ngx-eiffage-material 0.0.21 → 0.0.23

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.
package/index.d.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, ElementRef, WritableSignal, TemplateRef, Type } from '@angular/core';
2
+ import { Type, TemplateRef, PipeTransform, InjectionToken, Signal, OnInit, ElementRef, WritableSignal, OnDestroy } from '@angular/core';
3
3
  import { FormControl } from '@angular/forms';
4
4
  import { MatSelect, MatSelectChange } from '@angular/material/select';
5
- import { SortDirection } from '@angular/material/sort';
5
+ import { SortDirection, Sort } from '@angular/material/sort';
6
+ import { DateRange } from '@angular/material/datepicker';
7
+ import moment from 'moment';
6
8
  import { Observable } from 'rxjs';
7
- import { MatDialogConfig } from '@angular/material/dialog';
9
+ import { MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
10
+ import { MatMenuTrigger } from '@angular/material/menu';
11
+ import { PageEvent } from '@angular/material/paginator';
12
+ import jsPDF from 'jspdf';
8
13
 
9
14
  declare class NgxLoadingButton {
10
15
  isLoading: _angular_core.InputSignal<boolean>;
@@ -92,11 +97,15 @@ interface PaginatedSelectConfig<T> {
92
97
  filtersKeys?: FilterKeyOption<T>[];
93
98
  }
94
99
 
95
- interface PaginatedFilter {
100
+ type ColumnValue = undefined | null | string | string[] | moment.Moment | DateRange<moment.Moment | null>;
101
+
102
+ interface PaginatedFilter<T> {
96
103
  pageNumber: number;
97
104
  pageSize: number;
98
105
  query?: string;
99
106
  sortBy?: SortBy;
107
+ columnsFiltersValue?: Partial<Record<keyof T, ColumnValue>>;
108
+ advancedFilterId?: string;
100
109
  }
101
110
  interface SortBy {
102
111
  key: string;
@@ -108,6 +117,131 @@ interface PaginatedItems<T> {
108
117
  total: number;
109
118
  }
110
119
 
120
+ type FilterType = 'number' | 'text' | 'option' | 'option-multiple' | 'date' | 'date-range';
121
+ type RowActionIconColor = 'Yellow' | 'Orange' | 'Pink' | 'Purple' | 'Green' | 'Blue' | 'Sky' | 'Brown';
122
+ interface PaginatedTableConfig<T> {
123
+ tableId: string;
124
+ primaryKey: keyof T | Array<keyof T>;
125
+ title: () => string;
126
+ columns: PaginatedTableColumn<T>[];
127
+ showQueryFilter?: boolean;
128
+ queryFilterPlaceholder?: string;
129
+ create?: TableBasicAction<T>;
130
+ update?: TableBasicAction<T>;
131
+ clickOnRowForUpdate?: boolean;
132
+ delete?: TableBasicAction<T>;
133
+ deleteConfirm?: DeleteConfirm<T>;
134
+ rowActions?: TableRowAction<T>[];
135
+ showAdvancedFilters?: boolean;
136
+ expandableDetail?: boolean;
137
+ expandableDetailTemplateRef?: () => TemplateRef<{
138
+ $implicit: T;
139
+ }>;
140
+ enableRowSelection?: boolean;
141
+ rowSelectionAction?: RowSelectionAction<T>[];
142
+ exportFileName?: () => string;
143
+ mapperForExportData?: (row: T) => Partial<Record<keyof T, any>>;
144
+ pdfConfig?: jsPDF;
145
+ maxHeight?: string;
146
+ defaultStickyColumn?: keyof T;
147
+ }
148
+ interface PaginatedTableColumn<T> {
149
+ key: keyof T;
150
+ label: string;
151
+ isSortable?: boolean;
152
+ filterType?: FilterType;
153
+ filterOptions?: FilterOption[];
154
+ component?: Type<any>;
155
+ templateRef?: () => TemplateRef<{
156
+ $implicit: T;
157
+ }>;
158
+ valueGetter?: (row: T) => string;
159
+ pipes?: ColumnPipe | ColumnPipe[];
160
+ showTotalPerPage?: boolean;
161
+ showTotalGeneral?: boolean;
162
+ getTotalGeneral?: () => number;
163
+ totalFooterFormatter?: (total: number) => string;
164
+ style?: Partial<CSSStyleDeclaration>;
165
+ }
166
+ interface TableBasicAction<T> {
167
+ show?: (row?: T) => boolean;
168
+ disabled?: (row?: T) => boolean;
169
+ tooltip?: (row?: T) => string;
170
+ }
171
+ interface TableRowAction<T> {
172
+ id: string;
173
+ show?: (row: T) => boolean;
174
+ disabled?: (row: T) => boolean;
175
+ icon: string;
176
+ iconColor?: RowActionIconColor;
177
+ tooltip: (row: T) => string;
178
+ }
179
+ interface FilterOption {
180
+ value: string;
181
+ label: string;
182
+ }
183
+ interface ColumnPipe {
184
+ pipe: PipeTransform;
185
+ args?: any[];
186
+ }
187
+ interface DeleteConfirm<T> {
188
+ title: (row: T) => string;
189
+ body?: (row: T) => string;
190
+ templateRef?: () => TemplateRef<{
191
+ $implicit: T;
192
+ }>;
193
+ }
194
+ interface RowSelectionAction<T> {
195
+ id: string;
196
+ icon: string;
197
+ label: (row: T[], totalSelected: number) => string;
198
+ }
199
+
200
+ declare const USER_ID_FACTORY: InjectionToken<Signal<string | null | undefined>>;
201
+
202
+ type FilterConnector = 'AND' | 'OR';
203
+ type FilterOperator = '=' | '<>' | '>' | '>=' | '<' | '<=' | 'LIKE';
204
+ interface AdvancedFilter<T> {
205
+ name: string;
206
+ groups: FilterGroup<T>[];
207
+ }
208
+ interface FilterGroup<T> {
209
+ id?: string;
210
+ connector: FilterConnector;
211
+ filters: (FilterRule<T> | FilterGroup<T>)[];
212
+ }
213
+ interface FilterRule<T> {
214
+ id?: string;
215
+ key?: keyof T;
216
+ operator?: FilterOperator;
217
+ value?: ColumnValue;
218
+ }
219
+ declare const FILTER_CONNECTOR_LABEL: Record<FilterConnector, string>;
220
+ declare const OPTIONS_FILTER_CONNECTOR: FilterOption[];
221
+ declare const OPERATOR_BY_FILTER_TYPE: Record<FilterType, FilterOperator[]>;
222
+ declare const FILTER_OPERATOR_LABEL: Record<FilterOperator, string>;
223
+
224
+ interface RowActionClickEvent<T> {
225
+ id: string;
226
+ row: T;
227
+ }
228
+
229
+ interface SelectionActionEvent<T> {
230
+ id: string;
231
+ rows: T[];
232
+ }
233
+
234
+ interface ConfirmDialogData<T = any> {
235
+ title: string;
236
+ body?: string;
237
+ template?: TemplateRef<{
238
+ $implicit: T;
239
+ }>;
240
+ row?: T;
241
+ denyButtonLabel?: string;
242
+ confirmButtonLabel?: string;
243
+ }
244
+
111
245
  declare class NgxBasicTable<T> {
112
246
  readonly tableConfig: _angular_core.InputSignal<TableConfig>;
113
247
  readonly tableData: _angular_core.InputSignal<T[]>;
@@ -129,11 +263,6 @@ declare class NgxBasicTable<T> {
129
263
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxBasicTable<any>, "ngx-basic-table", never, { "tableConfig": { "alias": "tableConfig"; "required": true; "isSignal": true; }; "tableData": { "alias": "tableData"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": true; "isSignal": true; }; }, { "create": "create"; "view": "view"; "download": "download"; "update": "update"; "delete": "delete"; }, never, never, true, never>;
130
264
  }
131
265
 
132
- declare class NgxPaginatedTable {
133
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPaginatedTable, never>;
134
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxPaginatedTable, "ngx-paginated-table", never, {}, {}, never, never, true, never>;
135
- }
136
-
137
266
  declare class NgxInputFile implements OnInit {
138
267
  private _cdr;
139
268
  value: _angular_core.WritableSignal<File[]>;
@@ -151,6 +280,7 @@ declare class NgxInputFile implements OnInit {
151
280
  isDropping: _angular_core.WritableSignal<boolean>;
152
281
  inputFileRef: _angular_core.Signal<ElementRef<any> | undefined>;
153
282
  internalControl: FormControl<string[] | null>;
283
+ constructor();
154
284
  private checkErrors;
155
285
  controlEffect: _angular_core.EffectRef;
156
286
  ngOnInit(): void;
@@ -196,7 +326,7 @@ declare class NgxBasicSelect<T> {
196
326
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxBasicSelect<any>, "ngx-basic-select", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "options": { "alias": "options"; "required": true; "isSignal": true; }; "basicSelectConfig": { "alias": "basicSelectConfig"; "required": true; "isSignal": true; }; "control": { "alias": "control"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": true; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
197
327
  }
198
328
 
199
- declare class NgxPaginatedSelect<T, U extends PaginatedFilter> implements OnInit {
329
+ declare class NgxPaginatedSelect<T, U extends PaginatedFilter<T>> implements OnInit {
200
330
  private _bottomSheet;
201
331
  private _cdr;
202
332
  readonly label: _angular_core.InputSignal<string>;
@@ -268,6 +398,117 @@ declare class NgxDialog<T = any> {
268
398
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxDialog<any>, "ngx-dialog", never, {}, {}, never, never, true, never>;
269
399
  }
270
400
 
401
+ declare class NgxConfirmDialogComponent {
402
+ dialogRef: MatDialogRef<any, any>;
403
+ data: ConfirmDialogData<any>;
404
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxConfirmDialogComponent, never>;
405
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxConfirmDialogComponent, "ngx-confirm-dialog", never, {}, {}, never, never, true, never>;
406
+ }
407
+
408
+ interface ColumnConfig<T> {
409
+ key: keyof T;
410
+ show: boolean;
411
+ isSticky: boolean;
412
+ }
413
+
414
+ declare class NgxPaginatedTable<T, U extends PaginatedFilter<T>> implements OnDestroy {
415
+ private readonly columnConfigService;
416
+ private readonly advancedFilterService;
417
+ private readonly dialog;
418
+ private readonly datosPantallaService;
419
+ protected isDesktop: Signal<boolean>;
420
+ endpoint: _angular_core.InputSignal<(filters: U) => Observable<PaginatedItems<T>>>;
421
+ filters: _angular_core.InputSignal<WritableSignal<U>>;
422
+ config: _angular_core.InputSignal<WritableSignal<PaginatedTableConfig<T>>>;
423
+ protected createClick: _angular_core.OutputEmitterRef<void>;
424
+ protected updateClick: _angular_core.OutputEmitterRef<T>;
425
+ protected deleteClick: _angular_core.OutputEmitterRef<T>;
426
+ protected rowActionClick: _angular_core.OutputEmitterRef<RowActionClickEvent<T>>;
427
+ protected expandedItemChange: _angular_core.OutputEmitterRef<T | null>;
428
+ protected selectionActionEvent: _angular_core.OutputEmitterRef<SelectionActionEvent<T>>;
429
+ protected readonly filterKeyPrefix = "filter";
430
+ protected readonly nameOfActionsColumn = "actionsPerRow";
431
+ protected readonly generalFooterKeyPrefix = "footer";
432
+ protected readonly nameOfRowSelectionColumn = "rowSelectionColumn";
433
+ protected readonly debounceTime = 300;
434
+ dataResource: _angular_core.ResourceRef<PaginatedItems<T>>;
435
+ protected data: Signal<T[]>;
436
+ protected total: Signal<number>;
437
+ protected columnConfig: Signal<ColumnConfig<T>[]>;
438
+ protected stickyColumnKey: Signal<keyof T | undefined>;
439
+ protected keys: Signal<(string | keyof T)[]>;
440
+ protected keysWithFilter: Signal<string[]>;
441
+ protected keysWithGeneralFooter: Signal<string[]>;
442
+ protected showFiltersRow: Signal<boolean>;
443
+ protected showActionsColumn: Signal<boolean>;
444
+ protected showTotalPerPageFooter: Signal<boolean>;
445
+ protected showTotalGeneralFooter: Signal<boolean>;
446
+ protected queryTimeout: number | undefined;
447
+ protected timeoutsByKey: Partial<Record<keyof T, number>>;
448
+ protected advancedFilters: Signal<AdvancedFilter<T>[]>;
449
+ protected readonly expandableColumnDef = "expandedDetail";
450
+ protected expandedItem: WritableSignal<T | null>;
451
+ protected selection: WritableSignal<T[]>;
452
+ protected isFullScreen: WritableSignal<boolean>;
453
+ private readonly overlay;
454
+ private readonly overlayContainer;
455
+ private readonly viewContainerRef;
456
+ tableContentTemplate: Signal<TemplateRef<any> | undefined>;
457
+ private overlayRef?;
458
+ private portal?;
459
+ onEscape(): void;
460
+ ngOnDestroy(): void;
461
+ private includeInColumnConfig;
462
+ protected getKeyAsString: (columnKey: keyof T | string) => string;
463
+ protected onPageChange(event: PageEvent): void;
464
+ protected onQueryChange(inputElement: HTMLInputElement): void;
465
+ protected onQueryReset(inputElement: HTMLInputElement): void;
466
+ protected onSortChange(sort: Sort): void;
467
+ protected onNewClick(): void;
468
+ protected onUpdateClick(row: T, event: Event): void;
469
+ protected onRowClick(row: T): void;
470
+ protected isRowEnabled(row: T): boolean | undefined;
471
+ protected onDeleteClick(row: T, event: Event): void;
472
+ protected onRowActionClick(row: T, rowAction: TableRowAction<T>, event: Event): void;
473
+ protected onTextFilterColumnChange(column: PaginatedTableColumn<T>, event: Event): void;
474
+ protected onOptionFilterColumnChange(column: PaginatedTableColumn<T>, event: MatSelectChange<string | string[]>): void;
475
+ protected onDateFilterChange(column: PaginatedTableColumn<T>, value: moment.Moment | null): void;
476
+ protected onDateRangeFilterChange(column: PaginatedTableColumn<T>, value: DateRange<moment.Moment | null> | null): void;
477
+ private onColumnFilterChange;
478
+ protected getValueOfColumnFilter(key: keyof T): ColumnValue;
479
+ protected getDateRangeValueOfColumnFilter(key: keyof T, type: 'start' | 'end'): moment.Moment | null;
480
+ protected onEditColumns(): void;
481
+ protected applyColumnPipes(value: any, pipes?: ColumnPipe | ColumnPipe[]): any;
482
+ protected onNewAdvancedFiltersClick(): void;
483
+ protected onApplyTemplateClick(advancedFilter?: AdvancedFilter<T>): void;
484
+ protected onSelectedAdvancedFilterUpdate(event: Event): void;
485
+ protected onAdvancedFilterUpdate(event: Event, advancedFilter: AdvancedFilter<T>, advancedFiltersMenuTrigger?: MatMenuTrigger): void;
486
+ protected onAdvancedFilterDelete(event: Event, advancedFiltersMenuTrigger: MatMenuTrigger, advancedFilter: AdvancedFilter<T>): void;
487
+ protected onQuitAdvancedFilter(event: Event): void;
488
+ protected getAdvancedFilterLabel(): string;
489
+ protected rowIsExpanded(row: T): boolean;
490
+ protected expandableToggle(row: T): void;
491
+ protected getTotalOfColum(columnKey: keyof T): number;
492
+ protected areEqualByKeys(record1: T, record2: T): boolean;
493
+ protected isRowSelected(row: T): boolean;
494
+ protected toggleRowSelection(row: T): void;
495
+ protected isAllPageRowSelected(): boolean;
496
+ protected toggleAllPageRowSelection(): void;
497
+ protected getRowSelectionAction(): RowSelectionAction<T>[];
498
+ protected uncheckAllSelection(): void;
499
+ protected onRowSelectionActionClick(actionId: string): void;
500
+ private getDocumentHeaders;
501
+ private getDocumentRows;
502
+ protected exportToCsvCurrentPage(): void;
503
+ protected exportToPdfCurrentPage(): void;
504
+ protected onToggleFullScreen(): void;
505
+ private enterFullscreen;
506
+ private exitFullscreen;
507
+ private isMyOverlayOnTop;
508
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPaginatedTable<any, any>, never>;
509
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxPaginatedTable<any, any>, "ngx-paginated-table", never, { "endpoint": { "alias": "endpoint"; "required": true; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "createClick": "createClick"; "updateClick": "updateClick"; "deleteClick": "deleteClick"; "rowActionClick": "rowActionClick"; "expandedItemChange": "expandedItemChange"; "selectionActionEvent": "selectionActionEvent"; }, never, ["[icon-buttons]", "[more-filters]", "[extra-header-content]", "[end-container]"], true, never>;
510
+ }
511
+
271
512
  declare class NgxDialogService {
272
513
  private readonly _dialog;
273
514
  /**
@@ -399,5 +640,5 @@ declare class DynamicHostDirective<T> {
399
640
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DynamicHostDirective<any>, "[ngxDynamicHost]", never, { "component": { "alias": "component"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
400
641
  }
401
642
 
402
- export { DynamicHostDirective, NgxBasicSelect, NgxBasicTable, NgxDialog, NgxDialogService, NgxInputFile, NgxLoadingButton, NgxPaginatedSelect, NgxPaginatedTable };
403
- export type { ActionKey, BasicSelectConfig, ButtonConfig, ColumnType, LinkConfig, PaginatedFilter, PaginatedItems, PaginatedSelectConfig, PipeConfig, PipeType, SortBy, TableColumn, TableConfig };
643
+ export { DynamicHostDirective, FILTER_CONNECTOR_LABEL, FILTER_OPERATOR_LABEL, NgxBasicSelect, NgxBasicTable, NgxConfirmDialogComponent, NgxDialog, NgxDialogService, NgxInputFile, NgxLoadingButton, NgxPaginatedSelect, NgxPaginatedTable, OPERATOR_BY_FILTER_TYPE, OPTIONS_FILTER_CONNECTOR, USER_ID_FACTORY };
644
+ export type { ActionKey, AdvancedFilter, BasicSelectConfig, ButtonConfig, ColumnPipe, ColumnType, ConfirmDialogData, DeleteConfirm, FilterConnector, FilterGroup, FilterOperator, FilterOption, FilterRule, FilterType, LinkConfig, PaginatedFilter, PaginatedItems, PaginatedSelectConfig, PaginatedTableColumn, PaginatedTableConfig, PipeConfig, PipeType, RowActionClickEvent, RowActionIconColor, RowSelectionAction, SelectionActionEvent, SortBy, TableBasicAction, TableColumn, TableConfig, TableRowAction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-eiffage-material",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.0",
6
6
  "@angular/core": "^20.1.0"