ngx-material-entity 18.2.6 → 20.0.1

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 +173 -168
  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
@@ -1,6 +0,0 @@
1
- /**
2
- * The default false function.
3
- * A boolean false is resolved to this.
4
- * @returns False.
5
- */
6
- export declare function defaultFalse(): boolean;
@@ -1,6 +0,0 @@
1
- import { DynamicStyleClasses } from '../components/table/table-data';
2
- /**
3
- * The default function to retrieve dynamic style classes.
4
- * Returns an empty array.
5
- */
6
- export declare const defaultDynamicStyleClasses: DynamicStyleClasses<any>;
@@ -1,6 +0,0 @@
1
- /**
2
- * The default true function.
3
- * A boolean true is resolved to this.
4
- * @returns True.
5
- */
6
- export declare function defaultTrue(): boolean;
@@ -1,11 +0,0 @@
1
- import { DropdownValue } from '../decorators/base/dropdown-value.interface';
2
- /**
3
- * Generic Type for all possible values that can be provided as dropdown values.
4
- */
5
- export type DropdownValues<T> = DropdownValue<T | undefined>[] | ((entity: any) => DropdownValue<T | undefined>[]) | ((entity: any) => Promise<DropdownValue<T | undefined>[]>);
6
- /**
7
- * Transforms the given dropdown values to an async function.
8
- * @param dropdownValues - The dropdown values to transform.
9
- * @returns An abstract function.
10
- */
11
- export declare function dropdownValuesToFunction<T>(dropdownValues: DropdownValues<T>): (entity: any) => Promise<DropdownValue<T | undefined>[]>;
@@ -1,13 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { BaseEntityType } from '../classes/entity.model';
3
- import { Difference } from '../utilities/entity.utilities';
4
- /**
5
- * Provider for the changes tooltip title.
6
- */
7
- export declare const NgxChangesTooltipTitle: InjectionToken<string>;
8
- /**
9
- * The default function that gets the changes tooltip content.
10
- * @param changes - All changes for which the tooltip content should be generated.
11
- * @returns A html string, containing a list of the name of each changed property.
12
- */
13
- export declare function getChangesTooltipContent<EntityType extends BaseEntityType<EntityType>>(changes: Difference<EntityType>[]): string;
@@ -1,7 +0,0 @@
1
- /**
2
- * Gets either the provided value or the default value, depending on if and what has been provided.
3
- * @param defaultValue - The default value to fallback when nothing has been provided.
4
- * @param value - The specific value configured by the user.
5
- * @returns Value if it is not null and not the CONFIG_NEEDS_UPDATE_KEY, defaultValue otherwise.
6
- */
7
- export declare function getConfigValue<ValueType>(defaultValue: ValueType, value?: ValueType): ValueType;
@@ -1,5 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- /**
3
- * Provider for the default getValidationErrorMessage.
4
- */
5
- export declare const NGX_GET_VALIDATION_ERROR_MESSAGE: InjectionToken<() => string>;
@@ -1,12 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { ValidationError } from '../utilities/validation.utilities';
3
- /**
4
- * Provider for the validation errors tooltip title.
5
- */
6
- export declare const NgxValidationErrorsTooltipTitle: InjectionToken<string>;
7
- /**
8
- * The default function that gets the validation errors tooltip content.
9
- * @param validationErrors - All validation errors for which the tooltip content should be generated.
10
- * @returns A html string, containing a list of the name of each invalid property.
11
- */
12
- export declare function getValidationErrorsTooltipContent(validationErrors: ValidationError[]): string;
@@ -1,6 +0,0 @@
1
- /**
2
- * Checks if the given function is async or not.
3
- * @param originalFunction - The function to check.
4
- * @returns True when the constructor name is 'AsyncFunction' and false otherwise.
5
- */
6
- export declare function isAsyncFunction(originalFunction: Function): boolean;
@@ -1,9 +0,0 @@
1
- import { TableColumnValue } from '../components/table/table-data';
2
- /**
3
- * Converts the given table column value to a string/number for sorting.
4
- * This also supports string dates, if you eg. Needed to format them.
5
- * @param value - The value to convert.
6
- * @returns A string or a number to sort by.
7
- * @throws When a value with an unknown type has been provided.
8
- */
9
- export declare function tableColumnValueToSortValue(value: TableColumnValue): string | number;
@@ -1,205 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- /**
3
- * All configurable default values.
4
- */
5
- export interface NgxGlobalDefaultValues {
6
- /**
7
- * The label for create buttons.
8
- * @default 'Create'
9
- */
10
- createLabel: string;
11
- /**
12
- * The label for edit buttons.
13
- * @default 'Edit'
14
- */
15
- editLabel: string;
16
- /**
17
- * The label for save buttons.
18
- * @default 'Save'
19
- */
20
- saveLabel: string;
21
- /**
22
- * The label for cancel buttons.
23
- * @default 'Cancel'
24
- */
25
- cancelLabel: string;
26
- /**
27
- * The label for add buttons.
28
- * @default 'Add'
29
- */
30
- addLabel: string;
31
- /**
32
- * The label for delete buttons.
33
- * @default 'Delete'
34
- */
35
- deleteLabel: string;
36
- /**
37
- * The label for back buttons.
38
- * @default 'Back'
39
- */
40
- backLabel: string;
41
- /**
42
- * The label for actions.
43
- * @default 'Actions'
44
- */
45
- actionsLabel: string;
46
- /**
47
- * The label for searches.
48
- * @default 'Search'
49
- */
50
- searchLabel: string;
51
- /**
52
- * The display value for the "true" value in dropdowns.
53
- * @default 'Yes'
54
- */
55
- dropdownTrue: string;
56
- /**
57
- * The display value for the "false" value in dropdowns.
58
- * @default 'No'
59
- */
60
- dropdownFalse: string;
61
- /**
62
- * The label for confirm buttons.
63
- * @default 'Confirm'
64
- */
65
- confirmLabel: string;
66
- /**
67
- * The title for a confirm dialog.
68
- * @default 'Confirmation'
69
- */
70
- defaultConfirmDialogTitle: string;
71
- /**
72
- * The text for a confirm dialog.
73
- * @default ['Do you really want to do this?']
74
- */
75
- defaultConfirmDialogText: string[];
76
- /**
77
- * The text for confirming a save action.
78
- * @default ['Do you really want to save all changes?']
79
- */
80
- confirmSaveText: string[];
81
- /**
82
- * The text for confirming a delete action.
83
- * @default ['Do you really want to delete this entity?']
84
- */
85
- confirmDeleteText: string[];
86
- /**
87
- * The label for the button to leave without changes.
88
- * @default 'Leave'
89
- */
90
- confirmUnsavedChangesLabel: string;
91
- /**
92
- * The label for the button to close a dialog without changes.
93
- * @default 'Close'
94
- */
95
- confirmUnsavedChangesDialogLabel: string;
96
- /**
97
- * The title for confirming to leave without changes.
98
- * @default 'Unsaved Changes'
99
- */
100
- confirmUnsavedChangesTitle: string;
101
- /**
102
- * The text for confirming to leave a page without changes.
103
- * @default ['You have unsaved changes that will be deleted when you leave this page.', 'Continue?']
104
- */
105
- confirmUnsavedChangesText: string[];
106
- /**
107
- * The text for confirming to leave a dialog without changes.
108
- * @default ['You have unsaved changes that will be deleted when you close this dialog.', 'Continue?']
109
- */
110
- confirmUnsavedChangesDialogText: string[];
111
- /**
112
- * The title for the add array item dialog.
113
- * @default 'Add to array'
114
- */
115
- addArrayItemTitle: string;
116
- /**
117
- * The text for confirming a create action.
118
- * @default ['Do you really want to create this entity?']
119
- */
120
- confirmCreateText: string[];
121
- /**
122
- * The text for confirming a multi select action.
123
- * @default selectedEntries => [`Do you really want to run this action on ${selectedEntries.length} entries?`]
124
- */
125
- confirmMultiSelectActionText: (selectedEntries: unknown[]) => string[];
126
- /**
127
- * The text for confirming a base action.
128
- * @default ['Do you really want to run this action?']
129
- */
130
- confirmBaseActionText: string[];
131
- /**
132
- * The text for confirming the json import.
133
- * @default ['Do you really want to import entities from the provided file?']
134
- */
135
- confirmImportJsonText: string[];
136
- /**
137
- * How table entities are edited by default.
138
- * @default 'dialog'
139
- */
140
- defaultEditMethod: 'dialog' | 'page';
141
- /**
142
- * How table entities are created by default.
143
- * @default 'dialog'
144
- */
145
- defaultCreateMethod: 'dialog' | 'page';
146
- /**
147
- * The error message to display when an array property is required and empty.
148
- * @default 'Needs to contain at least one value'
149
- */
150
- emptyArrayErrorMessage: string;
151
- /**
152
- * The label for remove actions.
153
- * @default 'Remove'
154
- */
155
- removeLabel: string;
156
- /**
157
- * The label for time values.
158
- * Mainly used inside date properties.
159
- * @default 'Time'
160
- */
161
- timeLabel: string;
162
- /**
163
- * The label for the date range start.
164
- * @default 'Start'
165
- */
166
- startLabel: string;
167
- /**
168
- * The label for the date range end.
169
- * @default 'End'
170
- */
171
- endLabel: string;
172
- /**
173
- * The error text for duplicate entries inside an array.
174
- * @default ['Adding duplicate entries to the array is not allowed.']
175
- */
176
- duplicateErrorText: string[];
177
- /**
178
- * The error title for duplicate entries inside an array.
179
- * @default 'Error adding duplicate item'
180
- */
181
- duplicateErrorTitle: string;
182
- /**
183
- * The title for editing an entities.
184
- * @default () => 'Edit'
185
- */
186
- editTitle: (entity: unknown) => string;
187
- /**
188
- * The label for an select action, eg. Dropdowns.
189
- * @default 'Select'
190
- */
191
- selectLabel: string;
192
- /**
193
- * The label for an "Add all" button.
194
- * @default 'Add all'
195
- */
196
- addAllLabel: string;
197
- }
198
- /**
199
- * The provider for global configuration values.
200
- */
201
- export declare const NGX_GLOBAL_DEFAULT_VALUES: InjectionToken<Partial<NgxGlobalDefaultValues>>;
202
- /**
203
- * The internal values consisting of default ones and values provided by the user in NGX_GLOBAL_DEFAULT_VALUES.
204
- */
205
- export declare const NGX_COMPLETE_GLOBAL_DEFAULT_VALUES: InjectionToken<NgxGlobalDefaultValues>;
@@ -1 +0,0 @@
1
- export declare const PLACEHOLDER: string;
package/public-api.d.ts DELETED
@@ -1,60 +0,0 @@
1
- /**
2
- * Public API Surface of ngx-material-entity.
3
- */
4
- export * from './classes/entity.model';
5
- export * from './components/confirm-dialog/confirm-dialog-data';
6
- export * from './components/confirm-dialog/confirm-dialog.component';
7
- export * from './components/create-page/create-data.route';
8
- export * from './components/create-page/create-page.component';
9
- export * from './components/edit-page/edit-data.route';
10
- export * from './components/edit-page/edit-page.component';
11
- export * from './components/input/base-input.component';
12
- export * from './components/input/input.component';
13
- export * from './components/table/create-dialog/create-entity-data';
14
- export * from './components/table/create-dialog/create-entity-dialog.component';
15
- export * from './components/table/default.actions';
16
- export * from './components/table/display-column-value/base-display-column-value.component';
17
- export * from './components/table/edit-dialog/edit-entity-data';
18
- export * from './components/table/edit-dialog/edit-entity-dialog.component';
19
- export * from './components/table/table-data';
20
- export * from './components/table/table.component';
21
- export * from './components/tooltip/tooltip.component';
22
- export * from './decorators/array/array-decorator.data';
23
- export * from './decorators/array/array.decorator';
24
- export * from './decorators/base/decorator-types.enum';
25
- export * from './decorators/base/dropdown-value.interface';
26
- export { Col, Position } from './decorators/base/property-decorator.data';
27
- export * from './decorators/boolean/boolean-decorator.data';
28
- export * from './decorators/boolean/boolean.decorator';
29
- export * from './decorators/custom/custom-decorator.data';
30
- export * from './decorators/custom/custom.decorator';
31
- export * from './decorators/date/date-decorator.data';
32
- export * from './decorators/date/date.decorator';
33
- export * from './decorators/file/file-decorator.data';
34
- export * from './decorators/file/file.decorator';
35
- export * from './decorators/has-many/has-many-decorator.data';
36
- export * from './decorators/has-many/has-many.decorator';
37
- export * from './decorators/number/number-decorator.data';
38
- export * from './decorators/number/number.decorator';
39
- export * from './decorators/object/object-decorator.data';
40
- export * from './decorators/object/object.decorator';
41
- export * from './decorators/references-many/references-many-decorator.data';
42
- export * from './decorators/references-many/references-many.decorator';
43
- export * from './decorators/references-one/references-one-decorator.data';
44
- export * from './decorators/references-one/references-one.decorator';
45
- export * from './decorators/string/string-decorator.data';
46
- export * from './decorators/string/string.decorator';
47
- export * from './directives/dynamic-style-class.directive';
48
- export * from './directives/included-in.directive';
49
- export * from './directives/number.directive';
50
- export * from './directives/tooltip.directive';
51
- export * from './functions/get-validation-error-message.function';
52
- export * from './functions/get-validation-errors-tooltip-content.function';
53
- export * from './functions/get-changes-tooltip-content.function';
54
- export * from './services/entity.service';
55
- export * from './services/unsaved-changes.guard';
56
- export * from './utilities/date.utilities';
57
- export * from './utilities/entity.utilities';
58
- export * from './utilities/file.utilities';
59
- export * from './utilities/validation.utilities';
60
- export * from './global-configuration-values';
@@ -1,146 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { EnvironmentInjector } from '@angular/core';
3
- import { BehaviorSubject } from 'rxjs';
4
- import { BaseEntityType } from '../classes/entity.model';
5
- /**
6
- * A generic EntityService class.
7
- * Offers basic CRUD-functionality.
8
- * You should create a service for every Entity you have.
9
- * If you extend from this you need to make sure that the extended Service can be injected.
10
- */
11
- export declare abstract class EntityService<EntityType extends BaseEntityType<EntityType>> {
12
- protected readonly http: HttpClient;
13
- protected readonly injector: EnvironmentInjector;
14
- /**
15
- * The base url used for api requests. If u want to have more control over this,
16
- * you can override the create, read, update and delete methods.
17
- *
18
- * Create Sends a POST-Request to baseUrl.
19
- *
20
- * Read Sends a GET-Request to baseUrl.
21
- *
22
- * Update Sends a PATCH-Request to baseUrl/{id}.
23
- *
24
- * Delete Sends a DEL-Request to baseUrl/{id}.
25
- */
26
- abstract readonly baseUrl: string;
27
- /**
28
- * The default route segment that comes before the id when editing an entity in a separate page, if no extra route has been provided.
29
- */
30
- readonly editBaseRoute: string;
31
- /**
32
- * The complete route that is used to create an entity in a separate page, if no extra route has been provided.
33
- */
34
- readonly createBaseRoute: string;
35
- /**
36
- * The key which holds the id value.
37
- * @default 'id'
38
- */
39
- readonly idKey: keyof EntityType;
40
- /**
41
- * A subject of all the entity values.
42
- * Can be subscribed to when you want to do a specific thing whenever the entities change.
43
- */
44
- readonly entitiesSubject: BehaviorSubject<EntityType[]>;
45
- /**
46
- * When frequently trying to find a single entity by an id (eg. When nesting relations)
47
- * you might send a lot of unnecessary requests.
48
- * Therefore the findById method tries to look in the already existing entities first,
49
- * IF the entities have been requested in the last READ_EXPIRATION_IN_MS milliseconds.
50
- * @default 900000 (5 minutes)
51
- */
52
- protected readonly READ_EXPIRATION_IN_MS: number;
53
- /**
54
- * Gets the entities in an array from the internal entitiesSubject.
55
- * @returns The current entities in form of an array.
56
- */
57
- get entities(): EntityType[];
58
- /**
59
- * The last time that the entities have been requested from the api.
60
- */
61
- lastRead?: Date;
62
- constructor(http: HttpClient, injector: EnvironmentInjector);
63
- /**
64
- * Creates a new Entity and pushes it to the entities array.
65
- * @param entity - The data of the entity to create.
66
- * All values that should be omitted will be removed from it inside this method.
67
- * @param baseUrl - The base url to send the post request to.
68
- * This can be used if you want to create an entity belonging to another, like "customers/{id}/invoices".
69
- * @returns A Promise of the created entity.
70
- */
71
- create(entity: EntityType, baseUrl?: string): Promise<EntityType>;
72
- /**
73
- * Imports everything from the provided json file.
74
- * @param file - The json file to import from.
75
- * @returns All entities that have been imported.
76
- */
77
- import(file: File): Promise<EntityType[]>;
78
- /**
79
- * Creates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
80
- * All file values are stored inside their respective property key and their name.
81
- * Form data is able to handle setting multiple files to the same key.
82
- * @param body - The body Of the request.
83
- * @param filePropertyKeys - All property keys that are files and need to be added to the form data.
84
- * @param entity - The entity to create. This is needed in addition to the body because the body doesn't contain any metadata.
85
- * @param baseUrl - The base url to send the post request to.
86
- * This can be used if you want to create an entity belonging to another, like "customers/{id}/invoices".
87
- * @returns The created entity from the server.
88
- */
89
- protected createWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType, baseUrl?: string): Promise<EntityType>;
90
- /**
91
- * Creates the entity with a normal json body in contrast to creating it with form data when the entity contains files.
92
- * @param body - The body Of the request.
93
- * @param baseUrl - The base url to send the post request to.
94
- * This can be used if you want to create an entity belonging to another, like "customers/{id}/invoices".
95
- * @returns The created entity from the server.
96
- */
97
- protected createWithJson(body: Partial<EntityType>, baseUrl?: string): Promise<EntityType>;
98
- /**
99
- * Gets all existing entities and pushes them to the entities array.
100
- * @param baseUrl - The base url for the request. Defaults to the baseUrl on the service.
101
- * @returns A Promise of all received Entities.
102
- */
103
- read(baseUrl?: string): Promise<EntityType[]>;
104
- /**
105
- * Tries to find an entity with the given id.
106
- * @param id - The id of the entity to find.
107
- * @returns The found entity.
108
- */
109
- findById(id: EntityType[keyof EntityType]): Promise<EntityType>;
110
- /**
111
- * Updates a specific Entity.
112
- * @param entity - The updated Entity
113
- * All values that should be omitted will be removed from it inside this method.
114
- * @param entityPriorChanges - The current Entity.
115
- * It Is used to get changed values and only update them instead of sending the whole entity data.
116
- */
117
- update(entity: EntityType, entityPriorChanges: EntityType): Promise<void>;
118
- /**
119
- * Builds the update request body from the given entity before and after its changes.
120
- * @param entity - The entity with changed values.
121
- * @param entityPriorChanges - The entity before any changes.
122
- * @returns A partial of only the changed values.
123
- */
124
- protected entityToUpdateRequestBody(entity: EntityType, entityPriorChanges: EntityType): Promise<Partial<EntityType>>;
125
- /**
126
- * Updates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
127
- * All file values are stored inside their respective property key and their name.
128
- * Form data is able to handle setting multiple files to the same key.
129
- * @param body - The request body. Already contains only properties that have changed.
130
- * @param filePropertyKeys - The keys of all properties which are files and need to separately be appended to the form data.
131
- * @param entity - The original entity. Is needed to get the metadata of all the files.
132
- * @param id - The id of the entity to update.
133
- */
134
- protected updateWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType, id: EntityType[keyof EntityType]): Promise<void>;
135
- /**
136
- * Updates the entity with a normal json body in contrast to updating it with form data when the entity contains files.
137
- * @param body - The body of the Request. Has already removed all unnecessary values.
138
- * @param id - The id of the entity to update.
139
- */
140
- protected updateWithJson(body: Partial<EntityType>, id: EntityType[keyof EntityType]): Promise<void>;
141
- /**
142
- * Deletes a specific Entity.
143
- * @param entity - The entity to delete.
144
- */
145
- delete(entity: EntityType): Promise<void>;
146
- }
@@ -1,23 +0,0 @@
1
- import { CanDeactivateFn } from '@angular/router';
2
- /**
3
- * Interface definition for a page that can work with the UnsavedChangesGuard.
4
- */
5
- export interface UnsavedChangesPage {
6
- /**
7
- * Whether the page can be left without confirmation of unsaved changes.
8
- * @returns Whether or not the page can be left without confirmation.
9
- */
10
- canDeactivate: () => boolean;
11
- /**
12
- * Opens the confirm dialog for navigating with unsaved changes.
13
- * @returns The the promise boolean result of the confirm dialog.
14
- */
15
- openConfirmNavigationDialog: () => Promise<boolean>;
16
- }
17
- /**
18
- * A guard that checks if the user has unsaved changes and then prompts a confirmation from him.
19
- * Is used by the ngx-material-entity edit and create pages.
20
- * @param component - The component, can be either an edit or create page.
21
- * @returns An observable containing whether or not the user can continue.
22
- */
23
- export declare const UnsavedChangesGuard: CanDeactivateFn<UnsavedChangesPage>;
@@ -1,92 +0,0 @@
1
- import { DateFilterFn } from '@angular/material/datepicker';
2
- import { DropdownValue } from '../decorators/base/dropdown-value.interface';
3
- /**
4
- * Helper type for hours and minutes.
5
- */
6
- type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
7
- /**
8
- * Helper type for hours and minutes.
9
- */
10
- type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
11
- /**
12
- * The possible hour values. Ranges from 0 to 23.
13
- */
14
- export type Hour = Range<0, 24>;
15
- /**
16
- * The possible minute values. Ranges from 0 to 59.
17
- */
18
- export type Minute = Range<0, 60>;
19
- /**
20
- * Represents a time value with hours and minutes.
21
- */
22
- export type Time = {
23
- /**
24
- * The hours in the 24 hour format.
25
- */
26
- hours: Hour;
27
- /**
28
- * The minutes of the time.
29
- */
30
- minutes: Minute;
31
- };
32
- /**
33
- * Valid steps from one time value to the next. Needs to be able to divide 60 minutes without remainder.
34
- */
35
- type MinuteSteps = 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30 | 60;
36
- /**
37
- * Contains Helper Functions for handling date properties.
38
- */
39
- export declare abstract class DateUtilities {
40
- /**
41
- * The default filter function to user when none was provided by the user.
42
- */
43
- static defaultDateFilter: DateFilterFn<Date | null | undefined>;
44
- /**
45
- * Gets the given value as a date value.
46
- * @param value - The value to get as a date.
47
- * @returns The given value as a date.
48
- */
49
- static asDate(value: unknown): Date;
50
- /**
51
- * Gets the default times used by the DateTime picker when nothing is specified by the user.
52
- * @param format - The time format. Defaults to 24.
53
- * @param minuteSteps - The steps from one time value to the next. Defaults to 30.
54
- * @returns Times in the 24 hour format from 0:00 until 23:30 in 30 minute steps.
55
- */
56
- static getDefaultTimes(format?: 12 | 24, minuteSteps?: MinuteSteps): DropdownValue<Time>[];
57
- private static getTimeDropdownValue;
58
- private static getFormattedHour;
59
- private static getFormattedMinute;
60
- /**
61
- * Gets the Time object from the given date.
62
- * @param value - The date to get the time object from.
63
- * @returns The Time object build from the date value.
64
- */
65
- static getTimeFromDate(value?: Date): Time | undefined;
66
- /**
67
- * Gets the dates between the two given gates. Does additional filtering based on the provided DateRange metadata.
68
- * @param startDate - The start date.
69
- * @param endDate - The end date.
70
- * @param filter - The custom filter from the metadata.
71
- * @returns All dates between the two provided dates. Includes start and end date.
72
- */
73
- static getDatesBetween(startDate: Date, endDate: Date, filter?: DateFilterFn<Date>): Date[];
74
- /**
75
- * Get all valid times for the dropdown of a datetime property.
76
- * @param times - All given times to filter.
77
- * @param date - The date of the datetime.
78
- * @param min - The function that defines the minimum time.
79
- * @param max - The function that defines the maximum time.
80
- * @param filter - A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
81
- * @returns All valid dropdown values for the datetime property.
82
- */
83
- static getValidTimesForDropdown(times: DropdownValue<Time | undefined>[], date?: Date, min?: (date?: Date) => Time, max?: (date?: Date) => Time, filter?: ((time: Time) => boolean) | (() => boolean)): DropdownValue<Time | undefined>[];
84
- /**
85
- * Checks if the time object has processable hours and minutes properties.
86
- * Doesn't check custom validators like min/max from the metadata configuration.
87
- * @param time - The time to check.
88
- * @returns Whether or not the time object is unprocessable.
89
- */
90
- static timeIsUnprocessable(time?: Time): boolean;
91
- }
92
- export {};