ngx-material-entity 0.1.1 → 0.1.4

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 (133) hide show
  1. package/CONTRIBUTING.md +7 -1
  2. package/README.md +536 -328
  3. package/classes/base.builder.d.ts +35 -0
  4. package/classes/date.utilities.d.ts +58 -0
  5. package/classes/entity.model.d.ts +13 -0
  6. package/classes/{entity-service.class.d.ts → entity.service.d.ts} +35 -20
  7. package/classes/entity.utilities.d.ts +153 -0
  8. package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +23 -0
  9. package/components/confirm-dialog/confirm-dialog-data.d.ts +18 -8
  10. package/components/confirm-dialog/confirm-dialog.component.d.ts +15 -5
  11. package/components/get-validation-error-message.function.d.ts +3 -2
  12. package/components/input/add-array-item-dialog-data.builder.d.ts +20 -0
  13. package/components/input/add-array-item-dialog-data.d.ts +19 -0
  14. package/components/input/input.component.d.ts +151 -30
  15. package/components/input/input.module.d.ts +7 -4
  16. package/components/table/create-dialog/create-dialog-data.builder.d.ts +21 -0
  17. package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +21 -0
  18. package/components/table/create-dialog/create-entity-dialog-data.d.ts +4 -5
  19. package/components/table/create-dialog/create-entity-dialog.component.d.ts +21 -8
  20. package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +24 -0
  21. package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +7 -8
  22. package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +22 -0
  23. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +25 -8
  24. package/components/table/table-data.builder.d.ts +51 -0
  25. package/components/table/table-data.d.ts +46 -30
  26. package/components/table/table.component.d.ts +53 -7
  27. package/components/table/table.module.d.ts +3 -1
  28. package/decorators/array/array-decorator-internal.data.d.ts +45 -0
  29. package/decorators/array/array-decorator.data.d.ts +129 -0
  30. package/decorators/array/array.decorator.d.ts +9 -0
  31. package/decorators/base/base-property.decorator.d.ts +7 -6
  32. package/decorators/base/decorator-types.enum.d.ts +12 -9
  33. package/decorators/base/dropdown-value.interface.d.ts +14 -0
  34. package/decorators/base/property-decorator-internal.data.d.ts +24 -0
  35. package/decorators/base/property-decorator.data.d.ts +70 -0
  36. package/decorators/boolean/boolean-decorator-internal.data.d.ts +25 -0
  37. package/decorators/boolean/boolean-decorator.data.d.ts +37 -0
  38. package/decorators/boolean/boolean.decorator.d.ts +8 -0
  39. package/decorators/date/date-decorator-internal.data.d.ts +44 -0
  40. package/decorators/date/date-decorator.data.d.ts +129 -0
  41. package/decorators/number/number-decorator-internal.data.d.ts +20 -0
  42. package/decorators/number/number-decorator.data.d.ts +36 -0
  43. package/decorators/number/number.decorator.d.ts +8 -0
  44. package/decorators/object/object-decorator-internal.data.d.ts +11 -0
  45. package/decorators/object/object-decorator.data.d.ts +25 -0
  46. package/decorators/object/object.decorator.d.ts +8 -0
  47. package/decorators/string/string-decorator-internal.data.d.ts +41 -0
  48. package/decorators/string/string-decorator.data.d.ts +77 -0
  49. package/decorators/string/string.decorator.d.ts +8 -0
  50. package/esm2020/classes/base.builder.mjs +43 -0
  51. package/esm2020/classes/date.utilities.mjs +138 -0
  52. package/esm2020/classes/entity.model.mjs +19 -0
  53. package/esm2020/classes/entity.service.mjs +83 -0
  54. package/esm2020/classes/entity.utilities.mjs +538 -0
  55. package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +44 -0
  56. package/esm2020/components/confirm-dialog/confirm-dialog-data.mjs +1 -1
  57. package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +18 -22
  58. package/esm2020/components/get-validation-error-message.function.mjs +8 -3
  59. package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +30 -0
  60. package/esm2020/components/input/add-array-item-dialog-data.mjs +2 -0
  61. package/esm2020/components/input/input.component.mjs +240 -36
  62. package/esm2020/components/input/input.module.mjs +23 -9
  63. package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +32 -0
  64. package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +26 -0
  65. package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
  66. package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +31 -31
  67. package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +20 -4
  68. package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +41 -0
  69. package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
  70. package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +27 -0
  71. package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +45 -49
  72. package/esm2020/components/table/table-data.builder.mjs +105 -0
  73. package/esm2020/components/table/table-data.mjs +1 -1
  74. package/esm2020/components/table/table.component.mjs +91 -83
  75. package/esm2020/components/table/table.module.mjs +12 -4
  76. package/esm2020/decorators/array/array-decorator-internal.data.mjs +51 -0
  77. package/esm2020/decorators/array/array-decorator.data.mjs +7 -0
  78. package/esm2020/decorators/array/array.decorator.mjs +24 -0
  79. package/esm2020/decorators/base/base-property.decorator.mjs +6 -5
  80. package/esm2020/decorators/base/decorator-types.enum.mjs +4 -1
  81. package/esm2020/decorators/base/dropdown-value.interface.mjs +2 -0
  82. package/esm2020/decorators/base/property-decorator-internal.data.mjs +38 -0
  83. package/esm2020/decorators/base/property-decorator.data.mjs +6 -0
  84. package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +33 -0
  85. package/esm2020/decorators/boolean/boolean-decorator.data.mjs +7 -0
  86. package/esm2020/decorators/boolean/boolean.decorator.mjs +21 -0
  87. package/esm2020/decorators/date/date-decorator-internal.data.mjs +48 -0
  88. package/esm2020/decorators/date/date-decorator.data.mjs +7 -0
  89. package/esm2020/decorators/number/number-decorator-internal.data.mjs +23 -0
  90. package/esm2020/decorators/number/number-decorator.data.mjs +7 -0
  91. package/esm2020/decorators/number/number.decorator.mjs +18 -0
  92. package/esm2020/decorators/object/object-decorator-internal.data.mjs +12 -0
  93. package/esm2020/decorators/object/object-decorator.data.mjs +7 -0
  94. package/esm2020/decorators/object/object.decorator.mjs +13 -0
  95. package/esm2020/decorators/string/string-decorator-internal.data.mjs +48 -0
  96. package/esm2020/decorators/string/string-decorator.data.mjs +7 -0
  97. package/esm2020/decorators/string/string.decorator.mjs +24 -0
  98. package/esm2020/public-api.mjs +20 -13
  99. package/fesm2015/ngx-material-entity.mjs +1664 -944
  100. package/fesm2015/ngx-material-entity.mjs.map +1 -1
  101. package/fesm2020/ngx-material-entity.mjs +1667 -941
  102. package/fesm2020/ngx-material-entity.mjs.map +1 -1
  103. package/package.json +7 -1
  104. package/public-api.d.ts +21 -10
  105. package/classes/entity-model.class.d.ts +0 -9
  106. package/classes/entity-utilities.class.d.ts +0 -95
  107. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts +0 -35
  108. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.d.ts +0 -12
  109. package/components/input/array-table/array-table.component.d.ts +0 -34
  110. package/components/input/array-table/array-table.module.d.ts +0 -19
  111. package/components/input/internal-input/internal-input.component.d.ts +0 -57
  112. package/components/input/internal-input/internal-input.module.d.ts +0 -16
  113. package/decorators/array.decorator.d.ts +0 -125
  114. package/decorators/base/property-decorator-config.interface.d.ts +0 -50
  115. package/decorators/boolean.decorator.d.ts +0 -42
  116. package/decorators/number.decorator.d.ts +0 -40
  117. package/decorators/object.decorator.d.ts +0 -27
  118. package/decorators/string.decorator.d.ts +0 -76
  119. package/esm2020/classes/entity-model.class.mjs +0 -19
  120. package/esm2020/classes/entity-service.class.mjs +0 -70
  121. package/esm2020/classes/entity-utilities.class.mjs +0 -296
  122. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.mjs +0 -43
  123. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.mjs +0 -22
  124. package/esm2020/components/input/array-table/array-table.component.mjs +0 -116
  125. package/esm2020/components/input/array-table/array-table.module.mjs +0 -66
  126. package/esm2020/components/input/internal-input/internal-input.component.mjs +0 -73
  127. package/esm2020/components/input/internal-input/internal-input.module.mjs +0 -54
  128. package/esm2020/decorators/array.decorator.mjs +0 -70
  129. package/esm2020/decorators/base/property-decorator-config.interface.mjs +0 -31
  130. package/esm2020/decorators/boolean.decorator.mjs +0 -44
  131. package/esm2020/decorators/number.decorator.mjs +0 -36
  132. package/esm2020/decorators/object.decorator.mjs +0 -23
  133. package/esm2020/decorators/string.decorator.mjs +0 -61
package/package.json CHANGED
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "name": "ngx-material-entity",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
+ "keywords": [
6
+ "angular",
7
+ "material",
8
+ "crud",
9
+ "entity"
10
+ ],
5
11
  "peerDependencies": {
6
12
  "@angular/animations": "~13.3.0",
7
13
  "@angular/cdk": "^13.3.9",
package/public-api.d.ts CHANGED
@@ -1,10 +1,16 @@
1
+ /**
2
+ * Public API Surface of ngx-material-entity.
3
+ */
1
4
  import 'reflect-metadata';
2
- export * from './classes/entity-model.class';
3
- export * from './classes/entity-service.class';
4
- export * from './classes/entity-utilities.class';
5
+ export * from './classes/entity.model';
6
+ export * from './classes/entity.service';
7
+ export * from './classes/entity.utilities';
8
+ export * from './classes/date.utilities';
5
9
  export * from './components/confirm-dialog/confirm-dialog-data';
6
10
  export * from './components/confirm-dialog/confirm-dialog.component';
7
11
  export * from './components/confirm-dialog/confirm-dialog.module';
12
+ export * from './components/input/input.module';
13
+ export * from './components/input/input.component';
8
14
  export * from './components/table/table-data';
9
15
  export * from './components/table/table.component';
10
16
  export * from './components/table/table.module';
@@ -14,12 +20,17 @@ export * from './components/table/create-dialog/create-entity-dialog.component';
14
20
  export * from './components/table/edit-dialog/edit-entity-dialog-data';
15
21
  export * from './components/table/edit-dialog/edit-entity-dialog.module';
16
22
  export * from './components/table/edit-dialog/edit-entity-dialog.component';
17
- export * from './components/input/input.module';
18
- export * from './components/input/input.component';
19
23
  export * from './components/get-validation-error-message.function';
24
+ export * from './decorators/array/array.decorator';
25
+ export * from './decorators/array/array-decorator.data';
20
26
  export * from './decorators/base/decorator-types.enum';
21
- export * from './decorators/array.decorator';
22
- export * from './decorators/boolean.decorator';
23
- export * from './decorators/number.decorator';
24
- export * from './decorators/object.decorator';
25
- export * from './decorators/string.decorator';
27
+ export * from './decorators/base/dropdown-value.interface';
28
+ export { Col, Position } from './decorators/base/property-decorator.data';
29
+ export * from './decorators/boolean/boolean.decorator';
30
+ export * from './decorators/boolean/boolean-decorator.data';
31
+ export * from './decorators/number/number.decorator';
32
+ export * from './decorators/number/number-decorator.data';
33
+ export * from './decorators/object/object.decorator';
34
+ export * from './decorators/object/object-decorator.data';
35
+ export * from './decorators/string/string.decorator';
36
+ export * from './decorators/string/string-decorator.data';
@@ -1,9 +0,0 @@
1
- /**
2
- * The base Entity class.
3
- */
4
- export declare abstract class Entity {
5
- /**
6
- * A unique identifier for the Entity
7
- */
8
- id: string;
9
- }
@@ -1,95 +0,0 @@
1
- import { DecoratorType, DecoratorTypes } from '../decorators/base/decorator-types.enum';
2
- import { Entity } from './entity-model.class';
3
- /**
4
- * Contains HelperMethods around handling Entities and their property-metadata
5
- */
6
- export declare abstract class EntityUtilities {
7
- /**
8
- * Gets the properties to omit when updating the entity
9
- * @returns The properties which should be left out for updating a new Entity
10
- */
11
- static getOmitForUpdate<EntityType extends Entity>(entity: EntityType): (keyof EntityType)[];
12
- /**
13
- * Gets the properties to omit when creating new entities
14
- * @returns The properties which should be left out for creating a new Entity
15
- */
16
- static getOmitForCreate<EntityType extends Entity>(entity: EntityType): (keyof EntityType)[];
17
- /**
18
- * Gets the metadata included in an property
19
- * @param entity The entity with the property to get the metadata from
20
- * @param propertyKey The property on the given Entity to get the metadata from
21
- * @param type For secure Typing, defines the returned PropertyConfig
22
- * @returns The metadata of the property
23
- */
24
- static getPropertyMetadata<EntityType extends Entity, T extends DecoratorTypes>(entity: EntityType, propertyKey: keyof EntityType, type: T): DecoratorType<T>;
25
- /**
26
- * Gets the type of the property-metadata.
27
- * @param entity The entity with the property to get the type from
28
- * @param propertyKey The property on the given Entity to get the type from
29
- * @returns The type of the metadata
30
- */
31
- static getPropertyType<EntityType extends Entity>(entity: EntityType, propertyKey: keyof EntityType): DecoratorTypes;
32
- /**
33
- * Sets all property values based on a given entity data-object.
34
- * @param entity The data object to get the property values from.
35
- * @param target
36
- * the target object that needs to be constructed
37
- * (if called inside a Entity constructor its usually this)
38
- * @alias new
39
- * @alias build
40
- * @alias construct
41
- */
42
- static new<EntityType extends Entity>(target: EntityType, entity?: EntityType): void;
43
- static construct: typeof EntityUtilities.new;
44
- static build: typeof EntityUtilities.new;
45
- /**
46
- * Checks if the values on an entity are valid.
47
- * Also checks all the validators given by the metadata ("required", "maxLength" etc.)
48
- * @param entity The entity to validate.
49
- * @param omit Whether to check for creatiung or editing validity
50
- * @returns Whether or not the entity is valid.
51
- */
52
- static isEntityValid<EntityType extends Entity>(entity: EntityType, omit: 'create' | 'edit'): boolean;
53
- /**
54
- * Checks if a single property value is valid
55
- * @param entity The entity where the property is from
56
- * @param key The name of the property
57
- * @returns Whether or not the property value is valid
58
- */
59
- private static isPropertyValid;
60
- /**
61
- * Checks if an entity is "dirty" (if its values have changed)
62
- * @param entity The entity after all changes
63
- * @param entityPriorChanges The entity before the changes
64
- * @returns Whether or not the entity is dirty
65
- */
66
- static dirty(entity: Entity, entityPriorChanges: Entity): boolean;
67
- /**
68
- * Compares two Entities and returns their difference in an object
69
- * @param entity The first entity to compare
70
- * @param entityPriorChanges The second entity to compare
71
- * @returns The difference between the two Entities in form of a Partial
72
- */
73
- static difference<EntityType extends Entity>(entity: EntityType, entityPriorChanges: EntityType): Partial<EntityType>;
74
- /**
75
- * compare function for sorting entity keys by their order value
76
- * @param a first key of entity
77
- * @param b second key of entity
78
- * @param entity current entity (used to get metadata of entity keys)
79
- */
80
- static compareOrder<EntityType extends Entity>(a: keyof EntityType, b: keyof EntityType, entity: EntityType): number;
81
- /**
82
- * gets the bootstrap column values for "lg", "md", "sm"
83
- * @param entity entity to get the bootstrap column values of the key
84
- * @param key key of the property to get bootstrap column values from
85
- * @param type defines for which screensize the column values should be returned
86
- * @returns bootstrap column value
87
- */
88
- static getWidth<EntityType extends Entity>(entity: EntityType, key: keyof EntityType, type: 'lg' | 'md' | 'sm'): number;
89
- /**
90
- * Resets all changes on an entity
91
- * @param entity The entity to reset
92
- * @param entityPriorChanges The entity before any changes
93
- */
94
- static resetChangesOnEntity<EntityType extends Entity>(entity: EntityType, entityPriorChanges: EntityType): void;
95
- }
@@ -1,35 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { NgModel } from '@angular/forms';
3
- import { MatDialogRef } from '@angular/material/dialog';
4
- import { Entity } from '../../../../classes/entity-model.class';
5
- import { EntityUtilities } from '../../../../classes/entity-utilities.class';
6
- import { CreateDialogData } from '../../../table/table-data';
7
- import * as i0 from "@angular/core";
8
- export interface AddArrayItemDialogData<EntityType extends Entity> {
9
- /**
10
- * An empty entity that is used as the data model.
11
- */
12
- entity: EntityType;
13
- /**
14
- * The info of the generic create-dialog.
15
- */
16
- createDialogData: CreateDialogData;
17
- /**
18
- * (optional) A custom function to generate the error-message for invalid inputs.
19
- */
20
- getValidationErrorMessage: (model: NgModel) => string;
21
- }
22
- export declare class NgxMatEntityAddArrayItemDialogComponent<EntityType extends Entity> implements OnInit {
23
- data: AddArrayItemDialogData<EntityType>;
24
- dialogRef: MatDialogRef<NgxMatEntityAddArrayItemDialogComponent<EntityType>>;
25
- EntityUtilities: typeof EntityUtilities;
26
- entityKeys: (keyof EntityType)[];
27
- getWidth: typeof EntityUtilities.getWidth;
28
- constructor(data: AddArrayItemDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityAddArrayItemDialogComponent<EntityType>>);
29
- ngOnInit(): void;
30
- private setEntityKeys;
31
- create(): void;
32
- cancel(): void;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityAddArrayItemDialogComponent<any>, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityAddArrayItemDialogComponent<any>, "ngx-mat-entity-add-array-item-dialog", never, {}, {}, never, never>;
35
- }
@@ -1,12 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./add-array-item-dialog.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "../../internal-input/internal-input.module";
5
- import * as i4 from "@angular/material/dialog";
6
- import * as i5 from "@angular/forms";
7
- import * as i6 from "@angular/material/button";
8
- export declare class NgxMatEntityAddArrayItemDialogModule {
9
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityAddArrayItemDialogModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityAddArrayItemDialogModule, [typeof i1.NgxMatEntityAddArrayItemDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInternalInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule], [typeof i1.NgxMatEntityAddArrayItemDialogComponent]>;
11
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityAddArrayItemDialogModule>;
12
- }
@@ -1,34 +0,0 @@
1
- import { SelectionModel } from '@angular/cdk/collections';
2
- import { OnInit } from '@angular/core';
3
- import { EntityArrayDecoratorConfig } from '../../../decorators/array.decorator';
4
- import { Entity } from '../../../classes/entity-model.class';
5
- import { EntityUtilities } from '../../../classes/entity-utilities.class';
6
- import { NgModel } from '@angular/forms';
7
- import { MatTableDataSource } from '@angular/material/table';
8
- import { MatDialog } from '@angular/material/dialog';
9
- import * as i0 from "@angular/core";
10
- export declare class NgxMatEntityArrayTableComponent<EntityType extends Entity> implements OnInit {
11
- private readonly dialog;
12
- arrayItems: EntityType[];
13
- metadata: EntityArrayDecoratorConfig<EntityType>;
14
- getValidationErrorMessage: (model: NgModel) => string;
15
- omit: 'create' | 'edit';
16
- dataSource: MatTableDataSource<EntityType>;
17
- selection: SelectionModel<EntityType>;
18
- displayedColumns: string[];
19
- arrayItem: EntityType;
20
- private arrayItemPriorChanges;
21
- getWidth: typeof EntityUtilities.getWidth;
22
- EntityUtilities: typeof EntityUtilities;
23
- constructor(dialog: MatDialog);
24
- trackByFn(index: unknown): unknown;
25
- ngOnInit(): void;
26
- private validateInput;
27
- add(): void;
28
- remove(): void;
29
- getObjectProperties(): (keyof EntityType)[];
30
- masterToggle(): void;
31
- isAllSelected(): boolean;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityArrayTableComponent<any>, never>;
33
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityArrayTableComponent<any>, "ngx-mat-entity-array-table", never, { "arrayItems": "arrayItems"; "metadata": "metadata"; "getValidationErrorMessage": "getValidationErrorMessage"; "omit": "omit"; }, {}, never, never>;
34
- }
@@ -1,19 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./array-table.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "@angular/material/input";
5
- import * as i4 from "@angular/forms";
6
- import * as i5 from "@angular/material/form-field";
7
- import * as i6 from "@angular/material/select";
8
- import * as i7 from "@angular/material/autocomplete";
9
- import * as i8 from "@angular/material/checkbox";
10
- import * as i9 from "@angular/material/slide-toggle";
11
- import * as i10 from "@angular/material/table";
12
- import * as i11 from "../internal-input/internal-input.module";
13
- import * as i12 from "@angular/material/button";
14
- import * as i13 from "./add-array-item-dialog/add-array-item-dialog.module";
15
- export declare class NgxMatEntityArrayTableModule {
16
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityArrayTableModule, never>;
17
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityArrayTableModule, [typeof i1.NgxMatEntityArrayTableComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.FormsModule, typeof i5.MatFormFieldModule, typeof i6.MatSelectModule, typeof i7.MatAutocompleteModule, typeof i8.MatCheckboxModule, typeof i9.MatSlideToggleModule, typeof i10.MatTableModule, typeof i11.NgxMatEntityInternalInputModule, typeof i12.MatButtonModule, typeof i13.NgxMatEntityAddArrayItemDialogModule], [typeof i1.NgxMatEntityArrayTableComponent]>;
18
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityArrayTableModule>;
19
- }
@@ -1,57 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { DecoratorTypes } from '../../../decorators/base/decorator-types.enum';
3
- import { PropertyDecoratorConfig } from '../../../decorators/base/property-decorator-config.interface';
4
- import { DefaultNumberDecoratorConfig, DropdownNumberDecoratorConfig } from '../../../decorators/number.decorator';
5
- import { AutocompleteStringDecoratorConfig, DefaultStringDecoratorConfig, DropdownStringDecoratorConfig, TextboxStringDecoratorConfig } from '../../../decorators/string.decorator';
6
- import { DropdownBooleanDecoratorConfig } from '../../../decorators/boolean.decorator';
7
- import { Entity } from '../../../classes/entity-model.class';
8
- import { DefaultObjectDecoratorConfig } from '../../../decorators/object.decorator';
9
- import { EntityUtilities } from '../../../classes/entity-utilities.class';
10
- import { NgModel } from '@angular/forms';
11
- import * as i0 from "@angular/core";
12
- export declare class NgxMatEntityInternalInputComponent<EntityType extends Entity> implements OnInit {
13
- /**
14
- * The entity on which the property exists. Used in conjuction with the "propertyKey"
15
- * to determine the property for which the input should be generated.
16
- */
17
- entity: EntityType;
18
- /**
19
- * The name of the property to generate the input for. Used in conjuction with the "entity".
20
- */
21
- propertyKey: keyof EntityType;
22
- /**
23
- * Whether to hide a value if it is omitted for creation.
24
- * Is used internally for the object property.
25
- */
26
- hideOmitForCreate?: boolean;
27
- /**
28
- * Whether to hide a value if it is omitted for editing.
29
- * Is used internally for the object property.
30
- */
31
- hideOmitForEdit?: boolean;
32
- /**
33
- * (optional) A custom function to generate the error-message for invalid inputs.
34
- */
35
- getValidationErrorMessage: (model: NgModel) => string;
36
- type: DecoratorTypes;
37
- metadata: PropertyDecoratorConfig;
38
- metadataDefaultString: DefaultStringDecoratorConfig;
39
- metadataTextboxString: TextboxStringDecoratorConfig;
40
- metadataAutocompleteString: AutocompleteStringDecoratorConfig;
41
- metadataDropdownString: DropdownStringDecoratorConfig;
42
- metadataDropdownBoolean: DropdownBooleanDecoratorConfig;
43
- metadataDefaultNumber: DefaultNumberDecoratorConfig;
44
- metadataDropdownNumber: DropdownNumberDecoratorConfig;
45
- metadataDefaultObject: DefaultObjectDecoratorConfig;
46
- objectProperty: Entity;
47
- readonly DecoratorTypes: typeof DecoratorTypes;
48
- getWidth: typeof EntityUtilities.getWidth;
49
- /**
50
- * Helper method needed to recursively generate property input components (used eg. with the object)
51
- */
52
- trackByFn(index: unknown): unknown;
53
- ngOnInit(): void;
54
- getObjectProperties(): (keyof Entity)[];
55
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInternalInputComponent<any>, never>;
56
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInternalInputComponent<any>, "ngx-mat-entity-internal-input", never, { "entity": "entity"; "propertyKey": "propertyKey"; "hideOmitForCreate": "hideOmitForCreate"; "hideOmitForEdit": "hideOmitForEdit"; "getValidationErrorMessage": "getValidationErrorMessage"; }, {}, never, never>;
57
- }
@@ -1,16 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./internal-input.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "@angular/material/input";
5
- import * as i4 from "@angular/forms";
6
- import * as i5 from "@angular/material/form-field";
7
- import * as i6 from "@angular/material/select";
8
- import * as i7 from "@angular/material/autocomplete";
9
- import * as i8 from "@angular/material/checkbox";
10
- import * as i9 from "@angular/material/slide-toggle";
11
- import * as i10 from "@angular/material/table";
12
- export declare class NgxMatEntityInternalInputModule {
13
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInternalInputModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInternalInputModule, [typeof i1.NgxMatEntityInternalInputComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.FormsModule, typeof i5.MatFormFieldModule, typeof i6.MatSelectModule, typeof i7.MatAutocompleteModule, typeof i8.MatCheckboxModule, typeof i9.MatSlideToggleModule, typeof i10.MatTableModule], [typeof i1.NgxMatEntityInternalInputComponent]>;
15
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityInternalInputModule>;
16
- }
@@ -1,125 +0,0 @@
1
- import { Entity } from '../classes/entity-model.class';
2
- import { CreateDialogData } from '../components/table/table-data';
3
- import { DecoratorTypes } from './base/decorator-types.enum';
4
- import { PropertyDecoratorConfig } from './base/property-decorator-config.interface';
5
- /**
6
- * Decorator for setting and getting array propery metadata
7
- * @param metadata The metadata of the array property
8
- */
9
- export declare function array<EntityType extends Entity>(metadata: EntityArrayDecoratorConfig<EntityType> | StringChipsArrayDecoratorConfig | AutocompleteStringChipsArrayDecoratorConfig): (target: object, propertyKey: string) => void;
10
- export interface ArrayTableDisplayColumn<EntityType extends Entity> {
11
- /**
12
- * The name inside the header.
13
- */
14
- displayName: string;
15
- /**
16
- * A method to get the value inside an row
17
- */
18
- value: (entity: EntityType) => string;
19
- }
20
- /**
21
- * Interface definition for the @array metadata
22
- */
23
- declare abstract class ArrayDecoratorConfig extends PropertyDecoratorConfig {
24
- /**
25
- * How to display the string
26
- */
27
- displayStyle: 'table' | 'chips';
28
- /**
29
- * The type of the items inside the array
30
- */
31
- itemType: DecoratorTypes;
32
- /**
33
- * The error-message to display when the array is required but contains no values
34
- */
35
- missingErrorMessage?: string;
36
- }
37
- /**
38
- * Definition for an array of Entities
39
- */
40
- export declare class EntityArrayDecoratorConfig<EntityType extends Entity> extends ArrayDecoratorConfig {
41
- itemType: DecoratorTypes.OBJECT;
42
- displayStyle: 'table';
43
- /**
44
- * The EntityClass used for generating the create inputs
45
- */
46
- EntityClass: new (entity?: EntityType) => EntityType;
47
- /**
48
- * The definition of the columns to display. Consists of the displayName to show in the header of the row
49
- * and the value, which is a function that generates the value to display inside a column
50
- */
51
- displayColumns: ArrayTableDisplayColumn<EntityType>[];
52
- /**
53
- * The data for the add-item-dialog.
54
- * Can be omitted when adding items inline.
55
- */
56
- createDialogData?: CreateDialogData;
57
- /**
58
- * Whether or not the form for adding items to the array
59
- * should be displayed inline.
60
- * @default true
61
- */
62
- createInline?: boolean;
63
- constructor(metadata: EntityArrayDecoratorConfig<EntityType>);
64
- }
65
- /**
66
- * Definition for an array of strings displayed as a chips list
67
- */
68
- export declare class StringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
69
- itemType: DecoratorTypes.STRING;
70
- displayStyle: 'chips';
71
- /**
72
- * The html inside the delete-button.
73
- * Please note that custom tags such as <mat-icon></mat-icon>
74
- * need to be defined as known elements, otherwise the sanitizer will remove them.
75
- * You can however work around this by using `<span class="material-icons"></span>`
76
- * @default <mat-icon>cancel</mat-icon>
77
- */
78
- deleteHtml?: string;
79
- /**
80
- * (optional) The minimum required length of the string
81
- */
82
- minLength?: number;
83
- /**
84
- * (optional) The maximum required length of the string
85
- */
86
- maxLength?: number;
87
- /**
88
- * (optional) A regex used for validation
89
- */
90
- regex?: RegExp;
91
- constructor(metadata: StringChipsArrayDecoratorConfig);
92
- }
93
- /**
94
- * Definition for an array of autocomplete strings displayed as a chips list
95
- */
96
- export declare class AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
97
- itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
98
- displayStyle: 'chips';
99
- /**
100
- * The html inside the delete-button.
101
- * Please note that custom tags such as <mat-icon></mat-icon>
102
- * need to be defined as known elements, otherwise the sanitizer will remove them.
103
- * You can however work around this by using `<span class="material-icons"></span>`
104
- * @default <mat-icon>cancel</mat-icon>
105
- */
106
- deleteHtml?: string;
107
- /**
108
- * The autocomplete values
109
- */
110
- autocompleteValues: string[];
111
- /**
112
- * (optional) The minimum required length of the string
113
- */
114
- minLength?: number;
115
- /**
116
- * (optional) The maximum required length of the string
117
- */
118
- maxLength?: number;
119
- /**
120
- * (optional) A regex used for validation
121
- */
122
- regex?: RegExp;
123
- constructor(metadata: AutocompleteStringChipsArrayDecoratorConfig);
124
- }
125
- export {};
@@ -1,50 +0,0 @@
1
- declare type cols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
2
- /**
3
- * The base options for all propertyDecorators
4
- */
5
- export declare abstract class PropertyDecoratorConfig {
6
- /**
7
- * Whether or not the Property is displayed at all.
8
- * @default true
9
- */
10
- display?: boolean;
11
- /**
12
- * The name of the property used as a label for form fields.
13
- */
14
- displayName: string;
15
- /**
16
- * Whether or not the Property is required.
17
- * @default true
18
- */
19
- required?: boolean;
20
- /**
21
- * Whether or not the property gets omitted when creating new Entities.
22
- * @default false
23
- */
24
- omitForCreate?: boolean;
25
- /**
26
- * Whether or not the property gets omitted when updating Entities.
27
- * @default false
28
- */
29
- omitForUpdate?: boolean;
30
- /**
31
- * Defines the width of the input property when used inside the default create or edit dialog.
32
- * Has 3 bootstrap values for different breakpoints for simple responsive design.
33
- * @var firstValue: col-lg-{{firstValue}}
34
- * @var secondValue: col-md-{{secondValue}}
35
- * @var thirdValue: col-sm-{{thirdValue}}
36
- */
37
- defaultWidths?: [cols, cols, cols];
38
- /**
39
- * Specifies order of the input property when used inside the default create or edit dialog.
40
- * Ordering is ascending
41
- * @default -1 (sets this property at the end)
42
- */
43
- order?: number;
44
- /**
45
- * Defines, Whether or not there should be a line break after this input.
46
- * Is used inside the default create and edit dialogs.
47
- */
48
- constructor(displayName: string, display?: boolean, required?: boolean, omitForCreate?: boolean, omitForUpdate?: boolean, defaultWidths?: [cols, cols, cols], order?: number);
49
- }
50
- export {};
@@ -1,42 +0,0 @@
1
- import { PropertyDecoratorConfig } from './base/property-decorator-config.interface';
2
- /**
3
- * Decorator for setting and getting string propery metadata
4
- * @param metadata The metadata of the string property
5
- */
6
- export declare function boolean(metadata: CheckboxBooleanDecoratorConfig | ToggleBooleanDecoratorConfig | DropdownBooleanDecoratorConfig): (target: object, propertyKey: string) => void;
7
- /**
8
- * The Definition for the @boolean metadata
9
- */
10
- declare abstract class BooleanDecoratorConfig extends PropertyDecoratorConfig {
11
- /**
12
- * Whether to display the booleans as a checkbox, a toggle button or as a dropdown
13
- */
14
- displayStyle: 'checkbox' | 'dropdown' | 'toggle';
15
- }
16
- export declare class DropdownBooleanDecoratorConfig extends BooleanDecoratorConfig {
17
- displayStyle: 'dropdown';
18
- /**
19
- * The name of the true value if displayStyle dropdown is used.
20
- * Can also receive a function to determine the name.
21
- */
22
- dropdownTrue: string | {
23
- (args: unknown): string;
24
- };
25
- /**
26
- * The name of the false value if displayStyle dropdown is used.
27
- * Can also receive a function to determine the name,
28
- */
29
- dropdownFalse: string | {
30
- (args: unknown): string;
31
- };
32
- constructor(metadata: DropdownBooleanDecoratorConfig);
33
- }
34
- export declare class CheckboxBooleanDecoratorConfig extends BooleanDecoratorConfig {
35
- displayStyle: 'checkbox';
36
- constructor(metadata: CheckboxBooleanDecoratorConfig);
37
- }
38
- export declare class ToggleBooleanDecoratorConfig extends BooleanDecoratorConfig {
39
- displayStyle: 'toggle';
40
- constructor(metadata: ToggleBooleanDecoratorConfig);
41
- }
42
- export {};
@@ -1,40 +0,0 @@
1
- import { PropertyDecoratorConfig } from './base/property-decorator-config.interface';
2
- /**
3
- * Decorator for setting and getting string propery metadata
4
- * @param metadata The metadata of the string property
5
- */
6
- export declare function number(metadata: DefaultNumberDecoratorConfig | DropdownNumberDecoratorConfig): (target: object, propertyKey: string) => void;
7
- /**
8
- * Interface definition for the @number metadata
9
- */
10
- declare abstract class NumberDecoratorConfig extends PropertyDecoratorConfig {
11
- /**
12
- * Whether to display the number in a single line or as a dropdown
13
- */
14
- displayStyle: 'line' | 'dropdown';
15
- }
16
- export declare class DefaultNumberDecoratorConfig extends NumberDecoratorConfig {
17
- displayStyle: 'line';
18
- /**
19
- * (optional) The minimum value of the number
20
- */
21
- min?: number;
22
- /**
23
- * (optional) The maximum value of the number
24
- */
25
- max?: number;
26
- constructor(metadata: DefaultNumberDecoratorConfig);
27
- }
28
- export declare class DropdownNumberDecoratorConfig extends NumberDecoratorConfig {
29
- displayStyle: 'dropdown';
30
- /**
31
- * The values of the dropdown, consisting of a name to display and the actual value
32
- * Can also receive a function to determine the values
33
- */
34
- dropdownValues?: {
35
- displayName: string;
36
- value: number;
37
- }[];
38
- constructor(metadata: DropdownNumberDecoratorConfig);
39
- }
40
- export {};
@@ -1,27 +0,0 @@
1
- import { PropertyDecoratorConfig } from './base/property-decorator-config.interface';
2
- import { Entity } from '../classes/entity-model.class';
3
- /**
4
- * Decorator for setting and getting object propery metadata.
5
- * @param metadata The metadata of the object property
6
- */
7
- export declare function object(metadata: DefaultObjectDecoratorConfig): (target: object, propertyKey: string) => void;
8
- /**
9
- * Interface definition for the @object metadata
10
- */
11
- declare abstract class ObjectDecoratorConfig extends PropertyDecoratorConfig {
12
- /**
13
- * The entity type of the object
14
- */
15
- type: typeof Entity;
16
- /**
17
- * How to display the object.
18
- * @inline The objects properties are added as input fields in an section of the entity.
19
- * Useful if the object only contains a few properties (e.g. a address on a user).
20
- */
21
- displayStyle: 'inline';
22
- }
23
- export declare class DefaultObjectDecoratorConfig extends ObjectDecoratorConfig {
24
- displayStyle: 'inline';
25
- constructor(metadata: DefaultObjectDecoratorConfig);
26
- }
27
- export {};