@eherve/angular-material-datatable 19.24.0 → 19.26.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 (40) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/eherve-angular-material-datatable.mjs +3005 -1
  3. package/fesm2022/eherve-angular-material-datatable.mjs.map +1 -1
  4. package/lib/components/cell-date-value/cell-date-value.component.d.ts +2 -1
  5. package/lib/components/cell-select-value/cell-select-value.component.d.ts +2 -3
  6. package/lib/components/header-autocomplete-filter/header-autocomplete-filter.component.d.ts +2 -0
  7. package/lib/components/header-date-filter/header-date-filter.component.d.ts +2 -0
  8. package/lib/components/header-duration-filter/header-duration-filter.component.d.ts +2 -0
  9. package/lib/components/header-number-filter/header-number-filter.component.d.ts +2 -0
  10. package/lib/components/header-select-filter/header-select-filter.component.d.ts +3 -0
  11. package/lib/components/header-text-filter/header-text-filter.component.d.ts +2 -0
  12. package/lib/datasource.d.ts +4 -1
  13. package/lib/datatable.component.d.ts +6 -0
  14. package/lib/datatable.intl.d.ts +11 -0
  15. package/lib/date-refresh.service.d.ts +8 -0
  16. package/lib/directives/datatable-row-viewport.directive.d.ts +22 -0
  17. package/lib/pipes/safe-html.pipe.d.ts +2 -1
  18. package/lib/select-options-cache.service.d.ts +9 -0
  19. package/lib/types/action.type.d.ts +1 -0
  20. package/lib/types/datatable-column.type.d.ts +2 -1
  21. package/package.json +2 -2
  22. package/public-api.d.ts +1 -0
  23. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs +0 -26
  24. package/fesm2022/eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.mjs.map +0 -1
  25. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs +0 -83
  26. package/fesm2022/eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs.map +0 -1
  27. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs +0 -35
  28. package/fesm2022/eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.mjs.map +0 -1
  29. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs +0 -26
  30. package/fesm2022/eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.mjs.map +0 -1
  31. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs +0 -44
  32. package/fesm2022/eherve-angular-material-datatable-cell-select-value.component-DH-Kq9yJ.mjs.map +0 -1
  33. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs +0 -2510
  34. package/fesm2022/eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs.map +0 -1
  35. package/fesm2022/eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs +0 -19
  36. package/fesm2022/eherve-angular-material-datatable-get.pipe-kupjbnPY.mjs.map +0 -1
  37. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs +0 -20
  38. package/fesm2022/eherve-angular-material-datatable-suffix-function.pipe-CQO-ghpR.mjs.map +0 -1
  39. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs +0 -21
  40. package/fesm2022/eherve-angular-material-datatable-transform.pipe-BOmcXXZU.mjs.map +0 -1
@@ -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
  }
@@ -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;
@@ -53,6 +54,8 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
53
54
  private defaultOptions;
54
55
  private incrementalLoadToken;
55
56
  private restoredState?;
57
+ private rowRenderChangeScheduled;
58
+ private destroyed;
56
59
  get data(): Record[] | undefined;
57
60
  private _data?;
58
61
  container?: ElementRef<HTMLDivElement>;
@@ -78,12 +81,15 @@ export declare class NgxMatDatatableComponent<Record = any> implements OnInit, O
78
81
  private loadInitialPage;
79
82
  private loadFirstPage;
80
83
  private updateLoadedDataState;
84
+ private pruneRenderedRows;
81
85
  private buildDisabledRows;
82
86
  updateColumns: UpdateColumn<Record>[];
83
87
  openUpdateColumnDisplay(): void;
84
88
  reorderColumns(event: CdkDragDrop<any[]>): void;
85
89
  closeUpdateColumnDisplay(): void;
86
90
  rowClick(row: Record): void;
91
+ rowKeydown(event: KeyboardEvent, row: Record): void;
92
+ protected renderRow(row: Record): void;
87
93
  facetClick(column: DatatableColumn<Record> | undefined, result: NgxMatDatasourceResultFacet, option: FacetOptionsOptions): void;
88
94
  private buildDisplayColumns;
89
95
  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,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
  }
@@ -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 & {
@@ -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,10 +1,10 @@
1
1
  {
2
2
  "name": "@eherve/angular-material-datatable",
3
- "version": "19.24.0",
3
+ "version": "19.26.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,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-kupjbnPY.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-Dcer6VNu.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-checkbox-value.component-Dcer6VNu.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>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AA,CAAA;sBADF;;;;;"}
@@ -1,83 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Pipe, inject, ChangeDetectorRef, Component, Input } from '@angular/core';
4
- import { MatIconModule } from '@angular/material/icon';
5
- import moment from 'moment';
6
- import { g as get, d as duration } from './eherve-angular-material-datatable-eherve-angular-material-datatable-yAj8iPwA.mjs';
7
-
8
- /** @format */
9
- class MomentFormatPipe {
10
- transform(data, options) {
11
- const date = this.getMoment(data);
12
- if (!date)
13
- return '';
14
- const format = options?.format || 'LLL';
15
- return options?.locale ? date.locale(options.locale).format(format) : date.format(format);
16
- }
17
- getMoment(data) {
18
- if (typeof data === 'string')
19
- return moment(data);
20
- if (typeof data === 'number')
21
- return moment(data);
22
- if (data instanceof Date)
23
- return moment(data);
24
- if (moment.isMoment(data))
25
- return data.clone();
26
- if (typeof data?.valueOf === 'function') {
27
- const value = data.valueOf();
28
- if (typeof value === 'number')
29
- return moment(data);
30
- }
31
- return null;
32
- }
33
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
34
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, isStandalone: true, name: "momentFormat" });
35
- }
36
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: MomentFormatPipe, decorators: [{
37
- type: Pipe,
38
- args: [{ name: 'momentFormat' }]
39
- }] });
40
-
41
- /** @format */
42
- class CellDateValueComponent {
43
- changeDetectorRef = inject(ChangeDetectorRef);
44
- column;
45
- set setRow(row) {
46
- this.row = row;
47
- this.value = get(this.row, this.column.property);
48
- if (typeof this.column.transform === 'function') {
49
- this.value = this.column.transform(this.value, this.row);
50
- }
51
- this.duration = duration(this.value, this.column);
52
- }
53
- row;
54
- value;
55
- duration;
56
- refreshInterval;
57
- ngOnInit() {
58
- if (this.column.durationRefreshTime) {
59
- this.refreshInterval = setInterval(() => {
60
- this.duration = duration(this.value, this.column);
61
- this.changeDetectorRef.detectChanges();
62
- }, this.column.durationRefreshTime);
63
- }
64
- }
65
- ngOnDestroy() {
66
- if (this.refreshInterval)
67
- clearInterval(this.refreshInterval);
68
- }
69
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDateValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
- 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" }] });
71
- }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: CellDateValueComponent, decorators: [{
73
- type: Component,
74
- 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"] }]
75
- }], propDecorators: { column: [{
76
- type: Input
77
- }], setRow: [{
78
- type: Input,
79
- args: ['row']
80
- }] } });
81
-
82
- export { CellDateValueComponent };
83
- //# sourceMappingURL=eherve-angular-material-datatable-cell-date-value.component-CH38s3de.mjs.map
@@ -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,CAAC,IAAS,EAAE,OAA6C,EAAA;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AACjC,QAAA,IAAI,CAAC,IAAI;AAAE,YAAA,OAAO,EAAE;AACpB,QAAA,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK;AACvC,QAAA,OAAO,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;;AAGnF,IAAA,SAAS,CAAC,IAAS,EAAA;QACzB,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,IAAI,YAAY,IAAI;AAAE,YAAA,OAAO,MAAM,CAAC,IAAI,CAAC;AAC7C,QAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAAE,YAAA,OAAO,IAAI,CAAC,KAAK,EAAE;AAC9C,QAAA,IAAI,OAAO,IAAI,E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AAW,CAAC,MAAK;AACtC,gBAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;AACjD,gBAAA,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE;AACxC,aAAC,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;;;IAIvC,WAAW,GAAA;QACT,IAAI,IAAI,CAAC,eAAe;AAAE,YAAA,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC;;uGA/BpD,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,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,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-yAj8iPwA.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-C96dDNf9.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-duration-value.component-C96dDNf9.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-kupjbnPY.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-YPEA9XOc.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eherve-angular-material-datatable-cell-number-value.component-YPEA9XOc.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,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,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO;aACrE;AACH,YAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,IAAG;gBACtC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,GAAG,OAAO;aAC/C,CAAC,CACH;;;IAIL,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;;uGAvBjB,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,2HCpBrC,qrCAoCA,EAAA,MAAA,EAAA,CAAA,4bAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDpBY,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EA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