ngx-material-entity 0.1.0 → 0.1.3

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 (120) hide show
  1. package/CONTRIBUTING.md +7 -1
  2. package/README.md +3 -2
  3. package/classes/base-builder.class.d.ts +35 -0
  4. package/classes/entity-model.class.d.ts +1 -1
  5. package/classes/entity-service.class.d.ts +27 -17
  6. package/classes/entity-utilities.class.d.ts +96 -46
  7. package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +23 -0
  8. package/components/confirm-dialog/confirm-dialog-data.d.ts +18 -8
  9. package/components/confirm-dialog/confirm-dialog.component.d.ts +15 -5
  10. package/components/get-validation-error-message.function.d.ts +3 -2
  11. package/components/input/add-array-item-dialog-data.builder.d.ts +21 -0
  12. package/components/input/add-array-item-dialog-data.d.ts +20 -0
  13. package/components/input/input.component.d.ts +116 -26
  14. package/components/input/input.module.d.ts +6 -4
  15. package/components/table/create-dialog/create-dialog-data.builder.d.ts +21 -0
  16. package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +22 -0
  17. package/components/table/create-dialog/create-entity-dialog-data.d.ts +2 -2
  18. package/components/table/create-dialog/create-entity-dialog.component.d.ts +19 -5
  19. package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +25 -0
  20. package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +5 -5
  21. package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +23 -0
  22. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +23 -5
  23. package/components/table/table-data.builder.d.ts +51 -0
  24. package/components/table/table-data.d.ts +40 -24
  25. package/components/table/table.component.d.ts +52 -5
  26. package/components/table/table.module.d.ts +3 -1
  27. package/decorators/array/array-decorator-internal.data.d.ts +45 -0
  28. package/decorators/array/array-decorator.data.d.ts +129 -0
  29. package/decorators/array/array.decorator.d.ts +10 -0
  30. package/decorators/base/base-property.decorator.d.ts +7 -6
  31. package/decorators/base/decorator-types.enum.d.ts +7 -7
  32. package/decorators/base/property-decorator-internal.data.d.ts +24 -0
  33. package/decorators/base/property-decorator.data.d.ts +70 -0
  34. package/decorators/boolean/boolean-decorator-internal.data.d.ts +25 -0
  35. package/decorators/boolean/boolean-decorator.data.d.ts +37 -0
  36. package/decorators/boolean/boolean.decorator.d.ts +8 -0
  37. package/decorators/number/number-decorator-internal.data.d.ts +22 -0
  38. package/decorators/number/number-decorator.data.d.ts +38 -0
  39. package/decorators/number/number.decorator.d.ts +8 -0
  40. package/decorators/object/object-decorator-internal.data.d.ts +11 -0
  41. package/decorators/object/object-decorator.data.d.ts +25 -0
  42. package/decorators/object/object.decorator.d.ts +9 -0
  43. package/decorators/string/string-decorator-internal.data.d.ts +43 -0
  44. package/decorators/string/string-decorator.data.d.ts +79 -0
  45. package/decorators/string/string.decorator.d.ts +8 -0
  46. package/esm2020/classes/base-builder.class.mjs +43 -0
  47. package/esm2020/classes/entity-model.class.mjs +2 -2
  48. package/esm2020/classes/entity-service.class.mjs +20 -14
  49. package/esm2020/classes/entity-utilities.class.mjs +182 -101
  50. package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +44 -0
  51. package/esm2020/components/confirm-dialog/confirm-dialog-data.mjs +1 -1
  52. package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +18 -22
  53. package/esm2020/components/get-validation-error-message.function.mjs +8 -3
  54. package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +30 -0
  55. package/esm2020/components/input/add-array-item-dialog-data.mjs +2 -0
  56. package/esm2020/components/input/input.component.mjs +168 -32
  57. package/esm2020/components/input/input.module.mjs +19 -9
  58. package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +32 -0
  59. package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +26 -0
  60. package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
  61. package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +30 -30
  62. package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +20 -4
  63. package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +41 -0
  64. package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
  65. package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +27 -0
  66. package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +43 -47
  67. package/esm2020/components/table/table-data.builder.mjs +105 -0
  68. package/esm2020/components/table/table-data.mjs +1 -1
  69. package/esm2020/components/table/table.component.mjs +90 -82
  70. package/esm2020/components/table/table.module.mjs +12 -4
  71. package/esm2020/decorators/array/array-decorator-internal.data.mjs +51 -0
  72. package/esm2020/decorators/array/array-decorator.data.mjs +7 -0
  73. package/esm2020/decorators/array/array.decorator.mjs +24 -0
  74. package/esm2020/decorators/base/base-property.decorator.mjs +6 -5
  75. package/esm2020/decorators/base/decorator-types.enum.mjs +1 -1
  76. package/esm2020/decorators/base/property-decorator-internal.data.mjs +38 -0
  77. package/esm2020/decorators/base/property-decorator.data.mjs +6 -0
  78. package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +33 -0
  79. package/esm2020/decorators/boolean/boolean-decorator.data.mjs +7 -0
  80. package/esm2020/decorators/boolean/boolean.decorator.mjs +21 -0
  81. package/esm2020/decorators/number/number-decorator-internal.data.mjs +23 -0
  82. package/esm2020/decorators/number/number-decorator.data.mjs +7 -0
  83. package/esm2020/decorators/number/number.decorator.mjs +18 -0
  84. package/esm2020/decorators/object/object-decorator-internal.data.mjs +12 -0
  85. package/esm2020/decorators/object/object-decorator.data.mjs +7 -0
  86. package/esm2020/decorators/object/object.decorator.mjs +13 -0
  87. package/esm2020/decorators/string/string-decorator-internal.data.mjs +48 -0
  88. package/esm2020/decorators/string/string-decorator.data.mjs +7 -0
  89. package/esm2020/decorators/string/string.decorator.mjs +24 -0
  90. package/esm2020/public-api.mjs +15 -10
  91. package/fesm2015/ngx-material-entity.mjs +1221 -880
  92. package/fesm2015/ngx-material-entity.mjs.map +1 -1
  93. package/fesm2020/ngx-material-entity.mjs +1225 -877
  94. package/fesm2020/ngx-material-entity.mjs.map +1 -1
  95. package/package.json +2 -1
  96. package/public-api.d.ts +15 -7
  97. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts +0 -35
  98. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.d.ts +0 -12
  99. package/components/input/array-table/array-table.component.d.ts +0 -34
  100. package/components/input/array-table/array-table.module.d.ts +0 -19
  101. package/components/input/internal-input/internal-input.component.d.ts +0 -57
  102. package/components/input/internal-input/internal-input.module.d.ts +0 -16
  103. package/decorators/array.decorator.d.ts +0 -125
  104. package/decorators/base/property-decorator-config.interface.d.ts +0 -50
  105. package/decorators/boolean.decorator.d.ts +0 -42
  106. package/decorators/number.decorator.d.ts +0 -40
  107. package/decorators/object.decorator.d.ts +0 -27
  108. package/decorators/string.decorator.d.ts +0 -76
  109. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.mjs +0 -43
  110. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.mjs +0 -22
  111. package/esm2020/components/input/array-table/array-table.component.mjs +0 -116
  112. package/esm2020/components/input/array-table/array-table.module.mjs +0 -66
  113. package/esm2020/components/input/internal-input/internal-input.component.mjs +0 -73
  114. package/esm2020/components/input/internal-input/internal-input.module.mjs +0 -54
  115. package/esm2020/decorators/array.decorator.mjs +0 -70
  116. package/esm2020/decorators/base/property-decorator-config.interface.mjs +0 -31
  117. package/esm2020/decorators/boolean.decorator.mjs +0 -44
  118. package/esm2020/decorators/number.decorator.mjs +0 -36
  119. package/esm2020/decorators/object.decorator.mjs +0 -23
  120. package/esm2020/decorators/string.decorator.mjs +0 -61
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "ngx-material-entity",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
+ "license": "MIT",
4
5
  "peerDependencies": {
5
6
  "@angular/animations": "~13.3.0",
6
7
  "@angular/cdk": "^13.3.9",
package/public-api.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Public API Surface of ngx-material-entity.
3
+ */
1
4
  import 'reflect-metadata';
2
5
  export * from './classes/entity-model.class';
3
6
  export * from './classes/entity-service.class';
@@ -5,6 +8,8 @@ export * from './classes/entity-utilities.class';
5
8
  export * from './components/confirm-dialog/confirm-dialog-data';
6
9
  export * from './components/confirm-dialog/confirm-dialog.component';
7
10
  export * from './components/confirm-dialog/confirm-dialog.module';
11
+ export * from './components/input/input.module';
12
+ export * from './components/input/input.component';
8
13
  export * from './components/table/table-data';
9
14
  export * from './components/table/table.component';
10
15
  export * from './components/table/table.module';
@@ -14,12 +19,15 @@ export * from './components/table/create-dialog/create-entity-dialog.component';
14
19
  export * from './components/table/edit-dialog/edit-entity-dialog-data';
15
20
  export * from './components/table/edit-dialog/edit-entity-dialog.module';
16
21
  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
22
  export * from './components/get-validation-error-message.function';
20
23
  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';
24
+ export * from './decorators/array/array.decorator';
25
+ export * from './decorators/array/array-decorator.data';
26
+ export * from './decorators/boolean/boolean.decorator';
27
+ export * from './decorators/boolean/boolean-decorator.data';
28
+ export * from './decorators/number/number.decorator';
29
+ export * from './decorators/number/number-decorator.data';
30
+ export * from './decorators/object/object.decorator';
31
+ export * from './decorators/object/object-decorator.data';
32
+ export * from './decorators/string/string.decorator';
33
+ export * from './decorators/string/string-decorator.data';
@@ -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 {};
@@ -1,76 +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 string(metadata: DropdownStringDecoratorConfig | AutocompleteStringDecoratorConfig | DefaultStringDecoratorConfig | TextboxStringDecoratorConfig): (target: object, propertyKey: string) => void;
7
- /**
8
- * Interface definition for the @string metadata
9
- */
10
- declare abstract class StringDecoratorConfig extends PropertyDecoratorConfig {
11
- /**
12
- * How to display the string
13
- */
14
- displayStyle: 'line' | 'textbox' | 'autocomplete' | 'dropdown';
15
- }
16
- export declare class DropdownStringDecoratorConfig extends StringDecoratorConfig {
17
- displayStyle: 'dropdown';
18
- /**
19
- * The values of the dropdown, consisting of a name to display and the actual value
20
- * Can also receive a function to determine the values
21
- */
22
- dropdownValues: {
23
- displayName: string;
24
- value: string;
25
- }[];
26
- constructor(metadata: DropdownStringDecoratorConfig);
27
- }
28
- export declare class DefaultStringDecoratorConfig extends StringDecoratorConfig {
29
- displayStyle: 'line';
30
- /**
31
- * (optional) The minimum required length of the string
32
- */
33
- minLength?: number;
34
- /**
35
- * (optional) The maximum required length of the string
36
- */
37
- maxLength?: number;
38
- /**
39
- * (optional) A regex used for validation
40
- */
41
- regex?: RegExp;
42
- constructor(metadata: DefaultStringDecoratorConfig);
43
- }
44
- export declare class TextboxStringDecoratorConfig extends StringDecoratorConfig {
45
- displayStyle: 'textbox';
46
- /**
47
- * (optional) The minimum required length of the string
48
- */
49
- minLength?: number;
50
- /**
51
- * (optional) The maximum required length of the string
52
- */
53
- maxLength?: number;
54
- constructor(metadata: TextboxStringDecoratorConfig);
55
- }
56
- export declare class AutocompleteStringDecoratorConfig extends StringDecoratorConfig {
57
- displayStyle: 'autocomplete';
58
- /**
59
- * The autocomplete values
60
- */
61
- autocompleteValues: string[];
62
- /**
63
- * (optional) The minimum required length of the string
64
- */
65
- minLength?: number;
66
- /**
67
- * (optional) The maximum required length of the string
68
- */
69
- maxLength?: number;
70
- /**
71
- * (optional) A regex used for validation
72
- */
73
- regex?: RegExp;
74
- constructor(metadata: AutocompleteStringDecoratorConfig);
75
- }
76
- export {};