ninegrid2 6.392.0 → 6.394.0

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.
@@ -39,7 +39,6 @@ class aiMessage extends HTMLElement
39
39
  </svg>
40
40
  </div>
41
41
  </div>
42
-
43
42
  `;
44
43
 
45
44
  requestAnimationFrame(() => {
@@ -90,6 +89,12 @@ class aiMessage extends HTMLElement
90
89
  #init = () => {
91
90
 
92
91
  const rowCount = Number(this.getAttribute("row-count"));
92
+ if (rowCount < 1) {
93
+ this.shadowRoot.querySelector(".grid").style.display = "none";
94
+ this.shadowRoot.querySelector(".chat-menu").style.display = "none";
95
+ return;
96
+ }
97
+
93
98
  const html = `
94
99
  <nine-grid class="ai" display-row-count="${rowCount > 5 ? 5 : rowCount}" show-title-bar="false" show-menu-icon="false" show-status-bar="false" select-type="row" auto-fit-col="true" show-title-bar="true" show-menu-icon="true" show-status-bar="true" enable-fixed-col="true" row-resizable="false" col-movable="true">
95
100
  <table>
@@ -11157,11 +11157,11 @@ class ninegrid {
11157
11157
  //clone.style.visibility = "hidden";
11158
11158
  document.body.appendChild(clone);
11159
11159
 
11160
- //console.log(clone, element);
11161
- //console.log(clone.scrollWidth, element.clientWidth);
11160
+ console.log(clone, element);
11161
+ console.log(clone.scrollWidth, element.clientWidth);
11162
11162
 
11163
11163
  const isTruncated = clone.scrollWidth > element.clientWidth || clone.scrollHeight > element.clientHeight;
11164
- document.body.removeChild(clone);
11164
+ //document.body.removeChild(clone);
11165
11165
 
11166
11166
  return isTruncated;
11167
11167
  }
@@ -27385,7 +27385,6 @@ class aiMessage extends HTMLElement
27385
27385
  </svg>
27386
27386
  </div>
27387
27387
  </div>
27388
-
27389
27388
  `;
27390
27389
 
27391
27390
  requestAnimationFrame(() => {
@@ -27436,6 +27435,12 @@ class aiMessage extends HTMLElement
27436
27435
  #init = () => {
27437
27436
 
27438
27437
  const rowCount = Number(this.getAttribute("row-count"));
27438
+ if (rowCount < 1) {
27439
+ this.shadowRoot.querySelector(".grid").style.display = "none";
27440
+ this.shadowRoot.querySelector(".chat-menu").style.display = "none";
27441
+ return;
27442
+ }
27443
+
27439
27444
  const html = `
27440
27445
  <nine-grid class="ai" display-row-count="${rowCount > 5 ? 5 : rowCount}" show-title-bar="false" show-menu-icon="false" show-status-bar="false" select-type="row" auto-fit-col="true" show-title-bar="true" show-menu-icon="true" show-status-bar="true" enable-fixed-col="true" row-resizable="false" col-movable="true">
27441
27446
  <table>
@@ -11155,11 +11155,11 @@ class ninegrid {
11155
11155
  //clone.style.visibility = "hidden";
11156
11156
  document.body.appendChild(clone);
11157
11157
 
11158
- //console.log(clone, element);
11159
- //console.log(clone.scrollWidth, element.clientWidth);
11158
+ console.log(clone, element);
11159
+ console.log(clone.scrollWidth, element.clientWidth);
11160
11160
 
11161
11161
  const isTruncated = clone.scrollWidth > element.clientWidth || clone.scrollHeight > element.clientHeight;
11162
- document.body.removeChild(clone);
11162
+ //document.body.removeChild(clone);
11163
11163
 
11164
11164
  return isTruncated;
11165
11165
  }
@@ -27383,7 +27383,6 @@ class aiMessage extends HTMLElement
27383
27383
  </svg>
27384
27384
  </div>
27385
27385
  </div>
27386
-
27387
27386
  `;
27388
27387
 
27389
27388
  requestAnimationFrame(() => {
@@ -27434,6 +27433,12 @@ class aiMessage extends HTMLElement
27434
27433
  #init = () => {
27435
27434
 
27436
27435
  const rowCount = Number(this.getAttribute("row-count"));
27436
+ if (rowCount < 1) {
27437
+ this.shadowRoot.querySelector(".grid").style.display = "none";
27438
+ this.shadowRoot.querySelector(".chat-menu").style.display = "none";
27439
+ return;
27440
+ }
27441
+
27437
27442
  const html = `
27438
27443
  <nine-grid class="ai" display-row-count="${rowCount > 5 ? 5 : rowCount}" show-title-bar="false" show-menu-icon="false" show-status-bar="false" select-type="row" auto-fit-col="true" show-title-bar="true" show-menu-icon="true" show-status-bar="true" enable-fixed-col="true" row-resizable="false" col-movable="true">
27439
27444
  <table>
@@ -345,11 +345,11 @@ export class ninegrid {
345
345
  //clone.style.visibility = "hidden";
346
346
  document.body.appendChild(clone);
347
347
 
348
- //console.log(clone, element);
349
- //console.log(clone.scrollWidth, element.clientWidth);
348
+ console.log(clone, element);
349
+ console.log(clone.scrollWidth, element.clientWidth);
350
350
 
351
351
  const isTruncated = clone.scrollWidth > element.clientWidth || clone.scrollHeight > element.clientHeight;
352
- document.body.removeChild(clone);
352
+ //document.body.removeChild(clone);
353
353
 
354
354
  return isTruncated;
355
355
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.392.0",
4
+ "version": "6.394.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -39,7 +39,6 @@ class aiMessage extends HTMLElement
39
39
  </svg>
40
40
  </div>
41
41
  </div>
42
-
43
42
  `;
44
43
 
45
44
  requestAnimationFrame(() => {
@@ -90,6 +89,12 @@ class aiMessage extends HTMLElement
90
89
  #init = () => {
91
90
 
92
91
  const rowCount = Number(this.getAttribute("row-count"));
92
+ if (rowCount < 1) {
93
+ this.shadowRoot.querySelector(".grid").style.display = "none";
94
+ this.shadowRoot.querySelector(".chat-menu").style.display = "none";
95
+ return;
96
+ }
97
+
93
98
  const html = `
94
99
  <nine-grid class="ai" display-row-count="${rowCount > 5 ? 5 : rowCount}" show-title-bar="false" show-menu-icon="false" show-status-bar="false" select-type="row" auto-fit-col="true" show-title-bar="true" show-menu-icon="true" show-status-bar="true" enable-fixed-col="true" row-resizable="false" col-movable="true">
95
100
  <table>
@@ -345,11 +345,11 @@ export class ninegrid {
345
345
  //clone.style.visibility = "hidden";
346
346
  document.body.appendChild(clone);
347
347
 
348
- //console.log(clone, element);
349
- //console.log(clone.scrollWidth, element.clientWidth);
348
+ console.log(clone, element);
349
+ console.log(clone.scrollWidth, element.clientWidth);
350
350
 
351
351
  const isTruncated = clone.scrollWidth > element.clientWidth || clone.scrollHeight > element.clientHeight;
352
- document.body.removeChild(clone);
352
+ //document.body.removeChild(clone);
353
353
 
354
354
  return isTruncated;
355
355
  }