@rxap/material-table-system 14.0.0 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/select-row/select-row.options.mjs +1 -1
- package/esm2020/lib/select-row/select-row.service.mjs +2 -5
- package/esm2020/lib/table-column-menu/table-show-archived-slide/table-show-archived-slide.component.mjs +3 -3
- package/esm2020/lib/table-filter/filter-header-row.directive.mjs +3 -5
- package/esm2020/lib/table-filter/table-filter.service.mjs +15 -3
- package/esm2020/lib/table-select-controls/table-select-controls.component.mjs +3 -3
- package/fesm2015/rxap-material-table-system.mjs +20 -14
- package/fesm2015/rxap-material-table-system.mjs.map +1 -1
- package/fesm2020/rxap-material-table-system.mjs +20 -14
- package/fesm2020/rxap-material-table-system.mjs.map +1 -1
- package/lib/select-row/select-row.options.d.ts +3 -1
- package/lib/select-row/tokens.d.ts +1 -1
- package/lib/table-filter/table-filter.service.d.ts +7 -0
- package/package.json +8 -7
|
@@ -3,7 +3,7 @@ import { TemplateRef, Directive, Inject, Injectable, ViewContainerRef, Component
|
|
|
3
3
|
import { __decorate, __metadata } from 'tslib';
|
|
4
4
|
import * as i1 from '@angular/cdk/portal';
|
|
5
5
|
import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
6
|
-
import { Required, equals, coerceBoolean, coerceArray } from '@rxap/utilities';
|
|
6
|
+
import { Required, clone, DeleteEmptyProperties, equals, coerceBoolean, coerceArray } from '@rxap/utilities';
|
|
7
7
|
import { trigger, state, style, transition, animate, sequence } from '@angular/animations';
|
|
8
8
|
import { BehaviorSubject, EMPTY, ReplaySubject, Subscription, Subject, isObservable, of } from 'rxjs';
|
|
9
9
|
import { map, filter, tap, distinctUntilChanged, debounceTime, delay, startWith } from 'rxjs/operators';
|
|
@@ -283,10 +283,7 @@ const RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS = new InjectionToken('rxap-m
|
|
|
283
283
|
class SelectRowService {
|
|
284
284
|
constructor(options = null) {
|
|
285
285
|
this.selectionModel = new SelectionModel(true);
|
|
286
|
-
this.selectionModel = new SelectionModel(options?.multiple);
|
|
287
|
-
if (options?.selected) {
|
|
288
|
-
this.selectionModel.select(...options?.selected);
|
|
289
|
-
}
|
|
286
|
+
this.selectionModel = new SelectionModel(options?.multiple, options?.selected, options?.emitChanges, options?.compareWith);
|
|
290
287
|
this.selectedRows$ = this.selectionModel.changed.pipe(map(() => this.selectionModel.selected));
|
|
291
288
|
}
|
|
292
289
|
get selectedRows() {
|
|
@@ -487,12 +484,23 @@ class TableFilterService {
|
|
|
487
484
|
constructor() {
|
|
488
485
|
this.change = new ReplaySubject(1);
|
|
489
486
|
this.current = {};
|
|
487
|
+
/**
|
|
488
|
+
* a flag to indicate whether any value was already send to the change subject
|
|
489
|
+
* true - a value was send
|
|
490
|
+
* false - no value was send
|
|
491
|
+
* @private
|
|
492
|
+
*/
|
|
493
|
+
this._init = false;
|
|
490
494
|
this._subscription = this.change.subscribe(current => this.current = current);
|
|
491
495
|
}
|
|
492
496
|
setMap(map) {
|
|
493
497
|
const current = this.current;
|
|
494
|
-
const
|
|
495
|
-
|
|
498
|
+
const copy = clone(this.current);
|
|
499
|
+
const next = DeleteEmptyProperties(Object.assign(current, map));
|
|
500
|
+
if (!this._init || !equals(copy, next)) {
|
|
501
|
+
this._init = true;
|
|
502
|
+
this.change.next(next);
|
|
503
|
+
}
|
|
496
504
|
}
|
|
497
505
|
set(key, value) {
|
|
498
506
|
const current = this.current;
|
|
@@ -737,9 +745,7 @@ class FilterHeaderRowDirective extends FormDirective {
|
|
|
737
745
|
ngOnInit() {
|
|
738
746
|
super.ngOnInit();
|
|
739
747
|
this._subscription = this.form.value$
|
|
740
|
-
.pipe(debounceTime(1000),
|
|
741
|
-
.filter(([key, value]) => value !== null && value !== undefined && value !== '')
|
|
742
|
-
.reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {})), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
|
|
748
|
+
.pipe(debounceTime(1000), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
|
|
743
749
|
.subscribe();
|
|
744
750
|
}
|
|
745
751
|
ngOnDestroy() {
|
|
@@ -982,10 +988,10 @@ class TableShowArchivedSlideComponent {
|
|
|
982
988
|
}
|
|
983
989
|
}
|
|
984
990
|
TableShowArchivedSlideComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableShowArchivedSlideComponent, deps: [{ token: TableFilterService }, { token: TableColumnMenuComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
985
|
-
TableShowArchivedSlideComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: TableShowArchivedSlideComponent, selector: "mfd-table-show-archived-slide", host: { classAttribute: "mfd-table-show-archived-slide" }, ngImport: i0, template: "<div rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\"
|
|
991
|
+
TableShowArchivedSlideComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: TableShowArchivedSlideComponent, selector: "mfd-table-show-archived-slide", host: { classAttribute: "mfd-table-show-archived-slide" }, ngImport: i0, template: "<div rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\">\n <ng-container i18n>Show archived documents</ng-container>\n </mat-slide-toggle>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i6.StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "component", type: i4$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
986
992
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableShowArchivedSlideComponent, decorators: [{
|
|
987
993
|
type: Component,
|
|
988
|
-
args: [{ selector: 'mfd-table-show-archived-slide', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'mfd-table-show-archived-slide' }, template: "<div rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\"
|
|
994
|
+
args: [{ selector: 'mfd-table-show-archived-slide', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'mfd-table-show-archived-slide' }, template: "<div rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\">\n <ng-container i18n>Show archived documents</ng-container>\n </mat-slide-toggle>\n</div>\n" }]
|
|
989
995
|
}], ctorParameters: function () { return [{ type: TableFilterService }, { type: TableColumnMenuComponent }]; } });
|
|
990
996
|
|
|
991
997
|
class TableShowArchivedSlideComponentModule {
|
|
@@ -1349,10 +1355,10 @@ class TableSelectControlsComponent {
|
|
|
1349
1355
|
}
|
|
1350
1356
|
}
|
|
1351
1357
|
TableSelectControlsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableSelectControlsComponent, deps: [{ token: SelectRowService }, { token: RXAP_WINDOW_REF }], target: i0.ɵɵFactoryTarget.Component });
|
|
1352
|
-
TableSelectControlsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: TableSelectControlsComponent, selector: "mfd-table-select-controls", host: { classAttribute: "mfd-table-select-controls" }, ngImport: i0, template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button fxFlex=\"nogrow\" mat-stroked-button (click)=\"cancel()\" type=\"button\"
|
|
1358
|
+
TableSelectControlsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: TableSelectControlsComponent, selector: "mfd-table-select-controls", host: { classAttribute: "mfd-table-select-controls" }, ngImport: i0, template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button fxFlex=\"nogrow\" mat-stroked-button (click)=\"cancel()\" type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button fxFlex=\"nogrow\" mat-raised-button (click)=\"select()\" type=\"button\" [disabled]=\"hasNotSelected$ | async\">\n <ng-container i18n>Select</ng-container>\n </button>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1353
1359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableSelectControlsComponent, decorators: [{
|
|
1354
1360
|
type: Component,
|
|
1355
|
-
args: [{ selector: 'mfd-table-select-controls', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'mfd-table-select-controls' }, template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button fxFlex=\"nogrow\" mat-stroked-button (click)=\"cancel()\" type=\"button\"
|
|
1361
|
+
args: [{ selector: 'mfd-table-select-controls', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'mfd-table-select-controls' }, template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button fxFlex=\"nogrow\" mat-stroked-button (click)=\"cancel()\" type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button fxFlex=\"nogrow\" mat-raised-button (click)=\"select()\" type=\"button\" [disabled]=\"hasNotSelected$ | async\">\n <ng-container i18n>Select</ng-container>\n </button>\n</div>\n" }]
|
|
1356
1362
|
}], ctorParameters: function () { return [{ type: SelectRowService }, { type: undefined, decorators: [{
|
|
1357
1363
|
type: Inject,
|
|
1358
1364
|
args: [RXAP_WINDOW_REF]
|