ngx-material-entity 18.0.1 → 18.2.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 (109) hide show
  1. package/README.md +10 -13
  2. package/components/create-page/create-page.component.d.ts +3 -0
  3. package/components/custom-table/custom-table-configuration.model.d.ts +65 -0
  4. package/components/custom-table/custom-table.component.d.ts +111 -0
  5. package/components/edit-page/edit-page.component.d.ts +8 -1
  6. package/components/input/array/array-date-input/array-date-input.component.d.ts +2 -2
  7. package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +3 -3
  8. package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +3 -3
  9. package/components/input/array/array-table.class.d.ts +25 -19
  10. package/components/input/file/file-default-input/file-default-input.component.d.ts +1 -1
  11. package/components/input/file/file-image-input/file-image-input.component.d.ts +3 -0
  12. package/components/input/file/file-input/file-input.component.d.ts +8 -2
  13. package/components/input/input.component.d.ts +101 -80
  14. package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +2 -0
  15. package/components/input/relations/references-many-input/references-many-input.component.d.ts +14 -17
  16. package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +2 -0
  17. package/components/input/string/string-password-input/string-password-input.component.d.ts +3 -0
  18. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +5 -5
  19. package/components/table/table-data.d.ts +9 -4
  20. package/components/table/table.component.d.ts +15 -37
  21. package/components/tooltip/tooltip.component.d.ts +2 -0
  22. package/decorators/array/array-decorator-internal.data.d.ts +8 -3
  23. package/decorators/array/array-decorator.data.d.ts +45 -88
  24. package/decorators/base/property-decorator.data.d.ts +2 -2
  25. package/decorators/file/file-decorator-internal.data.d.ts +3 -2
  26. package/decorators/file/file-decorator.data.d.ts +4 -3
  27. package/decorators/references-many/references-many-decorator-internal.data.d.ts +3 -1
  28. package/decorators/references-many/references-many-decorator.data.d.ts +13 -1
  29. package/directives/dynamic-style-class.directive.d.ts +4 -5
  30. package/esm2022/components/confirm-dialog/confirm-dialog.component.mjs +7 -8
  31. package/esm2022/components/create-page/create-page.component.mjs +17 -11
  32. package/esm2022/components/custom-table/custom-table-configuration.model.mjs +37 -0
  33. package/esm2022/components/custom-table/custom-table.component.mjs +213 -0
  34. package/esm2022/components/edit-page/edit-page.component.mjs +29 -12
  35. package/esm2022/components/form/form.component.mjs +7 -8
  36. package/esm2022/components/input/array/array-date-input/array-date-input.component.mjs +17 -21
  37. package/esm2022/components/input/array/array-date-range-input/array-date-range-input.component.mjs +28 -27
  38. package/esm2022/components/input/array/array-date-time-input/array-date-time-input.component.mjs +18 -22
  39. package/esm2022/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +9 -7
  40. package/esm2022/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +9 -7
  41. package/esm2022/components/input/array/array-table.class.mjs +53 -45
  42. package/esm2022/components/input/base-input.component.mjs +3 -3
  43. package/esm2022/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +4 -4
  44. package/esm2022/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +3 -3
  45. package/esm2022/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +4 -4
  46. package/esm2022/components/input/custom/custom.component.mjs +3 -3
  47. package/esm2022/components/input/date/date-input/date-input.component.mjs +3 -3
  48. package/esm2022/components/input/date/date-range-input/date-range-input.component.mjs +7 -8
  49. package/esm2022/components/input/date/date-time-input/date-time-input.component.mjs +6 -6
  50. package/esm2022/components/input/file/file-default-input/file-default-input.component.mjs +5 -5
  51. package/esm2022/components/input/file/file-image-input/file-image-input.component.mjs +10 -9
  52. package/esm2022/components/input/file/file-input/file-input.component.mjs +27 -15
  53. package/esm2022/components/input/input.component.mjs +162 -114
  54. package/esm2022/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +11 -8
  55. package/esm2022/components/input/number/number-input/number-input.component.mjs +3 -3
  56. package/esm2022/components/input/number/number-slider-input/number-slider-input.component.mjs +4 -4
  57. package/esm2022/components/input/relations/references-many-input/references-many-input.component.mjs +46 -57
  58. package/esm2022/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +6 -7
  59. package/esm2022/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +11 -8
  60. package/esm2022/components/input/string/string-input/string-input.component.mjs +3 -3
  61. package/esm2022/components/input/string/string-password-input/string-password-input.component.mjs +13 -8
  62. package/esm2022/components/input/string/string-textbox-input/string-textbox-input.component.mjs +3 -3
  63. package/esm2022/components/table/create-dialog/create-entity-dialog.component.mjs +9 -10
  64. package/esm2022/components/table/display-column-value/base-display-column-value.component.mjs +3 -3
  65. package/esm2022/components/table/display-column-value/display-column-value.component.mjs +3 -3
  66. package/esm2022/components/table/edit-dialog/edit-data.builder.mjs +1 -1
  67. package/esm2022/components/table/edit-dialog/edit-entity-dialog.component.mjs +21 -16
  68. package/esm2022/components/table/table-data.builder.mjs +3 -1
  69. package/esm2022/components/table/table-data.mjs +1 -1
  70. package/esm2022/components/table/table.component.mjs +41 -114
  71. package/esm2022/components/tooltip/tooltip.component.mjs +9 -5
  72. package/esm2022/decorators/array/array-decorator-internal.data.mjs +18 -3
  73. package/esm2022/decorators/array/array-decorator.data.mjs +33 -2
  74. package/esm2022/decorators/array/array.decorator.mjs +15 -8
  75. package/esm2022/decorators/base/property-decorator.data.mjs +2 -2
  76. package/esm2022/decorators/file/file-decorator-internal.data.mjs +4 -3
  77. package/esm2022/decorators/file/file-decorator.data.mjs +3 -3
  78. package/esm2022/decorators/file/file.decorator.mjs +7 -4
  79. package/esm2022/decorators/has-many/has-many-decorator-internal.data.mjs +1 -1
  80. package/esm2022/decorators/number/number.decorator.mjs +7 -4
  81. package/esm2022/decorators/object/object.decorator.mjs +5 -3
  82. package/esm2022/decorators/references-many/references-many-decorator-internal.data.mjs +8 -1
  83. package/esm2022/decorators/references-many/references-many-decorator.data.mjs +1 -1
  84. package/esm2022/decorators/string/string-decorator-internal.data.mjs +2 -1
  85. package/esm2022/decorators/string/string.decorator.mjs +11 -6
  86. package/esm2022/directives/drag-drop.directive.mjs +3 -3
  87. package/esm2022/directives/dynamic-style-class.directive.mjs +7 -7
  88. package/esm2022/directives/included-in.directive.mjs +3 -3
  89. package/esm2022/directives/number.directive.mjs +3 -3
  90. package/esm2022/directives/password-match.directive.mjs +3 -3
  91. package/esm2022/directives/tooltip.directive.mjs +7 -4
  92. package/esm2022/functions/dropdown-values-to-function.function.mjs +2 -1
  93. package/esm2022/functions/get-changes-tooltip-content.function.mjs +23 -0
  94. package/esm2022/functions/get-validation-errors-tooltip-content.function.mjs +23 -0
  95. package/esm2022/functions/table-column-value-to-sort-value.function.mjs +33 -0
  96. package/esm2022/public-api.mjs +3 -2
  97. package/esm2022/utilities/date.utilities.mjs +7 -6
  98. package/esm2022/utilities/entity.utilities.mjs +58 -27
  99. package/esm2022/utilities/file.utilities.mjs +7 -4
  100. package/esm2022/utilities/validation.utilities.mjs +41 -21
  101. package/fesm2022/ngx-material-entity.mjs +2767 -2336
  102. package/fesm2022/ngx-material-entity.mjs.map +1 -1
  103. package/functions/get-changes-tooltip-content.function.d.ts +13 -0
  104. package/functions/table-column-value-to-sort-value.function.d.ts +9 -0
  105. package/package.json +4 -2
  106. package/public-api.d.ts +2 -1
  107. package/utilities/entity.utilities.d.ts +11 -7
  108. package/esm2022/functions/get-validation-errors-tooltip-content.function.ts.mjs +0 -23
  109. /package/functions/{get-validation-errors-tooltip-content.function.ts.d.ts → get-validation-errors-tooltip-content.function.d.ts} +0 -0
@@ -3,9 +3,9 @@ import { HttpClient } from '@angular/common/http';
3
3
  import { EnvironmentInjector, EventEmitter, OnInit } from '@angular/core';
4
4
  import { NgModel } from '@angular/forms';
5
5
  import { MatDialog } from '@angular/material/dialog';
6
- import { MatPaginator } from '@angular/material/paginator';
7
6
  import { MatTableDataSource } from '@angular/material/table';
8
7
  import { Router } from '@angular/router';
8
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
9
9
  import { BaseEntityType } from '../../classes/entity.model';
10
10
  import { EditArrayItemDialogDataInternal, EntityArrayDecoratorConfigInternal } from '../../decorators/array/array-decorator-internal.data';
11
11
  import { DecoratorTypes } from '../../decorators/base/decorator-types.enum';
@@ -16,14 +16,24 @@ import { DefaultObjectDecoratorConfigInternal, DropdownObjectDecoratorConfigInte
16
16
  import { ReferencesOneDecoratorConfigInternal } from '../../decorators/references-one/references-one-decorator-internal.data';
17
17
  import { NgxGlobalDefaultValues } from '../../global-configuration-values';
18
18
  import { DateUtilities } from '../../utilities/date.utilities';
19
- import { EntityTab, EntityUtilities } from '../../utilities/entity.utilities';
19
+ import { Difference, EntityTab, EntityUtilities } from '../../utilities/entity.utilities';
20
20
  import { SelectionUtilities } from '../../utilities/selection.utilities';
21
21
  import { ValidationError } from '../../utilities/validation.utilities';
22
+ import { InternalCustomTableConfiguration } from '../custom-table/custom-table-configuration.model';
22
23
  import { CreateDataInternal } from '../table/create-dialog/create-data.builder';
23
24
  import { EditActionInternal } from '../table/edit-dialog/edit-data.builder';
24
25
  import { DisplayColumn } from '../table/table-data';
25
26
  import { BaseTableActionInternal, TableActionInternal } from '../table/table-data.builder';
26
27
  import * as i0 from "@angular/core";
28
+ /**
29
+ * Generic type for contexts that can fill an inline template.
30
+ */
31
+ type TemplateContext<T> = {
32
+ /**
33
+ * The actual value. The $implicit is needed so that we don't need to specify a key when writing "let-context" in the html template.
34
+ */
35
+ $implicit: T;
36
+ };
27
37
  /**
28
38
  * A form context that is used to fill an inline template.
29
39
  * This is used to go around the limitations of having everything in the same file due to circular dependencies.
@@ -31,38 +41,64 @@ import * as i0 from "@angular/core";
31
41
  */
32
42
  type FormContext<EntityType extends BaseEntityType<EntityType>> = {
33
43
  /**
34
- * The actual value. The $implicit is needed so that we don't need to specify a key when writing "let-context" in the html template.
44
+ * The entity to build the form for.
45
+ */
46
+ entity: EntityType;
47
+ /**
48
+ * The tabs to display.
49
+ */
50
+ tabs: EntityTab<EntityType>[];
51
+ /**
52
+ * Whether or not edit values should be omitted.
53
+ */
54
+ hideOmitForEdit?: boolean;
55
+ /**
56
+ * Whether or not create values should be omitted.
57
+ */
58
+ hideOmitForCreate?: boolean;
59
+ /**
60
+ * What happens when the input changes.
35
61
  */
36
- $implicit: {
37
- /**
38
- * The entity to build the form for.
39
- */
40
- entity: EntityType;
41
- /**
42
- * The tabs to display.
43
- */
44
- tabs: EntityTab<EntityType>[];
45
- /**
46
- * Whether or not edit values should be omitted.
47
- */
48
- hideOmitForEdit?: boolean;
49
- /**
50
- * Whether or not create values should be omitted.
51
- */
52
- hideOmitForCreate?: boolean;
53
- /**
54
- * What happens when the input changes.
55
- */
56
- inputChangeEvent: () => void | Promise<void>;
57
- /**
58
- * Whether or not the input is readonly.
59
- */
60
- isReadOnly?: (property: EntityType, key: keyof EntityType) => boolean;
61
- /**
62
- * Whether or not the input is valid empty.
63
- */
64
- validEmpty?: () => boolean;
65
- };
62
+ inputChangeEvent: () => void | Promise<void>;
63
+ /**
64
+ * Whether or not the input is readonly.
65
+ */
66
+ isReadOnly?: (property: EntityType, key: keyof EntityType) => boolean;
67
+ /**
68
+ * Whether or not the input is valid empty.
69
+ */
70
+ validEmpty?: () => boolean;
71
+ };
72
+ /**
73
+ * A table context that is used to fill an inline template.
74
+ * This is used to go around the limitations of having everything in the same file due to circular dependencies.
75
+ * The table is used for entity array and hasMany.
76
+ */
77
+ type TableContext<T> = InternalCustomTableConfiguration & {
78
+ /**
79
+ * The data source of the table.
80
+ */
81
+ dataSource: MatTableDataSource<T>;
82
+ /**
83
+ * Whether or not a error message should be shown when the table is empty.
84
+ */
85
+ shouldShowMissingError: boolean;
86
+ /**
87
+ * The selection of the table.
88
+ */
89
+ selection: SelectionModel<T>;
90
+ /**
91
+ * What happens when a cell is clicked.
92
+ */
93
+ clickCell: (value: T, displayColumn: DisplayColumn<T>) => void;
94
+ /**
95
+ * Whether or not the data for the table is currently being loaded.
96
+ */
97
+ isLoading: boolean;
98
+ /**
99
+ * All columns that should be displayed.
100
+ */
101
+ displayedColumns: string[];
66
102
  };
67
103
  /**
68
104
  * The default input component. It gets the metadata of the property from the given @Input "entity" and @Input "propertyKey"
@@ -79,6 +115,7 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
79
115
  protected readonly defaultGetValidationErrorMessage: (model: NgModel) => string;
80
116
  protected readonly globalConfig: NgxGlobalDefaultValues;
81
117
  private readonly http;
118
+ faSearch: IconDefinition;
82
119
  /**
83
120
  * The entity on which the property exists. Used in conjunction with the "propertyKey"
84
121
  * to determine the property for which the input should be generated.
@@ -122,6 +159,12 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
122
159
  * Emits when the input value has been changed.
123
160
  */
124
161
  readonly inputChangeEvent: EventEmitter<void>;
162
+ /**
163
+ * A setter for the has many sort.
164
+ * Is needed because the sort is inside a switch case,
165
+ * which means that at ngOnInit it can't be initialized.
166
+ */
167
+ private set sort(value);
125
168
  /**
126
169
  * The type of the decorator for this input.
127
170
  */
@@ -137,7 +180,7 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
137
180
  /**
138
181
  * The form context for an object property.
139
182
  */
140
- objectFormContext: FormContext<EntityType>;
183
+ objectFormContext: TemplateContext<FormContext<EntityType>>;
141
184
  /**
142
185
  * The metadata of an dropdown object property.
143
186
  */
@@ -176,9 +219,9 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
176
219
  */
177
220
  metadataEntityArray: EntityArrayDecoratorConfigInternal<EntityType>;
178
221
  /**
179
- * The entity array property value.
222
+ * The table context for the entity array input.
180
223
  */
181
- entityArrayValues: EntityType[];
224
+ entityArrayTableContext: TemplateContext<TableContext<EntityType>>;
182
225
  /**
183
226
  * The current array item to be added or updated.
184
227
  */
@@ -190,23 +233,11 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
190
233
  /**
191
234
  * The form context for adding an array item.
192
235
  */
193
- addArrayItemFormContext: FormContext<EntityType>;
236
+ addArrayItemFormContext: TemplateContext<FormContext<EntityType>>;
194
237
  /**
195
238
  * The form context for editing an array item.
196
239
  */
197
- editArrayItemFormContext: FormContext<EntityType>;
198
- /**
199
- * The dataSource for the entity array.
200
- */
201
- entityArrayDataSource: MatTableDataSource<EntityType>;
202
- /**
203
- * The selection for the entity array.
204
- */
205
- entityArraySelection: SelectionModel<EntityType>;
206
- /**
207
- * The columns to display in the entity array table.
208
- */
209
- entityArrayDisplayedColumns: string[];
240
+ editArrayItemFormContext: TemplateContext<FormContext<EntityType>>;
210
241
  /**
211
242
  * Whether or not the array item is valid.
212
243
  */
@@ -231,6 +262,10 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
231
262
  * All validation errors for the array item.
232
263
  */
233
264
  arrayItemValidationErrors: ValidationError[];
265
+ /**
266
+ * All the changes that have been done to the array item.
267
+ */
268
+ arrayItemChanges: Difference<EntityType>[];
234
269
  /**
235
270
  * What to display inside the array item tooltip.
236
271
  */
@@ -240,34 +275,9 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
240
275
  */
241
276
  metadataHasMany: HasManyDecoratorConfigInternal<EntityType, EntityType>;
242
277
  /**
243
- * Whether or not has many is currently loading.
244
- */
245
- hasManyIsLoading: boolean;
246
- /**
247
- * A setter for the has many paginator.
248
- * Is needed because the paginator is inside a switch case,
249
- * which means that at ngOnInit it can't be initialized.
250
- */
251
- set hasManyPaginator(paginator: MatPaginator);
252
- /**
253
- * A setter for the has many sort.
254
- * Is needed because the sort is inside a switch case,
255
- * which means that at ngOnInit it can't be initialized.
256
- */
257
- private set hasManySort(value);
258
- private readonly hasManyFilter;
259
- /**
260
- * The columns of the has many table.
278
+ * The table context for the has many input.
261
279
  */
262
- displayedHasManyColumns: string[];
263
- /**
264
- * The data source of the has many table.
265
- */
266
- hasManyDataSource: MatTableDataSource<EntityType>;
267
- /**
268
- * The selection of the has many table.
269
- */
270
- hasManySelection: SelectionModel<EntityType>;
280
+ hasManyTableContext: TemplateContext<TableContext<EntityType>>;
271
281
  /**
272
282
  * The has many import action.
273
283
  */
@@ -293,6 +303,10 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
293
303
  * All validation errors of the has many entity.
294
304
  */
295
305
  hasManyValidationErrors: ValidationError[];
306
+ /**
307
+ * All the changes that have been done to the has many entity.
308
+ */
309
+ hasManyChanges: Difference<EntityType>[];
296
310
  /**
297
311
  * What to display inside the has many tooltip.
298
312
  */
@@ -308,11 +322,11 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
308
322
  /**
309
323
  * The form context for creating an has many entity.
310
324
  */
311
- hasManyCreateFormContext: FormContext<EntityType>;
325
+ hasManyCreateFormContext: TemplateContext<FormContext<EntityType>>;
312
326
  /**
313
327
  * The form context for editing an has many entity.
314
328
  */
315
- hasManyEditFormContext: FormContext<EntityType>;
329
+ hasManyEditFormContext: TemplateContext<FormContext<EntityType>>;
316
330
  private hasManyCreateBaseUrl;
317
331
  /**
318
332
  * The metadata for a references one property.
@@ -337,7 +351,7 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
337
351
  /**
338
352
  * The form context for an object property.
339
353
  */
340
- referencesOneFormContext: FormContext<EntityType>;
354
+ referencesOneFormContext: TemplateContext<FormContext<EntityType>>;
341
355
  /**
342
356
  * The enum Values for all the different DecoratorTypes.
343
357
  */
@@ -381,6 +395,13 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
381
395
  * @returns The value of the display column.
382
396
  */
383
397
  getDisplayColumnValue(entity: EntityType, displayColumn: DisplayColumn<EntityType>): unknown;
398
+ /**
399
+ * Emits a cellClicked event when the clicked column is enabled and clicking is allowed by the configuration.
400
+ * @param value - The value of the row that was clicked.
401
+ * @param dCol - The display column of the row that was clicked.
402
+ * @param context - The context of the table where the cell was clicked.
403
+ */
404
+ clickCell<T>(value: T, dCol: DisplayColumn<T>, context: TableContext<T>): void;
384
405
  ngOnInit(): void;
385
406
  private initReferencesOne;
386
407
  /**
@@ -1,4 +1,5 @@
1
1
  import { EnvironmentInjector, OnInit } from '@angular/core';
2
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
2
3
  import { BaseEntityType } from '../../../../classes/entity.model';
3
4
  import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
4
5
  import { DropdownValue } from '../../../../decorators/base/dropdown-value.interface';
@@ -6,6 +7,7 @@ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class NumberDropdownInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.NUMBER_DROPDOWN, number> implements OnInit {
8
9
  private readonly injector;
10
+ faSearch: IconDefinition;
9
11
  private dropdownValues;
10
12
  filteredDropdownValues: DropdownValue<number | undefined>[];
11
13
  get currentDropdownValue(): DropdownValue<number | undefined> | undefined;
@@ -1,28 +1,33 @@
1
- import { SelectionModel } from '@angular/cdk/collections';
2
1
  import { EnvironmentInjector, OnInit } from '@angular/core';
3
- import { MatTableDataSource } from '@angular/material/table';
2
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
4
3
  import { BaseEntityType } from '../../../../classes/entity.model';
5
4
  import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
6
5
  import { DropdownValue } from '../../../../decorators/base/dropdown-value.interface';
7
6
  import { NgxGlobalDefaultValues } from '../../../../global-configuration-values';
8
- import { SelectionUtilities } from '../../../../utilities/selection.utilities';
9
- import { DisplayColumn } from '../../../table/table-data';
7
+ import { CustomTableConfiguration } from '../../../custom-table/custom-table-configuration.model';
10
8
  import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
11
9
  import * as i0 from "@angular/core";
12
10
  export declare class ReferencesManyInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.REFERENCES_MANY, string[]> implements OnInit {
13
11
  private readonly injector;
14
12
  private readonly globalConfig;
13
+ faSearch: IconDefinition;
15
14
  private allReferencedEntities;
16
15
  private allDropdownValues;
17
16
  dropdownValues: DropdownValue<string>[];
18
17
  filteredDropdownValues: DropdownValue<string>[];
19
18
  input: string;
20
- referencedEntitiesDataSource: MatTableDataSource<string>;
21
- displayedColumns: string[];
22
- selection: SelectionModel<string>;
23
- SelectionUtilities: typeof SelectionUtilities;
24
19
  get currentDropdownValue(): DropdownValue<string> | undefined;
25
20
  get shouldDisplayCurrentValue(): boolean;
21
+ /**
22
+ * The currently selected values.
23
+ */
24
+ selected: string[];
25
+ /**
26
+ * Configuration for the references many table.
27
+ */
28
+ tableConfig: CustomTableConfiguration;
29
+ get propertyValue(): string[];
30
+ set propertyValue(value: string[]);
26
31
  constructor(injector: EnvironmentInjector, globalConfig: NgxGlobalDefaultValues);
27
32
  ngOnInit(): void;
28
33
  /**
@@ -30,15 +35,7 @@ export declare class ReferencesManyInputComponent<EntityType extends BaseEntityT
30
35
  * @param searchInput - The search input to filter for.
31
36
  */
32
37
  filterDropdownValues(searchInput: string): void;
33
- /**
34
- * Gets the value to display in the column.
35
- * Runs in environment context to enable injection.
36
- * @param entityId - The id of the entity to get the value from.
37
- * @param displayColumn - The display column to get the value from.
38
- * @returns The value of the display column.
39
- */
40
- getDisplayColumnValue(entityId: string, displayColumn: DisplayColumn<EntityType>): unknown;
41
- add(): Promise<void>;
38
+ add(): void;
42
39
  addAll(): void;
43
40
  remove(): void;
44
41
  static ɵfac: i0.ɵɵFactoryDeclaration<ReferencesManyInputComponent<any>, never>;
@@ -1,4 +1,5 @@
1
1
  import { EnvironmentInjector, OnInit } from '@angular/core';
2
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
2
3
  import { BaseEntityType } from '../../../../classes/entity.model';
3
4
  import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
4
5
  import { DropdownValue } from '../../../../decorators/base/dropdown-value.interface';
@@ -6,6 +7,7 @@ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class StringDropdownInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.STRING_DROPDOWN, string> implements OnInit {
8
9
  private readonly injector;
10
+ faSearch: IconDefinition;
9
11
  private dropdownValues;
10
12
  filteredDropdownValues: DropdownValue<string | undefined>[];
11
13
  get currentDropdownValue(): DropdownValue<string | undefined> | undefined;
@@ -1,4 +1,5 @@
1
1
  import { OnInit } from '@angular/core';
2
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
2
3
  import { BaseEntityType } from '../../../../classes/entity.model';
3
4
  import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
4
5
  import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
@@ -9,6 +10,8 @@ export declare enum PasswordStrength {
9
10
  STRONG = "strong"
10
11
  }
11
12
  export declare class StringPasswordInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.STRING_PASSWORD, string> implements OnInit {
13
+ faEye: IconDefinition;
14
+ faEyeSlash: IconDefinition;
12
15
  hide: boolean;
13
16
  hideConfirm: boolean;
14
17
  confirmRequired: boolean;
@@ -7,7 +7,7 @@ import { EditEntityDataInternal } from './edit-entity.builder';
7
7
  import { BaseEntityType } from '../../../classes/entity.model';
8
8
  import { NgxGlobalDefaultValues } from '../../../global-configuration-values';
9
9
  import { EntityService } from '../../../services/entity.service';
10
- import { EntityTab, EntityUtilities } from '../../../utilities/entity.utilities';
10
+ import { Difference, EntityUtilities } from '../../../utilities/entity.utilities';
11
11
  import { ValidationError } from '../../../utilities/validation.utilities';
12
12
  import * as i0 from "@angular/core";
13
13
  /**
@@ -31,10 +31,6 @@ export declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEnti
31
31
  * Contains HelperMethods around handling Entities and their property-metadata.
32
32
  */
33
33
  EntityUtilities: typeof EntityUtilities;
34
- /**
35
- * The tabs of the dialog.
36
- */
37
- entityTabs: EntityTab<EntityType>[];
38
34
  /**
39
35
  * The service of the provided entity.
40
36
  */
@@ -59,6 +55,10 @@ export declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEnti
59
55
  * The validation errors of the entity.
60
56
  */
61
57
  validationErrors: ValidationError[];
58
+ /**
59
+ * All the changes that have been done to the entity.
60
+ */
61
+ changes: Difference<EntityType>[];
62
62
  /**
63
63
  * What to display inside the tooltip.
64
64
  */
@@ -2,10 +2,14 @@ import { Type } from '@angular/core';
2
2
  import { NgxMatEntityBaseDisplayColumnValueComponent } from './display-column-value/base-display-column-value.component';
3
3
  import { BaseEntityType, EntityClassNewable, EntityServiceClassNewable } from '../../classes/entity.model';
4
4
  import { ConfirmDialogData } from '../confirm-dialog/confirm-dialog-data';
5
+ /**
6
+ * The value that can be displayed inside a table column.
7
+ */
8
+ export type TableColumnValue = string | number | Date;
5
9
  /**
6
10
  * The Definition of a Column inside the table.
7
11
  */
8
- export interface DisplayColumn<EntityType extends BaseEntityType<EntityType>> {
12
+ export interface DisplayColumn<T> {
9
13
  /**
10
14
  * The name inside the header.
11
15
  */
@@ -13,12 +17,12 @@ export interface DisplayColumn<EntityType extends BaseEntityType<EntityType>> {
13
17
  /**
14
18
  * What to display inside the row.
15
19
  */
16
- value: (entity: EntityType) => string;
20
+ value: (value: T) => TableColumnValue;
17
21
  /**
18
22
  * A custom component to use instead of the value.
19
23
  * You still need to provide a value function for the sorting by header to work.
20
24
  */
21
- Component?: Type<NgxMatEntityBaseDisplayColumnValueComponent<EntityType>>;
25
+ Component?: Type<NgxMatEntityBaseDisplayColumnValueComponent<T>>;
22
26
  /**
23
27
  * Whether or not the click event should be disabled.
24
28
  * This can be useful if your component has a custom way to handle clicks.
@@ -28,7 +32,7 @@ export interface DisplayColumn<EntityType extends BaseEntityType<EntityType>> {
28
32
  /**
29
33
  * Dynamic css class that should be applied based on a condition.
30
34
  */
31
- export type DynamicStyleClasses<EntityType extends BaseEntityType<EntityType>> = (entity: EntityType) => string[];
35
+ export type DynamicStyleClasses<T> = (value: T) => string[];
32
36
  /**
33
37
  * A table action that will run regardless if something has been selected in the table.
34
38
  */
@@ -197,6 +201,7 @@ export interface BaseData<EntityType extends BaseEntityType<EntityType>> {
197
201
  * Configuration for css classes that should be applied to table rows based on a condition.
198
202
  * This could be used to eg. Set the background color to green when an item has the status completed etc.
199
203
  * INFO: You need to use ng-deep or apply the styling in the styles.scss.
204
+ * @default () => []
200
205
  */
201
206
  dynamicRowStyleClasses?: DynamicStyleClasses<EntityType>;
202
207
  }
@@ -1,15 +1,11 @@
1
- import { SelectionModel } from '@angular/cdk/collections';
2
1
  import { EnvironmentInjector, EventEmitter, OnInit } from '@angular/core';
3
2
  import { MatDialog } from '@angular/material/dialog';
4
- import { MatPaginator } from '@angular/material/paginator';
5
- import { MatSort } from '@angular/material/sort';
6
- import { MatTableDataSource } from '@angular/material/table';
7
3
  import { Router } from '@angular/router';
8
4
  import { DisplayColumn, TableData } from './table-data';
9
5
  import { BaseTableActionInternal, TableActionInternal, TableDataInternal } from './table-data.builder';
10
6
  import { BaseEntityType, Entity } from '../../classes/entity.model';
11
7
  import { NgxGlobalDefaultValues } from '../../global-configuration-values';
12
- import { SelectionUtilities } from '../../utilities/selection.utilities';
8
+ import { CustomTableConfiguration } from '../custom-table/custom-table-configuration.model';
13
9
  import * as i0 from "@angular/core";
14
10
  /**
15
11
  * Generates a fully functional table for displaying, creating, updating and deleting entities
@@ -35,42 +31,30 @@ export declare class NgxMatEntityTableComponent<EntityType extends BaseEntityTyp
35
31
  */
36
32
  data: TableDataInternal<EntityType>;
37
33
  /**
38
- * Whether or not the table content is currently loading.
39
- */
40
- isLoading: boolean;
41
- /**
42
- * Whether or not the current user is allowed to create entries for the table.
43
- */
44
- allowCreate: boolean;
45
- private entityService;
46
- /**
47
- * The paginator from the html.
34
+ * Configuration for the table.
48
35
  */
49
- paginator: MatPaginator;
36
+ tableConfig: CustomTableConfiguration<EntityType>;
50
37
  /**
51
- * The sort from the html.
38
+ * The entities to display inside the table.
52
39
  */
53
- sort: MatSort;
40
+ entities: EntityType[];
54
41
  /**
55
- * The filter (search) from the html.
42
+ * A search string for filtering table results.
56
43
  */
57
- filter: string;
44
+ searchString: string;
58
45
  /**
59
- * The columns of the table.
46
+ * The currently selected entities.
60
47
  */
61
- displayedColumns: string[];
48
+ selected: EntityType[];
62
49
  /**
63
- * The table dataSource.
64
- */
65
- dataSource: MatTableDataSource<EntityType>;
66
- /**
67
- * The selection of the table.
50
+ * Whether or not the table content is currently loading.
68
51
  */
69
- selection: SelectionModel<EntityType>;
52
+ isLoading: boolean;
70
53
  /**
71
- * Provides functionality around material selections inside of tables.
54
+ * Whether or not the current user is allowed to create entries for the table.
72
55
  */
73
- SelectionUtilities: typeof SelectionUtilities;
56
+ allowCreate: boolean;
57
+ private entityService;
74
58
  /**
75
59
  * The internal BaseTableAction. Sets default values.
76
60
  */
@@ -93,10 +77,9 @@ export declare class NgxMatEntityTableComponent<EntityType extends BaseEntityTyp
93
77
  /**
94
78
  * Edits an entity. This either calls the edit-Method provided by the user or uses a default edit-dialog.
95
79
  * @param entity - The entity that should be updated.
96
- * @param dCol - The display column. Is needed if a custom component was used that handles the click event differently.
97
80
  * @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
98
81
  */
99
- editEntity(entity: EntityType, dCol: DisplayColumn<EntityType>): void;
82
+ editEntity(entity: EntityType): void;
100
83
  /**
101
84
  * Whether updating the provided entity is allowed.
102
85
  * @param entity - The entity that the user wants to edit.
@@ -131,11 +114,6 @@ export declare class NgxMatEntityTableComponent<EntityType extends BaseEntityTyp
131
114
  * @returns Whether or not the Action can be used.
132
115
  */
133
116
  tableActionDisabled(action: TableActionInternal<EntityType>): boolean;
134
- /**
135
- * Applies the search input to filter the table entries.
136
- * @param event - The keyup-event which contains the search-string of the user.
137
- */
138
- applyFilter(event: Event): void;
139
117
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityTableComponent<any>, never>;
140
118
  static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityTableComponent<any>, "ngx-mat-entity-table", never, { "tableData": { "alias": "tableData"; "required": true; }; }, { "unsavedDialogChanges": "unsavedDialogChanges"; }, never, never, true, never>;
141
119
  }
@@ -1,8 +1,10 @@
1
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
1
2
  import * as i0 from "@angular/core";
2
3
  /**
3
4
  * A component that displays an info-symbol and a tooltip when it is hovered/clicked.
4
5
  */
5
6
  export declare class TooltipComponent {
7
+ faInfo: IconDefinition;
6
8
  /**
7
9
  * What to display inside the tooltip.
8
10
  */
@@ -1,8 +1,9 @@
1
1
  import { DateFilterFn } from '@angular/material/datepicker';
2
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
2
3
  import { AutocompleteStringChipsArrayDecoratorConfig, DateArrayDecoratorConfig, DateRangeArrayDecoratorConfig, DateTimeArrayDecoratorConfig, EditArrayItemDialogData, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from './array-decorator.data';
3
4
  import { BaseEntityType, EntityClassNewable } from '../../classes/entity.model';
4
5
  import { ConfirmDialogData } from '../../components/confirm-dialog/confirm-dialog-data';
5
- import { CreateData, DisplayColumn } from '../../components/table/table-data';
6
+ import { CreateData, DisplayColumn, DynamicStyleClasses } from '../../components/table/table-data';
6
7
  import { NgxGlobalDefaultValues } from '../../global-configuration-values';
7
8
  import { Time } from '../../utilities/date.utilities';
8
9
  import { DecoratorTypes } from '../base/decorator-types.enum';
@@ -28,6 +29,7 @@ export declare class EntityArrayDecoratorConfigInternal<EntityType extends BaseE
28
29
  duplicatesErrorDialog: ConfirmDialogData;
29
30
  EntityClass: EntityClassNewable<EntityType>;
30
31
  displayColumns: DisplayColumn<EntityType>[];
32
+ dynamicRowStyleClasses: DynamicStyleClasses<EntityType>;
31
33
  createDialogData?: CreateData;
32
34
  editDialogData: EditArrayItemDialogDataInternal<EntityType>;
33
35
  createInline: boolean;
@@ -47,6 +49,7 @@ export declare class DateArrayDecoratorConfigInternal extends PropertyDecoratorC
47
49
  addButtonLabel: string;
48
50
  removeButtonLabel: string;
49
51
  missingErrorMessage: string;
52
+ dynamicRowStyleClasses: DynamicStyleClasses<Date>;
50
53
  min?: (date?: Date) => Date;
51
54
  max?: (date?: Date) => Date;
52
55
  filter?: DateFilterFn<Date | null | undefined>;
@@ -65,6 +68,7 @@ export declare class DateTimeArrayDecoratorConfigInternal extends PropertyDecora
65
68
  missingErrorMessage: string;
66
69
  times: DropdownValue<Time>[];
67
70
  timeDisplayName: string;
71
+ dynamicRowStyleClasses: DynamicStyleClasses<Date>;
68
72
  minDate?: (date?: Date) => Date;
69
73
  maxDate?: (date?: Date) => Date;
70
74
  filterDate?: DateFilterFn<Date | null | undefined>;
@@ -86,6 +90,7 @@ export declare class DateRangeArrayDecoratorConfigInternal extends PropertyDecor
86
90
  missingErrorMessage: string;
87
91
  placeholderStart: string;
88
92
  placeholderEnd: string;
93
+ dynamicRowStyleClasses: DynamicStyleClasses<DateRange>;
89
94
  minStart?: (date?: Date) => Date;
90
95
  maxStart?: (date?: Date) => Date;
91
96
  minEnd?: (date?: Date) => Date;
@@ -100,7 +105,7 @@ export declare class StringChipsArrayDecoratorConfigInternal extends PropertyDec
100
105
  itemType: DecoratorTypes.STRING;
101
106
  allowDuplicates: boolean;
102
107
  duplicatesErrorDialog: ConfirmDialogData;
103
- deleteIcon: string;
108
+ deleteIcon: IconDefinition;
104
109
  minLength?: number;
105
110
  maxLength?: number;
106
111
  regex?: RegExp;
@@ -114,7 +119,7 @@ export declare class AutocompleteStringChipsArrayDecoratorConfigInternal extends
114
119
  itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
115
120
  allowDuplicates: boolean;
116
121
  duplicatesErrorDialog: ConfirmDialogData;
117
- deleteIcon: string;
122
+ deleteIcon: IconDefinition;
118
123
  minLength?: number;
119
124
  maxLength?: number;
120
125
  regex?: RegExp;