@cdmx/wappler_ag_grid 1.8.17 → 1.9.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/README.md CHANGED
@@ -41,48 +41,47 @@ To use the "Custom" theme, copy "ag-theme-custom.css" to public/css/ag-theme-cus
41
41
  10. **Exclude Fields CSV**: Specifies fields to be excluded in CSV export. (Default: null)
42
42
  11. **Enable RTL**: Enabled Right to Left, used for Hebrew and Arabic. (Default: false)
43
43
  12. **Column Hover Highlight**: Specifies column hover highlighting. (Default: true)
44
- 13. **Suppress Row Deselection**: Specifies if rows can be deselected. (Default: false)
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).
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).
50
49
  - "Single"
51
50
  - "Multiple" (Default)
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.
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.
58
57
  - Fixed Header: Enables sticky header. (Default: false)
59
58
  - Header Offset: Specifies offset from the top of the viewport area (Optional). (Default: 100)
60
59
  - Topbar Class: Specify class, e.g., "topbar", to measure the offset from (Optional). (Default: "topbar")
61
60
  - Topbar Offset: Specify topbar offset (Default: 80)
62
61
  - Fixed Horizontal Scroll: Enables Hovering horizontal scrollbar which stays at the bottom all the time. (Default: false)
63
62
  - Fixed Horizontal Scroll Width: Fixed horizontal scroll width percentage. (Default: 80%)
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)
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)
86
85
 
87
86
  # Data Type Overrides
88
87
 
@@ -192,14 +192,6 @@
192
192
  "defaultValue": true,
193
193
  "help": "Specifies Column Hover Highlighting"
194
194
  },
195
- {
196
- "name": "suppressRowDeselection",
197
- "attribute": "dmx-bind:suppress_row_deselection",
198
- "title": "Supress Row Deselection",
199
- "type": "boolean",
200
- "defaultValue": false,
201
- "help": "Specifies if rows can be deselected"
202
- },
203
195
  {
204
196
  "name": "pagination",
205
197
  "attribute": "dmx-bind:pagination",
@@ -268,10 +260,10 @@
268
260
  "attribute": "row_selection",
269
261
  "title": "Row Selection",
270
262
  "type": "droplist",
271
- "defaultValue": 'multiple',
263
+ "defaultValue": 'multiRow',
272
264
  "values": [
273
- {title: 'Single', value: 'single'},
274
- {title: 'Muliple', value: 'multiple'}
265
+ {title: 'Single', value: 'singleRow'},
266
+ {title: 'Muliple', value: 'multiRow'}
275
267
  ],
276
268
  "help": "Row Selection (single or multiple)"
277
269
  },
package/dmx-ag-grid.js CHANGED
@@ -43,7 +43,7 @@ dmx.Component('ag-grid', {
43
43
  data: { type: Array, default: [] },
44
44
  dom_layout: { type: String, default: 'autoHeight' },
45
45
  enable_cell_text_selection: { type: Boolean, default: true },
46
- row_selection: { type: String, default: 'multiple' },
46
+ row_selection: { type: String, default: 'multiRow' },
47
47
  suppress_row_deselection: { type: Boolean, default: false },
48
48
  pagination: { type: Boolean, default: true },
49
49
  pagination_auto_page_size: { type: Boolean, default: false },
@@ -467,7 +467,7 @@ dmx.Component('ag-grid', {
467
467
  const cwidths = this.props.cwidths
468
468
  const ctypes = this.props.ctypes
469
469
  if (!this.$node || !rowData || rowData.length === 0) {
470
- console.error('No row data provided.')
470
+ console.debug('AG Grid loaded with no row data.')
471
471
  return;
472
472
  }
473
473
  let gridInstance = this.get('gridInstance') ? this.get('gridInstance') : null;
@@ -1435,25 +1435,6 @@ dmx.Component('ag-grid', {
1435
1435
  this.set('id', rowData.id);
1436
1436
  this.dispatchEvent('row_double_clicked')
1437
1437
  }
1438
- let checkboxColumn;
1439
- if (options.row_checkbox_event) {
1440
- checkboxColumn = {
1441
- headerCheckboxSelection: true,
1442
- headerCheckboxSelectionFilteredOnly: true,
1443
- headerName: '',
1444
- colId: 'checkboxColumn',
1445
- field: null,
1446
- filter: '',
1447
- checkboxSelection: true,
1448
- showDisabledCheckboxes: true,
1449
- resizable: false,
1450
- editable: false,
1451
- width: 50,
1452
- maxWidth: 50,
1453
- suppressHeaderMenuButton: true
1454
- };
1455
- columnDefs.unshift(checkboxColumn);
1456
- }
1457
1438
  if (options.enable_actions) {
1458
1439
  actionsColumn = {
1459
1440
  headerName: 'Actions',
@@ -1580,18 +1561,23 @@ dmx.Component('ag-grid', {
1580
1561
  editable: options.cell_editable,
1581
1562
  floatingFilter: options.floating_filter
1582
1563
  },
1564
+ selection: {
1565
+ mode: options.row_selection,
1566
+ selectAll: "filtered",
1567
+ checkboxes: options.row_checkbox_event, // To enable checkboxes
1568
+ headerCheckbox: options.row_checkbox_event, // Header checkbox for select all
1569
+ enableClickSelection: !options.suppress_row_click_selection, // Allows row selection on click
1570
+ hideDisabledCheckboxes: false // Show disabled checkboxes
1571
+ },
1583
1572
  editType: (options.row_editable ? 'fullRow': undefined),
1584
1573
  domLayout: this.props.dom_layout,
1585
1574
  enableCellTextSelection: true,
1586
- rowSelection: this.props.row_selection,
1587
- suppressRowDeselection: this.props.suppress_row_deselection,
1588
1575
  pagination: this.props.pagination,
1589
1576
  paginationAutoPageSize: this.props.pagination_auto_page_size,
1590
1577
  paginationPageSize: pagination_page_size,
1591
1578
  paginationPageSizeSelector: options.pagination_page_size_selector,
1592
1579
  rowHeight: this.props.row_height,
1593
1580
  headerHeight: this.props.header_height,
1594
- suppressRowClickSelection: this.props.suppress_row_click_selection,
1595
1581
  suppressMenuHide: this.props.suppress_menu_hide,
1596
1582
  suppressMovableColumns: this.props.suppress_movable_columns,
1597
1583
  enableCellExpressions: this.props.enable_cell_expressions,
@@ -1600,7 +1586,6 @@ dmx.Component('ag-grid', {
1600
1586
  suppressClipboardPaste: this.props.suppress_clipboard_paste,
1601
1587
  suppressScrollOnNewData: this.props.suppress_scroll_on_new_data,
1602
1588
  suppressPropertyNamesCheck: this.props.suppress_property_names_check,
1603
- suppressRowDeselection: this.props.suppress_row_deselection,
1604
1589
  columnHoverHighlight: this.props.column_hover_highlight,
1605
1590
  onFilterModified: function (params) {
1606
1591
  const columnApi = params.api;
@@ -1695,6 +1680,21 @@ dmx.Component('ag-grid', {
1695
1680
  actionsRenderer: actionsRenderer
1696
1681
  }
1697
1682
  };
1683
+ if (options.row_checkbox_event) {
1684
+ gridOptions.onRowSelected = (event) => {
1685
+ if (event.node && event.node.isSelected()) {
1686
+ const rowData = event.node.data;
1687
+ this.set('data', rowData);
1688
+ this.set('id', rowData.id);
1689
+ this.dispatchEvent('row_checkbox_checked');
1690
+ } else {
1691
+ const rowData = event.node.data;
1692
+ this.set('data', rowData);
1693
+ this.set('id', rowData.id);
1694
+ this.dispatchEvent('row_checkbox_unchecked');
1695
+ }
1696
+ };
1697
+ }
1698
1698
  const totalRow = function (api, columnsToSum, columnsToCount) {
1699
1699
  if (!columnsToSum && !columnsToCount) {
1700
1700
  return;
@@ -1825,22 +1825,6 @@ dmx.Component('ag-grid', {
1825
1825
  gridElement.style.setProperty('--ag-list-item-height', `${options.compact_view_item_height}`+'px');
1826
1826
  }
1827
1827
  const gridContainer = gridElement.parentNode;
1828
- // Add an event listener to the grid
1829
- if (options.row_checkbox_event) {
1830
- gridInstance.addEventListener('rowSelected', (event) => {
1831
- if (event.node && event.node.isSelected()) {
1832
- const rowData = event.node.data;
1833
- this.set('data', rowData);
1834
- this.set('id', rowData.id);
1835
- this.dispatchEvent('row_checkbox_checked');
1836
- } else {
1837
- const rowData = event.node.data;
1838
- this.set('data', rowData);
1839
- this.set('id', rowData.id);
1840
- this.dispatchEvent('row_checkbox_unchecked');
1841
- }
1842
- });
1843
- }
1844
1828
  if (!gridContainer) {
1845
1829
  console.error('Grid container not found.');
1846
1830
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.8.17",
3
+ "version": "1.9.1",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "ag-grid"
15
15
  ],
16
16
  "dependencies": {
17
- "ag-grid-community": "~32.1.0",
17
+ "ag-grid-community": "~32.2.0",
18
18
  "exceljs": "4.4.x",
19
19
  "papaparse": "5.4.x"
20
20
  },