ngx-material-entity 0.1.2 → 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 (97) hide show
  1. package/classes/base-builder.class.d.ts +35 -0
  2. package/classes/entity-service.class.d.ts +1 -1
  3. package/classes/entity-utilities.class.d.ts +36 -3
  4. package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +10 -11
  5. package/components/confirm-dialog/confirm-dialog-data.d.ts +4 -0
  6. package/components/confirm-dialog/confirm-dialog.component.d.ts +11 -0
  7. package/components/input/{array-table/add-array-item-dialog/add-array-item-dialog-data.builder.d.ts → add-array-item-dialog-data.builder.d.ts} +11 -7
  8. package/components/input/{array-table/add-array-item-dialog/add-array-item-dialog-data.d.ts → add-array-item-dialog-data.d.ts} +5 -2
  9. package/components/input/input.component.d.ts +100 -7
  10. package/components/input/input.module.d.ts +6 -4
  11. package/components/table/create-dialog/create-dialog-data.builder.d.ts +9 -8
  12. package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +9 -3
  13. package/components/table/create-dialog/create-entity-dialog.component.d.ts +15 -3
  14. package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +9 -11
  15. package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +9 -3
  16. package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +19 -3
  17. package/components/table/table-data.builder.d.ts +20 -9
  18. package/components/table/table-data.d.ts +14 -2
  19. package/components/table/table.component.d.ts +46 -0
  20. package/components/table/table.module.d.ts +3 -1
  21. package/decorators/array/array-decorator-internal.data.d.ts +13 -2
  22. package/decorators/array/array-decorator.data.d.ts +21 -12
  23. package/decorators/array/array.decorator.d.ts +1 -1
  24. package/decorators/base/property-decorator-internal.data.d.ts +16 -3
  25. package/decorators/base/property-decorator.data.d.ts +26 -5
  26. package/decorators/boolean/boolean-decorator-internal.data.d.ts +9 -0
  27. package/decorators/boolean/boolean-decorator.data.d.ts +9 -0
  28. package/decorators/boolean/boolean.decorator.d.ts +1 -1
  29. package/decorators/number/number-decorator-internal.data.d.ts +6 -0
  30. package/decorators/number/number-decorator.data.d.ts +6 -0
  31. package/decorators/number/number.decorator.d.ts +1 -1
  32. package/decorators/object/object-decorator-internal.data.d.ts +3 -0
  33. package/decorators/object/object-decorator.data.d.ts +3 -0
  34. package/decorators/object/object.decorator.d.ts +1 -1
  35. package/decorators/string/string-decorator-internal.data.d.ts +12 -0
  36. package/decorators/string/string-decorator.data.d.ts +12 -0
  37. package/decorators/string/string.decorator.d.ts +1 -1
  38. package/esm2020/classes/base-builder.class.mjs +43 -0
  39. package/esm2020/classes/entity-service.class.mjs +2 -2
  40. package/esm2020/classes/entity-utilities.class.mjs +81 -33
  41. package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +15 -48
  42. package/esm2020/components/confirm-dialog/confirm-dialog-data.mjs +1 -1
  43. package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +13 -2
  44. package/esm2020/components/get-validation-error-message.function.mjs +5 -1
  45. package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +30 -0
  46. package/esm2020/components/input/add-array-item-dialog-data.mjs +2 -0
  47. package/esm2020/components/input/input.component.mjs +170 -31
  48. package/esm2020/components/input/input.module.mjs +19 -9
  49. package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +18 -40
  50. package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +15 -7
  51. package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +24 -17
  52. package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +20 -4
  53. package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +23 -63
  54. package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +15 -7
  55. package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +35 -24
  56. package/esm2020/components/table/table-data.builder.mjs +30 -14
  57. package/esm2020/components/table/table-data.mjs +1 -1
  58. package/esm2020/components/table/table.component.mjs +57 -10
  59. package/esm2020/components/table/table.module.mjs +12 -4
  60. package/esm2020/decorators/array/array-decorator-internal.data.mjs +15 -4
  61. package/esm2020/decorators/array/array-decorator.data.mjs +1 -1
  62. package/esm2020/decorators/array/array.decorator.mjs +2 -2
  63. package/esm2020/decorators/base/property-decorator-internal.data.mjs +28 -5
  64. package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
  65. package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +12 -1
  66. package/esm2020/decorators/boolean/boolean-decorator.data.mjs +1 -1
  67. package/esm2020/decorators/boolean/boolean.decorator.mjs +2 -2
  68. package/esm2020/decorators/number/number-decorator-internal.data.mjs +7 -1
  69. package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
  70. package/esm2020/decorators/number/number.decorator.mjs +2 -2
  71. package/esm2020/decorators/object/object-decorator-internal.data.mjs +4 -1
  72. package/esm2020/decorators/object/object-decorator.data.mjs +1 -1
  73. package/esm2020/decorators/object/object.decorator.mjs +2 -2
  74. package/esm2020/decorators/string/string-decorator-internal.data.mjs +13 -1
  75. package/esm2020/decorators/string/string-decorator.data.mjs +1 -1
  76. package/esm2020/decorators/string/string.decorator.mjs +2 -2
  77. package/esm2020/public-api.mjs +1 -1
  78. package/fesm2015/ngx-material-entity.mjs +708 -703
  79. package/fesm2015/ngx-material-entity.mjs.map +1 -1
  80. package/fesm2020/ngx-material-entity.mjs +750 -723
  81. package/fesm2020/ngx-material-entity.mjs.map +1 -1
  82. package/package.json +1 -1
  83. package/public-api.d.ts +0 -1
  84. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts +0 -22
  85. package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.d.ts +0 -12
  86. package/components/input/array-table/array-table.component.d.ts +0 -34
  87. package/components/input/array-table/array-table.module.d.ts +0 -19
  88. package/components/input/internal-input/internal-input.component.d.ts +0 -54
  89. package/components/input/internal-input/internal-input.module.d.ts +0 -16
  90. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.builder.mjs +0 -33
  91. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.mjs +0 -2
  92. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.mjs +0 -45
  93. package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.mjs +0 -22
  94. package/esm2020/components/input/array-table/array-table.component.mjs +0 -119
  95. package/esm2020/components/input/array-table/array-table.module.mjs +0 -66
  96. package/esm2020/components/input/internal-input/internal-input.component.mjs +0 -70
  97. package/esm2020/components/input/internal-input/internal-input.module.mjs +0 -54
@@ -4,24 +4,33 @@ import { CreateDialogDataInternal } from './create-dialog/create-dialog-data.bui
4
4
  import { EditDialogDataInternal } from './edit-dialog/edit-dialog-data.builder';
5
5
  import { BaseData, DisplayColumn, MultiSelectAction, TableData } from './table-data';
6
6
  import { HttpClient } from '@angular/common/http';
7
+ import { BaseBuilder } from '../../classes/base-builder.class';
8
+ /**
9
+ * The internal TableData. Requires all default values the user can leave out.
10
+ */
7
11
  export declare class TableDataInternal<EntityType extends Entity> implements TableData<EntityType> {
8
12
  baseData: BaseDataInternal<EntityType>;
9
13
  createDialogData: CreateDialogDataInternal;
10
14
  editDialogData: EditDialogDataInternal<EntityType>;
11
15
  constructor(baseData: BaseDataInternal<EntityType>, createDialogData: CreateDialogDataInternal, editDialogData: EditDialogDataInternal<EntityType>);
12
16
  }
13
- export declare class BaseDataBuilder<EntityType extends Entity> {
14
- baseData: BaseDataInternal<EntityType>;
15
- private readonly dataInput;
17
+ /**
18
+ * The Builder for the table BaseData. Sets default values.
19
+ */
20
+ export declare class BaseDataBuilder<EntityType extends Entity> extends BaseBuilder<BaseDataInternal<EntityType>, BaseData<EntityType>> {
16
21
  constructor(data: BaseData<EntityType>);
22
+ protected generateBaseData(data: BaseData<EntityType>): BaseDataInternal<EntityType>;
17
23
  }
24
+ /**
25
+ * The internal TableData. Requires all default values the user can leave out.
26
+ */
18
27
  export declare class BaseDataInternal<EntityType extends Entity> implements BaseData<EntityType> {
19
28
  title: string;
20
29
  displayColumns: DisplayColumn<EntityType>[];
21
30
  EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
22
31
  searchLabel: string;
23
32
  createButtonLabel: string;
24
- searchString: (enity: EntityType) => string;
33
+ searchString: (entity: EntityType) => string;
25
34
  allowCreate: boolean;
26
35
  allowEdit: (entity: EntityType) => boolean;
27
36
  allowDelete: (entity: EntityType) => boolean;
@@ -30,11 +39,13 @@ export declare class BaseDataInternal<EntityType extends Entity> implements Base
30
39
  EntityClass?: new (entity?: EntityType) => EntityType;
31
40
  edit?: (entity: EntityType) => unknown;
32
41
  create?: (entity: EntityType) => unknown;
33
- constructor(title: string, displayColumns: DisplayColumn<EntityType>[], EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, searchLabel: string, createButtonLabel: string, searchString: (enity: EntityType) => string, allowCreate: boolean, allowEdit: (entity: EntityType) => boolean, allowDelete: (entity: EntityType) => boolean, multiSelectActions: MultiSelectAction<EntityType>[], multiSelectLabel: string, EntityClass?: new (entity?: EntityType) => EntityType, edit?: (entity: EntityType) => unknown, create?: (entity: EntityType) => unknown);
42
+ constructor(title: string, displayColumns: DisplayColumn<EntityType>[], EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, searchLabel: string, createButtonLabel: string, searchString: (entity: EntityType) => string, allowCreate: boolean, allowEdit: (entity: EntityType) => boolean, allowDelete: (entity: EntityType) => boolean, multiSelectActions: MultiSelectAction<EntityType>[], multiSelectLabel: string, EntityClass?: new (entity?: EntityType) => EntityType, edit?: (entity: EntityType) => unknown, create?: (entity: EntityType) => unknown);
34
43
  }
35
- export declare class TableDataBuilder<EntityType extends Entity> {
36
- tableData: TableDataInternal<EntityType>;
37
- private readonly dataInput;
44
+ /**
45
+ * The Builder for the complete TableData. Sets default values and validates user input.
46
+ */
47
+ export declare class TableDataBuilder<EntityType extends Entity> extends BaseBuilder<TableDataInternal<EntityType>, TableData<EntityType>> {
38
48
  constructor(data: TableData<EntityType>);
39
- private validateInput;
49
+ protected generateBaseData(data: TableData<EntityType>): TableDataInternal<EntityType>;
50
+ protected validateInput(data: TableData<EntityType>): void;
40
51
  }
@@ -40,10 +40,13 @@ export interface MultiSelectAction<EntityType extends Entity> {
40
40
  */
41
41
  requireConfirmDialog?: (selectedEntities: EntityType[]) => boolean;
42
42
  /**
43
- * The data used to generate a confirmation dialog for the multiselect action.
43
+ * The data used to generate a confirmation dialog for the multiSelect action.
44
44
  */
45
45
  confirmDialogData?: ConfirmDialogData;
46
46
  }
47
+ /**
48
+ * The base data of the ngx-mat-entity-table.
49
+ */
47
50
  export interface BaseData<EntityType extends Entity> {
48
51
  /**
49
52
  * The title of the table.
@@ -86,7 +89,7 @@ export interface BaseData<EntityType extends Entity> {
86
89
  /**
87
90
  * Defines how the search string of entities is generated.
88
91
  */
89
- searchString?: (enity: EntityType) => string;
92
+ searchString?: (entity: EntityType) => string;
90
93
  /**
91
94
  * Defines whether or not the user can add new entities.
92
95
  *
@@ -113,6 +116,9 @@ export interface BaseData<EntityType extends Entity> {
113
116
  */
114
117
  multiSelectLabel?: string;
115
118
  }
119
+ /**
120
+ * The data of the default create-dialog.
121
+ */
116
122
  export interface CreateDialogData {
117
123
  /**
118
124
  * The title of the default create-dialog.
@@ -135,6 +141,9 @@ export interface CreateDialogData {
135
141
  */
136
142
  confirmCreateDialogData?: ConfirmDialogData;
137
143
  }
144
+ /**
145
+ * The data of the default edit-dialog.
146
+ */
138
147
  export interface EditDialogData<EntityType extends Entity> {
139
148
  /**
140
149
  * The title of the default edit-dialog.
@@ -169,6 +178,9 @@ export interface EditDialogData<EntityType extends Entity> {
169
178
  */
170
179
  confirmEditDialogData?: ConfirmDialogData;
171
180
  }
181
+ /**
182
+ * All the configuration data required to display a ngx-mat-entity-table.
183
+ */
172
184
  export interface TableData<EntityType extends Entity> {
173
185
  /**
174
186
  * The base data for the table-component.
@@ -8,6 +8,12 @@ import { MatDialog } from '@angular/material/dialog';
8
8
  import { MultiSelectAction, TableData } from './table-data';
9
9
  import { TableDataInternal } from './table-data.builder';
10
10
  import * as i0 from "@angular/core";
11
+ /**
12
+ * Generates a fully functional table for displaying, creating, updating and deleting entities
13
+ * based on the configuration passed in the @Input "tableData".
14
+ *
15
+ * It offers a lot of customization options which can be found in "TableData".
16
+ */
11
17
  export declare class NgxMatEntityTableComponent<EntityType extends Entity> implements OnInit, OnDestroy {
12
18
  private readonly dialog;
13
19
  private readonly injector;
@@ -25,17 +31,57 @@ export declare class NgxMatEntityTableComponent<EntityType extends Entity> imple
25
31
  dataSource: MatTableDataSource<EntityType>;
26
32
  selection: SelectionModel<EntityType>;
27
33
  constructor(dialog: MatDialog, injector: Injector);
34
+ /**
35
+ * Sets up all the configuration for the table and the EntityService.
36
+ */
28
37
  ngOnInit(): void;
38
+ /**
39
+ * Edits an entity. This either calls the edit-Method provided by the user or uses a default edit-dialog.
40
+ *
41
+ * @param entity - The entity that should be updated.
42
+ * @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
43
+ */
29
44
  editEntity(entity: EntityType): void;
30
45
  private editDefault;
46
+ /**
47
+ * Creates a new Entity. This either calls the create-Method provided by the user or uses a default create-dialog.
48
+ *
49
+ * @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
50
+ */
31
51
  createEntity(): void;
32
52
  private createDefault;
53
+ /**
54
+ * Runs the MultiAction for all selected entries.
55
+ * Also handles confirmation with an additional dialog if configured.
56
+ *
57
+ * @param action - The MultiAction to run.
58
+ */
33
59
  runMultiAction(action: MultiSelectAction<EntityType>): void;
34
60
  private confirmRunMultiAction;
61
+ /**
62
+ * Checks if an MultiAction is disabled (e.g. Because no entries have been selected).
63
+ *
64
+ * @param action - The MultiAction to check.
65
+ * @returns Whether or not the Action can be used.
66
+ */
35
67
  multiActionDisabled(action: MultiSelectAction<EntityType>): boolean;
68
+ /**
69
+ * Toggles all entries in the table.
70
+ */
36
71
  masterToggle(): void;
72
+ /**
73
+ * Checks if all entries in the table have been selected.
74
+ * This is needed to display the "masterToggle"-checkbox correctly.
75
+ *
76
+ * @returns Whether or not all entries in the table have been selected.
77
+ */
37
78
  isAllSelected(): boolean;
38
79
  ngOnDestroy(): void;
80
+ /**
81
+ * Applies the search input to filter the table entries.
82
+ *
83
+ * @param event - The keyup-event which contains the search-string of the user.
84
+ */
39
85
  applyFilter(event: Event): void;
40
86
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityTableComponent<any>, never>;
41
87
  static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityTableComponent<any>, "ngx-mat-entity-table", never, { "tableData": "tableData"; }, {}, never, never>;
@@ -10,8 +10,10 @@ import * as i8 from "@angular/material/paginator";
10
10
  import * as i9 from "@angular/material/button";
11
11
  import * as i10 from "@angular/material/menu";
12
12
  import * as i11 from "@angular/material/dialog";
13
+ import * as i12 from "./create-dialog/create-entity-dialog.module";
14
+ import * as i13 from "./edit-dialog/edit-entity-dialog.module";
13
15
  export declare class NgxMatEntityTableModule {
14
16
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityTableModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityTableModule, [typeof i1.NgxMatEntityTableComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.FormsModule, typeof i5.MatFormFieldModule, typeof i6.MatCheckboxModule, typeof i7.MatTableModule, typeof i8.MatPaginatorModule, typeof i9.MatButtonModule, typeof i10.MatMenuModule, typeof i11.MatDialogModule], [typeof i1.NgxMatEntityTableComponent]>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityTableModule, [typeof i1.NgxMatEntityTableComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.FormsModule, typeof i5.MatFormFieldModule, typeof i6.MatCheckboxModule, typeof i7.MatTableModule, typeof i8.MatPaginatorModule, typeof i9.MatButtonModule, typeof i10.MatMenuModule, typeof i11.MatDialogModule, typeof i12.NgxMatEntityCreateDialogModule, typeof i13.NgxMatEntityEditDialogModule], [typeof i1.NgxMatEntityTableComponent]>;
16
18
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityTableModule>;
17
19
  }
@@ -3,6 +3,9 @@ import { CreateDialogData } from '../../components/table/table-data';
3
3
  import { DecoratorTypes } from '../base/decorator-types.enum';
4
4
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
5
5
  import { ArrayTableDisplayColumn, AutocompleteStringChipsArrayDecoratorConfig, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from './array-decorator.data';
6
+ /**
7
+ * The internal EntityArrayDecoratorConfig. Sets default values.
8
+ */
6
9
  export declare class EntityArrayDecoratorConfigInternal<EntityType extends Entity> extends PropertyDecoratorConfigInternal implements EntityArrayDecoratorConfig<EntityType> {
7
10
  itemType: DecoratorTypes.OBJECT;
8
11
  displayStyle: 'table';
@@ -11,22 +14,30 @@ export declare class EntityArrayDecoratorConfigInternal<EntityType extends Entit
11
14
  createDialogData?: CreateDialogData;
12
15
  createInline: boolean;
13
16
  missingErrorMessage: string;
17
+ addButtonLabel: string;
18
+ removeButtonLabel: string;
14
19
  constructor(data: EntityArrayDecoratorConfig<EntityType>);
15
20
  }
21
+ /**
22
+ * The internal StringChipsArrayDecoratorConfig. Sets default values.
23
+ */
16
24
  export declare class StringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements StringChipsArrayDecoratorConfig {
17
25
  itemType: DecoratorTypes.STRING;
18
26
  displayStyle: 'chips';
19
- deleteHtml?: string;
27
+ deleteIcon: string;
20
28
  minLength?: number;
21
29
  maxLength?: number;
22
30
  regex?: RegExp;
23
31
  constructor(data: StringChipsArrayDecoratorConfig);
24
32
  }
33
+ /**
34
+ * The internal AutocompleteStringChipsArrayDecoratorConfig. Sets default values.
35
+ */
25
36
  export declare class AutocompleteStringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements AutocompleteStringChipsArrayDecoratorConfig {
26
37
  autocompleteValues: string[];
27
38
  itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
28
39
  displayStyle: 'chips';
29
- deleteHtml?: string;
40
+ deleteIcon: string;
30
41
  minLength?: number;
31
42
  maxLength?: number;
32
43
  regex?: RegExp;
@@ -2,6 +2,9 @@ import { Entity } from '../../classes/entity-model.class';
2
2
  import { CreateDialogData } from '../../components/table/table-data';
3
3
  import { DecoratorTypes } from '../base/decorator-types.enum';
4
4
  import { PropertyDecoratorConfig } from '../base/property-decorator.data';
5
+ /**
6
+ * The configuration options for an array property displayed as a table.
7
+ */
5
8
  export interface ArrayTableDisplayColumn<EntityType extends Entity> {
6
9
  /**
7
10
  * The name inside the header.
@@ -52,6 +55,18 @@ export interface EntityArrayDecoratorConfig<EntityType extends Entity> extends A
52
55
  * @default true
53
56
  */
54
57
  createInline?: boolean;
58
+ /**
59
+ * The label for the add button when createInline is true.
60
+ *
61
+ * @default 'Add'
62
+ */
63
+ addButtonLabel?: string;
64
+ /**
65
+ * The label for the remove button when createInline is true.
66
+ *
67
+ * @default 'Remove'
68
+ */
69
+ removeButtonLabel?: string;
55
70
  /**
56
71
  * The error-message to display when the array is required but contains no values.
57
72
  */
@@ -64,14 +79,11 @@ export interface StringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
64
79
  itemType: DecoratorTypes.STRING;
65
80
  displayStyle: 'chips';
66
81
  /**
67
- * The html inside the delete-button.
68
- * Please note that custom tags such as <mat-icon></mat-icon>
69
- * need to be defined as known elements, otherwise the sanitizer will remove them.
70
- * You can however work around this by using `<span class="material-icons"></span>`.
82
+ * The class for the <i> tag used to remove an entry from the array.
71
83
  *
72
- * @default <mat-icon>cancel</mat-icon>
84
+ * @default 'fas fa-circle-minus'
73
85
  */
74
- deleteHtml?: string;
86
+ deleteIcon?: string;
75
87
  /**
76
88
  * The minimum required length of the string.
77
89
  */
@@ -92,14 +104,11 @@ export interface AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecora
92
104
  itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
93
105
  displayStyle: 'chips';
94
106
  /**
95
- * The html inside the delete-button.
96
- * Please note that custom tags such as <mat-icon></mat-icon>
97
- * need to be defined as known elements, otherwise the sanitizer will remove them.
98
- * You can however work around this by using `<span class="material-icons"></span>`.
107
+ * The class for the <i> tag used to remove an entry from the array.
99
108
  *
100
- * @default <mat-icon>cancel</mat-icon>
109
+ * @default 'fas fa-circle-minus'
101
110
  */
102
- deleteHtml?: string;
111
+ deleteIcon?: string;
103
112
  /**
104
113
  * The autocomplete values.
105
114
  */
@@ -1,7 +1,7 @@
1
1
  import { Entity } from '../../classes/entity-model.class';
2
2
  import { AutocompleteStringChipsArrayDecoratorConfig, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from './array-decorator.data';
3
3
  /**
4
- * Decorator for setting and getting array propery metadata.
4
+ * Decorator for setting and getting array property metadata.
5
5
  *
6
6
  * @param metadata - The metadata of the array property.
7
7
  * @returns The method that defines the metadata.
@@ -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.
@@ -1,11 +1,17 @@
1
1
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
2
2
  import { DefaultNumberDecoratorConfig, DropdownNumberDecoratorConfig } from './number-decorator.data';
3
+ /**
4
+ * The internal DefaultNumberDecoratorConfig. Sets default values.
5
+ */
3
6
  export declare class DefaultNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DefaultNumberDecoratorConfig {
4
7
  displayStyle: 'line';
5
8
  min?: number;
6
9
  max?: number;
7
10
  constructor(data: DefaultNumberDecoratorConfig);
8
11
  }
12
+ /**
13
+ * The internal DropdownNumberDecoratorConfig. Sets default values.
14
+ */
9
15
  export declare class DropdownNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DropdownNumberDecoratorConfig {
10
16
  displayStyle: 'dropdown';
11
17
  dropdownValues: {
@@ -8,6 +8,9 @@ declare abstract class NumberDecoratorConfig extends PropertyDecoratorConfig {
8
8
  */
9
9
  displayStyle: 'line' | 'dropdown';
10
10
  }
11
+ /**
12
+ * The configuration options for a number property displayed in a default number input.
13
+ */
11
14
  export interface DefaultNumberDecoratorConfig extends NumberDecoratorConfig {
12
15
  displayStyle: 'line';
13
16
  /**
@@ -19,6 +22,9 @@ export interface DefaultNumberDecoratorConfig extends NumberDecoratorConfig {
19
22
  */
20
23
  max?: number;
21
24
  }
25
+ /**
26
+ * The configuration options for a number property displayed in a dropdown.
27
+ */
22
28
  export interface DropdownNumberDecoratorConfig extends NumberDecoratorConfig {
23
29
  displayStyle: 'dropdown';
24
30
  /**
@@ -1,6 +1,6 @@
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 string property metadata.
4
4
  *
5
5
  * @param metadata - The metadata of the string property.
6
6
  * @returns The method that defines the metadata.
@@ -1,6 +1,9 @@
1
1
  import { Entity } from '../../classes/entity-model.class';
2
2
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
3
3
  import { DefaultObjectDecoratorConfig } from './object-decorator.data';
4
+ /**
5
+ * The internal DefaultObjectDecoratorConfig. Sets default values.
6
+ */
4
7
  export declare class DefaultObjectDecoratorConfigInternal<EntityType extends Entity> extends PropertyDecoratorConfigInternal implements DefaultObjectDecoratorConfig<EntityType> {
5
8
  displayStyle: 'inline';
6
9
  type: new (entity?: EntityType) => EntityType;
@@ -16,6 +16,9 @@ declare abstract class ObjectDecoratorConfig<EntityType extends Entity> extends
16
16
  */
17
17
  displayStyle: 'inline';
18
18
  }
19
+ /**
20
+ * The configuration options for a object property.
21
+ */
19
22
  export interface DefaultObjectDecoratorConfig<EntityType extends Entity> extends ObjectDecoratorConfig<EntityType> {
20
23
  displayStyle: 'inline';
21
24
  }
@@ -1,7 +1,7 @@
1
1
  import { Entity } from '../../classes/entity-model.class';
2
2
  import { DefaultObjectDecoratorConfig } from './object-decorator.data';
3
3
  /**
4
- * Decorator for setting and getting object propery metadata.
4
+ * Decorator for setting and getting object property metadata.
5
5
  *
6
6
  * @param metadata - The metadata of the object property.
7
7
  * @returns The method that defines the metadata.
@@ -1,5 +1,8 @@
1
1
  import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
2
2
  import { AutocompleteStringDecoratorConfig, DefaultStringDecoratorConfig, DropdownStringDecoratorConfig, TextboxStringDecoratorConfig } from './string-decorator.data';
3
+ /**
4
+ * The internal DropdownStringDecoratorConfig. Sets default values.
5
+ */
3
6
  export declare class DropdownStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DropdownStringDecoratorConfig {
4
7
  displayStyle: 'dropdown';
5
8
  dropdownValues: {
@@ -8,6 +11,9 @@ export declare class DropdownStringDecoratorConfigInternal extends PropertyDecor
8
11
  }[];
9
12
  constructor(data: DropdownStringDecoratorConfig);
10
13
  }
14
+ /**
15
+ * The internal DefaultStringDecoratorConfig. Sets default values.
16
+ */
11
17
  export declare class DefaultStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DefaultStringDecoratorConfig {
12
18
  displayStyle: 'line';
13
19
  minLength?: number;
@@ -15,12 +21,18 @@ export declare class DefaultStringDecoratorConfigInternal extends PropertyDecora
15
21
  regex?: RegExp;
16
22
  constructor(data: DefaultStringDecoratorConfig);
17
23
  }
24
+ /**
25
+ * The internal TextboxStringDecoratorConfig. Sets default values.
26
+ */
18
27
  export declare class TextboxStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements TextboxStringDecoratorConfig {
19
28
  displayStyle: 'textbox';
20
29
  minLength?: number;
21
30
  maxLength?: number;
22
31
  constructor(data: TextboxStringDecoratorConfig);
23
32
  }
33
+ /**
34
+ * The internal AutocompleteStringDecoratorConfig. Sets default values.
35
+ */
24
36
  export declare class AutocompleteStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements AutocompleteStringDecoratorConfig {
25
37
  displayStyle: 'autocomplete';
26
38
  autocompleteValues: string[];
@@ -8,6 +8,9 @@ declare abstract class StringDecoratorConfig extends PropertyDecoratorConfig {
8
8
  */
9
9
  displayStyle: 'line' | 'textbox' | 'autocomplete' | 'dropdown';
10
10
  }
11
+ /**
12
+ * The configuration options for a string property displayed as a dropdown.
13
+ */
11
14
  export interface DropdownStringDecoratorConfig extends StringDecoratorConfig {
12
15
  displayStyle: 'dropdown';
13
16
  /**
@@ -19,6 +22,9 @@ export interface DropdownStringDecoratorConfig extends StringDecoratorConfig {
19
22
  value: string;
20
23
  }[];
21
24
  }
25
+ /**
26
+ * The configuration options for a string property displayed in a default text input.
27
+ */
22
28
  export interface DefaultStringDecoratorConfig extends StringDecoratorConfig {
23
29
  displayStyle: 'line';
24
30
  /**
@@ -34,6 +40,9 @@ export interface DefaultStringDecoratorConfig extends StringDecoratorConfig {
34
40
  */
35
41
  regex?: RegExp;
36
42
  }
43
+ /**
44
+ * The configuration options for a string property displayed in a textbox input.
45
+ */
37
46
  export interface TextboxStringDecoratorConfig extends StringDecoratorConfig {
38
47
  displayStyle: 'textbox';
39
48
  /**
@@ -45,6 +54,9 @@ export interface TextboxStringDecoratorConfig extends StringDecoratorConfig {
45
54
  */
46
55
  maxLength?: number;
47
56
  }
57
+ /**
58
+ * The configuration options for a string property displayed in a mat-autocomplete input.
59
+ */
48
60
  export interface AutocompleteStringDecoratorConfig extends StringDecoratorConfig {
49
61
  displayStyle: 'autocomplete';
50
62
  /**
@@ -1,6 +1,6 @@
1
1
  import { AutocompleteStringDecoratorConfig, DefaultStringDecoratorConfig, DropdownStringDecoratorConfig, TextboxStringDecoratorConfig } from './string-decorator.data';
2
2
  /**
3
- * Decorator for setting and getting string propery metadata.
3
+ * Decorator for setting and getting string Property metadata.
4
4
  *
5
5
  * @param metadata - The metadata of the string property.
6
6
  * @returns The method that defines the metadata.