@cdmx/wappler_ag_grid 1.5.14 → 1.6.0
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 +100 -0
- package/dmx-ag-grid.js +49 -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,22 @@
|
|
|
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
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "hCenterCellData",
|
|
480
|
+
"attribute": "dmx-bind:horz_center_cell_data",
|
|
481
|
+
"title": "Center Align (H)",
|
|
482
|
+
"type": "boolean",
|
|
483
|
+
"defaultValue": false,
|
|
484
|
+
"help": "Specifies if the cell data should be horizontally centered."
|
|
485
|
+
},
|
|
454
486
|
{
|
|
455
487
|
"name": "autoHeight",
|
|
456
488
|
"attribute": "dmx-bind:auto_height",
|
|
@@ -2796,6 +2828,74 @@
|
|
|
2796
2828
|
"dmx-ag-grid": true
|
|
2797
2829
|
}
|
|
2798
2830
|
},
|
|
2831
|
+
{
|
|
2832
|
+
"name": "dmx-ag-grid-cell-edited",
|
|
2833
|
+
"attributeStartsWith": "dmx-on",
|
|
2834
|
+
"attribute": "cell_data_edited",
|
|
2835
|
+
"display": "fieldset",
|
|
2836
|
+
"title": "Cell Data Edited",
|
|
2837
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
2838
|
+
"groupTitle": "Grid Events",
|
|
2839
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
2840
|
+
"defaultValue": false,
|
|
2841
|
+
"show": [
|
|
2842
|
+
"cellDataUpdated"
|
|
2843
|
+
],
|
|
2844
|
+
"noChangeOnHide": true,
|
|
2845
|
+
"type": "boolean",
|
|
2846
|
+
"groupEnabler": true,
|
|
2847
|
+
"children": [
|
|
2848
|
+
{
|
|
2849
|
+
"name": "cellDataUpdated",
|
|
2850
|
+
"attributeStartsWith": "dmx-on",
|
|
2851
|
+
"attribute": "cell_data_edited",
|
|
2852
|
+
"isValue": true,
|
|
2853
|
+
"actionsPicker": true,
|
|
2854
|
+
"title": "Action:",
|
|
2855
|
+
"type": "text",
|
|
2856
|
+
"help": "Choose the action to execute.",
|
|
2857
|
+
"defaultValue": "",
|
|
2858
|
+
"initDisplay": "none"
|
|
2859
|
+
}
|
|
2860
|
+
],
|
|
2861
|
+
"allowedOn": {
|
|
2862
|
+
"dmx-ag-grid": true
|
|
2863
|
+
}
|
|
2864
|
+
},
|
|
2865
|
+
{
|
|
2866
|
+
"name": "dmx-ag-grid-row-edited",
|
|
2867
|
+
"attributeStartsWith": "dmx-on",
|
|
2868
|
+
"attribute": "row_data_edited",
|
|
2869
|
+
"display": "fieldset",
|
|
2870
|
+
"title": "Row Data Edited",
|
|
2871
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
2872
|
+
"groupTitle": "Grid Events",
|
|
2873
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
2874
|
+
"defaultValue": false,
|
|
2875
|
+
"show": [
|
|
2876
|
+
"rowDataUpdated"
|
|
2877
|
+
],
|
|
2878
|
+
"noChangeOnHide": true,
|
|
2879
|
+
"type": "boolean",
|
|
2880
|
+
"groupEnabler": true,
|
|
2881
|
+
"children": [
|
|
2882
|
+
{
|
|
2883
|
+
"name": "rowDataUpdated",
|
|
2884
|
+
"attributeStartsWith": "dmx-on",
|
|
2885
|
+
"attribute": "row_data_edited",
|
|
2886
|
+
"isValue": true,
|
|
2887
|
+
"actionsPicker": true,
|
|
2888
|
+
"title": "Action:",
|
|
2889
|
+
"type": "text",
|
|
2890
|
+
"help": "Choose the action to execute.",
|
|
2891
|
+
"defaultValue": "",
|
|
2892
|
+
"initDisplay": "none"
|
|
2893
|
+
}
|
|
2894
|
+
],
|
|
2895
|
+
"allowedOn": {
|
|
2896
|
+
"dmx-ag-grid": true
|
|
2897
|
+
}
|
|
2898
|
+
},
|
|
2799
2899
|
{
|
|
2800
2900
|
"name": "dmx-ag-grid-checkbox-checked",
|
|
2801
2901
|
"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,29 @@ dmx.Component('ag-grid', {
|
|
|
1510
1532
|
}
|
|
1511
1533
|
|
|
1512
1534
|
const gridElement = document.getElementById(options.id+'-grid');
|
|
1535
|
+
if (options.vert_center_cell_data || options.horz_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
|
+
align-items: center;
|
|
1542
|
+
}
|
|
1543
|
+
`;
|
|
1544
|
+
}
|
|
1545
|
+
if (options.horz_center_cell_data) {
|
|
1546
|
+
styleElement.textContent += `
|
|
1547
|
+
.ag-cell {
|
|
1548
|
+
display: flex;
|
|
1549
|
+
justify-content: center;
|
|
1550
|
+
}
|
|
1551
|
+
.ag-header-cell-label {
|
|
1552
|
+
justify-content: center;
|
|
1553
|
+
}
|
|
1554
|
+
`;
|
|
1555
|
+
}
|
|
1556
|
+
gridElement.appendChild(styleElement);
|
|
1557
|
+
}
|
|
1513
1558
|
if (options.compact_view) {
|
|
1514
1559
|
gridElement.style.setProperty('--ag-grid-size', `${options.compact_view_grid_size}`+'px');
|
|
1515
1560
|
gridElement.style.setProperty('--ag-list-item-height', `${options.compact_view_item_height}`+'px');
|
|
@@ -1605,9 +1650,8 @@ dmx.Component('ag-grid', {
|
|
|
1605
1650
|
}
|
|
1606
1651
|
}
|
|
1607
1652
|
function updateHoveringBarStyles() {
|
|
1608
|
-
const existingStyle =
|
|
1653
|
+
const existingStyle = gridElement.querySelector('#hovering-bar-style');
|
|
1609
1654
|
if (options.fixed_horizontal_scroll) {
|
|
1610
|
-
// Create a new style element
|
|
1611
1655
|
const styleElement = document.createElement('style');
|
|
1612
1656
|
styleElement.id = 'hovering-bar-style';
|
|
1613
1657
|
const agRootWrapper = gridElement.querySelector('.ag-root-wrapper');
|
|
@@ -1624,7 +1668,7 @@ dmx.Component('ag-grid', {
|
|
|
1624
1668
|
if (existingStyle) {
|
|
1625
1669
|
existingStyle.parentNode.replaceChild(styleElement, existingStyle);
|
|
1626
1670
|
} else {
|
|
1627
|
-
|
|
1671
|
+
gridElement.appendChild(styleElement);
|
|
1628
1672
|
}
|
|
1629
1673
|
} else if (existingStyle) {
|
|
1630
1674
|
// Remove the style element if it exists
|
|
@@ -1729,6 +1773,8 @@ dmx.Component('ag-grid', {
|
|
|
1729
1773
|
row_clicked: Event,
|
|
1730
1774
|
row_double_clicked: Event,
|
|
1731
1775
|
cell_clicked: Event,
|
|
1776
|
+
cell_data_edited: Event,
|
|
1777
|
+
row_data_edited: Event,
|
|
1732
1778
|
row_checkbox_checked: Event,
|
|
1733
1779
|
row_checkbox_unchecked: Event,
|
|
1734
1780
|
row_status_enabled: Event,
|