@cdmx/wappler_ag_grid 1.5.14 → 1.6.1
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 +40 -36
- package/app_connect/components.hjson +92 -0
- package/dmx-ag-grid.js +42 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,50 +33,54 @@ To use the "Custom" theme, copy "ag-theme-custom.css" to public/css/ag-theme-cus
|
|
|
33
33
|
4. **Case-Insensitive Sort**: Specifies if the columns are sorted in case-insensitive manner. (Default: false)
|
|
34
34
|
5. **Filter**: Specifies if the column has a filter. (Default: true)
|
|
35
35
|
6. **Floating Filter**: Specifies if the column has a floating filter. (Default: true)
|
|
36
|
-
7. **
|
|
37
|
-
8. **
|
|
38
|
-
9. **
|
|
39
|
-
10. **
|
|
40
|
-
11. **
|
|
41
|
-
12. **
|
|
42
|
-
13. **
|
|
43
|
-
14. **
|
|
44
|
-
15. **
|
|
36
|
+
7. **Editiable Cells**: Makes cells editable. (Default: false)
|
|
37
|
+
8. **Editiable Rows**: Makes row data editable. (Default: false)
|
|
38
|
+
9. **CSV Export**: Specifies if Export to CSV is enabled. (Default: true)
|
|
39
|
+
10. **Enable RTL**: Enabled Right to Left, used for Hebrew and Arabic. (Default: false)
|
|
40
|
+
11. **Column Hover Highlight**: Specifies column hover highlighting. (Default: true)
|
|
41
|
+
12. **Suppress Row Deselection**: Specifies if rows can be deselected. (Default: false)
|
|
42
|
+
13. **Pagination**: Enables pagination. (Default: true)
|
|
43
|
+
14. **Auto Pagination**: Enables automatic pagination. (Default: false)
|
|
44
|
+
15. **Page Limit Selectors**: Allowed selectors for for page size. Set to false to hide the page size selector. (Default: [20,50,100] ).
|
|
45
|
+
16. **Page Limit**: Number of rows to show per page. (Default: 20)
|
|
46
|
+
17. **Row Selection**: Row Selection (single or multiple).
|
|
45
47
|
- "Single"
|
|
46
48
|
- "Multiple" (Default)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
18. **Timezone**: Timezone for Date Fields. Select the appropriate timezone from the dropdown list. (Default: Local)
|
|
50
|
+
19. **Date Format**: Date Format for displaying date values. (Default: "dd/MM/yyyy hh:mm A")
|
|
51
|
+
20. **Filter Field ID**: Specifies the field ID of the search field when using grid quick filter. Applicable when using Quick Filter feature of AG Grid, called from Dynamic Events on change event on the field. (Default: search_field)
|
|
52
|
+
21. **Loading Overlay**: This enables loading overlay. (Default: false)
|
|
53
|
+
22. **Loading Overlay Duration**: This sets loading overlay duration in ms. (Default: 500)
|
|
54
|
+
23. **Sticky Header and Horizontal Scrollbar**: Optionally specify the header offset and topbar class.
|
|
53
55
|
- Fixed Header: Enables sticky header. (Default: false)
|
|
54
56
|
- Header Offset: Specifies offset from the top of the viewport area (Optional). (Default: 100)
|
|
55
57
|
- Topbar Class: Specify class, e.g., "topbar", to measure the offset from (Optional). (Default: "topbar")
|
|
56
58
|
- Topbar Offset: Specify topbar offset (Default: 80)
|
|
57
59
|
- Fixed Horizontal Scroll: Enables Hovering horizontal scrollbar which stays at the bottom all the time. (Default: false)
|
|
58
60
|
- Fixed Horizontal Scroll Width: Fixed horizontal scroll width percentage. (Default: 80%)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
61
|
+
24. **Row Height**: Height of each row in pixels. (Default: Auto)
|
|
62
|
+
25. **Header Height**: Height of the header row in pixels. (Default: Auto)
|
|
63
|
+
26. **Wrap Header Text**: This will cause long headers to wrap. (Default: true)
|
|
64
|
+
27. **Auto Header Height**: The header height is automatically set based on the content of the header. (Default: true)
|
|
65
|
+
28. **Auto Height**: The height is automatically set based on the content of the cells. (Default: false)
|
|
66
|
+
29. **Wrap Text**: This will cause long texts to wrap in the cells. (Default: false)
|
|
67
|
+
30. **Center Align (V)**: Specifies if the cell data should be vertically centered. (Default: false)
|
|
68
|
+
31. **Center Align (H)**: Specifies if the cell data should be vertically centered. (Default: false)
|
|
69
|
+
32. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
|
|
70
|
+
33. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
|
|
71
|
+
34. **Suppress Movable Columns**: Disables moving columns. (Default: false)
|
|
72
|
+
35. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
|
|
73
|
+
36. **Animate Rows**: Enables row animation on data changes. (Default: false)
|
|
74
|
+
37. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
|
|
75
|
+
38. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
|
|
76
|
+
39. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
|
|
77
|
+
40. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
|
|
78
|
+
41. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
|
|
79
|
+
42. **Numeric Column Align**: Align numeric columns to the right. (Default: false)
|
|
80
|
+
43. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
|
|
81
|
+
44. **Row Double Click Events**: Enables row double click events. This can be used in Dynamic events => Grid Events => Row Double Clicked. (Default: false)
|
|
82
|
+
45. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
83
|
+
46. **Enable Row Status Toggle**: Enables row status toggle events. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
80
84
|
|
|
81
85
|
# Data Type Overrides
|
|
82
86
|
|
|
@@ -176,6 +176,22 @@
|
|
|
176
176
|
"defaultValue": true,
|
|
177
177
|
"help": "Specifies if the column has a floating filter"
|
|
178
178
|
},
|
|
179
|
+
{
|
|
180
|
+
"name": "cellEditable",
|
|
181
|
+
"attribute": "dmx-bind:cell_editable",
|
|
182
|
+
"title": "Editable Cells",
|
|
183
|
+
"type": "boolean",
|
|
184
|
+
"defaultValue": false,
|
|
185
|
+
"help": "Makes cells editable."
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "rowEditable",
|
|
189
|
+
"attribute": "dmx-bind:row_editable",
|
|
190
|
+
"title": "Row Editable",
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"defaultValue": false,
|
|
193
|
+
"help": "Makes entire row editable."
|
|
194
|
+
},
|
|
179
195
|
{
|
|
180
196
|
"name": "exportToCSV",
|
|
181
197
|
"attribute": "dmx-bind:export_to_csv",
|
|
@@ -451,6 +467,14 @@
|
|
|
451
467
|
"defaultValue": false,
|
|
452
468
|
"help": "This will cause long texts to wrap in the cells."
|
|
453
469
|
},
|
|
470
|
+
{
|
|
471
|
+
"name": "vCenterCellData",
|
|
472
|
+
"attribute": "dmx-bind:vert_center_cell_data",
|
|
473
|
+
"title": "Center Align (V)",
|
|
474
|
+
"type": "boolean",
|
|
475
|
+
"defaultValue": false,
|
|
476
|
+
"help": "Specifies if the cell data should be vertically centered."
|
|
477
|
+
},
|
|
454
478
|
{
|
|
455
479
|
"name": "autoHeight",
|
|
456
480
|
"attribute": "dmx-bind:auto_height",
|
|
@@ -2796,6 +2820,74 @@
|
|
|
2796
2820
|
"dmx-ag-grid": true
|
|
2797
2821
|
}
|
|
2798
2822
|
},
|
|
2823
|
+
{
|
|
2824
|
+
"name": "dmx-ag-grid-cell-edited",
|
|
2825
|
+
"attributeStartsWith": "dmx-on",
|
|
2826
|
+
"attribute": "cell_data_edited",
|
|
2827
|
+
"display": "fieldset",
|
|
2828
|
+
"title": "Cell Data Edited",
|
|
2829
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
2830
|
+
"groupTitle": "Grid Events",
|
|
2831
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
2832
|
+
"defaultValue": false,
|
|
2833
|
+
"show": [
|
|
2834
|
+
"cellDataUpdated"
|
|
2835
|
+
],
|
|
2836
|
+
"noChangeOnHide": true,
|
|
2837
|
+
"type": "boolean",
|
|
2838
|
+
"groupEnabler": true,
|
|
2839
|
+
"children": [
|
|
2840
|
+
{
|
|
2841
|
+
"name": "cellDataUpdated",
|
|
2842
|
+
"attributeStartsWith": "dmx-on",
|
|
2843
|
+
"attribute": "cell_data_edited",
|
|
2844
|
+
"isValue": true,
|
|
2845
|
+
"actionsPicker": true,
|
|
2846
|
+
"title": "Action:",
|
|
2847
|
+
"type": "text",
|
|
2848
|
+
"help": "Choose the action to execute.",
|
|
2849
|
+
"defaultValue": "",
|
|
2850
|
+
"initDisplay": "none"
|
|
2851
|
+
}
|
|
2852
|
+
],
|
|
2853
|
+
"allowedOn": {
|
|
2854
|
+
"dmx-ag-grid": true
|
|
2855
|
+
}
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
"name": "dmx-ag-grid-row-edited",
|
|
2859
|
+
"attributeStartsWith": "dmx-on",
|
|
2860
|
+
"attribute": "row_data_edited",
|
|
2861
|
+
"display": "fieldset",
|
|
2862
|
+
"title": "Row Data Edited",
|
|
2863
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
2864
|
+
"groupTitle": "Grid Events",
|
|
2865
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
2866
|
+
"defaultValue": false,
|
|
2867
|
+
"show": [
|
|
2868
|
+
"rowDataUpdated"
|
|
2869
|
+
],
|
|
2870
|
+
"noChangeOnHide": true,
|
|
2871
|
+
"type": "boolean",
|
|
2872
|
+
"groupEnabler": true,
|
|
2873
|
+
"children": [
|
|
2874
|
+
{
|
|
2875
|
+
"name": "rowDataUpdated",
|
|
2876
|
+
"attributeStartsWith": "dmx-on",
|
|
2877
|
+
"attribute": "row_data_edited",
|
|
2878
|
+
"isValue": true,
|
|
2879
|
+
"actionsPicker": true,
|
|
2880
|
+
"title": "Action:",
|
|
2881
|
+
"type": "text",
|
|
2882
|
+
"help": "Choose the action to execute.",
|
|
2883
|
+
"defaultValue": "",
|
|
2884
|
+
"initDisplay": "none"
|
|
2885
|
+
}
|
|
2886
|
+
],
|
|
2887
|
+
"allowedOn": {
|
|
2888
|
+
"dmx-ag-grid": true
|
|
2889
|
+
}
|
|
2890
|
+
},
|
|
2799
2891
|
{
|
|
2800
2892
|
"name": "dmx-ag-grid-checkbox-checked",
|
|
2801
2893
|
"attributeStartsWith": "dmx-on",
|
package/dmx-ag-grid.js
CHANGED
|
@@ -30,6 +30,8 @@ dmx.Component('ag-grid', {
|
|
|
30
30
|
auto_header_height: { type: Boolean, default: true },
|
|
31
31
|
wrap_text: { type: Boolean, default: false },
|
|
32
32
|
auto_height: { type: Boolean, default: false },
|
|
33
|
+
vert_center_cell_data: { type: Boolean, default: false },
|
|
34
|
+
horz_center_cell_data: { type: Boolean, default: false },
|
|
33
35
|
data_changes: { type: Array, default: [] },
|
|
34
36
|
display_data_changes: { type: Array, default: [] },
|
|
35
37
|
js_data_changes: { type: Array, default: [] },
|
|
@@ -66,6 +68,8 @@ dmx.Component('ag-grid', {
|
|
|
66
68
|
amount_field_precision: { type: Number, default: 2 },
|
|
67
69
|
min_width: { type: Number, default: 150 },
|
|
68
70
|
sortable: { type: Boolean, default: true },
|
|
71
|
+
cell_editable: { type: Boolean, default: false },
|
|
72
|
+
row_editable: { type: Boolean, default: false },
|
|
69
73
|
ci_sort: { type: Boolean, default: false },
|
|
70
74
|
resizable: { type: Boolean, default: true },
|
|
71
75
|
filter: { type: Boolean, default: true },
|
|
@@ -1188,6 +1192,7 @@ dmx.Component('ag-grid', {
|
|
|
1188
1192
|
checkboxSelection: true,
|
|
1189
1193
|
showDisabledCheckboxes: true,
|
|
1190
1194
|
resizable: false,
|
|
1195
|
+
editable: false,
|
|
1191
1196
|
width: 50,
|
|
1192
1197
|
maxWidth: 50,
|
|
1193
1198
|
suppressMenu: true
|
|
@@ -1205,6 +1210,7 @@ dmx.Component('ag-grid', {
|
|
|
1205
1210
|
minWidth: options.actions_column_min_width,
|
|
1206
1211
|
maxWidth: options.actions_column_max_width,
|
|
1207
1212
|
autoHeight: true,
|
|
1213
|
+
editable: false,
|
|
1208
1214
|
pinned: (options.pin_actions ? options.actions_column_position: undefined),
|
|
1209
1215
|
cellRendererParams: {
|
|
1210
1216
|
buttons: [],
|
|
@@ -1311,8 +1317,10 @@ dmx.Component('ag-grid', {
|
|
|
1311
1317
|
autoHeight: options.auto_height,
|
|
1312
1318
|
filter: options.filter,
|
|
1313
1319
|
sortable: options.sortable,
|
|
1320
|
+
editable: options.cell_editable,
|
|
1314
1321
|
floatingFilter: options.floating_filter
|
|
1315
1322
|
},
|
|
1323
|
+
editType: (options.row_editable ? 'fullRow': undefined),
|
|
1316
1324
|
domLayout: this.props.dom_layout,
|
|
1317
1325
|
enableCellTextSelection: true,
|
|
1318
1326
|
rowSelection: this.props.row_selection,
|
|
@@ -1390,6 +1398,20 @@ dmx.Component('ag-grid', {
|
|
|
1390
1398
|
updateHoveringBarStyles();
|
|
1391
1399
|
}
|
|
1392
1400
|
},
|
|
1401
|
+
onCellValueChanged: (params) => {
|
|
1402
|
+
this.set('data', params.data);
|
|
1403
|
+
this.set('id', params.data.id);
|
|
1404
|
+
dmx.nextTick(function() {
|
|
1405
|
+
this.dispatchEvent('cell_data_edited');
|
|
1406
|
+
}, this);
|
|
1407
|
+
},
|
|
1408
|
+
onRowValueChanged: (params) => {
|
|
1409
|
+
this.set('data', params.data);
|
|
1410
|
+
this.set('id', params.data.id);
|
|
1411
|
+
dmx.nextTick(function() {
|
|
1412
|
+
this.dispatchEvent('row_data_edited');
|
|
1413
|
+
}, this);
|
|
1414
|
+
},
|
|
1393
1415
|
components: {
|
|
1394
1416
|
clickCellRenderer: clickCellRenderer,
|
|
1395
1417
|
checkboxCellRenderer: checkboxCellRenderer,
|
|
@@ -1510,6 +1532,22 @@ dmx.Component('ag-grid', {
|
|
|
1510
1532
|
}
|
|
1511
1533
|
|
|
1512
1534
|
const gridElement = document.getElementById(options.id+'-grid');
|
|
1535
|
+
if (options.vert_center_cell_data) {
|
|
1536
|
+
const styleElement = document.createElement('style');
|
|
1537
|
+
if (options.vert_center_cell_data) {
|
|
1538
|
+
styleElement.textContent += `
|
|
1539
|
+
.ag-cell {
|
|
1540
|
+
display: flex;
|
|
1541
|
+
flex-direction: column;
|
|
1542
|
+
justify-content: center;
|
|
1543
|
+
overflow: hidden;
|
|
1544
|
+
text-overflow: ellipsis;
|
|
1545
|
+
white-space: nowrap;
|
|
1546
|
+
}
|
|
1547
|
+
`;
|
|
1548
|
+
}
|
|
1549
|
+
gridElement.appendChild(styleElement);
|
|
1550
|
+
}
|
|
1513
1551
|
if (options.compact_view) {
|
|
1514
1552
|
gridElement.style.setProperty('--ag-grid-size', `${options.compact_view_grid_size}`+'px');
|
|
1515
1553
|
gridElement.style.setProperty('--ag-list-item-height', `${options.compact_view_item_height}`+'px');
|
|
@@ -1605,9 +1643,8 @@ dmx.Component('ag-grid', {
|
|
|
1605
1643
|
}
|
|
1606
1644
|
}
|
|
1607
1645
|
function updateHoveringBarStyles() {
|
|
1608
|
-
const existingStyle =
|
|
1646
|
+
const existingStyle = gridElement.querySelector('#hovering-bar-style');
|
|
1609
1647
|
if (options.fixed_horizontal_scroll) {
|
|
1610
|
-
// Create a new style element
|
|
1611
1648
|
const styleElement = document.createElement('style');
|
|
1612
1649
|
styleElement.id = 'hovering-bar-style';
|
|
1613
1650
|
const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
|
|
@@ -1624,7 +1661,7 @@ dmx.Component('ag-grid', {
|
|
|
1624
1661
|
if (existingStyle) {
|
|
1625
1662
|
existingStyle.parentNode.replaceChild(styleElement, existingStyle);
|
|
1626
1663
|
} else {
|
|
1627
|
-
|
|
1664
|
+
gridElement.appendChild(styleElement);
|
|
1628
1665
|
}
|
|
1629
1666
|
} else if (existingStyle) {
|
|
1630
1667
|
// Remove the style element if it exists
|
|
@@ -1729,6 +1766,8 @@ dmx.Component('ag-grid', {
|
|
|
1729
1766
|
row_clicked: Event,
|
|
1730
1767
|
row_double_clicked: Event,
|
|
1731
1768
|
cell_clicked: Event,
|
|
1769
|
+
cell_data_edited: Event,
|
|
1770
|
+
row_data_edited: Event,
|
|
1732
1771
|
row_checkbox_checked: Event,
|
|
1733
1772
|
row_checkbox_unchecked: Event,
|
|
1734
1773
|
row_status_enabled: Event,
|