ngx-mat-table-multi-sort 19.2.0 → 19.3.0-pre.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.
- package/fesm2022/ngx-mat-table-multi-sort.mjs +233 -56
- package/fesm2022/ngx-mat-table-multi-sort.mjs.map +1 -1
- package/lib/mat-multi-sort-control/mat-multi-sort-control.component.d.ts +1 -1
- package/lib/mat-multi-sort.directive.d.ts +47 -4
- package/lib/mat-table-column-config/mat-table-column-config.component.d.ts +9 -3
- package/lib/mat-table-column-config-persistence.service.d.ts +31 -0
- package/lib/mat-table-column-config-trigger.directive.d.ts +1 -10
- package/lib/mat-table-column-config.d.ts +18 -6
- package/package.json +9 -8
- package/public-api.d.ts +1 -0
|
@@ -1,29 +1,83 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, signal, Directive,
|
|
2
|
+
import { InjectionToken, EventEmitter, signal, effect, Directive, Optional, Inject, Output, Injectable, Component, HostListener, inject, ViewEncapsulation, ANIMATION_MODULE_TYPE, Input } from '@angular/core';
|
|
3
3
|
import { moveItemInArray, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
|
|
4
|
-
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
|
4
|
+
import { MatSort, MAT_SORT_DEFAULT_OPTIONS, MatSortHeader } from '@angular/material/sort';
|
|
5
5
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i2 from '@angular/material/checkbox';
|
|
7
7
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
8
|
-
import * as
|
|
8
|
+
import * as i3 from '@angular/material/icon';
|
|
9
9
|
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
-
import
|
|
10
|
+
import { BehaviorSubject } from 'rxjs';
|
|
11
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
11
12
|
import { MatTableDataSource } from '@angular/material/table';
|
|
12
13
|
import { NgIf } from '@angular/common';
|
|
13
|
-
import * as i1$
|
|
14
|
+
import * as i1$1 from '@angular/material/chips';
|
|
14
15
|
import { MatChipsModule } from '@angular/material/chips';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* Injection token for
|
|
18
|
+
* Injection token for the storage mechanism used to persist column configuration.
|
|
19
|
+
*
|
|
20
|
+
* This token can be used to provide a custom storage implementation for saving
|
|
21
|
+
* and retrieving the state of table column configurations.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
const COLUMN_CONFIG_PERSISTENCE_STORAGE = new InjectionToken("COLUMN_CONFIG_PERSISTENCE_STORAGE");
|
|
25
|
+
/**
|
|
26
|
+
* Injection token used to enable or disable column configuration persistence.
|
|
27
|
+
*
|
|
28
|
+
* This token can be provided with a boolean value to indicate whether the
|
|
29
|
+
* column configurations should be persisted (e.g., in local storage or a database).
|
|
18
30
|
*
|
|
19
|
-
* This token is used to inject an array of `TableColumn` configurations
|
|
20
|
-
* into Angular components or services. The generic type `unknown` is used
|
|
21
|
-
* to allow for flexibility in the type of data that can be represented
|
|
22
|
-
* by the table columns.
|
|
23
31
|
*/
|
|
24
|
-
const
|
|
32
|
+
const COLUMN_CONFIG_PERSISTENCE_ENABLED = new InjectionToken("COLUMN_CONFIG_PERSISTENCE_ENABLED");
|
|
33
|
+
/**
|
|
34
|
+
* Injection token for the column configuration persistence key.
|
|
35
|
+
* This token is used to provide a unique key for persisting column configurations.
|
|
36
|
+
*/
|
|
37
|
+
const COLUMN_CONFIG_PERSISTENCE_KEY = new InjectionToken("COLUMN_CONFIG_PERSISTENCE_KEY");
|
|
25
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Injection token for the storage mechanism used to persist sorting state.
|
|
41
|
+
*
|
|
42
|
+
* This token can be used to provide a custom storage implementation for persisting
|
|
43
|
+
* the sorting state of a table. By default, it can be set to use localStorage, sessionStorage,
|
|
44
|
+
* or any other storage mechanism that implements the Storage interface.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
const SORT_PERSISTENCE_STORAGE = new InjectionToken("SORT_PERSISTENCE_STORAGE");
|
|
48
|
+
/**
|
|
49
|
+
* Injection token used to enable or disable the persistence of sorting state.
|
|
50
|
+
*
|
|
51
|
+
* This token can be provided in the application's dependency injection system
|
|
52
|
+
* to control whether the sorting state of a table should be persisted across
|
|
53
|
+
* sessions or not.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // To enable sort persistence:
|
|
57
|
+
* providers: [
|
|
58
|
+
* { provide: SORT_PERSISTENCE_ENABLED, useValue: true }
|
|
59
|
+
* ]
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // To disable sort persistence:
|
|
63
|
+
* providers: [
|
|
64
|
+
* { provide: SORT_PERSISTENCE_ENABLED, useValue: false }
|
|
65
|
+
* ]
|
|
66
|
+
*/
|
|
67
|
+
const SORT_PERSISTENCE_ENABLED = new InjectionToken("SORT_PERSISTENCE_ENABLED");
|
|
68
|
+
/**
|
|
69
|
+
* Injection token for the key used to persist sorting state.
|
|
70
|
+
*
|
|
71
|
+
* This token can be used to provide a custom key for storing
|
|
72
|
+
* the sorting state in a persistence layer, such as local storage
|
|
73
|
+
* or a database.
|
|
74
|
+
*/
|
|
75
|
+
const SORT_PERSISTENCE_KEY = new InjectionToken("SORT_PERSISTENCE_KEY");
|
|
26
76
|
class MatMultiSortDirective extends MatSort {
|
|
77
|
+
isPersistenceEnabled;
|
|
78
|
+
key;
|
|
79
|
+
storage;
|
|
80
|
+
persistenceChanged = new EventEmitter();
|
|
27
81
|
/**
|
|
28
82
|
* A writable signal that holds an array of Sort objects.
|
|
29
83
|
* This signal is used to manage the sorting state of the table.
|
|
@@ -31,6 +85,28 @@ class MatMultiSortDirective extends MatSort {
|
|
|
31
85
|
* @readonly
|
|
32
86
|
*/
|
|
33
87
|
_sorts = signal([]);
|
|
88
|
+
constructor(isPersistenceEnabled, key, storage, defaultOptions) {
|
|
89
|
+
super(defaultOptions);
|
|
90
|
+
this.isPersistenceEnabled = isPersistenceEnabled;
|
|
91
|
+
this.key = key;
|
|
92
|
+
this.storage = storage;
|
|
93
|
+
this.isPersistenceEnabled ??= true;
|
|
94
|
+
this.key ??= "mat-table-persistence-sort";
|
|
95
|
+
this.storage ??= localStorage;
|
|
96
|
+
if (this.isPersistenceEnabled) {
|
|
97
|
+
const sortsSerialized = this.storage.getItem(this.key);
|
|
98
|
+
this._sorts.set(sortsSerialized ? JSON.parse(sortsSerialized) : []);
|
|
99
|
+
}
|
|
100
|
+
// Update the sorting state when the sorts signal changes.
|
|
101
|
+
effect(() => {
|
|
102
|
+
const length = this._sorts().length;
|
|
103
|
+
this.sortChange.emit({
|
|
104
|
+
active: length ? this._sorts()[length - 1].active : "",
|
|
105
|
+
direction: length ? this._sorts()[length - 1].direction : "",
|
|
106
|
+
});
|
|
107
|
+
this.persistSortSettings();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
34
110
|
/**
|
|
35
111
|
* Retrieves the sort direction for a given column ID.
|
|
36
112
|
*
|
|
@@ -70,6 +146,7 @@ class MatMultiSortDirective extends MatSort {
|
|
|
70
146
|
}
|
|
71
147
|
}
|
|
72
148
|
this.sortChange.emit({ active: this.active, direction: this.direction });
|
|
149
|
+
this.persistSortSettings();
|
|
73
150
|
}
|
|
74
151
|
/**
|
|
75
152
|
* Removes a sort level by its identifier.
|
|
@@ -84,6 +161,7 @@ class MatMultiSortDirective extends MatSort {
|
|
|
84
161
|
return;
|
|
85
162
|
this._sorts().splice(index, 1);
|
|
86
163
|
this.sortChange.emit();
|
|
164
|
+
this.persistSortSettings();
|
|
87
165
|
}
|
|
88
166
|
/**
|
|
89
167
|
* Reorders the sort level by moving an item in the sort array from a previous index to a current index.
|
|
@@ -97,6 +175,7 @@ class MatMultiSortDirective extends MatSort {
|
|
|
97
175
|
return;
|
|
98
176
|
moveItemInArray(this._sorts(), previousIndex, currentIndex);
|
|
99
177
|
this.sortChange.emit(this._sorts()[currentIndex]);
|
|
178
|
+
this.persistSortSettings();
|
|
100
179
|
}
|
|
101
180
|
/**
|
|
102
181
|
* Toggles the sort direction for the given column ID.
|
|
@@ -117,6 +196,7 @@ class MatMultiSortDirective extends MatSort {
|
|
|
117
196
|
});
|
|
118
197
|
this._sorts()[index].direction = this.direction;
|
|
119
198
|
this.sortChange.emit({ active: this.active, direction: this.direction });
|
|
199
|
+
this.persistSortSettings();
|
|
120
200
|
}
|
|
121
201
|
/**
|
|
122
202
|
* Clears the current sorting state.
|
|
@@ -129,11 +209,17 @@ class MatMultiSortDirective extends MatSort {
|
|
|
129
209
|
this.direction = "";
|
|
130
210
|
this._sorts.set([]);
|
|
131
211
|
this.sortChange.emit();
|
|
212
|
+
this.persistSortSettings();
|
|
213
|
+
}
|
|
214
|
+
persistSortSettings() {
|
|
215
|
+
this.persistenceChanged.emit(this._sorts());
|
|
216
|
+
if (this.isPersistenceEnabled)
|
|
217
|
+
this.storage.setItem(this.key, JSON.stringify(this._sorts()));
|
|
132
218
|
}
|
|
133
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
134
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
219
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatMultiSortDirective, deps: [{ token: SORT_PERSISTENCE_ENABLED, optional: true }, { token: SORT_PERSISTENCE_KEY, optional: true }, { token: SORT_PERSISTENCE_STORAGE, optional: true }, { token: MAT_SORT_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
220
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: MatMultiSortDirective, isStandalone: true, selector: "[matMultiSort]", outputs: { persistenceChanged: "persistenceChanged" }, host: { classAttribute: "mat-sort" }, exportAs: ["matMultiSort"], usesInheritance: true, ngImport: i0 });
|
|
135
221
|
}
|
|
136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatMultiSortDirective, decorators: [{
|
|
137
223
|
type: Directive,
|
|
138
224
|
args: [{
|
|
139
225
|
selector: "[matMultiSort]",
|
|
@@ -142,12 +228,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
142
228
|
class: "mat-sort",
|
|
143
229
|
},
|
|
144
230
|
}]
|
|
145
|
-
}]
|
|
231
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
232
|
+
type: Optional
|
|
233
|
+
}, {
|
|
234
|
+
type: Inject,
|
|
235
|
+
args: [SORT_PERSISTENCE_ENABLED]
|
|
236
|
+
}] }, { type: undefined, decorators: [{
|
|
237
|
+
type: Optional
|
|
238
|
+
}, {
|
|
239
|
+
type: Inject,
|
|
240
|
+
args: [SORT_PERSISTENCE_KEY]
|
|
241
|
+
}] }, { type: Storage, decorators: [{
|
|
242
|
+
type: Optional
|
|
243
|
+
}, {
|
|
244
|
+
type: Inject,
|
|
245
|
+
args: [SORT_PERSISTENCE_STORAGE]
|
|
246
|
+
}] }, { type: undefined, decorators: [{
|
|
247
|
+
type: Optional
|
|
248
|
+
}, {
|
|
249
|
+
type: Inject,
|
|
250
|
+
args: [MAT_SORT_DEFAULT_OPTIONS]
|
|
251
|
+
}] }], propDecorators: { persistenceChanged: [{
|
|
252
|
+
type: Output
|
|
253
|
+
}] } });
|
|
254
|
+
|
|
255
|
+
class MatTableColumnConfigPersistenceService {
|
|
256
|
+
isPersistenceEnabled;
|
|
257
|
+
key;
|
|
258
|
+
storage;
|
|
259
|
+
columns$ = new BehaviorSubject([]);
|
|
260
|
+
/**
|
|
261
|
+
* Gets the current table columns configuration.
|
|
262
|
+
*
|
|
263
|
+
* @returns {TableColumn<T>[]} An array of table columns.
|
|
264
|
+
*/
|
|
265
|
+
get columns() {
|
|
266
|
+
return this.columns$.getValue();
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Sets the columns configuration for the table and persists the configuration.
|
|
270
|
+
*
|
|
271
|
+
* @param value - An array of `TableColumn<T>` representing the new column configuration.
|
|
272
|
+
*/
|
|
273
|
+
set columns(value) {
|
|
274
|
+
this.columns$.next(value);
|
|
275
|
+
this.persistColumnConfig(value);
|
|
276
|
+
}
|
|
277
|
+
constructor(isPersistenceEnabled, key, storage) {
|
|
278
|
+
this.isPersistenceEnabled = isPersistenceEnabled;
|
|
279
|
+
this.key = key;
|
|
280
|
+
this.storage = storage;
|
|
281
|
+
this.isPersistenceEnabled ??= true;
|
|
282
|
+
this.key ??= "mat-table-persistence-column-config";
|
|
283
|
+
this.storage ??= localStorage;
|
|
284
|
+
if (this.isPersistenceEnabled) {
|
|
285
|
+
const columnsSerialized = this.storage.getItem(this.key);
|
|
286
|
+
this.columns$.next(columnsSerialized ? JSON.parse(columnsSerialized) : []);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Retrieves an observable stream of table columns.
|
|
291
|
+
*
|
|
292
|
+
* @returns {Observable<TableColumn<T>[]>} An observable that emits an array of table columns.
|
|
293
|
+
*/
|
|
294
|
+
getColumns() {
|
|
295
|
+
return this.columns$.asObservable();
|
|
296
|
+
}
|
|
297
|
+
persistColumnConfig(columns) {
|
|
298
|
+
if (!this.isPersistenceEnabled)
|
|
299
|
+
return;
|
|
300
|
+
this.storage.setItem(this.key, JSON.stringify(columns));
|
|
301
|
+
}
|
|
302
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatTableColumnConfigPersistenceService, deps: [{ token: COLUMN_CONFIG_PERSISTENCE_ENABLED, optional: true }, { token: COLUMN_CONFIG_PERSISTENCE_KEY, optional: true }, { token: COLUMN_CONFIG_PERSISTENCE_STORAGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
303
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatTableColumnConfigPersistenceService, providedIn: "root" });
|
|
304
|
+
}
|
|
305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatTableColumnConfigPersistenceService, decorators: [{
|
|
306
|
+
type: Injectable,
|
|
307
|
+
args: [{
|
|
308
|
+
providedIn: "root",
|
|
309
|
+
}]
|
|
310
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
311
|
+
type: Optional
|
|
312
|
+
}, {
|
|
313
|
+
type: Inject,
|
|
314
|
+
args: [COLUMN_CONFIG_PERSISTENCE_ENABLED]
|
|
315
|
+
}] }, { type: undefined, decorators: [{
|
|
316
|
+
type: Optional
|
|
317
|
+
}, {
|
|
318
|
+
type: Inject,
|
|
319
|
+
args: [COLUMN_CONFIG_PERSISTENCE_KEY]
|
|
320
|
+
}] }, { type: Storage, decorators: [{
|
|
321
|
+
type: Optional
|
|
322
|
+
}, {
|
|
323
|
+
type: Inject,
|
|
324
|
+
args: [COLUMN_CONFIG_PERSISTENCE_STORAGE]
|
|
325
|
+
}] }] });
|
|
146
326
|
|
|
147
327
|
class MatTableColumnConfigComponent {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
328
|
+
persistenceService;
|
|
329
|
+
subscription;
|
|
330
|
+
columns = [];
|
|
331
|
+
constructor(persistenceService) {
|
|
332
|
+
this.persistenceService = persistenceService;
|
|
333
|
+
}
|
|
334
|
+
ngOnInit() {
|
|
335
|
+
this.subscription = this.persistenceService
|
|
336
|
+
.getColumns()
|
|
337
|
+
.subscribe((columns) => {
|
|
338
|
+
this.columns = columns;
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
ngOnDestroy() {
|
|
342
|
+
this.subscription?.unsubscribe();
|
|
343
|
+
this.subscription = undefined;
|
|
151
344
|
}
|
|
152
345
|
/**
|
|
153
346
|
* Handles the event when a dragged column is dropped.
|
|
@@ -157,6 +350,7 @@ class MatTableColumnConfigComponent {
|
|
|
157
350
|
*/
|
|
158
351
|
onColumnDropped(event) {
|
|
159
352
|
moveItemInArray(this.columns, event.previousIndex, event.currentIndex);
|
|
353
|
+
this.persistenceService.columns = this.columns;
|
|
160
354
|
}
|
|
161
355
|
/**
|
|
162
356
|
* Toggles the visibility of a column based on its identifier.
|
|
@@ -168,31 +362,21 @@ class MatTableColumnConfigComponent {
|
|
|
168
362
|
if (index < 0)
|
|
169
363
|
return;
|
|
170
364
|
this.columns[index].visible = !this.columns[index].visible;
|
|
365
|
+
this.persistenceService.columns = this.columns;
|
|
171
366
|
}
|
|
172
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
173
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.
|
|
367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatTableColumnConfigComponent, deps: [{ token: MatTableColumnConfigPersistenceService }], target: i0.ɵɵFactoryTarget.Component });
|
|
368
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: MatTableColumnConfigComponent, isStandalone: true, selector: "mat-table-column-config", ngImport: i0, template: "<div\n cdkDropList\n class=\"table-column-list mat-elevation-z4\"\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"onColumnDropped($event)\">\n @for (column of columns; track column.id) {\n <div cdkDrag class=\"table-column\">\n <mat-icon cdkDragHandle>drag_indicator</mat-icon>\n <mat-checkbox\n [checked]=\"column.visible\"\n (change)=\"onColumnVisibilityChanged(column.id)\"\n >{{ column.label }}</mat-checkbox\n >\n </div>\n }\n</div>\n", styles: [".cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.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}.table-column-list{background-color:var(--mat-sys-surface-container, #eeeeee);color:var(--mat-sys-on-surface, rgba(0, 0, 0, .87))}.table-column{background:var(--mat-sys-surface, #ffffff);display:flex;justify-content:flex-start;align-items:center;height:48px;padding:0 16px 0 8px}.table-column mat-icon{margin-right:16px}.table-column mat-checkbox{line-height:48px;color:#000000de;font-size:14px;font-weight:400}.table-column:last-child{border:none}.cdk-drop-list-dragging .table-column:not(.cdk-drag-placeholder){transition:transform .15s cubic-bezier(0,0,.2,1)}\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: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
174
369
|
}
|
|
175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatTableColumnConfigComponent, decorators: [{
|
|
176
371
|
type: Component,
|
|
177
|
-
args: [{ selector: "mat-table-column-config", imports: [CdkDropList, CdkDrag, MatCheckboxModule, MatIconModule], template: "<div\n cdkDropList\n class=\"table-column-list mat-elevation-z4\"\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"onColumnDropped($event)\">\n @for (column of columns; track
|
|
178
|
-
}], ctorParameters: () => [{ type:
|
|
179
|
-
type: Inject,
|
|
180
|
-
args: [TABLE_COLUMNS]
|
|
181
|
-
}] }] });
|
|
372
|
+
args: [{ selector: "mat-table-column-config", imports: [CdkDropList, CdkDrag, MatCheckboxModule, MatIconModule], template: "<div\n cdkDropList\n class=\"table-column-list mat-elevation-z4\"\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"onColumnDropped($event)\">\n @for (column of columns; track column.id) {\n <div cdkDrag class=\"table-column\">\n <mat-icon cdkDragHandle>drag_indicator</mat-icon>\n <mat-checkbox\n [checked]=\"column.visible\"\n (change)=\"onColumnVisibilityChanged(column.id)\"\n >{{ column.label }}</mat-checkbox\n >\n </div>\n }\n</div>\n", styles: [".cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.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}.table-column-list{background-color:var(--mat-sys-surface-container, #eeeeee);color:var(--mat-sys-on-surface, rgba(0, 0, 0, .87))}.table-column{background:var(--mat-sys-surface, #ffffff);display:flex;justify-content:flex-start;align-items:center;height:48px;padding:0 16px 0 8px}.table-column mat-icon{margin-right:16px}.table-column mat-checkbox{line-height:48px;color:#000000de;font-size:14px;font-weight:400}.table-column:last-child{border:none}.cdk-drop-list-dragging .table-column:not(.cdk-drag-placeholder){transition:transform .15s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
373
|
+
}], ctorParameters: () => [{ type: MatTableColumnConfigPersistenceService }] });
|
|
182
374
|
|
|
183
375
|
class MatTableColumnConfigTriggerDirective {
|
|
184
376
|
elementRef;
|
|
185
377
|
overlay;
|
|
186
378
|
viewContainerRef;
|
|
187
379
|
_componentRef = null;
|
|
188
|
-
/**
|
|
189
|
-
* Input property that accepts an array of table column configurations.
|
|
190
|
-
* The alias for this input property is "matTableColumnConfigTrigger".
|
|
191
|
-
* This property is required.
|
|
192
|
-
*
|
|
193
|
-
* @type {TableColumn<T>[]} columns - The array of table column configurations.
|
|
194
|
-
*/
|
|
195
|
-
columns;
|
|
196
380
|
/**
|
|
197
381
|
* Gets the reference to the MatTableColumnConfigComponent.
|
|
198
382
|
*
|
|
@@ -229,11 +413,7 @@ class MatTableColumnConfigTriggerDirective {
|
|
|
229
413
|
hasBackdrop: true,
|
|
230
414
|
backdropClass: "cdk-overlay-transparent-backdrop",
|
|
231
415
|
});
|
|
232
|
-
const
|
|
233
|
-
providers: [{ provide: TABLE_COLUMNS, useValue: this.columns }],
|
|
234
|
-
parent: this.viewContainerRef.injector,
|
|
235
|
-
});
|
|
236
|
-
const portal = new ComponentPortal((MatTableColumnConfigComponent), this.viewContainerRef, injector);
|
|
416
|
+
const portal = new ComponentPortal((MatTableColumnConfigComponent), this.viewContainerRef, this.viewContainerRef.injector);
|
|
237
417
|
this._componentRef = overlayRef.attach(portal);
|
|
238
418
|
overlayRef.backdropClick().subscribe(() => {
|
|
239
419
|
overlayRef.detach();
|
|
@@ -241,19 +421,16 @@ class MatTableColumnConfigTriggerDirective {
|
|
|
241
421
|
this._componentRef = null;
|
|
242
422
|
});
|
|
243
423
|
}
|
|
244
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
245
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
|
424
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatTableColumnConfigTriggerDirective, deps: [{ token: i0.ElementRef }, { token: i1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
425
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: MatTableColumnConfigTriggerDirective, isStandalone: true, selector: "[matTableColumnConfigTrigger]", host: { listeners: { "click": "onClick()" } }, exportAs: ["matTableColumnConfigTrigger"], ngImport: i0 });
|
|
246
426
|
}
|
|
247
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
427
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatTableColumnConfigTriggerDirective, decorators: [{
|
|
248
428
|
type: Directive,
|
|
249
429
|
args: [{
|
|
250
430
|
selector: "[matTableColumnConfigTrigger]",
|
|
251
431
|
exportAs: "matTableColumnConfigTrigger",
|
|
252
432
|
}]
|
|
253
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1
|
|
254
|
-
type: Input,
|
|
255
|
-
args: [{ alias: "matTableColumnConfigTrigger", required: true }]
|
|
256
|
-
}], onClick: [{
|
|
433
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.Overlay }, { type: i0.ViewContainerRef }], propDecorators: { onClick: [{
|
|
257
434
|
type: HostListener,
|
|
258
435
|
args: ["click"]
|
|
259
436
|
}] } });
|
|
@@ -356,10 +533,10 @@ class MatMultiSortHeaderComponent extends MatSortHeader {
|
|
|
356
533
|
this._sort.sort(this);
|
|
357
534
|
this._recentlyCleared.set(wasSorted && !this._isSorted() ? prevDirection : null);
|
|
358
535
|
}
|
|
359
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
360
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.
|
|
536
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatMultiSortHeaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
537
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: MatMultiSortHeaderComponent, isStandalone: true, selector: "[mat-multi-sort-header]", providers: [{ provide: MatSort, useExisting: MatMultiSortDirective }], exportAs: ["matMultiSortHeader"], usesInheritance: true, ngImport: i0, template: "<!--\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", styles: [".mat-sort-header-container{display:flex;cursor:pointer;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-container:before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px) * -1)}.mat-sort-header-content{display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}@keyframes _mat-sort-header-recently-cleared-ascending{0%{transform:translateY(0);opacity:1}to{transform:translateY(-25%);opacity:0}}@keyframes _mat-sort-header-recently-cleared-descending{0%{transform:translateY(0) rotate(180deg);opacity:1}to{transform:translateY(25%) rotate(180deg);opacity:0}}.mat-sort-header-arrow{height:12px;width:12px;position:relative;transition:transform 225ms cubic-bezier(.4,0,.2,1),opacity 225ms cubic-bezier(.4,0,.2,1);opacity:0;overflow:visible;color:var(--mat-sort-arrow-color, var(--mat-sys-on-surface))}.mat-sort-header.cdk-keyboard-focused .mat-sort-header-arrow,.mat-sort-header.cdk-program-focused .mat-sort-header-arrow,.mat-sort-header:hover .mat-sort-header-arrow{opacity:.54}.mat-sort-header .mat-sort-header-sorted .mat-sort-header-arrow{opacity:1}.mat-sort-header-descending .mat-sort-header-arrow{transform:rotate(180deg)}.mat-sort-header-recently-cleared-ascending .mat-sort-header-arrow{transform:translateY(-25%);transition:none;animation:_mat-sort-header-recently-cleared-ascending 225ms cubic-bezier(.4,0,.2,1) forwards}.mat-sort-header-animations-disabled .mat-sort-header-arrow{transition-duration:0ms;animation-duration:0ms}.mat-sort-header-arrow svg{width:24px;height:24px;fill:currentColor;position:absolute;top:50%;left:50%;margin:-12px 0 0 -12px;transform:translateZ(0)}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-counter{color:var(--mat-sort-arrow-color, var(--mat-sys-on-surface))}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
361
538
|
}
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatMultiSortHeaderComponent, decorators: [{
|
|
363
540
|
type: Component,
|
|
364
541
|
args: [{ selector: "[mat-multi-sort-header]", exportAs: "matMultiSortHeader", imports: [NgIf], providers: [{ provide: MatSort, useExisting: MatMultiSortDirective }], encapsulation: ViewEncapsulation.None, template: "<!--\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", styles: [".mat-sort-header-container{display:flex;cursor:pointer;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-container:before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px) * -1)}.mat-sort-header-content{display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}@keyframes _mat-sort-header-recently-cleared-ascending{0%{transform:translateY(0);opacity:1}to{transform:translateY(-25%);opacity:0}}@keyframes _mat-sort-header-recently-cleared-descending{0%{transform:translateY(0) rotate(180deg);opacity:1}to{transform:translateY(25%) rotate(180deg);opacity:0}}.mat-sort-header-arrow{height:12px;width:12px;position:relative;transition:transform 225ms cubic-bezier(.4,0,.2,1),opacity 225ms cubic-bezier(.4,0,.2,1);opacity:0;overflow:visible;color:var(--mat-sort-arrow-color, var(--mat-sys-on-surface))}.mat-sort-header.cdk-keyboard-focused .mat-sort-header-arrow,.mat-sort-header.cdk-program-focused .mat-sort-header-arrow,.mat-sort-header:hover .mat-sort-header-arrow{opacity:.54}.mat-sort-header .mat-sort-header-sorted .mat-sort-header-arrow{opacity:1}.mat-sort-header-descending .mat-sort-header-arrow{transform:rotate(180deg)}.mat-sort-header-recently-cleared-ascending .mat-sort-header-arrow{transform:translateY(-25%);transition:none;animation:_mat-sort-header-recently-cleared-ascending 225ms cubic-bezier(.4,0,.2,1) forwards}.mat-sort-header-animations-disabled .mat-sort-header-arrow{transition-duration:0ms;animation-duration:0ms}.mat-sort-header-arrow svg{width:24px;height:24px;fill:currentColor;position:absolute;top:50%;left:50%;margin:-12px 0 0 -12px;transform:translateZ(0)}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-counter{color:var(--mat-sort-arrow-color, var(--mat-sys-on-surface))}\n"] }]
|
|
365
542
|
}] });
|
|
@@ -432,12 +609,12 @@ class MatMultiSortControlComponent {
|
|
|
432
609
|
onDrop(event) {
|
|
433
610
|
this.sort?.reorderSortLevel(event.previousIndex, event.currentIndex);
|
|
434
611
|
}
|
|
435
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
436
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.
|
|
612
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatMultiSortControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
613
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", 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: [".cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.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}.mat-mdc-chip.mat-sort-header{background-color:var(--mat-sys-surface, #ffffff);transition:background-color .1s cubic-bezier(0,0,.2,1),box-shadow .1s cubic-bezier(0,0,.2,1)}.mat-mdc-chip.mat-sort-header:hover{cursor:move}.mat-mdc-chip.mat-sort-header:hover:after{opacity:0}.mat-mdc-chip.mat-sort-header:focus:after{opacity:0}.mat-mdc-chip.mat-sort-header:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drop-list-dragging .mat-sort-header:not(.cdk-drag-placeholder){background-color:var(--mat-sys-surface-dim, #ffffff);transition:transform .15s cubic-bezier(0,0,.2,1)}\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$1.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$1.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i1$1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "directive", type: i1$1.MatChipRemove, selector: "[matChipRemove]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
437
614
|
}
|
|
438
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MatMultiSortControlComponent, decorators: [{
|
|
439
616
|
type: Component,
|
|
440
|
-
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: [".
|
|
617
|
+
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: [".cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .15s cubic-bezier(0,0,.2,1)}.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}.mat-mdc-chip.mat-sort-header{background-color:var(--mat-sys-surface, #ffffff);transition:background-color .1s cubic-bezier(0,0,.2,1),box-shadow .1s cubic-bezier(0,0,.2,1)}.mat-mdc-chip.mat-sort-header:hover{cursor:move}.mat-mdc-chip.mat-sort-header:hover:after{opacity:0}.mat-mdc-chip.mat-sort-header:focus:after{opacity:0}.mat-mdc-chip.mat-sort-header:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drop-list-dragging .mat-sort-header:not(.cdk-drag-placeholder){background-color:var(--mat-sys-surface-dim, #ffffff);transition:transform .15s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
441
618
|
}], propDecorators: { orientation: [{
|
|
442
619
|
type: Input
|
|
443
620
|
}], sort: [{
|
|
@@ -445,12 +622,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
445
622
|
}] } });
|
|
446
623
|
|
|
447
624
|
/*
|
|
448
|
-
* Public API
|
|
625
|
+
* Public API surface of the library
|
|
449
626
|
*/
|
|
450
627
|
|
|
451
628
|
/**
|
|
452
629
|
* Generated bundle index. Do not edit.
|
|
453
630
|
*/
|
|
454
631
|
|
|
455
|
-
export { MatMultiSortControlComponent, MatMultiSortDirective, MatMultiSortHeaderComponent, MatMultiSortTableDataSource, MatTableColumnConfigComponent, MatTableColumnConfigTriggerDirective, MultiCriterionSort,
|
|
632
|
+
export { COLUMN_CONFIG_PERSISTENCE_ENABLED, COLUMN_CONFIG_PERSISTENCE_KEY, COLUMN_CONFIG_PERSISTENCE_STORAGE, MatMultiSortControlComponent, MatMultiSortDirective, MatMultiSortHeaderComponent, MatMultiSortTableDataSource, MatTableColumnConfigComponent, MatTableColumnConfigPersistenceService, MatTableColumnConfigTriggerDirective, MultiCriterionSort, SORT_PERSISTENCE_ENABLED, SORT_PERSISTENCE_KEY, SORT_PERSISTENCE_STORAGE };
|
|
456
633
|
//# sourceMappingURL=ngx-mat-table-multi-sort.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-mat-table-multi-sort.mjs","sources":["../../../src/lib/mat-table-column-config.ts","../../../src/lib/mat-multi-sort.directive.ts","../../../src/lib/mat-table-column-config/mat-table-column-config.component.ts","../../../src/lib/mat-table-column-config/mat-table-column-config.component.html","../../../src/lib/mat-table-column-config-trigger.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 { InjectionToken } from \"@angular/core\";\n\n/**\n * Represents the configuration for a table column.\n *\n * @template T - The type of the data object that the table displays.\n */\nexport interface TableColumn<T> {\n id: keyof T;\n label: string;\n visible: boolean;\n}\n\n/**\n * Injection token for providing table column configurations.\n *\n * This token is used to inject an array of `TableColumn` configurations\n * into Angular components or services. The generic type `unknown` is used\n * to allow for flexibility in the type of data that can be represented\n * by the table columns.\n */\nexport const TABLE_COLUMNS = new InjectionToken<TableColumn<unknown>>(\n \"TABLE_COLUMNS\"\n);\n","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 {\n CdkDrag,\n CdkDragDrop,\n CdkDropList,\n moveItemInArray,\n} from \"@angular/cdk/drag-drop\";\nimport { Component, Inject } from \"@angular/core\";\nimport { MatCheckboxModule } from \"@angular/material/checkbox\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { TABLE_COLUMNS, TableColumn } from \"../mat-table-column-config\";\n\n@Component({\n selector: \"mat-table-column-config\",\n imports: [CdkDropList, CdkDrag, MatCheckboxModule, MatIconModule],\n templateUrl: \"./mat-table-column-config.component.html\",\n styleUrl: \"./mat-table-column-config.component.scss\",\n})\nexport class MatTableColumnConfigComponent<T> {\n constructor(@Inject(TABLE_COLUMNS) readonly columns: TableColumn<T>[]) {}\n\n /**\n * Handles the event when a dragged column is dropped.\n * This method updates the order of columns based on the drag and drop action.\n *\n * @param event - The event object containing information about the drag and drop action.\n */\n onColumnDropped(event: CdkDragDrop<T>): void {\n moveItemInArray(this.columns, event.previousIndex, event.currentIndex);\n }\n\n /**\n * Toggles the visibility of a column based on its identifier.\n *\n * @param id - The identifier of the column whose visibility is to be changed.\n */\n onColumnVisibilityChanged(id: keyof T): void {\n const index = this.columns.findIndex((column) => column.id === id);\n if (index < 0) return;\n\n this.columns[index].visible = !this.columns[index].visible;\n }\n}\n","<div\n cdkDropList\n class=\"table-column-list mat-elevation-z4\"\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"onColumnDropped($event)\">\n @for (column of columns; track $index) {\n <div cdkDrag class=\"table-column\">\n <mat-icon cdkDragHandle>drag_indicator</mat-icon>\n <mat-checkbox\n [checked]=\"column.visible\"\n (change)=\"onColumnVisibilityChanged(column.id)\"\n >{{ column.label }}</mat-checkbox\n >\n </div>\n }\n</div>\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport {\n ComponentRef,\n Directive,\n ElementRef,\n HostListener,\n Injector,\n Input,\n ViewContainerRef,\n} from \"@angular/core\";\nimport { TABLE_COLUMNS, TableColumn } from \"./mat-table-column-config\";\nimport { MatTableColumnConfigComponent } from \"./mat-table-column-config/mat-table-column-config.component\";\n\n@Directive({\n selector: \"[matTableColumnConfigTrigger]\",\n exportAs: \"matTableColumnConfigTrigger\",\n})\nexport class MatTableColumnConfigTriggerDirective<T> {\n private _componentRef: ComponentRef<MatTableColumnConfigComponent<T>> | null =\n null;\n /**\n * Input property that accepts an array of table column configurations.\n * The alias for this input property is \"matTableColumnConfigTrigger\".\n * This property is required.\n *\n * @type {TableColumn<T>[]} columns - The array of table column configurations.\n */\n @Input({ alias: \"matTableColumnConfigTrigger\", required: true })\n columns!: TableColumn<T>[];\n\n /**\n * Gets the reference to the MatTableColumnConfigComponent.\n *\n * @returns {ComponentRef<MatTableColumnConfigComponent<T>> | null}\n * The reference to the MatTableColumnConfigComponent if it exists, otherwise null.\n */\n get componentRef(): ComponentRef<MatTableColumnConfigComponent<T>> | null {\n return this._componentRef;\n }\n\n constructor(\n private readonly elementRef: ElementRef,\n private readonly overlay: Overlay,\n private readonly viewContainerRef: ViewContainerRef\n ) {}\n @HostListener(\"click\")\n onClick(): void {\n // Create the component portal\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef.nativeElement)\n .withFlexibleDimensions(true)\n .withViewportMargin(8)\n .withGrowAfterOpen(true)\n .withPush(true)\n .withPositions([\n {\n originX: \"end\",\n originY: \"bottom\",\n overlayX: \"end\",\n overlayY: \"top\",\n },\n ]);\n const overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: true,\n backdropClass: \"cdk-overlay-transparent-backdrop\",\n });\n const injector = Injector.create({\n providers: [{ provide: TABLE_COLUMNS, useValue: this.columns }],\n parent: this.viewContainerRef.injector,\n });\n const portal = new ComponentPortal(\n MatTableColumnConfigComponent<T>,\n this.viewContainerRef,\n injector\n );\n this._componentRef = overlayRef.attach(portal);\n\n overlayRef.backdropClick().subscribe(() => {\n overlayRef.detach();\n overlayRef.dispose();\n this._componentRef = null;\n });\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-table-column-config\";\nexport * from \"./lib/mat-multi-sort.directive\";\nexport * from \"./lib/mat-table-column-config-trigger.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\";\nexport * from \"./lib/mat-table-column-config/mat-table-column-config.component\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;AAaA;;;;;;;AAOG;MACU,aAAa,GAAG,IAAI,cAAc,CAC7C,eAAe;;ACNX,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,IAAI,KAAK,GAAG,CAAC,EAAE;AACb,YAAA,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;YAC7D,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CA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,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;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-mat-table-multi-sort.mjs","sources":["../../../src/lib/mat-table-column-config.ts","../../../src/lib/mat-multi-sort.directive.ts","../../../src/lib/mat-table-column-config-persistence.service.ts","../../../src/lib/mat-table-column-config/mat-table-column-config.component.ts","../../../src/lib/mat-table-column-config/mat-table-column-config.component.html","../../../src/lib/mat-table-column-config-trigger.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 { InjectionToken } from \"@angular/core\";\n\n/**\n * Represents the configuration for a table column.\n *\n * @template T - The type of the data object that the table displays.\n */\nexport interface TableColumn<T> {\n id: keyof T;\n label: string;\n visible: boolean;\n}\n\n/**\n * Injection token for the storage mechanism used to persist column configuration.\n *\n * This token can be used to provide a custom storage implementation for saving\n * and retrieving the state of table column configurations.\n *\n */\nexport const COLUMN_CONFIG_PERSISTENCE_STORAGE = new InjectionToken<Storage>(\n \"COLUMN_CONFIG_PERSISTENCE_STORAGE\"\n);\n\n/**\n * Injection token used to enable or disable column configuration persistence.\n *\n * This token can be provided with a boolean value to indicate whether the\n * column configurations should be persisted (e.g., in local storage or a database).\n *\n */\nexport const COLUMN_CONFIG_PERSISTENCE_ENABLED = new InjectionToken<boolean>(\n \"COLUMN_CONFIG_PERSISTENCE_ENABLED\"\n);\n\n/**\n * Injection token for the column configuration persistence key.\n * This token is used to provide a unique key for persisting column configurations.\n */\nexport const COLUMN_CONFIG_PERSISTENCE_KEY = new InjectionToken<string>(\n \"COLUMN_CONFIG_PERSISTENCE_KEY\"\n);\n","import { moveItemInArray } from \"@angular/cdk/drag-drop\";\nimport {\n Directive,\n effect,\n EventEmitter,\n Inject,\n InjectionToken,\n Optional,\n Output,\n signal,\n WritableSignal,\n} from \"@angular/core\";\nimport {\n MAT_SORT_DEFAULT_OPTIONS,\n MatSort,\n MatSortable,\n MatSortDefaultOptions,\n Sort,\n SortDirection,\n} from \"@angular/material/sort\";\n\n/**\n * Injection token for the storage mechanism used to persist sorting state.\n *\n * This token can be used to provide a custom storage implementation for persisting\n * the sorting state of a table. By default, it can be set to use localStorage, sessionStorage,\n * or any other storage mechanism that implements the Storage interface.\n *\n */\nexport const SORT_PERSISTENCE_STORAGE = new InjectionToken<Storage>(\n \"SORT_PERSISTENCE_STORAGE\"\n);\n\n/**\n * Injection token used to enable or disable the persistence of sorting state.\n *\n * This token can be provided in the application's dependency injection system\n * to control whether the sorting state of a table should be persisted across\n * sessions or not.\n *\n * @example\n * // To enable sort persistence:\n * providers: [\n * { provide: SORT_PERSISTENCE_ENABLED, useValue: true }\n * ]\n *\n * @example\n * // To disable sort persistence:\n * providers: [\n * { provide: SORT_PERSISTENCE_ENABLED, useValue: false }\n * ]\n */\nexport const SORT_PERSISTENCE_ENABLED = new InjectionToken<boolean>(\n \"SORT_PERSISTENCE_ENABLED\"\n);\n\n/**\n * Injection token for the key used to persist sorting state.\n *\n * This token can be used to provide a custom key for storing\n * the sorting state in a persistence layer, such as local storage\n * or a database.\n */\nexport const SORT_PERSISTENCE_KEY = new InjectionToken<string>(\n \"SORT_PERSISTENCE_KEY\"\n);\n\n@Directive({\n selector: \"[matMultiSort]\",\n exportAs: \"matMultiSort\",\n host: {\n class: \"mat-sort\",\n },\n})\nexport class MatMultiSortDirective extends MatSort {\n @Output()\n private readonly persistenceChanged = new EventEmitter<Sort[]>();\n\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 constructor(\n @Optional()\n @Inject(SORT_PERSISTENCE_ENABLED)\n public isPersistenceEnabled: boolean,\n @Optional()\n @Inject(SORT_PERSISTENCE_KEY)\n private readonly key: string,\n @Optional()\n @Inject(SORT_PERSISTENCE_STORAGE)\n private readonly storage: Storage,\n @Optional()\n @Inject(MAT_SORT_DEFAULT_OPTIONS)\n defaultOptions?: MatSortDefaultOptions | undefined\n ) {\n super(defaultOptions);\n\n this.isPersistenceEnabled ??= true;\n this.key ??= \"mat-table-persistence-sort\";\n this.storage ??= localStorage;\n\n if (this.isPersistenceEnabled) {\n const sortsSerialized = this.storage.getItem(this.key);\n this._sorts.set(sortsSerialized ? JSON.parse(sortsSerialized) : []);\n }\n\n // Update the sorting state when the sorts signal changes.\n effect(() => {\n const length = this._sorts().length;\n this.sortChange.emit({\n active: length ? this._sorts()[length - 1].active : \"\",\n direction: length ? this._sorts()[length - 1].direction : \"\",\n });\n this.persistSortSettings();\n });\n }\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 this.persistSortSettings();\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 this.persistSortSettings();\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 this.persistSortSettings();\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 this.persistSortSettings();\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 this.persistSortSettings();\n }\n\n private persistSortSettings(): void {\n this.persistenceChanged.emit(this._sorts());\n if (this.isPersistenceEnabled)\n this.storage.setItem(this.key, JSON.stringify(this._sorts()));\n }\n}\n","import { Inject, Injectable, Optional } from \"@angular/core\";\nimport { BehaviorSubject, Observable } from \"rxjs\";\nimport {\n COLUMN_CONFIG_PERSISTENCE_ENABLED,\n COLUMN_CONFIG_PERSISTENCE_KEY,\n COLUMN_CONFIG_PERSISTENCE_STORAGE,\n TableColumn,\n} from \"./mat-table-column-config\";\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class MatTableColumnConfigPersistenceService<T> {\n private readonly columns$ = new BehaviorSubject<TableColumn<T>[]>([]);\n\n /**\n * Gets the current table columns configuration.\n *\n * @returns {TableColumn<T>[]} An array of table columns.\n */\n public get columns(): TableColumn<T>[] {\n return this.columns$.getValue();\n }\n\n /**\n * Sets the columns configuration for the table and persists the configuration.\n *\n * @param value - An array of `TableColumn<T>` representing the new column configuration.\n */\n public set columns(value: TableColumn<T>[]) {\n this.columns$.next(value);\n this.persistColumnConfig(value);\n }\n\n constructor(\n @Optional()\n @Inject(COLUMN_CONFIG_PERSISTENCE_ENABLED)\n public isPersistenceEnabled: boolean,\n @Optional()\n @Inject(COLUMN_CONFIG_PERSISTENCE_KEY)\n private readonly key: string,\n @Optional()\n @Inject(COLUMN_CONFIG_PERSISTENCE_STORAGE)\n private readonly storage: Storage\n ) {\n this.isPersistenceEnabled ??= true;\n this.key ??= \"mat-table-persistence-column-config\";\n this.storage ??= localStorage;\n\n if (this.isPersistenceEnabled) {\n const columnsSerialized = this.storage.getItem(this.key);\n this.columns$.next(\n columnsSerialized ? JSON.parse(columnsSerialized) : []\n );\n }\n }\n\n /**\n * Retrieves an observable stream of table columns.\n *\n * @returns {Observable<TableColumn<T>[]>} An observable that emits an array of table columns.\n */\n public getColumns(): Observable<TableColumn<T>[]> {\n return this.columns$.asObservable();\n }\n\n private persistColumnConfig(columns: TableColumn<T>[]): void {\n if (!this.isPersistenceEnabled) return;\n this.storage.setItem(this.key, JSON.stringify(columns));\n }\n}\n","import {\n CdkDrag,\n CdkDragDrop,\n CdkDropList,\n moveItemInArray,\n} from \"@angular/cdk/drag-drop\";\nimport { Component, OnDestroy, OnInit } from \"@angular/core\";\nimport { MatCheckboxModule } from \"@angular/material/checkbox\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { Subscription } from \"rxjs\";\nimport { TableColumn } from \"../mat-table-column-config\";\nimport { MatTableColumnConfigPersistenceService } from \"../mat-table-column-config-persistence.service\";\n\n@Component({\n selector: \"mat-table-column-config\",\n imports: [CdkDropList, CdkDrag, MatCheckboxModule, MatIconModule],\n templateUrl: \"./mat-table-column-config.component.html\",\n styleUrl: \"./mat-table-column-config.component.scss\",\n})\nexport class MatTableColumnConfigComponent<T> implements OnInit, OnDestroy {\n private subscription: Subscription | undefined;\n columns: TableColumn<T>[] = [];\n\n constructor(\n private readonly persistenceService: MatTableColumnConfigPersistenceService<T>\n ) {}\n\n ngOnInit(): void {\n this.subscription = this.persistenceService\n .getColumns()\n .subscribe((columns) => {\n this.columns = columns;\n });\n }\n\n ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n this.subscription = undefined;\n }\n\n /**\n * Handles the event when a dragged column is dropped.\n * This method updates the order of columns based on the drag and drop action.\n *\n * @param event - The event object containing information about the drag and drop action.\n */\n onColumnDropped(event: CdkDragDrop<T>): void {\n moveItemInArray(this.columns, event.previousIndex, event.currentIndex);\n this.persistenceService.columns = this.columns;\n }\n\n /**\n * Toggles the visibility of a column based on its identifier.\n *\n * @param id - The identifier of the column whose visibility is to be changed.\n */\n onColumnVisibilityChanged(id: keyof T): void {\n const index = this.columns.findIndex((column) => column.id === id);\n if (index < 0) return;\n\n this.columns[index].visible = !this.columns[index].visible;\n this.persistenceService.columns = this.columns;\n }\n}\n","<div\n cdkDropList\n class=\"table-column-list mat-elevation-z4\"\n cdkDropListOrientation=\"vertical\"\n (cdkDropListDropped)=\"onColumnDropped($event)\">\n @for (column of columns; track column.id) {\n <div cdkDrag class=\"table-column\">\n <mat-icon cdkDragHandle>drag_indicator</mat-icon>\n <mat-checkbox\n [checked]=\"column.visible\"\n (change)=\"onColumnVisibilityChanged(column.id)\"\n >{{ column.label }}</mat-checkbox\n >\n </div>\n }\n</div>\n","import { Overlay } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport {\n ComponentRef,\n Directive,\n ElementRef,\n HostListener,\n ViewContainerRef,\n} from \"@angular/core\";\nimport { MatTableColumnConfigComponent } from \"./mat-table-column-config/mat-table-column-config.component\";\n\n@Directive({\n selector: \"[matTableColumnConfigTrigger]\",\n exportAs: \"matTableColumnConfigTrigger\",\n})\nexport class MatTableColumnConfigTriggerDirective<T> {\n private _componentRef: ComponentRef<MatTableColumnConfigComponent<T>> | null =\n null;\n\n /**\n * Gets the reference to the MatTableColumnConfigComponent.\n *\n * @returns {ComponentRef<MatTableColumnConfigComponent<T>> | null}\n * The reference to the MatTableColumnConfigComponent if it exists, otherwise null.\n */\n get componentRef(): ComponentRef<MatTableColumnConfigComponent<T>> | null {\n return this._componentRef;\n }\n\n constructor(\n private readonly elementRef: ElementRef,\n private readonly overlay: Overlay,\n private readonly viewContainerRef: ViewContainerRef\n ) {}\n\n @HostListener(\"click\")\n onClick(): void {\n // Create the component portal\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef.nativeElement)\n .withFlexibleDimensions(true)\n .withViewportMargin(8)\n .withGrowAfterOpen(true)\n .withPush(true)\n .withPositions([\n {\n originX: \"end\",\n originY: \"bottom\",\n overlayX: \"end\",\n overlayY: \"top\",\n },\n ]);\n const overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: true,\n backdropClass: \"cdk-overlay-transparent-backdrop\",\n });\n const portal = new ComponentPortal(\n MatTableColumnConfigComponent<T>,\n this.viewContainerRef,\n this.viewContainerRef.injector\n );\n this._componentRef = overlayRef.attach(portal);\n\n overlayRef.backdropClick().subscribe(() => {\n overlayRef.detach();\n overlayRef.dispose();\n this._componentRef = null;\n });\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 \"../mat-multi-sort.directive\";\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 the library\n */\n\nexport * from \"./lib/mat-table-column-config\";\nexport * from \"./lib/mat-multi-sort.directive\";\nexport * from \"./lib/mat-table-column-config-trigger.directive\";\nexport * from \"./lib/mat-multi-sort-table-data-source\";\nexport * from \"./lib/mat-table-column-config-persistence.service\";\nexport * from \"./lib/mat-multi-sort-header/mat-multi-sort-header.component\";\nexport * from \"./lib/mat-multi-sort-control/mat-multi-sort-control.component\";\nexport * from \"./lib/mat-table-column-config/mat-table-column-config.component\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.MatTableColumnConfigPersistenceService","i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAaA;;;;;;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,YAAA,EAAA,aAAA,EAAA,UAAA,EAAA,8BAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,IAAA,CAAA,aAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,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,60CAAA,EAAA,MAAA,EAAA,CAAA,w1BAAA,CAAA,EAAA;8BAqBrD,WAAW,EAAA,CAAA;sBAAnB;gBAMQ,IAAI,EAAA,CAAA;sBAAZ;;;AEzCH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CdkDragDrop, DropListOrientation } from "@angular/cdk/drag-drop";
|
|
2
2
|
import { Sort } from "@angular/material/sort";
|
|
3
|
-
import { MatMultiSortDirective } from "
|
|
3
|
+
import { MatMultiSortDirective } from "../mat-multi-sort.directive";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class MatMultiSortControlComponent {
|
|
6
6
|
/**
|
|
@@ -1,7 +1,48 @@
|
|
|
1
|
-
import { WritableSignal } from "@angular/core";
|
|
2
|
-
import { MatSort, MatSortable, Sort, SortDirection } from "@angular/material/sort";
|
|
1
|
+
import { InjectionToken, WritableSignal } from "@angular/core";
|
|
2
|
+
import { MatSort, MatSortable, MatSortDefaultOptions, Sort, SortDirection } from "@angular/material/sort";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Injection token for the storage mechanism used to persist sorting state.
|
|
6
|
+
*
|
|
7
|
+
* This token can be used to provide a custom storage implementation for persisting
|
|
8
|
+
* the sorting state of a table. By default, it can be set to use localStorage, sessionStorage,
|
|
9
|
+
* or any other storage mechanism that implements the Storage interface.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare const SORT_PERSISTENCE_STORAGE: InjectionToken<Storage>;
|
|
13
|
+
/**
|
|
14
|
+
* Injection token used to enable or disable the persistence of sorting state.
|
|
15
|
+
*
|
|
16
|
+
* This token can be provided in the application's dependency injection system
|
|
17
|
+
* to control whether the sorting state of a table should be persisted across
|
|
18
|
+
* sessions or not.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // To enable sort persistence:
|
|
22
|
+
* providers: [
|
|
23
|
+
* { provide: SORT_PERSISTENCE_ENABLED, useValue: true }
|
|
24
|
+
* ]
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // To disable sort persistence:
|
|
28
|
+
* providers: [
|
|
29
|
+
* { provide: SORT_PERSISTENCE_ENABLED, useValue: false }
|
|
30
|
+
* ]
|
|
31
|
+
*/
|
|
32
|
+
export declare const SORT_PERSISTENCE_ENABLED: InjectionToken<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Injection token for the key used to persist sorting state.
|
|
35
|
+
*
|
|
36
|
+
* This token can be used to provide a custom key for storing
|
|
37
|
+
* the sorting state in a persistence layer, such as local storage
|
|
38
|
+
* or a database.
|
|
39
|
+
*/
|
|
40
|
+
export declare const SORT_PERSISTENCE_KEY: InjectionToken<string>;
|
|
4
41
|
export declare class MatMultiSortDirective extends MatSort {
|
|
42
|
+
isPersistenceEnabled: boolean;
|
|
43
|
+
private readonly key;
|
|
44
|
+
private readonly storage;
|
|
45
|
+
private readonly persistenceChanged;
|
|
5
46
|
/**
|
|
6
47
|
* A writable signal that holds an array of Sort objects.
|
|
7
48
|
* This signal is used to manage the sorting state of the table.
|
|
@@ -9,6 +50,7 @@ export declare class MatMultiSortDirective extends MatSort {
|
|
|
9
50
|
* @readonly
|
|
10
51
|
*/
|
|
11
52
|
readonly _sorts: WritableSignal<Sort[]>;
|
|
53
|
+
constructor(isPersistenceEnabled: boolean, key: string, storage: Storage, defaultOptions?: MatSortDefaultOptions | undefined);
|
|
12
54
|
/**
|
|
13
55
|
* Retrieves the sort direction for a given column ID.
|
|
14
56
|
*
|
|
@@ -54,6 +96,7 @@ export declare class MatMultiSortDirective extends MatSort {
|
|
|
54
96
|
* @returns void
|
|
55
97
|
*/
|
|
56
98
|
clearSorting(): void;
|
|
57
|
-
|
|
58
|
-
static
|
|
99
|
+
private persistSortSettings;
|
|
100
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatMultiSortDirective, [{ optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
101
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatMultiSortDirective, "[matMultiSort]", ["matMultiSort"], {}, { "persistenceChanged": "persistenceChanged"; }, never, never, true, never>;
|
|
59
102
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { CdkDragDrop } from "@angular/cdk/drag-drop";
|
|
2
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
3
|
import { TableColumn } from "../mat-table-column-config";
|
|
4
|
+
import { MatTableColumnConfigPersistenceService } from "../mat-table-column-config-persistence.service";
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class MatTableColumnConfigComponent<T> {
|
|
5
|
-
readonly
|
|
6
|
-
|
|
6
|
+
export declare class MatTableColumnConfigComponent<T> implements OnInit, OnDestroy {
|
|
7
|
+
private readonly persistenceService;
|
|
8
|
+
private subscription;
|
|
9
|
+
columns: TableColumn<T>[];
|
|
10
|
+
constructor(persistenceService: MatTableColumnConfigPersistenceService<T>);
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
ngOnDestroy(): void;
|
|
7
13
|
/**
|
|
8
14
|
* Handles the event when a dragged column is dropped.
|
|
9
15
|
* This method updates the order of columns based on the drag and drop action.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { TableColumn } from "./mat-table-column-config";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MatTableColumnConfigPersistenceService<T> {
|
|
5
|
+
isPersistenceEnabled: boolean;
|
|
6
|
+
private readonly key;
|
|
7
|
+
private readonly storage;
|
|
8
|
+
private readonly columns$;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the current table columns configuration.
|
|
11
|
+
*
|
|
12
|
+
* @returns {TableColumn<T>[]} An array of table columns.
|
|
13
|
+
*/
|
|
14
|
+
get columns(): TableColumn<T>[];
|
|
15
|
+
/**
|
|
16
|
+
* Sets the columns configuration for the table and persists the configuration.
|
|
17
|
+
*
|
|
18
|
+
* @param value - An array of `TableColumn<T>` representing the new column configuration.
|
|
19
|
+
*/
|
|
20
|
+
set columns(value: TableColumn<T>[]);
|
|
21
|
+
constructor(isPersistenceEnabled: boolean, key: string, storage: Storage);
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves an observable stream of table columns.
|
|
24
|
+
*
|
|
25
|
+
* @returns {Observable<TableColumn<T>[]>} An observable that emits an array of table columns.
|
|
26
|
+
*/
|
|
27
|
+
getColumns(): Observable<TableColumn<T>[]>;
|
|
28
|
+
private persistColumnConfig;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatTableColumnConfigPersistenceService<any>, [{ optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MatTableColumnConfigPersistenceService<any>>;
|
|
31
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Overlay } from "@angular/cdk/overlay";
|
|
2
2
|
import { ComponentRef, ElementRef, ViewContainerRef } from "@angular/core";
|
|
3
|
-
import { TableColumn } from "./mat-table-column-config";
|
|
4
3
|
import { MatTableColumnConfigComponent } from "./mat-table-column-config/mat-table-column-config.component";
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
5
|
export declare class MatTableColumnConfigTriggerDirective<T> {
|
|
@@ -8,14 +7,6 @@ export declare class MatTableColumnConfigTriggerDirective<T> {
|
|
|
8
7
|
private readonly overlay;
|
|
9
8
|
private readonly viewContainerRef;
|
|
10
9
|
private _componentRef;
|
|
11
|
-
/**
|
|
12
|
-
* Input property that accepts an array of table column configurations.
|
|
13
|
-
* The alias for this input property is "matTableColumnConfigTrigger".
|
|
14
|
-
* This property is required.
|
|
15
|
-
*
|
|
16
|
-
* @type {TableColumn<T>[]} columns - The array of table column configurations.
|
|
17
|
-
*/
|
|
18
|
-
columns: TableColumn<T>[];
|
|
19
10
|
/**
|
|
20
11
|
* Gets the reference to the MatTableColumnConfigComponent.
|
|
21
12
|
*
|
|
@@ -26,5 +17,5 @@ export declare class MatTableColumnConfigTriggerDirective<T> {
|
|
|
26
17
|
constructor(elementRef: ElementRef, overlay: Overlay, viewContainerRef: ViewContainerRef);
|
|
27
18
|
onClick(): void;
|
|
28
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatTableColumnConfigTriggerDirective<any>, never>;
|
|
29
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MatTableColumnConfigTriggerDirective<any>, "[matTableColumnConfigTrigger]", ["matTableColumnConfigTrigger"], {
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatTableColumnConfigTriggerDirective<any>, "[matTableColumnConfigTrigger]", ["matTableColumnConfigTrigger"], {}, {}, never, never, true, never>;
|
|
30
21
|
}
|
|
@@ -10,11 +10,23 @@ export interface TableColumn<T> {
|
|
|
10
10
|
visible: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Injection token for
|
|
13
|
+
* Injection token for the storage mechanism used to persist column configuration.
|
|
14
14
|
*
|
|
15
|
-
* This token
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
15
|
+
* This token can be used to provide a custom storage implementation for saving
|
|
16
|
+
* and retrieving the state of table column configurations.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export declare const COLUMN_CONFIG_PERSISTENCE_STORAGE: InjectionToken<Storage>;
|
|
20
|
+
/**
|
|
21
|
+
* Injection token used to enable or disable column configuration persistence.
|
|
22
|
+
*
|
|
23
|
+
* This token can be provided with a boolean value to indicate whether the
|
|
24
|
+
* column configurations should be persisted (e.g., in local storage or a database).
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export declare const COLUMN_CONFIG_PERSISTENCE_ENABLED: InjectionToken<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Injection token for the column configuration persistence key.
|
|
30
|
+
* This token is used to provide a unique key for persisting column configurations.
|
|
19
31
|
*/
|
|
20
|
-
export declare const
|
|
32
|
+
export declare const COLUMN_CONFIG_PERSISTENCE_KEY: InjectionToken<string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-mat-table-multi-sort",
|
|
3
|
-
"version": "19.
|
|
4
|
-
"preview":
|
|
3
|
+
"version": "19.3.0-pre.0",
|
|
4
|
+
"preview": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "info@philipgerke.com",
|
|
@@ -30,12 +30,13 @@
|
|
|
30
30
|
"tslib": "^2.8.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@angular/
|
|
34
|
-
"@angular/
|
|
35
|
-
"@angular/
|
|
36
|
-
"@angular/
|
|
37
|
-
"@angular/forms": "^19.
|
|
38
|
-
"@angular/material": "^19.
|
|
33
|
+
"@angular/animations": "^19.1.4",
|
|
34
|
+
"@angular/cdk": "^19.1.2",
|
|
35
|
+
"@angular/common": "^19.1.4",
|
|
36
|
+
"@angular/core": "^19.1.4",
|
|
37
|
+
"@angular/forms": "^19.1.4",
|
|
38
|
+
"@angular/material": "^19.1.2",
|
|
39
|
+
"rxjs": "^7.8.1"
|
|
39
40
|
},
|
|
40
41
|
"sideEffects": false,
|
|
41
42
|
"module": "fesm2022/ngx-mat-table-multi-sort.mjs",
|
package/public-api.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./lib/mat-table-column-config";
|
|
|
2
2
|
export * from "./lib/mat-multi-sort.directive";
|
|
3
3
|
export * from "./lib/mat-table-column-config-trigger.directive";
|
|
4
4
|
export * from "./lib/mat-multi-sort-table-data-source";
|
|
5
|
+
export * from "./lib/mat-table-column-config-persistence.service";
|
|
5
6
|
export * from "./lib/mat-multi-sort-header/mat-multi-sort-header.component";
|
|
6
7
|
export * from "./lib/mat-multi-sort-control/mat-multi-sort-control.component";
|
|
7
8
|
export * from "./lib/mat-table-column-config/mat-table-column-config.component";
|