@rxap/material-table-system 14.0.0 → 14.0.1
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/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 +19 -10
- package/fesm2015/rxap-material-table-system.mjs.map +1 -1
- package/fesm2020/rxap-material-table-system.mjs +19 -10
- package/fesm2020/rxap-material-table-system.mjs.map +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';
|
|
@@ -487,12 +487,23 @@ class TableFilterService {
|
|
|
487
487
|
constructor() {
|
|
488
488
|
this.change = new ReplaySubject(1);
|
|
489
489
|
this.current = {};
|
|
490
|
+
/**
|
|
491
|
+
* a flag to indicate whether any value was already send to the change subject
|
|
492
|
+
* true - a value was send
|
|
493
|
+
* false - no value was send
|
|
494
|
+
* @private
|
|
495
|
+
*/
|
|
496
|
+
this._init = false;
|
|
490
497
|
this._subscription = this.change.subscribe(current => this.current = current);
|
|
491
498
|
}
|
|
492
499
|
setMap(map) {
|
|
493
500
|
const current = this.current;
|
|
494
|
-
const
|
|
495
|
-
|
|
501
|
+
const copy = clone(this.current);
|
|
502
|
+
const next = DeleteEmptyProperties(Object.assign(current, map));
|
|
503
|
+
if (!this._init || !equals(copy, next)) {
|
|
504
|
+
this._init = true;
|
|
505
|
+
this.change.next(next);
|
|
506
|
+
}
|
|
496
507
|
}
|
|
497
508
|
set(key, value) {
|
|
498
509
|
const current = this.current;
|
|
@@ -737,9 +748,7 @@ class FilterHeaderRowDirective extends FormDirective {
|
|
|
737
748
|
ngOnInit() {
|
|
738
749
|
super.ngOnInit();
|
|
739
750
|
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)))
|
|
751
|
+
.pipe(debounceTime(1000), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
|
|
743
752
|
.subscribe();
|
|
744
753
|
}
|
|
745
754
|
ngOnDestroy() {
|
|
@@ -982,10 +991,10 @@ class TableShowArchivedSlideComponent {
|
|
|
982
991
|
}
|
|
983
992
|
}
|
|
984
993
|
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)\"
|
|
994
|
+
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
995
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableShowArchivedSlideComponent, decorators: [{
|
|
987
996
|
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)\"
|
|
997
|
+
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
998
|
}], ctorParameters: function () { return [{ type: TableFilterService }, { type: TableColumnMenuComponent }]; } });
|
|
990
999
|
|
|
991
1000
|
class TableShowArchivedSlideComponentModule {
|
|
@@ -1349,10 +1358,10 @@ class TableSelectControlsComponent {
|
|
|
1349
1358
|
}
|
|
1350
1359
|
}
|
|
1351
1360
|
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\"
|
|
1361
|
+
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
1362
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableSelectControlsComponent, decorators: [{
|
|
1354
1363
|
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\"
|
|
1364
|
+
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
1365
|
}], ctorParameters: function () { return [{ type: SelectRowService }, { type: undefined, decorators: [{
|
|
1357
1366
|
type: Inject,
|
|
1358
1367
|
args: [RXAP_WINDOW_REF]
|