@cdmx/wappler_ag_grid 0.9.3 → 0.9.5
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 +4 -0
- package/app_connect/components.hjson +56 -2
- package/dmx-ag-grid.js +20 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -341,6 +341,10 @@ Specify the tooltip text for Button 10.
|
|
|
341
341
|
- This action enables you to reset the grid's column state to default state.
|
|
342
342
|
- It is useful when you want to revert the column configuration to a default configuration.
|
|
343
343
|
|
|
344
|
+
**Pin Columns to Left**
|
|
345
|
+
- This action allows you to pin one or more columns to the left side of the grid.
|
|
346
|
+
- It is useful when you want to freeze specific columns in place for easy reference, even as you scroll horizontally.
|
|
347
|
+
|
|
344
348
|
**Import File Data**
|
|
345
349
|
- The "Import File Data" action allows to import data from CSV and XLSX files into the AG Grid. This action simplifies the process of populating the grid with external data sources.
|
|
346
350
|
- Key Features:
|
|
@@ -1851,9 +1851,29 @@
|
|
|
1851
1851
|
name: 'resetColumnState',
|
|
1852
1852
|
icon: 'fa fa-lg fa-undo',
|
|
1853
1853
|
state: 'opened',
|
|
1854
|
-
help: '
|
|
1854
|
+
help: 'Reset Column State stored in Browser Local Storage',
|
|
1855
1855
|
properties: []
|
|
1856
1856
|
},
|
|
1857
|
+
{
|
|
1858
|
+
addTitle: 'pinColumnsState',
|
|
1859
|
+
title: 'Pin Columns',
|
|
1860
|
+
name: 'pinColumns',
|
|
1861
|
+
icon: 'fa fa-lg fa-thumbtack',
|
|
1862
|
+
state: 'opened',
|
|
1863
|
+
help: 'Pin Columns to Left',
|
|
1864
|
+
properties: [
|
|
1865
|
+
{
|
|
1866
|
+
group: 'Properties',
|
|
1867
|
+
variables: [
|
|
1868
|
+
{
|
|
1869
|
+
name: '1', optionName: '1', title: 'Column Name', type: 'text',
|
|
1870
|
+
dataBindings: true, defaultValue: '', required: true,
|
|
1871
|
+
help: 'Column Name to Pin to the Left'
|
|
1872
|
+
}
|
|
1873
|
+
]
|
|
1874
|
+
}
|
|
1875
|
+
]
|
|
1876
|
+
},
|
|
1857
1877
|
{
|
|
1858
1878
|
addTitle: 'importFileData',
|
|
1859
1879
|
title: 'Import File Data',
|
|
@@ -2037,7 +2057,7 @@
|
|
|
2037
2057
|
"attribute": "pagination_page_size",
|
|
2038
2058
|
"isValue": true,
|
|
2039
2059
|
"dataBindings": true,
|
|
2040
|
-
"title": "Pagination Page Size
|
|
2060
|
+
"title": "Pagination Page Size",
|
|
2041
2061
|
"type": "text",
|
|
2042
2062
|
"help": "Pagination Page Size.",
|
|
2043
2063
|
"defaultValue": "",
|
|
@@ -2048,6 +2068,40 @@
|
|
|
2048
2068
|
"dmx-ag-grid": true
|
|
2049
2069
|
}
|
|
2050
2070
|
},
|
|
2071
|
+
{
|
|
2072
|
+
"name": "dmx-ag-grid-floating-filter",
|
|
2073
|
+
"attributeStartsWith": "dmx-bind",
|
|
2074
|
+
"attribute": "floating_filter",
|
|
2075
|
+
"title": "Floating Filter",
|
|
2076
|
+
"type": "boolean",
|
|
2077
|
+
"display": "fieldset",
|
|
2078
|
+
"icon": "fa fa-lg fa-chevron-right",
|
|
2079
|
+
"groupTitle": "Grid Config",
|
|
2080
|
+
"groupIcon": "fa fa-lg fa-cubes",
|
|
2081
|
+
"defaultValue": false,
|
|
2082
|
+
"show": [
|
|
2083
|
+
"floatingFilters"
|
|
2084
|
+
],
|
|
2085
|
+
"noChangeOnHide": true,
|
|
2086
|
+
"groupEnabler": true,
|
|
2087
|
+
"children": [
|
|
2088
|
+
{
|
|
2089
|
+
"name": "floatingFilters",
|
|
2090
|
+
"attributeStartsWith": "dmx-bind",
|
|
2091
|
+
"attribute": "floating_filter",
|
|
2092
|
+
"isValue": true,
|
|
2093
|
+
"dataBindings": true,
|
|
2094
|
+
"title": "Floating Filter",
|
|
2095
|
+
"type": "text",
|
|
2096
|
+
"help": "Show/Hide FLoating Filters",
|
|
2097
|
+
"defaultValue": "",
|
|
2098
|
+
"initDisplay": "none"
|
|
2099
|
+
}
|
|
2100
|
+
],
|
|
2101
|
+
"allowedOn": {
|
|
2102
|
+
"dmx-ag-grid": true
|
|
2103
|
+
}
|
|
2104
|
+
},
|
|
2051
2105
|
{
|
|
2052
2106
|
"name": "dmx-ag-grid-locale",
|
|
2053
2107
|
"attributeStartsWith": "dmx-bind",
|
package/dmx-ag-grid.js
CHANGED
|
@@ -193,6 +193,9 @@ dmx.Component('ag-grid', {
|
|
|
193
193
|
this.set('gridInstance', gridInstance);
|
|
194
194
|
}, this);
|
|
195
195
|
},
|
|
196
|
+
pinColumns: function (fieldId) {
|
|
197
|
+
pinColumnToLeft(fieldId);
|
|
198
|
+
},
|
|
196
199
|
importFileData: async function (fieldId) {
|
|
197
200
|
await this.parseFileData(fieldId);
|
|
198
201
|
},
|
|
@@ -1078,11 +1081,11 @@ dmx.Component('ag-grid', {
|
|
|
1078
1081
|
rowStyle: enableRowClickEvent || enableCellClickEvent ? { cursor: 'pointer' } : undefined,
|
|
1079
1082
|
defaultColDef: {
|
|
1080
1083
|
flex: 1,
|
|
1081
|
-
minWidth:
|
|
1082
|
-
resizable:
|
|
1083
|
-
filter:
|
|
1084
|
-
sortable:
|
|
1085
|
-
floatingFilter:
|
|
1084
|
+
minWidth: options.min_width,
|
|
1085
|
+
resizable: options.resizable,
|
|
1086
|
+
filter: options.filter,
|
|
1087
|
+
sortable: options.sortable,
|
|
1088
|
+
floatingFilter: options.floating_filter
|
|
1086
1089
|
},
|
|
1087
1090
|
domLayout: this.props.dom_layout,
|
|
1088
1091
|
enableCellTextSelection: true,
|
|
@@ -1177,6 +1180,16 @@ dmx.Component('ag-grid', {
|
|
|
1177
1180
|
const gridConfig = {
|
|
1178
1181
|
onGridReady: function (params) {
|
|
1179
1182
|
const columnApi = params.columnApi;
|
|
1183
|
+
pinColumnToLeft = (fieldToPin) => {
|
|
1184
|
+
const columnState = columnApi.getColumnState();
|
|
1185
|
+
const columnIndex = columnState.findIndex(column => column.colId === fieldToPin);
|
|
1186
|
+
if (columnIndex !== -1) {
|
|
1187
|
+
for (let i = 0; i <= columnIndex; i++) {
|
|
1188
|
+
columnState[i].pinned = 'left';
|
|
1189
|
+
}
|
|
1190
|
+
columnApi.applyColumnState({ state: columnState });
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1180
1193
|
saveColumnStateToStorage = () => {
|
|
1181
1194
|
const columnState = columnApi.getColumnState();
|
|
1182
1195
|
const pageId = getPageId();
|
|
@@ -1248,7 +1261,7 @@ dmx.Component('ag-grid', {
|
|
|
1248
1261
|
const topbar = document.querySelector('.' + options.topbar_class);
|
|
1249
1262
|
const topbarHeight = (topbar ? topbar.getBoundingClientRect().height : 0) + options.fixed_top_offset;
|
|
1250
1263
|
const headerPos = (topbar ? topbar.getBoundingClientRect().bottom : 0) + options.fixed_header_offset;
|
|
1251
|
-
if (window.
|
|
1264
|
+
if (window.scrollY > headerPos) {
|
|
1252
1265
|
header.style.position = 'fixed';
|
|
1253
1266
|
header.style.top = `${topbarHeight}px`;
|
|
1254
1267
|
header.style.zIndex = '1';
|
|
@@ -1349,23 +1362,19 @@ dmx.Component('ag-grid', {
|
|
|
1349
1362
|
// Create the export button
|
|
1350
1363
|
if (exportToCSV) {
|
|
1351
1364
|
const existingExportButton = document.getElementById('exportButton');
|
|
1352
|
-
// If it already exists, just exit the function
|
|
1353
1365
|
if (existingExportButton) {
|
|
1354
1366
|
return;
|
|
1355
1367
|
}
|
|
1356
1368
|
const exportButton = document.createElement('button');
|
|
1357
1369
|
exportButton.id = 'exportButton';
|
|
1358
|
-
|
|
1359
|
-
// Add the icon
|
|
1360
1370
|
const icon = document.createElement('i');
|
|
1361
|
-
icon.classList.add('fas', 'fa-file-csv');
|
|
1371
|
+
icon.classList.add('fas', 'fa-file-csv');
|
|
1362
1372
|
exportButton.appendChild(icon);
|
|
1363
1373
|
|
|
1364
1374
|
// Add the button text
|
|
1365
1375
|
const buttonText = document.createElement('span');
|
|
1366
1376
|
buttonText.innerText = ' Export to CSV';
|
|
1367
1377
|
exportButton.appendChild(buttonText);
|
|
1368
|
-
// Add some fancy styles to the button
|
|
1369
1378
|
exportButton.style.backgroundColor = '#4CAF50';
|
|
1370
1379
|
exportButton.style.border = 'none';
|
|
1371
1380
|
exportButton.style.color = 'white';
|