@cdmx/wappler_ag_grid 1.0.2 → 1.0.4

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
@@ -47,20 +47,22 @@ The overrides for the "Custom" theme can be applied in the ag-theme-custom.css f
47
47
  - Fixed Horizontal Scroll Width: Fixed horizontal scroll width percentage. (Default: 80%)
48
48
  16. **Row Height**: Height of each row in pixels. (Default: 25)
49
49
  17. **Header Height**: Height of the header row in pixels. (Default: 30)
50
- 18. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
51
- 19. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
52
- 20. **Suppress Movable Columns**: Disables moving columns. (Default: false)
53
- 21. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
54
- 22. **Animate Rows**: Enables row animation on data changes. (Default: false)
55
- 23. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
56
- 24. **Suppress Aggregation at Root Level**: Disables aggregation at the root level. (Default: false)
57
- 25. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
58
- 26. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
59
- 27. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
60
- 28. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
61
- 29. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
62
- 30. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
63
- 31. **Enable Row Status Toggle**: Enables row status toggle events. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
50
+ 18. **Wrap Header Text**: This will cause long headers to wrap. (Default: true)
51
+ 19. **Auto Header Height**: The column header height is automatically set based on the content of the header cells. (Default: true)
52
+ 20. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
53
+ 21. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
54
+ 22. **Suppress Movable Columns**: Disables moving columns. (Default: false)
55
+ 23. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
56
+ 24. **Animate Rows**: Enables row animation on data changes. (Default: false)
57
+ 25. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
58
+ 26. **Suppress Aggregation at Root Level**: Disables aggregation at the root level. (Default: false)
59
+ 27. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
60
+ 28. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
61
+ 29. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
62
+ 30. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
63
+ 31. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
64
+ 32. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
65
+ 33. **Enable Row Status Toggle**: Enables row status toggle events. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
64
66
 
65
67
  # Data Type Overrides
66
68
 
@@ -204,13 +206,15 @@ Configuration includes:
204
206
 
205
207
  ---
206
208
 
207
- ### Set Filters
209
+ # Set Filters
208
210
 
209
211
  The "Set Filters" feature allows you to enable the setting of filters for columns in a user interface. This feature allows to preset filters when the grid is rendered.
210
212
 
211
213
  Configuration includes:
212
- - **Set Filters**: Toggle to enable or disable the feature. When enabled, users can set filters for columns. (Default: false)
213
- - **Custom Filters**: A grid that allows you to define custom filters.
214
+ ### Set Filters
215
+ Toggle to enable or disable the feature. When enabled, users can set filters for columns. (Default: false)
216
+
217
+ **Custom Filters**: A grid that allows you to define custom filters.
214
218
  - **Field**: The column name to filter.
215
219
  - **Filter Type**: The type of filter to apply, options available are: "Starts With," "Less Than," "Date From," "Greater Than," "Equals," and "Contains."
216
220
  - **Filter Value**: The Value/Filter to be applied.
@@ -361,6 +361,22 @@
361
361
  "defaultValue": null,
362
362
  "help": "Height of the header row in pixels"
363
363
  },
364
+ {
365
+ "name": "wrapHeaderText",
366
+ "attribute": "dmx-bind:wrap_header_text",
367
+ "title": "Wrap Header Text",
368
+ "type": "boolean",
369
+ "defaultValue": true,
370
+ "help": "This will cause long headers to wrap."
371
+ },
372
+ {
373
+ "name": "autoHeaderHeight",
374
+ "attribute": "dmx-bind:auto_header_height",
375
+ "title": "Auto Header Height",
376
+ "type": "boolean",
377
+ "defaultValue": true,
378
+ "help": "The column header height is automatically set based on the content of the header cells."
379
+ },
364
380
  {
365
381
  "name": "suppressRowClickSelection",
366
382
  "attribute": "dmx-bind:suppress_row_click_selection",
package/dmx-ag-grid.js CHANGED
@@ -20,6 +20,8 @@ dmx.Component('ag-grid', {
20
20
  cwidths: { type: Object, default: {} },
21
21
  ctypes: { type: Array, default: [] },
22
22
  cfilters: { type: Array, default: [] },
23
+ wrap_header_text: { type: Boolean, default: true },
24
+ auto_header_height: { type: Boolean, default: true },
23
25
  data_changes: { type: Array, default: [] },
24
26
  data: { type: Array, default: [] },
25
27
  dom_layout: { type: String, default: 'autoHeight' },
@@ -1088,6 +1090,8 @@ dmx.Component('ag-grid', {
1088
1090
  flex: 1,
1089
1091
  minWidth: options.min_width,
1090
1092
  resizable: options.resizable,
1093
+ wrapHeaderText: options.wrap_header_text,
1094
+ autoHeaderHeight: options.auto_header_height,
1091
1095
  filter: options.filter,
1092
1096
  sortable: options.sortable,
1093
1097
  floatingFilter: options.floating_filter
@@ -1287,12 +1291,25 @@ dmx.Component('ag-grid', {
1287
1291
  header.style.position = 'fixed';
1288
1292
  header.style.top = `${topbarHeight}px`;
1289
1293
  header.style.zIndex = '1';
1290
- document.body.style.marginBottom = `${header.offsetHeight}px`; // Add margin to the bottom of the page
1294
+ document.body.style.marginBottom = `${header.offsetHeight}px`;
1291
1295
  } else {
1292
1296
  header.style.position = 'static';
1293
1297
  document.body.style.marginBottom = '0'; // Reset the margin
1294
1298
  }
1295
1299
  });
1300
+ const agHeader = document.querySelector('.ag-header');
1301
+ const agRootWrapper = document.querySelector('.ag-root-wrapper');
1302
+
1303
+ // Function to adjust the header width
1304
+ function adjustHeaderWidth() {
1305
+ if (agHeader && agRootWrapper) {
1306
+ const rootWrapperWidth = agRootWrapper.clientWidth;
1307
+ const newHeaderWidth = rootWrapperWidth * 1.0;
1308
+ agHeader.style.width = `${newHeaderWidth}px`;
1309
+ }
1310
+ }
1311
+ window.addEventListener('resize', adjustHeaderWidth);
1312
+ adjustHeaderWidth();
1296
1313
  }
1297
1314
  if (options.fixed_footer) {
1298
1315
  window.addEventListener('scroll', function () {
@@ -1408,7 +1425,6 @@ dmx.Component('ag-grid', {
1408
1425
  };
1409
1426
  gridConfig.api.exportDataAsCsv(params);
1410
1427
  };
1411
-
1412
1428
  // Create the export button
1413
1429
  if (exportToCSV) {
1414
1430
  const existingExportButton = document.getElementById('exportButton');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",