.
This commit is contained in:
1 parent
e728c66786
commit
9da1c4cf30
194 files changed
+10680
-9060
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.ui-popup-mask .wrapper-edit-method{width:100%}.ui-popup-mask .wrapper-edit-method .ui-check-wrapper{padding:0 28px}.comm{display:flex;flex-direction:column;width:320px;background-color:var(--dark-fore-color);border:1px solid var(--title-bg-color);margin-left:12px}.comm{--dark-fore-color: #fff;--dark-fore-opacity-color: rgba(255, 255, 255, .6);--strong-color: #333;--light-color: #ccc}.comm .roundbtn{width:30px;height:30px;display:inline-block;box-sizing:border-box;cursor:pointer;padding:7px;margin-left:10px;fill:var(--dark-fore-color);border-radius:15px;border:none;transition:background-color .2s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.comm .roundbtn:focus,.comm .roundbtn:focus-visible{outline:none}.comm .roundbtn:hover{background-color:var(--dark-fore-opacity-color)}.comm .roundbtn:hover>svg{opacity:.6}.comm .roundbtn.disabled,.comm .roundbtn:disabled{background-color:transparent!important}.comm .roundbtn.disabled,.comm .roundbtn:disabled{fill:#d3d3d3}.comm .roundbtn.disabled:hover>svg,.comm .roundbtn:disabled:hover>svg{opacity:1;opacity:initial}.comm .roundbtn>svg{width:13px;height:14px;display:block;transition:opacity .2s}.comm .title-bar{flex:0 0 auto;padding:5px 0 5px 10px;color:var(--title-color);background-color:var(--title-bg-color);line-height:24px;display:flex;align-items:center;font-size:var(--font-larger-size)}.comm .title-bar>div{flex:1 1 auto}.comm .title-bar>.title-functions{flex:0 0 auto;display:flex;padding:4px}.comm .title-bar>.title-functions>label{margin:0 4px;box-sizing:border-box;cursor:pointer;width:30px;height:30px;background-color:var(--dark-fore-color);border-radius:15px;display:flex;align-items:center;justify-content:center;transition:background-color .2s}.comm .title-bar>.title-functions>label>svg{fill:var(--strong-color);width:14px;height:14px;transition:opacity .2s}.comm .title-bar>.title-functions>label:hover{background-color:var(--dark-fore-opacity-color)}.comm .title-bar>.title-functions>label:hover>svg{opacity:.6}.comm .title-bar>.title-functions>label.disabled{cursor:default;opacity:.6}.comm .title-bar>.title-functions>label.disabled:hover{background-color:var(--dark-fore-color)}.comm .title-bar>.title-functions>label.disabled:hover>svg{opacity:1;opacity:initial}.comm .contact-bar{flex:0 0 auto;padding:4px 0;display:flex;border-bottom:1px solid var(--title-bg-color)}.comm .contact-bar>.bar-icon{flex:0 0 auto}.comm .contact-bar>.bar-icon>svg{width:30px;height:30px;margin:0 8px}.comm .contact-bar>.bar-list{flex:1 1 auto;width:calc(100% - 46px)}.comm .contact-bar>.bar-list .bar-list-container{max-height:120px;overflow:auto}.comm .contact-bar>.bar-list .contact-item{display:flex;align-items:center;line-height:22px}.comm .contact-bar>.bar-list .contact-item>svg{flex:0 0 auto;width:16px;height:16px;margin-right:6px;fill:var(--strong-color)}.comm .contact-bar>.bar-list .contact-item>span{color:var(--strong-color);font-size:var(--font-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:10px}.comm .contact-bar .roundbtn{float:right;margin:4px 10px 10px}.comm .contact-bar .roundbtn>svg{width:16px}.comm .message-bar{flex:0 0 auto;border-bottom:1px solid var(--title-bg-color);display:flex;flex-direction:column}.comm .message-bar>textarea{padding:10px 10px 0;border:1px solid var(--title-bg-color);border-radius:5px;height:70px;resize:none;font-size:var(--font-smaller-size);font-family:var(--font-family);margin:3px 5px;background:#f0f0f0}.comm .message-bar>textarea:focus,.comm .message-bar>textarea:focus-visible{outline:none}.comm .message-bar>div{padding:0 10px 10px}.comm .message-bar>div>.customer-name{float:left}.comm .message-bar>div>.customer-name>span{font-size:var(--font-smaller-size)}.comm .message-bar>div>.customer-name>.ui-input{margin-left:4px;width:150px;border-top:none;border-left:none;border-right:none}.comm .message-bar>div>.prompt-count{display:inline-block;color:var(--light-color);font-size:var(--font-smaller-size)}.comm .list-bar{flex:1 1 auto;overflow:auto;margin-top:8px}.comm .list-bar .item-div{margin-top:5px;border-bottom:solid 1px lightgray;padding:3px 10px 5px;line-height:1.5rem;white-space:normal;word-break:break-word;overflow:hidden;font-size:var(--font-size);color:#333;display:flex;flex-direction:column}.comm .list-bar .item-div:last-child{border-bottom:none}.comm .list-bar .item-div .item-poster{font-weight:700;font-size:var(--font-size);align-self:flex-start}.comm .list-bar .item-div .item-poster .ui-tooltip-wrapper>.ui-tooltip-content{font-weight:400}.comm .list-bar .item-div .item-content{line-height:1.2rem;padding:8px 20px;border-radius:5px;white-space:pre-wrap;word-break:break-word;max-width:240px;background-color:#f4f4f4}.comm .list-bar .item-div .item-content a>svg{width:13px;height:13px;fill:#2140fb}.comm .list-bar .item-div .item-content a>svg:hover{border-bottom:1px solid}.comm .list-bar .item-div .item-content>span:after{content:"";display:block}.comm .list-bar .item-div .item-content .item-status{tLine truncated
|
||||
.ui-popup-mask .wrapper-edit-method{width:100%}.ui-popup-mask .wrapper-edit-method .ui-check-wrapper{padding:0 28px}.comm{display:flex;flex-direction:column;width:320px;background-color:var(--dark-fore-color);border:1px solid var(--title-bg-color);margin-left:12px}.comm{--dark-fore-color: #fff;--dark-fore-opacity-color: rgba(255, 255, 255, .6);--strong-color: #333;--light-color: #ccc}.comm .roundbtn{width:30px;height:30px;display:inline-block;box-sizing:border-box;cursor:pointer;padding:7px;margin-left:10px;fill:var(--dark-fore-color);border-radius:15px;border:none;transition:background-color .2s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.comm .roundbtn:focus,.comm .roundbtn:focus-visible{outline:none}.comm .roundbtn:hover{background-color:var(--dark-fore-opacity-color)}.comm .roundbtn:hover>svg{opacity:.6}.comm .roundbtn.disabled,.comm .roundbtn:disabled{background-color:transparent!important}.comm .roundbtn.disabled,.comm .roundbtn:disabled{fill:#d3d3d3}.comm .roundbtn.disabled:hover>svg,.comm .roundbtn:disabled:hover>svg{opacity:1;opacity:initial}.comm .roundbtn>svg{width:13px;height:14px;display:block;transition:opacity .2s}.comm .title-bar{flex:0 0 auto;padding:5px 0 5px 10px;color:var(--title-color);background-color:var(--title-bg-color);line-height:24px;display:flex;align-items:center;font-size:var(--font-larger-size)}.comm .title-bar>div{flex:1 1 auto}.comm .title-bar>.title-functions{flex:0 0 auto;display:flex;padding:4px}.comm .title-bar>.title-functions>label{margin:0 4px;box-sizing:border-box;cursor:pointer;width:30px;height:30px;background-color:var(--dark-fore-color);border-radius:15px;display:flex;align-items:center;justify-content:center;transition:background-color .2s}.comm .title-bar>.title-functions>label>svg{fill:var(--strong-color);width:14px;height:14px;transition:opacity .2s}.comm .title-bar>.title-functions>label:hover{background-color:var(--dark-fore-opacity-color)}.comm .title-bar>.title-functions>label:hover>svg{opacity:.6}.comm .title-bar>.title-functions>label.disabled{cursor:default;opacity:.6}.comm .title-bar>.title-functions>label.disabled:hover{background-color:var(--dark-fore-color)}.comm .title-bar>.title-functions>label.disabled:hover>svg{opacity:1;opacity:initial}.comm .contact-bar{flex:0 0 auto;padding:4px 0;display:flex;border-bottom:1px solid var(--title-bg-color)}.comm .contact-bar>.bar-icon{flex:0 0 auto}.comm .contact-bar>.bar-icon>svg{width:30px;height:30px;margin:0 8px}.comm .contact-bar>.bar-list{flex:1 1 auto;width:calc(100% - 46px)}.comm .contact-bar>.bar-list .bar-list-container{max-height:120px;overflow:auto}.comm .contact-bar>.bar-list .contact-item{display:flex;align-items:center;line-height:22px}.comm .contact-bar>.bar-list .contact-item>svg{flex:0 0 auto;width:16px;height:16px;margin-right:6px;fill:var(--strong-color)}.comm .contact-bar>.bar-list .contact-item>span{color:var(--strong-color);font-size:var(--font-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:10px}.comm .contact-bar .roundbtn{float:right;margin:4px 10px 10px}.comm .contact-bar .roundbtn>svg{width:16px}.comm .message-bar{flex:0 0 auto;border-bottom:1px solid var(--title-bg-color);display:flex;flex-direction:column}.comm .message-bar>textarea{padding:10px 10px 0;border:1px solid var(--title-bg-color);border-radius:5px;height:70px;resize:none;font-size:var(--font-smaller-size);font-family:var(--font-family);margin:3px 5px;background:#f0f0f0}.comm .message-bar>textarea:focus,.comm .message-bar>textarea:focus-visible{outline:none}.comm .message-bar>div{padding:0 10px 10px}.comm .message-bar>div>.customer-name{float:left}.comm .message-bar>div>.customer-name>span{font-size:var(--font-smaller-size)}.comm .message-bar>div>.customer-name>.ui-input{margin-left:4px;width:150px;border-top:none;border-left:none;border-right:none}.comm .message-bar>div>.prompt-count{display:inline-block;color:var(--light-color);font-size:var(--font-smaller-size)}.comm .list-bar{flex:1 1 auto;overflow:auto;margin-top:8px;min-height:100px}.comm .list-bar .item-div{margin-top:5px;border-bottom:solid 1px lightgray;padding:3px 10px 5px;line-height:1.5rem;white-space:normal;word-break:break-word;overflow:hidden;font-size:var(--font-size);color:#333;display:flex;flex-direction:column}.comm .list-bar .item-div:last-child{border-bottom:none}.comm .list-bar .item-div .item-poster{font-weight:700;font-size:var(--font-size);align-self:flex-start}.comm .list-bar .item-div .item-poster .ui-tooltip-wrapper>.ui-tooltip-content{font-weight:400}.comm .list-bar .item-div .item-content{line-height:1.2rem;padding:8px 20px;border-radius:5px;white-space:pre-wrap;word-break:break-word;max-width:240px;background-color:#f4f4f4}.comm .list-bar .item-div .item-content a>svg{width:13px;height:13px;fill:#2140fb}.comm .list-bar .item-div .item-content a>svg:hover{border-bottom:1px solid}.comm .list-bar .item-div .item-content>span:after{content:"";display:block}.comm .list-bar .item-div .item-conteLine truncated
|
||||
Vendored
+9
-10
@@ -1,12 +1,11 @@
|
||||
(function(k,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(k=typeof globalThis<"u"?globalThis:k||self,E(k["lib-app"]={}))})(this,function(k){var $,L,z,Q,x,v,X,Z,ie,B,W,V,H,j,ue,ee,me,te,he,be,Le,ge,Pe,we,Fe,Y,P,G,ne;"use strict";var Se=(k,E,M)=>{if(!E.has(k))throw TypeError("Cannot "+M)};var t=(k,E,M)=>(Se(k,E,"read from private field"),M?M.call(k):E.get(k)),C=(k,E,M)=>{if(E.has(k))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(k):E.set(k,M)},T=(k,E,M,ae)=>(Se(k,E,"write to private field"),ae?ae.call(k,M):E.set(k,M),M);var xe=(k,E,M)=>(Se(k,E,"access private method"),M);const E="",M=window["lib-ui"].createElement;function ae(se,e){const n=M("div","comm"),a=M("div","title-bar",se,M("div","title-functions",...e));return n.appendChild(a),n}const De=window["lib-ui"].Dropdown,O=window["lib-ui"].createElement,$e=window["lib-ui"].createCheckbox,Ae=window["lib-ui"].createPopup,Ce=window["lib-ui"].showAlert,Ue=window["lib-utility"].isEmail,re=window["lib-utility"].nullOrEmpty,S=window["lib-utility"].r;class Ee{constructor(e={}){C(this,$,void 0);C(this,L,void 0);T(this,$,e)}async show(e=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(i=>i.tabIndex??0))+3,a=t(this,$).contact,y=O("input",i=>{i.type="text",i.className="ui-input",i.tabIndex=n+1,i.maxLength=200,i.autocomplete="off"}),m=new De({tabIndex:n+2});m.source=[{value:"0",text:S("text","Text")},{value:"1",text:S("email","Email")},{value:"2",text:S("phone","Phone")}];const o=O("input",i=>{i.type="email",i.className="ui-input",i.tabIndex=n+3,i.maxLength=100,i.autocomplete="off"}),r=O("input",i=>{i.type="tel",i.className="ui-input",i.tabIndex=n+4,i.maxLength=50,i.autocomplete="off"}),s=$e({tabIndex:n+5}),d=O("textarea",i=>{i.className="ui-text",i.tabIndex=n+6,i.maxLength=2e3,i.style.height="100px"}),b=[];t(this,$).company&&b.push({text:a==null?S("addContactRecord","Add Contact Record"):S("editContactRecord","Edit Contact Record"),trigger:()=>{const i=this.prepare();if(i==null)return!1;if(i.SaveToCustomer=1,typeof t(this,$).onSave=="function")return t(this,$).onSave.call(this,i,"customerrecord")}}),b.push({text:S("workOrderOnly","Work Order Only"),trigger:()=>{const i=this.prepare();if(i==null)return!1;if(i.Id=-1,i.SaveToCustomer=0,typeof t(this,$).onSave=="function")return t(this,$).onSave.call(this,i,"workorder")}},{text:S("cancel","Cancel")});const p=Ae(a==null?S("addContact","Add Contact"):S("editContact","Edit Contact"),O("div",i=>{i.className="setting-wrapper",i.style.width="500px"},O("div","setting-item",O("span","setting-label setting-required",S("contactNameColon","Contact Name:")),y),O("div","setting-item",O("span","setting-label",S("contactPreferencesColon","Contact Preferences:")),m.create()),O("div","setting-item",O("span","setting-label",S("contactEmailColon","Email Address:")),o),O("div","setting-item",O("span","setting-label",S("contactMobileColon","Mobile:")),r),O("div","setting-item",O("span","setting-label",S("contactOptColon","Opt Out:")),s),O("div","setting-item",O("span","setting-label",S("contactNotesColon","Notes:")),d)),...b);a!=null?(y.value=a.Name,m.select(String(a.ContactPreference)),o.value=a.Email,r.value=a.MobilePhone,s.querySelector("input").checked=a.OptOut,d.value=a.Notes):m.select("0"),T(this,L,{contactName:y,preferences:m,contactEmail:o,contactMobile:r,checkOpt:s,contactNotes:d});const g=await p.show(e);return setTimeout(()=>y.focus()),g}prepare(){const e=t(this,L).contactName.value,n=t(this,L).preferences.selected.value,a=t(this,L).contactEmail.value,y=t(this,L).contactMobile.value,m=t(this,L).checkOpt.querySelector("input").checked,o=t(this,L).contactNotes.value,r=t(this,$).contact==null?S("addContact","Add Contact"):S("editContact","Edit Contact");if(re(e))return Ce(r,S("contactNameRequired","Contact Name cannot be empty."),"warn").then(()=>t(this,L).contactName.focus()),null;if(re(a)&&re(y))return Ce(r,S("contactEmailPhoneRequired","Email and Mobile Phone cannot both be empty."),"warn").then(()=>re(a)?t(this,L).contactEmail.focus():t(this,L).contactMobile.focus()),null;if(!re(a)&&!Ue(a))return Ce(r,S("contactEmailInvalid","The email address is invalid."),"warn").then(()=>t(this,L).contactEmail.focus()),null;let s=t(this,$).contact;return s==null?s={}:s.OptOut!==m&&(m!==!1||s.OptOut_BC===!1)&&(s.selected=!m),s.Name=e,s.ContactPreference=n,s.Email=a,s.MobilePhone=y,s.OptOut=m,s.Notes=o,s}}$=new WeakMap,L=new WeakMap;const ke=window["lib-ui"].Grid,pe=window["lib-ui"].createElement,We=window["lib-ui"].createPopup,Te=window["lib-utility"].nullOrEmpty,J=window["lib-utility"].r,He=window["lib-utility"].contains;class _e{constructor(e={}){C(this,z,void 0);C(this,Q,void 0);T(this,z,e)}async show(e=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(r=>r.tabIndex??0))+3,a=pe("div","follower-grid"),m=await We(J("addFollowers","Add FolloweLine truncated
|
||||
${p}`),I(d,p)}t(this,W).scrollTop=t(this,W).scrollHeight}}set readonly(e){if(t(this,v).readonly=e,t(this,x)==null)return;const n=t(this,x).querySelector(".check-status-link");e===!0?n.classList.add("disabled"):n.classList.remove("disabled"),n.querySelector("input").disabled=e;const a=e===!0?"none":"";t(this,x).querySelector(".button-edit-contacts").style.display=a,t(this,x).querySelector(".button-edit-followers").style.display=a,t(this,x).querySelector(".message-bar").style.display=a}set recordReadonly(e){t(this,v).recordReadonly=e,t(this,x)!=null&&(t(this,x).querySelector(".button-edit-contacts").style.display=e===!0?"none":"",t(this,x).querySelector(".button-edit-followers").style.display=e===!0?"none":"")}set companyName(e){t(this,v).companyName=e;const n=t(this,x).querySelector(".title-company");N(e)?n.style.display="none":(n.innerText=e,n.style.display="")}set companyCode(e){t(this,v).companyCode=e;const n=t(this,x).querySelector(".title-company");N(t(this,v).companyName)?n.style.display="none":(n.innerText=t(this,v).companyName,N(e)||(n.innerText=t(this,v).companyName+"/"+e),n.style.display="")}get followers(){return[...t(this,Z).children].map(e=>{const n=e.querySelector("span");return{Email:n.dataset.email,MobilePhone:n.dataset.mp,Value:n.dataset.name}})}set followers(e){if(t(this,V).followers=e,t(this,Z).replaceChildren(),(e==null?void 0:e.length)>0){t(this,x).querySelector(".follower-bar").style.display="",t(this,x).querySelector(".follower-bar>.bar-list").appendChild(t(this,ie));for(let n of e){if(n.OptOut)continue;const a=String(n.MobilePhone).trim(),y=String(n.Email).trim(),m=[];n.SendEmail&&m.push(l("emailsToColon","Emails to:")+` ${y}`),n.SendText&&m.push(l("textsToColon",`Texts to: ${a}`));let o;n.SendText&&n.SendEmail?o="at":o=n.SendText?"comment-lines":"envelope";const r=h("span",d=>{n.SendEmail&&(d.dataset.email=y),n.SendText&&(d.dataset.mp=a),d.dataset.name=n.Name,d.innerText=n.Name}),s=h("div","contact-item",D("fa-light",o),r);t(this,Z).appendChild(s),r.scrollWidth>r.offsetWidth&&m.splice(0,0,l("nameColon","Name:")+` ${c.Name}`),I(r,m.join(`
|
||||
`))}}else t(this,x).querySelector(".follower-bar").style.display="none",t(this,x).querySelector(".button-edit-contacts").insertAdjacentElement("beforebegin",t(this,ie));t(this,W).scrollTop=t(this,W).scrollHeight}setData(e,n){t(this,V)[e]=n}create(){const e=t(this,v),n=e.readonly,a=fe({className:"check-auto-update",checked:e.autoUpdates,checkedNode:D("fa-regular","redo-alt"),uncheckedNode:D("fa-regular","ban"),onchange:function(){I(a,this.checked?l("autoUpdateEnabled","Auto Updates Enabled"):l("autoUpdateDisabled","Auto Updates Disabled"))}});e.autoUpdatesVisible===!1&&(a.style.display="none");const y=fe({className:"check-status-link",enabled:!n,checked:e.statusLink,checkedNode:D("fa-regular","link"),uncheckedNode:D("fa-regular","unlink"),onchange:function(){I(y,this.checked?l("statusLinkIncluded","Status Link Included"):l("statusLinkExcluded","Status Link Excluded"))}});e.statusLinkVisible===!1&&(y.style.display="none");const m=ae(h("div",null,h("div",s=>{s.className="title-module",s.innerText=e.title??l("messages","Customer Communication")}),h("div",s=>{s.className="title-company",N(e.companyName)?s.style.display="none":N(e.companyCode)?s.innerText=e.companyName:s.innerText=e.companyName+"/"+e.companyCode})),[I(a,l("autoUpdateEnabled","Auto Updates Enabled")),I(y,l("statusLinkExcluded","Status Link Excluded"))]);T(this,X,xe(this,be,Le).call(this,m,e)),T(this,Z,xe(this,ge,Pe).call(this,m,e));const o=h("textarea","ui-text");o.placeholder=l("typeMessage","Enter Message Here"),e.maxLength??(e.maxLength=3e3),o.maxLength=e.maxLength,o.addEventListener("input",()=>{const s=t(this,B).value,d=String(N(s)?0:s.length)+"/"+String(e.maxLength);t(this,x).querySelector(".message-bar .prompt-count").innerText=d}),T(this,B,o),m.appendChild(h("div",s=>{s.className="message-bar",n===!0&&(s.style.display="none")},o,h("div",s=>s.style.textAlign="right",h("div",s=>{s.className="customer-name",e.customerNameVisible!==!0&&(s.style.display="none")},h("span",s=>s.innerText=l("nameColon","Name:")),h("input",s=>{s.type="text",s.className="ui-input"})),h("div","prompt-count"),h("button",s=>{s.className="roundbtn button-send-message",s.style.backgroundColor="rgb(19, 150, 204)",s.appendChild(D("fa-solid","paper-plane")),I(s,l("sendMessage","Send Message")),s.addEventListener("click",()=>{const d=t(this,B).value;if(N(d==null?void 0:d.trim())){ce(l("error","Error"),l("messageRequired","Please input the message."),"warn");return}typeof t(this,v).onAddMessage=="function"&&t(this,v).onAddMessage(t(this,B).value)})}))));const r=h("div","list-bar");return T(this,W,r),m.appendChild(r),T(this,x,m)}load(e,n,a){var m;const y=[];if((e==null?void 0:e.length)>0){n??(n=t(this,V).contacts),a??(a=t(this,V).allfollowers);for(let o of e){const r=h("div","item-div");let s;if(o.IsReply&&(n==null?void 0:n.length)>0){const p=ye(o.Sender)?n.find(g=>g.Email===o.Sender):n.find(g=>g.MobilePhone===o.Sender);s=p==null?void 0:p.Name}s??(s=o.IsReply&&String(o.FormatSender)!==""?o.FormatSender:o.Sender);let d="";if(!o.IsReply&&((m=o.OriPhoneNumbers)==null?void 0:m.length)>0)for(let p of o.OriPhoneNumbers){let g;const i=ye(p);if((n==null?void 0:n.length)>0){let w=i?n.find(f=>f.Email===p):n.find(f=>f.MobilePhone===p);w!=null?g=`${i?w.Email:w.MobilePhoneDisplayText} - ${w.Name}`:(a==null?void 0:a.length)>0&&(w=i?a.find(f=>f.Email===p):a.find(f=>f.MobilePhone===p),w!=null&&(g=`${i?w.Email:w.MobilePhoneDisplayText} - ${w.Name}`))}d+=(g??p)+`
|
||||
`}d!==""&&(d=l("sendToColon","Send To :")+`
|
||||
${d}`),r.appendChild(h("div",p=>{p.className="item-poster",p.innerText=s,!o.IsReply&&(d==null?void 0:d.length)>0&&I(p,d)}));const b=h("div","item-content");if(b.appendChild(h("span",p=>{/https?:\/\//i.test(o.Message)?p.innerHTML=Be(o.Message):p.innerText=o.Message})),o.IsReply)r.classList.add("item-other");else{r.classList.add("item-self");const[p,g]=xe(this,we,Fe).call(this,o);if(p!==-100){let i;switch(p){case 0:i=l("pending","Pending"),b.style.backgroundColor="#ffc107";break;case 1:i=l("sent","Sent");break;case 9:i=l("failed","Failed"),b.style.backgroundColor="#ffc107";break;case 10:i=l("optOut","Opt-Out"),b.style.backgroundColor="#ffc107";break;case 412:i=l("landline","Landline"),b.style.backgroundColor="#ffc107";break;default:i=l("undelivered","Undelivered"),b.style.backgroundColor="#ffc107";break}const w=h("div",f=>{f.className="item-status",f.innerText=i,p==-10&&I(f,g)});b.appendChild(w)}}r.append(b,h("div",p=>{p.className="item-time",p.innerText=o.TimeStr})),y.push(r)}y[0].style.marginTop="0"}t(this,W).replaceChildren(...y),t(this,W).scrollTop=t(this,W).scrollHeight}}x=new WeakMap,v=new WeakMap,X=new WeakMap,Z=new WeakMap,ie=new WeakMap,B=new WeakMap,W=new WeakMap,V=new WeakMap,H=new WeakMap,j=new WeakMap,ue=new WeakMap,ee=new WeakSet,me=function(){return t(this,x).querySelector(".check-auto-update>input")},te=new WeakSet,he=function(){return t(this,x).querySelector(".check-status-link>input")},be=new WeakSet,Le=function(e,n){const a=n.readonly,y=n.recordReadonly,m=h("div","bar-list-container");return e.append(h("div","contact-bar",h("div","bar-icon",D("fa-solid","user-circle",{fill:"lightgray"})),h("div","bar-list",m,h("button",o=>{o.className="roundbtn button-edit-contacts",o.style.backgroundColor="rgb(1, 199, 172)",a===!0&&(o.style.display="none"),o.appendChild(D("fa-solid","user-edit")),I(o,l("editContacts","Edit Contacts")),o.addEventListener("click",()=>{const r=qe(h("div",s=>{s.style.display="flex",s.style.alignItems="center",s.append(h("div",d=>{d.className="ui-popup-move",d.style.flex="1 1 auto"},h("div",d=>d.innerText=l("editContacts","Edit Contacts")),h("div",d=>{d.className="title-company",N(n.companyName)?d.style.display="none":N(n.companyCode)?d.innerText=n.companyName:d.innerText=n.companyName+"/"+n.companyCode})),h("button",d=>{d.style.flex="0 0 auto",d.style.backgroundColor="rgb(1, 199, 172)",d.style.marginRight="10px",d.className="roundbtn button-add-contact",y&&(d.style.display="none"),d.appendChild(D("fa-solid","user-plus",{width:"16px",height:"16px"})),d.addEventListener("click",()=>{new Ee({company:!N(t(this,v).companyName),onSave:p=>{if(t(this,H).source.some(i=>i.Name===p.Name&&i.MobilePhone===p.MobilePhone))return ce(l("addContact","Add Contact"),l("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const i=n.onSave(p,!0);return typeof(i==null?void 0:i.then)=="function"?i.then(w=>(t(this,H).source=w.filter(f=>f.Id>=0).map(f=>(f.OptOut||f.OptOut_BC||typeof f.selected>"u"&&(f.selected=!0),f)),t(this,j).source=w.filter(f=>f.Id<0).map(f=>(f.OptOut||f.OptOut_BC||typeof f.selected>"u"&&(f.selected=!0),f)),w)):!1}}}).show(e)}),I(d,l("addContact","Add Contact"))}))}),h("div",null,h("div",s=>{N(t(this,v).companyName)&&(s.style.display="none"),s.style.fontWeight="bold",s.innerText=l("contactFromRecord","Contacts from Customer Record")}),h("div",s=>{N(t(this,v).companyName)&&(s.style.display="none"),s.className="contacts-record",s.style.maxHeight="200px",s.style.width="675px",s.style.overflow="auto"}),h("div",s=>{s.style.fontWeight="bold",s.innerText=l("contactFromWorkOrder","Contacts not on Customer Record")}),h("div",s=>{s.className="contacts-wo",s.style.maxHeight="200px",s.style.width="675px",s.style.overflow="auto"})));r.show(e).then(()=>{const s=u=>({key:"selected",type:K.ColumnTypes.Checkbox,width:50,enabled:F=>!F.OptOut&&!F.OptOut_BC,onchanged:function(){typeof n.onChanged=="function"&&n.onChanged([...t(u,H).source,...t(u,j).source])}}),d={key:"type",type:K.ColumnTypes.Icon,width:50,filter:u=>{switch(String(u.ContactPreference)){case"0":return"comment-lines";case"2":return"mobile";default:return"envelope"}},className:"icon-contact-type",iconType:"fa-light"},b={key:"Name",type:je,width:160},p={type:K.ColumnTypes.Icon,width:40,visible:!y,align:"center",iconType:"fa-light"},g=u=>({key:"edit",...p,text:"edit",tooltip:l("edit","Edit"),events:{onclick:function(){new Ee({contact:this,company:!N(t(u,v).companyName),onSave:(A,le)=>{if(t(u,H).source.some(U=>U!==this&&U.Name===A.Name&&U.MobilePhone===A.MobilePhone)||t(u,j).source.some(U=>U!==this&&U.Name===A.Name&&U.MobilePhone===A.MobilePhone))return ce(l("editContact","Edit Contact"),l("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const U=n.onSave(A);return typeof(U==null?void 0:U.then)=="function"?U.then(Ne=>(t(u,H).source=Ne.filter(q=>q.Id>=0).map(q=>(q.OptOut||q.OptOut_BC|
Line truncated
|
||||
(function(v,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(v=typeof globalThis<"u"?globalThis:v||self,E(v["lib-app"]={}))})(this,function(v){var _,q,K,Q,V,X,w,k,Z,ee,Y,G,W,A,U,H,te,de,ne,ue,fe,Ae,ye,$e,ge,Fe,z,$,j,oe;"use strict";var ve=(v,E,P)=>{if(!E.has(v))throw TypeError("Cannot "+P)};var e=(v,E,P)=>(ve(v,E,"read from private field"),P?P.call(v):E.get(v)),N=(v,E,P)=>{if(E.has(v))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(v):E.set(v,P)},O=(v,E,P,re)=>(ve(v,E,"write to private field"),re?re.call(v,P):E.set(v,P),P);var be=(v,E,P)=>(ve(v,E,"access private method"),P);const E="",P=window["lib-ui"].createElement;function re(ie,t){const n=P("div","comm"),s=P("div","title-bar",ie,P("div","title-functions",...t));return n.appendChild(s),n}const Ce=window["lib-ui"].Grid,_e=window["lib-ui"].Dropdown,S=window["lib-ui"].createElement,Ue=window["lib-ui"].createCheckbox,Oe=window["lib-ui"].Popup,we=window["lib-ui"].showAlert,De=window["lib-utility"].isEmail,ce=window["lib-utility"].nullOrEmpty,x=window["lib-utility"].r;class Ee{constructor(t={}){N(this,_,void 0);N(this,q,void 0);O(this,_,t)}async show(t=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(l=>l.tabIndex??0))+3,s=e(this,_).contact,u=S("input",l=>{l.type="text",l.className="ui-input",l.tabIndex=n+1,l.maxLength=200,l.autocomplete="off"}),p=new _e({tabIndex:n+2});p.source=[{value:"0",text:x("text","Text")},{value:"1",text:x("email","Email")},{value:"2",text:x("phone","Phone")}];const i=S("input",l=>{l.type="email",l.className="ui-input",l.tabIndex=n+3,l.maxLength=100,l.autocomplete="off"}),d=S("input",l=>{l.type="tel",l.className="ui-input",l.tabIndex=n+4,l.maxLength=50,l.autocomplete="off"}),o=Ue({tabIndex:n+5}),a=S("textarea",l=>{l.className="ui-text",l.tabIndex=n+6,l.maxLength=2e3,l.style.height="100px"}),b=[];e(this,_).company&&b.push({text:s==null?x("addContactRecord","Add Contact Record"):x("editContactRecord","Edit Contact Record"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.SaveToCustomer=1,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"customerrecord")}}),b.push({text:x("workOrderOnly","Work Order Only"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.Id=-1,l.SaveToCustomer=0,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"workorder")}},{text:x("cancel","Cancel")});const y=new Oe({onMasking:e(this,_).onMasking,title:s==null?x("addContact","Add Contact"):x("editContact","Edit Contact"),content:S("div",l=>{l.className="setting-wrapper",l.style.width="500px"},S("div","setting-item",S("span","setting-label setting-required",x("contactNameColon","Contact Name:")),u),S("div","setting-item",S("span","setting-label",x("contactPreferencesColon","Contact Preferences:")),p.create()),S("div","setting-item",S("span","setting-label",x("contactEmailColon","Email Address:")),i),S("div","setting-item",S("span","setting-label",x("contactMobileColon","Mobile:")),d),S("div","setting-item",S("span","setting-label",x("contactOptColon","Opt Out:")),o),S("div","setting-item",S("span","setting-label",x("contactNotesColon","Notes:")),a)),buttons:b});s!=null?(u.value=s.Name,p.select(String(s.ContactPreference)),i.value=s.Email,d.value=s.MobilePhone,o.querySelector("input").checked=s.OptOut,a.value=s.Notes):p.select("0"),O(this,q,{contactName:u,preferences:p,contactEmail:i,contactMobile:d,checkOpt:o,contactNotes:a});const C=await y.show(t);return setTimeout(()=>u.focus()),C}prepare(){const t=e(this,q).contactName.value,n=e(this,q).preferences.selected.value,s=e(this,q).contactEmail.value,u=e(this,q).contactMobile.value,p=e(this,q).checkOpt.querySelector("input").checked,i=e(this,q).contactNotes.value,d=e(this,_).contact==null?x("addContact","Add Contact"):x("editContact","Edit Contact");if(ce(t))return we(d,x("contactNameRequired","Contact Name cannot be empty."),"warn").then(()=>e(this,q).contactName.focus()),null;if(ce(s)&&ce(u))return we(d,x("contactEmailPhoneRequired","Email and Mobile Phone cannot both be empty."),"warn").then(()=>ce(s)?e(this,q).contactEmail.focus():e(this,q).contactMobile.focus()),null;if(!ce(s)&&!De(s))return we(d,x("contactEmailInvalid","The email address is invalid."),"warn").then(()=>e(this,q).contactEmail.focus()),null;let o=e(this,_).contact;return o==null?o={}:o.OptOut!==p&&(p!==!1||o.OptOut_BC===!1)&&(o.selected=!p),o.Name=t,o.ContactPreference=n,o.Email=s,o.MobilePhone=u,o.OptOut=p,o.Notes=i,o}}_=new WeakMap,q=new WeakMap;class Be{constructor(t={}){N(this,K,void 0);N(this,Q,void 0);O(this,K,t)}async show(t,n=document.body){const s=S("div","selcontact-grid"),p=await new Oe({onMasking:e(this,K).onMasking,title:t,content:S("div","selcontact-wrapper",s),buttons:[{text:x("ok","OK"),key:"ok",trigger:()=>{if(typeof e(this,K).onOk=="function")return e(this,K).onOk.call(this,e(this,Q).source.filter(d=>d.selectLine truncated
|
||||
${C}`),M(b,C)}e(this,W).scrollTop=e(this,W).scrollHeight}}set readonly(t){if(e(this,k).readonly=t,e(this,w)==null)return;const n=e(this,w).querySelector(".check-status-link");t===!0?n.classList.add("disabled"):n.classList.remove("disabled"),n.querySelector("input").disabled=t;const s=t===!0?"none":"";e(this,w).querySelector(".button-edit-contacts").style.display=s,e(this,w).querySelector(".button-edit-followers").style.display=s,e(this,w).querySelector(".message-bar").style.display=s}set recordReadonly(t){e(this,k).recordReadonly=t,e(this,w)!=null&&(e(this,w).querySelector(".button-edit-contacts").style.display=t===!0?"none":"",e(this,w).querySelector(".button-edit-followers").style.display=t===!0?"none":"")}set companyName(t){e(this,k).companyName=t;const n=e(this,w).querySelector(".title-company");T(t)?n.style.display="none":(n.innerText=t,n.style.display="")}set companyCode(t){e(this,k).companyCode=t;const n=e(this,w).querySelector(".title-company");T(e(this,k).companyName)?n.style.display="none":(n.innerText=e(this,k).companyName,T(t)||(n.innerText=e(this,k).companyName+"/"+t),n.style.display="")}get followers(){return[...e(this,ee).children].map(t=>{const n=t.querySelector("span");return{Email:n.dataset.email,MobilePhone:n.dataset.mp,Value:n.dataset.name}})}set followers(t){if(e(this,A).followers=t,e(this,ee).replaceChildren(),(t==null?void 0:t.length)>0){e(this,w).querySelector(".follower-bar").style.display="",M(e(this,Y),r("editFollower","Edit Followers")),e(this,w).querySelector(".follower-bar>.bar-list").appendChild(e(this,Y));for(let n of t){if(n.OptOut)continue;const s=String(n.MobilePhone).trim(),u=String(n.Email).trim(),p=[];n.SendEmail&&p.push(r("emailsToColon","Emails to:")+` ${u}`),n.SendText&&p.push(r("textsToColon",`Texts to: ${s}`));let i;n.SendText&&n.SendEmail?i="at":i=n.SendText?"comment-lines":"envelope";const d=f("span",a=>{n.SendEmail&&(a.dataset.email=u),n.SendText&&(a.dataset.mp=s),a.dataset.name=n.Name,a.innerText=n.Name}),o=f("div","contact-item",F("fa-light",i),d);e(this,ee).appendChild(o),d.scrollWidth>d.offsetWidth&&p.splice(0,0,r("nameColon","Name:")+` ${c.Name}`),M(d,p.join(`
|
||||
`))}}else e(this,w).querySelector(".follower-bar").style.display="none",M(e(this,Y),r("addFollowers","Add Followers")),e(this,w).querySelector(".button-edit-contacts").insertAdjacentElement("beforebegin",e(this,Y));e(this,W).scrollTop=e(this,W).scrollHeight}setData(t,n){e(this,A)[t]=n}create(){const t=e(this,k),n=t.readonly,s=Te({className:"check-auto-update",checked:t.autoUpdates,checkedNode:F("fa-regular","redo-alt"),uncheckedNode:F("fa-regular","ban"),onchange:function(){M(s,this.checked?r("autoUpdateEnabled","Auto Updates Enabled"):r("autoUpdateDisabled","Auto Updates Disabled"))}});t.autoUpdatesVisible===!1&&(s.style.display="none");const u=Te({className:"check-status-link",enabled:!n,checked:t.statusLink,checkedNode:F("fa-regular","link"),uncheckedNode:F("fa-regular","unlink"),onchange:function(){M(u,this.checked?r("statusLinkIncluded","Status Link Included"):r("statusLinkExcluded","Status Link Excluded"))}});t.statusLinkVisible===!1&&(u.style.display="none");const p=re(f("div",null,f("div",o=>{o.className="title-module",o.innerText=t.title??r("messages","Customer Communication")}),f("div",o=>{o.className="title-company",T(t.companyName)?o.style.display="none":T(t.companyCode)?o.innerText=t.companyName:o.innerText=t.companyName+"/"+t.companyCode})),[M(s,r("autoUpdateEnabled","Auto Updates Enabled")),M(u,r("statusLinkExcluded","Status Link Excluded"))]);O(this,Z,be(this,fe,Ae).call(this,p,t)),O(this,ee,be(this,ye,$e).call(this,p,t));const i=f("textarea","ui-text");i.placeholder=r("typeMessage","Enter Message Here"),t.maxLength??(t.maxLength=3e3),i.maxLength=t.maxLength,i.addEventListener("input",()=>{const o=e(this,G).value,a=String(T(o)?0:o.length)+"/"+String(t.maxLength);e(this,w).querySelector(".message-bar .prompt-count").innerText=a}),O(this,G,i),p.appendChild(f("div",o=>{o.className="message-bar",n===!0&&(o.style.display="none")},i,f("div",o=>o.style.textAlign="right",f("div",o=>{o.className="customer-name",t.customerNameVisible!==!0&&(o.style.display="none")},f("span",o=>o.innerText=r("nameColon","Name:")),f("input",o=>{o.type="text",o.className="ui-input"})),f("div","prompt-count"),f("button",o=>{o.className="roundbtn button-send-message",o.style.backgroundColor="rgb(19, 150, 204)",o.appendChild(F("fa-solid","paper-plane")),M(o,r("sendMessage","Send Message")),o.addEventListener("click",()=>{const a=e(this,G).value;if(T(a==null?void 0:a.trim())){pe(r("error","Error"),r("messageRequired","Please input the message."),"warn");return}typeof e(this,k).onAddMessage=="function"&&e(this,k).onAddMessage(e(this,G).value)})}))));const d=f("div","list-bar");return O(this,W,d),p.appendChild(d),O(this,w,p)}load(t,n,s){var p;const u=[];if((t==null?void 0:t.length)>0){n??(n=e(this,A).contacts),s??(s=e(this,A).allfollowers);for(let i of t){const d=f("div","item-div");let o;if(i.IsReply&&(n==null?void 0:n.length)>0){const y=he(i.Sender)?n.find(C=>C.Email===i.Sender):n.find(C=>C.MobilePhone===i.Sender);o=y==null?void 0:y.Name}o??(o=i.IsReply&&String(i.FormatSender)!==""?i.FormatSender:i.Sender);let a="";if(!i.IsReply&&((p=i.OriPhoneNumbers)==null?void 0:p.length)>0)for(let y of i.OriPhoneNumbers){let C;const l=he(y);if((n==null?void 0:n.length)>0){let m=l?n.find(g=>g.Email===y):n.find(g=>g.MobilePhone===y);m!=null?C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`:(s==null?void 0:s.length)>0&&(m=l?s.find(g=>g.Email===y):s.find(g=>g.MobilePhone===y),m!=null&&(C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`))}a+=(C??y)+`
|
||||
`}a!==""&&(a=r("sendToColon","Send To :")+`
|
||||
${a}`),d.appendChild(f("div",y=>{y.className="item-poster",y.innerText=o,!i.IsReply&&(a==null?void 0:a.length)>0&&M(y,a)}));const b=f("div","item-content");if(b.appendChild(f("span",y=>{/https?:\/\//i.test(i.Message)?y.innerHTML=je(i.Message):y.innerText=i.Message})),i.IsReply)d.classList.add("item-other");else{d.classList.add("item-self");const[y,C]=be(this,ge,Fe).call(this,i);if(y!==-100){let l;switch(y){case 0:l=r("pending","Pending"),b.style.backgroundColor="#ffc107";break;case 1:l=r("sent","Sent");break;case 9:l=r("failed","Failed"),b.style.backgroundColor="#ffc107";break;case 10:l=r("optOut","Opt-Out"),b.style.backgroundColor="#ffc107";break;case 412:l=r("landline","Landline"),b.style.backgroundColor="#ffc107";break;default:l=r("undelivered","Undelivered"),b.style.backgroundColor="#ffc107";break}const m=f("div",g=>{g.className="item-status",g.innerText=l,y==-10&&M(g,C)});b.appendChild(m)}}d.append(b,f("div",y=>{y.className="item-time",y.innerText=i.TimeStr})),u.push(d)}u[0].style.marginTop="0"}e(this,W).replaceChildren(...u),e(this,W).scrollTop=e(this,W).scrollHeight}}w=new WeakMap,k=new WeakMap,Z=new WeakMap,ee=new WeakMap,Y=new WeakMap,G=new WeakMap,W=new WeakMap,A=new WeakMap,U=new WeakMap,H=new WeakMap,te=new WeakSet,de=function(){return e(this,w).querySelector(".check-auto-update>input")},ne=new WeakSet,ue=function(){return e(this,w).querySelector(".check-status-link>input")},fe=new WeakSet,Ae=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container");return t.append(f("div","contact-bar",f("div","bar-icon",F("fa-solid","user-circle",{fill:"lightgray"})),f("div","bar-list",p,f("button",i=>{i.className="roundbtn button-edit-contacts",i.style.backgroundColor="rgb(1, 199, 172)",s===!0&&(i.style.display="none"),i.appendChild(F("fa-solid","user-edit")),M(i,r("editContacts","Edit Contacts")),i.addEventListener("click",()=>{const d=new Ge({onMasking:n.onMasking,title:f("div",o=>{o.style.display="flex",o.style.alignItems="center",o.append(f("div",a=>{a.className="ui-popup-move",a.style.flex="1 1 auto"},f("div",a=>a.innerText=r("editContacts","Edit Contacts")),f("div",a=>{a.className="title-company",T(n.companyName)?a.style.display="none":T(n.companyCode)?a.innerText=n.companyName:a.innerText=n.companyName+"/"+n.companyCode})),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-from-customer-record",u&&(a.style.display="none"),a.appendChild(F("fa-solid","handshake",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{const b=new Be({contacts:[],onOk:C=>{typeof e(this,k).onSelectCRContacts=="function"&&(C==null||C.map(m=>(delete m.selected,m)),e(this,k).onSelectCRContacts(C));const l=e(this,A).contacts;e(this,U).source=l.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),e(this,H).source=l.filter(m=>m.Id<0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m))}});var y=r("selectFromCustomerRecord","Select from Customer Record");if(b.show(y,t),typeof e(this,k).onOpenSelectCRContacts=="function"){const C=e(this,k).onOpenSelectCRContacts();return typeof(C==null?void 0:C.then)=="function"?C.then(l=>(l.map(m=>{for(let g of e(this,A).contacts)if(m.Id===g.Id){m.selected=!0;break}return typeof m.selected>"u"&&(m.selected=!1),m}),e(this,A).contacts.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),b.source=l,l)):!1}}),M(a,r("selectFromCustomerRecord","Select from Customer Record"))}),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-add-contact",u&&(a.style.display="none"),a.appendChild(F("fa-solid","user-plus",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{new Ee({company:!T(e(this,k).companyName),onSave:y=>{if(e(this,U).source.some(l=>l.Name===y.Name&&l.MobilePhone===y.MobilePhone))return pe(r("addContact","Add Contact"),r("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const l=n.onSave(y,!0);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>(e(this,U).source=m.filter(g=>g.Id>=0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),e(this,H).source=m.filter(g=>g.Id<0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),m)):!1}}}).show(t)}),M(a,r("addContact","Add Contact"))}))}),content:f("div",null,f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.style.fontWeight="bold",o.innerText=r("contactFromRecord","Contacts from Customer Record")}),f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.className="contacts-record",o.style.maxHeight="200px",o.style.width="675px",o.style.overflow="auto"}),f("div",o=>{o.style.fontWeight="bold",o.innerText=r("contactFromWorkOrder","Contacts not on Customer Record")}),f("div",o=>{o.className="co
Line truncated
|
||||
|
||||
Do you want to Continue?`).replace("{name}",this.Name),[{key:"continue",text:l("continue","Continue")},{key:"cancel",text:l("cancel","Cancel")}]).then(u=>{if((u==null?void 0:u.key)==="continue"){typeof n.onDelete=="function"&&n.onDelete(u.key,this);const F=f.source.indexOf(this);if(F>=0){const A=f.source;A.splice(F,1),f.extraRows=A.filter(le=>!N(le.Notes)).length,f.source=A}}})}}}],f.init(r.container.querySelector(".contacts-wo"));const _=t(this,V).contacts.filter(u=>u.Id<0).map(u=>(u.OptOut||u.OptOut_BC||typeof u.selected>"u"&&(u.selected=!0),u));f.extraRows=_.filter(u=>!N(u.Notes)).length,f.source=_,f.selectedRowChanged=u=>{var F;u>=0&&((F=t(this,H).selectedIndexes)==null?void 0:F.length)>0&&(t(this,H).selectedIndexes=[])},T(this,j,f)})})})))),m},ge=new WeakSet,Pe=function(e,n){const a=n.readonly,y=n.recordReadonly,m=h("div","bar-list-container"),o=h("button",r=>{r.className="roundbtn button-edit-followers",r.style.backgroundColor="rgb(48, 107, 255)",(a===!0||y)&&(r.style.display="none"),r.appendChild(D("fa-solid","pen")),I(r,l("editFollower","Edit Followers")),r.addEventListener("click",()=>{const s=qe(h("div",d=>{d.style.display="flex",d.style.alignItems="center",d.append(h("div",b=>{b.className="ui-popup-move",b.style.flex="1 1 auto",b.innerText=l("editContacts","Edit Contacts")+`
|
||||
`+l("followers","Followers")}),h("button",b=>{b.style.flex="0 0 auto",b.style.backgroundColor="rgb(1, 199, 172)",b.style.marginRight="10px",b.className="roundbtn button-add-follower",b.appendChild(D("fa-solid","user-plus",{width:"16px",height:"16px"})),b.addEventListener("click",()=>{typeof t(this,v).onInitFollower=="function"&&t(this,v).onInitFollower().then(p=>{if(typeof p=="string"){ce(l("customerRecord","Customer Record"),p,"warn");return}new _e({followers:p,onOk:i=>{if(typeof t(this,v).onAddFollower=="function"){const w=t(this,v).onAddFollower(i);return typeof(w==null?void 0:w.then)=="function"?w.then(f=>(t(this,ue).source=f,f)):!1}}}).show(e)})}),I(b,l("addFollower","Add Follower"))}))}),h("div",null,h("div",d=>{d.style.fontWeight="bold",d.innerText=l("contactFromRecord","Contacts from Customer Record")}),h("div",d=>{d.className="followers-record",d.style.maxHeight="400px",d.style.width="675px",d.style.overflow="auto"})));s.show(e).then(()=>{const d={type:K.ColumnTypes.Icon,width:40,align:"center",iconType:"fa-light"},b=new K;b.height=0,b.allowHtml=!0,b.headerVisible=!1,b.columns=[{key:"type",type:K.ColumnTypes.Icon,width:50,filter:p=>p.SendText&&p.SendEmail?"at":p.SendText?"comment-lines":"envelope",className:"icon-contact-type",iconType:"fa-light"},{key:"Name",width:160},{key:"Email",width:180},{key:"MobilePhoneDisplayText",width:130},{key:"edit",...d,text:"edit",tooltip:l("edit","Edit"),events:{onclick:function(){typeof n.onInitFollower=="function"&&n.onInitFollower().then(p=>{if(typeof p=="string"){ce(l("customerRecord","Customer Record"),p,"warn");return}const g=p.find(i=>i.IID===this.UserIID);de(l("editContactMethod","Edit Contact Method"),h("div","wrapper-edit-method",h("div",i=>{i.style.display="flex",i.style.justifyContent="center",i.style.marginTop="20px"},fe({label:l("text","Text"),checked:this.SendText&&!N(g==null?void 0:g.Mobile),enabled:!N(g==null?void 0:g.Mobile),className:"check-method-text"}),fe({label:l("email","Email"),checked:this.SendEmail,className:"check-method-email"}))),[{key:"ok",text:l("ok","OK"),trigger:(i,w)=>{const f=i.container.querySelector(".check-method-text>input").checked,_=i.container.querySelector(".check-method-email>input").checked;return!f&&!_?de(l("editContactMethod","Edit Contact Method"),l("promptRemoveFollower","Contact method is required. If you continue, user will be removed as a follower."),[{key:"update",text:l("updateContactMethod","Update Contact Method")},{key:"remove",text:l("removeFollower","Remove Follower")}],"question").then(u=>(u==null?void 0:u.key)==="remove"?{key:u.key,popup:i}:!1):{key:w.key,popup:i}}},{key:"cancel",text:l("cancel","Cancel")}],null).then(i=>{const w=i==null?void 0:i.key;if(w==="remove"){typeof n.onDeleteFollower=="function"&&n.onDeleteFollower(i.key,this);const f=b.source.indexOf(this);if(f>=0){const _=b.source;_.splice(f,1),b.extraRows=_.filter(u=>!N(u.Notes)).length,b.source=_}}else if(w==="ok"){const f=i.popup.container.querySelector(".check-method-text>input").checked,_=i.popup.container.querySelector(".check-method-email>input").checked;typeof n.onChangeFollower=="function"&&n.onChangeFollower(i.key,this,f,_),this.SendText=f,this.SendEmail=_,b.refresh()}})})}}},{key:"delete",...d,text:"times",tooltip:l("delete","Delete"),events:{onclick:function(){de(l("deleteFollower","Delete Follower"),l("promptDeleteFollower","Do you want to delete this follower?")).then(p=>{if((p==null?void 0:p.key)==="yes"){typeof n.onDeleteFollower=="function"&&n.onDeleteFollower(p.key,this);const g=b.source.indexOf(this);if(g>=0){const i=b.source;i.splice(g,1),b.extraRows=i.filter(w=>!N(w.Notes)).length,b.source=i}}})}}}],b.init(s.container.querySelector(".followers-record")),b.source=t(this,V).followers,T(this,ue,b)})})});return T(this,ie,o),e.append(h("div",r=>{r.className="contact-bar follower-bar",r.style.display="none"},I(h("div","bar-icon",D("fa-solid","user-tag",{fill:"#fff","background-color":"lightgray","box-sizing":"border-box","border-radius":"15px",padding:"4px"})),l("copied","Copied")),h("div","bar-list",m,o))),m},we=new WeakSet,Fe=function(e){var m;let n=-100;const a=[];let y="";if(!e.StatusIncorrect&&((m=e.Participator)==null?void 0:m.length)>0){for(let o of e.Participator)if(!ye(o.CustomerNumber)){a.indexOf(o.Status)<0&&a.push(o.Status),y.length>0&&(y+=`
|
||||
`),y+=`${o.CustomerNumber}: `;const r={0:l("undelivered","Undelivered"),1:l("sent","Sent"),9:l("failed","Failed")}[o.Status];r!=null&&(y+=r)}}return a.length===1?n=a[0]:a.length>1&&(n=-10),[n,y]};const R=window["lib-ui"].createElement,ve=window["lib-ui"].setTooltip,Me=window["lib-ui"].createIcon,oe=window["lib-utility"].r,Ie=window["lib-utility"].nullOrEmpty,Ke=window["lib-utility"].escapeHtml;class ze{constructor(e){C(this,Y,void 0);C(this,P,void 0);C(this,G,void 0);C(this,ne,void 0);T(this,P,e??{})}get text(){var e;return(e=t(this,G))==null?void 0:e.value}set text(e){const n=t(this,G);n!=null&&(n.value=e,e=String(Ie(e)?0:val.length)+"/"+String(t(this,P).maxLength),t(this,Y).querySelector(".message-bar .prompt-count").innerText=e)}set readonly(e){t(this,P).readonly=e,t(this,Y)!=null&&(t(this,G).disabled=e===!0,t(this,Y).querySelector(".button-send-message").style.display=e===!0?"none":"",t(this,Y).querySelector(".button-post-note").style.display=e===!0?"none":"")}create(){var m;const e=ae(R("div",null,R("div",o=>{o.className="title-module",o.innerText=oe("internalComments","Internal Comments")})),[]),n=t(this,P).readonly,a=R("textarea","ui-text");a.placeholder=oe("typeComment","Enter Comment Here"),a.maxLength=(m=t(this,P)).maxLength??(m.maxLength=3e3),a.addEventListener("input",()=>{const o=t(this,G).value,r=String(Ie(o)?0:o.length)+"/"+String(t(this,P).maxLength);t(this,Y).querySelector(".message-bar .prompt-count").innerText=r}),n===!0&&(a.disabled=!0),T(this,G,a),e.appendChild(R("div","message-bar",a,R("div",o=>o.style.textAlign="right",R("div","prompt-count"),R("button",o=>{o.className="roundbtn button-send-message",o.style.backgroundColor="rgb(19, 150, 204)",(n===!0||t(this,P).noMessage===!0)&&(o.style.display="none"),o.appendChild(Me("fa-solid","paper-plane")),ve(o,oe("sendMessage","Send Message")),o.addEventListener("click",()=>{typeof t(this,P).onAddMessage=="function"&&t(this,P).onAddMessage(t(this,G).value)})}),R("button",o=>{o.className="roundbtn button-post-note",o.style.border="1px solid rgb(19, 150, 204)",o.style.fill="rgb(19, 150, 204)",n===!0&&(o.style.display="none"),o.appendChild(Me("fa-solid","comment-alt-lines")),ve(o,oe("postNote","Post Note")),o.addEventListener("click",()=>{typeof t(this,P).onAddComment=="function"&&t(this,P).onAddComment(t(this,G).value)})}))));const y=R("div","list-bar");return T(this,ne,y),e.appendChild(y),T(this,Y,e)}load(e){var a;const n=[];if((e==null?void 0:e.length)>0){for(let y of e){const m=R("div","item-div");m.appendChild(R("div",r=>{r.className="item-poster",r.innerText=y.UserName}));const o=R("div","item-content");if(o.appendChild(R("span",r=>r.innerHTML=Ke(y.Comment))),((a=y.FollowUp)==null?void 0:a.length)>0){m.classList.add("item-sent");const r=oe("sendToColon","Send To :")+`\r
|
||||
`+y.FollowUp.split(";").join(`\r
|
||||
`);o.appendChild(R("div",s=>{s.className="item-status",s.innerText=oe("sent","Sent"),ve(s,r)}))}m.append(o,R("div",r=>{r.className="item-time",r.innerText=y.SubmitDateStr})),n.push(m)}n[0].style.marginTop="0"}t(this,ne).replaceChildren(...n),t(this,ne).scrollTop=t(this,ne).scrollHeight}}Y=new WeakMap,P=new WeakMap,G=new WeakMap,ne=new WeakMap,k.CustomerCommunication=Ge,k.InternalComment=ze,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
||||
Do you want to Continue?`).replace("{name}",this.Name),[{key:"continue",text:r("continue","Continue")},{key:"cancel",text:r("cancel","Cancel")}]).then(h=>{if((h==null?void 0:h.key)==="continue"){typeof n.onDelete=="function"&&n.onDelete(h.key,this);const I=g.source.indexOf(this);if(I>=0){const D=g.source;D.splice(I,1),g.extraRows=D.filter(ae=>!T(ae.Notes)).length,g.source=D}}})}}}],g.init(d.container.querySelector(".contacts-wo"));const Le=e(this,A).contacts.filter(h=>h.Id<0).map(h=>(h.OptOut||h.OptOut_BC||typeof h.selected>"u"&&(h.selected=!0),h));g.extraRows=Le.filter(h=>!T(h.Notes)).length,g.source=Le,g.selectedRowChanged=h=>{var I;h>=0&&((I=e(this,U).selectedIndexes)==null?void 0:I.length)>0&&(e(this,U).selectedIndexes=[])},O(this,H,g)})})})))),p},ye=new WeakSet,$e=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container"),i=f("button",d=>{d.className="roundbtn button-edit-followers",d.style.backgroundColor="rgb(48, 107, 255)",(s===!0||u)&&(d.style.display="none"),d.appendChild(F("fa-solid","pen")),M(d,r("editFollower","Edit Followers")),d.addEventListener("click",()=>{typeof e(this,k).onInitFollower=="function"&&e(this,k).onInitFollower(e(this,A).followers).then(o=>{var y;if(typeof o=="string"){pe(r("customerRecord","Customer Record"),o,"warn");return}const a=new Ve({onMasking:n.onMasking,followers:o,onOk:C=>{if(typeof e(this,k).onAddFollower=="function"){const l=e(this,k).onAddFollower(C);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>m):!1}}});var b=((y=e(this,A).followers)==null?void 0:y.length)>0?r("editFollowers","Edit Followers"):r("addFollowers","Add Followers");a.show(b,t)})})});return O(this,Y,i),t.append(f("div",d=>{d.className="contact-bar follower-bar",d.style.display="none"},M(f("div","bar-icon",F("fa-solid","user-tag",{fill:"#fff","background-color":"lightgray","box-sizing":"border-box","border-radius":"15px",padding:"4px"})),r("copied","Copied")),f("div","bar-list",p,i))),p},ge=new WeakSet,Fe=function(t){var p;let n=-100;const s=[];let u="";if(!t.StatusIncorrect&&((p=t.Participator)==null?void 0:p.length)>0){for(let i of t.Participator)if(!he(i.CustomerNumber)){s.indexOf(i.Status)<0&&s.push(i.Status),u.length>0&&(u+=`
|
||||
`),u+=`${i.CustomerNumber}: `;const d={0:r("undelivered","Undelivered"),1:r("sent","Sent"),9:r("failed","Failed")}[i.Status];d!=null&&(u+=d)}}return s.length===1?n=s[0]:s.length>1&&(n=-10),[n,u]};const L=window["lib-ui"].createElement,ke=window["lib-ui"].setTooltip,Pe=window["lib-ui"].createIcon,le=window["lib-utility"].r,Ie=window["lib-utility"].nullOrEmpty,Je=window["lib-utility"].escapeHtml;class Qe{constructor(t){N(this,z,void 0);N(this,$,void 0);N(this,j,void 0);N(this,oe,void 0);O(this,$,t??{})}get text(){var t;return(t=e(this,j))==null?void 0:t.value}set text(t){const n=e(this,j);n!=null&&(n.value=t,t=String(Ie(t)?0:val.length)+"/"+String(e(this,$).maxLength),e(this,z).querySelector(".message-bar .prompt-count").innerText=t)}set readonly(t){e(this,$).readonly=t,e(this,z)!=null&&(e(this,j).disabled=t===!0,e(this,z).querySelector(".button-send-message").style.display=t===!0?"none":"",e(this,z).querySelector(".button-post-note").style.display=t===!0?"none":"")}create(){var p;const t=re(L("div",null,L("div",i=>{i.className="title-module",i.innerText=le("internalComments","Internal Comments")})),[]),n=e(this,$).readonly,s=L("textarea","ui-text");s.placeholder=le("typeComment","Enter Comment Here"),s.maxLength=(p=e(this,$)).maxLength??(p.maxLength=3e3),s.addEventListener("input",()=>{const i=e(this,j).value,d=String(Ie(i)?0:i.length)+"/"+String(e(this,$).maxLength);e(this,z).querySelector(".message-bar .prompt-count").innerText=d}),n===!0&&(s.disabled=!0),O(this,j,s),t.appendChild(L("div","message-bar",s,L("div",i=>i.style.textAlign="right",L("div","prompt-count"),L("button",i=>{i.className="roundbtn button-send-message",i.style.backgroundColor="rgb(19, 150, 204)",(n===!0||e(this,$).noMessage===!0)&&(i.style.display="none"),i.appendChild(Pe("fa-solid","paper-plane")),ke(i,le("sendMessage","Send Message")),i.addEventListener("click",()=>{typeof e(this,$).onAddMessage=="function"&&e(this,$).onAddMessage(e(this,j).value)})}),L("button",i=>{i.className="roundbtn button-post-note",i.style.border="1px solid rgb(19, 150, 204)",i.style.fill="rgb(19, 150, 204)",n===!0&&(i.style.display="none"),i.appendChild(Pe("fa-solid","comment-alt-lines")),ke(i,le("postNote","Post Note")),i.addEventListener("click",()=>{typeof e(this,$).onAddComment=="function"&&e(this,$).onAddComment(e(this,j).value)})}))));const u=L("div","list-bar");return O(this,oe,u),t.appendChild(u),O(this,z,t)}load(t){var s;const n=[];if((t==null?void 0:t.length)>0){for(let u of t){const p=L("div","item-div");p.appendChild(L("div",d=>{d.className="item-poster",d.innerText=u.UserName}));const i=L("div","item-content");if(i.appendChild(L("span",d=>d.innerHTML=Je(u.Comment))),((s=u.FollowUp)==null?void 0:s.length)>0){p.classList.add("item-sent");const d=le("sendToColon","Send To :")+`\r
|
||||
`+u.FollowUp.split(";").join(`\r
|
||||
`);i.appendChild(L("div",o=>{o.className="item-status",o.innerText=le("sent","Sent"),ke(o,d)}))}p.append(i,L("div",d=>{d.className="item-time",d.innerText=u.SubmitDateStr})),n.push(p)}n[0].style.marginTop="0"}e(this,oe).replaceChildren(...n),e(this,oe).scrollTop=e(this,oe).scrollHeight}}z=new WeakMap,$=new WeakMap,j=new WeakMap,oe=new WeakMap,v.CustomerCommunication=Ye,v.InternalComment=Qe,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|
||||
//# sourceMappingURL=app.min.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"app.min.js","sources":["../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../UILib/ui-lib/lib/app/communications/internal.js"],"sourcesContent":["import { createElement } from \"../../ui\";\r\n\r\nfunction createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n}\r\n\r\nexport {\r\n createBox\r\n}","import { Dropdown, createElement, createCheckbox, createPopup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r } from \"../../utility\";\r\n\r\nclass Contact {\r\n #option;\r\n #refs;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this.#option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('text', 'Text') },\r\n { value: '1', text: r('email', 'Email') },\r\n { value: '2', text: r('phone', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this.#option.company) {\r\n buttons.push({\r\n text: c == null ? r('addContactRecord', 'Add Contact Record') : r('editContactRecord', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('workOrderOnly', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('cancel', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = createPopup(\r\n c == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact'),\r\n createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('contactNameColon', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('contactLine truncated
|
||||
{"version":3,"file":"app.min.js","sources":["../../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../../UILib/ui-lib/lib/app/communications/internal.js"],"sourcesContent":["import { createElement } from \"../../ui\";\r\n\r\nfunction createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n}\r\n\r\nexport {\r\n createBox\r\n}","import { Grid, Dropdown, createElement, createCheckbox, Popup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r } from \"../../utility\";\r\n\r\nclass Contact {\r\n #option;\r\n #refs;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this.#option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('text', 'Text') },\r\n { value: '1', text: r('email', 'Email') },\r\n { value: '2', text: r('phone', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this.#option.company) {\r\n buttons.push({\r\n text: c == null ? r('addContactRecord', 'Add Contact Record') : r('editContactRecord', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('workOrderOnly', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('cancel', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = new Popup({\r\n onMasking: this.#option.onMasking,\r\n title: c == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact'),\r\n content: createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('contactNameColon', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'settingLine truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
@-webkit-keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}:root{--color: #201f1e;--bg-color: #fff;--border-color: #b9b9b9;--focus-border-color: #666;--shadow-color: rgba(0, 0, 0,.11);--disabled-color: #aaa;--disabled-bg-color: #e9e9e9;--disabled-border-color: #d9d9d9;--red-color: red;--title-color: #fff;--title-bg-color: rgb(68, 114, 196);--hover-bg-color: #eee;--link-color: #1890ff;--primary-color: rgb(123, 28, 33);--loading-bg-color: hsla(0, 0%, 100%, .4);--loading-fore-color: rgba(0, 0, 0, .2);--border-radius: 2px;--text-indent: 4px;--line-height: 24px;--font-size: .8125rem;--font-smaller-size: .75rem;--font-larger-size: .875rem;--font-family: "Franklin Gothic Book", "San Francisco", "Segoe UI", "Open Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei UI", sans-serif}.ui-text,.ui-input[type]{font-size:var(--font-size);font-family:var(--font-family);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-text:focus,.ui-text:focus-visible,.ui-input[type]:focus,.ui-input[type]:focus-visible{outline:none}.ui-text:focus,.ui-text:hover,.ui-input[type]:focus,.ui-input[type]:hover{border-color:var(--focus-border-color)}.ui-text:disabled,.ui-input[type]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-input{text-indent:var(--text-indent);line-height:var(--line-height)}.ui-check-image-wrapper>input[type=checkbox]{display:none}.ui-check-image-wrapper>input[type=checkbox]:checked~.checked{display:inline}.ui-check-image-wrapper>input[type=checkbox]:checked~.unchecked{display:none}.ui-check-image-wrapper>.checked{display:none}.ui-check-image-wrapper>.unchecked{display:inline}.ui-check-wrapper{display:inline-flex;align-items:center;padding:0 8px;height:36px}.ui-check-wrapper .ui-check-inner{position:relative;display:inline-block;padding:0;width:14px;height:14px;background-color:#fff;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:focus-visible{outline:none}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:hover{border-color:var(--focus-border-color)}.ui-check-wrapper .ui-check-inner:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-check-wrapper .ui-check-inner>svg{position:absolute;top:0;left:0;width:100%;height:100%;fill:#fff;-webkit-transform:scale(0);transform:scale(0);opacity:0;transition:all .08s cubic-bezier(.78,.14,.15,.86)}.ui-check-wrapper.ui-radio-wrapper .ui-check-inner{box-sizing:border-box;border-radius:8px;width:16px;height:16px}.ui-check-wrapper>input[type=checkbox],.ui-check-wrapper>input[type=radio]{display:none}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner{border-color:var(--link-color);background-color:var(--link-color)}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner>svg,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner>svg{-webkit-transform:scale(1);transform:scale(1);opacity:1}.ui-check-wrapper>input[type=checkbox]:disabled:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled:checked+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-border-color)}.ui-check-wrapper>input[type=checkbox]:disabled+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);cursor:default}.ui-check-wrapper>input[type=checkbox]:disabled~span,.ui-check-wrapper>input[type=radio]:disabled~span{color:var(--disabled-border-color);cursor:default}.ui-check-wrapper .ui-check-inner{flex:0 0 auto}.ui-check-wrapper .ui-check-inner+*{flex:1 1 auto;font-weight:400;font-size:var(--font-size);padding-left:8px;padding-right:6px;align-self:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;color:var(--color)}.ui-tooltip-color{background-color:#fff;color:#323130;border-color:#cccc}.ui-tooltip-color:focus,.ui-tooltip-color:focus-visible{outline:none}.ui-tooltip-wrapper{position:absolute;word-wrap:break-word;height:auto;text-align:left;z-index:250;min-width:45px;max-width:480px;min-height:32px;border-radius:2px;box-shadow:0 3.2px 7.2px #00000021,0 .6px 1.8px #0000001c;transition:visibility 0s linear .12s,opacity .12s ease}.ui-tooltip-wrapper>.ui-tooltip-pointer{box-sizing:border-box;box-shadow:0 5px 15px 2px #0000004d;border:1px solid #fff;z-index:-1;width:16px;height:16px;positionLine truncated
|
||||
@-webkit-keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}:root{--color: #201f1e;--bg-color: #fff;--border-color: #b9b9b9;--focus-border-color: #666;--shadow-color: rgba(0, 0, 0,.11);--disabled-color: #aaa;--disabled-bg-color: #e9e9e9;--disabled-border-color: #d9d9d9;--red-color: red;--title-color: #fff;--title-bg-color: rgb(68, 114, 196);--hover-bg-color: #eee;--link-color: #1890ff;--primary-color: rgb(123, 28, 33);--loading-bg-color: hsla(0, 0%, 100%, .4);--loading-fore-color: rgba(0, 0, 0, .2);--border-radius: 2px;--text-indent: 4px;--line-height: 24px;--font-size: .8125rem;--font-smaller-size: .75rem;--font-larger-size: .875rem;--font-family: "Franklin Gothic Book", "San Francisco", "Segoe UI", "Open Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei UI", sans-serif}.ui-text,.ui-input[type]{font-size:var(--font-size);font-family:var(--font-family);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-text:focus,.ui-text:focus-visible,.ui-input[type]:focus,.ui-input[type]:focus-visible{outline:none}.ui-text:focus,.ui-text:hover,.ui-input[type]:focus,.ui-input[type]:hover{border-color:var(--focus-border-color)}.ui-text:disabled,.ui-input[type]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-input{text-indent:var(--text-indent);line-height:var(--line-height)}.ui-check-image-wrapper>input[type=checkbox]{display:none}.ui-check-image-wrapper>input[type=checkbox]:checked~.checked{display:inline}.ui-check-image-wrapper>input[type=checkbox]:checked~.unchecked{display:none}.ui-check-image-wrapper>.checked{display:none}.ui-check-image-wrapper>.unchecked{display:inline}.ui-check-wrapper{display:inline-flex;align-items:center;padding:0 8px;height:36px}.ui-check-wrapper .ui-check-inner{position:relative;display:inline-block;padding:0;width:14px;height:14px;background-color:#fff;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:focus-visible{outline:none}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:hover{border-color:var(--focus-border-color)}.ui-check-wrapper .ui-check-inner:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-check-wrapper .ui-check-inner>svg{position:absolute;top:0;left:0;width:100%;height:100%;fill:#fff;-webkit-transform:scale(0);transform:scale(0);opacity:0;transition:all .08s cubic-bezier(.78,.14,.15,.86)}.ui-check-wrapper.ui-radio-wrapper .ui-check-inner{box-sizing:border-box;border-radius:8px;width:16px;height:16px}.ui-check-wrapper>input[type=checkbox],.ui-check-wrapper>input[type=radio]{display:none}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner{border-color:var(--link-color);background-color:var(--link-color)}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner>svg,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner>svg{-webkit-transform:scale(1);transform:scale(1);opacity:1}.ui-check-wrapper>input[type=checkbox]:disabled:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled:checked+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-border-color)}.ui-check-wrapper>input[type=checkbox]:disabled+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);cursor:default}.ui-check-wrapper>input[type=checkbox]:disabled~span,.ui-check-wrapper>input[type=radio]:disabled~span{color:var(--disabled-border-color);cursor:default}.ui-check-wrapper .ui-check-inner{flex:0 0 auto}.ui-check-wrapper .ui-check-inner+*{flex:1 1 auto;font-weight:400;font-size:var(--font-size);padding-left:8px;padding-right:6px;align-self:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;color:var(--color)}.ui-tooltip-color{background-color:#fff;color:#323130;border-color:#cccc}.ui-tooltip-color:focus,.ui-tooltip-color:focus-visible{outline:none}.ui-tooltip-wrapper{position:absolute;word-wrap:break-word;height:auto;text-align:left;z-index:250;min-width:45px;max-width:480px;min-height:32px;border-radius:2px;box-shadow:0 3.2px 7.2px #00000021,0 .6px 1.8px #0000001c;transition:visibility 0s linear .12s,opacity .12s ease}.ui-tooltip-wrapper>.ui-tooltip-pointer{box-sizing:border-box;box-shadow:0 5px 15px 2px #0000004d;border:1px solid #fff;z-index:-1;width:16px;height:16px;positionLine truncated
|
||||
Vendored
+2
-2
@@ -1,3 +1,3 @@
|
||||
(function(w,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(w=typeof globalThis<"u"?globalThis:w||self,L(w["lib-ui"]={}))})(this,function(w){var A,F,O,P,Y,me,He,re,oe,ae,Ke,be,vt,ve,xt,Oe,_t,$e,qt,Pe,Rt,ze,Ht,j,$,xe,W,v,we,ke,M,K,ce,de,ee,U,Ce,ue,Le,I,At,Ee,wt,lt,Zt,rt,ei,ot,ti,at,ii,he,Ue,ct,si,dt,ni,Ve,Ot,z,X,te,Se,fe,Ge,We,$t,Me,Pt,De,zt,pe,Je,ut,li,Fe,Vt,je,Wt,ht,ri,ft,oi,pt,ai,yt,ci,gt,di,mt,ui,bt,hi,Be,Mt,Xe,Dt,Te,kt,G,H,J,B,Q;"use strict";var _i=Object.defineProperty;var qi=Object.getPrototypeOf;var Ri=Reflect.get;var Hi=(w,L,N)=>L in w?_i(w,L,{enumerable:!0,configurable:!0,writable:!0,value:N}):w[L]=N;var C=(w,L,N)=>(Hi(w,typeof L!="symbol"?L+"":L,N),N),It=(w,L,N)=>{if(!L.has(w))throw TypeError("Cannot "+N)};var a=(w,L,N)=>(It(w,L,"read from private field"),N?N.call(w):L.get(w)),g=(w,L,N)=>{if(L.has(w))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(w):L.set(w,N)},x=(w,L,N,f)=>(It(w,L,"write to private field"),f?f.call(w,N):L.set(w,N),N);var y=(w,L,N)=>(It(w,L,"access private method"),N),Qt=(w,L,N)=>Ri(qi(w),N,L);const L="",N="";function f(c,e,...t){const s=document.createElement(c);return typeof e=="function"?e(s):e!=null&&(s.className=e),t.length>0&&s.append(...t),s}const Ft="http://www.w3.org/2000/svg";function Ct(c,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,r=document.createElementNS(Ft,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${c}.svg${n}#${e}`),r}function Ne(c,e,t){return c instanceof SVGElement&&c.replaceChildren(Ct(e,t)),c}function V(c,e,t){const s=document.createElementNS(Ft,"svg");if(s.appendChild(Ct(c,e)),t!=null)for(let n of Object.entries(t))s.style.setProperty(n[0],n[1]);return s}function fi(c){const e=c.querySelectorAll("svg[data-id]");for(let t of e){const s=t.dataset.type,n=t.dataset.id;t.replaceChildren(Ct(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return c}const Oi="";function Qe(c,e="fa-regular",t,s=-1,n="check"){c.appendChild(f("layer",r=>{r.className="ui-check-inner",r.addEventListener("keypress",i=>{if(i.key===" "||i.key==="Enter"){const l=c.querySelector("input");l!=null&&(l.checked=!l.checked,l.dispatchEvent(new Event("change")))}}),s>=0&&(r.tabIndex=s)},V(e,n))),t instanceof Element?c.appendChild(t):(t==null?void 0:t.length)>0&&c.appendChild(f("span",r=>r.innerText=t))}function pi(c={}){const e=f("label","ui-check-wrapper ui-radio-wrapper",f("input",t=>{if(t.setAttribute("type","radio"),t.name=c.name,c.checked===!0&&(t.checked=!0),c.enabled===!1&&(t.disabled=!0),c.customerAttributes!=null)for(let s of Object.entries(c.customerAttributes))t.setAttribute(s[0],s[1]);typeof c.onchange=="function"&&t.addEventListener("change",c.onchange)}));return c.className&&e.classList.add(c.className),Qe(e,c.type,c.label,c.tabIndex,"circle"),e}function ie(c={}){const e=f("label","ui-check-wrapper",f("input",t=>{if(t.setAttribute("type","checkbox"),c.checked===!0&&(t.checked=!0),c.enabled===!1&&(t.disabled=!0),c.customerAttributes!=null)for(let s of Object.entries(c.customerAttributes))t.setAttribute(s[0],s[1]);typeof c.onchange=="function"&&t.addEventListener("change",c.onchange)}));return c.className&&e.classList.add(c.className),c.enabled===!1&&e.classList.add("disabled"),c.checkedNode!=null&&c.uncheckedNode!=null?(e.classList.add("ui-check-image-wrapper"),c.imageHeight,c.checkedNode.classList.add("checked"),e.appendChild(c.checkedNode),c.uncheckedNode.classList.add("unchecked"),e.appendChild(c.uncheckedNode)):Qe(e,c.type,c.label,c.tabIndex),e}function yi(c=document.body,e){if(e){const s=c.querySelectorAll('input[type="checkbox"]');for(let n of s){if(n.parentElement.classList.contains("ui-check-wrapper"))continue;const r=n.id;let i,l;if(r!=null&&(i=c.querySelector(`label[for="${r}"]`)),i==null){const o=n.nextElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:o.tagName==="SPAN"&&o.dataset.lgid!=null&&(l=o.innerText,o.style.display="none"))}if(i==null){const o=n.previousElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:l==null&&o.tagName==="SPAN"&&o.dataset.lgid!=null&&(l=o.innerText,o.style.display="none"))}i==null?(i=f("label"),n.parentElement.insertBefore(i,n)):l=i.innerText,n.disabled?i.className="ui-check-wrapper disabled":i.className="ui-check-wrapper",i.replaceChildren(),Qe(i,"fa-regular",l,n.tabIndex),i.insertBefore(n,i.firstChild)}}const t=c.querySelectorAll("label[data-checkbox]");for(let s of t){s.classList.contains("ui-check-wrapper")||s.classList.add("ui-check-wrapper"),s.hasChildNodes()?s.classList.contains("ui-check-image-wrapper")||s.classList.add("ui-check-image-wrapper"):(Qe(s,s.dataset.type,s.dataset.label,s.dataset.tabIndex),s.removeAttribute("data-type"),s.removeAttribute("data-label"));const n=f("input"),r=s.dataset.id;(r==null?void 0:r.length)>0&&(n.id=r),s.dataset.checked!=null&&(n.checked=!0),n.setAttribute("type","checkbox"),s.insertBefore(nLine truncated
|
||||
`).length;e.style.height=`${i*r.lineHeight+12}px`}}}const Ci=Symbol.for("ui-dropdown"),Nt=class extends Z{static createEdit(e,t,s){const n=new Ze({...t.dropOptions,parent:s});return n.onselected=e,n.create()}static setValue(e,t,s,n){if(e.tagName!=="DIV"){let i=y(this,Pe,Rt).call(this,s,n);i instanceof Promise?i.then(l=>y(this,ze,Ht).call(this,l,e,t)):y(this,ze,Ht).call(this,i,e,t);return}const r=y(this,$e,qt).call(this,e);if(r!=null){if(r.source==null||r.source.length===0){let i=y(this,Pe,Rt).call(this,s,n);if(i instanceof Promise){i.then(l=>{r.source=l,r.select(t,!0)});return}else i!=null&&(r.source=i)}r.select(t,!0)}}static getValue(e){return e.value}static setEnabled(e,t){const s=y(this,$e,qt).call(this,e);s!=null&&(s.disabled=t===!1)}};let ge=Nt;$e=new WeakSet,qt=function(e){const t=ne[Ci];if(t==null)return null;const s=e.dataset.dropId,n=t[s];return n??null},Pe=new WeakSet,Rt=function(e,t){let s=t.source;return typeof s=="function"&&(s=s(e)),s},ze=new WeakSet,Ht=function(e,t,s){const n=e==null?void 0:e.find(r=>r.value===s);n!=null&&(s=n.text),Qt(Nt,this,"setValue").call(this,t,s)},g(ge,$e),g(ge,Pe),g(ge,ze);class Tt extends Z{static createEdit(e){return ie({onchange:typeof e=="function"?e:null})}static setValue(e,t){e.querySelector("input").checked=t}static getValue(e){return e.target.checked}static setEnabled(e,t){e.querySelector("input").disabled=t===!1}}class Li extends Z{static create(){return f("span","col-icon")}static setValue(e,t,s,n,r){let i=n.className;typeof i=="function"&&(i=i.call(n,s)),i==null?e.className="col-icon":e.className=`col-icon ${i}`;let l=n.iconType;if(typeof l=="function"&&(l=l.call(n,s)),l??(l="fa-regular"),e.dataset.type!==l||e.dataset.icon!==t){const o=V(l,t);e.replaceChildren(o),!se(n.tooltip)&&Lt(e,n.tooltip,!1,r.element),e.dataset.type=l,e.dataset.icon=t}}static setEnabled(e,t){t===!1?e.classList.add("disabled"):e.classList.remove("disabled");const s=e.querySelector(".ui-tooltip-wrapper");s!=null&&(s.style.display=t===!1?"none":"")}}const et={Reorder:"reorder",Resize:"resize",Sort:"sort"},tt=bi()?32:0,Ei=200,Yt=4,Kt=4,_e=50,Ut=200;function it(c){var t;return c==null?null:(c.touches&&((t=c.touches[0])==null?void 0:t.clientX))??c.clientX}function Ti(c){let e=0;for(;c!=null;)e+=c.offsetLeft,c=c.offsetParent;return e}function qe(c){return Array.prototype.indexOf.call(c.parentElement.children,c)}const Si={0:Z,1:Xt,2:ge,3:Tt,4:Li,5:ki},Ye=class{constructor(e){g(this,Ee);g(this,lt);g(this,rt);g(this,ot);g(this,at);g(this,he);g(this,ct);g(this,dt);g(this,Ve);g(this,z);g(this,te);g(this,fe);g(this,We);g(this,Me);g(this,De);g(this,pe);g(this,ut);g(this,Fe);g(this,je);g(this,ht);g(this,ft);g(this,pt);g(this,yt);g(this,gt);g(this,mt);g(this,bt);g(this,Be);g(this,Xe);g(this,Te);g(this,j,void 0);g(this,$,void 0);g(this,xe,void 0);g(this,W,void 0);g(this,v,void 0);g(this,we,void 0);g(this,ke,-1);g(this,M,void 0);g(this,K,0);g(this,ce,void 0);g(this,de,void 0);g(this,ee,void 0);g(this,U,-1);g(this,Ce,void 0);g(this,ue,void 0);g(this,Le,{});g(this,I,{});g(this,At,[]);C(this,"columns",[]);C(this,"langs",{all:D("allItem","( All )"),ok:D("ok","OK"),reset:D("reset","Reset")});C(this,"virtualCount",100);C(this,"rowHeight",36);C(this,"lineHeight",24);C(this,"extraRows",0);C(this,"filterRowHeight",30);C(this,"height");C(this,"readonly");C(this,"multiSelect",!1);C(this,"fullrowClick",!0);C(this,"allowHtml",!1);C(this,"holderDisabled",!1);C(this,"headerVisible",!0);C(this,"window",ne);C(this,"sortIndex",-1);C(this,"sortDirection",1);C(this,"willSelect");C(this,"selectedRowChanged");C(this,"cellDblClicked");C(this,"cellClicked");C(this,"rowDblClicked");C(this,"columnChanged");x(this,xe,e)}get element(){return a(this,W)}get source(){var e;return(e=a(this,j))==null?void 0:e.map(t=>t.values)}set source(e){if(a(this,W)==null)throw new Error("grid has not been initialized.");if(!Array.isArray(e))throw new Error("source is not an Array.");e=e.map(t=>({values:t})),x(this,j,e),y(this,Ee,wt).call(this,e)}get virtual(){var e;return((e=a(this,$))==null?void 0:e.length)>this.virtualCount}get sortKey(){var e;return this.columns==null?null:(e=this.columns[this.sortIndex])==null?void 0:e.key}get selectedIndexes(){return a(this,M)}set selectedIndexes(e){const t=a(this,K);a(this,M).splice(0,a(this,M).length,...e),this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((s,n)=>{e.indexOf(t+n)>=0?s.classList.add("selected"):s.classList.contains("selected")&&s.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged()}get selectedIndex(){return(a(this,M)&&a(this,M)[0])??-1}get loading(){var e,t;return((t=(e=a(this,v).loading)==null?void 0:e.style)==null?void 0:t.visibility)==="visible"}set loading(e){a(this,v).loading!=null&&(e===!1?(a(this,v).loading.style.visibility="hidden",a(this,v).loading.style.opacity=0):(a(this,v).loading.style.visibility="visible",a(this,v).loading.style.opacity=1))}get scrollTop(){var e;return(e=a(this,v).body)==null?void 0:e.s
Line truncated
|
||||
(function(w,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(w=typeof globalThis<"u"?globalThis:w||self,L(w["lib-ui"]={}))})(this,function(w){var I,D,R,O,Y,be,He,oe,ae,ce,Ue,ve,wt,xe,kt,Oe,_t,$e,zt,Pe,Rt,Ve,Ht,F,H,we,V,v,ke,Ce,M,K,de,ue,ie,Z,Le,he,Ee,A,At,Te,Ct,ot,ti,at,ii,ct,si,dt,ni,fe,Ge,ut,li,ht,ri,Me,Ot,$,X,se,Ne,pe,Ze,We,$t,De,Pt,Fe,Vt,ye,Je,ft,oi,je,Mt,Be,Wt,pt,ai,yt,ci,gt,di,mt,ui,bt,hi,vt,fi,xt,pi,Xe,Dt,Ye,Ft,Se,Lt,j,U,J,B,Q;"use strict";var zi=Object.defineProperty;var Ri=Object.getPrototypeOf;var Hi=Reflect.get;var Oi=(w,L,N)=>L in w?zi(w,L,{enumerable:!0,configurable:!0,writable:!0,value:N}):w[L]=N;var C=(w,L,N)=>(Oi(w,typeof L!="symbol"?L+"":L,N),N),qt=(w,L,N)=>{if(!L.has(w))throw TypeError("Cannot "+N)};var a=(w,L,N)=>(qt(w,L,"read from private field"),N?N.call(w):L.get(w)),g=(w,L,N)=>{if(L.has(w))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(w):L.set(w,N)},x=(w,L,N,p)=>(qt(w,L,"write to private field"),p?p.call(w,N):L.set(w,N),N);var y=(w,L,N)=>(qt(w,L,"access private method"),N),ei=(w,L,N)=>Hi(Ri(w),N,L);const L="",N="";function p(d,e,...t){const s=document.createElement(d);return typeof e=="function"?e(s):e!=null&&(s.className=e),t.length>0&&s.append(...t),s}const jt="http://www.w3.org/2000/svg";function Et(d,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,l=document.createElementNS(jt,"use");return l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${d}.svg${n}#${e}`),l}function Ie(d,e,t){return d instanceof SVGElement&&d.replaceChildren(Et(e,t)),d}function P(d,e,t){const s=document.createElementNS(jt,"svg");if(s.appendChild(Et(d,e)),t!=null)for(let n of Object.entries(t))s.style.setProperty(n[0],n[1]);return s}function yi(d){const e=d.querySelectorAll("svg[data-id]");for(let t of e){const s=t.dataset.type,n=t.dataset.id;t.replaceChildren(Et(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return d}const $i="";function Qe(d,e="fa-regular",t,s=-1,n="check"){d.appendChild(p("layer",l=>{l.className="ui-check-inner",l.addEventListener("keypress",i=>{if(i.key===" "||i.key==="Enter"){const r=d.querySelector("input");r!=null&&(r.checked=!r.checked,r.dispatchEvent(new Event("change")))}}),s>=0&&(l.tabIndex=s)},P(e,n))),t instanceof Element?d.appendChild(t):(t==null?void 0:t.length)>0&&d.appendChild(p("span",l=>l.innerText=t))}function gi(d={}){const e=p("label","ui-check-wrapper ui-radio-wrapper",p("input",t=>{if(t.setAttribute("type","radio"),t.name=d.name,d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),Qe(e,d.type,d.label,d.tabIndex,"circle"),e}function ne(d={}){const e=p("label","ui-check-wrapper",p("input",t=>{if(t.setAttribute("type","checkbox"),d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),d.enabled===!1&&e.classList.add("disabled"),d.checkedNode!=null&&d.uncheckedNode!=null?(e.classList.add("ui-check-image-wrapper"),d.imageHeight,d.checkedNode.classList.add("checked"),e.appendChild(d.checkedNode),d.uncheckedNode.classList.add("unchecked"),e.appendChild(d.uncheckedNode)):Qe(e,d.type,d.label,d.tabIndex),e}function mi(d=document.body,e){if(e){const s=d.querySelectorAll('input[type="checkbox"]');for(let n of s){if(n.parentElement.classList.contains("ui-check-wrapper"))continue;const l=n.id;let i,r;if(l!=null&&(i=d.querySelector(`label[for="${l}"]`)),i==null){const o=n.nextElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:o.tagName==="SPAN"&&o.dataset.lgid!=null&&(r=o.innerText,o.style.display="none"))}if(i==null){const o=n.previousElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:r==null&&o.tagName==="SPAN"&&o.dataset.lgid!=null&&(r=o.innerText,o.style.display="none"))}i==null?(i=p("label"),n.parentElement.insertBefore(i,n)):r=i.innerText,n.disabled?i.className="ui-check-wrapper disabled":i.className="ui-check-wrapper",i.replaceChildren(),Qe(i,"fa-regular",r,n.tabIndex),i.insertBefore(n,i.firstChild)}}const t=d.querySelectorAll("label[data-checkbox]");for(let s of t){s.classList.contains("ui-check-wrapper")||s.classList.add("ui-check-wrapper"),s.hasChildNodes()?s.classList.contains("ui-check-image-wrapper")||s.classList.add("ui-check-image-wrapper"):(Qe(s,s.dataset.type,s.dataset.label,s.dataset.tabIndex),s.removeAttribute("data-type"),s.removeAttribute("data-label"));const n=p("input"),l=s.dataset.id;(l==null?void 0:l.length)>0&&(n.id=l),s.dataset.checked!=null&&(n.checked=!0),n.setAttribute("type","checkbox"),s.insertBefore(nLine truncated
|
||||
`).length;e.style.height=`${i*l.lineHeight+12}px`}}}const Ei=Symbol.for("ui-dropdown"),It=class extends te{static createEdit(e,t,s){const n=new tt({...t.dropOptions,parent:s});return n.onselected=e,n.create()}static setValue(e,t,s,n){if(e.tagName!=="DIV"){let i=y(this,Pe,Rt).call(this,s,n);i instanceof Promise?i.then(r=>y(this,Ve,Ht).call(this,r,e,t)):y(this,Ve,Ht).call(this,i,e,t);return}const l=y(this,$e,zt).call(this,e);if(l!=null){if(l.source==null||l.source.length===0){let i=y(this,Pe,Rt).call(this,s,n);if(i instanceof Promise){i.then(r=>{l.source=r,l.select(t,!0)});return}else i!=null&&(l.source=i)}l.select(t,!0)}}static getValue(e){return e.value}static setEnabled(e,t){super.setEnabled(e,t);const s=y(this,$e,zt).call(this,e);s!=null&&(s.disabled=t===!1)}};let me=It;$e=new WeakSet,zt=function(e){const t=le[Ei];if(t==null)return null;const s=e.dataset.dropId,n=t[s];return n??null},Pe=new WeakSet,Rt=function(e,t){let s=t.source;return typeof s=="function"&&(s=s(e)),s},Ve=new WeakSet,Ht=function(e,t,s){const n=e==null?void 0:e.find(l=>l.value===s);n!=null&&(s=n.text),ei(It,this,"setValue").call(this,t,s)},g(me,$e),g(me,Pe),g(me,Ve);class St extends te{static createEdit(e){return ne({onchange:typeof e=="function"?e:null})}static setValue(e,t){e.querySelector("input").checked=t}static getValue(e){return e.target.checked}static setEnabled(e,t){super.setEnabled(e,t),e.querySelector("input").disabled=t===!1}}class Ti extends te{static create(){return p("span","col-icon")}static setValue(e,t,s,n,l){let i=n.className;typeof i=="function"&&(i=i.call(n,s)),i==null?e.className="col-icon":e.className=`col-icon ${i}`;let r=n.iconType;if(typeof r=="function"&&(r=r.call(n,s)),r??(r="fa-regular"),e.dataset.type!==r||e.dataset.icon!==t){const o=P(r,t);e.replaceChildren(o),e.dataset.type=r,e.dataset.icon=t}}static setEnabled(e,t){super.setEnabled(e,t),t===!1?e.classList.add("disabled"):e.classList.remove("disabled")}}const it={Reorder:"reorder",Resize:"resize",Sort:"sort"},st=xi()?32:0,Si=200,Kt=4,Ut=4,_e=50,Gt=200;function nt(d){var t;return d==null?null:(d.touches&&((t=d.touches[0])==null?void 0:t.clientX))??d.clientX}function Ni(d){let e=0;for(;d!=null;)e+=d.offsetLeft,d=d.offsetParent;return e}function ze(d){return Array.prototype.indexOf.call(d.parentElement.children,d)}const Ii={0:te,1:Yt,2:me,3:St,4:Ti,5:Li},Ke=class{constructor(e){g(this,Te);g(this,ot);g(this,at);g(this,ct);g(this,dt);g(this,fe);g(this,ut);g(this,ht);g(this,Me);g(this,$);g(this,se);g(this,pe);g(this,We);g(this,De);g(this,Fe);g(this,ye);g(this,ft);g(this,je);g(this,Be);g(this,pt);g(this,yt);g(this,gt);g(this,mt);g(this,bt);g(this,vt);g(this,xt);g(this,Xe);g(this,Ye);g(this,Se);g(this,F,void 0);g(this,H,void 0);g(this,we,void 0);g(this,V,void 0);g(this,v,void 0);g(this,ke,void 0);g(this,Ce,-1);g(this,M,void 0);g(this,K,0);g(this,de,void 0);g(this,ue,void 0);g(this,ie,void 0);g(this,Z,-1);g(this,Le,void 0);g(this,he,void 0);g(this,Ee,{});g(this,A,{});g(this,At,[]);C(this,"columns",[]);C(this,"langs",{all:W("allItem","( All )"),ok:W("ok","OK"),reset:W("reset","Reset")});C(this,"virtualCount",100);C(this,"rowHeight",36);C(this,"lineHeight",24);C(this,"extraRows",0);C(this,"filterRowHeight",30);C(this,"height");C(this,"readonly");C(this,"multiSelect",!1);C(this,"fullrowClick",!0);C(this,"allowHtml",!1);C(this,"holderDisabled",!1);C(this,"headerVisible",!0);C(this,"window",le);C(this,"sortIndex",-1);C(this,"sortDirection",1);C(this,"willSelect");C(this,"selectedRowChanged");C(this,"cellDblClicked");C(this,"cellClicked");C(this,"rowDblClicked");C(this,"columnChanged");x(this,we,e)}get element(){return a(this,V)}get source(){var e;return(e=a(this,F))==null?void 0:e.map(t=>t.values)}set source(e){if(a(this,V)==null)throw new Error("grid has not been initialized.");if(!Array.isArray(e))throw new Error("source is not an Array.");e=e.map(t=>({values:t})),x(this,F,e),y(this,Te,Ct).call(this,e)}get virtual(){var e;return((e=a(this,H))==null?void 0:e.length)>this.virtualCount}get sortKey(){var e;return this.columns==null?null:(e=this.columns[this.sortIndex])==null?void 0:e.key}get selectedIndexes(){return a(this,M)}set selectedIndexes(e){const t=a(this,K);a(this,M).splice(0,a(this,M).length,...e),this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((s,n)=>{e.indexOf(t+n)>=0?s.classList.add("selected"):s.classList.contains("selected")&&s.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged()}get selectedIndex(){return(a(this,M)&&a(this,M)[0])??-1}get loading(){var e,t;return((t=(e=a(this,v).loading)==null?void 0:e.style)==null?void 0:t.visibility)==="visible"}set loading(e){a(this,v).loading!=null&&(e===!1?(a(this,v).loading.style.visibility="hidden",a(this,v).loading.style.opacity=0):(a(this,v).loading.style.visibility="visible",a(this,v).loading.style.opacity=1))}get scrollTop(){var e;return(e=a(this,v).body)==null?void 0:e.scrollTop}set scrollTop(e){a(this,v).body!=null&&(a(this,v).body.sc
Line truncated
|
||||
//# sourceMappingURL=ui.min.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"ui.min.js","sources":["../lib/functions.js","../lib/ui/icon.js","../lib/ui/checkbox.js","../lib/ui/tooltip.js","../lib/utility/strings.js","../lib/utility/lgres.js","../lib/utility.js","../lib/ui/dropdown.js","../lib/ui/grid/column.js","../lib/ui/grid/grid.js","../lib/ui/popup.js"],"sourcesContent":["export function createElement(tagName, init, ...children) {\r\n const element = document.createElement(tagName);\r\n if (typeof init === 'function') {\r\n init(element);\r\n } else if (init != null) {\r\n element.className = init;\r\n }\r\n if (children.length > 0) {\r\n element.append(...children);\r\n }\r\n return element;\r\n}\r\n","const svgns = 'http://www.w3.org/2000/svg';\r\n\r\nfunction createUse(type, id) {\r\n const c = typeof consts !== 'undefined' ? consts : {};\r\n const path = c.path || '';\r\n const ver = c.resver == null ? '' : `?${c.resver}`;\r\n const use = document.createElementNS(svgns, 'use');\r\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `${path}fonts/${type}.svg${ver}#${id}`);\r\n return use;\r\n}\r\n\r\nfunction changeIcon(svg, type, id) {\r\n if (svg instanceof SVGElement) {\r\n svg.replaceChildren(createUse(type, id));\r\n }\r\n return svg;\r\n}\r\n\r\nfunction createIcon(type, id, style) {\r\n const svg = document.createElementNS(svgns, 'svg');\r\n svg.appendChild(createUse(type, id));\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n svg.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n return svg;\r\n}\r\n\r\nfunction resolveIcon(container) {\r\n const svgs = container.querySelectorAll('svg[data-id]');\r\n for (let icon of svgs) {\r\n const type = icon.dataset.type;\r\n const id = icon.dataset.id;\r\n icon.replaceChildren(createUse(type, id));\r\n icon.removeAttribute('data-type');\r\n icon.removeAttribute('data-id');\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createIcon,\r\n changeIcon,\r\n resolveIcon\r\n}","import './css/checkbox.scss';\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\n\r\nfunction fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check') {\r\n container.appendChild(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-check-inner';\r\n layer.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n const input = container.querySelector('input');\r\n if (input != null) {\r\n input.checked = !input.checked;\r\n input.dispatchEvent(new Event('change'));\r\n }\r\n }\r\n });\r\n if (tabindex >= 0) {\r\n layer.tabIndex = tabindex;\r\n }\r\n }, createIcon(type, charactor))\r\n );\r\n if (label instanceof Element) {\r\n container.appendChild(label);\r\n } else if (label?.length > 0) {\r\n container.appendChild(\r\n createElement('span', span => span.innerText = label)\r\n );\r\n }\r\n}\r\n\r\nfunction createRadiobox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper ui-radio-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'radio');\r\n input.name = opts.name;\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle');\r\n return container;\r\n}\r\n\r\nfunction createCheckbox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'checkbox');\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n Line truncated
|
||||
{"version":3,"file":"ui.min.js","sources":["../lib/functions.js","../lib/ui/icon.js","../lib/ui/checkbox.js","../lib/ui/tooltip.js","../lib/utility/strings.js","../lib/utility/lgres.js","../lib/utility.js","../lib/ui/dropdown.js","../lib/ui/grid/column.js","../lib/ui/grid/grid.js","../lib/ui/popup.js"],"sourcesContent":["export function createElement(tagName, init, ...children) {\r\n const element = document.createElement(tagName);\r\n if (typeof init === 'function') {\r\n init(element);\r\n } else if (init != null) {\r\n element.className = init;\r\n }\r\n if (children.length > 0) {\r\n element.append(...children);\r\n }\r\n return element;\r\n}\r\n","const svgns = 'http://www.w3.org/2000/svg';\r\n\r\nfunction createUse(type, id) {\r\n const c = typeof consts !== 'undefined' ? consts : {};\r\n const path = c.path || '';\r\n const ver = c.resver == null ? '' : `?${c.resver}`;\r\n const use = document.createElementNS(svgns, 'use');\r\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `${path}fonts/${type}.svg${ver}#${id}`);\r\n return use;\r\n}\r\n\r\nfunction changeIcon(svg, type, id) {\r\n if (svg instanceof SVGElement) {\r\n svg.replaceChildren(createUse(type, id));\r\n }\r\n return svg;\r\n}\r\n\r\nfunction createIcon(type, id, style) {\r\n const svg = document.createElementNS(svgns, 'svg');\r\n svg.appendChild(createUse(type, id));\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n svg.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n return svg;\r\n}\r\n\r\nfunction resolveIcon(container) {\r\n const svgs = container.querySelectorAll('svg[data-id]');\r\n for (let icon of svgs) {\r\n const type = icon.dataset.type;\r\n const id = icon.dataset.id;\r\n icon.replaceChildren(createUse(type, id));\r\n icon.removeAttribute('data-type');\r\n icon.removeAttribute('data-id');\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createIcon,\r\n changeIcon,\r\n resolveIcon\r\n}","import './css/checkbox.scss';\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\n\r\nfunction fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check') {\r\n container.appendChild(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-check-inner';\r\n layer.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n const input = container.querySelector('input');\r\n if (input != null) {\r\n input.checked = !input.checked;\r\n input.dispatchEvent(new Event('change'));\r\n }\r\n }\r\n });\r\n if (tabindex >= 0) {\r\n layer.tabIndex = tabindex;\r\n }\r\n }, createIcon(type, charactor))\r\n );\r\n if (label instanceof Element) {\r\n container.appendChild(label);\r\n } else if (label?.length > 0) {\r\n container.appendChild(\r\n createElement('span', span => span.innerText = label)\r\n );\r\n }\r\n}\r\n\r\nfunction createRadiobox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper ui-radio-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'radio');\r\n input.name = opts.name;\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle');\r\n return container;\r\n}\r\n\r\nfunction createCheckbox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'checkbox');\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n Line truncated
|
||||
Reference in new issue
Block a user