@verdocs/web-sdk 5.0.52 → 5.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.css +4 -1
- package/dist/components/{p-edf89442.js → p-85b0a2e1.js} +2 -2
- package/dist/components/{p-edf89442.js.map → p-85b0a2e1.js.map} +1 -1
- package/dist/components/{p-bae61eb2.js → p-b6e5b0c3.js} +2 -2
- package/dist/components/p-b6e5b0c3.js.map +1 -0
- package/dist/components/verdocs-build.js +2 -2
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-toolbar-icon.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-b8ccd4e5.entry.js → p-31e15b7b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b8ccd4e5.entry.js.map → p-31e15b7b.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-227fdd3a.system.entry.js → p-7a4d7c71.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-227fdd3a.system.entry.js.map → p-7a4d7c71.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-8a6c7f95.system.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-bae61eb2.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"file":"verdocs-template-document-page.verdocs-toolbar-icon.entry.js","mappings":";;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,g3BAAg3B,CAAC;AACx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,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;SAC5B;KACF;IAED,IAAI;;QACF,MAAA,IAAI,CAAC,OAAO,0CAAE,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC5C,MAAA,IAAI,CAAC,cAAc,0CAAE,MAAM,GAAG,KAAK,CAAC,SAAQ,CAAC,CAAC;KAC/C;IAED,IAAI;;QACF,MAAA,IAAI,CAAC,OAAO,0CAAE,eAAe,CAAC,WAAW,CAAC,CAAC;KAC5C;;;;IAMD,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,KAAK,EAAE,EAAE,IACb,gFACoB,IAAI,CAAC,WAAW,EAClC,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE,IAAI,CAAC,IAAI,EACpB,YAAY,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAC/B,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAC1B,YAAY,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAC/B,MAAM,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EACzB,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,MAAM,GAAG,EAAoB,CAAC,GAC/C,EACF,4DAAK,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,SAAS,2BAAwB,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,OAAO,GAAG,EAAoB,CAAC,IAC9I,IAAI,CAAC,IAAI,EACV,iFAAuB,MAAM,EAAC,KAAK,EAAC,OAAO,GAAG,CAC1C,CACD,EACP;KACH;;;;;;","names":[],"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","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.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.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","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n display: inline-block;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"verdocs-template-document-page.verdocs-toolbar-icon.entry.js","mappings":";;;;;;;;;AAAA,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QAClB,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;SAC5B;KACF;IAED,IAAI;;QACF,MAAA,IAAI,CAAC,OAAO,0CAAE,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC5C,MAAA,IAAI,CAAC,cAAc,0CAAE,MAAM,GAAG,KAAK,CAAC,SAAQ,CAAC,CAAC;KAC/C;IAED,IAAI;;QACF,MAAA,IAAI,CAAC,OAAO,0CAAE,eAAe,CAAC,WAAW,CAAC,CAAC;KAC5C;;;;IAMD,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,KAAK,EAAE,EAAE,IACb,gFACoB,IAAI,CAAC,WAAW,EAClC,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE,IAAI,CAAC,IAAI,EACpB,YAAY,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAC/B,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAC1B,YAAY,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAC/B,MAAM,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EACzB,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,MAAM,GAAG,EAAoB,CAAC,GAC/C,EACF,4DAAK,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,SAAS,2BAAwB,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,OAAO,GAAG,EAAoB,CAAC,IAC9I,IAAI,CAAC,IAAI,EACV,iFAAuB,MAAM,EAAC,KAAK,EAAC,OAAO,GAAG,CAC1C,CACD,EACP;KACH;;;;;;","names":[],"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","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.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.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","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{c(r.next(e))}catch(e){a(e)}}function n(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?o(e.value):i(e.value).then(s,n)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(r=1,i&&(a=n[0]&2?i["return"]:n[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;if(i=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;i=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];i=0}finally{r=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-24c3207f.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,j as getControlStyles,g as getFieldId}from"./utils-bd656c37.js";import{S as Store}from"./Datastore-974a55a5.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsTemplateDocumentPageCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,r=t;o<r.length;o++){var i=r[o];var a=i.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){var r;return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,r;var i=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var c=e,l=c.xScale,d=c.yScale,u=c.templateId,p=c.editable,f=c.disabled,b=c.done,m=c.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"textarea":return h("verdocs-field-textarea",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"date":return h("verdocs-field-date",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"attachment":return h("verdocs-field-attachment",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"dropdown":return h("verdocs-field-dropdown",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"initial":return h("verdocs-field-initial",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"signature":return h("verdocs-field-signature",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"checkbox":return h("verdocs-field-checkbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"radio":return h("verdocs-field-radio",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"8163f7ebe7d2f3a13db305b411b454287a4b3729",class:{}},h("div",{key:"1782db14268643ad1620ebcd5efc6a27ff9fcc04","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"54c1bb4abc22a943051ba2df8b557e6c02fdabef",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"4d2c884923f2e79b375ffcfa2592cd914bead68c","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{c(r.next(e))}catch(e){a(e)}}function n(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?o(e.value):i(e.value).then(s,n)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(r=1,i&&(a=n[0]&2?i["return"]:n[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;if(i=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;i=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];i=0}finally{r=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-24c3207f.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,j as getControlStyles,g as getFieldId}from"./utils-bd656c37.js";import{S as Store}from"./Datastore-974a55a5.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsTemplateDocumentPageCss="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,r=t;o<r.length;o++){var i=r[o];var a=i.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){var r;return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,r;var i=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var c=e,l=c.xScale,d=c.yScale,u=c.templateId,p=c.editable,f=c.disabled,b=c.done,m=c.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"textarea":return h("verdocs-field-textarea",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"date":return h("verdocs-field-date",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"attachment":return h("verdocs-field-attachment",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"dropdown":return h("verdocs-field-dropdown",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"initial":return h("verdocs-field-initial",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"signature":return h("verdocs-field-signature",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"checkbox":return h("verdocs-field-checkbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"radio":return h("verdocs-field-radio",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"8163f7ebe7d2f3a13db305b411b454287a4b3729",class:{}},h("div",{key:"1782db14268643ad1620ebcd5efc6a27ff9fcc04","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"54c1bb4abc22a943051ba2df8b557e6c02fdabef",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"4d2c884923f2e79b375ffcfa2592cd914bead68c","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
|
2
2
|
//# sourceMappingURL=verdocs-template-document-page_2.entry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"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","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.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.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","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n display: inline-block;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"o7DAAA,IAAMA,+BAAiC,i3BACvC,IAAAC,kCAAeD,+B,ICkBFE,4BAA2B,WALxC,SAAAC,EAAAC,G,8EAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,gBAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMrBV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/ErB,KAAAsB,cAAwBtB,KAAKW,aAC7BX,KAAAuB,eAAyBvB,KAAKY,cAC9BZ,KAAAwB,aAAuBxB,KAAKW,aAC5BX,KAAAyB,cAAwBzB,KAAKY,cAC7BZ,KAAA0B,YAAsB1B,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA2B,sBAAwB,KACxB3B,KAAA4B,eAA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ACC,OAAQ,CAAC,EAAG,OAAS,I,EAO5FV,EAAApE,UAAAuB,qBAAA,WACE,GAAIxD,KAAKyG,eAAgB,CACvBzG,KAAKyG,eAAeO,UACpBhH,KAAKyG,eAAiB,I,GAI1BJ,EAAApE,UAAAgF,KAAA,W,SACExD,EAAAzD,KAAK4G,WAAO,MAAAnD,SAAA,SAAAA,EAAEyD,aAAa,YAAa,KACxC5B,EAAAtF,KAAKyG,kBAAc,MAAAnB,SAAA,SAAAA,EAAE6B,SAASC,OAAM,c,EAGtCf,EAAApE,UAAAoF,KAAA,W,OACE5D,EAAAzD,KAAK4G,WAAO,MAAAnD,SAAA,SAAAA,EAAE6D,gBAAgB,Y,EAOhCjB,EAAApE,UAAAkC,OAAA,eAAA1B,EAAAzC,KACE,OACEoE,EAACC,KAAI,CAAAkD,IAAA,2CAAChD,MAAO,IACXH,EAAA,OAAAmD,IAAA,8DACoBvH,KAAKgB,YACvBuD,MAAM,OACNiD,UAAWxH,KAAKuG,KAChBkB,aAAc,WAAM,OAAAhF,EAAKwE,MAAL,EACpBS,QAAS,WAAM,OAAAjF,EAAKwE,MAAL,EACfU,aAAc,WAAM,OAAAlF,EAAK4E,MAAL,EACpBO,OAAQ,WAAM,OAAAnF,EAAK4E,MAAL,EACdQ,IAAK,SAAAC,GAAE,OAAKrF,EAAKkE,OAASmB,CAAnB,IAET1D,EAAA,OAAAmD,IAAA,2CAAK7C,GAAI1E,KAAKgB,YAAa+G,KAAK,UAAUxD,MAAM,UAAS,wBAAwBvE,KAAKwG,UAAWqB,IAAK,SAAAC,GAAE,OAAKrF,EAAKmE,QAAUkB,CAApB,GACrG9H,KAAKsG,KACNlC,EAAA,OAAAmD,IAAA,+DAAuB,OAAOhD,MAAM,W,WAxEf,G","ignoreList":[]}
|
1
|
+
{"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"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","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.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.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","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"o7DAAA,IAAMA,+BAAiC,i3BACvC,IAAAC,kCAAeD,+B,ICkBFE,4BAA2B,WALxC,SAAAC,EAAAC,G,8EAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,gBAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMrBV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC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AAE,OAAKrF,EAAKmE,QAAUkB,CAApB,GACrG9H,KAAKsG,KACNlC,EAAA,OAAAmD,IAAA,+DAAuB,OAAOhD,MAAM,W,WAxEf,G","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-576f984d.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,j as n,g as p}from"./p-0c45b79c.js";import{S as h}from"./p-33300e3a.js";import{c as b}from"./p-68a5aaff.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const u="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";const m=u;const f=class{constructor(i){e(this,i);this.pageRendered=t(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=r.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}componentDidLoad(){this.resizeObserver=new ResizeObserver(c((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){if(this.loading){return i(o,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(o,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var o;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,o;const a=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:u,disabled:m,done:f,pageNumber:g}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((o=e["settings"])===null||o===void 0?void 0:o.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,multiline:l,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(s,null,r)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null)})))}get container(){return a(this)}};f.style=m;const g='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-576f984d.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,j as n,g as p}from"./p-0c45b79c.js";import{S as h}from"./p-33300e3a.js";import{c as b}from"./p-68a5aaff.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const u="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";const m=u;const f=class{constructor(i){e(this,i);this.pageRendered=t(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=r.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}componentDidLoad(){this.resizeObserver=new ResizeObserver(c((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){if(this.loading){return i(o,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(o,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var o;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,o;const a=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:u,disabled:m,done:f,pageNumber:g}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((o=e["settings"])===null||o===void 0?void 0:o.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,multiline:l,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(s,null,r)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null)})))}get container(){return a(this)}};f.style=m;const g='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';const v=g;const x=class{constructor(t){e(this,t);this.text="";this.icon="";this.placement="bottom";this.containerId=`verdocs-toolbar-icon-${Math.random().toString(36).substring(2,11)}`}componentDidLoad(){this.popperInstance=b(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}show(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((()=>{}))}hide(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")}render(){return i(o,{key:"8163f7ebe7d2f3a13db305b411b454287a4b3729",class:{}},i("div",{key:"1782db14268643ad1620ebcd5efc6a27ff9fcc04","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:()=>this.show(),onFocus:()=>this.show(),onMouseLeave:()=>this.hide(),onBlur:()=>this.hide(),ref:e=>this.iconEl=e}),i("div",{key:"54c1bb4abc22a943051ba2df8b557e6c02fdabef",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"4d2c884923f2e79b375ffcfa2592cd914bead68c","data-popper-arrow":"true",class:"arrow"})))}};x.style=v;export{f as verdocs_template_document_page,x as verdocs_toolbar_icon};
|
2
|
+
//# sourceMappingURL=p-31e15b7b.entry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","constructor","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","componentWillLoad","getTemplateDocumentPageDisplayUri","listenToTemplate","componentDidLoad","resizeObserver","ResizeObserver","throttle","entries","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"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","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.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.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","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n display: inline-block;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"mXAAA,MAAMA,EAAiC,i3BACvC,MAAAC,EAAeD,E,MCkBFE,EAA2B,MALxC,WAAAC,CAAAC,G,qDAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,EAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMrBV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,MAC/EpB,KAAAqB,cAAwBrB,KAAKW,aAC7BX,KAAAsB,eAAyBtB,KAAKY,cAC9BZ,KAAAuB,aAAuBvB,KAAKW,aAC5BX,KAAAwB,cAAwBxB,KAAKY,cAC7BZ,KAAAyB,YAAsBzB,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA0B,sBAAwB,KACxB1B,KAAA2B,eAAiB,GACjB3B,KAAA4B,OAAS,EACT5B,KAAA6B,OAAS,EAET7B,KAAA8B,QAAU,KACV9B,KAAA+B,SAA6B,I,CAEtC,uBAAMC,GACJhC,KAAK2B,qBAAuBM,EAAkCjC,KAAKE,SAAUF,KAAKS,WAAYT,KAAKU,YACnGV,KAAKkC,kB,CAGP,gBAAAC,GACEnC,KAAKoC,eAAiB,IAAIC,eACxBC,GA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ACNlC,EAAA,OAAAmD,IAAA,+DAAuB,OAAOhD,MAAM,W","ignoreList":[]}
|
1
|
+
{"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","constructor","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","componentWillLoad","getTemplateDocumentPageDisplayUri","listenToTemplate","componentDidLoad","resizeObserver","ResizeObserver","throttle","entries","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"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","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.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.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","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"mXAAA,MAAMA,EAAiC,i3BACvC,MAAAC,EAAeD,E,MCkBFE,EAA2B,MALxC,WAAAC,CAAAC,G,qDAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,EAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAq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