@cdmx/wappler_ag_grid 0.5.7 → 0.5.9
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 +54 -0
- package/dmx-ag-grid.js +14 -2
- package/package.json +1 -1
|
@@ -438,6 +438,14 @@
|
|
|
438
438
|
"defaultValue": false,
|
|
439
439
|
"help": "Hides the ID Field in Grid"
|
|
440
440
|
},
|
|
441
|
+
{
|
|
442
|
+
"name": "numericColumnAlign",
|
|
443
|
+
"attribute": "dmx-bind:numeric_column_align",
|
|
444
|
+
"title": "Right Align Numeric Columns",
|
|
445
|
+
"type": "boolean",
|
|
446
|
+
"defaultValue": false,
|
|
447
|
+
"help": "Align numeric columns to the right."
|
|
448
|
+
},
|
|
441
449
|
{
|
|
442
450
|
"name": "rowClickEvent",
|
|
443
451
|
"attribute": "dmx-bind:row_click_event",
|
|
@@ -1044,6 +1052,52 @@
|
|
|
1044
1052
|
}
|
|
1045
1053
|
]
|
|
1046
1054
|
},
|
|
1055
|
+
{
|
|
1056
|
+
"group": "📒 Compact View",
|
|
1057
|
+
"variables": [
|
|
1058
|
+
{
|
|
1059
|
+
"name": "compact_view",
|
|
1060
|
+
"title": "Compact View Config",
|
|
1061
|
+
"type": "boolean",
|
|
1062
|
+
"defaultValue": false,
|
|
1063
|
+
"display": "fieldset",
|
|
1064
|
+
"show": [
|
|
1065
|
+
"compactView",
|
|
1066
|
+
"compactViewGridSize",
|
|
1067
|
+
"compactViewItemHeight"
|
|
1068
|
+
],
|
|
1069
|
+
"noChangeOnHide": true,
|
|
1070
|
+
"groupEnabler": true,
|
|
1071
|
+
"help": "Configure amount fields to have comma-seperation implemented"
|
|
1072
|
+
"children": [
|
|
1073
|
+
{
|
|
1074
|
+
"name": "compactView",
|
|
1075
|
+
"attribute": "dmx-bind:compact_view",
|
|
1076
|
+
"title": "Compact View",
|
|
1077
|
+
"type": "boolean",
|
|
1078
|
+
"defaultValue": false,
|
|
1079
|
+
"initDisplay": "none"
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
"name": "compactViewGridSize",
|
|
1083
|
+
"attribute": "compact_view_grid_size",
|
|
1084
|
+
"title": "Grid Size",
|
|
1085
|
+
"type": "number",
|
|
1086
|
+
"defaultValue": 3,
|
|
1087
|
+
"initDisplay": "none"
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
"name": "compactViewItemHeight",
|
|
1091
|
+
"attribute": "compact_view_item_height",
|
|
1092
|
+
"title": "Grid Item Height",
|
|
1093
|
+
"type": "number",
|
|
1094
|
+
"defaultValue": 20,
|
|
1095
|
+
"initDisplay": "none"
|
|
1096
|
+
}
|
|
1097
|
+
]
|
|
1098
|
+
}
|
|
1099
|
+
]
|
|
1100
|
+
},
|
|
1047
1101
|
{
|
|
1048
1102
|
"group": "📒 Configure Actions Column",
|
|
1049
1103
|
"variables": [
|
package/dmx-ag-grid.js
CHANGED
|
@@ -38,6 +38,7 @@ dmx.Component('ag-grid', {
|
|
|
38
38
|
suppress_scroll_on_new_data: { type: Boolean, default: false },
|
|
39
39
|
suppress_property_names_check: { type: Boolean, default: false },
|
|
40
40
|
hide_id_field: { type: Boolean, default: false },
|
|
41
|
+
numeric_column_align: { type: Boolean, default: false },
|
|
41
42
|
enable_rtl: { type: Boolean, default: false },
|
|
42
43
|
locale_text: { type: String, default: null },
|
|
43
44
|
date_locale: { type: String, default: 'en-IN' },
|
|
@@ -81,7 +82,10 @@ dmx.Component('ag-grid', {
|
|
|
81
82
|
data_binded_changes: {type: Array, default: [] },
|
|
82
83
|
hide_fields: {type: Array, default: [] },
|
|
83
84
|
hide_filters: {type: Array, default: [] },
|
|
84
|
-
hide_sort: {type: Array, default: [] }
|
|
85
|
+
hide_sort: {type: Array, default: [] },
|
|
86
|
+
compact_view: { type: Boolean, default: false },
|
|
87
|
+
compact_view_grid_size: { type: Number, default: 3 },
|
|
88
|
+
compact_view_item_height: { type: Number, default: 20 }
|
|
85
89
|
},
|
|
86
90
|
|
|
87
91
|
methods: {
|
|
@@ -537,9 +541,12 @@ dmx.Component('ag-grid', {
|
|
|
537
541
|
let minWidth;
|
|
538
542
|
let hide;
|
|
539
543
|
let colId;
|
|
540
|
-
|
|
544
|
+
|
|
541
545
|
if (dataType === 'number') {
|
|
542
546
|
filter = 'agNumberColumnFilter';
|
|
547
|
+
if (options.numeric_column_align){
|
|
548
|
+
type = 'numericColumn';
|
|
549
|
+
}
|
|
543
550
|
if (options.amount_fields && options.amount_fields.includes(key)) {
|
|
544
551
|
valueFormatter = function (params) {
|
|
545
552
|
if (params.value != null) {
|
|
@@ -695,6 +702,7 @@ dmx.Component('ag-grid', {
|
|
|
695
702
|
valueGetter: valueGetter,
|
|
696
703
|
minWidth: minWidth,
|
|
697
704
|
hide: hide,
|
|
705
|
+
type: type,
|
|
698
706
|
sortable: sortable,
|
|
699
707
|
filterValueGetter: filterValueGetter,
|
|
700
708
|
filterParams: filterParams,
|
|
@@ -854,6 +862,10 @@ dmx.Component('ag-grid', {
|
|
|
854
862
|
// Create ag-Grid instance
|
|
855
863
|
gridInstance = new agGrid.Grid(gridDiv, gridConfig);
|
|
856
864
|
const gridElement = document.getElementById(options.id+'-grid');
|
|
865
|
+
if (options.compact_view) {
|
|
866
|
+
gridElement.style.setProperty('--ag-grid-size', `${options.compact_view_grid_size}`+'px');
|
|
867
|
+
gridElement.style.setProperty('--ag-list-item-height', `${options.compact_view_item_height}`+'px');
|
|
868
|
+
}
|
|
857
869
|
const gridContainer = gridElement.parentNode;
|
|
858
870
|
// Add an event listener to the grid
|
|
859
871
|
if (options.row_checkbox_event) {
|