ngx-material-entity 15.1.6 → 15.1.7
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.
- package/classes/base.builder.d.ts +2 -0
- package/components/input/input.component.d.ts +109 -6
- package/components/input/input.module.d.ts +4 -1
- package/components/table/table-data.builder.d.ts +15 -4
- package/components/table/table-data.d.ts +4 -4
- package/decorators/base/decorator-types.enum.d.ts +3 -1
- package/decorators/has-many/has-many-decorator-internal.data.d.ts +17 -0
- package/decorators/has-many/has-many-decorator.data.d.ts +38 -0
- package/decorators/has-many/has-many.decorator.d.ts +9 -0
- package/encapsulation/lodash.utilities.d.ts +2 -2
- package/esm2020/classes/base.builder.mjs +3 -1
- package/esm2020/classes/entity.model.mjs +2 -3
- package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +3 -3
- package/esm2020/components/edit-page/page-edit-data.builder.mjs +4 -4
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +3 -3
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +3 -3
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +3 -3
- package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +3 -3
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +3 -3
- package/esm2020/components/input/input.component.mjs +409 -51
- package/esm2020/components/input/input.module.mjs +16 -4
- package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +3 -3
- package/esm2020/components/input/relations/references-many-input/references-many-input.component.mjs +3 -3
- package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +3 -3
- package/esm2020/components/table/edit-dialog/edit-entity.builder.mjs +3 -3
- package/esm2020/components/table/table-data.builder.mjs +48 -50
- package/esm2020/components/table/table-data.mjs +1 -1
- package/esm2020/components/table/table.component.mjs +3 -3
- package/esm2020/decorators/base/decorator-types.enum.mjs +2 -1
- package/esm2020/decorators/custom/custom-decorator-internal.data.mjs +3 -2
- package/esm2020/decorators/has-many/has-many-decorator-internal.data.mjs +32 -0
- package/esm2020/decorators/has-many/has-many-decorator.data.mjs +2 -0
- package/esm2020/decorators/has-many/has-many.decorator.mjs +13 -0
- package/esm2020/encapsulation/lodash.utilities.mjs +1 -1
- package/esm2020/public-api.mjs +3 -1
- package/esm2020/services/entity.service.mjs +31 -13
- package/esm2020/utilities/entity.utilities.mjs +57 -12
- package/fesm2015/ngx-material-entity.mjs +609 -143
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +598 -139
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/services/entity.service.d.ts +19 -4
- package/utilities/entity.utilities.d.ts +16 -1
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
|
-
import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
2
|
+
import { EnvironmentInjector, EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
3
3
|
import { NgModel } from '@angular/forms';
|
|
4
4
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
5
|
+
import { MatPaginator } from '@angular/material/paginator';
|
|
6
|
+
import { MatSort } from '@angular/material/sort';
|
|
5
7
|
import { MatTableDataSource } from '@angular/material/table';
|
|
8
|
+
import { Router } from '@angular/router';
|
|
6
9
|
import { BaseEntityType } from '../../classes/entity.model';
|
|
7
10
|
import { EditArrayItemDialogDataInternal, EntityArrayDecoratorConfigInternal } from '../../decorators/array/array-decorator-internal.data';
|
|
8
11
|
import { DecoratorTypes } from '../../decorators/base/decorator-types.enum';
|
|
9
12
|
import { PropertyDecoratorConfigInternal } from '../../decorators/base/property-decorator-internal.data';
|
|
13
|
+
import { HasManyDecoratorConfigInternal } from '../../decorators/has-many/has-many-decorator-internal.data';
|
|
10
14
|
import { DefaultObjectDecoratorConfigInternal } from '../../decorators/object/object-decorator-internal.data';
|
|
11
15
|
import { DateUtilities } from '../../utilities/date.utilities';
|
|
12
16
|
import { EntityTab, EntityUtilities } from '../../utilities/entity.utilities';
|
|
13
17
|
import { SelectionUtilities } from '../../utilities/selection.utilities';
|
|
14
18
|
import { CreateDialogDataInternal } from '../table/create-dialog/create-dialog-data.builder';
|
|
19
|
+
import { MultiSelectAction } from '../table/table-data';
|
|
15
20
|
import * as i0 from "@angular/core";
|
|
16
21
|
/**
|
|
17
22
|
* The default input component. It gets the metadata of the property from the given @Input "entity" and @Input "propertyKey"
|
|
@@ -23,6 +28,8 @@ import * as i0 from "@angular/core";
|
|
|
23
28
|
*/
|
|
24
29
|
export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
25
30
|
private readonly dialog;
|
|
31
|
+
private readonly injector;
|
|
32
|
+
private readonly router;
|
|
26
33
|
protected readonly defaultGetValidationErrorMessage: (model: NgModel) => string;
|
|
27
34
|
/**
|
|
28
35
|
* The entity on which the property exists. Used in conjunction with the "propertyKey"
|
|
@@ -77,20 +84,41 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
77
84
|
arrayItem: EntityType;
|
|
78
85
|
arrayItemPriorChanges: EntityType;
|
|
79
86
|
arrayItemInlineTabs: EntityTab<EntityType>[];
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
entityArrayDataSource: MatTableDataSource<EntityType>;
|
|
88
|
+
entityArraySelection: SelectionModel<EntityType>;
|
|
89
|
+
entityArrayDisplayedColumns: string[];
|
|
83
90
|
isArrayItemValid: boolean;
|
|
84
91
|
isArrayItemDirty: boolean;
|
|
85
92
|
indexOfEditedArrayItem: number;
|
|
86
93
|
addArrayItemDialogData: CreateDialogDataInternal;
|
|
87
94
|
arrayItemDialogTabs: EntityTab<EntityType>[];
|
|
88
95
|
editArrayItemDialogData: EditArrayItemDialogDataInternal<EntityType>;
|
|
96
|
+
metadataHasMany: HasManyDecoratorConfigInternal<EntityType, EntityType>;
|
|
97
|
+
hasManyIsLoading: boolean;
|
|
98
|
+
hasManyPaginator: MatPaginator;
|
|
99
|
+
hasManySort: MatSort;
|
|
100
|
+
hasManyFilter: string;
|
|
101
|
+
displayedHasManyColumns: string[];
|
|
102
|
+
hasManyDataSource: MatTableDataSource<EntityType>;
|
|
103
|
+
hasManySelection: SelectionModel<EntityType>;
|
|
104
|
+
hasManyImportAction: Omit<MultiSelectAction<EntityType>, 'confirmationDialog'>;
|
|
105
|
+
private hasManyEntityService;
|
|
106
|
+
createHasManyDialog: TemplateRef<unknown>;
|
|
107
|
+
createHasManyDialogRef: MatDialogRef<unknown>;
|
|
108
|
+
editHasManyDialog: TemplateRef<unknown>;
|
|
109
|
+
editHasManyDialogRef: MatDialogRef<unknown>;
|
|
110
|
+
hasManyEntity: EntityType;
|
|
111
|
+
hasManyEntityPriorChanges: EntityType;
|
|
112
|
+
isHasManyEntityValid: boolean;
|
|
113
|
+
isHasManyEntityDirty: boolean;
|
|
114
|
+
hasManyCreateTabs: EntityTab<EntityType>[];
|
|
115
|
+
hasManyUpdateTabs: EntityTab<EntityType>[];
|
|
116
|
+
private createBaseUrl;
|
|
89
117
|
readonly DecoratorTypes: typeof DecoratorTypes;
|
|
90
118
|
EntityUtilities: typeof EntityUtilities;
|
|
91
119
|
DateUtilities: typeof DateUtilities;
|
|
92
120
|
SelectionUtilities: typeof SelectionUtilities;
|
|
93
|
-
constructor(dialog: MatDialog, defaultGetValidationErrorMessage: (model: NgModel) => string);
|
|
121
|
+
constructor(dialog: MatDialog, injector: EnvironmentInjector, router: Router, defaultGetValidationErrorMessage: (model: NgModel) => string);
|
|
94
122
|
/**
|
|
95
123
|
* This is needed for the inputs to work inside an ngFor.
|
|
96
124
|
*
|
|
@@ -99,8 +127,83 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
99
127
|
*/
|
|
100
128
|
trackByFn(index: unknown): unknown;
|
|
101
129
|
ngOnInit(): void;
|
|
130
|
+
private initHasMany;
|
|
102
131
|
private initEntityArray;
|
|
103
132
|
private initObjectInput;
|
|
133
|
+
private startImportJson;
|
|
134
|
+
private importJson;
|
|
135
|
+
/**
|
|
136
|
+
* Edits an entity. This either calls the edit-Method provided by the user or uses a default edit-dialog.
|
|
137
|
+
*
|
|
138
|
+
* @param entity - The entity that should be updated.
|
|
139
|
+
* @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
|
|
140
|
+
*/
|
|
141
|
+
editHasManyEntity(entity: EntityType): void;
|
|
142
|
+
private editHasManyDefaultPage;
|
|
143
|
+
private editHasManyDefaultDialog;
|
|
144
|
+
/**
|
|
145
|
+
* Tries to save the changes and close the dialog afterwards.
|
|
146
|
+
* Also handles the confirmation if required.
|
|
147
|
+
*/
|
|
148
|
+
dialogEditHasMany(): void;
|
|
149
|
+
private dialogConfirmEditHasMany;
|
|
150
|
+
/**
|
|
151
|
+
* Tries to delete the entity and close the dialog afterwards.
|
|
152
|
+
* Also handles the confirmation if required.
|
|
153
|
+
*/
|
|
154
|
+
deleteHasManyEntity(): void;
|
|
155
|
+
private confirmDeleteHasManyEntity;
|
|
156
|
+
/**
|
|
157
|
+
* Cancels the editing of the has many entity and closes the dialog.
|
|
158
|
+
*/
|
|
159
|
+
dialogCancelEditHasMany(): void;
|
|
160
|
+
/**
|
|
161
|
+
* Creates a new Entity. This either calls the create-Method provided by the user or uses a default create-dialog.
|
|
162
|
+
*
|
|
163
|
+
* @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
|
|
164
|
+
*/
|
|
165
|
+
createHasManyEntity(): void;
|
|
166
|
+
private createHasManyDefault;
|
|
167
|
+
/**
|
|
168
|
+
* Creates the has many entity over the dialog.
|
|
169
|
+
*/
|
|
170
|
+
dialogCreateHasMany(): void;
|
|
171
|
+
private dialogConfirmCreateHasMany;
|
|
172
|
+
/**
|
|
173
|
+
* Cancels the creating of the has many entity and closes the dialog.
|
|
174
|
+
*/
|
|
175
|
+
dialogCancelCreateHasMany(): void;
|
|
176
|
+
/**
|
|
177
|
+
* Runs the MultiAction for all selected entries.
|
|
178
|
+
* Also handles confirmation with an additional dialog if configured.
|
|
179
|
+
*
|
|
180
|
+
* @param action - The MultiAction to run.
|
|
181
|
+
*/
|
|
182
|
+
runHasManyMultiAction(action: MultiSelectAction<EntityType>): void;
|
|
183
|
+
private confirmRunHasManyMultiAction;
|
|
184
|
+
/**
|
|
185
|
+
* Checks if an MultiAction is disabled (e.g. Because no entries have been selected).
|
|
186
|
+
*
|
|
187
|
+
* @param action - The MultiAction to check.
|
|
188
|
+
* @returns Whether or not the Action can be used.
|
|
189
|
+
*/
|
|
190
|
+
hasManyMultiActionDisabled(action: MultiSelectAction<EntityType>): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Applies the search input to filter the table entries.
|
|
193
|
+
*
|
|
194
|
+
* @param event - The keyup-event which contains the search-string of the user.
|
|
195
|
+
*/
|
|
196
|
+
applyHasManyFilter(event: Event): void;
|
|
197
|
+
/**
|
|
198
|
+
* Checks if the entity is valid for updating and if it is dirty.
|
|
199
|
+
*/
|
|
200
|
+
checkHasManyEntity(): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Checks if the entity is valid.
|
|
203
|
+
*
|
|
204
|
+
* @param omit - Whether values omitted for create or update should be left out.
|
|
205
|
+
*/
|
|
206
|
+
checkIsHasManyEntityValid(omit: 'create' | 'update'): void;
|
|
104
207
|
/**
|
|
105
208
|
* Checks whether the array item is valid and if the array item is dirty.
|
|
106
209
|
*/
|
|
@@ -148,7 +251,7 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
148
251
|
/**
|
|
149
252
|
* Removes all selected entries from the entity array.
|
|
150
253
|
*/
|
|
151
|
-
|
|
254
|
+
removeFromEntityArray(): void;
|
|
152
255
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputComponent<any>, never>;
|
|
153
256
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInputComponent<any>, "ngx-mat-entity-input", never, { "entity": "entity"; "propertyKey": "propertyKey"; "getValidationErrorMessage": "getValidationErrorMessage"; "hideOmitForCreate": "hideOmitForCreate"; "hideOmitForEdit": "hideOmitForEdit"; "isReadOnly": "isReadOnly"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never, false, never>;
|
|
154
257
|
}
|
|
@@ -41,8 +41,11 @@ import * as i39 from "@angular/material/button";
|
|
|
41
41
|
import * as i40 from "@angular/material/datepicker";
|
|
42
42
|
import * as i41 from "@angular/material/slider";
|
|
43
43
|
import * as i42 from "@angular/material/tabs";
|
|
44
|
+
import * as i43 from "@angular/material/menu";
|
|
45
|
+
import * as i44 from "@angular/material/progress-spinner";
|
|
46
|
+
import * as i45 from "@angular/material/paginator";
|
|
44
47
|
export declare class NgxMatEntityInputModule {
|
|
45
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputModule, never>;
|
|
46
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.StringInputComponent, typeof i2.StringTextboxInputComponent, typeof i3.StringAutocompleteInputComponent, typeof i4.StringDropdownInputComponent, typeof i5.StringPasswordInputComponent, typeof i6.BooleanCheckboxInputComponent, typeof i7.BooleanToggleInputComponent, typeof i8.BooleanDropdownInputComponent, typeof i9.NumberInputComponent, typeof i10.NumberDropdownInputComponent, typeof i11.NumberSliderInputComponent, typeof i12.ArrayStringChipsInputComponent, typeof i13.ArrayStringAutocompleteChipsComponent, typeof i14.DateInputComponent, typeof i15.DateRangeInputComponent, typeof i16.DateTimeInputComponent, typeof i17.ArrayDateInputComponent, typeof i18.ArrayDateTimeInputComponent, typeof i19.ArrayDateRangeInputComponent, typeof i20.FileInputComponent, typeof i21.FileImageInputComponent, typeof i22.FileDefaultInputComponent, typeof i23.DragDropDirective, typeof i24.ReferencesManyInputComponent, typeof i25.CustomInputComponent, typeof i26.NgxMatEntityInputComponent], [typeof i27.CommonModule, typeof i28.MatInputModule, typeof i29.FormsModule, typeof i30.MatFormFieldModule, typeof i31.MatSelectModule, typeof i32.MatAutocompleteModule, typeof i33.MatCheckboxModule, typeof i34.MatSlideToggleModule, typeof i35.MatChipsModule, typeof i36.MatIconModule, typeof i37.MatTableModule, typeof i38.MatDialogModule, typeof i39.MatButtonModule, typeof i40.MatDatepickerModule, typeof i41.MatSliderModule, typeof i42.MatTabsModule], [typeof i26.NgxMatEntityInputComponent]>;
|
|
49
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.StringInputComponent, typeof i2.StringTextboxInputComponent, typeof i3.StringAutocompleteInputComponent, typeof i4.StringDropdownInputComponent, typeof i5.StringPasswordInputComponent, typeof i6.BooleanCheckboxInputComponent, typeof i7.BooleanToggleInputComponent, typeof i8.BooleanDropdownInputComponent, typeof i9.NumberInputComponent, typeof i10.NumberDropdownInputComponent, typeof i11.NumberSliderInputComponent, typeof i12.ArrayStringChipsInputComponent, typeof i13.ArrayStringAutocompleteChipsComponent, typeof i14.DateInputComponent, typeof i15.DateRangeInputComponent, typeof i16.DateTimeInputComponent, typeof i17.ArrayDateInputComponent, typeof i18.ArrayDateTimeInputComponent, typeof i19.ArrayDateRangeInputComponent, typeof i20.FileInputComponent, typeof i21.FileImageInputComponent, typeof i22.FileDefaultInputComponent, typeof i23.DragDropDirective, typeof i24.ReferencesManyInputComponent, typeof i25.CustomInputComponent, typeof i26.NgxMatEntityInputComponent], [typeof i27.CommonModule, typeof i28.MatInputModule, typeof i29.FormsModule, typeof i30.MatFormFieldModule, typeof i31.MatSelectModule, typeof i32.MatAutocompleteModule, typeof i33.MatCheckboxModule, typeof i34.MatSlideToggleModule, typeof i35.MatChipsModule, typeof i36.MatIconModule, typeof i37.MatTableModule, typeof i38.MatDialogModule, typeof i39.MatButtonModule, typeof i40.MatDatepickerModule, typeof i41.MatSliderModule, typeof i42.MatTabsModule, typeof i43.MatMenuModule, typeof i44.MatProgressSpinnerModule, typeof i45.MatPaginatorModule], [typeof i26.NgxMatEntityInputComponent]>;
|
|
47
50
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityInputModule>;
|
|
48
51
|
}
|
|
@@ -33,9 +33,9 @@ export declare class BaseDataInternal<EntityType extends BaseEntityType<EntityTy
|
|
|
33
33
|
defaultEdit: 'dialog' | 'page';
|
|
34
34
|
searchString: (entity: EntityType) => string;
|
|
35
35
|
allowCreate: () => boolean;
|
|
36
|
-
allowRead: (entity
|
|
37
|
-
allowUpdate: (entity
|
|
38
|
-
allowDelete: (entity
|
|
36
|
+
allowRead: (entity?: EntityType) => boolean;
|
|
37
|
+
allowUpdate: (entity?: EntityType) => boolean;
|
|
38
|
+
allowDelete: (entity?: EntityType) => boolean;
|
|
39
39
|
multiSelectActions: MultiSelectAction<EntityType>[];
|
|
40
40
|
multiSelectLabel: string;
|
|
41
41
|
displayLoadingSpinner: boolean;
|
|
@@ -44,7 +44,8 @@ export declare class BaseDataInternal<EntityType extends BaseEntityType<EntityTy
|
|
|
44
44
|
EntityClass?: EntityClassNewable<EntityType>;
|
|
45
45
|
edit?: (entity: EntityType) => unknown;
|
|
46
46
|
create?: (entity: EntityType) => unknown;
|
|
47
|
-
constructor(
|
|
47
|
+
constructor(data: BaseData<EntityType>);
|
|
48
|
+
private allowDataToFunction;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* The Builder for the complete TableData. Sets default values and validates user input.
|
|
@@ -54,3 +55,13 @@ export declare class TableDataBuilder<EntityType extends BaseEntityType<EntityTy
|
|
|
54
55
|
protected generateBaseData(data: TableData<EntityType>): TableDataInternal<EntityType>;
|
|
55
56
|
protected validateInput(data: TableData<EntityType>): void;
|
|
56
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* The default search function taken from googles mat table.
|
|
60
|
+
* This will be used if no custom search function is provided by the configuration.
|
|
61
|
+
*
|
|
62
|
+
* It generates a string from an entity which is then used to compare it to the search input.
|
|
63
|
+
*
|
|
64
|
+
* @param entity - An entity that is in the search.
|
|
65
|
+
* @returns The generated string of the given entity used for comparison with the search input.
|
|
66
|
+
*/
|
|
67
|
+
export declare function defaultSearchFunction<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): string;
|
|
@@ -99,25 +99,25 @@ export interface BaseData<EntityType extends BaseEntityType<EntityType>> {
|
|
|
99
99
|
*
|
|
100
100
|
* @default () => true
|
|
101
101
|
*/
|
|
102
|
-
allowCreate?: () => boolean;
|
|
102
|
+
allowCreate?: boolean | (() => boolean);
|
|
103
103
|
/**
|
|
104
104
|
* Defines whether or not the user can view the specific entity.
|
|
105
105
|
*
|
|
106
106
|
* @default () => true
|
|
107
107
|
*/
|
|
108
|
-
allowRead?: (entity
|
|
108
|
+
allowRead?: boolean | ((entity?: EntityType) => boolean);
|
|
109
109
|
/**
|
|
110
110
|
* Defines whether or not the user can edit the specific entity.
|
|
111
111
|
*
|
|
112
112
|
* @default () => true
|
|
113
113
|
*/
|
|
114
|
-
allowUpdate?: (entity
|
|
114
|
+
allowUpdate?: boolean | ((entity?: EntityType) => boolean);
|
|
115
115
|
/**
|
|
116
116
|
* Whether or not the user can delete this specific entity.
|
|
117
117
|
*
|
|
118
118
|
* @default () => true
|
|
119
119
|
*/
|
|
120
|
-
allowDelete?: (entity
|
|
120
|
+
allowDelete?: boolean | ((entity?: EntityType) => boolean);
|
|
121
121
|
/**
|
|
122
122
|
* All Actions that you want to run on multiple entities can be defined here.
|
|
123
123
|
* (e.g. Download as zip-file or mass delete).
|
|
@@ -3,6 +3,7 @@ import { CheckboxBooleanDecoratorConfigInternal, DropdownBooleanDecoratorConfigI
|
|
|
3
3
|
import { CustomDecoratorConfigInternal } from '../custom/custom-decorator-internal.data';
|
|
4
4
|
import { DateRangeDateDecoratorConfigInternal, DateTimeDateDecoratorConfigInternal, DefaultDateDecoratorConfigInternal } from '../date/date-decorator-internal.data';
|
|
5
5
|
import { DefaultFileDecoratorConfigInternal, ImageFileDecoratorConfigInternal } from '../file/file-decorator-internal.data';
|
|
6
|
+
import { HasManyDecoratorConfigInternal } from '../has-many/has-many-decorator-internal.data';
|
|
6
7
|
import { DefaultNumberDecoratorConfigInternal, DropdownNumberDecoratorConfigInternal, SliderNumberDecoratorConfigInternal } from '../number/number-decorator-internal.data';
|
|
7
8
|
import { DefaultObjectDecoratorConfigInternal } from '../object/object-decorator-internal.data';
|
|
8
9
|
import { ReferencesManyDecoratorConfigInternal } from '../references-many/references-many-decorator-internal.data';
|
|
@@ -35,9 +36,10 @@ export declare enum DecoratorTypes {
|
|
|
35
36
|
FILE_DEFAULT = "fileDefault",
|
|
36
37
|
FILE_IMAGE = "fileImage",
|
|
37
38
|
REFERENCES_MANY = "referencesMany",
|
|
39
|
+
HAS_MANY = "hasMany",
|
|
38
40
|
CUSTOM = "custom"
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
41
43
|
* Gives the metadata-config Type based on the DecoratorTypes enum.
|
|
42
44
|
*/
|
|
43
|
-
export declare type DecoratorType<T, CustomMetadataType extends Record<string, unknown>> = T extends DecoratorTypes.STRING ? DefaultStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_TEXTBOX ? TextboxStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_DROPDOWN ? DropdownStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_AUTOCOMPLETE ? AutocompleteStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_PASSWORD ? PasswordStringDecoratorConfigInternal : T extends DecoratorTypes.NUMBER ? DefaultNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_DROPDOWN ? DropdownNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_SLIDER ? SliderNumberDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_CHECKBOX ? CheckboxBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_TOGGLE ? ToggleBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_DROPDOWN ? DropdownBooleanDecoratorConfigInternal : T extends DecoratorTypes.OBJECT ? DefaultObjectDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY ? EntityArrayDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY_DATE ? DateArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_TIME ? DateTimeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_RANGE ? DateRangeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_CHIPS ? StringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS ? AutocompleteStringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.DATE ? DefaultDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_RANGE ? DateRangeDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_TIME ? DateTimeDateDecoratorConfigInternal : T extends DecoratorTypes.FILE_DEFAULT ? DefaultFileDecoratorConfigInternal : T extends DecoratorTypes.FILE_IMAGE ? ImageFileDecoratorConfigInternal : T extends DecoratorTypes.REFERENCES_MANY ? ReferencesManyDecoratorConfigInternal<any> : T extends DecoratorTypes.CUSTOM ? CustomDecoratorConfigInternal<any, any, CustomMetadataType, any> : never;
|
|
45
|
+
export declare type DecoratorType<T, CustomMetadataType extends Record<string, unknown>> = T extends DecoratorTypes.STRING ? DefaultStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_TEXTBOX ? TextboxStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_DROPDOWN ? DropdownStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_AUTOCOMPLETE ? AutocompleteStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_PASSWORD ? PasswordStringDecoratorConfigInternal : T extends DecoratorTypes.NUMBER ? DefaultNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_DROPDOWN ? DropdownNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_SLIDER ? SliderNumberDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_CHECKBOX ? CheckboxBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_TOGGLE ? ToggleBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_DROPDOWN ? DropdownBooleanDecoratorConfigInternal : T extends DecoratorTypes.OBJECT ? DefaultObjectDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY ? EntityArrayDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY_DATE ? DateArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_TIME ? DateTimeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_RANGE ? DateRangeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_CHIPS ? StringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS ? AutocompleteStringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.DATE ? DefaultDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_RANGE ? DateRangeDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_TIME ? DateTimeDateDecoratorConfigInternal : T extends DecoratorTypes.FILE_DEFAULT ? DefaultFileDecoratorConfigInternal : T extends DecoratorTypes.FILE_IMAGE ? ImageFileDecoratorConfigInternal : T extends DecoratorTypes.REFERENCES_MANY ? ReferencesManyDecoratorConfigInternal<any> : T extends DecoratorTypes.HAS_MANY ? HasManyDecoratorConfigInternal<any, any> : T extends DecoratorTypes.CUSTOM ? CustomDecoratorConfigInternal<any, any, CustomMetadataType, any> : never;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
3
|
+
import { TableDataInternal } from '../../components/table/table-data.builder';
|
|
4
|
+
import { EntityService } from '../../services/entity.service';
|
|
5
|
+
import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
|
|
6
|
+
import { HasManyDecoratorConfig } from './has-many-decorator.data';
|
|
7
|
+
/**
|
|
8
|
+
* The internal HasManyDecoratorConfig. Sets default values.
|
|
9
|
+
*/
|
|
10
|
+
export declare class HasManyDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>, RelatedBaseEntityType extends BaseEntityType<RelatedBaseEntityType>> extends PropertyDecoratorConfigInternal implements HasManyDecoratorConfig<EntityType, RelatedBaseEntityType> {
|
|
11
|
+
omitForCreate: true;
|
|
12
|
+
tableData: TableDataInternal<EntityType>;
|
|
13
|
+
RelatedEntityServiceClass: new (httpClient: HttpClient) => EntityService<RelatedBaseEntityType>;
|
|
14
|
+
createBaseUrl: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
|
|
15
|
+
readBaseUrl: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
|
|
16
|
+
constructor(data: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>);
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
3
|
+
import { TableData } from '../../components/table/table-data';
|
|
4
|
+
import { EntityService } from '../../services/entity.service';
|
|
5
|
+
import { PropertyDecoratorConfig } from '../base/property-decorator.data';
|
|
6
|
+
/**
|
|
7
|
+
* Definition for the @hasMany metadata.
|
|
8
|
+
*/
|
|
9
|
+
export interface HasManyDecoratorConfig<EntityType extends BaseEntityType<EntityType>, RelatedBaseEntityType extends BaseEntityType<RelatedBaseEntityType>> extends PropertyDecoratorConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Whether or not the property gets omitted when creating new Entities.
|
|
12
|
+
*
|
|
13
|
+
* For the hasMany property this is always true, as entities can't be created for a non existing base entity.
|
|
14
|
+
*/
|
|
15
|
+
omitForCreate?: true;
|
|
16
|
+
/**
|
|
17
|
+
* The configuration for the table with the hasMany entities.
|
|
18
|
+
*/
|
|
19
|
+
tableData: TableData<EntityType>;
|
|
20
|
+
/**
|
|
21
|
+
* The service class for the base entity that the has hasMany entities belong to.
|
|
22
|
+
* This is used to generate the create and read base urls, eg. "customers/{id}/invoices".
|
|
23
|
+
* If you want to override that behavior you can provide a custom createBaseUrl and readBaseUrl function.
|
|
24
|
+
*/
|
|
25
|
+
RelatedEntityServiceClass: new (httpClient: HttpClient) => EntityService<RelatedBaseEntityType>;
|
|
26
|
+
/**
|
|
27
|
+
* A function that generates a base url for create requests.
|
|
28
|
+
*
|
|
29
|
+
* @default `{baseEntityUrl}/{id}/{lastHasManyEntityUrlSegment}`
|
|
30
|
+
*/
|
|
31
|
+
createBaseUrl?: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
|
|
32
|
+
/**
|
|
33
|
+
* A function that generates a base url for read requests.
|
|
34
|
+
*
|
|
35
|
+
* @default `{baseEntityUrl}/{id}/{lastHasManyEntityUrlSegment}`
|
|
36
|
+
*/
|
|
37
|
+
readBaseUrl?: (baseEntity: RelatedBaseEntityType, metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>) => string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
2
|
+
import { HasManyDecoratorConfig } from './has-many-decorator.data';
|
|
3
|
+
/**
|
|
4
|
+
* Decorator for setting and getting has many property metadata.
|
|
5
|
+
*
|
|
6
|
+
* @param metadata - The metadata of the has many property.
|
|
7
|
+
* @returns The method that defines the metadata.
|
|
8
|
+
*/
|
|
9
|
+
export declare function hasMany<EntityType extends BaseEntityType<EntityType>, RelatedBaseEntityType extends BaseEntityType<RelatedBaseEntityType>>(metadata: HasManyDecoratorConfig<EntityType, RelatedBaseEntityType>): (target: object, propertyKey: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Many, PartialObject, ValueKeyIteratee } from 'lodash';
|
|
2
2
|
/**
|
|
3
3
|
* Encapsulates all functionality of lodash.
|
|
4
4
|
*/
|
|
@@ -51,7 +51,7 @@ export declare abstract class LodashUtilities {
|
|
|
51
51
|
* @param predicate - The function invoked per property.
|
|
52
52
|
* @returns Returns the new object.
|
|
53
53
|
*/
|
|
54
|
-
static omitBy<T>(object:
|
|
54
|
+
static omitBy<T extends object>(object: T | null | undefined, predicate: ValueKeyIteratee<T[keyof T]>): PartialObject<T>;
|
|
55
55
|
/**
|
|
56
56
|
* Checks if value is classified as an Array object.
|
|
57
57
|
*
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export const defaultTrue = () => true;
|
|
2
|
+
export const defaultFalse = () => false;
|
|
1
3
|
/**
|
|
2
4
|
* The abstract BaseBuilder class.
|
|
3
5
|
*/
|
|
@@ -39,4 +41,4 @@ export class BaseBuilder {
|
|
|
39
41
|
return this.data;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5idWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LW1hdGVyaWFsLWVudGl0eS9zcmMvY2xhc3Nlcy9iYXNlLmJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxDQUFDLE1BQU0sV0FBVyxHQUFrQixHQUFHLEVBQUUsQ0FBQyxJQUFJLENBQUM7QUFDckQsTUFBTSxDQUFDLE1BQU0sWUFBWSxHQUFrQixHQUFHLEVBQUUsQ0FBQyxLQUFLLENBQUM7QUFFdkQ7O0dBRUc7QUFDSCxNQUFNLE9BQWdCLFdBQVc7SUFLN0IsWUFBc0IsSUFBZ0I7UUFDbEMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsQ0FBQzt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B0aGlzLmRhdGE7XG4gICAgfVxufSJdfQ==
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { string } from '../decorators/string/string.decorator';
|
|
3
|
-
import { EntityUtilities } from '../utilities/entity.utilities';
|
|
4
3
|
/**
|
|
5
4
|
* A base Entity class with a builtin id.
|
|
6
5
|
*/
|
|
7
6
|
export class Entity {
|
|
8
7
|
constructor(entity) {
|
|
9
|
-
|
|
8
|
+
this.id = entity?.id;
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
11
|
__decorate([
|
|
@@ -20,4 +19,4 @@ __decorate([
|
|
|
20
19
|
}),
|
|
21
20
|
__metadata("design:type", String)
|
|
22
21
|
], Entity.prototype, "id", void 0);
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5Lm1vZGVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LW1hdGVyaWFsLWVudGl0eS9zcmMvY2xhc3Nlcy9lbnRpdHkubW9kZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSx1Q0FBdUMsQ0FBQztBQVkvRDs7R0FFRztBQUNILE1BQU0sT0FBZ0IsTUFBTTtJQWN4QixZQUFZLE1BQWU7UUFDdkIsSUFBSSxDQUFDLEVBQUUsR0FBRyxNQUFNLEVBQUUsRUFBWSxDQUFDO0lBQ25DLENBQUM7Q0FDSjtBQWJHO0lBQUMsTUFBTSxDQUFDO1FBQ0osYUFBYSxFQUFFLElBQUk7UUFDbkIsYUFBYSxFQUFFLElBQUk7UUFDbkIsT0FBTyxFQUFFLEtBQUs7UUFDZCxZQUFZLEVBQUUsTUFBTTtRQUNwQixXQUFXLEVBQUUsSU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pXG4gICAgcmVhZG9ubHkgaWQhOiBzdHJpbmc7XG5cbiAgICBjb25zdHJ1Y3RvcihlbnRpdHk/OiBFbnRpdHkpIHtcbiAgICAgICAgdGhpcy5pZCA9IGVudGl0eT8uaWQgYXMgc3RyaW5nO1xuICAgIH1cbn0iXX0=
|
|
@@ -30,8 +30,8 @@ export class ConfirmDialogDataBuilder extends BaseBuilder {
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
if (data.requireConfirmation === true && !data.confirmationText) {
|
|
33
|
-
|
|
34
|
-
You can only omit this value when "requireConfirmation" is false
|
|
33
|
+
// eslint-disable-next-line max-len
|
|
34
|
+
throw new Error('Missing required Input data "confirmationText". You can only omit this value when "requireConfirmation" is false.');
|
|
35
35
|
}
|
|
36
36
|
if (data.requireConfirmation !== true && data.confirmationText) {
|
|
37
37
|
throw new Error('The "confirmationText" will never be shown because "requireConfirmation" is not set to true');
|
|
@@ -41,4 +41,4 @@ export class ConfirmDialogDataBuilder extends BaseBuilder {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS1kaWFsb2ctZGF0YS5idWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LW1hdGVyaWFsLWVudGl0eS9zcmMvY29tcG9uZW50cy9jb25maXJtLWRpYWxvZy9jb25maXJtLWRpYWxvZy1kYXRhLmJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBR3pEOztHQUVHO0FBQ0gsTUFBTSxPQUFPLHlCQUF5QjtJQWdCbEMsWUFDSSxJQUFjLEVBQ2QsSUFBd0I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XRpb25UZXh0XCIgd2lsbCBuZXZlciBiZSBzaG93biBiZWNhdXNlIFwicmVxdWlyZUNvbmZpcm1hdGlvblwiIGlzIG5vdCBzZXQgdG8gdHJ1ZScpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChkYXRhLnR5cGUgPT09ICdpbmZvLW9ubHknICYmIGRhdGEuY2FuY2VsQnV0dG9uTGFiZWwpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVGhlIFwiY2FuY2VsQnV0dG9uTGFiZWxcIiB3aWxsIG5ldmVyIGJlIHNob3duIGJlY2F1c2UgXCJ0eXBlXCIgaXMgc2V0IHRvIFwiaW5mby1vbmx5XCInKTtcbiAgICAgICAgfVxuICAgIH1cbn0iXX0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseBuilder } from '../../classes/base.builder';
|
|
1
|
+
import { BaseBuilder, defaultTrue } from '../../classes/base.builder';
|
|
2
2
|
import { ConfirmDialogDataBuilder } from '../confirm-dialog/confirm-dialog-data.builder';
|
|
3
3
|
import { EditDialogDataBuilder } from '../table/edit-dialog/edit-data.builder';
|
|
4
4
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
@@ -23,10 +23,10 @@ export class PageEditDataBuilder extends BaseBuilder {
|
|
|
23
23
|
confirmUnsavedChangesDialogData: confirmUnsavedChangesDialogData,
|
|
24
24
|
unsavedChangesRequireConfirmDialog: data.editData?.unsavedChangesRequireConfirmDialog ?? true
|
|
25
25
|
},
|
|
26
|
-
allowUpdate: data.allowUpdate ??
|
|
27
|
-
allowDelete: data.allowDelete ??
|
|
26
|
+
allowUpdate: data.allowUpdate ?? defaultTrue,
|
|
27
|
+
allowDelete: data.allowDelete ?? defaultTrue,
|
|
28
28
|
displayLoadingSpinner: data.displayLoadingSpinner ?? true
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;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