@cdmx/wappler_ag_grid 2.0.5 → 2.0.6

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 +8 -57
  2. package/package.json +1 -1
package/dmx-ag-grid.js CHANGED
@@ -1057,47 +1057,20 @@ dmx.Component('ag-grid', {
1057
1057
  };
1058
1058
  }
1059
1059
 
1060
- // Custom HTML Tooltip Component
1061
- function CustomTooltipComponent() {}
1062
1060
 
1061
+ //Tooltip Component
1062
+ function CustomTooltipComponent() {}
1063
1063
  CustomTooltipComponent.prototype.init = function(params) {
1064
- const eGui = this.eGui = document.createElement('div');
1065
- eGui.classList.add('custom-tooltip');
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
-
1081
- eGui.style.borderRadius = '4px';
1082
- eGui.style.padding = '8px';
1083
- eGui.style.boxShadow = '0 2px 8px rgba(0,0,0,0.15)';
1084
- eGui.style.maxWidth = '300px';
1085
- eGui.style.fontSize = '13px';
1086
- eGui.style.zIndex = '9999';
1087
-
1088
1064
  const tooltipValue = params.value || params.valueFormatted || '';
1089
- // Check if the content contains HTML tags
1090
- if (typeof tooltipValue === 'string' && (tooltipValue.includes('<') && tooltipValue.includes('>'))) {
1091
- eGui.innerHTML = tooltipValue;
1092
- } else {
1093
- eGui.textContent = tooltipValue;
1094
- }
1065
+ const eGui = this.eGui = document.createElement('div');
1066
+ eGui.classList.add('ag-tooltip');
1067
+ eGui.innerHTML = tooltipValue;
1095
1068
  };
1096
1069
 
1097
1070
  CustomTooltipComponent.prototype.getGui = function() {
1098
1071
  return this.eGui;
1099
1072
  };
1100
-
1073
+
1101
1074
  createCombinedTooltipValueGetter = (key, dataChanges, dataBindedChanges) => {
1102
1075
  const keyLookup = {};
1103
1076
  dataBindedChanges.forEach(change => {
@@ -1485,30 +1458,8 @@ dmx.Component('ag-grid', {
1485
1458
  ...(tooltipComponent ? {
1486
1459
  tooltipComponent: tooltipComponent,
1487
1460
  tooltipValueGetter: tooltipValueGetter
1488
- } : tooltipValueGetter && typeof tooltipValueGetter === 'function' ? (() => {
1489
- // Check if tooltip content contains HTML
1490
- const sampleParams = { data: rowData[0] || {}, value: '' };
1491
- const sampleTooltip = tooltipValueGetter(sampleParams);
1492
- const containsHtml = typeof sampleTooltip === 'string' &&
1493
- (sampleTooltip.includes('<') && sampleTooltip.includes('>'));
1494
-
1495
- return containsHtml ? {
1496
- tooltipComponent: 'CustomTooltipComponent',
1497
- tooltipValueGetter: tooltipValueGetter
1498
- } : {
1499
- tooltipValueGetter: tooltipValueGetter
1500
- };
1501
- })() : tooltipValueGetter && typeof tooltipValueGetter === 'object' && tooltipValueGetter.isHtml ? {
1502
- tooltipComponent: function(params) {
1503
- return {
1504
- getGui: function() {
1505
- const element = document.createElement('div');
1506
- element.innerHTML = tooltipValueGetter.htmlContent;
1507
- element.className = 'ag-tooltip-custom';
1508
- return element;
1509
- }
1510
- };
1511
- }
1461
+ } : tooltipValueGetter && typeof tooltipValueGetter === 'function' ? {
1462
+ tooltipValueGetter: tooltipValueGetter
1512
1463
  } : {}),
1513
1464
  cellStyle: applyCellStyle,
1514
1465
  ...(cwidths.hasOwnProperty(key) && {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
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",