@cdmx/wappler_ag_grid 1.2.4 → 1.2.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 -27
- package/app_connect/components.hjson +76 -8
- package/dmx-ag-grid.js +27 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,7 +13,8 @@ The AG Grid module allows you to create a flexible and customizable data grid wi
|
|
|
13
13
|
- "Balham"
|
|
14
14
|
- "Material"
|
|
15
15
|
- "Custom"
|
|
16
|
-
5. **
|
|
16
|
+
5. **Dark Mode** (Default: false)
|
|
17
|
+
6. **Locale**: Select the locale for the grid. Currently supported locales: English (EN), Russian (RU) and Hebrew (HE). (Default: EN)
|
|
17
18
|
|
|
18
19
|
**Note for Custom Theme:**
|
|
19
20
|
When you select the "Custom" theme option, you have the flexibility to define your own unique styling for the ag-Grid components.
|
|
@@ -34,40 +35,41 @@ To use the "Custom" theme, copy "ag-theme-custom.css" to public/css/ag-theme-cus
|
|
|
34
35
|
8. **Column Hover Highlight**: Specifies column hover highlighting. (Default: true)
|
|
35
36
|
9. **Suppress Row Deselection**: Specifies if rows can be deselected. (Default: false)
|
|
36
37
|
10. **Pagination**: Enables pagination. (Default: true)
|
|
37
|
-
11. **Pagination
|
|
38
|
-
12. **
|
|
38
|
+
11. **Auto Pagination**: Enables automatic pagination. (Default: false)
|
|
39
|
+
12. **Pagination Size Selectors**: Allowed selectors for for page size. (Default: [20,50,100] ).
|
|
40
|
+
13. **Pagination Page Size**: Number of rows to show per page. (Default: 20)
|
|
41
|
+
14. **Row Selection**: Row Selection (single or multiple).
|
|
39
42
|
- "Single"
|
|
40
43
|
- "Multiple" (Default)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
15. **Timezone**: Timezone for Date Fields. Select the appropriate timezone from the dropdown list. (Default: Local)
|
|
45
|
+
16. **Date Format**: Date Format for displaying date values. (Default: "dd/MM/yyyy hh:mm A")
|
|
46
|
+
17. **Sticky Header and Horizontal Scrollbar**: Optionally specify the header offset and topbar class.
|
|
44
47
|
- Fixed Header: Enables sticky header. (Default: false)
|
|
45
48
|
- Header Offset: Specifies offset from the top of the viewport area (Optional). (Default: 100)
|
|
46
49
|
- Topbar Class: Specify class, e.g., "topbar", to measure the offset from (Optional). (Default: "topbar")
|
|
47
50
|
- Topbar Offset: Specify topbar offset (Default: 80)
|
|
48
51
|
- Fixed Horizontal Scroll: Enables Hovering horizontal scrollbar which stays at the bottom all the time. (Default: false)
|
|
49
52
|
- 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)
|
|
53
|
+
18. **Row Height**: Height of each row in pixels. (Default: 25)
|
|
54
|
+
19. **Header Height**: Height of the header row in pixels. (Default: 30)
|
|
55
|
+
20. **Wrap Header Text**: This will cause long headers to wrap. (Default: true)
|
|
56
|
+
21. **Auto Header Height**: The column header height is automatically set based on the content of the header cells. (Default: true)
|
|
57
|
+
23. **Wrap Text**: This will cause long texts to wrap in the cells. (Default: false)
|
|
58
|
+
24. **Suppress Row Click Selection**: Disables row selection on row click. (Default: false)
|
|
59
|
+
25. **Suppress Menu Hide**: Prevents hiding the column menu. (Default: false)
|
|
60
|
+
26. **Suppress Movable Columns**: Disables moving columns. (Default: false)
|
|
61
|
+
27. **Enable Cell Expressions**: Enables expressions in cell values. (Default: false)
|
|
62
|
+
28. **Animate Rows**: Enables row animation on data changes. (Default: false)
|
|
63
|
+
29. **Suppress Aggregation Function in Header**: Hides the aggregation function in column headers. (Default: false)
|
|
64
|
+
30. **Suppress Clipboard Paste**: Disables pasting data from the clipboard. (Default: false)
|
|
65
|
+
31. **Suppress Scroll on New Data**: Prevents scrolling to newly added data. (Default: false)
|
|
66
|
+
32. **Suppress Property Names Check**: Disables checking for duplicate property names. (Default: false)
|
|
67
|
+
33. **Hide ID Field**: Hides the ID Field in the Grid. (Default: false)
|
|
68
|
+
34. **Numeric Column Align**: Align numeric columns to the right. (Default: false)
|
|
69
|
+
35. **Row Click Events**: Enables row click events. This can be used in Dynamic events => Grid Events => Row Clicked. (Default: false)
|
|
70
|
+
36. **Row Double Click Events**: Enables row double click events. This can be used in Dynamic events => Grid Events => Row Double Clicked. (Default: false)
|
|
71
|
+
37. **Enable Row Selection**: Enables row selection. This can be used in Dynamic events => Grid Events => Checkbox Checked || Checkbox Unchecked. (Default: false)
|
|
72
|
+
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
73
|
|
|
72
74
|
# Data Type Overrides
|
|
73
75
|
|
|
@@ -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",
|
|
@@ -85,11 +95,20 @@
|
|
|
85
95
|
{title: 'Alpine', value: 'ag-theme-alpine'},
|
|
86
96
|
{title: 'Balham', value: 'ag-theme-balham'},
|
|
87
97
|
{title: 'Material', value: 'ag-theme-material'},
|
|
98
|
+
{title: 'Quartz', value: 'ag-theme-quartz'},
|
|
88
99
|
{title: 'Custom', value: 'ag-theme-alpine ag-theme-custom'},
|
|
89
100
|
{title: 'Base', value: 'ag-grid'}
|
|
90
101
|
],
|
|
91
102
|
"help": "Select a theme for the grid"
|
|
92
103
|
},
|
|
104
|
+
{
|
|
105
|
+
"name": "dark_mode",
|
|
106
|
+
"attribute": "dmx-bind:dark_mode",
|
|
107
|
+
"title": "Dark Mode",
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"defaultValue": false,
|
|
110
|
+
"help": "Enables dark mode"
|
|
111
|
+
},
|
|
93
112
|
{
|
|
94
113
|
"name": "locale_text",
|
|
95
114
|
"attribute": "locale_text",
|
|
@@ -188,6 +207,22 @@
|
|
|
188
207
|
"defaultValue": true,
|
|
189
208
|
"help": "Enables pagination"
|
|
190
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
|
+
},
|
|
191
226
|
{
|
|
192
227
|
"name": "paginationPageSize",
|
|
193
228
|
"attribute": "pagination_page_size",
|
|
@@ -434,14 +469,6 @@
|
|
|
434
469
|
"defaultValue": false,
|
|
435
470
|
"help": "Hides the aggregation function in column headers"
|
|
436
471
|
},
|
|
437
|
-
{
|
|
438
|
-
"name": "suppressAggAtRootLevel",
|
|
439
|
-
"attribute": "dmx-bind:suppress_agg_at_root_level",
|
|
440
|
-
"title": "Suppress Aggregation at Root Level",
|
|
441
|
-
"type": "boolean",
|
|
442
|
-
"defaultValue": false,
|
|
443
|
-
"help": "Disables aggregation at the root level"
|
|
444
|
-
},
|
|
445
472
|
{
|
|
446
473
|
"name": "suppressClipboardPaste",
|
|
447
474
|
"attribute": "dmx-bind:suppress_clipboard_paste",
|
|
@@ -2264,6 +2291,10 @@
|
|
|
2264
2291
|
"src": "../../../node_modules/ag-grid-community/styles/ag-theme-material.css",
|
|
2265
2292
|
"dst": "css/ag-theme-material.css"
|
|
2266
2293
|
},
|
|
2294
|
+
{
|
|
2295
|
+
"src": "../../../node_modules/ag-grid-community/styles/ag-theme-quartz.css",
|
|
2296
|
+
"dst": "css/ag-theme-quartz.css"
|
|
2297
|
+
},
|
|
2267
2298
|
{
|
|
2268
2299
|
"src": "../../../node_modules/moment/min/moment.min.js",
|
|
2269
2300
|
"dst": "js/moment.min.js"
|
|
@@ -2333,6 +2364,10 @@
|
|
|
2333
2364
|
"src": "css/ag-theme-material.css",
|
|
2334
2365
|
"type": "css"
|
|
2335
2366
|
},
|
|
2367
|
+
{
|
|
2368
|
+
"src": "css/ag-theme-quartz.css",
|
|
2369
|
+
"type": "css"
|
|
2370
|
+
},
|
|
2336
2371
|
{
|
|
2337
2372
|
"src": "css/switch-toggle-slider.css",
|
|
2338
2373
|
"type": "css"
|
|
@@ -2578,6 +2613,39 @@
|
|
|
2578
2613
|
"allowedOn": {
|
|
2579
2614
|
"dmx-ag-grid": true
|
|
2580
2615
|
}
|
|
2616
|
+
},
|
|
2617
|
+
{
|
|
2618
|
+
"name": "dmx-ag-grid-dark-mode",
|
|
2619
|
+
"attributeStartsWith": "dmx-bind",
|
|
2620
|
+
"attribute": "dark_mode",
|
|
2621
|
+
"title": "Dark Mode",
|
|
2622
|
+
"type": "boolean",
|
|
2623
|
+
"display": "fieldset",
|
|
2624
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
2625
|
+
"groupTitle": "Grid Config",
|
|
2626
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
2627
|
+
"defaultValue": false,
|
|
2628
|
+
"show": [
|
|
2629
|
+
"darkMode"
|
|
2630
|
+
],
|
|
2631
|
+
"noChangeOnHide": true,
|
|
2632
|
+
"groupEnabler": true,
|
|
2633
|
+
"children": [
|
|
2634
|
+
{
|
|
2635
|
+
"name": "darkMode",
|
|
2636
|
+
"attributeStartsWith": "dmx-bind",
|
|
2637
|
+
"attribute": "dark_mode",
|
|
2638
|
+
"isValue": true,
|
|
2639
|
+
"dataBindings": true,
|
|
2640
|
+
"title": "Dark Mode",
|
|
2641
|
+
"type": "text",
|
|
2642
|
+
"help": "Enables dark mode.",
|
|
2643
|
+
"initDisplay": "none"
|
|
2644
|
+
}
|
|
2645
|
+
],
|
|
2646
|
+
"allowedOn": {
|
|
2647
|
+
"dmx-ag-grid": true
|
|
2648
|
+
}
|
|
2581
2649
|
}
|
|
2582
2650
|
],
|
|
2583
2651
|
"events": [
|
package/dmx-ag-grid.js
CHANGED
|
@@ -5,13 +5,19 @@ dmx.Component('ag-grid', {
|
|
|
5
5
|
count: Number,
|
|
6
6
|
fields: {},
|
|
7
7
|
fileData: [],
|
|
8
|
-
selectedRows: []
|
|
8
|
+
selectedRows: [],
|
|
9
|
+
state: {
|
|
10
|
+
gridReady: !1,
|
|
11
|
+
firstDataRendered: !1,
|
|
12
|
+
rowDataUpdated: !1
|
|
13
|
+
}
|
|
9
14
|
},
|
|
10
15
|
|
|
11
16
|
attributes: {
|
|
12
17
|
id: { default: null },
|
|
13
18
|
noload: { type: Boolean, default: false },
|
|
14
19
|
grid_theme: { type: String, default: 'ag-theme-alpine' },
|
|
20
|
+
dark_mode: { type: Boolean, default: false},
|
|
15
21
|
column_defs: { type: Array, default: [] },
|
|
16
22
|
tooltip_config: { type: Array, default: [] },
|
|
17
23
|
custom_tooltip: { type: String, default: null },
|
|
@@ -32,6 +38,8 @@ dmx.Component('ag-grid', {
|
|
|
32
38
|
row_selection: { type: String, default: 'multiple' },
|
|
33
39
|
suppress_row_deselection: { type: Boolean, default: false },
|
|
34
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] },
|
|
35
43
|
pagination_page_size: { type: Number, default: 20 },
|
|
36
44
|
row_height: { type: Number, default: null },
|
|
37
45
|
header_height: { type: Number, default: null },
|
|
@@ -359,7 +367,8 @@ dmx.Component('ag-grid', {
|
|
|
359
367
|
let exportToCSV = this.props.export_to_csv;
|
|
360
368
|
let gridInstance = null;
|
|
361
369
|
let cellRenderer;
|
|
362
|
-
|
|
370
|
+
const gridThemeClass = options.dark_mode ? `${options.grid_theme}-dark` : options.grid_theme;
|
|
371
|
+
this.$node.innerHTML = `<div id=${options.id}-grid class="${gridThemeClass}"></div>`;
|
|
363
372
|
if (!rowData || rowData.length === 0) {
|
|
364
373
|
console.error('No row data provided.');
|
|
365
374
|
return;
|
|
@@ -1248,7 +1257,9 @@ dmx.Component('ag-grid', {
|
|
|
1248
1257
|
rowSelection: this.props.row_selection,
|
|
1249
1258
|
suppressRowDeselection: this.props.suppress_row_deselection,
|
|
1250
1259
|
pagination: this.props.pagination,
|
|
1260
|
+
paginationAutoPageSize: this.props.pagination_auto_page_size,
|
|
1251
1261
|
paginationPageSize: this.props.pagination_page_size,
|
|
1262
|
+
paginationPageSizeSelector: options.pagination_page_size_selector,
|
|
1252
1263
|
rowHeight: this.props.row_height,
|
|
1253
1264
|
headerHeight: this.props.header_height,
|
|
1254
1265
|
suppressRowClickSelection: this.props.suppress_row_click_selection,
|
|
@@ -1257,12 +1268,20 @@ dmx.Component('ag-grid', {
|
|
|
1257
1268
|
enableCellExpressions: this.props.enable_cell_expressions,
|
|
1258
1269
|
animateRows: this.props.animate_rows,
|
|
1259
1270
|
suppressAggFuncInHeader: this.props.suppress_agg_func_in_header,
|
|
1260
|
-
suppressAggAtRootLevel: this.props.suppress_agg_at_root_level,
|
|
1261
1271
|
suppressClipboardPaste: this.props.suppress_clipboard_paste,
|
|
1262
1272
|
suppressScrollOnNewData: this.props.suppress_scroll_on_new_data,
|
|
1263
1273
|
suppressPropertyNamesCheck: this.props.suppress_property_names_check,
|
|
1264
1274
|
suppressRowDeselection: this.props.suppress_row_deselection,
|
|
1265
1275
|
columnHoverHighlight: this.props.column_hover_highlight,
|
|
1276
|
+
onGridReady: () => {
|
|
1277
|
+
this.set("state", { gridReady: true });
|
|
1278
|
+
},
|
|
1279
|
+
onFirstDataRendered: () => {
|
|
1280
|
+
this.set("state", { firstDataRendered: true });
|
|
1281
|
+
},
|
|
1282
|
+
onRowDataUpdated: (event) => {
|
|
1283
|
+
this.set("state", { rowDataUpdated: true });
|
|
1284
|
+
},
|
|
1266
1285
|
onGridSizeChanged: function(params) {
|
|
1267
1286
|
// This function is called whenever the grid's size changes
|
|
1268
1287
|
adjustHeaderWidth();
|
|
@@ -1394,7 +1413,7 @@ dmx.Component('ag-grid', {
|
|
|
1394
1413
|
};
|
|
1395
1414
|
}
|
|
1396
1415
|
// Create ag-Grid instance
|
|
1397
|
-
gridInstance =
|
|
1416
|
+
gridInstance = agGrid.createGrid(gridDiv, gridConfig);
|
|
1398
1417
|
|
|
1399
1418
|
if (options.cfilters && options.cfilters.length > 0) {
|
|
1400
1419
|
var filterModel = {};
|
|
@@ -1652,5 +1671,9 @@ dmx.Component('ag-grid', {
|
|
|
1652
1671
|
let gridInstance = this.refreshGrid();
|
|
1653
1672
|
this.set('gridInstance', gridInstance);
|
|
1654
1673
|
}
|
|
1674
|
+
if (!dmx.equal(this.props.dark_mode, props.dark_mode)) {
|
|
1675
|
+
let gridInstance = this.refreshGrid();
|
|
1676
|
+
this.set('gridInstance', gridInstance);
|
|
1677
|
+
}
|
|
1655
1678
|
},
|
|
1656
1679
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdmx/wappler_ag_grid",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "App Connect module for AG Grid Table Generation.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"ag-grid"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"ag-grid-community": "
|
|
17
|
+
"ag-grid-community": "31.0.x",
|
|
18
18
|
"exceljs": "4.3.x",
|
|
19
19
|
"moment": "2.29.x",
|
|
20
20
|
"papaparse": "5.4.x"
|