ngx-material-entity 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +533 -326
- package/capsulation/lodash.utilities.d.ts +62 -0
- package/capsulation/reflect.utilities.d.ts +56 -0
- package/classes/base.builder.d.ts +36 -0
- package/classes/date.utilities.d.ts +70 -0
- package/classes/entity.model.d.ts +19 -0
- package/classes/entity.service.d.ts +108 -0
- package/classes/entity.utilities.d.ts +180 -0
- package/classes/file.utilities.d.ts +52 -0
- package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +10 -11
- package/components/confirm-dialog/confirm-dialog-data.d.ts +4 -0
- package/components/confirm-dialog/confirm-dialog.component.d.ts +11 -0
- package/components/input/add-array-item-dialog-data.builder.d.ts +21 -0
- package/components/input/{array-table/add-array-item-dialog/add-array-item-dialog-data.d.ts → add-array-item-dialog-data.d.ts} +6 -3
- package/components/input/array/array-date-input/array-date-input.component.d.ts +22 -0
- package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +30 -0
- package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +32 -0
- package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +58 -0
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +51 -0
- package/components/input/array/array-table.class.d.ts +48 -0
- package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +17 -0
- package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +17 -0
- package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +17 -0
- package/components/input/date/date-input/date-input.component.d.ts +21 -0
- package/components/input/date/date-range-input/date-range-input.component.d.ts +27 -0
- package/components/input/date/date-time-input/date-time-input.component.d.ts +38 -0
- package/components/input/file/file-default-input/file-default-input.component.d.ts +21 -0
- package/components/input/file/file-image-input/file-image-input.component.d.ts +30 -0
- package/components/input/file/file-input/dragDrop.directive.d.ts +32 -0
- package/components/input/file/file-input/file-input.component.d.ts +32 -0
- package/components/input/input.component.d.ts +108 -39
- package/components/input/input.module.d.ts +37 -13
- package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +17 -0
- package/components/input/number/number-input/number-input.component.d.ts +17 -0
- package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +25 -0
- package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +17 -0
- package/components/input/string/string-input/string-input.component.d.ts +17 -0
- package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +17 -0
- package/components/table/create-dialog/create-dialog-data.builder.d.ts +9 -8
- package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +12 -6
- package/components/table/create-dialog/create-entity-dialog-data.d.ts +3 -3
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +23 -7
- package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +11 -13
- package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +3 -3
- package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +12 -6
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +25 -7
- package/components/table/table-data.builder.d.ts +25 -14
- package/components/table/table-data.d.ts +22 -10
- package/components/table/table.component.d.ts +48 -2
- package/components/table/table.module.d.ts +3 -1
- package/decorators/array/array-decorator-internal.data.d.ts +85 -9
- package/decorators/array/array-decorator.data.d.ts +200 -25
- package/decorators/array/array.decorator.d.ts +4 -4
- package/decorators/base/base-property.decorator.d.ts +2 -3
- package/decorators/base/decorator-types.enum.d.ts +13 -4
- package/decorators/base/dropdown-value.interface.d.ts +14 -0
- package/decorators/base/property-decorator-internal.data.d.ts +16 -3
- package/decorators/base/property-decorator.data.d.ts +26 -5
- package/decorators/boolean/boolean-decorator-internal.data.d.ts +9 -0
- package/decorators/boolean/boolean-decorator.data.d.ts +9 -0
- package/decorators/boolean/boolean.decorator.d.ts +1 -1
- package/decorators/date/date-decorator-internal.data.d.ts +44 -0
- package/decorators/date/date-decorator.data.d.ts +129 -0
- package/decorators/date/date.decorator.d.ts +8 -0
- package/decorators/file/file-decorator-internal.data.d.ts +92 -0
- package/decorators/file/file-decorator.data.d.ts +92 -0
- package/decorators/file/file.decorator.d.ts +9 -0
- package/decorators/number/number-decorator-internal.data.d.ts +8 -4
- package/decorators/number/number-decorator.data.d.ts +8 -4
- package/decorators/number/number.decorator.d.ts +2 -2
- package/decorators/object/object-decorator-internal.data.d.ts +6 -3
- package/decorators/object/object-decorator.data.d.ts +8 -5
- package/decorators/object/object.decorator.d.ts +3 -3
- package/decorators/string/string-decorator-internal.data.d.ts +14 -4
- package/decorators/string/string-decorator.data.d.ts +14 -4
- package/decorators/string/string.decorator.d.ts +1 -1
- package/esm2020/capsulation/lodash.utilities.mjs +75 -0
- package/esm2020/capsulation/reflect.utilities.mjs +69 -0
- package/esm2020/classes/base.builder.mjs +42 -0
- package/esm2020/classes/date.utilities.mjs +158 -0
- package/esm2020/classes/entity.model.mjs +19 -0
- package/esm2020/classes/entity.service.mjs +180 -0
- package/esm2020/classes/entity.utilities.mjs +669 -0
- package/esm2020/classes/file.utilities.mjs +123 -0
- package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +17 -50
- package/esm2020/components/confirm-dialog/confirm-dialog-data.mjs +1 -1
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +15 -4
- package/esm2020/components/get-validation-error-message.function.mjs +5 -1
- package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +30 -0
- package/esm2020/components/input/add-array-item-dialog-data.mjs +2 -0
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +44 -0
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +68 -0
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +65 -0
- package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +131 -0
- package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +116 -0
- package/esm2020/components/input/array/array-table.class.mjs +92 -0
- package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +38 -0
- package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +35 -0
- package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +38 -0
- package/esm2020/components/input/date/date-input/date-input.component.mjs +38 -0
- package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +63 -0
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +74 -0
- package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +39 -0
- package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +95 -0
- package/esm2020/components/input/file/file-input/dragDrop.directive.mjs +64 -0
- package/esm2020/components/input/file/file-input/file-input.component.mjs +152 -0
- package/esm2020/components/input/input.component.mjs +207 -110
- package/esm2020/components/input/input.module.mjs +87 -10
- package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +36 -0
- package/esm2020/components/input/number/number-input/number-input.component.mjs +34 -0
- package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +52 -0
- package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +36 -0
- package/esm2020/components/input/string/string-input/string-input.component.mjs +34 -0
- package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +35 -0
- package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +18 -40
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +15 -7
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +36 -22
- package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +20 -4
- package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +23 -63
- package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +15 -7
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +50 -31
- package/esm2020/components/table/table-data.builder.mjs +31 -15
- package/esm2020/components/table/table-data.mjs +1 -1
- package/esm2020/components/table/table.component.mjs +77 -32
- package/esm2020/components/table/table.module.mjs +12 -4
- package/esm2020/decorators/array/array-decorator-internal.data.mjs +111 -12
- package/esm2020/decorators/array/array-decorator.data.mjs +2 -2
- package/esm2020/decorators/array/array.decorator.mjs +9 -3
- package/esm2020/decorators/base/base-property.decorator.mjs +4 -3
- package/esm2020/decorators/base/decorator-types.enum.mjs +9 -1
- package/esm2020/decorators/base/dropdown-value.interface.mjs +2 -0
- package/esm2020/decorators/base/property-decorator-internal.data.mjs +33 -10
- package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
- package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +12 -1
- package/esm2020/decorators/boolean/boolean-decorator.data.mjs +1 -1
- package/esm2020/decorators/boolean/boolean.decorator.mjs +2 -2
- package/esm2020/decorators/date/date-decorator-internal.data.mjs +48 -0
- package/esm2020/decorators/date/date-decorator.data.mjs +7 -0
- package/esm2020/decorators/date/date.decorator.mjs +21 -0
- package/esm2020/decorators/file/file-decorator-internal.data.mjs +98 -0
- package/esm2020/decorators/file/file-decorator.data.mjs +7 -0
- package/esm2020/decorators/file/file.decorator.mjs +22 -0
- package/esm2020/decorators/number/number-decorator-internal.data.mjs +7 -1
- package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
- package/esm2020/decorators/number/number.decorator.mjs +3 -3
- package/esm2020/decorators/object/object-decorator-internal.data.mjs +5 -2
- package/esm2020/decorators/object/object-decorator.data.mjs +1 -1
- package/esm2020/decorators/object/object.decorator.mjs +2 -2
- package/esm2020/decorators/string/string-decorator-internal.data.mjs +13 -1
- package/esm2020/decorators/string/string-decorator.data.mjs +1 -1
- package/esm2020/decorators/string/string.decorator.mjs +2 -2
- package/esm2020/mocks/placeholder-data.png.mjs +3 -0
- package/esm2020/public-api.mjs +12 -5
- package/fesm2015/ngx-material-entity.mjs +3271 -894
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +3140 -829
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/mocks/placeholder-data.png.d.ts +1 -0
- package/package.json +7 -1
- package/public-api.d.ts +12 -5
- package/classes/entity-model.class.d.ts +0 -9
- package/classes/entity-service.class.d.ts +0 -66
- package/classes/entity-utilities.class.d.ts +0 -112
- package/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.builder.d.ts +0 -17
- package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts +0 -22
- package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.d.ts +0 -12
- package/components/input/array-table/array-table.component.d.ts +0 -34
- package/components/input/array-table/array-table.module.d.ts +0 -19
- package/components/input/internal-input/internal-input.component.d.ts +0 -54
- package/components/input/internal-input/internal-input.module.d.ts +0 -16
- package/esm2020/classes/entity-model.class.mjs +0 -19
- package/esm2020/classes/entity-service.class.mjs +0 -76
- package/esm2020/classes/entity-utilities.class.mjs +0 -329
- package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.builder.mjs +0 -33
- package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog-data.mjs +0 -2
- package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.mjs +0 -45
- package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.mjs +0 -22
- package/esm2020/components/input/array-table/array-table.component.mjs +0 -119
- package/esm2020/components/input/array-table/array-table.module.mjs +0 -66
- package/esm2020/components/input/internal-input/internal-input.component.mjs +0 -70
- package/esm2020/components/input/internal-input/internal-input.module.mjs +0 -54
|
@@ -1,31 +1,44 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
2
2
|
import { NgModel } from '@angular/forms';
|
|
3
|
-
import { EntityUtilities } from '../../classes/entity
|
|
4
|
-
import { Entity } from '../../classes/entity-model.class';
|
|
3
|
+
import { EntityRow, EntityUtilities } from '../../classes/entity.utilities';
|
|
5
4
|
import { DecoratorTypes } from '../../decorators/base/decorator-types.enum';
|
|
6
|
-
import {
|
|
7
|
-
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
|
8
|
-
import { AutocompleteStringChipsArrayDecoratorConfigInternal, EntityArrayDecoratorConfigInternal, StringChipsArrayDecoratorConfigInternal } from '../../decorators/array/array-decorator-internal.data';
|
|
9
|
-
import { DropdownBooleanDecoratorConfigInternal } from '../../decorators/boolean/boolean-decorator-internal.data';
|
|
10
|
-
import { DefaultNumberDecoratorConfigInternal, DropdownNumberDecoratorConfigInternal } from '../../decorators/number/number-decorator-internal.data';
|
|
5
|
+
import { EntityArrayDecoratorConfigInternal } from '../../decorators/array/array-decorator-internal.data';
|
|
11
6
|
import { DefaultObjectDecoratorConfigInternal } from '../../decorators/object/object-decorator-internal.data';
|
|
12
|
-
import { AutocompleteStringDecoratorConfigInternal, DefaultStringDecoratorConfigInternal, DropdownStringDecoratorConfigInternal, TextboxStringDecoratorConfigInternal } from '../../decorators/string/string-decorator-internal.data';
|
|
13
7
|
import { PropertyDecoratorConfigInternal } from '../../decorators/base/property-decorator-internal.data';
|
|
8
|
+
import { MatTableDataSource } from '@angular/material/table';
|
|
9
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
10
|
+
import { AddArrayItemDialogDataInternal } from './add-array-item-dialog-data.builder';
|
|
11
|
+
import { AddArrayItemDialogData } from './add-array-item-dialog-data';
|
|
12
|
+
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
13
|
+
import { DateUtilities } from '../../classes/date.utilities';
|
|
14
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
14
15
|
import * as i0 from "@angular/core";
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The default input component. It gets the metadata of the property from the given @Input "entity" and @Input "propertyKey"
|
|
18
|
+
* and displays the input field accordingly.
|
|
19
|
+
*
|
|
20
|
+
* You can also define a method that generates error-messages and if the input should be hidden when its metadata says
|
|
21
|
+
* that it should be omitted for creating or updating.
|
|
22
|
+
* The last part being mostly relevant if you want to use this component inside an ngFor.
|
|
23
|
+
*/
|
|
24
|
+
export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
25
|
+
private readonly dialog;
|
|
16
26
|
/**
|
|
17
|
-
* The entity on which the property exists. Used in
|
|
27
|
+
* The entity on which the property exists. Used in conjunction with the "propertyKey"
|
|
18
28
|
* to determine the property for which the input should be generated.
|
|
19
29
|
*/
|
|
20
|
-
entity
|
|
30
|
+
entity?: EntityType;
|
|
31
|
+
internalEntity: EntityType;
|
|
21
32
|
/**
|
|
22
|
-
* The name of the property to generate the input for. Used in
|
|
33
|
+
* The name of the property to generate the input for. Used in conjunction with the "entity".
|
|
23
34
|
*/
|
|
24
|
-
propertyKey
|
|
35
|
+
propertyKey?: keyof EntityType;
|
|
36
|
+
internalPropertyKey: keyof EntityType;
|
|
25
37
|
/**
|
|
26
38
|
* (optional) A custom function to generate the error-message for invalid inputs.
|
|
27
39
|
*/
|
|
28
|
-
getValidationErrorMessage
|
|
40
|
+
getValidationErrorMessage?: (model: NgModel) => string;
|
|
41
|
+
internalGetValidationErrorMessage: (model: NgModel) => string;
|
|
29
42
|
/**
|
|
30
43
|
* Whether to hide a value if it is omitted for creation.
|
|
31
44
|
* Is used internally for the object property.
|
|
@@ -36,35 +49,91 @@ export declare class NgxMatEntityInputComponent<EntityType extends Entity> imple
|
|
|
36
49
|
* Is used internally for the object property.
|
|
37
50
|
*/
|
|
38
51
|
hideOmitForEdit?: boolean;
|
|
52
|
+
inputChangeEvent: EventEmitter<void>;
|
|
53
|
+
addArrayItemDialog: TemplateRef<unknown>;
|
|
54
|
+
addArrayItemDialogRef: MatDialogRef<unknown>;
|
|
39
55
|
type: DecoratorTypes;
|
|
40
56
|
metadata: PropertyDecoratorConfigInternal;
|
|
41
|
-
metadataDefaultString: DefaultStringDecoratorConfigInternal;
|
|
42
|
-
metadataTextboxString: TextboxStringDecoratorConfigInternal;
|
|
43
|
-
metadataAutocompleteString: AutocompleteStringDecoratorConfigInternal;
|
|
44
|
-
autocompleteStrings: string[];
|
|
45
|
-
filteredAutocompleteStrings: string[];
|
|
46
|
-
metadataDropdownString: DropdownStringDecoratorConfigInternal;
|
|
47
|
-
metadataDropdownBoolean: DropdownBooleanDecoratorConfigInternal;
|
|
48
|
-
metadataDefaultNumber: DefaultNumberDecoratorConfigInternal;
|
|
49
|
-
metadataDropdownNumber: DropdownNumberDecoratorConfigInternal;
|
|
50
57
|
metadataDefaultObject: DefaultObjectDecoratorConfigInternal<EntityType>;
|
|
51
|
-
objectProperty:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
objectProperty: EntityType;
|
|
59
|
+
objectPropertyRows: EntityRow<EntityType>[];
|
|
60
|
+
metadataEntityArray: EntityArrayDecoratorConfigInternal<EntityType>;
|
|
61
|
+
entityArrayValues: EntityType[];
|
|
62
|
+
arrayItem: EntityType;
|
|
63
|
+
private arrayItemPriorChanges;
|
|
64
|
+
arrayItemInlineRows: EntityRow<EntityType>[];
|
|
65
|
+
dataSource: MatTableDataSource<EntityType>;
|
|
66
|
+
selection: SelectionModel<EntityType>;
|
|
67
|
+
displayedColumns: string[];
|
|
68
|
+
isArrayItemValid: boolean;
|
|
69
|
+
dialogInputData: AddArrayItemDialogData<EntityType>;
|
|
70
|
+
dialogData: AddArrayItemDialogDataInternal<EntityType>;
|
|
71
|
+
arrayItemDialogRows: EntityRow<EntityType>[];
|
|
72
|
+
isDialogArrayItemValid: boolean;
|
|
58
73
|
readonly DecoratorTypes: typeof DecoratorTypes;
|
|
59
|
-
|
|
60
|
-
|
|
74
|
+
EntityUtilities: typeof EntityUtilities;
|
|
75
|
+
DateUtilities: typeof DateUtilities;
|
|
76
|
+
constructor(dialog: MatDialog);
|
|
77
|
+
/**
|
|
78
|
+
* This is needed for the inputs to work inside an ngFor.
|
|
79
|
+
*
|
|
80
|
+
* @param index - The index of the element in the ngFor.
|
|
81
|
+
* @returns The index.
|
|
82
|
+
*/
|
|
61
83
|
trackByFn(index: unknown): unknown;
|
|
62
84
|
ngOnInit(): void;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
85
|
+
private initEntityArray;
|
|
86
|
+
private initObjectInput;
|
|
87
|
+
/**
|
|
88
|
+
* Checks if the arrayItem is valid.
|
|
89
|
+
*/
|
|
90
|
+
checkIsArrayItemValid(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Checks if the arrayItem inside the dialog is valid.
|
|
93
|
+
*/
|
|
94
|
+
checkIsDialogArrayItemValid(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Emits that a the value has been changed.
|
|
97
|
+
*/
|
|
98
|
+
emitChange(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Tries to add an item to the entity array.
|
|
101
|
+
* Does this either inline if the "createInline"-metadata is set to true
|
|
102
|
+
* or in a separate dialog if it is set to false.
|
|
103
|
+
*/
|
|
104
|
+
addEntity(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Adds the array item defined in the dialog.
|
|
107
|
+
*/
|
|
108
|
+
addArrayItem(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Cancels adding the array item defined in the dialog.
|
|
111
|
+
*/
|
|
112
|
+
cancelAddArrayItem(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Removes all selected entries from the entity array.
|
|
115
|
+
*
|
|
116
|
+
* @param selection - The selection containing the items to remove.
|
|
117
|
+
* @param values - The values of the dataSource.
|
|
118
|
+
* @param dataSource - The dataSource.
|
|
119
|
+
*/
|
|
120
|
+
remove(selection: SelectionModel<any>, values: any[], dataSource: MatTableDataSource<any>): void;
|
|
121
|
+
/**
|
|
122
|
+
* Toggles all array-items in the table.
|
|
123
|
+
*
|
|
124
|
+
* @param selection - The selection to toggle.
|
|
125
|
+
* @param dataSource - The dataSource of the selection.
|
|
126
|
+
*/
|
|
127
|
+
masterToggle(selection: SelectionModel<any>, dataSource: MatTableDataSource<any>): void;
|
|
128
|
+
/**
|
|
129
|
+
* Checks if all array-items in the table have been selected.
|
|
130
|
+
* This is needed to display the "masterToggle"-checkbox correctly.
|
|
131
|
+
*
|
|
132
|
+
* @param selection - The selection to check.
|
|
133
|
+
* @param dataSource - The dataSource of the selection.
|
|
134
|
+
* @returns Whether or not all array-items in the table have been selected.
|
|
135
|
+
*/
|
|
136
|
+
isAllSelected(selection: SelectionModel<any>, dataSource: MatTableDataSource<any>): boolean;
|
|
68
137
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputComponent<any>, never>;
|
|
69
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInputComponent<any>, "ngx-mat-entity-input", never, { "entity": "entity"; "propertyKey": "propertyKey"; "getValidationErrorMessage": "getValidationErrorMessage"; "hideOmitForCreate": "hideOmitForCreate"; "hideOmitForEdit": "hideOmitForEdit"; }, {}, never, never>;
|
|
138
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInputComponent<any>, "ngx-mat-entity-input", never, { "entity": "entity"; "propertyKey": "propertyKey"; "getValidationErrorMessage": "getValidationErrorMessage"; "hideOmitForCreate": "hideOmitForCreate"; "hideOmitForEdit": "hideOmitForEdit"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never>;
|
|
70
139
|
}
|
|
@@ -1,18 +1,42 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./input.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "
|
|
6
|
-
import * as i5 from "
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "
|
|
9
|
-
import * as i8 from "
|
|
10
|
-
import * as i9 from "
|
|
11
|
-
import * as i10 from "./array-
|
|
12
|
-
import * as i11 from "
|
|
13
|
-
import * as i12 from "
|
|
2
|
+
import * as i1 from "./string/string-input/string-input.component";
|
|
3
|
+
import * as i2 from "./string/string-textbox-input/string-textbox-input.component";
|
|
4
|
+
import * as i3 from "./string/string-autocomplete-input/string-autocomplete-input.component";
|
|
5
|
+
import * as i4 from "./string/string-dropdown-input/string-dropdown-input.component";
|
|
6
|
+
import * as i5 from "./boolean/boolean-checkbox-input/boolean-checkbox-input.component";
|
|
7
|
+
import * as i6 from "./boolean/boolean-toggle-input/boolean-toggle-input.component";
|
|
8
|
+
import * as i7 from "./boolean/boolean-dropdown-input/boolean-dropdown-input.component";
|
|
9
|
+
import * as i8 from "./number/number-input/number-input.component";
|
|
10
|
+
import * as i9 from "./number/number-dropdown-input/number-dropdown-input.component";
|
|
11
|
+
import * as i10 from "./array/array-string-chips-input/array-string-chips-input.component";
|
|
12
|
+
import * as i11 from "./array/array-string-autocomplete-chips/array-string-autocomplete-chips.component";
|
|
13
|
+
import * as i12 from "./date/date-input/date-input.component";
|
|
14
|
+
import * as i13 from "./date/date-range-input/date-range-input.component";
|
|
15
|
+
import * as i14 from "./date/date-time-input/date-time-input.component";
|
|
16
|
+
import * as i15 from "./array/array-date-input/array-date-input.component";
|
|
17
|
+
import * as i16 from "./array/array-date-time-input/array-date-time-input.component";
|
|
18
|
+
import * as i17 from "./array/array-date-range-input/array-date-range-input.component";
|
|
19
|
+
import * as i18 from "./file/file-input/file-input.component";
|
|
20
|
+
import * as i19 from "./file/file-image-input/file-image-input.component";
|
|
21
|
+
import * as i20 from "./file/file-default-input/file-default-input.component";
|
|
22
|
+
import * as i21 from "./file/file-input/dragDrop.directive";
|
|
23
|
+
import * as i22 from "./input.component";
|
|
24
|
+
import * as i23 from "@angular/common";
|
|
25
|
+
import * as i24 from "@angular/material/input";
|
|
26
|
+
import * as i25 from "@angular/forms";
|
|
27
|
+
import * as i26 from "@angular/material/form-field";
|
|
28
|
+
import * as i27 from "@angular/material/select";
|
|
29
|
+
import * as i28 from "@angular/material/autocomplete";
|
|
30
|
+
import * as i29 from "@angular/material/checkbox";
|
|
31
|
+
import * as i30 from "@angular/material/slide-toggle";
|
|
32
|
+
import * as i31 from "@angular/material/chips";
|
|
33
|
+
import * as i32 from "@angular/material/icon";
|
|
34
|
+
import * as i33 from "@angular/material/table";
|
|
35
|
+
import * as i34 from "@angular/material/dialog";
|
|
36
|
+
import * as i35 from "@angular/material/button";
|
|
37
|
+
import * as i36 from "@angular/material/datepicker";
|
|
14
38
|
export declare class NgxMatEntityInputModule {
|
|
15
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputModule, never>;
|
|
16
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.
|
|
40
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.StringInputComponent, typeof i2.StringTextboxInputComponent, typeof i3.StringAutocompleteInputComponent, typeof i4.StringDropdownInputComponent, typeof i5.BooleanCheckboxInputComponent, typeof i6.BooleanToggleInputComponent, typeof i7.BooleanDropdownInputComponent, typeof i8.NumberInputComponent, typeof i9.NumberDropdownInputComponent, typeof i10.ArrayStringChipsInputComponent, typeof i11.ArrayStringAutocompleteChipsComponent, typeof i12.DateInputComponent, typeof i13.DateRangeInputComponent, typeof i14.DateTimeInputComponent, typeof i15.ArrayDateInputComponent, typeof i16.ArrayDateTimeInputComponent, typeof i17.ArrayDateRangeInputComponent, typeof i18.FileInputComponent, typeof i19.FileImageInputComponent, typeof i20.FileDefaultInputComponent, typeof i21.DragDropDirective, typeof i22.NgxMatEntityInputComponent], [typeof i23.CommonModule, typeof i24.MatInputModule, typeof i25.FormsModule, typeof i26.MatFormFieldModule, typeof i27.MatSelectModule, typeof i28.MatAutocompleteModule, typeof i29.MatCheckboxModule, typeof i30.MatSlideToggleModule, typeof i31.MatChipsModule, typeof i32.MatIconModule, typeof i33.MatTableModule, typeof i34.MatDialogModule, typeof i35.MatButtonModule, typeof i36.MatDatepickerModule], [typeof i22.NgxMatEntityInputComponent]>;
|
|
17
41
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityInputModule>;
|
|
18
42
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { DropdownNumberDecoratorConfigInternal } from '../../../../decorators/number/number-decorator-internal.data';
|
|
3
|
+
import { NgModel } from '@angular/forms';
|
|
4
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class NumberDropdownInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
7
|
+
entity: EntityType;
|
|
8
|
+
key: keyof EntityType;
|
|
9
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
10
|
+
inputChangeEvent: EventEmitter<void>;
|
|
11
|
+
metadata: DropdownNumberDecoratorConfigInternal;
|
|
12
|
+
constructor();
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
emitChange(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NumberDropdownInputComponent<any>, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NumberDropdownInputComponent<any>, "number-dropdown-input", never, { "entity": "entity"; "key": "key"; "getValidationErrorMessage": "getValidationErrorMessage"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { DefaultNumberDecoratorConfigInternal } from '../../../../decorators/number/number-decorator-internal.data';
|
|
3
|
+
import { NgModel } from '@angular/forms';
|
|
4
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class NumberInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
7
|
+
entity: EntityType;
|
|
8
|
+
key: keyof EntityType;
|
|
9
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
10
|
+
inputChangeEvent: EventEmitter<void>;
|
|
11
|
+
metadata: DefaultNumberDecoratorConfigInternal;
|
|
12
|
+
constructor();
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
emitChange(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NumberInputComponent<any>, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent<any>, "number-input", never, { "entity": "entity"; "key": "key"; "getValidationErrorMessage": "getValidationErrorMessage"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never>;
|
|
17
|
+
}
|
package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { NgModel } from '@angular/forms';
|
|
3
|
+
import { AutocompleteStringDecoratorConfigInternal } from '../../../../decorators/string/string-decorator-internal.data';
|
|
4
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class StringAutocompleteInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
7
|
+
entity: EntityType;
|
|
8
|
+
key: keyof EntityType;
|
|
9
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
10
|
+
inputChangeEvent: EventEmitter<void>;
|
|
11
|
+
metadata: AutocompleteStringDecoratorConfigInternal;
|
|
12
|
+
autocompleteStrings: string[];
|
|
13
|
+
filteredAutocompleteStrings: string[];
|
|
14
|
+
constructor();
|
|
15
|
+
ngOnInit(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Dynamically filters the Autocomplete options when the user inputs something.
|
|
18
|
+
*
|
|
19
|
+
* @param input - The input of the user.
|
|
20
|
+
*/
|
|
21
|
+
filterAutocompleteStrings(input: unknown): void;
|
|
22
|
+
emitChange(): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StringAutocompleteInputComponent<any>, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StringAutocompleteInputComponent<any>, "string-autocomplete-input", never, { "entity": "entity"; "key": "key"; "getValidationErrorMessage": "getValidationErrorMessage"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { DropdownStringDecoratorConfigInternal } from '../../../../decorators/string/string-decorator-internal.data';
|
|
3
|
+
import { NgModel } from '@angular/forms';
|
|
4
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class StringDropdownInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
7
|
+
entity: EntityType;
|
|
8
|
+
key: keyof EntityType;
|
|
9
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
10
|
+
inputChangeEvent: EventEmitter<void>;
|
|
11
|
+
metadata: DropdownStringDecoratorConfigInternal;
|
|
12
|
+
constructor();
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
emitChange(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StringDropdownInputComponent<any>, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StringDropdownInputComponent<any>, "string-dropdown-input", never, { "entity": "entity"; "key": "key"; "getValidationErrorMessage": "getValidationErrorMessage"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { DefaultStringDecoratorConfigInternal } from '../../../../decorators/string/string-decorator-internal.data';
|
|
3
|
+
import { NgModel } from '@angular/forms';
|
|
4
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class StringInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
7
|
+
entity: EntityType;
|
|
8
|
+
key: keyof EntityType;
|
|
9
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
10
|
+
inputChangeEvent: EventEmitter<void>;
|
|
11
|
+
metadata: DefaultStringDecoratorConfigInternal;
|
|
12
|
+
constructor();
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
emitChange(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StringInputComponent<any>, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StringInputComponent<any>, "string-input", never, { "entity": "entity"; "key": "key"; "getValidationErrorMessage": "getValidationErrorMessage"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { NgModel } from '@angular/forms';
|
|
3
|
+
import { TextboxStringDecoratorConfigInternal } from '../../../../decorators/string/string-decorator-internal.data';
|
|
4
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class StringTextboxInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
7
|
+
entity: EntityType;
|
|
8
|
+
key: keyof EntityType;
|
|
9
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
10
|
+
inputChangeEvent: EventEmitter<void>;
|
|
11
|
+
metadata: TextboxStringDecoratorConfigInternal;
|
|
12
|
+
constructor();
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
emitChange(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StringTextboxInputComponent<any>, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StringTextboxInputComponent<any>, "string-textbox-input", never, { "entity": "entity"; "key": "key"; "getValidationErrorMessage": "getValidationErrorMessage"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never>;
|
|
17
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { BaseBuilder } from '../../../classes/base.builder';
|
|
1
2
|
import { ConfirmDialogDataInternal } from '../../confirm-dialog/confirm-dialog-data.builder';
|
|
2
3
|
import { CreateDialogData } from '../table-data';
|
|
4
|
+
/**
|
|
5
|
+
* The internal CreateDialogData. Requires all default values the user can leave out.
|
|
6
|
+
*/
|
|
3
7
|
export declare class CreateDialogDataInternal implements CreateDialogData {
|
|
4
8
|
title: string;
|
|
5
9
|
createButtonLabel: string;
|
|
@@ -8,13 +12,10 @@ export declare class CreateDialogDataInternal implements CreateDialogData {
|
|
|
8
12
|
confirmCreateDialogData: ConfirmDialogDataInternal;
|
|
9
13
|
constructor(title: string, createButtonLabel: string, cancelButtonLabel: string, createRequiresConfirmDialog: boolean, confirmCreateDialogData: ConfirmDialogDataInternal);
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The Builder for the CreateDialogData. Sets default values.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CreateDialogDataBuilder extends BaseBuilder<CreateDialogDataInternal, CreateDialogData> {
|
|
14
19
|
constructor(data?: CreateDialogData);
|
|
15
|
-
|
|
16
|
-
withDefaultCreateButtonLabel(label: string): CreateDialogDataBuilder;
|
|
17
|
-
withDefaultCancelButtonLabel(label: string): CreateDialogDataBuilder;
|
|
18
|
-
withDefaultCreateRequiresConfirmDialog(createRequiresConfirmDialog: boolean): CreateDialogDataBuilder;
|
|
19
|
-
withDefaultConfirmCreateDialogData(confirmCreateDialogData: ConfirmDialogDataInternal): CreateDialogDataBuilder;
|
|
20
|
+
protected generateBaseData(data?: CreateDialogData): CreateDialogDataInternal;
|
|
20
21
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { EntityService } from '../../../classes/entity
|
|
2
|
-
import { Entity } from '../../../classes/entity-model.class';
|
|
1
|
+
import { EntityService } from '../../../classes/entity.service';
|
|
3
2
|
import { CreateEntityDialogData } from './create-entity-dialog-data';
|
|
4
3
|
import { HttpClient } from '@angular/common/http';
|
|
5
4
|
import { CreateDialogDataInternal } from './create-dialog-data.builder';
|
|
6
|
-
|
|
5
|
+
import { BaseBuilder } from '../../../classes/base.builder';
|
|
6
|
+
import { BaseEntityType } from '../../../classes/entity.model';
|
|
7
|
+
/**
|
|
8
|
+
* The internal CreateEntityDialogData. Requires all default values the user can leave out.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CreateEntityDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements CreateEntityDialogData<EntityType> {
|
|
7
11
|
entity: EntityType;
|
|
8
12
|
EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
|
|
9
13
|
createDialogData: CreateDialogDataInternal;
|
|
10
14
|
constructor(entity: EntityType, EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, createDialogData: CreateDialogDataInternal);
|
|
11
15
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The Builder for the CreateEntityDialogData. Sets default values.
|
|
18
|
+
*/
|
|
19
|
+
export declare class CreateEntityDialogDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<CreateEntityDialogDataInternal<EntityType>, CreateEntityDialogData<EntityType>> {
|
|
15
20
|
constructor(data: CreateEntityDialogData<EntityType>);
|
|
21
|
+
protected generateBaseData(data: CreateEntityDialogData<EntityType>): CreateEntityDialogDataInternal<EntityType>;
|
|
16
22
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BaseEntityType } from '../../../classes/entity.model';
|
|
3
|
+
import { EntityService } from '../../../classes/entity.service';
|
|
4
4
|
import { CreateDialogData } from '../table-data';
|
|
5
5
|
/**
|
|
6
6
|
* The Definition of the Create Entity Dialog Data.
|
|
7
7
|
*/
|
|
8
|
-
export interface CreateEntityDialogData<EntityType extends
|
|
8
|
+
export interface CreateEntityDialogData<EntityType extends BaseEntityType<EntityType>> {
|
|
9
9
|
/**
|
|
10
10
|
* An empty entity that is used as the data model.
|
|
11
11
|
*/
|
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
import { Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
-
import { EntityService } from '../../../classes/entity
|
|
4
|
-
import {
|
|
5
|
-
import { EntityUtilities } from '../../../classes/entity-utilities.class';
|
|
3
|
+
import { EntityService } from '../../../classes/entity.service';
|
|
4
|
+
import { EntityRow, EntityUtilities } from '../../../classes/entity.utilities';
|
|
6
5
|
import { CreateEntityDialogDataInternal } from './create-entity-dialog-data.builder';
|
|
7
6
|
import { CreateEntityDialogData } from './create-entity-dialog-data';
|
|
7
|
+
import { BaseEntityType } from '../../../classes/entity.model';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The default dialog used to create new entities based on the configuration passed in the MAT_DIALOG_DATA "inputData".
|
|
11
|
+
* Used by the ngx-mat-entity-table.
|
|
12
|
+
*
|
|
13
|
+
* It offers a lot of customization options which can be found in "CreateEntityDialogData".
|
|
14
|
+
*/
|
|
15
|
+
export declare class NgxMatEntityCreateDialogComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
10
16
|
private readonly inputData;
|
|
11
17
|
dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>;
|
|
12
18
|
private readonly injector;
|
|
13
19
|
private readonly dialog;
|
|
14
20
|
EntityUtilities: typeof EntityUtilities;
|
|
15
|
-
|
|
21
|
+
entityRows: EntityRow<EntityType>[];
|
|
16
22
|
entityService: EntityService<EntityType>;
|
|
17
23
|
data: CreateEntityDialogDataInternal<EntityType>;
|
|
18
|
-
|
|
24
|
+
isEntityValid: boolean;
|
|
19
25
|
constructor(inputData: CreateEntityDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>, injector: Injector, dialog: MatDialog);
|
|
20
26
|
ngOnInit(): void;
|
|
21
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the entity is valid.
|
|
29
|
+
*/
|
|
30
|
+
checkIsEntityValid(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Tries add the new entity and close the dialog afterwards.
|
|
33
|
+
* Also handles the confirmation if required.
|
|
34
|
+
*/
|
|
22
35
|
create(): void;
|
|
23
36
|
private confirmCreate;
|
|
37
|
+
/**
|
|
38
|
+
* Closes the dialog.
|
|
39
|
+
*/
|
|
24
40
|
cancel(): void;
|
|
25
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityCreateDialogComponent<any>, never>;
|
|
26
42
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityCreateDialogComponent<any>, "ngx-mat-entity-create-dialog", never, {}, {}, never, never>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseEntityType } from '../../../classes/entity.model';
|
|
2
|
+
import { BaseBuilder } from '../../../classes/base.builder';
|
|
2
3
|
import { ConfirmDialogData } from '../../confirm-dialog/confirm-dialog-data';
|
|
3
4
|
import { EditDialogData } from '../table-data';
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The internal EditDialogData. Requires all default values the user can leave out.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EditDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements EditDialogData<EntityType> {
|
|
5
9
|
title: (entity: EntityType) => string;
|
|
6
10
|
confirmButtonLabel: string;
|
|
7
11
|
deleteButtonLabel: string;
|
|
@@ -12,16 +16,10 @@ export declare class EditDialogDataInternal<EntityType extends Entity> implement
|
|
|
12
16
|
confirmEditDialogData: ConfirmDialogData;
|
|
13
17
|
constructor(title: (entity: EntityType) => string, confirmButtonLabel: string, deleteButtonLabel: string, cancelButtonLabel: string, deleteRequiresConfirmDialog: boolean, editRequiresConfirmDialog: boolean, confirmDeleteDialogData: ConfirmDialogData, confirmEditDialogData: ConfirmDialogData);
|
|
14
18
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The Builder for the EditDialogData. Sets default values.
|
|
21
|
+
*/
|
|
22
|
+
export declare class EditDialogDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<EditDialogDataInternal<EntityType>, EditDialogData<EntityType>> {
|
|
18
23
|
constructor(data?: EditDialogData<EntityType>);
|
|
19
|
-
|
|
20
|
-
withDefaultConfirmButtonLabel(label: string): EditDialogDataBuilder<EntityType>;
|
|
21
|
-
withDefaultDeleteButtonLabel(label: string): EditDialogDataBuilder<EntityType>;
|
|
22
|
-
withDefaultCancelButtonLabel(label: string): EditDialogDataBuilder<EntityType>;
|
|
23
|
-
withDefaultDeleteRequiresConfirmDialog(deleteRequiresConfirmDialog: boolean): EditDialogDataBuilder<EntityType>;
|
|
24
|
-
withDefaultEditRequiresConfirmDialog(editRequiresConfirmDialog: boolean): EditDialogDataBuilder<EntityType>;
|
|
25
|
-
withDefaultConfirmDeleteDialogData(confirmDeleteDialogData: ConfirmDialogData): EditDialogDataBuilder<EntityType>;
|
|
26
|
-
withDefaultConfirmEditDialogData(confirmEditDialogData: ConfirmDialogData): EditDialogDataBuilder<EntityType>;
|
|
24
|
+
protected generateBaseData(data?: EditDialogData<EntityType>): EditDialogDataInternal<EntityType>;
|
|
27
25
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BaseEntityType } from '../../../classes/entity.model';
|
|
3
|
+
import { EntityService } from '../../../classes/entity.service';
|
|
4
4
|
import { EditDialogData } from '../table-data';
|
|
5
5
|
/**
|
|
6
6
|
* The Definition of the Edit Entity Dialog Data.
|
|
7
7
|
*/
|
|
8
|
-
export interface EditEntityDialogData<EntityType extends
|
|
8
|
+
export interface EditEntityDialogData<EntityType extends BaseEntityType<EntityType>> {
|
|
9
9
|
/**
|
|
10
10
|
* The entity to edit.
|
|
11
11
|
*/
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { EntityService } from '../../../classes/entity
|
|
2
|
-
import { Entity } from '../../../classes/entity-model.class';
|
|
1
|
+
import { EntityService } from '../../../classes/entity.service';
|
|
3
2
|
import { HttpClient } from '@angular/common/http';
|
|
4
3
|
import { EditEntityDialogData } from './edit-entity-dialog-data';
|
|
5
4
|
import { EditDialogDataInternal } from './edit-dialog-data.builder';
|
|
6
|
-
|
|
5
|
+
import { BaseBuilder } from '../../../classes/base.builder';
|
|
6
|
+
import { BaseEntityType } from '../../../classes/entity.model';
|
|
7
|
+
/**
|
|
8
|
+
* The internal EditEntityDialogData. Requires all default values the user can leave out.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EditEntityDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements EditEntityDialogData<EntityType> {
|
|
7
11
|
entity: EntityType;
|
|
8
12
|
EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
|
|
9
13
|
editDialogData: EditDialogDataInternal<EntityType>;
|
|
10
14
|
allowDelete: (entity: EntityType) => boolean;
|
|
11
15
|
constructor(entity: EntityType, EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>, editDialogData: EditDialogDataInternal<EntityType>, allowDelete: (entity: EntityType) => boolean);
|
|
12
16
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The Builder for the EditEntityDialogData. Sets default values.
|
|
19
|
+
*/
|
|
20
|
+
export declare class EditEntityDialogDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<EditEntityDialogDataInternal<EntityType>, EditEntityDialogData<EntityType>> {
|
|
16
21
|
constructor(data: EditEntityDialogData<EntityType>);
|
|
22
|
+
protected generateBaseData(data: EditEntityDialogData<EntityType>): EditEntityDialogDataInternal<EntityType>;
|
|
17
23
|
}
|
|
@@ -1,29 +1,47 @@
|
|
|
1
1
|
import { Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
-
import { EntityService } from '../../../classes/entity
|
|
4
|
-
import {
|
|
5
|
-
import { EntityUtilities } from '../../../classes/entity-utilities.class';
|
|
3
|
+
import { EntityService } from '../../../classes/entity.service';
|
|
4
|
+
import { EntityRow, EntityUtilities } from '../../../classes/entity.utilities';
|
|
6
5
|
import { EditEntityDialogData } from './edit-entity-dialog-data';
|
|
7
6
|
import { EditEntityDialogDataInternal } from './edit-entity-dialog.builder';
|
|
7
|
+
import { BaseEntityType } from '../../../classes/entity.model';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The default dialog used to edit an existing entity based on the configuration passed in the MAT_DIALOG_DATA "inputData".
|
|
11
|
+
* Used by the ngx-mat-entity-table.
|
|
12
|
+
*
|
|
13
|
+
* It offers a lot of customization options which can be found in "EditEntityDialogData".
|
|
14
|
+
*/
|
|
15
|
+
export declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
10
16
|
private readonly inputData;
|
|
11
17
|
dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>;
|
|
12
18
|
private readonly injector;
|
|
13
19
|
private readonly dialog;
|
|
14
20
|
EntityUtilities: typeof EntityUtilities;
|
|
15
|
-
|
|
21
|
+
entityRows: EntityRow<EntityType>[];
|
|
16
22
|
entityService: EntityService<EntityType>;
|
|
17
23
|
entityPriorChanges: EntityType;
|
|
18
24
|
data: EditEntityDialogDataInternal<EntityType>;
|
|
19
|
-
|
|
25
|
+
isEntityValid: boolean;
|
|
26
|
+
isEntityDirty: Promise<boolean>;
|
|
20
27
|
constructor(inputData: EditEntityDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>, injector: Injector, dialog: MatDialog);
|
|
21
28
|
ngOnInit(): void;
|
|
22
|
-
|
|
29
|
+
checkEntity(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Tries to save the changes and close the dialog afterwards.
|
|
32
|
+
* Also handles the confirmation if required.
|
|
33
|
+
*/
|
|
23
34
|
edit(): void;
|
|
24
35
|
private confirmEdit;
|
|
36
|
+
/**
|
|
37
|
+
* Tries to delete the entity and close the dialog afterwards.
|
|
38
|
+
* Also handles the confirmation if required.
|
|
39
|
+
*/
|
|
25
40
|
delete(): void;
|
|
26
41
|
private confirmDelete;
|
|
42
|
+
/**
|
|
43
|
+
* Reverts all changes made and closes the dialog.
|
|
44
|
+
*/
|
|
27
45
|
cancel(): void;
|
|
28
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityEditDialogComponent<any>, never>;
|
|
29
47
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityEditDialogComponent<any>, "ngx-mat-entity-edit-dialog", never, {}, {}, never, never>;
|