Merge remote-tracking branch 'upstream/master'

This commit is contained in:
1Map 2023-08-17 15:20:19 +02:00
commit 956c8b4330
41 changed files with 208 additions and 161 deletions

View file

@ -1103,6 +1103,7 @@ export interface DataTableSlots {
empty(): VNode[];
/**
* Custom group header template.
* @param {Object} scope - group header slot's params.
*/
groupheader(scope: {
/**
@ -1130,6 +1131,7 @@ export interface DataTableSlots {
}): VNode[];
/**
* Custom loading template.
* @param {Object} scope - loading slot's params.
*/
loading(): VNode[];
/**

View file

@ -526,7 +526,7 @@ export default {
if (value1 == null && value2 != null) result = -1;
else if (value1 != null && value2 == null) result = 1;
else if (value1 == null && value2 == null) result = 0;
else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, { numeric: true });
else if (typeof value1 === 'string' && typeof value2 === 'string') result = new Intl.Collator(undefined, { numeric: true }).compare(value1, value2);
else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
return this.d_sortOrder * result;
@ -562,7 +562,7 @@ export default {
if (typeof value1 === 'string' || value1 instanceof String) {
if (value1.localeCompare && value1 !== value2) {
return this.d_multiSortMeta[index].order * value1.localeCompare(value2, undefined, { numeric: true });
return this.d_multiSortMeta[index].order * new Intl.Collator(undefined, { numeric: true }).compare(value1, value2);
}
} else {
result = value1 < value2 ? -1 : 1;