@verdocs/web-sdk 1.12.12 → 1.12.14
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-button-panel_3.cjs.entry.js +33 -30
- package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-create_2.cjs.entry.js +5 -2
- package/dist/collection/components/controls/verdocs-button-panel/verdocs-button-panel.js +22 -26
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +2 -2
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +11 -4
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +5 -2
- package/dist/components/verdocs-button-panel2.js +22 -26
- package/dist/components/verdocs-field-date.js +2 -2
- package/dist/components/verdocs-template-field-properties2.js +11 -4
- package/dist/components/verdocs-template-fields2.js +5 -2
- package/dist/docs.json +1 -1
- package/dist/esm/verdocs-button-panel_3.entry.js +33 -30
- package/dist/esm/verdocs-field-date.entry.js +2 -2
- package/dist/esm/verdocs-template-create_2.entry.js +5 -2
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-2c2de2e7.system.entry.js → p-34242d9b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-329ba73d.entry.js → p-34900911.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ec345452.system.entry.js → p-64b9ae85.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-7e6d7c07.system.js +1 -1
- package/dist/verdocs-web-sdk/p-ad3dad4b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-b0922cdf.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e8c200ad.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/verdocs-web-sdk/p-8a564dcf.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-972c85b6.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e76245f0.entry.js +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as t,h as i,H as s}from"./p-7239d28d.js";import{c as o,g as a}from"./p-b28ef4bb.js";import{c as l}from"./p-4cd5eb1f.js";import{V as r}from"./p-a93b745a.js";import{S as n}from"./p-7a1b2643.js";import{i as d}from"./p-9e7679fa.js";import{u as h,c as p}from"./p-feb442b1.js";import{a as c,r as m,e as g,f as v,h as f}from"./p-4a36fe61.js";import{s as x}from"./p-a8b01bb9.js";import{l as u}from"./p-35c46590.js";import"./p-21603661.js";import"./p-4926fa27.js";import"./p-aa124212.js";import"./p-ab01f71e.js";import"./p-8b2040be.js";import"./p-7291906c.js";const w=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.endpoint=r.getDefault(),this.file=void 0,this.creating=!1}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0;try{const e=await o(this.endpoint,{name:this.file.name});console.log("[CREATE] Created template",e);const t=await l(this.endpoint,e.id,this.file);console.log("[CREATE] Created document",t);let i=null;const s=setInterval((async()=>{var o;console.log("[CREATE] Waiting for template to be processed...",t),i=await a(this.endpoint,e.id),(null==i?void 0:i.processed)&&(console.log("[CREATE] Retrieved new template",i),s&&clearInterval(s),null===(o=this.next)||void 0===o||o.emit(i),this.creating=!1)}),3e3)}catch(e){console.log("[CREATE] Error creating template",e),null===(t=this.sdkError)||void 0===t||t.emit(new n(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.creating=!1}}}render(){return this.endpoint.session?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),i("div",{class:"loading-text"},"Processing, please wait...")):i("div",{class:"upload-box"},i("div",null,i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>'})),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};w.style='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end;padding:0 0 30px 0}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const b='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',q=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:b},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:b},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],C=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.cachedPageInfo={},this.endpoint=r.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,s,o,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[BUILD] Unable to start builder session, must be authenticated");try{console.log(`[FIELDS] Loading template ${this.templateId}`,this.endpoint.session),await u(this.endpoint,this.templateId,!0),this.selectedRoleName=x.roleNames[0],console.log("Starting with role",this.selectedRoleName)}catch(s){console.log("[FIELDS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new n(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new n(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(a=e.response)||void 0===a?void 0:a.data))}}componentDidRender(){d.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}attachFieldAttributes(e,t,i,s){s.addEventListener("input",(e=>this.handleFieldChange(t,e))),s.addEventListener("settingsChanged",(()=>{var e;console.log("Settings",x.fields),this.selectedRoleName=t.role_name,console.log("settings changed",this.selectedRoleName,t),s.setAttribute("roleindex",c(x.roleNames,t.role_name)),this.rerender++,s.setAttribute("rerender",this.rerender),null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:x.template,event:"updated-field"})})),s.addEventListener("deleted",(()=>{var e;console.log("deleted",this,t),s.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:x.template,event:"updated-field"})})),s.setAttribute("roleindex",i),s.setAttribute("pageNumber",e.pageNumber),s.setAttribute("xScale",e.xScale),s.setAttribute("yScale",e.yScale),s.setAttribute("name",t.name)}handlePageRendered(e){const t=e.detail;console.log("[FIELDS] Page rendered",t.pageNumber,t),this.cachedPageInfo[t.pageNumber]=t,this.pageHeights[t.pageNumber]=t.naturalHeight,x.fields.filter((e=>e.page_sequence===t.pageNumber)).forEach((e=>{const i=c(x.roleNames,e.role_name),s=m(e,t,i,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((s=>{this.attachFieldAttributes(t,e,i,s),d(s).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),s=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),a=e.dx/s+t,l=e.dy/o+i;e.target.setAttribute("posX",a),e.target.setAttribute("posy",l),g(e.target,"translate",`${a}px, ${l}px`)},end:this.handleMoveField.bind(this)}})})):(this.attachFieldAttributes(t,e,i,s),d(s).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),s=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),a=e.dx/s+t,l=e.dy/o+i;e.target.setAttribute("posX",a),e.target.setAttribute("posy",l),g(e.target,"translate",`${a}px, ${l}px`)},end:this.handleMoveField.bind(this)}})))}))}async handleMoveField(e){const t=e.target.getAttribute("pageNumber"),{naturalWidth:i=612,naturalHeight:s=792,renderedHeight:o=792}=this.cachedPageInfo[t];console.log("[FIELDS] Drag ended",t,e.target);const a=e.target.getBoundingClientRect(),l=e.target.parentElement.getBoundingClientRect(),r=Math.max(a.left-l.left,0),n=Math.max(o-(l.bottom-a.bottom),0),{x:d,y:p}=this.viewCoordinatesToPageCoordinates(r,n,t,i-e.rect.width,s-e.rect.height),c=e.target.getAttribute("name"),m=+(e.target.getAttribute("option")||"0"),g=x.fields.find((e=>e.name===c));if(console.log("Will update",c,m,g),g){switch(g.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":g.setting.x=d,g.setting.y=p;break;case"checkbox_group":case"radio_button_group":{const e=g.setting.options[m];e&&(e.x=d,e.y=p)}}await h(this.endpoint,this.templateId,c,g),this.handlePageRendered({detail:this.cachedPageInfo[t]})}}generateFieldName(e,t){let i,s=1;do{i=`${e}P${t}-${s}`,console.log("testing field",i),s++}while(x.fields.some((e=>e.name===i)));return console.log("Will use field name",i,x.fields),i}viewCoordinatesToPageCoordinates(e,t,i,s,o){const{xScale:a=1,yScale:l=1,renderedHeight:r=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/a,s)),y:Math.floor(Math.min(Math.max(r-t,0)/l,o))}}async handleClickPage(e,t){var i;if(this.placing){console.log("Placing field",this.placing,t.sequence,e.offsetX,e.offsetY);const s=t.sequence,o=e.offsetX,a=e.offsetY,l=v(this.placing),r=f(this.placing),n=this.cachedPageInfo[s];console.log("Cached page",n);const{naturalWidth:d=612,naturalHeight:h=792}=n,c=this.viewCoordinatesToPageCoordinates(o,a,s,d-l,h-r),m=Math.floor(c.x),g=Math.floor(c.y),u={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:!0,page_sequence:s,validator:null,setting:{x:m,y:g}};switch(u.type){case"attachment":case"payment":u.setting={x:m,y:g};break;case"initial":case"signature":u.setting={x:m,y:g,result:""};break;case"checkbox_group":u.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${u.name}-1`,value:"Option 1",checked:!1,x:m,y:g}]};break;case"date":u.setting={x:m,y:g,width:l,height:r,result:""};break;case"dropdown":u.required=!1,u.setting={x:m,y:g,width:l,height:r,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":u.setting={options:[{id:`${u.name}-1`,value:"Option 1",selected:!1,x:m,y:g}]};break;case"textarea":case"textbox":u.setting={x:m,y:g,width:l,height:r,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":u.setting={x:m,y:g,width:l,height:r}}"textarea"===u.type&&(u.type="textbox");const w=await p(this.endpoint,this.templateId,u);console.log("Saved field",w),x.fields.push(w),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:x.template,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[s]})}}render(){if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(x.loading||!x.template)return i(s,null,i("verdocs-loader",null));const e=[...x.template.pages];return e.sort(((e,t)=>e.sequence-t.sequence)),i(s,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},q.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.placing=e.id)}})))),i("div",{class:"pages"},e.map((e=>i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.document_id,pageNumber:e.sequence,virtualWidth:612,virtualHeight:792,onClick:t=>this.handleClickPage(t,e),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))}};C.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";export{w as verdocs_template_create,C as verdocs_template_fields}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,h as t,H as o,c as i,a as s}from"./p-7239d28d.js";import{c as r}from"./p-ec26fc38.js";import{u as l,d as n}from"./p-feb442b1.js";import{V as a}from"./p-a93b745a.js";import{s as p}from"./p-a8b01bb9.js";import{l as d}from"./p-35c46590.js";import{S as c}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-8b2040be.js";import"./p-7291906c.js";import"./p-b28ef4bb.js";const h=class{constructor(t){e(this,t),this.showing=!1,this.icon=""}componentDidRender(){document.body.appendChild(this.panelEl),this.popperInstance&&this.popperInstance.destroy(),this.popperInstance=r(this.iconEl,this.panelEl,{})}disconnectedCallback(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.panelEl&&this.panelEl.remove()}async showPanel(){var e,t;null===(e=this.panelEl)||void 0===e||e.setAttribute("data-show",""),null===(t=this.popperInstance)||void 0===t||t.update().catch((()=>{})),this.showing=!0,this.hiderEl=document.createElement("div"),this.hiderEl.style.zIndex="100",this.hiderEl.style.position="absolute",this.hiderEl.style.top="0px",this.hiderEl.style.left="0px",this.hiderEl.style.right="0px",this.hiderEl.style.bottom="0px",this.hiderEl.onclick=e=>{e.stopPropagation(),this.toggle()},document.body.appendChild(this.hiderEl)}async hidePanel(){var e,t;null===(e=this.panelEl)||void 0===e||e.removeAttribute("data-show"),null===(t=this.hiderEl)||void 0===t||t.remove(),this.showing=!1}async toggle(){this.showing?await this.hidePanel():await this.showPanel()}render(){return t(o,null,t("div",{class:"icon",innerHTML:this.icon,onClick:e=>(e.stopPropagation(),this.toggle()),ref:e=>this.iconEl=e}),t("div",{role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:e=>this.panelEl=e},t("div",{"data-popper-arrow":"true",class:"arrow"}),t("slot",null)))}};h.style='verdocs-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';const u=class{constructor(t){e(this,t),this.value="",this.label="",this.options=void 0,this.disabled=!1}render(){return t(o,{class:"input-field"},t("label",null,this.label?t("div",{class:"input-label"},this.label+":"):t("div",null),t("select",{class:"input-element",disabled:this.disabled},this.options.map((e=>t("option",{value:e.value,selected:e.value===this.value},e.label))))))}};u.style='verdocs-select-input{font-family:"Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #707ae5;border-radius:4px;background:#ffffff;color:#000;width:100%;font-size:16px;height:28px;padding:4px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:focus{border:1px solid #7d88ff}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';const f='<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>',m=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.delete=i(this,"delete",7),this.settingsChanged=i(this,"settingsChanged",7),this.sdkError=i(this,"sdkError",7),this.endpoint=a.getDefault(),this.templateId="",this.fieldName="",this.dirty=!1,this.loading=!0,this.type="signature",this.setting=null,this.name="",this.roleName="",this.required=!1,this.options=[],this.placeholder="",this.defaultValue=""}async componentWillLoad(){var e,t,o,i,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.error("[FIELD PROPERTIES] Missing required template ID");if(!this.fieldName)return void console.error("[FIELD PROPERTIES] Missing required field name");if(!this.endpoint.session)return void console.error("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");await d(this.endpoint,this.templateId);const o=p.fields.find((e=>e.name===this.fieldName));o||console.log(`[FIELD PROPERTIES] Unable to find field "${this.fieldName}" in template`),this.type=o.type,this.name=o.name,this.roleName=o.role_name,this.required=o.required,this.placeholder=o.label,this.defaultValue=(null===(e=o.setting)||void 0===e?void 0:e.value)||"",this.setting=o.setting||{},this.options=(null===(t=o.setting)||void 0===t?void 0:t.options)||[],this.dirty=!1,this.loading=!1}catch(e){console.log("[FIELD PROPERTIES] Error loading template",e),this.loading=!1,null===(o=this.sdkError)||void 0===o||o.emit(new c(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleCancel(e){var t,o;e.stopPropagation();const i=p.fields.find((e=>e.name===this.fieldName));console.log("hc",e,i),i&&(this.name=i.name,this.roleName=i.role_name,this.required=i.required,this.placeholder=i.label,this.defaultValue=(null===(t=i.setting)||void 0===t?void 0:t.result)||""),this.dirty=!1,null===(o=this.close)||void 0===o||o.emit()}handleSave(e){e.stopPropagation();const t={name:this.name,required:this.required,role_name:this.roleName};"checkbox_group"===this.type||"radio_button_group"===this.type?(t.setting=this.setting,t.setting.options=this.options):"dropdown"===this.type&&(t.setting={x:this.setting.x,y:this.setting.y,options:this.options}),l(this.endpoint,this.templateId,this.fieldName,t).then((()=>{var e,t;this.dirty=!1;const o=p.fields.find((e=>e.name===this.fieldName));o&&(o.name=this.name,o.role_name=this.roleName,o.required=this.required,o.label=this.placeholder,o.setting.result=this.defaultValue),null===(e=this.settingsChanged)||void 0===e||e.emit({fieldName:this.fieldName}),null===(t=this.close)||void 0===t||t.emit()})).catch((()=>{console.log("Field update failed",e)}))}async handleDelete(e){e.stopPropagation(),window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")&&n(this.endpoint,this.templateId,this.fieldName).then((e=>{var t;console.log("Field deleted",e),p.fields=[...p.fields.filter((e=>e.name!==this.fieldName))],p.template.roles.forEach((e=>{e.fields=[...e.fields.filter((e=>e.name!==this.fieldName))]})),null===(t=this.delete)||void 0===t||t.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("Deletion error",e)}))}render(){return this.endpoint.session?this.endpoint.session&&p.template?t(o,null,t("h6",null,"Field Settings"),t("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},t("div",{class:"row"},t("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",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.",placeholder:"Field Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}})),t("div",{class:"row"},t("div",{class:"input-label"},"Role:"),t("verdocs-select-input",{value:this.roleName,options:p.template.roles.map((e=>({label:e.name,value:e.name}))),onInput:e=>{this.roleName=e.target.value,this.dirty=!0}}),t("verdocs-help-icon",{text:"The participant who will complete this field."})),["textbox","textarea"].includes(this.type)&&t("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.name,autocomplete:"off",helpText:"Placeholder to display if the field is empty.",placeholder:"Placeholder...",onInput:e=>{this.placeholder=e.target.value,this.dirty=!0}}),t("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},t("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),t("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:e=>{this.required=e.target.checked,this.dirty=!0}})),["dropdown"].includes(this.type)&&t("div",{class:"options"},t("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options ",t("verdocs-help-icon",{text:"Each option requires a unique ID and value. The ID will be stored when the user selects an option."})),t("div",{class:"row-header"},t("h6",null,"ID"),t("h6",null,"Label"),t("div",{style:{width:"34px"}})),this.options.map(((e,o)=>t("div",{class:"row option-row",key:o},t("verdocs-text-input",{id:`verdocs-option-id-${e.id}`,value:e.id,placeholder:"Unique ID",onInput:e=>{this.options[o].id=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{id:`verdocs-option-value-${e.id}`,value:e.value,placeholder:"Display value",onInput:e=>{this.options[o].value=e.target.value,this.dirty=!0}}),t("button",{innerHTML:f,class:"remove-button",onClick:()=>{this.options=this.options.filter((t=>t.id!==e.id)),this.dirty=!0}})))),t("div",{class:"row-header"},t("button",{class:"add-option-button",onClick:()=>{this.options=[...this.options,{id:`option-${this.options.length+1}`,value:`Option ${this.options.length+1}`}],this.dirty=!0}},"Add Option"))),t("div",{class:"buttons"},t("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:f}),t("div",{style:{flex:"1"}}),t("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),t("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):t(o,{class:"empty"}):t(o,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}))}get el(){return s(this)}};m.style='verdocs-template-field-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;font-size:16px;font-weight:bold;margin:0 0 8px 0;color:#092c4c}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';export{h as verdocs_button_panel,u as verdocs_select_input,m as verdocs_template_field_properties}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as e,b as d}from"./p-7239d28d.js";(()=>{const d=import.meta.url,t={};return""!==d&&(t.resourcesUrl=new URL(".",d).href),e(t)})().then((e=>d([["p-e87ad9cc",[[0,"verdocs-template-roles",{endpoint:[16],templateId:[1,"template-id"],showingRoleDialog:[32],showingSenderDialog:[32],sender:[32],forceRerender:[32]}]]],["p-cebebb9e",[[0,"verdocs-field-initial",{field:[16],disabled:[4],initials:[1],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],tempInitials:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-096d1436",[[0,"verdocs-field-signature",{field:[16],name:[1],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],tempSignature:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-f239387c",[[0,"verdocs-field-checkbox",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],rerender:[2],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-
|
1
|
+
import{p as e,b as d}from"./p-7239d28d.js";(()=>{const d=import.meta.url,t={};return""!==d&&(t.resourcesUrl=new URL(".",d).href),e(t)})().then((e=>d([["p-e87ad9cc",[[0,"verdocs-template-roles",{endpoint:[16],templateId:[1,"template-id"],showingRoleDialog:[32],showingSenderDialog:[32],sender:[32],forceRerender:[32]}]]],["p-cebebb9e",[[0,"verdocs-field-initial",{field:[16],disabled:[4],initials:[1],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],tempInitials:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-096d1436",[[0,"verdocs-field-signature",{field:[16],name:[1],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],tempSignature:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-f239387c",[[0,"verdocs-field-checkbox",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],rerender:[2],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-34900911",[[0,"verdocs-field-date",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],containerId:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-92fedce7",[[0,"verdocs-field-dropdown",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-de5fec97",[[0,"verdocs-field-radio-button",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],rerender:[2],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-c9f8ff41",[[0,"verdocs-field-textarea",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-4e874241",[[0,"verdocs-field-textbox",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-f2c98257",[[0,"verdocs-field-timestamp",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],rerender:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-af1eb1d8",[[0,"verdocs-loader"]]],["p-98497031",[[0,"verdocs-build",{endpoint:[16],templateId:[1,"template-id"],step:[32],pdfUrl:[32],template:[32]}]]],["p-f106b96c",[[0,"verdocs-sign",{envelopeId:[1,"envelope-id"],roleId:[1,"role-id"],inviteCode:[1,"invite-code"],recipient:[32],signerToken:[32],hasSignature:[32],nextButtonLabel:[32],nextSubmits:[32],errorMessage:[32],focusedField:[32],isDone:[32],showDone:[32],finishLater:[32],showFinishLater:[32],agreed:[32],documentsSingularPlural:[32]}]]],["p-c7ff8e32",[[0,"verdocs-template-properties",{endpoint:[16],templateId:[1,"template-id"],template:[32],name:[32],visibility:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32]}]]],["p-4c1349bf",[[0,"verdocs-template-reminders",{endpoint:[16],templateId:[1,"template-id"],showPlanBlocker:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32],dirty:[32],loading:[32]}]]],["p-4c50da3f",[[0,"verdocs-template-name",{endpoint:[16],templateId:[1,"template-id"],name:[32],dirty:[32],loading:[32]}]]],["p-62866e51",[[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],isAuthenticated:[32],displayMode:[32],username:[32],password:[32],loggingIn:[32],activeSession:[32],loginError:[32]}]]],["p-466589ad",[[0,"verdocs-search",{endpoint:[16]}]]],["p-dda83545",[[0,"verdocs-send",{endpoint:[16],templateId:[1,"template-id"],containerId:[32],rolesAtLevel:[32],showPickerForId:[32],sessionContacts:[32],rolesCompleted:[32],reset:[64]}]]],["p-7d7918bc",[[0,"verdocs-template-visibility",{endpoint:[16],templateId:[1,"template-id"],dirty:[32],loading:[32],personal:[32],public:[32]}]]],["p-8293540f",[[0,"verdocs-view",{endpoint:[16],envelopeId:[1,"envelope-id"]}]]],["p-79b5b76f",[[0,"verdocs-upload-dialog",{draggingOver:[32],decodedFiles:[32]}]]],["p-e15a4cc6",[[0,"verdocs-field-attachment",{field:[16],disabled:[4],roleIndex:[2,"role-index"],rerender:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-997fc4dd",[[0,"verdocs-template-document-page",{endpoint:[16],templateId:[1,"template-id"],documentId:[1,"document-id"],pageNumber:[2,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32],pageDisplayUri:[32]}]]],["p-62db0bfe",[[0,"verdocs-preview",{endpoint:[16],templateId:[1,"template-id"]}]]],["p-53692637",[[0,"verdocs-template-attachments",{endpoint:[16],templateId:[1,"template-id"],loading:[32]}]]],["p-74a6403f",[[0,"verdocs-envelope-sidebar",{endpoint:[16],envelopeId:[1,"envelope-id"],activeTab:[32],panelOpen:[32]}]]],["p-0031154e",[[0,"verdocs-floating-menu",{options:[16]}]]],["p-04ca7746",[[0,"verdocs-kba-dialog",{step:[2],steps:[2],helptitle:[1],helptext:[1],mode:[1],label:[1],placeholder:[1],choices:[16],response:[32]}]]],["p-f19969ec",[[0,"verdocs-field-payment",{field:[16],disabled:[4],fields:[16],pageNum:[2,"page-num"],roleName:[1,"role-name"],fieldId:[1,"field-id"],recipients:[8],selectedRoleName:[1,"selected-role-name"],pdfPages:[16],currentSignature:[1,"current-signature"],currentSignatureId:[1,"current-signature-id"],currentInitial:[1,"current-initial"],currentInitialId:[1,"current-initial-id"],focused:[4],signed:[4],rerender:[2],roleindex:[2],preparedMessage:[32],signatureUrl:[32],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-f93d3324",[[0,"verdocs-organization-card",{organization:[16]}]]],["p-9f532d65",[[0,"verdocs-search-tabs",{selected:[32]}]]],["p-ab2ab46e",[[0,"verdocs-status-indicator",{size:[1],theme:[1],status:[1],envelope:[16],isOpen:[32],recipientStatusIcons:[32],containerId:[32]}]]],["p-140e1871",[[0,"verdocs-template-card",{template:[16]}]]],["p-7cb46b17",[[0,"verdocs-template-tags",{tags:[16]}]]],["p-d9aab909",[[0,"verdocs-toggle",{options:[16],theme:[1],selectedOption:[32]}]]],["p-d8696ee6",[[0,"verdocs-button",{label:[1],startIcon:[1,"start-icon"],endIcon:[1,"end-icon"],size:[1],type:[1],variant:[1],disabled:[4]}]]],["p-09c48cd5",[[0,"verdocs-checkbox",{checked:[4],name:[1],label:[1],value:[1],theme:[1],disabled:[4]}],[0,"verdocs-text-input",{value:[1],label:[1],placeholder:[1],autocomplete:[1],helpText:[1,"help-text"],type:[1],disabled:[4]}],[0,"verdocs-component-error",{message:[1]}],[0,"verdocs-help-icon",{text:[1],containerId:[32]}]]],["p-d0fc924d",[[0,"verdocs-initial-dialog",{initials:[1],fontLoaded:[32],enteredInitials:[32],mode:[32]}]]],["p-f75b2973",[[0,"verdocs-signature-dialog",{name:[1],fontLoaded:[32],enteredName:[32],mode:[32]}]]],["p-facf681e",[[0,"verdocs-toggle-button",{active:[4],icon:[1],label:[1],size:[1],_active:[32]}]]],["p-03f1894c",[[0,"verdocs-contact-picker",{endpoint:[16],templateRole:[16],contactSuggestions:[16],name:[32],email:[32],phone:[32],message:[32],showSuggestions:[32],showMessage:[32],delegator:[32],nameFieldId:[32],emailFieldId:[32],phoneFieldId:[32]}]]],["p-0ccb837b",[[0,"verdocs-radio-button",{checked:[4],name:[1],value:[1],disabled:[4]}]]],["p-2060a40c",[[0,"verdocs-template-role-properties",{endpoint:[16],templateId:[1,"template-id"],roleName:[1,"role-name"],sender:[1],dirty:[32],saving:[32],name:[32],type:[32],fullName:[32],email:[32],phone:[32],allowDelegation:[32]}],[0,"verdocs-template-sender",{endpoint:[16],templateId:[1,"template-id"],sender:[1],saving:[32]}]]],["p-b0922cdf",[[0,"verdocs-template-fields",{endpoint:[16],templateId:[1,"template-id"],toolbarTargetId:[1,"toolbar-target-id"],placing:[32],selectedRoleName:[32],rerender:[32]},[[4,"keydown","handleKeyDown"]]],[0,"verdocs-template-create",{endpoint:[16],file:[32],creating:[32]}]]],["p-607b66bb",[[0,"verdocs-ok-dialog",{heading:[1],message:[1],showCancel:[4,"show-cancel"]}]]],["p-59a504ef",[[0,"verdocs-quick-functions",{endpoint:[16]}],[0,"verdocs-search-activity",{endpoint:[16],type:[1],options:[8],emptyMessage:[32],authFailure:[32],title:[32],recent:[32],saved:[32],starred:[32]}],[0,"verdocs-search-box",{endpoint:[16],placeholder:[1],type:[1],query:[1],grabsFocus:[4,"grabs-focus"],focusField:[64]}]]],["p-e5c28d78",[[0,"verdocs-toolbar-icon",{text:[1],icon:[1],placement:[1],containerId:[32]}]]],["p-4f8d48c4",[[0,"verdocs-envelope-document-page",{endpoint:[16],envelopeId:[1,"envelope-id"],documentId:[1,"document-id"],pageNumber:[2,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32],pageDisplayUri:[32]}],[0,"verdocs-dropdown",{options:[16],open:[32]}]]],["p-e8c200ad",[[0,"verdocs-template-field-properties",{endpoint:[16],templateId:[1,"template-id"],fieldName:[1,"field-name"],dirty:[32],loading:[32],type:[32],setting:[32],name:[32],roleName:[32],required:[32],options:[32],placeholder:[32],defaultValue:[32]}],[4,"verdocs-button-panel",{icon:[1],showPanel:[64],hidePanel:[64],toggle:[64]}],[0,"verdocs-select-input",{value:[1],label:[1],options:[16],disabled:[4]}]]]],e)));
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function l(e){try{a(i["throw"](e))}catch(e){r(e)}}function a(e){e.done?o(e.value):n(e.value).then(s,l)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var i=0,n=t.length,r;i<n;i++){if(r||!(i in t)){if(!r)r=Array.prototype.slice.call(t,0,i);r[i]=t[i]}}return e.concat(r||Array.prototype.slice.call(t))};System.register(["./p-9422b807.system.js","./p-e12b7fbc.system.js","./p-b1288daf.system.js","./p-8e5d9f77.system.js","./p-03aeaebe.system.js","./p-f0f99234.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-71c7e1ba.system.js","./p-d50523fd.system.js","./p-69912cbf.system.js"],(function(e){"use strict";var t,o,i,n,r,s,l,a,p,d,c,u;return{setters:[function(e){t=e.r;o=e.h;i=e.H;n=e.c;r=e.a},function(e){s=e.c},function(e){l=e.u;a=e.d},function(e){p=e.V},function(e){d=e.s},function(e){c=e.l},function(e){u=e.S},function(){},function(){},function(){},function(){}],execute:function(){var f='verdocs-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';var h=e("verdocs_button_panel",function(){function e(e){t(this,e);this.showing=false;this.icon=""}e.prototype.componentDidRender=function(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=s(this.iconEl,this.panelEl,{})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}};e.prototype.showPanel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!!this.showing)return[3,2];return[4,this.toggle()];case 1:e.sent();e.label=2;case 2:return[2]}}))}))};e.prototype.hidePanel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:console.log("Hiding panel",this.showing);if(!this.showing)return[3,2];return[4,this.toggle()];case 1:e.sent();e.label=2;case 2:return[2]}}))}))};e.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i;var n=this;return __generator(this,(function(r){if(this.showing){(e=this.panelEl)===null||e===void 0?void 0:e.removeAttribute("data-show");(t=this.hiderEl)===null||t===void 0?void 0:t.remove();this.showing=false}else{(o=this.panelEl)===null||o===void 0?void 0:o.setAttribute("data-show","");(i=this.popperInstance)===null||i===void 0?void 0:i.update().catch((function(){}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=function(e){e.stopPropagation();n.toggle()};document.body.appendChild(this.hiderEl)}return[2]}))}))};e.prototype.render=function(){var e=this;return o(i,null,o("div",{class:"icon",innerHTML:this.icon,onClick:function(t){t.stopPropagation();return e.toggle()},ref:function(t){return e.iconEl=t}}),o("div",{role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:function(t){return e.panelEl=t}},o("div",{"data-popper-arrow":"true",class:"arrow"}),o("slot",null)))};return e}());h.style=f;var m='verdocs-select-input{font-family:"Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #707ae5;border-radius:4px;background:#ffffff;color:#000;width:100%;font-size:16px;height:28px;padding:4px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:focus{border:1px solid #7d88ff}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';var v=e("verdocs_select_input",function(){function e(e){t(this,e);this.value="";this.label="";this.options=undefined;this.disabled=false}e.prototype.render=function(){var e=this;return o(i,{class:"input-field"},o("label",null,this.label?o("div",{class:"input-label"},this.label+":"):o("div",null),o("select",{class:"input-element",disabled:this.disabled},this.options.map((function(t){return o("option",{value:t.value,selected:t.value===e.value},t.label)})))))};return e}());v.style=m;var b='verdocs-template-field-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;font-size:16px;font-weight:bold;margin:0 0 8px 0;color:#092c4c}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var g='<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>';var x=e("verdocs_template_field_properties",function(){function e(e){t(this,e);this.close=n(this,"close",7);this.delete=n(this,"delete",7);this.settingsChanged=n(this,"settingsChanged",7);this.sdkError=n(this,"sdkError",7);this.endpoint=p.getDefault();this.templateId="";this.fieldName="";this.dirty=false;this.loading=true;this.type="signature";this.setting=null;this.name="";this.roleName="";this.required=false;this.options=[];this.placeholder="";this.defaultValue=""}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,n,r,s;var l=this;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.error("[FIELD PROPERTIES] Missing required template ID");return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.error("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}return[4,c(this.endpoint,this.templateId)];case 1:a.sent();r=d.fields.find((function(e){return e.name===l.fieldName}));if(!r){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in template'))}this.type=r.type;this.name=r.name;this.roleName=r.role_name;this.required=r.required;this.placeholder=r.label;this.defaultValue=((e=r.setting)===null||e===void 0?void 0:e.value)||"";this.setting=r.setting||{};this.options=((t=r.setting)===null||t===void 0?void 0:t.options)||[];this.dirty=false;this.loading=false;return[3,3];case 2:s=a.sent();console.log("[FIELD PROPERTIES] Error loading template",s);this.loading=false;(o=this.sdkError)===null||o===void 0?void 0:o.emit(new u(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(n=s.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var o,i;e.stopPropagation();var n=d.fields.find((function(e){return e.name===t.fieldName}));console.log("hc",e,n);if(n){this.name=n.name;this.roleName=n.role_name;this.required=n.required;this.placeholder=n.label;this.defaultValue=((o=n.setting)===null||o===void 0?void 0:o.result)||""}this.dirty=false;(i=this.close)===null||i===void 0?void 0:i.emit()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var o={name:this.name,required:this.required,role_name:this.roleName};console.log("np",this.required,o);if(this.type==="dropdown"||this.type==="checkbox_group"||this.type==="radio_button_group"){o.setting=this.setting;o.setting.options=this.options}l(this.endpoint,this.templateId,this.fieldName,o).then((function(){var e,o;t.dirty=false;d.fields.forEach((function(e){e.name=t.name;e.role_name=t.roleName;e.required=t.required;e.label=t.placeholder;e.setting.result=t.defaultValue}));(e=t.settingsChanged)===null||e===void 0?void 0:e.emit({fieldName:t.fieldName});(o=t.close)===null||o===void 0?void 0:o.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")){a(this.endpoint,this.templateId,this.fieldName).then((function(e){var o;console.log("Field deleted",e);d.fields=__spreadArray([],d.fields.filter((function(e){return e.name!==t.fieldName})),true);d.template.roles.forEach((function(e){e.fields=__spreadArray([],e.fields.filter((function(e){return e.name!==t.fieldName})),true)}));(o=t.delete)===null||o===void 0?void 0:o.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!d.template){return o(i,{class:"empty"})}return o(i,null,o("h6",null,"Field Settings"),o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("div",{class:"row"},o("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",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.",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),o("div",{class:"row"},o("div",{class:"input-label"},"Role:"),o("verdocs-select-input",{value:this.roleName,options:d.template.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}}),o("verdocs-help-icon",{text:"The participant who will complete this field."})),["textbox","textarea"].includes(this.type)&&o("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.name,autocomplete:"off",helpText:"Placeholder to display if the field is empty.",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}}),o("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},o("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),o("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),["dropdown"].includes(this.type)&&o("div",{class:"options"},o("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options ",o("verdocs-help-icon",{text:"Each option requires a unique ID and value. The ID will be stored when the user selects an option."})),o("div",{class:"row-header"},o("h6",null,"ID"),o("h6",null,"Label"),o("div",{style:{width:"34px"}})),this.options.map((function(t,i){return o("div",{class:"row option-row",key:i},o("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[i].id=t.target.value;e.dirty=true}}),o("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[i].value=t.target.value;e.dirty=true}}),o("button",{innerHTML:g,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true}}))})),o("div",{class:"row-header"},o("button",{class:"add-option-button",onClick:function(){e.options=__spreadArray(__spreadArray([],e.options,true),[{id:"option-".concat(e.options.length+1),value:"Option ".concat(e.options.length+1)}],false);e.dirty=true}},"Add Option"))),o("div",{class:"buttons"},o("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:g}),o("div",{style:{flex:"1"}}),o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());x.style=b}}}));
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as e,h as t,H as o,c as i,a as s}from"./p-7239d28d.js";import{c as l}from"./p-ec26fc38.js";import{u as r,d as n}from"./p-feb442b1.js";import{V as a}from"./p-a93b745a.js";import{s as p}from"./p-a8b01bb9.js";import{l as d}from"./p-35c46590.js";import{S as c}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-8b2040be.js";import"./p-7291906c.js";import"./p-b28ef4bb.js";const h=class{constructor(t){e(this,t),this.showing=!1,this.icon=""}componentDidRender(){document.body.appendChild(this.panelEl),this.popperInstance&&this.popperInstance.destroy(),this.popperInstance=l(this.iconEl,this.panelEl,{})}disconnectedCallback(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.panelEl&&this.panelEl.remove()}async showPanel(){this.showing||await this.toggle()}async hidePanel(){console.log("Hiding panel",this.showing),this.showing&&await this.toggle()}async toggle(){var e,t,o,i;this.showing?(null===(e=this.panelEl)||void 0===e||e.removeAttribute("data-show"),null===(t=this.hiderEl)||void 0===t||t.remove(),this.showing=!1):(null===(o=this.panelEl)||void 0===o||o.setAttribute("data-show",""),null===(i=this.popperInstance)||void 0===i||i.update().catch((()=>{})),this.showing=!0,this.hiderEl=document.createElement("div"),this.hiderEl.style.zIndex="100",this.hiderEl.style.position="absolute",this.hiderEl.style.top="0px",this.hiderEl.style.left="0px",this.hiderEl.style.right="0px",this.hiderEl.style.bottom="0px",this.hiderEl.onclick=e=>{e.stopPropagation(),this.toggle()},document.body.appendChild(this.hiderEl))}render(){return t(o,null,t("div",{class:"icon",innerHTML:this.icon,onClick:e=>(e.stopPropagation(),this.toggle()),ref:e=>this.iconEl=e}),t("div",{role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:e=>this.panelEl=e},t("div",{"data-popper-arrow":"true",class:"arrow"}),t("slot",null)))}};h.style='verdocs-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';const u=class{constructor(t){e(this,t),this.value="",this.label="",this.options=void 0,this.disabled=!1}render(){return t(o,{class:"input-field"},t("label",null,this.label?t("div",{class:"input-label"},this.label+":"):t("div",null),t("select",{class:"input-element",disabled:this.disabled},this.options.map((e=>t("option",{value:e.value,selected:e.value===this.value},e.label))))))}};u.style='verdocs-select-input{font-family:"Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #707ae5;border-radius:4px;background:#ffffff;color:#000;width:100%;font-size:16px;height:28px;padding:4px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:focus{border:1px solid #7d88ff}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';const f='<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>',m=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.delete=i(this,"delete",7),this.settingsChanged=i(this,"settingsChanged",7),this.sdkError=i(this,"sdkError",7),this.endpoint=a.getDefault(),this.templateId="",this.fieldName="",this.dirty=!1,this.loading=!0,this.type="signature",this.setting=null,this.name="",this.roleName="",this.required=!1,this.options=[],this.placeholder="",this.defaultValue=""}async componentWillLoad(){var e,t,o,i,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.error("[FIELD PROPERTIES] Missing required template ID");if(!this.fieldName)return void console.error("[FIELD PROPERTIES] Missing required field name");if(!this.endpoint.session)return void console.error("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");await d(this.endpoint,this.templateId);const o=p.fields.find((e=>e.name===this.fieldName));o||console.log(`[FIELD PROPERTIES] Unable to find field "${this.fieldName}" in template`),this.type=o.type,this.name=o.name,this.roleName=o.role_name,this.required=o.required,this.placeholder=o.label,this.defaultValue=(null===(e=o.setting)||void 0===e?void 0:e.value)||"",this.setting=o.setting||{},this.options=(null===(t=o.setting)||void 0===t?void 0:t.options)||[],this.dirty=!1,this.loading=!1}catch(e){console.log("[FIELD PROPERTIES] Error loading template",e),this.loading=!1,null===(o=this.sdkError)||void 0===o||o.emit(new c(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleCancel(e){var t,o;e.stopPropagation();const i=p.fields.find((e=>e.name===this.fieldName));console.log("hc",e,i),i&&(this.name=i.name,this.roleName=i.role_name,this.required=i.required,this.placeholder=i.label,this.defaultValue=(null===(t=i.setting)||void 0===t?void 0:t.result)||""),this.dirty=!1,null===(o=this.close)||void 0===o||o.emit()}handleSave(e){e.stopPropagation();const t={name:this.name,required:this.required,role_name:this.roleName};console.log("np",this.required,t),"dropdown"!==this.type&&"checkbox_group"!==this.type&&"radio_button_group"!==this.type||(t.setting=this.setting,t.setting.options=this.options),r(this.endpoint,this.templateId,this.fieldName,t).then((()=>{var e,t;this.dirty=!1,p.fields.forEach((e=>{e.name=this.name,e.role_name=this.roleName,e.required=this.required,e.label=this.placeholder,e.setting.result=this.defaultValue})),null===(e=this.settingsChanged)||void 0===e||e.emit({fieldName:this.fieldName}),null===(t=this.close)||void 0===t||t.emit()})).catch((()=>{console.log("Field update failed",e)}))}async handleDelete(e){e.stopPropagation(),window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")&&n(this.endpoint,this.templateId,this.fieldName).then((e=>{var t;console.log("Field deleted",e),p.fields=[...p.fields.filter((e=>e.name!==this.fieldName))],p.template.roles.forEach((e=>{e.fields=[...e.fields.filter((e=>e.name!==this.fieldName))]})),null===(t=this.delete)||void 0===t||t.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("Deletion error",e)}))}render(){return this.endpoint.session?this.endpoint.session&&p.template?t(o,null,t("h6",null,"Field Settings"),t("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},t("div",{class:"row"},t("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",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.",placeholder:"Field Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}})),t("div",{class:"row"},t("div",{class:"input-label"},"Role:"),t("verdocs-select-input",{value:this.roleName,options:p.template.roles.map((e=>({label:e.name,value:e.name}))),onInput:e=>{this.roleName=e.target.value,this.dirty=!0}}),t("verdocs-help-icon",{text:"The participant who will complete this field."})),["textbox","textarea"].includes(this.type)&&t("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.name,autocomplete:"off",helpText:"Placeholder to display if the field is empty.",placeholder:"Placeholder...",onInput:e=>{this.placeholder=e.target.value,this.dirty=!0}}),t("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},t("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),t("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:e=>{this.required=e.target.checked,this.dirty=!0}})),["dropdown"].includes(this.type)&&t("div",{class:"options"},t("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options ",t("verdocs-help-icon",{text:"Each option requires a unique ID and value. The ID will be stored when the user selects an option."})),t("div",{class:"row-header"},t("h6",null,"ID"),t("h6",null,"Label"),t("div",{style:{width:"34px"}})),this.options.map(((e,o)=>t("div",{class:"row option-row",key:o},t("verdocs-text-input",{id:`verdocs-option-id-${e.id}`,value:e.id,placeholder:"Unique ID",onInput:e=>{this.options[o].id=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{id:`verdocs-option-value-${e.id}`,value:e.value,placeholder:"Display value",onInput:e=>{this.options[o].value=e.target.value,this.dirty=!0}}),t("button",{innerHTML:f,class:"remove-button",onClick:()=>{this.options=this.options.filter((t=>t.id!==e.id)),this.dirty=!0}})))),t("div",{class:"row-header"},t("button",{class:"add-option-button",onClick:()=>{this.options=[...this.options,{id:`option-${this.options.length+1}`,value:`Option ${this.options.length+1}`}],this.dirty=!0}},"Add Option"))),t("div",{class:"buttons"},t("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:f}),t("div",{style:{flex:"1"}}),t("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),t("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):t(o,{class:"empty"}):t(o,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}))}get el(){return s(this)}};m.style='verdocs-template-field-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;font-size:16px;font-weight:bold;margin:0 0 8px 0;color:#092c4c}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';export{h as verdocs_button_panel,u as verdocs_select_input,m as verdocs_template_field_properties}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as e,c as t,h as i,H as s}from"./p-7239d28d.js";import{c as o,g as a}from"./p-b28ef4bb.js";import{c as l}from"./p-4cd5eb1f.js";import{V as r}from"./p-a93b745a.js";import{S as n}from"./p-7a1b2643.js";import{i as d}from"./p-9e7679fa.js";import{u as h,c as p}from"./p-feb442b1.js";import{a as c,r as m,e as g,f as v,h as f}from"./p-4a36fe61.js";import{s as x}from"./p-a8b01bb9.js";import{l as u}from"./p-35c46590.js";import"./p-21603661.js";import"./p-4926fa27.js";import"./p-aa124212.js";import"./p-ab01f71e.js";import"./p-8b2040be.js";import"./p-7291906c.js";const w=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.endpoint=r.getDefault(),this.file=void 0,this.creating=!1}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0;try{const e=await o(this.endpoint,{name:this.file.name});console.log("[CREATE] Created template",e);const t=await l(this.endpoint,e.id,this.file);console.log("[CREATE] Created document",t);let i=null;const s=setInterval((async()=>{var o;console.log("[CREATE] Waiting for template to be processed...",t),i=await a(this.endpoint,e.id),(null==i?void 0:i.processed)&&(console.log("[CREATE] Retrieved new template",i),s&&clearInterval(s),null===(o=this.next)||void 0===o||o.emit(i),this.creating=!1)}),3e3)}catch(e){console.log("[CREATE] Error creating template",e),null===(t=this.sdkError)||void 0===t||t.emit(new n(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.creating=!1}}}render(){return this.endpoint.session?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),i("div",{class:"loading-text"},"Processing, please wait...")):i("div",{class:"upload-box"},i("div",null,i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>'})),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};w.style='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end;padding:0 0 30px 0}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const b='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',q=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:b},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:b},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],C=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.cachedPageInfo={},this.endpoint=r.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,s,o,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[BUILD] Unable to start builder session, must be authenticated");try{console.log(`[FIELDS] Loading template ${this.templateId}`,this.endpoint.session),await u(this.endpoint,this.templateId,!0),this.selectedRoleName=x.roleNames[0],console.log("Starting with role",this.selectedRoleName)}catch(s){console.log("[FIELDS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new n(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new n(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(a=e.response)||void 0===a?void 0:a.data))}}componentDidRender(){d.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}attachFieldAttributes(e,t,i,s){s.addEventListener("input",(e=>this.handleFieldChange(t,e))),s.addEventListener("settingsChanged",(()=>{var e;console.log("settings changed",this,t),s.setAttribute("roleindex",c(x.roleNames,t.role_name)),this.rerender++,s.setAttribute("rerender",this.rerender),null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:x.template,event:"updated-field"})})),s.addEventListener("deleted",(()=>{var e;console.log("deleted",this,t),s.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:x.template,event:"updated-field"})})),s.setAttribute("roleindex",i),s.setAttribute("pageNumber",e.pageNumber),s.setAttribute("xScale",e.xScale),s.setAttribute("yScale",e.yScale),s.setAttribute("name",t.name)}handlePageRendered(e){const t=e.detail;console.log("[FIELDS] Page rendered",t.pageNumber,t),this.cachedPageInfo[t.pageNumber]=t,this.pageHeights[t.pageNumber]=t.naturalHeight,x.fields.filter((e=>e.page_sequence===t.pageNumber)).forEach((e=>{const i=c(x.roleNames,e.role_name),s=m(e,t,i,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((s=>{this.attachFieldAttributes(t,e,i,s),d(s).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),s=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),a=e.dx/s+t,l=e.dy/o+i;e.target.setAttribute("posX",a),e.target.setAttribute("posy",l),g(e.target,"translate",`${a}px, ${l}px`)},end:this.handleMoveField.bind(this)}})})):(this.attachFieldAttributes(t,e,i,s),d(s).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),s=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),a=e.dx/s+t,l=e.dy/o+i;e.target.setAttribute("posX",a),e.target.setAttribute("posy",l),g(e.target,"translate",`${a}px, ${l}px`)},end:this.handleMoveField.bind(this)}})))}))}async handleMoveField(e){const t=e.target.getAttribute("pageNumber"),{naturalWidth:i=612,naturalHeight:s=792,renderedHeight:o=792}=this.cachedPageInfo[t];console.log("[FIELDS] Drag ended",t,e.target);const a=e.target.getBoundingClientRect(),l=e.target.parentElement.getBoundingClientRect(),r=Math.max(a.left-l.left,0),n=Math.max(o-(l.bottom-a.bottom),0),{x:d,y:p}=this.viewCoordinatesToPageCoordinates(r,n,t,i-e.rect.width,s-e.rect.height),c=e.target.getAttribute("name"),m=+(e.target.getAttribute("option")||"0"),g=x.fields.find((e=>e.name===c));if(console.log("Will update",c,m,g),g){switch(g.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":g.setting.x=d,g.setting.y=p;break;case"checkbox_group":case"radio_button_group":{const e=g.setting.options[m];e&&(e.x=d,e.y=p)}}await h(this.endpoint,this.templateId,c,g),this.handlePageRendered({detail:this.cachedPageInfo[t]})}}generateFieldName(e,t){let i,s=1;do{i=`${e}P${t}-${s}`,s++}while(x.fields.some((e=>e.name===i)));return console.log("Field name",i),i}viewCoordinatesToPageCoordinates(e,t,i,s,o){const{xScale:a=1,yScale:l=1,renderedHeight:r=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/a,s)),y:Math.floor(Math.min(Math.max(r-t,0)/l,o))}}async handleClickPage(e,t){var i;if(this.placing){console.log("Placing field",this.placing,t.sequence,e.offsetX,e.offsetY);const s=t.sequence,o=e.offsetX,a=e.offsetY,l=v(this.placing),r=f(this.placing),n=this.cachedPageInfo[s];console.log("Cached page",n);const{naturalWidth:d=612,naturalHeight:h=792}=n,c=this.viewCoordinatesToPageCoordinates(o,a,s,d-l,h-r),m=Math.floor(c.x),g=Math.floor(c.y),u={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:!0,page_sequence:s,validator:null,setting:{x:m,y:g}};switch(u.type){case"attachment":case"payment":u.setting={x:m,y:g};break;case"initial":case"signature":u.setting={x:m,y:g,result:""};break;case"checkbox_group":u.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${u.name}-1`,value:"Option 1",checked:!1,x:m,y:g}]};break;case"date":u.setting={x:m,y:g,width:l,height:r,result:""};break;case"dropdown":u.required=!1,u.setting={x:m,y:g,width:l,height:r,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":u.setting={options:[{id:`${u.name}-1`,value:"Option 1",selected:!1,x:m,y:g}]};break;case"textarea":case"textbox":u.setting={x:m,y:g,width:l,height:r,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":u.setting={x:m,y:g,width:l,height:r}}"textarea"===u.type&&(u.type="textbox");const w=await p(this.endpoint,this.templateId,u);console.log("Saved field",w),x.fields.push(w),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:x.template,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[s]})}}render(){if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(x.loading||!x.template)return i(s,null,i("verdocs-loader",null));const e=[...x.template.pages];return e.sort(((e,t)=>e.sequence-t.sequence)),i(s,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},q.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.placing=e.id)}})))),i("div",{class:"pages"},e.map((e=>i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.document_id,pageNumber:e.sequence,virtualWidth:612,virtualHeight:792,onClick:t=>this.handleClickPage(t,e),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))}};C.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";export{w as verdocs_template_create,C as verdocs_template_fields}
|