@guiexpert/table 1.1.26 → 1.1.27

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/css/main.css CHANGED
@@ -348,3 +348,7 @@ html[data-theme="dark"] {
348
348
  display: grid;
349
349
  grid-template-columns: 16px 1fr;
350
350
  }
351
+ .ge-table-col-div.ge-table-col-tree.ge-table-tree-cell.ge-with-checkbox {
352
+ display: grid;
353
+ grid-template-columns: 16px 20px 1fr;
354
+ }
@@ -51,3 +51,7 @@
51
51
  display: grid;
52
52
  grid-template-columns: 16px 1fr;
53
53
  }
54
+ .ge-table-col-div.ge-table-col-tree.ge-table-tree-cell.ge-with-checkbox {
55
+ display: grid;
56
+ grid-template-columns: 16px 20px 1fr;
57
+ }
package/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Qe(c=500){return function(e,t,o){let i=0;const s=o.value;return o.value=function(...r){if(!(Date.now()-i<c))return i=Date.now(),s.apply(this,r)},o}}class P{constructor(){this.alreadySet=!1}static getInstance(){return P.instance||(P.instance=new P),P.instance}setLicenseKey(e){if(e&&!this.alreadySet){const t=document.createElement("meta");t.content="license="+e,t.name="guiexperttable",document.getElementsByTagName("head")[0].appendChild(t),this.alreadySet=!0}}}function L(c){return c&&c.type==="TreeRow"}function j(c){return c&&c.type==="AreaModelTree"}function Ce(c){return c&&c.type==="CheckboxColumnDef"}class J{constructor(e=-1,t=-1,o=-1,i=-1,s,r,n,l=0,d=0,a=0,h=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=o,this.columnLeft=i,this.areaIdent=s,this.sideIdent=r,this.originalEvent=n,this.clickCount=l,this.draggingX=d,this.draggingY=a,this.action=h}clone(){return new J(this.rowIndex,this.rowTop,this.columnIndex,this.columnLeft,this.areaIdent,this.sideIdent,this.originalEvent,this.clickCount,this.draggingX,this.draggingY,this.action)}}class O{constructor(e=">",t="",o=[]){this.content=e,this.style=t,this.classes=o}}class ge{constructor(e=new O(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new O(">","",["ge-table-tree-arrow-collapsed"]),o=new O(">","color:transparent;",["gt-table-tree-arrow-hidden"]),i=new O("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=o,this.arrowExpandCollapseAll=i}}class pe{constructor(e=new O("↑","",["ge-header-sorted-asc"]),t=new O("↓","",["ge-header-sorted-desc"]),o=new O("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=o}}class ye{constructor(e){this.domService=e}setStyle(e,t,o){return this.domService.setStyle(e,t,o),e}applyStyle(e,t){for(const o in t)this.domService.setStyle(e,o,t[o]);return e}applyDisplayNoneStyle(e){return this.domService.setStyle(e,"display","none"),e}applyDisplayBlockStyle(e){return this.domService.setStyle(e,"display","block"),e}applyStyleInPx(e,t){return Object.entries(t).forEach(([o,i])=>this.domService.setStyle(e,o,i+"px")),e}applyStylePosistionRelative(e){return this.domService.setStyle(e,"position","relative"),this.domService.setStyle(e,"overflow","clip"),e}applyStylePosistionAbsolute(e){return this.domService.setStyle(e,"position","absolute"),e}applyStyleFullSize(e){return this.domService.setStyle(e,"width","100%"),this.domService.setStyle(e,"height","100%"),e}applyStyleOverflowAuto(e="auto",t="auto",o){return this.domService.setStyle(o,"overflow-x",e),this.domService.setStyle(o,"overflow-y",t),o}applyStyleNoPadding(e){return this.domService.setStyle(e,"padding","0"),this.domService.setStyle(e,"margin","0"),this.domService.setStyle(e,"border","0"),e}appendRelativeChildDiv(e){const t=this.applyStylePosistionRelative(this.applyStyleFullSize(this.applyStyleNoPadding(this.domService.createElement("div"))));return this.domService.appendChild(e,t),this.applyStylePosistionAbsolute(e),{parent:e,child:t,cache:{}}}appendText(e,t){const o=this.domService.createText(t);return this.domService.appendChild(e,o),o}addClass(e,t){return e.includes(" ")?e.split(" ").forEach(o=>this.domService.addClass(t,o)):this.domService.addClass(t,e),t}removeClass(e,t){return e.includes(" ")?e.split(" ").forEach(o=>this.domService.removeClass(t,o)):this.domService.removeClass(t,e),t}addClasses(e,t){if(e)for(const o of e)this.domService.addClass(t,o);return t}setAttribute(e,t,o){return t&&o&&this.domService.setAttribute(e,t,o),e}createAreaDivWithClass(e,t,o,i){const s=this.domService.createElement("div");return this.addClass(e,s),this.domService.setAttribute(s,"data-area",o),this.domService.setAttribute(s,"data-side",i),this.domService.appendChild(t,s),s}createDivWithClass(e,t){const o=this.domService.createElement("div");return this.addClass(e,o),this.domService.appendChild(t,o),o}addRowDiv(e,t,o=-1,i,s,r=""){const n=t.index??-1,l=this.getDivOrCreateDiv(n,e);if(this.domService.addClass(l,"ge-table-row-div"),this.domService.addClass(l,`ge-table-row-div-${t.index}`),i==="body"&&s==="center"){const d=((t==null?void 0:t.index)??0)%2===0?"even":"odd";this.domService.addClass(l,`ge-table-row-${d}`)}if(this.domService.setStyle(l,"display","clip"),this.domService.setStyle(l,"position","absolute"),this.domService.setStyle(l,"left",`${t.left}px`),this.domService.setStyle(l,"top",`${t.top}px`),this.domService.setStyle(l,"width",`${t.width}px`),this.domService.setStyle(l,"height",`${t.height}px`),this.domService.setAttribute(l,"data-row-index",`${o}`),this.domService.setAttribute(l,"data-area",`${i}`),r){const d=this.domService.createText(r);this.domService.appendChild(l,d)}return this.domService.appendChild(e.child,l),l}addColumnDiv(e){const{parent:t,geo:o,rowIndex:i=-1,columnIndex:s=-1,areaIdent:r,sideIdent:n,text:l="",treeArrow:d,tableOptions:a,checkedType:h=void 0,sortState:u}=e,m=a==null?void 0:a.treeOptions,b=a==null?void 0:a.showCheckboxWihoutExtraColumn,f=this.domService.createElement("div");this.domService.addClass(f,"ge-table-col-div"),this.domService.addClass(f,`ge-table-col-div-${o.index}`),this.domService.setAttribute(f,"data-col-index",`${o.index}`),this.domService.setAttribute(f,"data-row-index",`${i}`),this.domService.setAttribute(f,"data-area",`${r}`);const g=((o==null?void 0:o.index)??0)%2===0?"even":"odd";if(r==="body"&&n==="center"&&this.domService.addClass(f,`ge-table-column-${g}`),this.domService.setStyle(f,"display","clip"),this.domService.setStyle(f,"position","absolute"),this.domService.setStyle(f,"left",`${o.left}px`),this.domService.setStyle(f,"top",`${o.top}px`),this.domService.setStyle(f,"width",`${o.width}px`),this.domService.setStyle(f,"height",`${o.height}px`),d&&d!=="none"&&(this.domService.addClass(f,"ge-table-col-tree"),this.addArrowDiv(f,d,m,i,s,r)),b&&s===0&&h&&this.addCheckboxToDiv(f,h,r,i),l){const p=d!=="none"&&s===0;this.addLabelDiv(f,l,p,i,s,r)}return u&&this.addSortedIcon(f,u,a==null?void 0:a.sortedOptions,s),this.domService.appendChild(t,f),f}addCheckboxToDiv(e,t,o,i){const s=this.domService.createElement("div"),r=t==="full"?"checked":"";return s.innerHTML=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Qe(c=500){return function(e,t,o){let i=0;const s=o.value;return o.value=function(...r){if(!(Date.now()-i<c))return i=Date.now(),s.apply(this,r)},o}}class P{constructor(){this.alreadySet=!1}static getInstance(){return P.instance||(P.instance=new P),P.instance}setLicenseKey(e){if(e&&!this.alreadySet){const t=document.createElement("meta");t.content="license="+e,t.name="guiexperttable",document.getElementsByTagName("head")[0].appendChild(t),this.alreadySet=!0}}}function L(c){return c&&c.type==="TreeRow"}function j(c){return c&&c.type==="AreaModelTree"}function Ce(c){return c&&c.type==="CheckboxColumnDef"}class J{constructor(e=-1,t=-1,o=-1,i=-1,s,r,n,l=0,d=0,a=0,h=""){this.rowIndex=e,this.rowTop=t,this.columnIndex=o,this.columnLeft=i,this.areaIdent=s,this.sideIdent=r,this.originalEvent=n,this.clickCount=l,this.draggingX=d,this.draggingY=a,this.action=h}clone(){return new J(this.rowIndex,this.rowTop,this.columnIndex,this.columnLeft,this.areaIdent,this.sideIdent,this.originalEvent,this.clickCount,this.draggingX,this.draggingY,this.action)}}class O{constructor(e=">",t="",o=[]){this.content=e,this.style=t,this.classes=o}}class ge{constructor(e=new O(">","transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",["gt-table-tree-arrow-expanded"]),t=new O(">","",["ge-table-tree-arrow-collapsed"]),o=new O(">","color:transparent;",["gt-table-tree-arrow-hidden"]),i=new O("↕","",["gt-table-tree-arrow-expanded-all"])){this.arrowExpanded=e,this.arrowCollapsed=t,this.arrowPlaceholder=o,this.arrowExpandCollapseAll=i}}class pe{constructor(e=new O("↑","",["ge-header-sorted-asc"]),t=new O("↓","",["ge-header-sorted-desc"]),o=new O("↑","color:transparent;",[])){this.iconAsc=e,this.iconDesc=t,this.iconPlaceholder=o}}class ye{constructor(e){this.domService=e}setStyle(e,t,o){return this.domService.setStyle(e,t,o),e}applyStyle(e,t){for(const o in t)this.domService.setStyle(e,o,t[o]);return e}applyDisplayNoneStyle(e){return this.domService.setStyle(e,"display","none"),e}applyDisplayBlockStyle(e){return this.domService.setStyle(e,"display","block"),e}applyStyleInPx(e,t){return Object.entries(t).forEach(([o,i])=>this.domService.setStyle(e,o,i+"px")),e}applyStylePosistionRelative(e){return this.domService.setStyle(e,"position","relative"),this.domService.setStyle(e,"overflow","clip"),e}applyStylePosistionAbsolute(e){return this.domService.setStyle(e,"position","absolute"),e}applyStyleFullSize(e){return this.domService.setStyle(e,"width","100%"),this.domService.setStyle(e,"height","100%"),e}applyStyleOverflowAuto(e="auto",t="auto",o){return this.domService.setStyle(o,"overflow-x",e),this.domService.setStyle(o,"overflow-y",t),o}applyStyleNoPadding(e){return this.domService.setStyle(e,"padding","0"),this.domService.setStyle(e,"margin","0"),this.domService.setStyle(e,"border","0"),e}appendRelativeChildDiv(e){const t=this.applyStylePosistionRelative(this.applyStyleFullSize(this.applyStyleNoPadding(this.domService.createElement("div"))));return this.domService.appendChild(e,t),this.applyStylePosistionAbsolute(e),{parent:e,child:t,cache:{}}}appendText(e,t){const o=this.domService.createText(t);return this.domService.appendChild(e,o),o}addClass(e,t){return e.includes(" ")?e.split(" ").forEach(o=>this.domService.addClass(t,o)):this.domService.addClass(t,e),t}removeClass(e,t){return e.includes(" ")?e.split(" ").forEach(o=>this.domService.removeClass(t,o)):this.domService.removeClass(t,e),t}addClasses(e,t){if(e)for(const o of e)this.domService.addClass(t,o);return t}setAttribute(e,t,o){return t&&o&&this.domService.setAttribute(e,t,o),e}createAreaDivWithClass(e,t,o,i){const s=this.domService.createElement("div");return this.addClass(e,s),this.domService.setAttribute(s,"data-area",o),this.domService.setAttribute(s,"data-side",i),this.domService.appendChild(t,s),s}createDivWithClass(e,t){const o=this.domService.createElement("div");return this.addClass(e,o),this.domService.appendChild(t,o),o}addRowDiv(e,t,o=-1,i,s,r=""){const n=t.index??-1,l=this.getDivOrCreateDiv(n,e);if(this.domService.addClass(l,"ge-table-row-div"),this.domService.addClass(l,`ge-table-row-div-${t.index}`),i==="body"&&s==="center"){const d=((t==null?void 0:t.index)??0)%2===0?"even":"odd";this.domService.addClass(l,`ge-table-row-${d}`)}if(this.domService.setStyle(l,"display","clip"),this.domService.setStyle(l,"position","absolute"),this.domService.setStyle(l,"left",`${t.left}px`),this.domService.setStyle(l,"top",`${t.top}px`),this.domService.setStyle(l,"width",`${t.width}px`),this.domService.setStyle(l,"height",`${t.height}px`),this.domService.setAttribute(l,"data-row-index",`${o}`),this.domService.setAttribute(l,"data-area",`${i}`),r){const d=this.domService.createText(r);this.domService.appendChild(l,d)}return this.domService.appendChild(e.child,l),l}addColumnDiv(e){const{parent:t,geo:o,rowIndex:i=-1,columnIndex:s=-1,areaIdent:r,sideIdent:n,text:l="",treeArrow:d,tableOptions:a,checkedType:h=void 0,sortState:u}=e,m=a==null?void 0:a.treeOptions,b=a==null?void 0:a.showCheckboxWihoutExtraColumn,f=this.domService.createElement("div");this.domService.addClass(f,"ge-table-col-div"),b&&this.domService.addClass(f,"ge-with-checkbox"),this.domService.addClass(f,`ge-table-col-div-${o.index}`),this.domService.setAttribute(f,"data-col-index",`${o.index}`),this.domService.setAttribute(f,"data-row-index",`${i}`),this.domService.setAttribute(f,"data-area",`${r}`);const g=((o==null?void 0:o.index)??0)%2===0?"even":"odd";if(r==="body"&&n==="center"&&this.domService.addClass(f,`ge-table-column-${g}`),this.domService.setStyle(f,"display","clip"),this.domService.setStyle(f,"position","absolute"),this.domService.setStyle(f,"left",`${o.left}px`),this.domService.setStyle(f,"top",`${o.top}px`),this.domService.setStyle(f,"width",`${o.width}px`),this.domService.setStyle(f,"height",`${o.height}px`),d&&d!=="none"&&(this.domService.addClass(f,"ge-table-col-tree"),this.addArrowDiv(f,d,m,i,s,r)),b&&s===0&&h&&this.addCheckboxToDiv(f,h,r,i),l){const p=d!=="none"&&s===0;this.addLabelDiv(f,l,p,i,s,r)}return u&&this.addSortedIcon(f,u,a==null?void 0:a.sortedOptions,s),this.domService.appendChild(t,f),f}addCheckboxToDiv(e,t,o,i){const s=this.domService.createElement("div"),r=t==="full"?"checked":"";return s.innerHTML=`
2
2
  <input
3
3
  type="checkbox"
4
4
  data-area="${o}"
package/index.js CHANGED
@@ -180,7 +180,7 @@ class ve {
180
180
  }
181
181
  addColumnDiv(e) {
182
182
  const { parent: t, geo: o, rowIndex: i = -1, columnIndex: s = -1, areaIdent: r, sideIdent: l, text: n = "", treeArrow: d, tableOptions: a, checkedType: h = void 0, sortState: u } = e, m = a == null ? void 0 : a.treeOptions, b = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, f = this.domService.createElement("div");
183
- this.domService.addClass(f, "ge-table-col-div"), this.domService.addClass(f, `ge-table-col-div-${o.index}`), this.domService.setAttribute(f, "data-col-index", `${o.index}`), this.domService.setAttribute(f, "data-row-index", `${i}`), this.domService.setAttribute(f, "data-area", `${r}`);
183
+ this.domService.addClass(f, "ge-table-col-div"), b && this.domService.addClass(f, "ge-with-checkbox"), this.domService.addClass(f, `ge-table-col-div-${o.index}`), this.domService.setAttribute(f, "data-col-index", `${o.index}`), this.domService.setAttribute(f, "data-row-index", `${i}`), this.domService.setAttribute(f, "data-area", `${r}`);
184
184
  const g = ((o == null ? void 0 : o.index) ?? 0) % 2 === 0 ? "even" : "odd";
185
185
  if (r === "body" && l === "center" && this.domService.addClass(f, `ge-table-column-${g}`), this.domService.setStyle(f, "display", "clip"), this.domService.setStyle(f, "position", "absolute"), this.domService.setStyle(f, "left", `${o.left}px`), this.domService.setStyle(f, "top", `${o.top}px`), this.domService.setStyle(f, "width", `${o.width}px`), this.domService.setStyle(f, "height", `${o.height}px`), d && d !== "none" && (this.domService.addClass(f, "ge-table-col-tree"), this.addArrowDiv(f, d, m, i, s, r)), b && s === 0 && h && this.addCheckboxToDiv(f, h, r, i), n) {
186
186
  const p = d !== "none" && s === 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.1.26",
3
+ "version": "1.1.27",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./index.js",