@eherve/angular-material-datatable 19.25.0 → 19.26.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.
Files changed (26) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/eherve-angular-material-datatable.mjs +3023 -1
  3. package/fesm2022/eherve-angular-material-datatable.mjs.map +1 -1
  4. package/lib/datatable.component.d.ts +10 -0
  5. package/lib/directives/datatable-row-viewport.directive.d.ts +22 -0
  6. package/lib/pipes/safe-html.pipe.d.ts +2 -1
  7. package/lib/types/datatable-column.type.d.ts +2 -1
  8. package/package.json +1 -1
  9. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs +0 -26
  10. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs.map +0 -1
  11. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs +0 -103
  12. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs.map +0 -1
  13. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs +0 -35
  14. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs.map +0 -1
  15. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs +0 -26
  16. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs.map +0 -1
  17. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs +0 -45
  18. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs.map +0 -1
  19. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs +0 -2650
  20. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs.map +0 -1
  21. package/fesm2022/eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs +0 -19
  22. package/fesm2022/eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs.map +0 -1
  23. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs +0 -20
  24. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs.map +0 -1
  25. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs +0 -21
  26. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs.map +0 -1
@@ -25,6 +25,7 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
25
25
  displayedColumns: string[];
26
26
  visibleColumnsColspan: number;
27
27
  disabledRows: Record[];
28
+ protected renderedRows: Set<Record>;
28
29
  dataSource: DatagridDataSource<Record>;
29
30
  expandedRow: any | null;
30
31
  loaded: boolean;
@@ -48,11 +49,16 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
48
49
  paginationPageSize: number;
49
50
  paginationPageIndex: number;
50
51
  searchFormGroup: FormGroup;
52
+ protected searchControlNames: {
53
+ [columnDef: string]: string;
54
+ };
51
55
  private subscriptions;
52
56
  private changeDetectorRef;
53
57
  private defaultOptions;
54
58
  private incrementalLoadToken;
55
59
  private restoredState?;
60
+ private rowRenderChangeScheduled;
61
+ private destroyed;
56
62
  get data(): Record[] | undefined;
57
63
  private _data?;
58
64
  container?: ElementRef<HTMLDivElement>;
@@ -78,6 +84,7 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
78
84
  private loadInitialPage;
79
85
  private loadFirstPage;
80
86
  private updateLoadedDataState;
87
+ private pruneRenderedRows;
81
88
  private buildDisabledRows;
82
89
  updateColumns: UpdateColumn<Record>[];
83
90
  openUpdateColumnDisplay(): void;
@@ -85,6 +92,7 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
85
92
  closeUpdateColumnDisplay(): void;
86
93
  rowClick(row: Record): void;
87
94
  rowKeydown(event: KeyboardEvent, row: Record): void;
95
+ protected renderRow(row: Record): void;
88
96
  facetClick(column: DatatableColumn<Record> | undefined, result: NgxMatDatasourceResultFacet, option: FacetOptionsOptions): void;
89
97
  private buildDisplayColumns;
90
98
  private prepareLoadModeOptions;
@@ -99,6 +107,8 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
99
107
  private updateHasMoreRecordsState;
100
108
  private updateIncrementalRowState;
101
109
  private buildSearchFormGroup;
110
+ private getSearchValues;
111
+ private getSearchControlName;
102
112
  private consolidateOrderIndex;
103
113
  private applyConfig;
104
114
  private applyState;
@@ -0,0 +1,22 @@
1
+ import { EventEmitter, OnChanges, OnDestroy } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DatatableRowViewportObserverService implements OnDestroy {
4
+ private observer?;
5
+ private callbacks;
6
+ observe(element: Element, callback: () => void): void;
7
+ unobserve(element: Element): void;
8
+ ngOnDestroy(): void;
9
+ private getObserver;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableRowViewportObserverService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<DatatableRowViewportObserverService>;
12
+ }
13
+ export declare class DatatableRowViewportDirective<Record = any> implements OnChanges, OnDestroy {
14
+ datatableRowViewport: Record;
15
+ datatableRowVisible: EventEmitter<Record>;
16
+ private elementRef;
17
+ private observerService;
18
+ ngOnChanges(): void;
19
+ ngOnDestroy(): void;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatatableRowViewportDirective<any>, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DatatableRowViewportDirective<any>, "[datatableRowViewport]", never, { "datatableRowViewport": { "alias": "datatableRowViewport"; "required": true; }; }, { "datatableRowVisible": "datatableRowVisible"; }, never, never, true, never>;
22
+ }
@@ -1,9 +1,10 @@
1
1
  import { DomSanitizer } from '@angular/platform-browser';
2
+ import type { SafeHtml } from '@angular/platform-browser';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class SafeHtmlPipe {
4
5
  private sanitizer;
5
6
  constructor(sanitizer: DomSanitizer);
6
- transform(html: string | null | undefined): string;
7
+ transform(html: string | null | undefined): SafeHtml;
7
8
  static ɵfac: i0.ɵɵFactoryDeclaration<SafeHtmlPipe, never>;
8
9
  static ɵpipe: i0.ɵɵPipeDeclaration<SafeHtmlPipe, "safeHtml", true>;
9
10
  }
@@ -2,7 +2,7 @@
2
2
  import { ComponentType } from '@angular/cdk/portal';
3
3
  import { Observable } from 'rxjs';
4
4
  import { PipeFunction } from '../pipes/suffix-function.pipe';
5
- import { NgxMatDatasourceRequestOrderDir } from './datasource-service.type';
5
+ import { NgxMatDatasourceRequestColumnType, NgxMatDatasourceRequestOrderDir } from './datasource-service.type';
6
6
  type Color<Record> = string | ((row: Record) => string | undefined);
7
7
  type BaseColumn = {
8
8
  type?: string;
@@ -17,6 +17,7 @@ type BaseColumn = {
17
17
  disabled?: boolean;
18
18
  searchable?: boolean;
19
19
  searchProperty?: string;
20
+ searchType?: NgxMatDatasourceRequestColumnType;
20
21
  searchValue?: any;
21
22
  sortable?: boolean;
22
23
  sortProperty?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eherve/angular-material-datatable",
3
- "version": "19.25.0",
3
+ "version": "19.26.1",
4
4
  "author": "Eric Herve <eric.herve.95@gmail.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,26 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Component, Input } from '@angular/core';
4
- import * as i5 from '@angular/material/icon';
5
- import { MatIconModule } from '@angular/material/icon';
6
- import { GetPipe } from './eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs';
7
- import { TransformPipe } from './eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs';
8
-
9
- /** @format */
10
- class CellCheckboxValueComponent {
11
- column;
12
- row;
13
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellCheckboxValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
14
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellCheckboxValueComponent, isStandalone: true, selector: "lib-cell-checkbox-value", inputs: { column: "column", row: "row" }, ngImport: i0, template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n@if (value === false) {\n <mat-icon>check_box_outline_blank</mat-icon>\n} @else if (value === true) {\n <mat-icon>check_box</mat-icon>\n}\n", styles: ["mat-icon{color:currentColor;padding:8px;box-sizing:content-box}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TransformPipe, name: "transform" }] });
15
- }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellCheckboxValueComponent, decorators: [{
17
- type: Component,
18
- args: [{ selector: 'lib-cell-checkbox-value', imports: [CommonModule, GetPipe, MatIconModule, TransformPipe], template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n@if (value === false) {\n <mat-icon>check_box_outline_blank</mat-icon>\n} @else if (value === true) {\n <mat-icon>check_box</mat-icon>\n}\n", styles: ["mat-icon{color:currentColor;padding:8px;box-sizing:content-box}\n"] }]
19
- }], propDecorators: { column: [{
20
- type: Input
21
- }], row: [{
22
- type: Input
23
- }] } });
24
-
25
- export { CellCheckboxValueComponent };
26
- //# sourceMappingURL=eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs","sources":["../../../projects/datatable/src/lib/components/cell-checkbox-value/cell-checkbox-value.component.ts","../../../projects/datatable/src/lib/components/cell-checkbox-value/cell-checkbox-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { TransformPipe } from '../../pipes/transform.pipe';\nimport { DatatableCheckboxColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-checkbox-value',\n imports: [CommonModule, GetPipe, MatIconModule, TransformPipe],\n templateUrl: './cell-checkbox-value.component.html',\n styleUrl: './cell-checkbox-value.component.scss',\n})\nexport class CellCheckboxValueComponent<Record> {\n @Input()\n column!: DatatableCheckboxColumn<Record>;\n\n @Input()\n row: any;\n}\n","<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n@if (value === false) {\n <mat-icon>check_box_outline_blank</mat-icon>\n} @else if (value === true) {\n <mat-icon>check_box</mat-icon>\n}\n"],"names":["i1"],"mappings":";;;;;;;;AAAA;MAea,0BAA0B,CAAA;AAErC,IAAA,MAAM;AAGN,IAAA,GAAG;uGALQ,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,GAAA,EAAA,KAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfvC,uOAQA,EDGY,MAAA,EAAA,CAAA,mEAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,0BAAE,OAAO,EAAA,IAAA,EAAA,KAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,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,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAIlD,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,SAAS;+BACE,yBAAyB,EAAA,OAAA,EAC1B,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,uOAAA,EAAA,MAAA,EAAA,CAAA,mEAAA,CAAA,EAAA;8BAM9D,MAAM,EAAA,CAAA;sBADL;gBAID,GAAG,EAAA,CAAA;sBADF;;;;;"}
@@ -1,103 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, Pipe, inject, ChangeDetectorRef, Component, Input } from '@angular/core';
4
- import { MatIconModule } from '@angular/material/icon';
5
- import { interval, share } from 'rxjs';
6
- import moment from 'moment';
7
- import { g as get, d as duration } from './eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs';
8
-
9
- /** @format */
10
- class DateRefreshService {
11
- intervals = new Map();
12
- forInterval(refreshTime) {
13
- let ticks = this.intervals.get(refreshTime);
14
- if (!ticks) {
15
- ticks = interval(refreshTime).pipe(share());
16
- this.intervals.set(refreshTime, ticks);
17
- }
18
- return ticks;
19
- }
20
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DateRefreshService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
21
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DateRefreshService, providedIn: 'root' });
22
- }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: DateRefreshService, decorators: [{
24
- type: Injectable,
25
- args: [{ providedIn: 'root' }]
26
- }] });
27
-
28
- /** @format */
29
- class MomentFormatPipe {
30
- transform(data, options) {
31
- const date = this.getMoment(data);
32
- if (!date)
33
- return '';
34
- const format = options?.format || 'LLL';
35
- return options?.locale ? date.locale(options.locale).format(format) : date.format(format);
36
- }
37
- getMoment(data) {
38
- if (typeof data === 'string')
39
- return moment(data);
40
- if (typeof data === 'number')
41
- return moment(data);
42
- if (data instanceof Date)
43
- return moment(data);
44
- if (moment.isMoment(data))
45
- return data.clone();
46
- if (typeof data?.valueOf === 'function') {
47
- const value = data.valueOf();
48
- if (typeof value === 'number')
49
- return moment(data);
50
- }
51
- return null;
52
- }
53
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
54
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, isStandalone: true, name: "momentFormat" });
55
- }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, decorators: [{
57
- type: Pipe,
58
- args: [{ name: 'momentFormat' }]
59
- }] });
60
-
61
- /** @format */
62
- class CellDateValueComponent {
63
- changeDetectorRef = inject(ChangeDetectorRef);
64
- dateRefreshService = inject(DateRefreshService);
65
- column;
66
- set setRow(row) {
67
- this.row = row;
68
- this.value = get(this.row, this.column.property);
69
- if (typeof this.column.transform === 'function') {
70
- this.value = this.column.transform(this.value, this.row);
71
- }
72
- this.duration = duration(this.value, this.column);
73
- }
74
- row;
75
- value;
76
- duration;
77
- refreshSubscription;
78
- ngOnInit() {
79
- if (!this.column.withDuration || !this.column.durationRefreshTime)
80
- return;
81
- this.refreshSubscription = this.dateRefreshService.forInterval(this.column.durationRefreshTime).subscribe(() => {
82
- this.duration = duration(this.value, this.column);
83
- this.changeDetectorRef.detectChanges();
84
- });
85
- }
86
- ngOnDestroy() {
87
- this.refreshSubscription?.unsubscribe();
88
- }
89
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDateValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
90
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellDateValueComponent, isStandalone: true, selector: "lib-cell-date-value", inputs: { column: "column", setRow: ["row", "setRow"] }, ngImport: i0, template: "<!-- @format -->\n\n@if (value) {\n <span class=\"date\"> {{ value | momentFormat: column }} </span>\n @if (column.withDuration) {\n <span class=\"duration\"> ({{ duration }}) </span>\n }\n}\n", styles: [".date,.duration{white-space:nowrap}.duration{margin-left:4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "pipe", type: MomentFormatPipe, name: "momentFormat" }] });
91
- }
92
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDateValueComponent, decorators: [{
93
- type: Component,
94
- args: [{ selector: 'lib-cell-date-value', imports: [CommonModule, MatIconModule, MomentFormatPipe], template: "<!-- @format -->\n\n@if (value) {\n <span class=\"date\"> {{ value | momentFormat: column }} </span>\n @if (column.withDuration) {\n <span class=\"duration\"> ({{ duration }}) </span>\n }\n}\n", styles: [".date,.duration{white-space:nowrap}.duration{margin-left:4px}\n"] }]
95
- }], propDecorators: { column: [{
96
- type: Input
97
- }], setRow: [{
98
- type: Input,
99
- args: ['row']
100
- }] } });
101
-
102
- export { CellDateValueComponent };
103
- //# sourceMappingURL=eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs","sources":["../../../projects/datatable/src/lib/date-refresh.service.ts","../../../projects/datatable/src/lib/pipes/moment-format.pipe.ts","../../../projects/datatable/src/lib/components/cell-date-value/cell-date-value.component.ts","../../../projects/datatable/src/lib/components/cell-date-value/cell-date-value.component.html"],"sourcesContent":["/** @format */\n\nimport { Injectable } from '@angular/core';\nimport { interval, Observable, share } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class DateRefreshService {\n private readonly intervals = new Map<number, Observable<number>>();\n\n forInterval(refreshTime: number): Observable<number> {\n let ticks = this.intervals.get(refreshTime);\n if (!ticks) {\n ticks = interval(refreshTime).pipe(share());\n this.intervals.set(refreshTime, ticks);\n }\n return ticks;\n }\n}\n","/** @format */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport moment, { Moment } from 'moment';\n\n@Pipe({ name: 'momentFormat' })\nexport class MomentFormatPipe implements PipeTransform {\n transform(data: any, options: { format?: string; locale?: string }): string {\n const date = this.getMoment(data);\n if (!date) return '';\n const format = options?.format || 'LLL';\n return options?.locale ? date.locale(options.locale).format(format) : date.format(format);\n }\n\n private getMoment(data: any): Moment | null {\n if (typeof data === 'string') return moment(data);\n if (typeof data === 'number') return moment(data);\n if (data instanceof Date) return moment(data);\n if (moment.isMoment(data)) return data.clone();\n if (typeof data?.valueOf === 'function') {\n const value = data.valueOf();\n if (typeof value === 'number') return moment(data);\n }\n return null;\n }\n}\n","/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { Subscription } from 'rxjs';\nimport { DateRefreshService } from '../../date-refresh.service';\nimport { MomentFormatPipe } from '../../pipes/moment-format.pipe';\nimport { duration } from '../../tools/duration.tool';\nimport { get } from '../../tools/get.tool';\nimport { DatatableDateColumn, DatatableValueColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-date-value',\n imports: [CommonModule, MatIconModule, MomentFormatPipe],\n templateUrl: './cell-date-value.component.html',\n styleUrl: './cell-date-value.component.scss',\n})\nexport class CellDateValueComponent<Record> implements OnInit, OnDestroy {\n private changeDetectorRef = inject(ChangeDetectorRef);\n private dateRefreshService = inject(DateRefreshService);\n\n @Input()\n column!: DatatableDateColumn<Record>;\n\n @Input('row')\n set setRow(row: any) {\n this.row = row;\n this.value = get(this.row, this.column.property);\n if (typeof (this.column as DatatableValueColumn<Record>).transform === 'function') {\n this.value = (this.column as DatatableValueColumn<Record>).transform!(this.value, this.row);\n }\n this.duration = duration(this.value, this.column);\n }\n row: any;\n\n value?: any;\n duration?: string | null;\n\n private refreshSubscription?: Subscription;\n\n ngOnInit(): void {\n if (!this.column.withDuration || !this.column.durationRefreshTime) return;\n this.refreshSubscription = this.dateRefreshService.forInterval(this.column.durationRefreshTime).subscribe(() => {\n this.duration = duration(this.value, this.column);\n this.changeDetectorRef.detectChanges();\n });\n }\n\n ngOnDestroy(): void {\n this.refreshSubscription?.unsubscribe();\n }\n}\n","<!-- @format -->\n\n@if (value) {\n <span class=\"date\"> {{ value | momentFormat: column }} </span>\n @if (column.withDuration) {\n <span class=\"duration\"> ({{ duration }}) </span>\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;MAMa,kBAAkB,CAAA;AACZ,IAAA,SAAS,GAAG,IAAI,GAAG,EAA8B;AAElE,IAAA,WAAW,CAAC,WAAmB,EAAA;QAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC;QAC3C,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAC3C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC;;AAExC,QAAA,OAAO,KAAK;;uGATH,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,E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C,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;AACjD,YAAA,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE;AACxC,SAAC,CAAC;;IAGJ,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,mBAAmB,EAAE,WAAW,EAAE;;uGAhC9B,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,wIClBnC,wMAQA,EAAA,MAAA,EAAA,CAAA,iEAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDMY,YAAY,EAAE,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,aAAa,0BAAE,gBAAgB,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA,EAAA,CAAA;;2FAI5C,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBANlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,WACtB,CAAC,YAAY,EAAE,aAAa,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,wMAAA,EAAA,MAAA,EAAA,CAAA,iEAAA,CAAA,EAAA;8BASxD,MAAM,EAAA,CAAA;sBADL;gBAIG,MAAM,EAAA,CAAA;sBADT,KAAK;uBAAC,KAAK;;;;;"}
@@ -1,35 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Component, Input } from '@angular/core';
4
- import { MatIconModule } from '@angular/material/icon';
5
- import { g as get, d as duration } from './eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs';
6
-
7
- /** @format */
8
- class CellDurationValueComponent {
9
- column;
10
- set setRow(row) {
11
- this.row = row;
12
- this.value = get(this.row, this.column.property);
13
- if (typeof this.column.transform === 'function') {
14
- this.value = this.column.transform(this.value, this.row);
15
- }
16
- this.duration = duration(this.value, this.column);
17
- }
18
- row;
19
- value;
20
- duration;
21
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDurationValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellDurationValueComponent, isStandalone: true, selector: "lib-cell-duration-value", inputs: { column: "column", setRow: ["row", "setRow"] }, ngImport: i0, template: "<!-- @format -->\n\n@if (duration !== null) {\n {{ duration }}\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }] });
23
- }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDurationValueComponent, decorators: [{
25
- type: Component,
26
- args: [{ selector: 'lib-cell-duration-value', imports: [CommonModule, MatIconModule], template: "<!-- @format -->\n\n@if (duration !== null) {\n {{ duration }}\n}\n" }]
27
- }], propDecorators: { column: [{
28
- type: Input
29
- }], setRow: [{
30
- type: Input,
31
- args: ['row']
32
- }] } });
33
-
34
- export { CellDurationValueComponent };
35
- //# sourceMappingURL=eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs","sources":["../../../projects/datatable/src/lib/components/cell-duration-value/cell-duration-value.component.ts","../../../projects/datatable/src/lib/components/cell-duration-value/cell-duration-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, Input } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { duration } from '../../tools/duration.tool';\nimport { get } from '../../tools/get.tool';\nimport { DatatableDurationColumn, DatatableValueColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-duration-value',\n imports: [CommonModule, MatIconModule],\n templateUrl: './cell-duration-value.component.html',\n styleUrl: './cell-duration-value.component.scss',\n})\nexport class CellDurationValueComponent<Record> {\n @Input()\n column!: DatatableDurationColumn<Record>;\n\n @Input('row')\n set setRow(row: any) {\n this.row = row;\n this.value = get(this.row, this.column.property);\n if (typeof (this.column as DatatableValueColumn<Record>).transform === 'function') {\n this.value = (this.column as DatatableValueColumn<Record>).transform!(this.value, this.row);\n }\n this.duration = duration(this.value, this.column);\n }\n row: any;\n\n value?: any;\n duration?: string | null;\n}\n","<!-- @format -->\n\n@if (duration !== null) {\n {{ duration }}\n}\n"],"names":[],"mappings":";;;;;;AAAA;MAea,0BAA0B,CAAA;AAErC,IAAA,MAAM;IAEN,IACI,MAAM,CAAC,GAAQ,EAAA;AACjB,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;AACd,QAAA,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChD,IAAI,OAAQ,IAAI,CAAC,MAAuC,CAAC,SAAS,KAAK,UAAU,EAAE;AACjF,YAAA,IAAI,CAAC,KAAK,GAAI,IAAI,CAAC,MAAuC,CAAC,SAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;;AAE7F,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;;AAEnD,IAAA,GAAG;AAEH,IAAA,KAAK;AACL,IAAA,QAAQ;uGAhBG,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA1B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,0BAA0B,ECfvC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,sEAKA,EDMY,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,8BAAE,aAAa,EAAA,CAAA,EAAA,CAAA;;2FAI1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,EAC1B,OAAA,EAAA,CAAC,YAAY,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,sEAAA,EAAA;8BAMtC,MAAM,EAAA,CAAA;sBADL;gBAIG,MAAM,EAAA,CAAA;sBADT,KAAK;uBAAC,KAAK;;;;;"}
@@ -1,26 +0,0 @@
1
- import * as i1 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { Component, Input } from '@angular/core';
5
- import { MatIconModule } from '@angular/material/icon';
6
- import { GetPipe } from './eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs';
7
- import { TransformPipe } from './eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs';
8
-
9
- /** @format */
10
- class CellNumberValueComponent {
11
- column;
12
- row;
13
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellNumberValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
14
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: CellNumberValueComponent, isStandalone: true, selector: "lib-cell-number-value", inputs: { column: "column", row: "row" }, ngImport: i0, template: "<!-- @format -->\n\n@let value = row | get: column.property;\n{{ value | transform: row : column | number: column.format : column.locale }}\n", styles: ["mat-icon{padding:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "ngmodule", type: MatIconModule }, { kind: "pipe", type: TransformPipe, name: "transform" }] });
15
- }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellNumberValueComponent, decorators: [{
17
- type: Component,
18
- args: [{ selector: 'lib-cell-number-value', imports: [CommonModule, GetPipe, MatIconModule, TransformPipe], template: "<!-- @format -->\n\n@let value = row | get: column.property;\n{{ value | transform: row : column | number: column.format : column.locale }}\n", styles: ["mat-icon{padding:8px}\n"] }]
19
- }], propDecorators: { column: [{
20
- type: Input
21
- }], row: [{
22
- type: Input
23
- }] } });
24
-
25
- export { CellNumberValueComponent };
26
- //# sourceMappingURL=eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs","sources":["../../../projects/datatable/src/lib/components/cell-number-value/cell-number-value.component.ts","../../../projects/datatable/src/lib/components/cell-number-value/cell-number-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { TransformPipe } from '../../pipes/transform.pipe';\nimport { DatatableNumberColumn } from '../../types/datatable-column.type';\n\n@Component({\n selector: 'lib-cell-number-value',\n imports: [CommonModule, GetPipe, MatIconModule, TransformPipe],\n templateUrl: './cell-number-value.component.html',\n styleUrl: './cell-number-value.component.scss',\n})\nexport class CellNumberValueComponent<Record> {\n @Input()\n column!: DatatableNumberColumn<Record>;\n\n @Input()\n row: any;\n}\n","<!-- @format -->\n\n@let value = row | get: column.property;\n{{ value | transform: row : column | number: column.format : column.locale }}\n"],"names":[],"mappings":";;;;;;;;AAAA;MAea,wBAAwB,CAAA;AAEnC,IAAA,MAAM;AAGN,IAAA,GAAG;uGALQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,GAAA,EAAA,KAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfrC,+IAIA,EDOY,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,kFAAE,OAAO,EAAA,IAAA,EAAA,KAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAIlD,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBANpC,SAAS;+BACE,uBAAuB,EAAA,OAAA,EACxB,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,+IAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,CAAA,EAAA;8BAM9D,MAAM,EAAA,CAAA;sBADL;gBAID,GAAG,EAAA,CAAA;sBADF;;;;;"}
@@ -1,45 +0,0 @@
1
- import * as i1 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { inject, Component, Input } from '@angular/core';
5
- import { MatLabel } from '@angular/material/form-field';
6
- import * as i5 from '@angular/material/icon';
7
- import { MatIconModule } from '@angular/material/icon';
8
- import { GetPipe } from './eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs';
9
- import { S as SelectOptionsCacheService, a as SelectOptionPipe, I as IsArrayPipe, b as SafeHtmlPipe } from './eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs';
10
- import { TransformPipe } from './eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs';
11
- import { Subscription } from 'rxjs';
12
-
13
- /** @format */
14
- class CellSelectValueComponent {
15
- column;
16
- row;
17
- options = [];
18
- selectOptionsCache = inject(SelectOptionsCacheService);
19
- subsink = new Subscription();
20
- ngOnInit() {
21
- if (Array.isArray(this.column.options))
22
- this.options = this.column.options;
23
- else {
24
- this.subsink.add(this.selectOptionsCache.resolve(this.column.options).subscribe(options => {
25
- this.options = options;
26
- }));
27
- }
28
- }
29
- ngOnDestroy() {
30
- this.subsink.unsubscribe();
31
- }
32
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
33
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: CellSelectValueComponent, isStandalone: true, selector: "lib-cell-select-value", inputs: { column: "column", row: "row" }, ngImport: i0, template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n\n@if (column.isArrayValue && value | isArray) {\n <div class=\"options\">\n @for (v of value; track v) {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value: v }\"></ng-container>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value }\"></ng-container>\n}\n\n<ng-template #optionTmpl let-value=\"value\">\n @let option = value | selectOption: options;\n @if (option) {\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon [svgIcon]=\"option.icon\" [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label *ngIf=\"!column.iconOnly\" [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n } @else {\n {{ value }}\n }\n</ng-template>\n", styles: [".option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;padding:4px}mat-icon,mat-label{color:currentColor}:host-context(tr.has-click:hover) mat-icon,:host-context(tr.has-click:hover) mat-label{color:var(--datatable-hover-color, var(--mat-sys-on-primary))!important}.options{display:flex;box-sizing:border-box;place-content:start start;align-items:center;flex-direction:row;flex-wrap:wrap}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SelectOptionPipe, name: "selectOption" }, { kind: "pipe", type: GetPipe, name: "get" }, { kind: "pipe", type: IsArrayPipe, name: "isArray" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "pipe", type: TransformPipe, name: "transform" }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
34
- }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, decorators: [{
36
- type: Component,
37
- args: [{ selector: 'lib-cell-select-value', imports: [CommonModule, SelectOptionPipe, GetPipe, IsArrayPipe, MatIconModule, MatLabel, TransformPipe, SafeHtmlPipe], template: "<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n\n@if (column.isArrayValue && value | isArray) {\n <div class=\"options\">\n @for (v of value; track v) {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value: v }\"></ng-container>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value }\"></ng-container>\n}\n\n<ng-template #optionTmpl let-value=\"value\">\n @let option = value | selectOption: options;\n @if (option) {\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon [svgIcon]=\"option.icon\" [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label *ngIf=\"!column.iconOnly\" [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n } @else {\n {{ value }}\n }\n</ng-template>\n", styles: [".option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;padding:4px}mat-icon,mat-label{color:currentColor}:host-context(tr.has-click:hover) mat-icon,:host-context(tr.has-click:hover) mat-label{color:var(--datatable-hover-color, var(--mat-sys-on-primary))!important}.options{display:flex;box-sizing:border-box;place-content:start start;align-items:center;flex-direction:row;flex-wrap:wrap}\n"] }]
38
- }], propDecorators: { column: [{
39
- type: Input
40
- }], row: [{
41
- type: Input
42
- }] } });
43
-
44
- export { CellSelectValueComponent };
45
- //# sourceMappingURL=eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs","sources":["../../../projects/datatable/src/lib/components/cell-select-value/cell-select-value.component.ts","../../../projects/datatable/src/lib/components/cell-select-value/cell-select-value.component.html"],"sourcesContent":["/** @format */\n\nimport { CommonModule } from '@angular/common';\nimport { Component, inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport { MatLabel } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { GetPipe } from '../../pipes/get.pipe';\nimport { SafeHtmlPipe } from '../../pipes/safe-html.pipe';\nimport { SelectOptionPipe } from '../../pipes/select-option.pipe';\nimport { TransformPipe } from '../../pipes/transform.pipe';\nimport { DatatableSearchListOption, DatatableSelectColumn } from '../../types/datatable-column.type';\nimport { IsArrayPipe } from '../../pipes/is-array.pipe';\nimport { Subscription } from 'rxjs';\nimport { SelectOptionsCacheService } from '../../select-options-cache.service';\n\n@Component({\n selector: 'lib-cell-select-value',\n imports: [CommonModule, SelectOptionPipe, GetPipe, IsArrayPipe, MatIconModule, MatLabel, TransformPipe, SafeHtmlPipe],\n templateUrl: './cell-select-value.component.html',\n styleUrl: './cell-select-value.component.scss',\n})\nexport class CellSelectValueComponent<Record> implements OnInit, OnDestroy {\n @Input()\n column!: DatatableSelectColumn<Record>;\n\n @Input()\n row: any;\n\n options: DatatableSearchListOption[] = [];\n\n private selectOptionsCache = inject(SelectOptionsCacheService);\n private subsink = new Subscription();\n\n ngOnInit(): void {\n if (Array.isArray(this.column.options)) this.options = this.column.options;\n else {\n this.subsink.add(\n this.selectOptionsCache.resolve(this.column.options).subscribe(options => {\n this.options = options;\n }),\n );\n }\n }\n\n ngOnDestroy(): void {\n this.subsink.unsubscribe();\n }\n}\n","<!-- @format -->\n\n@let value = row | get: column.property | transform: row : column;\n\n@if (column.isArrayValue && value | isArray) {\n <div class=\"options\">\n @for (v of value; track v) {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value: v }\"></ng-container>\n }\n </div>\n} @else {\n <ng-container *ngTemplateOutlet=\"optionTmpl; context: { value }\"></ng-container>\n}\n\n<ng-template #optionTmpl let-value=\"value\">\n @let option = value | selectOption: options;\n @if (option) {\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case ('svg') {\n <mat-icon [svgIcon]=\"option.icon\" [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\"></mat-icon>\n }\n @default {\n <mat-icon [style.color]=\"option.iconColor ?? option.color\" [style.margin-right.px]=\"8\">\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label *ngIf=\"!column.iconOnly\" [style.color]=\"option.color\" [innerHTML]=\"option.name | safeHtml\"></mat-label>\n </div>\n } @else {\n {{ value }}\n }\n</ng-template>\n"],"names":["i2"],"mappings":";;;;;;;;;;;;AAAA;MAqBa,wBAAwB,CAAA;AAEnC,IAAA,MAAM;AAGN,IAAA,GAAG;IAEH,OAAO,GAAgC,EAAE;AAEjC,IAAA,kBAAkB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACtD,IAAA,OAAO,GAAG,IAAI,YAAY,EAAE;IAEpC,QAAQ,GAAA;QACN,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO;aACrE;YACH,IAAI,CAAC,OAAO,CAAC,GAAG,CACd,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,IAAG;AACvE,gBAAA,IAAI,CAAC,OAAO,GAAG,OAAO;aACvB,CAAC,CACH;;;IAIL,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;;uGAxBjB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,2HCrBrC,wrCAoCA,EAAA,MAAA,EAAA,CAAA,4bAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,I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