@cdmx/wappler_ag_grid 1.1.5 → 1.1.7

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 (2) hide show
  1. package/dmx-ag-grid.js +27 -22
  2. package/package.json +1 -1
package/dmx-ag-grid.js CHANGED
@@ -882,13 +882,13 @@ dmx.Component('ag-grid', {
882
882
  case '!=':
883
883
  return left.toString() != right.toString();
884
884
  case '>':
885
- return left.toNumber() > right.toNumber();
885
+ return left.toString() > parseFloat(right);
886
886
  case '<':
887
- return left.toNumber() < right.toNumber();
887
+ return left.toString() < parseFloat(right);
888
888
  case '>=':
889
- return left.toNumber() >= right.toNumber();
889
+ return left.toString() >= parseFloat(right);
890
890
  case '<=':
891
- return left.toNumber() <= right.toNumber();
891
+ return left.toString() <= parseFloat(right);
892
892
  default:
893
893
  return false;
894
894
  }
@@ -905,7 +905,6 @@ dmx.Component('ag-grid', {
905
905
  const font = style.font || 'normal';
906
906
  const area = style.area || 'text';
907
907
  const [left, operator, right] = extractConditionParts(condition);
908
-
909
908
  if (
910
909
  params.data.hasOwnProperty(left) &&
911
910
  evaluateCondition(params.data[left], operator, right)
@@ -1161,6 +1160,13 @@ dmx.Component('ag-grid', {
1161
1160
  suppressPropertyNamesCheck: this.props.suppress_property_names_check,
1162
1161
  suppressRowDeselection: this.props.suppress_row_deselection,
1163
1162
  columnHoverHighlight: this.props.column_hover_highlight,
1163
+ onGridSizeChanged: function(params) {
1164
+ // This function is called whenever the grid's size changes
1165
+ adjustHeaderWidth();
1166
+ if (options.fixed_horizontal_scroll) {
1167
+ updateHoveringBarStyles();
1168
+ }
1169
+ },
1164
1170
  components: {
1165
1171
  clickCellRenderer: clickCellRenderer,
1166
1172
  checkboxCellRenderer: checkboxCellRenderer,
@@ -1326,6 +1332,18 @@ dmx.Component('ag-grid', {
1326
1332
  console.error('Grid container not found.');
1327
1333
  return;
1328
1334
  }
1335
+ const agHeader = gridElement.querySelector('.ag-header');
1336
+ const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
1337
+
1338
+ // Function to adjust the header width
1339
+ function adjustHeaderWidth() {
1340
+ if (agHeader && agRootWrapper) {
1341
+ const rootWrapperWidth = agRootWrapper.clientWidth;
1342
+ const newHeaderWidth = rootWrapperWidth * 1.0;
1343
+ agHeader.style.width = `${newHeaderWidth}px`;
1344
+ }
1345
+ }
1346
+ adjustHeaderWidth();
1329
1347
  if (options.fixed_header) {
1330
1348
  window.addEventListener('scroll', function () {
1331
1349
  const header = gridElement.querySelector('.ag-header');
@@ -1342,19 +1360,6 @@ dmx.Component('ag-grid', {
1342
1360
  document.body.style.marginBottom = '0'; // Reset the margin
1343
1361
  }
1344
1362
  });
1345
- const agHeader = gridElement.querySelector('.ag-header');
1346
- const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
1347
-
1348
- // Function to adjust the header width
1349
- function adjustHeaderWidth() {
1350
- if (agHeader && agRootWrapper) {
1351
- const rootWrapperWidth = agRootWrapper.clientWidth;
1352
- const newHeaderWidth = rootWrapperWidth * 1.0;
1353
- agHeader.style.width = `${newHeaderWidth}px`;
1354
- }
1355
- }
1356
- window.addEventListener('resize', adjustHeaderWidth);
1357
- adjustHeaderWidth();
1358
1363
  }
1359
1364
  if (options.fixed_footer) {
1360
1365
  window.addEventListener('scroll', function () {
@@ -1394,12 +1399,13 @@ dmx.Component('ag-grid', {
1394
1399
  // Create a new style element
1395
1400
  const styleElement = document.createElement('style');
1396
1401
  styleElement.id = 'hovering-bar-style';
1397
- const barWidthPercentage = options.fixed_horizontal_scroll_width;
1398
- const barWidth = `calc(${barWidthPercentage}vw - 10px)`;
1402
+ const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
1403
+ const bodyHorizontalScrollElement = gridElement.querySelector('.ag-body-horizontal-scroll');
1404
+ const rootWrapperWidth = agRootWrapper.clientWidth;
1405
+ bodyHorizontalScrollElement.style.width = rootWrapperWidth + 'px';
1399
1406
  // Add the styles for the hovering horizontal bottom bar
1400
1407
  styleElement.innerHTML = `
1401
1408
  .ag-body-horizontal-scroll {
1402
- width: ${barWidth};
1403
1409
  position: fixed;
1404
1410
  bottom: 0;
1405
1411
  }
@@ -1415,7 +1421,6 @@ dmx.Component('ag-grid', {
1415
1421
  }
1416
1422
  }
1417
1423
  updateHoveringBarStyles();
1418
- window.addEventListener('resize', updateHoveringBarStyles);
1419
1424
 
1420
1425
  //CSV Export Function
1421
1426
  exportGridData = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",