This commit is contained in:
lchen committed 2023-06-05 10:10:22 +08:00
1 parent 9da1c4cf30
commit 634e8b71ab
18 files changed
+367 -143

No files matched your search

+6 -6
View File
@@ -1,11 +1,11 @@
(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
(function(O,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(O=typeof globalThis<"u"?globalThis:O||self,E(O["lib-app"]={}))})(this,function(O){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 Oe=(O,E,P)=>{if(!E.has(O))throw TypeError("Cannot "+P)};var e=(O,E,P)=>(Oe(O,E,"read from private field"),P?P.call(O):E.get(O)),N=(O,E,P)=>{if(E.has(O))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(O):E.set(O,P)},v=(O,E,P,re)=>(Oe(O,E,"write to private field"),re?re.call(O,P):E.set(O,P),P);var be=(O,E,P)=>(Oe(O,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,ve=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);v(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 ve({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"),v(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);v(this,K,t)}async show(t,n=document.body){const s=S("div","selcontact-grid"),p=await new ve({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)+`
`))}}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"))]);v(this,Z,be(this,fe,Ae).call(this,p,t)),v(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}),v(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 v(this,W,d),p.appendChild(d),v(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
${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.style.padding="10px 0 6px 12px",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 Reco Line truncated
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
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=[])},v(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 v(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);v(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),v(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 v(this,oe,u),t.appendChild(u),v(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"})});
`);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,O.CustomerCommunication=Ye,O.InternalComment=Qe,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
//# sourceMappingURL=app.min.js.map
+1 -1
View File
@@ -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 { 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
{"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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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 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
(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,Pe,zt,$e,Rt,Ve,Ht,F,H,we,V,v,ke,Ce,M,K,de,ue,ie,Z,Le,he,Ee,q,At,Te,Ct,ot,ti,at,ii,ct,si,dt,ni,fe,Ge,ut,li,ht,ri,Me,Ot,P,X,se,Ne,pe,Ze,We,Pt,De,$t,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)),b=(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}`,r=document.createElementNS(jt,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${d}.svg${n}#${e}`),r}function Ie(d,e,t){return d instanceof SVGElement&&d.replaceChildren(Et(e,t)),d}function $(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 Pi="";function Qe(d,e="fa-regular",t,s=-1,n="check"){d.appendChild(p("layer",r=>{r.className="ui-check-inner",r.addEventListener("keypress",i=>{if(i.key===" "||i.key==="Enter"){const l=d.querySelector("input");l!=null&&(l.checked=!l.checked,l.dispatchEvent(new Event("change")))}}),s>=0&&(r.tabIndex=s)},$(e,n))),t instanceof Element?d.appendChild(t):(t==null?void 0:t.length)>0&&d.appendChild(p("span",r=>r.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 r=n.id;let i,l;if(r!=null&&(i=d.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=p("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=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"),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 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,$e,Rt).call(this,s,n);i instanceof Promise?i.then(l=>y(this,Ve,Ht).call(this,l,e,t)):y(this,Ve,Ht).call(this,i,e,t);return}const r=y(this,Pe,zt).call(this,e);if(r!=null){if(r.source==null||r.source.length===0){let i=y(this,$e,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){super.setEnabled(e,t);const s=y(this,Pe,zt).call(this,e);s!=null&&(s.disabled=t===!1)}};let me=It;Pe=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},$e=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(r=>r.value===s);n!=null&&(s=n.text),ei(It,this,"setValue").call(this,t,s)},b(me,Pe),b(me,$e),b(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,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=$(l,t);e.replaceChildren(o),e.dataset.type=l,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){b(this,Te);b(this,ot);b(this,at);b(this,ct);b(this,dt);b(this,fe);b(this,ut);b(this,ht);b(this,Me);b(this,P);b(this,se);b(this,pe);b(this,We);b(this,De);b(this,Fe);b(this,ye);b(this,ft);b(this,je);b(this,Be);b(this,pt);b(this,yt);b(this,gt);b(this,mt);b(this,bt);b(this,vt);b(this,xt);b(this,Xe);b(this,Ye);b(this,Se);b(this,F,void 0);b(this,H,void 0);b(this,we,void 0);b(this,V,void 0);b(this,v,void 0);b(this,ke,void 0);b(this,Ce,-1);b(this,M,void 0);b(this,K,0);b(this,de,void 0);b(this,ue,void 0);b(this,ie,void 0);b(this,Z,-1);b(this,Le,void 0);b(this,he,void 0);b(this,Ee,{});b(this,q,{});b(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
View File
@@ -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