@cdmx/wappler_ag_grid 1.8.4 → 1.8.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.
- package/app_connect/components.hjson +946 -80
- package/dmx-ag-grid.js +96 -4
- package/package.json +1 -1
package/dmx-ag-grid.js
CHANGED
|
@@ -127,6 +127,7 @@ dmx.Component('ag-grid', {
|
|
|
127
127
|
delete_action_btn_class: {type: String, default: 'btn-danger btn-xs m-1' },
|
|
128
128
|
delete_action_btn_condition: {type: String, default: null },
|
|
129
129
|
enable_custom_action_btns: { type: Boolean, default: false },
|
|
130
|
+
action_button_class_toggles: { type: Array, default: [] },
|
|
130
131
|
button1_action_btn: { type: "Boolean", default: false },
|
|
131
132
|
button1_action_title: { type: "String", default: "" },
|
|
132
133
|
button1_action_tooltip: { type: "String", default: "" },
|
|
@@ -187,6 +188,66 @@ dmx.Component('ag-grid', {
|
|
|
187
188
|
button10_action_icon_class: { type: "String", default: "fas fa-trash-alt" },
|
|
188
189
|
button10_action_btn_class: { type: "String", default: "btn-danger btn-xs m-1" },
|
|
189
190
|
button10_action_btn_condition: {type: String, default: null },
|
|
191
|
+
button11_action_btn: { type: "Boolean", default: false },
|
|
192
|
+
button11_action_title: { type: "String", default: "" },
|
|
193
|
+
button11_action_tooltip: { type: "String", default: "" },
|
|
194
|
+
button11_action_icon_class: { type: "String", default: "fas fa-cog" },
|
|
195
|
+
button11_action_btn_class: { type: "String", default: "btn-primary btn-xs m-1" },
|
|
196
|
+
button11_action_btn_condition: { type: String, default: null },
|
|
197
|
+
button12_action_btn: { type: "Boolean", default: false },
|
|
198
|
+
button12_action_title: { type: "String", default: "" },
|
|
199
|
+
button12_action_tooltip: { type: "String", default: "" },
|
|
200
|
+
button12_action_icon_class: { type: "String", default: "fas fa-search" },
|
|
201
|
+
button12_action_btn_class: { type: "String", default: "btn-info btn-xs m-1" },
|
|
202
|
+
button12_action_btn_condition: { type: String, default: null },
|
|
203
|
+
button13_action_btn: { type: "Boolean", default: false },
|
|
204
|
+
button13_action_title: { type: "String", default: "" },
|
|
205
|
+
button13_action_tooltip: { type: "String", default: "" },
|
|
206
|
+
button13_action_icon_class: { type: "String", default: "fas fa-thumbs-up" },
|
|
207
|
+
button13_action_btn_class: { type: "String", default: "btn-success btn-xs m-1" },
|
|
208
|
+
button13_action_btn_condition: { type: String, default: null },
|
|
209
|
+
button14_action_btn: { type: "Boolean", default: false },
|
|
210
|
+
button14_action_title: { type: "String", default: "" },
|
|
211
|
+
button14_action_tooltip: { type: "String", default: "" },
|
|
212
|
+
button14_action_icon_class: { type: "String", default: "fas fa-bell" },
|
|
213
|
+
button14_action_btn_class: { type: "String", default: "btn-warning btn-xs m-1" },
|
|
214
|
+
button14_action_btn_condition: { type: String, default: null },
|
|
215
|
+
button15_action_btn: { type: "Boolean", default: false },
|
|
216
|
+
button15_action_title: { type: "String", default: "" },
|
|
217
|
+
button15_action_tooltip: { type: "String", default: "" },
|
|
218
|
+
button15_action_icon_class: { type: "String", default: "fas fa-ban" },
|
|
219
|
+
button15_action_btn_class: { type: "String", default: "btn-danger btn-xs m-1" },
|
|
220
|
+
button15_action_btn_condition: { type: String, default: null },
|
|
221
|
+
button16_action_btn: { type: "Boolean", default: false },
|
|
222
|
+
button16_action_title: { type: "String", default: "" },
|
|
223
|
+
button16_action_tooltip: { type: "String", default: "" },
|
|
224
|
+
button16_action_icon_class: { type: "String", default: "fas fa-link" },
|
|
225
|
+
button16_action_btn_class: { type: "String", default: "btn-secondary btn-xs m-1" },
|
|
226
|
+
button16_action_btn_condition: { type: String, default: null },
|
|
227
|
+
button17_action_btn: { type: "Boolean", default: false },
|
|
228
|
+
button17_action_title: { type: "String", default: "" },
|
|
229
|
+
button17_action_tooltip: { type: "String", default: "" },
|
|
230
|
+
button17_action_icon_class: { type: "String", default: "fas fa-file" },
|
|
231
|
+
button17_action_btn_class: { type: "String", default: "btn-primary btn-sm m-1" },
|
|
232
|
+
button17_action_btn_condition: { type: String, default: null },
|
|
233
|
+
button18_action_btn: { type: "Boolean", default: false },
|
|
234
|
+
button18_action_title: { type: "String", default: "" },
|
|
235
|
+
button18_action_tooltip: { type: "String", default: "" },
|
|
236
|
+
button18_action_icon_class: { type: "String", default: "fas fa-print" },
|
|
237
|
+
button18_action_btn_class: { type: "String", default: "btn-info btn-sm m-1" },
|
|
238
|
+
button18_action_btn_condition: { type: String, default: null },
|
|
239
|
+
button19_action_btn: { type: "Boolean", default: false },
|
|
240
|
+
button19_action_title: { type: "String", default: "" },
|
|
241
|
+
button19_action_tooltip: { type: "String", default: "" },
|
|
242
|
+
button19_action_icon_class: { type: "String", default: "fas fa-heart" },
|
|
243
|
+
button19_action_btn_class: { type: "String", default: "btn-success btn-sm m-1" },
|
|
244
|
+
button19_action_btn_condition: { type: String, default: null },
|
|
245
|
+
button20_action_btn: { type: "Boolean", default: false },
|
|
246
|
+
button20_action_title: { type: "String", default: "" },
|
|
247
|
+
button20_action_tooltip: { type: "String", default: "" },
|
|
248
|
+
button20_action_icon_class: { type: "String", default: "fas fa-times" },
|
|
249
|
+
button20_action_btn_class: { type: "String", default: "btn-danger btn-sm m-1" },
|
|
250
|
+
button20_action_btn_condition: { type: String, default: null },
|
|
190
251
|
data_binded_changes: {type: Array, default: [] },
|
|
191
252
|
hide_fields: {type: String, default: null },
|
|
192
253
|
hide_filters: {type: String, default: null },
|
|
@@ -406,6 +467,7 @@ dmx.Component('ag-grid', {
|
|
|
406
467
|
const enableRowDoubleClickEvent = this.props.row_double_click_event && !this.props.enable_actions && !this.props.row_checkbox_event;
|
|
407
468
|
const enableCellClickEvent = this.props.row_click_event && (this.props.enable_actions || this.props.row_checkbox_event);
|
|
408
469
|
const enableCellDoubleClickEvent = this.props.row_double_click_event && (this.props.enable_actions || this.props.row_checkbox_event);
|
|
470
|
+
const actionButtonClassToggles = options.action_button_class_toggles
|
|
409
471
|
let localeText;
|
|
410
472
|
let columnDefs = [];
|
|
411
473
|
let groupedColumnDefs = [];
|
|
@@ -517,8 +579,18 @@ dmx.Component('ag-grid', {
|
|
|
517
579
|
{ action: 'Button7', classNames: 'btn-primary btn-sm', tooltip: 'Button7', icon: 'fas fa-download' },
|
|
518
580
|
{ action: 'Button8', classNames: 'btn-info btn-sm', tooltip: 'Button8', icon: 'fas fa-file-pdf' },
|
|
519
581
|
{ action: 'Button9', classNames: 'btn-success btn-sm', tooltip: 'Button9', icon: 'fas fa-star' },
|
|
520
|
-
{ action: 'Button10', classNames: 'btn-danger btn-sm', tooltip: 'Button10', icon: 'fas fa-trash-alt' }
|
|
521
|
-
|
|
582
|
+
{ action: 'Button10', classNames: 'btn-danger btn-sm', tooltip: 'Button10', icon: 'fas fa-trash-alt' },
|
|
583
|
+
{ action: 'Button11', classNames: 'btn-primary btn-xs', tooltip: 'Button11', icon: 'fas fa-cog' },
|
|
584
|
+
{ action: 'Button12', classNames: 'btn-info btn-xs', tooltip: 'Button12', icon: 'fas fa-search' },
|
|
585
|
+
{ action: 'Button13', classNames: 'btn-success btn-xs', tooltip: 'Button13', icon: 'fas fa-thumbs-up' },
|
|
586
|
+
{ action: 'Button14', classNames: 'btn-warning btn-xs', tooltip: 'Button14', icon: 'fas fa-bell' },
|
|
587
|
+
{ action: 'Button15', classNames: 'btn-danger btn-xs', tooltip: 'Button15', icon: 'fas fa-ban' },
|
|
588
|
+
{ action: 'Button16', classNames: 'btn-secondary btn-xs', tooltip: 'Button16', icon: 'fas fa-link' },
|
|
589
|
+
{ action: 'Button17', classNames: 'btn-primary btn-sm', tooltip: 'Button17', icon: 'fas fa-file' },
|
|
590
|
+
{ action: 'Button18', classNames: 'btn-info btn-sm', tooltip: 'Button18', icon: 'fas fa-print' },
|
|
591
|
+
{ action: 'Button19', classNames: 'btn-success btn-sm', tooltip: 'Button19', icon: 'fas fa-heart' },
|
|
592
|
+
{ action: 'Button20', classNames: 'btn-danger btn-sm', tooltip: 'Button20', icon: 'fas fa-times' }
|
|
593
|
+
];
|
|
522
594
|
// User-defined button configurations (if any)
|
|
523
595
|
const buttons = params.buttons || defaultButtons;
|
|
524
596
|
// Create a new container element to hold the buttons
|
|
@@ -542,6 +614,12 @@ dmx.Component('ag-grid', {
|
|
|
542
614
|
}
|
|
543
615
|
button.innerHTML = `<i class="${buttonConfig.icon}"></i> ${buttonConfig.action}`;
|
|
544
616
|
container.appendChild(button);
|
|
617
|
+
// Handle dynamic classes based on conditions and buttonConfig.id
|
|
618
|
+
actionButtonClassToggles.forEach((toggle) => {
|
|
619
|
+
if (toggle.btn_id === buttonConfig.id && evaluateConditions([toggle.condition], params)) {
|
|
620
|
+
button.classList.add(...toggle.class.split(' '));
|
|
621
|
+
}
|
|
622
|
+
});
|
|
545
623
|
// Check if the button should be hidden based on the condition string and row data
|
|
546
624
|
if (buttonConfig.condition) {
|
|
547
625
|
const conditions = buttonConfig.condition.split(/(\|\||&&)/);
|
|
@@ -1373,6 +1451,7 @@ dmx.Component('ag-grid', {
|
|
|
1373
1451
|
|
|
1374
1452
|
if (options.edit_action_btn) {
|
|
1375
1453
|
actionsColumn.cellRendererParams.buttons.push({
|
|
1454
|
+
id: 'edit',
|
|
1376
1455
|
action: options.edit_action_title,
|
|
1377
1456
|
classNames: options.edit_action_btn_class,
|
|
1378
1457
|
tooltip: options.edit_action_tooltip,
|
|
@@ -1388,6 +1467,7 @@ dmx.Component('ag-grid', {
|
|
|
1388
1467
|
|
|
1389
1468
|
if (options.view_action_btn) {
|
|
1390
1469
|
actionsColumn.cellRendererParams.buttons.push({
|
|
1470
|
+
id: 'view',
|
|
1391
1471
|
action: options.view_action_title,
|
|
1392
1472
|
classNames: options.view_action_btn_class,
|
|
1393
1473
|
tooltip: options.view_action_tooltip,
|
|
@@ -1403,6 +1483,7 @@ dmx.Component('ag-grid', {
|
|
|
1403
1483
|
|
|
1404
1484
|
if (options.delete_action_btn) {
|
|
1405
1485
|
actionsColumn.cellRendererParams.buttons.push({
|
|
1486
|
+
id: 'delete',
|
|
1406
1487
|
action: options.delete_action_title,
|
|
1407
1488
|
classNames: options.delete_action_btn_class,
|
|
1408
1489
|
tooltip: options.delete_action_tooltip,
|
|
@@ -1427,6 +1508,7 @@ dmx.Component('ag-grid', {
|
|
|
1427
1508
|
|
|
1428
1509
|
if (options[buttonActionKey]) {
|
|
1429
1510
|
actionsColumn.cellRendererParams.buttons.push({
|
|
1511
|
+
id: `button${i}`,
|
|
1430
1512
|
action: options[buttonTitleKey],
|
|
1431
1513
|
classNames: options[buttonClassKey],
|
|
1432
1514
|
tooltip: options[buttonTooltipKey],
|
|
@@ -2162,8 +2244,18 @@ dmx.Component('ag-grid', {
|
|
|
2162
2244
|
row_action_button7: Event,
|
|
2163
2245
|
row_action_button8: Event,
|
|
2164
2246
|
row_action_button9: Event,
|
|
2165
|
-
row_action_button10: Event
|
|
2166
|
-
|
|
2247
|
+
row_action_button10: Event,
|
|
2248
|
+
row_action_button11: Event,
|
|
2249
|
+
row_action_button12: Event,
|
|
2250
|
+
row_action_button13: Event,
|
|
2251
|
+
row_action_button14: Event,
|
|
2252
|
+
row_action_button15: Event,
|
|
2253
|
+
row_action_button16: Event,
|
|
2254
|
+
row_action_button17: Event,
|
|
2255
|
+
row_action_button18: Event,
|
|
2256
|
+
row_action_button19: Event,
|
|
2257
|
+
row_action_button20: Event
|
|
2258
|
+
},
|
|
2167
2259
|
|
|
2168
2260
|
init: function(node) {
|
|
2169
2261
|
if (this.$node) {
|