@cdmx/wappler_ag_grid 0.6.9 → 0.7.1
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/dmx-ag-grid.js +40 -23
- 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 },
|
|
@@ -362,26 +364,18 @@ dmx.Component('ag-grid', {
|
|
|
362
364
|
}
|
|
363
365
|
|
|
364
366
|
function formatTime(params, timezone) {
|
|
365
|
-
const date = new Date(params.value)
|
|
366
|
-
if (
|
|
367
|
-
|
|
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);
|
|
368
378
|
}
|
|
369
|
-
const options = {
|
|
370
|
-
timeZone: timezone,
|
|
371
|
-
year: 'numeric',
|
|
372
|
-
month: '2-digit',
|
|
373
|
-
day: '2-digit',
|
|
374
|
-
hour: 'numeric',
|
|
375
|
-
minute: 'numeric',
|
|
376
|
-
second: 'numeric',
|
|
377
|
-
hour12: false,
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
const formatter = new Intl.DateTimeFormat(undefined, options);
|
|
381
|
-
// const formattedDateTime = formatter.format(date);
|
|
382
|
-
const formattedDateTime = date.toISOString()
|
|
383
|
-
return formatDate(formattedDateTime)
|
|
384
|
-
|
|
385
379
|
}
|
|
386
380
|
dateFilterParams = {
|
|
387
381
|
comparator: function (filterLocalDateAtMidnight, cellValue) {
|
|
@@ -1024,10 +1018,33 @@ dmx.Component('ag-grid', {
|
|
|
1024
1018
|
exportGridData = () => {
|
|
1025
1019
|
const excludedColumnIds = ['checkboxColumn', 'actionsColumn'];
|
|
1026
1020
|
// Extracting fields and colIds from columnDefs
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1021
|
+
let fieldsAndColIds;
|
|
1022
|
+
if (options.group_config) {
|
|
1023
|
+
// Helper function to traverse grouped column structure
|
|
1024
|
+
const traverseColumns = (columns) => {
|
|
1025
|
+
const fieldsAndColIds = [];
|
|
1026
|
+
columns.forEach((column) => {
|
|
1027
|
+
if (column.children) {
|
|
1028
|
+
fieldsAndColIds.push(...traverseColumns(column.children));
|
|
1029
|
+
} else {
|
|
1030
|
+
fieldsAndColIds.push({
|
|
1031
|
+
field: column.field,
|
|
1032
|
+
colId: column.colId,
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1036
|
+
return fieldsAndColIds;
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
// Traverse columnDefs to gather fields and colIds
|
|
1040
|
+
fieldsAndColIds = traverseColumns(gridConfig.columnDefs);
|
|
1041
|
+
|
|
1042
|
+
} else {
|
|
1043
|
+
fieldsAndColIds = gridConfig.columnDefs.map((column) => ({
|
|
1044
|
+
field: column.field,
|
|
1045
|
+
colId: column.colId,
|
|
1046
|
+
}));
|
|
1047
|
+
}
|
|
1031
1048
|
// Filtering out fields based on excludedColumnIds
|
|
1032
1049
|
const fieldsToExport = fieldsAndColIds.filter(
|
|
1033
1050
|
(column) => !excludedColumnIds.includes(column.colId)
|