@verdocs/web-sdk 5.0.6 → 5.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +9 -8
- package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +9 -8
- package/dist/components/{p-53585e13.js → p-9c37d4b3.js} +9 -8
- package/dist/components/{p-5de4d4ee.js → p-eefda339.js} +1 -1
- package/dist/components/verdocs-build.js +2 -2
- package/dist/components/verdocs-template-role-properties.js +1 -1
- package/dist/components/verdocs-template-roles.js +1 -1
- package/dist/esm/verdocs-menu-panel_2.entry.js +9 -8
- package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-48ff3cce.system.entry.js → p-b029989a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
- package/dist/verdocs-web-sdk/p-fe48c408.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/custom-elements.json +0 -2156
- package/dist/verdocs-web-sdk/p-365ed258.entry.js +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
import{r as e,c as t,h as s,H as i}from"./p-b9654a5e.js";import{VerdocsEndpoint as o,getTemplate as r,updateTemplateRole as l,deleteTemplateRole as a,isValidEmail as d}from"@verdocs/js-sdk";import{S as c}from"./p-fd97809c.js";import{S as n}from"./p-b712e729.js";const p=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.moved=!1,this.overlayId="verdocs-menu-panel-overlay",this.panelId="verdocs-menu-panel",this.side="right",this.overlay=!0,this.width=300}handleClick(e){var t;this.element.contains(e.target)||(this.hide(),null===(t=this.close)||void 0===t||t.emit())}componentWillLoad(){this.hide(),this.overlay&&(this.portal=document.createElement("div"),this.portal.setAttribute("id",this.overlayId),document.body.append(this.portal)),this.portal=document.createElement("div"),this.portal.setAttribute("id",this.panelId),this.portal.style.top="0px",this.portal.style.bottom="0px",this.portal.style.width=`${this.width}px`,"left"===this.side?this.portal.style.left="0px":this.portal.style.right="0px",document.body.append(this.portal)}componentDidLoad(){this.portal.appendChild(this.element)}disconnectedCallback(){this.moved?this.portal.remove():this.moved=!0}hide(){var e,t;null===(e=document.getElementById(this.overlayId))||void 0===e||e.remove(),null===(t=document.getElementById(this.panelId))||void 0===t||t.remove()}render(){return s(i,{key:"1d8fd8a0d6035917184972712ab812f5c6141a1f",ref:e=>this.element=e},s("slot",{key:"696879936056ff36c4054e4a235455f9308605af"}))}};p.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}#verdocs-menu-panel-overlay{top:0;left:0;width:100%;height:100%;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.4980392157)}#verdocs-menu-panel{opacity:0;z-index:10001;position:fixed;overflow-y:scroll;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-animation:showVerdocsMenuPanel 0.35s;-webkit-animation-fill-mode:forwards}@-webkit-keyframes showVerdocsMenuPanel{0%{opacity:0;right:-300px}100%{right:0;opacity:1}}';const h=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.delete=t(this,"delete",7),this.sdkError=t(this,"sdkError",7),this.templateListenerId=null,this.endpoint=o.getDefault(),this.templateId="",this.roleName="",this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.first_name="",this.last_name="",this.email="",this.phone="",this.delegator=!1,this.loading=!0,this.template=null}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.listenToTemplate()}catch(i){console.log("[ROLES Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new c(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){console.log("[ROLES] Loading tempate",this.templateId),this.unlistenToTemplate(),n.subscribe("templates",this.templateId,(()=>r(this.endpoint,this.templateId)),!1,(e=>{var t;console.log("[BUILD] Template Updated",e),this.template=e,this.loading=!1;const s=null===(t=this.template)||void 0===t?void 0:t.roles.find((e=>e.name===this.roleName));s&&(this.name=s.name,this.type=s.type,this.first_name=s.first_name,this.last_name=s.last_name,this.email=s.email,this.phone=s.phone,this.delegator=s.delegator,console.log("[ROLES] Editing role",s))}))}unlistenToTemplate(){this.templateListenerId&&(n.store.delListener(this.templateListenerId),this.templateListenerId=null)}handleCancel(e){var t,s;e.stopPropagation();const i=null===(t=this.template)||void 0===t?void 0:t.roles.find((e=>e.name===this.roleName));i&&(this.name=i.name,this.type=i.type,this.first_name=i.first_name,this.last_name=i.last_name,this.email=i.email,this.phone=i.phone,this.delegator=i.delegator),this.dirty=!1,null===(s=this.close)||void 0===s||s.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,l(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((async e=>{var t;console.log("[ROLES] Update result",e),this.saving=!1,this.dirty=!1;const s=JSON.parse(JSON.stringify(this.template)),i=s.roles.findIndex((e=>e.name===this.roleName));i>-1&&(s.roles[i]=e),n.updateTemplate(this.templateId,s),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("[ROLES Update error",e),this.saving=!1}))}async handleDelete(e){e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&a(this.endpoint,this.templateId,this.roleName).then((()=>{var e,t;const s=JSON.parse(JSON.stringify(this.template));s.roles=s.roles.filter((e=>e.name!==this.roleName)),n.updateTemplate(this.templateId,s),null===(e=this.delete)||void 0===e||e.emit({templateId:this.templateId,roleName:this.roleName}),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("[ROLES Deletion error",e)}))}render(){var e;const t=((null===(e=this.template)||void 0===e?void 0:e.fields)||[]).some((e=>e.role_name===this.roleName)),o=!this.email&&!this.first_name&&!this.last_name||d(this.email)&&!!this.first_name&&!!this.last_name;return s(i,{key:"33fd4fdb9aab4d7e8db63b8f98803d618f396c7e"},s("form",{key:"f0ea5498aecaee8f00c68a60a0c941e1895cf89d",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},s("div",{key:"0900acf8a16a37b0fb1b6786c41c79f9ba3baee2"},s("verdocs-text-input",{key:"7c6f93dfbacd951ea086e1f3f67a2ac731649218",id:"verdocs-role-name",label:"Role Name (Must be unique)",value:this.name,autocomplete:"off",disabled:t,placeholder:"Role Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),t&&s("div",{key:"439e8d7ba00f6f60bfb4c92d3ad7811cbbce6c35",class:"instructions"},"This role has fields assigned and can no longer be renamed.")),s("div",{key:"622509e07d3329f97b2afe1b812c1920b95d9677"},s("div",{key:"da96defab9d0d608bb02292e99a5390613a4face",class:"input-label"},"Type:"),s("verdocs-select-input",{key:"01368605afcbb3d0ea905f3698f7c4bc1946a0ee",value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}})),s("div",{key:"8a6c71ab8a7566e9d2cfd942c72ec44c7966e6a8"},s("div",{key:"41ce817a89e963dd8aa4ce49cc27871994b69e2a",class:"input-label"},"Default Contact Info:"),s("div",{key:"e4b958063bc92d3df34bcb9314ff9c931c6a4993",class:"first-last"},s("verdocs-text-input",{key:"cde6107c9d66e786dc17f6ce825a9dc1bf6e101e",id:"verdocs-recipient-first",value:this.first_name,autocomplete:"off",placeholder:"First...",onInput:e=>{this.first_name=e.target.value,this.dirty=!0}}),s("verdocs-text-input",{key:"219e51d998390ea3a297b40867cd3e908374938a",id:"verdocs-recipient-first",value:this.last_name,autocomplete:"off",placeholder:"Last...",onInput:e=>{this.last_name=e.target.value,this.dirty=!0}}))),s("div",{key:"95f56626e28d1ab8e82af7954012b34e36ecdc19"},s("verdocs-text-input",{key:"1e676e75b29e8dc63711c9a4c3de95cd2d88b6cc",id:"verdocs-recipient-email",value:this.email,autocomplete:"off",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),s("div",{key:"f298189867060ffbfb977da4b0f6cd4c69dce71f",style:{height:"15px"}}),s("div",{key:"71a8079b3751957cd135a2c736a3b59624f77bd4"},s("verdocs-text-input",{key:"2ff08fdee843a2c4c72769b8bbe50f48608b6a08",id:"verdocs-recipient-phone",value:this.phone,autocomplete:"off",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}))),s("div",{key:"30b10e1c20ace197aa67dedcabef9adf2206bbf1",class:"buttons"},s("button",{key:"52ccaafe4e4f51d2b994813538d33443c79da0ed",class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<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>'}),s("div",{key:"49dcb63a78d83f03e8b434adeca3cf60082de647",style:{flex:"1"}}),s("verdocs-button",{key:"70b8347ddba86faf658cae033de62b9dab14aeab",size:"small",label:"Save",disabled:!this.dirty||!o,onClick:e=>this.handleSave(e)}))))}};h.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-role-properties{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form{gap:15px;padding:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-role-properties form .instructions{margin:7px 0 0 0;font-size:12px;font-style:italic}verdocs-template-role-properties form .input-label{display:block;font-size:14px;-ms-flex:0 0 100px;flex:0 0 100px;font-weight:700;margin:0 0 4px 0;color:#555570}verdocs-template-role-properties form .first-last{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form verdocs-help-icon{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-role-properties verdocs-select-input label{display:block}verdocs-template-role-properties verdocs-text-input{margin:0}verdocs-template-role-properties verdocs-text-input label{display:block}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;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-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';export{p as verdocs_menu_panel,h as verdocs_template_role_properties}
|