@cdmx/wappler_ag_grid 1.2.5 → 1.2.7
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 +35 -27
- package/app_connect/components.hjson +72 -10
- package/dmx-ag-grid.js +21 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
The AG Grid module allows you to create a flexible and customizable data grid with various options and properties. Below, you'll find the list of properties and options available for configuring the AG Grid module:
|
|
5
5
|
|
|
6
|
+
**Important Changes in v1.2.5:**
|
|
7
|
+
With the update to AG Grid v31, a built-in page limit dropdown feature has been introduced. Consequently, when utilizing external page limit selectors, it is necessary to configure the page selector settings accordingly. The defaults are 20, 50, and 100. If you wish to use values other than these defaults, kindly utilize the Page Size Selectors settings to define your preferred selections.
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
## AG Grid Properties
|
|
7
11
|
|
|
8
12
|
1. **ID**: Unique ID for the grid. (Required)
|
|
@@ -12,8 +16,10 @@ The AG Grid module allows you to create a flexible and customizable data grid wi
|
|
|
12
16
|
- "Alpine" (Default)
|
|
13
17
|
- "Balham"
|
|
14
18
|
- "Material"
|
|
19
|
+
- "Quartz"
|
|
15
20
|
- "Custom"
|
|
16
|
-
5. **
|
|
21
|
+
5. **Dark Mode** (Default: false)
|
|
22
|
+
6. **Locale**: Select the locale for the grid. Currently supported locales: English (EN), Russian (RU) and Hebrew (HE). (Default: EN)
|
|
17
23
|
|
|
18
24
|
**Note for Custom Theme:**
|
|
19
25
|
When you select the "Custom" theme option, you have the flexibility to define your own unique styling for the ag-Grid components.
|
|
@@ -23,6 +29,7 @@ The overrides for the "Custom" theme can be applied in the ag-theme-custom.css f
|
|
|
23
29
|
|
|
24
30
|
To use the "Custom" theme, copy "ag-theme-custom.css" to public/css/ag-theme-custom.css and include it in your layout file.
|
|
25
31
|
|
|
32
|
+
|
|
26
33
|
## AG Grid Options
|
|
27
34
|
1. **Minimum Width**: The minimum width of the column. (Default: 150)
|
|
28
35
|
2. **Resizable**: Specifies if the column can be resized. (Default: true)
|
|
@@ -34,40 +41,41 @@ To use the "Custom" theme, copy "ag-theme-custom.css" to public/css/ag-theme-cus
|
|
|
34
41
|
8. **Column Hover Highlight**: Specifies column hover highlighting. (Default: true)
|
|
35
42
|
9. **Suppress Row Deselection**: Specifies if rows can be deselected. (Default: false)
|
|
36
43
|
10. **Pagination**: Enables pagination. (Default: true)
|
|
37
|
-
11. **Pagination
|
|
38
|
-
12. **
|
|
44
|
+
11. **Auto Pagination**: Enables automatic pagination. (Default: false)
|
|
45
|
+
12. **Page Size Selectors**: Allowed selectors for for page size. (Default: [20,50,100] ).
|
|
46
|
+
13. **Pagination Page Size**: Number of rows to show per page. (Default: 20)
|
|
47
|
+
14. **Row Selection**: Row Selection (single or multiple).
|
|
39
48
|
- "Single"
|
|
40
49
|
- "Multiple" (Default)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
15. **Timezone**: Timezone for Date Fields. Select the appropriate timezone from the dropdown list. (Default: Local)
|
|
51
|
+
16. **Date Format**: Date Format for displaying date values. (Default: "dd/MM/yyyy hh:mm A")
|
|
52
|
+
17. **Sticky Header and Horizontal Scrollbar**: Optionally specify the header offset and topbar class.
|
|
44
53
|
- Fixed Header: Enables sticky header. (Default: false)
|
|
45
54
|
- Header Offset: Specifies offset from the top of the viewport area (Optional). (Default: 100)
|
|
46
55
|
- Topbar Class: Specify class, e.g., "topbar", to measure the offset from (Optional). (Default: "topbar")
|
|
47
56
|
- Topbar Offset: Specify topbar offset (Default: 80)
|
|
48
57
|
- Fixed Horizontal Scroll: Enables Hovering horizontal scrollbar which stays at the bottom all the time. (Default: false)
|
|
49
58
|
- Fixed Horizontal Scroll Width: Fixed horizontal scroll width percentage. (Default: 80%)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
37. **Enable Row Status Toggle**: Enables row status toggle events. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
59
|
+
18. **Row Height**: Height of each row in pixels. (Default: 25)
|
|
60
|
+
19. **Header Height**: Height of the header row in pixels. (Default: 30)
|
|
61
|
+
20. **Wrap Header Text**: This will cause long headers to wrap. (Default: true)
|
|
62
|
+
21. **Auto Header Height**: The column header height is automatically set based on the content of the header cells. (Default: true)
|
|
63
|
+
23. **Wrap Text**: This will cause long texts to wrap in the cells. (Default: false)
|
|
64
|
+
24. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
|
|
65
|
+
25. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
|
|
66
|
+
26. **Suppress Movable Columns**: Disables moving columns. (Default: false)
|
|
67
|
+
27. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
|
|
68
|
+
28. **Animate Rows**: Enables row animation on data changes. (Default: false)
|
|
69
|
+
29. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
|
|
70
|
+
30. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
|
|
71
|
+
31. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
|
|
72
|
+
32. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
|
|
73
|
+
33. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
|
|
74
|
+
34. **Numeric Column Align**: Align numeric columns to the right. (Default: false)
|
|
75
|
+
35. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
|
|
76
|
+
36. **Row Double Click Events**: Enables row double click events. This can be used in Dynamic events => Grid Events => Row Double Clicked. (Default: false)
|
|
77
|
+
37. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
78
|
+
38. **Enable Row Status Toggle**: Enables row status toggle events. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
71
79
|
|
|
72
80
|
# Data Type Overrides
|
|
73
81
|
|
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
"title": "Data",
|
|
24
24
|
"type": "object"
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"name": "state",
|
|
28
|
+
"title": "state",
|
|
29
|
+
"type": "object",
|
|
30
|
+
sub: [
|
|
31
|
+
{name: "gridReady", type: "boolean"},
|
|
32
|
+
{name: "firstDataRendered", type: "boolean"},
|
|
33
|
+
{name: "rowDataUpdated", type: "boolean"}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
26
36
|
{
|
|
27
37
|
"name": "count",
|
|
28
38
|
"title": "Count",
|
|
@@ -96,7 +106,7 @@
|
|
|
96
106
|
"attribute": "dmx-bind:dark_mode",
|
|
97
107
|
"title": "Dark Mode",
|
|
98
108
|
"type": "boolean",
|
|
99
|
-
"defaultValue":
|
|
109
|
+
"defaultValue": false,
|
|
100
110
|
"help": "Enables dark mode"
|
|
101
111
|
},
|
|
102
112
|
{
|
|
@@ -197,6 +207,22 @@
|
|
|
197
207
|
"defaultValue": true,
|
|
198
208
|
"help": "Enables pagination"
|
|
199
209
|
},
|
|
210
|
+
{
|
|
211
|
+
"name": "paginationAutoPageSize",
|
|
212
|
+
"attribute": "pagination_auto_page_size",
|
|
213
|
+
"title": "Auto Pagination",
|
|
214
|
+
"type": "boolean",
|
|
215
|
+
"defaultValue": false,
|
|
216
|
+
"help": "Built-in pagination size as per page size."
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "paginationPageSizeSelector",
|
|
220
|
+
"attribute": "dmx-bind:pagination_page_size_selector",
|
|
221
|
+
"title": "Pagination Size Selectors",
|
|
222
|
+
"type": "text",
|
|
223
|
+
"defaultValue": "[20,50,100]",
|
|
224
|
+
"help": "Allowed selectors for for page size."
|
|
225
|
+
},
|
|
200
226
|
{
|
|
201
227
|
"name": "paginationPageSize",
|
|
202
228
|
"attribute": "pagination_page_size",
|
|
@@ -443,14 +469,6 @@
|
|
|
443
469
|
"defaultValue": false,
|
|
444
470
|
"help": "Hides the aggregation function in column headers"
|
|
445
471
|
},
|
|
446
|
-
{
|
|
447
|
-
"name": "suppressAggAtRootLevel",
|
|
448
|
-
"attribute": "dmx-bind:suppress_agg_at_root_level",
|
|
449
|
-
"title": "Suppress Aggregation at Root Level",
|
|
450
|
-
"type": "boolean",
|
|
451
|
-
"defaultValue": false,
|
|
452
|
-
"help": "Disables aggregation at the root level"
|
|
453
|
-
},
|
|
454
472
|
{
|
|
455
473
|
"name": "suppressClipboardPaste",
|
|
456
474
|
"attribute": "dmx-bind:suppress_clipboard_paste",
|
|
@@ -840,7 +858,8 @@
|
|
|
840
858
|
"display": "fieldset",
|
|
841
859
|
"show": [
|
|
842
860
|
"dataChanges",
|
|
843
|
-
"amountFields"
|
|
861
|
+
"amountFields",
|
|
862
|
+
"amountFieldsPrecision"
|
|
844
863
|
],
|
|
845
864
|
"noChangeOnHide": true,
|
|
846
865
|
"groupEnabler": true,
|
|
@@ -902,7 +921,17 @@
|
|
|
902
921
|
"attribute": "amount_fields",
|
|
903
922
|
"title": "Amount Fields",
|
|
904
923
|
"type": "text",
|
|
924
|
+
"initDisplay": "none",
|
|
925
|
+
"help": "Fields (numeric/float data fields) where you desire currency formatting to be applied."
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"name": "amountFieldsPrecision",
|
|
929
|
+
"attribute": "amount_field_precision",
|
|
930
|
+
"title": "Amount Field Precision",
|
|
931
|
+
"type": "number",
|
|
932
|
+
"defaultValue": 2,
|
|
905
933
|
"initDisplay": "none"
|
|
934
|
+
"help": "Setting precision digits after the decimal"
|
|
906
935
|
}
|
|
907
936
|
]
|
|
908
937
|
}
|
|
@@ -2595,6 +2624,39 @@
|
|
|
2595
2624
|
"allowedOn": {
|
|
2596
2625
|
"dmx-ag-grid": true
|
|
2597
2626
|
}
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
"name": "dmx-ag-grid-dark-mode",
|
|
2630
|
+
"attributeStartsWith": "dmx-bind",
|
|
2631
|
+
"attribute": "dark_mode",
|
|
2632
|
+
"title": "Dark Mode",
|
|
2633
|
+
"type": "boolean",
|
|
2634
|
+
"display": "fieldset",
|
|
2635
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
2636
|
+
"groupTitle": "Grid Config",
|
|
2637
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
2638
|
+
"defaultValue": false,
|
|
2639
|
+
"show": [
|
|
2640
|
+
"darkMode"
|
|
2641
|
+
],
|
|
2642
|
+
"noChangeOnHide": true,
|
|
2643
|
+
"groupEnabler": true,
|
|
2644
|
+
"children": [
|
|
2645
|
+
{
|
|
2646
|
+
"name": "darkMode",
|
|
2647
|
+
"attributeStartsWith": "dmx-bind",
|
|
2648
|
+
"attribute": "dark_mode",
|
|
2649
|
+
"isValue": true,
|
|
2650
|
+
"dataBindings": true,
|
|
2651
|
+
"title": "Dark Mode",
|
|
2652
|
+
"type": "text",
|
|
2653
|
+
"help": "Enables dark mode.",
|
|
2654
|
+
"initDisplay": "none"
|
|
2655
|
+
}
|
|
2656
|
+
],
|
|
2657
|
+
"allowedOn": {
|
|
2658
|
+
"dmx-ag-grid": true
|
|
2659
|
+
}
|
|
2598
2660
|
}
|
|
2599
2661
|
],
|
|
2600
2662
|
"events": [
|
package/dmx-ag-grid.js
CHANGED
|
@@ -38,6 +38,8 @@ dmx.Component('ag-grid', {
|
|
|
38
38
|
row_selection: { type: String, default: 'multiple' },
|
|
39
39
|
suppress_row_deselection: { type: Boolean, default: false },
|
|
40
40
|
pagination: { type: Boolean, default: true },
|
|
41
|
+
pagination_auto_page_size: { type: Boolean, default: false },
|
|
42
|
+
pagination_page_size_selector: { type: Array, default: [20,50,100] },
|
|
41
43
|
pagination_page_size: { type: Number, default: 20 },
|
|
42
44
|
row_height: { type: Number, default: null },
|
|
43
45
|
header_height: { type: Number, default: null },
|
|
@@ -60,6 +62,7 @@ dmx.Component('ag-grid', {
|
|
|
60
62
|
date_locale: { type: String, default: 'en-US' },
|
|
61
63
|
date_format: { type: String, default: 'dd/MM/yyyy hh:mm A' },
|
|
62
64
|
amount_fields: { type: String, default: null },
|
|
65
|
+
amount_field_precision: { type: Number, default: 2 },
|
|
63
66
|
min_width: { type: Number, default: 150 },
|
|
64
67
|
sortable: { type: Boolean, default: true },
|
|
65
68
|
resizable: { type: Boolean, default: true },
|
|
@@ -933,8 +936,8 @@ dmx.Component('ag-grid', {
|
|
|
933
936
|
valueFormatter = function (params) {
|
|
934
937
|
if (params.value != null) {
|
|
935
938
|
return Number(params.value).toLocaleString(options.date_locale, {
|
|
936
|
-
minimumFractionDigits:
|
|
937
|
-
maximumFractionDigits:
|
|
939
|
+
minimumFractionDigits: options.amount_field_precision,
|
|
940
|
+
maximumFractionDigits: options.amount_field_precision
|
|
938
941
|
});
|
|
939
942
|
}
|
|
940
943
|
return '-';
|
|
@@ -1255,7 +1258,9 @@ dmx.Component('ag-grid', {
|
|
|
1255
1258
|
rowSelection: this.props.row_selection,
|
|
1256
1259
|
suppressRowDeselection: this.props.suppress_row_deselection,
|
|
1257
1260
|
pagination: this.props.pagination,
|
|
1261
|
+
paginationAutoPageSize: this.props.pagination_auto_page_size,
|
|
1258
1262
|
paginationPageSize: this.props.pagination_page_size,
|
|
1263
|
+
paginationPageSizeSelector: options.pagination_page_size_selector,
|
|
1259
1264
|
rowHeight: this.props.row_height,
|
|
1260
1265
|
headerHeight: this.props.header_height,
|
|
1261
1266
|
suppressRowClickSelection: this.props.suppress_row_click_selection,
|
|
@@ -1264,12 +1269,20 @@ dmx.Component('ag-grid', {
|
|
|
1264
1269
|
enableCellExpressions: this.props.enable_cell_expressions,
|
|
1265
1270
|
animateRows: this.props.animate_rows,
|
|
1266
1271
|
suppressAggFuncInHeader: this.props.suppress_agg_func_in_header,
|
|
1267
|
-
suppressAggAtRootLevel: this.props.suppress_agg_at_root_level,
|
|
1268
1272
|
suppressClipboardPaste: this.props.suppress_clipboard_paste,
|
|
1269
1273
|
suppressScrollOnNewData: this.props.suppress_scroll_on_new_data,
|
|
1270
1274
|
suppressPropertyNamesCheck: this.props.suppress_property_names_check,
|
|
1271
1275
|
suppressRowDeselection: this.props.suppress_row_deselection,
|
|
1272
1276
|
columnHoverHighlight: this.props.column_hover_highlight,
|
|
1277
|
+
onGridReady: () => {
|
|
1278
|
+
this.set("state", { gridReady: true });
|
|
1279
|
+
},
|
|
1280
|
+
onFirstDataRendered: () => {
|
|
1281
|
+
this.set("state", { firstDataRendered: true });
|
|
1282
|
+
},
|
|
1283
|
+
onRowDataUpdated: (event) => {
|
|
1284
|
+
this.set("state", { rowDataUpdated: true });
|
|
1285
|
+
},
|
|
1273
1286
|
onGridSizeChanged: function(params) {
|
|
1274
1287
|
// This function is called whenever the grid's size changes
|
|
1275
1288
|
adjustHeaderWidth();
|
|
@@ -1401,7 +1414,7 @@ dmx.Component('ag-grid', {
|
|
|
1401
1414
|
};
|
|
1402
1415
|
}
|
|
1403
1416
|
// Create ag-Grid instance
|
|
1404
|
-
gridInstance =
|
|
1417
|
+
gridInstance = agGrid.createGrid(gridDiv, gridConfig);
|
|
1405
1418
|
|
|
1406
1419
|
if (options.cfilters && options.cfilters.length > 0) {
|
|
1407
1420
|
var filterModel = {};
|
|
@@ -1659,5 +1672,9 @@ dmx.Component('ag-grid', {
|
|
|
1659
1672
|
let gridInstance = this.refreshGrid();
|
|
1660
1673
|
this.set('gridInstance', gridInstance);
|
|
1661
1674
|
}
|
|
1675
|
+
if (!dmx.equal(this.props.dark_mode, props.dark_mode)) {
|
|
1676
|
+
let gridInstance = this.refreshGrid();
|
|
1677
|
+
this.set('gridInstance', gridInstance);
|
|
1678
|
+
}
|
|
1662
1679
|
},
|
|
1663
1680
|
});
|