@ninebone/grid 0.0.10 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.html +2 -2
- package/dist/nine-grid.js +4 -5
- package/dist/nine-grid.js.map +1 -1
- package/dist/nine-grid.umd.js +5 -5
- package/dist/nine-grid.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-grid.umd.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
to { transform: rotate(360deg); }
|
|
34
34
|
}
|
|
35
35
|
`,document.head.appendChild(t)}E.style.display="flex"},hide:()=>{const E=document.getElementById("global-loading-overlay");E&&(E.style.display="none")}}),it(St,"i18n",{convertArrayToJSON:E=>{let t={};for(const l of E){if(!l)continue;const c=l.indexOf("=");if(c<=0)continue;const o=l.substring(0,c).split("."),r=l.substring(c+1);let n=t;for(let s=0;s<o.length;s++)s===o.length-1?n[o[s]]=r:(n[o[s]]||(n[o[s]]={}),n=n[o[s]])}return t},updateContent:()=>{St.querySelectorAll("nx-i18n,nx-span").forEach(E=>{E.refresh&&E.refresh()}),St.querySelectorAll("nine-grid").forEach(E=>{E.refresh&&E.refreshData()})},addResourceBundle:E=>{let t=Math.floor(E.length/2);for(var l=0;l<E.length&&!(l+1>=E.length);l+=2){const c=E[l],o=E[l+1];$.ajax({url:o,dataType:"text",success:r=>{i18next.addResourceBundle(c,"translation",St.i18n.convertArrayToJSON(r.split(`
|
|
36
|
-
`))),--t==0&&i18next.changeLanguage(St.global.locale)}})}},init:()=>{i18next.init({lng:St.global.locale,debug:window.location.hostname=="localhost",resources:{}},function(E,t){E&&console.error(E)}),i18next.on("languageChanged",()=>{St.i18n.updateContent()})},t:E=>(console.log(i18next),i18next.t(E))}),it(St,"alert",(E,t,l)=>ls.alert(E,t,l)),it(St,"filter",(E,t)=>{const l=(c,o)=>{const r=c[o.key];if(o.match){const n=o.match;if(n.value!==void 0)return r===n.value;if(n.any&&Array.isArray(n.any))return n.any.includes(r);if(n.all&&Array.isArray(n.all))return Array.isArray(r)?n.all.every(s=>r.includes(s)):!1;if(n.text!==void 0)return typeof r=="string"&&r.includes(n.text)}if(o.range){const n=o.range;return typeof r=="string"&&typeof n.gte=="string"||typeof r=="number"?!(n.gte!==void 0&&r<n.gte||n.gt!==void 0&&r<=n.gt||n.lte!==void 0&&r>n.lte||n.lt!==void 0&&r>=n.lt):!1}return!1};return!E||!Array.isArray(E)?(console.error("첫 번째 인수는 JSON 배열이어야 합니다."),[]):!t||typeof t!="object"?E:E.filter(c=>!(t.must&&!t.must.every(o=>l(c,o))||t.should&&t.should.length>0&&!t.should.some(o=>l(c,o))||(t.should&&t.should.length===0&&(t.must||t.must_not),t.must_not&&t.must_not.some(o=>l(c,o)))))}),it(St,"j",{copyEvents:(E,t)=>{const l=getEventListeners(E);for(const[c,o]of Object.entries(l))o.forEach(r=>{t.addEventListener(c,r.listener,r.options)})},querySelectorAll:(E,t=document)=>{let l=[];return t instanceof NodeList?t.forEach(c=>{E instanceof NodeList?E.forEach(o=>{l.push(...c.querySelectorAll(o))}):E instanceof HTMLElement?l.push(...c.querySelectorAll(E)):l.push(...c.querySelectorAll(E))}):E instanceof HTMLElement?l=[E]:E instanceof NodeList?E.forEach(c=>{l.push(...t.querySelectorAll(c))}):l=t.querySelectorAll(E),{elements:l,elem(){return l[0]},clone(c=!1){const o=[];return l.forEach(r=>{const n=r.cloneNode(!0);c&&St.j.copyEvents(r,n),o.push(n)}),this.elements=o,this},children(){let c=[];return l.forEach(o=>{c.push(...o.children)}),this.elements=c,this},attr(c,o){return o===void 0?l[0]?l[0].getAttribute(c):null:(l.forEach(r=>{o===!1?r.removeAttribute(c):r.setAttribute(c,o===!0?"true":o)}),this)},removeAttr(...c){return c.forEach(o=>{l.forEach(r=>{r.removeAttribute(o)})}),this},css(c,o){return l.forEach(r=>{r.style[c]=o}),this},hasClass(c){return(Array.isArray(l)?l:Array.from(l)).some(r=>r.classList.contains(c))},addClass(c){return l.forEach(o=>{o.classList.add(c)}),this},removeClass(c){return l.forEach(o=>{o.classList.remove(c)}),this},show(){return l.forEach(c=>{c.style.display="",getComputedStyle(c).display==="none"&&(c.style.display="block")}),this},hide(){return l.forEach(c=>{c.style.display="none"}),this}}}}),it(St,"x",{querySelectorAll:(E,t=document)=>{let l=E instanceof HTMLElement?[E]:t.querySelectorAll(E);return{elements:l,elem:function(){return l[0]},attr:function(c,o){return o===void 0?l[0]?l[0].getAttribute(c):null:(l.forEach(r=>{o===!1?r.removeAttribute(c):r.setAttribute(c,o===!0?"true":o)}),this)},css:function(c,o){return l.forEach(r=>{r.style[c]=o}),this},addClass:function(c){return l.forEach(o=>{o.classList.contains(c)||o.classList.add(c)}),this},removeClass:function(c){return l.forEach(o=>{o.classList.contains(c)&&o.classList.remove(c)}),this}}}});let H=St;Array.prototype.nineBinarySearch=function(vt){let E=0,t=this.length-1,l;for(;E<=t;){if(l=parseInt((E+t)/2),vt==this[l])return l;vt<this[l]?t=l-1:E=l+1}return-1};class Pu extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const E=document.createElement("button");E.textContent="클릭하세요!",E.style.padding="10px",E.style.backgroundColor="blue",E.style.color="white",this.shadowRoot.appendChild(E)}}customElements.get("nine-grid4")||customElements.define("nine-grid4",Pu);class Du extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const E=document.createElement("button");E.textContent="클릭하세요!",E.style.padding="10px",E.style.backgroundColor="blue",E.style.color="white",this.shadowRoot.appendChild(E)}}customElements.get("nine-grid3")||customElements.define("nine-grid3",Du);class _r extends HTMLElement{constructor(){super();Y(this,Gn);Y(this,Kn);Y(this,Zn);Y(this,hs);it(this,"getDisplayText",t=>{if(this.cell)if(this.cell.closest("tbody")){const l=this.cell.closest("tr").data,c=parseInt(this.cell.dataset.row);if(!l)return"";if(H.isNull(this.cell.dataset.expr)){if(!H.isNull(this.cell.dataset.bind))return l[this.cell.dataset.bind]||H.nvl(t,"")}else try{return this.getExprValue(this.cell.dataset.expr,l,c,this.cell)}catch{console.error(this.cell.dataset.expr,l,this.cell.dataset.row)}return H.nvl(t,"")}else try{return this.owner.exprFunction(this.cell.dataset.expr).call(this,null,-1,this.owner.data)}catch{}});it(this,"reset",()=>{var t=parseInt(this.cell.dataset.row),l=this.cell.closest("tr"),c=l.data;if(c||(c=this.owner.data.get(t),this.owner.body.querySelectorAll(`.ng-container tbody tr[data-row="${t}"]`).forEach(i=>{i.data=c})),this.cell.dataset.bind&&this.shadowRoot.querySelector("input,textarea,button")&&(H.j.querySelectorAll(this.cell).removeClass("ng-changed"),c.__ng.o.hasOwnProperty(this.cell.dataset.bind)&&c[this.cell.dataset.bind]!=c.__ng.o[this.cell.dataset.bind]&&H.j.querySelectorAll(this.cell).addClass("ng-changed")),(this.getAttribute("show-icon")||this.cell.getAttribute("show-icon"))=="true"){var e=this.getAttribute("icon-color")||this.cell.getAttribute("icon-color");if(e){var o=this.getExprValue(e,c,t);this.shadowRoot.querySelector("ng-expand-icon").setAttribute("color",o)}var e=this.getAttribute("icon-src")||this.cell.getAttribute("icon-src");if(e){var r=this.getExprValue(e,c,t);this.shadowRoot.querySelector("ng-expand-icon").setAttribute("src",r)}}if(f(this,hs)){var e=this.getAttribute("button-image")||this.cell.getAttribute("button-image");if(e){var r=this.getExprValue(e,c,t);r&&($(f(this,hs)).text(""),$(f(this,hs)).css({border:"none","background-color":"transparent","background-image":r.startsWith("<svg")?`url('data:image/svg+xml;utf8,${r}')`:`url("${r}")`}))}}var e=this.getAttribute("class-expr");if(e){this.classList.forEach(i=>{["aaa"].includes(i)||this.classList.remove(i)});var n=this.getExprValue(e,c,t);n&&this.classList.toggle(n)}var e=this.cell.getAttribute("enable-check");if(e){var s=this.shadowRoot.querySelector("ng-expand-check");s&&s.shadowRoot.querySelector("input").setAttribute("disabled",!this.getExprValue(e,c,t))}var e=this.cell.getAttribute("enable-button");if(e){var s=this.shadowRoot.querySelector("ng-expand-button");s&&s.shadowRoot.querySelector("button").setAttribute("disabled",!this.getExprValue(e,c,t))}var e=this.getAttribute("visible")||this.cell.getAttribute("visible");e?this.getExprValue(e,c,t)?H.j.querySelectorAll(this.cell).removeClass("hidden"):H.j.querySelectorAll(this.cell).addClass("hidden"):H.j.querySelectorAll(this.cell).removeClass("hidden");var e=this.getAttribute("enable")||this.cell.getAttribute("enable");e?H.j.querySelectorAll("input,textarea,button",this.shadowRoot).attr("disabled",!this.getExprValue(e,c,t)):H.j.querySelectorAll("input,textarea,button",this.shadowRoot).attr("disabled",!1);var e=this.getAttribute("readonly")||this.cell.getAttribute("readonly");e?H.j.querySelectorAll("input,textarea",this.shadowRoot).attr("readonly",this.getExprValue(e,c,t)):H.j.querySelectorAll("input,textarea,button",this.shadowRoot).attr("readonly",!1),["color","background-color","class"].forEach(i=>{var u=this.cell.getAttribute(i);u&&$(this.cell).css({[i]:this.getExprValue(u,c,t)})}),$(this.cell).children().each((i,u)=>{var a=u.getAttribute("tooltip");a&&H.j.querySelectorAll(u).attr("title",this.owner.exprFunction(a).call(this,this.cell.closest("tr").data,t))}),f(this,Pl).call(this)});Y(this,Pl,()=>{if(!(!this.owner||!this.owner.template||!this.cell.closest("tbody.bindable"))){var t=H.j.querySelectorAll(this.cell).attr("suppress");if(t&&(t=parseInt(t)),t&&!isNaN(t)){var l=this.cell.closest("tr"),c=[];$("th,td",l).each((b,g)=>{var S=H.j.querySelectorAll(g).attr("suppress");S&&g.dataset.row&&(S=parseInt(S),!isNaN(S)&&S<=t&&c.push(S))}),c.sort();var o=!1;if(parseInt(l.sectionRowIndex/this.owner.template.length)>0)for(var r of c){if(r>t)break;var n=parseInt(this.cell.dataset.row),s=n-1,e=this.cell.closest("tr").data,i=this.owner.data.get(s);this.cell.dataset.matrixRow;var u=this.owner.body.querySelector(`tbody.bindable [suppress="${r}"][data-matrix-row="${this.cell.dataset.matrixRow}"]`),a=u.dataset.expr?this.getExprValue(u.dataset.expr,e,n):e[u.dataset.bind],h=u.dataset.expr?this.getExprValue(u.dataset.expr,i,s):i[u.dataset.bind];if(a!=h){o=!0;break}}else o=!0;o?H.j.querySelectorAll(this.cell).removeClass("suppress"):H.j.querySelectorAll(this.cell).addClass("suppress"),H.j.querySelectorAll(this.cell).hasClass("hidden")||(o?H.j.querySelectorAll(this.cell).removeClass("hidden"):H.j.querySelectorAll(this.cell).addClass("hidden"));var p=parseInt(this.cell.dataset.matrixRow),m=p-1,d=this.owner.body.querySelector(`tbody.bindable [data-col="${this.cell.dataset.col}"][data-matrix-row="${m}"]`);$(d).hasClass("suppress")&&!H.j.querySelectorAll(this.cell).hasClass("suppress")?H.j.querySelectorAll(d).removeClass("last-none-suppress").addClass("last-suppress"):!$(d).hasClass("suppress")&&H.j.querySelectorAll(this.cell).hasClass("suppress")?H.j.querySelectorAll(d).removeClass("last-suppress").addClass("last-none-suppress"):H.j.querySelectorAll(d).removeClass("last-none-suppress").removeClass("last-suppress")}}});it(this,"getExprValue",(t,l,c,o)=>{if(typeof t<"u")try{c=parseInt(c);const r=t.replace("()","");return this.owner[r]?this.owner[r].call(this,l,c,this.cell):this.owner.exprFunction(t).call(this,l,c,this.owner.data)}catch{return["NG-COMBO"].includes(this.tagName)?"":t}else return t});this.attachShadow({mode:"open"})}connectedCallback(){let t=this.getRootNode().host;if(t&&t.tagName!="NINE-GRID"&&(t=t.getRootNode().host),this.owner=t&&t.tagName=="NINE-GRID"?t:null,this.cell=this.closest("th,td"),this.cell&&this.shadowRoot){tt(this,Gn,this.getAttribute("show-icon")=="true"||this.cell.getAttribute("show-icon")=="true"),tt(this,Kn,this.getAttribute("show-check")=="true"||this.cell.getAttribute("show-check")=="true"),tt(this,Zn,this.getAttribute("show-button")=="true"||this.cell.getAttribute("show-button")=="true"),this.cell.dataset.bind&&H.j.querySelectorAll(this).addClass(this.cell.dataset.bind);const c=this.shadowRoot.querySelector("style"),o=this.getAttribute("text-align")||this.cell.getAttribute("text-align")||"left";if(H.j.querySelectorAll(this).addClass(`ng-${o}`),f(this,Gn)){const s=this.getAttribute("icon-type")||this.cell.getAttribute("icon-type")||"sphere",e=this.getAttribute("icon-size")||this.cell.getAttribute("icon-size")||"8",i=this.getAttribute("icon-width")||this.cell.getAttribute("icon-width")||this.getAttribute("icon-size")||this.cell.getAttribute("icon-size")||"8",u=this.getAttribute("icon-height")||this.cell.getAttribute("icon-height")||this.getAttribute("icon-size")||this.cell.getAttribute("icon-size")||"8",a=this.getAttribute("icon-color")||this.cell.getAttribute("icon-color")||"gray",h=this.getAttribute("icon-position")||this.cell.getAttribute("icon-position")||"left-first",p=h.startsWith("left"),m=`<ng-expand-icon class="ng-${p?"left":"right"} ng-${h}" type="${s}" size="${e}" width="${i}" height="${u}" color="${a}"></ng-expand-icon>`;p?c?$(c).after(m):$(this.shadowRoot).prepend(m):$(this.shadowRoot).append(m)}if(f(this,Kn)){const s=this.getAttribute("check-position")||this.cell.getAttribute("check-position")||"left-first",e=s.startsWith("left"),i=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}`),u=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}-first`),a=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}-second`),h=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}-third`),p=`<ng-expand-check class="ng-${e?"left":"right"} ng-${s}"></ng-expand-check>`;e?i&&s.endsWith("second")?a||u?$(a||u).after(p):c?$(c).after(p):$(this.shadowRoot).prepend(p):i&&s.endsWith("third")?h||a||u?$(h||a||u).after(p):c?$(c).after(p):$(this.shadowRoot).prepend(p):c?$(c).after(p):$(this.shadowRoot).prepend(p):i&&s.endsWith("first")?u||a||h?$(u||a||h).before(p):$(this.shadowRoot).append(p):i&&s.endsWith("second")?a||h?$(a||h).before(p):$(this.shadowRoot).append(p):$(this.shadowRoot).append(p)}if(f(this,Zn)){const s=this.getAttribute("button-text")||this.cell.getAttribute("button-text"),e=this.getAttribute("button-width")||this.cell.getAttribute("button-width"),i=this.getAttribute("button-image")||this.cell.getAttribute("button-image"),u=this.getAttribute("button-position")||this.cell.getAttribute("button-position")||"right-third",a=u.startsWith("left"),h=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}`),p=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}-first`),m=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}-second`),d=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}-third`),b=`<ng-expand-button class="ng-${a?"left":"right"} ng-${u}"></ng-expand-button>`;if(a?h&&u.endsWith("second")?m||p?$(m||p).after(b):c?$(c).after(b):$(this.shadowRoot).prepend(b):h&&u.endsWith("third")?d||m||p?$(d||m||p).after(b):c?$(c).after(b):$(this.shadowRoot).prepend(b):c?$(c).after(b):$(this.shadowRoot).prepend(b):h&&u.endsWith("first")?p||m||d?$(p||m||d).before(b):$(this.shadowRoot).append(b):h&&u.endsWith("second")?m||d?$(m||d).before(b):$(this.shadowRoot).append(b):$(this.shadowRoot).append(b),tt(this,hs,this.shadowRoot.querySelector("ng-expand-button").shadowRoot.querySelector("button")),s&&$(f(this,hs)).text(s),e&&$(f(this,hs)).css({width:e}),["NG-INPUT","NG-TEXTAREA"].includes(this.tagName)&&!i){const g=this.shadowRoot.querySelector("input[type=text],textarea").previousElementSibling,S=this.shadowRoot.querySelector("input[type=text],textarea").nextElementSibling;g.tagName=="NG-EXPAND-BUTTON"?(H.j.querySelectorAll(this.shadowRoot.querySelector("input[type=text],textarea")).addClass("border-left-none"),H.j.querySelectorAll(g).addClass("border-right-none")):S.tagName=="NG-EXPAND-BUTTON"&&(H.j.querySelectorAll(this.shadowRoot.querySelector("input[type=text],textarea")).addClass("border-right-none"),H.j.querySelectorAll(S).addClass("border-left-none"))}}const r=this.shadowRoot.querySelectorAll(".ng-left");r.length>0&&H.j.querySelectorAll(r[0]).addClass("ng-first");const n=this.shadowRoot.querySelectorAll(".ng-right");if(n.length>0&&H.j.querySelectorAll(n[n.length-1]).addClass("ng-last"),this.closest("tbody")&&this.cell.dataset.bind){const s=this.shadowRoot.querySelector("ng-expand-check");s&&$("input",s.shadowRoot).on("change",e=>{var i=this.cell.closest("tr").data;i.__ng.c[this.cell.dataset.bind]=!!$(e.target).is(":checked")})}}this.shadowRoot.querySelectorAll("button,ng-expand-button").forEach(c=>{$(c).on("click",o=>{var n,s,e;let r=this.getAttribute("onbuttonclick")||this.getAttribute("onButtonClick")||((n=this.cell)==null?void 0:n.getAttribute("onbuttonclick"))||((s=this.cell)==null?void 0:s.getAttribute("onButtonClick"));if(r&&this.owner){r=r.replace("()","");const i=r.match(/^(\w+)\s*\(/),u=i==null?void 0:i[1];this.owner[u]?this.owner[u].call(this.owner,this.cell.closest("tr").data,parseInt(this.cell.dataset.row),this.cell):this.owner.exprFunction(r).call(this,this.cell.closest("tr").data,parseInt(this.cell.dataset.row))}(e=this.owner)==null||e.dispatchEvent(new CustomEvent(H.EVENT.BUTTON_CLICK,{detail:{target:this.cell,data:this.cell.closest("tr").data,currow:parseInt(this.cell.dataset.row)},bubbles:!0,composed:!0}))})});var l=this.shadowRoot.querySelector(".renderer");if(l){let c=this.getAttribute("onlinkclick")||this.getAttribute("onLinkClick");this.getAttribute("link")=="true"&&(H.j.querySelectorAll(l).addClass("link"),l.addEventListener("click",o=>{if(c){c=c.replace("()","");const r=c.match(/^(\w+)\s*\(/),n=r==null?void 0:r[1];console.log(n),this.owner[n]?this.owner[n].call(this.owner,this.cell.closest("tr").data,parseInt(this.cell.dataset.row),this.cell):this.owner.exprFunction(c).call(this,this.cell.closest("tr").data,parseInt(this.cell.dataset.row))}this.owner.dispatchEvent(new CustomEvent(H.EVENT.LINK_CLICK,{detail:{target:this.cell,data:this.cell.closest("tr").data,currow:parseInt(this.cell.dataset.row)},bubbles:!0,composed:!0}))}))}}get value(){var t=!this.owner||!this.owner.dataManager||!this.cell||!this.cell.dataset||!this.cell.dataset.row||!this.cell.dataset.bind?"":this.cell.closest("tr").data[this.cell.dataset.bind];return t??""}set value(t){var l=parseInt(this.cell.dataset.row);const c=this.getAttribute("update-row-state")!="false";l<0?this.owner.data.setValueNF(parseInt(this.cell.dataset.index),this.cell.dataset.bind,t,c):this.owner.data.setValue(l,this.cell.dataset.bind,t,c)}get row(){return parseInt(this.cell.dataset.row)}get data(){return this.cell.closest("tr").data}}Gn=new WeakMap,Kn=new WeakMap,Zn=new WeakMap,hs=new WeakMap,Pl=new WeakMap;class ti extends _r{constructor(){super()}connectedCallback(){super.connectedCallback(),$("input,textarea",this.shadowRoot).on("change",E=>{if(this.closest("tbody")){switch(E.target.getAttribute("type")){case"checkbox":this.value=$(E.target).is(":checked")?this.trueValue:this.falseValue;break;case"radio":this.tagName=="NG-CHECKBOX"&&this.selectAll(!1),this.value=$(E.target).val();break;default:var t=this.getAttribute("maxbyte");t&&(t=parseInt(t),H.getByteLength(E.target.value)>=t&&(E.target.value=H.cut(E.target.value,t)));var l=$(E.target).val();this.value=H.j.querySelectorAll(this).attr("type")=="number"?isNaN(l)?"":Number(l):l;break}this.owner.refreshData(this.cell.dataset.row)}})}}class Bu extends _r{constructor(){super();Y(this,Cs);it(this,"dataRefresh",t=>{f(this,Cs).innerHTML=this.getDisplayText(this.getAttribute("text"));var l=parseInt(this.cell.dataset.row);const c=this.cell.closest("tr").data;["color","background","border"].forEach(o=>{var r=f(this,Cs).getAttribute(o);r&&$(f(this,Cs)).css({[o]:this.getExprValue(r,c,l)})}),t||this.reset()})}connectedCallback(){for(var t=[],l=0;l<this.attributes.length;l++)["color","background","border"].includes(this.attributes[l].name)&&t.push(`${this.attributes[l].name}="${this.attributes[l].value}"`);this.shadowRoot.innerHTML=`
|
|
36
|
+
`))),--t==0&&i18next.changeLanguage(St.global.locale)}})}},init:()=>{i18next.init({lng:St.global.locale,debug:window.location.hostname=="localhost",resources:{}},function(E,t){E&&console.error(E)}),i18next.on("languageChanged",()=>{St.i18n.updateContent()})},t:E=>(console.log(i18next),i18next.t(E))}),it(St,"alert",(E,t,l)=>ls.alert(E,t,l)),it(St,"filter",(E,t)=>{const l=(c,o)=>{const r=c[o.key];if(o.match){const n=o.match;if(n.value!==void 0)return r===n.value;if(n.any&&Array.isArray(n.any))return n.any.includes(r);if(n.all&&Array.isArray(n.all))return Array.isArray(r)?n.all.every(s=>r.includes(s)):!1;if(n.text!==void 0)return typeof r=="string"&&r.includes(n.text)}if(o.range){const n=o.range;return typeof r=="string"&&typeof n.gte=="string"||typeof r=="number"?!(n.gte!==void 0&&r<n.gte||n.gt!==void 0&&r<=n.gt||n.lte!==void 0&&r>n.lte||n.lt!==void 0&&r>=n.lt):!1}return!1};return!E||!Array.isArray(E)?(console.error("첫 번째 인수는 JSON 배열이어야 합니다."),[]):!t||typeof t!="object"?E:E.filter(c=>!(t.must&&!t.must.every(o=>l(c,o))||t.should&&t.should.length>0&&!t.should.some(o=>l(c,o))||(t.should&&t.should.length===0&&(t.must||t.must_not),t.must_not&&t.must_not.some(o=>l(c,o)))))}),it(St,"j",{copyEvents:(E,t)=>{const l=getEventListeners(E);for(const[c,o]of Object.entries(l))o.forEach(r=>{t.addEventListener(c,r.listener,r.options)})},querySelectorAll:(E,t=document)=>{let l=[];return t instanceof NodeList?t.forEach(c=>{E instanceof NodeList?E.forEach(o=>{l.push(...c.querySelectorAll(o))}):E instanceof HTMLElement?l.push(...c.querySelectorAll(E)):l.push(...c.querySelectorAll(E))}):E instanceof HTMLElement?l=[E]:E instanceof NodeList?E.forEach(c=>{l.push(...t.querySelectorAll(c))}):l=t.querySelectorAll(E),{elements:l,elem(){return l[0]},clone(c=!1){const o=[];return l.forEach(r=>{const n=r.cloneNode(!0);c&&St.j.copyEvents(r,n),o.push(n)}),this.elements=o,this},children(){let c=[];return l.forEach(o=>{c.push(...o.children)}),this.elements=c,this},attr(c,o){return o===void 0?l[0]?l[0].getAttribute(c):null:(l.forEach(r=>{o===!1?r.removeAttribute(c):r.setAttribute(c,o===!0?"true":o)}),this)},removeAttr(...c){return c.forEach(o=>{l.forEach(r=>{r.removeAttribute(o)})}),this},css(c,o){return l.forEach(r=>{r.style[c]=o}),this},hasClass(c){return(Array.isArray(l)?l:Array.from(l)).some(r=>r.classList.contains(c))},addClass(c){return l.forEach(o=>{o.classList.add(c)}),this},removeClass(c){return l.forEach(o=>{o.classList.remove(c)}),this},show(){return l.forEach(c=>{c.style.display="",getComputedStyle(c).display==="none"&&(c.style.display="block")}),this},hide(){return l.forEach(c=>{c.style.display="none"}),this}}}}),it(St,"x",{querySelectorAll:(E,t=document)=>{let l=E instanceof HTMLElement?[E]:t.querySelectorAll(E);return{elements:l,elem:function(){return l[0]},attr:function(c,o){return o===void 0?l[0]?l[0].getAttribute(c):null:(l.forEach(r=>{o===!1?r.removeAttribute(c):r.setAttribute(c,o===!0?"true":o)}),this)},css:function(c,o){return l.forEach(r=>{r.style[c]=o}),this},addClass:function(c){return l.forEach(o=>{o.classList.contains(c)||o.classList.add(c)}),this},removeClass:function(c){return l.forEach(o=>{o.classList.contains(c)&&o.classList.remove(c)}),this}}}});let H=St;Array.prototype.nineBinarySearch=function(vt){let E=0,t=this.length-1,l;for(;E<=t;){if(l=parseInt((E+t)/2),vt==this[l])return l;vt<this[l]?t=l-1:E=l+1}return-1};class Pu extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const E=document.createElement("button");E.textContent="클릭하세요!",E.style.padding="10px",E.style.backgroundColor="blue",E.style.color="white",this.shadowRoot.appendChild(E)}}customElements.get("nine-grid4")||customElements.define("nine-grid4",Pu);class Du extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const E=document.createElement("button");E.textContent="클릭하세요!",E.style.padding="10px",E.style.backgroundColor="blue",E.style.color="white",this.shadowRoot.appendChild(E)}}customElements.get("nine-grid2")||customElements.define("nine-grid2",Du);class _r extends HTMLElement{constructor(){super();Y(this,Gn);Y(this,Kn);Y(this,Zn);Y(this,hs);it(this,"getDisplayText",t=>{if(this.cell)if(this.cell.closest("tbody")){const l=this.cell.closest("tr").data,c=parseInt(this.cell.dataset.row);if(!l)return"";if(H.isNull(this.cell.dataset.expr)){if(!H.isNull(this.cell.dataset.bind))return l[this.cell.dataset.bind]||H.nvl(t,"")}else try{return this.getExprValue(this.cell.dataset.expr,l,c,this.cell)}catch{console.error(this.cell.dataset.expr,l,this.cell.dataset.row)}return H.nvl(t,"")}else try{return this.owner.exprFunction(this.cell.dataset.expr).call(this,null,-1,this.owner.data)}catch{}});it(this,"reset",()=>{var t=parseInt(this.cell.dataset.row),l=this.cell.closest("tr"),c=l.data;if(c||(c=this.owner.data.get(t),this.owner.body.querySelectorAll(`.ng-container tbody tr[data-row="${t}"]`).forEach(i=>{i.data=c})),this.cell.dataset.bind&&this.shadowRoot.querySelector("input,textarea,button")&&(H.j.querySelectorAll(this.cell).removeClass("ng-changed"),c.__ng.o.hasOwnProperty(this.cell.dataset.bind)&&c[this.cell.dataset.bind]!=c.__ng.o[this.cell.dataset.bind]&&H.j.querySelectorAll(this.cell).addClass("ng-changed")),(this.getAttribute("show-icon")||this.cell.getAttribute("show-icon"))=="true"){var e=this.getAttribute("icon-color")||this.cell.getAttribute("icon-color");if(e){var o=this.getExprValue(e,c,t);this.shadowRoot.querySelector("ng-expand-icon").setAttribute("color",o)}var e=this.getAttribute("icon-src")||this.cell.getAttribute("icon-src");if(e){var r=this.getExprValue(e,c,t);this.shadowRoot.querySelector("ng-expand-icon").setAttribute("src",r)}}if(f(this,hs)){var e=this.getAttribute("button-image")||this.cell.getAttribute("button-image");if(e){var r=this.getExprValue(e,c,t);r&&($(f(this,hs)).text(""),$(f(this,hs)).css({border:"none","background-color":"transparent","background-image":r.startsWith("<svg")?`url('data:image/svg+xml;utf8,${r}')`:`url("${r}")`}))}}var e=this.getAttribute("class-expr");if(e){this.classList.forEach(i=>{["aaa"].includes(i)||this.classList.remove(i)});var n=this.getExprValue(e,c,t);n&&this.classList.toggle(n)}var e=this.cell.getAttribute("enable-check");if(e){var s=this.shadowRoot.querySelector("ng-expand-check");s&&s.shadowRoot.querySelector("input").setAttribute("disabled",!this.getExprValue(e,c,t))}var e=this.cell.getAttribute("enable-button");if(e){var s=this.shadowRoot.querySelector("ng-expand-button");s&&s.shadowRoot.querySelector("button").setAttribute("disabled",!this.getExprValue(e,c,t))}var e=this.getAttribute("visible")||this.cell.getAttribute("visible");e?this.getExprValue(e,c,t)?H.j.querySelectorAll(this.cell).removeClass("hidden"):H.j.querySelectorAll(this.cell).addClass("hidden"):H.j.querySelectorAll(this.cell).removeClass("hidden");var e=this.getAttribute("enable")||this.cell.getAttribute("enable");e?H.j.querySelectorAll("input,textarea,button",this.shadowRoot).attr("disabled",!this.getExprValue(e,c,t)):H.j.querySelectorAll("input,textarea,button",this.shadowRoot).attr("disabled",!1);var e=this.getAttribute("readonly")||this.cell.getAttribute("readonly");e?H.j.querySelectorAll("input,textarea",this.shadowRoot).attr("readonly",this.getExprValue(e,c,t)):H.j.querySelectorAll("input,textarea,button",this.shadowRoot).attr("readonly",!1),["color","background-color","class"].forEach(i=>{var u=this.cell.getAttribute(i);u&&$(this.cell).css({[i]:this.getExprValue(u,c,t)})}),$(this.cell).children().each((i,u)=>{var a=u.getAttribute("tooltip");a&&H.j.querySelectorAll(u).attr("title",this.owner.exprFunction(a).call(this,this.cell.closest("tr").data,t))}),f(this,Pl).call(this)});Y(this,Pl,()=>{if(!(!this.owner||!this.owner.template||!this.cell.closest("tbody.bindable"))){var t=H.j.querySelectorAll(this.cell).attr("suppress");if(t&&(t=parseInt(t)),t&&!isNaN(t)){var l=this.cell.closest("tr"),c=[];$("th,td",l).each((b,g)=>{var S=H.j.querySelectorAll(g).attr("suppress");S&&g.dataset.row&&(S=parseInt(S),!isNaN(S)&&S<=t&&c.push(S))}),c.sort();var o=!1;if(parseInt(l.sectionRowIndex/this.owner.template.length)>0)for(var r of c){if(r>t)break;var n=parseInt(this.cell.dataset.row),s=n-1,e=this.cell.closest("tr").data,i=this.owner.data.get(s);this.cell.dataset.matrixRow;var u=this.owner.body.querySelector(`tbody.bindable [suppress="${r}"][data-matrix-row="${this.cell.dataset.matrixRow}"]`),a=u.dataset.expr?this.getExprValue(u.dataset.expr,e,n):e[u.dataset.bind],h=u.dataset.expr?this.getExprValue(u.dataset.expr,i,s):i[u.dataset.bind];if(a!=h){o=!0;break}}else o=!0;o?H.j.querySelectorAll(this.cell).removeClass("suppress"):H.j.querySelectorAll(this.cell).addClass("suppress"),H.j.querySelectorAll(this.cell).hasClass("hidden")||(o?H.j.querySelectorAll(this.cell).removeClass("hidden"):H.j.querySelectorAll(this.cell).addClass("hidden"));var p=parseInt(this.cell.dataset.matrixRow),m=p-1,d=this.owner.body.querySelector(`tbody.bindable [data-col="${this.cell.dataset.col}"][data-matrix-row="${m}"]`);$(d).hasClass("suppress")&&!H.j.querySelectorAll(this.cell).hasClass("suppress")?H.j.querySelectorAll(d).removeClass("last-none-suppress").addClass("last-suppress"):!$(d).hasClass("suppress")&&H.j.querySelectorAll(this.cell).hasClass("suppress")?H.j.querySelectorAll(d).removeClass("last-suppress").addClass("last-none-suppress"):H.j.querySelectorAll(d).removeClass("last-none-suppress").removeClass("last-suppress")}}});it(this,"getExprValue",(t,l,c,o)=>{if(typeof t<"u")try{c=parseInt(c);const r=t.replace("()","");return this.owner[r]?this.owner[r].call(this,l,c,this.cell):this.owner.exprFunction(t).call(this,l,c,this.owner.data)}catch{return["NG-COMBO"].includes(this.tagName)?"":t}else return t});this.attachShadow({mode:"open"})}connectedCallback(){let t=this.getRootNode().host;if(t&&t.tagName!="NINE-GRID"&&(t=t.getRootNode().host),this.owner=t&&t.tagName=="NINE-GRID"?t:null,this.cell=this.closest("th,td"),this.cell&&this.shadowRoot){tt(this,Gn,this.getAttribute("show-icon")=="true"||this.cell.getAttribute("show-icon")=="true"),tt(this,Kn,this.getAttribute("show-check")=="true"||this.cell.getAttribute("show-check")=="true"),tt(this,Zn,this.getAttribute("show-button")=="true"||this.cell.getAttribute("show-button")=="true"),this.cell.dataset.bind&&H.j.querySelectorAll(this).addClass(this.cell.dataset.bind);const c=this.shadowRoot.querySelector("style"),o=this.getAttribute("text-align")||this.cell.getAttribute("text-align")||"left";if(H.j.querySelectorAll(this).addClass(`ng-${o}`),f(this,Gn)){const s=this.getAttribute("icon-type")||this.cell.getAttribute("icon-type")||"sphere",e=this.getAttribute("icon-size")||this.cell.getAttribute("icon-size")||"8",i=this.getAttribute("icon-width")||this.cell.getAttribute("icon-width")||this.getAttribute("icon-size")||this.cell.getAttribute("icon-size")||"8",u=this.getAttribute("icon-height")||this.cell.getAttribute("icon-height")||this.getAttribute("icon-size")||this.cell.getAttribute("icon-size")||"8",a=this.getAttribute("icon-color")||this.cell.getAttribute("icon-color")||"gray",h=this.getAttribute("icon-position")||this.cell.getAttribute("icon-position")||"left-first",p=h.startsWith("left"),m=`<ng-expand-icon class="ng-${p?"left":"right"} ng-${h}" type="${s}" size="${e}" width="${i}" height="${u}" color="${a}"></ng-expand-icon>`;p?c?$(c).after(m):$(this.shadowRoot).prepend(m):$(this.shadowRoot).append(m)}if(f(this,Kn)){const s=this.getAttribute("check-position")||this.cell.getAttribute("check-position")||"left-first",e=s.startsWith("left"),i=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}`),u=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}-first`),a=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}-second`),h=this.shadowRoot.querySelector(`.ng-${e?"left":"right"}-third`),p=`<ng-expand-check class="ng-${e?"left":"right"} ng-${s}"></ng-expand-check>`;e?i&&s.endsWith("second")?a||u?$(a||u).after(p):c?$(c).after(p):$(this.shadowRoot).prepend(p):i&&s.endsWith("third")?h||a||u?$(h||a||u).after(p):c?$(c).after(p):$(this.shadowRoot).prepend(p):c?$(c).after(p):$(this.shadowRoot).prepend(p):i&&s.endsWith("first")?u||a||h?$(u||a||h).before(p):$(this.shadowRoot).append(p):i&&s.endsWith("second")?a||h?$(a||h).before(p):$(this.shadowRoot).append(p):$(this.shadowRoot).append(p)}if(f(this,Zn)){const s=this.getAttribute("button-text")||this.cell.getAttribute("button-text"),e=this.getAttribute("button-width")||this.cell.getAttribute("button-width"),i=this.getAttribute("button-image")||this.cell.getAttribute("button-image"),u=this.getAttribute("button-position")||this.cell.getAttribute("button-position")||"right-third",a=u.startsWith("left"),h=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}`),p=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}-first`),m=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}-second`),d=this.shadowRoot.querySelector(`.ng-${a?"left":"right"}-third`),b=`<ng-expand-button class="ng-${a?"left":"right"} ng-${u}"></ng-expand-button>`;if(a?h&&u.endsWith("second")?m||p?$(m||p).after(b):c?$(c).after(b):$(this.shadowRoot).prepend(b):h&&u.endsWith("third")?d||m||p?$(d||m||p).after(b):c?$(c).after(b):$(this.shadowRoot).prepend(b):c?$(c).after(b):$(this.shadowRoot).prepend(b):h&&u.endsWith("first")?p||m||d?$(p||m||d).before(b):$(this.shadowRoot).append(b):h&&u.endsWith("second")?m||d?$(m||d).before(b):$(this.shadowRoot).append(b):$(this.shadowRoot).append(b),tt(this,hs,this.shadowRoot.querySelector("ng-expand-button").shadowRoot.querySelector("button")),s&&$(f(this,hs)).text(s),e&&$(f(this,hs)).css({width:e}),["NG-INPUT","NG-TEXTAREA"].includes(this.tagName)&&!i){const g=this.shadowRoot.querySelector("input[type=text],textarea").previousElementSibling,S=this.shadowRoot.querySelector("input[type=text],textarea").nextElementSibling;g.tagName=="NG-EXPAND-BUTTON"?(H.j.querySelectorAll(this.shadowRoot.querySelector("input[type=text],textarea")).addClass("border-left-none"),H.j.querySelectorAll(g).addClass("border-right-none")):S.tagName=="NG-EXPAND-BUTTON"&&(H.j.querySelectorAll(this.shadowRoot.querySelector("input[type=text],textarea")).addClass("border-right-none"),H.j.querySelectorAll(S).addClass("border-left-none"))}}const r=this.shadowRoot.querySelectorAll(".ng-left");r.length>0&&H.j.querySelectorAll(r[0]).addClass("ng-first");const n=this.shadowRoot.querySelectorAll(".ng-right");if(n.length>0&&H.j.querySelectorAll(n[n.length-1]).addClass("ng-last"),this.closest("tbody")&&this.cell.dataset.bind){const s=this.shadowRoot.querySelector("ng-expand-check");s&&$("input",s.shadowRoot).on("change",e=>{var i=this.cell.closest("tr").data;i.__ng.c[this.cell.dataset.bind]=!!$(e.target).is(":checked")})}}this.shadowRoot.querySelectorAll("button,ng-expand-button").forEach(c=>{$(c).on("click",o=>{var n,s,e;let r=this.getAttribute("onbuttonclick")||this.getAttribute("onButtonClick")||((n=this.cell)==null?void 0:n.getAttribute("onbuttonclick"))||((s=this.cell)==null?void 0:s.getAttribute("onButtonClick"));if(r&&this.owner){r=r.replace("()","");const i=r.match(/^(\w+)\s*\(/),u=i==null?void 0:i[1];this.owner[u]?this.owner[u].call(this.owner,this.cell.closest("tr").data,parseInt(this.cell.dataset.row),this.cell):this.owner.exprFunction(r).call(this,this.cell.closest("tr").data,parseInt(this.cell.dataset.row))}(e=this.owner)==null||e.dispatchEvent(new CustomEvent(H.EVENT.BUTTON_CLICK,{detail:{target:this.cell,data:this.cell.closest("tr").data,currow:parseInt(this.cell.dataset.row)},bubbles:!0,composed:!0}))})});var l=this.shadowRoot.querySelector(".renderer");if(l){let c=this.getAttribute("onlinkclick")||this.getAttribute("onLinkClick");this.getAttribute("link")=="true"&&(H.j.querySelectorAll(l).addClass("link"),l.addEventListener("click",o=>{if(c){c=c.replace("()","");const r=c.match(/^(\w+)\s*\(/),n=r==null?void 0:r[1];console.log(n),this.owner[n]?this.owner[n].call(this.owner,this.cell.closest("tr").data,parseInt(this.cell.dataset.row),this.cell):this.owner.exprFunction(c).call(this,this.cell.closest("tr").data,parseInt(this.cell.dataset.row))}this.owner.dispatchEvent(new CustomEvent(H.EVENT.LINK_CLICK,{detail:{target:this.cell,data:this.cell.closest("tr").data,currow:parseInt(this.cell.dataset.row)},bubbles:!0,composed:!0}))}))}}get value(){var t=!this.owner||!this.owner.dataManager||!this.cell||!this.cell.dataset||!this.cell.dataset.row||!this.cell.dataset.bind?"":this.cell.closest("tr").data[this.cell.dataset.bind];return t??""}set value(t){var l=parseInt(this.cell.dataset.row);const c=this.getAttribute("update-row-state")!="false";l<0?this.owner.data.setValueNF(parseInt(this.cell.dataset.index),this.cell.dataset.bind,t,c):this.owner.data.setValue(l,this.cell.dataset.bind,t,c)}get row(){return parseInt(this.cell.dataset.row)}get data(){return this.cell.closest("tr").data}}Gn=new WeakMap,Kn=new WeakMap,Zn=new WeakMap,hs=new WeakMap,Pl=new WeakMap;class ti extends _r{constructor(){super()}connectedCallback(){super.connectedCallback(),$("input,textarea",this.shadowRoot).on("change",E=>{if(this.closest("tbody")){switch(E.target.getAttribute("type")){case"checkbox":this.value=$(E.target).is(":checked")?this.trueValue:this.falseValue;break;case"radio":this.tagName=="NG-CHECKBOX"&&this.selectAll(!1),this.value=$(E.target).val();break;default:var t=this.getAttribute("maxbyte");t&&(t=parseInt(t),H.getByteLength(E.target.value)>=t&&(E.target.value=H.cut(E.target.value,t)));var l=$(E.target).val();this.value=H.j.querySelectorAll(this).attr("type")=="number"?isNaN(l)?"":Number(l):l;break}this.owner.refreshData(this.cell.dataset.row)}})}}class Bu extends _r{constructor(){super();Y(this,Cs);it(this,"dataRefresh",t=>{f(this,Cs).innerHTML=this.getDisplayText(this.getAttribute("text"));var l=parseInt(this.cell.dataset.row);const c=this.cell.closest("tr").data;["color","background","border"].forEach(o=>{var r=f(this,Cs).getAttribute(o);r&&$(f(this,Cs)).css({[o]:this.getExprValue(r,c,l)})}),t||this.reset()})}connectedCallback(){for(var t=[],l=0;l<this.attributes.length;l++)["color","background","border"].includes(this.attributes[l].name)&&t.push(`${this.attributes[l].name}="${this.attributes[l].value}"`);this.shadowRoot.innerHTML=`
|
|
37
37
|
<style>
|
|
38
38
|
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngButton.css";
|
|
39
39
|
${H.getCustomPath(this,"ngButton.css")}
|
|
@@ -717,10 +717,10 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
|
|
|
717
717
|
<div></div>
|
|
718
718
|
<span class="text">${this.displayValue}</span>
|
|
719
719
|
</div>
|
|
720
|
-
`,super.connectedCallback(),tt(this,$a,this.shadowRoot.querySelector("div.ng-pad")),tt(this,La,this.shadowRoot.querySelector("span"))}get prevLevel(){var t=parseInt(this.closest("tr").sectionRowIndex/this.owner.template.length);if(!this.owner.dataManager.viewRecords)return-1;if(t!=0){var l=this.owner.data.getNF(t-1);return l[this.cell.dataset.bind]}else for(var c=parseInt(this.cell.dataset.row)-1;c>=0;c--){var o=this.owner.data.get(c);if(!o.__ng._[H.ROW.EXPAND])return o[this.cell.dataset.bind]}return-1}}$a=new WeakMap,La=new WeakMap,Pa=new WeakMap,yi=new WeakSet,Ol=function(){return this.data.__ng._[H.ROW.EXPAND]},sc=new WeakMap,ic=new WeakMap,nc=new WeakMap,oc=new WeakMap,uu=new WeakMap,Da=new WeakMap,Ba=new WeakMap,ac=new WeakMap,lc=new WeakMap,hc=new WeakMap,customElements.get("ng-tree-item")||customElements.define("ng-tree-item",tf);class ef{constructor(E){Y(this,yt);Y(this,Ge);Y(this,wr);Y(this,vi);Y(this,wi,[]);it(this,"init",()=>{tt(this,wr,{body:$(".ng-container-body",f(this,yt).body).height()||0,thead:$(".ng-container-body thead",f(this,yt).body).height()||0,tfoot:$(".ng-container-body tfoot",f(this,yt).body).height()||0}),!f(this,vi)&&($(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(f(this,wr).body),tt(this,vi,!0))});it(this,"redraw",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),f(this,yt).dataManager&&(tt(this,Ge,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,cc).call(this),f(this,kn).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refresh())});it(this,"redrawV2",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),tt(this,Ge,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,uc).call(this),f(this,kn).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refreshV2()});it(this,"redrawV3",()=>{this.init(),tt(this,Ge,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,kn).call(this)});Y(this,Fa,()=>{var E=0;return $(".ng-container-body tbody.fixed tr",f(this,yt).body).each((t,l)=>{l.data&&l.data.__ng&&(E+=f(this,yt).matrix.getHeight(l.data.__ng.height[parseInt(t%f(this,yt).template.length)]))}),E});Y(this,qa,()=>{var E=f(this,Fa).call(this);const t=parseInt(f(this,Ge)*f(this,yt).template.length);return $(".ng-container-body tbody.bindable tr:not(.nodata)",f(this,yt).body).each((l,c)=>{E+=f(this,yt).matrix.getHeight(t+l)}),E});Y(this,Ha,()=>{const E=parseInt(f(this,yt).getAttribute("display-row-count"));if(f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple"))return 1;if([H.PAGINGTYPE.CLIENT,H.PAGINGTYPE.SERVER].includes(f(this,yt).paging.type))return f(this,yt).paging.linesPerPage;if(!isNaN(E))return f(this,Ge)+E>f(this,yt).data.count()&&(tt(this,Ge,E>=f(this,yt).data.count()?0:f(this,yt).data.count()-E),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ge)),E;const t=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,Fa).call(this);for(var l=0,c=0;c<t;)c+=this.getRowHeight(f(this,Ge)+l++);if(f(this,Ge)+l>f(this,yt).data.count()){l=0,c=0;for(var o=f(this,yt).data.count()-1;o>=0&&c<t;o--)c+=this.getRowHeight(o),l++;c>t&&l--,tt(this,Ge,f(this,yt).data.count()-l),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ge)}return l});Y(this,za,()=>{var E=f(this,Ha).call(this),t=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not("tr.nodata").length/(f(this,yt).template.length||1);const l=f(this,yt).template.clone(),c=l.clone(),o=l.clone();l.find("th,td").not("[fixed=left]").remove(),c.find("th,td").not("[fixed=right]").remove(),o.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const r=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-left")),n=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-right")),s=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-body"));for(var e=t;e<E;e++)l.each((u,a)=>{r.before(a.outerHTML)}),c.each((u,a)=>{n.before(a.outerHTML)}),o.each((u,a)=>{s.before(a.outerHTML)});return;var i;if(i.length>0)var t});Y(this,Ua,()=>{var E=Math.min(f(this,Ha).call(this),f(this,yt).data.count());$(".ng-container tbody.bindable tr:not(.nodata)",f(this,yt).body).each((t,l)=>{parseInt(l.sectionRowIndex/f(this,yt).template.length)>=E&&$(l).remove()}),f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{f(this,Ge)+parseInt(t.sectionRowIndex/f(this,yt).template.length)>=f(this,yt).data.count()&&$(t).remove()})});Y(this,cc,()=>{f(this,za).call(this),f(this,Ua).call(this);var E=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,qa).call(this);if(f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(E=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(E),f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple")){$("tr.nodata",f(this,yt).body).height(0);var E=47;$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata").each((l,c)=>{E+=$(c).height()}),$(f(this,yt).closest("dialog")).height(E)}});Y(this,uc,()=>{f(this,za).call(this),f(this,Ua).call(this),f(this,yt).isLastPage});Y(this,dc,()=>{for(const E of f(this,wi))clearTimeout(E);tt(this,wi,[]),f(this,wi).push(setTimeout(()=>{tt(this,vi,!1);var E=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata"),t=$(".ng-container-left tbody.bindable tr",f(this,yt).body).not(".nodata"),l=$(".ng-container-right tbody.bindable tr",f(this,yt).body).not(".nodata");if(E.length>0){var c=parseInt(E[0].dataset.row*f(this,yt).template.length);E.each((r,n)=>{var s=f(this,yt).matrix.getHeight(c+r);$("canvas.chart",n).css({height:s-4}),$("canvas.chart",t.eq(r)).css({height:s-4}),$("canvas.chart",l.eq(r)).css({height:s-4}),$(n).css({height:s}).height(s),t.eq(r).css({height:s}).height(s),l.eq(r).css({height:s}).height(s)})}f(this,yt).cell.refresh(),$("ng-row-indicator",f(this,yt).body).each((r,n)=>{n.refresh()});var o=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,qa).call(this);f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(o=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(o),f(this,yt).refreshBindRows(),f(this,yt).refreshData(),f(this,yt).paging.totalCount=f(this,yt).data.countNF(),f(this,yt).body.querySelector("ng-vscrollbar").refresh(),H.j.querySelectorAll(".ng-table tbody tr",f(this,yt).body).removeClass("hover"),H.j.querySelectorAll(f(this,yt)).removeClass("loading"),H.j.querySelectorAll("ng-filter-panel").removeClass("loading")},300)),f(this,wi).push(setTimeout(()=>{f(this,yt).refreshDataV2()}))});Y(this,kn,()=>{var E=[];f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)").forEach(t=>{E.push(f(this,Ge)+parseInt(t.sectionRowIndex/f(this,yt).template.length))}),E=[...new Set(E)],f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{const l=parseInt(t.sectionRowIndex/f(this,yt).template.length);t.dataset.row=E[l],t.dataset.matrixRow=parseInt(E[l]*f(this,yt).template.length)+parseInt(t.sectionRowIndex%f(this,yt).template.length);for(const c of t.cells)c.dataset.row=t.dataset.row,c.dataset.matrixRow=t.dataset.matrixRow}),E.forEach(t=>{const l=f(this,yt).data.get(t);f(this,yt).body.querySelectorAll(`.ng-container tbody.bindable tr[data-row="${t}"]`).forEach(c=>{c.data=l})}),tt(this,Ge,parseInt(f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-of-type").getAttribute("data-row"))),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ge),f(this,dc).call(this),f(this,yt).isFirstPage=f(this,Ge)==0,f(this,yt).isLastPage=E[E.length-1]==f(this,yt).data.count()-1});it(this,"getVisibleFirstRow",()=>{var E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-child");return parseInt(E.dataset.row)});it(this,"getVisibleLastRow",()=>{var E=f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)");return E.length>0?parseInt(E[E.length-1].dataset.row):-1});it(this,"getRowHeight",E=>{let t=0;for(var l=0;l<f(this,yt).template.length;l++)t+=f(this,yt).matrix.getHeight(parseInt(E*f(this,yt).template.length+l));return t});it(this,"getTranslateY",()=>{const E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable");return!E||!E.style||!E.style.transform?0:parseFloat(E.style.transform.replace("translateY(","").replace(")",""))});it(this,"getTotalSpace",()=>$(f(this,yt).body.querySelector(".ng-container-body")).height()-($(f(this,yt).body.querySelector(".ng-container-body thead")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tfoot")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tbody.fixed")).height()||0));it(this,"fitPage",()=>{const E=this.getVisibleLastRow(),t=this.getTotalSpace();if(E==f(this,yt).data.count()-1){for(var l=0,c=E;c>=0;c--)if(l+=this.getRowHeight(c),l>t){f(this,yt).scrollTo(c+1);break}}});it(this,"selectArea",(E,t,l,c)=>{const o=f(this,Us).call(this,E),r=f(this,Us).call(this,l),n=f(this,Vs).call(this,t),s=f(this,Vs).call(this,c),e=parseInt(o*f(this,yt).template.length),i=parseInt(r*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=o,o>=0&&r>=0?f(this,yt).selection.selectArea(e,n,i,s):this.clearSelection()});it(this,"selectRow",(E,t)=>{const l=f(this,Us).call(this,E),c=H.isNull(t)?l:f(this,Us).call(this,t),o=parseInt(l*f(this,yt).template.length),r=parseInt(c*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=l,l>=0&&c>=0?f(this,yt).selection.selectArea(o,f(this,yt).firstCol,r,f(this,yt).lastCol):this.clearSelection()});it(this,"selectCol",(E,t)=>{const l=f(this,Vs).call(this,E),c=H.isNull(t)?l:f(this,Vs).call(this,t),o=0,r=parseInt(f(this,yt).data.count()*f(this,yt).template.length-1);l>=0&&c>=0?f(this,yt).selection.selectArea(o,l,r,c):this.clearSelection()});it(this,"selectCell",(E,t,l)=>{const c=f(this,Us).call(this,E),o=f(this,Vs).call(this,t),r=parseInt(c*f(this,yt).template.length)+H.nvl(l,0);f(this,yt).row.at=c,c>=0?f(this,yt).selection.selectArea(r,o,r,o):this.clearSelection()});Y(this,Us,E=>{if(typeof E=="number")return E;if(typeof E=="function")return f(this,yt).data.findIndex(E);throw`invalid ${E}`});Y(this,Vs,E=>{if(typeof E=="number")return E;if(typeof E=="string"&&f(this,yt).fields.includes(E))return parseInt($(`[data-bind="${E}"]`,f(this,yt).template)[0].dataset.col);throw`invalid ${E}`});it(this,"moveTo",E=>{f(this,yt).scrollTo(E)});tt(this,yt,E),tt(this,vi,!1),this.init()}}yt=new WeakMap,Ge=new WeakMap,wr=new WeakMap,vi=new WeakMap,wi=new WeakMap,Fa=new WeakMap,qa=new WeakMap,Ha=new WeakMap,za=new WeakMap,Ua=new WeakMap,cc=new WeakMap,uc=new WeakMap,dc=new WeakMap,kn=new WeakMap,Us=new WeakMap,Vs=new WeakMap;class rf{constructor(E){Y(this,Je);Y(this,Ws);it(this,"initialize",()=>{tt(this,Ws,!1),f(this,Je).data.clearFilter()});it(this,"isFiltering",()=>f(this,Ws));it(this,"on",E=>{tt(this,Ws,!0);const t=f(this,fc).call(this);f(this,Je).body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach(l=>{var o,r;const c=(o=l.closest("tr"))==null?void 0:o.sectionRowIndex;if(c!==void 0&&c+l.rowSpan-1===t){const n=Array.from(f(this,Je).activeTmpl.querySelectorAll(`[data-col="${l.dataset.col}"]`)).map(s=>s.dataset.bind?{colnm:s.dataset.bind,data:[]}:null).filter(Boolean);if(n.length>0){(r=l.querySelector("ng-filter-button"))==null||r.remove();const s=document.createElement("ng-filter-button");l.appendChild(s),s.filterOptions=n}}})});it(this,"off",()=>{tt(this,Ws,!1),f(this,Je).body.querySelectorAll(".ng-table ng-filter-button").forEach(E=>{E.remove()})});it(this,"set",E=>{this.on();let t=Array.isArray(E)?Object.fromEntries(Object.keys(E[0]).map(l=>[l,[...new Set(E.map(c=>c[l]))]])):E;f(this,Je).data.clearFilter(),Object.entries(t).forEach(([l,c])=>{const o=f(this,Je).fields.indexOf(l);f(this,Je).data.getValidData().some(r=>typeof r.v[o]=="number")&&(c=c.map(Number)),f(this,Je).data.getValidData().filter(r=>c.nineBinarySearch(r.v[o]||"")<0).forEach(r=>{r.__ng.filtered=!0})}),f(this,Je).data.refreshFilter(),f(this,Je).shadowRoot.querySelectorAll("ng-filter-button").forEach(l=>{l.filterOptions.forEach(c=>{c.data=[]})}),Object.entries(t).forEach(([l,c])=>{f(this,Je).shadowRoot.querySelectorAll("ng-filter-button").forEach(o=>{let r=o.filterOptions;r.forEach(n=>{n.colnm===l&&(n.data=c)}),o.filterOptions=r})}),f(this,Je).scrollTo_V1(0),f(this,Je).paging.reset()});Y(this,fc,(E="thead")=>[...f(this,Je).body.querySelectorAll(`.ng-table ${E}`)].reduce((t,l)=>Math.max(l.rows.length-1,t),0));tt(this,Je,E),tt(this,Ws,!1);const t=document.createElement("ng-filter-panel");t.style.display="none",f(this,Je).shadowRoot.appendChild(t)}}Je=new WeakMap,Ws=new WeakMap,fc=new WeakMap;class sf extends HTMLElement{constructor(){super();Y(this,Va);Y(this,Cn);Y(this,Wa,t=>{var o;t.preventDefault(),t.stopPropagation();const l=f(this,Va).shadowRoot.querySelector("ng-filter-panel"),c=(o=this.closest("th,td"))==null?void 0:o.dataset.col;l.col===c?l.close():l.open(this)})}connectedCallback(){tt(this,Va,this.getRootNode().host),this.removeEventListener("click",f(this,Wa)),this.addEventListener("click",f(this,Wa))}get filterOptions(){return f(this,Cn)}set filterOptions(t){tt(this,Cn,t),this.classList.toggle("filtered",f(this,Cn).some(l=>l.data.length>0))}}Va=new WeakMap,Cn=new WeakMap,Wa=new WeakMap;class nf extends HTMLElement{constructor(){super();Y(this,Mr);Y(this,Xa);Y(this,Ya);Y(this,pc,t=>{const l=this.shadowRoot.querySelector("nine-grid");this.classList.add("loading"),setTimeout(()=>{const[c,o,r,n]=["LVL","CHK","COLNM","DATA"].map(u=>l.fields.indexOf(u)),s=l.data.getValidDataNF().filter(u=>u.v[c]===2&&u.v[o]==="Y"),e=s.length>0?[...new Set(s.map(u=>u.v[r]))].map(u=>({colnm:u,data:[...new Set(l.data.getValidData().filter(a=>a.v[o]==="Y"&&a.v[r]===u).map(a=>a.v[n]||""))].sort()})):[];f(this,Xa).filterOptions=e;const i=Object.fromEntries([...f(this,Mr).body.querySelectorAll("ng-filter-button")].flatMap(u=>u.filterOptions).filter(u=>u.data.length>0).map(u=>[u.colnm,u.data]));f(this,Mr).filtering.set(i),this.classList.remove("loading"),this.style.display="none"})});Y(this,mc,t=>{this.style.display="none"});Y(this,gc,t=>{const l=this.shadowRoot.querySelector("nine-grid"),c=l.fields.indexOf("CHK"),o=t.target.checked;l.data.getValidData().forEach(r=>{r.v[c]=o?"Y":"N"}),l.refreshData()});Y(this,bc,t=>{const l=this.shadowRoot.querySelector("nine-grid");l.classList.add("loading");const c=l.dataManager.rawRecords;c.forEach(s=>{s.__ng.filtered=!1});const o=t.target.value.toLowerCase(),[r,n]=["LVL","DATA"].map(s=>l.fields.indexOf(s));c.forEach(s=>{s.__ng.filtered=s.v[r]===2&&!String(s.v[n]||"").toLowerCase().includes(o)}),l.data.resetRecords(),clearTimeout(f(this,Ya)),tt(this,Ya,setTimeout(()=>{l.dataManager.viewRecords.reset(),l.dataManager.viewRecords.touch()},200))});it(this,"close",()=>{this.col=null,this.style.display="none"});it(this,"open",t=>{const l=t.closest("th,td"),{left:c}=t.getBoundingClientRect(),{left:o,width:r,top:n}=f(this,Mr).getBoundingClientRect(),{top:s,height:e}=l.getBoundingClientRect(),{width:i}=this.getBoundingClientRect();let u=Math.max(0,c-o);u=Math.min(u,r-i-5);const a=s+e-n;Object.assign(this.style,{left:`${u}px`,top:`${a}px`,display:"flex"}),this.classList.add("loading"),this.shadowRoot.querySelector("input[type=text]").value="",setTimeout(()=>{const h=f(this,Mr).data.getValidDataNF(),p=l.dataset.col;this.col=p,tt(this,Xa,t);const m=t.filterOptions.map((g,S)=>{const C=`<span class="group">${l.textContent}${t.filterOptions.length>1?` #${S+1} (${g.colnm})`:""}</span>`,I=f(this,Mr).activeTmpl.querySelector(`[data-col="${p}"][data-bind="${g.colnm}"]`),D=I==null?void 0:I.getAttribute("data-expr"),z=D?f(this,Mr).exprFunction(D):null,P=h.map(B=>{const F=f(this,Mr).fields.indexOf(g.colnm);return D?{v:B.v[F],v2:z(f(this,Mr).data.conv(B),B.__ng.rowidx,f(this,Mr).data)}:{v:B.v[F],v2:B.v[F]}});return[{LVL:1,CHK:"N",DATA2:C},...[...new Set(P.map(JSON.stringify))].map(JSON.parse).sort((B,F)=>(B.v2||"")>(F.v2||"")?1:(B.v2||"")<(F.v2||"")?-1:0).map(B=>({LVL:2,DATA:B.v,DATA2:B.v2||` <span class="empty">(empty)</span> ${B.v}`,COLNM:g.colnm,CHK:g.data.length===0||g.data.nineBinarySearch(B.v||"")>=0?"Y":"N"}))]}).flat(),d=this.shadowRoot.querySelector("nine-grid");d.fields.add(["DATA","DATA2","COLNM"]),d.data.set(m);const b=this.shadowRoot.querySelector("input[type=checkbox]");b.checked=d.data.getValidData().every(g=>!(g.LVL===2&&g.CHK!=="Y")),this.shadowRoot.querySelector("input").focus(),this.classList.remove("loading")})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Mr,this.getRootNode().host);const t=this.getRootNode().host.closest("nine-grid").getAttribute("css-path")||"",l=nine.cssPath?`@import "${nine.cssPath}/ninegrid/ngFilterPanel.css";`:"";this.shadowRoot.innerHTML=`
|
|
720
|
+
`,super.connectedCallback(),tt(this,$a,this.shadowRoot.querySelector("div.ng-pad")),tt(this,La,this.shadowRoot.querySelector("span"))}get prevLevel(){var t=parseInt(this.closest("tr").sectionRowIndex/this.owner.template.length);if(!this.owner.dataManager.viewRecords)return-1;if(t!=0){var l=this.owner.data.getNF(t-1);return l[this.cell.dataset.bind]}else for(var c=parseInt(this.cell.dataset.row)-1;c>=0;c--){var o=this.owner.data.get(c);if(!o.__ng._[H.ROW.EXPAND])return o[this.cell.dataset.bind]}return-1}}$a=new WeakMap,La=new WeakMap,Pa=new WeakMap,yi=new WeakSet,Ol=function(){return this.data.__ng._[H.ROW.EXPAND]},sc=new WeakMap,ic=new WeakMap,nc=new WeakMap,oc=new WeakMap,uu=new WeakMap,Da=new WeakMap,Ba=new WeakMap,ac=new WeakMap,lc=new WeakMap,hc=new WeakMap,customElements.get("ng-tree-item")||customElements.define("ng-tree-item",tf);class ef{constructor(E){Y(this,yt);Y(this,Ge);Y(this,wr);Y(this,vi);Y(this,wi,[]);it(this,"init",()=>{tt(this,wr,{body:$(".ng-container-body",f(this,yt).body).height()||0,thead:$(".ng-container-body thead",f(this,yt).body).height()||0,tfoot:$(".ng-container-body tfoot",f(this,yt).body).height()||0}),!f(this,vi)&&($(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(f(this,wr).body),tt(this,vi,!0))});it(this,"redraw",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),f(this,yt).dataManager&&(tt(this,Ge,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,cc).call(this),f(this,kn).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refresh())});it(this,"redrawV2",()=>{f(this,yt).touchEvent.scrollTop(),this.init(),tt(this,Ge,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,uc).call(this),f(this,kn).call(this),f(this,yt).body.querySelector("ng-vscrollbar").refreshV2()});it(this,"redrawV3",()=>{this.init(),tt(this,Ge,f(this,yt).dataManager.viewRecords.rawIndex||0),f(this,kn).call(this)});Y(this,Fa,()=>{var E=0;return $(".ng-container-body tbody.fixed tr",f(this,yt).body).each((t,l)=>{l.data&&l.data.__ng&&(E+=f(this,yt).matrix.getHeight(l.data.__ng.height[parseInt(t%f(this,yt).template.length)]))}),E});Y(this,qa,()=>{var E=f(this,Fa).call(this);const t=parseInt(f(this,Ge)*f(this,yt).template.length);return $(".ng-container-body tbody.bindable tr:not(.nodata)",f(this,yt).body).each((l,c)=>{E+=f(this,yt).matrix.getHeight(t+l)}),E});Y(this,Ha,()=>{const E=parseInt(f(this,yt).getAttribute("display-row-count"));if(f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple"))return 1;if([H.PAGINGTYPE.CLIENT,H.PAGINGTYPE.SERVER].includes(f(this,yt).paging.type))return f(this,yt).paging.linesPerPage;if(!isNaN(E))return f(this,Ge)+E>f(this,yt).data.count()&&(tt(this,Ge,E>=f(this,yt).data.count()?0:f(this,yt).data.count()-E),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ge)),E;const t=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,Fa).call(this);for(var l=0,c=0;c<t;)c+=this.getRowHeight(f(this,Ge)+l++);if(f(this,Ge)+l>f(this,yt).data.count()){l=0,c=0;for(var o=f(this,yt).data.count()-1;o>=0&&c<t;o--)c+=this.getRowHeight(o),l++;c>t&&l--,tt(this,Ge,f(this,yt).data.count()-l),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ge)}return l});Y(this,za,()=>{var E=f(this,Ha).call(this),t=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not("tr.nodata").length/(f(this,yt).template.length||1);const l=f(this,yt).template.clone(),c=l.clone(),o=l.clone();l.find("th,td").not("[fixed=left]").remove(),c.find("th,td").not("[fixed=right]").remove(),o.find("th[fixed=left],td[fixed=left],th[fixed=right],td[fixed=right]").remove();const r=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-left")),n=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-right")),s=$("tr.nodata",f(this,yt).body.querySelector(".ng-container-body"));for(var e=t;e<E;e++)l.each((u,a)=>{r.before(a.outerHTML)}),c.each((u,a)=>{n.before(a.outerHTML)}),o.each((u,a)=>{s.before(a.outerHTML)});return;var i;if(i.length>0)var t});Y(this,Ua,()=>{var E=Math.min(f(this,Ha).call(this),f(this,yt).data.count());$(".ng-container tbody.bindable tr:not(.nodata)",f(this,yt).body).each((t,l)=>{parseInt(l.sectionRowIndex/f(this,yt).template.length)>=E&&$(l).remove()}),f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{f(this,Ge)+parseInt(t.sectionRowIndex/f(this,yt).template.length)>=f(this,yt).data.count()&&$(t).remove()})});Y(this,cc,()=>{f(this,za).call(this),f(this,Ua).call(this);var E=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,qa).call(this);if(f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(E=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(E),f(this,yt).closest("dialog")&&H.j.querySelectorAll(f(this,yt)).hasClass("simple")){$("tr.nodata",f(this,yt).body).height(0);var E=47;$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata").each((l,c)=>{E+=$(c).height()}),$(f(this,yt).closest("dialog")).height(E)}});Y(this,uc,()=>{f(this,za).call(this),f(this,Ua).call(this),f(this,yt).isLastPage});Y(this,dc,()=>{for(const E of f(this,wi))clearTimeout(E);tt(this,wi,[]),f(this,wi).push(setTimeout(()=>{tt(this,vi,!1);var E=$(".ng-container-body tbody.bindable tr",f(this,yt).body).not(".nodata"),t=$(".ng-container-left tbody.bindable tr",f(this,yt).body).not(".nodata"),l=$(".ng-container-right tbody.bindable tr",f(this,yt).body).not(".nodata");if(E.length>0){var c=parseInt(E[0].dataset.row*f(this,yt).template.length);E.each((r,n)=>{var s=f(this,yt).matrix.getHeight(c+r);$("canvas.chart",n).css({height:s-4}),$("canvas.chart",t.eq(r)).css({height:s-4}),$("canvas.chart",l.eq(r)).css({height:s-4}),$(n).css({height:s}).height(s),t.eq(r).css({height:s}).height(s),l.eq(r).css({height:s}).height(s)})}f(this,yt).cell.refresh(),$("ng-row-indicator",f(this,yt).body).each((r,n)=>{n.refresh()});var o=f(this,wr).body-f(this,wr).thead-f(this,wr).tfoot-f(this,qa).call(this);f(this,yt).getAttribute("display-row-count")&&f(this,yt).data.count()>=Number(f(this,yt).getAttribute("display-row-count")||0)&&(o=0),$(".ng-container tbody.bindable tr.nodata",f(this,yt).body).height(o),f(this,yt).refreshBindRows(),f(this,yt).refreshData(),f(this,yt).paging.totalCount=f(this,yt).data.countNF(),f(this,yt).body.querySelector("ng-vscrollbar").refresh(),H.j.querySelectorAll(".ng-table tbody tr",f(this,yt).body).removeClass("hover"),H.j.querySelectorAll(f(this,yt)).removeClass("loading"),H.j.querySelectorAll("ng-filter-panel").removeClass("loading")},300)),f(this,wi).push(setTimeout(()=>{f(this,yt).refreshDataV2()}))});Y(this,kn,()=>{var E=[];f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)").forEach(t=>{E.push(f(this,Ge)+parseInt(t.sectionRowIndex/f(this,yt).template.length))}),E=[...new Set(E)],f(this,yt).body.querySelectorAll(".ng-container tbody.bindable tr:not(.nodata)").forEach(t=>{const l=parseInt(t.sectionRowIndex/f(this,yt).template.length);t.dataset.row=E[l],t.dataset.matrixRow=parseInt(E[l]*f(this,yt).template.length)+parseInt(t.sectionRowIndex%f(this,yt).template.length);for(const c of t.cells)c.dataset.row=t.dataset.row,c.dataset.matrixRow=t.dataset.matrixRow}),E.forEach(t=>{const l=f(this,yt).data.get(t);f(this,yt).body.querySelectorAll(`.ng-container tbody.bindable tr[data-row="${t}"]`).forEach(c=>{c.data=l})}),tt(this,Ge,parseInt(f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-of-type").getAttribute("data-row"))),f(this,yt).dataManager.viewRecords.rawIndex=f(this,Ge),f(this,dc).call(this),f(this,yt).isFirstPage=f(this,Ge)==0,f(this,yt).isLastPage=E[E.length-1]==f(this,yt).data.count()-1});it(this,"getVisibleFirstRow",()=>{var E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable tr:first-child");return parseInt(E.dataset.row)});it(this,"getVisibleLastRow",()=>{var E=f(this,yt).body.querySelectorAll(".ng-container-body tbody.bindable tr:not(.nodata)");return E.length>0?parseInt(E[E.length-1].dataset.row):-1});it(this,"getRowHeight",E=>{let t=0;for(var l=0;l<f(this,yt).template.length;l++)t+=f(this,yt).matrix.getHeight(parseInt(E*f(this,yt).template.length+l));return t});it(this,"getTranslateY",()=>{const E=f(this,yt).body.querySelector(".ng-container-body tbody.bindable");return!E||!E.style||!E.style.transform?0:parseFloat(E.style.transform.replace("translateY(","").replace(")",""))});it(this,"getTotalSpace",()=>$(f(this,yt).body.querySelector(".ng-container-body")).height()-($(f(this,yt).body.querySelector(".ng-container-body thead")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tfoot")).height()||0)-($(f(this,yt).body.querySelector(".ng-container-body tbody.fixed")).height()||0));it(this,"fitPage",()=>{const E=this.getVisibleLastRow(),t=this.getTotalSpace();if(E==f(this,yt).data.count()-1){for(var l=0,c=E;c>=0;c--)if(l+=this.getRowHeight(c),l>t){f(this,yt).scrollTo(c+1);break}}});it(this,"selectArea",(E,t,l,c)=>{const o=f(this,Us).call(this,E),r=f(this,Us).call(this,l),n=f(this,Vs).call(this,t),s=f(this,Vs).call(this,c),e=parseInt(o*f(this,yt).template.length),i=parseInt(r*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=o,o>=0&&r>=0?f(this,yt).selection.selectArea(e,n,i,s):this.clearSelection()});it(this,"selectRow",(E,t)=>{const l=f(this,Us).call(this,E),c=H.isNull(t)?l:f(this,Us).call(this,t),o=parseInt(l*f(this,yt).template.length),r=parseInt(c*f(this,yt).template.length)+f(this,yt).template.length-1;f(this,yt).row.at=l,l>=0&&c>=0?f(this,yt).selection.selectArea(o,f(this,yt).firstCol,r,f(this,yt).lastCol):this.clearSelection()});it(this,"selectCol",(E,t)=>{const l=f(this,Vs).call(this,E),c=H.isNull(t)?l:f(this,Vs).call(this,t),o=0,r=parseInt(f(this,yt).data.count()*f(this,yt).template.length-1);l>=0&&c>=0?f(this,yt).selection.selectArea(o,l,r,c):this.clearSelection()});it(this,"selectCell",(E,t,l)=>{const c=f(this,Us).call(this,E),o=f(this,Vs).call(this,t),r=parseInt(c*f(this,yt).template.length)+H.nvl(l,0);f(this,yt).row.at=c,c>=0?f(this,yt).selection.selectArea(r,o,r,o):this.clearSelection()});Y(this,Us,E=>{if(typeof E=="number")return E;if(typeof E=="function")return f(this,yt).data.findIndex(E);throw`invalid ${E}`});Y(this,Vs,E=>{if(typeof E=="number")return E;if(typeof E=="string"&&f(this,yt).fields.includes(E))return parseInt($(`[data-bind="${E}"]`,f(this,yt).template)[0].dataset.col);throw`invalid ${E}`});it(this,"moveTo",E=>{f(this,yt).scrollTo(E)});tt(this,yt,E),tt(this,vi,!1),this.init()}}yt=new WeakMap,Ge=new WeakMap,wr=new WeakMap,vi=new WeakMap,wi=new WeakMap,Fa=new WeakMap,qa=new WeakMap,Ha=new WeakMap,za=new WeakMap,Ua=new WeakMap,cc=new WeakMap,uc=new WeakMap,dc=new WeakMap,kn=new WeakMap,Us=new WeakMap,Vs=new WeakMap;class rf{constructor(E){Y(this,Je);Y(this,Ws);it(this,"initialize",()=>{tt(this,Ws,!1),f(this,Je).data.clearFilter()});it(this,"isFiltering",()=>f(this,Ws));it(this,"on",E=>{tt(this,Ws,!0);const t=f(this,fc).call(this);f(this,Je).body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach(l=>{var o,r;const c=(o=l.closest("tr"))==null?void 0:o.sectionRowIndex;if(c!==void 0&&c+l.rowSpan-1===t){const n=Array.from(f(this,Je).activeTmpl.querySelectorAll(`[data-col="${l.dataset.col}"]`)).map(s=>s.dataset.bind?{colnm:s.dataset.bind,data:[]}:null).filter(Boolean);if(n.length>0){(r=l.querySelector("ng-filter-button"))==null||r.remove();const s=document.createElement("ng-filter-button");l.appendChild(s),s.filterOptions=n}}})});it(this,"off",()=>{tt(this,Ws,!1),f(this,Je).body.querySelectorAll(".ng-table ng-filter-button").forEach(E=>{E.remove()})});it(this,"set",E=>{this.on();let t=Array.isArray(E)?Object.fromEntries(Object.keys(E[0]).map(l=>[l,[...new Set(E.map(c=>c[l]))]])):E;f(this,Je).data.clearFilter(),Object.entries(t).forEach(([l,c])=>{const o=f(this,Je).fields.indexOf(l);f(this,Je).data.getValidData().some(r=>typeof r.v[o]=="number")&&(c=c.map(Number)),f(this,Je).data.getValidData().filter(r=>c.nineBinarySearch(r.v[o]||"")<0).forEach(r=>{r.__ng.filtered=!0})}),f(this,Je).data.refreshFilter(),f(this,Je).shadowRoot.querySelectorAll("ng-filter-button").forEach(l=>{l.filterOptions.forEach(c=>{c.data=[]})}),Object.entries(t).forEach(([l,c])=>{f(this,Je).shadowRoot.querySelectorAll("ng-filter-button").forEach(o=>{let r=o.filterOptions;r.forEach(n=>{n.colnm===l&&(n.data=c)}),o.filterOptions=r})}),f(this,Je).scrollTo_V1(0),f(this,Je).paging.reset()});Y(this,fc,(E="thead")=>[...f(this,Je).body.querySelectorAll(`.ng-table ${E}`)].reduce((t,l)=>Math.max(l.rows.length-1,t),0));tt(this,Je,E),tt(this,Ws,!1);const t=document.createElement("ng-filter-panel");t.style.display="none",f(this,Je).shadowRoot.appendChild(t)}}Je=new WeakMap,Ws=new WeakMap,fc=new WeakMap;class sf extends HTMLElement{constructor(){super();Y(this,Va);Y(this,Cn);Y(this,Wa,t=>{var o;t.preventDefault(),t.stopPropagation();const l=f(this,Va).shadowRoot.querySelector("ng-filter-panel"),c=(o=this.closest("th,td"))==null?void 0:o.dataset.col;l.col===c?l.close():l.open(this)})}connectedCallback(){tt(this,Va,this.getRootNode().host),this.removeEventListener("click",f(this,Wa)),this.addEventListener("click",f(this,Wa))}get filterOptions(){return f(this,Cn)}set filterOptions(t){tt(this,Cn,t),this.classList.toggle("filtered",f(this,Cn).some(l=>l.data.length>0))}}Va=new WeakMap,Cn=new WeakMap,Wa=new WeakMap;class nf extends HTMLElement{constructor(){super();Y(this,Mr);Y(this,Xa);Y(this,Ya);Y(this,pc,t=>{const l=this.shadowRoot.querySelector("nine-grid");this.classList.add("loading"),setTimeout(()=>{const[c,o,r,n]=["LVL","CHK","COLNM","DATA"].map(u=>l.fields.indexOf(u)),s=l.data.getValidDataNF().filter(u=>u.v[c]===2&&u.v[o]==="Y"),e=s.length>0?[...new Set(s.map(u=>u.v[r]))].map(u=>({colnm:u,data:[...new Set(l.data.getValidData().filter(a=>a.v[o]==="Y"&&a.v[r]===u).map(a=>a.v[n]||""))].sort()})):[];f(this,Xa).filterOptions=e;const i=Object.fromEntries([...f(this,Mr).body.querySelectorAll("ng-filter-button")].flatMap(u=>u.filterOptions).filter(u=>u.data.length>0).map(u=>[u.colnm,u.data]));f(this,Mr).filtering.set(i),this.classList.remove("loading"),this.style.display="none"})});Y(this,mc,t=>{this.style.display="none"});Y(this,gc,t=>{const l=this.shadowRoot.querySelector("nine-grid"),c=l.fields.indexOf("CHK"),o=t.target.checked;l.data.getValidData().forEach(r=>{r.v[c]=o?"Y":"N"}),l.refreshData()});Y(this,bc,t=>{const l=this.shadowRoot.querySelector("nine-grid");l.classList.add("loading");const c=l.dataManager.rawRecords;c.forEach(s=>{s.__ng.filtered=!1});const o=t.target.value.toLowerCase(),[r,n]=["LVL","DATA"].map(s=>l.fields.indexOf(s));c.forEach(s=>{s.__ng.filtered=s.v[r]===2&&!String(s.v[n]||"").toLowerCase().includes(o)}),l.data.resetRecords(),clearTimeout(f(this,Ya)),tt(this,Ya,setTimeout(()=>{l.dataManager.viewRecords.reset(),l.dataManager.viewRecords.touch()},200))});it(this,"close",()=>{this.col=null,this.style.display="none"});it(this,"open",t=>{const l=t.closest("th,td"),{left:c}=t.getBoundingClientRect(),{left:o,width:r,top:n}=f(this,Mr).getBoundingClientRect(),{top:s,height:e}=l.getBoundingClientRect(),{width:i}=this.getBoundingClientRect();let u=Math.max(0,c-o);u=Math.min(u,r-i-5);const a=s+e-n;Object.assign(this.style,{left:`${u}px`,top:`${a}px`,display:"flex"}),this.classList.add("loading"),this.shadowRoot.querySelector("input[type=text]").value="",setTimeout(()=>{const h=f(this,Mr).data.getValidDataNF(),p=l.dataset.col;this.col=p,tt(this,Xa,t);const m=t.filterOptions.map((g,S)=>{const C=`<span class="group">${l.textContent}${t.filterOptions.length>1?` #${S+1} (${g.colnm})`:""}</span>`,I=f(this,Mr).activeTmpl.querySelector(`[data-col="${p}"][data-bind="${g.colnm}"]`),D=I==null?void 0:I.getAttribute("data-expr"),z=D?f(this,Mr).exprFunction(D):null,P=h.map(B=>{const F=f(this,Mr).fields.indexOf(g.colnm);return D?{v:B.v[F],v2:z(f(this,Mr).data.conv(B),B.__ng.rowidx,f(this,Mr).data)}:{v:B.v[F],v2:B.v[F]}});return[{LVL:1,CHK:"N",DATA2:C},...[...new Set(P.map(JSON.stringify))].map(JSON.parse).sort((B,F)=>(B.v2||"")>(F.v2||"")?1:(B.v2||"")<(F.v2||"")?-1:0).map(B=>({LVL:2,DATA:B.v,DATA2:B.v2||` <span class="empty">(empty)</span> ${B.v}`,COLNM:g.colnm,CHK:g.data.length===0||g.data.nineBinarySearch(B.v||"")>=0?"Y":"N"}))]}).flat(),d=this.shadowRoot.querySelector("nine-grid");d.fields.add(["DATA","DATA2","COLNM"]),d.data.set(m);const b=this.shadowRoot.querySelector("input[type=checkbox]");b.checked=d.data.getValidData().every(g=>!(g.LVL===2&&g.CHK!=="Y")),this.shadowRoot.querySelector("input").focus(),this.classList.remove("loading")})});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,Mr,this.getRootNode().host);const t=this.getRootNode().host.closest("nine-grid").getAttribute("css-path")||"";this.shadowRoot.innerHTML=`
|
|
721
721
|
<style>
|
|
722
722
|
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngFilterPanel.css";
|
|
723
|
-
${
|
|
723
|
+
${H.getCustomPath(this,"ngFilterPanel.css")}
|
|
724
724
|
</style>
|
|
725
725
|
|
|
726
726
|
<div class="head">
|
|
@@ -750,7 +750,7 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
|
|
|
750
750
|
<button id="btnOk">OK</button>
|
|
751
751
|
<button id="btnCancel">Cancel</button>
|
|
752
752
|
</div>
|
|
753
|
-
`,this.shadowRoot.querySelector("input[type=text]").addEventListener("input",f(this,bc)),this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change",f(this,gc)),this.shadowRoot.querySelector("#btnOk").addEventListener("click",f(this,pc)),this.shadowRoot.querySelector("#btnCancel").addEventListener("click",f(this,mc))}}Mr=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,pc=new WeakMap,mc=new WeakMap,gc=new WeakMap,bc=new WeakMap,customElements.get("ng-filter-button")||customElements.define("ng-filter-button",sf),customElements.get("ng-filter-panel")||customElements.define("ng-filter-panel",nf);class Yn extends HTMLElement{constructor(){
|
|
753
|
+
`,this.shadowRoot.querySelector("input[type=text]").addEventListener("input",f(this,bc)),this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change",f(this,gc)),this.shadowRoot.querySelector("#btnOk").addEventListener("click",f(this,pc)),this.shadowRoot.querySelector("#btnCancel").addEventListener("click",f(this,mc))}}Mr=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,pc=new WeakMap,mc=new WeakMap,gc=new WeakMap,bc=new WeakMap,customElements.get("ng-filter-button")||customElements.define("ng-filter-button",sf),customElements.get("ng-filter-panel")||customElements.define("ng-filter-panel",nf);class Yn extends HTMLElement{constructor(){super();Y(this,Ga,!1);Y(this,xi);Y(this,Ka);Y(this,En);Y(this,os);it(this,"export",()=>{const t=this.shadowRoot.querySelector("ng-export");t&&t.remove();const l=document.createElement("ng-export");this.shadowRoot.appendChild(l),setTimeout(()=>{l.exportExcel()})});it(this,"maximize",()=>{const t=this.shadowRoot.querySelector("ng-max-popup");t&&t.remove();const l=document.createElement("ng-max-popup");this.shadowRoot.appendChild(l),setTimeout(()=>{l.popup()})});it(this,"refreshData",t=>{if(t==null){var l=[];$(".ng-container-body tbody.bindable tr",this.body).not(".nodata").each((r,n)=>{l.push(this.dataManager.viewRecords.rawIndex+parseInt(n.sectionRowIndex/this.template.length))}),l=[...new Set(l)],l.forEach(r=>{const n=this.data.get(r);this.body.querySelectorAll(`.ng-container tbody.bindable tr[data-row="${r}"]`).forEach(s=>{s.data=n})});var c=[];$(".ng-container-body tbody.fixed tr",this.body).not(".nodata").each((r,n)=>{c.push({INDEX:n.data.__ng._[H.ROW.INDEX],ROW:n.dataset.row})}),c.forEach(r=>{const n=this.data.getNF(r.INDEX);this.body.querySelectorAll(`.ng-container tbody.fixed tr[data-row="${r.ROW}"]`).forEach(s=>{s.data=n})})}else{t=parseInt(t);const r=t<0?this.data.getNF(this.body.querySelector(`tbody.fixed tr[data-row="${t}"]`).dataset.index):this.data.get(t);this.body.querySelectorAll(`.ng-container tbody tr[data-row="${t}"]`).forEach(n=>{n.data=r})}(t==null?$(".ng-container tbody tr th,.ng-container tbody tr td",this.body):$(`.ng-container tbody tr[data-row=${t}] th,.ng-container tbody tr[data-row=${t}] td`,this.body)).each((r,n)=>{n.children[0]&&n.children[0].dataRefresh&&n.dataset.row&&n.children[0].dataRefresh()}),$(".ng-container thead tr th,.ng-container thead tr td,.ng-container tfoot tr th,.ng-container tfoot tr td",this.body).each((r,n)=>{n.children[0]&&n.children[0].dataRefresh&&n.children[0].dataRefresh()})});it(this,"refreshDataV2",()=>{$(".ng-container tbody tr th,.ng-container tbody tr td",this.body).each((l,c)=>{c.children[0]&&c.children[0].dataRefresh&&c.dataset.row&&c.children[0].dataRefresh(!0)}),$(".ng-container thead tr th,.ng-container thead tr td,.ng-container tfoot tr th,.ng-container tfoot tr td",this.body).each((l,c)=>{c.children[0]&&c.children[0].dataRefresh&&c.children[0].dataRefresh(!0)})});Y(this,Za,t=>{this.dataManager&&(this.data.clear(),this.dataManager.setDataSource(t),this.refresh(),this.paging&&this.paging.refresh(),this.scrollTo_V1(0))});it(this,"changeRayout",t=>{$(".ng-container-left",this.body).children().remove(),$(".ng-container-right",this.body).children().remove(),$(".ng-container-body",this.body).children().remove(),$(".ng-container-body",this.shadowRoot).append(f(this,os)[t]),f(this,tl).call(this),this.createTemplate(),f(this,Ja).call(this),this.resetTemplate(),f(this,Qa).call(this),this.cell.resetEvent(),this.touchEvent.resetEvent(),f(this,xi).resetEvent(),f(this,Ka).resetEvent(),f(this,En)&&f(this,En).resetEvent(),this.sorting&&this.sorting.initialize(),this.filtering&&this.filtering.initialize(),this.pin&&this.pin.initialize(),this.data.initialize(),setTimeout(()=>{this.paging&&this.paging.refresh(),this.scrollTo_V1(0)})});Y(this,Ja,()=>{this.elements={table:$(this.body.querySelector(".ng-container-body > table")),hscrollbar:$(this.body.querySelector("ng-hscrollbar")),vscrollbar:$(this.body.querySelector("ng-vscrollbar")),bodyLeft:$(this.body.querySelector(".ng-container-left")),bodyBody:$(this.body.querySelector(".ng-container-body")),bodyRight:$(this.body.querySelector(".ng-container-right"))},this.elements.table.show();var t=this.elements.table.clone();this.elements.bodyLeft.html(t.clone()),$("col,th,td",this.elements.bodyLeft).not("[fixed=left]").remove();var l=0;if($("col",this.elements.bodyLeft).each((o,r)=>{l+=parseInt(H.j.querySelectorAll(r).attr("width"))}),this.elements.bodyLeft.css({width:l,"min-width":l}),this.elements.bodyRight.html(t.clone()),$("col,th,td",this.elements.bodyRight).not("[fixed=right]").remove(),l=0,$("col",this.elements.bodyRight).each((o,r)=>{l+=parseInt(H.j.querySelectorAll(r).attr("width"))}),this.elements.bodyRight.css({width:l,"min-width":l}),this.elements.bodyBody.html(t.clone()),this.elements.bodyBody.find("[fixed=left]").remove(),this.elements.bodyBody.find("[fixed=right]").remove(),this.elements.bodyLeft.find("tbody tr").remove(),this.elements.bodyRight.find("tbody tr").remove(),this.elements.bodyBody.find("tbody tr").remove(),this.elements.bodyBody.find("table").width(0),$(".ng-container .ng-table tr.nodata",this.body).length<=0){var c='<tr class="nodata"></tr>';this.elements.bodyLeft.find("tbody.bindable").append(c),this.elements.bodyRight.find("tbody.bindable").append(c),this.elements.bodyBody.find("tbody.bindable").append(c)}});Y(this,yc,()=>{if(!this.template)return 0;var t=0;return this.template.each((l,c)=>{t+=$(c).height()}),t});Y(this,vs,()=>{const t=parseInt(this.getAttribute("display-row-count"));if(isNaN(t))return;const l=this.shadowRoot.querySelector("ng-head");l&&setTimeout(()=>{const c=parseInt(window.getComputedStyle(l).getPropertyValue("padding-bottom"),10);var o=($(l).height()||0)+($("ng-foot",this.shadowRoot).height()||0)+($(".ng-container-body thead",this.shadowRoot).height()||0)+($(".ng-container-body tfoot:visible",this.shadowRoot).height()||0)+($(".ng-container-bottom:visible",this.shadowRoot).height()||0)+c+(f(this,yc).call(this)||0)*t+3;$(this).height(o)})});Y(this,vc,()=>{if(f(this,Ga))return;this.originFormat=this.outerHTML,this.uuid=H.randomUUID(),this.id||(this.id=this.uuid),$("table",this).each((r,n)=>{if($("colgroup",n).length==0){var s=0;$("tbody tr",n).eq(0).find("th,td").each((i,u)=>{s+=u.colSpan||1}),$(n).prepend("<colgroup></colgroup>");for(var e=Math.max(parseInt(($(n).width()-16)/s)-1,100),r=0;r<s;r++)$("colgroup",n).append(`<col width="${e}" />`)}n.querySelector("thead")||$("colgroup",n).after("<thead></thead>"),$("tbody th,tbody td",n).each((i,u)=>{u.innerHTML.trim()==""&&(u.innerHTML="<ng-renderer>")}),$("thead th,thead td,tfoot th,tfoot td",n).each((i,u)=>{u.dataset&&u.dataset.expr&&(u.innerHTML="<ng-renderer>"),u.getAttribute("title")||u.setAttribute("title",u.innerHTML)}),$("datalist_BAK",n).each((i,u)=>{if(u.parentNode.getAttribute("data-source"))return!0;const a=[];u.querySelectorAll("option").forEach(m=>{for(var d={},b=0;b<m.attributes.length;b++)d[m.attributes[b].name]=m.attributes[b].value;a.push(d)}),window[this.id]||(window[this.id]=this),window[this.id]["code"+i]=a;const h=u.closest("th,td");if(h){const m=h.getAttribute("key")||"key",d=h.getAttribute("value")||"value",b=h.getAttribute("multi-separator")||",";var p=`window["${this.id}"]["code${i}"]`;u.parentNode.setAttribute("data-source",p),h.dataset.expr=`ninegrid.binarySearchValue(${p}, "${m}", data["${h.dataset.bind}"].split("${b}"), "${d}")`}}),$(n).hide(),f(this,os).push(n),H.j.querySelectorAll(this).hasClass("simple")||f(this,_c).call(this,n)});const t=`
|
|
754
754
|
<style>
|
|
755
755
|
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ninegrid.css";
|
|
756
756
|
${H.getCustomPath(this,"ninegrid.css")}
|
|
@@ -1380,5 +1380,5 @@ Do you want to save it?`,"SAVE",{class:"rgb","true-text":"Yes","false-text":"No"
|
|
|
1380
1380
|
</div>
|
|
1381
1381
|
</div>
|
|
1382
1382
|
</dialog>
|
|
1383
|
-
`;const o=this.querySelector(".title");o&&t&&(o.textContent=t),f(this,Xc).call(this)}}Ss=new WeakMap,Xc=new WeakMap,Tl=new WeakMap,Hn=new WeakMap,Rl=new WeakMap,Ml=new WeakMap,zn=new WeakMap,Il=new WeakMap,customElements.get("nx-modal")||customElements.define("nx-modal",Nf),window.jQuery=window.$=Se;function Of(){customElements.get("nine-
|
|
1383
|
+
`;const o=this.querySelector(".title");o&&t&&(o.textContent=t),f(this,Xc).call(this)}}Ss=new WeakMap,Xc=new WeakMap,Tl=new WeakMap,Hn=new WeakMap,Rl=new WeakMap,Ml=new WeakMap,zn=new WeakMap,Il=new WeakMap,customElements.get("nx-modal")||customElements.define("nx-modal",Nf),window.jQuery=window.$=Se;function Of(){customElements.get("nine-grid")||customElements.define("nine-grid",Yn)}fe.NineGridContainer=Yn,fe.default=H,fe.defineCustomElements=Of,Object.defineProperties(fe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1384
1384
|
//# sourceMappingURL=nine-grid.umd.js.map
|