sync
This commit is contained in:
1 parent
c9723008af
commit
d831a707ae
4 files changed
+26
-11
No files matched your search
+23
-8
@@ -50,8 +50,23 @@ if (typeof ($assetsummary) != "function") {
|
||||
|
||||
p.append(this.basectrl);
|
||||
|
||||
this.maskbgctrl = $('<div class="maskbg"><div class="loading_icon icon c-spin"></div></div>');
|
||||
p.append(this.maskbgctrl);
|
||||
//this.maskbgctrl = $('<div class="maskbg"><div class="loading_icon icon c-spin"></div></div>');
|
||||
//p.append(this.maskbgctrl);
|
||||
|
||||
this.loadingicon = $('<span class="loading c-spin" style="top: 60px;right: 13px;font-size: 20px;color: black;position: absolute;left:unset;width:unset;height:unset;line-height:unset;"></span>');
|
||||
p.append(this.loadingicon);
|
||||
|
||||
this.loadingCount = 0;
|
||||
this.showLoading = function () {
|
||||
this.loadingCount++;
|
||||
this.loadingicon.show();
|
||||
}
|
||||
|
||||
this.hideLoading = function () {
|
||||
this.loadingCount--;
|
||||
if (this.loadingCount === 0)
|
||||
this.loadingicon.hide();
|
||||
}
|
||||
|
||||
this.refresh = function () {
|
||||
p.parent(".contentPane").unbind();
|
||||
@@ -530,8 +545,9 @@ if (typeof ($assetsummary) != "function") {
|
||||
}
|
||||
|
||||
function loadAssetInfo() {
|
||||
_this.maskbgctrl.show();
|
||||
_this.showLoading();
|
||||
devicerequest('GetAssetSummaryInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) {
|
||||
_this.hideLoading();
|
||||
if (typeof data === 'string') {
|
||||
_dialog.showAlert(GetTextByKey("P_SELECTASSETS_FAILEDGETLIST", 'Failed to get the machine list: ') + data, "Asset Summary");
|
||||
return;
|
||||
@@ -539,24 +555,23 @@ if (typeof ($assetsummary) != "function") {
|
||||
_this.asset = data;
|
||||
if (_this.status == 0)
|
||||
showAssetInfo();
|
||||
_this.maskbgctrl.hide();
|
||||
}, function () {
|
||||
_this.maskbgctrl.hide();
|
||||
_this.hideLoading();
|
||||
});
|
||||
}
|
||||
|
||||
function loadAssetExtInfo() {
|
||||
//_this.maskbgctrl.show();
|
||||
_this.showLoading();
|
||||
devicerequest('GetAssetExtInfo', _this.companyid + String.fromCharCode(170) + _this.assetid, function (data) {
|
||||
_this.hideLoading();
|
||||
if (typeof data === 'string') {
|
||||
return;
|
||||
}
|
||||
_this.assetext = data;
|
||||
if (_this.status == 0 && _this.asset)
|
||||
showAssetExtInfo(_this.assetext);
|
||||
//_this.maskbgctrl.hide();
|
||||
}, function () {
|
||||
//_this.maskbgctrl.hide();
|
||||
_this.hideLoading();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"app.min.js","sources":["../../../../../../FI_G3/_wsp/UILib/ui-lib/lib/app/communications/lib.js","../../../../../../FI_G3/_wsp/UILib/ui-lib/lib/app/communications/contact.js","../../../../../../FI_G3/_wsp/UILib/ui-lib/lib/app/communications/follower.js","../../../../../../FI_G3/_wsp/UILib/ui-lib/lib/app/communications/customer.js","../../../../../../FI_G3/_wsp/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\Line 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 { 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-labLine truncated
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
(function(k,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(k=typeof globalThis<"u"?globalThis:k||self,T(k["lib-ui"]={}))})(this,function(k){var N,j,H,z,K,we,Pe,ce,de,ue,Qe,ke,kt,Ce,Ct,ze,Rt,Ve,Ht,We,Ot,Me,$t,B,O,Le,M,b,Ee,Te,D,U,he,fe,se,G,Se,pe,Ne,A,De,Ae,Lt,ct,ii,dt,si,ut,ni,ye,Ze,ht,li,ft,ri,Fe,Pt,V,Y,ne,_e,ge,et,je,zt,Be,Vt,Xe,Wt,me,tt,pt,oi,Ye,Mt,Ke,Dt,yt,ai,gt,ci,mt,di,bt,ui,vt,hi,xt,fi,wt,pi,Ue,Ft,Ge,jt,Ie,Et,J,R,Q,X,te;"use strict";var Ri=Object.defineProperty;var Hi=Object.getPrototypeOf;var Oi=Reflect.get;var $i=(k,T,S)=>T in k?Ri(k,T,{enumerable:!0,configurable:!0,writable:!0,value:S}):k[T]=S;var E=(k,T,S)=>($i(k,typeof T!="symbol"?T+"":T,S),S),qt=(k,T,S)=>{if(!T.has(k))throw TypeError("Cannot "+S)};var o=(k,T,S)=>(qt(k,T,"read from private field"),S?S.call(k):T.get(k)),m=(k,T,S)=>{if(T.has(k))throw TypeError("Cannot add the same private member more than once");T instanceof WeakSet?T.add(k):T.set(k,S)},x=(k,T,S,f)=>(qt(k,T,"write to private field"),f?f.call(k,S):T.set(k,S),S);var p=(k,T,S)=>(qt(k,T,"access private method"),S),ti=(k,T,S)=>Oi(Hi(k),S,T);const T="",S="";function f(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 Bt="http://www.w3.org/2000/svg";function Tt(d,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,r=document.createElementNS(Bt,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${d}.svg${n}#${e}`),r}function qe(d,e,t){return d instanceof SVGElement&&d.replaceChildren(Tt(e,t)),d}function W(d,e,t){const s=document.createElementNS(Bt,"svg");if(s.appendChild(Tt(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(Tt(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return d}const Pi="";function it(d,e="fa-regular",t,s=-1,n="check"){d.appendChild(f("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)},W(e,n))),t instanceof Element?d.appendChild(t):(t==null?void 0:t.length)>0&&d.appendChild(f("span",r=>r.innerText=t))}function gi(d={}){const e=f("label","ui-check-wrapper ui-radio-wrapper",f("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),it(e,d.type,d.label,d.tabIndex,"circle"),e}function le(d={}){const e=f("label","ui-check-wrapper",f("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)):it(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 a=n.nextElementSibling;a!=null&&(a.tagName==="LABEL"?i=a:a.tagName==="SPAN"&&a.dataset.lgid!=null&&(l=a.innerText,a.style.display="none"))}if(i==null){const a=n.previousElementSibling;a!=null&&(a.tagName==="LABEL"?i=a:l==null&&a.tagName==="SPAN"&&a.dataset.lgid!=null&&(l=a.innerText,a.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(),it(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"):(it(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(n,s.fiLine truncated
|
||||
(function(k,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(k=typeof globalThis<"u"?globalThis:k||self,T(k["lib-ui"]={}))})(this,function(k){var N,j,H,z,K,we,Pe,ce,de,ue,Qe,ke,kt,Ce,Ct,ze,Rt,Ve,Ht,We,Ot,Me,$t,B,O,Le,M,b,Ee,Te,D,U,he,fe,se,G,Se,pe,Ne,A,De,Ae,Lt,ct,ii,dt,si,ut,ni,ye,Ze,ht,li,ft,ri,Fe,Pt,V,Y,ne,_e,ge,et,je,zt,Be,Vt,Xe,Wt,me,tt,pt,oi,Ye,Mt,Ke,Dt,yt,ai,gt,ci,mt,di,bt,ui,vt,hi,xt,fi,wt,pi,Ue,Ft,Ge,jt,Ie,Et,J,R,Q,X,te;"use strict";var Ri=Object.defineProperty;var Hi=Object.getPrototypeOf;var Oi=Reflect.get;var $i=(k,T,S)=>T in k?Ri(k,T,{enumerable:!0,configurable:!0,writable:!0,value:S}):k[T]=S;var E=(k,T,S)=>($i(k,typeof T!="symbol"?T+"":T,S),S),qt=(k,T,S)=>{if(!T.has(k))throw TypeError("Cannot "+S)};var o=(k,T,S)=>(qt(k,T,"read from private field"),S?S.call(k):T.get(k)),m=(k,T,S)=>{if(T.has(k))throw TypeError("Cannot add the same private member more than once");T instanceof WeakSet?T.add(k):T.set(k,S)},x=(k,T,S,f)=>(qt(k,T,"write to private field"),f?f.call(k,S):T.set(k,S),S);var p=(k,T,S)=>(qt(k,T,"access private method"),S),ti=(k,T,S)=>Oi(Hi(k),S,T);const T="",S="";function f(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 Bt="http://www.w3.org/2000/svg";function Tt(d,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,r=document.createElementNS(Bt,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${d}.svg${n}#${e}`),r}function qe(d,e,t){return d instanceof SVGElement&&d.replaceChildren(Tt(e,t)),d}function W(d,e,t){const s=document.createElementNS(Bt,"svg");if(s.appendChild(Tt(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(Tt(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return d}const Pi="";function it(d,e="fa-regular",t,s=-1,n="check"){d.appendChild(f("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)},W(e,n))),t instanceof Element?d.appendChild(t):(t==null?void 0:t.length)>0&&d.appendChild(f("span",r=>r.innerText=t))}function gi(d={}){const e=f("label","ui-check-wrapper ui-radio-wrapper",f("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),it(e,d.type,d.label,d.tabIndex,"circle"),e}function le(d={}){const e=f("label","ui-check-wrapper",f("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)):it(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 a=n.nextElementSibling;a!=null&&(a.tagName==="LABEL"?i=a:a.tagName==="SPAN"&&a.dataset.lgid!=null&&(l=a.innerText,a.style.display="none"))}if(i==null){const a=n.previousElementSibling;a!=null&&(a.tagName==="LABEL"?i=a:l==null&&a.tagName==="SPAN"&&a.dataset.lgid!=null&&(l=a.innerText,a.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(),it(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"):(it(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(n,s.fiLine truncated
|
||||
`).length;e.style.height=`${i*r.lineHeight+12}px`}}}const Ei=Symbol.for("ui-dropdown"),_t=class extends ie{static createEdit(e,t,s){const n=new st({...t.dropOptions,parent:s});return n.onselected=e,n.create()}static setValue(e,t,s,n){if(e.tagName!=="DIV"){let i=p(this,We,Ot).call(this,s,n);i instanceof Promise?i.then(l=>p(this,Me,$t).call(this,l,e,t)):p(this,Me,$t).call(this,i,e,t);return}const r=p(this,Ve,Ht).call(this,e);if(r!=null){if(r.source==null||r.source.length===0){let i=p(this,We,Ot).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=p(this,Ve,Ht).call(this,e);s!=null&&(s.disabled=t===!1)}};let xe=_t;Ve=new WeakSet,Ht=function(e){const t=oe[Ei];if(t==null)return null;const s=e.dataset.dropId,n=t[s];return n??null},We=new WeakSet,Ot=function(e,t){let s=t.source;return typeof s=="function"&&(s=s(e)),s},Me=new WeakSet,$t=function(e,t,s){const n=e==null?void 0:e.find(r=>r.value===s);n!=null&&(s=n.text),ti(_t,this,"setValue").call(this,t,s)},m(xe,Ve),m(xe,We),m(xe,Me);class At extends ie{static createEdit(e){return le({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 Ti extends ie{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 a=W(l,t);e.replaceChildren(a),!re(n.tooltip)&&St(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 nt={Reorder:"reorder",Resize:"resize",Sort:"sort"},lt=xi()?32:0,Si=200,Ut=4,Gt=4,He=50,Jt=200;function rt(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 Oe(d){return Array.prototype.indexOf.call(d.parentElement.children,d)}const Ai={0:ie,1:Kt,2:xe,3:At,4:Ti,5:Li},Je=class{constructor(e){m(this,Ae);m(this,ct);m(this,dt);m(this,ut);m(this,ye);m(this,ht);m(this,ft);m(this,Fe);m(this,V);m(this,ne);m(this,ge);m(this,je);m(this,Be);m(this,Xe);m(this,me);m(this,pt);m(this,Ye);m(this,Ke);m(this,yt);m(this,gt);m(this,mt);m(this,bt);m(this,vt);m(this,xt);m(this,wt);m(this,Ue);m(this,Ge);m(this,Ie);m(this,B,void 0);m(this,O,void 0);m(this,Le,void 0);m(this,M,void 0);m(this,b,void 0);m(this,Ee,void 0);m(this,Te,-1);m(this,D,void 0);m(this,U,0);m(this,he,void 0);m(this,fe,void 0);m(this,se,void 0);m(this,G,-1);m(this,Se,void 0);m(this,pe,void 0);m(this,Ne,{});m(this,A,{});m(this,De,[]);E(this,"columns",[]);E(this,"langs",{all:F("allItem","( All )"),ok:F("ok","OK"),reset:F("reset","Reset")});E(this,"virtualCount",100);E(this,"rowHeight",36);E(this,"lineHeight",24);E(this,"extraRows",0);E(this,"filterRowHeight",30);E(this,"height");E(this,"readonly");E(this,"multiSelect",!1);E(this,"fullrowClick",!0);E(this,"allowHtml",!1);E(this,"holderDisabled",!1);E(this,"headerVisible",!0);E(this,"window",oe);E(this,"sortIndex",-1);E(this,"sortDirection",1);E(this,"willSelect");E(this,"selectedRowChanged");E(this,"cellDblClicked");E(this,"cellClicked");E(this,"rowDblClicked");E(this,"columnChanged");x(this,Le,e)}get element(){return o(this,M)}get source(){var e;return(e=o(this,B))==null?void 0:e.map(t=>t.values)}set source(e){if(o(this,M)==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,B,e),p(this,Ae,Lt).call(this,e)}get virtual(){var e;return((e=o(this,O))==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 o(this,D)}set selectedIndexes(e){const t=o(this,U);o(this,D).splice(0,o(this,D).length,...e),this.readonly!==!0?this.refresh():[...o(this,b).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(o(this,D)&&o(this,D)[0])??-1}get loading(){var e,t;return((t=(e=o(this,b).loading)==null?void 0:e.style)==null?void 0:t.visibility)==="visible"}set loading(e){o(this,b).loading!=null&&(e===!1?(o(this,b).loading.style.visibility="hidden",o(this,b).loading.style.opacity=0):(o(this,b).loading.style.visibility="visible",o(this,b).loading.style.opacity=1))}get scrollTop(){var e;return(e=o(this,b).body)==null?void 0:e.scrollTo
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