@cdmx/wappler_ag_grid 1.8.12 → 1.8.14
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/dmx-ag-grid.js +56 -6
- package/package.json +1 -1
package/dmx-ag-grid.js
CHANGED
|
@@ -863,15 +863,29 @@ dmx.Component('ag-grid', {
|
|
|
863
863
|
}
|
|
864
864
|
// comparator for case-insensitive sorting
|
|
865
865
|
const caseInsensitiveComparator = (valueA, valueB) => {
|
|
866
|
-
|
|
867
|
-
|
|
866
|
+
// Check for null, undefined, or empty strings
|
|
867
|
+
if (valueA === null || valueA === undefined || valueA === '') {
|
|
868
|
+
return valueB === null || valueB === undefined || valueB === '' ? 0 : -1;
|
|
868
869
|
}
|
|
869
|
-
|
|
870
|
-
if (valueB === null || valueB === undefined || valueB === ''
|
|
870
|
+
|
|
871
|
+
if (valueB === null || valueB === undefined || valueB === '') {
|
|
871
872
|
return 1;
|
|
872
873
|
}
|
|
873
|
-
|
|
874
|
-
|
|
874
|
+
|
|
875
|
+
// Convert values to numbers if they are numeric
|
|
876
|
+
const numA = Number(valueA);
|
|
877
|
+
const numB = Number(valueB);
|
|
878
|
+
|
|
879
|
+
// If both values are numbers
|
|
880
|
+
if (!isNaN(numA) && !isNaN(numB)) {
|
|
881
|
+
return numA - numB;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
// Convert non-number values to strings for case-insensitive comparison
|
|
885
|
+
const strA = typeof valueA === 'string' ? valueA : String(valueA);
|
|
886
|
+
const strB = typeof valueB === 'string' ? valueB : String(valueB);
|
|
887
|
+
|
|
888
|
+
return strA.toLowerCase().localeCompare(strB.toLowerCase());
|
|
875
889
|
};
|
|
876
890
|
//Custom Row Styles
|
|
877
891
|
function createRowStyleFunction(rstyles) {
|
|
@@ -2226,6 +2240,42 @@ dmx.Component('ag-grid', {
|
|
|
2226
2240
|
gridContainer.parentNode.insertBefore(exportPdfButton, gridContainer);
|
|
2227
2241
|
exportPdfButton.style.marginBottom = '10px';
|
|
2228
2242
|
}
|
|
2243
|
+
const paginationPanelCss = `
|
|
2244
|
+
/* Flexbox layout for pagination panel */
|
|
2245
|
+
.ag-paging-panel {
|
|
2246
|
+
display: flex;
|
|
2247
|
+
flex-wrap: wrap;
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
/* Adjust layout for tablets and smaller devices */
|
|
2251
|
+
@media (max-width: 768px) {
|
|
2252
|
+
.ag-paging-panel {
|
|
2253
|
+
height: 100px !important;
|
|
2254
|
+
}
|
|
2255
|
+
.ag-paging-page-size {
|
|
2256
|
+
width: 60%; /* Ensure it takes up 60% width */
|
|
2257
|
+
display: flex;
|
|
2258
|
+
align-items: center;
|
|
2259
|
+
order: 2; /* Force it to be positioned after the summary panel */
|
|
2260
|
+
margin-top: 20px;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
/* Ensure to/from, next/previous are visible */
|
|
2264
|
+
.ag-paging-row-summary-panel,
|
|
2265
|
+
.ag-paging-page-summary-panel {
|
|
2266
|
+
display: inline-block;
|
|
2267
|
+
width: 100%; /* Ensure it takes full width */
|
|
2268
|
+
flex-wrap: wrap;
|
|
2269
|
+
justify-content: space-between;
|
|
2270
|
+
text-align: center;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
`;
|
|
2274
|
+
|
|
2275
|
+
const paginationPanelStyle = document.createElement('style');
|
|
2276
|
+
paginationPanelStyle.innerHTML = paginationPanelCss;
|
|
2277
|
+
document.appendChild(paginationPanelStyle);
|
|
2278
|
+
|
|
2229
2279
|
// Return grid instance
|
|
2230
2280
|
return gridInstance;
|
|
2231
2281
|
|