easy-mat-ui 1.0.1 → 1.1.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.
package/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnChanges, AfterViewInit, EventEmitter, ChangeDetectorRef, SimpleChanges, QueryList, Injector, InjectionToken, Provider } from '@angular/core';
2
+ import { OnInit, OnChanges, AfterViewInit, EventEmitter, ChangeDetectorRef, SimpleChanges, Type, QueryList, Injector, InjectionToken, Provider } from '@angular/core';
3
3
  import { MatTableDataSource, MatTable } from '@angular/material/table';
4
4
  import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
5
5
  import { MatSort } from '@angular/material/sort';
6
- import { FormControl } from '@angular/forms';
6
+ import { MatTabGroup } from '@angular/material/tabs';
7
+ import { FormControl, ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
7
8
  import { MatSelect } from '@angular/material/select';
8
9
  import { MatFormFieldAppearance } from '@angular/material/form-field';
9
10
  import { Observable } from 'rxjs';
@@ -21,6 +22,38 @@ declare class EasyMatUiComponent {
21
22
  static ɵcmp: i0.ɵɵComponentDeclaration<EasyMatUiComponent, "lib-easy-mat-ui", never, {}, {}, never, never, true, never>;
22
23
  }
23
24
 
25
+ interface EasyTableGroupBy {
26
+ field: string;
27
+ collapsible?: boolean;
28
+ expanded?: boolean;
29
+ selectionField?: string;
30
+ emptyLabel?: string;
31
+ showGroupColumn?: boolean;
32
+ showToggleAll?: boolean;
33
+ expandAllLabel?: string;
34
+ collapseAllLabel?: string;
35
+ }
36
+ type EasyCheckState = 'all' | 'some' | 'none';
37
+ interface EasyTableGroupSelectionChange<T = any> {
38
+ field: string;
39
+ groupKey: string;
40
+ groupValue: unknown;
41
+ rows: T[];
42
+ value: boolean;
43
+ previousState: EasyCheckState;
44
+ }
45
+
46
+ declare class RowGroupingState {
47
+ private readonly overrides;
48
+ isExpanded(key: string, groupBy: EasyTableGroupBy): boolean;
49
+ setAll(keys: string[], expanded: boolean): void;
50
+ toggle(key: string, groupBy: EasyTableGroupBy): void;
51
+ }
52
+ interface GroupExpansion {
53
+ allExpanded: boolean;
54
+ allCollapsed: boolean;
55
+ }
56
+
24
57
  declare enum CRUD {
25
58
  CREATE = "create",
26
59
  READ = "read",
@@ -40,7 +73,8 @@ declare enum ColumnType {
40
73
  PASSWORD = "password",
41
74
  BUTTON = "button",
42
75
  DROPDOWNLIST = "dropdownlist",
43
- IMAGE = "image"
76
+ IMAGE = "image",
77
+ Checkbox = "checkbox"
44
78
  }
45
79
  declare enum ColumnSize {
46
80
  XSmall = "x-small-column",
@@ -82,6 +116,19 @@ declare class Tuple {
82
116
  constructor(item1: string, item2: string, item3: string | null, item4?: string | null | undefined);
83
117
  }
84
118
 
119
+ type EasyColumnAlign = 'left' | 'center' | 'right';
120
+ interface EasyColumnSelection {
121
+ enabled?: boolean;
122
+ headerAlign?: EasyColumnAlign;
123
+ disabledFn?: (row: any) => boolean;
124
+ }
125
+ interface EasyTableSelectionChange<T = any> {
126
+ field: string;
127
+ row: T;
128
+ value: boolean;
129
+ previousValue: boolean | undefined;
130
+ }
131
+
85
132
  /** How a column is filtered from the table header: a multi-select of its values, or a free text input. */
86
133
  type ColumnFilterType = 'select' | 'text';
87
134
  declare class MatColumnTyped {
@@ -97,6 +144,7 @@ declare class MatColumnTyped {
97
144
  readonly BUTTON: "button";
98
145
  readonly DROPDOWNLIST: "dropdownlist";
99
146
  readonly IMAGE: "image";
147
+ readonly CHECKBOX: "checkbox";
100
148
  };
101
149
  static readonly ColumnSize: {
102
150
  readonly XSmall: "x-small-column";
@@ -130,6 +178,7 @@ declare class MatColumnTyped {
130
178
  /** Kind of header filter shown when `enableFilter` is on (and `withFilterInHeader` for the table). */
131
179
  filterType: ColumnFilterType;
132
180
  filterList: any[];
181
+ optionsFilter?: (option: any, data: any) => boolean;
133
182
  isOverwriting: boolean;
134
183
  readonly: boolean;
135
184
  stickyClass: string;
@@ -160,7 +209,9 @@ declare class MatColumnTyped {
160
209
  title?: string | null;
161
210
  titleFallback?: string | null;
162
211
  headerIcon?: string | null;
212
+ selection?: EasyColumnSelection;
163
213
  constructor(init?: Partial<MatColumnTyped>);
214
+ get checkboxHeaderAlignClass(): string;
164
215
  static allColumnTypes(): string[];
165
216
  static allColumnSizes(): string[];
166
217
  static allInputTypes(): string[];
@@ -236,12 +287,19 @@ declare class EasyMultiSelect implements OnInit, OnChanges, AfterViewInit {
236
287
  static ɵcmp: i0.ɵɵComponentDeclaration<EasyMultiSelect, "lib-easy-multi-select", never, { "data": { "alias": "data"; "required": false; }; "title": { "alias": "title"; "required": false; }; "valueField": { "alias": "valueField"; "required": false; }; "displayField": { "alias": "displayField"; "required": false; }; "selectedData": { "alias": "selectedData"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "noPlaceholderNoHint": { "alias": "noPlaceholderNoHint"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "formField": { "alias": "formField"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "single": { "alias": "single"; "required": false; }; "idPrefix": { "alias": "idPrefix"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
237
288
  }
238
289
 
290
+ type ToolbarSaveState = 'pending' | 'saving' | 'saved' | 'error';
239
291
  declare class ToolbarTranslations {
240
292
  title: string | null;
241
293
  search: string;
242
294
  clear: string;
243
295
  addBtn: string;
296
+ saveBtn: string;
297
+ savePendingBtn: string;
298
+ savingBtn: string;
299
+ savedBtn: string;
300
+ saveErrorBtn: string;
244
301
  exportBtn: string;
302
+ importBtn: string;
245
303
  close: string;
246
304
  auditTrailBtn: string;
247
305
  linkBtn: string;
@@ -260,6 +318,7 @@ declare class ToolbarConfig {
260
318
  isAndFilterOperator: boolean;
261
319
  logout: boolean;
262
320
  btnSize: string;
321
+ saveState: ToolbarSaveState | null;
263
322
  customActionEnable: boolean;
264
323
  customActionIcon?: string;
265
324
  customRowActionClass: string;
@@ -281,6 +340,7 @@ interface EasyDialogField {
281
340
  readonly?: boolean;
282
341
  size?: ColumnSize | string;
283
342
  filterList?: any[];
343
+ optionsFilter?: (option: any, data: any) => boolean;
284
344
  displayColumn?: string | null;
285
345
  filterValue?: string | null;
286
346
  isRequired?: boolean;
@@ -424,8 +484,12 @@ declare class EasyTableConfig<T = any> {
424
484
  extendableColumnCheck?: string;
425
485
  expandedIcon: string;
426
486
  dialog?: EasyTableDialogConfig;
487
+ groupBy?: EasyTableGroupBy;
427
488
  tabTitle?: string;
428
489
  tabIcon?: string;
490
+ tabContent?: Type<unknown>;
491
+ tabContentInputs?: Record<string, unknown>;
492
+ canLeaveTab?: () => boolean | Promise<boolean>;
429
493
  constructor(init?: Partial<EasyTableConfig>);
430
494
  }
431
495
 
@@ -454,10 +518,13 @@ declare class EasyTableComponent<T extends Record<string, any>> implements OnIni
454
518
  logout: EventEmitter<String>;
455
519
  titleIconClick: EventEmitter<void>;
456
520
  customAction: EventEmitter<void>;
521
+ importData: EventEmitter<void>;
457
522
  auditTrail: EventEmitter<object>;
458
523
  dialogAction: EventEmitter<EasyTableDialogRequest<any>>;
459
524
  dialogResult: EventEmitter<EasyTableDialogResult<any>>;
460
525
  extendRow: EventEmitter<any>;
526
+ groupSelectionChange: EventEmitter<EasyTableGroupSelectionChange<T>>;
527
+ selectionChange: EventEmitter<EasyTableSelectionChange<T>>;
461
528
  clickField: EventEmitter<{
462
529
  columnName: string;
463
530
  row: T;
@@ -472,6 +539,7 @@ declare class EasyTableComponent<T extends Record<string, any>> implements OnIni
472
539
  columnName: string;
473
540
  row: any;
474
541
  }>;
542
+ childSelectionChange: EventEmitter<EasyTableSelectionChange<any>>;
475
543
  searchTableField: string;
476
544
  /**
477
545
  * Text the table filters on. It is kept apart from `searchTableField`, the value bound to the toolbar input:
@@ -498,13 +566,17 @@ declare class EasyTableComponent<T extends Record<string, any>> implements OnIni
498
566
  expandedElement: any;
499
567
  childTabIndex: number;
500
568
  get childTabs(): EasyTableConfig<any>[] | null;
501
- onChildTabChange(index: number): void;
569
+ onChildTabChange(index: number, tabGroup: MatTabGroup): Promise<void>;
570
+ get hasTabLeaveGuard(): boolean;
502
571
  selectedRow: any;
572
+ readonly rowGrouping: RowGroupingState;
573
+ readonly isGroupRow: (_index: number, row: any) => boolean;
574
+ readonly isDataRow: (_index: number, row: any) => boolean;
503
575
  paginator: MatPaginator;
504
576
  sort: MatSort;
505
577
  table: MatTable<any> | undefined;
506
578
  multiSelectDropdowns: QueryList<EasyMultiSelect>;
507
- isExpansionDetailRow: (index: number, row: any) => boolean;
579
+ isExpansionDetailRow: (_index: number, row: any) => boolean;
508
580
  private readonly injector;
509
581
  private readonly destroyRef;
510
582
  private readonly translate;
@@ -517,6 +589,11 @@ declare class EasyTableComponent<T extends Record<string, any>> implements OnIni
517
589
  loadData(): void;
518
590
  /** The rows in display order: always a sorted copy, the array of the application is not reordered. */
519
591
  private displayRows;
592
+ private groupRows;
593
+ private createDataSource;
594
+ get groupExpansion(): GroupExpansion;
595
+ setAllRowGroups(expanded: boolean): void;
596
+ toggleRowGroup(key: string): void;
520
597
  syncFiltersWithData(): void;
521
598
  ngAfterViewInit(): void;
522
599
  updatePageSize(): void;
@@ -564,7 +641,7 @@ declare class EasyTableComponent<T extends Record<string, any>> implements OnIni
564
641
  onDeleteChildItem(item: object): void;
565
642
  onViewChildItem(item: object): void;
566
643
  static ɵfac: i0.ɵɵFactoryDeclaration<EasyTableComponent<any>, never>;
567
- static ɵcmp: i0.ɵɵComponentDeclaration<EasyTableComponent<any>, "lib-easy-table", never, { "dataSource": { "alias": "dataSource"; "required": false; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; }; "config": { "alias": "config"; "required": false; }; "childConfig": { "alias": "childConfig"; "required": false; }; }, { "childTabChange": "childTabChange"; "deleteItem": "deleteItem"; "addItem": "addItem"; "editItem": "editItem"; "viewItem": "viewItem"; "overwrite": "overwrite"; "logout": "logout"; "titleIconClick": "titleIconClick"; "customAction": "customAction"; "auditTrail": "auditTrail"; "dialogAction": "dialogAction"; "dialogResult": "dialogResult"; "extendRow": "extendRow"; "clickField": "clickField"; "addChildItem": "addChildItem"; "deleteChildItem": "deleteChildItem"; "editChildItem": "editChildItem"; "viewChildItem": "viewChildItem"; "childDialogAction": "childDialogAction"; "childDialogResult": "childDialogResult"; "clickChildField": "clickChildField"; }, never, never, true, never>;
644
+ static ɵcmp: i0.ɵɵComponentDeclaration<EasyTableComponent<any>, "lib-easy-table", never, { "dataSource": { "alias": "dataSource"; "required": false; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; }; "config": { "alias": "config"; "required": false; }; "childConfig": { "alias": "childConfig"; "required": false; }; }, { "childTabChange": "childTabChange"; "deleteItem": "deleteItem"; "addItem": "addItem"; "editItem": "editItem"; "viewItem": "viewItem"; "overwrite": "overwrite"; "logout": "logout"; "titleIconClick": "titleIconClick"; "customAction": "customAction"; "importData": "importData"; "auditTrail": "auditTrail"; "dialogAction": "dialogAction"; "dialogResult": "dialogResult"; "extendRow": "extendRow"; "groupSelectionChange": "groupSelectionChange"; "selectionChange": "selectionChange"; "clickField": "clickField"; "addChildItem": "addChildItem"; "deleteChildItem": "deleteChildItem"; "editChildItem": "editChildItem"; "viewChildItem": "viewChildItem"; "childDialogAction": "childDialogAction"; "childDialogResult": "childDialogResult"; "clickChildField": "clickChildField"; "childSelectionChange": "childSelectionChange"; }, never, never, true, never>;
568
645
  }
569
646
 
570
647
  declare class EasyTableBasicComponent<T extends Record<string, any>> implements OnInit, AfterViewInit, OnChanges {
@@ -590,9 +667,13 @@ declare class EasyTableBasicComponent<T extends Record<string, any>> implements
590
667
  logout: EventEmitter<String>;
591
668
  titleIconClick: EventEmitter<void>;
592
669
  customAction: EventEmitter<void>;
670
+ saveData: EventEmitter<void>;
671
+ importData: EventEmitter<void>;
593
672
  auditTrail: EventEmitter<object>;
594
673
  dialogAction: EventEmitter<EasyTableDialogRequest<any>>;
595
674
  dialogResult: EventEmitter<EasyTableDialogResult<any>>;
675
+ groupSelectionChange: EventEmitter<EasyTableGroupSelectionChange<T>>;
676
+ selectionChange: EventEmitter<EasyTableSelectionChange<T>>;
596
677
  clickField: EventEmitter<{
597
678
  columnName: string;
598
679
  row: T;
@@ -621,6 +702,9 @@ declare class EasyTableBasicComponent<T extends Record<string, any>> implements
621
702
  [key: string]: boolean;
622
703
  };
623
704
  selectedRow: any;
705
+ readonly rowGrouping: RowGroupingState;
706
+ readonly isGroupRow: (_index: number, row: any) => boolean;
707
+ readonly isDataRow: (_index: number, row: any) => boolean;
624
708
  paginator: MatPaginator;
625
709
  sort: MatSort;
626
710
  table: MatTable<any> | undefined;
@@ -637,6 +721,11 @@ declare class EasyTableBasicComponent<T extends Record<string, any>> implements
637
721
  loadData(): void;
638
722
  /** The rows in display order: always a sorted copy, the array of the application is not reordered. */
639
723
  private displayRows;
724
+ private groupRows;
725
+ private createDataSource;
726
+ get groupExpansion(): GroupExpansion;
727
+ setAllRowGroups(expanded: boolean): void;
728
+ toggleRowGroup(key: string): void;
640
729
  syncFiltersWithData(): void;
641
730
  ngAfterViewInit(): void;
642
731
  updatePageSize(): void;
@@ -679,7 +768,7 @@ declare class EasyTableBasicComponent<T extends Record<string, any>> implements
679
768
  getSelectedRow(element: any): boolean;
680
769
  manageSelectedRow(item: any): void;
681
770
  static ɵfac: i0.ɵɵFactoryDeclaration<EasyTableBasicComponent<any>, never>;
682
- static ɵcmp: i0.ɵɵComponentDeclaration<EasyTableBasicComponent<any>, "lib-easy-table-basic", never, { "dataSource": { "alias": "dataSource"; "required": false; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "deleteItem": "deleteItem"; "addItem": "addItem"; "editItem": "editItem"; "viewItem": "viewItem"; "overwrite": "overwrite"; "logout": "logout"; "titleIconClick": "titleIconClick"; "customAction": "customAction"; "auditTrail": "auditTrail"; "dialogAction": "dialogAction"; "dialogResult": "dialogResult"; "clickField": "clickField"; }, never, never, true, never>;
771
+ static ɵcmp: i0.ɵɵComponentDeclaration<EasyTableBasicComponent<any>, "lib-easy-table-basic", never, { "dataSource": { "alias": "dataSource"; "required": false; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "deleteItem": "deleteItem"; "addItem": "addItem"; "editItem": "editItem"; "viewItem": "viewItem"; "overwrite": "overwrite"; "logout": "logout"; "titleIconClick": "titleIconClick"; "customAction": "customAction"; "saveData": "saveData"; "importData": "importData"; "auditTrail": "auditTrail"; "dialogAction": "dialogAction"; "dialogResult": "dialogResult"; "groupSelectionChange": "groupSelectionChange"; "selectionChange": "selectionChange"; "clickField": "clickField"; }, never, never, true, never>;
683
772
  }
684
773
 
685
774
  declare class MatColumn {
@@ -708,6 +797,7 @@ declare class TableToolbarComponent {
708
797
  readonly: boolean;
709
798
  canCreate: boolean;
710
799
  canExport: boolean;
800
+ canImport: boolean;
711
801
  showFilterOperator: boolean;
712
802
  customColumnFilter: Dictionary[];
713
803
  searchTableFieldChange: EventEmitter<string>;
@@ -717,7 +807,9 @@ declare class TableToolbarComponent {
717
807
  filterTypeEvent: EventEmitter<void>;
718
808
  clearTableFilterEvent: EventEmitter<void>;
719
809
  addItem: EventEmitter<void>;
810
+ save: EventEmitter<void>;
720
811
  exportToCsv: EventEmitter<void>;
812
+ importData: EventEmitter<void>;
721
813
  customAction: EventEmitter<void>;
722
814
  close: EventEmitter<void>;
723
815
  toggleChanged: EventEmitter<any>;
@@ -728,6 +820,10 @@ declare class TableToolbarComponent {
728
820
  filterType(): void;
729
821
  clearTableFilter(): void;
730
822
  onAddItem(): void;
823
+ onSave(): void;
824
+ get saveIcon(): string;
825
+ get saveTitle(): string;
826
+ onImportData(): void;
731
827
  onExportToCsv(): void;
732
828
  onCustomAction(): void;
733
829
  onClose(): void;
@@ -737,7 +833,7 @@ declare class TableToolbarComponent {
737
833
  getFilterColor(filter: Dictionary): string | undefined;
738
834
  getFilterIcon(filter: Dictionary): string;
739
835
  static ɵfac: i0.ɵɵFactoryDeclaration<TableToolbarComponent, never>;
740
- static ɵcmp: i0.ɵɵComponentDeclaration<TableToolbarComponent, "lib-table-toolbar", never, { "config": { "alias": "config"; "required": false; }; "isPreview": { "alias": "isPreview"; "required": false; }; "searchTableField": { "alias": "searchTableField"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "canCreate": { "alias": "canCreate"; "required": false; }; "canExport": { "alias": "canExport"; "required": false; }; "showFilterOperator": { "alias": "showFilterOperator"; "required": false; }; "customColumnFilter": { "alias": "customColumnFilter"; "required": false; }; }, { "searchTableFieldChange": "searchTableFieldChange"; "applyFilterEvent": "applyFilterEvent"; "searchInput": "searchInput"; "filterTypeEvent": "filterTypeEvent"; "clearTableFilterEvent": "clearTableFilterEvent"; "addItem": "addItem"; "exportToCsv": "exportToCsv"; "customAction": "customAction"; "close": "close"; "toggleChanged": "toggleChanged"; }, never, ["[toolbarFilters]", "*"], true, never>;
836
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableToolbarComponent, "lib-table-toolbar", never, { "config": { "alias": "config"; "required": false; }; "isPreview": { "alias": "isPreview"; "required": false; }; "searchTableField": { "alias": "searchTableField"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "canCreate": { "alias": "canCreate"; "required": false; }; "canExport": { "alias": "canExport"; "required": false; }; "canImport": { "alias": "canImport"; "required": false; }; "showFilterOperator": { "alias": "showFilterOperator"; "required": false; }; "customColumnFilter": { "alias": "customColumnFilter"; "required": false; }; }, { "searchTableFieldChange": "searchTableFieldChange"; "applyFilterEvent": "applyFilterEvent"; "searchInput": "searchInput"; "filterTypeEvent": "filterTypeEvent"; "clearTableFilterEvent": "clearTableFilterEvent"; "addItem": "addItem"; "save": "save"; "exportToCsv": "exportToCsv"; "importData": "importData"; "customAction": "customAction"; "close": "close"; "toggleChanged": "toggleChanged"; }, never, ["[toolbarFilters]", "*"], true, never>;
741
837
  }
742
838
 
743
839
  interface ConfirmDeleteData {
@@ -746,17 +842,25 @@ interface ConfirmDeleteData {
746
842
  confirm: string;
747
843
  cancel: string;
748
844
  icon?: string;
845
+ choices?: ConfirmChoice[];
846
+ }
847
+ interface ConfirmChoice {
848
+ value: string;
849
+ label: string;
850
+ description: string;
851
+ icon: string;
749
852
  }
750
853
  declare class ConfirmDialogComponent {
751
854
  readonly data: ConfirmDeleteData;
752
855
  private readonly dialogRef;
753
856
  constructor();
754
- close(confirmed: boolean): void;
857
+ close(result: boolean | string): void;
755
858
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
756
859
  static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "lib-confirm-dialog", never, {}, {}, never, never, true, never>;
757
860
  }
758
861
  declare function confirmDelete(injector: Injector, translations: ToolbarTranslations): Observable<boolean>;
759
862
  declare function confirmAction(injector: Injector, data: ConfirmDeleteData): Observable<boolean>;
863
+ declare function confirmChoice(injector: Injector, data: ConfirmDeleteData): Observable<string | null>;
760
864
 
761
865
  interface DropdownState {
762
866
  control: FormControl<any>;
@@ -771,6 +875,7 @@ declare class EasyDialogComponent {
771
875
  readonly isReadOnly: boolean;
772
876
  readonly data: Record<string, any>;
773
877
  readonly groupedFields: EasyDialogField[][];
878
+ private readonly dropdownChanged;
774
879
  readonly dropdowns: Record<string, DropdownState>;
775
880
  readonly dateControls: Record<string, FormControl<Date | null>>;
776
881
  readonly confirmingClose: i0.WritableSignal<boolean>;
@@ -1132,5 +1237,209 @@ declare class EasyPageHeader {
1132
1237
  static ɵcmp: i0.ɵɵComponentDeclaration<EasyPageHeader, "lib-easy-page-header", never, { "config": { "alias": "config"; "required": true; }; }, {}, never, ["*"], true, never>;
1133
1238
  }
1134
1239
 
1135
- export { CRUD, ColumnSize, ColumnType, ConfirmDialogComponent, DEFAULT_EASY_DIALOG_TRANSLATIONS, Dictionary, EASY_DIALOG_DEFAULT_MAX_WIDTH, EASY_DIALOG_DEFAULT_WIDTH, EASY_THEME_OPTIONS, EasyCard, EasyCardGrid, EasyChipNav, EasyDialogComponent, EasyDialogConfig, EasyDialogService, EasyLanguageSwitch, EasyMatUiComponent, EasyMatUiService, EasyMultiSelect, EasyPageHeader, EasyPaginatorIntl, EasySegmented, EasyStat, EasyTableBasicComponent, EasyTableComponent, EasyTableConfig, EasyThemeService, InputType, MatColumn, MatColumnTyped, ScreenSize, TableToolbarComponent, TitleFormatter, ToolbarConfig, ToolbarTranslations, Tuple, confirmAction, confirmDelete, provideEasyPaginatorIntl, resolveDialogRequest };
1136
- export type { ColumnFilterType, ConfirmDeleteData, EasyCardAction, EasyCardActionEvent, EasyCardConfig, EasyChipNavItem, EasyDialogAction, EasyDialogButtonColor, EasyDialogField, EasyDialogInit, EasyDialogResult, EasyDialogSize, EasyDialogTranslations, EasyLanguage, EasyLanguageDisplay, EasyLanguageLayout, EasyPageHeaderConfig, EasyResolvedTheme, EasySegmentedOption, EasySegmentedSemantics, EasySegmentedSize, EasyStatConfig, EasyStatTone, EasyTableDialogConfig, EasyTableDialogMode, EasyTableDialogRequest, EasyTableDialogResult, EasyThemeMode, EasyThemeOptions, TitlePipe, TitleTranslate };
1240
+ interface EasyCsvParseOptions {
1241
+ delimiter?: string | 'auto';
1242
+ withHeader?: boolean | 'auto';
1243
+ }
1244
+ interface EasyCsvParseResult {
1245
+ delimiter: string;
1246
+ hasHeader: boolean;
1247
+ headerDetected: boolean;
1248
+ delimiterDetected: boolean;
1249
+ headers: string[];
1250
+ rows: string[][];
1251
+ records: Record<string, string>[];
1252
+ rowCount: number;
1253
+ columnCount: number;
1254
+ warnings: string[];
1255
+ errors: string[];
1256
+ }
1257
+ interface RowsParsing {
1258
+ rows: string[][];
1259
+ errors: string[];
1260
+ }
1261
+ declare function stripByteOrderMark(text: string): string;
1262
+ declare function parseCsvRows(text: string, delimiter: string): RowsParsing;
1263
+ declare function detectCsvDelimiter(text: string): string | null;
1264
+ declare function detectCsvHeader(rows: string[][]): boolean;
1265
+ declare function parseCsv(content: string, options?: EasyCsvParseOptions): EasyCsvParseResult;
1266
+
1267
+ type EasyFileUploadOutputMode = 'easy-table' | 'easy-basic-table' | 'raw';
1268
+ type EasyFileUploadMode = 'button' | 'drag-drop' | 'both';
1269
+ type EasyFileUploadButtonAppearance = 'filled' | 'tonal' | 'outlined' | 'text';
1270
+ type EasyFileUploadButtonSize = 'small' | 'medium' | 'large';
1271
+ type EasyFileUploadDuplicateHandling = 'reject' | 'replace' | 'allow';
1272
+ type EasyFileUploadLayout = 'area' | 'field';
1273
+ type EasyFileUploadAppearance = 'outline' | 'filled' | 'flat';
1274
+ type EasyFileUploadStatus = 'idle' | 'processing' | 'success' | 'error';
1275
+ type EasyFileItemStatus = 'ready' | 'processing' | 'parsed' | 'error';
1276
+ type EasyFileUploadErrorCode = 'type' | 'size' | 'max-files' | 'duplicate' | 'empty' | 'parse' | 'read' | 'required';
1277
+ interface EasyFileUploadError {
1278
+ code: EasyFileUploadErrorCode;
1279
+ message: string;
1280
+ fileName?: string;
1281
+ }
1282
+ type EasyFileUploadMessages = Partial<Record<EasyFileUploadErrorCode, string>>;
1283
+ interface EasyFileItem {
1284
+ id: string;
1285
+ file: File;
1286
+ name: string;
1287
+ extension: string;
1288
+ size: number;
1289
+ type: string;
1290
+ status: EasyFileItemStatus;
1291
+ error?: string;
1292
+ }
1293
+ interface EasyFileUploadTableOutput<T extends Record<string, any> = Record<string, any>> {
1294
+ config: EasyTableConfig<T>;
1295
+ dataSource: MatTableDataSource<T>;
1296
+ displayedColumns: MatColumnTyped[];
1297
+ childConfig?: EasyTableConfig<T>;
1298
+ }
1299
+ interface EasyFileParsedFile<TOutput = any> {
1300
+ item: EasyFileItem;
1301
+ output: TOutput | null;
1302
+ csv: EasyCsvParseResult | null;
1303
+ delimiter: string | null;
1304
+ hasHeader: boolean | null;
1305
+ warnings: string[];
1306
+ errors: EasyFileUploadError[];
1307
+ }
1308
+ interface EasyFileUploadResult<TOutput = any> {
1309
+ outputMode: EasyFileUploadOutputMode;
1310
+ status: EasyFileUploadStatus;
1311
+ files: EasyFileItem[];
1312
+ parsedFiles: EasyFileParsedFile<TOutput>[];
1313
+ outputs: TOutput[];
1314
+ output: TOutput | null;
1315
+ delimiter: string | null;
1316
+ hasHeader: boolean | null;
1317
+ errors: EasyFileUploadError[];
1318
+ }
1319
+
1320
+ declare class EasyFileUpload<TOutput = any> implements ControlValueAccessor, Validator {
1321
+ accept: string;
1322
+ multiple: boolean;
1323
+ maxFileSize: number | null;
1324
+ maxFiles: number | null;
1325
+ required: boolean;
1326
+ allowDragAndDrop: boolean;
1327
+ showFilePreview: boolean;
1328
+ showFileSize: boolean;
1329
+ showRemoveButton: boolean;
1330
+ showParseInfo: boolean;
1331
+ label: string;
1332
+ placeholder: string;
1333
+ hint: string;
1334
+ icon: string;
1335
+ mode: EasyFileUploadMode | null;
1336
+ browseLabel: string;
1337
+ buttonIcon: string;
1338
+ buttonAppearance: EasyFileUploadButtonAppearance;
1339
+ buttonSize: EasyFileUploadButtonSize;
1340
+ showDropArea: boolean;
1341
+ showButton: boolean;
1342
+ dropTitle: string;
1343
+ dropDescription: string;
1344
+ expanded: boolean;
1345
+ inline: boolean;
1346
+ showProgress: boolean;
1347
+ duplicates: EasyFileUploadDuplicateHandling;
1348
+ customClass: string;
1349
+ appearance: EasyFileUploadAppearance;
1350
+ layout: EasyFileUploadLayout;
1351
+ compact: boolean;
1352
+ inputHeight: string;
1353
+ minHeight: string;
1354
+ maxHeight: string;
1355
+ outputMode: EasyFileUploadOutputMode;
1356
+ delimiter: string | 'auto';
1357
+ withHeader: boolean | 'auto';
1358
+ encoding: string | 'auto';
1359
+ parentColumn: string | null;
1360
+ tableConfig: Partial<EasyTableConfig>;
1361
+ parse: boolean;
1362
+ autoProcess: boolean;
1363
+ loading: boolean;
1364
+ messages: EasyFileUploadMessages;
1365
+ set disabled(value: boolean);
1366
+ inputWidth: string;
1367
+ filesChange: EventEmitter<EasyFileItem[]>;
1368
+ resultChange: EventEmitter<EasyFileUploadResult<TOutput>>;
1369
+ fileRejected: EventEmitter<EasyFileUploadError[]>;
1370
+ fileRemoved: EventEmitter<EasyFileItem>;
1371
+ private fileInput;
1372
+ readonly inputId: string;
1373
+ readonly hintId: string;
1374
+ readonly errorsId: string;
1375
+ readonly items: i0.WritableSignal<EasyFileItem[]>;
1376
+ readonly parsedFiles: i0.WritableSignal<EasyFileParsedFile<TOutput>[]>;
1377
+ readonly errors: i0.WritableSignal<EasyFileUploadError[]>;
1378
+ readonly status: i0.WritableSignal<EasyFileUploadStatus>;
1379
+ readonly dragActive: i0.WritableSignal<boolean>;
1380
+ readonly touched: i0.WritableSignal<boolean>;
1381
+ isDisabled: boolean;
1382
+ private readonly changeDetector;
1383
+ private rejections;
1384
+ private fileSequence;
1385
+ private processingRun;
1386
+ private onChange;
1387
+ private onTouched;
1388
+ private onValidatorChange;
1389
+ get isBusy(): boolean;
1390
+ get isInteractive(): boolean;
1391
+ get hasRequiredError(): boolean;
1392
+ get hasError(): boolean;
1393
+ get visibleErrors(): EasyFileUploadError[];
1394
+ get resolvedMode(): EasyFileUploadMode;
1395
+ get showsDropArea(): boolean;
1396
+ get showsButton(): boolean;
1397
+ get acceptsDrops(): boolean;
1398
+ get resolvedButtonLabel(): string;
1399
+ get resolvedButtonIcon(): string;
1400
+ get resolvedDropTitle(): string;
1401
+ get resolvedPlaceholder(): string;
1402
+ get constraintsSummary(): string;
1403
+ get surfaceHeight(): string | null;
1404
+ get surfaceMinHeight(): string | null;
1405
+ get surfaceMaxHeight(): string | null;
1406
+ get hostClasses(): string;
1407
+ open(): void;
1408
+ clear(): void;
1409
+ process(): Promise<EasyFileUploadResult<TOutput>>;
1410
+ onZoneKey(event: Event): void;
1411
+ onInputChange(event: Event): void;
1412
+ onDragOver(event: DragEvent): void;
1413
+ onDragLeave(event: DragEvent): void;
1414
+ onDrop(event: DragEvent): void;
1415
+ removeFile(item: EasyFileItem, event?: Event): void;
1416
+ markAsTouched(): void;
1417
+ sizeLabel(item: EasyFileItem): string;
1418
+ fileTooltip(item: EasyFileItem): string;
1419
+ parseInfo(item: EasyFileItem): {
1420
+ delimiter: string;
1421
+ header: string;
1422
+ } | null;
1423
+ iconFor(item: EasyFileItem): string;
1424
+ writeValue(value: File | File[] | null): void;
1425
+ registerOnChange(onChange: (value: File | File[] | null) => void): void;
1426
+ registerOnTouched(onTouched: () => void): void;
1427
+ registerOnValidatorChange(onValidatorChange: () => void): void;
1428
+ setDisabledState(isDisabled: boolean): void;
1429
+ validate(_control: AbstractControl): ValidationErrors | null;
1430
+ private addFiles;
1431
+ private findRejectionCode;
1432
+ private createItem;
1433
+ private createError;
1434
+ private resolveMessage;
1435
+ private updateItems;
1436
+ private buildProcessingOptions;
1437
+ private buildResult;
1438
+ private emitFiles;
1439
+ private emitResult;
1440
+ static ɵfac: i0.ɵɵFactoryDeclaration<EasyFileUpload<any>, never>;
1441
+ static ɵcmp: i0.ɵɵComponentDeclaration<EasyFileUpload<any>, "lib-easy-file-upload", never, { "accept": { "alias": "accept"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; "maxFiles": { "alias": "maxFiles"; "required": false; }; "required": { "alias": "required"; "required": false; }; "allowDragAndDrop": { "alias": "allowDragAndDrop"; "required": false; }; "showFilePreview": { "alias": "showFilePreview"; "required": false; }; "showFileSize": { "alias": "showFileSize"; "required": false; }; "showRemoveButton": { "alias": "showRemoveButton"; "required": false; }; "showParseInfo": { "alias": "showParseInfo"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "browseLabel": { "alias": "browseLabel"; "required": false; }; "buttonIcon": { "alias": "buttonIcon"; "required": false; }; "buttonAppearance": { "alias": "buttonAppearance"; "required": false; }; "buttonSize": { "alias": "buttonSize"; "required": false; }; "showDropArea": { "alias": "showDropArea"; "required": false; }; "showButton": { "alias": "showButton"; "required": false; }; "dropTitle": { "alias": "dropTitle"; "required": false; }; "dropDescription": { "alias": "dropDescription"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "showProgress": { "alias": "showProgress"; "required": false; }; "duplicates": { "alias": "duplicates"; "required": false; }; "customClass": { "alias": "customClass"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "inputHeight": { "alias": "inputHeight"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "outputMode": { "alias": "outputMode"; "required": false; }; "delimiter": { "alias": "delimiter"; "required": false; }; "withHeader": { "alias": "withHeader"; "required": false; }; "encoding": { "alias": "encoding"; "required": false; }; "parentColumn": { "alias": "parentColumn"; "required": false; }; "tableConfig": { "alias": "tableConfig"; "required": false; }; "parse": { "alias": "parse"; "required": false; }; "autoProcess": { "alias": "autoProcess"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "inputWidth": { "alias": "inputWidth"; "required": false; }; }, { "filesChange": "filesChange"; "resultChange": "resultChange"; "fileRejected": "fileRejected"; "fileRemoved": "fileRemoved"; }, never, never, true, never>;
1442
+ }
1443
+
1444
+ export { CRUD, ColumnSize, ColumnType, ConfirmDialogComponent, DEFAULT_EASY_DIALOG_TRANSLATIONS, Dictionary, EASY_DIALOG_DEFAULT_MAX_WIDTH, EASY_DIALOG_DEFAULT_WIDTH, EASY_THEME_OPTIONS, EasyCard, EasyCardGrid, EasyChipNav, EasyDialogComponent, EasyDialogConfig, EasyDialogService, EasyFileUpload, EasyLanguageSwitch, EasyMatUiComponent, EasyMatUiService, EasyMultiSelect, EasyPageHeader, EasyPaginatorIntl, EasySegmented, EasyStat, EasyTableBasicComponent, EasyTableComponent, EasyTableConfig, EasyThemeService, InputType, MatColumn, MatColumnTyped, ScreenSize, TableToolbarComponent, TitleFormatter, ToolbarConfig, ToolbarTranslations, Tuple, confirmAction, confirmChoice, confirmDelete, detectCsvDelimiter, detectCsvHeader, parseCsv, parseCsvRows, provideEasyPaginatorIntl, resolveDialogRequest, stripByteOrderMark };
1445
+ export type { ColumnFilterType, ConfirmChoice, ConfirmDeleteData, EasyCardAction, EasyCardActionEvent, EasyCardConfig, EasyCheckState, EasyChipNavItem, EasyColumnAlign, EasyColumnSelection, EasyCsvParseOptions, EasyCsvParseResult, EasyDialogAction, EasyDialogButtonColor, EasyDialogField, EasyDialogInit, EasyDialogResult, EasyDialogSize, EasyDialogTranslations, EasyFileItem, EasyFileItemStatus, EasyFileParsedFile, EasyFileUploadAppearance, EasyFileUploadButtonAppearance, EasyFileUploadButtonSize, EasyFileUploadDuplicateHandling, EasyFileUploadError, EasyFileUploadErrorCode, EasyFileUploadLayout, EasyFileUploadMessages, EasyFileUploadMode, EasyFileUploadOutputMode, EasyFileUploadResult, EasyFileUploadStatus, EasyFileUploadTableOutput, EasyLanguage, EasyLanguageDisplay, EasyLanguageLayout, EasyPageHeaderConfig, EasyResolvedTheme, EasySegmentedOption, EasySegmentedSemantics, EasySegmentedSize, EasyStatConfig, EasyStatTone, EasyTableDialogConfig, EasyTableDialogMode, EasyTableDialogRequest, EasyTableDialogResult, EasyTableGroupBy, EasyTableGroupSelectionChange, EasyTableSelectionChange, EasyThemeMode, EasyThemeOptions, TitlePipe, TitleTranslate, ToolbarSaveState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-mat-ui",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Angular 20, 21 and 22 data table and reusable UI components on Angular Material: filters, pagination, CRUD dialog, child tables, themes, page generator CLI",
5
5
  "keywords": [
6
6
  "angular",