ngx-material-entity 0.1.0
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/CONTRIBUTING.md +93 -0
- package/LICENSE.md +21 -0
- package/README.md +691 -0
- package/classes/entity-model.class.d.ts +9 -0
- package/classes/entity-service.class.d.ts +56 -0
- package/classes/entity-utilities.class.d.ts +95 -0
- package/components/confirm-dialog/confirm-dialog-data.d.ts +41 -0
- package/components/confirm-dialog/confirm-dialog.component.d.ts +18 -0
- package/components/confirm-dialog/confirm-dialog.module.d.ts +12 -0
- package/components/get-validation-error-message.function.d.ts +7 -0
- package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts +35 -0
- package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.d.ts +12 -0
- package/components/input/array-table/array-table.component.d.ts +34 -0
- package/components/input/array-table/array-table.module.d.ts +19 -0
- package/components/input/input.component.d.ts +73 -0
- package/components/input/input.module.d.ts +18 -0
- package/components/input/internal-input/internal-input.component.d.ts +57 -0
- package/components/input/internal-input/internal-input.module.d.ts +16 -0
- package/components/table/create-dialog/create-entity-dialog-data.d.ts +21 -0
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +25 -0
- package/components/table/create-dialog/create-entity-dialog.module.d.ts +12 -0
- package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +25 -0
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +28 -0
- package/components/table/edit-dialog/edit-entity-dialog.module.d.ts +13 -0
- package/components/table/table-data.d.ts +184 -0
- package/components/table/table.component.d.ts +41 -0
- package/components/table/table.module.d.ts +17 -0
- package/decorators/array.decorator.d.ts +125 -0
- package/decorators/base/base-property.decorator.d.ts +9 -0
- package/decorators/base/decorator-types.enum.d.ts +28 -0
- package/decorators/base/property-decorator-config.interface.d.ts +50 -0
- package/decorators/boolean.decorator.d.ts +42 -0
- package/decorators/number.decorator.d.ts +40 -0
- package/decorators/object.decorator.d.ts +27 -0
- package/decorators/string.decorator.d.ts +76 -0
- package/esm2020/classes/entity-model.class.mjs +19 -0
- package/esm2020/classes/entity-service.class.mjs +70 -0
- package/esm2020/classes/entity-utilities.class.mjs +296 -0
- package/esm2020/components/confirm-dialog/confirm-dialog-data.mjs +2 -0
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +51 -0
- package/esm2020/components/confirm-dialog/confirm-dialog.module.mjs +22 -0
- package/esm2020/components/get-validation-error-message.function.mjs +32 -0
- package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.mjs +43 -0
- package/esm2020/components/input/array-table/add-array-item-dialog/add-array-item-dialog.module.mjs +22 -0
- package/esm2020/components/input/array-table/array-table.component.mjs +116 -0
- package/esm2020/components/input/array-table/array-table.module.mjs +66 -0
- package/esm2020/components/input/input.component.mjs +158 -0
- package/esm2020/components/input/input.module.mjs +62 -0
- package/esm2020/components/input/internal-input/internal-input.component.mjs +73 -0
- package/esm2020/components/input/internal-input/internal-input.module.mjs +54 -0
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +2 -0
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +77 -0
- package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +22 -0
- package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +2 -0
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +112 -0
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.module.mjs +42 -0
- package/esm2020/components/table/table-data.mjs +2 -0
- package/esm2020/components/table/table.component.mjs +232 -0
- package/esm2020/components/table/table.module.mjs +58 -0
- package/esm2020/decorators/array.decorator.mjs +70 -0
- package/esm2020/decorators/base/base-property.decorator.mjs +13 -0
- package/esm2020/decorators/base/decorator-types.enum.mjs +20 -0
- package/esm2020/decorators/base/property-decorator-config.interface.mjs +31 -0
- package/esm2020/decorators/boolean.decorator.mjs +44 -0
- package/esm2020/decorators/number.decorator.mjs +36 -0
- package/esm2020/decorators/object.decorator.mjs +23 -0
- package/esm2020/decorators/string.decorator.mjs +61 -0
- package/esm2020/ngx-material-entity.mjs +5 -0
- package/esm2020/public-api.mjs +32 -0
- package/fesm2015/ngx-material-entity.mjs +1786 -0
- package/fesm2015/ngx-material-entity.mjs.map +1 -0
- package/fesm2020/ngx-material-entity.mjs +1760 -0
- package/fesm2020/ngx-material-entity.mjs.map +1 -0
- package/ngx-material-entity.d.ts +5 -0
- package/package.json +40 -0
- package/public-api.d.ts +25 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Entity } from './entity-model.class';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
/**
|
|
5
|
+
* A generic EntityService class.
|
|
6
|
+
* Offers basic CRUD-functionality.
|
|
7
|
+
* You should create a service for every Entity you have.
|
|
8
|
+
* If you extend from this you need to make sure that the extended Service can be injected.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class EntityService<EntityType extends Entity> {
|
|
11
|
+
private readonly http;
|
|
12
|
+
/**
|
|
13
|
+
* The base url used for api requests. If u want to have more control over this,
|
|
14
|
+
* you can override the create, read, update and delete methods.
|
|
15
|
+
* @create Sends a POST-Request to baseUrl
|
|
16
|
+
* @read Sends a GET-Request to baseUrl
|
|
17
|
+
* @update Sends a PATCH-Request to baseUrl/{id}
|
|
18
|
+
* @delete Sends a DEL-Request to baseUrl/{id}
|
|
19
|
+
*/
|
|
20
|
+
abstract readonly baseUrl: string;
|
|
21
|
+
/**
|
|
22
|
+
* a subject of all the entity values.
|
|
23
|
+
* Can be subscribed to when you want to do a specific thing whenever the entities change.
|
|
24
|
+
*/
|
|
25
|
+
readonly entitiesSubject: BehaviorSubject<EntityType[]>;
|
|
26
|
+
/**
|
|
27
|
+
* gets the entities in an array from the internal entitiesSubject
|
|
28
|
+
*/
|
|
29
|
+
get entities(): EntityType[];
|
|
30
|
+
constructor(http: HttpClient);
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new Entity and pushes it to the entities array
|
|
33
|
+
* @param entity The data of the entity to create.
|
|
34
|
+
* All values that should be omitted will be removed from it inside this method.
|
|
35
|
+
* @returns A Promise of the created entity
|
|
36
|
+
*/
|
|
37
|
+
create(entity: EntityType): Promise<EntityType>;
|
|
38
|
+
/**
|
|
39
|
+
* Gets all existing entities and pushes them to the entites array
|
|
40
|
+
* @returns A Promise of all received Entities
|
|
41
|
+
*/
|
|
42
|
+
read(): Promise<EntityType[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Updates a specific Entity
|
|
45
|
+
* @param entity The updated Entity
|
|
46
|
+
* All values that should be omitted will be removed from it inside this method.
|
|
47
|
+
* @param entityPriorChanges The current Entity.
|
|
48
|
+
* It Is used to get changed values and only update them instead of sending the whole entity data
|
|
49
|
+
*/
|
|
50
|
+
update(entity: EntityType, entityPriorChanges: EntityType): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Method to delete a specific Entity
|
|
53
|
+
* @param id The id of the element to delete
|
|
54
|
+
*/
|
|
55
|
+
delete(id: string): Promise<void>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { DecoratorType, DecoratorTypes } from '../decorators/base/decorator-types.enum';
|
|
2
|
+
import { Entity } from './entity-model.class';
|
|
3
|
+
/**
|
|
4
|
+
* Contains HelperMethods around handling Entities and their property-metadata
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class EntityUtilities {
|
|
7
|
+
/**
|
|
8
|
+
* Gets the properties to omit when updating the entity
|
|
9
|
+
* @returns The properties which should be left out for updating a new Entity
|
|
10
|
+
*/
|
|
11
|
+
static getOmitForUpdate<EntityType extends Entity>(entity: EntityType): (keyof EntityType)[];
|
|
12
|
+
/**
|
|
13
|
+
* Gets the properties to omit when creating new entities
|
|
14
|
+
* @returns The properties which should be left out for creating a new Entity
|
|
15
|
+
*/
|
|
16
|
+
static getOmitForCreate<EntityType extends Entity>(entity: EntityType): (keyof EntityType)[];
|
|
17
|
+
/**
|
|
18
|
+
* Gets the metadata included in an property
|
|
19
|
+
* @param entity The entity with the property to get the metadata from
|
|
20
|
+
* @param propertyKey The property on the given Entity to get the metadata from
|
|
21
|
+
* @param type For secure Typing, defines the returned PropertyConfig
|
|
22
|
+
* @returns The metadata of the property
|
|
23
|
+
*/
|
|
24
|
+
static getPropertyMetadata<EntityType extends Entity, T extends DecoratorTypes>(entity: EntityType, propertyKey: keyof EntityType, type: T): DecoratorType<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the type of the property-metadata.
|
|
27
|
+
* @param entity The entity with the property to get the type from
|
|
28
|
+
* @param propertyKey The property on the given Entity to get the type from
|
|
29
|
+
* @returns The type of the metadata
|
|
30
|
+
*/
|
|
31
|
+
static getPropertyType<EntityType extends Entity>(entity: EntityType, propertyKey: keyof EntityType): DecoratorTypes;
|
|
32
|
+
/**
|
|
33
|
+
* Sets all property values based on a given entity data-object.
|
|
34
|
+
* @param entity The data object to get the property values from.
|
|
35
|
+
* @param target
|
|
36
|
+
* the target object that needs to be constructed
|
|
37
|
+
* (if called inside a Entity constructor its usually this)
|
|
38
|
+
* @alias new
|
|
39
|
+
* @alias build
|
|
40
|
+
* @alias construct
|
|
41
|
+
*/
|
|
42
|
+
static new<EntityType extends Entity>(target: EntityType, entity?: EntityType): void;
|
|
43
|
+
static construct: typeof EntityUtilities.new;
|
|
44
|
+
static build: typeof EntityUtilities.new;
|
|
45
|
+
/**
|
|
46
|
+
* Checks if the values on an entity are valid.
|
|
47
|
+
* Also checks all the validators given by the metadata ("required", "maxLength" etc.)
|
|
48
|
+
* @param entity The entity to validate.
|
|
49
|
+
* @param omit Whether to check for creatiung or editing validity
|
|
50
|
+
* @returns Whether or not the entity is valid.
|
|
51
|
+
*/
|
|
52
|
+
static isEntityValid<EntityType extends Entity>(entity: EntityType, omit: 'create' | 'edit'): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if a single property value is valid
|
|
55
|
+
* @param entity The entity where the property is from
|
|
56
|
+
* @param key The name of the property
|
|
57
|
+
* @returns Whether or not the property value is valid
|
|
58
|
+
*/
|
|
59
|
+
private static isPropertyValid;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if an entity is "dirty" (if its values have changed)
|
|
62
|
+
* @param entity The entity after all changes
|
|
63
|
+
* @param entityPriorChanges The entity before the changes
|
|
64
|
+
* @returns Whether or not the entity is dirty
|
|
65
|
+
*/
|
|
66
|
+
static dirty(entity: Entity, entityPriorChanges: Entity): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Compares two Entities and returns their difference in an object
|
|
69
|
+
* @param entity The first entity to compare
|
|
70
|
+
* @param entityPriorChanges The second entity to compare
|
|
71
|
+
* @returns The difference between the two Entities in form of a Partial
|
|
72
|
+
*/
|
|
73
|
+
static difference<EntityType extends Entity>(entity: EntityType, entityPriorChanges: EntityType): Partial<EntityType>;
|
|
74
|
+
/**
|
|
75
|
+
* compare function for sorting entity keys by their order value
|
|
76
|
+
* @param a first key of entity
|
|
77
|
+
* @param b second key of entity
|
|
78
|
+
* @param entity current entity (used to get metadata of entity keys)
|
|
79
|
+
*/
|
|
80
|
+
static compareOrder<EntityType extends Entity>(a: keyof EntityType, b: keyof EntityType, entity: EntityType): number;
|
|
81
|
+
/**
|
|
82
|
+
* gets the bootstrap column values for "lg", "md", "sm"
|
|
83
|
+
* @param entity entity to get the bootstrap column values of the key
|
|
84
|
+
* @param key key of the property to get bootstrap column values from
|
|
85
|
+
* @param type defines for which screensize the column values should be returned
|
|
86
|
+
* @returns bootstrap column value
|
|
87
|
+
*/
|
|
88
|
+
static getWidth<EntityType extends Entity>(entity: EntityType, key: keyof EntityType, type: 'lg' | 'md' | 'sm'): number;
|
|
89
|
+
/**
|
|
90
|
+
* Resets all changes on an entity
|
|
91
|
+
* @param entity The entity to reset
|
|
92
|
+
* @param entityPriorChanges The entity before any changes
|
|
93
|
+
*/
|
|
94
|
+
static resetChangesOnEntity<EntityType extends Entity>(entity: EntityType, entityPriorChanges: EntityType): void;
|
|
95
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare type ConfirmDialogTypes = 'default' | 'delete' | 'info-only';
|
|
2
|
+
/**
|
|
3
|
+
* The Definition of the Confirm Dialog Data
|
|
4
|
+
*/
|
|
5
|
+
export interface ConfirmDialogData {
|
|
6
|
+
/**
|
|
7
|
+
* An array of paragraphs to display inside the dialog body
|
|
8
|
+
*/
|
|
9
|
+
text?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* The type of the Confirm Dialog. Changes the button layout. Can be either:
|
|
12
|
+
* @value 'default': A confirm- and a cancel-button
|
|
13
|
+
* @value 'delete': Like default but the confirm-button is red
|
|
14
|
+
* @value 'info-only': Only a cancel-button
|
|
15
|
+
*/
|
|
16
|
+
type?: ConfirmDialogTypes;
|
|
17
|
+
/**
|
|
18
|
+
* The label of the button that confirms the dialog.
|
|
19
|
+
* In case of the 'delete' Dialog this is the string that is shown on the delete-button.
|
|
20
|
+
* Defaults to "Confirm" or "Delete", depending on the type
|
|
21
|
+
*/
|
|
22
|
+
confirmButtonLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The label of the button that closes the dialog without doing anything.
|
|
25
|
+
* Defaults to "Cancel"
|
|
26
|
+
*/
|
|
27
|
+
cancelButtonLabel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The title of the dialog.
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether or not a checkbox needs to be selected before the user can confirm the dialog.
|
|
34
|
+
* Defaults to false.
|
|
35
|
+
*/
|
|
36
|
+
requireConfirmation?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The text to display on the checkbox if 'requireConfirmation' is set to true.
|
|
39
|
+
*/
|
|
40
|
+
confirmationText?: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { ConfirmDialogData } from './confirm-dialog-data';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class NgxMatEntityConfirmDialogComponent implements OnInit {
|
|
6
|
+
private readonly dialogRef;
|
|
7
|
+
readonly data: ConfirmDialogData;
|
|
8
|
+
/**
|
|
9
|
+
* Used for the checkbox to confirm the action
|
|
10
|
+
*/
|
|
11
|
+
confirm: boolean;
|
|
12
|
+
constructor(dialogRef: MatDialogRef<NgxMatEntityConfirmDialogComponent>, data: ConfirmDialogData);
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
confirmAction(): void;
|
|
15
|
+
cancel(): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityConfirmDialogComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityConfirmDialogComponent, "ngx-mat-entity-confirm-dialog", never, {}, {}, never, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./confirm-dialog.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/dialog";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "@angular/material/checkbox";
|
|
7
|
+
import * as i6 from "@angular/material/button";
|
|
8
|
+
export declare class NgxMatEntityConfirmDialogModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityConfirmDialogModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityConfirmDialogModule, [typeof i1.NgxMatEntityConfirmDialogComponent], [typeof i2.CommonModule, typeof i3.MatDialogModule, typeof i4.FormsModule, typeof i5.MatCheckboxModule, typeof i6.MatButtonModule], [typeof i1.NgxMatEntityConfirmDialogComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityConfirmDialogModule>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NgModel } from '@angular/forms';
|
|
2
|
+
/**
|
|
3
|
+
* Generates a default error message for most validation errors.
|
|
4
|
+
* @param model The ngModel to get the error from
|
|
5
|
+
* @returns The Validation Error Message to display
|
|
6
|
+
*/
|
|
7
|
+
export declare function getValidationErrorMessage(model: NgModel): string;
|
package/components/input/array-table/add-array-item-dialog/add-array-item-dialog.component.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { NgModel } from '@angular/forms';
|
|
3
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
4
|
+
import { Entity } from '../../../../classes/entity-model.class';
|
|
5
|
+
import { EntityUtilities } from '../../../../classes/entity-utilities.class';
|
|
6
|
+
import { CreateDialogData } from '../../../table/table-data';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export interface AddArrayItemDialogData<EntityType extends Entity> {
|
|
9
|
+
/**
|
|
10
|
+
* An empty entity that is used as the data model.
|
|
11
|
+
*/
|
|
12
|
+
entity: EntityType;
|
|
13
|
+
/**
|
|
14
|
+
* The info of the generic create-dialog.
|
|
15
|
+
*/
|
|
16
|
+
createDialogData: CreateDialogData;
|
|
17
|
+
/**
|
|
18
|
+
* (optional) A custom function to generate the error-message for invalid inputs.
|
|
19
|
+
*/
|
|
20
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
21
|
+
}
|
|
22
|
+
export declare class NgxMatEntityAddArrayItemDialogComponent<EntityType extends Entity> implements OnInit {
|
|
23
|
+
data: AddArrayItemDialogData<EntityType>;
|
|
24
|
+
dialogRef: MatDialogRef<NgxMatEntityAddArrayItemDialogComponent<EntityType>>;
|
|
25
|
+
EntityUtilities: typeof EntityUtilities;
|
|
26
|
+
entityKeys: (keyof EntityType)[];
|
|
27
|
+
getWidth: typeof EntityUtilities.getWidth;
|
|
28
|
+
constructor(data: AddArrayItemDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityAddArrayItemDialogComponent<EntityType>>);
|
|
29
|
+
ngOnInit(): void;
|
|
30
|
+
private setEntityKeys;
|
|
31
|
+
create(): void;
|
|
32
|
+
cancel(): void;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityAddArrayItemDialogComponent<any>, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityAddArrayItemDialogComponent<any>, "ngx-mat-entity-add-array-item-dialog", never, {}, {}, never, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./add-array-item-dialog.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "../../internal-input/internal-input.module";
|
|
5
|
+
import * as i4 from "@angular/material/dialog";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "@angular/material/button";
|
|
8
|
+
export declare class NgxMatEntityAddArrayItemDialogModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityAddArrayItemDialogModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityAddArrayItemDialogModule, [typeof i1.NgxMatEntityAddArrayItemDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInternalInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule], [typeof i1.NgxMatEntityAddArrayItemDialogComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityAddArrayItemDialogModule>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
|
+
import { OnInit } from '@angular/core';
|
|
3
|
+
import { EntityArrayDecoratorConfig } from '../../../decorators/array.decorator';
|
|
4
|
+
import { Entity } from '../../../classes/entity-model.class';
|
|
5
|
+
import { EntityUtilities } from '../../../classes/entity-utilities.class';
|
|
6
|
+
import { NgModel } from '@angular/forms';
|
|
7
|
+
import { MatTableDataSource } from '@angular/material/table';
|
|
8
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class NgxMatEntityArrayTableComponent<EntityType extends Entity> implements OnInit {
|
|
11
|
+
private readonly dialog;
|
|
12
|
+
arrayItems: EntityType[];
|
|
13
|
+
metadata: EntityArrayDecoratorConfig<EntityType>;
|
|
14
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
15
|
+
omit: 'create' | 'edit';
|
|
16
|
+
dataSource: MatTableDataSource<EntityType>;
|
|
17
|
+
selection: SelectionModel<EntityType>;
|
|
18
|
+
displayedColumns: string[];
|
|
19
|
+
arrayItem: EntityType;
|
|
20
|
+
private arrayItemPriorChanges;
|
|
21
|
+
getWidth: typeof EntityUtilities.getWidth;
|
|
22
|
+
EntityUtilities: typeof EntityUtilities;
|
|
23
|
+
constructor(dialog: MatDialog);
|
|
24
|
+
trackByFn(index: unknown): unknown;
|
|
25
|
+
ngOnInit(): void;
|
|
26
|
+
private validateInput;
|
|
27
|
+
add(): void;
|
|
28
|
+
remove(): void;
|
|
29
|
+
getObjectProperties(): (keyof EntityType)[];
|
|
30
|
+
masterToggle(): void;
|
|
31
|
+
isAllSelected(): boolean;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityArrayTableComponent<any>, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityArrayTableComponent<any>, "ngx-mat-entity-array-table", never, { "arrayItems": "arrayItems"; "metadata": "metadata"; "getValidationErrorMessage": "getValidationErrorMessage"; "omit": "omit"; }, {}, never, never>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./array-table.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/input";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "@angular/material/form-field";
|
|
7
|
+
import * as i6 from "@angular/material/select";
|
|
8
|
+
import * as i7 from "@angular/material/autocomplete";
|
|
9
|
+
import * as i8 from "@angular/material/checkbox";
|
|
10
|
+
import * as i9 from "@angular/material/slide-toggle";
|
|
11
|
+
import * as i10 from "@angular/material/table";
|
|
12
|
+
import * as i11 from "../internal-input/internal-input.module";
|
|
13
|
+
import * as i12 from "@angular/material/button";
|
|
14
|
+
import * as i13 from "./add-array-item-dialog/add-array-item-dialog.module";
|
|
15
|
+
export declare class NgxMatEntityArrayTableModule {
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityArrayTableModule, never>;
|
|
17
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityArrayTableModule, [typeof i1.NgxMatEntityArrayTableComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.FormsModule, typeof i5.MatFormFieldModule, typeof i6.MatSelectModule, typeof i7.MatAutocompleteModule, typeof i8.MatCheckboxModule, typeof i9.MatSlideToggleModule, typeof i10.MatTableModule, typeof i11.NgxMatEntityInternalInputModule, typeof i12.MatButtonModule, typeof i13.NgxMatEntityAddArrayItemDialogModule], [typeof i1.NgxMatEntityArrayTableComponent]>;
|
|
18
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityArrayTableModule>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { NgModel } from '@angular/forms';
|
|
3
|
+
import { EntityUtilities } from '../../classes/entity-utilities.class';
|
|
4
|
+
import { Entity } from '../../classes/entity-model.class';
|
|
5
|
+
import { DecoratorTypes } from '../../decorators/base/decorator-types.enum';
|
|
6
|
+
import { PropertyDecoratorConfig } from '../../decorators/base/property-decorator-config.interface';
|
|
7
|
+
import { AutocompleteStringDecoratorConfig, DefaultStringDecoratorConfig, DropdownStringDecoratorConfig, TextboxStringDecoratorConfig } from '../../decorators/string.decorator';
|
|
8
|
+
import { DropdownBooleanDecoratorConfig } from '../../decorators/boolean.decorator';
|
|
9
|
+
import { DefaultNumberDecoratorConfig, DropdownNumberDecoratorConfig } from '../../decorators/number.decorator';
|
|
10
|
+
import { DefaultObjectDecoratorConfig } from '../../decorators/object.decorator';
|
|
11
|
+
import { AutocompleteStringChipsArrayDecoratorConfig, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from '../../decorators/array.decorator';
|
|
12
|
+
import { MatChipInputEvent } from '@angular/material/chips';
|
|
13
|
+
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
export declare class NgxMatEntityInputComponent<EntityType extends Entity> implements OnInit {
|
|
16
|
+
/**
|
|
17
|
+
* The entity on which the property exists. Used in conjuction with the "propertyKey"
|
|
18
|
+
* to determine the property for which the input should be generated.
|
|
19
|
+
*/
|
|
20
|
+
entity: EntityType;
|
|
21
|
+
/**
|
|
22
|
+
* The name of the property to generate the input for. Used in conjuction with the "entity".
|
|
23
|
+
*/
|
|
24
|
+
propertyKey: keyof EntityType;
|
|
25
|
+
/**
|
|
26
|
+
* (optional) A custom function to generate the error-message for invalid inputs.
|
|
27
|
+
*/
|
|
28
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to hide a value if it is omitted for creation.
|
|
31
|
+
* Is used internally for the object property.
|
|
32
|
+
*/
|
|
33
|
+
hideOmitForCreate?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to hide a value if it is omitted for editing.
|
|
36
|
+
* Is used internally for the object property.
|
|
37
|
+
*/
|
|
38
|
+
hideOmitForEdit?: boolean;
|
|
39
|
+
type: DecoratorTypes;
|
|
40
|
+
metadata: PropertyDecoratorConfig;
|
|
41
|
+
metadataDefaultString: DefaultStringDecoratorConfig;
|
|
42
|
+
metadataTextboxString: TextboxStringDecoratorConfig;
|
|
43
|
+
metadataAutocompleteString: AutocompleteStringDecoratorConfig;
|
|
44
|
+
autocompleteStrings: string[];
|
|
45
|
+
filteredAutocompleteStrings: string[];
|
|
46
|
+
metadataDropdownString: DropdownStringDecoratorConfig;
|
|
47
|
+
metadataDropdownBoolean: DropdownBooleanDecoratorConfig;
|
|
48
|
+
metadataDefaultNumber: DefaultNumberDecoratorConfig;
|
|
49
|
+
metadataDropdownNumber: DropdownNumberDecoratorConfig;
|
|
50
|
+
metadataDefaultObject: DefaultObjectDecoratorConfig;
|
|
51
|
+
objectProperty: Entity;
|
|
52
|
+
metadataEntityArray: EntityArrayDecoratorConfig<Entity>;
|
|
53
|
+
entityArrayValues: Entity[];
|
|
54
|
+
metadataStringChipsArray: StringChipsArrayDecoratorConfig;
|
|
55
|
+
stringChipsArrayValues: string[];
|
|
56
|
+
chipsInput: string;
|
|
57
|
+
metadataAutocompleteStringChipsArray: AutocompleteStringChipsArrayDecoratorConfig;
|
|
58
|
+
readonly DecoratorTypes: typeof DecoratorTypes;
|
|
59
|
+
getWidth: typeof EntityUtilities.getWidth;
|
|
60
|
+
constructor();
|
|
61
|
+
/**
|
|
62
|
+
* Helper method needed to recursively generate property input components (used eg. with the object)
|
|
63
|
+
*/
|
|
64
|
+
trackByFn(index: unknown): unknown;
|
|
65
|
+
ngOnInit(): void;
|
|
66
|
+
getObjectProperties(): (keyof Entity)[];
|
|
67
|
+
addStringChipArrayValue(event: MatChipInputEvent): void;
|
|
68
|
+
removeStringChipArrayValue(value: string): void;
|
|
69
|
+
selected(event: MatAutocompleteSelectedEvent, chipsInput: HTMLInputElement): void;
|
|
70
|
+
filterAutocompleteStrings(input: unknown): void;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputComponent<any>, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInputComponent<any>, "ngx-mat-entity-input", never, { "entity": "entity"; "propertyKey": "propertyKey"; "getValidationErrorMessage": "getValidationErrorMessage"; "hideOmitForCreate": "hideOmitForCreate"; "hideOmitForEdit": "hideOmitForEdit"; }, {}, never, never>;
|
|
73
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./input.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/input";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "@angular/material/form-field";
|
|
7
|
+
import * as i6 from "@angular/material/select";
|
|
8
|
+
import * as i7 from "@angular/material/autocomplete";
|
|
9
|
+
import * as i8 from "@angular/material/checkbox";
|
|
10
|
+
import * as i9 from "@angular/material/slide-toggle";
|
|
11
|
+
import * as i10 from "./array-table/array-table.module";
|
|
12
|
+
import * as i11 from "@angular/material/chips";
|
|
13
|
+
import * as i12 from "@angular/material/icon";
|
|
14
|
+
export declare class NgxMatEntityInputModule {
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputModule, never>;
|
|
16
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.NgxMatEntityInputComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.FormsModule, typeof i5.MatFormFieldModule, typeof i6.MatSelectModule, typeof i7.MatAutocompleteModule, typeof i8.MatCheckboxModule, typeof i9.MatSlideToggleModule, typeof i10.NgxMatEntityArrayTableModule, typeof i11.MatChipsModule, typeof i12.MatIconModule], [typeof i1.NgxMatEntityInputComponent]>;
|
|
17
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityInputModule>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { DecoratorTypes } from '../../../decorators/base/decorator-types.enum';
|
|
3
|
+
import { PropertyDecoratorConfig } from '../../../decorators/base/property-decorator-config.interface';
|
|
4
|
+
import { DefaultNumberDecoratorConfig, DropdownNumberDecoratorConfig } from '../../../decorators/number.decorator';
|
|
5
|
+
import { AutocompleteStringDecoratorConfig, DefaultStringDecoratorConfig, DropdownStringDecoratorConfig, TextboxStringDecoratorConfig } from '../../../decorators/string.decorator';
|
|
6
|
+
import { DropdownBooleanDecoratorConfig } from '../../../decorators/boolean.decorator';
|
|
7
|
+
import { Entity } from '../../../classes/entity-model.class';
|
|
8
|
+
import { DefaultObjectDecoratorConfig } from '../../../decorators/object.decorator';
|
|
9
|
+
import { EntityUtilities } from '../../../classes/entity-utilities.class';
|
|
10
|
+
import { NgModel } from '@angular/forms';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
export declare class NgxMatEntityInternalInputComponent<EntityType extends Entity> implements OnInit {
|
|
13
|
+
/**
|
|
14
|
+
* The entity on which the property exists. Used in conjuction with the "propertyKey"
|
|
15
|
+
* to determine the property for which the input should be generated.
|
|
16
|
+
*/
|
|
17
|
+
entity: EntityType;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the property to generate the input for. Used in conjuction with the "entity".
|
|
20
|
+
*/
|
|
21
|
+
propertyKey: keyof EntityType;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to hide a value if it is omitted for creation.
|
|
24
|
+
* Is used internally for the object property.
|
|
25
|
+
*/
|
|
26
|
+
hideOmitForCreate?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to hide a value if it is omitted for editing.
|
|
29
|
+
* Is used internally for the object property.
|
|
30
|
+
*/
|
|
31
|
+
hideOmitForEdit?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* (optional) A custom function to generate the error-message for invalid inputs.
|
|
34
|
+
*/
|
|
35
|
+
getValidationErrorMessage: (model: NgModel) => string;
|
|
36
|
+
type: DecoratorTypes;
|
|
37
|
+
metadata: PropertyDecoratorConfig;
|
|
38
|
+
metadataDefaultString: DefaultStringDecoratorConfig;
|
|
39
|
+
metadataTextboxString: TextboxStringDecoratorConfig;
|
|
40
|
+
metadataAutocompleteString: AutocompleteStringDecoratorConfig;
|
|
41
|
+
metadataDropdownString: DropdownStringDecoratorConfig;
|
|
42
|
+
metadataDropdownBoolean: DropdownBooleanDecoratorConfig;
|
|
43
|
+
metadataDefaultNumber: DefaultNumberDecoratorConfig;
|
|
44
|
+
metadataDropdownNumber: DropdownNumberDecoratorConfig;
|
|
45
|
+
metadataDefaultObject: DefaultObjectDecoratorConfig;
|
|
46
|
+
objectProperty: Entity;
|
|
47
|
+
readonly DecoratorTypes: typeof DecoratorTypes;
|
|
48
|
+
getWidth: typeof EntityUtilities.getWidth;
|
|
49
|
+
/**
|
|
50
|
+
* Helper method needed to recursively generate property input components (used eg. with the object)
|
|
51
|
+
*/
|
|
52
|
+
trackByFn(index: unknown): unknown;
|
|
53
|
+
ngOnInit(): void;
|
|
54
|
+
getObjectProperties(): (keyof Entity)[];
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInternalInputComponent<any>, never>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInternalInputComponent<any>, "ngx-mat-entity-internal-input", never, { "entity": "entity"; "propertyKey": "propertyKey"; "hideOmitForCreate": "hideOmitForCreate"; "hideOmitForEdit": "hideOmitForEdit"; "getValidationErrorMessage": "getValidationErrorMessage"; }, {}, never, never>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./internal-input.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/input";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "@angular/material/form-field";
|
|
7
|
+
import * as i6 from "@angular/material/select";
|
|
8
|
+
import * as i7 from "@angular/material/autocomplete";
|
|
9
|
+
import * as i8 from "@angular/material/checkbox";
|
|
10
|
+
import * as i9 from "@angular/material/slide-toggle";
|
|
11
|
+
import * as i10 from "@angular/material/table";
|
|
12
|
+
export declare class NgxMatEntityInternalInputModule {
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInternalInputModule, never>;
|
|
14
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInternalInputModule, [typeof i1.NgxMatEntityInternalInputComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.FormsModule, typeof i5.MatFormFieldModule, typeof i6.MatSelectModule, typeof i7.MatAutocompleteModule, typeof i8.MatCheckboxModule, typeof i9.MatSlideToggleModule, typeof i10.MatTableModule], [typeof i1.NgxMatEntityInternalInputComponent]>;
|
|
15
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityInternalInputModule>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { EntityService } from '../../../classes/entity-service.class';
|
|
3
|
+
import { Entity } from '../../../classes/entity-model.class';
|
|
4
|
+
import { CreateDialogData } from '../table-data';
|
|
5
|
+
/**
|
|
6
|
+
* The Definition of the Create Entity Dialog Data
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateEntityDialogData<EntityType extends Entity> {
|
|
9
|
+
/**
|
|
10
|
+
* An empty entity that is used as the data model.
|
|
11
|
+
*/
|
|
12
|
+
entity: EntityType;
|
|
13
|
+
/**
|
|
14
|
+
* The Entity Service class used for the create request.
|
|
15
|
+
*/
|
|
16
|
+
EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
|
|
17
|
+
/**
|
|
18
|
+
* The info of the generic create-dialog.
|
|
19
|
+
*/
|
|
20
|
+
createDialogData: CreateDialogData;
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Injector, OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { EntityService } from '../../../classes/entity-service.class';
|
|
4
|
+
import { Entity } from '../../../classes/entity-model.class';
|
|
5
|
+
import { EntityUtilities } from '../../../classes/entity-utilities.class';
|
|
6
|
+
import { CreateEntityDialogData } from './create-entity-dialog-data';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class NgxMatEntityCreateDialogComponent<EntityType extends Entity> implements OnInit {
|
|
9
|
+
data: CreateEntityDialogData<EntityType>;
|
|
10
|
+
dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>;
|
|
11
|
+
private readonly injector;
|
|
12
|
+
private readonly dialog;
|
|
13
|
+
EntityUtilities: typeof EntityUtilities;
|
|
14
|
+
entityKeys: (keyof EntityType)[];
|
|
15
|
+
entityService: EntityService<EntityType>;
|
|
16
|
+
getWidth: typeof EntityUtilities.getWidth;
|
|
17
|
+
constructor(data: CreateEntityDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityCreateDialogComponent<EntityType>>, injector: Injector, dialog: MatDialog);
|
|
18
|
+
ngOnInit(): void;
|
|
19
|
+
private setEntityKeys;
|
|
20
|
+
create(): void;
|
|
21
|
+
private confirmCreate;
|
|
22
|
+
cancel(): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityCreateDialogComponent<any>, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityCreateDialogComponent<any>, "ngx-mat-entity-create-dialog", never, {}, {}, never, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./create-entity-dialog.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "../../input/input.module";
|
|
5
|
+
import * as i4 from "@angular/material/dialog";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "@angular/material/button";
|
|
8
|
+
export declare class NgxMatEntityCreateDialogModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityCreateDialogModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityCreateDialogModule, [typeof i1.NgxMatEntityCreateDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule], [typeof i1.NgxMatEntityCreateDialogComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityCreateDialogModule>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { EntityService } from '../../../classes/entity-service.class';
|
|
3
|
+
import { Entity } from '../../../classes/entity-model.class';
|
|
4
|
+
import { EditDialogData } from '../table-data';
|
|
5
|
+
/**
|
|
6
|
+
* The Definition of the Edit Entity Dialog Data
|
|
7
|
+
*/
|
|
8
|
+
export interface EditEntityDialogData<EntityType extends Entity> {
|
|
9
|
+
/**
|
|
10
|
+
* The entity to edit
|
|
11
|
+
*/
|
|
12
|
+
entity: EntityType;
|
|
13
|
+
/**
|
|
14
|
+
* The Entity Service class used for updating/deleting the entity.
|
|
15
|
+
*/
|
|
16
|
+
EntityServiceClass: new (httpClient: HttpClient) => EntityService<EntityType>;
|
|
17
|
+
/**
|
|
18
|
+
* The info of the generic edit-dialog.
|
|
19
|
+
*/
|
|
20
|
+
editDialogData: EditDialogData<EntityType>;
|
|
21
|
+
/**
|
|
22
|
+
* Whether or not the user can delete this specific entity
|
|
23
|
+
*/
|
|
24
|
+
allowDelete: (entity: EntityType) => boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Injector, OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { EntityService } from '../../../classes/entity-service.class';
|
|
4
|
+
import { Entity } from '../../../classes/entity-model.class';
|
|
5
|
+
import { EntityUtilities } from '../../../classes/entity-utilities.class';
|
|
6
|
+
import { EditEntityDialogData } from './edit-entity-dialog-data';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class NgxMatEntityEditDialogComponent<EntityType extends Entity> implements OnInit {
|
|
9
|
+
data: EditEntityDialogData<EntityType>;
|
|
10
|
+
dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>;
|
|
11
|
+
private readonly injector;
|
|
12
|
+
private readonly dialog;
|
|
13
|
+
EntityUtilities: typeof EntityUtilities;
|
|
14
|
+
entityKeys: (keyof EntityType)[];
|
|
15
|
+
entityService: EntityService<EntityType>;
|
|
16
|
+
entityPriorChanges: EntityType;
|
|
17
|
+
getWidth: typeof EntityUtilities.getWidth;
|
|
18
|
+
constructor(data: EditEntityDialogData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>, injector: Injector, dialog: MatDialog);
|
|
19
|
+
ngOnInit(): void;
|
|
20
|
+
private setEntityKeys;
|
|
21
|
+
edit(): void;
|
|
22
|
+
private confirmEdit;
|
|
23
|
+
delete(): void;
|
|
24
|
+
private confirmDelete;
|
|
25
|
+
cancel(): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityEditDialogComponent<any>, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityEditDialogComponent<any>, "ngx-mat-entity-edit-dialog", never, {}, {}, never, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./edit-entity-dialog.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "../../input/input.module";
|
|
5
|
+
import * as i4 from "@angular/material/dialog";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "@angular/material/button";
|
|
8
|
+
import * as i7 from "../../confirm-dialog/confirm-dialog.module";
|
|
9
|
+
export declare class NgxMatEntityEditDialogModule {
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityEditDialogModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityEditDialogModule, [typeof i1.NgxMatEntityEditDialogComponent], [typeof i2.CommonModule, typeof i3.NgxMatEntityInputModule, typeof i4.MatDialogModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.NgxMatEntityConfirmDialogModule], [typeof i1.NgxMatEntityEditDialogComponent]>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityEditDialogModule>;
|
|
13
|
+
}
|