@verdocs/web-sdk 6.2.4 → 6.2.6
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-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +1 -0
- package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +3 -2
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +1 -0
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +3 -2
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
- package/dist/components/{p-DK8_N2Na.js → p-80nhsQfQ.js} +14 -14
- package/dist/components/{p-DK8_N2Na.js.map → p-80nhsQfQ.js.map} +1 -1
- package/dist/components/{p-L3HpKTaM.js → p-BJqJsTbt.js} +3 -3
- package/dist/components/{p-L3HpKTaM.js.map → p-BJqJsTbt.js.map} +1 -1
- package/dist/components/{p-DSO1_d48.js → p-BPPiqx8Q.js} +3 -3
- package/dist/components/{p-DSO1_d48.js.map → p-BPPiqx8Q.js.map} +1 -1
- package/dist/components/{p-C4lOZS20.js → p-BiqAkA9R.js} +3 -3
- package/dist/components/{p-C4lOZS20.js.map → p-BiqAkA9R.js.map} +1 -1
- package/dist/components/{p-BVuTqQTL.js → p-BiuMDRxW.js} +3 -3
- package/dist/components/{p-BVuTqQTL.js.map → p-BiuMDRxW.js.map} +1 -1
- package/dist/components/{p-6s2A2xbN.js → p-CA_Xcyt7.js} +17 -16
- package/dist/components/p-CA_Xcyt7.js.map +1 -0
- package/dist/components/{p-CcIaiNEM.js → p-Ck_1uk0F.js} +3 -3
- package/dist/components/{p-CcIaiNEM.js.map → p-Ck_1uk0F.js.map} +1 -1
- package/dist/components/{p-BXFf3Lpk.js → p-CnRyZDAM.js} +3 -3
- package/dist/components/{p-BXFf3Lpk.js.map → p-CnRyZDAM.js.map} +1 -1
- package/dist/components/{p-mjn4Ftey.js → p-CzUVVFEJ.js} +13 -13
- package/dist/components/{p-mjn4Ftey.js.map → p-CzUVVFEJ.js.map} +1 -1
- package/dist/components/{p-TkHAxPB_.js → p-Da1nfhXq.js} +3 -2
- package/dist/components/p-Da1nfhXq.js.map +1 -0
- package/dist/components/{p-B4UtR_2c.js → p-IbPNQm1I.js} +3 -3
- package/dist/components/{p-B4UtR_2c.js.map → p-IbPNQm1I.js.map} +1 -1
- package/dist/components/{p-DfTz53m-.js → p-LPa2SLXL.js} +3 -3
- package/dist/components/{p-DfTz53m-.js.map → p-LPa2SLXL.js.map} +1 -1
- package/dist/components/{p-CtbvYEGE.js → p-gGtgKfmC.js} +3 -3
- package/dist/components/{p-CtbvYEGE.js.map → p-gGtgKfmC.js.map} +1 -1
- package/dist/components/{p-B0MvlQO2.js → p-jXH2SygA.js} +3 -3
- package/dist/components/{p-B0MvlQO2.js.map → p-jXH2SygA.js.map} +1 -1
- package/dist/components/verdocs-build.js +14 -14
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +1 -1
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-field-payment.js +1 -1
- package/dist/components/verdocs-field-radio.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-field-textarea.js +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-field-properties.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/esm/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.js.map +1 -1
- package/dist/esm/verdocs-checkbox_5.entry.js +1 -0
- package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +3 -2
- package/dist/esm-es5/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-74f5a0bd.entry.js → p-77a3e9ea.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-77a3e9ea.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-df9a63c8.system.entry.js → p-77a96b42.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-df9a63c8.system.entry.js.map → p-77a96b42.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BSxnvcXp.system.js +1 -1
- package/dist/verdocs-web-sdk/p-L9recsMg.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-a4af0218.system.entry.js → p-bd7e0e8f.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-bd7e0e8f.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-f4d573b8.entry.js → p-da01f5fd.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-da01f5fd.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-Cdv-0jBY.system.js.map → p-gJaz09Zo.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-checkbox.verdocs-component-error.verdocs-loader.verdocs-select-input.verdocs-template-field-properties.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-6s2A2xbN.js.map +0 -1
- package/dist/components/p-TkHAxPB_.js.map +0 -1
- package/dist/verdocs-web-sdk/p-74f5a0bd.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-BYcAVzPM.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-a4af0218.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f4d573b8.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-CcIaiNEM.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,osEAAosE;;ACatuE,MAAM,aAAa,GAAG,CAAA,qSAAA,CAAuS;AAE7T,MAAM,YAAY,GAAG,CAAA,yVAAA,CAA2V;MAUnW,sBAAsB,iBAAAA,kBAAA,CAAA,MAAA,sBAAA,SAAAC,CAAA,CAAA;AALnC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AAQE;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;AAEG;AACoB,QAAA,IAAS,CAAA,SAAA,GAAW,EAAE;AAE7C;;;AAGG;AACK,QAAA,IAAK,CAAA,KAAA,GAAsC,IAAI;AAEvD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;;AAGG;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IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EACrC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACzC,MAAM,EAAE,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,GACvC,CACa,CAClB,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-attachment/verdocs-field-attachment.scss?tag=verdocs-field-attachment","src/components/fields/verdocs-field-attachment/verdocs-field-attachment.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-attachment {\n font-family: $verdocs-primary-font;\n box-sizing: border-box;\n width: 24px;\n height: 24px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n svg {\n width: 16px;\n height: 16px;\n }\n\n &.disabled svg {\n opacity: 0.5;\n\n span {\n cursor: inherit;\n }\n }\n\n .attach {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.required {\n .attach {\n border: 1px solid $verdocs-red-1;\n }\n }\n\n verdocs-button-panel {\n top: 1px;\n left: -19px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import {ITemplateField, getRGBA, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, State, Fragment, Element} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\nexport interface ISelectedFile {\n lastModified: number;\n size: number;\n type: string;\n name: string;\n data: string;\n}\n\nconst PaperclipIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13\" /></svg>`;\n\nconst AttachedIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#339933\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-file-check\"><path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"/><path d=\"M14 2v4a2 2 0 0 0 2 2h4\"/><path d=\"m9 15 2 2 4-4\"/></svg>`;\n\n/**\n * Displays an attachment field.\n */\n@Component({\n tag: 'verdocs-field-attachment',\n styleUrl: 'verdocs-field-attachment.scss',\n shadow: false,\n})\nexport class VerdocsFieldAttachment {\n @Element() el: HTMLElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when a file is attached by the signer.\n */\n @Event({composed: true}) attached: EventEmitter<ISelectedFile>;\n\n /**\n * Event fired when the field is deleted. Note that this is for the FIELD (e.g. in\n * Build) not for any attachments (during signing).\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n @State() dialogOpen?: boolean = false;\n @State() selectedFile?: ISelectedFile | null = null;\n @State() focused = false;\n\n @Method()\n async focusField() {\n // Our input field is fake, so we fake the flash too\n this.focused = true;\n this.dialogOpen = true;\n setTimeout(() => {\n this.focused = false;\n }, 500);\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n handleShow() {\n this.dialogOpen = true;\n }\n\n handleUploadNext = (e: any) => {\n console.log('Upload next', e);\n this.dialogOpen = false;\n this.selectedFile = e.detail[0];\n this.attached?.emit(e.detail[0]);\n };\n\n handleUploadRemove = (e: any) => {\n e.preventDefault();\n e.stopPropagation();\n this.dialogOpen = false;\n this.selectedFile = null;\n this.deleted?.emit({fieldName: this.fieldname});\n };\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, value = '', label = '', readonly = false, settings = {}} = field || {};\n const backgroundColor = getRGBA(index);\n\n const hasFile = value || !!this.selectedFile;\n\n if (done) {\n return (\n <Host class={{done}}>\n <div class=\"attach\" innerHTML={hasFile ? AttachedIcon : PaperclipIcon} />\n </Host>\n );\n }\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n\n <div class=\"attach\" innerHTML={hasFile ? AttachedIcon : PaperclipIcon} onClick={() => !disabled && !readonly && this.handleShow()} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Attachments allow the user to attach their own documents (e.g. resumes or disclosures) to a signing flow.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n\n {this.dialogOpen && (\n <verdocs-portal>\n <verdocs-upload-dialog\n existingFile={settings}\n onNext={e => this.handleUploadNext(e)}\n onRemove={e => this.handleUploadRemove(e)}\n onExit={() => (this.dialogOpen = false)}\n />\n </verdocs-portal>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-Ck_1uk0F.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,osEAAosE;;ACatuE,MAAM,aAAa,GAAG,CAAA,qSAAA,CAAuS;AAE7T,MAAM,YAAY,GAAG,CAAA,yVAAA,CAA2V;MAUnW,sBAAsB,iBAAAA,kBAAA,CAAA,MAAA,sBAAA,SAAAC,CAAA,CAAA;AALnC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AAQE;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;AAEG;AACoB,QAAA,IAAS,CAAA,SAAA,GAAW,EAAE;AAE7C;;;AAGG;AACK,QAAA,IAAK,CAAA,KAAA,GAAsC,IAAI;AAEvD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;;AAGG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,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CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACzC,MAAM,EAAE,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,GACvC,CACa,CAClB,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-attachment/verdocs-field-attachment.scss?tag=verdocs-field-attachment","src/components/fields/verdocs-field-attachment/verdocs-field-attachment.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-attachment {\n font-family: $verdocs-primary-font;\n box-sizing: border-box;\n width: 24px;\n height: 24px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n svg {\n width: 16px;\n height: 16px;\n }\n\n &.disabled svg {\n opacity: 0.5;\n\n span {\n cursor: inherit;\n }\n }\n\n .attach {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.required {\n .attach {\n border: 1px solid $verdocs-red-1;\n }\n }\n\n verdocs-button-panel {\n top: 1px;\n left: -19px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import {ITemplateField, getRGBA, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, State, Fragment, Element} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\nexport interface ISelectedFile {\n lastModified: number;\n size: number;\n type: string;\n name: string;\n data: string;\n}\n\nconst PaperclipIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13\" /></svg>`;\n\nconst AttachedIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#339933\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-file-check\"><path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"/><path d=\"M14 2v4a2 2 0 0 0 2 2h4\"/><path d=\"m9 15 2 2 4-4\"/></svg>`;\n\n/**\n * Displays an attachment field.\n */\n@Component({\n tag: 'verdocs-field-attachment',\n styleUrl: 'verdocs-field-attachment.scss',\n shadow: false,\n})\nexport class VerdocsFieldAttachment {\n @Element() el: HTMLElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when a file is attached by the signer.\n */\n @Event({composed: true}) attached: EventEmitter<ISelectedFile>;\n\n /**\n * Event fired when the field is deleted. Note that this is for the FIELD (e.g. in\n * Build) not for any attachments (during signing).\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n @State() dialogOpen?: boolean = false;\n @State() selectedFile?: ISelectedFile | null = null;\n @State() focused = false;\n\n @Method()\n async focusField() {\n // Our input field is fake, so we fake the flash too\n this.focused = true;\n this.dialogOpen = true;\n setTimeout(() => {\n this.focused = false;\n }, 500);\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n handleShow() {\n this.dialogOpen = true;\n }\n\n handleUploadNext = (e: any) => {\n console.log('Upload next', e);\n this.dialogOpen = false;\n this.selectedFile = e.detail[0];\n this.attached?.emit(e.detail[0]);\n };\n\n handleUploadRemove = (e: any) => {\n e.preventDefault();\n e.stopPropagation();\n this.dialogOpen = false;\n this.selectedFile = null;\n this.deleted?.emit({fieldName: this.fieldname});\n };\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, value = '', label = '', readonly = false, settings = {}} = field || {};\n const backgroundColor = getRGBA(index);\n\n const hasFile = value || !!this.selectedFile;\n\n if (done) {\n return (\n <Host class={{done}}>\n <div class=\"attach\" innerHTML={hasFile ? AttachedIcon : PaperclipIcon} />\n </Host>\n );\n }\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n\n <div class=\"attach\" innerHTML={hasFile ? AttachedIcon : PaperclipIcon} onClick={() => !disabled && !readonly && this.handleShow()} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Attachments allow the user to attach their own documents (e.g. resumes or disclosures) to a signing flow.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n\n {this.dialogOpen && (\n <verdocs-portal>\n <verdocs-upload-dialog\n existingFile={settings}\n onNext={e => this.handleUploadNext(e)}\n onRemove={e => this.handleUploadRemove(e)}\n onExit={() => (this.dialogOpen = false)}\n />\n </verdocs-portal>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -10,7 +10,7 @@ import { d as defineCustomElement$6 } from './p-DGJlf5J_.js';
|
|
|
10
10
|
import { d as defineCustomElement$5 } from './p-D_QT5uZk.js';
|
|
11
11
|
import { d as defineCustomElement$4 } from './p-C3iwT41e.js';
|
|
12
12
|
import { d as defineCustomElement$3 } from './p-kvTSiSQ0.js';
|
|
13
|
-
import { d as defineCustomElement$2 } from './p-
|
|
13
|
+
import { d as defineCustomElement$2 } from './p-Da1nfhXq.js';
|
|
14
14
|
import { d as defineCustomElement$1 } from './p-BvDqCFDj.js';
|
|
15
15
|
|
|
16
16
|
const verdocsFieldTextareaCss = "@-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-field-textarea{width:150px;height:15px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textarea textarea{cursor:inherit;width:100%;height:100%;resize:none;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textarea textarea.hide{display:none}verdocs-field-textarea.disabled textarea{opacity:0.5}verdocs-field-textarea label{top:-14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-textarea.required{border:1px solid rgb(204, 0, 0)}verdocs-field-textarea.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-textarea verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textarea verdocs-button-panel[data-active],verdocs-field-textarea verdocs-button-panel:hover{opacity:1}verdocs-field-textarea verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textarea verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textarea .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-textarea .settings-icon svg{fill:#707ae5}verdocs-field-textarea .settings-icon:hover{opacity:1}@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)}}";
|
|
@@ -244,6 +244,6 @@ function defineCustomElement() {
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
export { VerdocsFieldTextarea as V, defineCustomElement as d };
|
|
247
|
-
//# sourceMappingURL=p-
|
|
247
|
+
//# sourceMappingURL=p-CnRyZDAM.js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G;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,0DAA0D,EAAA,CACpE,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-textarea/verdocs-field-textarea.scss?tag=verdocs-field-textarea","src/components/fields/verdocs-field-textarea/verdocs-field-textarea.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-textarea {\n width: 150px;\n height: 15px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n box-sizing: border-box;\n background-color: transparent;\n transform-origin: bottom left;\n font-family: $verdocs-primary-font;\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n textarea {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n width: 100%;\n height: 100%;\n resize: none;\n border: none;\n outline: none;\n padding: 0 3px;\n font-size: 11px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n\n &.hide {\n display: none;\n }\n }\n\n &.disabled textarea {\n opacity: 0.5;\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import interact from 'interactjs';\nimport {IEnvelopeField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {ITemplateField, updateField, getRGBA} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, Element, Fragment, State} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a multi-line text input field. Reminder: the \"position\" of the field is specified\n * as the BOTTOM-LEFT corner.\n */\n@Component({\n tag: 'verdocs-field-textarea',\n styleUrl: 'verdocs-field-textarea.scss',\n shadow: false,\n})\nexport class VerdocsFieldTextarea {\n @Element() el: HTMLElement;\n private inputEl: HTMLTextAreaElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n * This component self-manages its resize (width) behavior when in edit-template mode, and uses\n * this endpoint to save changes.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n @Method()\n async focusField() {\n this.inputEl.focus();\n }\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n @State() focused?: boolean = false;\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n if (this.editable) {\n interact(this.el).resizable({\n edges: {top: true, bottom: true, left: true, right: true},\n listeners: {\n start: this.handleResizeStart.bind(this),\n move: this.handleResize.bind(this),\n end: this.handleResizeEnd.bind(this),\n },\n });\n }\n }\n\n handleResizeStart(e: any) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleResize(e: any) {\n let {x = 0, y = 0, h = 0} = e.target.dataset;\n let {width, height} = e.rect;\n\n x = (parseFloat(x) || 0) + e.deltaRect.left;\n y = (parseFloat(y) || 0) + e.deltaRect.top;\n h = (parseFloat(h) || 0) + e.deltaRect.height;\n\n Object.assign(e.target.style, {\n width: `${width}px`,\n height: `${height}px`,\n transform: `translate(${x}px, ${y + h}px)`,\n });\n\n Object.assign(e.target.dataset, {x, y, h});\n }\n\n handleResizeEnd(e: any) {\n const {source, sourceid, fieldname} = this;\n const {field} = Store.getField(source, sourceid, fieldname, this.field);\n if (!field) {\n return;\n }\n\n const [translateX, translateY] = e.target.style.transform.split('(')[1].split(')')[0].split(',').map(parseFloat);\n\n const width = Math.round(parseFloat(e.target.style.width) / this.xscale);\n const height = Math.round(parseFloat(e.target.style.height) / this.yscale);\n const x = Math.round(field.x + translateX / this.xscale);\n const y = Math.round(field.y - translateY / this.yscale);\n\n updateField(this.endpoint, this.sourceid, this.fieldname, {x, y, width, height})\n .then(field => {\n this.settingsChanged?.emit({fieldName: this.fieldname, field});\n Object.assign(e.target.dataset, {x: 0, y: 0, h: 0});\n })\n .catch(e => console.log('Field update failed', e));\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, placeholder = '', value = '', label = '', readonly = false} = field || {};\n const backgroundColor = getRGBA(index);\n\n if (done) {\n return <Host class={{done}}>{value}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n\n <textarea\n name={fieldname}\n required={required}\n placeholder={placeholder}\n disabled={readonly || disabled}\n ref={el => (this.inputEl = el)}\n onFocus={() => (this.focused = true)}\n onBlur={() => (this.focused = false)}\n >\n {value}\n </textarea>\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Text areas may be used to create multi-line text fields.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-CnRyZDAM.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,kwEAAkwE;;MCgBrxE,oBAAoB,iBAAAA,kBAAA,CAAA,MAAA,oBAAA,SAAAC,CAAA,CAAA;AALjC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AASE;;;;AAIG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;AAEG;AACoB,QAAA,IAAS,CAAA,SAAA,GAAW,EAAE;AAE7C;;;AAGG;AACK,QAAA,IAAK,CAAA,KAAA,GAAsC,IAAI;AAEvD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEj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gB,MAAM,EAAE,CAAA,+BAAA,EAAkC,SAAS,CAAA,CAAE,EAAE,WAAW,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAAA,EACxH,CACE,CAAA,mCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAC/C,QAAQ,EAAE,MAAK;;AACb,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC;AAC1C,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,iBAAiB,EAAE,CAAC,IAAG;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,0DAA0D,EAAA,CACpE,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-textarea/verdocs-field-textarea.scss?tag=verdocs-field-textarea","src/components/fields/verdocs-field-textarea/verdocs-field-textarea.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-textarea {\n width: 150px;\n height: 15px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n box-sizing: border-box;\n background-color: transparent;\n transform-origin: bottom left;\n font-family: $verdocs-primary-font;\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n textarea {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n width: 100%;\n height: 100%;\n resize: none;\n border: none;\n outline: none;\n padding: 0 3px;\n font-size: 11px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n\n &.hide {\n display: none;\n }\n }\n\n &.disabled textarea {\n opacity: 0.5;\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import interact from 'interactjs';\nimport {IEnvelopeField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {ITemplateField, updateField, getRGBA} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, Element, Fragment, State} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a multi-line text input field. Reminder: the \"position\" of the field is specified\n * as the BOTTOM-LEFT corner.\n */\n@Component({\n tag: 'verdocs-field-textarea',\n styleUrl: 'verdocs-field-textarea.scss',\n shadow: false,\n})\nexport class VerdocsFieldTextarea {\n @Element() el: HTMLElement;\n private inputEl: HTMLTextAreaElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n * This component self-manages its resize (width) behavior when in edit-template mode, and uses\n * this endpoint to save changes.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n @Method()\n async focusField() {\n this.inputEl.focus();\n }\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n @State() focused?: boolean = false;\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n if (this.editable) {\n interact(this.el).resizable({\n edges: {top: true, bottom: true, left: true, right: true},\n listeners: {\n start: this.handleResizeStart.bind(this),\n move: this.handleResize.bind(this),\n end: this.handleResizeEnd.bind(this),\n },\n });\n }\n }\n\n handleResizeStart(e: any) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleResize(e: any) {\n let {x = 0, y = 0, h = 0} = e.target.dataset;\n let {width, height} = e.rect;\n\n x = (parseFloat(x) || 0) + e.deltaRect.left;\n y = (parseFloat(y) || 0) + e.deltaRect.top;\n h = (parseFloat(h) || 0) + e.deltaRect.height;\n\n Object.assign(e.target.style, {\n width: `${width}px`,\n height: `${height}px`,\n transform: `translate(${x}px, ${y + h}px)`,\n });\n\n Object.assign(e.target.dataset, {x, y, h});\n }\n\n handleResizeEnd(e: any) {\n const {source, sourceid, fieldname} = this;\n const {field} = Store.getField(source, sourceid, fieldname, this.field);\n if (!field) {\n return;\n }\n\n const [translateX, translateY] = e.target.style.transform.split('(')[1].split(')')[0].split(',').map(parseFloat);\n\n const width = Math.round(parseFloat(e.target.style.width) / this.xscale);\n const height = Math.round(parseFloat(e.target.style.height) / this.yscale);\n const x = Math.round(field.x + translateX / this.xscale);\n const y = Math.round(field.y - translateY / this.yscale);\n\n updateField(this.endpoint, this.sourceid, this.fieldname, {x, y, width, height})\n .then(field => {\n this.settingsChanged?.emit({fieldName: this.fieldname, field});\n Object.assign(e.target.dataset, {x: 0, y: 0, h: 0});\n })\n .catch(e => console.log('Field update failed', e));\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, placeholder = '', value = '', label = '', readonly = false} = field || {};\n const backgroundColor = getRGBA(index);\n\n if (done) {\n return <Host class={{done}}>{value}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n\n <textarea\n name={fieldname}\n required={required}\n placeholder={placeholder}\n disabled={readonly || disabled}\n ref={el => (this.inputEl = el)}\n onFocus={() => (this.focused = true)}\n onBlur={() => (this.focused = false)}\n >\n {value}\n </textarea>\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Text areas may be used to create multi-line text fields.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -6,16 +6,16 @@ import { d as defineCustomElement$o } from './p-RQJ9uyyW.js';
|
|
|
6
6
|
import { d as defineCustomElement$n } from './p-wj1u5UNC.js';
|
|
7
7
|
import { d as defineCustomElement$m } from './p-KqTfG8Kf.js';
|
|
8
8
|
import { d as defineCustomElement$l } from './p-CBRYaKLM.js';
|
|
9
|
-
import { d as defineCustomElement$k } from './p-
|
|
10
|
-
import { d as defineCustomElement$j } from './p-
|
|
11
|
-
import { d as defineCustomElement$i } from './p-
|
|
12
|
-
import { d as defineCustomElement$h } from './p-
|
|
13
|
-
import { d as defineCustomElement$g } from './p-
|
|
14
|
-
import { d as defineCustomElement$f } from './p-
|
|
15
|
-
import { d as defineCustomElement$e } from './p-
|
|
16
|
-
import { d as defineCustomElement$d } from './p-
|
|
17
|
-
import { d as defineCustomElement$c } from './p-
|
|
18
|
-
import { d as defineCustomElement$b } from './p-
|
|
9
|
+
import { d as defineCustomElement$k } from './p-Ck_1uk0F.js';
|
|
10
|
+
import { d as defineCustomElement$j } from './p-gGtgKfmC.js';
|
|
11
|
+
import { d as defineCustomElement$i } from './p-LPa2SLXL.js';
|
|
12
|
+
import { d as defineCustomElement$h } from './p-BiuMDRxW.js';
|
|
13
|
+
import { d as defineCustomElement$g } from './p-jXH2SygA.js';
|
|
14
|
+
import { d as defineCustomElement$f } from './p-BPPiqx8Q.js';
|
|
15
|
+
import { d as defineCustomElement$e } from './p-BJqJsTbt.js';
|
|
16
|
+
import { d as defineCustomElement$d } from './p-CnRyZDAM.js';
|
|
17
|
+
import { d as defineCustomElement$c } from './p-IbPNQm1I.js';
|
|
18
|
+
import { d as defineCustomElement$b } from './p-BiqAkA9R.js';
|
|
19
19
|
import { d as defineCustomElement$a } from './p-DGJlf5J_.js';
|
|
20
20
|
import { d as defineCustomElement$9 } from './p-CBfSBOmz.js';
|
|
21
21
|
import { d as defineCustomElement$8 } from './p-D_QT5uZk.js';
|
|
@@ -23,7 +23,7 @@ import { d as defineCustomElement$7 } from './p-BUDGHfvB.js';
|
|
|
23
23
|
import { d as defineCustomElement$6 } from './p-C3iwT41e.js';
|
|
24
24
|
import { d as defineCustomElement$5 } from './p-kvTSiSQ0.js';
|
|
25
25
|
import { d as defineCustomElement$4 } from './p-LeCnrgBv.js';
|
|
26
|
-
import { d as defineCustomElement$3 } from './p-
|
|
26
|
+
import { d as defineCustomElement$3 } from './p-Da1nfhXq.js';
|
|
27
27
|
import { d as defineCustomElement$2 } from './p-BvDqCFDj.js';
|
|
28
28
|
import { d as defineCustomElement$1 } from './p-9Csbf-tN.js';
|
|
29
29
|
|
|
@@ -389,6 +389,6 @@ function defineCustomElement() {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
export { VerdocsTemplateDocumentPage as V, defineCustomElement as d };
|
|
392
|
-
//# sourceMappingURL=p-
|
|
392
|
+
//# sourceMappingURL=p-CzUVVFEJ.js.map
|
|
393
393
|
|
|
394
|
-
//# sourceMappingURL=p-
|
|
394
|
+
//# sourceMappingURL=p-CzUVVFEJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-mjn4Ftey.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,g3BAAg3B;;MCmB14B,2BAA2B,iBAAAA,kBAAA,CAAA,MAAA,2BAAA,SAAAC,CAAA,CAAA;AALxC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAKjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAI,CAAA,IAAA,GAAG,KAAK;AAEpB;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAE/B;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-CzUVVFEJ.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,g3BAAg3B;;MCmB14B,2BAA2B,iBAAAA,kBAAA,CAAA,MAAA,2BAAA,SAAAC,CAAA,CAAA;AALxC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAKjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAI,CAAA,IAAA,GAAG,KAAK;AAEpB;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAE/B;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAE/B;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,CAAC;AAE9B;;;AAGG;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -134,6 +134,7 @@ const VerdocsTemplateFieldProperties = /*@__PURE__*/ proxyCustomElement(class Ve
|
|
|
134
134
|
name: this.name,
|
|
135
135
|
role_name: this.roleName,
|
|
136
136
|
required: this.required,
|
|
137
|
+
readonly: this.readonly,
|
|
137
138
|
label: this.label,
|
|
138
139
|
group: this.group,
|
|
139
140
|
placeholder: this.placeholder,
|
|
@@ -313,6 +314,6 @@ function defineCustomElement() {
|
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
export { VerdocsTemplateFieldProperties as V, defineCustomElement as d };
|
|
316
|
-
//# sourceMappingURL=p-
|
|
317
|
+
//# sourceMappingURL=p-Da1nfhXq.js.map
|
|
317
318
|
|
|
318
|
-
//# sourceMappingURL=p-
|
|
319
|
+
//# sourceMappingURL=p-Da1nfhXq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-Da1nfhXq.js","mappings":";;;;;;;;;;;;AAAA,MAAM,iCAAiC,GAAG,wrKAAwrK;;ACKluK,MAAM,UAAU,GAAG,CAAC,GAAW,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAE9E,MAAM,SAA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A,EAC3H,CAAA,CAAA,gBAAA,EAAA,EAAgB,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAA,CAAI,CAC5J,CACD,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.scss?tag=verdocs-template-field-properties","src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-field-properties {\n padding: 20px;\n display: block;\n border-radius: 4px;\n background: #ffffff;\n border: 1px solid #ccc;\n font-family: $verdocs-primary-font;\n box-shadow: 2px 2px 10px 0 #0000001f;\n\n @media all and (max-width: 600px) {\n padding: 10px;\n transform: scale(0.8);\n }\n\n .buttons {\n display: flex;\n margin-top: 30px;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n verdocs-button {\n margin-left: 16px;\n }\n }\n\n form .row {\n display: flex;\n column-gap: 15px;\n margin: 0 0 10px 0;\n align-items: center;\n flex-direction: row;\n\n .input-label {\n display: block;\n color: $label-color-light;\n font-weight: 700;\n font-size: 14px;\n margin: 0 0 4px 0;\n flex: 0 0 100px;\n }\n }\n\n verdocs-select-input {\n flex: 1;\n margin: 0;\n }\n\n verdocs-text-input {\n margin: 0;\n flex: 1;\n\n label {\n margin: 0;\n display: flex;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n }\n\n .input-label {\n flex: 0 0 100px;\n }\n\n input {\n flex: 1;\n display: flex;\n }\n }\n\n .checkbox-wrapper {\n flex: 1;\n display: flex;\n }\n\n .delete-button {\n height: 34px;\n display: flex;\n cursor: pointer;\n background: none;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #999;\n justify-content: center;\n\n &:active {\n background: #f3f3f3;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n }\n\n h6 {\n flex: 1;\n display: flex;\n font-size: 16px;\n font-weight: bold;\n margin: 0 0 8px 0;\n flex-direction: row;\n color: $verdocs-grey-0;\n\n .help-icon {\n opacity: 0.5;\n\n &:hover {\n opacity: 1;\n cursor: pointer;\n }\n }\n }\n\n .instructions {\n }\n\n .row-header {\n gap: 15px;\n display: flex;\n flex-direction: row;\n\n h6 {\n margin-bottom: 0;\n }\n\n verdocs-help-icon {\n transform: scale(0.85);\n\n svg {\n margin-bottom: -5px;\n }\n }\n\n .add-button {\n margin: 0;\n padding: 0;\n border: none;\n opacity: 0.5;\n cursor: pointer;\n background: none;\n\n &:hover {\n opacity: 1;\n }\n\n svg {\n width: 32px;\n height: 32px;\n }\n }\n }\n\n .options-header {\n gap: 10px;\n margin: 0 0 5px 0;\n display: flex;\n color: #ffffff;\n font-size: 14px;\n padding: 5px 8px;\n font-weight: 700;\n text-align: center;\n flex-direction: row;\n justify-content: center;\n background-color: #333333;\n }\n\n .options-header-label {\n display: flex;\n flex: 1;\n font-weight: 700;\n font-size: 14px;\n }\n\n .option-row {\n margin: 15px 0;\n\n .remove-button {\n height: 28px;\n display: flex;\n cursor: pointer;\n background: none;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #999;\n justify-content: center;\n\n &:active {\n background: #f3f3f3;\n }\n\n &:hover {\n svg {\n stroke: rgb(165, 0, 33);\n }\n }\n\n svg {\n width: 20px;\n height: 20px;\n stroke: #333333;\n }\n }\n }\n\n .options {\n background: #f3f3f3;\n padding: 0 0 1px 0;\n\n .row-header,\n .option-row {\n padding: 0 10px;\n }\n\n .add-option-button {\n border-radius: 5px;\n border: 1px solid #cccccc;\n background: $verdocs-grey-blue;\n color: #ffffff;\n padding: 3px 8px;\n }\n\n .option-row .input-element {\n font-size: 14px;\n }\n\n verdocs-help-icon {\n opacity: 1;\n transform: scale(0.8);\n\n svg {\n fill: #ffffff;\n }\n }\n }\n}\n","import {Component, h, Element, Event, EventEmitter, Prop, State, Host} from '@stencil/core';\nimport {deleteField, getTemplate, type ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst TrashIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#a50021\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0\" /></svg>`;\n\nconst HelpIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z\"/></svg>';\n\n/**\n * Displays an edit form that allows the user to adjust a field's settings.\n */\n@Component({\n tag: 'verdocs-template-field-properties',\n styleUrl: 'verdocs-template-field-properties.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFieldProperties {\n private templateListenerId = null;\n\n @Element()\n el: any;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * The field to configure.\n */\n @Prop({mutable: true}) fieldName: string = '';\n\n /**\n * If specified, the properties card will have a \"back\" side with the help text as its content.\n */\n @Prop() helpText?: string = '';\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) close: EventEmitter;\n\n /**\n * Event fired when the user deletes the role. The parent should update its UI to reflect the removal. When this event is emitted,\n * the role will have already been deleted server-side.\n */\n @Event({composed: true}) delete: EventEmitter<{templateId: string; roleName: string}>;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() dirty: boolean = false;\n @State() label = '';\n @State() type = 'textbox' as TFieldType;\n @State() name = '';\n @State() required = false;\n @State() readonly = false;\n @State() roleName = '';\n @State() group = '';\n @State() fieldType = '';\n @State() options = [];\n @State() placeholder = '';\n @State() defaultValue = '';\n @State() showingHelp = false;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n this.resetForm();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELD PROPERTIES] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.fieldName) {\n console.error(`[FIELD PROPERTIES] Missing required field name`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELD PROPERTIES] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELD PROPERTIES] Error loading template', e);\n this.loading = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n resetForm() {\n const field = (this.template?.fields || []).find(field => field.name === this.fieldName);\n if (!field) {\n console.log(`[FIELD PROPERTIES] Unable to find field \"${this.fieldName}\" in fields`);\n return;\n }\n\n this.type = field.type;\n this.name = field.name;\n this.label = field.label;\n this.group = field.group;\n this.roleName = field.role_name;\n this.required = field.required;\n this.readonly = field.readonly;\n this.fieldType = field.type;\n this.options = field.options || [];\n this.placeholder = field.placeholder || '';\n this.defaultValue = field.default || '';\n this.dirty = false;\n this.loading = false;\n this.cleanupOptions();\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n\n this.resetForm();\n this.close?.emit();\n document.getElementById('verdocs-template-field-properties')?.remove();\n }\n\n handleSave(e: any) {\n e.stopPropagation();\n const newProperties = {\n name: this.name,\n role_name: this.roleName,\n required: this.required,\n readonly: this.readonly,\n label: this.label,\n group: this.group,\n placeholder: this.placeholder,\n default: this.defaultValue,\n options: this.options,\n } as Partial<ITemplateField>;\n\n this.cleanupOptions();\n updateField(this.endpoint, this.templateId, this.fieldName, newProperties)\n .then(updatedField => {\n console.log('[FIELD PROPERTIES] Updated', updatedField);\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === this.fieldName);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n Store.updateTemplate(this.templateId, newTemplate);\n this.settingsChanged?.emit({fieldName: this.fieldName, field: updatedField});\n this.close?.emit();\n\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(() => {\n console.log('[FIELD PROPERTIES] Update failed', e);\n });\n }\n\n async handleDelete(e: any) {\n e.stopPropagation();\n deleteField(this.endpoint, this.templateId, this.fieldName)\n .then(() => {\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields = newTemplate.fields.filter(field => field.name !== this.fieldName);\n Store.updateTemplate(this.templateId, newTemplate);\n this.delete?.emit({templateId: this.templateId, roleName: this.roleName});\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(e => {\n console.log('[FIELD PROPERTIES] Deletion error', e);\n });\n }\n\n cleanupOptions() {\n this.options = [...this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '')];\n if (!this.options.find(opt => !opt.id && !opt.label)) {\n this.options = [...this.options, {id: '', label: ''}];\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n // This is meant to be a companion for larger visual experiences so we just go blank on errors for now.\n if (!this.endpoint.session || !(this.template?.fields || []).some(field => field.name === this.fieldName)) {\n return <Host class=\"empty\" />;\n }\n\n if (this.helpText && this.showingHelp) {\n return (\n <Host>\n <h6>\n {capitalize(this.fieldType)} Settings <div style={{flex: '1'}} />\n <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = false)} />\n </h6>\n\n <p class=\"instructions\" innerHTML={this.helpText} />\n </Host>\n );\n }\n\n const hasOptions = this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '').length > 0;\n const saveDisabled = !this.dirty || (this.type === 'dropdown' && !hasOptions);\n\n return (\n <Host id=\"verdocs-template-field-properties\">\n <h6>\n {capitalize(this.fieldType.replace(/_/g, ' '))} Settings <div style={{flex: '1'}} />\n {this.helpText && <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = true)} />}\n </h6>\n\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Field Name\"\n value={this.name}\n autocomplete=\"off\"\n // helpText=\"The internal name of the field. Must be unique, and contain only letters, numbers, and dashes. After an envelope is completed, the value entered by the signer will be tagged with this key.\"\n placeholder=\"Field Name...\"\n onInput={(e: any) => {\n this.name = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Optional Label\"\n value={this.label}\n autocomplete=\"off\"\n placeholder=\"Optional Label...\"\n onInput={(e: any) => {\n this.label = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <div class=\"input-label\">Role:</div>\n <verdocs-select-input\n value={this.roleName}\n options={(this.template?.roles || []).map(role => ({label: role.name, value: role.name}))}\n onInput={(e: any) => {\n this.roleName = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-value\"\n label=\"Default Value\"\n value={this.defaultValue}\n autocomplete=\"off\"\n placeholder={this.readonly && !this.defaultValue ? 'Default value required' : 'Pre-filled value...'}\n onInput={(e: any) => {\n this.defaultValue = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {this.type === 'radio' && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Group\"\n value={this.group}\n autocomplete=\"off\"\n helpText=\"Enable exclusive selections. Only one option within the same group may be selected at a time.\"\n placeholder=\"Group...\"\n onInput={(e: any) => {\n this.group = (e.target.value || '')\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '');\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-placeholder\"\n label=\"Placeholder\"\n value={this.placeholder}\n autocomplete=\"off\"\n placeholder=\"Placeholder...\"\n onInput={(e: any) => {\n this.placeholder = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Required\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-required\"\n name=\"is-required\"\n checked={this.required}\n value=\"on\"\n onInput={(e: any) => {\n this.required = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-readonly\" class=\"input-label\">\n Read-only\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-readonly\"\n name=\"is-readonly\"\n checked={this.readonly}\n value=\"on\"\n onInput={(e: any) => {\n this.readonly = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n {this.type === 'dropdown' && (\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Options\n </label>\n </div>\n )}\n\n {this.type === 'dropdown' && (\n <div class=\"options\">\n <div class=\"options-header\">\n <div class=\"options-header-label\">ID</div>\n <dev class=\"options-header-label\">Label</dev>\n </div>\n\n {this.options.map((option, index) => (\n <div class=\"row option-row\" key={index}>\n <verdocs-text-input\n value={option.id}\n placeholder=\"Unique ID\"\n onInput={(e: any) => {\n this.options[index].id = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <verdocs-text-input\n value={option.label}\n placeholder=\"Display label\"\n onInput={(e: any) => {\n this.options[index].label = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <button\n innerHTML={TrashIcon}\n class=\"remove-button\"\n onClick={() => {\n this.options = this.options.filter(opt => opt.id !== option.id);\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n </div>\n ))}\n </div>\n )}\n\n <div class=\"buttons\">\n <button class=\"delete-button\" disabled={this.dirty} onClick={e => this.handleDelete(e)} innerHTML={TrashIcon} />\n <div style={{flex: '1'}} />\n <verdocs-button size=\"small\" variant=\"outline\" label=\"Cancel\" disabled={!this.dirty} onClick={e => this.handleCancel(e)} />\n <verdocs-button size=\"small\" label=\"Save\" disabled={saveDisabled || (this.readonly && !this.defaultValue)} onClick={e => !saveDisabled && this.handleSave(e)} />\n </div>\n </form>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -10,7 +10,7 @@ import { d as defineCustomElement$6 } from './p-DGJlf5J_.js';
|
|
|
10
10
|
import { d as defineCustomElement$5 } from './p-D_QT5uZk.js';
|
|
11
11
|
import { d as defineCustomElement$4 } from './p-C3iwT41e.js';
|
|
12
12
|
import { d as defineCustomElement$3 } from './p-kvTSiSQ0.js';
|
|
13
|
-
import { d as defineCustomElement$2 } from './p-
|
|
13
|
+
import { d as defineCustomElement$2 } from './p-Da1nfhXq.js';
|
|
14
14
|
import { d as defineCustomElement$1 } from './p-BvDqCFDj.js';
|
|
15
15
|
|
|
16
16
|
const verdocsFieldTextboxCss = "@-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-field-textbox{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;width:150px;height:15px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;letter-spacing:-0.2px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox .edge-top,verdocs-field-textbox .edge-right,verdocs-field-textbox .edge-left,verdocs-field-textbox .edge-bottom{position:absolute;z-index:10}verdocs-field-textbox .edge-top{top:-2px;left:0;right:0;height:5px}verdocs-field-textbox .edge-right{top:0;bottom:0;right:-2px;width:5px}verdocs-field-textbox .edge-left{top:0;left:-2px;bottom:0;width:5px}verdocs-field-textbox .edge-bottom{bottom:-2px;left:0;right:0;height:5px}verdocs-field-textbox input{cursor:inherit;width:100%;height:100%;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;position:absolute;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.disabled input{opacity:0.5}verdocs-field-textbox textarea{cursor:inherit;width:100%;height:100%;resize:none;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textbox textarea.hide{display:none}verdocs-field-textbox.disabled textarea{opacity:0.5}verdocs-field-textbox label{top:-14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-textbox.required{border:1px solid rgb(204, 0, 0)}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}verdocs-field-textbox .settings-icon{position:absolute;top:-4px;left:-18px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-textbox .settings-icon svg{fill:#707ae5}verdocs-field-textbox .settings-icon:hover{opacity:1}@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)}}";
|
|
@@ -271,6 +271,6 @@ function defineCustomElement() {
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
export { VerdocsFieldTextbox as V, defineCustomElement as d };
|
|
274
|
-
//# sourceMappingURL=p-
|
|
274
|
+
//# sourceMappingURL=p-IbPNQm1I.js.map
|
|
275
275
|
|
|
276
|
-
//# sourceMappingURL=p-
|
|
276
|
+
//# sourceMappingURL=p-IbPNQm1I.js.map
|