ngx-mat-table-multi-sort 19.1.0-pre.2 → 19.1.0
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.
|
@@ -104,6 +104,18 @@ class MatMultiSortDirective extends MatSort {
|
|
|
104
104
|
this._sorts()[index].direction = this.direction;
|
|
105
105
|
this.sortChange.emit({ active: this.active, direction: this.direction });
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Clears the current sorting state.
|
|
109
|
+
*
|
|
110
|
+
* @param id - The unique identifier of the column to toggle the sort direction for.
|
|
111
|
+
* @returns void
|
|
112
|
+
*/
|
|
113
|
+
clearSorting() {
|
|
114
|
+
this.active = "";
|
|
115
|
+
this.direction = "";
|
|
116
|
+
this._sorts.set([]);
|
|
117
|
+
this.sortChange.emit();
|
|
118
|
+
}
|
|
107
119
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MatMultiSortDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
108
120
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: MatMultiSortDirective, isStandalone: true, selector: "[matMultiSort]", host: { classAttribute: "mat-sort" }, exportAs: ["matMultiSort"], usesInheritance: true, ngImport: i0 });
|
|
109
121
|
}
|
|
@@ -274,6 +286,15 @@ class MatMultiSortControlComponent {
|
|
|
274
286
|
onChipRemoved(id) {
|
|
275
287
|
this.sort?.removeSortLevel(id);
|
|
276
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Clears the current sorting applied to the table.
|
|
291
|
+
*
|
|
292
|
+
* @param id - The identifier of the sort level to be removed.
|
|
293
|
+
* @returns void
|
|
294
|
+
*/
|
|
295
|
+
onClearClick() {
|
|
296
|
+
this.sort?.clearSorting();
|
|
297
|
+
}
|
|
277
298
|
/**
|
|
278
299
|
* Handles the drop event for drag-and-drop sorting.
|
|
279
300
|
* Reorders the sort levels based on the previous and current indices.
|
|
@@ -284,11 +305,11 @@ class MatMultiSortControlComponent {
|
|
|
284
305
|
this.sort?.reorderSortLevel(event.previousIndex, event.currentIndex);
|
|
285
306
|
}
|
|
286
307
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MatMultiSortControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
287
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: MatMultiSortControlComponent, isStandalone: true, selector: "mat-multi-sort-control", inputs: { orientation: "orientation", sort: "sort" }, ngImport: i0, template: "<mat-chip-listbox\n cdkDropList\n [cdkDropListOrientation]=\"orientation\"\n (cdkDropListDropped)=\"onDrop($event)\">\n @for (column of sorts; track $index) {\n <mat-chip\n class=\"mat-sort-header\"\n cdkDrag\n (click)=\"onChipClick(column.active)\"\n (removed)=\"onChipRemoved(column.active)\">\n <div\n matChipAvatar\n class=\"mat-sort-header-container mat-sort-header-sorted mat-focus-indicator\"\n [class.mat-sort-header-descending]=\"column.direction === 'desc'\"\n [class.mat-sort-header-ascending]=\"column.direction === 'asc'\"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \">\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n </div>\n {{ column.active }}\n <button matChipRemove>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-chip>\n }\n</mat-chip-listbox>\n", styles: [".mat-mdc-chip-listbox.mat-mdc-chip-set.cdk-drop-list .cdk-drop-list-dragging{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header{transition:background-color .1s cubic-bezier(0,0,.2,1),box-shadow .1s cubic-bezier(0,0,.2,1)}.mat-sort-header.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header:hover{background-color:#ccc;cursor:move}.mat-sort-header:hover:after{opacity:0}.mat-sort-header:focus:after{opacity:0}.mat-sort-header:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview{box-sizing:border-box;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;overflow:hidden}.cdk-drag-placeholder{opacity:0}\n"], dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: i1.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "directive", type: i1.MatChipRemove, selector: "[matChipRemove]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
308
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: MatMultiSortControlComponent, isStandalone: true, selector: "mat-multi-sort-control", inputs: { orientation: "orientation", sort: "sort" }, ngImport: i0, template: "<mat-chip-listbox\n cdkDropList\n [cdkDropListOrientation]=\"orientation\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <mat-chip\n [disabled]=\"!sorts.length\"\n [highlighted]=\"true\"\n (click)=\"onClearClick()\"\n ><mat-icon matChipAvatar fontIcon=\"clear_all\"></mat-icon>Clear All</mat-chip\n >\n @for (column of sorts; track $index) {\n <mat-chip\n class=\"mat-sort-header\"\n cdkDrag\n (click)=\"onChipClick(column.active)\"\n (removed)=\"onChipRemoved(column.active)\">\n <div\n matChipAvatar\n class=\"mat-sort-header-container mat-sort-header-sorted mat-focus-indicator\"\n [class.mat-sort-header-descending]=\"column.direction === 'desc'\"\n [class.mat-sort-header-ascending]=\"column.direction === 'asc'\"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \">\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n </div>\n {{ column.active }}\n <button matChipRemove>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-chip>\n }\n</mat-chip-listbox>\n", styles: [".mat-mdc-chip-listbox.mat-mdc-chip-set.cdk-drop-list .cdk-drop-list-dragging{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header{transition:background-color .1s cubic-bezier(0,0,.2,1),box-shadow .1s cubic-bezier(0,0,.2,1)}.mat-sort-header.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header:hover{background-color:#ccc;cursor:move}.mat-sort-header:hover:after{opacity:0}.mat-sort-header:focus:after{opacity:0}.mat-sort-header:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview{box-sizing:border-box;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;overflow:hidden}.cdk-drag-placeholder{opacity:0}\n"], dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: i1.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "directive", type: i1.MatChipRemove, selector: "[matChipRemove]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
288
309
|
}
|
|
289
310
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: MatMultiSortControlComponent, decorators: [{
|
|
290
311
|
type: Component,
|
|
291
|
-
args: [{ selector: "mat-multi-sort-control", imports: [CdkDropList, CdkDrag, MatChipsModule, MatIconModule], template: "<mat-chip-listbox\n cdkDropList\n [cdkDropListOrientation]=\"orientation\"\n (cdkDropListDropped)=\"onDrop($event)\">\n @for (column of sorts; track $index) {\n <mat-chip\n class=\"mat-sort-header\"\n cdkDrag\n (click)=\"onChipClick(column.active)\"\n (removed)=\"onChipRemoved(column.active)\">\n <div\n matChipAvatar\n class=\"mat-sort-header-container mat-sort-header-sorted mat-focus-indicator\"\n [class.mat-sort-header-descending]=\"column.direction === 'desc'\"\n [class.mat-sort-header-ascending]=\"column.direction === 'asc'\"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \">\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n </div>\n {{ column.active }}\n <button matChipRemove>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-chip>\n }\n</mat-chip-listbox>\n", styles: [".mat-mdc-chip-listbox.mat-mdc-chip-set.cdk-drop-list .cdk-drop-list-dragging{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header{transition:background-color .1s cubic-bezier(0,0,.2,1),box-shadow .1s cubic-bezier(0,0,.2,1)}.mat-sort-header.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header:hover{background-color:#ccc;cursor:move}.mat-sort-header:hover:after{opacity:0}.mat-sort-header:focus:after{opacity:0}.mat-sort-header:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview{box-sizing:border-box;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;overflow:hidden}.cdk-drag-placeholder{opacity:0}\n"] }]
|
|
312
|
+
args: [{ selector: "mat-multi-sort-control", imports: [CdkDropList, CdkDrag, MatChipsModule, MatIconModule], template: "<mat-chip-listbox\n cdkDropList\n [cdkDropListOrientation]=\"orientation\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <mat-chip\n [disabled]=\"!sorts.length\"\n [highlighted]=\"true\"\n (click)=\"onClearClick()\"\n ><mat-icon matChipAvatar fontIcon=\"clear_all\"></mat-icon>Clear All</mat-chip\n >\n @for (column of sorts; track $index) {\n <mat-chip\n class=\"mat-sort-header\"\n cdkDrag\n (click)=\"onChipClick(column.active)\"\n (removed)=\"onChipRemoved(column.active)\">\n <div\n matChipAvatar\n class=\"mat-sort-header-container mat-sort-header-sorted mat-focus-indicator\"\n [class.mat-sort-header-descending]=\"column.direction === 'desc'\"\n [class.mat-sort-header-ascending]=\"column.direction === 'asc'\"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \">\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n </div>\n {{ column.active }}\n <button matChipRemove>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-chip>\n }\n</mat-chip-listbox>\n", styles: [".mat-mdc-chip-listbox.mat-mdc-chip-set.cdk-drop-list .cdk-drop-list-dragging{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header{transition:background-color .1s cubic-bezier(0,0,.2,1),box-shadow .1s cubic-bezier(0,0,.2,1)}.mat-sort-header.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.mat-sort-header:hover{background-color:#ccc;cursor:move}.mat-sort-header:hover:after{opacity:0}.mat-sort-header:focus:after{opacity:0}.mat-sort-header:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview{box-sizing:border-box;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;overflow:hidden}.cdk-drag-placeholder{opacity:0}\n"] }]
|
|
292
313
|
}], propDecorators: { orientation: [{
|
|
293
314
|
type: Input
|
|
294
315
|
}], sort: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-mat-table-multi-sort.mjs","sources":["../../../src/lib/mat-multi-sort.directive.ts","../../../src/lib/mat-multi-sort-table-data-source.ts","../../../src/lib/mat-multi-sort-header/mat-multi-sort-header.component.ts","../../../src/lib/mat-multi-sort-header/mat-multi-sort-header.component.html","../../../src/lib/mat-multi-sort-control/mat-multi-sort-control.component.ts","../../../src/lib/mat-multi-sort-control/mat-multi-sort-control.component.html","../../../src/public-api.ts","../../../src/ngx-mat-table-multi-sort.ts"],"sourcesContent":["import { moveItemInArray } from \"@angular/cdk/drag-drop\";\nimport { Directive, signal, WritableSignal } from \"@angular/core\";\nimport {\n MatSort,\n MatSortable,\n Sort,\n SortDirection,\n} from \"@angular/material/sort\";\n\n@Directive({\n selector: \"[matMultiSort]\",\n exportAs: \"matMultiSort\",\n host: {\n class: \"mat-sort\",\n },\n})\nexport class MatMultiSortDirective extends MatSort {\n /**\n * A writable signal that holds an array of Sort objects.\n * This signal is used to manage the sorting state of the table.\n *\n * @readonly\n */\n readonly _sorts: WritableSignal<Sort[]> = signal([]);\n\n /**\n * Retrieves the sort direction for a given column ID.\n *\n * @param id - The ID of the column to get the sort direction for.\n * @returns The sort direction ('asc', 'desc', or '') for the specified column ID.\n */\n getSortDirection(id: string): SortDirection {\n const sort = this._sorts().find((e) => e.active === id);\n return sort ? sort.direction : \"\";\n }\n\n /**\n * Gets the sort index of the given column ID.\n *\n * @param id - The ID of the column to get the sort index for.\n * @returns The sort index of the column, or -1 if the column is not active.\n */\n public getSortIndex(id: string): number {\n return this._sorts().findIndex((e) => e.active === id);\n }\n\n override sort(sortable: MatSortable): void {\n this.active = sortable.id;\n this.direction = this.getSortDirection(sortable.id);\n const index = this.getSortIndex(sortable.id);\n\n // If the column is not active, add it to the list of active columns.\n if (index < 0) {\n this.direction = sortable.start ? sortable.start : this.start;\n this._sorts().push({ active: this.active, direction: this.direction });\n } else {\n // If the column is active, update the direction or remove it if the direction is empty.\n this.direction = this.getNextSortDirection(sortable);\n if (!this.direction) {\n this._sorts().splice(index, 1);\n } else {\n this._sorts()[index].direction = this.direction;\n }\n }\n\n this.sortChange.emit({ active: this.active, direction: this.direction });\n }\n\n /**\n * Removes a sort level by its identifier.\n * If the sort level is not found, the method returns without making any changes.\n *\n * @param id - The identifier of the sort level to be removed.\n * @returns void\n */\n removeSortLevel(id: string): void {\n const index = this.getSortIndex(id);\n if (index < 0) return;\n\n this._sorts().splice(index, 1);\n this.sortChange.emit();\n }\n\n /**\n * Reorders the sort level by moving an item in the sort array from a previous index to a current index.\n * If the previous index is the same as the current index, the function returns without making any changes.\n *\n * @param previousIndex - The index of the item to be moved.\n * @param currentIndex - The index to which the item should be moved.\n */\n reorderSortLevel(previousIndex: number, currentIndex: number): void {\n if (previousIndex === currentIndex) return;\n\n moveItemInArray(this._sorts(), previousIndex, currentIndex);\n this.sortChange.emit(this._sorts()[currentIndex]);\n }\n\n /**\n * Toggles the sort direction for the given column ID.\n *\n * @param id - The unique identifier of the column to toggle the sort direction for.\n * @returns void\n */\n toggleSortDirection(id: string): void {\n const index = this.getSortIndex(id);\n if (index < 0) return;\n\n this.active = id;\n // The value of this.direction is used in the getNextSortDirection method. That's why it is necessary for it to be set before the call to getNextSortDirection.\n this.direction = this.getSortDirection(id);\n this.direction = this.getNextSortDirection({\n id: id,\n disableClear: true,\n } as MatSortable);\n this._sorts()[index].direction = this.direction;\n this.sortChange.emit({ active: this.active, direction: this.direction });\n }\n}\n","import { MatPaginator } from \"@angular/material/paginator\";\nimport { Sort } from \"@angular/material/sort\";\nimport { MatTableDataSource } from \"@angular/material/table\";\nimport { MatMultiSortDirective } from \"./mat-multi-sort.directive\";\n\n/**\n * Sorts two items based on multiple sorting criteria.\n *\n * @description To do this, we iterate over each sort level and compare the values of the active column. If the values are equal, we move to the next sort level. If all sort levels are equal, we return 0.\n *\n * @template T - The type of the items being sorted.\n * @param {T} a - The first item to compare.\n * @param {T} b - The second item to compare.\n * @param {Sort[]} sorts - An array of sorting criteria, where each criterion specifies the property to sort by and the direction of sorting.\n * @returns {number} - A negative number if `a` should come before `b`, a positive number if `a` should come after `b`, or 0 if they are considered equal.\n */\nexport function MultiCriterionSort<T>(a: T, b: T, sorts: Sort[]): number {\n for (const { active, direction } of sorts) {\n const aValue = a[active as keyof T];\n const bValue = b[active as keyof T];\n\n const comparison = compareValues(aValue, bValue);\n\n if (comparison !== 0) {\n return direction === \"desc\" ? -comparison : comparison;\n }\n }\n\n return 0; // If all comparisons are equal, preserve original order\n}\n\nfunction compareValues<T>(aValue: T, bValue: T): number {\n if (aValue == null && bValue != null) return 1;\n if (aValue != null && bValue == null) return -1;\n if (aValue == null && bValue == null) return 0;\n\n if (typeof aValue === \"string\" && typeof bValue === \"string\") {\n return aValue.localeCompare(bValue);\n }\n\n if (aValue > bValue) return 1;\n if (aValue < bValue) return -1;\n return 0;\n}\n\n/**\n * A data source class that extends `MatTableDataSource` to support multi-column sorting.\n *\n * @template T The type of data that the table displays.\n * @template P The type of paginator used, defaults to `MatPaginator`.\n *\n * @extends MatTableDataSource<T, P>\n */\nexport class MatMultiSortTableDataSource<\n T,\n P extends MatPaginator = MatPaginator,\n> extends MatTableDataSource<T, P> {\n override get sort(): MatMultiSortDirective | null {\n return super.sort as MatMultiSortDirective;\n }\n override set sort(sort: MatMultiSortDirective | null) {\n super.sort = sort;\n }\n\n constructor(initialData?: T[]) {\n super(initialData);\n // Set the default sort function\n this.sortData = (data): T[] => this.sortDataFunction(data);\n }\n\n private sortDataFunction(data: T[]): T[] {\n // Return the data if there is no sort\n if (!this.sort?._sorts().length) return data;\n\n // Sort the data:\n return data.sort((a, b) => MultiCriterionSort(a, b, this.sort!._sorts()));\n }\n}\n","import { NgIf } from \"@angular/common\";\nimport { Component, inject, OnInit, ViewEncapsulation } from \"@angular/core\";\nimport { MatSort, MatSortHeader, SortDirection } from \"@angular/material/sort\";\nimport { MatMultiSortDirective } from \"../mat-multi-sort.directive\";\n\n@Component({\n selector: \"[mat-multi-sort-header]\", // eslint-disable-line @angular-eslint/component-selector\n exportAs: \"matMultiSortHeader\",\n imports: [NgIf],\n providers: [{ provide: MatSort, useExisting: MatMultiSortDirective }],\n templateUrl: \"./mat-multi-sort-header.component.html\",\n styleUrl: \"./mat-multi-sort-header.component.scss\",\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatMultiSortHeaderComponent\n extends MatSortHeader\n implements OnInit\n{\n override readonly _sort: MatMultiSortDirective = inject(\n MatMultiSortDirective,\n {\n optional: true,\n }\n )!;\n\n /**\n * Retrieves the sort direction for the current column.\n *\n * @returns {SortDirection} The sort direction for the column identified by this.id.\n */\n get sortDirection(): SortDirection {\n return this._sort.getSortDirection(this.id);\n }\n\n /**\n * Gets the sort index for the current column.\n *\n * @returns {number} The index of the sort order for this column.\n */\n get sortIndex(): number {\n return this._sort.getSortIndex(this.id);\n }\n\n override _isSorted(): boolean {\n return this.sortIndex > -1;\n }\n\n override _toggleOnInteraction(): void {\n if (this._isDisabled()) return;\n\n const wasSorted = this._isSorted();\n const prevDirection = this.sortDirection;\n this._sort.sort(this);\n this._recentlyCleared.set(\n wasSorted && !this._isSorted() ? prevDirection : null\n );\n }\n}\n","<!--\n We set the `tabindex` on an element inside the table header, rather than the header itself,\n because of a bug in NVDA where having a `tabindex` on a `th` breaks keyboard navigation in the\n table (see https://github.com/nvaccess/nvda/issues/7718). This allows for the header to both\n be focusable, and have screen readers read out its `aria-sort` state. We prefer this approach\n over having a button with an `aria-label` inside the header, because the button's `aria-label`\n will be read out as the user is navigating the table's cell (see #13012).\n\n The approach is based off of: https://dequeuniversity.com/library/aria/tables/sf-sortable-grid\n-->\n<div\n class=\"mat-sort-header-container mat-focus-indicator\"\n [class.mat-sort-header-sorted]=\"_isSorted()\"\n [class.mat-sort-header-position-before]=\"arrowPosition === 'before'\"\n [class.mat-sort-header-descending]=\"sortDirection === 'desc'\"\n [class.mat-sort-header-ascending]=\"sortDirection === 'asc'\"\n [class.mat-sort-header-recently-cleared-ascending]=\"\n _recentlyCleared() === 'asc'\n \"\n [class.mat-sort-header-recently-cleared-descending]=\"\n _recentlyCleared() === 'desc'\n \"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \"\n [attr.tabindex]=\"_isDisabled() ? null : 0\"\n [attr.role]=\"_isDisabled() ? null : 'button'\">\n <!--\n TODO(crisbeto): this div isn't strictly necessary, but we have to keep it due to a large\n number of screenshot diff failures. It should be removed eventually. Note that the difference\n isn't visible with a shorter header, but once it breaks up into multiple lines, this element\n causes it to be center-aligned, whereas removing it will keep the text to the left.\n -->\n <div class=\"mat-sort-header-content\">\n <ng-content></ng-content>\n </div>\n\n <!-- Disable animations while a current animation is running -->\n @if (_renderArrow()) {\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n }\n <div *ngIf=\"_isSorted()\" class=\"mat-sort-header-counter\">\n {{ sortIndex + 1 }}\n </div>\n</div>\n","import {\n CdkDrag,\n CdkDragDrop,\n CdkDropList,\n DropListOrientation,\n} from \"@angular/cdk/drag-drop\";\nimport { ANIMATION_MODULE_TYPE, Component, inject, Input } from \"@angular/core\";\nimport { MatChipsModule } from \"@angular/material/chips\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { Sort } from \"@angular/material/sort\";\nimport { MatMultiSortDirective } from \"../../public-api\";\n\n@Component({\n selector: \"mat-multi-sort-control\",\n imports: [CdkDropList, CdkDrag, MatChipsModule, MatIconModule],\n templateUrl: \"./mat-multi-sort-control.component.html\",\n styleUrl: \"./mat-multi-sort-control.component.scss\",\n})\nexport class MatMultiSortControlComponent {\n /**\n * Injects the ANIMATION_MODULE_TYPE token, which indicates the type of animation module being used.\n * This is an optional dependency and may be undefined if the animation module is not provided.\n *\n * @readonly\n * @type {ANIMATION_MODULE_TYPE | undefined}\n */\n readonly _animationModule = inject(ANIMATION_MODULE_TYPE, { optional: true });\n\n /**\n * Specifies the orientation of the drop list.\n * Can be either \"horizontal\" or \"vertical\".\n *\n * @type {DropListOrientation}\n * @default \"horizontal\"\n */\n @Input() orientation: DropListOrientation = \"horizontal\";\n\n /**\n * An optional input property that accepts an instance of `MatMultiSortDirective`.\n * This directive is used to control the sorting behavior of the table.\n */\n @Input() sort?: MatMultiSortDirective;\n\n /**\n * Retrieves the array of Sort objects from the current sort instance.\n * If the sort instance is not defined, it returns an empty array.\n *\n * @returns {Sort[]} An array of Sort objects or an empty array if no sorts are defined.\n */\n get sorts(): Sort[] {\n return this.sort?._sorts() || [];\n }\n\n /**\n * Handles the click event on a sort chip.\n * Toggles the sort direction for the given sort ID.\n *\n * @param id - The identifier of the sort field to toggle.\n * @returns void\n */\n onChipClick(id: string): void {\n this.sort?.toggleSortDirection(id);\n }\n\n /**\n * Handles the event when a sort chip is removed.\n *\n * @param id - The identifier of the sort level to be removed.\n * @returns void\n */\n onChipRemoved(id: string): void {\n this.sort?.removeSortLevel(id);\n }\n\n /**\n * Handles the drop event for drag-and-drop sorting.\n * Reorders the sort levels based on the previous and current indices.\n *\n * @param event - The drag-and-drop event containing the previous and current indices of the sort order.\n */\n onDrop(event: CdkDragDrop<Sort[]>): void {\n this.sort?.reorderSortLevel(event.previousIndex, event.currentIndex);\n }\n}\n","<mat-chip-listbox\n cdkDropList\n [cdkDropListOrientation]=\"orientation\"\n (cdkDropListDropped)=\"onDrop($event)\">\n @for (column of sorts; track $index) {\n <mat-chip\n class=\"mat-sort-header\"\n cdkDrag\n (click)=\"onChipClick(column.active)\"\n (removed)=\"onChipRemoved(column.active)\">\n <div\n matChipAvatar\n class=\"mat-sort-header-container mat-sort-header-sorted mat-focus-indicator\"\n [class.mat-sort-header-descending]=\"column.direction === 'desc'\"\n [class.mat-sort-header-ascending]=\"column.direction === 'asc'\"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \">\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n </div>\n {{ column.active }}\n <button matChipRemove>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-chip>\n }\n</mat-chip-listbox>\n","/*\n * Public API Surface of lib\n */\n\nexport * from \"./lib/mat-multi-sort.directive\";\nexport * from \"./lib/mat-multi-sort-table-data-source\";\nexport * from \"./lib/mat-multi-sort-header/mat-multi-sort-header.component\";\nexport * from \"./lib/mat-multi-sort-control/mat-multi-sort-control.component\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAgBM,MAAO,qBAAsB,SAAQ,OAAO,CAAA;AAChD;;;;;AAKG;AACM,IAAA,MAAM,GAA2B,MAAM,CAAC,EAAE,CAAC;AAEpD;;;;;AAK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A,kBAAA,EAAA,YAAA,EAAA,aAAA,EAAA,UAAA,EAAA,8BAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIlD,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBANxC,SAAS;+BACE,wBAAwB,EAAA,OAAA,EACzB,CAAC,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,yoCAAA,EAAA,MAAA,EAAA,CAAA,guBAAA,CAAA,EAAA;8BAqBrD,WAAW,EAAA,CAAA;sBAAnB;gBAMQ,IAAI,EAAA,CAAA;sBAAZ;;;AEzCH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-mat-table-multi-sort.mjs","sources":["../../../src/lib/mat-multi-sort.directive.ts","../../../src/lib/mat-multi-sort-table-data-source.ts","../../../src/lib/mat-multi-sort-header/mat-multi-sort-header.component.ts","../../../src/lib/mat-multi-sort-header/mat-multi-sort-header.component.html","../../../src/lib/mat-multi-sort-control/mat-multi-sort-control.component.ts","../../../src/lib/mat-multi-sort-control/mat-multi-sort-control.component.html","../../../src/public-api.ts","../../../src/ngx-mat-table-multi-sort.ts"],"sourcesContent":["import { moveItemInArray } from \"@angular/cdk/drag-drop\";\nimport { Directive, signal, WritableSignal } from \"@angular/core\";\nimport {\n MatSort,\n MatSortable,\n Sort,\n SortDirection,\n} from \"@angular/material/sort\";\n\n@Directive({\n selector: \"[matMultiSort]\",\n exportAs: \"matMultiSort\",\n host: {\n class: \"mat-sort\",\n },\n})\nexport class MatMultiSortDirective extends MatSort {\n /**\n * A writable signal that holds an array of Sort objects.\n * This signal is used to manage the sorting state of the table.\n *\n * @readonly\n */\n readonly _sorts: WritableSignal<Sort[]> = signal([]);\n\n /**\n * Retrieves the sort direction for a given column ID.\n *\n * @param id - The ID of the column to get the sort direction for.\n * @returns The sort direction ('asc', 'desc', or '') for the specified column ID.\n */\n public getSortDirection(id: string): SortDirection {\n const sort = this._sorts().find((e) => e.active === id);\n return sort ? sort.direction : \"\";\n }\n\n /**\n * Gets the sort index of the given column ID.\n *\n * @param id - The ID of the column to get the sort index for.\n * @returns The sort index of the column, or -1 if the column is not active.\n */\n public getSortIndex(id: string): number {\n return this._sorts().findIndex((e) => e.active === id);\n }\n\n override sort(sortable: MatSortable): void {\n this.active = sortable.id;\n this.direction = this.getSortDirection(sortable.id);\n const index = this.getSortIndex(sortable.id);\n\n // If the column is not active, add it to the list of active columns.\n if (index < 0) {\n this.direction = sortable.start ? sortable.start : this.start;\n this._sorts().push({ active: this.active, direction: this.direction });\n } else {\n // If the column is active, update the direction or remove it if the direction is empty.\n this.direction = this.getNextSortDirection(sortable);\n if (!this.direction) {\n this._sorts().splice(index, 1);\n } else {\n this._sorts()[index].direction = this.direction;\n }\n }\n\n this.sortChange.emit({ active: this.active, direction: this.direction });\n }\n\n /**\n * Removes a sort level by its identifier.\n * If the sort level is not found, the method returns without making any changes.\n *\n * @param id - The identifier of the sort level to be removed.\n * @returns void\n */\n public removeSortLevel(id: string): void {\n const index = this.getSortIndex(id);\n if (index < 0) return;\n\n this._sorts().splice(index, 1);\n this.sortChange.emit();\n }\n\n /**\n * Reorders the sort level by moving an item in the sort array from a previous index to a current index.\n * If the previous index is the same as the current index, the function returns without making any changes.\n *\n * @param previousIndex - The index of the item to be moved.\n * @param currentIndex - The index to which the item should be moved.\n */\n public reorderSortLevel(previousIndex: number, currentIndex: number): void {\n if (previousIndex === currentIndex) return;\n\n moveItemInArray(this._sorts(), previousIndex, currentIndex);\n this.sortChange.emit(this._sorts()[currentIndex]);\n }\n\n /**\n * Toggles the sort direction for the given column ID.\n *\n * @param id - The unique identifier of the column to toggle the sort direction for.\n * @returns void\n */\n public toggleSortDirection(id: string): void {\n const index = this.getSortIndex(id);\n if (index < 0) return;\n\n this.active = id;\n // The value of this.direction is used in the getNextSortDirection method. That's why it is necessary for it to be set before the call to getNextSortDirection.\n this.direction = this.getSortDirection(id);\n this.direction = this.getNextSortDirection({\n id: id,\n disableClear: true,\n } as MatSortable);\n this._sorts()[index].direction = this.direction;\n this.sortChange.emit({ active: this.active, direction: this.direction });\n }\n\n /**\n * Clears the current sorting state.\n *\n * @param id - The unique identifier of the column to toggle the sort direction for.\n * @returns void\n */\n public clearSorting(): void {\n this.active = \"\";\n this.direction = \"\";\n this._sorts.set([]);\n this.sortChange.emit();\n }\n}\n","import { MatPaginator } from \"@angular/material/paginator\";\nimport { Sort } from \"@angular/material/sort\";\nimport { MatTableDataSource } from \"@angular/material/table\";\nimport { MatMultiSortDirective } from \"./mat-multi-sort.directive\";\n\n/**\n * Sorts two items based on multiple sorting criteria.\n *\n * @description To do this, we iterate over each sort level and compare the values of the active column. If the values are equal, we move to the next sort level. If all sort levels are equal, we return 0.\n *\n * @template T - The type of the items being sorted.\n * @param {T} a - The first item to compare.\n * @param {T} b - The second item to compare.\n * @param {Sort[]} sorts - An array of sorting criteria, where each criterion specifies the property to sort by and the direction of sorting.\n * @returns {number} - A negative number if `a` should come before `b`, a positive number if `a` should come after `b`, or 0 if they are considered equal.\n */\nexport function MultiCriterionSort<T>(a: T, b: T, sorts: Sort[]): number {\n for (const { active, direction } of sorts) {\n const aValue = a[active as keyof T];\n const bValue = b[active as keyof T];\n\n const comparison = compareValues(aValue, bValue);\n\n if (comparison !== 0) {\n return direction === \"desc\" ? -comparison : comparison;\n }\n }\n\n return 0; // If all comparisons are equal, preserve original order\n}\n\nfunction compareValues<T>(aValue: T, bValue: T): number {\n if (aValue == null && bValue != null) return 1;\n if (aValue != null && bValue == null) return -1;\n if (aValue == null && bValue == null) return 0;\n\n if (typeof aValue === \"string\" && typeof bValue === \"string\") {\n return aValue.localeCompare(bValue);\n }\n\n if (aValue > bValue) return 1;\n if (aValue < bValue) return -1;\n return 0;\n}\n\n/**\n * A data source class that extends `MatTableDataSource` to support multi-column sorting.\n *\n * @template T The type of data that the table displays.\n * @template P The type of paginator used, defaults to `MatPaginator`.\n *\n * @extends MatTableDataSource<T, P>\n */\nexport class MatMultiSortTableDataSource<\n T,\n P extends MatPaginator = MatPaginator,\n> extends MatTableDataSource<T, P> {\n override get sort(): MatMultiSortDirective | null {\n return super.sort as MatMultiSortDirective;\n }\n override set sort(sort: MatMultiSortDirective | null) {\n super.sort = sort;\n }\n\n constructor(initialData?: T[]) {\n super(initialData);\n // Set the default sort function\n this.sortData = (data): T[] => this.sortDataFunction(data);\n }\n\n private sortDataFunction(data: T[]): T[] {\n // Return the data if there is no sort\n if (!this.sort?._sorts().length) return data;\n\n // Sort the data:\n return data.sort((a, b) => MultiCriterionSort(a, b, this.sort!._sorts()));\n }\n}\n","import { NgIf } from \"@angular/common\";\nimport { Component, inject, OnInit, ViewEncapsulation } from \"@angular/core\";\nimport { MatSort, MatSortHeader, SortDirection } from \"@angular/material/sort\";\nimport { MatMultiSortDirective } from \"../mat-multi-sort.directive\";\n\n@Component({\n selector: \"[mat-multi-sort-header]\", // eslint-disable-line @angular-eslint/component-selector\n exportAs: \"matMultiSortHeader\",\n imports: [NgIf],\n providers: [{ provide: MatSort, useExisting: MatMultiSortDirective }],\n templateUrl: \"./mat-multi-sort-header.component.html\",\n styleUrl: \"./mat-multi-sort-header.component.scss\",\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatMultiSortHeaderComponent\n extends MatSortHeader\n implements OnInit\n{\n override readonly _sort: MatMultiSortDirective = inject(\n MatMultiSortDirective,\n {\n optional: true,\n }\n )!;\n\n /**\n * Retrieves the sort direction for the current column.\n *\n * @returns {SortDirection} The sort direction for the column identified by this.id.\n */\n get sortDirection(): SortDirection {\n return this._sort.getSortDirection(this.id);\n }\n\n /**\n * Gets the sort index for the current column.\n *\n * @returns {number} The index of the sort order for this column.\n */\n get sortIndex(): number {\n return this._sort.getSortIndex(this.id);\n }\n\n override _isSorted(): boolean {\n return this.sortIndex > -1;\n }\n\n override _toggleOnInteraction(): void {\n if (this._isDisabled()) return;\n\n const wasSorted = this._isSorted();\n const prevDirection = this.sortDirection;\n this._sort.sort(this);\n this._recentlyCleared.set(\n wasSorted && !this._isSorted() ? prevDirection : null\n );\n }\n}\n","<!--\n We set the `tabindex` on an element inside the table header, rather than the header itself,\n because of a bug in NVDA where having a `tabindex` on a `th` breaks keyboard navigation in the\n table (see https://github.com/nvaccess/nvda/issues/7718). This allows for the header to both\n be focusable, and have screen readers read out its `aria-sort` state. We prefer this approach\n over having a button with an `aria-label` inside the header, because the button's `aria-label`\n will be read out as the user is navigating the table's cell (see #13012).\n\n The approach is based off of: https://dequeuniversity.com/library/aria/tables/sf-sortable-grid\n-->\n<div\n class=\"mat-sort-header-container mat-focus-indicator\"\n [class.mat-sort-header-sorted]=\"_isSorted()\"\n [class.mat-sort-header-position-before]=\"arrowPosition === 'before'\"\n [class.mat-sort-header-descending]=\"sortDirection === 'desc'\"\n [class.mat-sort-header-ascending]=\"sortDirection === 'asc'\"\n [class.mat-sort-header-recently-cleared-ascending]=\"\n _recentlyCleared() === 'asc'\n \"\n [class.mat-sort-header-recently-cleared-descending]=\"\n _recentlyCleared() === 'desc'\n \"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \"\n [attr.tabindex]=\"_isDisabled() ? null : 0\"\n [attr.role]=\"_isDisabled() ? null : 'button'\">\n <!--\n TODO(crisbeto): this div isn't strictly necessary, but we have to keep it due to a large\n number of screenshot diff failures. It should be removed eventually. Note that the difference\n isn't visible with a shorter header, but once it breaks up into multiple lines, this element\n causes it to be center-aligned, whereas removing it will keep the text to the left.\n -->\n <div class=\"mat-sort-header-content\">\n <ng-content></ng-content>\n </div>\n\n <!-- Disable animations while a current animation is running -->\n @if (_renderArrow()) {\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n }\n <div *ngIf=\"_isSorted()\" class=\"mat-sort-header-counter\">\n {{ sortIndex + 1 }}\n </div>\n</div>\n","import {\n CdkDrag,\n CdkDragDrop,\n CdkDropList,\n DropListOrientation,\n} from \"@angular/cdk/drag-drop\";\nimport { ANIMATION_MODULE_TYPE, Component, inject, Input } from \"@angular/core\";\nimport { MatChipsModule } from \"@angular/material/chips\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { Sort } from \"@angular/material/sort\";\nimport { MatMultiSortDirective } from \"../../public-api\";\n\n@Component({\n selector: \"mat-multi-sort-control\",\n imports: [CdkDropList, CdkDrag, MatChipsModule, MatIconModule],\n templateUrl: \"./mat-multi-sort-control.component.html\",\n styleUrl: \"./mat-multi-sort-control.component.scss\",\n})\nexport class MatMultiSortControlComponent {\n /**\n * Injects the ANIMATION_MODULE_TYPE token, which indicates the type of animation module being used.\n * This is an optional dependency and may be undefined if the animation module is not provided.\n *\n * @readonly\n * @type {ANIMATION_MODULE_TYPE | undefined}\n */\n readonly _animationModule = inject(ANIMATION_MODULE_TYPE, { optional: true });\n\n /**\n * Specifies the orientation of the drop list.\n * Can be either \"horizontal\" or \"vertical\".\n *\n * @type {DropListOrientation}\n * @default \"horizontal\"\n */\n @Input() orientation: DropListOrientation = \"horizontal\";\n\n /**\n * An optional input property that accepts an instance of `MatMultiSortDirective`.\n * This directive is used to control the sorting behavior of the table.\n */\n @Input() sort?: MatMultiSortDirective;\n\n /**\n * Retrieves the array of Sort objects from the current sort instance.\n * If the sort instance is not defined, it returns an empty array.\n *\n * @returns {Sort[]} An array of Sort objects or an empty array if no sorts are defined.\n */\n get sorts(): Sort[] {\n return this.sort?._sorts() || [];\n }\n\n /**\n * Handles the click event on a sort chip.\n * Toggles the sort direction for the given sort ID.\n *\n * @param id - The identifier of the sort field to toggle.\n * @returns void\n */\n onChipClick(id: string): void {\n this.sort?.toggleSortDirection(id);\n }\n\n /**\n * Handles the event when a sort chip is removed.\n *\n * @param id - The identifier of the sort level to be removed.\n * @returns void\n */\n onChipRemoved(id: string): void {\n this.sort?.removeSortLevel(id);\n }\n\n /**\n * Clears the current sorting applied to the table.\n *\n * @param id - The identifier of the sort level to be removed.\n * @returns void\n */\n onClearClick(): void {\n this.sort?.clearSorting();\n }\n\n /**\n * Handles the drop event for drag-and-drop sorting.\n * Reorders the sort levels based on the previous and current indices.\n *\n * @param event - The drag-and-drop event containing the previous and current indices of the sort order.\n */\n onDrop(event: CdkDragDrop<Sort[]>): void {\n this.sort?.reorderSortLevel(event.previousIndex, event.currentIndex);\n }\n}\n","<mat-chip-listbox\n cdkDropList\n [cdkDropListOrientation]=\"orientation\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <mat-chip\n [disabled]=\"!sorts.length\"\n [highlighted]=\"true\"\n (click)=\"onClearClick()\"\n ><mat-icon matChipAvatar fontIcon=\"clear_all\"></mat-icon>Clear All</mat-chip\n >\n @for (column of sorts; track $index) {\n <mat-chip\n class=\"mat-sort-header\"\n cdkDrag\n (click)=\"onChipClick(column.active)\"\n (removed)=\"onChipRemoved(column.active)\">\n <div\n matChipAvatar\n class=\"mat-sort-header-container mat-sort-header-sorted mat-focus-indicator\"\n [class.mat-sort-header-descending]=\"column.direction === 'desc'\"\n [class.mat-sort-header-ascending]=\"column.direction === 'asc'\"\n [class.mat-sort-header-animations-disabled]=\"\n _animationModule === 'NoopAnimations'\n \">\n <div class=\"mat-sort-header-arrow\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\" />\n </svg>\n </div>\n </div>\n {{ column.active }}\n <button matChipRemove>\n <mat-icon>clear</mat-icon>\n </button>\n </mat-chip>\n }\n</mat-chip-listbox>\n","/*\n * Public API Surface of lib\n */\n\nexport * from \"./lib/mat-multi-sort.directive\";\nexport * from \"./lib/mat-multi-sort-table-data-source\";\nexport * from \"./lib/mat-multi-sort-header/mat-multi-sort-header.component\";\nexport * from \"./lib/mat-multi-sort-control/mat-multi-sort-control.component\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAgBM,MAAO,qBAAsB,SAAQ,OAAO,CAAA;AAChD;;;;;AAKG;AACM,IAAA,MAAM,GAA2B,MAAM,CAAC,EAAE,CAAC;AAEpD;;;;;AAKG;AACI,IAAA,gBAAgB,CAAC,EAAU,EAAA;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC;QACvD,OAAO,IAAI,GAAG,IAAI,CAAC,SAAS,GAAG,EAAE;;AAGnC;;;;;AAKG;AACI,IAAA,YAAY,CAAC,EAAU,EAAA;AAC5B,QAAA,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC;;AAG/C,IAAA,IAAI,CAAC,QAAqB,EAAA;AACjC,QAAA,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE;QACzB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;;AAG5C,QAAA,IAA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AAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIlD,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBANxC,SAAS;+BACE,wBAAwB,EAAA,OAAA,EACzB,CAAC,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,60CAAA,EAAA,MAAA,EAAA,CAAA,guBAAA,CAAA,EAAA;8BAqBrD,WAAW,EAAA,CAAA;sBAAnB;gBAMQ,IAAI,EAAA,CAAA;sBAAZ;;;AEzCH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -46,6 +46,13 @@ export declare class MatMultiSortControlComponent {
|
|
|
46
46
|
* @returns void
|
|
47
47
|
*/
|
|
48
48
|
onChipRemoved(id: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Clears the current sorting applied to the table.
|
|
51
|
+
*
|
|
52
|
+
* @param id - The identifier of the sort level to be removed.
|
|
53
|
+
* @returns void
|
|
54
|
+
*/
|
|
55
|
+
onClearClick(): void;
|
|
49
56
|
/**
|
|
50
57
|
* Handles the drop event for drag-and-drop sorting.
|
|
51
58
|
* Reorders the sort levels based on the previous and current indices.
|
|
@@ -47,6 +47,13 @@ export declare class MatMultiSortDirective extends MatSort {
|
|
|
47
47
|
* @returns void
|
|
48
48
|
*/
|
|
49
49
|
toggleSortDirection(id: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Clears the current sorting state.
|
|
52
|
+
*
|
|
53
|
+
* @param id - The unique identifier of the column to toggle the sort direction for.
|
|
54
|
+
* @returns void
|
|
55
|
+
*/
|
|
56
|
+
clearSorting(): void;
|
|
50
57
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatMultiSortDirective, never>;
|
|
51
58
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MatMultiSortDirective, "[matMultiSort]", ["matMultiSort"], {}, {}, never, never, true, never>;
|
|
52
59
|
}
|