@visns-studio/visns-components 5.9.10 → 5.9.11

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/package.json CHANGED
@@ -87,7 +87,7 @@
87
87
  "react-dom": "^17.0.0 || ^18.0.0"
88
88
  },
89
89
  "name": "@visns-studio/visns-components",
90
- "version": "5.9.10",
90
+ "version": "5.9.11",
91
91
  "description": "Various packages to assist in the development of our Custom Applications.",
92
92
  "main": "src/index.js",
93
93
  "files": [
@@ -87,6 +87,7 @@ import Form from './Form';
87
87
  import _ from 'lodash';
88
88
 
89
89
  // CSS styles to ensure consistent group header heights with compact design and click indicators
90
+ // Also includes improved multi-line content handling for data rows
90
91
  const groupHeaderStyles = `
91
92
  .datagrid-fixed-group-headers .group-header-fixed-height {
92
93
  height: 34px !important;
@@ -168,6 +169,31 @@ const groupHeaderStyles = `
168
169
  min-height: 34px !important;
169
170
  max-height: 34px !important;
170
171
  }
172
+
173
+ /* Enhanced multi-line content support for data cells */
174
+ .InovuaReactDataGrid__cell {
175
+ word-wrap: break-word;
176
+ white-space: pre-wrap;
177
+ line-height: 1.3;
178
+ padding: 4px 8px;
179
+ vertical-align: top;
180
+ min-height: 32px;
181
+ display: flex;
182
+ align-items: flex-start;
183
+ }
184
+
185
+ /* Ensure cell content adapts to content height */
186
+ .InovuaReactDataGrid__cell-content {
187
+ width: 100%;
188
+ overflow-wrap: break-word;
189
+ word-break: break-word;
190
+ hyphens: auto;
191
+ }
192
+
193
+ /* Improve row height calculation trigger after data changes */
194
+ .InovuaReactDataGrid__row {
195
+ transition: height 0.1s ease-out;
196
+ }
171
197
  `;
172
198
 
173
199
  // Inject styles into the document head
@@ -359,6 +385,7 @@ const CellWithTooltip = ({
359
385
  );
360
386
  };
361
387
 
388
+
362
389
  const DataGrid = forwardRef(
363
390
  (
364
391
  {
@@ -595,6 +622,7 @@ const DataGrid = forwardRef(
595
622
  if (ajaxSetting?.groupBy) {
596
623
  groupsInitializedRef.current = false;
597
624
  setCollapsedGroups({}); // Clear existing state when groupBy changes
625
+
598
626
  }
599
627
  }, [ajaxSetting?.groupBy]);
600
628
 
@@ -718,6 +746,14 @@ const DataGrid = forwardRef(
718
746
  setTableData(res.data);
719
747
  }
720
748
  dataRef.current = res.data;
749
+
750
+ // Force grid to recalculate row heights after data changes
751
+ // This helps with multi-line content timing without interfering with core mechanisms
752
+ setTimeout(() => {
753
+ if (gridRef.current?.api) {
754
+ gridRef.current.api.forceUpdate();
755
+ }
756
+ }, 10);
721
757
  });
722
758
 
723
759
  return sqlResult;
@@ -2220,16 +2256,12 @@ const DataGrid = forwardRef(
2220
2256
  });
2221
2257
  };
2222
2258
 
2223
- // Apply immediately and with delays
2259
+ // Apply immediately and with a conservative delay
2224
2260
  applyGroupedStyling();
2225
2261
  const timer1 = setTimeout(applyGroupedStyling, 100);
2226
- const timer2 = setTimeout(applyGroupedStyling, 500);
2227
- const timer3 = setTimeout(applyGroupedStyling, 1000);
2228
-
2262
+
2229
2263
  return () => {
2230
2264
  clearTimeout(timer1);
2231
- clearTimeout(timer2);
2232
- clearTimeout(timer3);
2233
2265
  };
2234
2266
  }
2235
2267
  }, [ajaxSetting?.groupBy, gridColumns]);
@@ -4538,15 +4570,16 @@ const DataGrid = forwardRef(
4538
4570
  }, [dataCount, gridHeight, window.innerHeight]);
4539
4571
 
4540
4572
  useEffect(() => {
4541
- const handleResize = () => {
4573
+ const debouncedHandleResize = debounce(() => {
4542
4574
  setWindowHeight(window.innerHeight);
4543
- };
4575
+ }, 150);
4544
4576
 
4545
- window.addEventListener('resize', handleResize);
4577
+ window.addEventListener('resize', debouncedHandleResize);
4546
4578
 
4547
4579
  // Clean up the event listener
4548
4580
  return () => {
4549
- window.removeEventListener('resize', handleResize);
4581
+ window.removeEventListener('resize', debouncedHandleResize);
4582
+ debouncedHandleResize.cancel();
4550
4583
  };
4551
4584
  }, []);
4552
4585