@cdmx/wappler_ag_grid 1.0.4 → 1.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.
- package/README.md +29 -17
- package/app_connect/components.hjson +61 -0
- package/dmx-ag-grid.js +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,20 +49,22 @@ The overrides for the "Custom" theme can be applied in the ag-theme-custom.css f
|
|
|
49
49
|
17. **Header Height**: Height of the header row in pixels. (Default: 30)
|
|
50
50
|
18. **Wrap Header Text**: This will cause long headers to wrap. (Default: true)
|
|
51
51
|
19. **Auto Header Height**: The column header height is automatically set based on the content of the header cells. (Default: true)
|
|
52
|
-
20. **
|
|
53
|
-
21. **Suppress
|
|
54
|
-
22. **Suppress
|
|
55
|
-
23. **
|
|
56
|
-
24. **
|
|
57
|
-
25. **
|
|
58
|
-
26. **Suppress Aggregation
|
|
59
|
-
27. **Suppress
|
|
60
|
-
28. **Suppress
|
|
61
|
-
29. **Suppress
|
|
62
|
-
30. **
|
|
63
|
-
31. **
|
|
64
|
-
|
|
65
|
-
|
|
52
|
+
20. **Wrap Text**: This will cause long texts to wrap in the cells. (Default: false)
|
|
53
|
+
21. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
|
|
54
|
+
22. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
|
|
55
|
+
23. **Suppress Movable Columns**: Disables moving columns. (Default: false)
|
|
56
|
+
24. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
|
|
57
|
+
25. **Animate Rows**: Enables row animation on data changes. (Default: false)
|
|
58
|
+
26. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
|
|
59
|
+
27. **Suppress Aggregation at Root Level**: Disables aggregation at the root level. (Default: false)
|
|
60
|
+
28. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
|
|
61
|
+
29. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
|
|
62
|
+
30. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
|
|
63
|
+
31. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
|
|
64
|
+
33. **Numeric Column Align**: Align numeric columns to the right. (Default: false)
|
|
65
|
+
34. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
|
|
66
|
+
35. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
67
|
+
36. **Enable Row Status Toggle**: Enables row status toggle events. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
66
68
|
|
|
67
69
|
# Data Type Overrides
|
|
68
70
|
|
|
@@ -100,7 +102,7 @@ This grid allows you to configure custom tooltips for specific fields. The grid
|
|
|
100
102
|
# Advanced Data Manipulation
|
|
101
103
|
|
|
102
104
|
The Advanced Data Manipulation feature allows you to add custom values to the field data based on specific conditions.
|
|
103
|
-
This grid allows you to define custom data changes for specific fields. The grid has the following
|
|
105
|
+
This grid allows you to define custom data changes for specific fields. The grid has the following settings:
|
|
104
106
|
|
|
105
107
|
1. **Field**: The field name for which you want to apply the custom data changes. (field name)
|
|
106
108
|
2. **Data**: The new data source or value to be used for the field. (Eg. SC data source array or JSON Data source)
|
|
@@ -114,7 +116,7 @@ This grid allows you to define custom data changes for specific fields. The grid
|
|
|
114
116
|
# Data Manipulation
|
|
115
117
|
|
|
116
118
|
The Data Manipulation feature allows you to add custom values to the field data based on specific conditions.
|
|
117
|
-
This grid allows you to define custom data changes for specific fields. The grid has the following
|
|
119
|
+
This grid allows you to define custom data changes for specific fields. The grid has the following settings:
|
|
118
120
|
|
|
119
121
|
1. **Field**: The field name for which you want to apply the custom data changes.
|
|
120
122
|
2. **Value**: The value to be replaced in the field data.
|
|
@@ -123,7 +125,17 @@ This grid allows you to define custom data changes for specific fields. The grid
|
|
|
123
125
|
|
|
124
126
|
**Amount Fields** (Type: textbox, Default: null)
|
|
125
127
|
- Define the fields where the comma-separation and float parsing need to be applied.
|
|
126
|
-
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
# Display Data Manipulation
|
|
132
|
+
|
|
133
|
+
The Display Data Manipulation feature allows you to add custom text, Combine fields data.
|
|
134
|
+
The grid has the following settings:
|
|
135
|
+
|
|
136
|
+
1. **Field**: The field name for which you want to apply the custom data changes.
|
|
137
|
+
2. **Data**: The value to be replaced in the field data ex: %first_name% %last_name%.
|
|
138
|
+
|
|
127
139
|
---
|
|
128
140
|
# Custom Headers
|
|
129
141
|
|
|
@@ -377,6 +377,14 @@
|
|
|
377
377
|
"defaultValue": true,
|
|
378
378
|
"help": "The column header height is automatically set based on the content of the header cells."
|
|
379
379
|
},
|
|
380
|
+
{
|
|
381
|
+
"name": "wrapText",
|
|
382
|
+
"attribute": "dmx-bind:wrap_text",
|
|
383
|
+
"title": "Wrap Text",
|
|
384
|
+
"type": "boolean",
|
|
385
|
+
"defaultValue": false,
|
|
386
|
+
"help": "This will cause long texts to wrap in the cells."
|
|
387
|
+
},
|
|
380
388
|
{
|
|
381
389
|
"name": "suppressRowClickSelection",
|
|
382
390
|
"attribute": "dmx-bind:suppress_row_click_selection",
|
|
@@ -882,6 +890,59 @@
|
|
|
882
890
|
}
|
|
883
891
|
]
|
|
884
892
|
},
|
|
893
|
+
{
|
|
894
|
+
"group": "📒 Display Data Manipulation",
|
|
895
|
+
"variables": [
|
|
896
|
+
{
|
|
897
|
+
"name": "display_data_changes",
|
|
898
|
+
"title": "Configure Fields",
|
|
899
|
+
"attributeStartsWith": "dmx-bind",
|
|
900
|
+
"attribute": "display_data_changes",
|
|
901
|
+
"type": "boolean",
|
|
902
|
+
"defaultValue": false,
|
|
903
|
+
"display": "fieldset",
|
|
904
|
+
"show": [
|
|
905
|
+
"displayDataChanges",
|
|
906
|
+
],
|
|
907
|
+
"noChangeOnHide": true,
|
|
908
|
+
"groupEnabler": true,
|
|
909
|
+
"help": "Add custom values for Display, Combine columns and add custom text for display."
|
|
910
|
+
"children": [
|
|
911
|
+
{
|
|
912
|
+
"name": "displayDataChanges",
|
|
913
|
+
"attribute": "dmx-bind:display_data_changes",
|
|
914
|
+
"title": "Fields Data",
|
|
915
|
+
"type": "grid",
|
|
916
|
+
"dataBindings": true,
|
|
917
|
+
"jsonFormat": true,
|
|
918
|
+
"encloseBT": true,
|
|
919
|
+
"jsonBT": true,
|
|
920
|
+
"initDisplay": "none",
|
|
921
|
+
"columns": [
|
|
922
|
+
{
|
|
923
|
+
"field": "field",
|
|
924
|
+
"caption": "Field",
|
|
925
|
+
"editable": {
|
|
926
|
+
"type": "text"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
field: "data",
|
|
931
|
+
caption: "Data",
|
|
932
|
+
editable: {
|
|
933
|
+
type: "text"
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
],
|
|
937
|
+
"newRecord": {
|
|
938
|
+
"field": "",
|
|
939
|
+
"data": ""
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
]
|
|
943
|
+
}
|
|
944
|
+
]
|
|
945
|
+
},
|
|
885
946
|
{
|
|
886
947
|
"group": "📒 Custom Headers",
|
|
887
948
|
"variables": [
|
package/dmx-ag-grid.js
CHANGED
|
@@ -22,7 +22,9 @@ dmx.Component('ag-grid', {
|
|
|
22
22
|
cfilters: { type: Array, default: [] },
|
|
23
23
|
wrap_header_text: { type: Boolean, default: true },
|
|
24
24
|
auto_header_height: { type: Boolean, default: true },
|
|
25
|
+
wrap_text: { type: Boolean, default: false },
|
|
25
26
|
data_changes: { type: Array, default: [] },
|
|
27
|
+
display_data_changes: { type: Array, default: [] },
|
|
26
28
|
data: { type: Array, default: [] },
|
|
27
29
|
dom_layout: { type: String, default: 'autoHeight' },
|
|
28
30
|
enable_cell_text_selection: { type: Boolean, default: true },
|
|
@@ -616,7 +618,7 @@ dmx.Component('ag-grid', {
|
|
|
616
618
|
return 'text';
|
|
617
619
|
}
|
|
618
620
|
}
|
|
619
|
-
createCombinedValueGetter = (key, dataChanges, dataBindedChanges) => {
|
|
621
|
+
createCombinedValueGetter = (key, dataChanges, dataBindedChanges, displayDataChanges) => {
|
|
620
622
|
const keyLookup = {};
|
|
621
623
|
|
|
622
624
|
dataBindedChanges.forEach(change => {
|
|
@@ -635,6 +637,20 @@ dmx.Component('ag-grid', {
|
|
|
635
637
|
|
|
636
638
|
return function (params) {
|
|
637
639
|
const value = params.data[key];
|
|
640
|
+
|
|
641
|
+
if ((displayDataChanges.length > 0) && displayDataChanges.some(change => change.field === params.colDef.field)) {
|
|
642
|
+
const placeholderMap = Object.fromEntries(
|
|
643
|
+
Object.entries(params.data).map(([field, fieldValue]) => [`%${field}%`, fieldValue])
|
|
644
|
+
);
|
|
645
|
+
return displayDataChanges.reduce((cellData, change) => {
|
|
646
|
+
if (change.field === params.colDef.field) {
|
|
647
|
+
const placeholders = Object.keys(placeholderMap).join('|');
|
|
648
|
+
const regex = new RegExp(placeholders, 'g');
|
|
649
|
+
cellData = change.data.replace(regex, match => placeholderMap[match]);
|
|
650
|
+
}
|
|
651
|
+
return cellData;
|
|
652
|
+
}, value);
|
|
653
|
+
}
|
|
638
654
|
|
|
639
655
|
// Check if there's a matching change in dataChanges
|
|
640
656
|
const matchingChange = dataChanges.find(change => change.field === key && change.value === String(value));
|
|
@@ -820,7 +836,7 @@ dmx.Component('ag-grid', {
|
|
|
820
836
|
}
|
|
821
837
|
}
|
|
822
838
|
else {
|
|
823
|
-
valueGetter = createCombinedValueGetter(key, options.data_changes, options.data_binded_changes);
|
|
839
|
+
valueGetter = createCombinedValueGetter(key, options.data_changes, options.data_binded_changes, options.display_data_changes);
|
|
824
840
|
filterValueGetter = createCombinedFilterValueGetter(key, options.data_changes, options.data_binded_changes);
|
|
825
841
|
tooltipValueGetter = createCombinedTooltipValueGetter(key, options.data_changes, options.data_binded_changes);
|
|
826
842
|
|
|
@@ -1092,6 +1108,7 @@ dmx.Component('ag-grid', {
|
|
|
1092
1108
|
resizable: options.resizable,
|
|
1093
1109
|
wrapHeaderText: options.wrap_header_text,
|
|
1094
1110
|
autoHeaderHeight: options.auto_header_height,
|
|
1111
|
+
wrapText: options.wrap_text,
|
|
1095
1112
|
filter: options.filter,
|
|
1096
1113
|
sortable: options.sortable,
|
|
1097
1114
|
floatingFilter: options.floating_filter
|