ngx-material-entity 15.3.0 → 16.0.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/classes/entity.model.d.ts +2 -2
- package/components/confirm-dialog/confirm-dialog-data.d.ts +1 -1
- package/components/edit-page/edit-page.component.d.ts +4 -2
- package/components/edit-page/page-edit-data.builder.d.ts +1 -1
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +1 -0
- package/components/input/array/array-table.class.d.ts +4 -2
- package/components/input/base-input.component.d.ts +5 -1
- package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +1 -1
- package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +1 -1
- package/components/input/file/file-default-input/file-default-input.component.d.ts +0 -2
- package/components/input/file/file-image-input/file-image-input.component.d.ts +3 -2
- package/components/input/file/file-input/file-input.component.d.ts +4 -2
- package/components/input/input.component.d.ts +9 -4
- package/components/input/input.module.d.ts +2 -1
- package/components/table/display-column-value/base-display-column-value.component.d.ts +1 -1
- package/components/table/display-column-value/display-column-value.component.d.ts +1 -1
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +3 -1
- package/components/table/table-data.builder.d.ts +1 -1
- package/components/table/table-data.d.ts +1 -1
- package/components/table/table.component.d.ts +1 -1
- package/decorators/base/decorator-types.enum.d.ts +1 -1
- package/decorators/base/property-decorator.data.d.ts +1 -1
- package/decorators/file/file-decorator.data.d.ts +1 -1
- package/decorators/number/number-decorator.data.d.ts +1 -1
- package/decorators/string/string-decorator.data.d.ts +1 -1
- package/encapsulation/jszip.utilities.d.ts +1 -1
- package/encapsulation/uuid.utilities.d.ts +11 -0
- package/esm2022/classes/base.builder.mjs +44 -0
- package/esm2022/classes/entity.model.mjs +26 -0
- package/esm2022/components/confirm-dialog/confirm-dialog-data.builder.mjs +58 -0
- package/esm2022/components/confirm-dialog/confirm-dialog.component.mjs +60 -0
- package/esm2022/components/edit-page/edit-page.component.mjs +291 -0
- package/esm2022/components/input/array/array-date-input/array-date-input.component.mjs +23 -0
- package/esm2022/components/input/array/array-date-range-input/array-date-range-input.component.mjs +49 -0
- package/esm2022/components/input/array/array-date-time-input/array-date-time-input.component.mjs +49 -0
- package/esm2022/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +50 -0
- package/esm2022/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +69 -0
- package/esm2022/components/input/array/array-table.class.mjs +100 -0
- package/esm2022/components/input/base-input.component.mjs +88 -0
- package/esm2022/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +21 -0
- package/esm2022/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +17 -0
- package/esm2022/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +21 -0
- package/esm2022/components/input/custom/custom.component.mjs +28 -0
- package/esm2022/components/input/date/date-input/date-input.component.mjs +19 -0
- package/esm2022/components/input/date/date-range-input/date-range-input.component.mjs +68 -0
- package/esm2022/components/input/date/date-time-input/date-time-input.component.mjs +69 -0
- package/esm2022/components/input/file/file-default-input/file-default-input.component.mjs +18 -0
- package/esm2022/components/input/file/file-image-input/file-image-input.component.mjs +101 -0
- package/esm2022/components/input/file/file-input/dragDrop.directive.mjs +62 -0
- package/esm2022/components/input/file/file-input/file-input.component.mjs +206 -0
- package/esm2022/components/input/input.component.mjs +849 -0
- package/esm2022/components/input/input.module.mjs +172 -0
- package/esm2022/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +23 -0
- package/esm2022/components/input/number/number-input/number-input.component.mjs +16 -0
- package/esm2022/components/input/number/number-slider-input/number-slider-input.component.mjs +17 -0
- package/esm2022/components/input/relations/references-many-input/references-many-input.component.mjs +102 -0
- package/esm2022/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +36 -0
- package/esm2022/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +23 -0
- package/esm2022/components/input/string/string-input/string-input.component.mjs +16 -0
- package/esm2022/components/input/string/string-password-input/string-password-input.component.mjs +39 -0
- package/esm2022/components/input/string/string-textbox-input/string-textbox-input.component.mjs +17 -0
- package/esm2022/components/table/create-dialog/create-dialog-data.builder.mjs +42 -0
- package/esm2022/components/table/create-dialog/create-entity-dialog-data.builder.mjs +32 -0
- package/esm2022/components/table/create-dialog/create-entity-dialog.component.mjs +107 -0
- package/esm2022/components/table/display-column-value/base-display-column-value.component.mjs +28 -0
- package/esm2022/components/table/display-column-value/display-column-value.component.mjs +37 -0
- package/esm2022/components/table/edit-dialog/edit-data.builder.mjs +106 -0
- package/esm2022/components/table/edit-dialog/edit-entity-dialog.component.mjs +209 -0
- package/esm2022/components/table/edit-dialog/edit-entity.builder.mjs +39 -0
- package/esm2022/components/table/table-data.builder.mjs +269 -0
- package/esm2022/components/table/table.component.mjs +348 -0
- package/esm2022/decorators/array/array-decorator-internal.data.mjs +286 -0
- package/esm2022/decorators/array/array-decorator.data.mjs +21 -0
- package/esm2022/decorators/base/property-decorator-internal.data.mjs +82 -0
- package/esm2022/decorators/base/property-decorator.data.mjs +56 -0
- package/esm2022/decorators/boolean/boolean-decorator-internal.data.mjs +43 -0
- package/esm2022/decorators/boolean/boolean-decorator.data.mjs +11 -0
- package/esm2022/decorators/custom/custom-decorator-internal.data.mjs +35 -0
- package/{esm2020 → esm2022}/decorators/date/date-decorator-internal.data.mjs +43 -1
- package/esm2022/decorators/date/date-decorator.data.mjs +11 -0
- package/esm2022/decorators/file/file-decorator-internal.data.mjs +143 -0
- package/esm2022/decorators/file/file-decorator.data.mjs +64 -0
- package/esm2022/decorators/has-many/has-many-decorator-internal.data.mjs +42 -0
- package/esm2022/decorators/number/number-decorator-internal.data.mjs +76 -0
- package/esm2022/decorators/number/number-decorator.data.mjs +11 -0
- package/esm2022/decorators/object/object-decorator-internal.data.mjs +20 -0
- package/esm2022/decorators/object/object-decorator.data.mjs +22 -0
- package/esm2022/decorators/references-many/references-many-decorator-internal.data.mjs +48 -0
- package/esm2022/decorators/references-one/references-one-decorator-internal.data.mjs +24 -0
- package/esm2022/decorators/string/string-decorator-internal.data.mjs +114 -0
- package/esm2022/decorators/string/string-decorator.data.mjs +11 -0
- package/esm2022/encapsulation/uuid.utilities.mjs +15 -0
- package/esm2022/services/entity.service.mjs +276 -0
- package/esm2022/utilities/date.utilities.mjs +159 -0
- package/esm2022/utilities/entity.utilities.mjs +905 -0
- package/esm2022/utilities/file.utilities.mjs +180 -0
- package/{fesm2020 → fesm2022}/ngx-material-entity.mjs +1355 -484
- package/fesm2022/ngx-material-entity.mjs.map +1 -0
- package/package.json +11 -17
- package/utilities/date.utilities.d.ts +1 -1
- package/utilities/entity.utilities.d.ts +7 -3
- package/utilities/file.utilities.d.ts +6 -2
- package/esm2020/classes/base.builder.mjs +0 -42
- package/esm2020/classes/entity.model.mjs +0 -22
- package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +0 -44
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +0 -57
- package/esm2020/components/edit-page/edit-page.component.mjs +0 -274
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +0 -26
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +0 -50
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +0 -49
- package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +0 -49
- package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +0 -70
- package/esm2020/components/input/array/array-table.class.mjs +0 -93
- package/esm2020/components/input/base-input.component.mjs +0 -64
- package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +0 -21
- package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +0 -17
- package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +0 -21
- package/esm2020/components/input/custom/custom.component.mjs +0 -26
- package/esm2020/components/input/date/date-input/date-input.component.mjs +0 -22
- package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +0 -71
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +0 -71
- package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +0 -23
- package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +0 -98
- package/esm2020/components/input/file/file-input/dragDrop.directive.mjs +0 -63
- package/esm2020/components/input/file/file-input/file-input.component.mjs +0 -195
- package/esm2020/components/input/input.component.mjs +0 -746
- package/esm2020/components/input/input.module.mjs +0 -169
- package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +0 -26
- package/esm2020/components/input/number/number-input/number-input.component.mjs +0 -16
- package/esm2020/components/input/number/number-slider-input/number-slider-input.component.mjs +0 -17
- package/esm2020/components/input/relations/references-many-input/references-many-input.component.mjs +0 -100
- package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +0 -34
- package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +0 -26
- package/esm2020/components/input/string/string-input/string-input.component.mjs +0 -16
- package/esm2020/components/input/string/string-password-input/string-password-input.component.mjs +0 -42
- package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +0 -17
- package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +0 -32
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +0 -26
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +0 -100
- package/esm2020/components/table/display-column-value/base-display-column-value.component.mjs +0 -27
- package/esm2020/components/table/display-column-value/display-column-value.component.mjs +0 -33
- package/esm2020/components/table/edit-dialog/edit-data.builder.mjs +0 -76
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +0 -195
- package/esm2020/components/table/edit-dialog/edit-entity.builder.mjs +0 -29
- package/esm2020/components/table/table-data.builder.mjs +0 -205
- package/esm2020/components/table/table.component.mjs +0 -333
- package/esm2020/decorators/array/array-decorator-internal.data.mjs +0 -150
- package/esm2020/decorators/array/array-decorator.data.mjs +0 -7
- package/esm2020/decorators/base/property-decorator-internal.data.mjs +0 -58
- package/esm2020/decorators/base/property-decorator.data.mjs +0 -6
- package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +0 -33
- package/esm2020/decorators/boolean/boolean-decorator.data.mjs +0 -7
- package/esm2020/decorators/custom/custom-decorator-internal.data.mjs +0 -27
- package/esm2020/decorators/date/date-decorator.data.mjs +0 -7
- package/esm2020/decorators/file/file-decorator-internal.data.mjs +0 -97
- package/esm2020/decorators/file/file-decorator.data.mjs +0 -7
- package/esm2020/decorators/has-many/has-many-decorator-internal.data.mjs +0 -32
- package/esm2020/decorators/number/number-decorator-internal.data.mjs +0 -54
- package/esm2020/decorators/number/number-decorator.data.mjs +0 -7
- package/esm2020/decorators/object/object-decorator-internal.data.mjs +0 -14
- package/esm2020/decorators/object/object-decorator.data.mjs +0 -7
- package/esm2020/decorators/references-many/references-many-decorator-internal.data.mjs +0 -30
- package/esm2020/decorators/references-one/references-one-decorator-internal.data.mjs +0 -16
- package/esm2020/decorators/string/string-decorator-internal.data.mjs +0 -72
- package/esm2020/decorators/string/string-decorator.data.mjs +0 -7
- package/esm2020/services/entity.service.mjs +0 -274
- package/esm2020/utilities/date.utilities.mjs +0 -159
- package/esm2020/utilities/entity.utilities.mjs +0 -896
- package/esm2020/utilities/file.utilities.mjs +0 -176
- package/fesm2015/ngx-material-entity.mjs +0 -6300
- package/fesm2015/ngx-material-entity.mjs.map +0 -1
- package/fesm2020/ngx-material-entity.mjs.map +0 -1
- /package/{esm2020 → esm2022}/components/confirm-dialog/confirm-dialog-data.mjs +0 -0
- /package/{esm2020 → esm2022}/components/edit-page/edit-data.route.mjs +0 -0
- /package/{esm2020 → esm2022}/components/edit-page/page-edit-data.builder.mjs +0 -0
- /package/{esm2020 → esm2022}/components/get-validation-error-message.function.mjs +0 -0
- /package/{esm2020 → esm2022}/components/table/create-dialog/create-entity-dialog-data.mjs +0 -0
- /package/{esm2020 → esm2022}/components/table/default.actions.mjs +0 -0
- /package/{esm2020 → esm2022}/components/table/edit-dialog/edit-entity-data.mjs +0 -0
- /package/{esm2020 → esm2022}/components/table/table-data.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/array/array.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/base/base-property.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/base/decorator-types.enum.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/base/dropdown-value.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/boolean/boolean.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/custom/custom-decorator.data.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/custom/custom.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/date/date.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/file/file.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/has-many/has-many-decorator.data.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/has-many/has-many.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/number/number.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/object/object.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/references-many/references-many-decorator.data.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/references-many/references-many.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/references-one/references-one-decorator.data.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/references-one/references-one.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/decorators/string/string.decorator.mjs +0 -0
- /package/{esm2020 → esm2022}/encapsulation/js-2-xml.utilities.mjs +0 -0
- /package/{esm2020 → esm2022}/encapsulation/jszip.utilities.mjs +0 -0
- /package/{esm2020 → esm2022}/encapsulation/lodash.utilities.mjs +0 -0
- /package/{esm2020 → esm2022}/encapsulation/reflect.utilities.mjs +0 -0
- /package/{esm2020 → esm2022}/functions/default-false.function.mjs +0 -0
- /package/{esm2020 → esm2022}/functions/default-true.function.mjs +0 -0
- /package/{esm2020 → esm2022}/functions/is-async-function.function.mjs +0 -0
- /package/{esm2020 → esm2022}/mocks/placeholder-data.png.mjs +0 -0
- /package/{esm2020 → esm2022}/ngx-material-entity.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/services/unsaved-changes.guard.mjs +0 -0
- /package/{esm2020 → esm2022}/utilities/selection.utilities.mjs +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The newable type used whenever an entity class is passed to create an entity and initialize its metadata.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type EntityClassNewable<EntityType extends BaseEntityType<EntityType>> = new (data?: EntityType) => EntityType;
|
|
5
5
|
/**
|
|
6
6
|
* The Generic Base EntityType.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type BaseEntityType<T> = {
|
|
9
9
|
[K in keyof T]: unknown;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The different types of a confirm dialog.
|
|
3
3
|
* Is used for displaying different buttons accordingly.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type ConfirmDialogTypes = 'default' | 'delete' | 'info-only';
|
|
6
6
|
/**
|
|
7
7
|
* The Definition of the Confirm Dialog Data.
|
|
8
8
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Location } from '@angular/common';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
3
|
import { EnvironmentInjector, InjectionToken, OnInit } from '@angular/core';
|
|
3
4
|
import { MatDialog } from '@angular/material/dialog';
|
|
4
5
|
import { ActivatedRoute } from '@angular/router';
|
|
@@ -15,7 +16,7 @@ import * as i0 from "@angular/core";
|
|
|
15
16
|
/**
|
|
16
17
|
* The data that needs to be provided for a route to be able to edit a entity.
|
|
17
18
|
*/
|
|
18
|
-
export
|
|
19
|
+
export type PageEditData<EntityType extends BaseEntityType<EntityType>> = Omit<EditEntityData<EntityType>, 'entity' | 'EntityServiceClass'> & {
|
|
19
20
|
/**
|
|
20
21
|
* Whether or not to display a loading spinner while the entity for the page is loaded.
|
|
21
22
|
*
|
|
@@ -62,6 +63,7 @@ export declare class NgxMatEntityEditPageComponent<EntityType extends BaseEntity
|
|
|
62
63
|
readonly entityService: EntityService<EntityType>;
|
|
63
64
|
private readonly EntityClass;
|
|
64
65
|
private readonly inputData;
|
|
66
|
+
private readonly http;
|
|
65
67
|
EntityUtilities: typeof EntityUtilities;
|
|
66
68
|
entityTabs: EntityTab<EntityType>[];
|
|
67
69
|
entity: EntityType;
|
|
@@ -73,7 +75,7 @@ export declare class NgxMatEntityEditPageComponent<EntityType extends BaseEntity
|
|
|
73
75
|
allowDelete: boolean;
|
|
74
76
|
private inConfirmNavigation;
|
|
75
77
|
get hasUnsavedChanges(): boolean;
|
|
76
|
-
constructor(dialog: MatDialog, location: Location, route: ActivatedRoute, injector: EnvironmentInjector, entityService: EntityService<EntityType>, EntityClass: EntityClassNewable<EntityType>, inputData: PageEditData<EntityType
|
|
78
|
+
constructor(dialog: MatDialog, location: Location, route: ActivatedRoute, injector: EnvironmentInjector, entityService: EntityService<EntityType>, EntityClass: EntityClassNewable<EntityType>, inputData: PageEditData<EntityType>, http: HttpClient);
|
|
77
79
|
/**
|
|
78
80
|
* Checks if the input with the given key is readonly.
|
|
79
81
|
*
|
|
@@ -4,7 +4,7 @@ import { ConfirmDialogDataInternal } from '../confirm-dialog/confirm-dialog-data
|
|
|
4
4
|
import { EditDataInternal } from '../table/edit-dialog/edit-data.builder';
|
|
5
5
|
import { EditEntityDataInternal } from '../table/edit-dialog/edit-entity.builder';
|
|
6
6
|
import { PageEditData } from './edit-page.component';
|
|
7
|
-
export
|
|
7
|
+
export type PageEditDataInternal<EntityType extends BaseEntityType<EntityType>> = Omit<EditEntityDataInternal<EntityType>, 'entity' | 'EntityServiceClass'> & {
|
|
8
8
|
displayLoadingSpinner: boolean;
|
|
9
9
|
editData: EditDataInternal<EntityType> & {
|
|
10
10
|
confirmUnsavedChangesDialogData: ConfirmDialogDataInternal;
|
package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum
|
|
|
5
5
|
import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class ArrayStringChipsInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.ARRAY_STRING_CHIPS, string[]> implements OnInit {
|
|
8
|
+
uuid2: string;
|
|
8
9
|
chipsInput: string;
|
|
9
10
|
/**
|
|
10
11
|
* Handles adding strings to the chipsArray.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
3
|
import { EnvironmentInjector, OnInit } from '@angular/core';
|
|
3
4
|
import { MatDialog } from '@angular/material/dialog';
|
|
4
5
|
import { MatTableDataSource } from '@angular/material/table';
|
|
@@ -8,19 +9,20 @@ import { SelectionUtilities } from '../../../utilities/selection.utilities';
|
|
|
8
9
|
import { DisplayColumn } from '../../table/table-data';
|
|
9
10
|
import { NgxMatEntityBaseInputComponent } from '../base-input.component';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
|
-
|
|
12
|
+
type ArrayTableType = DecoratorTypes.ARRAY | DecoratorTypes.ARRAY_DATE | DecoratorTypes.ARRAY_DATE_RANGE | DecoratorTypes.ARRAY_DATE_TIME;
|
|
12
13
|
/**
|
|
13
14
|
* The base component needed for all arrays that are displayed as a table.
|
|
14
15
|
*/
|
|
15
16
|
export declare abstract class ArrayTableComponent<ValueType, EntityType extends BaseEntityType<EntityType>, ArrayType extends ArrayTableType> extends NgxMatEntityBaseInputComponent<EntityType, ArrayType, ValueType[]> implements OnInit {
|
|
16
17
|
private readonly matDialog;
|
|
17
18
|
private readonly injector;
|
|
19
|
+
private readonly http;
|
|
18
20
|
input?: ValueType;
|
|
19
21
|
dataSource: MatTableDataSource<ValueType>;
|
|
20
22
|
selection: SelectionModel<ValueType>;
|
|
21
23
|
displayedColumns: string[];
|
|
22
24
|
SelectionUtilities: typeof SelectionUtilities;
|
|
23
|
-
constructor(matDialog: MatDialog, injector: EnvironmentInjector);
|
|
25
|
+
constructor(matDialog: MatDialog, injector: EnvironmentInjector, http: HttpClient);
|
|
24
26
|
ngOnInit(): void;
|
|
25
27
|
/**
|
|
26
28
|
* Gets the value to display in the column.
|
|
@@ -47,11 +47,15 @@ export declare abstract class NgxMatEntityBaseInputComponent<EntityType extends
|
|
|
47
47
|
* The metadata of the property.
|
|
48
48
|
*/
|
|
49
49
|
metadata: DecoratorType<Type, CustomMetadataType>;
|
|
50
|
+
/**
|
|
51
|
+
* A uuid that is used to specify unique name values for inputs.
|
|
52
|
+
*/
|
|
53
|
+
uuid: string;
|
|
50
54
|
ngOnInit(): void;
|
|
51
55
|
/**
|
|
52
56
|
* Should emit when the input has changed. This is needed to trigger validation and dirty checks.
|
|
53
57
|
*/
|
|
54
58
|
emitChange(): void;
|
|
55
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityBaseInputComponent<any, any, any, any>, never>;
|
|
56
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityBaseInputComponent<any, any, any, any>, "ngx-mat-entity-base-input", never, { "entity": "entity"; "key": "key"; "getValidationErrorMessage": "getValidationErrorMessage"; "isReadOnly": "isReadOnly"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never, false, never>;
|
|
60
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityBaseInputComponent<any, any, any, any>, "ngx-mat-entity-base-input", never, { "entity": { "alias": "entity"; "required": false; }; "key": { "alias": "key"; "required": false; }; "getValidationErrorMessage": { "alias": "getValidationErrorMessage"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never, false, never>;
|
|
57
61
|
}
|
package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
-
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
3
2
|
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
3
|
+
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
4
4
|
import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class BooleanCheckboxInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.BOOLEAN_CHECKBOX, boolean> implements OnInit {
|
package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
-
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
3
2
|
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
3
|
+
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
4
4
|
import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class BooleanDropdownInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.BOOLEAN_DROPDOWN, boolean> implements OnInit {
|
|
@@ -2,11 +2,9 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
3
3
|
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
4
4
|
import { FileData } from '../../../../decorators/file/file-decorator.data';
|
|
5
|
-
import { FileUtilities } from '../../../../utilities/file.utilities';
|
|
6
5
|
import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
export declare class FileDefaultInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.FILE_DEFAULT, FileData | FileData[]> implements OnInit {
|
|
9
|
-
FileUtilities: typeof FileUtilities;
|
|
10
8
|
refreshFileData(fileData?: FileData | FileData[]): Promise<void>;
|
|
11
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileDefaultInputComponent<any>, never>;
|
|
12
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<FileDefaultInputComponent<any>, "file-default-input", never, {}, {}, never, never, false, never>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
1
2
|
import { OnInit } from '@angular/core';
|
|
2
3
|
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
3
4
|
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
4
5
|
import { FileData } from '../../../../decorators/file/file-decorator.data';
|
|
5
|
-
import { FileUtilities } from '../../../../utilities/file.utilities';
|
|
6
6
|
import { NgxMatEntityBaseInputComponent } from '../../base-input.component';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class FileImageInputComponent<EntityType extends BaseEntityType<EntityType>> extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.FILE_IMAGE, FileData | FileData[]> implements OnInit {
|
|
9
|
-
|
|
9
|
+
private readonly http;
|
|
10
10
|
get multiPreviewImages(): string[] | undefined;
|
|
11
11
|
set multiPreviewImages(value: string[] | undefined);
|
|
12
12
|
get singlePreviewImage(): string | undefined;
|
|
13
13
|
set singlePreviewImage(value: string | undefined);
|
|
14
14
|
imageIndex: number;
|
|
15
15
|
placeHolder: string;
|
|
16
|
+
constructor(http: HttpClient);
|
|
16
17
|
private setSinglePreviewImage;
|
|
17
18
|
private setMultiPreviewImages;
|
|
18
19
|
refreshFileData(fileData?: FileData | FileData[]): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
1
2
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
3
|
import { NgModel } from '@angular/forms';
|
|
3
4
|
import { MatDialog } from '@angular/material/dialog';
|
|
@@ -8,6 +9,7 @@ import { FileUtilities } from '../../../../utilities/file.utilities';
|
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
export declare class FileInputComponent<EntityType extends BaseEntityType<EntityType>> implements OnInit {
|
|
10
11
|
private readonly dialog;
|
|
12
|
+
private readonly http;
|
|
11
13
|
get filenames(): string[] | undefined;
|
|
12
14
|
set filenames(value: string[] | undefined);
|
|
13
15
|
FileUtilities: typeof FileUtilities;
|
|
@@ -18,7 +20,7 @@ export declare class FileInputComponent<EntityType extends BaseEntityType<Entity
|
|
|
18
20
|
getValidationErrorMessage: (model: NgModel) => string;
|
|
19
21
|
isReadOnly: boolean;
|
|
20
22
|
fileDataChangeEvent: EventEmitter<FileData | FileData[]>;
|
|
21
|
-
constructor(dialog: MatDialog);
|
|
23
|
+
constructor(dialog: MatDialog, http: HttpClient);
|
|
22
24
|
ngOnInit(): Promise<void>;
|
|
23
25
|
private initMultiFile;
|
|
24
26
|
private initSingleFile;
|
|
@@ -32,5 +34,5 @@ export declare class FileInputComponent<EntityType extends BaseEntityType<Entity
|
|
|
32
34
|
downloadAllEnabled(): boolean;
|
|
33
35
|
downloadAll(): Promise<void>;
|
|
34
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileInputComponent<any>, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FileInputComponent<any>, "file-input", never, { "propertyValue": "propertyValue"; "entity": "entity"; "key": "key"; "metadata": "metadata"; "getValidationErrorMessage": "getValidationErrorMessage"; "isReadOnly": "isReadOnly"; }, { "fileDataChangeEvent": "fileDataChangeEvent"; }, never, never, false, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FileInputComponent<any>, "file-input", never, { "propertyValue": { "alias": "propertyValue"; "required": false; }; "entity": { "alias": "entity"; "required": false; }; "key": { "alias": "key"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "getValidationErrorMessage": { "alias": "getValidationErrorMessage"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; }, { "fileDataChangeEvent": "fileDataChangeEvent"; }, never, never, false, never>;
|
|
36
38
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
3
|
import { EnvironmentInjector, EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
3
4
|
import { NgModel } from '@angular/forms';
|
|
4
5
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
@@ -34,6 +35,7 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
34
35
|
private readonly injector;
|
|
35
36
|
private readonly router;
|
|
36
37
|
protected readonly defaultGetValidationErrorMessage: (model: NgModel) => string;
|
|
38
|
+
private readonly http;
|
|
37
39
|
/**
|
|
38
40
|
* The entity on which the property exists. Used in conjunction with the "propertyKey"
|
|
39
41
|
* to determine the property for which the input should be generated.
|
|
@@ -134,7 +136,8 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
134
136
|
EntityUtilities: typeof EntityUtilities;
|
|
135
137
|
DateUtilities: typeof DateUtilities;
|
|
136
138
|
SelectionUtilities: typeof SelectionUtilities;
|
|
137
|
-
|
|
139
|
+
referencesOneUUID: string;
|
|
140
|
+
constructor(dialog: MatDialog, injector: EnvironmentInjector, router: Router, defaultGetValidationErrorMessage: (model: NgModel) => string, http: HttpClient);
|
|
138
141
|
/**
|
|
139
142
|
* Checks if the input with the given key on the given property is readonly.
|
|
140
143
|
*
|
|
@@ -174,9 +177,10 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
174
177
|
* Edits an entity. This either calls the edit-Method provided by the user or uses a default edit-dialog.
|
|
175
178
|
*
|
|
176
179
|
* @param entity - The entity that should be updated.
|
|
180
|
+
* @param dCol - The display column that was clicked on.
|
|
177
181
|
* @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
|
|
178
182
|
*/
|
|
179
|
-
editHasManyEntity(entity: EntityType): void;
|
|
183
|
+
editHasManyEntity(entity: EntityType, dCol: DisplayColumn<EntityType>): void;
|
|
180
184
|
/**
|
|
181
185
|
* Whether updating the provided entity from the has many property is allowed.
|
|
182
186
|
*
|
|
@@ -297,8 +301,9 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
297
301
|
* Edits an entity array item.
|
|
298
302
|
*
|
|
299
303
|
* @param entity - The entity that has been clicked.
|
|
304
|
+
* @param dCol - The display column that was clicked on.
|
|
300
305
|
*/
|
|
301
|
-
editArrayItem(entity: EntityType): void;
|
|
306
|
+
editArrayItem(entity: EntityType, dCol: DisplayColumn<EntityType>): void;
|
|
302
307
|
/**
|
|
303
308
|
* Saves changes on the array item in the dialog.
|
|
304
309
|
*/
|
|
@@ -312,5 +317,5 @@ export declare class NgxMatEntityInputComponent<EntityType extends BaseEntityTyp
|
|
|
312
317
|
*/
|
|
313
318
|
removeFromEntityArray(): void;
|
|
314
319
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputComponent<any>, never>;
|
|
315
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInputComponent<any>, "ngx-mat-entity-input", never, { "entity": "entity"; "propertyKey": "propertyKey"; "getValidationErrorMessage": "getValidationErrorMessage"; "hideOmitForCreate": "hideOmitForCreate"; "hideOmitForEdit": "hideOmitForEdit"; "validEmpty": "validEmpty"; "isReadOnly": "isReadOnly"; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never, false, never>;
|
|
320
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityInputComponent<any>, "ngx-mat-entity-input", never, { "entity": { "alias": "entity"; "required": false; }; "propertyKey": { "alias": "propertyKey"; "required": false; }; "getValidationErrorMessage": { "alias": "getValidationErrorMessage"; "required": false; }; "hideOmitForCreate": { "alias": "hideOmitForCreate"; "required": false; }; "hideOmitForEdit": { "alias": "hideOmitForEdit"; "required": false; }; "validEmpty": { "alias": "validEmpty"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; }, { "inputChangeEvent": "inputChangeEvent"; }, never, never, false, never>;
|
|
316
321
|
}
|
|
@@ -44,8 +44,9 @@ import * as i42 from "@angular/material/tabs";
|
|
|
44
44
|
import * as i43 from "@angular/material/menu";
|
|
45
45
|
import * as i44 from "@angular/material/progress-spinner";
|
|
46
46
|
import * as i45 from "@angular/material/paginator";
|
|
47
|
+
import * as i46 from "../table/display-column-value/display-column-value.component";
|
|
47
48
|
export declare class NgxMatEntityInputModule {
|
|
48
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityInputModule, never>;
|
|
49
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.StringInputComponent, typeof i2.StringTextboxInputComponent, typeof i3.StringAutocompleteInputComponent, typeof i4.StringDropdownInputComponent, typeof i5.StringPasswordInputComponent, typeof i6.BooleanCheckboxInputComponent, typeof i7.BooleanToggleInputComponent, typeof i8.BooleanDropdownInputComponent, typeof i9.NumberInputComponent, typeof i10.NumberDropdownInputComponent, typeof i11.NumberSliderInputComponent, typeof i12.ArrayStringChipsInputComponent, typeof i13.ArrayStringAutocompleteChipsComponent, typeof i14.DateInputComponent, typeof i15.DateRangeInputComponent, typeof i16.DateTimeInputComponent, typeof i17.ArrayDateInputComponent, typeof i18.ArrayDateTimeInputComponent, typeof i19.ArrayDateRangeInputComponent, typeof i20.FileInputComponent, typeof i21.FileImageInputComponent, typeof i22.FileDefaultInputComponent, typeof i23.DragDropDirective, typeof i24.ReferencesManyInputComponent, typeof i25.CustomInputComponent, typeof i26.NgxMatEntityInputComponent], [typeof i27.CommonModule, typeof i28.MatInputModule, typeof i29.FormsModule, typeof i30.MatFormFieldModule, typeof i31.MatSelectModule, typeof i32.MatAutocompleteModule, typeof i33.MatCheckboxModule, typeof i34.MatSlideToggleModule, typeof i35.MatChipsModule, typeof i36.MatIconModule, typeof i37.MatTableModule, typeof i38.MatDialogModule, typeof i39.MatButtonModule, typeof i40.MatDatepickerModule, typeof i41.MatSliderModule, typeof i42.MatTabsModule, typeof i43.MatMenuModule, typeof i44.MatProgressSpinnerModule, typeof i45.MatPaginatorModule], [typeof i26.NgxMatEntityInputComponent]>;
|
|
50
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxMatEntityInputModule, [typeof i1.StringInputComponent, typeof i2.StringTextboxInputComponent, typeof i3.StringAutocompleteInputComponent, typeof i4.StringDropdownInputComponent, typeof i5.StringPasswordInputComponent, typeof i6.BooleanCheckboxInputComponent, typeof i7.BooleanToggleInputComponent, typeof i8.BooleanDropdownInputComponent, typeof i9.NumberInputComponent, typeof i10.NumberDropdownInputComponent, typeof i11.NumberSliderInputComponent, typeof i12.ArrayStringChipsInputComponent, typeof i13.ArrayStringAutocompleteChipsComponent, typeof i14.DateInputComponent, typeof i15.DateRangeInputComponent, typeof i16.DateTimeInputComponent, typeof i17.ArrayDateInputComponent, typeof i18.ArrayDateTimeInputComponent, typeof i19.ArrayDateRangeInputComponent, typeof i20.FileInputComponent, typeof i21.FileImageInputComponent, typeof i22.FileDefaultInputComponent, typeof i23.DragDropDirective, typeof i24.ReferencesManyInputComponent, typeof i25.CustomInputComponent, typeof i26.NgxMatEntityInputComponent], [typeof i27.CommonModule, typeof i28.MatInputModule, typeof i29.FormsModule, typeof i30.MatFormFieldModule, typeof i31.MatSelectModule, typeof i32.MatAutocompleteModule, typeof i33.MatCheckboxModule, typeof i34.MatSlideToggleModule, typeof i35.MatChipsModule, typeof i36.MatIconModule, typeof i37.MatTableModule, typeof i38.MatDialogModule, typeof i39.MatButtonModule, typeof i40.MatDatepickerModule, typeof i41.MatSliderModule, typeof i42.MatTabsModule, typeof i43.MatMenuModule, typeof i44.MatProgressSpinnerModule, typeof i45.MatPaginatorModule, typeof i46.DisplayColumnValueComponent], [typeof i26.NgxMatEntityInputComponent]>;
|
|
50
51
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxMatEntityInputModule>;
|
|
51
52
|
}
|
|
@@ -11,5 +11,5 @@ export declare abstract class NgxMatEntityBaseDisplayColumnValueComponent<Entity
|
|
|
11
11
|
constructor();
|
|
12
12
|
ngOnInit(): void;
|
|
13
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityBaseDisplayColumnValueComponent<any>, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityBaseDisplayColumnValueComponent<any>, "ngx-mat-entity-base-display-column-value", never, { "entity": "entity"; }, {}, never, never, false, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityBaseDisplayColumnValueComponent<any>, "ngx-mat-entity-base-display-column-value", never, { "entity": { "alias": "entity"; "required": false; }; }, {}, never, never, false, never>;
|
|
15
15
|
}
|
|
@@ -13,5 +13,5 @@ export declare class DisplayColumnValueComponent<EntityType extends BaseEntityTy
|
|
|
13
13
|
constructor(viewContainerRef: ViewContainerRef);
|
|
14
14
|
ngOnInit(): void;
|
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<DisplayColumnValueComponent<any>, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DisplayColumnValueComponent<any>, "display-column-value", never, { "entity": "entity"; "ComponentClass": "ComponentClass"; }, {}, never, never, true, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DisplayColumnValueComponent<any>, "display-column-value", never, { "entity": { "alias": "entity"; "required": false; }; "ComponentClass": { "alias": "ComponentClass"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
1
2
|
import { EnvironmentInjector, OnInit } from '@angular/core';
|
|
2
3
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
3
4
|
import { BaseEntityType } from '../../../classes/entity.model';
|
|
@@ -18,6 +19,7 @@ export declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEnti
|
|
|
18
19
|
dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>;
|
|
19
20
|
private readonly injector;
|
|
20
21
|
private readonly dialog;
|
|
22
|
+
private readonly http;
|
|
21
23
|
EntityUtilities: typeof EntityUtilities;
|
|
22
24
|
entityTabs: EntityTab<EntityType>[];
|
|
23
25
|
entityService: EntityService<EntityType>;
|
|
@@ -27,7 +29,7 @@ export declare class NgxMatEntityEditDialogComponent<EntityType extends BaseEnti
|
|
|
27
29
|
isEntityDirty: boolean;
|
|
28
30
|
isEntityReadOnly: boolean;
|
|
29
31
|
allowDelete: boolean;
|
|
30
|
-
constructor(inputData: EditEntityData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>, injector: EnvironmentInjector, dialog: MatDialog);
|
|
32
|
+
constructor(inputData: EditEntityData<EntityType>, dialogRef: MatDialogRef<NgxMatEntityEditDialogComponent<EntityType>>, injector: EnvironmentInjector, dialog: MatDialog, http: HttpClient);
|
|
31
33
|
ngOnInit(): void;
|
|
32
34
|
/**
|
|
33
35
|
* Checks if the input with the given key is readonly.
|
|
@@ -35,7 +35,7 @@ export declare class MultiSelectActionInternal<EntityType extends BaseEntityType
|
|
|
35
35
|
/**
|
|
36
36
|
* The Internal Table Action. Sets default values.
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type TableActionInternal<EntityType extends BaseEntityType<EntityType>> = BaseTableActionInternal | MultiSelectActionInternal<EntityType>;
|
|
39
39
|
/**
|
|
40
40
|
* The internal TableData. Requires all default values the user can leave out.
|
|
41
41
|
*/
|
|
@@ -96,7 +96,7 @@ export interface MultiSelectAction<EntityType extends BaseEntityType<EntityType>
|
|
|
96
96
|
/**
|
|
97
97
|
* An action for the table. Can either be independent or run on the selected entities in the table.
|
|
98
98
|
*/
|
|
99
|
-
export
|
|
99
|
+
export type TableAction<EntityType extends BaseEntityType<EntityType>> = BaseTableAction | MultiSelectAction<EntityType>;
|
|
100
100
|
/**
|
|
101
101
|
* The base data of the ngx-mat-entity-table.
|
|
102
102
|
*/
|
|
@@ -107,5 +107,5 @@ export declare class NgxMatEntityTableComponent<EntityType extends BaseEntityTyp
|
|
|
107
107
|
*/
|
|
108
108
|
applyFilter(event: Event): void;
|
|
109
109
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatEntityTableComponent<any>, never>;
|
|
110
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityTableComponent<any>, "ngx-mat-entity-table", never, { "tableData": "tableData"; }, {}, never, never, true, never>;
|
|
110
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatEntityTableComponent<any>, "ngx-mat-entity-table", never, { "tableData": { "alias": "tableData"; "required": false; }; }, {}, never, never, true, never>;
|
|
111
111
|
}
|
|
@@ -44,4 +44,4 @@ export declare enum DecoratorTypes {
|
|
|
44
44
|
/**
|
|
45
45
|
* Gives the metadata-config Type based on the DecoratorTypes enum.
|
|
46
46
|
*/
|
|
47
|
-
export
|
|
47
|
+
export type DecoratorType<T, CustomMetadataType extends Record<string, unknown>> = T extends DecoratorTypes.STRING ? DefaultStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_TEXTBOX ? TextboxStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_DROPDOWN ? DropdownStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_AUTOCOMPLETE ? AutocompleteStringDecoratorConfigInternal : T extends DecoratorTypes.STRING_PASSWORD ? PasswordStringDecoratorConfigInternal : T extends DecoratorTypes.NUMBER ? DefaultNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_DROPDOWN ? DropdownNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_SLIDER ? SliderNumberDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_CHECKBOX ? CheckboxBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_TOGGLE ? ToggleBooleanDecoratorConfigInternal : T extends DecoratorTypes.BOOLEAN_DROPDOWN ? DropdownBooleanDecoratorConfigInternal : T extends DecoratorTypes.OBJECT ? DefaultObjectDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY ? EntityArrayDecoratorConfigInternal<any> : T extends DecoratorTypes.ARRAY_DATE ? DateArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_TIME ? DateTimeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_DATE_RANGE ? DateRangeArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_CHIPS ? StringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS ? AutocompleteStringChipsArrayDecoratorConfigInternal : T extends DecoratorTypes.DATE ? DefaultDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_RANGE ? DateRangeDateDecoratorConfigInternal : T extends DecoratorTypes.DATE_TIME ? DateTimeDateDecoratorConfigInternal : T extends DecoratorTypes.FILE_DEFAULT ? DefaultFileDecoratorConfigInternal : T extends DecoratorTypes.FILE_IMAGE ? ImageFileDecoratorConfigInternal : T extends DecoratorTypes.REFERENCES_MANY ? ReferencesManyDecoratorConfigInternal<any> : T extends DecoratorTypes.REFERENCES_ONE ? ReferencesOneDecoratorConfigInternal<any> : T extends DecoratorTypes.HAS_MANY ? HasManyDecoratorConfigInternal<any, any> : T extends DecoratorTypes.CUSTOM ? CustomDecoratorConfigInternal<any, any, CustomMetadataType, any> : never;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A bootstrap column value (a range from 1 - 12).
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type Col = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
5
|
/**
|
|
6
6
|
* The base options for all propertyDecorators.
|
|
7
7
|
*/
|
|
@@ -4,7 +4,7 @@ import { FileDataWithFile, FileDataWithUrl } from './file-decorator-internal.dat
|
|
|
4
4
|
/**
|
|
5
5
|
* The type of a property annotated with @file.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type FileData = FileDataWithFile | FileDataWithUrl;
|
|
8
8
|
/**
|
|
9
9
|
* Definition for the @file metadata.
|
|
10
10
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownValue } from '../base/dropdown-value.interface';
|
|
2
2
|
import { PropertyDecoratorConfig } from '../base/property-decorator.data';
|
|
3
|
-
export
|
|
3
|
+
export type NumberDropdownValues = DropdownValue<number | undefined>[] | ((entity: any) => DropdownValue<number | undefined>[]) | ((entity: any) => Promise<DropdownValue<number | undefined>[]>);
|
|
4
4
|
/**
|
|
5
5
|
* Definition for the @number metadata.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownValue } from '../base/dropdown-value.interface';
|
|
2
2
|
import { PropertyDecoratorConfig } from '../base/property-decorator.data';
|
|
3
|
-
export
|
|
3
|
+
export type StringDropdownValues = DropdownValue<string | undefined>[] | ((entity: any) => DropdownValue<string | undefined>[]) | ((entity: any) => Promise<DropdownValue<string | undefined>[]>);
|
|
4
4
|
/**
|
|
5
5
|
* Definition for the @string metadata.
|
|
6
6
|
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The abstract BaseBuilder class.
|
|
3
|
+
*/
|
|
4
|
+
export class BaseBuilder {
|
|
5
|
+
data;
|
|
6
|
+
inputData;
|
|
7
|
+
constructor(data) {
|
|
8
|
+
this.validateInput(data);
|
|
9
|
+
this.inputData = data;
|
|
10
|
+
this.data = this.generateBaseData(data);
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Used to validate the user input in the constructor.
|
|
15
|
+
*
|
|
16
|
+
* @param data - The user input.
|
|
17
|
+
*/
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
validateInput(data) {
|
|
20
|
+
// By default, no validation is done
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sets the value for the given key if no user value was provided.
|
|
24
|
+
*
|
|
25
|
+
* @param key - The key to set the default value for.
|
|
26
|
+
* @param value - The value to set when nothing was provided.
|
|
27
|
+
* @returns The Builder.
|
|
28
|
+
*/
|
|
29
|
+
withDefault(key, value) {
|
|
30
|
+
if (this.inputData == null || this.inputData[key] == null) {
|
|
31
|
+
this.data[key] = value;
|
|
32
|
+
}
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Method used to get the final build value after applying all chaining.
|
|
37
|
+
*
|
|
38
|
+
* @returns The build value.
|
|
39
|
+
*/
|
|
40
|
+
getResult() {
|
|
41
|
+
return this.data;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5idWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LW1hdGVyaWFsLWVudGl0eS9zcmMvY2xhc3Nlcy9iYXNlLmJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUE7O0dBRUc7QUFDSCxNQUFNLE9BQWdCLFdBQVc7SUFFWixJQUFJLENBQWU7SUFDbkIsU0FBUyxDQUFhO0lBRXZDLFlBQXNCLElBQWdCO1FBQ2xDLElBQUksQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDL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ZhbHVlIHdhcyBwcm92aWRlZC5cbiAgICAgKlxuICAgICAqIEBwYXJhbSBrZXkgLSBUaGUga2V5IHRvIHNldCB0aGUgZGVmYXVsdCB2YWx1ZSBmb3IuXG4gICAgICogQHBhcmFtIHZhbHVlIC0gVGhlIHZhbHVlIHRvIHNldCB3aGVuIG5vdGhpbmcgd2FzIHByb3ZpZGVkLlxuICAgICAqIEByZXR1cm5zIFRoZSBCdWlsZGVyLlxuICAgICAqL1xuICAgIHdpdGhEZWZhdWx0KGtleToga2V5b2YgSW5wdXRUeXBlLCB2YWx1ZTogT21pdDxJbnRlcm5hbFR5cGVba2V5b2YgSW5wdXRUeXBlXSwgJ3VuZGVmaW5lZCc+KTogQmFzZUJ1aWxkZXI8SW50ZXJuYWxUeXBlLCBJbnB1dFR5cGU+IHtcbiAgICAgICAgaWYgKHRoaXMuaW5wdXREYXRhID09IG51bGwgfHwgdGhpcy5pbnB1dERhdGFba2V5XSA9PSBudWxsKSB7XG4gICAgICAgICAgICB0aGlzLmRhdGFba2V5XSA9IHZhbHVlIGFzIEludGVybmFsVHlwZVtrZXlvZiBJbnB1dFR5cGVdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIE1ldGhvZCB1c2VkIHRvIGdldCB0aGUgZmluYWwgYnVpbGQgdmFsdWUgYWZ0ZXIgYXBwbHlpbmcgYWxsIGNoYWluaW5nLlxuICAgICAqXG4gICAgICogQHJldHVybnMgVGhlIGJ1aWxkIHZhbHVlLlxuICAgICAqL1xuICAgIGdldFJlc3VsdCgpOiBJbnRlcm5hbFR5cGUge1xuICAgICAgICByZXR1cm4gdGhpcy5kYXRhO1xuICAgIH1cbn0iXX0=
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { string } from '../decorators/string/string.decorator';
|
|
3
|
+
/**
|
|
4
|
+
* A base Entity class with a builtin id.
|
|
5
|
+
*/
|
|
6
|
+
export class Entity {
|
|
7
|
+
/**
|
|
8
|
+
* A unique identifier for the Entity.
|
|
9
|
+
*/
|
|
10
|
+
id;
|
|
11
|
+
constructor(entity) {
|
|
12
|
+
this.id = entity?.id;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
__decorate([
|
|
16
|
+
string({
|
|
17
|
+
omitForCreate: true,
|
|
18
|
+
omitForUpdate: true,
|
|
19
|
+
display: false,
|
|
20
|
+
displayStyle: 'line',
|
|
21
|
+
displayName: 'ID',
|
|
22
|
+
required: true
|
|
23
|
+
}),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], Entity.prototype, "id", void 0);
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5Lm1vZGVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LW1hdGVyaWFsLWVudGl0eS9zcmMvY2xhc3Nlcy9lbnRpdHkubW9kZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSx1Q0FBdUMsQ0FBQztBQVkvRDs7R0FFRztBQUNILE1BQU0sT0FBZ0IsTUFBTTtJQUN4Qjs7T0FFRztJQVNNLEVBQUUsQ0FBVTtJQUVyQixZQUFZLE1BQWU7UUFDdkIsSUFBSSxDQUFDLEVBQUUsR0FBRyxNQUFNLEVBQUUsRUFBWSxDQUFDO0lBQ25DLENBQUM7Q0FDSjtBQUxZO0lBUlIsTUFBTSxDQUFDO1FBQ0osYUFBYSxFQUFFLElBQUk7UUFDbkIsYUFBYSxFQUFFLElBQUk7UUFDbkIsT0FBTyxFQUFFLEtBQUs7UUFDZCxZQUFZLEVBQUUsTUFBTTtRQUNwQixXQUFXLEVBQUUsSUFBSTtRQUNqQixRQUFRLEVBQUUsSUFBSTtLQUNqQix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cbiAgICBjb25zdHJ1Y3RvcihlbnRpdHk/OiBFbnRpdHkpIHtcbiAgICAgICAgdGhpcy5pZCA9IGVudGl0eT8uaWQgYXMgc3RyaW5nO1xuICAgIH1cbn0iXX0=
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BaseBuilder } from '../../classes/base.builder';
|
|
2
|
+
/**
|
|
3
|
+
* The internal ConfirmDialogData. Requires all default values the user can leave out.
|
|
4
|
+
*/
|
|
5
|
+
export class ConfirmDialogDataInternal {
|
|
6
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
7
|
+
text;
|
|
8
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
9
|
+
type;
|
|
10
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
11
|
+
confirmButtonLabel;
|
|
12
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
13
|
+
cancelButtonLabel;
|
|
14
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
15
|
+
title;
|
|
16
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
17
|
+
requireConfirmation;
|
|
18
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
19
|
+
confirmationText;
|
|
20
|
+
constructor(text, type, confirmButtonLabel, cancelButtonLabel, title, requireConfirmation, confirmationText) {
|
|
21
|
+
this.text = text;
|
|
22
|
+
this.type = type;
|
|
23
|
+
this.confirmButtonLabel = confirmButtonLabel;
|
|
24
|
+
this.cancelButtonLabel = cancelButtonLabel;
|
|
25
|
+
this.title = title;
|
|
26
|
+
this.requireConfirmation = requireConfirmation;
|
|
27
|
+
this.confirmationText = confirmationText;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The Builder for the ConfirmDialogData. Sets default values.
|
|
32
|
+
*/
|
|
33
|
+
export class ConfirmDialogDataBuilder extends BaseBuilder {
|
|
34
|
+
constructor(data) {
|
|
35
|
+
super(data);
|
|
36
|
+
}
|
|
37
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
38
|
+
generateBaseData(data) {
|
|
39
|
+
return new ConfirmDialogDataInternal(data?.text ?? ['Do you really want to do this?'], data?.type ?? 'default', data?.confirmButtonLabel ?? 'Confirm', data?.cancelButtonLabel ?? 'Cancel', data?.title ?? 'Confirmation', data?.requireConfirmation ?? false, data?.confirmationText);
|
|
40
|
+
}
|
|
41
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
42
|
+
validateInput(data) {
|
|
43
|
+
if (!data) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (data.requireConfirmation === true && !data.confirmationText) {
|
|
47
|
+
// eslint-disable-next-line max-len
|
|
48
|
+
throw new Error('Missing required Input data "confirmationText". You can only omit this value when "requireConfirmation" is false.');
|
|
49
|
+
}
|
|
50
|
+
if (data.requireConfirmation !== true && data.confirmationText) {
|
|
51
|
+
throw new Error('The "confirmationText" will never be shown because "requireConfirmation" is not set to true');
|
|
52
|
+
}
|
|
53
|
+
if (data.type === 'info-only' && data.cancelButtonLabel) {
|
|
54
|
+
throw new Error('The "cancelButtonLabel" will never be shown because "type" is set to "info-only"');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS1kaWFsb2ctZGF0YS5idWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LW1hdGVyaWFsLWVudGl0eS9zcmMvY29tcG9uZW50cy9jb25maXJtLWRpYWxvZy9jb25maXJtLWRpYWxvZy1kYXRhLmJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBR3pEOztHQUVHO0FBQ0gsTUFBTSxPQUFPLHl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