ngx-material-entity 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +533 -326
  2. package/capsulation/lodash.utilities.d.ts +62 -0
  3. package/capsulation/reflect.utilities.d.ts +56 -0
  4. package/classes/base.builder.d.ts +36 -0
  5. package/classes/date.utilities.d.ts +70 -0
  6. package/classes/entity.model.d.ts +19 -0
  7. package/classes/entity.service.d.ts +108 -0
  8. package/classes/entity.utilities.d.ts +180 -0
  9. package/classes/file.utilities.d.ts +52 -0
  10. package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +10 -11
  11. package/components/confirm-dialog/confirm-dialog-data.d.ts +4 -0
  12. package/components/confirm-dialog/confirm-dialog.component.d.ts +11 -0
  13. package/components/input/add-array-item-dialog-data.builder.d.ts +21 -0
  14. package/components/input/{array-table/add-array-item-dialog/add-array-item-dialog-data.d.ts → add-array-item-dialog-data.d.ts} +6 -3
  15. package/components/input/array/array-date-input/array-date-input.component.d.ts +22 -0
  16. package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +30 -0
  17. package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +32 -0
  18. package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +58 -0
  19. package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +51 -0
  20. package/components/input/array/array-table.class.d.ts +48 -0
  21. package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +17 -0
  22. package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +17 -0
  23. package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +17 -0
  24. package/components/input/date/date-input/date-input.component.d.ts +21 -0
  25. package/components/input/date/date-range-input/date-range-input.component.d.ts +27 -0
  26. package/components/input/date/date-time-input/date-time-input.component.d.ts +38 -0
  27. package/components/input/file/file-default-input/file-default-input.component.d.ts +21 -0
  28. package/components/input/file/file-image-input/file-image-input.component.d.ts +30 -0
  29. package/components/input/file/file-input/dragDrop.directive.d.ts +32 -0
  30. package/components/input/file/file-input/file-input.component.d.ts +32 -0
  31. package/components/input/input.component.d.ts +108 -39
  32. package/components/input/input.module.d.ts +37 -13
  33. package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +17 -0
  34. package/components/input/number/number-input/number-input.component.d.ts +17 -0
  35. package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +25 -0
  36. package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +17 -0
  37. package/components/input/string/string-input/string-input.component.d.ts +17 -0
  38. package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +17 -0
  39. package/components/table/create-dialog/create-dialog-data.builder.d.ts +9 -8
  40. package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +12 -6
  41. package/components/table/create-dialog/create-entity-dialog-data.d.ts +3 -3
  42. package/components/table/create-dialog/create-entity-dialog.component.d.ts +23 -7
  43. package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +11 -13
  44. package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +3 -3
  45. package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +12 -6
  46. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +25 -7
  47. package/components/table/table-data.builder.d.ts +25 -14
  48. package/components/table/table-data.d.ts +22 -10
  49. package/components/table/table.component.d.ts +48 -2
  50. package/components/table/table.module.d.ts +3 -1
  51. package/decorators/array/array-decorator-internal.data.d.ts +85 -9
  52. package/decorators/array/array-decorator.data.d.ts +200 -25
  53. package/decorators/array/array.decorator.d.ts +4 -4
  54. package/decorators/base/base-property.decorator.d.ts +2 -3
  55. package/decorators/base/decorator-types.enum.d.ts +13 -4
  56. package/decorators/base/dropdown-value.interface.d.ts +14 -0
  57. package/decorators/base/property-decorator-internal.data.d.ts +16 -3
  58. package/decorators/base/property-decorator.data.d.ts +26 -5
  59. package/decorators/boolean/boolean-decorator-internal.data.d.ts +9 -0
  60. package/decorators/boolean/boolean-decorator.data.d.ts +9 -0
  61. package/decorators/boolean/boolean.decorator.d.ts +1 -1
  62. package/decorators/date/date-decorator-internal.data.d.ts +44 -0
  63. package/decorators/date/date-decorator.data.d.ts +129 -0
  64. package/decorators/date/date.decorator.d.ts +8 -0
  65. package/decorators/file/file-decorator-internal.data.d.ts +92 -0
  66. package/decorators/file/file-decorator.data.d.ts +92 -0
  67. package/decorators/file/file.decorator.d.ts +9 -0
  68. package/decorators/number/number-decorator-internal.data.d.ts +8 -4
  69. package/decorators/number/number-decorator.data.d.ts +8 -4
  70. package/decorators/number/number.decorator.d.ts +2 -2
  71. package/decorators/object/object-decorator-internal.data.d.ts +6 -3
  72. package/decorators/object/object-decorator.data.d.ts +8 -5
  73. package/decorators/object/object.decorator.d.ts +3 -3
  74. package/decorators/string/string-decorator-internal.data.d.ts +14 -4
  75. package/decorators/string/string-decorator.data.d.ts +14 -4
  76. package/decorators/string/string.decorator.d.ts +1 -1
  77. package/esm2020/capsulation/lodash.utilities.mjs +75 -0
  78. package/esm2020/capsulation/reflect.utilities.mjs +69 -0
  79. package/esm2020/classes/base.builder.mjs +42 -0
  80. package/esm2020/classes/date.utilities.mjs +158 -0
  81. package/esm2020/classes/entity.model.mjs +19 -0
  82. package/esm2020/classes/entity.service.mjs +180 -0
  83. package/esm2020/classes/entity.utilities.mjs +669 -0
  84. package/esm2020/classes/file.utilities.mjs +123 -0
  85. package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +17 -50
  86. package/esm2020/components/confirm-dialog/confirm-dialog-data.mjs +1 -1
  87. package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +15 -4
  88. package/esm2020/components/get-validation-error-message.function.mjs +5 -1
  89. package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +30 -0
  90. package/esm2020/components/input/add-array-item-dialog-data.mjs +2 -0
  91. package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +44 -0
  92. package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +68 -0
  93. package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +65 -0
  94. package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +131 -0
  95. package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +116 -0
  96. package/esm2020/components/input/array/array-table.class.mjs +92 -0
  97. package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +38 -0
  98. package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +35 -0
  99. package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +38 -0
  100. package/esm2020/components/input/date/date-input/date-input.component.mjs +38 -0
  101. package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +63 -0
  102. package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +74 -0
  103. package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +39 -0
  104. package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +95 -0
  105. package/esm2020/components/input/file/file-input/dragDrop.directive.mjs +64 -0
  106. package/esm2020/components/input/file/file-input/file-input.component.mjs +152 -0
  107. package/esm2020/components/input/input.component.mjs +207 -110
  108. package/esm2020/components/input/input.module.mjs +87 -10
  109. package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +36 -0
  110. package/esm2020/components/input/number/number-input/number-input.component.mjs +34 -0
  111. package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +52 -0
  112. package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +36 -0
  113. package/esm2020/components/input/string/string-input/string-input.component.mjs +34 -0
  114. package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +35 -0
  115. package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +18 -40
  116. package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +15 -7
  117. package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
  118. package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +36 -22
  119. package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +20 -4
  120. package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +23 -63
  121. package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
  122. package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +15 -7
  123. package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +50 -31
  124. package/esm2020/components/table/table-data.builder.mjs +31 -15
  125. package/esm2020/components/table/table-data.mjs +1 -1
  126. package/esm2020/components/table/table.component.mjs +77 -32
  127. package/esm2020/components/table/table.module.mjs +12 -4
  128. package/esm2020/decorators/array/array-decorator-internal.data.mjs +111 -12
  129. package/esm2020/decorators/array/array-decorator.data.mjs +2 -2
  130. package/esm2020/decorators/array/array.decorator.mjs +9 -3
  131. package/esm2020/decorators/base/base-property.decorator.mjs +4 -3
  132. package/esm2020/decorators/base/decorator-types.enum.mjs +9 -1
  133. package/esm2020/decorators/base/dropdown-value.interface.mjs +2 -0
  134. package/esm2020/decorators/base/property-decorator-internal.data.mjs +33 -10
  135. package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
  136. package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +12 -1
  137. package/esm2020/decorators/boolean/boolean-decorator.data.mjs +1 -1
  138. package/esm2020/decorators/boolean/boolean.decorator.mjs +2 -2
  139. package/esm2020/decorators/date/date-decorator-internal.data.mjs +48 -0
  140. package/esm2020/decorators/date/date-decorator.data.mjs +7 -0
  141. package/esm2020/decorators/date/date.decorator.mjs +21 -0
  142. package/esm2020/decorators/file/file-decorator-internal.data.mjs +98 -0
  143. package/esm2020/decorators/file/file-decorator.data.mjs +7 -0
  144. package/esm2020/decorators/file/file.decorator.mjs +22 -0
  145. package/esm2020/decorators/number/number-decorator-internal.data.mjs +7 -1
  146. package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
  147. package/esm2020/decorators/number/number.decorator.mjs +3 -3
  148. package/esm2020/decorators/object/object-decorator-internal.data.mjs +5 -2
  149. package/esm2020/decorators/object/object-decorator.data.mjs +1 -1
  150. package/esm2020/decorators/object/object.decorator.mjs +2 -2
  151. package/esm2020/decorators/string/string-decorator-internal.data.mjs +13 -1
  152. package/esm2020/decorators/string/string-decorator.data.mjs +1 -1
  153. package/esm2020/decorators/string/string.decorator.mjs +2 -2
  154. package/esm2020/mocks/placeholder-data.png.mjs +3 -0
  155. package/esm2020/public-api.mjs +12 -5
  156. package/fesm2015/ngx-material-entity.mjs +3271 -894
  157. package/fesm2015/ngx-material-entity.mjs.map +1 -1
  158. package/fesm2020/ngx-material-entity.mjs +3140 -829
  159. package/fesm2020/ngx-material-entity.mjs.map +1 -1
  160. package/mocks/placeholder-data.png.d.ts +1 -0
  161. package/package.json +7 -1
  162. package/public-api.d.ts +12 -5
  163. package/classes/entity-model.class.d.ts +0 -9
  164. package/classes/entity-service.class.d.ts +0 -66
  165. package/classes/entity-utilities.class.d.ts +0 -112
  166. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.builder.d.ts +0 -17
  167. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts +0 -22
  168. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.d.ts +0 -12
  169. package/components/input/array-table/array-table.component.d.ts +0 -34
  170. package/components/input/array-table/array-table.module.d.ts +0 -19
  171. package/components/input/internal-input/internal-input.component.d.ts +0 -54
  172. package/components/input/internal-input/internal-input.module.d.ts +0 -16
  173. package/esm2020/classes/entity-model.class.mjs +0 -19
  174. package/esm2020/classes/entity-service.class.mjs +0 -76
  175. package/esm2020/classes/entity-utilities.class.mjs +0 -329
  176. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.builder.mjs +0 -33
  177. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.mjs +0 -2
  178. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.mjs +0 -45
  179. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.mjs +0 -22
  180. package/esm2020/components/input/array-table/array-table.component.mjs +0 -119
  181. package/esm2020/components/input/array-table/array-table.module.mjs +0 -66
  182. package/esm2020/components/input/internal-input/internal-input.component.mjs +0 -70
  183. package/esm2020/components/input/internal-input/internal-input.module.mjs +0 -54
@@ -1,5 +1,4 @@
1
- import { DecoratorTypes } from './decorator-types.enum';
2
- import { PropertyDecoratorConfigInternal } from './property-decorator-internal.data';
1
+ import { DecoratorType, DecoratorTypes } from './decorator-types.enum';
3
2
  /**
4
3
  * The base decorator for setting metadata on properties.
5
4
  *
@@ -7,4 +6,4 @@ import { PropertyDecoratorConfigInternal } from './property-decorator-internal.d
7
6
  * @param type - The type of metadata.
8
7
  * @returns The method that sets the metadata.
9
8
  */
10
- export declare function baseProperty(metadata: PropertyDecoratorConfigInternal, type: DecoratorTypes): (target: object, propertyKey: string) => void;
9
+ export declare function baseProperty<T extends DecoratorTypes>(metadata: DecoratorType<T>, type: T): (target: object, propertyKey: string) => void;
@@ -1,6 +1,7 @@
1
- import { Entity } from '../../classes/entity-model.class';
2
- import { AutocompleteStringChipsArrayDecoratorConfigInternal, EntityArrayDecoratorConfigInternal, StringChipsArrayDecoratorConfigInternal } from '../array/array-decorator-internal.data';
1
+ import { AutocompleteStringChipsArrayDecoratorConfigInternal, EntityArrayDecoratorConfigInternal, DateArrayDecoratorConfigInternal, StringChipsArrayDecoratorConfigInternal, DateTimeArrayDecoratorConfigInternal, DateRangeArrayDecoratorConfigInternal } from '../array/array-decorator-internal.data';
3
2
  import { CheckboxBooleanDecoratorConfigInternal, DropdownBooleanDecoratorConfigInternal, ToggleBooleanDecoratorConfigInternal } from '../boolean/boolean-decorator-internal.data';
3
+ import { DateRangeDateDecoratorConfigInternal, DateTimeDateDecoratorConfigInternal, DefaultDateDecoratorConfigInternal } from '../date/date-decorator-internal.data';
4
+ import { DefaultFileDecoratorConfigInternal, ImageFileDecoratorConfigInternal } from '../file/file-decorator-internal.data';
4
5
  import { DefaultNumberDecoratorConfigInternal, DropdownNumberDecoratorConfigInternal } from '../number/number-decorator-internal.data';
5
6
  import { DefaultObjectDecoratorConfigInternal } from '../object/object-decorator-internal.data';
6
7
  import { AutocompleteStringDecoratorConfigInternal, DefaultStringDecoratorConfigInternal, DropdownStringDecoratorConfigInternal, TextboxStringDecoratorConfigInternal } from '../string/string-decorator-internal.data';
@@ -19,10 +20,18 @@ export declare enum DecoratorTypes {
19
20
  BOOLEAN_DROPDOWN = "booleanDropdown",
20
21
  OBJECT = "object",
21
22
  ARRAY = "array",
23
+ ARRAY_DATE = "arrayDate",
24
+ ARRAY_DATE_TIME = "arrayDateTime",
25
+ ARRAY_DATE_RANGE = "arrayDateRange",
22
26
  ARRAY_STRING_CHIPS = "arrayStringChips",
23
- ARRAY_STRING_AUTOCOMPLETE_CHIPS = "arrayStringAutocompleteChips"
27
+ ARRAY_STRING_AUTOCOMPLETE_CHIPS = "arrayStringAutocompleteChips",
28
+ DATE = "date",
29
+ DATE_RANGE = "dateRange",
30
+ DATE_TIME = "dateTime",
31
+ FILE_DEFAULT = "fileDefault",
32
+ FILE_IMAGE = "fileImage"
24
33
  }
25
34
  /**
26
35
  * Gives the metadata-config Type based on the DecoratorTypes enum.
27
36
  */
28
- export declare type DecoratorType<T> = 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.NUMBER ? DefaultNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_DROPDOWN ? DropdownNumberDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_CHECKBOX ? CheckboxBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_TOGGLE ? ToggleBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_DROPDOWN ? DropdownBooleanDecoratorConfigInternal : T extends DecoratorTypes.OBJECT ? DefaultObjectDecoratorConfigInternal<Entity> : T extends DecoratorTypes.ARRAY ? EntityArrayDecoratorConfigInternal<Entity> : T extends DecoratorTypes.ARRAY_STRING_CHIPS ? StringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS ? AutocompleteStringChipsArrayDecoratorConfigInternal : never;
37
+ export declare type DecoratorType<T> = 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.NUMBER ? DefaultNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_DROPDOWN ? DropdownNumberDecoratorConfigInternal : 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.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 : never;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The definition for a dropdown value.
3
+ * Consists of the name to display in the dropdown and the actual value.
4
+ */
5
+ export interface DropdownValue<T> {
6
+ /**
7
+ * The name to display in the dropdown.
8
+ */
9
+ displayName: string;
10
+ /**
11
+ * The actual value.
12
+ */
13
+ value: T;
14
+ }
@@ -1,11 +1,24 @@
1
- import { cols, PropertyDecoratorConfig } from './property-decorator.data';
1
+ import { Col, Position, PropertyDecoratorConfig } from './property-decorator.data';
2
+ /**
3
+ * The internal Position. Sets default values and validates user input.
4
+ */
5
+ declare class PositionInternal implements Position {
6
+ row: number;
7
+ order: number;
8
+ constructor(data?: Position);
9
+ private validateInput;
10
+ }
11
+ /**
12
+ * The internal PropertyDecoratorConfig. Sets default values.
13
+ */
2
14
  export declare abstract class PropertyDecoratorConfigInternal implements PropertyDecoratorConfig {
3
15
  display: boolean;
4
16
  displayName: string;
5
17
  required: boolean;
6
18
  omitForCreate: boolean;
7
19
  omitForUpdate: boolean;
8
- defaultWidths: [cols, cols, cols];
9
- order: number;
20
+ defaultWidths: [Col, Col, Col];
21
+ position: PositionInternal;
10
22
  constructor(data: PropertyDecoratorConfig);
11
23
  }
24
+ export {};
@@ -1,4 +1,7 @@
1
- export declare type cols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
1
+ /**
2
+ * A bootstrap column value (a range from 1 - 12).
3
+ */
4
+ export declare type Col = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
2
5
  /**
3
6
  * The base options for all propertyDecorators.
4
7
  */
@@ -34,16 +37,34 @@ export declare abstract class PropertyDecoratorConfig {
34
37
  /**
35
38
  * Defines the width of the input property when used inside the default create or edit dialog.
36
39
  * Has 3 bootstrap values for different breakpoints for simple responsive design.
37
- * The first value sets the columns for the screensize lg, the second for md and the third for sm.
40
+ * The first value sets the columns for the screen size lg, the second for md and the third for sm.
38
41
  *
39
42
  * @default [6, 6, 12]
40
43
  */
41
- defaultWidths?: [cols, cols, cols];
44
+ defaultWidths?: [Col, Col, Col];
45
+ /**
46
+ * Specifies the how to position this property when using default create/edit dialogs.
47
+ *
48
+ * @default { row: -1, order: -1} (Adds the property at the end)
49
+ */
50
+ position?: Position;
51
+ }
52
+ /**
53
+ * The options for positioning a property when using default create/edit dialogs.
54
+ */
55
+ export interface Position {
56
+ /**
57
+ * Specifies the (bootstrap)-row in which this property is displayed.
58
+ * Ordering is ascending.
59
+ *
60
+ * @default -1 (sets this property after the last row)
61
+ */
62
+ row?: number;
42
63
  /**
43
- * Specifies order of the input property when used inside the default create or edit dialog.
64
+ * Specifies order of the input property inside the specified row.
44
65
  * Ordering is ascending.
45
66
  *
46
- * @default -1 (sets this property at the end)
67
+ * @default -1 (sets this property at the end of the row)
47
68
  */
48
69
  order?: number;
49
70
  }
@@ -1,15 +1,24 @@
1
1
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
2
2
  import { CheckboxBooleanDecoratorConfig, DropdownBooleanDecoratorConfig, ToggleBooleanDecoratorConfig } from './boolean-decorator.data';
3
+ /**
4
+ * The internal DropdownBooleanDecoratorConfig. Sets default values.
5
+ */
3
6
  export declare class DropdownBooleanDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DropdownBooleanDecoratorConfig {
4
7
  displayStyle: 'dropdown';
5
8
  dropdownTrue: string;
6
9
  dropdownFalse: string;
7
10
  constructor(data: DropdownBooleanDecoratorConfig);
8
11
  }
12
+ /**
13
+ * The internal CheckboxBooleanDecoratorConfig. Sets default values.
14
+ */
9
15
  export declare class CheckboxBooleanDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements CheckboxBooleanDecoratorConfig {
10
16
  displayStyle: 'checkbox';
11
17
  constructor(data: CheckboxBooleanDecoratorConfig);
12
18
  }
19
+ /**
20
+ * The internal ToggleBooleanDecoratorConfig. Sets default values.
21
+ */
13
22
  export declare class ToggleBooleanDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements ToggleBooleanDecoratorConfig {
14
23
  displayStyle: 'toggle';
15
24
  constructor(data: ToggleBooleanDecoratorConfig);
@@ -8,6 +8,9 @@ declare abstract class BooleanDecoratorConfig extends PropertyDecoratorConfig {
8
8
  */
9
9
  displayStyle: 'checkbox' | 'dropdown' | 'toggle';
10
10
  }
11
+ /**
12
+ * The configuration options for a boolean property displayed in a dropdown.
13
+ */
11
14
  export interface DropdownBooleanDecoratorConfig extends BooleanDecoratorConfig {
12
15
  displayStyle: 'dropdown';
13
16
  /**
@@ -19,9 +22,15 @@ export interface DropdownBooleanDecoratorConfig extends BooleanDecoratorConfig {
19
22
  */
20
23
  dropdownFalse: string;
21
24
  }
25
+ /**
26
+ * The configuration options for a boolean property displayed as a checkbox.
27
+ */
22
28
  export interface CheckboxBooleanDecoratorConfig extends BooleanDecoratorConfig {
23
29
  displayStyle: 'checkbox';
24
30
  }
31
+ /**
32
+ * The configuration options for a boolean property displayed as a mat-toggle.
33
+ */
25
34
  export interface ToggleBooleanDecoratorConfig extends BooleanDecoratorConfig {
26
35
  displayStyle: 'toggle';
27
36
  }
@@ -1,6 +1,6 @@
1
1
  import { CheckboxBooleanDecoratorConfig, DropdownBooleanDecoratorConfig, ToggleBooleanDecoratorConfig } from './boolean-decorator.data';
2
2
  /**
3
- * Decorator for setting and getting boolean propery metadata.
3
+ * Decorator for setting and getting boolean property metadata.
4
4
  *
5
5
  * @param metadata - The metadata of the boolean property.
6
6
  * @returns The method that defines the metadata.
@@ -0,0 +1,44 @@
1
+ import { Time } from '@angular/common';
2
+ import { DateFilterFn } from '@angular/material/datepicker';
3
+ import { DropdownValue } from '../base/dropdown-value.interface';
4
+ import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
5
+ import { DateRangeDateDecoratorConfig, DateTimeDateDecoratorConfig, DefaultDateDecoratorConfig } from './date-decorator.data';
6
+ /**
7
+ * The internal DefaultDateDecoratorConfig. Sets default values.
8
+ */
9
+ export declare class DefaultDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DefaultDateDecoratorConfig {
10
+ displayStyle: 'date';
11
+ min?: (date?: Date) => Date;
12
+ max?: (date?: Date) => Date;
13
+ filter?: DateFilterFn<Date | null | undefined>;
14
+ constructor(data: DefaultDateDecoratorConfig);
15
+ }
16
+ /**
17
+ * The internal DateRangeDateDecoratorConfig. Sets default values.
18
+ */
19
+ export declare class DateRangeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DateRangeDateDecoratorConfig {
20
+ displayStyle: 'daterange';
21
+ minStart?: (date?: Date) => Date;
22
+ maxStart?: (date?: Date) => Date;
23
+ minEnd?: (date?: Date) => Date;
24
+ maxEnd?: (date?: Date) => Date;
25
+ filter?: DateFilterFn<Date>;
26
+ placeholderStart: string;
27
+ placeholderEnd: string;
28
+ constructor(data: DateRangeDateDecoratorConfig);
29
+ }
30
+ /**
31
+ * The internal DateTimeDateDecoratorConfig. Sets default values.
32
+ */
33
+ export declare class DateTimeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DateTimeDateDecoratorConfig {
34
+ displayStyle: 'datetime';
35
+ times: DropdownValue<Time>[];
36
+ timeDisplayName: string;
37
+ minDate?: (date?: Date) => Date;
38
+ maxDate?: (date?: Date) => Date;
39
+ filterDate?: DateFilterFn<Date | null | undefined>;
40
+ minTime?: (date?: Date) => Time;
41
+ maxTime?: (date?: Date) => Time;
42
+ filterTime?: ((time: Time) => boolean) | (() => boolean);
43
+ constructor(data: DateTimeDateDecoratorConfig);
44
+ }
@@ -0,0 +1,129 @@
1
+ import { Time } from '@angular/common';
2
+ import { DateFilterFn } from '@angular/material/datepicker';
3
+ import { DropdownValue } from '../base/dropdown-value.interface';
4
+ import { PropertyDecoratorConfig } from '../base/property-decorator.data';
5
+ /**
6
+ * This is the needed type for an property that should be displayed as a date range.
7
+ */
8
+ export interface DateRange {
9
+ /**
10
+ * The start date of the range.
11
+ */
12
+ start: Date;
13
+ /**
14
+ * The end date of the range.
15
+ */
16
+ end: Date;
17
+ /**
18
+ * The actual Date values. These are needed if the date range might contain some values that are disabled.
19
+ * E.g. When you build a tool to request vacation you may want the user to select 3 weeks in the range picker
20
+ * but don't want the weekend dates in the final result.
21
+ */
22
+ values?: Date[];
23
+ }
24
+ /**
25
+ * Definition for the @date metadata.
26
+ */
27
+ declare abstract class DateDecoratorConfig extends PropertyDecoratorConfig {
28
+ /**
29
+ * How to display the date.
30
+ */
31
+ displayStyle: 'date' | 'datetime' | 'daterange';
32
+ }
33
+ /**
34
+ * The configuration options for a date property displayed as a default single date picker.
35
+ */
36
+ export interface DefaultDateDecoratorConfig extends DateDecoratorConfig {
37
+ displayStyle: 'date';
38
+ /**
39
+ * A function to get the minimum value of the date.
40
+ */
41
+ min?: (date?: Date) => Date;
42
+ /**
43
+ * A function to get the maximum value of the date.
44
+ */
45
+ max?: (date?: Date) => Date;
46
+ /**
47
+ * A filter function to do more specific filtering. This could be the removal of e.g. All weekends.
48
+ */
49
+ filter?: DateFilterFn<Date | null | undefined>;
50
+ }
51
+ /**
52
+ * The configuration options for a date property displayed as a date range.
53
+ */
54
+ export interface DateRangeDateDecoratorConfig extends DateDecoratorConfig {
55
+ displayStyle: 'daterange';
56
+ /**
57
+ * A function to get the minimum value of the start date.
58
+ */
59
+ minStart?: (date?: Date) => Date;
60
+ /**
61
+ * A function to get the maximum value of the start date.
62
+ */
63
+ maxStart?: (date?: Date) => Date;
64
+ /**
65
+ * A function to get the minimum value of the end date.
66
+ */
67
+ minEnd?: (date?: Date) => Date;
68
+ /**
69
+ * A function to get the maximum value of the end date.
70
+ */
71
+ maxEnd?: (date?: Date) => Date;
72
+ /**
73
+ * A filter function to do more specific filtering on the disallowed end date values. This could be the removal of e.g. All weekends.
74
+ */
75
+ filter?: DateFilterFn<Date>;
76
+ /**
77
+ * The placeholder for the start date of the date range picker.
78
+ *
79
+ * @default "Start"
80
+ */
81
+ placeholderStart?: string;
82
+ /**
83
+ * The placeholder for the end date of the date range picker.
84
+ *
85
+ * @default "End"
86
+ */
87
+ placeholderEnd?: string;
88
+ }
89
+ /**
90
+ * The configuration options for a date property displayed as date time.
91
+ */
92
+ export interface DateTimeDateDecoratorConfig extends DateDecoratorConfig {
93
+ displayStyle: 'datetime';
94
+ /**
95
+ * The selectable times.
96
+ */
97
+ times?: DropdownValue<Time>[];
98
+ /**
99
+ * The name to use as a label for the time form field.
100
+ *
101
+ * @default 'Time'
102
+ */
103
+ timeDisplayName?: string;
104
+ /**
105
+ * A function to get the minimum value of the date.
106
+ */
107
+ minDate?: (date?: Date) => Date;
108
+ /**
109
+ * A function to get the maximum value of the date.
110
+ */
111
+ maxDate?: (date?: Date) => Date;
112
+ /**
113
+ * A filter function to do more specific date filtering. This could be the removal of e.g. All weekends.
114
+ */
115
+ filterDate?: DateFilterFn<Date | null | undefined>;
116
+ /**
117
+ * A function to get the minimum value of the time.
118
+ */
119
+ minTime?: (date?: Date) => Time;
120
+ /**
121
+ * A function to get the maximum value of the time.
122
+ */
123
+ maxTime?: (date?: Date) => Time;
124
+ /**
125
+ * A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
126
+ */
127
+ filterTime?: ((time: Time) => boolean) | (() => boolean);
128
+ }
129
+ export {};
@@ -0,0 +1,8 @@
1
+ import { DateRangeDateDecoratorConfig, DateTimeDateDecoratorConfig, DefaultDateDecoratorConfig } from './date-decorator.data';
2
+ /**
3
+ * Decorator for setting and getting date property metadata.
4
+ *
5
+ * @param metadata - The metadata of the date property.
6
+ * @returns The method that defines the metadata.
7
+ */
8
+ export declare function date(metadata: DefaultDateDecoratorConfig | DateRangeDateDecoratorConfig | DateTimeDateDecoratorConfig): (target: object, propertyKey: string) => void;
@@ -0,0 +1,92 @@
1
+ import { ConfirmDialogData } from '../../components/confirm-dialog/confirm-dialog-data';
2
+ import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
3
+ import { DefaultFileDecoratorConfig, ImageFileDecoratorConfig } from './file-decorator.data';
4
+ /**
5
+ * Contains data about a file property where a blob exists.
6
+ */
7
+ export interface FileDataWithFile {
8
+ /**
9
+ * The name of the file.
10
+ */
11
+ name: string;
12
+ /**
13
+ * The file data itself in form of a blob.
14
+ */
15
+ file: Blob;
16
+ /**
17
+ * The mime type of the file.
18
+ * This is needed to increase performance when checking if the provided file is valid.
19
+ */
20
+ type: string;
21
+ /**
22
+ * The size of the file in bytes.
23
+ * This is needed to increase performance when checking if the provided file is valid.
24
+ */
25
+ size: number;
26
+ /**
27
+ * The url where the blob is saved.
28
+ */
29
+ url?: string;
30
+ }
31
+ /**
32
+ * Contains data about a file property where no blob exists.
33
+ */
34
+ export interface FileDataWithUrl {
35
+ /**
36
+ * The name of the file.
37
+ */
38
+ name: string;
39
+ /**
40
+ * The file data itself in form of a blob.
41
+ */
42
+ file?: Blob;
43
+ /**
44
+ * The mime type of the file.
45
+ * This is needed to increase performance when checking if the provided file is valid.
46
+ */
47
+ type: string;
48
+ /**
49
+ * The size of the file in bytes.
50
+ * This is needed to increase performance when checking if the provided file is valid.
51
+ */
52
+ size: number;
53
+ /**
54
+ * The url where the blob is saved.
55
+ */
56
+ url: string;
57
+ }
58
+ /**
59
+ * The internal DefaultFileDecoratorConfig. Sets default values.
60
+ */
61
+ export declare class DefaultFileDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DefaultFileDecoratorConfig {
62
+ type: 'other';
63
+ preview: false;
64
+ multiple: boolean;
65
+ allowedMimeTypes: string[];
66
+ deleteIcon: string;
67
+ maxSize: number;
68
+ maxSizeTotal: number;
69
+ mimeTypeErrorDialog: ConfirmDialogData;
70
+ maxSizeErrorDialog: ConfirmDialogData;
71
+ maxSizeTotalErrorDialog: ConfirmDialogData;
72
+ dragAndDrop: boolean;
73
+ constructor(data: DefaultFileDecoratorConfig);
74
+ }
75
+ /**
76
+ * The internal ImageFileDecoratorConfig. Sets default values.
77
+ */
78
+ export declare class ImageFileDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements ImageFileDecoratorConfig {
79
+ type: 'image';
80
+ allowedMimeTypes: string[];
81
+ multiple: boolean;
82
+ preview: boolean;
83
+ previewPlaceholderUrl?: string;
84
+ deleteIcon: string;
85
+ maxSize: number;
86
+ maxSizeTotal: number;
87
+ mimeTypeErrorDialog: ConfirmDialogData;
88
+ maxSizeErrorDialog: ConfirmDialogData;
89
+ maxSizeTotalErrorDialog: ConfirmDialogData;
90
+ dragAndDrop: boolean;
91
+ constructor(data: ImageFileDecoratorConfig);
92
+ }
@@ -0,0 +1,92 @@
1
+ import { ConfirmDialogData } from '../../components/confirm-dialog/confirm-dialog-data';
2
+ import { PropertyDecoratorConfig } from '../base/property-decorator.data';
3
+ import { FileDataWithFile, FileDataWithUrl } from './file-decorator-internal.data';
4
+ /**
5
+ * The type of a property annotated with @file.
6
+ */
7
+ export declare type FileData = FileDataWithFile | FileDataWithUrl;
8
+ /**
9
+ * Definition for the @file metadata.
10
+ */
11
+ declare abstract class FileDecoratorConfig extends PropertyDecoratorConfig {
12
+ /**
13
+ * Specifies whether or not the decorated property can have multiple files.
14
+ */
15
+ multiple: boolean;
16
+ /**
17
+ * The type of the upload.
18
+ */
19
+ type: 'image' | 'other';
20
+ /**
21
+ * The class for the <i> tag used to remove a file from the input.
22
+ *
23
+ * @default 'fas fa-circle-minus'
24
+ */
25
+ deleteIcon?: string;
26
+ /**
27
+ * Whether or not the file should be displayed inside a preview.
28
+ *
29
+ * @default true
30
+ */
31
+ preview?: boolean;
32
+ /**
33
+ * Specifies allowed File types like 'image/jpg' etc.
34
+ * Allows every file type if not set.
35
+ */
36
+ allowedMimeTypes?: string[];
37
+ /**
38
+ * The error dialog to display when the user inputs files that are not of the allowed mime types.
39
+ */
40
+ mimeTypeErrorDialog?: ConfirmDialogData;
41
+ /**
42
+ * The maximum allowed size of a single file in MB.
43
+ *
44
+ * @default 10
45
+ */
46
+ maxSize?: number;
47
+ /**
48
+ * The error dialog to display when the user inputs a single file that is bigger than the 'maxSize' value.
49
+ */
50
+ maxSizeErrorDialog?: ConfirmDialogData;
51
+ /**
52
+ * The maximum allowed size of all files in MB.
53
+ *
54
+ * @default 100
55
+ */
56
+ maxSizeTotal?: number;
57
+ /**
58
+ * The error dialog to display when the user inputs files which are in total bigger than the 'maxSizeTotal' value.
59
+ */
60
+ maxSizeTotalErrorDialog?: ConfirmDialogData;
61
+ /**
62
+ * Defines whether or not a dropdown box is displayed.
63
+ *
64
+ * @default true // when multiple is set to true.
65
+ * false // when multiple is set to false.
66
+ */
67
+ dragAndDrop?: boolean;
68
+ }
69
+ /**
70
+ * Definition for a default file.
71
+ */
72
+ export interface DefaultFileDecoratorConfig extends FileDecoratorConfig {
73
+ type: 'other';
74
+ preview?: false;
75
+ }
76
+ /**
77
+ * Definition for a image file.
78
+ */
79
+ export interface ImageFileDecoratorConfig extends FileDecoratorConfig {
80
+ type: 'image';
81
+ /**
82
+ * Specifies allowed File types like image/jpg etc. In a comma separated string.
83
+ *
84
+ * @default ['image/*']
85
+ */
86
+ allowedMimeTypes?: string[];
87
+ /**
88
+ * Url to the file that gets displayed in the preview when no file has been selected yet.
89
+ */
90
+ previewPlaceholderUrl?: string;
91
+ }
92
+ export {};
@@ -0,0 +1,9 @@
1
+ import { DefaultFileDecoratorConfig, ImageFileDecoratorConfig } from './file-decorator.data';
2
+ /**
3
+ * Decorator for setting and getting file property metadata.
4
+ *
5
+ * @param metadata - The metadata of the file property.
6
+ * @returns The method that defines the metadata.
7
+ * @throws When an unknown metadata type was provided.
8
+ */
9
+ export declare function file(metadata: DefaultFileDecoratorConfig | ImageFileDecoratorConfig): (target: object, propertyKey: string) => void;
@@ -1,16 +1,20 @@
1
+ import { DropdownValue } from '../base/dropdown-value.interface';
1
2
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
2
3
  import { DefaultNumberDecoratorConfig, DropdownNumberDecoratorConfig } from './number-decorator.data';
4
+ /**
5
+ * The internal DefaultNumberDecoratorConfig. Sets default values.
6
+ */
3
7
  export declare class DefaultNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DefaultNumberDecoratorConfig {
4
8
  displayStyle: 'line';
5
9
  min?: number;
6
10
  max?: number;
7
11
  constructor(data: DefaultNumberDecoratorConfig);
8
12
  }
13
+ /**
14
+ * The internal DropdownNumberDecoratorConfig. Sets default values.
15
+ */
9
16
  export declare class DropdownNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DropdownNumberDecoratorConfig {
10
17
  displayStyle: 'dropdown';
11
- dropdownValues: {
12
- displayName: string;
13
- value: number;
14
- }[];
18
+ dropdownValues: DropdownValue<number>[];
15
19
  constructor(data: DropdownNumberDecoratorConfig);
16
20
  }
@@ -1,3 +1,4 @@
1
+ import { DropdownValue } from '../base/dropdown-value.interface';
1
2
  import { PropertyDecoratorConfig } from '../base/property-decorator.data';
2
3
  /**
3
4
  * Definition for the @number metadata.
@@ -8,6 +9,9 @@ declare abstract class NumberDecoratorConfig extends PropertyDecoratorConfig {
8
9
  */
9
10
  displayStyle: 'line' | 'dropdown';
10
11
  }
12
+ /**
13
+ * The configuration options for a number property displayed in a default number input.
14
+ */
11
15
  export interface DefaultNumberDecoratorConfig extends NumberDecoratorConfig {
12
16
  displayStyle: 'line';
13
17
  /**
@@ -19,14 +23,14 @@ export interface DefaultNumberDecoratorConfig extends NumberDecoratorConfig {
19
23
  */
20
24
  max?: number;
21
25
  }
26
+ /**
27
+ * The configuration options for a number property displayed in a dropdown.
28
+ */
22
29
  export interface DropdownNumberDecoratorConfig extends NumberDecoratorConfig {
23
30
  displayStyle: 'dropdown';
24
31
  /**
25
32
  * The values of the dropdown, consisting of a name to display and the actual value.
26
33
  */
27
- dropdownValues: {
28
- displayName: string;
29
- value: number;
30
- }[];
34
+ dropdownValues: DropdownValue<number>[];
31
35
  }
32
36
  export {};
@@ -1,8 +1,8 @@
1
1
  import { DefaultNumberDecoratorConfig, DropdownNumberDecoratorConfig } from './number-decorator.data';
2
2
  /**
3
- * Decorator for setting and getting string propery metadata.
3
+ * Decorator for setting and getting number property metadata.
4
4
  *
5
- * @param metadata - The metadata of the string property.
5
+ * @param metadata - The metadata of the number property.
6
6
  * @returns The method that defines the metadata.
7
7
  */
8
8
  export declare function number(metadata: DefaultNumberDecoratorConfig | DropdownNumberDecoratorConfig): (target: object, propertyKey: string) => void;
@@ -1,8 +1,11 @@
1
- import { Entity } from '../../classes/entity-model.class';
1
+ import { BaseEntityType, EntityClassNewable } from '../../classes/entity.model';
2
2
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
3
3
  import { DefaultObjectDecoratorConfig } from './object-decorator.data';
4
- export declare class DefaultObjectDecoratorConfigInternal<EntityType extends Entity> extends PropertyDecoratorConfigInternal implements DefaultObjectDecoratorConfig<EntityType> {
4
+ /**
5
+ * The internal DefaultObjectDecoratorConfig. Sets default values.
6
+ */
7
+ export declare class DefaultObjectDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal implements DefaultObjectDecoratorConfig<EntityType> {
5
8
  displayStyle: 'inline';
6
- type: new (entity?: EntityType) => EntityType;
9
+ EntityClass: EntityClassNewable<EntityType>;
7
10
  constructor(data: DefaultObjectDecoratorConfig<EntityType>);
8
11
  }