@cdmx/wappler_ag_grid 1.1.4 → 1.1.6

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/README.md CHANGED
@@ -21,6 +21,8 @@ This option allows you to customize the look and feel of the grid to match the d
21
21
  You can override the default styles provided by ag-Grid with your own CSS rules by targeting the specific CSS variables and classes used by the grid.
22
22
  The overrides for the "Custom" theme can be applied in the ag-theme-custom.css file located in the public/css folder. This file serves as a centralized place for customizing the grid's appearance.
23
23
 
24
+ To use the "Custom" theme, copy "ag-theme-custom.css" to public/css/ag-theme-custom.css and include it in your layout file.
25
+
24
26
  ## AG Grid Options
25
27
  1. **Minimum Width**: The minimum width of the column. (Default: 150)
26
28
  2. **Resizable**: Specifies if the column can be resized. (Default: true)
@@ -2137,10 +2137,6 @@
2137
2137
  "src": "../../../node_modules/moment/min/moment.min.js",
2138
2138
  "dst": "js/moment.min.js"
2139
2139
  },
2140
- {
2141
- "src": "ag-theme-custom.css",
2142
- "dst": "css/ag-theme-custom.css"
2143
- },
2144
2140
  {
2145
2141
  "src": "switch-toggle-slider.css",
2146
2142
  "dst": "css/switch-toggle-slider.css"
@@ -2206,10 +2202,6 @@
2206
2202
  "src": "css/ag-theme-material.css",
2207
2203
  "type": "css"
2208
2204
  },
2209
- {
2210
- "src": "css/ag-theme-custom.css",
2211
- "type": "css"
2212
- },
2213
2205
  {
2214
2206
  "src": "css/switch-toggle-slider.css",
2215
2207
  "type": "css"
package/dmx-ag-grid.js CHANGED
@@ -1161,6 +1161,13 @@ dmx.Component('ag-grid', {
1161
1161
  suppressPropertyNamesCheck: this.props.suppress_property_names_check,
1162
1162
  suppressRowDeselection: this.props.suppress_row_deselection,
1163
1163
  columnHoverHighlight: this.props.column_hover_highlight,
1164
+ onGridSizeChanged: function(params) {
1165
+ // This function is called whenever the grid's size changes
1166
+ adjustHeaderWidth();
1167
+ if (options.fixed_horizontal_scroll) {
1168
+ updateHoveringBarStyles();
1169
+ }
1170
+ },
1164
1171
  components: {
1165
1172
  clickCellRenderer: clickCellRenderer,
1166
1173
  checkboxCellRenderer: checkboxCellRenderer,
@@ -1326,6 +1333,18 @@ dmx.Component('ag-grid', {
1326
1333
  console.error('Grid container not found.');
1327
1334
  return;
1328
1335
  }
1336
+ const agHeader = gridElement.querySelector('.ag-header');
1337
+ const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
1338
+
1339
+ // Function to adjust the header width
1340
+ function adjustHeaderWidth() {
1341
+ if (agHeader && agRootWrapper) {
1342
+ const rootWrapperWidth = agRootWrapper.clientWidth;
1343
+ const newHeaderWidth = rootWrapperWidth * 1.0;
1344
+ agHeader.style.width = `${newHeaderWidth}px`;
1345
+ }
1346
+ }
1347
+ adjustHeaderWidth();
1329
1348
  if (options.fixed_header) {
1330
1349
  window.addEventListener('scroll', function () {
1331
1350
  const header = gridElement.querySelector('.ag-header');
@@ -1342,19 +1361,6 @@ dmx.Component('ag-grid', {
1342
1361
  document.body.style.marginBottom = '0'; // Reset the margin
1343
1362
  }
1344
1363
  });
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
1364
  }
1359
1365
  if (options.fixed_footer) {
1360
1366
  window.addEventListener('scroll', function () {
@@ -1394,12 +1400,13 @@ dmx.Component('ag-grid', {
1394
1400
  // Create a new style element
1395
1401
  const styleElement = document.createElement('style');
1396
1402
  styleElement.id = 'hovering-bar-style';
1397
- const barWidthPercentage = options.fixed_horizontal_scroll_width;
1398
- const barWidth = `calc(${barWidthPercentage}vw - 10px)`;
1403
+ const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
1404
+ const bodyHorizontalScrollElement = gridElement.querySelector('.ag-body-horizontal-scroll');
1405
+ const rootWrapperWidth = agRootWrapper.clientWidth;
1406
+ bodyHorizontalScrollElement.style.width = rootWrapperWidth + 'px';
1399
1407
  // Add the styles for the hovering horizontal bottom bar
1400
1408
  styleElement.innerHTML = `
1401
1409
  .ag-body-horizontal-scroll {
1402
- width: ${barWidth};
1403
1410
  position: fixed;
1404
1411
  bottom: 0;
1405
1412
  }
@@ -1415,7 +1422,6 @@ dmx.Component('ag-grid', {
1415
1422
  }
1416
1423
  }
1417
1424
  updateHoveringBarStyles();
1418
- window.addEventListener('resize', updateHoveringBarStyles);
1419
1425
 
1420
1426
  //CSV Export Function
1421
1427
  exportGridData = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",