@cdmx/wappler_ag_grid 1.9.9 → 1.9.10

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
@@ -35,53 +35,54 @@ To use the "Custom" theme, copy "ag-theme-custom.css" to public/css/ag-theme-cus
35
35
  4. **Case-Insensitive Sort**: Specifies if the columns are sorted in case-insensitive manner. (Default: false)
36
36
  5. **Filter**: Specifies if the column has a filter. (Default: true)
37
37
  6. **Floating Filter**: Specifies if the column has a floating filter. (Default: true)
38
- 7. **Exclude Hidden Fields**: Specifies if Hidden fields are to be excluded in CSV export. (Default: false)
39
- 8. **CSV Export**: Specifies if Export to CSV is enabled. (Default: true).
40
- 9. **PDF Export**: Specifies if Export to PDF is enabled. (Default: false).
41
- 10. **Exclude Fields CSV**: Specifies fields to be excluded in CSV export. (Default: null)
42
- 11. **Enable RTL**: Enabled Right to Left, used for Hebrew and Arabic. (Default: false)
43
- 12. **Column Hover Highlight**: Specifies column hover highlighting. (Default: true)
44
- 13. **Pagination**: Enables pagination. (Default: true)
45
- 14. **Auto Pagination**: Enables automatic pagination. (Default: false)
46
- 15. **Page Limit Selectors**: Allowed selectors for for page size. Set to false to hide the page size selector. (Default: [20,50,100] ).
47
- 16. **Page Limit**: Number of rows to show per page. (Default: 20)
48
- 17. **Row Selection**: Row Selection (single or multiple).
38
+ 7. **Trim Export Data**: Specifies if data trimming is to be applied for exported data. (Default: false)
39
+ 8. **Exclude Hidden Fields**: Specifies if Hidden fields are to be excluded in CSV export. (Default: false)
40
+ 9. **CSV Export**: Specifies if Export to CSV is enabled. (Default: true).
41
+ 10. **PDF Export**: Specifies if Export to PDF is enabled. (Default: false).
42
+ 11. **Exclude Fields CSV**: Specifies fields to be excluded in CSV export. (Default: null)
43
+ 12. **Enable RTL**: Enabled Right to Left, used for Hebrew and Arabic. (Default: false)
44
+ 13. **Column Hover Highlight**: Specifies column hover highlighting. (Default: true)
45
+ 14. **Pagination**: Enables pagination. (Default: true)
46
+ 15. **Auto Pagination**: Enables automatic pagination. (Default: false)
47
+ 16. **Page Limit Selectors**: Allowed selectors for for page size. Set to false to hide the page size selector. (Default: [20,50,100] ).
48
+ 17. **Page Limit**: Number of rows to show per page. (Default: 20)
49
+ 18. **Row Selection**: Row Selection (single or multiple).
49
50
  - "Single"
50
51
  - "Multiple" (Default)
51
- 18. **Timezone**: Timezone for Date Fields. Select the appropriate timezone from the dropdown list. (Default: Local)
52
- 19. **Date Format**: Date Format for displaying date values. (Default: "dd/MM/yyyy hh:mm A")
53
- 20. **Filter Field ID**: Specifies the field ID of the search field when using grid quick filter. Applicable when using Quick Filter feature of AG Grid, called from Dynamic Events on change event on the field. (Default: search_field)
54
- 21. **Loading Overlay**: This enables loading overlay. (Default: false)
55
- 22. **Loading Overlay Duration**: This sets loading overlay duration in ms. (Default: 500)
56
- 23. **Sticky Header and Horizontal Scrollbar**: Optionally specify the header offset and topbar class.
52
+ 19. **Timezone**: Timezone for Date Fields. Select the appropriate timezone from the dropdown list. (Default: Local)
53
+ 20. **Date Format**: Date Format for displaying date values. (Default: "dd/MM/yyyy hh:mm A")
54
+ 21. **Filter Field ID**: Specifies the field ID of the search field when using grid quick filter. Applicable when using Quick Filter feature of AG Grid, called from Dynamic Events on change event on the field. (Default: search_field)
55
+ 22. **Loading Overlay**: This enables loading overlay. (Default: false)
56
+ 23. **Loading Overlay Duration**: This sets loading overlay duration in ms. (Default: 500)
57
+ 24. **Sticky Header and Horizontal Scrollbar**: Optionally specify the header offset and topbar class.
57
58
  - Fixed Header: Enables sticky header. (Default: false)
58
59
  - Header Offset: Specifies offset from the top of the viewport area (Optional). (Default: 100)
59
60
  - Topbar Class: Specify class, e.g., "topbar", to measure the offset from (Optional). (Default: "topbar")
60
61
  - Topbar Offset: Specify topbar offset (Default: 80)
61
62
  - Fixed Horizontal Scroll: Enables Hovering horizontal scrollbar which stays at the bottom all the time. (Default: false)
62
63
  - Fixed Horizontal Scroll Width: Fixed horizontal scroll width percentage. (Default: 80%)
63
- 24. **Row Height**: Height of each row in pixels. (Default: Auto)
64
- 25. **Header Height**: Height of the header row in pixels. (Default: Auto)
65
- 26. **Wrap Header Text**: This will cause long headers to wrap. (Default: true)
66
- 27. **Auto Header Height**: The header height is automatically set based on the content of the header. (Default: true)
67
- 28. **Auto Height**: The height is automatically set based on the content of the cells. (Default: false)
68
- 29. **Wrap Text**: This will cause long texts to wrap in the cells. (Default: false)
69
- 30. **Center Align (V)**: Specifies if the cell data should be vertically centered. (Default: false)
70
- 31. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
71
- 32. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
72
- 33. **Suppress Movable Columns**: Disables moving columns. (Default: false)
73
- 34. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
74
- 35. **Animate Rows**: Enables row animation on data changes. (Default: false)
75
- 36. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
76
- 37. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
77
- 38. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
78
- 39. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
79
- 40. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
80
- 41. **Numeric Column Align**: Align numeric columns to the right. (Default: false)
81
- 42. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
82
- 43. **Row Double Click Events**: Enables row double click events. This can be used in Dynamic events => Grid Events => Row Double Clicked. (Default: false)
83
- 44. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
84
- 45. **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
+ 25. **Row Height**: Height of each row in pixels. (Default: Auto)
65
+ 26. **Header Height**: Height of the header row in pixels. (Default: Auto)
66
+ 27. **Wrap Header Text**: This will cause long headers to wrap. (Default: true)
67
+ 28. **Auto Header Height**: The header height is automatically set based on the content of the header. (Default: true)
68
+ 29. **Auto Height**: The height is automatically set based on the content of the cells. (Default: false)
69
+ 30. **Wrap Text**: This will cause long texts to wrap in the cells. (Default: false)
70
+ 31. **Center Align (V)**: Specifies if the cell data should be vertically centered. (Default: false)
71
+ 32. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
72
+ 33. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
73
+ 34. **Suppress Movable Columns**: Disables moving columns. (Default: false)
74
+ 35. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
75
+ 36. **Animate Rows**: Enables row animation on data changes. (Default: false)
76
+ 37. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
77
+ 38. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
78
+ 39. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
79
+ 40. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
80
+ 41. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
81
+ 42. **Numeric Column Align**: Align numeric columns to the right. (Default: false)
82
+ 43. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
83
+ 44. **Row Double Click Events**: Enables row double click events. This can be used in Dynamic events => Grid Events => Row Double Clicked. (Default: false)
84
+ 45. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
85
+ 46. **Enable Row Status Toggle**: Enables row status toggle events. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
85
86
 
86
87
  # Data Type Overrides
87
88
 
@@ -209,6 +209,14 @@
209
209
  "defaultValue": false,
210
210
  "help": "Built-in pagination size as per page size."
211
211
  },
212
+ {
213
+ "name": "exportTrimData",
214
+ "attribute": "dmx-bind:export_trim_data",
215
+ "title": "Trim Export Data",
216
+ "type": "boolean",
217
+ "defaultValue": false,
218
+ "help": "Specifies if exported data should be trimmed"
219
+ },
212
220
  {
213
221
  "name": "exportToCSV",
214
222
  "attribute": "dmx-bind:export_to_csv",
package/dmx-ag-grid.js CHANGED
@@ -81,6 +81,7 @@ dmx.Component('ag-grid', {
81
81
  floating_filter: { type: Boolean, default: true },
82
82
  column_hover_highlight: { type: Boolean, default: true },
83
83
  quick_filter_field: { type: String, default: 'search_field' },
84
+ export_trim_data: { type: Boolean, default: false },
84
85
  export_exclude_hidden_fields: { type: Boolean, default: false },
85
86
  export_exclude_fields: { type: String, default: null },
86
87
  export_to_csv: { type: Boolean, default: true },
@@ -1950,7 +1951,7 @@ dmx.Component('ag-grid', {
1950
1951
 
1951
1952
  //CSV Export Function
1952
1953
  exportGridData = () => {
1953
- const excludedColumnIds = ['checkboxColumn', 'actionsColumn'];
1954
+ const excludedColumnIds = ['checkboxColumn', 'actionsColumn'];
1954
1955
  const exportExcludeFieldsArray = options.export_exclude_fields ? options.export_exclude_fields.split(',') : [];
1955
1956
  // Extracting fields and colIds from columnDefs
1956
1957
  let fieldsAndColIds;
@@ -1985,7 +1986,7 @@ dmx.Component('ag-grid', {
1985
1986
  (!options.export_exclude_hidden_fields || !column.hide) &&
1986
1987
  !exportExcludeFieldsArray.includes(column.field);
1987
1988
  }).map((column) => column.field);
1988
-
1989
+
1989
1990
  const params = {
1990
1991
  fileName: options.export_csv_filename,
1991
1992
  allColumns: true,
@@ -1994,6 +1995,8 @@ dmx.Component('ag-grid', {
1994
1995
  const columnDef = params.column.getColDef();
1995
1996
  const valueFormatter = columnDef.valueFormatter;
1996
1997
  const cellRenderer = columnDef.cellRenderer;
1998
+ let value = params.value || "-";
1999
+
1997
2000
  // Apply cellRenderer if it exists
1998
2001
  if (cellRenderer && typeof cellRenderer === "function") {
1999
2002
  const cellRendererParams = {
@@ -2005,16 +2008,22 @@ dmx.Component('ag-grid', {
2005
2008
  api: params.api,
2006
2009
  context: params.context,
2007
2010
  };
2008
- const cellRendererValue = cellRenderer(cellRendererParams);
2009
- return cellRendererValue;
2011
+ value = cellRenderer(cellRendererParams);
2010
2012
  }
2013
+ // Apply valueFormatter if it exists
2011
2014
  else if (valueFormatter && typeof valueFormatter === "function") {
2012
2015
  const formattedValue = valueFormatter(params);
2013
2016
  if (formattedValue !== null && formattedValue !== undefined) {
2014
- return formattedValue;
2017
+ value = formattedValue;
2015
2018
  }
2016
2019
  }
2017
- return params.value;
2020
+
2021
+ // Trim value if export_trim is true
2022
+ if (options.export_trim_data && typeof value === 'string') {
2023
+ return value.trim();
2024
+ }
2025
+
2026
+ return value;
2018
2027
  },
2019
2028
  };
2020
2029
  gridInstance.exportDataAsCsv(params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.9.9",
3
+ "version": "1.9.10",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",