@cdmx/wappler_ag_grid 1.0.9 → 1.1.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.
@@ -1251,8 +1251,7 @@
1251
1251
  "children": [
1252
1252
  {
1253
1253
  "name": "columnsToCount",
1254
- "attributeStartsWith": "dmx-bind",
1255
- "attribute": "columns_to_count",
1254
+ "attribute": "dmx-bind:columns_to_count",
1256
1255
  "title": "Columns to Count",
1257
1256
  "type": "grid",
1258
1257
  "jsonFormat": true,
@@ -1298,7 +1297,7 @@
1298
1297
  },
1299
1298
  {
1300
1299
  "name": "fixedFooterBottomPadding",
1301
- "attribute": "dmx-bind:fixed_footer_bottom_padding",
1300
+ "attribute": "fixed_footer_bottom_padding",
1302
1301
  "title": "Fixed Footer Bottom Padding",
1303
1302
  "type": "number",
1304
1303
  "initDisplay": "none",
package/dmx-ag-grid.js CHANGED
@@ -50,7 +50,7 @@ dmx.Component('ag-grid', {
50
50
  numeric_column_align: { type: Boolean, default: false },
51
51
  enable_rtl: { type: Boolean, default: false },
52
52
  locale_text: { type: String, default: null },
53
- date_locale: { type: String, default: 'en-IN' },
53
+ date_locale: { type: String, default: 'en-US' },
54
54
  date_format: { type: String, default: 'dd/MM/yyyy hh:mm A' },
55
55
  amount_fields: { type: String, default: null },
56
56
  min_width: { type: Number, default: 150 },
@@ -385,6 +385,11 @@ dmx.Component('ag-grid', {
385
385
  const idValue = params.data.id;
386
386
  const columnName = params.colDef.field;
387
387
  const value = params.value;
388
+
389
+ if (params.node.rowPinned == 'bottom') {
390
+ // Render an empty cell for the footer row
391
+ return '-';
392
+ }
388
393
  // Assuming `value` is a boolean representing the status
389
394
  const checked = value==true ? "checked" : "";
390
395
  return `
@@ -559,7 +564,7 @@ dmx.Component('ag-grid', {
559
564
  timeZone: timezone,
560
565
  };
561
566
 
562
- const convertedTimestamp = date.toLocaleString('en-US', options);
567
+ const convertedTimestamp = date.toLocaleString(options.date_locale, options);
563
568
  dateTimezone = new Date(convertedTimestamp).getTime();
564
569
  return formatDate(dateTimezone)
565
570
  } else {
@@ -804,7 +809,7 @@ dmx.Component('ag-grid', {
804
809
  if (amountFieldsArray.includes(key)) {
805
810
  valueFormatter = function (params) {
806
811
  if (params.value != null) {
807
- return Number(params.value).toLocaleString("en-US", {
812
+ return Number(params.value).toLocaleString(options.date_locale, {
808
813
  minimumFractionDigits: 2,
809
814
  maximumFractionDigits: 2,
810
815
  });
@@ -1067,6 +1072,21 @@ dmx.Component('ag-grid', {
1067
1072
  },
1068
1073
  });
1069
1074
  }
1075
+
1076
+ if (options.delete_action_btn) {
1077
+ actionsColumn.cellRendererParams.buttons.push({
1078
+ action: options.delete_action_title,
1079
+ classNames: options.delete_action_btn_class,
1080
+ tooltip: options.delete_action_tooltip,
1081
+ icon: options.delete_action_icon_class,
1082
+ onClick: (rowData) => {
1083
+ this.set('data', rowData);
1084
+ this.set('id', rowData.id);
1085
+ this.dispatchEvent('row_action_delete');
1086
+ },
1087
+ });
1088
+ }
1089
+
1070
1090
  if (options.enable_custom_action_btns) {
1071
1091
  for (let i = 1; i <= 10; i++) {
1072
1092
  const buttonActionKey = `button${i}_action_btn`;
@@ -1304,8 +1324,8 @@ dmx.Component('ag-grid', {
1304
1324
  }
1305
1325
  if (options.fixed_header) {
1306
1326
  window.addEventListener('scroll', function () {
1307
- const header = document.querySelector('.ag-header');
1308
- const topbar = document.querySelector('.' + options.topbar_class);
1327
+ const header = gridElement.querySelector('.ag-header');
1328
+ const topbar = gridElement.querySelector('.' + options.topbar_class);
1309
1329
  const topbarHeight = (topbar ? topbar.getBoundingClientRect().height : 0) + options.fixed_top_offset;
1310
1330
  const headerPos = (topbar ? topbar.getBoundingClientRect().bottom : 0) + options.fixed_header_offset;
1311
1331
  if (window.scrollY > headerPos) {
@@ -1318,8 +1338,8 @@ dmx.Component('ag-grid', {
1318
1338
  document.body.style.marginBottom = '0'; // Reset the margin
1319
1339
  }
1320
1340
  });
1321
- const agHeader = document.querySelector('.ag-header');
1322
- const agRootWrapper = document.querySelector('.ag-root-wrapper');
1341
+ const agHeader = gridElement.querySelector('.ag-header');
1342
+ const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
1323
1343
 
1324
1344
  // Function to adjust the header width
1325
1345
  function adjustHeaderWidth() {
@@ -1335,8 +1355,8 @@ dmx.Component('ag-grid', {
1335
1355
  if (options.fixed_footer) {
1336
1356
  window.addEventListener('scroll', function () {
1337
1357
  if (gridDiv.scrollTop >= (gridDiv.scrollHeight - gridDiv.clientHeight)) {
1338
- const footerRow = document.querySelector('.ag-row-pinned');
1339
- const footerRowDiv = document.querySelector('.ag-floating-bottom.ag-selectable');
1358
+ const footerRow = gridElement.querySelector('.ag-row-pinned');
1359
+ const footerRowDiv = gridElement.querySelector('.ag-floating-bottom.ag-selectable');
1340
1360
  if (footerRow) {
1341
1361
  footerRow.classList.remove('ag-row-pinned');
1342
1362
  footerRow.classList.add('ag-row-even');
@@ -1347,13 +1367,13 @@ dmx.Component('ag-grid', {
1347
1367
  footerRowDiv.style.height = '0px';
1348
1368
  footerRowDiv.style.minHeight = '0px';
1349
1369
  }
1350
- const bottomViewport = document.querySelector('.ag-floating-bottom-viewport');
1370
+ const bottomViewport = gridElement.querySelector('.ag-floating-bottom-viewport');
1351
1371
  if (bottomViewport) {
1352
1372
  bottomViewport.style.position = 'fixed';
1353
1373
  bottomViewport.style.bottom = '0';
1354
1374
  }
1355
1375
  } else {
1356
- const footerRow = document.querySelector('.fixed-footer-row');
1376
+ const footerRow = gridElement.querySelector('.fixed-footer-row');
1357
1377
  if (footerRow) {
1358
1378
  footerRow.classList.add('ag-row-pinned');
1359
1379
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",