@rxap/material-table-system 12.5.5 → 12.5.8

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.
@@ -7,12 +7,17 @@ export class OptionsCellComponent {
7
7
  constructor(renderer) {
8
8
  this.renderer = renderer;
9
9
  this._subscription = new Subscription();
10
+ this._initialised = false;
10
11
  this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;
11
12
  this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;
12
13
  }
13
14
  ngAfterContentInit() {
14
15
  // Hide the mat-option elements
15
16
  this._subscription.add(this.options.changes.pipe(startWith(null), tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))).subscribe());
17
+ this.setViewValue();
18
+ this._initialised = true;
19
+ }
20
+ setViewValue() {
16
21
  if (this.value === undefined || this.value === null) {
17
22
  this.viewValue = this.emptyViewValue;
18
23
  }
@@ -27,6 +32,13 @@ export class OptionsCellComponent {
27
32
  }
28
33
  }
29
34
  }
35
+ ngOnChanges(changes) {
36
+ if (this._initialised) {
37
+ if (changes['value']) {
38
+ this.setViewValue();
39
+ }
40
+ }
41
+ }
30
42
  getViewValue() {
31
43
  var _a, _b;
32
44
  return ((_b = (_a = this.options.find((option) => option.value === this.value)) === null || _a === void 0 ? void 0 : _a.viewValue) !== null && _b !== void 0 ? _b : this.defaultViewValue);
@@ -37,7 +49,7 @@ export class OptionsCellComponent {
37
49
  }
38
50
  }
39
51
  OptionsCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OptionsCellComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
40
- OptionsCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: OptionsCellComponent, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, host: { classAttribute: "rxap-options-cell" }, queries: [{ propertyName: "options", predicate: MatOption, descendants: true }], ngImport: i0, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
52
+ OptionsCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: OptionsCellComponent, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, host: { classAttribute: "rxap-options-cell" }, queries: [{ propertyName: "options", predicate: MatOption, descendants: true }], usesOnChanges: true, ngImport: i0, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
41
53
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OptionsCellComponent, decorators: [{
42
54
  type: Component,
43
55
  args: [{
@@ -1 +1 @@
1
- {"version":3,"file":"options-cell.component.js","sourceRoot":"","sources":["../../../../../../../../libs/material/table-system/src/lib/cells/options-cell/options-cell.component.ts","../../../../../../../../libs/material/table-system/src/lib/cells/options-cell/options-cell.component.html"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,KAAK,EACL,eAAe,EAEf,SAAS,EAET,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,GAAG,EACH,SAAS,EACV,MAAM,gBAAgB,CAAC;;AASxB,MAAM,OAAO,oBAAoB;IAc/B,YAA6B,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;QAF/B,kBAAa,GAAG,IAAI,YAAY,EAAE,CAAC;QAGlD,IAAI,CAAC,gBAAgB,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tB,CAAC;IACJ,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,aAAa,0CAAE,WAAW,EAAE,CAAC;IACpC,CAAC;;kHArDU,oBAAoB;sGAApB,oBAAoB,uRAmBd,SAAS,gDC5C5B,4CAEA;4FDuBa,oBAAoB;kBAPhC,SAAS;mBAAC;oBACT,QAAQ,EAAS,uBAAuB;oBACxC,WAAW,EAAM,+BAA+B;oBAChD,SAAS,EAAQ,CAAE,+BAA+B,CAAE;oBACpD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,IAAI,EAAa,EAAE,KAAK,EAAE,mBAAmB,EAAE;iBAChD;gGAGQ,KAAK;sBADX,KAAK;uBAAC,mBAAmB;gBAInB,gBAAgB;sBADtB,KAAK;uBAAC,SAAS;gBAIT,cAAc;sBADpB,KAAK;uBAAC,OAAO;gBAaP,OAAO;sBADb,eAAe;uBAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE","sourcesContent":["import type { QueryList } from '@angular/core';\nimport {\n Component,\n ChangeDetectionStrategy,\n Input,\n ContentChildren,\n AfterContentInit,\n isDevMode,\n OnDestroy,\n Renderer2\n} from '@angular/core';\nimport { MatOption } from '@angular/material/core';\nimport { Subscription } from 'rxjs';\nimport {\n tap,\n startWith\n} from 'rxjs/operators';\n\n@Component({\n selector: 'td[rxap-options-cell]',\n templateUrl: './options-cell.component.html',\n styleUrls: [ './options-cell.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-options-cell' }\n})\nexport class OptionsCellComponent implements AfterContentInit, OnDestroy {\n @Input('rxap-options-cell')\n public value: any;\n\n @Input('default')\n public defaultViewValue!: string;\n\n @Input('empty')\n public emptyViewValue!: string;\n\n public viewValue!: string;\n\n private readonly _subscription = new Subscription();\n\n constructor(private readonly renderer: Renderer2) {\n this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;\n this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;\n }\n\n @ContentChildren(MatOption, { descendants: true })\n public options!: QueryList<MatOption>;\n\n public ngAfterContentInit() {\n // Hide the mat-option elements\n this._subscription.add(this.options.changes.pipe(\n startWith(null),\n tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))\n ).subscribe());\n if (this.value === undefined || this.value === null) {\n this.viewValue = this.emptyViewValue;\n } else {\n if (this.options) {\n this._subscription.add(this.options.changes\n .pipe(\n startWith(null),\n tap(() => (this.viewValue = this.getViewValue()))\n )\n .subscribe());\n } else if (isDevMode()) {\n console.log('Could not load any option');\n }\n }\n }\n\n public getViewValue(): string {\n return (\n this.options.find((option) => option.value === this.value)?.viewValue ??\n this.defaultViewValue\n );\n }\n\n public ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n}\n","{{viewValue}}\n<ng-content></ng-content>\n"]}
1
+ {"version":3,"file":"options-cell.component.js","sourceRoot":"","sources":["../../../../../../../../libs/material/table-system/src/lib/cells/options-cell/options-cell.component.ts","../../../../../../../../libs/material/table-system/src/lib/cells/options-cell/options-cell.component.html"],"names":[],"mappings":"AAKA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,KAAK,EACL,eAAe,EAEf,SAAS,EAET,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,GAAG,EACH,SAAS,EACV,MAAM,gBAAgB,CAAC;;AASxB,MAAM,OAAO,oBAAoB;IAgB/B,YAA6B,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;QAJ/B,kBAAa,GAAG,IAAI,YAAY,EAAE,CAAC;QAE5C,iBAAY,GAAG,KAAK,CAAC;QAG3B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC,yEAAyE;QACrG,IAAI,CAAC,cAAc,GAAK,EAAE,CAAC,CAAC,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ACjB,OAAO,CACL,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,0CAAE,SAAS,mCACrE,IAAI,CAAC,gBAAgB,CACtB,CAAC;IACJ,CAAC;IAEM,WAAW;;QAChB,MAAA,IAAI,CAAC,aAAa,0CAAE,WAAW,EAAE,CAAC;IACpC,CAAC;;kHApEU,oBAAoB;sGAApB,oBAAoB,uRAqBd,SAAS,qEClD5B,4CAEA;4FD2Ba,oBAAoB;kBAPhC,SAAS;mBAAC;oBACT,QAAQ,EAAS,uBAAuB;oBACxC,WAAW,EAAM,+BAA+B;oBAChD,SAAS,EAAQ,CAAE,+BAA+B,CAAE;oBACpD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,IAAI,EAAa,EAAE,KAAK,EAAE,mBAAmB,EAAE;iBAChD;gGAGQ,KAAK;sBADX,KAAK;uBAAC,mBAAmB;gBAInB,gBAAgB;sBADtB,KAAK;uBAAC,SAAS;gBAIT,cAAc;sBADpB,KAAK;uBAAC,OAAO;gBAeP,OAAO;sBADb,eAAe;uBAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE","sourcesContent":["import type {\n QueryList,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\nimport {\n Component,\n ChangeDetectionStrategy,\n Input,\n ContentChildren,\n AfterContentInit,\n isDevMode,\n OnDestroy,\n Renderer2\n} from '@angular/core';\nimport { MatOption } from '@angular/material/core';\nimport { Subscription } from 'rxjs';\nimport {\n tap,\n startWith\n} from 'rxjs/operators';\n\n@Component({\n selector: 'td[rxap-options-cell]',\n templateUrl: './options-cell.component.html',\n styleUrls: [ './options-cell.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-options-cell' }\n})\nexport class OptionsCellComponent implements AfterContentInit, OnDestroy, OnChanges {\n @Input('rxap-options-cell')\n public value: any;\n\n @Input('default')\n public defaultViewValue!: string;\n\n @Input('empty')\n public emptyViewValue!: string;\n\n public viewValue!: string;\n\n private readonly _subscription = new Subscription();\n\n private _initialised = false;\n\n constructor(private readonly renderer: Renderer2) {\n this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;\n this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;\n }\n\n @ContentChildren(MatOption, { descendants: true })\n public options!: QueryList<MatOption>;\n\n public ngAfterContentInit() {\n // Hide the mat-option elements\n this._subscription.add(this.options.changes.pipe(\n startWith(null),\n tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))\n ).subscribe());\n this.setViewValue();\n this._initialised = true;\n }\n\n public setViewValue() {\n if (this.value === undefined || this.value === null) {\n this.viewValue = this.emptyViewValue;\n } else {\n if (this.options) {\n this._subscription.add(this.options.changes\n .pipe(\n startWith(null),\n tap(() => (this.viewValue = this.getViewValue()))\n )\n .subscribe());\n } else if (isDevMode()) {\n console.log('Could not load any option');\n }\n }\n }\n\n public ngOnChanges(changes: SimpleChanges) {\n if (this._initialised) {\n if (changes['value']) {\n this.setViewValue();\n }\n }\n }\n\n public getViewValue(): string {\n return (\n this.options.find((option) => option.value === this.value)?.viewValue ??\n this.defaultViewValue\n );\n }\n\n public ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n}\n","{{viewValue}}\n<ng-content></ng-content>\n"]}
@@ -1,13 +1,13 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Component, ElementRef, Input, Inject } from '@angular/core';
3
- import { ActivatedRoute } from '@angular/router';
3
+ import { Router } from '@angular/router';
4
4
  import { coerceBoolean, Required } from '@rxap/utilities';
5
5
  import * as i0 from "@angular/core";
6
6
  import * as i1 from "@angular/router";
7
7
  export class TableColumnOptionComponent {
8
- constructor(_element, route) {
8
+ constructor(_element, router) {
9
9
  this._element = _element;
10
- this.route = route;
10
+ this.router = router;
11
11
  this.active = true;
12
12
  this._hidden = false;
13
13
  }
@@ -31,7 +31,7 @@ export class TableColumnOptionComponent {
31
31
  this._hidden = !value;
32
32
  }
33
33
  get cacheId() {
34
- return this.route.snapshot.url.map(u => u.path).join('__') + '--' + this.name;
34
+ return this.router.url + '--' + this.name;
35
35
  }
36
36
  ngOnInit() {
37
37
  const cachedValue = localStorage.getItem(this.cacheId);
@@ -55,7 +55,7 @@ export class TableColumnOptionComponent {
55
55
  localStorage.setItem(this.cacheId, 'false');
56
56
  }
57
57
  }
58
- TableColumnOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TableColumnOptionComponent, deps: [{ token: ElementRef }, { token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
58
+ TableColumnOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TableColumnOptionComponent, deps: [{ token: ElementRef }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
59
59
  TableColumnOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TableColumnOptionComponent, selector: "rxap-table-column-option", inputs: { name: "name", active: "active", inactive: "inactive", hidden: "hidden", show: "show" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""] });
60
60
  __decorate([
61
61
  Required,
@@ -71,7 +71,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
71
71
  }], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
72
72
  type: Inject,
73
73
  args: [ElementRef]
74
- }] }, { type: i1.ActivatedRoute }]; }, propDecorators: { name: [{
74
+ }] }, { type: i1.Router }]; }, propDecorators: { name: [{
75
75
  type: Input
76
76
  }], active: [{
77
77
  type: Input
@@ -1 +1 @@
1
- {"version":3,"file":"table-column-option.component.js","sourceRoot":"","sources":["../../../../../../../../libs/material/table-system/src/lib/table-column-menu/table-column-option/table-column-option.component.ts","../../../../../../../../libs/material/table-system/src/lib/table-column-menu/table-column-option/table-column-option.component.html"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;;;AAO1D,MAAM,OAAO,0BAA0B;IAyCrC,YAEU,QAAiC,EACxB,KAAqB;QAD9B,aAAQ,GAAR,QAAQ,CAAyB;QACxB,UAAK,GAAL,KAAK,CAAgB;QAtCjC,WAAM,GAAY,IAAI,CAAC;QAwBtB,YAAO,GAAG,KAAK,CAAC;IAerB,CAAC;IArCJ;;;OAGG;IACH,IAAI,OAAO;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAChE,CAAC;IAED,IACW,QAAQ,CAAC,KAAmB;QACrC,IAAI,CAAC,MAAM,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,IACW,MAAM,CAAC,KAAmB;QACnC,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAID,IACW,IAAI,CAAC,KAAc;QAC5B,IAAI,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,IAAY,OAAO;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAChF,CAAC;IAQM,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@angular/router';\nimport { coerceBoolean, Required } from '@rxap/utilities';\n\n@Component({\n selector: 'rxap-table-column-option',\n templateUrl: './table-column-option.component.html',\n styleUrls: ['./table-column-option.component.css'],\n})\nexport class TableColumnOptionComponent implements OnInit {\n @Input()\n @Required\n public name!: string;\n\n @Input()\n public active: boolean = true;\n\n /**\n * The displayed value of the option. It is necessary to show the selected option in the\n * select's trigger.\n */\n get display(): string {\n return (this._element.nativeElement.textContent || '').trim();\n }\n\n @Input()\n public set inactive(value: boolean | '') {\n this.active = !coerceBoolean(value);\n }\n\n @Input()\n public set hidden(value: boolean | '') {\n this._hidden = coerceBoolean(value);\n }\n\n public get hidden(): boolean | '' {\n return this._hidden;\n }\n\n private _hidden = false;\n\n @Input()\n public set show(value: boolean) {\n this._hidden = !value;\n }\n\n private get cacheId(): string {\n return this.route.snapshot.url.map(u => u.path).join('__') + '--' + this.name;\n }\n\n constructor(\n @Inject(ElementRef)\n private _element: ElementRef<HTMLElement>,\n private readonly route: ActivatedRoute,\n ) {}\n\n public ngOnInit() {\n const cachedValue = localStorage.getItem(this.cacheId);\n if (cachedValue === 'true') {\n this.active = true;\n }\n if (cachedValue === 'false') {\n this.active = false;\n }\n }\n\n public toggle(): void {\n this.active = !this.active;\n localStorage.setItem(this.cacheId, this.active ? 'true' : 'false');\n }\n\n public activate() {\n this.active = true;\n localStorage.setItem(this.cacheId, 'true');\n }\n\n public deactivate() {\n this.active = false;\n localStorage.setItem(this.cacheId, 'false');\n }\n}\n","<ng-content></ng-content>\n"]}
1
+ {"version":3,"file":"table-column-option.component.js","sourceRoot":"","sources":["../../../../../../../../libs/material/table-system/src/lib/table-column-menu/table-column-option/table-column-option.component.ts","../../../../../../../../libs/material/table-system/src/lib/table-column-menu/table-column-option/table-column-option.component.html"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkB,MAAM,EAAE,MAAM,iBA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,MAAM,CAAC;QAC3B,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;IAEM,QAAQ;QACb,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;;wHAtEU,0BAA0B,kBA0C3B,UAAU;4GA1CT,0BAA0B,kKCfvC,6BACA;ADiBE;IADC,QAAQ;;wDACY;4FAHV,0BAA0B;kBALtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,WAAW,EAAE,sCAAsC;oBACnD,SAAS,EAAE,CAAC,qCAAqC,CAAC;iBACnD;;0BA2CI,MAAM;2BAAC,UAAU;iEAvCb,IAAI;sBAFV,KAAK;gBAKC,MAAM;sBADZ,KAAK;gBAYK,QAAQ;sBADlB,KAAK;gBAMK,MAAM;sBADhB,KAAK;gBAYK,IAAI;sBADd,KAAK","sourcesContent":["import {\n Component,\n ElementRef,\n Input,\n Inject,\n OnInit\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { coerceBoolean, Required } from '@rxap/utilities';\n\n@Component({\n selector: 'rxap-table-column-option',\n templateUrl: './table-column-option.component.html',\n styleUrls: ['./table-column-option.component.css'],\n})\nexport class TableColumnOptionComponent implements OnInit {\n @Input()\n @Required\n public name!: string;\n\n @Input()\n public active: boolean = true;\n\n /**\n * The displayed value of the option. It is necessary to show the selected option in the\n * select's trigger.\n */\n get display(): string {\n return (this._element.nativeElement.textContent || '').trim();\n }\n\n @Input()\n public set inactive(value: boolean | '') {\n this.active = !coerceBoolean(value);\n }\n\n @Input()\n public set hidden(value: boolean | '') {\n this._hidden = coerceBoolean(value);\n }\n\n public get hidden(): boolean | '' {\n return this._hidden;\n }\n\n private _hidden = false;\n\n @Input()\n public set show(value: boolean) {\n this._hidden = !value;\n }\n\n private get cacheId(): string {\n return this.router.url + '--' + this.name;\n }\n\n constructor(\n @Inject(ElementRef)\n private _element: ElementRef<HTMLElement>,\n private readonly router: Router,\n ) {}\n\n public ngOnInit() {\n const cachedValue = localStorage.getItem(this.cacheId);\n if (cachedValue === 'true') {\n this.active = true;\n }\n if (cachedValue === 'false') {\n this.active = false;\n }\n }\n\n public toggle(): void {\n this.active = !this.active;\n localStorage.setItem(this.cacheId, this.active ? 'true' : 'false');\n }\n\n public activate() {\n this.active = true;\n localStorage.setItem(this.cacheId, 'true');\n }\n\n public deactivate() {\n this.active = false;\n localStorage.setItem(this.cacheId, 'false');\n }\n}\n","<ng-content></ng-content>\n"]}
@@ -16,7 +16,6 @@ export class FilterHeaderRowDirective extends FormDirective {
16
16
  super.ngOnInit();
17
17
  this._subscription = this.form.value$
18
18
  .pipe(debounceTime(1000), map((values) => Object.entries(values)
19
- .filter(([key, value]) => value !== null && value !== undefined && value !== '')
20
19
  .reduce((obj, [key, value]) => (Object.assign(Object.assign({}, obj), { [key]: value })), {})), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
21
20
  .subscribe();
22
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"filter-header-row.directive.js","sourceRoot":"","sources":["../../../../../../../libs/material/table-system/src/lib/table-filter/filter-header-row.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,MAAM,EAGN,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EACL,YA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;QACpB,MAAA,IAAI,CAAC,aAAa,0CAAE,WAAW,EAAE,CAAC;IACpC,CAAC;;sHAtCU,wBAAwB,qFAUzB,iCAAiC;0GAVhC,wBAAwB,wDARxB;QACT;YACE,OAAO,EAAE,gBAAgB;YACzB,kBAAkB;YAClB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;SACxD;KACF;4FAEU,wBAAwB;kBAXpC,SAAS;mBAAC;oBACT,8CAA8C;oBAC9C,QAAQ,EAAE,+BAA+B;oBACzC,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,gBAAgB;4BACzB,kBAAkB;4BAClB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC;yBACxD;qBACF;iBACF;;0BAUI,QAAQ;;0BACR,MAAM;2BAAC,iCAAiC","sourcesContent":["import {\n FormDirective,\n FormDefinition\n} from '@rxap/forms';\nimport {\n ChangeDetectorRef,\n Directive,\n forwardRef,\n Inject,\n OnDestroy,\n OnInit,\n Optional\n} from '@angular/core';\nimport { TableFilterService } from './table-filter.service';\nimport { Subscription } from 'rxjs';\nimport {\n debounceTime,\n distinctUntilChanged,\n map,\n tap\n} from 'rxjs/operators';\nimport { RXAP_TABLE_FILTER_FORM_DEFINITION } from './tokens';\nimport { ControlContainer } from '@angular/forms';\nimport { equals } from '@rxap/utilities';\n\n@Directive({\n // tslint:disable-next-line:directive-selector\n selector: 'table[rxap-filter-header-row]',\n providers: [\n {\n provide: ControlContainer,\n // ignore coverage\n useExisting: forwardRef(() => FilterHeaderRowDirective),\n },\n ],\n})\nexport class FilterHeaderRowDirective\n extends FormDirective\n implements OnInit, OnDestroy\n{\n private _subscription?: Subscription;\n\n constructor(\n private readonly tableFilter: TableFilterService,\n cdr: ChangeDetectorRef,\n @Optional()\n @Inject(RXAP_TABLE_FILTER_FORM_DEFINITION)\n formDefinition: FormDefinition | null\n ) {\n super(cdr, formDefinition);\n }\n\n public ngOnInit() {\n super.ngOnInit();\n this._subscription = this.form.value$\n .pipe(\n debounceTime(1000),\n map((values) =>\n Object.entries(values)\n .filter(\n ([key, value]) =>\n value !== null && value !== undefined && value !== ''\n )\n .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {})\n ),\n distinctUntilChanged((a, b) => equals(a, b)),\n tap(values => this.tableFilter.setMap(values))\n )\n .subscribe();\n }\n\n public ngOnDestroy() {\n super.ngOnDestroy();\n this._subscription?.unsubscribe();\n }\n}\n"]}
1
+ {"version":3,"file":"filter-header-row.directive.js","sourceRoot":"","sources":["../../../../../../../libs/material/table-system/src/lib/table-filter/filter-header-row.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,MAAM,EAGN,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,GAAG,EACH,GAAG,EACJ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;;;AAazC,MAAM,OAAO,wBACX,SAAQ,aAAa;IAKrB,YACmB,WAA+B,EAChD,GAAsB,EAGtB,cAAqC;QAErC,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QANV,gBAAW,GAAX,WAAW,CAAoB;IAOlD,CAAC;IAEM,QAAQ;QACb,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM;aAClC,IAAI,CACH,YAAY,CAAC,IAAI,CAAC,EAClB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACb,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;aACnB,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,iCAAM,GAAG,KAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAG,EAAE,EAAE,CAAC,CACjE,EACD,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAC5C,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAC/C;aACA,SAAS,EAAE,CAAC;IACjB,CAAC;IAEM,WAAW;;QAChB,KAAK,CAAC,WAAW,EAAE,CAAC;QACpB,MAAA,IAAI,CAAC,aAAa,0CAAE,WAAW,EAAE,CAAC;IACpC,CAAC;;sHAlCU,wBAAwB,qFAUzB,iCAAiC;0GAVhC,wBAAwB,wDARxB;QACT;YACE,OAAO,EAAE,gBAAgB;YACzB,kBAAkB;YAClB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;SACxD;KACF;4FAEU,wBAAwB;kBAXpC,SAAS;mBAAC;oBACT,8CAA8C;oBAC9C,QAAQ,EAAE,+BAA+B;oBACzC,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,gBAAgB;4BACzB,kBAAkB;4BAClB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC;yBACxD;qBACF;iBACF;;0BAUI,QAAQ;;0BACR,MAAM;2BAAC,iCAAiC","sourcesContent":["import {\n FormDirective,\n FormDefinition\n} from '@rxap/forms';\nimport {\n ChangeDetectorRef,\n Directive,\n forwardRef,\n Inject,\n OnDestroy,\n OnInit,\n Optional\n} from '@angular/core';\nimport { TableFilterService } from './table-filter.service';\nimport { Subscription } from 'rxjs';\nimport {\n debounceTime,\n distinctUntilChanged,\n map,\n tap\n} from 'rxjs/operators';\nimport { RXAP_TABLE_FILTER_FORM_DEFINITION } from './tokens';\nimport { ControlContainer } from '@angular/forms';\nimport { equals } from '@rxap/utilities';\n\n@Directive({\n // tslint:disable-next-line:directive-selector\n selector: 'table[rxap-filter-header-row]',\n providers: [\n {\n provide: ControlContainer,\n // ignore coverage\n useExisting: forwardRef(() => FilterHeaderRowDirective),\n },\n ],\n})\nexport class FilterHeaderRowDirective\n extends FormDirective\n implements OnInit, OnDestroy\n{\n private _subscription?: Subscription;\n\n constructor(\n private readonly tableFilter: TableFilterService,\n cdr: ChangeDetectorRef,\n @Optional()\n @Inject(RXAP_TABLE_FILTER_FORM_DEFINITION)\n formDefinition: FormDefinition | null\n ) {\n super(cdr, formDefinition);\n }\n\n public ngOnInit() {\n super.ngOnInit();\n this._subscription = this.form.value$\n .pipe(\n debounceTime(1000),\n map((values) =>\n Object.entries(values)\n .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {})\n ),\n distinctUntilChanged((a, b) => equals(a, b)),\n tap(values => this.tableFilter.setMap(values))\n )\n .subscribe();\n }\n\n public ngOnDestroy() {\n super.ngOnDestroy();\n this._subscription?.unsubscribe();\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import { Injectable } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
+ import { DeleteEmptyProperties } from '@rxap/utilities';
3
4
  import * as i0 from "@angular/core";
4
5
  export class TableFilterService {
5
6
  constructor() {
@@ -9,13 +10,18 @@ export class TableFilterService {
9
10
  }
10
11
  setMap(map) {
11
12
  const current = this.current;
12
- const next = Object.assign(current, map);
13
+ const next = DeleteEmptyProperties(Object.assign(current, map));
13
14
  this.change.next(next);
14
15
  }
15
16
  set(key, value) {
16
- const current = this.current;
17
- current[key] = value;
18
- this.change.next(current);
17
+ if (value === null || value === undefined || value === '') {
18
+ this.remove(key);
19
+ }
20
+ else {
21
+ const current = this.current;
22
+ current[key] = value;
23
+ this.change.next(current);
24
+ }
19
25
  }
20
26
  remove(key) {
21
27
  const current = this.current;
@@ -1 +1 @@
1
- {"version":3,"file":"table-filter.service.js","sourceRoot":"","sources":["../../../../../../../libs/material/table-system/src/lib/table-filter/table-filter.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAEX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EAEd,MAAM,MAAM,CAAC;;AAGd,MAAM,OAAO,kBAAkB;IAQ7B;QANgB,WAAM,GAAG,IAAI,aAAa,CAAsB,CAAC,CAAC,CAAC;QAE5D,YAAO,GAAwB,EAAE,CAAC;QAKvC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;IAChF,CAAC;IAEM,MAAM,CAAC,GAAwB;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,KAAU;QAChC,MAAM,OAAO,GAAI,IAAI,CAAC,OAAO,CAAC;QAC9B,OAAO,CAAE,GAAG,CAAE,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,GAAW;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC/B,OAAO,OAAO,CAAE,GAAG,CAAE,CAAC;SACvB;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAEM,WAAW;QAChB,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;IACnC,CAAC;;gHAlCU,kBAAkB;oHAAlB,kBAAkB;4FAAlB,kBAAkB;kBAD9B,UAAU","sourcesContent":["import { FilterLike } from '@rxap/data-source/table';\nimport {\n Injectable,\n OnDestroy\n} from '@angular/core';\nimport {\n ReplaySubject,\n Subscription\n} from 'rxjs';\n\n@Injectable()\nexport class TableFilterService implements FilterLike, OnDestroy {\n\n public readonly change = new ReplaySubject<Record<string, any>>(1);\n\n public current: Record<string, any> = {};\n\n private _subscription: Subscription;\n\n constructor() {\n this._subscription = this.change.subscribe(current => this.current = current);\n }\n\n public setMap(map: Record<string, any>): void {\n const current = this.current;\n const next = Object.assign(current, map);\n this.change.next(next);\n }\n\n public set(key: string, value: any): void {\n const current = this.current;\n current[ key ] = value;\n this.change.next(current);\n }\n\n public remove(key: string): void {\n const current = this.current;\n if (current.hasOwnProperty(key)) {\n delete current[ key ];\n }\n this.change.next(current);\n }\n\n public ngOnDestroy() {\n this._subscription.unsubscribe();\n }\n\n}\n"]}
1
+ {"version":3,"file":"table-filter.service.js","sourceRoot":"","sources":["../../../../../../../libs/material/table-system/src/lib/table-filter/table-filter.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAEX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EAEd,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;;AAGxD,MAAM,OAAO,kBAAkB;IAQ7B;QANgB,WAAM,GAAG,IAAI,aAAa,CAAsB,CAAC,CAAC,CAAC;QAE5D,YAAO,GAAwB,EAAE,CAAC;QAKvC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;IAChF,CAAC;IAEM,MAAM,CAAC,GAAwB;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,KAAU;QAChC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE;YACzD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAClB;aAAM;YACL,MAAM,OAAO,GAAI,IAAI,CAAC,OAAO,CAAC;YAC9B,OAAO,CAAE,GAAG,CAAE,GAAG,KAAK,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC3B;IACH,CAAC;IAEM,MAAM,CAAC,GAAW;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC/B,OAAO,OAAO,CAAE,GAAG,CAAE,CAAC;SACvB;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAEM,WAAW;QAChB,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;IACnC,CAAC;;gHAtCU,kBAAkB;oHAAlB,kBAAkB;4FAAlB,kBAAkB;kBAD9B,UAAU","sourcesContent":["import { FilterLike } from '@rxap/data-source/table';\nimport {\n Injectable,\n OnDestroy\n} from '@angular/core';\nimport {\n ReplaySubject,\n Subscription\n} from 'rxjs';\nimport { DeleteEmptyProperties } from '@rxap/utilities';\n\n@Injectable()\nexport class TableFilterService implements FilterLike, OnDestroy {\n\n public readonly change = new ReplaySubject<Record<string, any>>(1);\n\n public current: Record<string, any> = {};\n\n private _subscription: Subscription;\n\n constructor() {\n this._subscription = this.change.subscribe(current => this.current = current);\n }\n\n public setMap(map: Record<string, any>): void {\n const current = this.current;\n const next = DeleteEmptyProperties(Object.assign(current, map));\n this.change.next(next);\n }\n\n public set(key: string, value: any): void {\n if (value === null || value === undefined || value === '') {\n this.remove(key);\n } else {\n const current = this.current;\n current[ key ] = value;\n this.change.next(current);\n }\n }\n\n public remove(key: string): void {\n const current = this.current;\n if (current.hasOwnProperty(key)) {\n delete current[ key ];\n }\n this.change.next(current);\n }\n\n public ngOnDestroy() {\n this._subscription.unsubscribe();\n }\n\n}\n"]}
@@ -3,7 +3,7 @@ import { TemplateRef, Directive, Inject, Injectable, ViewContainerRef, Component
3
3
  import { __decorate, __metadata, __awaiter } 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, 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';
@@ -528,13 +528,18 @@ class TableFilterService {
528
528
  }
529
529
  setMap(map) {
530
530
  const current = this.current;
531
- const next = Object.assign(current, map);
531
+ const next = DeleteEmptyProperties(Object.assign(current, map));
532
532
  this.change.next(next);
533
533
  }
534
534
  set(key, value) {
535
- const current = this.current;
536
- current[key] = value;
537
- this.change.next(current);
535
+ if (value === null || value === undefined || value === '') {
536
+ this.remove(key);
537
+ }
538
+ else {
539
+ const current = this.current;
540
+ current[key] = value;
541
+ this.change.next(current);
542
+ }
538
543
  }
539
544
  remove(key) {
540
545
  const current = this.current;
@@ -779,7 +784,6 @@ class FilterHeaderRowDirective extends FormDirective {
779
784
  super.ngOnInit();
780
785
  this._subscription = this.form.value$
781
786
  .pipe(debounceTime(1000), map((values) => Object.entries(values)
782
- .filter(([key, value]) => value !== null && value !== undefined && value !== '')
783
787
  .reduce((obj, [key, value]) => (Object.assign(Object.assign({}, obj), { [key]: value })), {})), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
784
788
  .subscribe();
785
789
  }
@@ -853,9 +857,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
853
857
  }] });
854
858
 
855
859
  class TableColumnOptionComponent {
856
- constructor(_element, route) {
860
+ constructor(_element, router) {
857
861
  this._element = _element;
858
- this.route = route;
862
+ this.router = router;
859
863
  this.active = true;
860
864
  this._hidden = false;
861
865
  }
@@ -879,7 +883,7 @@ class TableColumnOptionComponent {
879
883
  this._hidden = !value;
880
884
  }
881
885
  get cacheId() {
882
- return this.route.snapshot.url.map(u => u.path).join('__') + '--' + this.name;
886
+ return this.router.url + '--' + this.name;
883
887
  }
884
888
  ngOnInit() {
885
889
  const cachedValue = localStorage.getItem(this.cacheId);
@@ -903,7 +907,7 @@ class TableColumnOptionComponent {
903
907
  localStorage.setItem(this.cacheId, 'false');
904
908
  }
905
909
  }
906
- TableColumnOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TableColumnOptionComponent, deps: [{ token: ElementRef }, { token: i1$4.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
910
+ TableColumnOptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TableColumnOptionComponent, deps: [{ token: ElementRef }, { token: i1$4.Router }], target: i0.ɵɵFactoryTarget.Component });
907
911
  TableColumnOptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TableColumnOptionComponent, selector: "rxap-table-column-option", inputs: { name: "name", active: "active", inactive: "inactive", hidden: "hidden", show: "show" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""] });
908
912
  __decorate([
909
913
  Required,
@@ -919,7 +923,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
919
923
  }], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
920
924
  type: Inject,
921
925
  args: [ElementRef]
922
- }] }, { type: i1$4.ActivatedRoute }]; }, propDecorators: { name: [{
926
+ }] }, { type: i1$4.Router }]; }, propDecorators: { name: [{
923
927
  type: Input
924
928
  }], active: [{
925
929
  type: Input
@@ -1722,12 +1726,17 @@ class OptionsCellComponent {
1722
1726
  constructor(renderer) {
1723
1727
  this.renderer = renderer;
1724
1728
  this._subscription = new Subscription();
1729
+ this._initialised = false;
1725
1730
  this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;
1726
1731
  this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;
1727
1732
  }
1728
1733
  ngAfterContentInit() {
1729
1734
  // Hide the mat-option elements
1730
1735
  this._subscription.add(this.options.changes.pipe(startWith(null), tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))).subscribe());
1736
+ this.setViewValue();
1737
+ this._initialised = true;
1738
+ }
1739
+ setViewValue() {
1731
1740
  if (this.value === undefined || this.value === null) {
1732
1741
  this.viewValue = this.emptyViewValue;
1733
1742
  }
@@ -1742,6 +1751,13 @@ class OptionsCellComponent {
1742
1751
  }
1743
1752
  }
1744
1753
  }
1754
+ ngOnChanges(changes) {
1755
+ if (this._initialised) {
1756
+ if (changes['value']) {
1757
+ this.setViewValue();
1758
+ }
1759
+ }
1760
+ }
1745
1761
  getViewValue() {
1746
1762
  var _a, _b;
1747
1763
  return ((_b = (_a = this.options.find((option) => option.value === this.value)) === null || _a === void 0 ? void 0 : _a.viewValue) !== null && _b !== void 0 ? _b : this.defaultViewValue);
@@ -1752,7 +1768,7 @@ class OptionsCellComponent {
1752
1768
  }
1753
1769
  }
1754
1770
  OptionsCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OptionsCellComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1755
- OptionsCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: OptionsCellComponent, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, host: { classAttribute: "rxap-options-cell" }, queries: [{ propertyName: "options", predicate: MatOption, descendants: true }], ngImport: i0, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1771
+ OptionsCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: OptionsCellComponent, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, host: { classAttribute: "rxap-options-cell" }, queries: [{ propertyName: "options", predicate: MatOption, descendants: true }], usesOnChanges: true, ngImport: i0, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1756
1772
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OptionsCellComponent, decorators: [{
1757
1773
  type: Component,
1758
1774
  args: [{