@cdmx/wappler_ag_grid 2.0.3 → 2.0.5

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
@@ -226,6 +226,11 @@ This grid allows you to configure custom tooltips for specific fields. The grid
226
226
  **Custom Tooltip Text** (Type: textbox)
227
227
  - Set a global custom tooltip text that will be applied to all fields that don't have specific tooltip configurations.
228
228
 
229
+ ## Tooltip Show Delay
230
+
231
+ **Tooltip Show Delay** (Type: number, Default: 2000)
232
+ - Set the delay in milliseconds before tooltips appear when hovering over cells. This helps prevent tooltips from showing immediately and can improve user experience by avoiding accidental tooltip displays.
233
+
229
234
  ## Advanced Tooltips with JavaScript Functions
230
235
 
231
236
  The **Using JS Function** feature allows you to create rich HTML tooltips using JavaScript functions. This provides full control over tooltip content and styling.
@@ -6,7 +6,7 @@
6
6
  "groupTitle": "Components",
7
7
  "groupIcon": "fa fa-lg fa-cube",
8
8
  "title": "AG Grid: @@id@@",
9
- "icon": "fa fa-lg fa-table",
9
+ "icon": "fas fa-lg fa-table",
10
10
  "state": "opened",
11
11
  "anyParent": true,
12
12
  "template": "<dmx-ag-grid id=\"@@id@@\"></dmx-ag-grid>",
@@ -836,6 +836,14 @@
836
836
  "type": "text",
837
837
  "help": "Specify custom tooltip text"
838
838
  },
839
+ {
840
+ "name": "tooltipShowDelay",
841
+ "attribute": "tooltip_show_delay",
842
+ "title": "Tooltip Show Delay (ms)",
843
+ "type": "number",
844
+ "defaultValue": 2000,
845
+ "help": "Delay in milliseconds before showing tooltips (default: 2000ms)"
846
+ },
839
847
  {
840
848
  "name": "tooltipConfig",
841
849
  "title": "Configure Field Tooltips",
package/dmx-ag-grid.js CHANGED
@@ -42,6 +42,7 @@ dmx.Component('ag-grid', {
42
42
  display_data_changes: { type: Array, default: [] },
43
43
  js_data_changes: { type: Array, default: [] },
44
44
  js_tooltip_changes: { type: Array, default: [] },
45
+ tooltip_show_delay: { type: Number, default: 2000 },
45
46
  data: { type: Array, default: [] },
46
47
  dom_layout: { type: String, default: 'autoHeight' },
47
48
  enable_cell_text_selection: { type: Boolean, default: true },
@@ -487,8 +488,16 @@ dmx.Component('ag-grid', {
487
488
  let exportToCSV = this.props.export_to_csv;
488
489
  let exportToPDF = this.props.export_to_pdf;
489
490
  let cellRenderer;
490
- const gridThemeClass = options.dark_mode ? `${options.grid_theme}-dark` : options.grid_theme;
491
- this.$node.innerHTML = `<div id=${options.id}-grid class="${gridThemeClass}"></div>`;
491
+
492
+ // Set up theme mode
493
+ this.$node.innerHTML = `<div id=${options.id}-grid class="${options.grid_theme}"></div>`;
494
+
495
+ // Apply theme mode using dark_mode attribute
496
+ const themeContainer = this.$node.querySelector(`#${options.id}-grid`);
497
+ if (themeContainer) {
498
+ themeContainer.dataset.agThemeMode = options.dark_mode ? 'dark' : 'light';
499
+ }
500
+
492
501
  let idFieldPresent = false;
493
502
  window.cellClickEvent = (columnName, value, idValue) => {
494
503
  this.set('fields', {"field": columnName, "data": value});
@@ -1054,8 +1063,21 @@ dmx.Component('ag-grid', {
1054
1063
  CustomTooltipComponent.prototype.init = function(params) {
1055
1064
  const eGui = this.eGui = document.createElement('div');
1056
1065
  eGui.classList.add('custom-tooltip');
1057
- eGui.style.backgroundColor = 'white';
1058
- eGui.style.border = '1px solid #ccc';
1066
+
1067
+ // Use the dark_mode option from grid configuration
1068
+ const isDarkMode = params.context && params.context.dark_mode ? params.context.dark_mode : false;
1069
+
1070
+ // Apply theme-aware styling
1071
+ if (isDarkMode) {
1072
+ eGui.style.backgroundColor = '#2d3748';
1073
+ eGui.style.border = '1px solid #4a5568';
1074
+ eGui.style.color = '#e2e8f0';
1075
+ } else {
1076
+ eGui.style.backgroundColor = 'white';
1077
+ eGui.style.border = '1px solid #ccc';
1078
+ eGui.style.color = '#333';
1079
+ }
1080
+
1059
1081
  eGui.style.borderRadius = '4px';
1060
1082
  eGui.style.padding = '8px';
1061
1083
  eGui.style.boxShadow = '0 2px 8px rgba(0,0,0,0.15)';
@@ -1075,7 +1097,7 @@ dmx.Component('ag-grid', {
1075
1097
  CustomTooltipComponent.prototype.getGui = function() {
1076
1098
  return this.eGui;
1077
1099
  };
1078
-
1100
+
1079
1101
  createCombinedTooltipValueGetter = (key, dataChanges, dataBindedChanges) => {
1080
1102
  const keyLookup = {};
1081
1103
  dataBindedChanges.forEach(change => {
@@ -1340,6 +1362,7 @@ dmx.Component('ag-grid', {
1340
1362
  colId = undefined;
1341
1363
  }
1342
1364
 
1365
+ // Handle JS tooltip changes
1343
1366
  if (options.js_tooltip_changes && Array.isArray(options.js_tooltip_changes) && options.js_tooltip_changes.length > 0) {
1344
1367
  const tooltipChange = options.js_tooltip_changes.find(change => change.field === key);
1345
1368
  if (tooltipChange) {
@@ -1644,6 +1667,9 @@ dmx.Component('ag-grid', {
1644
1667
  getRowStyle: options.rstyles ? createRowStyleFunction(options.rstyles): undefined,
1645
1668
  localeText: localeText,
1646
1669
  enableRtl: options.enable_rtl,
1670
+ context: {
1671
+ dark_mode: options.dark_mode
1672
+ },
1647
1673
  onRowClicked: enableRowClickEvent ? onRowClicked : undefined,
1648
1674
  onRowDoubleClicked: enableRowDoubleClickEvent ? onRowDoubleClicked : undefined,
1649
1675
  onCellClicked: enableCellClickEvent ? onCellClicked : undefined,
@@ -1686,6 +1712,7 @@ dmx.Component('ag-grid', {
1686
1712
  suppressClipboardPaste: this.props.suppress_clipboard_paste,
1687
1713
  suppressScrollOnNewData: this.props.suppress_scroll_on_new_data,
1688
1714
  columnHoverHighlight: this.props.column_hover_highlight,
1715
+ tooltipShowDelay: options.tooltip_show_delay,
1689
1716
  onFilterModified: function (params) {
1690
1717
  const columnApi = params.api;
1691
1718
  const rowCount = columnApi.getDisplayedRowCount();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid v34 - Advanced data grid with enhanced editing, filtering, and tree data capabilities.",
6
6
  "license": "MIT",
7
7
  "author": {
8
- "name": "cdmx1",
9
- "url": "https://github.com/cdmx1"
8
+ "name": "cdmx-in",
9
+ "url": "https://github.com/cdmx-in"
10
10
  },
11
11
  "keywords": [
12
12
  "wappler-extension",