ngx-material-entity 18.2.6 → 20.0.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 (257) hide show
  1. package/fesm2022/ngx-material-entity.mjs +154 -150
  2. package/fesm2022/ngx-material-entity.mjs.map +1 -1
  3. package/index.d.ts +4501 -3
  4. package/package.json +10 -12
  5. package/classes/base.builder.d.ts +0 -37
  6. package/classes/entity.model.d.ts +0 -27
  7. package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +0 -24
  8. package/components/confirm-dialog/confirm-dialog-data.d.ts +0 -48
  9. package/components/confirm-dialog/confirm-dialog.component.d.ts +0 -36
  10. package/components/create-page/create-data.route.d.ts +0 -16
  11. package/components/create-page/create-page.component.d.ts +0 -141
  12. package/components/create-page/page-create-data.builder.d.ts +0 -18
  13. package/components/custom-table/custom-table-configuration.model.d.ts +0 -65
  14. package/components/custom-table/custom-table.component.d.ts +0 -111
  15. package/components/edit-page/edit-data.route.d.ts +0 -16
  16. package/components/edit-page/edit-page.component.d.ts +0 -167
  17. package/components/edit-page/page-edit-data.builder.d.ts +0 -18
  18. package/components/form/form.component.d.ts +0 -64
  19. package/components/input/array/array-date-input/array-date-input.component.d.ts +0 -17
  20. package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +0 -25
  21. package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +0 -26
  22. package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +0 -30
  23. package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +0 -36
  24. package/components/input/array/array-table.class.d.ts +0 -56
  25. package/components/input/base-input.component.d.ts +0 -64
  26. package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +0 -10
  27. package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +0 -13
  28. package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +0 -10
  29. package/components/input/custom/custom.component.d.ts +0 -13
  30. package/components/input/date/date-input/date-input.component.d.ts +0 -11
  31. package/components/input/date/date-range-input/date-range-input.component.d.ts +0 -22
  32. package/components/input/date/date-time-input/date-time-input.component.d.ts +0 -32
  33. package/components/input/file/file-default-input/file-default-input.component.d.ts +0 -11
  34. package/components/input/file/file-image-input/file-image-input.component.d.ts +0 -28
  35. package/components/input/file/file-input/file-input.component.d.ts +0 -45
  36. package/components/input/input.component.d.ts +0 -590
  37. package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +0 -24
  38. package/components/input/number/number-input/number-input.component.d.ts +0 -9
  39. package/components/input/number/number-slider-input/number-slider-input.component.d.ts +0 -10
  40. package/components/input/relations/references-many-input/references-many-input.component.d.ts +0 -43
  41. package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +0 -19
  42. package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +0 -24
  43. package/components/input/string/string-input/string-input.component.d.ts +0 -9
  44. package/components/input/string/string-password-input/string-password-input.component.d.ts +0 -31
  45. package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +0 -9
  46. package/components/table/create-dialog/create-data.builder.d.ts +0 -25
  47. package/components/table/create-dialog/create-entity-data.builder.d.ts +0 -21
  48. package/components/table/create-dialog/create-entity-data.d.ts +0 -19
  49. package/components/table/create-dialog/create-entity-dialog.component.d.ts +0 -77
  50. package/components/table/default.actions.d.ts +0 -25
  51. package/components/table/display-column-value/base-display-column-value.component.d.ts +0 -15
  52. package/components/table/display-column-value/display-column-value.component.d.ts +0 -26
  53. package/components/table/edit-dialog/edit-data.builder.d.ts +0 -44
  54. package/components/table/edit-dialog/edit-entity-data.d.ts +0 -27
  55. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +0 -118
  56. package/components/table/edit-dialog/edit-entity.builder.d.ts +0 -23
  57. package/components/table/table-data.builder.d.ts +0 -102
  58. package/components/table/table-data.d.ts +0 -340
  59. package/components/table/table.component.d.ts +0 -119
  60. package/components/tooltip/tooltip.component.d.ts +0 -14
  61. package/decorators/array/array-decorator-internal.data.d.ts +0 -129
  62. package/decorators/array/array-decorator.data.d.ts +0 -252
  63. package/decorators/array/array.decorator.d.ts +0 -9
  64. package/decorators/base/base-property.decorator.d.ts +0 -9
  65. package/decorators/base/decorator-types.enum.d.ts +0 -48
  66. package/decorators/base/dropdown-value.interface.d.ts +0 -14
  67. package/decorators/base/property-decorator-internal.data.d.ts +0 -41
  68. package/decorators/base/property-decorator.data.d.ts +0 -88
  69. package/decorators/boolean/boolean-decorator-internal.data.d.ts +0 -26
  70. package/decorators/boolean/boolean-decorator.data.d.ts +0 -39
  71. package/decorators/boolean/boolean.decorator.d.ts +0 -7
  72. package/decorators/custom/custom-decorator-internal.data.d.ts +0 -17
  73. package/decorators/custom/custom-decorator.data.d.ts +0 -35
  74. package/decorators/custom/custom.decorator.d.ts +0 -9
  75. package/decorators/date/date-decorator-internal.data.d.ts +0 -45
  76. package/decorators/date/date-decorator.data.d.ts +0 -126
  77. package/decorators/date/date.decorator.d.ts +0 -7
  78. package/decorators/file/file-decorator-internal.data.d.ts +0 -93
  79. package/decorators/file/file-decorator.data.d.ts +0 -88
  80. package/decorators/file/file.decorator.d.ts +0 -8
  81. package/decorators/has-many/has-many-decorator-internal.data.d.ts +0 -16
  82. package/decorators/has-many/has-many-decorator.data.d.ts +0 -34
  83. package/decorators/has-many/has-many.decorator.d.ts +0 -8
  84. package/decorators/number/number-decorator-internal.data.d.ts +0 -38
  85. package/decorators/number/number-decorator.data.d.ts +0 -63
  86. package/decorators/number/number.decorator.d.ts +0 -7
  87. package/decorators/object/object-decorator-internal.data.d.ts +0 -23
  88. package/decorators/object/object-decorator.data.d.ts +0 -42
  89. package/decorators/object/object.decorator.d.ts +0 -8
  90. package/decorators/references-many/references-many-decorator-internal.data.d.ts +0 -30
  91. package/decorators/references-many/references-many-decorator.data.d.ts +0 -63
  92. package/decorators/references-many/references-many.decorator.d.ts +0 -8
  93. package/decorators/references-one/references-one-decorator-internal.data.d.ts +0 -16
  94. package/decorators/references-one/references-one-decorator.data.d.ts +0 -32
  95. package/decorators/references-one/references-one.decorator.d.ts +0 -8
  96. package/decorators/string/string-decorator-internal.data.d.ts +0 -56
  97. package/decorators/string/string-decorator.data.d.ts +0 -116
  98. package/decorators/string/string.decorator.d.ts +0 -7
  99. package/default-global-configuration-values.d.ts +0 -13
  100. package/directives/drag-drop.directive.d.ts +0 -29
  101. package/directives/dynamic-style-class.directive.d.ts +0 -24
  102. package/directives/included-in.directive.d.ts +0 -14
  103. package/directives/number.directive.d.ts +0 -16
  104. package/directives/password-match.directive.d.ts +0 -14
  105. package/directives/tooltip.directive.d.ts +0 -42
  106. package/encapsulation/js-2-xml.utilities.d.ts +0 -14
  107. package/encapsulation/jszip.utilities.d.ts +0 -12
  108. package/encapsulation/lodash.utilities.d.ts +0 -60
  109. package/encapsulation/reflect.utilities.d.ts +0 -59
  110. package/encapsulation/uuid.utilities.d.ts +0 -10
  111. package/esm2022/classes/base.builder.mjs +0 -47
  112. package/esm2022/classes/entity.model.mjs +0 -26
  113. package/esm2022/components/confirm-dialog/confirm-dialog-data.builder.mjs +0 -57
  114. package/esm2022/components/confirm-dialog/confirm-dialog-data.mjs +0 -2
  115. package/esm2022/components/confirm-dialog/confirm-dialog.component.mjs +0 -71
  116. package/esm2022/components/create-page/create-data.route.mjs +0 -12
  117. package/esm2022/components/create-page/create-page.component.mjs +0 -276
  118. package/esm2022/components/create-page/page-create-data.builder.mjs +0 -30
  119. package/esm2022/components/custom-table/custom-table-configuration.model.mjs +0 -37
  120. package/esm2022/components/custom-table/custom-table.component.mjs +0 -213
  121. package/esm2022/components/edit-page/edit-data.route.mjs +0 -12
  122. package/esm2022/components/edit-page/edit-page.component.mjs +0 -362
  123. package/esm2022/components/edit-page/page-edit-data.builder.mjs +0 -33
  124. package/esm2022/components/form/form.component.mjs +0 -106
  125. package/esm2022/components/input/array/array-date-input/array-date-input.component.mjs +0 -56
  126. package/esm2022/components/input/array/array-date-range-input/array-date-range-input.component.mjs +0 -82
  127. package/esm2022/components/input/array/array-date-time-input/array-date-time-input.component.mjs +0 -82
  128. package/esm2022/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +0 -81
  129. package/esm2022/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +0 -74
  130. package/esm2022/components/input/array/array-table.class.mjs +0 -107
  131. package/esm2022/components/input/base-input.component.mjs +0 -102
  132. package/esm2022/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +0 -29
  133. package/esm2022/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +0 -40
  134. package/esm2022/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +0 -29
  135. package/esm2022/components/input/custom/custom.component.mjs +0 -28
  136. package/esm2022/components/input/date/date-input/date-input.component.mjs +0 -28
  137. package/esm2022/components/input/date/date-range-input/date-range-input.component.mjs +0 -84
  138. package/esm2022/components/input/date/date-time-input/date-time-input.component.mjs +0 -90
  139. package/esm2022/components/input/file/file-default-input/file-default-input.component.mjs +0 -18
  140. package/esm2022/components/input/file/file-image-input/file-image-input.component.mjs +0 -104
  141. package/esm2022/components/input/file/file-input/file-input.component.mjs +0 -228
  142. package/esm2022/components/input/input.component.mjs +0 -1367
  143. package/esm2022/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +0 -65
  144. package/esm2022/components/input/number/number-input/number-input.component.mjs +0 -23
  145. package/esm2022/components/input/number/number-slider-input/number-slider-input.component.mjs +0 -27
  146. package/esm2022/components/input/relations/references-many-input/references-many-input.component.mjs +0 -145
  147. package/esm2022/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +0 -56
  148. package/esm2022/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +0 -65
  149. package/esm2022/components/input/string/string-input/string-input.component.mjs +0 -23
  150. package/esm2022/components/input/string/string-password-input/string-password-input.component.mjs +0 -107
  151. package/esm2022/components/input/string/string-textbox-input/string-textbox-input.component.mjs +0 -24
  152. package/esm2022/components/table/create-dialog/create-data.builder.mjs +0 -56
  153. package/esm2022/components/table/create-dialog/create-entity-data.builder.mjs +0 -32
  154. package/esm2022/components/table/create-dialog/create-entity-data.mjs +0 -2
  155. package/esm2022/components/table/create-dialog/create-entity-dialog.component.mjs +0 -180
  156. package/esm2022/components/table/default.actions.mjs +0 -83
  157. package/esm2022/components/table/display-column-value/base-display-column-value.component.mjs +0 -27
  158. package/esm2022/components/table/display-column-value/display-column-value.component.mjs +0 -41
  159. package/esm2022/components/table/edit-dialog/edit-data.builder.mjs +0 -136
  160. package/esm2022/components/table/edit-dialog/edit-entity-data.mjs +0 -2
  161. package/esm2022/components/table/edit-dialog/edit-entity-dialog.component.mjs +0 -295
  162. package/esm2022/components/table/edit-dialog/edit-entity.builder.mjs +0 -39
  163. package/esm2022/components/table/table-data.builder.mjs +0 -304
  164. package/esm2022/components/table/table-data.mjs +0 -2
  165. package/esm2022/components/table/table.component.mjs +0 -324
  166. package/esm2022/components/tooltip/tooltip.component.mjs +0 -26
  167. package/esm2022/decorators/array/array-decorator-internal.data.mjs +0 -310
  168. package/esm2022/decorators/array/array-decorator.data.mjs +0 -51
  169. package/esm2022/decorators/array/array.decorator.mjs +0 -37
  170. package/esm2022/decorators/base/base-property.decorator.mjs +0 -17
  171. package/esm2022/decorators/base/decorator-types.enum.mjs +0 -35
  172. package/esm2022/decorators/base/dropdown-value.interface.mjs +0 -2
  173. package/esm2022/decorators/base/property-decorator-internal.data.mjs +0 -101
  174. package/esm2022/decorators/base/property-decorator.data.mjs +0 -59
  175. package/esm2022/decorators/boolean/boolean-decorator-internal.data.mjs +0 -45
  176. package/esm2022/decorators/boolean/boolean-decorator.data.mjs +0 -11
  177. package/esm2022/decorators/boolean/boolean.decorator.mjs +0 -21
  178. package/esm2022/decorators/custom/custom-decorator-internal.data.mjs +0 -34
  179. package/esm2022/decorators/custom/custom-decorator.data.mjs +0 -2
  180. package/esm2022/decorators/custom/custom.decorator.mjs +0 -13
  181. package/esm2022/decorators/date/date-decorator-internal.data.mjs +0 -92
  182. package/esm2022/decorators/date/date-decorator.data.mjs +0 -11
  183. package/esm2022/decorators/date/date.decorator.mjs +0 -22
  184. package/esm2022/decorators/file/file-decorator-internal.data.mjs +0 -143
  185. package/esm2022/decorators/file/file-decorator.data.mjs +0 -59
  186. package/esm2022/decorators/file/file.decorator.mjs +0 -25
  187. package/esm2022/decorators/has-many/has-many-decorator-internal.data.mjs +0 -41
  188. package/esm2022/decorators/has-many/has-many-decorator.data.mjs +0 -2
  189. package/esm2022/decorators/has-many/has-many.decorator.mjs +0 -13
  190. package/esm2022/decorators/number/number-decorator-internal.data.mjs +0 -68
  191. package/esm2022/decorators/number/number-decorator.data.mjs +0 -11
  192. package/esm2022/decorators/number/number.decorator.mjs +0 -22
  193. package/esm2022/decorators/object/object-decorator-internal.data.mjs +0 -42
  194. package/esm2022/decorators/object/object-decorator.data.mjs +0 -22
  195. package/esm2022/decorators/object/object.decorator.mjs +0 -20
  196. package/esm2022/decorators/references-many/references-many-decorator-internal.data.mjs +0 -55
  197. package/esm2022/decorators/references-many/references-many-decorator.data.mjs +0 -2
  198. package/esm2022/decorators/references-many/references-many.decorator.mjs +0 -13
  199. package/esm2022/decorators/references-one/references-one-decorator-internal.data.mjs +0 -34
  200. package/esm2022/decorators/references-one/references-one-decorator.data.mjs +0 -2
  201. package/esm2022/decorators/references-one/references-one.decorator.mjs +0 -12
  202. package/esm2022/decorators/string/string-decorator-internal.data.mjs +0 -119
  203. package/esm2022/decorators/string/string-decorator.data.mjs +0 -11
  204. package/esm2022/decorators/string/string.decorator.mjs +0 -29
  205. package/esm2022/default-global-configuration-values.mjs +0 -91
  206. package/esm2022/directives/drag-drop.directive.mjs +0 -60
  207. package/esm2022/directives/dynamic-style-class.directive.mjs +0 -51
  208. package/esm2022/directives/included-in.directive.mjs +0 -33
  209. package/esm2022/directives/number.directive.mjs +0 -37
  210. package/esm2022/directives/password-match.directive.mjs +0 -30
  211. package/esm2022/directives/tooltip.directive.mjs +0 -142
  212. package/esm2022/encapsulation/js-2-xml.utilities.mjs +0 -17
  213. package/esm2022/encapsulation/jszip.utilities.mjs +0 -16
  214. package/esm2022/encapsulation/lodash.utilities.mjs +0 -80
  215. package/esm2022/encapsulation/reflect.utilities.mjs +0 -79
  216. package/esm2022/encapsulation/uuid.utilities.mjs +0 -14
  217. package/esm2022/functions/default-false.function.mjs +0 -9
  218. package/esm2022/functions/default-style-classes.function.mjs +0 -7
  219. package/esm2022/functions/default-true.function.mjs +0 -9
  220. package/esm2022/functions/dropdown-values-to-function.function.mjs +0 -15
  221. package/esm2022/functions/get-changes-tooltip-content.function.mjs +0 -23
  222. package/esm2022/functions/get-config-value.function.mjs +0 -14
  223. package/esm2022/functions/get-validation-error-message.function.mjs +0 -54
  224. package/esm2022/functions/get-validation-errors-tooltip-content.function.mjs +0 -23
  225. package/esm2022/functions/is-async-function.function.mjs +0 -9
  226. package/esm2022/functions/table-column-value-to-sort-value.function.mjs +0 -33
  227. package/esm2022/global-configuration-values.mjs +0 -27
  228. package/esm2022/mocks/placeholder-data.png.mjs +0 -3
  229. package/esm2022/ngx-material-entity.mjs +0 -5
  230. package/esm2022/public-api.mjs +0 -68
  231. package/esm2022/services/entity.service.mjs +0 -269
  232. package/esm2022/services/unsaved-changes.guard.mjs +0 -13
  233. package/esm2022/utilities/date.utilities.mjs +0 -138
  234. package/esm2022/utilities/entity.utilities.mjs +0 -611
  235. package/esm2022/utilities/file.utilities.mjs +0 -172
  236. package/esm2022/utilities/selection.utilities.mjs +0 -49
  237. package/esm2022/utilities/validation.utilities.mjs +0 -543
  238. package/functions/default-false.function.d.ts +0 -6
  239. package/functions/default-style-classes.function.d.ts +0 -6
  240. package/functions/default-true.function.d.ts +0 -6
  241. package/functions/dropdown-values-to-function.function.d.ts +0 -11
  242. package/functions/get-changes-tooltip-content.function.d.ts +0 -13
  243. package/functions/get-config-value.function.d.ts +0 -7
  244. package/functions/get-validation-error-message.function.d.ts +0 -5
  245. package/functions/get-validation-errors-tooltip-content.function.d.ts +0 -12
  246. package/functions/is-async-function.function.d.ts +0 -6
  247. package/functions/table-column-value-to-sort-value.function.d.ts +0 -9
  248. package/global-configuration-values.d.ts +0 -205
  249. package/mocks/placeholder-data.png.d.ts +0 -1
  250. package/public-api.d.ts +0 -60
  251. package/services/entity.service.d.ts +0 -146
  252. package/services/unsaved-changes.guard.d.ts +0 -23
  253. package/utilities/date.utilities.d.ts +0 -92
  254. package/utilities/entity.utilities.d.ts +0 -236
  255. package/utilities/file.utilities.d.ts +0 -67
  256. package/utilities/selection.utilities.d.ts +0 -28
  257. package/utilities/validation.utilities.d.ts +0 -58
package/index.d.ts CHANGED
@@ -1,5 +1,4503 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import * as i0 from '@angular/core';
3
+ import { EnvironmentInjector, InjectionToken, OnInit, Type, Provider, EnvironmentProviders, EventEmitter, ElementRef, Renderer2, OnChanges, OnDestroy } from '@angular/core';
4
+ import { BehaviorSubject, Observable } from 'rxjs';
5
+ import { MatDialogRef, MatDialog } from '@angular/material/dialog';
6
+ import { Route, DefaultExport, CanDeactivateFn, ActivatedRoute, Router } from '@angular/router';
7
+ import { Location } from '@angular/common';
8
+ import { IconDefinition } from '@fortawesome/angular-fontawesome';
9
+ import { DateFilterFn } from '@angular/material/datepicker';
10
+ import { NgModel, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
11
+ import { SelectionModel } from '@angular/cdk/collections';
12
+ import { MatTableDataSource } from '@angular/material/table';
13
+
1
14
  /**
2
- * Generated bundle index. Do not edit.
15
+ * A generic EntityService class.
16
+ * Offers basic CRUD-functionality.
17
+ * You should create a service for every Entity you have.
18
+ * If you extend from this you need to make sure that the extended Service can be injected.
3
19
  */
4
- /// <amd-module name="ngx-material-entity" />
5
- export * from './public-api';
20
+ declare abstract class EntityService<EntityType extends BaseEntityType<EntityType>> {
21
+ protected readonly http: HttpClient;
22
+ protected readonly injector: EnvironmentInjector;
23
+ /**
24
+ * The base url used for api requests. If u want to have more control over this,
25
+ * you can override the create, read, update and delete methods.
26
+ *
27
+ * Create Sends a POST-Request to baseUrl.
28
+ *
29
+ * Read Sends a GET-Request to baseUrl.
30
+ *
31
+ * Update Sends a PATCH-Request to baseUrl/{id}.
32
+ *
33
+ * Delete Sends a DEL-Request to baseUrl/{id}.
34
+ */
35
+ abstract readonly baseUrl: string;
36
+ /**
37
+ * The default route segment that comes before the id when editing an entity in a separate page, if no extra route has been provided.
38
+ */
39
+ readonly editBaseRoute: string;
40
+ /**
41
+ * The complete route that is used to create an entity in a separate page, if no extra route has been provided.
42
+ */
43
+ readonly createBaseRoute: string;
44
+ /**
45
+ * The key which holds the id value.
46
+ * @default 'id'
47
+ */
48
+ readonly idKey: keyof EntityType;
49
+ /**
50
+ * A subject of all the entity values.
51
+ * Can be subscribed to when you want to do a specific thing whenever the entities change.
52
+ */
53
+ readonly entitiesSubject: BehaviorSubject<EntityType[]>;
54
+ /**
55
+ * When frequently trying to find a single entity by an id (eg. When nesting relations)
56
+ * you might send a lot of unnecessary requests.
57
+ * Therefore the findById method tries to look in the already existing entities first,
58
+ * IF the entities have been requested in the last READ_EXPIRATION_IN_MS milliseconds.
59
+ * @default 900000 (5 minutes)
60
+ */
61
+ protected readonly READ_EXPIRATION_IN_MS: number;
62
+ /**
63
+ * Gets the entities in an array from the internal entitiesSubject.
64
+ * @returns The current entities in form of an array.
65
+ */
66
+ get entities(): EntityType[];
67
+ /**
68
+ * The last time that the entities have been requested from the api.
69
+ */
70
+ lastRead?: Date;
71
+ constructor(http: HttpClient, injector: EnvironmentInjector);
72
+ /**
73
+ * Creates a new Entity and pushes it to the entities array.
74
+ * @param entity - The data of the entity to create.
75
+ * All values that should be omitted will be removed from it inside this method.
76
+ * @param baseUrl - The base url to send the post request to.
77
+ * This can be used if you want to create an entity belonging to another, like "customers/{id}/invoices".
78
+ * @returns A Promise of the created entity.
79
+ */
80
+ create(entity: EntityType, baseUrl?: string): Promise<EntityType>;
81
+ /**
82
+ * Imports everything from the provided json file.
83
+ * @param file - The json file to import from.
84
+ * @returns All entities that have been imported.
85
+ */
86
+ import(file: File): Promise<EntityType[]>;
87
+ /**
88
+ * Creates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
89
+ * All file values are stored inside their respective property key and their name.
90
+ * Form data is able to handle setting multiple files to the same key.
91
+ * @param body - The body Of the request.
92
+ * @param filePropertyKeys - All property keys that are files and need to be added to the form data.
93
+ * @param entity - The entity to create. This is needed in addition to the body because the body doesn't contain any metadata.
94
+ * @param baseUrl - The base url to send the post request to.
95
+ * This can be used if you want to create an entity belonging to another, like "customers/{id}/invoices".
96
+ * @returns The created entity from the server.
97
+ */
98
+ protected createWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType, baseUrl?: string): Promise<EntityType>;
99
+ /**
100
+ * Creates the entity with a normal json body in contrast to creating it with form data when the entity contains files.
101
+ * @param body - The body Of the request.
102
+ * @param baseUrl - The base url to send the post request to.
103
+ * This can be used if you want to create an entity belonging to another, like "customers/{id}/invoices".
104
+ * @returns The created entity from the server.
105
+ */
106
+ protected createWithJson(body: Partial<EntityType>, baseUrl?: string): Promise<EntityType>;
107
+ /**
108
+ * Gets all existing entities and pushes them to the entities array.
109
+ * @param baseUrl - The base url for the request. Defaults to the baseUrl on the service.
110
+ * @returns A Promise of all received Entities.
111
+ */
112
+ read(baseUrl?: string): Promise<EntityType[]>;
113
+ /**
114
+ * Tries to find an entity with the given id.
115
+ * @param id - The id of the entity to find.
116
+ * @returns The found entity.
117
+ */
118
+ findById(id: EntityType[keyof EntityType]): Promise<EntityType>;
119
+ /**
120
+ * Updates a specific Entity.
121
+ * @param entity - The updated Entity
122
+ * All values that should be omitted will be removed from it inside this method.
123
+ * @param entityPriorChanges - The current Entity.
124
+ * It Is used to get changed values and only update them instead of sending the whole entity data.
125
+ */
126
+ update(entity: EntityType, entityPriorChanges: EntityType): Promise<void>;
127
+ /**
128
+ * Builds the update request body from the given entity before and after its changes.
129
+ * @param entity - The entity with changed values.
130
+ * @param entityPriorChanges - The entity before any changes.
131
+ * @returns A partial of only the changed values.
132
+ */
133
+ protected entityToUpdateRequestBody(entity: EntityType, entityPriorChanges: EntityType): Promise<Partial<EntityType>>;
134
+ /**
135
+ * Updates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
136
+ * All file values are stored inside their respective property key and their name.
137
+ * Form data is able to handle setting multiple files to the same key.
138
+ * @param body - The request body. Already contains only properties that have changed.
139
+ * @param filePropertyKeys - The keys of all properties which are files and need to separately be appended to the form data.
140
+ * @param entity - The original entity. Is needed to get the metadata of all the files.
141
+ * @param id - The id of the entity to update.
142
+ */
143
+ protected updateWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType, id: EntityType[keyof EntityType]): Promise<void>;
144
+ /**
145
+ * Updates the entity with a normal json body in contrast to updating it with form data when the entity contains files.
146
+ * @param body - The body of the Request. Has already removed all unnecessary values.
147
+ * @param id - The id of the entity to update.
148
+ */
149
+ protected updateWithJson(body: Partial<EntityType>, id: EntityType[keyof EntityType]): Promise<void>;
150
+ /**
151
+ * Deletes a specific Entity.
152
+ * @param entity - The entity to delete.
153
+ */
154
+ delete(entity: EntityType): Promise<void>;
155
+ }
156
+
157
+ /**
158
+ * The newable type used whenever an entity class is passed to create an entity and initialize its metadata.
159
+ */
160
+ type EntityClassNewable<EntityType extends BaseEntityType<EntityType>> = new (data?: EntityType) => EntityType;
161
+ /**
162
+ * The newable type used whenever an entity service class is passed.
163
+ */
164
+ type EntityServiceClassNewable<EntityType extends BaseEntityType<EntityType>> = new (http: HttpClient, injector: EnvironmentInjector) => EntityService<EntityType>;
165
+ /**
166
+ * The Generic Base EntityType.
167
+ */
168
+ type BaseEntityType<T> = {
169
+ [K in keyof T]: unknown;
170
+ };
171
+ /**
172
+ * A base Entity class with a builtin id.
173
+ */
174
+ declare abstract class Entity {
175
+ /**
176
+ * A unique identifier for the Entity.
177
+ */
178
+ readonly id: string;
179
+ constructor(entity?: Entity);
180
+ }
181
+
182
+ /**
183
+ * The different types of a confirm dialog.
184
+ * Is used for displaying different buttons accordingly.
185
+ */
186
+ type ConfirmDialogTypes = 'default' | 'delete' | 'info-only';
187
+ /**
188
+ * The Definition of the Confirm Dialog Data.
189
+ */
190
+ interface ConfirmDialogData {
191
+ /**
192
+ * An array of paragraphs to display inside the dialog body.
193
+ */
194
+ text?: string[];
195
+ /**
196
+ * The type of the Confirm Dialog. Changes the button layout. Can be either:
197
+ *
198
+ * 'default': A confirm- and a cancel-button.
199
+ *
200
+ * 'delete': Like default but the confirm-button is red.
201
+ *
202
+ * 'info-only': Only a cancel-button.
203
+ */
204
+ type?: ConfirmDialogTypes;
205
+ /**
206
+ * The label of the button that confirms the dialog.
207
+ * In case of the 'delete' Dialog this is the string that is shown on the delete-button.
208
+ * @default 'Confirm' or 'Delete', depending on the type
209
+ */
210
+ confirmButtonLabel?: string;
211
+ /**
212
+ * The label of the button that closes the dialog without doing anything.
213
+ * @default 'Cancel'
214
+ */
215
+ cancelButtonLabel?: string;
216
+ /**
217
+ * The title of the dialog.
218
+ */
219
+ title?: string;
220
+ /**
221
+ * Whether or not a checkbox needs to be selected before the user can confirm the dialog.
222
+ * @default false
223
+ */
224
+ requireConfirmation?: boolean;
225
+ /**
226
+ * The text to display on the checkbox if 'requireConfirmation' is set to true.
227
+ */
228
+ confirmationText?: string;
229
+ }
230
+
231
+ /**
232
+ * All configurable default values.
233
+ */
234
+ interface NgxGlobalDefaultValues {
235
+ /**
236
+ * The label for create buttons.
237
+ * @default 'Create'
238
+ */
239
+ createLabel: string;
240
+ /**
241
+ * The label for edit buttons.
242
+ * @default 'Edit'
243
+ */
244
+ editLabel: string;
245
+ /**
246
+ * The label for save buttons.
247
+ * @default 'Save'
248
+ */
249
+ saveLabel: string;
250
+ /**
251
+ * The label for cancel buttons.
252
+ * @default 'Cancel'
253
+ */
254
+ cancelLabel: string;
255
+ /**
256
+ * The label for add buttons.
257
+ * @default 'Add'
258
+ */
259
+ addLabel: string;
260
+ /**
261
+ * The label for delete buttons.
262
+ * @default 'Delete'
263
+ */
264
+ deleteLabel: string;
265
+ /**
266
+ * The label for back buttons.
267
+ * @default 'Back'
268
+ */
269
+ backLabel: string;
270
+ /**
271
+ * The label for actions.
272
+ * @default 'Actions'
273
+ */
274
+ actionsLabel: string;
275
+ /**
276
+ * The label for searches.
277
+ * @default 'Search'
278
+ */
279
+ searchLabel: string;
280
+ /**
281
+ * The display value for the "true" value in dropdowns.
282
+ * @default 'Yes'
283
+ */
284
+ dropdownTrue: string;
285
+ /**
286
+ * The display value for the "false" value in dropdowns.
287
+ * @default 'No'
288
+ */
289
+ dropdownFalse: string;
290
+ /**
291
+ * The label for confirm buttons.
292
+ * @default 'Confirm'
293
+ */
294
+ confirmLabel: string;
295
+ /**
296
+ * The title for a confirm dialog.
297
+ * @default 'Confirmation'
298
+ */
299
+ defaultConfirmDialogTitle: string;
300
+ /**
301
+ * The text for a confirm dialog.
302
+ * @default ['Do you really want to do this?']
303
+ */
304
+ defaultConfirmDialogText: string[];
305
+ /**
306
+ * The text for confirming a save action.
307
+ * @default ['Do you really want to save all changes?']
308
+ */
309
+ confirmSaveText: string[];
310
+ /**
311
+ * The text for confirming a delete action.
312
+ * @default ['Do you really want to delete this entity?']
313
+ */
314
+ confirmDeleteText: string[];
315
+ /**
316
+ * The label for the button to leave without changes.
317
+ * @default 'Leave'
318
+ */
319
+ confirmUnsavedChangesLabel: string;
320
+ /**
321
+ * The label for the button to close a dialog without changes.
322
+ * @default 'Close'
323
+ */
324
+ confirmUnsavedChangesDialogLabel: string;
325
+ /**
326
+ * The title for confirming to leave without changes.
327
+ * @default 'Unsaved Changes'
328
+ */
329
+ confirmUnsavedChangesTitle: string;
330
+ /**
331
+ * The text for confirming to leave a page without changes.
332
+ * @default ['You have unsaved changes that will be deleted when you leave this page.', 'Continue?']
333
+ */
334
+ confirmUnsavedChangesText: string[];
335
+ /**
336
+ * The text for confirming to leave a dialog without changes.
337
+ * @default ['You have unsaved changes that will be deleted when you close this dialog.', 'Continue?']
338
+ */
339
+ confirmUnsavedChangesDialogText: string[];
340
+ /**
341
+ * The title for the add array item dialog.
342
+ * @default 'Add to array'
343
+ */
344
+ addArrayItemTitle: string;
345
+ /**
346
+ * The text for confirming a create action.
347
+ * @default ['Do you really want to create this entity?']
348
+ */
349
+ confirmCreateText: string[];
350
+ /**
351
+ * The text for confirming a multi select action.
352
+ * @default selectedEntries => [`Do you really want to run this action on ${selectedEntries.length} entries?`]
353
+ */
354
+ confirmMultiSelectActionText: (selectedEntries: unknown[]) => string[];
355
+ /**
356
+ * The text for confirming a base action.
357
+ * @default ['Do you really want to run this action?']
358
+ */
359
+ confirmBaseActionText: string[];
360
+ /**
361
+ * The text for confirming the json import.
362
+ * @default ['Do you really want to import entities from the provided file?']
363
+ */
364
+ confirmImportJsonText: string[];
365
+ /**
366
+ * How table entities are edited by default.
367
+ * @default 'dialog'
368
+ */
369
+ defaultEditMethod: 'dialog' | 'page';
370
+ /**
371
+ * How table entities are created by default.
372
+ * @default 'dialog'
373
+ */
374
+ defaultCreateMethod: 'dialog' | 'page';
375
+ /**
376
+ * The error message to display when an array property is required and empty.
377
+ * @default 'Needs to contain at least one value'
378
+ */
379
+ emptyArrayErrorMessage: string;
380
+ /**
381
+ * The label for remove actions.
382
+ * @default 'Remove'
383
+ */
384
+ removeLabel: string;
385
+ /**
386
+ * The label for time values.
387
+ * Mainly used inside date properties.
388
+ * @default 'Time'
389
+ */
390
+ timeLabel: string;
391
+ /**
392
+ * The label for the date range start.
393
+ * @default 'Start'
394
+ */
395
+ startLabel: string;
396
+ /**
397
+ * The label for the date range end.
398
+ * @default 'End'
399
+ */
400
+ endLabel: string;
401
+ /**
402
+ * The error text for duplicate entries inside an array.
403
+ * @default ['Adding duplicate entries to the array is not allowed.']
404
+ */
405
+ duplicateErrorText: string[];
406
+ /**
407
+ * The error title for duplicate entries inside an array.
408
+ * @default 'Error adding duplicate item'
409
+ */
410
+ duplicateErrorTitle: string;
411
+ /**
412
+ * The title for editing an entities.
413
+ * @default () => 'Edit'
414
+ */
415
+ editTitle: (entity: unknown) => string;
416
+ /**
417
+ * The label for an select action, eg. Dropdowns.
418
+ * @default 'Select'
419
+ */
420
+ selectLabel: string;
421
+ /**
422
+ * The label for an "Add all" button.
423
+ * @default 'Add all'
424
+ */
425
+ addAllLabel: string;
426
+ }
427
+ /**
428
+ * The provider for global configuration values.
429
+ */
430
+ declare const NGX_GLOBAL_DEFAULT_VALUES: InjectionToken<Partial<NgxGlobalDefaultValues>>;
431
+ /**
432
+ * The internal values consisting of default ones and values provided by the user in NGX_GLOBAL_DEFAULT_VALUES.
433
+ */
434
+ declare const NGX_COMPLETE_GLOBAL_DEFAULT_VALUES: InjectionToken<NgxGlobalDefaultValues>;
435
+
436
+ /**
437
+ * The internal ConfirmDialogData. Requires all default values the user can leave out.
438
+ */
439
+ declare class ConfirmDialogDataInternal implements ConfirmDialogData {
440
+ text: string[];
441
+ type: ConfirmDialogTypes;
442
+ confirmButtonLabel: string;
443
+ cancelButtonLabel: string;
444
+ title: string;
445
+ requireConfirmation: boolean;
446
+ confirmationText?: string;
447
+ constructor(text: string[], type: ConfirmDialogTypes, confirmButtonLabel: string, cancelButtonLabel: string, title: string, requireConfirmation: boolean, confirmationText?: string);
448
+ }
449
+
450
+ /**
451
+ * The Dialog used whenever confirmation by the user is required (e.g. When the user tries to delete an entity).
452
+ *
453
+ * Can be customized with the MAT_DIALOG_DATA "inputData". Customization options are defined in "ConfirmDialogData".
454
+ */
455
+ declare class NgxMatEntityConfirmDialogComponent implements OnInit {
456
+ private readonly dialogRef;
457
+ private readonly inputData;
458
+ protected readonly globalConfig: NgxGlobalDefaultValues;
459
+ /**
460
+ * Whether or not the user needs to tick a checkbox to enable the confirm button.
461
+ */
462
+ confirm: boolean;
463
+ /**
464
+ * The configuration data of the dialog.
465
+ */
466
+ data: ConfirmDialogDataInternal;
467
+ constructor(dialogRef: MatDialogRef<NgxMatEntityConfirmDialogComponent>, inputData: ConfirmDialogData, globalConfig: NgxGlobalDefaultValues);
468
+ ngOnInit(): void;
469
+ /**
470
+ * Closes the dialog with true to signal that the action should be run.
471
+ */
472
+ confirmAction(): void;
473
+ /**
474
+ * Closes the dialog.
475
+ */
476
+ cancel(): void;
477
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityConfirmDialogComponent, never>;
478
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityConfirmDialogComponent, "ngx-mat-entity-confirm-dialog", never, {}, {}, never, never, true, never>;
479
+ }
480
+
481
+ /**
482
+ * The definition for a route to use with the "NgxMatEntityCreatePageComponent".
483
+ */
484
+ interface CreateDataRoute extends Route {
485
+ loadComponent: () => Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>;
486
+ providers: (Provider | EnvironmentProviders)[];
487
+ title: string;
488
+ path: string;
489
+ }
490
+ /**
491
+ * The default data for a create route.
492
+ */
493
+ declare const defaultCreateDataRoute: Omit<CreateDataRoute, 'providers'>;
494
+
495
+ /**
496
+ * The base component for custom display values.
497
+ *
498
+ * Contains the entity for which the component gets displayed.
499
+ */
500
+ declare abstract class NgxMatEntityBaseDisplayColumnValueComponent<EntityType extends BaseEntityType<EntityType>> {
501
+ /**
502
+ * The entity for which the component gets displayed.
503
+ */
504
+ entity: EntityType;
505
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityBaseDisplayColumnValueComponent<any>, never>;
506
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityBaseDisplayColumnValueComponent<any>, "ngx-mat-entity-base-display-column-value", never, { "entity": { "alias": "entity"; "required": true; }; }, {}, never, never, true, never>;
507
+ }
508
+
509
+ /**
510
+ * The value that can be displayed inside a table column.
511
+ */
512
+ type TableColumnValue = string | number | Date;
513
+ /**
514
+ * The Definition of a Column inside the table.
515
+ */
516
+ interface DisplayColumn<T> {
517
+ /**
518
+ * The name inside the header.
519
+ */
520
+ displayName: string;
521
+ /**
522
+ * What to display inside the row.
523
+ */
524
+ value: (value: T) => TableColumnValue;
525
+ /**
526
+ * A custom component to use instead of the value.
527
+ * You still need to provide a value function for the sorting by header to work.
528
+ */
529
+ Component?: Type<NgxMatEntityBaseDisplayColumnValueComponent<T>>;
530
+ /**
531
+ * Whether or not the click event should be disabled.
532
+ * This can be useful if your component has a custom way to handle clicks.
533
+ */
534
+ disableClick?: boolean;
535
+ }
536
+ /**
537
+ * Dynamic css class that should be applied based on a condition.
538
+ */
539
+ type DynamicStyleClasses<T> = (value: T) => string[];
540
+ /**
541
+ * A table action that will run regardless if something has been selected in the table.
542
+ */
543
+ interface BaseTableAction {
544
+ /**
545
+ * The type of the table action to distinct between base and multi-select actions.
546
+ */
547
+ type: 'default';
548
+ /**
549
+ * The name of the action.
550
+ */
551
+ displayName: string;
552
+ /**
553
+ * The action itself.
554
+ */
555
+ action: (() => unknown) | (() => Promise<unknown>);
556
+ /**
557
+ * A method that defines whether or not the action can be used.
558
+ * @default () => true
559
+ */
560
+ enabled?: () => boolean;
561
+ /**
562
+ * A method that defines whether or not a confirm dialog is needed to run the action.
563
+ * @default false
564
+ */
565
+ requireConfirmDialog?: () => boolean;
566
+ /**
567
+ * The data used to generate a confirmation dialog for the table action.
568
+ */
569
+ confirmDialogData?: ConfirmDialogData;
570
+ }
571
+ /**
572
+ * The Definition of an Action that can be run on multiple selected entities.
573
+ */
574
+ interface MultiSelectAction<EntityType extends BaseEntityType<EntityType>> {
575
+ /**
576
+ * The type of the table action to distinct between base and multi-select actions.
577
+ */
578
+ type: 'multi-select';
579
+ /**
580
+ * The name of the action.
581
+ */
582
+ displayName: string;
583
+ /**
584
+ * The action itself.
585
+ */
586
+ action: ((selectedEntities: EntityType[]) => unknown) | ((selectedEntities: EntityType[]) => Promise<unknown>);
587
+ /**
588
+ * A method that defines whether or not the action can be used.
589
+ * @default (selectedEntities: EntityType[]) => !!selectedEntities.length
590
+ */
591
+ enabled?: (selectedEntities: EntityType[]) => boolean;
592
+ /**
593
+ * A method that defines whether or not a confirm dialog is needed to run the action.
594
+ * @default false
595
+ */
596
+ requireConfirmDialog?: (selectedEntities: EntityType[]) => boolean;
597
+ /**
598
+ * The data used to generate a confirmation dialog for the table action.
599
+ */
600
+ confirmDialogData?: ConfirmDialogData;
601
+ }
602
+ /**
603
+ * An action for the table. Can either be independent or run on the selected entities in the table.
604
+ */
605
+ type TableAction<EntityType extends BaseEntityType<EntityType>> = BaseTableAction | MultiSelectAction<EntityType>;
606
+ /**
607
+ * The base data of the ngx-mat-entity-table.
608
+ */
609
+ interface BaseData<EntityType extends BaseEntityType<EntityType>> {
610
+ /**
611
+ * The title of the table.
612
+ */
613
+ title: string;
614
+ /**
615
+ * The definition of the columns to display. Consists of the displayName to show in the header of the row
616
+ * and the value, which is a function that generates the value to display inside a column.
617
+ */
618
+ displayColumns: DisplayColumn<EntityType>[];
619
+ /**
620
+ * The Class of the service that handles the entities.
621
+ * Needs to be injectable and an extension of the "EntityService"-Class.
622
+ */
623
+ EntityServiceClass: EntityServiceClassNewable<EntityType>;
624
+ /**
625
+ * The Class of the entities to manage.
626
+ */
627
+ EntityClass?: EntityClassNewable<EntityType>;
628
+ /**
629
+ * The label on the search bar. Defaults to "Search".
630
+ */
631
+ searchLabel?: string;
632
+ /**
633
+ * The label on the button for adding new entities. Defaults to "Create".
634
+ */
635
+ createButtonLabel?: string;
636
+ /**
637
+ * Whether editing happens in a dialog or a separate page.
638
+ */
639
+ defaultEdit?: 'dialog' | 'page';
640
+ /**
641
+ * Whether creating happens in a dialog or a separate page.
642
+ */
643
+ defaultCreate?: 'dialog' | 'page';
644
+ /**
645
+ * Takes a custom edit method which runs when you click on a entity.
646
+ * If you don't need any special editing of entries you can also omit this.
647
+ * In that case a default edit dialog is generated.
648
+ */
649
+ edit?: (entity: EntityType) => unknown;
650
+ /**
651
+ * Takes a method to run when you click on the new button.
652
+ * If you don't need anything special you can also omit this.
653
+ * In that case a default create dialog is generated.
654
+ */
655
+ create?: (entity: EntityType) => unknown;
656
+ /**
657
+ * Defines how the search string of entities is generated.
658
+ */
659
+ searchString?: (entity: EntityType) => string;
660
+ /**
661
+ * Defines whether or not the user can add new entities.
662
+ * @default () => true
663
+ */
664
+ allowCreate?: boolean | (() => boolean);
665
+ /**
666
+ * Defines whether or not the user can view the specific entity.
667
+ * @default () => true
668
+ */
669
+ allowRead?: boolean | ((entity?: EntityType) => boolean);
670
+ /**
671
+ * Defines whether or not the user can edit the specific entity.
672
+ * @default () => true
673
+ */
674
+ allowUpdate?: boolean | ((entity?: EntityType) => boolean);
675
+ /**
676
+ * Whether or not the user can delete this specific entity.
677
+ * @default () => true
678
+ */
679
+ allowDelete?: boolean | ((entity?: EntityType) => boolean);
680
+ /**
681
+ * All Actions that you want to run on the table can be defined here.
682
+ * (e.g. Download as zip-file, import or mass delete).
683
+ */
684
+ tableActions?: TableAction<EntityType>[];
685
+ /**
686
+ * The Label for the button that opens all table-actions.
687
+ */
688
+ tableActionsLabel?: string;
689
+ /**
690
+ * Whether or not to display a loading spinner while the entities of the table are loaded.
691
+ * @default true
692
+ */
693
+ displayLoadingSpinner?: boolean;
694
+ /**
695
+ * Whether or not JSON imports are allowed.
696
+ * This adds an table select action.
697
+ * @default false
698
+ */
699
+ allowJsonImport?: boolean;
700
+ /**
701
+ * Data to customize the json import action.
702
+ */
703
+ importActionData?: Omit<BaseTableAction, 'action' | 'requireConfirmDialog' | 'type'>;
704
+ /**
705
+ * Configuration for css classes that should be applied to table rows based on a condition.
706
+ * This could be used to eg. Set the background color to green when an item has the status completed etc.
707
+ * INFO: You need to use ng-deep or apply the styling in the styles.scss.
708
+ * @default () => []
709
+ */
710
+ dynamicRowStyleClasses?: DynamicStyleClasses<EntityType>;
711
+ }
712
+ /**
713
+ * The data of the default create-dialog.
714
+ */
715
+ interface CreateData {
716
+ /**
717
+ * The title of the default create-dialog.
718
+ */
719
+ title?: string;
720
+ /**
721
+ * The label on the create-button of the default create-dialog. Defaults to "Create".
722
+ */
723
+ createButtonLabel?: string;
724
+ /**
725
+ * The label on the cancel-button for the default create-dialog. Defaults to "Cancel".
726
+ */
727
+ cancelButtonLabel?: string;
728
+ /**
729
+ * Whether or not the creation of an entry should require a confirm dialog.
730
+ */
731
+ createRequiresConfirmDialog?: boolean;
732
+ /**
733
+ * The data used to generate a confirmation dialog for the create action.
734
+ */
735
+ confirmCreateDialogData?: ConfirmDialogData;
736
+ /**
737
+ * Whether or not cancelling with unsaved changes should require a confirm dialog.
738
+ */
739
+ unsavedChangesRequireConfirmDialog?: boolean;
740
+ /**
741
+ * The data used to generate a confirmation dialog for the cancel with unsaved changes action.
742
+ */
743
+ confirmUnsavedChangesDialogData?: ConfirmDialogData;
744
+ }
745
+ /**
746
+ * An action that can be run from inside the edit dialog or page.
747
+ */
748
+ interface EditAction<EntityType extends BaseEntityType<EntityType>> {
749
+ /**
750
+ * The name of the action.
751
+ */
752
+ displayName: string;
753
+ /**
754
+ * The action itself.
755
+ */
756
+ action: ((entity: EntityType, entityPriorChanges: EntityType) => unknown) | ((entity: EntityType, entityPriorChanges: EntityType) => Promise<unknown>);
757
+ /**
758
+ * A method that defines whether or not the action can be used.
759
+ * @default () => true
760
+ */
761
+ enabled?: (e: EntityType) => boolean;
762
+ /**
763
+ * A method that defines whether or not a confirm dialog is needed to run the action.
764
+ * @default false
765
+ */
766
+ requireConfirmDialog?: (e: EntityType) => boolean;
767
+ /**
768
+ * The data used to generate a confirmation dialog for the action.
769
+ */
770
+ confirmDialogData?: ConfirmDialogData;
771
+ }
772
+ /**
773
+ * The data of the default edit-dialog or page.
774
+ */
775
+ interface EditData<EntityType extends BaseEntityType<EntityType>> {
776
+ /**
777
+ * The title of the default edit-dialog.
778
+ */
779
+ title?: (entity: EntityType) => string;
780
+ /**
781
+ * The label on the confirm-button of the default edit-dialog or page. Defaults to "Save".
782
+ */
783
+ confirmButtonLabel?: string;
784
+ /**
785
+ * The label on the delete-button of the default edit-dialog or page. Defaults to "Delete".
786
+ */
787
+ deleteButtonLabel?: string;
788
+ /**
789
+ * The label on the cancel-button for the default edit-dialog or page. Defaults to "Cancel".
790
+ */
791
+ cancelButtonLabel?: string;
792
+ /**
793
+ * Whether or not the deletion of an entry should require a confirm dialog.
794
+ */
795
+ deleteRequiresConfirmDialog?: boolean;
796
+ /**
797
+ * Whether or not the editing of an entry should require a confirm dialog.
798
+ */
799
+ editRequiresConfirmDialog?: boolean;
800
+ /**
801
+ * The data used to generate a confirmation dialog for the delete action.
802
+ */
803
+ confirmDeleteDialogData?: ConfirmDialogData;
804
+ /**
805
+ * The data used to generate a confirmation dialog for the edit action.
806
+ */
807
+ confirmEditDialogData?: ConfirmDialogData;
808
+ /**
809
+ * Whether or not cancelling with unsaved changes should require a confirm dialog.
810
+ */
811
+ unsavedChangesRequireConfirmDialog?: boolean;
812
+ /**
813
+ * The data used to generate a confirmation dialog for the cancel with unsaved changes action.
814
+ */
815
+ confirmUnsavedChangesDialogData?: ConfirmDialogData;
816
+ /**
817
+ * The label of the actions button.
818
+ */
819
+ actionsLabel?: string;
820
+ /**
821
+ * All actions of the edit page/dialog.
822
+ */
823
+ actions?: EditAction<EntityType>[];
824
+ }
825
+ /**
826
+ * All the configuration data required to display a ngx-mat-entity-table.
827
+ */
828
+ interface TableData<EntityType extends BaseEntityType<EntityType>> {
829
+ /**
830
+ * The base data for the table-component.
831
+ * Includes stuff like the title for the table, what to display inside the rows etc.
832
+ */
833
+ baseData: BaseData<EntityType>;
834
+ /**
835
+ * The data for the default create-dialog.
836
+ * Can be omitted when specifying a custom "create" method inside the baseData.
837
+ */
838
+ createData?: CreateData;
839
+ /**
840
+ * The data for the default edit-dialog.
841
+ * Can be omitted when specifying a custom "edit" method inside the baseData.
842
+ */
843
+ editData?: EditData<EntityType>;
844
+ }
845
+
846
+ /**
847
+ * The internal CreateData. Requires all default values the user can leave out.
848
+ */
849
+ declare class CreateDataInternal implements CreateData {
850
+ title: string;
851
+ createButtonLabel: string;
852
+ cancelButtonLabel: string;
853
+ createRequiresConfirmDialog: boolean;
854
+ confirmCreateDialogData: ConfirmDialogDataInternal;
855
+ unsavedChangesRequireConfirmDialog: boolean;
856
+ confirmUnsavedChangesDialogData: ConfirmDialogData;
857
+ constructor(title: string, createButtonLabel: string, cancelButtonLabel: string, createRequiresConfirmDialog: boolean, confirmCreateDialogData: ConfirmDialogDataInternal, unsavedChangesRequireConfirmDialog: boolean, confirmUnsavedChangesDialogData: ConfirmDialogDataInternal);
858
+ }
859
+
860
+ /**
861
+ * The Definition of the Create Entity Data.
862
+ */
863
+ interface CreateEntityData<EntityType extends BaseEntityType<EntityType>> {
864
+ /**
865
+ * An empty entity that is used as the data model.
866
+ */
867
+ entity: EntityType;
868
+ /**
869
+ * The Entity Service class used for the create request.
870
+ */
871
+ EntityServiceClass: EntityServiceClassNewable<EntityType>;
872
+ /**
873
+ * The info of the generic create-dialog or page.
874
+ */
875
+ createData?: CreateData;
876
+ }
877
+
878
+ /**
879
+ * The internal CreateEntityDialogData. Requires all default values the user can leave out.
880
+ */
881
+ declare class CreateEntityDataInternal<EntityType extends BaseEntityType<EntityType>> implements CreateEntityData<EntityType> {
882
+ entity: EntityType;
883
+ EntityServiceClass: EntityServiceClassNewable<EntityType>;
884
+ createData: CreateDataInternal;
885
+ constructor(entity: EntityType, EntityServiceClass: EntityServiceClassNewable<EntityType>, createData: CreateDataInternal);
886
+ }
887
+
888
+ type PageCreateDataInternal<EntityType extends BaseEntityType<EntityType>> = Omit<CreateEntityDataInternal<EntityType>, 'entity' | 'EntityServiceClass'> & {
889
+ displayLoadingSpinner: boolean;
890
+ createData: CreateDataInternal & {
891
+ confirmUnsavedChangesDialogData: ConfirmDialogDataInternal;
892
+ unsavedChangesRequireConfirmDialog: boolean;
893
+ };
894
+ };
895
+
896
+ /**
897
+ * Interface definition for a page that can work with the UnsavedChangesGuard.
898
+ */
899
+ interface UnsavedChangesPage {
900
+ /**
901
+ * Whether the page can be left without confirmation of unsaved changes.
902
+ * @returns Whether or not the page can be left without confirmation.
903
+ */
904
+ canDeactivate: () => boolean;
905
+ /**
906
+ * Opens the confirm dialog for navigating with unsaved changes.
907
+ * @returns The the promise boolean result of the confirm dialog.
908
+ */
909
+ openConfirmNavigationDialog: () => Promise<boolean>;
910
+ }
911
+ /**
912
+ * A guard that checks if the user has unsaved changes and then prompts a confirmation from him.
913
+ * Is used by the ngx-material-entity edit and create pages.
914
+ * @param component - The component, can be either an edit or create page.
915
+ * @returns An observable containing whether or not the user can continue.
916
+ */
917
+ declare const UnsavedChangesGuard: CanDeactivateFn<UnsavedChangesPage>;
918
+
919
+ /**
920
+ * The definition for a dropdown value.
921
+ * Consists of the name to display in the dropdown and the actual value.
922
+ */
923
+ interface DropdownValue<T> {
924
+ /**
925
+ * The name to display in the dropdown.
926
+ */
927
+ displayName: string;
928
+ /**
929
+ * The actual value.
930
+ */
931
+ value: T;
932
+ }
933
+
934
+ /**
935
+ * Helper type for hours and minutes.
936
+ */
937
+ type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
938
+ /**
939
+ * Helper type for hours and minutes.
940
+ */
941
+ type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
942
+ /**
943
+ * The possible hour values. Ranges from 0 to 23.
944
+ */
945
+ type Hour = Range<0, 24>;
946
+ /**
947
+ * The possible minute values. Ranges from 0 to 59.
948
+ */
949
+ type Minute = Range<0, 60>;
950
+ /**
951
+ * Represents a time value with hours and minutes.
952
+ */
953
+ type Time = {
954
+ /**
955
+ * The hours in the 24 hour format.
956
+ */
957
+ hours: Hour;
958
+ /**
959
+ * The minutes of the time.
960
+ */
961
+ minutes: Minute;
962
+ };
963
+ /**
964
+ * Valid steps from one time value to the next. Needs to be able to divide 60 minutes without remainder.
965
+ */
966
+ type MinuteSteps = 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30 | 60;
967
+ /**
968
+ * Contains Helper Functions for handling date properties.
969
+ */
970
+ declare abstract class DateUtilities {
971
+ /**
972
+ * The default filter function to user when none was provided by the user.
973
+ */
974
+ static defaultDateFilter: DateFilterFn<Date | null | undefined>;
975
+ /**
976
+ * Gets the given value as a date value.
977
+ * @param value - The value to get as a date.
978
+ * @returns The given value as a date.
979
+ */
980
+ static asDate(value: unknown): Date;
981
+ /**
982
+ * Gets the default times used by the DateTime picker when nothing is specified by the user.
983
+ * @param format - The time format. Defaults to 24.
984
+ * @param minuteSteps - The steps from one time value to the next. Defaults to 30.
985
+ * @returns Times in the 24 hour format from 0:00 until 23:30 in 30 minute steps.
986
+ */
987
+ static getDefaultTimes(format?: 12 | 24, minuteSteps?: MinuteSteps): DropdownValue<Time>[];
988
+ private static getTimeDropdownValue;
989
+ private static getFormattedHour;
990
+ private static getFormattedMinute;
991
+ /**
992
+ * Gets the Time object from the given date.
993
+ * @param value - The date to get the time object from.
994
+ * @returns The Time object build from the date value.
995
+ */
996
+ static getTimeFromDate(value?: Date): Time | undefined;
997
+ /**
998
+ * Gets the dates between the two given gates. Does additional filtering based on the provided DateRange metadata.
999
+ * @param startDate - The start date.
1000
+ * @param endDate - The end date.
1001
+ * @param filter - The custom filter from the metadata.
1002
+ * @returns All dates between the two provided dates. Includes start and end date.
1003
+ */
1004
+ static getDatesBetween(startDate: Date, endDate: Date, filter?: DateFilterFn<Date>): Date[];
1005
+ /**
1006
+ * Get all valid times for the dropdown of a datetime property.
1007
+ * @param times - All given times to filter.
1008
+ * @param date - The date of the datetime.
1009
+ * @param min - The function that defines the minimum time.
1010
+ * @param max - The function that defines the maximum time.
1011
+ * @param filter - A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
1012
+ * @returns All valid dropdown values for the datetime property.
1013
+ */
1014
+ static getValidTimesForDropdown(times: DropdownValue<Time | undefined>[], date?: Date, min?: (date?: Date) => Time, max?: (date?: Date) => Time, filter?: ((time: Time) => boolean) | (() => boolean)): DropdownValue<Time | undefined>[];
1015
+ /**
1016
+ * Checks if the time object has processable hours and minutes properties.
1017
+ * Doesn't check custom validators like min/max from the metadata configuration.
1018
+ * @param time - The time to check.
1019
+ * @returns Whether or not the time object is unprocessable.
1020
+ */
1021
+ static timeIsUnprocessable(time?: Time): boolean;
1022
+ }
1023
+
1024
+ /**
1025
+ * A bootstrap column value (a range from 1 - 12).
1026
+ */
1027
+ type Col = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
1028
+ /**
1029
+ * The base options for all propertyDecorators.
1030
+ */
1031
+ declare abstract class PropertyDecoratorConfig<ValueType> {
1032
+ /**
1033
+ * Whether or not the Property is displayed at all.
1034
+ * @default true
1035
+ */
1036
+ display?: boolean | ((entity: any) => boolean);
1037
+ /**
1038
+ * The name of the property used as a label for form fields.
1039
+ */
1040
+ displayName: string;
1041
+ /**
1042
+ * Whether or not the Property is required.
1043
+ * @default true
1044
+ */
1045
+ required?: boolean | ((entity: any) => boolean);
1046
+ /**
1047
+ * Whether or not the property gets omitted when creating new Entities.
1048
+ * @default false
1049
+ */
1050
+ omitForCreate?: boolean;
1051
+ /**
1052
+ * Whether or not the property gets omitted when updating Entities.
1053
+ * @default false
1054
+ */
1055
+ omitForUpdate?: boolean;
1056
+ /**
1057
+ * Defines the width of the input property when used inside the default create or edit dialog.
1058
+ * Has 3 values for different breakpoints for simple responsive design based on bootstrap (1-12).
1059
+ * The first value sets the columns for the screen size lg, the second for md and the third for sm.
1060
+ * @default [6, 6, 12]
1061
+ */
1062
+ defaultWidths?: [Col, Col, Col];
1063
+ /**
1064
+ * Specifies the how to position this property when using default create/edit dialogs.
1065
+ * @default { row: -1, order: -1} (Adds the property at the end)
1066
+ */
1067
+ position?: Position;
1068
+ /**
1069
+ * Whether or not this property is readonly.
1070
+ * Can either be a boolean or a function returning a boolean.
1071
+ */
1072
+ isReadOnly?: boolean | ((entity: any) => boolean);
1073
+ /**
1074
+ * The value that the property should be prefilled with. Only active in create mode.
1075
+ */
1076
+ default?: ValueType | (() => ValueType);
1077
+ /**
1078
+ * A function that runs just before the inputChangeEvent every time the property is changed.
1079
+ */
1080
+ change?: (entity: any) => void;
1081
+ }
1082
+ /**
1083
+ * The options for positioning a property when using default create/edit dialogs.
1084
+ */
1085
+ interface Position {
1086
+ /**
1087
+ * Specifies a tab in which this property is displayed.
1088
+ * If no property has the tab metadata specified no tabs are displayed.
1089
+ * Ordering is ascending.
1090
+ * @default -1 (sets this property in the first tab)
1091
+ */
1092
+ tab?: number;
1093
+ /**
1094
+ * Specifies the name of the tab. Can only be set by one property in each tab.
1095
+ * Requires "tab" to be set.
1096
+ * @default `Tab ${numberOfTheTab}`
1097
+ */
1098
+ tabName?: string;
1099
+ /**
1100
+ * Specifies the row in which this property is displayed.
1101
+ * Ordering is ascending.
1102
+ * @default -1 (sets this property after the last row)
1103
+ */
1104
+ row?: number;
1105
+ /**
1106
+ * Specifies order of the input property inside the specified row.
1107
+ * Ordering is ascending.
1108
+ * @default -1 (sets this property at the end of the row)
1109
+ */
1110
+ order?: number;
1111
+ }
1112
+
1113
+ /**
1114
+ * This is the needed type for an property that should be displayed as a date range.
1115
+ */
1116
+ interface DateRange {
1117
+ /**
1118
+ * The start date of the range.
1119
+ */
1120
+ start: Date;
1121
+ /**
1122
+ * The end date of the range.
1123
+ */
1124
+ end: Date;
1125
+ /**
1126
+ * The actual Date values. These are needed if the date range might contain some values that are disabled.
1127
+ * E.g. When you build a tool to request vacation you may want the user to select 3 weeks in the range picker
1128
+ * but don't want the weekend dates in the final result.
1129
+ */
1130
+ values: Date[];
1131
+ }
1132
+ /**
1133
+ * Definition for the @date metadata.
1134
+ */
1135
+ declare abstract class DateDecoratorConfig<ValueType> extends PropertyDecoratorConfig<ValueType> {
1136
+ /**
1137
+ * How to display the date.
1138
+ */
1139
+ displayStyle: 'date' | 'datetime' | 'daterange';
1140
+ }
1141
+ /**
1142
+ * The configuration options for a date property displayed as a default single date picker.
1143
+ */
1144
+ interface DefaultDateDecoratorConfig extends DateDecoratorConfig<Date> {
1145
+ displayStyle: 'date';
1146
+ /**
1147
+ * A function to get the minimum value of the date.
1148
+ */
1149
+ min?: (date?: Date) => Date;
1150
+ /**
1151
+ * A function to get the maximum value of the date.
1152
+ */
1153
+ max?: (date?: Date) => Date;
1154
+ /**
1155
+ * A filter function to do more specific filtering. This could be the removal of e.g. All weekends.
1156
+ */
1157
+ filter?: DateFilterFn<Date | null | undefined>;
1158
+ }
1159
+ /**
1160
+ * The configuration options for a date property displayed as a date range.
1161
+ */
1162
+ interface DateRangeDateDecoratorConfig extends DateDecoratorConfig<DateRange> {
1163
+ displayStyle: 'daterange';
1164
+ /**
1165
+ * A function to get the minimum value of the start date.
1166
+ */
1167
+ minStart?: (date?: Date) => Date;
1168
+ /**
1169
+ * A function to get the maximum value of the start date.
1170
+ */
1171
+ maxStart?: (date?: Date) => Date;
1172
+ /**
1173
+ * A function to get the minimum value of the end date.
1174
+ */
1175
+ minEnd?: (date?: Date) => Date;
1176
+ /**
1177
+ * A function to get the maximum value of the end date.
1178
+ */
1179
+ maxEnd?: (date?: Date) => Date;
1180
+ /**
1181
+ * A filter function to do more specific filtering on the disallowed end date values. This could be the removal of e.g. All weekends.
1182
+ */
1183
+ filter?: DateFilterFn<Date>;
1184
+ /**
1185
+ * The placeholder for the start date of the date range picker.
1186
+ * @default "Start"
1187
+ */
1188
+ placeholderStart?: string;
1189
+ /**
1190
+ * The placeholder for the end date of the date range picker.
1191
+ * @default "End"
1192
+ */
1193
+ placeholderEnd?: string;
1194
+ }
1195
+ /**
1196
+ * The configuration options for a date property displayed as date time.
1197
+ */
1198
+ interface DateTimeDateDecoratorConfig extends DateDecoratorConfig<Date> {
1199
+ displayStyle: 'datetime';
1200
+ /**
1201
+ * The selectable times.
1202
+ */
1203
+ times?: DropdownValue<Time | undefined>[];
1204
+ /**
1205
+ * The name to use as a label for the time form field.
1206
+ * @default 'Time'
1207
+ */
1208
+ timeDisplayName?: string;
1209
+ /**
1210
+ * A function to get the minimum value of the date.
1211
+ */
1212
+ minDate?: (date?: Date) => Date;
1213
+ /**
1214
+ * A function to get the maximum value of the date.
1215
+ */
1216
+ maxDate?: (date?: Date) => Date;
1217
+ /**
1218
+ * A filter function to do more specific date filtering. This could be the removal of e.g. All weekends.
1219
+ */
1220
+ filterDate?: DateFilterFn<Date | null | undefined>;
1221
+ /**
1222
+ * A function to get the minimum value of the time.
1223
+ */
1224
+ minTime?: (date?: Date) => Time;
1225
+ /**
1226
+ * A function to get the maximum value of the time.
1227
+ */
1228
+ maxTime?: (date?: Date) => Time;
1229
+ /**
1230
+ * A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
1231
+ */
1232
+ filterTime?: ((time: Time) => boolean) | (() => boolean);
1233
+ }
1234
+
1235
+ type StringDropdownValues = DropdownValue<string | undefined>[] | ((entity: any) => DropdownValue<string | undefined>[]) | ((entity: any) => Promise<DropdownValue<string | undefined>[]>);
1236
+ type StringAutocompleteValues = string[] | ((entity: any) => string[]) | ((entity: any) => Promise<string[]>);
1237
+ /**
1238
+ * Definition for the @string metadata.
1239
+ */
1240
+ declare abstract class StringDecoratorConfig extends PropertyDecoratorConfig<string> {
1241
+ /**
1242
+ * How to display the string.
1243
+ */
1244
+ displayStyle: 'line' | 'textbox' | 'autocomplete' | 'dropdown' | 'password';
1245
+ }
1246
+ /**
1247
+ * The configuration options for a string property displayed as a dropdown.
1248
+ */
1249
+ interface DropdownStringDecoratorConfig extends StringDecoratorConfig {
1250
+ displayStyle: 'dropdown';
1251
+ /**
1252
+ * The values of the dropdown, consisting of a name to display and the actual value
1253
+ * Can also receive a function to determine the values.
1254
+ */
1255
+ dropdownValues: StringDropdownValues;
1256
+ }
1257
+ /**
1258
+ * The configuration options for a string property displayed in a default text input.
1259
+ */
1260
+ interface DefaultStringDecoratorConfig extends StringDecoratorConfig {
1261
+ displayStyle: 'line';
1262
+ /**
1263
+ * The minimum required length of the string.
1264
+ */
1265
+ minLength?: number;
1266
+ /**
1267
+ * The maximum required length of the string.
1268
+ */
1269
+ maxLength?: number;
1270
+ /**
1271
+ * A regex used for validation.
1272
+ */
1273
+ regex?: RegExp;
1274
+ }
1275
+ /**
1276
+ * The configuration options for a string property displayed in a textbox input.
1277
+ */
1278
+ interface TextboxStringDecoratorConfig extends StringDecoratorConfig {
1279
+ displayStyle: 'textbox';
1280
+ /**
1281
+ * The minimum required length of the string.
1282
+ */
1283
+ minLength?: number;
1284
+ /**
1285
+ * The maximum required length of the string.
1286
+ */
1287
+ maxLength?: number;
1288
+ }
1289
+ /**
1290
+ * The configuration options for a string property displayed in a mat-autocomplete input.
1291
+ */
1292
+ interface AutocompleteStringDecoratorConfig extends StringDecoratorConfig {
1293
+ displayStyle: 'autocomplete';
1294
+ /**
1295
+ * The autocomplete values.
1296
+ */
1297
+ autocompleteValues: StringAutocompleteValues;
1298
+ /**
1299
+ * The minimum required length of the string.
1300
+ */
1301
+ minLength?: number;
1302
+ /**
1303
+ * The maximum required length of the string.
1304
+ */
1305
+ maxLength?: number;
1306
+ /**
1307
+ * A regex used for validation.
1308
+ */
1309
+ regex?: RegExp;
1310
+ /**
1311
+ * Whether or not valid inputs should be restricted to the autocomplete options.
1312
+ */
1313
+ restrictToOptions?: boolean;
1314
+ }
1315
+ /**
1316
+ * The configuration options for a string property displayed in a password input.
1317
+ */
1318
+ interface PasswordStringDecoratorConfig extends StringDecoratorConfig {
1319
+ displayStyle: 'password';
1320
+ /**
1321
+ * The minimum required length of the password.
1322
+ */
1323
+ minLength?: number;
1324
+ /**
1325
+ * The maximum required length of the password.
1326
+ */
1327
+ maxLength?: number;
1328
+ /**
1329
+ * A regex used for validation.
1330
+ */
1331
+ regex?: RegExp;
1332
+ /**
1333
+ * Whether or not the password needs to be retyped.
1334
+ * @default true
1335
+ */
1336
+ needsConfirmation?: boolean;
1337
+ /**
1338
+ * Whether or not the password strength should be displayed.
1339
+ * @default true
1340
+ */
1341
+ displayPasswordStrength?: boolean;
1342
+ /**
1343
+ * The display name of the confirmation password input.
1344
+ * @default 'Confirm Password'
1345
+ */
1346
+ confirmationDisplayName?: string;
1347
+ }
1348
+
1349
+ /**
1350
+ * Base definition for the @array metadata.
1351
+ */
1352
+ declare abstract class ArrayDecoratorConfig<ValueType> extends PropertyDecoratorConfig<ValueType> {
1353
+ /**
1354
+ * The type of the items inside the array.
1355
+ */
1356
+ itemType: DecoratorTypes;
1357
+ /**
1358
+ * Whether or not duplicate values are allowed inside the array.
1359
+ * @default false
1360
+ */
1361
+ allowDuplicates?: boolean;
1362
+ /**
1363
+ * The error dialog to display when the user tries to add a duplicate entry.
1364
+ */
1365
+ duplicatesErrorDialog?: ConfirmDialogData;
1366
+ }
1367
+ /**
1368
+ * Base definition for the @array table metadata.
1369
+ */
1370
+ declare abstract class ArrayTableDecoratorConfig<ValueType> extends ArrayDecoratorConfig<ValueType[]> {
1371
+ /**
1372
+ * The definition of the columns to display. Consists of the displayName to show in the header of the row
1373
+ * and the value, which is a function that generates the value to display inside a column.
1374
+ */
1375
+ displayColumns: DisplayColumn<ValueType>[];
1376
+ /**
1377
+ * Configuration for css classes that should be applied to table rows based on a condition.
1378
+ * This could be used to eg. Set the background color to green when an item has the status completed etc.
1379
+ * INFO: You need to use ng-deep or apply the styling in the styles.scss.
1380
+ * @default () => []
1381
+ */
1382
+ dynamicRowStyleClasses?: DynamicStyleClasses<ValueType>;
1383
+ /**
1384
+ * The error-message to display when the array is required but contains no values.
1385
+ */
1386
+ missingErrorMessage?: string;
1387
+ /**
1388
+ * The label for the add button.
1389
+ * @default 'Add'
1390
+ */
1391
+ addButtonLabel?: string;
1392
+ /**
1393
+ * The label for the remove button.
1394
+ * @default 'Remove'
1395
+ */
1396
+ removeButtonLabel?: string;
1397
+ }
1398
+ /**
1399
+ * The dialog data for the entities array edit dialog.
1400
+ */
1401
+ interface EditArrayItemDialogData<EntityType extends BaseEntityType<EntityType>> {
1402
+ /**
1403
+ * The title of the default edit-dialog.
1404
+ */
1405
+ title?: (entity: EntityType) => string;
1406
+ /**
1407
+ * The label on the confirm-button of the default edit-dialog or page. Defaults to "Save".
1408
+ */
1409
+ confirmButtonLabel?: string;
1410
+ /**
1411
+ * The label on the cancel-button for the default edit-dialog or page. Defaults to "Cancel".
1412
+ */
1413
+ cancelButtonLabel?: string;
1414
+ }
1415
+ /**
1416
+ * Definition for an array of Entities.
1417
+ */
1418
+ interface EntityArrayDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends ArrayTableDecoratorConfig<EntityType> {
1419
+ itemType: DecoratorTypes.OBJECT;
1420
+ /**
1421
+ * The EntityClass used for generating the create inputs.
1422
+ */
1423
+ EntityClass: EntityClassNewable<EntityType>;
1424
+ /**
1425
+ * The data for the add-item-dialog.
1426
+ * Can be omitted when adding items inline.
1427
+ */
1428
+ createDialogData?: CreateData;
1429
+ /**
1430
+ * The data for the edit-item-dialog.
1431
+ * Can be omitted when adding items inline.
1432
+ */
1433
+ editDialogData?: EditArrayItemDialogData<EntityType>;
1434
+ /**
1435
+ * Whether or not the form for adding items to the array
1436
+ * should be displayed inline.
1437
+ * @default true
1438
+ */
1439
+ createInline?: boolean;
1440
+ }
1441
+ /**
1442
+ * Definition for an array of Dates.
1443
+ */
1444
+ interface DateArrayDecoratorConfig extends ArrayTableDecoratorConfig<Date> {
1445
+ itemType: DecoratorTypes.DATE;
1446
+ /**
1447
+ * A function to get the minimum value of the date.
1448
+ */
1449
+ min?: (date?: Date) => Date;
1450
+ /**
1451
+ * A function to get the maximum value of the date.
1452
+ */
1453
+ max?: (date?: Date) => Date;
1454
+ /**
1455
+ * A filter function to do more specific filtering. This could be the removal of e.g. All weekends.
1456
+ */
1457
+ filter?: DateFilterFn<Date | null | undefined>;
1458
+ }
1459
+ /**
1460
+ * Definition for an array of DateTimes.
1461
+ */
1462
+ interface DateTimeArrayDecoratorConfig extends ArrayTableDecoratorConfig<Date> {
1463
+ itemType: DecoratorTypes.DATE_TIME;
1464
+ /**
1465
+ * The selectable times.
1466
+ */
1467
+ times?: DropdownValue<Time>[];
1468
+ /**
1469
+ * The name to use as a label for the time form field.
1470
+ * @default 'Time'
1471
+ */
1472
+ timeDisplayName?: string;
1473
+ /**
1474
+ * A function to get the minimum value of the date.
1475
+ */
1476
+ minDate?: (date?: Date) => Date;
1477
+ /**
1478
+ * A function to get the maximum value of the date.
1479
+ */
1480
+ maxDate?: (date?: Date) => Date;
1481
+ /**
1482
+ * A filter function to do more specific date filtering. This could be the removal of e.g. All weekends.
1483
+ */
1484
+ filterDate?: DateFilterFn<Date | null | undefined>;
1485
+ /**
1486
+ * A function to get the minimum value of the time.
1487
+ */
1488
+ minTime?: (date?: Date) => Time;
1489
+ /**
1490
+ * A function to get the maximum value of the time.
1491
+ */
1492
+ maxTime?: (date?: Date) => Time;
1493
+ /**
1494
+ * A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
1495
+ */
1496
+ filterTime?: ((time: Time) => boolean) | (() => boolean);
1497
+ }
1498
+ /**
1499
+ * Definition for an array of DateRanges.
1500
+ */
1501
+ interface DateRangeArrayDecoratorConfig extends ArrayTableDecoratorConfig<DateRange> {
1502
+ itemType: DecoratorTypes.DATE_RANGE;
1503
+ /**
1504
+ * A function to get the minimum value of the start date.
1505
+ */
1506
+ minStart?: (date?: Date) => Date;
1507
+ /**
1508
+ * A function to get the maximum value of the start date.
1509
+ */
1510
+ maxStart?: (date?: Date) => Date;
1511
+ /**
1512
+ * A function to get the minimum value of the end date.
1513
+ */
1514
+ minEnd?: (date?: Date) => Date;
1515
+ /**
1516
+ * A function to get the maximum value of the end date.
1517
+ */
1518
+ maxEnd?: (date?: Date) => Date;
1519
+ /**
1520
+ * A filter function to do more specific filtering on the disallowed end date values. This could be the removal of e.g. All weekends.
1521
+ */
1522
+ filter?: DateFilterFn<Date>;
1523
+ /**
1524
+ * The placeholder for the start date of the date range picker.
1525
+ * @default "Start"
1526
+ */
1527
+ placeholderStart?: string;
1528
+ /**
1529
+ * The placeholder for the end date of the date range picker.
1530
+ * @default "End"
1531
+ */
1532
+ placeholderEnd?: string;
1533
+ }
1534
+ /**
1535
+ * Definition for an array of strings displayed as a chips list.
1536
+ */
1537
+ interface StringChipsArrayDecoratorConfig extends ArrayDecoratorConfig<string[]> {
1538
+ itemType: DecoratorTypes.STRING;
1539
+ /**
1540
+ * The font awesome icon used to remove an entry from the array.
1541
+ * @default faCircleMinus
1542
+ */
1543
+ deleteIcon?: IconDefinition;
1544
+ /**
1545
+ * The minimum required length of the string.
1546
+ */
1547
+ minLength?: number;
1548
+ /**
1549
+ * The maximum required length of the string.
1550
+ */
1551
+ maxLength?: number;
1552
+ /**
1553
+ * A regex used for validation.
1554
+ */
1555
+ regex?: RegExp;
1556
+ }
1557
+ /**
1558
+ * Definition for an array of autocomplete strings displayed as a chips list.
1559
+ */
1560
+ interface AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecoratorConfig<string[]> {
1561
+ itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
1562
+ /**
1563
+ * The icon used to remove an entry from the array.
1564
+ * @default faCircleMinus
1565
+ */
1566
+ deleteIcon?: IconDefinition;
1567
+ /**
1568
+ * The autocomplete values.
1569
+ */
1570
+ autocompleteValues: StringAutocompleteValues;
1571
+ /**
1572
+ * The minimum required length of the string.
1573
+ */
1574
+ minLength?: number;
1575
+ /**
1576
+ * The maximum required length of the string.
1577
+ */
1578
+ maxLength?: number;
1579
+ /**
1580
+ * A regex used for validation.
1581
+ */
1582
+ regex?: RegExp;
1583
+ /**
1584
+ * Whether or not valid inputs should be restricted to the autocomplete options.
1585
+ * @default false
1586
+ */
1587
+ restrictToOptions?: boolean;
1588
+ }
1589
+
1590
+ /**
1591
+ * The internal Position. Sets default values and validates user input.
1592
+ */
1593
+ declare class PositionInternal implements Position {
1594
+ row: number;
1595
+ order: number;
1596
+ tab: number;
1597
+ tabName?: string;
1598
+ constructor(data?: Position);
1599
+ private validateInput;
1600
+ }
1601
+ /**
1602
+ * The internal PropertyDecoratorConfig. Sets default values.
1603
+ */
1604
+ declare abstract class PropertyDecoratorConfigInternal<ValueType> implements PropertyDecoratorConfig<ValueType> {
1605
+ display: (entity: unknown) => boolean;
1606
+ displayName: string;
1607
+ required: ((entity: unknown) => boolean);
1608
+ omitForCreate: boolean;
1609
+ omitForUpdate: boolean;
1610
+ defaultWidths: [Col, Col, Col];
1611
+ position: PositionInternal;
1612
+ isReadOnly: (entity: unknown) => boolean;
1613
+ default?: () => ValueType;
1614
+ change?: (entity: unknown) => void;
1615
+ constructor(data: PropertyDecoratorConfig<ValueType>);
1616
+ /**
1617
+ * Converts the default value to a function or undefined.
1618
+ * @param value - The default value provided by the metadata.
1619
+ * @returns A function that returns a default value or undefined.
1620
+ */
1621
+ protected defaultToFunction(value?: ValueType | (() => ValueType)): (() => ValueType) | undefined;
1622
+ /**
1623
+ * Converts the given boolean or boolean function to a boolean function.
1624
+ * @param value - The value to convert.
1625
+ * @returns A function that resolves to a boolean.
1626
+ */
1627
+ protected booleanToFunction(value: boolean | ((entity: unknown) => boolean)): (entity: unknown) => boolean;
1628
+ }
1629
+
1630
+ /**
1631
+ * The internal dialog data for the entities array edit dialog.
1632
+ * Sets default values.
1633
+ */
1634
+ declare class EditArrayItemDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements EditArrayItemDialogData<EntityType> {
1635
+ title: (entity: EntityType) => string;
1636
+ confirmButtonLabel: string;
1637
+ cancelButtonLabel: string;
1638
+ constructor(globalConfig: NgxGlobalDefaultValues, data?: EditArrayItemDialogData<EntityType>);
1639
+ }
1640
+ /**
1641
+ * The internal EntityArrayDecoratorConfig. Sets default values.
1642
+ */
1643
+ declare class EntityArrayDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal<EntityType[]> implements EntityArrayDecoratorConfig<EntityType> {
1644
+ itemType: DecoratorTypes.OBJECT;
1645
+ allowDuplicates: boolean;
1646
+ duplicatesErrorDialog: ConfirmDialogData;
1647
+ EntityClass: EntityClassNewable<EntityType>;
1648
+ displayColumns: DisplayColumn<EntityType>[];
1649
+ dynamicRowStyleClasses: DynamicStyleClasses<EntityType>;
1650
+ createDialogData?: CreateData;
1651
+ editDialogData: EditArrayItemDialogDataInternal<EntityType>;
1652
+ createInline: boolean;
1653
+ missingErrorMessage: string;
1654
+ addButtonLabel: string;
1655
+ removeButtonLabel: string;
1656
+ constructor(data: EntityArrayDecoratorConfig<EntityType>, globalConfig: NgxGlobalDefaultValues);
1657
+ }
1658
+ /**
1659
+ * The internal DateArrayDecoratorConfig. Sets default values.
1660
+ */
1661
+ declare class DateArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal<Date[]> implements DateArrayDecoratorConfig {
1662
+ itemType: DecoratorTypes.DATE;
1663
+ allowDuplicates: boolean;
1664
+ duplicatesErrorDialog: ConfirmDialogData;
1665
+ displayColumns: DisplayColumn<Date>[];
1666
+ addButtonLabel: string;
1667
+ removeButtonLabel: string;
1668
+ missingErrorMessage: string;
1669
+ dynamicRowStyleClasses: DynamicStyleClasses<Date>;
1670
+ min?: (date?: Date) => Date;
1671
+ max?: (date?: Date) => Date;
1672
+ filter?: DateFilterFn<Date | null | undefined>;
1673
+ constructor(data: DateArrayDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1674
+ }
1675
+ /**
1676
+ * The internal DateTimeArrayDecoratorConfig. Sets default values.
1677
+ */
1678
+ declare class DateTimeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal<Date[]> implements DateTimeArrayDecoratorConfig {
1679
+ itemType: DecoratorTypes.DATE_TIME;
1680
+ allowDuplicates: boolean;
1681
+ duplicatesErrorDialog: ConfirmDialogData;
1682
+ displayColumns: DisplayColumn<Date>[];
1683
+ addButtonLabel: string;
1684
+ removeButtonLabel: string;
1685
+ missingErrorMessage: string;
1686
+ times: DropdownValue<Time>[];
1687
+ timeDisplayName: string;
1688
+ dynamicRowStyleClasses: DynamicStyleClasses<Date>;
1689
+ minDate?: (date?: Date) => Date;
1690
+ maxDate?: (date?: Date) => Date;
1691
+ filterDate?: DateFilterFn<Date | null | undefined>;
1692
+ minTime?: (date?: Date) => Time;
1693
+ maxTime?: (date?: Date) => Time;
1694
+ filterTime?: ((time: Time) => boolean) | (() => boolean);
1695
+ constructor(data: DateTimeArrayDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1696
+ }
1697
+ /**
1698
+ * The internal DateRangeArrayDecoratorConfig. Sets default values.
1699
+ */
1700
+ declare class DateRangeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal<DateRange[]> implements DateRangeArrayDecoratorConfig {
1701
+ itemType: DecoratorTypes.DATE_RANGE;
1702
+ allowDuplicates: boolean;
1703
+ duplicatesErrorDialog: ConfirmDialogData;
1704
+ displayColumns: DisplayColumn<DateRange>[];
1705
+ addButtonLabel: string;
1706
+ removeButtonLabel: string;
1707
+ missingErrorMessage: string;
1708
+ placeholderStart: string;
1709
+ placeholderEnd: string;
1710
+ dynamicRowStyleClasses: DynamicStyleClasses<DateRange>;
1711
+ minStart?: (date?: Date) => Date;
1712
+ maxStart?: (date?: Date) => Date;
1713
+ minEnd?: (date?: Date) => Date;
1714
+ maxEnd?: (date?: Date) => Date;
1715
+ filter?: DateFilterFn<Date>;
1716
+ constructor(data: DateRangeArrayDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1717
+ }
1718
+ /**
1719
+ * The internal StringChipsArrayDecoratorConfig. Sets default values.
1720
+ */
1721
+ declare class StringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string[]> implements StringChipsArrayDecoratorConfig {
1722
+ itemType: DecoratorTypes.STRING;
1723
+ allowDuplicates: boolean;
1724
+ duplicatesErrorDialog: ConfirmDialogData;
1725
+ deleteIcon: IconDefinition;
1726
+ minLength?: number;
1727
+ maxLength?: number;
1728
+ regex?: RegExp;
1729
+ constructor(data: StringChipsArrayDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1730
+ }
1731
+ /**
1732
+ * The internal AutocompleteStringChipsArrayDecoratorConfig. Sets default values.
1733
+ */
1734
+ declare class AutocompleteStringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string[]> implements AutocompleteStringChipsArrayDecoratorConfig {
1735
+ autocompleteValues: (entity: any) => Promise<string[]>;
1736
+ itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
1737
+ allowDuplicates: boolean;
1738
+ duplicatesErrorDialog: ConfirmDialogData;
1739
+ deleteIcon: IconDefinition;
1740
+ minLength?: number;
1741
+ maxLength?: number;
1742
+ regex?: RegExp;
1743
+ restrictToOptions?: boolean;
1744
+ constructor(data: AutocompleteStringChipsArrayDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1745
+ private autocompleteValuesToFunction;
1746
+ }
1747
+
1748
+ /**
1749
+ * The Definition for the @boolean metadata.
1750
+ */
1751
+ declare abstract class BooleanDecoratorConfig extends PropertyDecoratorConfig<boolean> {
1752
+ /**
1753
+ * Whether to display the booleans as a checkbox, a toggle button or as a dropdown.
1754
+ */
1755
+ displayStyle: 'checkbox' | 'dropdown' | 'toggle';
1756
+ }
1757
+ /**
1758
+ * The configuration options for a boolean property displayed in a dropdown.
1759
+ */
1760
+ interface DropdownBooleanDecoratorConfig extends BooleanDecoratorConfig {
1761
+ displayStyle: 'dropdown';
1762
+ /**
1763
+ * The name of the true value if displayStyle dropdown is used.
1764
+ * @default 'Yes'
1765
+ */
1766
+ dropdownTrue?: string;
1767
+ /**
1768
+ * The name of the false value if displayStyle dropdown is used.
1769
+ * @default 'No'
1770
+ */
1771
+ dropdownFalse?: string;
1772
+ }
1773
+ /**
1774
+ * The configuration options for a boolean property displayed as a checkbox.
1775
+ */
1776
+ interface CheckboxBooleanDecoratorConfig extends BooleanDecoratorConfig {
1777
+ displayStyle: 'checkbox';
1778
+ }
1779
+ /**
1780
+ * The configuration options for a boolean property displayed as a mat-toggle.
1781
+ */
1782
+ interface ToggleBooleanDecoratorConfig extends BooleanDecoratorConfig {
1783
+ displayStyle: 'toggle';
1784
+ }
1785
+
1786
+ /**
1787
+ * The internal DropdownBooleanDecoratorConfig. Sets default values.
1788
+ */
1789
+ declare class DropdownBooleanDecoratorConfigInternal extends PropertyDecoratorConfigInternal<boolean> implements DropdownBooleanDecoratorConfig {
1790
+ displayStyle: 'dropdown';
1791
+ dropdownTrue: string;
1792
+ dropdownFalse: string;
1793
+ constructor(data: DropdownBooleanDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1794
+ }
1795
+ /**
1796
+ * The internal CheckboxBooleanDecoratorConfig. Sets default values.
1797
+ */
1798
+ declare class CheckboxBooleanDecoratorConfigInternal extends PropertyDecoratorConfigInternal<boolean> implements CheckboxBooleanDecoratorConfig {
1799
+ displayStyle: 'checkbox';
1800
+ constructor(data: CheckboxBooleanDecoratorConfig);
1801
+ }
1802
+ /**
1803
+ * The internal ToggleBooleanDecoratorConfig. Sets default values.
1804
+ */
1805
+ declare class ToggleBooleanDecoratorConfigInternal extends PropertyDecoratorConfigInternal<boolean> implements ToggleBooleanDecoratorConfig {
1806
+ displayStyle: 'toggle';
1807
+ constructor(data: ToggleBooleanDecoratorConfig);
1808
+ }
1809
+
1810
+ /**
1811
+ * The abstract base class of any ngx-mat-entity input.
1812
+ * Extend from this when implementing your own custom decorator.
1813
+ *
1814
+ * It already provides:
1815
+ *
1816
+ * - entity: The entity which the property is on. (type-safe due to the Generic "EntityType")
1817
+ * - key: The key of the property. (type-safe due to the Generic "EntityType")
1818
+ * - getValidationErrorMessage: The function that generates the error message when the input is invalid.
1819
+ * - isReadOnly: Whether or not the input is read only. Can be used to disable elements.
1820
+ * - propertyValue: Just the typed version of the property, its the same as entity[key].
1821
+ * - metadata: The metadata of the property. (type-safe due to the Generic "CustomMetadataType")
1822
+ * - ngOnInit: Gets the metadata for the property, be aware of this when overriding this method.
1823
+ * - emitChange: Should be called when the input has changed. This is needed to trigger validation and dirty checks.
1824
+ */
1825
+ declare abstract class NgxMatEntityBaseInputComponent<EntityType extends BaseEntityType<EntityType>, Type extends DecoratorTypes, ValueType, CustomMetadataType extends BaseEntityType<CustomMetadataType> = {}> implements OnInit {
1826
+ /**
1827
+ * The entity that the property to display as an input comes from.
1828
+ */
1829
+ entity: EntityType;
1830
+ /**
1831
+ * The key of the property to build the input for.
1832
+ */
1833
+ key: keyof EntityType;
1834
+ /**
1835
+ * The function that generates the error message when the input is invalid.
1836
+ */
1837
+ getValidationErrorMessage: (model: NgModel) => string;
1838
+ /**
1839
+ * Whether or not the input should be readonly.
1840
+ * In that case it is disabled, but most of the disabled-styling is overridden.
1841
+ */
1842
+ isReadOnly: boolean;
1843
+ /**
1844
+ * Emits when the property value has changed.
1845
+ */
1846
+ readonly inputChangeEvent: EventEmitter<void>;
1847
+ /**
1848
+ * The property value of entity[key] correctly typed.
1849
+ * Uses getters and setters so that inputs are always linked to the original value.
1850
+ */
1851
+ get propertyValue(): ValueType | undefined;
1852
+ set propertyValue(value: ValueType | undefined);
1853
+ /**
1854
+ * The metadata of the property.
1855
+ */
1856
+ metadata: DecoratorType<Type, CustomMetadataType>;
1857
+ /**
1858
+ * A unique name for inputs. Includes a uuid.
1859
+ */
1860
+ name: string;
1861
+ ngOnInit(): void;
1862
+ /**
1863
+ * Should emit when the input has changed. This is needed to trigger validation and dirty checks.
1864
+ */
1865
+ emitChange(): void;
1866
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityBaseInputComponent<any, any, any, any>, never>;
1867
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityBaseInputComponent<any, any, any, any>, "ngx-mat-entity-base-input", never, { "entity": { "alias": "entity"; "required": true; }; "key": { "alias": "key"; "required": true; }; "getValidationErrorMessage": { "alias": "getValidationErrorMessage"; "required": true; }; "isReadOnly": { "alias": "isReadOnly"; "required": true; }; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never, true, never>;
1868
+ }
1869
+
1870
+ /**
1871
+ * Definition for a custom property. Use this if the provided decorators don't fit your needs.
1872
+ */
1873
+ interface CustomDecoratorConfig<EntityType extends BaseEntityType<EntityType>, ValueType, CustomMetadataType extends BaseEntityType<CustomMetadataType>, ComponentType extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.CUSTOM, ValueType, CustomMetadataType>> extends PropertyDecoratorConfig<ValueType> {
1874
+ /**
1875
+ * The component to use for this input.
1876
+ */
1877
+ component: Type<ComponentType>;
1878
+ /**
1879
+ * The function that defines whether or not the value is valid.
1880
+ * Used in addition to default checks like required etc.
1881
+ * Needed for the edit and create dialogs.
1882
+ *
1883
+ * TIP: If you need additional data for checking if the value is valid, you can define them as metadata directly on the value.
1884
+ * @default () => true
1885
+ */
1886
+ isValid?: (value: ValueType, omit?: 'create' | 'update') => boolean;
1887
+ /**
1888
+ * The function that defines whether or not two of your custom values are equal.
1889
+ * Needed for the edit and create dialogs.
1890
+ *
1891
+ * TIP: If you need additional data for checking if the value is valid, you can define them as metadata directly on the values.
1892
+ * @default (value: ValueType, valuePriorChanges: ValueType) => LodashUtilities.isEqual(value, valuePriorChanges)
1893
+ */
1894
+ isEqual?: (value: ValueType, valuePriorChanges: ValueType, metadata: CustomDecoratorConfig<EntityType, ValueType, CustomMetadataType, ComponentType>) => boolean;
1895
+ /**
1896
+ * Any custom metadata you want to add to the property.
1897
+ */
1898
+ customMetadata: CustomMetadataType;
1899
+ }
1900
+
1901
+ /**
1902
+ * The internal config for the @custom decorator.
1903
+ * Sets default values.
1904
+ */
1905
+ declare class CustomDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>, ValueType, MetadataType extends BaseEntityType<MetadataType>, ComponentType extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.CUSTOM, ValueType, MetadataType>> extends PropertyDecoratorConfigInternal<ValueType> implements CustomDecoratorConfig<EntityType, ValueType, MetadataType, ComponentType> {
1906
+ component: Type<ComponentType>;
1907
+ isValid: (value: ValueType, omit?: 'create' | 'update') => boolean;
1908
+ isEqual: (value: ValueType, valuePriorChanges: ValueType, metadata: CustomDecoratorConfig<EntityType, ValueType, MetadataType, ComponentType>) => boolean;
1909
+ customMetadata: MetadataType;
1910
+ constructor(data: CustomDecoratorConfig<EntityType, ValueType, MetadataType, ComponentType>);
1911
+ }
1912
+
1913
+ /**
1914
+ * The internal DefaultDateDecoratorConfig. Sets default values.
1915
+ */
1916
+ declare class DefaultDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal<Date> implements DefaultDateDecoratorConfig {
1917
+ displayStyle: 'date';
1918
+ min?: (date?: Date) => Date;
1919
+ max?: (date?: Date) => Date;
1920
+ filter?: DateFilterFn<Date | null | undefined>;
1921
+ constructor(data: DefaultDateDecoratorConfig);
1922
+ }
1923
+ /**
1924
+ * The internal DateRangeDateDecoratorConfig. Sets default values.
1925
+ */
1926
+ declare class DateRangeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal<DateRange> implements DateRangeDateDecoratorConfig {
1927
+ displayStyle: 'daterange';
1928
+ minStart?: (date?: Date) => Date;
1929
+ maxStart?: (date?: Date) => Date;
1930
+ minEnd?: (date?: Date) => Date;
1931
+ maxEnd?: (date?: Date) => Date;
1932
+ filter?: DateFilterFn<Date>;
1933
+ placeholderStart: string;
1934
+ placeholderEnd: string;
1935
+ constructor(data: DateRangeDateDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1936
+ }
1937
+ /**
1938
+ * The internal DateTimeDateDecoratorConfig. Sets default values.
1939
+ */
1940
+ declare class DateTimeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal<Date> implements DateTimeDateDecoratorConfig {
1941
+ displayStyle: 'datetime';
1942
+ times: DropdownValue<Time | undefined>[];
1943
+ timeDisplayName: string;
1944
+ minDate?: (date?: Date) => Date;
1945
+ maxDate?: (date?: Date) => Date;
1946
+ filterDate?: DateFilterFn<Date | null | undefined>;
1947
+ minTime?: (date?: Date) => Time;
1948
+ maxTime?: (date?: Date) => Time;
1949
+ filterTime?: ((time: Time) => boolean) | (() => boolean);
1950
+ constructor(data: DateTimeDateDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
1951
+ }
1952
+
1953
+ /**
1954
+ * The type of a property annotated with @file.
1955
+ */
1956
+ type FileData = FileDataWithFile | FileDataWithUrl;
1957
+ /**
1958
+ * Definition for the @file metadata.
1959
+ */
1960
+ declare abstract class FileDecoratorConfig extends PropertyDecoratorConfig<FileData> {
1961
+ /**
1962
+ * Specifies whether or not the decorated property can have multiple files.
1963
+ */
1964
+ multiple: boolean;
1965
+ /**
1966
+ * The type of the upload.
1967
+ */
1968
+ type: 'image' | 'other';
1969
+ /**
1970
+ * The icon used to remove a file from the input.
1971
+ * @default faCircleMinus
1972
+ */
1973
+ deleteIcon?: IconDefinition;
1974
+ /**
1975
+ * Whether or not the file should be displayed inside a preview.
1976
+ * @default true
1977
+ */
1978
+ preview?: boolean;
1979
+ /**
1980
+ * Specifies allowed File types like 'image/jpg' etc.
1981
+ * Allows every file type if not set.
1982
+ */
1983
+ allowedMimeTypes?: string[];
1984
+ /**
1985
+ * The error dialog to display when the user inputs files that are not of the allowed mime types.
1986
+ */
1987
+ mimeTypeErrorDialog?: ConfirmDialogData;
1988
+ /**
1989
+ * The maximum allowed size of a single file in MB.
1990
+ * @default 10
1991
+ */
1992
+ maxSize?: number;
1993
+ /**
1994
+ * The error dialog to display when the user inputs a single file that is bigger than the 'maxSize' value.
1995
+ */
1996
+ maxSizeErrorDialog?: ConfirmDialogData;
1997
+ /**
1998
+ * The maximum allowed size of all files in MB.
1999
+ * @default 100
2000
+ */
2001
+ maxSizeTotal?: number;
2002
+ /**
2003
+ * The error dialog to display when the user inputs files which are in total bigger than the 'maxSizeTotal' value.
2004
+ */
2005
+ maxSizeTotalErrorDialog?: ConfirmDialogData;
2006
+ /**
2007
+ * Defines whether or not a dropdown box is displayed.
2008
+ * @default
2009
+ * true // when multiple is set to true.
2010
+ * false // when multiple is set to false.
2011
+ */
2012
+ dragAndDrop?: boolean;
2013
+ }
2014
+ /**
2015
+ * Definition for a default file.
2016
+ */
2017
+ interface DefaultFileDecoratorConfig extends FileDecoratorConfig {
2018
+ type: 'other';
2019
+ preview?: false;
2020
+ }
2021
+ /**
2022
+ * Definition for a image file.
2023
+ */
2024
+ interface ImageFileDecoratorConfig extends FileDecoratorConfig {
2025
+ type: 'image';
2026
+ /**
2027
+ * Specifies allowed File types like image/jpg etc. In a comma separated string.
2028
+ * @default ['image/*']
2029
+ */
2030
+ allowedMimeTypes?: string[];
2031
+ /**
2032
+ * Url to the file that gets displayed in the preview when no file has been selected yet.
2033
+ */
2034
+ previewPlaceholderUrl?: string;
2035
+ }
2036
+
2037
+ /**
2038
+ * Contains data about a file property where a blob exists.
2039
+ */
2040
+ interface FileDataWithFile {
2041
+ /**
2042
+ * The name of the file.
2043
+ */
2044
+ name: string;
2045
+ /**
2046
+ * The file data itself in form of a blob.
2047
+ */
2048
+ file: Blob;
2049
+ /**
2050
+ * The mime type of the file.
2051
+ * This is needed to increase performance when checking if the provided file is valid.
2052
+ */
2053
+ type: string;
2054
+ /**
2055
+ * The size of the file in bytes.
2056
+ * This is needed to increase performance when checking if the provided file is valid.
2057
+ */
2058
+ size: number;
2059
+ /**
2060
+ * The url where the blob is saved.
2061
+ */
2062
+ url?: string;
2063
+ }
2064
+ /**
2065
+ * Contains data about a file property where no blob exists.
2066
+ */
2067
+ interface FileDataWithUrl {
2068
+ /**
2069
+ * The name of the file.
2070
+ */
2071
+ name: string;
2072
+ /**
2073
+ * The file data itself in form of a blob.
2074
+ */
2075
+ file?: Blob;
2076
+ /**
2077
+ * The mime type of the file.
2078
+ * This is needed to increase performance when checking if the provided file is valid.
2079
+ */
2080
+ type: string;
2081
+ /**
2082
+ * The size of the file in bytes.
2083
+ * This is needed to increase performance when checking if the provided file is valid.
2084
+ */
2085
+ size: number;
2086
+ /**
2087
+ * The url where the blob is saved.
2088
+ */
2089
+ url: string;
2090
+ }
2091
+ /**
2092
+ * The internal DefaultFileDecoratorConfig. Sets default values.
2093
+ */
2094
+ declare class DefaultFileDecoratorConfigInternal extends PropertyDecoratorConfigInternal<FileData> implements DefaultFileDecoratorConfig {
2095
+ type: 'other';
2096
+ preview: false;
2097
+ multiple: boolean;
2098
+ allowedMimeTypes: string[];
2099
+ deleteIcon: IconDefinition;
2100
+ maxSize: number;
2101
+ maxSizeTotal: number;
2102
+ mimeTypeErrorDialog: ConfirmDialogData;
2103
+ maxSizeErrorDialog: ConfirmDialogData;
2104
+ maxSizeTotalErrorDialog: ConfirmDialogData;
2105
+ dragAndDrop: boolean;
2106
+ constructor(data: DefaultFileDecoratorConfig);
2107
+ }
2108
+ /**
2109
+ * The internal ImageFileDecoratorConfig. Sets default values.
2110
+ */
2111
+ declare class ImageFileDecoratorConfigInternal extends PropertyDecoratorConfigInternal<FileData> implements ImageFileDecoratorConfig {
2112
+ type: 'image';
2113
+ allowedMimeTypes: string[];
2114
+ multiple: boolean;
2115
+ preview: boolean;
2116
+ previewPlaceholderUrl?: string;
2117
+ deleteIcon: IconDefinition;
2118
+ maxSize: number;
2119
+ maxSizeTotal: number;
2120
+ mimeTypeErrorDialog: ConfirmDialogData;
2121
+ maxSizeErrorDialog: ConfirmDialogData;
2122
+ maxSizeTotalErrorDialog: ConfirmDialogData;
2123
+ dragAndDrop: boolean;
2124
+ constructor(data: ImageFileDecoratorConfig);
2125
+ }
2126
+
2127
+ /**
2128
+ * Definition for the @hasMany metadata.
2129
+ */
2130
+ interface HasManyDecoratorConfig<EntityType extends BaseEntityType<EntityType>, RelatedBaseEntityType extends BaseEntityType<RelatedBaseEntityType>> extends PropertyDecoratorConfig<EntityType> {
2131
+ /**
2132
+ * Whether or not the property gets omitted when creating new Entities.
2133
+ *
2134
+ * For the hasMany property this is always true, as entities can't be created for a non existing base entity.
2135
+ */
2136
+ omitForCreate?: true;
2137
+ /**
2138
+ * The configuration for the table with the hasMany entities.
2139
+ */
2140
+ tableData: TableData<EntityType>;
2141
+ /**
2142
+ * The service class for the base entity that the has hasMany entities belong to.
2143
+ * This is used to generate the create and read base urls, eg. "customers/{id}/invoices".
2144
+ * If you want to override that behavior you can provide a custom createBaseUrl and readBaseUrl function.
2145
+ */
2146
+ RelatedEntityServiceClass: EntityServiceClassNewable<RelatedBaseEntityType>;
2147
+ /**
2148
+ * A function that generates a base url for create requests.
2149
+ * @default `{baseEntityUrl}/{id}/{lastHasManyEntityUrlSegment}`
2150
+ */
2151
+ createBaseUrl?: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
2152
+ /**
2153
+ * A function that generates a base url for read requests.
2154
+ * @default `{baseEntityUrl}/{id}/{lastHasManyEntityUrlSegment}`
2155
+ */
2156
+ readBaseUrl?: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
2157
+ }
2158
+
2159
+ /**
2160
+ * The internal edit action.
2161
+ * Sets default values.
2162
+ */
2163
+ declare class EditActionInternal<EntityType extends BaseEntityType<EntityType>> implements EditAction<EntityType> {
2164
+ protected readonly globalConfig: NgxGlobalDefaultValues;
2165
+ displayName: string;
2166
+ action: (entity: EntityType, entityPriorChanges: EntityType) => Promise<unknown>;
2167
+ enabled: ((e: EntityType) => boolean);
2168
+ requireConfirmDialog: ((e: EntityType) => boolean);
2169
+ confirmDialogData: ConfirmDialogData;
2170
+ constructor(data: EditAction<EntityType>, globalConfig: NgxGlobalDefaultValues);
2171
+ private functionToAsync;
2172
+ }
2173
+ /**
2174
+ * The internal EditData. Requires all default values the user can leave out.
2175
+ */
2176
+ declare class EditDataInternal<EntityType extends BaseEntityType<EntityType>> implements EditData<EntityType> {
2177
+ title: (entity: EntityType) => string;
2178
+ confirmButtonLabel: string;
2179
+ deleteButtonLabel: string;
2180
+ cancelButtonLabel: string;
2181
+ deleteRequiresConfirmDialog: boolean;
2182
+ editRequiresConfirmDialog: boolean;
2183
+ confirmDeleteDialogData: ConfirmDialogData;
2184
+ confirmEditDialogData: ConfirmDialogData;
2185
+ unsavedChangesRequireConfirmDialog: boolean;
2186
+ confirmUnsavedChangesDialogData: ConfirmDialogData;
2187
+ actionsLabel: string;
2188
+ actions: EditActionInternal<EntityType>[];
2189
+ constructor(title: (entity: EntityType) => string, confirmButtonLabel: string, deleteButtonLabel: string, cancelButtonLabel: string, deleteRequiresConfirmDialog: boolean, editRequiresConfirmDialog: boolean, unsavedChangesRequireConfirmDialog: boolean, confirmDeleteDialogData: ConfirmDialogData, confirmEditDialogData: ConfirmDialogData, confirmUnsavedChangesDialogData: ConfirmDialogData, actionsLabel: string, actions: EditAction<EntityType>[], globalConfig: NgxGlobalDefaultValues);
2190
+ }
2191
+
2192
+ /**
2193
+ * The internal BaseTableAction. Sets default values.
2194
+ */
2195
+ declare class BaseTableActionInternal implements BaseTableAction {
2196
+ protected readonly globalConfig: NgxGlobalDefaultValues;
2197
+ type: 'default';
2198
+ displayName: string;
2199
+ action: () => Promise<unknown>;
2200
+ enabled: (() => boolean);
2201
+ requireConfirmDialog: (() => boolean);
2202
+ confirmDialogData: ConfirmDialogDataInternal;
2203
+ constructor(data: BaseTableAction, globalConfig: NgxGlobalDefaultValues);
2204
+ private functionToAsync;
2205
+ }
2206
+ /**
2207
+ * The internal BaseTableAction. Sets default values.
2208
+ */
2209
+ declare class MultiSelectActionInternal<EntityType extends BaseEntityType<EntityType>> implements MultiSelectAction<EntityType> {
2210
+ protected readonly globalConfig: NgxGlobalDefaultValues;
2211
+ type: 'multi-select';
2212
+ displayName: string;
2213
+ action: (selectedEntities: EntityType[]) => Promise<unknown>;
2214
+ enabled: ((selectedEntities: EntityType[]) => boolean);
2215
+ requireConfirmDialog: ((selectedEntities: EntityType[]) => boolean);
2216
+ confirmDialogData: ConfirmDialogDataInternal;
2217
+ constructor(data: MultiSelectAction<EntityType>, globalConfig: NgxGlobalDefaultValues);
2218
+ private functionToAsync;
2219
+ }
2220
+ /**
2221
+ * The Internal Table Action. Sets default values.
2222
+ */
2223
+ type TableActionInternal<EntityType extends BaseEntityType<EntityType>> = BaseTableActionInternal | MultiSelectActionInternal<EntityType>;
2224
+ /**
2225
+ * The internal TableData. Requires all default values the user can leave out.
2226
+ */
2227
+ declare class TableDataInternal<EntityType extends BaseEntityType<EntityType>> implements TableData<EntityType> {
2228
+ baseData: BaseDataInternal<EntityType>;
2229
+ createData: CreateDataInternal;
2230
+ editData: EditDataInternal<EntityType>;
2231
+ constructor(baseData: BaseDataInternal<EntityType>, createData: CreateDataInternal, editData: EditDataInternal<EntityType>);
2232
+ }
2233
+ /**
2234
+ * The internal TableData. Requires all default values the user can leave out.
2235
+ */
2236
+ declare class BaseDataInternal<EntityType extends BaseEntityType<EntityType>> implements BaseData<EntityType> {
2237
+ protected readonly globalConfig: NgxGlobalDefaultValues;
2238
+ title: string;
2239
+ displayColumns: DisplayColumn<EntityType>[];
2240
+ EntityServiceClass: EntityServiceClassNewable<EntityType>;
2241
+ searchLabel: string;
2242
+ createButtonLabel: string;
2243
+ defaultEdit: 'dialog' | 'page';
2244
+ defaultCreate: 'dialog' | 'page';
2245
+ searchString: (entity: EntityType) => string;
2246
+ allowCreate: () => boolean;
2247
+ allowRead: (entity?: EntityType) => boolean;
2248
+ allowUpdate: (entity?: EntityType) => boolean;
2249
+ allowDelete: (entity?: EntityType) => boolean;
2250
+ tableActions: TableActionInternal<EntityType>[];
2251
+ tableActionsLabel: string;
2252
+ displayLoadingSpinner: boolean;
2253
+ allowJsonImport: boolean;
2254
+ importActionData: Omit<BaseTableActionInternal, 'action'>;
2255
+ dynamicRowStyleClasses: DynamicStyleClasses<EntityType>;
2256
+ EntityClass?: EntityClassNewable<EntityType>;
2257
+ edit?: (entity: EntityType) => unknown;
2258
+ create?: (entity: EntityType) => unknown;
2259
+ constructor(data: BaseData<EntityType>, globalConfig: NgxGlobalDefaultValues);
2260
+ private buildImportActionData;
2261
+ private allowDataToFunction;
2262
+ }
2263
+
2264
+ /**
2265
+ * The internal HasManyDecoratorConfig. Sets default values.
2266
+ */
2267
+ declare class HasManyDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>, RelatedBaseEntityType extends BaseEntityType<RelatedBaseEntityType>> extends PropertyDecoratorConfigInternal<EntityType> implements HasManyDecoratorConfig<EntityType, RelatedBaseEntityType> {
2268
+ omitForCreate: true;
2269
+ tableData: TableDataInternal<EntityType>;
2270
+ RelatedEntityServiceClass: EntityServiceClassNewable<RelatedBaseEntityType>;
2271
+ createBaseUrl: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
2272
+ readBaseUrl: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
2273
+ constructor(data: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>, globalConfig: NgxGlobalDefaultValues);
2274
+ }
2275
+
2276
+ type NumberDropdownValues = DropdownValue<number | undefined>[] | ((entity: any) => DropdownValue<number | undefined>[]) | ((entity: any) => Promise<DropdownValue<number | undefined>[]>);
2277
+ /**
2278
+ * Definition for the @number metadata.
2279
+ */
2280
+ declare abstract class NumberDecoratorConfig extends PropertyDecoratorConfig<number> {
2281
+ /**
2282
+ * Whether to display the number in a single line or as a dropdown.
2283
+ */
2284
+ displayStyle: 'line' | 'dropdown' | 'slider';
2285
+ }
2286
+ /**
2287
+ * The configuration options for a number property displayed in a default number input.
2288
+ */
2289
+ interface DefaultNumberDecoratorConfig extends NumberDecoratorConfig {
2290
+ displayStyle: 'line';
2291
+ /**
2292
+ * The minimum value of the number.
2293
+ */
2294
+ min?: number;
2295
+ /**
2296
+ * The maximum value of the number.
2297
+ */
2298
+ max?: number;
2299
+ }
2300
+ /**
2301
+ * The configuration options for a number property displayed in a dropdown.
2302
+ */
2303
+ interface DropdownNumberDecoratorConfig extends NumberDecoratorConfig {
2304
+ displayStyle: 'dropdown';
2305
+ /**
2306
+ * The values of the dropdown, consisting of a name to display and the actual value.
2307
+ */
2308
+ dropdownValues: NumberDropdownValues;
2309
+ }
2310
+ /**
2311
+ * The configuration options for a number property displayed as a slider input.
2312
+ */
2313
+ interface SliderNumberDecoratorConfig extends NumberDecoratorConfig {
2314
+ displayStyle: 'slider';
2315
+ /**
2316
+ * The minimum value of the number.
2317
+ */
2318
+ min?: number;
2319
+ /**
2320
+ * The maximum value of the number.
2321
+ */
2322
+ max?: number;
2323
+ /**
2324
+ * How big a single step is at which the thumb label will snap.
2325
+ */
2326
+ step?: number;
2327
+ /**
2328
+ * Function that transforms the value to display inside the thumb label.
2329
+ */
2330
+ formatThumbLabelValue?: (value: number) => string;
2331
+ /**
2332
+ * Whether or not ticks should be displayed.
2333
+ */
2334
+ showTickMarks?: boolean;
2335
+ }
2336
+
2337
+ /**
2338
+ * The internal DefaultNumberDecoratorConfig. Sets default values.
2339
+ */
2340
+ declare class DefaultNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal<number> implements DefaultNumberDecoratorConfig {
2341
+ displayStyle: 'line';
2342
+ min?: number;
2343
+ max?: number;
2344
+ constructor(data: DefaultNumberDecoratorConfig);
2345
+ }
2346
+ /**
2347
+ * The internal DropdownNumberDecoratorConfig. Sets default values.
2348
+ */
2349
+ declare class DropdownNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal<number> implements DropdownNumberDecoratorConfig {
2350
+ displayStyle: 'dropdown';
2351
+ dropdownValues: ((entity: any) => Promise<DropdownValue<number | undefined>[]>);
2352
+ constructor(data: DropdownNumberDecoratorConfig);
2353
+ }
2354
+ /**
2355
+ * The internal SliderNumberDecoratorConfig. Sets default values.
2356
+ */
2357
+ declare class SliderNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal<number> implements SliderNumberDecoratorConfig {
2358
+ displayStyle: 'slider';
2359
+ min?: number;
2360
+ max?: number;
2361
+ step?: number;
2362
+ formatThumbLabelValue: (value: number) => string;
2363
+ showTickMarks?: boolean;
2364
+ constructor(data: SliderNumberDecoratorConfig);
2365
+ }
2366
+
2367
+ type ObjectDropdownValues<EntityType extends BaseEntityType<EntityType>> = DropdownValue<EntityType | undefined>[] | ((entity: any) => DropdownValue<EntityType | undefined>[]) | ((entity: any) => Promise<DropdownValue<EntityType | undefined>[]>);
2368
+ /**
2369
+ * Definition for the @object metadata.
2370
+ */
2371
+ declare abstract class ObjectDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfig<EntityType> {
2372
+ /**
2373
+ * The class of the object. Is used to call the constructor so that all metadata is initialized.
2374
+ */
2375
+ EntityClass: EntityClassNewable<EntityType>;
2376
+ /**
2377
+ * How to display the object.
2378
+ *
2379
+ * The objects properties are added as input fields in an section of the entity.
2380
+ * Useful if the object only contains a few properties (e.g. A address on a user).
2381
+ */
2382
+ displayStyle: 'dropdown' | 'inline';
2383
+ /**
2384
+ * Some properties of the objects entity class that should be omitted.
2385
+ */
2386
+ omit?: (keyof EntityType)[];
2387
+ }
2388
+ /**
2389
+ * The configuration options for a object property.
2390
+ */
2391
+ interface DefaultObjectDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends ObjectDecoratorConfig<EntityType> {
2392
+ displayStyle: 'inline';
2393
+ }
2394
+ /**
2395
+ * The configuration options for a dropdown object property.
2396
+ */
2397
+ interface DropdownObjectDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends ObjectDecoratorConfig<EntityType> {
2398
+ displayStyle: 'dropdown';
2399
+ /**
2400
+ * The values of the dropdown, consisting of a name to display and the actual value.
2401
+ * Can also receive a function to determine the values.
2402
+ */
2403
+ dropdownValues: ObjectDropdownValues<EntityType>;
2404
+ }
2405
+
2406
+ /**
2407
+ * The internal DefaultObjectDecoratorConfig. Sets default values.
2408
+ */
2409
+ declare class DefaultObjectDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal<EntityType> implements DefaultObjectDecoratorConfig<EntityType> {
2410
+ displayStyle: 'inline';
2411
+ EntityClass: EntityClassNewable<EntityType>;
2412
+ omit: (keyof EntityType)[];
2413
+ constructor(data: DefaultObjectDecoratorConfig<EntityType>);
2414
+ }
2415
+ /**
2416
+ * The internal DropdownObjectDecoratorConfig. Sets default values.
2417
+ */
2418
+ declare class DropdownObjectDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal<EntityType> implements DropdownObjectDecoratorConfig<EntityType> {
2419
+ displayStyle: 'dropdown';
2420
+ EntityClass: EntityClassNewable<EntityType>;
2421
+ omit: (keyof EntityType)[];
2422
+ dropdownValues: ((entity: any) => Promise<DropdownValue<EntityType | undefined>[]>);
2423
+ constructor(data: DropdownObjectDecoratorConfig<EntityType>);
2424
+ }
2425
+
2426
+ /**
2427
+ * Definition for the @referencesMany metadata.
2428
+ */
2429
+ interface ReferencesManyDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfig<EntityType> {
2430
+ /**
2431
+ * The function that returns the values that can be referenced.
2432
+ */
2433
+ getReferencedEntities: () => Promise<EntityType[]>;
2434
+ /**
2435
+ * Method to get the referenced dropdown values.
2436
+ */
2437
+ getDropdownValues: (referencedEntities: EntityType[]) => DropdownValue<string>[];
2438
+ /**
2439
+ * Gets the referenced entity for the given id.
2440
+ */
2441
+ getEntityForId?: (entityId: string, allReferencedEntities: EntityType[]) => EntityType;
2442
+ /**
2443
+ * The error message to display when an array property is required and empty.
2444
+ * @default 'Needs to contain at least one value'
2445
+ */
2446
+ emptyErrorMessage?: string;
2447
+ /**
2448
+ * Configuration for css classes that should be applied to table rows based on a condition.
2449
+ * This could be used to eg. Set the background color to green when an item has the status completed etc.
2450
+ * INFO: You need to use ng-deep or apply the styling in the styles.scss.
2451
+ * @default () => []
2452
+ */
2453
+ dynamicRowStyleClasses?: DynamicStyleClasses<EntityType>;
2454
+ /**
2455
+ * The definition of the columns to display. Consists of the displayName to show in the header of the row
2456
+ * and the value, which is a function that generates the value to display inside a column.
2457
+ */
2458
+ displayColumns: DisplayColumn<EntityType>[];
2459
+ /**
2460
+ * The label for the dropdown input.
2461
+ * @default 'Select'
2462
+ */
2463
+ dropdownLabel?: string;
2464
+ /**
2465
+ * Whether or not a button that adds all values exists.
2466
+ * @default false
2467
+ */
2468
+ addAll?: boolean;
2469
+ /**
2470
+ * The label for the add all button.
2471
+ * @default 'Add all'
2472
+ */
2473
+ addAllButtonLabel?: string;
2474
+ /**
2475
+ * The label for the add button when createInline is true.
2476
+ * @default 'Add'
2477
+ */
2478
+ addButtonLabel?: string;
2479
+ /**
2480
+ * The label for the remove button when createInline is true.
2481
+ * @default 'Remove'
2482
+ */
2483
+ removeButtonLabel?: string;
2484
+ }
2485
+
2486
+ /**
2487
+ * The internal DefaultNumberDecoratorConfig. Sets default values.
2488
+ */
2489
+ declare class ReferencesManyDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal<EntityType> implements ReferencesManyDecoratorConfig<EntityType> {
2490
+ getReferencedEntities: () => Promise<EntityType[]>;
2491
+ getDropdownValues: (referencedEntities: EntityType[]) => DropdownValue<string>[];
2492
+ getEntityForId: (entityId: string, allReferencedEntities: EntityType[]) => EntityType;
2493
+ emptyErrorMessage: string;
2494
+ dynamicRowStyleClasses: DynamicStyleClasses<EntityType>;
2495
+ displayColumns: DisplayColumn<EntityType>[];
2496
+ addButtonLabel: string;
2497
+ removeButtonLabel: string;
2498
+ dropdownLabel: string;
2499
+ addAll: boolean;
2500
+ addAllButtonLabel: string;
2501
+ constructor(data: ReferencesManyDecoratorConfig<EntityType>, globalConfig: NgxGlobalDefaultValues);
2502
+ }
2503
+
2504
+ /**
2505
+ * Definition for the @referencesOne metadata.
2506
+ */
2507
+ interface ReferencesOneDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfig<EntityType> {
2508
+ /**
2509
+ * The function that returns the values that can be possibly referenced.
2510
+ */
2511
+ getReferencedEntities: () => Promise<EntityType[]>;
2512
+ /**
2513
+ * Method to filter or add dropdown options eg, for an empty value.
2514
+ */
2515
+ getDropdownValues: (referencedEntities: EntityType[]) => DropdownValue<string>[];
2516
+ /**
2517
+ * Gets the referenced entity for the given id.
2518
+ */
2519
+ getEntityForId?: (entityId: string, allReferencedEntities: EntityType[]) => EntityType;
2520
+ /**
2521
+ * The class of the entity that gets referenced.
2522
+ */
2523
+ EntityClass: EntityClassNewable<EntityType>;
2524
+ /**
2525
+ * Whether or not to only show the dropdown, instead of all data of the selected entity in read only.
2526
+ */
2527
+ dropdownOnly?: boolean;
2528
+ /**
2529
+ * Some properties of the objects entity class that should be omitted.
2530
+ */
2531
+ omit?: (keyof EntityType)[];
2532
+ }
2533
+
2534
+ /**
2535
+ * The internal DefaultNumberDecoratorConfig. Sets default values.
2536
+ */
2537
+ declare class ReferencesOneDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal<EntityType> implements ReferencesOneDecoratorConfig<EntityType> {
2538
+ getReferencedEntities: () => Promise<EntityType[]>;
2539
+ getDropdownValues: (referencedEntities: EntityType[]) => DropdownValue<string>[];
2540
+ getEntityForId: (entityId: string, allReferencedEntities: EntityType[]) => EntityType;
2541
+ EntityClass: EntityClassNewable<EntityType>;
2542
+ dropdownOnly: boolean;
2543
+ omit: (keyof EntityType)[];
2544
+ constructor(data: ReferencesOneDecoratorConfig<EntityType>);
2545
+ }
2546
+
2547
+ /**
2548
+ * The internal DropdownStringDecoratorConfig. Sets default values.
2549
+ */
2550
+ declare class DropdownStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string> implements DropdownStringDecoratorConfig {
2551
+ displayStyle: 'dropdown';
2552
+ dropdownValues: ((entity: any) => Promise<DropdownValue<string | undefined>[]>);
2553
+ constructor(data: DropdownStringDecoratorConfig);
2554
+ }
2555
+ /**
2556
+ * The internal DefaultStringDecoratorConfig. Sets default values.
2557
+ */
2558
+ declare class DefaultStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string> implements DefaultStringDecoratorConfig {
2559
+ displayStyle: 'line';
2560
+ minLength?: number;
2561
+ maxLength?: number;
2562
+ regex?: RegExp;
2563
+ constructor(data: DefaultStringDecoratorConfig);
2564
+ }
2565
+ /**
2566
+ * The internal TextboxStringDecoratorConfig. Sets default values.
2567
+ */
2568
+ declare class TextboxStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string> implements TextboxStringDecoratorConfig {
2569
+ displayStyle: 'textbox';
2570
+ minLength?: number;
2571
+ maxLength?: number;
2572
+ constructor(data: TextboxStringDecoratorConfig);
2573
+ }
2574
+ /**
2575
+ * The internal AutocompleteStringDecoratorConfig. Sets default values.
2576
+ */
2577
+ declare class AutocompleteStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string> implements AutocompleteStringDecoratorConfig {
2578
+ displayStyle: 'autocomplete';
2579
+ autocompleteValues: (entity: any) => Promise<string[]>;
2580
+ minLength?: number;
2581
+ maxLength?: number;
2582
+ regex?: RegExp;
2583
+ restrictToOptions?: boolean;
2584
+ constructor(data: AutocompleteStringDecoratorConfig);
2585
+ private autocompleteValuesToFunction;
2586
+ }
2587
+ /**
2588
+ * The internal PasswordStringDecoratorConfig. Sets default values.
2589
+ */
2590
+ declare class PasswordStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string> implements PasswordStringDecoratorConfig {
2591
+ displayStyle: 'password';
2592
+ minLength?: number;
2593
+ maxLength?: number;
2594
+ regex?: RegExp;
2595
+ needsConfirmation: boolean;
2596
+ confirmationDisplayName: string;
2597
+ displayPasswordStrength: boolean;
2598
+ constructor(data: PasswordStringDecoratorConfig);
2599
+ }
2600
+
2601
+ /**
2602
+ * The enum Values for all the different DecoratorTypes.
2603
+ */
2604
+ declare enum DecoratorTypes {
2605
+ STRING = "string",
2606
+ STRING_DROPDOWN = "stringDropdown",
2607
+ STRING_AUTOCOMPLETE = "stringAutocomplete",
2608
+ STRING_TEXTBOX = "stringTextbox",
2609
+ STRING_PASSWORD = "stringPassword",
2610
+ NUMBER = "number",
2611
+ NUMBER_DROPDOWN = "numberDropdown",
2612
+ NUMBER_SLIDER = "numberSlider",
2613
+ BOOLEAN_CHECKBOX = "boolean",
2614
+ BOOLEAN_TOGGLE = "booleanToggle",
2615
+ BOOLEAN_DROPDOWN = "booleanDropdown",
2616
+ OBJECT = "object",
2617
+ OBJECT_DROPDOWN = "objectDropdown",
2618
+ ARRAY = "array",
2619
+ ARRAY_DATE = "arrayDate",
2620
+ ARRAY_DATE_TIME = "arrayDateTime",
2621
+ ARRAY_DATE_RANGE = "arrayDateRange",
2622
+ ARRAY_STRING_CHIPS = "arrayStringChips",
2623
+ ARRAY_STRING_AUTOCOMPLETE_CHIPS = "arrayStringAutocompleteChips",
2624
+ DATE = "date",
2625
+ DATE_RANGE = "dateRange",
2626
+ DATE_TIME = "dateTime",
2627
+ FILE_DEFAULT = "fileDefault",
2628
+ FILE_IMAGE = "fileImage",
2629
+ REFERENCES_MANY = "referencesMany",
2630
+ REFERENCES_ONE = "referencesOne",
2631
+ HAS_MANY = "hasMany",
2632
+ CUSTOM = "custom"
2633
+ }
2634
+ /**
2635
+ * Gives the metadata-config Type based on the DecoratorTypes enum.
2636
+ */
2637
+ type DecoratorType<T, CustomMetadataType extends Record<string, unknown>> = T extends DecoratorTypes.STRING ? DefaultStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_TEXTBOX ? TextboxStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_DROPDOWN ? DropdownStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_AUTOCOMPLETE ? AutocompleteStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_PASSWORD ? PasswordStringDecoratorConfigInternal : T extends DecoratorTypes.NUMBER ? DefaultNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_DROPDOWN ? DropdownNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_SLIDER ? SliderNumberDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_CHECKBOX ? CheckboxBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_TOGGLE ? ToggleBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_DROPDOWN ? DropdownBooleanDecoratorConfigInternal : T extends DecoratorTypes.OBJECT ? DefaultObjectDecoratorConfigInternal<any> : T extends DecoratorTypes.OBJECT_DROPDOWN ? DropdownObjectDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY ? EntityArrayDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY_DATE ? DateArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_TIME ? DateTimeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_RANGE ? DateRangeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_CHIPS ? StringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS ? AutocompleteStringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.DATE ? DefaultDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_RANGE ? DateRangeDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_TIME ? DateTimeDateDecoratorConfigInternal : T extends DecoratorTypes.FILE_DEFAULT ? DefaultFileDecoratorConfigInternal : T extends DecoratorTypes.FILE_IMAGE ? ImageFileDecoratorConfigInternal : T extends DecoratorTypes.REFERENCES_MANY ? ReferencesManyDecoratorConfigInternal<any> : T extends DecoratorTypes.REFERENCES_ONE ? ReferencesOneDecoratorConfigInternal<any> : T extends DecoratorTypes.HAS_MANY ? HasManyDecoratorConfigInternal<any, any> : T extends DecoratorTypes.CUSTOM ? CustomDecoratorConfigInternal<any, any, CustomMetadataType, any> : never;
2638
+
2639
+ /**
2640
+ * Shows information about differences between two entities.
2641
+ */
2642
+ interface Difference<EntityType extends BaseEntityType<EntityType>> {
2643
+ /**
2644
+ * The key where the two entities have different values.
2645
+ */
2646
+ key: keyof EntityType;
2647
+ /**
2648
+ * The value before any changes.
2649
+ */
2650
+ before: unknown;
2651
+ /**
2652
+ * The current value after changes.
2653
+ */
2654
+ after: unknown;
2655
+ }
2656
+ /**
2657
+ * Contains HelperMethods around handling Entities and their property-metadata.
2658
+ */
2659
+ declare abstract class EntityUtilities {
2660
+ /**
2661
+ * The key for all keys of metadata that should be set to undefined when the entity gets reset.
2662
+ */
2663
+ static readonly METADATA_KEYS_TO_RESET_KEY: string;
2664
+ /**
2665
+ * The key for the metadata that saves the single preview image value on image properties.
2666
+ */
2667
+ static readonly SINGLE_PREVIEW_IMAGE_KEY: string;
2668
+ /**
2669
+ * The key for the metadata that saves the multi preview images value on image properties.
2670
+ */
2671
+ static readonly MULTI_PREVIEW_IMAGES_KEY: string;
2672
+ /**
2673
+ * The key for the metadata that saves the filenames value on file properties.
2674
+ */
2675
+ static readonly FILENAMES_KEY: string;
2676
+ /**
2677
+ * The key for the metadata that saves the confirm password value on password properties.
2678
+ */
2679
+ static readonly CONFIRM_PASSWORD_KEY: string;
2680
+ /**
2681
+ * The key for the metadata that saves the time value on date time properties.
2682
+ */
2683
+ static readonly TIME_KEY: string;
2684
+ /**
2685
+ * Gets the properties to omit when updating the entity.
2686
+ * @param entity - The entity to get the properties which should be left out for updating from.
2687
+ * @returns The properties which should be left out for updating an Entity.
2688
+ */
2689
+ static getOmitForUpdate<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): (keyof EntityType)[];
2690
+ /**
2691
+ * Gets the properties to omit when creating new entities.
2692
+ * @param entity - The entity to get the properties which should be left out for creating from.
2693
+ * @returns The properties which should be left out for creating a new Entity.
2694
+ */
2695
+ static getOmitForCreate<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): (keyof EntityType)[];
2696
+ /**
2697
+ * Returns the given entity without the values that should be omitted for creation.
2698
+ * @param entity - The entity with all its values.
2699
+ * @returns The reduced entity object.
2700
+ */
2701
+ static getWithoutOmitCreateValues<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): Partial<EntityType>;
2702
+ /**
2703
+ * Returns the given entity without the values that should be omitted for updating.
2704
+ * This also handles omitting keys for @object or @array values and removes values that haven't been changed by default.
2705
+ * @param entity - The entity with all its values.
2706
+ * @param entityPriorChanges - The entity before any changes were applied.
2707
+ * @param http - The angular HttpClient. Used to fetch files.
2708
+ * @param injector - An angular environment injector.
2709
+ * @returns The reduced entity object.
2710
+ */
2711
+ static getWithoutOmitUpdateValues<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType, http: HttpClient, injector: EnvironmentInjector): Promise<Partial<EntityType>>;
2712
+ /**
2713
+ * Sets all default values on the given entity.
2714
+ * @param entity - The entity to set the default values on.
2715
+ */
2716
+ static setDefaultValues<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): void;
2717
+ /**
2718
+ * Gets all properties on the given entity which are files.
2719
+ * @param entity - The entity to check for file properties.
2720
+ * @param omit - Whether to leave out values that are omitted for create or delete.
2721
+ * @returns The keys of all file properties on the given entity.
2722
+ */
2723
+ static getFileProperties<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit?: 'create' | 'update'): (keyof EntityType)[];
2724
+ /**
2725
+ * Gets the metadata included in an property.
2726
+ * @param entity - The entity with the property to get the metadata from.
2727
+ * @param propertyKey - The property on the given Entity to get the metadata from.
2728
+ * @param type - For secure Typing, defines the returned PropertyConfig.
2729
+ * @returns The metadata of the property.
2730
+ * @throws When no metadata can be found for the given property.
2731
+ */
2732
+ static getPropertyMetadata<EntityType extends BaseEntityType<EntityType>, T extends DecoratorTypes, CustomMetadataType extends Record<string, unknown>>(entity: EntityType, propertyKey: keyof EntityType, type?: T): DecoratorType<T, CustomMetadataType> | undefined;
2733
+ /**
2734
+ * Gets the type of the property-metadata.
2735
+ * @param entity - The entity with the property to get the type from.
2736
+ * @param propertyKey - The property on the given Entity to get the type from.
2737
+ * @returns The type of the metadata.
2738
+ * @throws Will throw an error if no metadata can be found for the given property.
2739
+ */
2740
+ static getPropertyType<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, propertyKey: keyof EntityType): DecoratorTypes | undefined;
2741
+ /**
2742
+ * Sets all property values based on a given entity data-object.
2743
+ * @param target - The target object that needs to be constructed (if called inside an Entity constructor its usually this).
2744
+ * @param entity - The data object to get the property values from.
2745
+ * @alias new
2746
+ * @alias build
2747
+ * @alias construct
2748
+ */
2749
+ static new<EntityType extends BaseEntityType<EntityType>>(target: EntityType, entity?: EntityType): void;
2750
+ static construct: typeof EntityUtilities.new;
2751
+ static build: typeof EntityUtilities.new;
2752
+ /**
2753
+ * Checks if an entity is "dirty" (if its values have changed).
2754
+ * @param entity - The entity after all changes.
2755
+ * @param entityPriorChanges - The entity before the changes.
2756
+ * @param http - The angular HttpClient. Used to fetch files.
2757
+ * @param injector - An angular environment injector.
2758
+ * @returns Whether or not the entity is dirty.
2759
+ */
2760
+ static isDirty<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType, http: HttpClient, injector: EnvironmentInjector): Promise<boolean>;
2761
+ /**
2762
+ * Gets the differences between the two given entities. Only checks properties which are decorated.
2763
+ * @param entity - The entity as is.
2764
+ * @param entityPriorChanges - The entity before any changes have been made.
2765
+ * @param http - The angular http client, is needed to check if files are equal.
2766
+ * @param injector - An angular environment injector.
2767
+ * @returns The differences as an array consisting of key, before and after.
2768
+ */
2769
+ static getDifferencesBetweenEntities<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType, http: HttpClient, injector: EnvironmentInjector): Promise<Difference<EntityType>[]>;
2770
+ /**
2771
+ * Checks if two given values are equal.
2772
+ * It uses the isEqual method from LodashUtilities and extends it with functionality regarding Dates.
2773
+ * @param value - The updated value.
2774
+ * @param valuePriorChanges - The value before any changes.
2775
+ * @param metadata - The metadata of the property.
2776
+ * @param type - The type of the property.
2777
+ * @param http - The angular HttpClient. Used to fetch files.
2778
+ * @returns Whether or not the given values are equal.
2779
+ */
2780
+ static isEqual(value: unknown, valuePriorChanges: unknown, metadata: PropertyDecoratorConfigInternal<unknown> | undefined, type: DecoratorTypes | undefined, http: HttpClient): Promise<boolean>;
2781
+ private static differenceIsUndefinedAndEmptyString;
2782
+ private static differenceIsUndefinedAndEmptyArray;
2783
+ private static isEqualArrayString;
2784
+ private static isEqualArrayDate;
2785
+ private static isEqualArrayDateRange;
2786
+ private static isEqualDateTime;
2787
+ private static isEqualDate;
2788
+ private static isEqualDateRange;
2789
+ private static isEqualFile;
2790
+ private static isEqualCustom;
2791
+ /**
2792
+ * Compare function for sorting entity keys by their order value.
2793
+ * @param a - First key of entity.
2794
+ * @param b - Second key of entity.
2795
+ * @param entity - Current entity (used to get metadata of entity keys).
2796
+ * @returns 0 if both values have the same order, a negative value if 'a' comes before 'b', a positive value if 'a' comes behind 'b'.
2797
+ */
2798
+ static compareOrder<EntityType extends BaseEntityType<EntityType>>(a: keyof EntityType, b: keyof EntityType, entity: EntityType): number;
2799
+ /**
2800
+ * Gets the responsive column classes for "lg", "md" and "sm".
2801
+ * @param entity - Entity to get the responsive column classes for.
2802
+ * @param key - Key of the property to get the responsive column classes from.
2803
+ * @returns Responsive column classes for large, middle and small displays.
2804
+ * @throws When no metadata for the given key was found.
2805
+ */
2806
+ static getWidthClasses<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType): string;
2807
+ /**
2808
+ * Resets all changes on an entity.
2809
+ * @param entity - The entity to reset.
2810
+ * @param entityPriorChanges - The entity before any changes.
2811
+ */
2812
+ static resetChangesOnEntity<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType): void;
2813
+ private static getEntityRows;
2814
+ /**
2815
+ * Gets the tabs that are used to display the given entity.
2816
+ * @param entity - The entity to get the rows from.
2817
+ * @param injector - An angular environment injector.
2818
+ * @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
2819
+ * @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
2820
+ * @param additionalOmitKeys - Additional omit values.
2821
+ * @returns The sorted Tabs containing the rows and the keys to display in that row.
2822
+ */
2823
+ static getEntityTabs<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean, additionalOmitKeys?: (keyof EntityType)[]): EntityTab<EntityType>[];
2824
+ private static getKeysForRow;
2825
+ private static getNumberOfRows;
2826
+ private static getNumberOfTabs;
2827
+ private static getTabName;
2828
+ private static getFirstTabName;
2829
+ /**
2830
+ * Gets the keys of the provided entity correctly typed.
2831
+ * @param entity - The entity to get the keys of.
2832
+ * @param injector - An angular environment injector.
2833
+ * @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
2834
+ * @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
2835
+ * @returns An array of keys of the entity.
2836
+ */
2837
+ static keysOf<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean): (keyof EntityType)[];
2838
+ private static getDontDisplayKeys;
2839
+ }
2840
+ /**
2841
+ * A row that contains information about how to display an entity.
2842
+ */
2843
+ interface EntityRow<EntityType extends BaseEntityType<EntityType>> {
2844
+ /**
2845
+ * The row in which this should be displayed.
2846
+ */
2847
+ row: number;
2848
+ /**
2849
+ * The keys of the values that should be displayed in that row.
2850
+ */
2851
+ keys: (keyof EntityType)[];
2852
+ }
2853
+ /**
2854
+ * A tab that contains all the information about how to display an entity.
2855
+ */
2856
+ interface EntityTab<EntityType extends BaseEntityType<EntityType>> {
2857
+ /**
2858
+ * The tab in which the rows should be displayed.
2859
+ */
2860
+ tab: number;
2861
+ /**
2862
+ * The name to display inside the tab.
2863
+ */
2864
+ tabName: string;
2865
+ /**
2866
+ * The rows that should be displayed inside this tab,.
2867
+ */
2868
+ rows: EntityRow<EntityType>[];
2869
+ }
2870
+
2871
+ /**
2872
+ * A validation error reported by the validation utilities.
2873
+ * Consists of the property name where the error originated from and a message.
2874
+ */
2875
+ interface ValidationError {
2876
+ /**
2877
+ * The property name on which the error occurred. This is the displayName value.
2878
+ */
2879
+ property: string;
2880
+ /**
2881
+ * The validation error message.
2882
+ */
2883
+ message: string;
2884
+ }
2885
+ /**
2886
+ * Contains HelperMethods around handling Validation of entities and properties.
2887
+ */
2888
+ declare abstract class ValidationUtilities {
2889
+ /**
2890
+ * Checks if the values on an entity are valid.
2891
+ * Also checks all the validators given by the metadata ("required", "maxLength" etc.).
2892
+ * @param entity - The entity to validate.
2893
+ * @param injector - An angular environment injector.
2894
+ * @param omit - Whether to check for creating or editing validity.
2895
+ * @returns Whether or not the entity is valid.
2896
+ */
2897
+ static isEntityValid<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, omit?: 'create' | 'update'): Promise<boolean>;
2898
+ /**
2899
+ * Gets all validation errors on the given entity.
2900
+ * @param entity - The entity to validate.
2901
+ * @param injector - An angular environment injector.
2902
+ * @param omit - What keys not to check. An empty value means no keys are omitted.
2903
+ * @returns An array of validation errors on the provided entity.
2904
+ */
2905
+ static getEntityValidationErrors<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, omit?: 'create' | 'update'): Promise<ValidationError[]>;
2906
+ /**
2907
+ * Validates the property on the given entity with the given key.
2908
+ * @param entity - The entity on which the property to check is.
2909
+ * @param key - The key of the property to validate.
2910
+ * @param omit - What keys not to check. An empty value means no keys are omitted.
2911
+ * @returns A validation error when the property is not valid, undefined otherwise.
2912
+ * @throws When the type of the property is not known.
2913
+ */
2914
+ static getPropertyValidationError<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType, omit?: 'create' | 'update'): Promise<ValidationError | undefined>;
2915
+ private static getArrayStringAutocompleteChipsValidationError;
2916
+ private static getBooleanValidationError;
2917
+ private static getStringValidationError;
2918
+ private static getAutocompleteStringValidationError;
2919
+ private static getTextboxValidationError;
2920
+ private static getPasswordValidationError;
2921
+ private static getNumberValidationError;
2922
+ private static getDateValidationError;
2923
+ private static getDateRangeValidationError;
2924
+ private static getDateTimeValidationError;
2925
+ private static getFileDataValidationError;
2926
+ }
2927
+
2928
+ /**
2929
+ * The data that needs to be provided for a route to be able to create a entity.
2930
+ */
2931
+ type PageCreateData<EntityType extends BaseEntityType<EntityType>> = Omit<CreateEntityData<EntityType>, 'entity' | 'EntityServiceClass'> & {
2932
+ /**
2933
+ * Whether or not to display a loading spinner while the data for the page is loaded.
2934
+ * @default true
2935
+ */
2936
+ displayLoadingSpinner?: boolean;
2937
+ /**
2938
+ * The data of the default create page.
2939
+ */
2940
+ createData?: CreateData & {
2941
+ /**
2942
+ * The data for the dialog when the user tries to leave the site with unsaved changes.
2943
+ */
2944
+ confirmUnsavedChangesDialogData?: ConfirmDialogData;
2945
+ /**
2946
+ * Whether or not leaving with unsaved changes should require a confirm dialog.
2947
+ * @default true
2948
+ */
2949
+ unsavedChangesRequireConfirmDialog?: boolean;
2950
+ };
2951
+ };
2952
+ /**
2953
+ * The entity service that needs to be provided in the providers array of the create page route.
2954
+ */
2955
+ declare const NGX_CREATE_DATA_ENTITY_SERVICE: InjectionToken<EntityService<any>>;
2956
+ /**
2957
+ * The entity class that needs to be provided in the providers array of the create page route.
2958
+ */
2959
+ declare const NGX_CREATE_DATA_ENTITY: InjectionToken<EntityClassNewable<any>>;
2960
+ /**
2961
+ * The configuration that needs to be provided in the providers array of the create page route.
2962
+ */
2963
+ declare const NGX_CREATE_DATA: InjectionToken<PageCreateData<any>>;
2964
+ /**
2965
+ * A generic page that allows you to create a specific entity.
2966
+ * For this to work you need to provide some data for the route.
2967
+ */
2968
+ declare class NgxMatEntityCreatePageComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit, UnsavedChangesPage {
2969
+ private readonly dialog;
2970
+ private readonly location;
2971
+ private readonly injector;
2972
+ readonly entityService: EntityService<EntityType>;
2973
+ private readonly EntityClass;
2974
+ private readonly inputData;
2975
+ private readonly http;
2976
+ private readonly el;
2977
+ private readonly renderer;
2978
+ protected readonly globalConfig: NgxGlobalDefaultValues;
2979
+ faChevronLeft: IconDefinition;
2980
+ faWarning: IconDefinition;
2981
+ /**
2982
+ * Contains HelperMethods around handling Entities and their property-metadata.
2983
+ */
2984
+ EntityUtilities: typeof EntityUtilities;
2985
+ /**
2986
+ * The entity to create.
2987
+ */
2988
+ entity: EntityType;
2989
+ /**
2990
+ * The entity before any changes have been made.
2991
+ * This is used to determine if leaving the page is possible without interruption.
2992
+ */
2993
+ entityPriorChanges: EntityType;
2994
+ /**
2995
+ * Configuration data for this component.
2996
+ */
2997
+ data: PageCreateDataInternal<EntityType>;
2998
+ /**
2999
+ * All validation errors of the entity.
3000
+ */
3001
+ validationErrors: ValidationError[];
3002
+ /**
3003
+ * Whether or not the entity is valid.
3004
+ */
3005
+ isEntityValid: boolean;
3006
+ /**
3007
+ * Whether or not the entity is dirty.
3008
+ */
3009
+ isEntityDirty: boolean;
3010
+ /**
3011
+ * What to display inside the tooltip.
3012
+ */
3013
+ tooltipContent: string;
3014
+ /**
3015
+ * Whether or not the page has been loaded.
3016
+ */
3017
+ isLoaded: boolean;
3018
+ private inConfirmNavigation;
3019
+ get hasUnsavedChanges(): boolean;
3020
+ constructor(dialog: MatDialog, location: Location, injector: EnvironmentInjector, entityService: EntityService<EntityType>, EntityClass: EntityClassNewable<EntityType>, inputData: PageCreateData<EntityType>, http: HttpClient, el: ElementRef, renderer: Renderer2, globalConfig: NgxGlobalDefaultValues);
3021
+ ngOnInit(): void;
3022
+ canDeactivate(): boolean;
3023
+ /**
3024
+ * Checks if the bottom row should be displayed as fixed.
3025
+ */
3026
+ checkOffset(): void;
3027
+ /**
3028
+ * Checks if the entity has become invalid or dirty.
3029
+ */
3030
+ checkEntity(): Promise<void>;
3031
+ private checkIsEntityValid;
3032
+ /**
3033
+ * Tries create the entity and navigate back afterwards.
3034
+ * Also handles the confirmation if required.
3035
+ */
3036
+ create(): Promise<void>;
3037
+ private confirmCreate;
3038
+ /**
3039
+ * Tries to navigate back.
3040
+ */
3041
+ navigateBack(): Promise<void>;
3042
+ openConfirmNavigationDialog(): Promise<boolean>;
3043
+ private confirmNavigateBack;
3044
+ /**
3045
+ * Checks if the input with the given key is readonly.
3046
+ * @param key - The key for the input to check.
3047
+ * @returns Whether or not the input for the key is read only.
3048
+ */
3049
+ isReadOnly(key: keyof EntityType): boolean;
3050
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityCreatePageComponent<any>, never>;
3051
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityCreatePageComponent<any>, "ngx-mat-entity-create-page", never, {}, {}, never, never, true, never>;
3052
+ }
3053
+
3054
+ /**
3055
+ * The definition for a route to use with the "NgxMatEntityEditPageComponent".
3056
+ */
3057
+ interface EditDataRoute extends Route {
3058
+ loadComponent: () => Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>;
3059
+ providers: (Provider | EnvironmentProviders)[];
3060
+ title: string;
3061
+ path: string;
3062
+ }
3063
+ /**
3064
+ * The default data for a edit route.
3065
+ */
3066
+ declare const defaultEditDataRoute: Omit<EditDataRoute, 'providers'>;
3067
+
3068
+ /**
3069
+ * The Definition of the Edit Entity Dialog or page Data.
3070
+ */
3071
+ interface EditEntityData<EntityType extends BaseEntityType<EntityType>> {
3072
+ /**
3073
+ * The entity to edit.
3074
+ */
3075
+ entity: EntityType;
3076
+ /**
3077
+ * The Entity Service class used for updating/deleting the entity.
3078
+ */
3079
+ EntityServiceClass: EntityServiceClassNewable<EntityType>;
3080
+ /**
3081
+ * The info of the generic edit-dialog.
3082
+ */
3083
+ editData?: EditData<EntityType>;
3084
+ /**
3085
+ * Whether or not the user can delete this specific entity.
3086
+ */
3087
+ allowDelete?: (entity: EntityType) => boolean;
3088
+ /**
3089
+ * Whether or not the user can update this specific entity.
3090
+ */
3091
+ allowUpdate?: (entity: EntityType) => boolean;
3092
+ }
3093
+
3094
+ /**
3095
+ * The internal EditEntityData. Requires all default values the user can leave out.
3096
+ */
3097
+ declare class EditEntityDataInternal<EntityType extends BaseEntityType<EntityType>> implements EditEntityData<EntityType> {
3098
+ entity: EntityType;
3099
+ EntityServiceClass: EntityServiceClassNewable<EntityType>;
3100
+ editData: EditDataInternal<EntityType>;
3101
+ allowUpdate: (entity: EntityType) => boolean;
3102
+ allowDelete: (entity: EntityType) => boolean;
3103
+ constructor(entity: EntityType, EntityServiceClass: EntityServiceClassNewable<EntityType>, editData: EditDataInternal<EntityType>, allowUpdate: (entity: EntityType) => boolean, allowDelete: (entity: EntityType) => boolean);
3104
+ }
3105
+
3106
+ type PageEditDataInternal<EntityType extends BaseEntityType<EntityType>> = Omit<EditEntityDataInternal<EntityType>, 'entity' | 'EntityServiceClass'> & {
3107
+ displayLoadingSpinner: boolean;
3108
+ editData: EditDataInternal<EntityType> & {
3109
+ confirmUnsavedChangesDialogData: ConfirmDialogDataInternal;
3110
+ unsavedChangesRequireConfirmDialog: boolean;
3111
+ };
3112
+ };
3113
+
3114
+ /**
3115
+ * The data that needs to be provided for a route to be able to edit a entity.
3116
+ */
3117
+ type PageEditData<EntityType extends BaseEntityType<EntityType>> = Omit<EditEntityData<EntityType>, 'entity' | 'EntityServiceClass'> & {
3118
+ /**
3119
+ * Whether or not to display a loading spinner while the entity for the page is loaded.
3120
+ * @default true
3121
+ */
3122
+ displayLoadingSpinner?: boolean;
3123
+ /**
3124
+ * The data of the default edit page.
3125
+ */
3126
+ editData?: EditData<EntityType> & {
3127
+ /**
3128
+ * The data for the dialog when the user tries to leave the site with unsaved changes.
3129
+ */
3130
+ confirmUnsavedChangesDialogData?: ConfirmDialogData;
3131
+ /**
3132
+ * Whether or not leaving with unsaved changes should require a confirm dialog.
3133
+ * @default true
3134
+ */
3135
+ unsavedChangesRequireConfirmDialog?: boolean;
3136
+ };
3137
+ };
3138
+ /**
3139
+ * The entity service that needs to be provided in the providers array of the edit page route.
3140
+ */
3141
+ declare const NGX_EDIT_DATA_ENTITY_SERVICE: InjectionToken<EntityService<any>>;
3142
+ /**
3143
+ * The entity class that needs to be provided in the providers array of the edit page route.
3144
+ */
3145
+ declare const NGX_EDIT_DATA_ENTITY: InjectionToken<EntityClassNewable<any>>;
3146
+ /**
3147
+ * The configuration that needs to be provided in the providers array of the edit page route.
3148
+ */
3149
+ declare const NGX_EDIT_DATA: InjectionToken<PageEditData<any>>;
3150
+ /**
3151
+ * A generic page that allows you to edit a specific entity.
3152
+ * For this to work you need to provide some data for the route.
3153
+ */
3154
+ declare class NgxMatEntityEditPageComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit, UnsavedChangesPage {
3155
+ private readonly dialog;
3156
+ private readonly location;
3157
+ private readonly route;
3158
+ private readonly injector;
3159
+ readonly entityService: EntityService<EntityType>;
3160
+ private readonly EntityClass;
3161
+ private readonly inputData;
3162
+ private readonly http;
3163
+ private readonly el;
3164
+ private readonly renderer;
3165
+ protected readonly globalConfig: NgxGlobalDefaultValues;
3166
+ faChevronLeft: IconDefinition;
3167
+ faWarning: IconDefinition;
3168
+ /**
3169
+ * Contains HelperMethods around handling Entities and their property-metadata.
3170
+ */
3171
+ EntityUtilities: typeof EntityUtilities;
3172
+ /**
3173
+ * The entity that is being edited.
3174
+ */
3175
+ entity: EntityType;
3176
+ /**
3177
+ * The entity before any changes have been made.
3178
+ */
3179
+ entityPriorChanges: EntityType;
3180
+ /**
3181
+ * Configuration data for the component.
3182
+ */
3183
+ data: PageEditDataInternal<EntityType>;
3184
+ /**
3185
+ * All validation errors of the entity.
3186
+ */
3187
+ validationErrors: ValidationError[];
3188
+ /**
3189
+ * Whether or not the entity is valid.
3190
+ */
3191
+ isEntityValid: boolean;
3192
+ /**
3193
+ * All changes that have been done to the entity.
3194
+ */
3195
+ changes: Difference<EntityType>[];
3196
+ /**
3197
+ * Whether or not the entity is dirty.
3198
+ */
3199
+ isEntityDirty: boolean;
3200
+ /**
3201
+ * What to display inside the tooltip.
3202
+ */
3203
+ tooltipContent: string;
3204
+ /**
3205
+ * Whether or not the entity is readonly.
3206
+ */
3207
+ isEntityReadOnly: boolean;
3208
+ /**
3209
+ * Whether or not the current user is allowed to delete the entity.
3210
+ */
3211
+ allowDelete: boolean;
3212
+ /**
3213
+ * Whether or not the page has been loaded.
3214
+ */
3215
+ isLoaded: boolean;
3216
+ private inConfirmNavigation;
3217
+ get hasUnsavedChanges(): boolean;
3218
+ constructor(dialog: MatDialog, location: Location, route: ActivatedRoute, injector: EnvironmentInjector, entityService: EntityService<EntityType>, EntityClass: EntityClassNewable<EntityType>, inputData: PageEditData<EntityType>, http: HttpClient, el: ElementRef, renderer: Renderer2, globalConfig: NgxGlobalDefaultValues);
3219
+ ngOnInit(): void;
3220
+ /**
3221
+ * Checks if the bottom row should be displayed as fixed.
3222
+ */
3223
+ checkOffset(): void;
3224
+ canDeactivate(): boolean;
3225
+ /**
3226
+ * Checks if the entity has become invalid or dirty.
3227
+ */
3228
+ checkEntity(): Promise<void>;
3229
+ private checkIsEntityValid;
3230
+ /**
3231
+ * Tries to save the changes and close the dialog afterwards.
3232
+ * Also handles the confirmation if required.
3233
+ */
3234
+ edit(): Promise<void>;
3235
+ private confirmEdit;
3236
+ /**
3237
+ * Tries to delete the entity and close the dialog afterwards.
3238
+ * Also handles the confirmation if required.
3239
+ */
3240
+ delete(): Promise<void>;
3241
+ private confirmDelete;
3242
+ /**
3243
+ * Tries to navigate back.
3244
+ */
3245
+ navigateBack(): Promise<void>;
3246
+ openConfirmNavigationDialog(): Promise<boolean>;
3247
+ private confirmNavigateBack;
3248
+ /**
3249
+ * Runs the edit action on the entity.
3250
+ * @param action - The action to run.
3251
+ */
3252
+ runEditAction(action: EditActionInternal<EntityType>): Promise<void>;
3253
+ private confirmRunEditAction;
3254
+ /**
3255
+ * Checks if an EditAction is disabled (e.g. Because the current entry doesn't fullfil the requirements).
3256
+ * @param action - The EditAction to check.
3257
+ * @returns Whether or not the Action can be used.
3258
+ */
3259
+ editActionDisabled(action: EditActionInternal<EntityType>): boolean;
3260
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityEditPageComponent<any>, never>;
3261
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityEditPageComponent<any>, "ngx-mat-entity-edit-page", never, {}, {}, never, never, true, never>;
3262
+ }
3263
+
3264
+ /**
3265
+ * Provides functionality around material selections inside of tables.
3266
+ */
3267
+ declare abstract class SelectionUtilities {
3268
+ /**
3269
+ * Checks if all items in the table have been selected.
3270
+ * This is needed to display the "masterToggle"-checkbox correctly.
3271
+ * @param selection - The selection to check.
3272
+ * @param dataSource - The dataSource of the selection.
3273
+ * @returns Whether or not all items in the table have been selected.
3274
+ */
3275
+ static isAllSelected(selection: SelectionModel<any>, dataSource: MatTableDataSource<any>): boolean;
3276
+ /**
3277
+ * Toggles all items in the table.
3278
+ * @param selection - The selection to toggle.
3279
+ * @param dataSource - The dataSource of the selection.
3280
+ */
3281
+ static masterToggle(selection: SelectionModel<any>, dataSource: MatTableDataSource<any>): void;
3282
+ /**
3283
+ * Removes all selected entries from the array.
3284
+ * @param selection - The selection containing the items to remove.
3285
+ * @param values - The values of the dataSource.
3286
+ * @param dataSource - The dataSource.
3287
+ */
3288
+ static remove(selection: SelectionModel<any>, values: any[], dataSource: MatTableDataSource<any>): void;
3289
+ }
3290
+
3291
+ /**
3292
+ * Configuration for the custom table.
3293
+ */
3294
+ interface CustomTableConfiguration<T = unknown> {
3295
+ /**
3296
+ * Configuration for css classes that should be applied to table rows based on a condition.
3297
+ * This could be used to eg. Set the background color to green when an item has the status completed etc.
3298
+ * INFO: You need to use ng-deep or apply the styling in the styles.scss.
3299
+ * @default () => []
3300
+ */
3301
+ dynamicRowStyleClasses?: DynamicStyleClasses<T>;
3302
+ /**
3303
+ * The columns to display inside the custom table.
3304
+ */
3305
+ displayColumns: DisplayColumn<T>[];
3306
+ /**
3307
+ * Whether or not a loading spinner should be shown.
3308
+ * Only works when you provide the "loading" input to the custom table.
3309
+ * @default true
3310
+ */
3311
+ displayLoadingSpinner?: boolean;
3312
+ /**
3313
+ * Whether or not the select column should be enabled.
3314
+ * @default true
3315
+ */
3316
+ withSelection: boolean;
3317
+ /**
3318
+ * A function that resolves a row value to a string that can be searched for.
3319
+ * By default this uses a built in search filter.
3320
+ */
3321
+ searchStringForRow?: (value: T) => string;
3322
+ /**
3323
+ * Whether or not the user is allowed to click on entries in the custom table.
3324
+ * @default () => true
3325
+ */
3326
+ allowClick?: (value: T) => boolean;
3327
+ /**
3328
+ * An error message to show when the table contains no entries.
3329
+ * Also applies styling to the table.
3330
+ */
3331
+ emptyErrorMessage?: string;
3332
+ /**
3333
+ * Resolves the given id for an entity.
3334
+ * This is used for the referencesMany input,
3335
+ * where you want to show values of the entity in the table rows and not the id.
3336
+ */
3337
+ resolveToReferencedEntity?: (id: unknown) => unknown;
3338
+ }
3339
+ /**
3340
+ * Internal configuration for the custom table.
3341
+ * Provides default values.
3342
+ */
3343
+ declare class InternalCustomTableConfiguration<T = unknown> implements CustomTableConfiguration<T> {
3344
+ dynamicRowStyleClasses: DynamicStyleClasses<T>;
3345
+ displayColumns: DisplayColumn<T>[];
3346
+ displayLoadingSpinner: boolean;
3347
+ withSelection: boolean;
3348
+ searchStringForRow: (value: T) => string;
3349
+ allowClick: (value: T) => boolean;
3350
+ emptyErrorMessage: string;
3351
+ resolveToReferencedEntity?: (id: unknown) => unknown;
3352
+ constructor(globalConfig: NgxGlobalDefaultValues, configuration: CustomTableConfiguration<T>);
3353
+ }
3354
+
3355
+ /**
3356
+ * Generic type for contexts that can fill an inline template.
3357
+ */
3358
+ type TemplateContext<T> = {
3359
+ /**
3360
+ * 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.
3361
+ */
3362
+ $implicit: T;
3363
+ };
3364
+ /**
3365
+ * A form context that is used to fill an inline template.
3366
+ * This is used to go around the limitations of having everything in the same file due to circular dependencies.
3367
+ * The forms are used for object, hasMany, referencesMany and the dialogs.
3368
+ */
3369
+ type FormContext<EntityType extends BaseEntityType<EntityType>> = {
3370
+ /**
3371
+ * The entity to build the form for.
3372
+ */
3373
+ entity: EntityType;
3374
+ /**
3375
+ * The tabs to display.
3376
+ */
3377
+ tabs: EntityTab<EntityType>[];
3378
+ /**
3379
+ * Whether or not edit values should be omitted.
3380
+ */
3381
+ hideOmitForEdit?: boolean;
3382
+ /**
3383
+ * Whether or not create values should be omitted.
3384
+ */
3385
+ hideOmitForCreate?: boolean;
3386
+ /**
3387
+ * What happens when the input changes.
3388
+ */
3389
+ inputChangeEvent: () => void | Promise<void>;
3390
+ /**
3391
+ * Whether or not the input is readonly.
3392
+ */
3393
+ isReadOnly?: (property: EntityType, key: keyof EntityType) => boolean;
3394
+ /**
3395
+ * Whether or not the input is valid empty.
3396
+ */
3397
+ validEmpty?: () => boolean;
3398
+ };
3399
+ /**
3400
+ * A table context that is used to fill an inline template.
3401
+ * This is used to go around the limitations of having everything in the same file due to circular dependencies.
3402
+ * The table is used for entity array and hasMany.
3403
+ */
3404
+ type TableContext<T> = InternalCustomTableConfiguration & {
3405
+ /**
3406
+ * The data source of the table.
3407
+ */
3408
+ dataSource: MatTableDataSource<T>;
3409
+ /**
3410
+ * Whether or not a error message should be shown when the table is empty.
3411
+ */
3412
+ shouldShowMissingError: boolean;
3413
+ /**
3414
+ * The selection of the table.
3415
+ */
3416
+ selection: SelectionModel<T>;
3417
+ /**
3418
+ * What happens when a cell is clicked.
3419
+ */
3420
+ clickCell: (value: T, displayColumn: DisplayColumn<T>) => void;
3421
+ /**
3422
+ * Whether or not the data for the table is currently being loaded.
3423
+ */
3424
+ isLoading: boolean;
3425
+ /**
3426
+ * All columns that should be displayed.
3427
+ */
3428
+ displayedColumns: string[];
3429
+ };
3430
+ /**
3431
+ * The default input component. It gets the metadata of the property from the given @Input "entity" and @Input "propertyKey"
3432
+ * and displays the input field accordingly.
3433
+ *
3434
+ * You can also define a method that generates error-messages and if the input should be hidden when its metadata says
3435
+ * that it should be omitted for creating or updating.
3436
+ * The last part being mostly relevant if you want to use this component inside an ngFor.
3437
+ */
3438
+ declare class NgxMatEntityInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
3439
+ private readonly dialog;
3440
+ private readonly injector;
3441
+ private readonly router;
3442
+ protected readonly defaultGetValidationErrorMessage: (model: NgModel) => string;
3443
+ protected readonly globalConfig: NgxGlobalDefaultValues;
3444
+ private readonly http;
3445
+ faSearch: IconDefinition;
3446
+ /**
3447
+ * The entity on which the property exists. Used in conjunction with the "propertyKey"
3448
+ * to determine the property for which the input should be generated.
3449
+ */
3450
+ entity: EntityType;
3451
+ /**
3452
+ * The name of the property to generate the input for. Used in conjunction with the "entity".
3453
+ */
3454
+ propertyKey: keyof EntityType;
3455
+ /**
3456
+ * (optional) A custom function to generate the error-message for invalid inputs.
3457
+ */
3458
+ getValidationErrorMessage?: (model: NgModel) => string;
3459
+ internalGetValidationErrorMessage: (model: NgModel) => string;
3460
+ /**
3461
+ * Whether to hide a value if it is omitted for creation.
3462
+ * Is used internally for the object property.
3463
+ * @default false
3464
+ */
3465
+ hideOmitForCreate?: boolean;
3466
+ /**
3467
+ * Whether to hide a value if it is omitted for editing.
3468
+ * Is used internally for the object property.
3469
+ * @default false
3470
+ */
3471
+ hideOmitForEdit?: boolean;
3472
+ /**
3473
+ * Whether or not an empty value should be valid.
3474
+ * Is used internally for the object property.
3475
+ * @default undefined
3476
+ */
3477
+ validEmpty?: boolean;
3478
+ /**
3479
+ * Whether or not the input should be readonly.
3480
+ * In that case it is disabled, but most of the default styling is overwritten.
3481
+ * @default false
3482
+ */
3483
+ isReadOnly?: boolean;
3484
+ internalIsReadOnly: boolean;
3485
+ /**
3486
+ * Emits when the input value has been changed.
3487
+ */
3488
+ readonly inputChangeEvent: EventEmitter<void>;
3489
+ /**
3490
+ * A setter for the has many and array sort.
3491
+ * Is needed because the sort is inside a switch case,
3492
+ * which means that at ngOnInit it can't be initialized.
3493
+ */
3494
+ private set sort(value);
3495
+ /**
3496
+ * A setter for the has many and array paginator.
3497
+ * Is needed because the paginator is inside a switch case,
3498
+ * which means that at ngOnInit it can't be initialized.
3499
+ */
3500
+ private set paginator(value);
3501
+ /**
3502
+ * The type of the decorator for this input.
3503
+ */
3504
+ type: DecoratorTypes;
3505
+ /**
3506
+ * The property metadata received from the decorator.
3507
+ */
3508
+ metadata: PropertyDecoratorConfigInternal<unknown>;
3509
+ /**
3510
+ * The metadata of an object property.
3511
+ */
3512
+ metadataDefaultObject: DefaultObjectDecoratorConfigInternal<EntityType>;
3513
+ /**
3514
+ * The form context for an object property.
3515
+ */
3516
+ objectFormContext: TemplateContext<FormContext<EntityType>>;
3517
+ /**
3518
+ * The metadata of an dropdown object property.
3519
+ */
3520
+ metadataDropdownObject: DropdownObjectDecoratorConfigInternal<EntityType>;
3521
+ /**
3522
+ * All possible dropdown values for the object property.
3523
+ */
3524
+ private objectDropdownValues;
3525
+ /**
3526
+ * A unique input name for the references one property.
3527
+ */
3528
+ objectDropdownName: string;
3529
+ /**
3530
+ * All currently shown dropdown values for the object property.
3531
+ */
3532
+ filteredObjectDropdownValues: DropdownValue<EntityType | undefined>[];
3533
+ /**
3534
+ * The currently selected object as a drop down value.
3535
+ */
3536
+ get currentObjectDropdownValue(): DropdownValue<EntityType | undefined> | undefined;
3537
+ /**
3538
+ * Whether or not the current object dropdown value should be shown in the dropdown.
3539
+ */
3540
+ get shouldDisplayCurrentObjectDropdownValue(): boolean;
3541
+ /**
3542
+ * A compareWith method for the select.
3543
+ * Uses bind.
3544
+ */
3545
+ compareObjectsBound: (value1?: EntityType, value2?: EntityType) => boolean;
3546
+ private readonly addArrayItemDialog;
3547
+ private addArrayItemDialogRef;
3548
+ private readonly editArrayItemDialog;
3549
+ private editArrayItemDialogRef;
3550
+ /**
3551
+ * The metadata of an entity array property.
3552
+ */
3553
+ metadataEntityArray: EntityArrayDecoratorConfigInternal<EntityType>;
3554
+ /**
3555
+ * The table context for the entity array input.
3556
+ */
3557
+ entityArrayTableContext: TemplateContext<TableContext<EntityType>>;
3558
+ /**
3559
+ * The current array item to be added or updated.
3560
+ */
3561
+ arrayItem: EntityType;
3562
+ /**
3563
+ * The array item before any changes have been made. Used to check if the form is dirty.
3564
+ */
3565
+ arrayItemPriorChanges: EntityType;
3566
+ /**
3567
+ * The form context for adding an array item.
3568
+ */
3569
+ addArrayItemFormContext: TemplateContext<FormContext<EntityType>>;
3570
+ addArrayItemFormContext2: TemplateContext<FormContext<EntityType>>;
3571
+ /**
3572
+ * The form context for editing an array item.
3573
+ */
3574
+ editArrayItemFormContext: TemplateContext<FormContext<EntityType>>;
3575
+ /**
3576
+ * Whether or not the array item is valid.
3577
+ */
3578
+ isArrayItemValid: boolean;
3579
+ /**
3580
+ * Whether or not the array item is dirty.
3581
+ */
3582
+ isArrayItemDirty: boolean;
3583
+ /**
3584
+ * The index of the array item that is being edited.
3585
+ */
3586
+ private indexOfEditedArrayItem;
3587
+ /**
3588
+ * Config for the dialog that adds a new array item.
3589
+ */
3590
+ addArrayItemDialogData: CreateDataInternal;
3591
+ /**
3592
+ * The tabs to display inside the edit array item dialog.
3593
+ */
3594
+ editArrayItemDialogData: EditArrayItemDialogDataInternal<EntityType>;
3595
+ /**
3596
+ * All validation errors for the array item.
3597
+ */
3598
+ arrayItemValidationErrors: ValidationError[];
3599
+ /**
3600
+ * All the changes that have been done to the array item.
3601
+ */
3602
+ arrayItemChanges: Difference<EntityType>[];
3603
+ /**
3604
+ * What to display inside the array item tooltip.
3605
+ */
3606
+ arrayItemTooltipContent: string;
3607
+ /**
3608
+ * Metadata of a has many property.
3609
+ */
3610
+ metadataHasMany: HasManyDecoratorConfigInternal<EntityType, EntityType>;
3611
+ /**
3612
+ * The table context for the has many input.
3613
+ */
3614
+ hasManyTableContext: TemplateContext<TableContext<EntityType>>;
3615
+ /**
3616
+ * The has many import action.
3617
+ */
3618
+ hasManyImportAction: BaseTableActionInternal;
3619
+ private hasManyEntityService;
3620
+ private readonly createHasManyDialog;
3621
+ private createHasManyDialogRef;
3622
+ private readonly editHasManyDialog;
3623
+ private editHasManyDialogRef;
3624
+ /**
3625
+ * A single has many entity.
3626
+ */
3627
+ hasManyEntity: EntityType;
3628
+ /**
3629
+ * The single has many entity before any changes have been made. Is used to determine if the form is dirty.
3630
+ */
3631
+ hasManyEntityPriorChanges: EntityType;
3632
+ /**
3633
+ * Whether or not the has many entity is valid.
3634
+ */
3635
+ isHasManyEntityValid: boolean;
3636
+ /**
3637
+ * All validation errors of the has many entity.
3638
+ */
3639
+ hasManyValidationErrors: ValidationError[];
3640
+ /**
3641
+ * All the changes that have been done to the has many entity.
3642
+ */
3643
+ hasManyChanges: Difference<EntityType>[];
3644
+ /**
3645
+ * What to display inside the has many tooltip.
3646
+ */
3647
+ hasManyTooltipContent: string;
3648
+ /**
3649
+ * Whether or not the has many entity is dirty.
3650
+ */
3651
+ isHasManyEntityDirty: boolean;
3652
+ /**
3653
+ * Whether or not the current user is allowed to create a has many entity.
3654
+ */
3655
+ hasManyAllowCreate: boolean;
3656
+ /**
3657
+ * The form context for creating an has many entity.
3658
+ */
3659
+ hasManyCreateFormContext: TemplateContext<FormContext<EntityType>>;
3660
+ /**
3661
+ * The form context for editing an has many entity.
3662
+ */
3663
+ hasManyEditFormContext: TemplateContext<FormContext<EntityType>>;
3664
+ private hasManyCreateBaseUrl;
3665
+ /**
3666
+ * The metadata for a references one property.
3667
+ */
3668
+ metadataReferencesOne: ReferencesOneDecoratorConfigInternal<EntityType>;
3669
+ /**
3670
+ * The values that can be possibly referenced.
3671
+ */
3672
+ private referencesOneAllReferencedEntities;
3673
+ /**
3674
+ * The possible references one dropdown values.
3675
+ */
3676
+ private referencesOneDropdownValues;
3677
+ /**
3678
+ * The filtered dropdown values that get displayed in the references one dropdown input.
3679
+ */
3680
+ filteredReferencesOneDropdownValues: DropdownValue<string>[];
3681
+ /**
3682
+ * A unique input name for the references one property.
3683
+ */
3684
+ referencesOneName: string;
3685
+ /**
3686
+ * The form context for an references one property.
3687
+ */
3688
+ referencesOneFormContext: TemplateContext<FormContext<EntityType>>;
3689
+ /**
3690
+ * The enum Values for all the different DecoratorTypes.
3691
+ */
3692
+ readonly DecoratorTypes: typeof DecoratorTypes;
3693
+ /**
3694
+ * Contains HelperMethods around handling Entities and their property-metadata.
3695
+ */
3696
+ EntityUtilities: typeof EntityUtilities;
3697
+ /**
3698
+ * Contains Helper Functions for handling date properties.
3699
+ */
3700
+ DateUtilities: typeof DateUtilities;
3701
+ /**
3702
+ * Provides functionality around material selections inside of tables.
3703
+ */
3704
+ SelectionUtilities: typeof SelectionUtilities;
3705
+ /**
3706
+ * Gets the currently selected dropdown value for references one.
3707
+ * Is needed so that the dropdown value will still be displayed,
3708
+ * even when the filter method removes the value from the selectable dropdown values.
3709
+ */
3710
+ get currentReferencesOneDropdownValue(): DropdownValue<string> | undefined;
3711
+ /**
3712
+ * Whether or not the currently selected references one value should be shown,
3713
+ * although it would have been filtered out by the search.
3714
+ */
3715
+ get shouldDisplayCurrentReferencesOneDropdownValue(): boolean;
3716
+ constructor(dialog: MatDialog, injector: EnvironmentInjector, router: Router, defaultGetValidationErrorMessage: (model: NgModel) => string, globalConfig: NgxGlobalDefaultValues, http: HttpClient);
3717
+ /**
3718
+ * Checks if the input with the given key on the given property is readonly.
3719
+ * @param property - The property on which to check the input.
3720
+ * @param key - The key for the input to check.
3721
+ * @returns Whether or not the input is readonly.
3722
+ */
3723
+ isPropertyReadOnly(property: EntityType, key: keyof EntityType): boolean;
3724
+ /**
3725
+ * Gets the value to display in the column.
3726
+ * Runs in environment context to enable injection.
3727
+ * @param entity - The entity to get the value from.
3728
+ * @param displayColumn - The display column to get the value from.
3729
+ * @returns The value of the display column.
3730
+ */
3731
+ getDisplayColumnValue(entity: EntityType, displayColumn: DisplayColumn<EntityType>): unknown;
3732
+ /**
3733
+ * Emits a cellClicked event when the clicked column is enabled and clicking is allowed by the configuration.
3734
+ * @param value - The value of the row that was clicked.
3735
+ * @param dCol - The display column of the row that was clicked.
3736
+ * @param context - The context of the table where the cell was clicked.
3737
+ */
3738
+ clickCell<T>(value: T, dCol: DisplayColumn<T>, context: TableContext<T>): void;
3739
+ ngOnInit(): void;
3740
+ private initReferencesOne;
3741
+ /**
3742
+ * Filters the references one dropdown values.
3743
+ * @param searchInput - The search input to filter for.
3744
+ */
3745
+ filterReferencesOneValues(searchInput: string): void;
3746
+ private initHasMany;
3747
+ private initEntityArray;
3748
+ private initDropdownObjectInput;
3749
+ private initObjectInput;
3750
+ private startImportJson;
3751
+ private importJson;
3752
+ /**
3753
+ * Checks if two objects are equal. Is needed for the dropdown.
3754
+ * @param value1 - The first object to compare.
3755
+ * @param value2 - The second object to compare.
3756
+ * @returns Whether or not the objects are the same.
3757
+ */
3758
+ private compareObjects;
3759
+ /**
3760
+ * Filters the dropdown values.
3761
+ * @param searchInput - The search input to filter for.
3762
+ */
3763
+ filterObjectDropdownValues(searchInput: string): void;
3764
+ /**
3765
+ * Sets the references one object using the input id.
3766
+ */
3767
+ setReferencesOneObject(): void;
3768
+ /**
3769
+ * Edits an entity. This either calls the edit-Method provided by the user or uses a default edit-dialog.
3770
+ * @param entity - The entity that should be updated.
3771
+ * @param dCol - The display column that was clicked on.
3772
+ * @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
3773
+ */
3774
+ editHasManyEntity(entity: EntityType, dCol: DisplayColumn<EntityType>): void;
3775
+ /**
3776
+ * Whether updating the provided entity from the has many property is allowed.
3777
+ * @param entity - A single value of the has many property that the user wants to edit.
3778
+ * @returns True when the user can edit the provided entity and false otherwise.
3779
+ */
3780
+ hasManyAllowUpdate(entity: EntityType): boolean;
3781
+ /**
3782
+ * Whether viewing the provided entity from the has many property is allowed.
3783
+ * @param entity - A single value of the has many property that the user wants to view.
3784
+ * @returns True when the user can view the provided entity and false otherwise.
3785
+ */
3786
+ hasManyAllowRead(entity: EntityType): boolean;
3787
+ /**
3788
+ * Whether deleting the provided entity from the has many property is allowed.
3789
+ * @param entity - A single value of the has many property that the user wants to delete.
3790
+ * @returns True when the user can delete the provided entity and false otherwise.
3791
+ */
3792
+ hasManyAllowDelete(entity: EntityType): boolean;
3793
+ /**
3794
+ * Checks if an EditAction is disabled (e.g. Because the current entry doesn't fullfil the requirements).
3795
+ * @param action - The EditAction to check.
3796
+ * @returns Whether or not the Action can be used.
3797
+ */
3798
+ hasManyEditActionDisabled(action: EditActionInternal<EntityType>): boolean;
3799
+ /**
3800
+ * Runs the edit action on the entity.
3801
+ * @param action - The action to run.
3802
+ */
3803
+ hasManyRunEditAction(action: EditActionInternal<EntityType>): Promise<void>;
3804
+ private confirmHasManyRunEditAction;
3805
+ private editHasManyDefaultPage;
3806
+ private editHasManyDefaultDialog;
3807
+ /**
3808
+ * Tries to save the changes and close the dialog afterwards.
3809
+ * Also handles the confirmation if required.
3810
+ */
3811
+ dialogEditHasMany(): Promise<void>;
3812
+ private dialogConfirmEditHasMany;
3813
+ /**
3814
+ * Tries to delete the entity and close the dialog afterwards.
3815
+ * Also handles the confirmation if required.
3816
+ */
3817
+ deleteHasManyEntity(): Promise<void>;
3818
+ private confirmDeleteHasManyEntity;
3819
+ /**
3820
+ * Cancels the editing of the has many entity and closes the dialog.
3821
+ */
3822
+ dialogCancelEditHasMany(): void;
3823
+ /**
3824
+ * Creates a new Entity. This either calls the create-Method provided by the user or uses a default create-dialog.
3825
+ * @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
3826
+ */
3827
+ createHasManyEntity(): void;
3828
+ private createHasManyDefaultPage;
3829
+ private createHasManyDefaultDialog;
3830
+ /**
3831
+ * Creates the has many entity over the dialog.
3832
+ */
3833
+ dialogCreateHasMany(): Promise<void>;
3834
+ private dialogConfirmCreateHasMany;
3835
+ /**
3836
+ * Cancels the creating of the has many entity and closes the dialog.
3837
+ */
3838
+ dialogCancelCreateHasMany(): void;
3839
+ /**
3840
+ * Runs the TableAction for all selected entries.
3841
+ * Also handles confirmation with an additional dial#og if configured.
3842
+ * @param action - The TableAction to run.
3843
+ */
3844
+ runHasManyTableAction(action: TableActionInternal<EntityType>): Promise<void>;
3845
+ private confirmRunHasManyTableAction;
3846
+ /**
3847
+ * Checks if an TableAction is disabled (e.g. Because no entries have been selected).
3848
+ * @param action - The TableAction to check.
3849
+ * @returns Whether or not the Action can be used.
3850
+ */
3851
+ hasManyTableActionDisabled(action: TableActionInternal<EntityType>): boolean;
3852
+ /**
3853
+ * Applies the search input to filter the table entries.
3854
+ * @param event - The keyup-event which contains the search-string of the user.
3855
+ */
3856
+ applyHasManyFilter(event: Event): void;
3857
+ /**
3858
+ * Checks if the entity is valid for updating and if it is dirty.
3859
+ */
3860
+ checkHasManyEntity(): Promise<void>;
3861
+ /**
3862
+ * Checks if the entity is valid.
3863
+ * @param omit - Whether values omitted for create or update should be left out.
3864
+ */
3865
+ checkIsHasManyEntityValid(omit: 'create' | 'update'): Promise<void>;
3866
+ /**
3867
+ * Checks whether the array item is valid and if the array item is dirty.
3868
+ */
3869
+ checkArrayItem(): Promise<void>;
3870
+ /**
3871
+ * Checks if the array item is dirty.
3872
+ */
3873
+ checkIsArrayItemDirty(): Promise<void>;
3874
+ /**
3875
+ * Checks if the arrayItem is valid.
3876
+ */
3877
+ checkIsArrayItemValid(): Promise<void>;
3878
+ /**
3879
+ * Emits that a the value has been changed.
3880
+ */
3881
+ emitChange(): void;
3882
+ /**
3883
+ * Tries to add an item to the entity array.
3884
+ * Does this either inline if the "createInline"-metadata is set to true
3885
+ * or in a separate dialog if it is set to false.
3886
+ */
3887
+ addEntity(): Promise<void>;
3888
+ /**
3889
+ * Adds the array item defined in the dialog.
3890
+ */
3891
+ addArrayItem(): Promise<void>;
3892
+ /**
3893
+ * Cancels adding the array item defined in the dialog.
3894
+ */
3895
+ closeAddArrayItemDialog(): Promise<void>;
3896
+ /**
3897
+ * Edits an entity array item.
3898
+ * @param entity - The entity that has been clicked.
3899
+ * @param dCol - The display column that was clicked on.
3900
+ */
3901
+ editArrayItem(entity: EntityType, dCol: DisplayColumn<EntityType>): Promise<void>;
3902
+ /**
3903
+ * Saves changes on the array item in the dialog.
3904
+ */
3905
+ saveArrayItem(): void;
3906
+ /**
3907
+ * Closes the edit array item dialog and resets changes.
3908
+ */
3909
+ closeEditArrayItemDialog(): Promise<void>;
3910
+ /**
3911
+ * Removes all selected entries from the entity array.
3912
+ */
3913
+ removeFromEntityArray(): void;
3914
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputComponent<any>, never>;
3915
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInputComponent<any>, "ngx-mat-entity-input", never, { "entity": { "alias": "entity"; "required": true; }; "propertyKey": { "alias": "propertyKey"; "required": true; }; "getValidationErrorMessage": { "alias": "getValidationErrorMessage"; "required": false; }; "hideOmitForCreate": { "alias": "hideOmitForCreate"; "required": false; }; "hideOmitForEdit": { "alias": "hideOmitForEdit"; "required": false; }; "validEmpty": { "alias": "validEmpty"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never, true, never>;
3916
+ }
3917
+
3918
+ /**
3919
+ * The default dialog used to create new entities based on the configuration passed in the MAT_DIALOG_DATA "inputData".
3920
+ * Used by the ngx-mat-entity-table.
3921
+ *
3922
+ * It offers a lot of customization options which can be found in "CreateEntityDialogData".
3923
+ */
3924
+ declare class NgxMatEntityCreateDialogComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
3925
+ private readonly inputData;
3926
+ readonly dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>;
3927
+ private readonly injector;
3928
+ private readonly dialog;
3929
+ private readonly http;
3930
+ private readonly globalConfig;
3931
+ /**
3932
+ * Emits when the form is dirty.
3933
+ */
3934
+ readonly unsavedChanges: EventEmitter<boolean>;
3935
+ /**
3936
+ * Contains HelperMethods around handling Entities and their property-metadata.
3937
+ */
3938
+ EntityUtilities: typeof EntityUtilities;
3939
+ /**
3940
+ * The services that handles the entity.
3941
+ */
3942
+ entityService: EntityService<EntityType>;
3943
+ /**
3944
+ * The internal configuration data.
3945
+ */
3946
+ data: CreateEntityDataInternal<EntityType>;
3947
+ private entityPriorChanges;
3948
+ /**
3949
+ * Whether or not the entity is dirty.
3950
+ */
3951
+ isEntityDirty: boolean;
3952
+ /**
3953
+ * Whether or not the entity is valid.
3954
+ */
3955
+ isEntityValid: boolean;
3956
+ /**
3957
+ * The validation errors of the entity.
3958
+ */
3959
+ validationErrors: ValidationError[];
3960
+ /**
3961
+ * What to display inside the tooltip.
3962
+ */
3963
+ tooltipContent: string;
3964
+ constructor(inputData: CreateEntityData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>, injector: EnvironmentInjector, dialog: MatDialog, http: HttpClient, globalConfig: NgxGlobalDefaultValues);
3965
+ ngOnInit(): void;
3966
+ /**
3967
+ * Checks if the entity is valid.
3968
+ */
3969
+ checkIsEntityValid(): Promise<void>;
3970
+ /**
3971
+ * Tries add the new entity and close the dialog afterwards.
3972
+ * Also handles the confirmation if required.
3973
+ */
3974
+ create(): Promise<void>;
3975
+ private confirmCreate;
3976
+ /**
3977
+ * Closes the dialog.
3978
+ */
3979
+ cancel(): Promise<void>;
3980
+ private confirmCancel;
3981
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityCreateDialogComponent<any>, never>;
3982
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityCreateDialogComponent<any>, "ngx-mat-entity-create-dialog", never, {}, { "unsavedChanges": "unsavedChanges"; }, never, never, true, never>;
3983
+ }
3984
+
3985
+ /**
3986
+ * A multi select action that imports the data from a json file.
3987
+ * @param EntityServiceClass - The entity class that handles importing the file.
3988
+ */
3989
+ declare function importFromJsonMultiAction<EntityType extends BaseEntityType<EntityType>>(EntityServiceClass: Type<EntityService<EntityType>>): void;
3990
+ /**
3991
+ * A multi select action that exports the data as a json file.
3992
+ * @param selectedEntities - The selected entities to export.
3993
+ */
3994
+ declare function exportAsJsonMultiAction<EntityType extends BaseEntityType<EntityType>>(selectedEntities: EntityType[]): void;
3995
+ /**
3996
+ * A multi select action that exports the data as a csv file.
3997
+ * Object values get stringified.
3998
+ * @param selectedEntities - The selected entities to export.
3999
+ */
4000
+ declare function exportAsCsvMultiAction<EntityType extends BaseEntityType<EntityType>>(selectedEntities: EntityType[]): void;
4001
+ /**
4002
+ * A multi select action that exports the data as a xml file.
4003
+ * Object values get stringified.
4004
+ * @param selectedEntities - The selected entities to export.
4005
+ */
4006
+ declare function exportAsXmlMultiAction<EntityType extends BaseEntityType<EntityType>>(selectedEntities: EntityType[]): void;
4007
+
4008
+ /**
4009
+ * The default dialog used to edit an existing entity based on the configuration passed in the MAT_DIALOG_DATA "inputData".
4010
+ * Used by the ngx-mat-entity-table.
4011
+ *
4012
+ * It offers a lot of customization options which can be found in "EditEntityDialogData".
4013
+ */
4014
+ declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
4015
+ private readonly inputData;
4016
+ dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>;
4017
+ private readonly injector;
4018
+ private readonly dialog;
4019
+ private readonly http;
4020
+ private readonly globalConfig;
4021
+ /**
4022
+ * Emits when the form is dirty.
4023
+ */
4024
+ readonly unsavedChanges: EventEmitter<boolean>;
4025
+ /**
4026
+ * Contains HelperMethods around handling Entities and their property-metadata.
4027
+ */
4028
+ EntityUtilities: typeof EntityUtilities;
4029
+ /**
4030
+ * The service of the provided entity.
4031
+ */
4032
+ entityService: EntityService<EntityType>;
4033
+ /**
4034
+ * The entity before any changes have been applied.
4035
+ */
4036
+ entityPriorChanges: EntityType;
4037
+ /**
4038
+ * The internal configuration data.
4039
+ */
4040
+ data: EditEntityDataInternal<EntityType>;
4041
+ /**
4042
+ * Whether or not the entity is valid.
4043
+ */
4044
+ isEntityValid: boolean;
4045
+ /**
4046
+ * Whether or not the entity is dirty.
4047
+ */
4048
+ isEntityDirty: boolean;
4049
+ /**
4050
+ * The validation errors of the entity.
4051
+ */
4052
+ validationErrors: ValidationError[];
4053
+ /**
4054
+ * All the changes that have been done to the entity.
4055
+ */
4056
+ changes: Difference<EntityType>[];
4057
+ /**
4058
+ * What to display inside the tooltip.
4059
+ */
4060
+ tooltipContent: string;
4061
+ /**
4062
+ * Whether or not the entity is readonly.
4063
+ */
4064
+ isEntityReadOnly: boolean;
4065
+ /**
4066
+ * Whether or not deleting the entity is allowed for the current user.
4067
+ */
4068
+ allowDelete: boolean;
4069
+ constructor(inputData: EditEntityData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>, injector: EnvironmentInjector, dialog: MatDialog, http: HttpClient, globalConfig: NgxGlobalDefaultValues);
4070
+ ngOnInit(): void;
4071
+ /**
4072
+ * Checks if the input with the given key is readonly.
4073
+ * @param key - The key for the input to check.
4074
+ * @returns Whether or not the input for the key is read only.
4075
+ */
4076
+ isReadOnly(key: keyof EntityType): boolean;
4077
+ /**
4078
+ * Checks if the entity has become invalid or dirty.
4079
+ */
4080
+ checkEntity(): Promise<void>;
4081
+ private checkIsEntityValid;
4082
+ /**
4083
+ * Tries to save the changes and close the dialog afterwards.
4084
+ * Also handles the confirmation if required.
4085
+ */
4086
+ edit(): Promise<void>;
4087
+ private confirmEdit;
4088
+ /**
4089
+ * Tries to delete the entity and close the dialog afterwards.
4090
+ * Also handles the confirmation if required.
4091
+ */
4092
+ delete(): Promise<void>;
4093
+ private confirmDelete;
4094
+ /**
4095
+ * Closes the dialog.
4096
+ */
4097
+ cancel(): Promise<void>;
4098
+ private confirmCancel;
4099
+ /**
4100
+ * Runs the edit action on the entity.
4101
+ * @param action - The action to run.
4102
+ */
4103
+ runEditAction(action: EditActionInternal<EntityType>): Promise<void>;
4104
+ private confirmRunEditAction;
4105
+ /**
4106
+ * Checks if an EditAction is disabled (e.g. Because the current entry doesn't fullfil the requirements).
4107
+ * @param action - The EditAction to check.
4108
+ * @returns Whether or not the Action can be used.
4109
+ */
4110
+ editActionDisabled(action: EditActionInternal<EntityType>): boolean;
4111
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityEditDialogComponent<any>, never>;
4112
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityEditDialogComponent<any>, "ngx-mat-entity-edit-dialog", never, {}, { "unsavedChanges": "unsavedChanges"; }, never, never, true, never>;
4113
+ }
4114
+
4115
+ /**
4116
+ * Generates a fully functional table for displaying, creating, updating and deleting entities
4117
+ * based on the configuration passed in the @Input "tableData".
4118
+ *
4119
+ * It offers a lot of customization options which can be found in "TableData".
4120
+ */
4121
+ declare class NgxMatEntityTableComponent<EntityType extends BaseEntityType<Entity>> implements OnInit {
4122
+ private readonly dialog;
4123
+ private readonly injector;
4124
+ private readonly router;
4125
+ private readonly globalConfig;
4126
+ /**
4127
+ * The configuration for the component.
4128
+ */
4129
+ tableData: TableData<EntityType>;
4130
+ /**
4131
+ * Emits when there are unsaved changes on either the create or update dialog.
4132
+ */
4133
+ readonly unsavedDialogChanges: EventEmitter<boolean>;
4134
+ /**
4135
+ * The internal TableData.
4136
+ */
4137
+ data: TableDataInternal<EntityType>;
4138
+ /**
4139
+ * Configuration for the table.
4140
+ */
4141
+ tableConfig: CustomTableConfiguration<EntityType>;
4142
+ /**
4143
+ * The entities to display inside the table.
4144
+ */
4145
+ entities: EntityType[];
4146
+ /**
4147
+ * A search string for filtering table results.
4148
+ */
4149
+ searchString: string;
4150
+ /**
4151
+ * The currently selected entities.
4152
+ */
4153
+ selected: EntityType[];
4154
+ /**
4155
+ * Whether or not the table content is currently loading.
4156
+ */
4157
+ isLoading: boolean;
4158
+ /**
4159
+ * Whether or not the current user is allowed to create entries for the table.
4160
+ */
4161
+ allowCreate: boolean;
4162
+ private entityService;
4163
+ /**
4164
+ * The internal BaseTableAction. Sets default values.
4165
+ */
4166
+ importAction: BaseTableActionInternal;
4167
+ constructor(dialog: MatDialog, injector: EnvironmentInjector, router: Router, globalConfig: NgxGlobalDefaultValues);
4168
+ /**
4169
+ * Sets up all the configuration for the table and the EntityService.
4170
+ */
4171
+ ngOnInit(): void;
4172
+ /**
4173
+ * Gets the value to display in the column.
4174
+ * Runs in environment context to enable injection.
4175
+ * @param entity - The entity to get the value from.
4176
+ * @param displayColumn - The display column to get the value from.
4177
+ * @returns The value of the display column.
4178
+ */
4179
+ getDisplayColumnValue(entity: EntityType, displayColumn: DisplayColumn<EntityType>): unknown;
4180
+ private startImportJson;
4181
+ private importJson;
4182
+ /**
4183
+ * Edits an entity. This either calls the edit-Method provided by the user or uses a default edit-dialog.
4184
+ * @param entity - The entity that should be updated.
4185
+ * @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
4186
+ */
4187
+ editEntity(entity: EntityType): void;
4188
+ /**
4189
+ * Whether updating the provided entity is allowed.
4190
+ * @param entity - The entity that the user wants to edit.
4191
+ * @returns True when the user can edit the provided entity and false otherwise.
4192
+ */
4193
+ allowUpdate(entity: EntityType): boolean;
4194
+ /**
4195
+ * Whether viewing the provided entity is allowed.
4196
+ * @param entity - The entity that the user wants to view.
4197
+ * @returns True when the user can view the provided entity and false otherwise.
4198
+ */
4199
+ allowRead(entity: EntityType): boolean;
4200
+ private editDefaultPage;
4201
+ private editDefaultDialog;
4202
+ /**
4203
+ * Creates a new Entity. This either calls the create-Method provided by the user or uses a default create-dialog.
4204
+ * @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
4205
+ */
4206
+ createEntity(): void;
4207
+ private createDefaultPage;
4208
+ private createDefaultDialog;
4209
+ /**
4210
+ * Runs the TableAction for all selected entries.
4211
+ * Also handles confirmation with an additional dialog if configured.
4212
+ * @param action - The TableAction to run.
4213
+ */
4214
+ runTableAction(action: TableActionInternal<EntityType>): Promise<void>;
4215
+ private confirmRunTableAction;
4216
+ /**
4217
+ * Checks if an TableAction is disabled (e.g. Because no entries have been selected).
4218
+ * @param action - The TableAction to check.
4219
+ * @returns Whether or not the Action can be used.
4220
+ */
4221
+ tableActionDisabled(action: TableActionInternal<EntityType>): boolean;
4222
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityTableComponent<any>, never>;
4223
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityTableComponent<any>, "ngx-mat-entity-table", never, { "tableData": { "alias": "tableData"; "required": true; }; }, { "unsavedDialogChanges": "unsavedDialogChanges"; }, never, never, true, never>;
4224
+ }
4225
+
4226
+ /**
4227
+ * A component that displays an info-symbol and a tooltip when it is hovered/clicked.
4228
+ */
4229
+ declare class TooltipComponent {
4230
+ faInfo: IconDefinition;
4231
+ /**
4232
+ * What to display inside the tooltip.
4233
+ */
4234
+ tooltipContent: string;
4235
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
4236
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "ngx-mat-entity-tooltip", never, { "tooltipContent": { "alias": "tooltipContent"; "required": true; }; }, {}, never, never, true, never>;
4237
+ }
4238
+
4239
+ /**
4240
+ * Decorator for setting and getting array property metadata.
4241
+ * @param metadata - The metadata of the array property.
4242
+ * @returns The method that defines the metadata.
4243
+ * @throws When the given type of the array-items is unknown.
4244
+ */
4245
+ declare function array<EntityType extends BaseEntityType<EntityType>>(metadata: EntityArrayDecoratorConfig<EntityType> | StringChipsArrayDecoratorConfig | AutocompleteStringChipsArrayDecoratorConfig | DateArrayDecoratorConfig | DateTimeArrayDecoratorConfig | DateRangeArrayDecoratorConfig): (target: object, propertyKey: string) => void;
4246
+
4247
+ /**
4248
+ * Decorator for setting and getting boolean property metadata.
4249
+ * @param metadata - The metadata of the boolean property.
4250
+ * @returns The method that defines the metadata.
4251
+ */
4252
+ declare function boolean(metadata: CheckboxBooleanDecoratorConfig | ToggleBooleanDecoratorConfig | DropdownBooleanDecoratorConfig): (target: object, propertyKey: string) => void;
4253
+
4254
+ /**
4255
+ * Decorator for setting and getting custom property metadata.
4256
+ * @param metadata - The metadata of the custom property.
4257
+ * @param metadataKeysToReset - Any metadata keys which values should be set to undefined on reset.
4258
+ * @returns The method that defines the metadata.
4259
+ */
4260
+ declare function custom<ValueType, CustomMetadataType extends BaseEntityType<CustomMetadataType>, EntityType extends BaseEntityType<EntityType>>(metadata: CustomDecoratorConfig<EntityType, ValueType, CustomMetadataType, any>, metadataKeysToReset?: string[]): (target: object, propertyKey: string) => void;
4261
+
4262
+ /**
4263
+ * Decorator for setting and getting date property metadata.
4264
+ * @param metadata - The metadata of the date property.
4265
+ * @returns The method that defines the metadata.
4266
+ */
4267
+ declare function date(metadata: DefaultDateDecoratorConfig | DateRangeDateDecoratorConfig | DateTimeDateDecoratorConfig): (target: object, propertyKey: string) => void;
4268
+
4269
+ /**
4270
+ * Decorator for setting and getting file property metadata.
4271
+ * @param metadata - The metadata of the file property.
4272
+ * @returns The method that defines the metadata.
4273
+ * @throws When an unknown metadata type was provided.
4274
+ */
4275
+ declare function file(metadata: DefaultFileDecoratorConfig | ImageFileDecoratorConfig): (target: object, propertyKey: string) => void;
4276
+
4277
+ /**
4278
+ * Decorator for setting and getting has many property metadata.
4279
+ * @param metadata - The metadata of the has many property.
4280
+ * @returns The method that defines the metadata.
4281
+ */
4282
+ declare function hasMany<EntityType extends BaseEntityType<EntityType>, RelatedBaseEntityType extends BaseEntityType<RelatedBaseEntityType>>(metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>): (target: object, propertyKey: string) => void;
4283
+
4284
+ /**
4285
+ * Decorator for setting and getting number property metadata.
4286
+ * @param metadata - The metadata of the number property.
4287
+ * @returns The method that defines the metadata.
4288
+ */
4289
+ declare function number(metadata: DefaultNumberDecoratorConfig | DropdownNumberDecoratorConfig | SliderNumberDecoratorConfig): (target: object, propertyKey: string) => void;
4290
+
4291
+ /**
4292
+ * Decorator for setting and getting object property metadata.
4293
+ * @param metadata - The metadata of the object property.
4294
+ * @returns The method that defines the metadata.
4295
+ */
4296
+ declare function object<EntityType extends BaseEntityType<EntityType>>(metadata: DefaultObjectDecoratorConfig<EntityType> | DropdownObjectDecoratorConfig<EntityType>): (target: object, propertyKey: string) => void;
4297
+
4298
+ /**
4299
+ * Decorator for setting and getting references many property metadata.
4300
+ * @param metadata - The metadata of the references many property.
4301
+ * @returns The method that defines the metadata.
4302
+ */
4303
+ declare function referencesMany<EntityType extends BaseEntityType<EntityType>>(metadata: ReferencesManyDecoratorConfig<EntityType>): (target: object, propertyKey: string) => void;
4304
+
4305
+ /**
4306
+ * Decorator for setting and getting references one property metadata.
4307
+ * @param metadata - The metadata of the references one property.
4308
+ * @returns The method that defines the metadata.
4309
+ */
4310
+ declare function referencesOne<EntityType extends BaseEntityType<EntityType>>(metadata: ReferencesOneDecoratorConfig<EntityType>): (target: object, propertyKey: string) => void;
4311
+
4312
+ /**
4313
+ * Decorator for setting and getting string Property metadata.
4314
+ * @param metadata - The metadata of the string property.
4315
+ * @returns The method that defines the metadata.
4316
+ */
4317
+ declare function string(metadata: DropdownStringDecoratorConfig | AutocompleteStringDecoratorConfig | DefaultStringDecoratorConfig | TextboxStringDecoratorConfig | PasswordStringDecoratorConfig): (target: object, propertyKey: string) => void;
4318
+
4319
+ /**
4320
+ * Dynamically applies css classes based on a provided function.
4321
+ */
4322
+ declare class DynamicStyleClassDirective<T> implements OnChanges {
4323
+ private readonly element;
4324
+ private readonly renderer;
4325
+ private styleClassesApplied;
4326
+ /**
4327
+ * The function that gets the css classes to dynamically apply.
4328
+ */
4329
+ dynamicStyleClasses: DynamicStyleClasses<T>;
4330
+ /**
4331
+ * The input for the dynamic style classes function.
4332
+ */
4333
+ value: T;
4334
+ constructor(element: ElementRef, renderer: Renderer2);
4335
+ ngOnChanges(): void;
4336
+ private applyDynamicClasses;
4337
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicStyleClassDirective<any>, never>;
4338
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicStyleClassDirective<any>, "[dynamicStyleClasses]", never, { "dynamicStyleClasses": { "alias": "dynamicStyleClasses"; "required": true; }; "value": { "alias": "value"; "required": true; }; }, {}, never, never, true, never>;
4339
+ }
4340
+
4341
+ /**
4342
+ * A Validator that checks if the input value is one of the provided values of the "includedIn" array.
4343
+ */
4344
+ declare class IncludedInValidatorDirective implements Validator {
4345
+ /**
4346
+ * The values that are valid for the input.
4347
+ */
4348
+ includedIn: unknown[] | undefined;
4349
+ validate(control: AbstractControl<unknown>): ValidationErrors | null;
4350
+ static ɵfac: i0.ɵɵFactoryDeclaration<IncludedInValidatorDirective, never>;
4351
+ static ɵdir: i0.ɵɵDirectiveDeclaration<IncludedInValidatorDirective, "[includedIn]", never, { "includedIn": { "alias": "includedIn"; "required": false; }; }, {}, never, never, true, never>;
4352
+ }
4353
+
4354
+ /**
4355
+ * A directive that only allows number inputs.
4356
+ */
4357
+ declare class NumberDirective {
4358
+ private readonly el;
4359
+ constructor(el: ElementRef);
4360
+ /**
4361
+ * Prevents the default event when a key is pressed that is not a valid number, eg. 'A', 'B', 'C', 'D' etc.
4362
+ * @param e - The keydown event from the user.
4363
+ */
4364
+ onKeyDown(e: KeyboardEvent): void;
4365
+ static ɵfac: i0.ɵɵFactoryDeclaration<NumberDirective, never>;
4366
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NumberDirective, "[number]", never, {}, {}, never, never, true, never>;
4367
+ }
4368
+
4369
+ /**
4370
+ * A directive that displays a tooltip on hover.
4371
+ */
4372
+ declare class TooltipDirective implements OnDestroy {
4373
+ private readonly el;
4374
+ private readonly renderer;
4375
+ /**
4376
+ * The content to display inside the tooltip.
4377
+ */
4378
+ tooltip: string;
4379
+ private tooltipElement?;
4380
+ private closeListeners;
4381
+ private openedByClick;
4382
+ constructor(el: ElementRef, renderer: Renderer2);
4383
+ /**
4384
+ * Toggles the tooltip.
4385
+ * @param event - The click event, is used to stop the propagation that would trigger the global click listener.
4386
+ */
4387
+ onClick(event: Event): void;
4388
+ /**
4389
+ * Shows the tooltip.
4390
+ */
4391
+ onMouseEnter(): void;
4392
+ /**
4393
+ * Hides the tooltip.
4394
+ */
4395
+ onMouseLeave(): void;
4396
+ /**
4397
+ * Hides the tooltip.
4398
+ */
4399
+ onResize(): void;
4400
+ private showTooltip;
4401
+ private registerCloseListeners;
4402
+ private getCloseListener;
4403
+ private hideTooltip;
4404
+ private removeCloseListeners;
4405
+ ngOnDestroy(): void;
4406
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
4407
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[tooltip]", never, { "tooltip": { "alias": "tooltip"; "required": true; }; }, {}, never, never, true, never>;
4408
+ }
4409
+
4410
+ /**
4411
+ * Provider for the default getValidationErrorMessage.
4412
+ */
4413
+ declare const NGX_GET_VALIDATION_ERROR_MESSAGE: InjectionToken<() => string>;
4414
+
4415
+ /**
4416
+ * Provider for the validation errors tooltip title.
4417
+ */
4418
+ declare const NgxValidationErrorsTooltipTitle: InjectionToken<string>;
4419
+ /**
4420
+ * The default function that gets the validation errors tooltip content.
4421
+ * @param validationErrors - All validation errors for which the tooltip content should be generated.
4422
+ * @returns A html string, containing a list of the name of each invalid property.
4423
+ */
4424
+ declare function getValidationErrorsTooltipContent(validationErrors: ValidationError[]): string;
4425
+
4426
+ /**
4427
+ * Provider for the changes tooltip title.
4428
+ */
4429
+ declare const NgxChangesTooltipTitle: InjectionToken<string>;
4430
+ /**
4431
+ * The default function that gets the changes tooltip content.
4432
+ * @param changes - All changes for which the tooltip content should be generated.
4433
+ * @returns A html string, containing a list of the name of each changed property.
4434
+ */
4435
+ declare function getChangesTooltipContent<EntityType extends BaseEntityType<EntityType>>(changes: Difference<EntityType>[]): string;
4436
+
4437
+ /**
4438
+ * Provides functionality regarding files.
4439
+ */
4440
+ declare abstract class FileUtilities {
4441
+ /**
4442
+ * Gets the accept value for the html input.
4443
+ * @param mimeTypes - The mimeTypes to get the accept string from.
4444
+ * @returns A comma separated string of all the provided mime types.
4445
+ */
4446
+ static getAcceptString(mimeTypes?: string[]): string;
4447
+ /**
4448
+ * Reads a url to display the given file.
4449
+ * @param file - The file to get the url from.
4450
+ * @returns A promise of the url. Undefined if no file was provided.
4451
+ */
4452
+ static getDataURLFromFile(file?: Blob): Promise<string | undefined>;
4453
+ /**
4454
+ * Gets a file from the given url.
4455
+ * @param url - The url to get the file from.
4456
+ * @param http - The angular HttpClient. Used to fetch files.
4457
+ * @returns A promise of the File.
4458
+ */
4459
+ private static getFileFromUrl;
4460
+ /**
4461
+ * Gets the file data with the blob from the given File Data.
4462
+ * @param data - The File Data to get the file data with blob from.
4463
+ * @param http - The angular HttpClient. Used to fetch files.
4464
+ * @returns FileDataWithFile.
4465
+ */
4466
+ static getFileData(data: FileData, http: HttpClient): Promise<FileDataWithFile>;
4467
+ /**
4468
+ * Downloads a single file from the given File Data.
4469
+ * @param fileData - The file data. Needs to contain a blob.
4470
+ */
4471
+ static downloadSingleFile(fileData: FileDataWithFile): void;
4472
+ /**
4473
+ * Downloads a blob.
4474
+ * @param blob - The blob to download.
4475
+ * @param name - The name of the downloaded file.
4476
+ */
4477
+ static downLoadBlob(blob: Blob, name?: string): void;
4478
+ /**
4479
+ * Downloads multiple files as a zip with the given name.
4480
+ * @param name - The name of the zip file to generate.
4481
+ * @param multiFileData - The file data array to put in the zip.
4482
+ * @param http - The angular HttpClient. Used to fetch files.
4483
+ */
4484
+ static downloadMultipleFiles(name: string, multiFileData: FileData[], http: HttpClient): Promise<void>;
4485
+ /**
4486
+ * Checks if the given file has a valid mime type.
4487
+ * @param type - The type of the file to check.
4488
+ * @param allowedMimeTypes - The allowed mime types.
4489
+ * @returns Whether or not the given file has a valid mime type.
4490
+ */
4491
+ static isMimeTypeValid(type: string, allowedMimeTypes: string[]): boolean;
4492
+ /**
4493
+ * Transform the given value to Megabytes.
4494
+ * @param value - The original value.
4495
+ * @param unit - If the value is B, KB or GB.
4496
+ * @returns The given value as bytes.
4497
+ */
4498
+ static transformToMegaBytes(value: number, unit: 'B' | 'KB' | 'GB'): number;
4499
+ private static transformToBytes;
4500
+ }
4501
+
4502
+ export { ArrayDecoratorConfig, DateUtilities, DecoratorTypes, DynamicStyleClassDirective, Entity, EntityService, EntityUtilities, FileUtilities, IncludedInValidatorDirective, NGX_COMPLETE_GLOBAL_DEFAULT_VALUES, NGX_CREATE_DATA, NGX_CREATE_DATA_ENTITY, NGX_CREATE_DATA_ENTITY_SERVICE, NGX_EDIT_DATA, NGX_EDIT_DATA_ENTITY, NGX_EDIT_DATA_ENTITY_SERVICE, NGX_GET_VALIDATION_ERROR_MESSAGE, NGX_GLOBAL_DEFAULT_VALUES, NgxChangesTooltipTitle, NgxMatEntityBaseDisplayColumnValueComponent, NgxMatEntityBaseInputComponent, NgxMatEntityConfirmDialogComponent, NgxMatEntityCreateDialogComponent, NgxMatEntityCreatePageComponent, NgxMatEntityEditDialogComponent, NgxMatEntityEditPageComponent, NgxMatEntityInputComponent, NgxMatEntityTableComponent, NgxValidationErrorsTooltipTitle, NumberDirective, TooltipComponent, TooltipDirective, UnsavedChangesGuard, ValidationUtilities, array, boolean, custom, date, defaultCreateDataRoute, defaultEditDataRoute, exportAsCsvMultiAction, exportAsJsonMultiAction, exportAsXmlMultiAction, file, getChangesTooltipContent, getValidationErrorsTooltipContent, hasMany, importFromJsonMultiAction, number, object, referencesMany, referencesOne, string };
4503
+ export type { AutocompleteStringChipsArrayDecoratorConfig, AutocompleteStringDecoratorConfig, BaseData, BaseEntityType, BaseTableAction, CheckboxBooleanDecoratorConfig, Col, ConfirmDialogData, ConfirmDialogTypes, CreateData, CreateDataRoute, CreateEntityData, CustomDecoratorConfig, DateArrayDecoratorConfig, DateRange, DateRangeArrayDecoratorConfig, DateRangeDateDecoratorConfig, DateTimeArrayDecoratorConfig, DateTimeDateDecoratorConfig, DecoratorType, DefaultDateDecoratorConfig, DefaultFileDecoratorConfig, DefaultNumberDecoratorConfig, DefaultObjectDecoratorConfig, DefaultStringDecoratorConfig, Difference, DisplayColumn, DropdownBooleanDecoratorConfig, DropdownNumberDecoratorConfig, DropdownObjectDecoratorConfig, DropdownStringDecoratorConfig, DropdownValue, DynamicStyleClasses, EditAction, EditArrayItemDialogData, EditData, EditDataRoute, EditEntityData, EntityArrayDecoratorConfig, EntityClassNewable, EntityRow, EntityServiceClassNewable, EntityTab, FileData, HasManyDecoratorConfig, Hour, ImageFileDecoratorConfig, Minute, MultiSelectAction, NgxGlobalDefaultValues, NumberDropdownValues, ObjectDropdownValues, PageCreateData, PageEditData, PasswordStringDecoratorConfig, Position, ReferencesManyDecoratorConfig, ReferencesOneDecoratorConfig, SliderNumberDecoratorConfig, StringAutocompleteValues, StringChipsArrayDecoratorConfig, StringDropdownValues, TableAction, TableColumnValue, TableData, TextboxStringDecoratorConfig, Time, ToggleBooleanDecoratorConfig, UnsavedChangesPage, ValidationError };