@rxap/material-table-system 12.5.4 → 12.5.7

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('__');
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,CAAC;IAC7D,CAAC;IAQM,QAAQ;QACb,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,WAAW,KAAK,MAAM,EAAE;YAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACpB;QACD,IAAI,WAAW,KAAK,OAAO,EAAE;YAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACrB;IACH,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,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;yEAvCb,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 } 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.route.snapshot.url.map(u => u.path).join('__');\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,iBAAiB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MA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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"]}
@@ -853,9 +853,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
853
853
  }] });
854
854
 
855
855
  class TableColumnOptionComponent {
856
- constructor(_element, route) {
856
+ constructor(_element, router) {
857
857
  this._element = _element;
858
- this.route = route;
858
+ this.router = router;
859
859
  this.active = true;
860
860
  this._hidden = false;
861
861
  }
@@ -879,7 +879,7 @@ class TableColumnOptionComponent {
879
879
  this._hidden = !value;
880
880
  }
881
881
  get cacheId() {
882
- return this.route.snapshot.url.map(u => u.path).join('__');
882
+ return this.router.url + '--' + this.name;
883
883
  }
884
884
  ngOnInit() {
885
885
  const cachedValue = localStorage.getItem(this.cacheId);
@@ -903,7 +903,7 @@ class TableColumnOptionComponent {
903
903
  localStorage.setItem(this.cacheId, 'false');
904
904
  }
905
905
  }
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 });
906
+ 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
907
  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
908
  __decorate([
909
909
  Required,
@@ -919,7 +919,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
919
919
  }], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
920
920
  type: Inject,
921
921
  args: [ElementRef]
922
- }] }, { type: i1$4.ActivatedRoute }]; }, propDecorators: { name: [{
922
+ }] }, { type: i1$4.Router }]; }, propDecorators: { name: [{
923
923
  type: Input
924
924
  }], active: [{
925
925
  type: Input
@@ -1722,12 +1722,17 @@ class OptionsCellComponent {
1722
1722
  constructor(renderer) {
1723
1723
  this.renderer = renderer;
1724
1724
  this._subscription = new Subscription();
1725
+ this._initialised = false;
1725
1726
  this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;
1726
1727
  this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;
1727
1728
  }
1728
1729
  ngAfterContentInit() {
1729
1730
  // Hide the mat-option elements
1730
1731
  this._subscription.add(this.options.changes.pipe(startWith(null), tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))).subscribe());
1732
+ this.setViewValue();
1733
+ this._initialised = true;
1734
+ }
1735
+ setViewValue() {
1731
1736
  if (this.value === undefined || this.value === null) {
1732
1737
  this.viewValue = this.emptyViewValue;
1733
1738
  }
@@ -1742,6 +1747,13 @@ class OptionsCellComponent {
1742
1747
  }
1743
1748
  }
1744
1749
  }
1750
+ ngOnChanges(changes) {
1751
+ if (this._initialised) {
1752
+ if (changes['value']) {
1753
+ this.setViewValue();
1754
+ }
1755
+ }
1756
+ }
1745
1757
  getViewValue() {
1746
1758
  var _a, _b;
1747
1759
  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 +1764,7 @@ class OptionsCellComponent {
1752
1764
  }
1753
1765
  }
1754
1766
  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 });
1767
+ 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
1768
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OptionsCellComponent, decorators: [{
1757
1769
  type: Component,
1758
1770
  args: [{