@eherve/angular-material-datatable 19.24.0 → 19.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/fesm2022/{eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs → eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs} +2 -2
  2. package/fesm2022/{eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs.map → eherve-angular-material-datatable-cell-checkbox-value.component-E5dQ-SJb.mjs.map} +1 -1
  3. package/fesm2022/{eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs → eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs} +32 -12
  4. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CXh9rWrt.mjs.map +1 -0
  5. package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs → eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs} +2 -2
  6. package/fesm2022/{eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs.map → eherve-angular-material-datatable-cell-duration-value.component-Br8ga1qE.mjs.map} +1 -1
  7. package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs → eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs} +2 -2
  8. package/fesm2022/{eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs.map → eherve-angular-material-datatable-cell-number-value.component-BGmWTDbF.mjs.map} +1 -1
  9. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs +45 -0
  10. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-_CDm5Nid.mjs.map +1 -0
  11. package/fesm2022/{eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs → eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs} +276 -136
  12. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs.map +1 -0
  13. package/fesm2022/{eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs → eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs} +2 -2
  14. package/fesm2022/{eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs.map → eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs.map} +1 -1
  15. package/fesm2022/eherve-angular-material-datatable.mjs +1 -1
  16. package/lib/components/cell-date-value/cell-date-value.component.d.ts +2 -1
  17. package/lib/components/cell-select-value/cell-select-value.component.d.ts +2 -3
  18. package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +2 -0
  19. package/lib/components/header-date-filter/header-date-filter.component.d.ts +2 -0
  20. package/lib/components/header-duration-filter/header-duration-filter.component.d.ts +2 -0
  21. package/lib/components/header-number-filter/header-number-filter.component.d.ts +2 -0
  22. package/lib/components/header-select-filter/header-select-filter.component.d.ts +3 -0
  23. package/lib/components/header-text-filter/header-text-filter.component.d.ts +2 -0
  24. package/lib/datasource.d.ts +4 -1
  25. package/lib/datatable.component.d.ts +1 -0
  26. package/lib/datatable.intl.d.ts +11 -0
  27. package/lib/date-refresh.service.d.ts +8 -0
  28. package/lib/select-options-cache.service.d.ts +9 -0
  29. package/lib/types/action.type.d.ts +1 -0
  30. package/package.json +2 -2
  31. package/public-api.d.ts +1 -0
  32. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs.map +0 -1
  33. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs +0 -44
  34. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs.map +0 -1
  35. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe } from '@angular/core';
3
- import { g as get } from './eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs';
3
+ import { g as get } from './eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs';
4
4
 
5
5
  /** @format */
6
6
  class GetPipe {
@@ -16,4 +16,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
16
16
  }] });
17
17
 
18
18
  export { GetPipe };
19
- //# sourceMappingURL=eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs.map
19
+ //# sourceMappingURL=eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs","sources":["../../../projects/datatable/src/lib/pipes/get.pipe.ts"],"sourcesContent":["/** @format */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { get } from '../tools/get.tool';\n\n@Pipe({ name: 'get' })\nexport class GetPipe implements PipeTransform {\n transform(obj: any, path: string): any | undefined {\n return get(obj, path);\n }\n}\n"],"names":[],"mappings":";;;;AAAA;MAMa,OAAO,CAAA;IAClB,SAAS,CAAC,GAAQ,EAAE,IAAY,EAAA;AAC9B,QAAA,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC;;uGAFZ,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAP,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB,IAAI;mBAAC,EAAE,IAAI,EAAE,KAAK,EAAE;;;;;"}
1
+ {"version":3,"file":"eherve-angular-material-datatable-get.pipe-OPM3WlAY.mjs","sources":["../../../projects/datatable/src/lib/pipes/get.pipe.ts"],"sourcesContent":["/** @format */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { get } from '../tools/get.tool';\n\n@Pipe({ name: 'get' })\nexport class GetPipe implements PipeTransform {\n transform(obj: any, path: string): any | undefined {\n return get(obj, path);\n }\n}\n"],"names":[],"mappings":";;;;AAAA;MAMa,OAAO,CAAA;IAClB,SAAS,CAAC,GAAQ,EAAE,IAAY,EAAA;AAC9B,QAAA,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC;;uGAFZ,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAP,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB,IAAI;mBAAC,EAAE,IAAI,EAAE,KAAK,EAAE;;;;;"}
@@ -1,2 +1,2 @@
1
- export { c as NGX_MAT_DATATABLE_DEFAULT_OPTIONS, b as NgxMatDatatableComponent, e as NgxMatDatatableContentDirective, f as NgxMatDatatableIntl, N as NgxMatDatatableModule, p as provideNgxMatDatatableDefaultOptions } from './eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs';
1
+ export { e as NGX_MAT_DATATABLE_DEFAULT_OPTIONS, c as NgxMatDatatableComponent, f as NgxMatDatatableContentDirective, h as NgxMatDatatableIntl, N as NgxMatDatatableModule, p as provideNgxMatDatatableDefaultOptions } from './eherve-angular-material-datatable-eherve-angular-material-datatable-oKhIjmQe.mjs';
2
2
  //# sourceMappingURL=eherve-angular-material-datatable.mjs.map
@@ -3,12 +3,13 @@ import { DatatableDateColumn } from '../../types/datatable-column.type';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class CellDateValueComponent<Record> implements OnInit, OnDestroy {
5
5
  private changeDetectorRef;
6
+ private dateRefreshService;
6
7
  column: DatatableDateColumn<Record>;
7
8
  set setRow(row: any);
8
9
  row: any;
9
10
  value?: any;
10
11
  duration?: string | null;
11
- private refreshInterval;
12
+ private refreshSubscription?;
12
13
  ngOnInit(): void;
13
14
  ngOnDestroy(): void;
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<CellDateValueComponent<any>, never>;
@@ -2,11 +2,10 @@ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { DatatableSearchListOption, DatatableSelectColumn } from '../../types/datatable-column.type';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class CellSelectValueComponent<Record> implements OnInit, OnDestroy {
5
- column: DatatableSelectColumn<Record> & {
6
- __options?: DatatableSearchListOption[];
7
- };
5
+ column: DatatableSelectColumn<Record>;
8
6
  row: any;
9
7
  options: DatatableSearchListOption[];
8
+ private selectOptionsCache;
10
9
  private subsink;
11
10
  ngOnInit(): void;
12
11
  ngOnDestroy(): void;
@@ -1,6 +1,7 @@
1
1
  import { AfterViewInit, ElementRef, OnDestroy } from '@angular/core';
2
2
  import { ControlValueAccessor, FormControl } from '@angular/forms';
3
3
  import { MatAutocomplete } from '@angular/material/autocomplete';
4
+ import { NgxMatDatatableIntl } from '../../datatable.intl';
4
5
  import { DatatableSearchAutocompleteColumn, DatatableSearchListOption } from '../../types/datatable-column.type';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class HeaderAutocompleteFilterComponent<Record> implements AfterViewInit, OnDestroy, ControlValueAccessor {
@@ -20,6 +21,7 @@ export declare class HeaderAutocompleteFilterComponent<Record> implements AfterV
20
21
  onTouched: () => void;
21
22
  private filter$;
22
23
  private nextPage$;
24
+ datatableIntl: NgxMatDatatableIntl;
23
25
  private injector;
24
26
  private changeDetectorRef;
25
27
  private subsink;
@@ -1,5 +1,6 @@
1
1
  import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ControlValueAccessor, FormControl, FormGroup } from '@angular/forms';
3
+ import { NgxMatDatatableIntl } from '../../datatable.intl';
3
4
  import { DatatableSearchDateColumn } from '../../types/datatable-column.type';
4
5
  import { OPERATOR } from '../operator-select/operator-select.component';
5
6
  import * as i0 from "@angular/core";
@@ -17,6 +18,7 @@ export declare class HeaderDateFilterComponent<Record> implements OnInit, AfterV
17
18
  private readonly _adapter;
18
19
  private readonly _intl;
19
20
  private readonly _locale;
21
+ datatableIntl: NgxMatDatatableIntl;
20
22
  private injector;
21
23
  private changeDetectorRef;
22
24
  private subsink;
@@ -1,5 +1,6 @@
1
1
  import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ControlValueAccessor, FormControl, FormGroup } from '@angular/forms';
3
+ import { NgxMatDatatableIntl } from '../../datatable.intl';
3
4
  import { DatatableSearchDurationColumn } from '../../types/datatable-column.type';
4
5
  import { OPERATOR } from '../operator-select/operator-select.component';
5
6
  import { TIME_UNIT } from '../time-unit-select/time-unit-select.component';
@@ -16,6 +17,7 @@ export declare class HeaderDurationFilterComponent<Record> implements OnInit, Af
16
17
  timeUnitControl: FormControl<TIME_UNIT | null>;
17
18
  onChange: (value: any) => void;
18
19
  onTouched: () => void;
20
+ datatableIntl: NgxMatDatatableIntl;
19
21
  private injector;
20
22
  private changeDetectorRef;
21
23
  private subsink;
@@ -1,5 +1,6 @@
1
1
  import { AfterViewInit, OnDestroy } from '@angular/core';
2
2
  import { ControlValueAccessor, FormControl } from '@angular/forms';
3
+ import { NgxMatDatatableIntl } from '../../datatable.intl';
3
4
  import { DatatableSearchNumberColumn } from '../../types/datatable-column.type';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class HeaderNumberFilterComponent<Record> implements AfterViewInit, OnDestroy, ControlValueAccessor {
@@ -9,6 +10,7 @@ export declare class HeaderNumberFilterComponent<Record> implements AfterViewIni
9
10
  operatorControl: FormControl<string | null>;
10
11
  onChange: (value: any) => void;
11
12
  onTouched: () => void;
13
+ datatableIntl: NgxMatDatatableIntl;
12
14
  private injector;
13
15
  private changeDetectorRef;
14
16
  private subsink;
@@ -1,5 +1,6 @@
1
1
  import { AfterViewInit, OnDestroy } from '@angular/core';
2
2
  import { ControlValueAccessor, FormControl } from '@angular/forms';
3
+ import { NgxMatDatatableIntl } from '../../datatable.intl';
3
4
  import { DatatableSearchListOption, DatatableSearchSelectColumn } from '../../types/datatable-column.type';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class HeaderSelectFilterComponent<Record> implements AfterViewInit, OnDestroy, ControlValueAccessor {
@@ -13,8 +14,10 @@ export declare class HeaderSelectFilterComponent<Record> implements AfterViewIni
13
14
  selectControl: FormControl<any>;
14
15
  onChange: (value: any) => void;
15
16
  onTouched: () => void;
17
+ datatableIntl: NgxMatDatatableIntl;
16
18
  private injector;
17
19
  private changeDetectorRef;
20
+ private selectOptionsCache;
18
21
  private subsink;
19
22
  writeValue(controlValue: any): void;
20
23
  setDisabledState(isDisabled: boolean): void;
@@ -1,5 +1,6 @@
1
1
  import { AfterViewInit, OnDestroy } from '@angular/core';
2
2
  import { ControlValueAccessor, FormControl } from '@angular/forms';
3
+ import { NgxMatDatatableIntl } from '../../datatable.intl';
3
4
  import { DatatableSearchTextColumn } from '../../types/datatable-column.type';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class HeaderTextFilterComponent<Record> implements AfterViewInit, OnDestroy, ControlValueAccessor {
@@ -8,6 +9,7 @@ export declare class HeaderTextFilterComponent<Record> implements AfterViewInit,
8
9
  selectControl: FormControl<any>;
9
10
  onChange: (value: any) => void;
10
11
  onTouched: () => void;
12
+ datatableIntl: NgxMatDatatableIntl;
11
13
  private injector;
12
14
  private changeDetectorRef;
13
15
  private subsink;
@@ -15,6 +15,9 @@ export declare class DatagridDataSource<Record> extends DataSource<Record> {
15
15
  private options?;
16
16
  private latestRequestId;
17
17
  private disconnected;
18
+ private measuredRowSize;
19
+ private measuredRowCount;
20
+ private readonly textEncoder;
18
21
  protected dataStream: BehaviorSubject<Record[]>;
19
22
  constructor(service: NgxMatDatasourceService<Record>);
20
23
  connect(): Observable<Record[]>;
@@ -23,5 +26,5 @@ export declare class DatagridDataSource<Record> extends DataSource<Record> {
23
26
  refresh(): void;
24
27
  redraw(match?: (record: Record) => boolean): void;
25
28
  private setData;
26
- private calculateRowSize;
29
+ private updateRowSize;
27
30
  }
@@ -84,6 +84,7 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
84
84
  reorderColumns(event: CdkDragDrop<any[]>): void;
85
85
  closeUpdateColumnDisplay(): void;
86
86
  rowClick(row: Record): void;
87
+ rowKeydown(event: KeyboardEvent, row: Record): void;
87
88
  facetClick(column: DatatableColumn<Record> | undefined, result: NgxMatDatasourceResultFacet, option: FacetOptionsOptions): void;
88
89
  private buildDisplayColumns;
89
90
  private prepareLoadModeOptions;
@@ -2,6 +2,8 @@ import * as i0 from "@angular/core";
2
2
  type NumberOptions = {
3
3
  separator: string;
4
4
  decimal: string;
5
+ duration: number;
6
+ useEasing: boolean;
5
7
  };
6
8
  export declare class NgxMatDatatableIntl {
7
9
  locale: string;
@@ -14,6 +16,15 @@ export declare class NgxMatDatatableIntl {
14
16
  onLabel: string;
15
17
  incrementalLoadingLabel: string;
16
18
  incrementalLoadMoreLabel: string;
19
+ columnsActionLabel: string;
20
+ exportActionLabel: string;
21
+ refreshActionLabel: string;
22
+ showColumnActionLabel: string;
23
+ hideColumnActionLabel: string;
24
+ pinColumnActionLabel: string;
25
+ unpinColumnActionLabel: string;
26
+ sortColumnActionLabel: string;
27
+ clearFilterLabel: string;
17
28
  numberOptions: NumberOptions;
18
29
  getRangeLabel: (page: number, pageSize: number, length: number) => string;
19
30
  constructor();
@@ -0,0 +1,8 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DateRefreshService {
4
+ private readonly intervals;
5
+ forInterval(refreshTime: number): Observable<number>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateRefreshService, never>;
7
+ static ɵprov: i0.ɵɵInjectableDeclaration<DateRefreshService>;
8
+ }
@@ -0,0 +1,9 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DatatableSearchListOption } from './types/datatable-column.type';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SelectOptionsCacheService {
5
+ private cache;
6
+ resolve(source: Observable<DatatableSearchListOption[]>): Observable<DatatableSearchListOption[]>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectOptionsCacheService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<SelectOptionsCacheService>;
9
+ }
@@ -10,6 +10,7 @@ export type IconAction<Record> = BaseAction & {
10
10
  icon: string;
11
11
  onclick: (datagrid: NgxMatDatatableComponent<Record>) => void;
12
12
  tooltip?: string;
13
+ ariaLabel?: string;
13
14
  color?: string;
14
15
  };
15
16
  export type TemplateAction = BaseAction & {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@eherve/angular-material-datatable",
3
- "version": "19.24.0",
3
+ "version": "19.25.0",
4
4
  "author": "Eric Herve <eric.herve.95@gmail.com>",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "https://github.com/eherve/angular-material-extended.git"
7
+ "url": "git+https://github.com/eherve/angular-material-extended.git"
8
8
  },
9
9
  "private": false,
10
10
  "publishConfig": {
package/public-api.d.ts CHANGED
@@ -13,4 +13,5 @@ export * from './lib/types/datatable-options.type';
13
13
  export * from './lib/types/action.type';
14
14
  export * from './lib/types/datatable-facet.type';
15
15
  export * from './lib/types/datatable-state.type';
16
+ export * from './lib/types/config.type';
16
17
  export * from './lib/datatable.intl';
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs","sources":["../../../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 { 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 { 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\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 refreshInterval: any;\n ngOnInit(): void {\n if (this.column.durationRefreshTime) {\n this.refreshInterval = setInterval(() => {\n this.duration = duration(this.value, this.column);\n this.changeDetectorRef.detectChanges();\n }, this.column.durationRefreshTime);\n }\n }\n\n ngOnDestroy(): void {\n if (this.refreshInterval) clearInterval(this.refreshInterval);\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,gBAAgB,CAAA;IAC3B,SAAS,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,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,wIChBnC,wMAQA,EAAA,MAAA,EAAA,CAAA,iEAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIY,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;8BAQxD,MAAM,EAAA,CAAA;sBADL;gBAIG,MAAM,EAAA,CAAA;sBADT,KAAK;uBAAC,KAAK;;;;;"}
@@ -1,44 +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 { 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-kupjbnPY.mjs';
9
- import { S as SelectOptionPipe, I as IsArrayPipe, a as SafeHtmlPipe } from './eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.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
- subsink = new Subscription();
19
- ngOnInit() {
20
- if (Array.isArray(this.column.options))
21
- this.options = this.column.options;
22
- else {
23
- this.subsink.add(this.column.options.subscribe(options => {
24
- this.column.__options = this.options = options;
25
- }));
26
- }
27
- }
28
- ngOnDestroy() {
29
- this.subsink.unsubscribe();
30
- }
31
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
32
- 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 id=\"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" }] });
33
- }
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellSelectValueComponent, decorators: [{
35
- type: Component,
36
- 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 id=\"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"] }]
37
- }], propDecorators: { column: [{
38
- type: Input
39
- }], row: [{
40
- type: Input
41
- }] } });
42
-
43
- export { CellSelectValueComponent };
44
- //# sourceMappingURL=eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.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, 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';\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> & { __options?: DatatableSearchListOption[] };\n\n @Input()\n row: any;\n\n options: DatatableSearchListOption[] = [];\n\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.column.options.subscribe(options => {\n this.column.__options = 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 id=\"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;MAoBa,wBAAwB,CAAA;AAEnC,IAAA,MAAM;AAGN,IAAA,GAAG;IAEH,OAAO,GAAgC,EAAE;AAEjC,IAAA,OAAO,GAAG,IAAI,YAAY,EAAE;IAEpC,QAAQ,GAAA;QACN,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAAE,IAAI,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