@cdmx/wappler_ag_grid 0.7.0 → 0.7.2

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 +45 -16
  2. package/package.json +1 -1
package/dmx-ag-grid.js CHANGED
@@ -32,6 +32,8 @@ dmx.Component('ag-grid', {
32
32
  suppress_movable_columns: { type: Boolean, default: false },
33
33
  enable_cell_expressions: { type: Boolean, default: false },
34
34
  animate_rows: { type: Boolean, default: false },
35
+ always_show_horizontal_scroll: { type: Boolean, default: true },
36
+ always_show_vertical_scroll: { type: Boolean, default: false },
35
37
  suppress_agg_func_in_header: { type: Boolean, default: false },
36
38
  suppress_agg_at_root_level: { type: Boolean, default: false },
37
39
  suppress_clipboard_paste: { type: Boolean, default: false },
@@ -360,19 +362,23 @@ dmx.Component('ag-grid', {
360
362
  }
361
363
  });
362
364
  }
363
-
364
365
  function formatTime(params, timezone) {
365
- const date = new Date(params.value)
366
- if (timezone) {
367
- const options = {
368
- timeZone: timezone,
369
- };
370
-
371
- const convertedTimestamp = date.toLocaleString('en-US', options);
372
- dateTimezone = new Date(convertedTimestamp).getTime();
373
- return formatDate(dateTimezone)
374
- } else {
375
- return formatDate(date);
366
+ if (params.value) {
367
+ const date = new Date(params.value)
368
+ if (timezone) {
369
+ const options = {
370
+ timeZone: timezone,
371
+ };
372
+
373
+ const convertedTimestamp = date.toLocaleString('en-US', options);
374
+ dateTimezone = new Date(convertedTimestamp).getTime();
375
+ return formatDate(dateTimezone)
376
+ } else {
377
+ return formatDate(date);
378
+ }
379
+ }
380
+ else {
381
+ return '-'
376
382
  }
377
383
  }
378
384
  dateFilterParams = {
@@ -1016,10 +1022,33 @@ dmx.Component('ag-grid', {
1016
1022
  exportGridData = () => {
1017
1023
  const excludedColumnIds = ['checkboxColumn', 'actionsColumn'];
1018
1024
  // Extracting fields and colIds from columnDefs
1019
- const fieldsAndColIds = gridConfig.columnDefs.map((column) => ({
1020
- field: column.field,
1021
- colId: column.colId,
1022
- }));
1025
+ let fieldsAndColIds;
1026
+ if (options.group_config) {
1027
+ // Helper function to traverse grouped column structure
1028
+ const traverseColumns = (columns) => {
1029
+ const fieldsAndColIds = [];
1030
+ columns.forEach((column) => {
1031
+ if (column.children) {
1032
+ fieldsAndColIds.push(...traverseColumns(column.children));
1033
+ } else {
1034
+ fieldsAndColIds.push({
1035
+ field: column.field,
1036
+ colId: column.colId,
1037
+ });
1038
+ }
1039
+ });
1040
+ return fieldsAndColIds;
1041
+ };
1042
+
1043
+ // Traverse columnDefs to gather fields and colIds
1044
+ fieldsAndColIds = traverseColumns(gridConfig.columnDefs);
1045
+
1046
+ } else {
1047
+ fieldsAndColIds = gridConfig.columnDefs.map((column) => ({
1048
+ field: column.field,
1049
+ colId: column.colId,
1050
+ }));
1051
+ }
1023
1052
  // Filtering out fields based on excludedColumnIds
1024
1053
  const fieldsToExport = fieldsAndColIds.filter(
1025
1054
  (column) => !excludedColumnIds.includes(column.colId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",