@cdmx/wappler_ag_grid 1.2.3 → 1.2.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
@@ -259,6 +259,9 @@ The Configure Actions Column feature allows you to configure actions for the but
259
259
  **Enable Actions**
260
260
  This will display the "Configure Actions" options for the buttons in the Actions Column.
261
261
 
262
+ Note: Button Tooltip Supports Calling a function, just define a function and add the function name in the Tooltip e.g. getEditTooltip().
263
+ In the function the variable for the row data will be available as the first attribute e.g. getEditTooltip(data), then data holds the values of the row.
264
+
262
265
  **Pin Actions Column**
263
266
  This will keep the Actions Column fixed when scrolling horizontally.
264
267
 
@@ -288,7 +291,7 @@ Specify the CSS class for styling the Edit Action button.
288
291
  Specify the CSS class for styling the icon of the Edit Action button.
289
292
 
290
293
  **Edit Action Button Condition**
291
- Specify the condition to Show the Edit Action button, eg: code==TEST, or status==COMPLETED
294
+ Specify the condition to Show the Edit Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
292
295
 
293
296
  **View Action Button**
294
297
  This will display the "View Action Button" options.
@@ -306,7 +309,7 @@ Specify the CSS class for styling the View Action button.
306
309
  Specify the CSS class for styling the icon of the View Action button.
307
310
 
308
311
  **View Action Button Condition**
309
- Specify the condition to Show the View Action button, eg: code==TEST, or status==COMPLETED
312
+ Specify the condition to Show the View Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
310
313
 
311
314
  **Delete Action Button**
312
315
  This will display the "Delete Action Button" options.
@@ -324,69 +327,29 @@ Specify the CSS class for styling the Delete Action button.
324
327
  Specify the CSS class for styling the icon of the Delete Action button.
325
328
 
326
329
  **Delete Action Button Condition**
327
- Specify the condition to Show the Delete Action button, eg: code==TEST, or status==COMPLETED
330
+ Specify the condition to Show the Delete Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
328
331
 
329
332
  # Custom Action Buttons
330
333
 
331
- **Button1 Class**
332
- Specify the CSS class for Button 1.
333
-
334
- **Button1 Tooltip**
335
- Specify the tooltip text for Button 1.
336
-
337
- **Button2 Class**
338
- Specify the CSS class for Button 2.
339
-
340
- **Button2 Tooltip**
341
- Specify the tooltip text for Button 2.
342
-
343
- **Button3 Class**
344
- Specify the CSS class for Button 3.
345
-
346
- **Button3 Tooltip**
347
- Specify the tooltip text for Button 3.
348
-
349
- **Button4 Class**
350
- Specify the CSS class for Button 4.
351
-
352
- **Button4 Tooltip**
353
- Specify the tooltip text for Button 4.
354
-
355
- **Button5 Class**
356
- Specify the CSS class for Button 5.
357
-
358
- **Button5 Tooltip**
359
- Specify the tooltip text for Button 5.
360
-
361
- **Button6 Class**
362
- Specify the CSS class for Button 6.
363
-
364
- **Button6 Tooltip**
365
- Specify the tooltip text for Button 6.
366
-
367
- **Button7 Class**
368
- Specify the CSS class for Button 7.
369
-
370
- **Button7 Tooltip**
371
- Specify the tooltip text for Button 7.
334
+ **Buttons 1-10**
372
335
 
373
- **Button8 Class**
374
- Specify the CSS class for Button 8.
336
+ **Button[i] Action Button**
337
+ This will display the "Button[i] Action Button" options.
375
338
 
376
- **Button8 Tooltip**
377
- Specify the tooltip text for Button 8.
339
+ **Button[i] Action Button Title**
340
+ Specify the title for the Button[i] Action button.
378
341
 
379
- **Button9 Class**
380
- Specify the CSS class for Button 9.
342
+ **Button[i] Action Button Tooltip**
343
+ Specify the tooltip text for the Button[i] Action button.
381
344
 
382
- **Button9 Tooltip**
383
- Specify the tooltip text for Button 9.
345
+ **Button[i] Action Button Class**
346
+ Specify the CSS class for styling the Button[i] Action button.
384
347
 
385
- **Button10 Class**
386
- Specify the CSS class for Button 10.
348
+ **Button[i] Action Button Icon Class**
349
+ Specify the CSS class for styling the icon of the Button[i] Action button.
387
350
 
388
- **Button10 Tooltip**
389
- Specify the tooltip text for Button 10.
351
+ **Button[i] Action Button Condition**
352
+ Specify the condition to Show the Button[i] Action button, eg: code==TEST, or status==COMPLETED||status==FINISHED or status==COMPLETED&&user_status==true
390
353
 
391
354
  # Action Attributes
392
355
 
@@ -85,11 +85,20 @@
85
85
  {title: 'Alpine', value: 'ag-theme-alpine'},
86
86
  {title: 'Balham', value: 'ag-theme-balham'},
87
87
  {title: 'Material', value: 'ag-theme-material'},
88
+ {title: 'Quartz', value: 'ag-theme-quartz'},
88
89
  {title: 'Custom', value: 'ag-theme-alpine ag-theme-custom'},
89
90
  {title: 'Base', value: 'ag-grid'}
90
91
  ],
91
92
  "help": "Select a theme for the grid"
92
93
  },
94
+ {
95
+ "name": "dark_mode",
96
+ "attribute": "dmx-bind:dark_mode",
97
+ "title": "Dark Mode",
98
+ "type": "boolean",
99
+ "defaultValue": true,
100
+ "help": "Enables dark mode"
101
+ },
93
102
  {
94
103
  "name": "locale_text",
95
104
  "attribute": "locale_text",
@@ -2264,6 +2273,10 @@
2264
2273
  "src": "../../../node_modules/ag-grid-community/styles/ag-theme-material.css",
2265
2274
  "dst": "css/ag-theme-material.css"
2266
2275
  },
2276
+ {
2277
+ "src": "../../../node_modules/ag-grid-community/styles/ag-theme-quartz.css",
2278
+ "dst": "css/ag-theme-quartz.css"
2279
+ },
2267
2280
  {
2268
2281
  "src": "../../../node_modules/moment/min/moment.min.js",
2269
2282
  "dst": "js/moment.min.js"
@@ -2333,6 +2346,10 @@
2333
2346
  "src": "css/ag-theme-material.css",
2334
2347
  "type": "css"
2335
2348
  },
2349
+ {
2350
+ "src": "css/ag-theme-quartz.css",
2351
+ "type": "css"
2352
+ },
2336
2353
  {
2337
2354
  "src": "css/switch-toggle-slider.css",
2338
2355
  "type": "css"
package/dmx-ag-grid.js CHANGED
@@ -5,13 +5,19 @@ dmx.Component('ag-grid', {
5
5
  count: Number,
6
6
  fields: {},
7
7
  fileData: [],
8
- selectedRows: []
8
+ selectedRows: [],
9
+ state: {
10
+ gridReady: !1,
11
+ firstDataRendered: !1,
12
+ rowDataUpdated: !1
13
+ }
9
14
  },
10
15
 
11
16
  attributes: {
12
17
  id: { default: null },
13
18
  noload: { type: Boolean, default: false },
14
19
  grid_theme: { type: String, default: 'ag-theme-alpine' },
20
+ dark_mode: { type: Boolean, default: false},
15
21
  column_defs: { type: Array, default: [] },
16
22
  tooltip_config: { type: Array, default: [] },
17
23
  custom_tooltip: { type: String, default: null },
@@ -359,7 +365,8 @@ dmx.Component('ag-grid', {
359
365
  let exportToCSV = this.props.export_to_csv;
360
366
  let gridInstance = null;
361
367
  let cellRenderer;
362
- this.$node.innerHTML = `<div id=${options.id}-grid class="${options.grid_theme}"></div>`;
368
+ const gridThemeClass = options.dark_mode ? `${options.grid_theme}-dark` : options.grid_theme;
369
+ this.$node.innerHTML = `<div id=${options.id}-grid class="${gridThemeClass}"></div>`;
363
370
  if (!rowData || rowData.length === 0) {
364
371
  console.error('No row data provided.');
365
372
  return;
@@ -464,14 +471,21 @@ dmx.Component('ag-grid', {
464
471
  const buttons = params.buttons || defaultButtons;
465
472
  // Create a new container element to hold the buttons
466
473
  const container = document.createElement('div');
467
-
474
+
468
475
  buttons.forEach((buttonConfig) => {
469
476
  const button = document.createElement('button');
470
477
  button.classList.add('btn');
471
478
  const classNames = buttonConfig.classNames.split(' ');
472
479
  classNames.forEach((className) => button.classList.add(className));
473
480
  button.setAttribute('data-toggle', 'tooltip');
474
- button.setAttribute('title', buttonConfig.tooltip);
481
+ // Call a function to get the dynamic tooltip content
482
+ if (buttonConfig.tooltip.endsWith('()')) {
483
+ const tooltipFunction = buttonConfig.tooltip.slice(0, -2); // Remove the trailing '()'
484
+ const tooltipText = window[tooltipFunction](params.data)
485
+ button.setAttribute('title', tooltipText);
486
+ } else {
487
+ button.setAttribute('title', buttonConfig.tooltip);
488
+ }
475
489
  button.innerHTML = `<i class="${buttonConfig.icon}"></i> ${buttonConfig.action}`;
476
490
  container.appendChild(button);
477
491
  // Check if the button should be hidden based on the condition string and row data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
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": "30.2.x",
17
+ "ag-grid-community": "31.0.x",
18
18
  "exceljs": "4.3.x",
19
19
  "moment": "2.29.x",
20
20
  "papaparse": "5.4.x"