@cdmx/wappler_ag_grid 0.4.6 → 0.4.8
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 +74 -0
- package/dmx-ag-grid.js +16 -5
- package/package.json +1 -1
|
@@ -590,6 +590,72 @@
|
|
|
590
590
|
}
|
|
591
591
|
]
|
|
592
592
|
},
|
|
593
|
+
{
|
|
594
|
+
"group": "📒 Tooltip Settings",
|
|
595
|
+
"variables": [
|
|
596
|
+
{
|
|
597
|
+
"name": "customTooltip",
|
|
598
|
+
"attribute": "custom_tooltip",
|
|
599
|
+
"title": "Custom Tooltip Text",
|
|
600
|
+
"type": "text",
|
|
601
|
+
"help": "Specify custom tooltip text"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"name": "tooltipConfig",
|
|
605
|
+
"title": "Configure Field Tooltips",
|
|
606
|
+
"attributeStartsWith": "dmx-bind",
|
|
607
|
+
"attribute": "tooltip_config",
|
|
608
|
+
"type": "boolean",
|
|
609
|
+
"defaultValue": false,
|
|
610
|
+
"display": "fieldset",
|
|
611
|
+
"show": [
|
|
612
|
+
"tooltipConfig"
|
|
613
|
+
],
|
|
614
|
+
"noChangeOnHide": true,
|
|
615
|
+
"groupEnabler": true,
|
|
616
|
+
"help": "Enable/Disable Tooltips for fields"
|
|
617
|
+
"children": [
|
|
618
|
+
{
|
|
619
|
+
"name": "tooltipConfig",
|
|
620
|
+
"attribute": "dmx-bind:tooltip_config",
|
|
621
|
+
"title": "Tooltip Configs",
|
|
622
|
+
"type": "grid",
|
|
623
|
+
"dataBindings": true,
|
|
624
|
+
"jsonFormat": true,
|
|
625
|
+
"encloseBT": true,
|
|
626
|
+
"jsonBT": true,
|
|
627
|
+
"initDisplay": "none",
|
|
628
|
+
"columns": [
|
|
629
|
+
{
|
|
630
|
+
"field": "field",
|
|
631
|
+
"caption": "Field",
|
|
632
|
+
"size": "20%",
|
|
633
|
+
"editable": {
|
|
634
|
+
"type": "text"
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"field": "tooltip",
|
|
639
|
+
"caption": "Tooltip",
|
|
640
|
+
"size": "20%",
|
|
641
|
+
"editable": {
|
|
642
|
+
"type": "list",
|
|
643
|
+
"items": [
|
|
644
|
+
{id: 'yes', text: 'yes'},
|
|
645
|
+
{id: 'no', text: 'no'}
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
],
|
|
650
|
+
"newRecord": {
|
|
651
|
+
"field": "",
|
|
652
|
+
"tooltip": "no"
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
]
|
|
658
|
+
},
|
|
593
659
|
{
|
|
594
660
|
"group": "📒 Advanced Data Manipulation",
|
|
595
661
|
"variables": [
|
|
@@ -962,6 +1028,14 @@
|
|
|
962
1028
|
"defaultValue": false,
|
|
963
1029
|
"help": "Enable Actions"
|
|
964
1030
|
},
|
|
1031
|
+
{
|
|
1032
|
+
"name": "pingActions",
|
|
1033
|
+
"attribute": "dmx-bind:pin_actions",
|
|
1034
|
+
"title": "Pin Actions Column",
|
|
1035
|
+
"type": "boolean",
|
|
1036
|
+
"defaultValue": true,
|
|
1037
|
+
"help": "Pin Actions Column"
|
|
1038
|
+
},
|
|
965
1039
|
{
|
|
966
1040
|
"name": "editActionBtn",
|
|
967
1041
|
"attribute": "dmx-bind:edit_action_btn",
|
package/dmx-ag-grid.js
CHANGED
|
@@ -11,6 +11,8 @@ dmx.Component('ag-grid', {
|
|
|
11
11
|
noload: { type: Boolean, default: false },
|
|
12
12
|
grid_theme: { type: String, default: 'ag-theme-alpine' },
|
|
13
13
|
column_defs: { type: Array, default: [] },
|
|
14
|
+
tooltip_config: { type: Array, default: [] },
|
|
15
|
+
custom_tooltip: { type: String, default: null },
|
|
14
16
|
cstyles: { type: Array, default: [] },
|
|
15
17
|
cnames: { type: Object, default: {} },
|
|
16
18
|
cwidths: { type: Object, default: {} },
|
|
@@ -423,7 +425,6 @@ dmx.Component('ag-grid', {
|
|
|
423
425
|
}
|
|
424
426
|
createCombinedTooltipValueGetter = (key, dataChanges, dataBindedChanges) => {
|
|
425
427
|
const keyLookup = {};
|
|
426
|
-
|
|
427
428
|
dataBindedChanges.forEach(change => {
|
|
428
429
|
if (!keyLookup[change.field]) {
|
|
429
430
|
const data_source = change.data_source;
|
|
@@ -453,14 +454,23 @@ dmx.Component('ag-grid', {
|
|
|
453
454
|
if (matchingKeyData) {
|
|
454
455
|
const { dataArray, property, output, area } = matchingKeyData;
|
|
455
456
|
const matchingItem = dataArray.find(item => item[property] === value);
|
|
456
|
-
|
|
457
|
-
|
|
458
457
|
if (matchingItem && area === 'tooltip') {
|
|
459
458
|
return matchingItem[output];
|
|
460
459
|
}
|
|
461
460
|
}
|
|
462
|
-
|
|
463
|
-
|
|
461
|
+
if (options.custom_tooltip) {
|
|
462
|
+
return options.custom_tooltip;
|
|
463
|
+
}
|
|
464
|
+
else if (Array.isArray(options.tooltip_config)) {
|
|
465
|
+
for (const config of options.tooltip_config) {
|
|
466
|
+
if (config.field === key && config.tooltip === "yes") {
|
|
467
|
+
return value;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
return undefined;
|
|
473
|
+
}
|
|
464
474
|
};
|
|
465
475
|
}
|
|
466
476
|
createCombinedFilterValueGetter = (key, dataChanges, dataBindedChanges) => {
|
|
@@ -560,6 +570,7 @@ dmx.Component('ag-grid', {
|
|
|
560
570
|
valueGetter = createCombinedValueGetter(key, options.data_changes, options.data_binded_changes);
|
|
561
571
|
filterValueGetter = createCombinedFilterValueGetter(key, options.data_changes, options.data_binded_changes);
|
|
562
572
|
tooltipValueGetter = createCombinedTooltipValueGetter(key, options.data_changes, options.data_binded_changes);
|
|
573
|
+
|
|
563
574
|
}
|
|
564
575
|
function extractConditionParts(condition) {
|
|
565
576
|
|