ms-data-grid 0.0.124 → 0.0.126
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.
|
@@ -1827,6 +1827,7 @@ class DataGridComponent {
|
|
|
1827
1827
|
el.style.transform = `translateX(${deltaX}px)`;
|
|
1828
1828
|
// Force reflow
|
|
1829
1829
|
void el.offsetWidth;
|
|
1830
|
+
this.cdr.detectChanges();
|
|
1830
1831
|
el.style.transition = 'transform 250ms cubic-bezier(0.4, 0, 0.2, 1)';
|
|
1831
1832
|
el.style.transform = 'translateX(0)';
|
|
1832
1833
|
const handle = () => {
|
|
@@ -1906,31 +1907,30 @@ class DataGridComponent {
|
|
|
1906
1907
|
// await this.refreshPreviewColumns();
|
|
1907
1908
|
this.cdr.detectChanges();
|
|
1908
1909
|
await firstValueFrom(this.ngZone.onStable);
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
// });
|
|
1910
|
+
allFields.forEach((field) => {
|
|
1911
|
+
const updatedCells = Array.from(document.querySelectorAll(`[field="${field}"]`));
|
|
1912
|
+
updatedCells.forEach((el) => {
|
|
1913
|
+
const newLeft = el.getBoundingClientRect().left;
|
|
1914
|
+
const oldLeft = firstPositions.get(el);
|
|
1915
|
+
const deltaX = oldLeft - newLeft;
|
|
1916
|
+
if (deltaX !== 0) {
|
|
1917
|
+
el.style.willChange = 'transform';
|
|
1918
|
+
el.style.transition = 'none';
|
|
1919
|
+
el.style.transform = `translateX(${deltaX}px)`;
|
|
1920
|
+
void el.offsetWidth;
|
|
1921
|
+
this.cdr.detectChanges();
|
|
1922
|
+
el.style.transition = 'transform 400ms cubic-bezier(0.4, 0, 0.2, 1)';
|
|
1923
|
+
el.style.transform = 'translateX(0)';
|
|
1924
|
+
const handle = () => {
|
|
1925
|
+
el.style.transition = '';
|
|
1926
|
+
el.style.transform = '';
|
|
1927
|
+
el.style.willChange = '';
|
|
1928
|
+
el.removeEventListener('transitionend', handle);
|
|
1929
|
+
};
|
|
1930
|
+
el.addEventListener('transitionend', handle);
|
|
1931
|
+
}
|
|
1932
|
+
});
|
|
1933
|
+
});
|
|
1934
1934
|
this.ngZone.runOutsideAngular(() => {
|
|
1935
1935
|
allFields.forEach((field) => {
|
|
1936
1936
|
const updatedCells = Array.from(document.querySelectorAll(`[field="${field}"]`));
|
|
@@ -3988,6 +3988,23 @@ class DataGridComponent {
|
|
|
3988
3988
|
const dateObj = keyValue instanceof Date ? keyValue : new Date(keyValue);
|
|
3989
3989
|
groupKey = this.commonSevice.formatDateValue(dateObj, this.dateFormat || 'dd/MM/yyyy');
|
|
3990
3990
|
}
|
|
3991
|
+
// Handle objects (like {id, name, value})
|
|
3992
|
+
else if (typeof keyValue === 'object' && keyValue !== null && !Array.isArray(keyValue)) {
|
|
3993
|
+
// Try common property names for objects
|
|
3994
|
+
groupKey = keyValue.value ??
|
|
3995
|
+
keyValue.name ??
|
|
3996
|
+
keyValue.id ??
|
|
3997
|
+
keyValue.label ??
|
|
3998
|
+
keyValue[Object.keys(keyValue)[0]] ??
|
|
3999
|
+
"_Blank";
|
|
4000
|
+
// If it's still an object after extraction, convert to string
|
|
4001
|
+
if (typeof groupKey === 'object') {
|
|
4002
|
+
groupKey = "_Blank";
|
|
4003
|
+
}
|
|
4004
|
+
else {
|
|
4005
|
+
groupKey = this.toTitleCase(String(groupKey).trim());
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
3991
4008
|
else {
|
|
3992
4009
|
groupKey = keyValue ? this.toTitleCase(String(keyValue).trim()) : "_Blank";
|
|
3993
4010
|
}
|