@guiexpert/solid-table 1.0.7 → 1.0.8

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.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.js +12 -8
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -17,4 +17,4 @@
17
17
  data-col-index="${s}"
18
18
  data-input-type="text"
19
19
  style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
20
- class="ge-table-cell-editor-input">`}}}class at{constructor(e="none",t="single"){this.selectionType=e,this.selectionMode=t,this.ranges=[],this.negativeRanges=[],this.allSelected=!1}getSelectionCount(e,t){let s=0;for(const i of this.ranges)i.isInRange(e,t)&&s++;return this.allSelected&&s++,this.isInNegativeRange(e,t)&&(s=0),s}isInNegativeRange(e,t){for(const s of this.negativeRanges)if(s.isInRange(e,t))return!0;return!1}getRanges(){return this.ranges}clear(){this.ranges=[],this.negativeRanges=[],this.allSelected=!1}hasSelection(){return!!this.ranges.length}selectAll(){this.allSelected=!0}addSelection(e){this.addRange(e)}removeSelection(e){if(this.selectionType==="none")return;let t=e;this.selectionType==="row"?t=T.singleRow(e.r1):this.selectionType==="column"&&(t=T.singleColumn(e.c1)),this.negativeRanges.push(t)}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(T.singleCell(e,t)):this.addSelection(T.singleCell(e,t))}addRange(e){this.selectionType!=="none"&&(this.allSelected=!1,this.selectionMode==="single"&&(this.ranges=[]),this.selectionType==="row"?(e.c1=0,e.c2=Number.MAX_SAFE_INTEGER):this.selectionType==="column"?(e.r1=0,e.r2=Number.MAX_SAFE_INTEGER):this.selectionType==="cell"?(e.r2=e.r1,e.c2=e.c1):this.selectionType,this.ranges.push(e))}}class dt{constructor(e="none"){this.selectionType=e,this.rowIndex=-1,this.columnIndex=-1,this.changed=!1}clearChanged(){this.changed=!1}hasChanged(){return this.changed}clear(){this.rowIndex=-1,this.columnIndex=-1}setFocus(e,t){(this.rowIndex!==e||this.columnIndex!==t)&&(this.rowIndex=e,this.columnIndex=t,this.changed=!0)}hasFocus(e,t){return this.rowIndex===e&&this.columnIndex===t}getFocus(){return[this.rowIndex,this.columnIndex]}}const ht=new at,ct=new dt("cell");class ut{constructor(){this.overflowX="auto",this.overflowY="auto",this.horizontalBorderVisible=!0,this.verticalBorderVisible=!0,this.footerSeparatorBorderVisible=!0,this.headerSeparatorBorderVisible=!0,this.fixedEastSeparatorBorderVisible=!0,this.fixedWestSeparatorBorderVisible=!0,this.tableTopBorderVisible=!0,this.tableBottomBorderVisible=!0,this.hoverRowVisible=!0,this.hoverColumnVisible=!0,this.columnsResizable=!0,this.columnsDraggable=!0,this.columnResizeHandleWidthInPx=4,this.defaultRowHeights={header:34,body:34,footer:34},this.footerVerticalSeparator=!1,this.headerToggleExpandCollapseIcons=!1,this.headerVerticalSeparator=!1,this.treeOptions=new ge,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new Se,this.sortOrder=["asc","desc"],this.getEditRenderer=(e,t)=>new nt,this.getSelectionModel=()=>ht,this.getFocusModel=()=>ct}}class pt{setStyle(e,t,s){return e.style[t]=s,e}appendText(e,t){const s=this.createText(t);return this.appendChild(e,s),s}addClass(e,t){return t.includes(" ")?t.split(" ").forEach(s=>e.classList.add(s)):e.classList.add(t),e}appendChild(e,t){e.appendChild(t)}createElement(e){return document.createElement(e)}createText(e){return document.createTextNode(e)}setAttribute(e,t,s){e.setAttribute(t,s)}}const ft=Oe("<div>"),gt=l=>{let e;const t=fe({tableModel:null,tableOptions:new ut},l);return ve(()=>{const s={onCheckboxChanged:r=>{const n=new CustomEvent("checkboxChanged",{detail:r,bubbles:!0});e&&e.dispatchEvent(n)},onContextmenu:r=>{const n=new CustomEvent("contextmenu",{detail:r,bubbles:!0});e&&e.dispatchEvent(n)},onModelChanged:r=>{const n=new CustomEvent("modelChanged",{detail:r,bubbles:!0});e&&e.dispatchEvent(n)},onMouseClicked:r=>{const n=new CustomEvent("mouseClicked",{detail:r,bubbles:!0});e&&e.dispatchEvent(n)},onMouseDragging:r=>{const n=new CustomEvent("mouseDragging",{detail:r,bubbles:!0});e&&e.dispatchEvent(n)},onMouseDraggingEnd:r=>{const n=new CustomEvent("mouseDraggingEnd",{detail:r,bubbles:!0});e&&e.dispatchEvent(n)},onMouseMoved:r=>{const n=new CustomEvent("mouseMoved",{detail:r,bubbles:!0});e&&e.dispatchEvent(n)}},i=new rt(e,t.tableModel,new pt,t.tableOptions,s);i.firstInit();const o=new CustomEvent("tableReady",{detail:i.getApi(),bubbles:!0});e&&e.dispatchEvent(o)}),(()=>{const s=ft(),i=e;return typeof i=="function"?Le(i,s):e=s,s})()};exports.ComponentRendererWrapper=Be;exports.GuiexpertTable=gt;exports.GuiexpertTableProps=$e;
20
+ class="ge-table-cell-editor-input">`}}}class at{constructor(e="none",t="single"){this.selectionType=e,this.selectionMode=t,this.ranges=[],this.negativeRanges=[],this.allSelected=!1}getSelectionCount(e,t){let s=0;for(const i of this.ranges)i.isInRange(e,t)&&s++;return this.allSelected&&s++,this.isInNegativeRange(e,t)&&(s=0),s}isInNegativeRange(e,t){for(const s of this.negativeRanges)if(s.isInRange(e,t))return!0;return!1}getRanges(){return this.ranges}clear(){this.ranges=[],this.negativeRanges=[],this.allSelected=!1}hasSelection(){return!!this.ranges.length}selectAll(){this.allSelected=!0}addSelection(e){this.addRange(e)}removeSelection(e){if(this.selectionType==="none")return;let t=e;this.selectionType==="row"?t=T.singleRow(e.r1):this.selectionType==="column"&&(t=T.singleColumn(e.c1)),this.negativeRanges.push(t)}togglePoint(e,t){this.getSelectionCount(e,t)>0?this.removeSelection(T.singleCell(e,t)):this.addSelection(T.singleCell(e,t))}addRange(e){this.selectionType!=="none"&&(this.allSelected=!1,this.selectionMode==="single"&&(this.ranges=[]),this.selectionType==="row"?(e.c1=0,e.c2=Number.MAX_SAFE_INTEGER):this.selectionType==="column"?(e.r1=0,e.r2=Number.MAX_SAFE_INTEGER):this.selectionType==="cell"?(e.r2=e.r1,e.c2=e.c1):this.selectionType,this.ranges.push(e))}}class dt{constructor(e="none"){this.selectionType=e,this.rowIndex=-1,this.columnIndex=-1,this.changed=!1}clearChanged(){this.changed=!1}hasChanged(){return this.changed}clear(){this.rowIndex=-1,this.columnIndex=-1}setFocus(e,t){(this.rowIndex!==e||this.columnIndex!==t)&&(this.rowIndex=e,this.columnIndex=t,this.changed=!0)}hasFocus(e,t){return this.rowIndex===e&&this.columnIndex===t}getFocus(){return[this.rowIndex,this.columnIndex]}}const ht=new at,ct=new dt("cell");class ut{constructor(){this.overflowX="auto",this.overflowY="auto",this.horizontalBorderVisible=!0,this.verticalBorderVisible=!0,this.footerSeparatorBorderVisible=!0,this.headerSeparatorBorderVisible=!0,this.fixedEastSeparatorBorderVisible=!0,this.fixedWestSeparatorBorderVisible=!0,this.tableTopBorderVisible=!0,this.tableBottomBorderVisible=!0,this.hoverRowVisible=!0,this.hoverColumnVisible=!0,this.columnsResizable=!0,this.columnsDraggable=!0,this.columnResizeHandleWidthInPx=4,this.defaultRowHeights={header:34,body:34,footer:34},this.footerVerticalSeparator=!1,this.headerToggleExpandCollapseIcons=!1,this.headerVerticalSeparator=!1,this.treeOptions=new ge,this.showCheckboxWihoutExtraColumn=!1,this.externalFilterFunction=void 0,this.sortedOptions=new Se,this.sortOrder=["asc","desc"],this.getEditRenderer=(e,t)=>new nt,this.getSelectionModel=()=>ht,this.getFocusModel=()=>ct}}class pt{setStyle(e,t,s){return e.style[t]=s,e}appendText(e,t){const s=this.createText(t);return this.appendChild(e,s),s}addClass(e,t){return t.includes(" ")?t.split(" ").forEach(s=>e.classList.add(s)):e.classList.add(t),e}appendChild(e,t){e.appendChild(t)}createElement(e){return document.createElement(e)}createText(e){return document.createTextNode(e)}setAttribute(e,t,s){e.setAttribute(t,s)}}const ft=Oe("<div>"),gt=l=>{let e;const t=fe({tableModel:null,tableOptions:new ut},l);return ve(()=>{if(console.info("onMount() ref",e),!e)throw setTimeout(()=>{console.info("ref after 2 secs",e)},2222),new Error("ref is undefined in onMount()!");const s={onCheckboxChanged:r=>{const n=new CustomEvent("checkboxChanged",{detail:r,bubbles:!0});e.dispatchEvent(n)},onContextmenu:r=>{const n=new CustomEvent("contextmenu",{detail:r,bubbles:!0});e.dispatchEvent(n)},onModelChanged:r=>{const n=new CustomEvent("modelChanged",{detail:r,bubbles:!0});e.dispatchEvent(n)},onMouseClicked:r=>{const n=new CustomEvent("mouseClicked",{detail:r,bubbles:!0});e.dispatchEvent(n)},onMouseDragging:r=>{const n=new CustomEvent("mouseDragging",{detail:r,bubbles:!0});e.dispatchEvent(n)},onMouseDraggingEnd:r=>{const n=new CustomEvent("mouseDraggingEnd",{detail:r,bubbles:!0});e.dispatchEvent(n)},onMouseMoved:r=>{const n=new CustomEvent("mouseMoved",{detail:r,bubbles:!0});e.dispatchEvent(n)}},i=new rt(e,t.tableModel,new pt,t.tableOptions,s);i.firstInit();const o=new CustomEvent("tableReady",{detail:i.getApi(),bubbles:!0});e.dispatchEvent(o)}),(()=>{const s=ft(),i=e;return typeof i=="function"?Le(i,s):e=s,s})()};exports.ComponentRendererWrapper=Be;exports.GuiexpertTable=gt;exports.GuiexpertTableProps=$e;
package/index.js CHANGED
@@ -2431,55 +2431,59 @@ const ut = /* @__PURE__ */ Oe("<div>"), gt = (l) => {
2431
2431
  tableOptions: new ht()
2432
2432
  }, l);
2433
2433
  return ve(() => {
2434
+ if (console.info("onMount() ref", e), !e)
2435
+ throw setTimeout(() => {
2436
+ console.info("ref after 2 secs", e);
2437
+ }, 2222), new Error("ref is undefined in onMount()!");
2434
2438
  const s = {
2435
2439
  onCheckboxChanged: (r) => {
2436
2440
  const n = new CustomEvent("checkboxChanged", {
2437
2441
  detail: r,
2438
2442
  bubbles: !0
2439
2443
  });
2440
- e && e.dispatchEvent(n);
2444
+ e.dispatchEvent(n);
2441
2445
  },
2442
2446
  onContextmenu: (r) => {
2443
2447
  const n = new CustomEvent("contextmenu", {
2444
2448
  detail: r,
2445
2449
  bubbles: !0
2446
2450
  });
2447
- e && e.dispatchEvent(n);
2451
+ e.dispatchEvent(n);
2448
2452
  },
2449
2453
  onModelChanged: (r) => {
2450
2454
  const n = new CustomEvent("modelChanged", {
2451
2455
  detail: r,
2452
2456
  bubbles: !0
2453
2457
  });
2454
- e && e.dispatchEvent(n);
2458
+ e.dispatchEvent(n);
2455
2459
  },
2456
2460
  onMouseClicked: (r) => {
2457
2461
  const n = new CustomEvent("mouseClicked", {
2458
2462
  detail: r,
2459
2463
  bubbles: !0
2460
2464
  });
2461
- e && e.dispatchEvent(n);
2465
+ e.dispatchEvent(n);
2462
2466
  },
2463
2467
  onMouseDragging: (r) => {
2464
2468
  const n = new CustomEvent("mouseDragging", {
2465
2469
  detail: r,
2466
2470
  bubbles: !0
2467
2471
  });
2468
- e && e.dispatchEvent(n);
2472
+ e.dispatchEvent(n);
2469
2473
  },
2470
2474
  onMouseDraggingEnd: (r) => {
2471
2475
  const n = new CustomEvent("mouseDraggingEnd", {
2472
2476
  detail: r,
2473
2477
  bubbles: !0
2474
2478
  });
2475
- e && e.dispatchEvent(n);
2479
+ e.dispatchEvent(n);
2476
2480
  },
2477
2481
  onMouseMoved: (r) => {
2478
2482
  const n = new CustomEvent("mouseMoved", {
2479
2483
  detail: r,
2480
2484
  bubbles: !0
2481
2485
  });
2482
- e && e.dispatchEvent(n);
2486
+ e.dispatchEvent(n);
2483
2487
  }
2484
2488
  }, i = new ot(e, t.tableModel, new ct(), t.tableOptions, s);
2485
2489
  i.firstInit();
@@ -2487,7 +2491,7 @@ const ut = /* @__PURE__ */ Oe("<div>"), gt = (l) => {
2487
2491
  detail: i.getApi(),
2488
2492
  bubbles: !0
2489
2493
  });
2490
- e && e.dispatchEvent(o);
2494
+ e.dispatchEvent(o);
2491
2495
  }), (() => {
2492
2496
  const s = ut(), i = e;
2493
2497
  return typeof i == "function" ? Le(i, s) : e = s, s;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/solid-table",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",