ngx-material-entity 0.1.4 → 1.0.5

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 (156) hide show
  1. package/README.md +416 -39
  2. package/capsulation/lodash.utilities.d.ts +62 -0
  3. package/capsulation/reflect.utilities.d.ts +56 -0
  4. package/classes/base.builder.d.ts +2 -1
  5. package/classes/date.utilities.d.ts +18 -6
  6. package/classes/entity.model.d.ts +9 -2
  7. package/classes/entity.service.d.ts +38 -1
  8. package/classes/entity.utilities.d.ts +45 -16
  9. package/classes/file.utilities.d.ts +52 -0
  10. package/components/input/add-array-item-dialog-data.builder.d.ts +3 -2
  11. package/components/input/add-array-item-dialog-data.d.ts +2 -1
  12. package/components/input/array/array-date-input/array-date-input.component.d.ts +11 -0
  13. package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +20 -0
  14. package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +22 -0
  15. package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +50 -0
  16. package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +42 -0
  17. package/components/input/array/array-table.class.d.ts +48 -0
  18. package/components/input/base-input.component.d.ts +57 -0
  19. package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +10 -0
  20. package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +9 -0
  21. package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +10 -0
  22. package/components/input/custom/custom.component.d.ts +13 -0
  23. package/components/input/date/date-input/date-input.component.d.ts +11 -0
  24. package/components/input/date/date-range-input/date-range-input.component.d.ts +19 -0
  25. package/components/input/date/date-time-input/date-time-input.component.d.ts +30 -0
  26. package/components/input/file/file-default-input/file-default-input.component.d.ts +13 -0
  27. package/components/input/file/file-image-input/file-image-input.component.d.ts +22 -0
  28. package/components/input/file/file-input/dragDrop.directive.d.ts +32 -0
  29. package/components/input/file/file-input/file-input.component.d.ts +33 -0
  30. package/components/input/input.component.d.ts +49 -92
  31. package/components/input/input.module.d.ts +41 -16
  32. package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +9 -0
  33. package/components/input/number/number-input/number-input.component.d.ts +9 -0
  34. package/components/input/number/number-slider-input/number-slider-input.component.d.ts +9 -0
  35. package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +18 -0
  36. package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +9 -0
  37. package/components/input/string/string-input/string-input.component.d.ts +9 -0
  38. package/components/input/string/string-password-input/string-password-input.component.d.ts +15 -0
  39. package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +9 -0
  40. package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +3 -2
  41. package/components/table/create-dialog/create-entity-dialog-data.d.ts +2 -1
  42. package/components/table/create-dialog/create-entity-dialog.component.d.ts +7 -2
  43. package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +3 -2
  44. package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +6 -1
  45. package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +5 -3
  46. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +6 -2
  47. package/components/table/table-data.builder.d.ts +9 -8
  48. package/components/table/table-data.d.ts +18 -10
  49. package/components/table/table.component.d.ts +2 -1
  50. package/decorators/array/array-decorator-internal.data.d.ts +71 -6
  51. package/decorators/array/array-decorator.data.d.ts +178 -12
  52. package/decorators/array/array.decorator.d.ts +3 -2
  53. package/decorators/base/base-property.decorator.d.ts +2 -3
  54. package/decorators/base/decorator-types.enum.d.ts +15 -5
  55. package/decorators/custom/custom-decorator-internal.data.d.ts +17 -0
  56. package/decorators/custom/custom-decorator.data.d.ts +37 -0
  57. package/decorators/custom/custom.decorator.d.ts +11 -0
  58. package/decorators/date/date-decorator-internal.data.d.ts +2 -2
  59. package/decorators/date/date.decorator.d.ts +8 -0
  60. package/decorators/file/file-decorator-internal.data.d.ts +92 -0
  61. package/decorators/file/file-decorator.data.d.ts +92 -0
  62. package/decorators/file/file.decorator.d.ts +9 -0
  63. package/decorators/number/number-decorator-internal.data.d.ts +20 -1
  64. package/decorators/number/number-decorator.data.d.ts +27 -1
  65. package/decorators/number/number.decorator.d.ts +2 -2
  66. package/decorators/object/object-decorator-internal.data.d.ts +2 -2
  67. package/decorators/object/object-decorator.data.d.ts +3 -3
  68. package/decorators/object/object.decorator.d.ts +2 -1
  69. package/decorators/string/string-decorator-internal.data.d.ts +14 -1
  70. package/decorators/string/string-decorator.data.d.ts +37 -1
  71. package/decorators/string/string.decorator.d.ts +2 -2
  72. package/esm2020/capsulation/lodash.utilities.mjs +75 -0
  73. package/esm2020/capsulation/reflect.utilities.mjs +69 -0
  74. package/esm2020/classes/base.builder.mjs +2 -3
  75. package/esm2020/classes/date.utilities.mjs +35 -15
  76. package/esm2020/classes/entity.model.mjs +5 -1
  77. package/esm2020/classes/entity.service.mjs +103 -6
  78. package/esm2020/classes/entity.utilities.mjs +241 -71
  79. package/esm2020/classes/file.utilities.mjs +124 -0
  80. package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +4 -4
  81. package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +3 -3
  82. package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +2 -2
  83. package/esm2020/components/input/add-array-item-dialog-data.mjs +1 -1
  84. package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +26 -0
  85. package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +50 -0
  86. package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +50 -0
  87. package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +103 -0
  88. package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +85 -0
  89. package/esm2020/components/input/array/array-table.class.mjs +104 -0
  90. package/esm2020/components/input/base-input.component.mjs +65 -0
  91. package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +21 -0
  92. package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +17 -0
  93. package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +21 -0
  94. package/esm2020/components/input/custom/custom.component.mjs +26 -0
  95. package/esm2020/components/input/date/date-input/date-input.component.mjs +22 -0
  96. package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +51 -0
  97. package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +63 -0
  98. package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +23 -0
  99. package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +84 -0
  100. package/esm2020/components/input/file/file-input/dragDrop.directive.mjs +64 -0
  101. package/esm2020/components/input/file/file-input/file-input.component.mjs +154 -0
  102. package/esm2020/components/input/input.component.mjs +137 -236
  103. package/esm2020/components/input/input.module.mjs +82 -6
  104. package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +18 -0
  105. package/esm2020/components/input/number/number-input/number-input.component.mjs +16 -0
  106. package/esm2020/components/input/number/number-slider-input/number-slider-input.component.mjs +17 -0
  107. package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +35 -0
  108. package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +18 -0
  109. package/esm2020/components/input/string/string-input/string-input.component.mjs +16 -0
  110. package/esm2020/components/input/string/string-password-input/string-password-input.component.mjs +36 -0
  111. package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +17 -0
  112. package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +2 -2
  113. package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +1 -1
  114. package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
  115. package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +15 -8
  116. package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +2 -2
  117. package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
  118. package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +4 -3
  119. package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +19 -10
  120. package/esm2020/components/table/table-data.builder.mjs +13 -10
  121. package/esm2020/components/table/table-data.mjs +1 -1
  122. package/esm2020/components/table/table.component.mjs +35 -35
  123. package/esm2020/decorators/array/array-decorator-internal.data.mjs +102 -14
  124. package/esm2020/decorators/array/array-decorator.data.mjs +2 -2
  125. package/esm2020/decorators/array/array.decorator.mjs +8 -2
  126. package/esm2020/decorators/base/base-property.decorator.mjs +4 -3
  127. package/esm2020/decorators/base/decorator-types.enum.mjs +9 -1
  128. package/esm2020/decorators/base/property-decorator-internal.data.mjs +10 -10
  129. package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
  130. package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +3 -3
  131. package/esm2020/decorators/custom/custom-decorator-internal.data.mjs +26 -0
  132. package/esm2020/decorators/custom/custom-decorator.data.mjs +2 -0
  133. package/esm2020/decorators/custom/custom.decorator.mjs +13 -0
  134. package/esm2020/decorators/date/date-decorator-internal.data.mjs +5 -5
  135. package/esm2020/decorators/date/date.decorator.mjs +21 -0
  136. package/esm2020/decorators/file/file-decorator-internal.data.mjs +98 -0
  137. package/esm2020/decorators/file/file-decorator.data.mjs +7 -0
  138. package/esm2020/decorators/file/file.decorator.mjs +22 -0
  139. package/esm2020/decorators/number/number-decorator-internal.data.mjs +24 -1
  140. package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
  141. package/esm2020/decorators/number/number.decorator.mjs +9 -7
  142. package/esm2020/decorators/object/object-decorator-internal.data.mjs +1 -1
  143. package/esm2020/decorators/object/object-decorator.data.mjs +1 -1
  144. package/esm2020/decorators/object/object.decorator.mjs +1 -1
  145. package/esm2020/decorators/string/string-decorator-internal.data.mjs +16 -1
  146. package/esm2020/decorators/string/string-decorator.data.mjs +1 -1
  147. package/esm2020/decorators/string/string.decorator.mjs +13 -13
  148. package/esm2020/mocks/placeholder-data.png.mjs +3 -0
  149. package/esm2020/public-api.mjs +9 -1
  150. package/fesm2015/ngx-material-entity.mjs +2488 -524
  151. package/fesm2015/ngx-material-entity.mjs.map +1 -1
  152. package/fesm2020/ngx-material-entity.mjs +2363 -493
  153. package/fesm2020/ngx-material-entity.mjs.map +1 -1
  154. package/mocks/placeholder-data.png.d.ts +1 -0
  155. package/package.json +1 -1
  156. package/public-api.d.ts +8 -0
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class NumberDropdownInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.NUMBER_DROPDOWN, number> implements OnInit {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<NumberDropdownInputComponent<any>, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<NumberDropdownInputComponent<any>, "number-dropdown-input", never, {}, {}, never, never>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class NumberInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.NUMBER, number> implements OnInit {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<NumberInputComponent<any>, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent<any>, "number-input", never, {}, {}, never, never>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class NumberSliderInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.NUMBER_SLIDER, number> implements OnInit {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<NumberSliderInputComponent<any>, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<NumberSliderInputComponent<any>, "number-slider-input", never, {}, {}, never, never>;
9
+ }
@@ -0,0 +1,18 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class StringAutocompleteInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.STRING_AUTOCOMPLETE, string> implements OnInit {
7
+ autocompleteStrings: string[];
8
+ filteredAutocompleteStrings: string[];
9
+ ngOnInit(): void;
10
+ /**
11
+ * Dynamically filters the Autocomplete options when the user inputs something.
12
+ *
13
+ * @param input - The input of the user.
14
+ */
15
+ filterAutocompleteStrings(input?: string): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<StringAutocompleteInputComponent<any>, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<StringAutocompleteInputComponent<any>, "string-autocomplete-input", never, {}, {}, never, never>;
18
+ }
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class StringDropdownInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.STRING_DROPDOWN, string> implements OnInit {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<StringDropdownInputComponent<any>, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<StringDropdownInputComponent<any>, "string-dropdown-input", never, {}, {}, never, never>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class StringInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.STRING, string> implements OnInit {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<StringInputComponent<any>, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<StringInputComponent<any>, "string-input", never, {}, {}, never, never>;
9
+ }
@@ -0,0 +1,15 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class StringPasswordInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.STRING_PASSWORD, string> implements OnInit {
7
+ hide: boolean;
8
+ hideConfirm: boolean;
9
+ confirmRequired: boolean;
10
+ confirmPassword?: string;
11
+ ngOnInit(): void;
12
+ passwordInput(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<StringPasswordInputComponent<any>, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<StringPasswordInputComponent<any>, "string-password-input", never, {}, {}, never, never>;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
3
+ import { BaseEntityType } from '../../../../classes/entity.model';
4
+ import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class StringTextboxInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.STRING_TEXTBOX, string> implements OnInit {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<StringTextboxInputComponent<any>, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<StringTextboxInputComponent<any>, "string-textbox-input", never, {}, {}, never, never>;
9
+ }
@@ -3,10 +3,11 @@ import { CreateEntityDialogData } from './create-entity-dialog-data';
3
3
  import { HttpClient } from '@angular/common/http';
4
4
  import { CreateDialogDataInternal } from './create-dialog-data.builder';
5
5
  import { BaseBuilder } from '../../../classes/base.builder';
6
+ import { BaseEntityType } from '../../../classes/entity.model';
6
7
  /**
7
8
  * The internal CreateEntityDialogData. Requires all default values the user can leave out.
8
9
  */
9
- export declare class CreateEntityDialogDataInternal<EntityType extends object> implements CreateEntityDialogData<EntityType> {
10
+ export declare class CreateEntityDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements CreateEntityDialogData<EntityType> {
10
11
  entity: EntityType;
11
12
  EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
12
13
  createDialogData: CreateDialogDataInternal;
@@ -15,7 +16,7 @@ export declare class CreateEntityDialogDataInternal<EntityType extends object> i
15
16
  /**
16
17
  * The Builder for the CreateEntityDialogData. Sets default values.
17
18
  */
18
- export declare class CreateEntityDialogDataBuilder<EntityType extends object> extends BaseBuilder<CreateEntityDialogDataInternal<EntityType>, CreateEntityDialogData<EntityType>> {
19
+ export declare class CreateEntityDialogDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<CreateEntityDialogDataInternal<EntityType>, CreateEntityDialogData<EntityType>> {
19
20
  constructor(data: CreateEntityDialogData<EntityType>);
20
21
  protected generateBaseData(data: CreateEntityDialogData<EntityType>): CreateEntityDialogDataInternal<EntityType>;
21
22
  }
@@ -1,10 +1,11 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { BaseEntityType } from '../../../classes/entity.model';
2
3
  import { EntityService } from '../../../classes/entity.service';
3
4
  import { CreateDialogData } from '../table-data';
4
5
  /**
5
6
  * The Definition of the Create Entity Dialog Data.
6
7
  */
7
- export interface CreateEntityDialogData<EntityType extends object> {
8
+ export interface CreateEntityDialogData<EntityType extends BaseEntityType<EntityType>> {
8
9
  /**
9
10
  * An empty entity that is used as the data model.
10
11
  */
@@ -4,6 +4,7 @@ import { EntityService } from '../../../classes/entity.service';
4
4
  import { EntityRow, EntityUtilities } from '../../../classes/entity.utilities';
5
5
  import { CreateEntityDialogDataInternal } from './create-entity-dialog-data.builder';
6
6
  import { CreateEntityDialogData } from './create-entity-dialog-data';
7
+ import { BaseEntityType } from '../../../classes/entity.model';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * The default dialog used to create new entities based on the configuration passed in the MAT_DIALOG_DATA "inputData".
@@ -11,7 +12,7 @@ import * as i0 from "@angular/core";
11
12
  *
12
13
  * It offers a lot of customization options which can be found in "CreateEntityDialogData".
13
14
  */
14
- export declare class NgxMatEntityCreateDialogComponent<EntityType extends object> implements OnInit {
15
+ export declare class NgxMatEntityCreateDialogComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
15
16
  private readonly inputData;
16
17
  dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>;
17
18
  private readonly injector;
@@ -20,9 +21,13 @@ export declare class NgxMatEntityCreateDialogComponent<EntityType extends object
20
21
  entityRows: EntityRow<EntityType>[];
21
22
  entityService: EntityService<EntityType>;
22
23
  data: CreateEntityDialogDataInternal<EntityType>;
23
- getWidth: typeof EntityUtilities.getWidth;
24
+ isEntityValid: boolean;
24
25
  constructor(inputData: CreateEntityDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>, injector: Injector, dialog: MatDialog);
25
26
  ngOnInit(): void;
27
+ /**
28
+ * Checks if the entity is valid.
29
+ */
30
+ checkIsEntityValid(): void;
26
31
  /**
27
32
  * Tries add the new entity and close the dialog afterwards.
28
33
  * Also handles the confirmation if required.
@@ -1,10 +1,11 @@
1
+ import { BaseEntityType } from '../../../classes/entity.model';
1
2
  import { BaseBuilder } from '../../../classes/base.builder';
2
3
  import { ConfirmDialogData } from '../../confirm-dialog/confirm-dialog-data';
3
4
  import { EditDialogData } from '../table-data';
4
5
  /**
5
6
  * The internal EditDialogData. Requires all default values the user can leave out.
6
7
  */
7
- export declare class EditDialogDataInternal<EntityType extends object> implements EditDialogData<EntityType> {
8
+ export declare class EditDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements EditDialogData<EntityType> {
8
9
  title: (entity: EntityType) => string;
9
10
  confirmButtonLabel: string;
10
11
  deleteButtonLabel: string;
@@ -18,7 +19,7 @@ export declare class EditDialogDataInternal<EntityType extends object> implement
18
19
  /**
19
20
  * The Builder for the EditDialogData. Sets default values.
20
21
  */
21
- export declare class EditDialogDataBuilder<EntityType extends object> extends BaseBuilder<EditDialogDataInternal<EntityType>, EditDialogData<EntityType>> {
22
+ export declare class EditDialogDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<EditDialogDataInternal<EntityType>, EditDialogData<EntityType>> {
22
23
  constructor(data?: EditDialogData<EntityType>);
23
24
  protected generateBaseData(data?: EditDialogData<EntityType>): EditDialogDataInternal<EntityType>;
24
25
  }
@@ -1,10 +1,11 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { BaseEntityType } from '../../../classes/entity.model';
2
3
  import { EntityService } from '../../../classes/entity.service';
3
4
  import { EditDialogData } from '../table-data';
4
5
  /**
5
6
  * The Definition of the Edit Entity Dialog Data.
6
7
  */
7
- export interface EditEntityDialogData<EntityType extends object> {
8
+ export interface EditEntityDialogData<EntityType extends BaseEntityType<EntityType>> {
8
9
  /**
9
10
  * The entity to edit.
10
11
  */
@@ -21,4 +22,8 @@ export interface EditEntityDialogData<EntityType extends object> {
21
22
  * Whether or not the user can delete this specific entity.
22
23
  */
23
24
  allowDelete?: (entity: EntityType) => boolean;
25
+ /**
26
+ * Whether or not the user can update this specific entity.
27
+ */
28
+ allowUpdate?: (entity: EntityType) => boolean;
24
29
  }
@@ -3,20 +3,22 @@ import { HttpClient } from '@angular/common/http';
3
3
  import { EditEntityDialogData } from './edit-entity-dialog-data';
4
4
  import { EditDialogDataInternal } from './edit-dialog-data.builder';
5
5
  import { BaseBuilder } from '../../../classes/base.builder';
6
+ import { BaseEntityType } from '../../../classes/entity.model';
6
7
  /**
7
8
  * The internal EditEntityDialogData. Requires all default values the user can leave out.
8
9
  */
9
- export declare class EditEntityDialogDataInternal<EntityType extends object> implements EditEntityDialogData<EntityType> {
10
+ export declare class EditEntityDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements EditEntityDialogData<EntityType> {
10
11
  entity: EntityType;
11
12
  EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
12
13
  editDialogData: EditDialogDataInternal<EntityType>;
14
+ allowUpdate: (entity: EntityType) => boolean;
13
15
  allowDelete: (entity: EntityType) => boolean;
14
- constructor(entity: EntityType, EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, editDialogData: EditDialogDataInternal<EntityType>, allowDelete: (entity: EntityType) => boolean);
16
+ constructor(entity: EntityType, EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, editDialogData: EditDialogDataInternal<EntityType>, allowUpdate: (entity: EntityType) => boolean, allowDelete: (entity: EntityType) => boolean);
15
17
  }
16
18
  /**
17
19
  * The Builder for the EditEntityDialogData. Sets default values.
18
20
  */
19
- export declare class EditEntityDialogDataBuilder<EntityType extends object> extends BaseBuilder<EditEntityDialogDataInternal<EntityType>, EditEntityDialogData<EntityType>> {
21
+ export declare class EditEntityDialogDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<EditEntityDialogDataInternal<EntityType>, EditEntityDialogData<EntityType>> {
20
22
  constructor(data: EditEntityDialogData<EntityType>);
21
23
  protected generateBaseData(data: EditEntityDialogData<EntityType>): EditEntityDialogDataInternal<EntityType>;
22
24
  }
@@ -4,6 +4,7 @@ import { EntityService } from '../../../classes/entity.service';
4
4
  import { EntityRow, EntityUtilities } from '../../../classes/entity.utilities';
5
5
  import { EditEntityDialogData } from './edit-entity-dialog-data';
6
6
  import { EditEntityDialogDataInternal } from './edit-entity-dialog.builder';
7
+ import { BaseEntityType } from '../../../classes/entity.model';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * The default dialog used to edit an existing entity based on the configuration passed in the MAT_DIALOG_DATA "inputData".
@@ -11,7 +12,7 @@ import * as i0 from "@angular/core";
11
12
  *
12
13
  * It offers a lot of customization options which can be found in "EditEntityDialogData".
13
14
  */
14
- export declare class NgxMatEntityEditDialogComponent<EntityType extends object> implements OnInit {
15
+ export declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
15
16
  private readonly inputData;
16
17
  dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>;
17
18
  private readonly injector;
@@ -21,9 +22,12 @@ export declare class NgxMatEntityEditDialogComponent<EntityType extends object>
21
22
  entityService: EntityService<EntityType>;
22
23
  entityPriorChanges: EntityType;
23
24
  data: EditEntityDialogDataInternal<EntityType>;
24
- getWidth: typeof EntityUtilities.getWidth;
25
+ isEntityValid: boolean;
26
+ isEntityDirty: Promise<boolean>;
27
+ isReadOnly: boolean;
25
28
  constructor(inputData: EditEntityDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>, injector: Injector, dialog: MatDialog);
26
29
  ngOnInit(): void;
30
+ checkEntity(): void;
27
31
  /**
28
32
  * Tries to save the changes and close the dialog afterwards.
29
33
  * Also handles the confirmation if required.
@@ -4,11 +4,11 @@ import { EditDialogDataInternal } from './edit-dialog/edit-dialog-data.builder';
4
4
  import { BaseData, DisplayColumn, MultiSelectAction, TableData } from './table-data';
5
5
  import { HttpClient } from '@angular/common/http';
6
6
  import { BaseBuilder } from '../../classes/base.builder';
7
- import { EntityClassNewable } from '../../classes/entity.model';
7
+ import { BaseEntityType, EntityClassNewable } from '../../classes/entity.model';
8
8
  /**
9
9
  * The internal TableData. Requires all default values the user can leave out.
10
10
  */
11
- export declare class TableDataInternal<EntityType extends object> implements TableData<EntityType> {
11
+ export declare class TableDataInternal<EntityType extends BaseEntityType<EntityType>> implements TableData<EntityType> {
12
12
  baseData: BaseDataInternal<EntityType>;
13
13
  createDialogData: CreateDialogDataInternal;
14
14
  editDialogData: EditDialogDataInternal<EntityType>;
@@ -17,34 +17,35 @@ export declare class TableDataInternal<EntityType extends object> implements Tab
17
17
  /**
18
18
  * The Builder for the table BaseData. Sets default values.
19
19
  */
20
- export declare class BaseDataBuilder<EntityType extends object> extends BaseBuilder<BaseDataInternal<EntityType>, BaseData<EntityType>> {
20
+ export declare class BaseDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<BaseDataInternal<EntityType>, BaseData<EntityType>> {
21
21
  constructor(data: BaseData<EntityType>);
22
22
  protected generateBaseData(data: BaseData<EntityType>): BaseDataInternal<EntityType>;
23
23
  }
24
24
  /**
25
25
  * The internal TableData. Requires all default values the user can leave out.
26
26
  */
27
- export declare class BaseDataInternal<EntityType extends object> implements BaseData<EntityType> {
27
+ export declare class BaseDataInternal<EntityType extends BaseEntityType<EntityType>> implements BaseData<EntityType> {
28
28
  title: string;
29
29
  displayColumns: DisplayColumn<EntityType>[];
30
30
  EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
31
31
  searchLabel: string;
32
32
  createButtonLabel: string;
33
33
  searchString: (entity: EntityType) => string;
34
- allowCreate: boolean;
35
- allowEdit: (entity: EntityType) => boolean;
34
+ allowCreate: () => boolean;
35
+ allowRead: (entity: EntityType) => boolean;
36
+ allowUpdate: (entity: EntityType) => boolean;
36
37
  allowDelete: (entity: EntityType) => boolean;
37
38
  multiSelectActions: MultiSelectAction<EntityType>[];
38
39
  multiSelectLabel: string;
39
40
  EntityClass?: EntityClassNewable<EntityType>;
40
41
  edit?: (entity: EntityType) => unknown;
41
42
  create?: (entity: EntityType) => unknown;
42
- constructor(title: string, displayColumns: DisplayColumn<EntityType>[], EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, searchLabel: string, createButtonLabel: string, searchString: (entity: EntityType) => string, allowCreate: boolean, allowEdit: (entity: EntityType) => boolean, allowDelete: (entity: EntityType) => boolean, multiSelectActions: MultiSelectAction<EntityType>[], multiSelectLabel: string, EntityClass?: EntityClassNewable<EntityType>, edit?: (entity: EntityType) => unknown, create?: (entity: EntityType) => unknown);
43
+ constructor(title: string, displayColumns: DisplayColumn<EntityType>[], EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, searchLabel: string, createButtonLabel: string, searchString: (entity: EntityType) => string, allowCreate: () => boolean, allowRead: (entity: EntityType) => boolean, allowUpdate: (entity: EntityType) => boolean, allowDelete: (entity: EntityType) => boolean, multiSelectActions: MultiSelectAction<EntityType>[], multiSelectLabel: string, EntityClass?: EntityClassNewable<EntityType>, edit?: (entity: EntityType) => unknown, create?: (entity: EntityType) => unknown);
43
44
  }
44
45
  /**
45
46
  * The Builder for the complete TableData. Sets default values and validates user input.
46
47
  */
47
- export declare class TableDataBuilder<EntityType extends object> extends BaseBuilder<TableDataInternal<EntityType>, TableData<EntityType>> {
48
+ export declare class TableDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<TableDataInternal<EntityType>, TableData<EntityType>> {
48
49
  constructor(data: TableData<EntityType>);
49
50
  protected generateBaseData(data: TableData<EntityType>): TableDataInternal<EntityType>;
50
51
  protected validateInput(data: TableData<EntityType>): void;
@@ -1,11 +1,11 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { EntityService } from '../../classes/entity.service';
3
- import { EntityClassNewable } from '../../classes/entity.model';
3
+ import { BaseEntityType, EntityClassNewable } from '../../classes/entity.model';
4
4
  import { ConfirmDialogData } from '../confirm-dialog/confirm-dialog-data';
5
5
  /**
6
6
  * The Definition of a Column inside the table.
7
7
  */
8
- export interface DisplayColumn<EntityType extends object> {
8
+ export interface DisplayColumn<EntityType extends BaseEntityType<EntityType>> {
9
9
  /**
10
10
  * The name inside the header.
11
11
  */
@@ -18,7 +18,7 @@ export interface DisplayColumn<EntityType extends object> {
18
18
  /**
19
19
  * The Definition of an Action that can be run on multiple selected entities.
20
20
  */
21
- export interface MultiSelectAction<EntityType extends object> {
21
+ export interface MultiSelectAction<EntityType extends BaseEntityType<EntityType>> {
22
22
  /**
23
23
  * The name of the action.
24
24
  */
@@ -47,7 +47,7 @@ export interface MultiSelectAction<EntityType extends object> {
47
47
  /**
48
48
  * The base data of the ngx-mat-entity-table.
49
49
  */
50
- export interface BaseData<EntityType extends object> {
50
+ export interface BaseData<EntityType extends BaseEntityType<EntityType>> {
51
51
  /**
52
52
  * The title of the table.
53
53
  */
@@ -93,17 +93,25 @@ export interface BaseData<EntityType extends object> {
93
93
  /**
94
94
  * Defines whether or not the user can add new entities.
95
95
  *
96
- * @default true
96
+ * @default () => true
97
+ */
98
+ allowCreate?: () => boolean;
99
+ /**
100
+ * Defines whether or not the user can view the specific entity.
101
+ *
102
+ * @default () => true
97
103
  */
98
- allowCreate?: boolean;
104
+ allowRead?: (entity: EntityType) => boolean;
99
105
  /**
100
- * Defines whether or not the user can edit entities.
106
+ * Defines whether or not the user can edit the specific entity.
101
107
  *
102
108
  * @default () => true
103
109
  */
104
- allowEdit?: (entity: EntityType) => boolean;
110
+ allowUpdate?: (entity: EntityType) => boolean;
105
111
  /**
106
112
  * Whether or not the user can delete this specific entity.
113
+ *
114
+ * @default () => true
107
115
  */
108
116
  allowDelete?: (entity: EntityType) => boolean;
109
117
  /**
@@ -144,7 +152,7 @@ export interface CreateDialogData {
144
152
  /**
145
153
  * The data of the default edit-dialog.
146
154
  */
147
- export interface EditDialogData<EntityType extends object> {
155
+ export interface EditDialogData<EntityType extends BaseEntityType<EntityType>> {
148
156
  /**
149
157
  * The title of the default edit-dialog.
150
158
  */
@@ -181,7 +189,7 @@ export interface EditDialogData<EntityType extends object> {
181
189
  /**
182
190
  * All the configuration data required to display a ngx-mat-entity-table.
183
191
  */
184
- export interface TableData<EntityType extends object> {
192
+ export interface TableData<EntityType extends BaseEntityType<EntityType>> {
185
193
  /**
186
194
  * The base data for the table-component.
187
195
  * Includes stuff like the title for the table, what to display inside the rows etc.
@@ -6,6 +6,7 @@ import { SelectionModel } from '@angular/cdk/collections';
6
6
  import { MatDialog } from '@angular/material/dialog';
7
7
  import { MultiSelectAction, TableData } from './table-data';
8
8
  import { TableDataInternal } from './table-data.builder';
9
+ import { BaseEntityType } from '../../classes/entity.model';
9
10
  import * as i0 from "@angular/core";
10
11
  /**
11
12
  * Generates a fully functional table for displaying, creating, updating and deleting entities
@@ -13,7 +14,7 @@ import * as i0 from "@angular/core";
13
14
  *
14
15
  * It offers a lot of customization options which can be found in "TableData".
15
16
  */
16
- export declare class NgxMatEntityTableComponent<EntityType extends object> implements OnInit, OnDestroy {
17
+ export declare class NgxMatEntityTableComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit, OnDestroy {
17
18
  private readonly dialog;
18
19
  private readonly injector;
19
20
  /**
@@ -1,14 +1,20 @@
1
1
  import { CreateDialogData } from '../../components/table/table-data';
2
- import { EntityClassNewable } from '../../classes/entity.model';
2
+ import { BaseEntityType, EntityClassNewable } from '../../classes/entity.model';
3
3
  import { DecoratorTypes } from '../base/decorator-types.enum';
4
4
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
5
- import { ArrayTableDisplayColumn, AutocompleteStringChipsArrayDecoratorConfig, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from './array-decorator.data';
5
+ import { ArrayTableDisplayColumn, AutocompleteStringChipsArrayDecoratorConfig, DateArrayDecoratorConfig, DateRangeArrayDecoratorConfig, DateTimeArrayDecoratorConfig, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from './array-decorator.data';
6
+ import { DateFilterFn } from '@angular/material/datepicker';
7
+ import { Time } from '@angular/common';
8
+ import { DropdownValue } from '../base/dropdown-value.interface';
9
+ import { DateRange } from '../date/date-decorator.data';
10
+ import { ConfirmDialogData } from '../../components/confirm-dialog/confirm-dialog-data';
6
11
  /**
7
12
  * The internal EntityArrayDecoratorConfig. Sets default values.
8
13
  */
9
- export declare class EntityArrayDecoratorConfigInternal<EntityType extends object> extends PropertyDecoratorConfigInternal implements EntityArrayDecoratorConfig<EntityType> {
14
+ export declare class EntityArrayDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal implements EntityArrayDecoratorConfig<EntityType> {
10
15
  itemType: DecoratorTypes.OBJECT;
11
- displayStyle: 'table';
16
+ allowDuplicates: boolean;
17
+ duplicatesErrorDialog: ConfirmDialogData;
12
18
  EntityClass: EntityClassNewable<EntityType>;
13
19
  displayColumns: ArrayTableDisplayColumn<EntityType>[];
14
20
  createDialogData?: CreateDialogData;
@@ -18,12 +24,70 @@ export declare class EntityArrayDecoratorConfigInternal<EntityType extends objec
18
24
  removeButtonLabel: string;
19
25
  constructor(data: EntityArrayDecoratorConfig<EntityType>);
20
26
  }
27
+ /**
28
+ * The internal DateArrayDecoratorConfig. Sets default values.
29
+ */
30
+ export declare class DateArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DateArrayDecoratorConfig {
31
+ itemType: DecoratorTypes.DATE;
32
+ allowDuplicates: boolean;
33
+ duplicatesErrorDialog: ConfirmDialogData;
34
+ displayColumns: ArrayTableDisplayColumn<Date>[];
35
+ addButtonLabel: string;
36
+ removeButtonLabel: string;
37
+ missingErrorMessage: string;
38
+ min?: (date?: Date) => Date;
39
+ max?: (date?: Date) => Date;
40
+ filter?: DateFilterFn<Date | null | undefined>;
41
+ constructor(data: DateArrayDecoratorConfig);
42
+ }
43
+ /**
44
+ * The internal DateTimeArrayDecoratorConfig. Sets default values.
45
+ */
46
+ export declare class DateTimeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DateTimeArrayDecoratorConfig {
47
+ itemType: DecoratorTypes.DATE_TIME;
48
+ allowDuplicates: boolean;
49
+ duplicatesErrorDialog: ConfirmDialogData;
50
+ displayColumns: ArrayTableDisplayColumn<Date>[];
51
+ addButtonLabel: string;
52
+ removeButtonLabel: string;
53
+ missingErrorMessage: string;
54
+ times: DropdownValue<Time>[];
55
+ timeDisplayName: string;
56
+ minDate?: (date?: Date) => Date;
57
+ maxDate?: (date?: Date) => Date;
58
+ filterDate?: DateFilterFn<Date | null | undefined>;
59
+ minTime?: (date?: Date) => Time;
60
+ maxTime?: (date?: Date) => Time;
61
+ filterTime?: ((time: Time) => boolean) | (() => boolean);
62
+ constructor(data: DateTimeArrayDecoratorConfig);
63
+ }
64
+ /**
65
+ * The internal DateRangeArrayDecoratorConfig. Sets default values.
66
+ */
67
+ export declare class DateRangeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DateRangeArrayDecoratorConfig {
68
+ itemType: DecoratorTypes.DATE_RANGE;
69
+ allowDuplicates: boolean;
70
+ duplicatesErrorDialog: ConfirmDialogData;
71
+ displayColumns: ArrayTableDisplayColumn<DateRange>[];
72
+ addButtonLabel: string;
73
+ removeButtonLabel: string;
74
+ missingErrorMessage: string;
75
+ placeholderStart: string;
76
+ placeholderEnd: string;
77
+ minStart?: (date?: Date) => Date;
78
+ maxStart?: (date?: Date) => Date;
79
+ minEnd?: (date?: Date) => Date;
80
+ maxEnd?: (date?: Date) => Date;
81
+ filter?: DateFilterFn<Date>;
82
+ constructor(data: DateRangeArrayDecoratorConfig);
83
+ }
21
84
  /**
22
85
  * The internal StringChipsArrayDecoratorConfig. Sets default values.
23
86
  */
24
87
  export declare class StringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements StringChipsArrayDecoratorConfig {
25
88
  itemType: DecoratorTypes.STRING;
26
- displayStyle: 'chips';
89
+ allowDuplicates: boolean;
90
+ duplicatesErrorDialog: ConfirmDialogData;
27
91
  deleteIcon: string;
28
92
  minLength?: number;
29
93
  maxLength?: number;
@@ -36,7 +100,8 @@ export declare class StringChipsArrayDecoratorConfigInternal extends PropertyDec
36
100
  export declare class AutocompleteStringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements AutocompleteStringChipsArrayDecoratorConfig {
37
101
  autocompleteValues: string[];
38
102
  itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
39
- displayStyle: 'chips';
103
+ allowDuplicates: boolean;
104
+ duplicatesErrorDialog: ConfirmDialogData;
40
105
  deleteIcon: string;
41
106
  minLength?: number;
42
107
  maxLength?: number;