ngx-material-entity 16.0.5 → 16.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/classes/base.builder.d.ts +0 -4
- package/classes/entity.model.d.ts +7 -0
- package/components/confirm-dialog/confirm-dialog-data.d.ts +0 -3
- package/components/confirm-dialog/confirm-dialog.component.d.ts +6 -0
- package/components/create-page/create-data.route.d.ts +16 -0
- package/components/create-page/create-page.component.d.ts +147 -0
- package/components/create-page/page-create-data.builder.d.ts +18 -0
- package/components/edit-page/edit-data.route.d.ts +3 -0
- package/components/edit-page/edit-page.component.d.ts +34 -9
- package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +3 -3
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +0 -2
- package/components/input/array/array-table.class.d.ts +0 -1
- package/components/input/base-input.component.d.ts +5 -2
- package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +0 -1
- package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +0 -1
- package/components/input/date/date-range-input/date-range-input.component.d.ts +2 -6
- package/components/input/date/date-time-input/date-time-input.component.d.ts +0 -1
- package/components/input/file/file-input/file-input.component.d.ts +1 -0
- package/components/input/input.component.d.ts +160 -38
- package/components/input/input.module.d.ts +48 -47
- package/components/input/number/number-input/number-input.component.d.ts +1 -1
- package/components/input/relations/references-many-input/references-many-input.component.d.ts +0 -1
- package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +0 -1
- package/components/input/string/string-input/string-input.component.d.ts +1 -1
- package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +1 -1
- package/components/table/create-dialog/{create-dialog-data.builder.d.ts → create-data.builder.d.ts} +7 -7
- package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +11 -13
- package/components/table/create-dialog/create-entity-dialog-data.d.ts +7 -9
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +26 -5
- package/components/table/default.actions.d.ts +0 -4
- package/components/table/display-column-value/base-display-column-value.component.d.ts +3 -0
- package/components/table/display-column-value/display-column-value.component.d.ts +9 -0
- package/components/table/edit-dialog/edit-data.builder.d.ts +3 -3
- package/components/table/edit-dialog/edit-entity-data.d.ts +2 -4
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +34 -4
- package/components/table/edit-dialog/edit-entity.builder.d.ts +3 -5
- package/components/table/table-data.builder.d.ts +6 -8
- package/components/table/table-data.d.ts +8 -18
- package/components/table/table.component.d.ts +35 -9
- package/components/tooltip/tooltip.component.d.ts +3 -0
- package/decorators/array/array-decorator-internal.data.d.ts +3 -2
- package/decorators/array/array-decorator.data.d.ts +6 -17
- package/decorators/array/array.decorator.d.ts +0 -1
- package/decorators/base/base-property.decorator.d.ts +0 -1
- package/decorators/base/property-decorator-internal.data.d.ts +0 -2
- package/decorators/base/property-decorator.data.d.ts +0 -10
- package/decorators/boolean/boolean-decorator.data.d.ts +0 -2
- package/decorators/boolean/boolean.decorator.d.ts +0 -1
- package/decorators/custom/custom-decorator.data.d.ts +0 -2
- package/decorators/custom/custom.decorator.d.ts +0 -1
- package/decorators/date/date-decorator.data.d.ts +0 -3
- package/decorators/date/date.decorator.d.ts +0 -1
- package/decorators/file/file-decorator.data.d.ts +0 -6
- package/decorators/file/file.decorator.d.ts +0 -1
- package/decorators/has-many/has-many-decorator-internal.data.d.ts +2 -4
- package/decorators/has-many/has-many-decorator.data.d.ts +2 -6
- package/decorators/has-many/has-many.decorator.d.ts +0 -1
- package/decorators/number/number-decorator-internal.data.d.ts +0 -1
- package/decorators/number/number.decorator.d.ts +0 -1
- package/decorators/object/object.decorator.d.ts +0 -1
- package/decorators/references-many/references-many-decorator-internal.data.d.ts +0 -1
- package/decorators/references-many/references-many-decorator.data.d.ts +0 -5
- package/decorators/references-many/references-many.decorator.d.ts +0 -1
- package/decorators/references-one/references-one.decorator.d.ts +0 -1
- package/decorators/string/string-decorator-internal.data.d.ts +1 -0
- package/decorators/string/string-decorator.data.d.ts +4 -2
- package/decorators/string/string.decorator.d.ts +0 -1
- package/default-global-configuration-values.d.ts +12 -0
- package/directives/drag-drop.directive.d.ts +0 -3
- package/directives/included-in.directive.d.ts +14 -0
- package/directives/number.directive.d.ts +0 -1
- package/encapsulation/js-2-xml.utilities.d.ts +0 -1
- package/encapsulation/jszip.utilities.d.ts +0 -1
- package/encapsulation/lodash.utilities.d.ts +2 -11
- package/encapsulation/reflect.utilities.d.ts +0 -7
- package/encapsulation/uuid.utilities.d.ts +0 -1
- package/esm2022/classes/base.builder.mjs +3 -6
- package/esm2022/classes/entity.model.mjs +1 -1
- package/esm2022/components/confirm-dialog/confirm-dialog-data.builder.mjs +1 -3
- package/esm2022/components/confirm-dialog/confirm-dialog-data.mjs +1 -1
- package/esm2022/components/confirm-dialog/confirm-dialog.component.mjs +9 -3
- package/esm2022/components/create-page/create-data.route.mjs +11 -0
- package/esm2022/components/create-page/create-page.component.mjs +275 -0
- package/esm2022/components/create-page/page-create-data.builder.mjs +30 -0
- package/esm2022/components/edit-page/edit-data.route.mjs +4 -1
- package/esm2022/components/edit-page/edit-page.component.mjs +43 -18
- package/esm2022/components/edit-page/page-edit-data.builder.mjs +3 -3
- package/esm2022/components/input/array/array-date-input/array-date-input.component.mjs +11 -10
- package/esm2022/components/input/array/array-date-range-input/array-date-range-input.component.mjs +10 -9
- package/esm2022/components/input/array/array-date-time-input/array-date-time-input.component.mjs +13 -12
- package/esm2022/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +17 -13
- package/esm2022/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +8 -9
- package/esm2022/components/input/array/array-table.class.mjs +4 -6
- package/esm2022/components/input/base-input.component.mjs +8 -4
- package/esm2022/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +8 -11
- package/esm2022/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +8 -7
- package/esm2022/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +6 -9
- package/esm2022/components/input/custom/custom.component.mjs +2 -1
- package/esm2022/components/input/date/date-input/date-input.component.mjs +8 -7
- package/esm2022/components/input/date/date-range-input/date-range-input.component.mjs +38 -43
- package/esm2022/components/input/date/date-time-input/date-time-input.component.mjs +10 -10
- package/esm2022/components/input/file/file-default-input/file-default-input.component.mjs +4 -3
- package/esm2022/components/input/file/file-image-input/file-image-input.component.mjs +6 -5
- package/esm2022/components/input/file/file-input/file-input.component.mjs +9 -6
- package/esm2022/components/input/input.component.mjs +225 -91
- package/esm2022/components/input/input.module.mjs +84 -81
- package/esm2022/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +8 -7
- package/esm2022/components/input/number/number-input/number-input.component.mjs +6 -5
- package/esm2022/components/input/number/number-slider-input/number-slider-input.component.mjs +6 -5
- package/esm2022/components/input/relations/references-many-input/references-many-input.component.mjs +24 -19
- package/esm2022/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +12 -8
- package/esm2022/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +8 -7
- package/esm2022/components/input/string/string-input/string-input.component.mjs +6 -5
- package/esm2022/components/input/string/string-password-input/string-password-input.component.mjs +8 -7
- package/esm2022/components/input/string/string-textbox-input/string-textbox-input.component.mjs +7 -6
- package/esm2022/components/table/create-dialog/create-data.builder.mjs +44 -0
- package/esm2022/components/table/create-dialog/create-entity-dialog-data.builder.mjs +8 -9
- package/esm2022/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
- package/esm2022/components/table/create-dialog/create-entity-dialog.component.mjs +30 -9
- package/esm2022/components/table/default.actions.mjs +1 -5
- package/esm2022/components/table/display-column-value/base-display-column-value.component.mjs +5 -1
- package/esm2022/components/table/display-column-value/display-column-value.component.mjs +10 -2
- package/esm2022/components/table/edit-dialog/edit-data.builder.mjs +3 -3
- package/esm2022/components/table/edit-dialog/edit-entity-data.mjs +1 -1
- package/esm2022/components/table/edit-dialog/edit-entity-dialog.component.mjs +37 -7
- package/esm2022/components/table/edit-dialog/edit-entity.builder.mjs +3 -3
- package/esm2022/components/table/table-data.builder.mjs +12 -12
- package/esm2022/components/table/table-data.mjs +1 -1
- package/esm2022/components/table/table.component.mjs +63 -34
- package/esm2022/components/tooltip/tooltip.component.mjs +6 -3
- package/esm2022/decorators/array/array-decorator-internal.data.mjs +4 -2
- package/esm2022/decorators/array/array-decorator.data.mjs +1 -2
- package/esm2022/decorators/array/array.decorator.mjs +2 -3
- package/esm2022/decorators/base/base-property.decorator.mjs +1 -2
- package/esm2022/decorators/base/decorator-types.enum.mjs +1 -1
- package/esm2022/decorators/base/property-decorator-internal.data.mjs +1 -3
- package/esm2022/decorators/base/property-decorator.data.mjs +5 -11
- package/esm2022/decorators/boolean/boolean-decorator.data.mjs +1 -1
- package/esm2022/decorators/boolean/boolean.decorator.mjs +1 -2
- package/esm2022/decorators/custom/custom-decorator-internal.data.mjs +1 -2
- package/esm2022/decorators/custom/custom-decorator.data.mjs +1 -1
- package/esm2022/decorators/custom/custom.decorator.mjs +1 -2
- package/esm2022/decorators/date/date-decorator-internal.data.mjs +2 -2
- package/esm2022/decorators/date/date-decorator.data.mjs +1 -1
- package/esm2022/decorators/date/date.decorator.mjs +2 -3
- package/esm2022/decorators/file/file-decorator-internal.data.mjs +1 -4
- package/esm2022/decorators/file/file-decorator.data.mjs +1 -6
- package/esm2022/decorators/file/file.decorator.mjs +2 -3
- package/esm2022/decorators/has-many/has-many-decorator-internal.data.mjs +1 -2
- package/esm2022/decorators/has-many/has-many-decorator.data.mjs +1 -1
- package/esm2022/decorators/has-many/has-many.decorator.mjs +1 -2
- package/esm2022/decorators/number/number-decorator-internal.data.mjs +4 -5
- package/esm2022/decorators/number/number-decorator.data.mjs +1 -1
- package/esm2022/decorators/number/number.decorator.mjs +1 -2
- package/esm2022/decorators/object/object.decorator.mjs +1 -2
- package/esm2022/decorators/references-many/references-many-decorator-internal.data.mjs +1 -2
- package/esm2022/decorators/references-many/references-many-decorator.data.mjs +1 -1
- package/esm2022/decorators/references-many/references-many.decorator.mjs +1 -2
- package/esm2022/decorators/references-one/references-one.decorator.mjs +1 -2
- package/esm2022/decorators/string/string-decorator-internal.data.mjs +7 -4
- package/esm2022/decorators/string/string-decorator.data.mjs +1 -1
- package/esm2022/decorators/string/string.decorator.mjs +1 -2
- package/esm2022/default-global-configuration-values.mjs +16 -1
- package/esm2022/directives/drag-drop.directive.mjs +1 -4
- package/esm2022/directives/included-in.directive.mjs +33 -0
- package/esm2022/directives/number.directive.mjs +1 -2
- package/esm2022/directives/password-match.directive.mjs +2 -2
- package/esm2022/encapsulation/js-2-xml.utilities.mjs +1 -2
- package/esm2022/encapsulation/jszip.utilities.mjs +1 -2
- package/esm2022/encapsulation/lodash.utilities.mjs +12 -19
- package/esm2022/encapsulation/reflect.utilities.mjs +1 -8
- package/esm2022/encapsulation/uuid.utilities.mjs +1 -2
- package/esm2022/functions/default-false.function.mjs +1 -2
- package/esm2022/functions/default-true.function.mjs +1 -2
- package/esm2022/functions/get-config-value.function.mjs +1 -2
- package/esm2022/functions/get-validation-error-message.function.mjs +13 -7
- package/esm2022/functions/get-validation-errors-tooltip-content.function.ts.mjs +6 -4
- package/esm2022/functions/is-async-function.function.mjs +1 -2
- package/esm2022/global-configuration-values.mjs +5 -2
- package/esm2022/mocks/placeholder-data.png.mjs +3 -3
- package/esm2022/public-api.mjs +3 -1
- package/esm2022/services/entity.service.mjs +15 -21
- package/esm2022/services/unsaved-changes.guard.mjs +7 -2
- package/esm2022/utilities/date.utilities.mjs +3 -9
- package/esm2022/utilities/entity.utilities.mjs +82 -79
- package/esm2022/utilities/file.utilities.mjs +1 -10
- package/esm2022/utilities/selection.utilities.mjs +4 -7
- package/esm2022/utilities/validation.utilities.mjs +72 -36
- package/fesm2022/ngx-material-entity.mjs +1340 -752
- package/fesm2022/ngx-material-entity.mjs.map +1 -1
- package/functions/default-false.function.d.ts +0 -1
- package/functions/default-true.function.d.ts +0 -1
- package/functions/get-config-value.function.d.ts +0 -1
- package/functions/get-validation-error-message.function.d.ts +3 -0
- package/functions/get-validation-errors-tooltip-content.function.ts.d.ts +4 -2
- package/functions/is-async-function.function.d.ts +0 -1
- package/global-configuration-values.d.ts +9 -34
- package/mocks/placeholder-data.png.d.ts +1 -1
- package/package.json +2 -1
- package/public-api.d.ts +2 -0
- package/services/entity.service.d.ts +11 -16
- package/services/unsaved-changes.guard.d.ts +13 -1
- package/utilities/date.utilities.d.ts +0 -6
- package/utilities/entity.utilities.d.ts +10 -36
- package/utilities/file.utilities.d.ts +0 -9
- package/utilities/selection.utilities.d.ts +0 -3
- package/utilities/validation.utilities.d.ts +1 -3
- package/esm2022/components/table/create-dialog/create-dialog-data.builder.mjs +0 -44
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { EnvironmentInjector } from '@angular/core';
|
|
2
3
|
import { BaseEntityType } from '../classes/entity.model';
|
|
3
4
|
import { DecoratorType, DecoratorTypes } from '../decorators/base/decorator-types.enum';
|
|
4
5
|
import { PropertyDecoratorConfigInternal } from '../decorators/base/property-decorator-internal.data';
|
|
@@ -47,35 +48,20 @@ export declare abstract class EntityUtilities {
|
|
|
47
48
|
* The key for the metadata that saves the time value on date time properties.
|
|
48
49
|
*/
|
|
49
50
|
static readonly TIME_KEY: string;
|
|
50
|
-
/**
|
|
51
|
-
* The key for the metadata that saves the date range value on date range properties.
|
|
52
|
-
*/
|
|
53
|
-
static readonly DATE_RANGE_KEY: string;
|
|
54
|
-
/**
|
|
55
|
-
* The key for the metadata that saves the date range start value on date range properties.
|
|
56
|
-
*/
|
|
57
|
-
static readonly DATE_RANGE_START_KEY: string;
|
|
58
|
-
/**
|
|
59
|
-
* The key for the metadata that saves the date range end value on date range properties.
|
|
60
|
-
*/
|
|
61
|
-
static readonly DATE_RANGE_END_KEY: string;
|
|
62
51
|
/**
|
|
63
52
|
* Gets the properties to omit when updating the entity.
|
|
64
|
-
*
|
|
65
53
|
* @param entity - The entity to get the properties which should be left out for updating from.
|
|
66
54
|
* @returns The properties which should be left out for updating an Entity.
|
|
67
55
|
*/
|
|
68
56
|
static getOmitForUpdate<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): (keyof EntityType)[];
|
|
69
57
|
/**
|
|
70
58
|
* Gets the properties to omit when creating new entities.
|
|
71
|
-
*
|
|
72
59
|
* @param entity - The entity to get the properties which should be left out for creating from.
|
|
73
60
|
* @returns The properties which should be left out for creating a new Entity.
|
|
74
61
|
*/
|
|
75
62
|
static getOmitForCreate<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): (keyof EntityType)[];
|
|
76
63
|
/**
|
|
77
64
|
* Returns the given entity without the values that should be omitted for creation.
|
|
78
|
-
*
|
|
79
65
|
* @param entity - The entity with all its values.
|
|
80
66
|
* @returns The reduced entity object.
|
|
81
67
|
*/
|
|
@@ -83,22 +69,20 @@ export declare abstract class EntityUtilities {
|
|
|
83
69
|
/**
|
|
84
70
|
* Returns the given entity without the values that should be omitted for updating.
|
|
85
71
|
* This also handles omitting keys for @object or @array values and removes values that haven't been changed by default.
|
|
86
|
-
*
|
|
87
72
|
* @param entity - The entity with all its values.
|
|
88
73
|
* @param entityPriorChanges - The entity before any changes were applied.
|
|
89
74
|
* @param http - The angular HttpClient. Used to fetch files.
|
|
75
|
+
* @param injector - An angular environment injector.
|
|
90
76
|
* @returns The reduced entity object.
|
|
91
77
|
*/
|
|
92
|
-
static getWithoutOmitUpdateValues<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType, http: HttpClient): Promise<Partial<EntityType>>;
|
|
78
|
+
static getWithoutOmitUpdateValues<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType, http: HttpClient, injector: EnvironmentInjector): Promise<Partial<EntityType>>;
|
|
93
79
|
/**
|
|
94
80
|
* Sets all default values on the given entity.
|
|
95
|
-
*
|
|
96
81
|
* @param entity - The entity to set the default values on.
|
|
97
82
|
*/
|
|
98
83
|
static setDefaultValues<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): void;
|
|
99
84
|
/**
|
|
100
85
|
* Gets all properties on the given entity which are files.
|
|
101
|
-
*
|
|
102
86
|
* @param entity - The entity to check for file properties.
|
|
103
87
|
* @param omit - Whether to leave out values that are omitted for create or delete.
|
|
104
88
|
* @returns The keys of all file properties on the given entity.
|
|
@@ -106,7 +90,6 @@ export declare abstract class EntityUtilities {
|
|
|
106
90
|
static getFileProperties<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit?: 'create' | 'update'): (keyof EntityType)[];
|
|
107
91
|
/**
|
|
108
92
|
* Gets the metadata included in an property.
|
|
109
|
-
*
|
|
110
93
|
* @param entity - The entity with the property to get the metadata from.
|
|
111
94
|
* @param propertyKey - The property on the given Entity to get the metadata from.
|
|
112
95
|
* @param type - For secure Typing, defines the returned PropertyConfig.
|
|
@@ -116,7 +99,6 @@ export declare abstract class EntityUtilities {
|
|
|
116
99
|
static getPropertyMetadata<EntityType extends BaseEntityType<EntityType>, T extends DecoratorTypes, CustomMetadataType extends Record<string, unknown>>(entity: EntityType, propertyKey: keyof EntityType, type?: T): DecoratorType<T, CustomMetadataType>;
|
|
117
100
|
/**
|
|
118
101
|
* Gets the type of the property-metadata.
|
|
119
|
-
*
|
|
120
102
|
* @param entity - The entity with the property to get the type from.
|
|
121
103
|
* @param propertyKey - The property on the given Entity to get the type from.
|
|
122
104
|
* @returns The type of the metadata.
|
|
@@ -125,7 +107,6 @@ export declare abstract class EntityUtilities {
|
|
|
125
107
|
static getPropertyType<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, propertyKey: keyof EntityType): DecoratorTypes;
|
|
126
108
|
/**
|
|
127
109
|
* Sets all property values based on a given entity data-object.
|
|
128
|
-
*
|
|
129
110
|
* @param target - The target object that needs to be constructed (if called inside an Entity constructor its usually this).
|
|
130
111
|
* @param entity - The data object to get the property values from.
|
|
131
112
|
* @alias new
|
|
@@ -137,7 +118,6 @@ export declare abstract class EntityUtilities {
|
|
|
137
118
|
static build: typeof EntityUtilities.new;
|
|
138
119
|
/**
|
|
139
120
|
* Checks if an entity is "dirty" (if its values have changed).
|
|
140
|
-
*
|
|
141
121
|
* @param entity - The entity after all changes.
|
|
142
122
|
* @param entityPriorChanges - The entity before the changes.
|
|
143
123
|
* @param http - The angular HttpClient. Used to fetch files.
|
|
@@ -146,7 +126,6 @@ export declare abstract class EntityUtilities {
|
|
|
146
126
|
static isDirty<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType, http: HttpClient): Promise<boolean>;
|
|
147
127
|
/**
|
|
148
128
|
* Gets the differences between the two given entities.
|
|
149
|
-
*
|
|
150
129
|
* @param entity - The entity as is.
|
|
151
130
|
* @param entityPriorChanges - The entity before any changes have been made.
|
|
152
131
|
* @param http - The angular http client, is needed to check if files are equal.
|
|
@@ -156,7 +135,6 @@ export declare abstract class EntityUtilities {
|
|
|
156
135
|
/**
|
|
157
136
|
* Checks if two given values are equal.
|
|
158
137
|
* It uses the isEqual method from LodashUtilities and extends it with functionality regarding Dates.
|
|
159
|
-
*
|
|
160
138
|
* @param value - The updated value.
|
|
161
139
|
* @param valuePriorChanges - The value before any changes.
|
|
162
140
|
* @param metadata - The metadata of the property.
|
|
@@ -175,7 +153,6 @@ export declare abstract class EntityUtilities {
|
|
|
175
153
|
private static isEqualCustom;
|
|
176
154
|
/**
|
|
177
155
|
* Compare function for sorting entity keys by their order value.
|
|
178
|
-
*
|
|
179
156
|
* @param a - First key of entity.
|
|
180
157
|
* @param b - Second key of entity.
|
|
181
158
|
* @param entity - Current entity (used to get metadata of entity keys).
|
|
@@ -183,17 +160,14 @@ export declare abstract class EntityUtilities {
|
|
|
183
160
|
*/
|
|
184
161
|
static compareOrder<EntityType extends BaseEntityType<EntityType>>(a: keyof EntityType, b: keyof EntityType, entity: EntityType): number;
|
|
185
162
|
/**
|
|
186
|
-
* Gets the bootstrap column
|
|
187
|
-
*
|
|
163
|
+
* Gets the bootstrap column classes for "lg", "md" and "sm".
|
|
188
164
|
* @param entity - Entity to get the bootstrap column values of the key.
|
|
189
165
|
* @param key - Key of the property to get bootstrap column values from.
|
|
190
|
-
* @
|
|
191
|
-
* @returns Bootstrap column value.
|
|
166
|
+
* @returns Bootstrap column classes.
|
|
192
167
|
*/
|
|
193
|
-
static
|
|
168
|
+
static getWidthClasses<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType): string;
|
|
194
169
|
/**
|
|
195
170
|
* Resets all changes on an entity.
|
|
196
|
-
*
|
|
197
171
|
* @param entity - The entity to reset.
|
|
198
172
|
* @param entityPriorChanges - The entity before any changes.
|
|
199
173
|
*/
|
|
@@ -201,14 +175,14 @@ export declare abstract class EntityUtilities {
|
|
|
201
175
|
private static getEntityRows;
|
|
202
176
|
/**
|
|
203
177
|
* Gets the tabs that are used to display the given entity.
|
|
204
|
-
*
|
|
205
178
|
* @param entity - The entity to get the rows from.
|
|
179
|
+
* @param injector - An angular environment injector.
|
|
206
180
|
* @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
|
|
207
181
|
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
208
182
|
* @param additionalOmitValues - Additional omit values.
|
|
209
183
|
* @returns The sorted Tabs containing the rows and the keys to display in that row.
|
|
210
184
|
*/
|
|
211
|
-
static getEntityTabs<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean, additionalOmitValues?: (keyof EntityType)[]): EntityTab<EntityType>[];
|
|
185
|
+
static getEntityTabs<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean, additionalOmitValues?: (keyof EntityType)[]): EntityTab<EntityType>[];
|
|
212
186
|
private static getKeysForRow;
|
|
213
187
|
private static getNumberOfRows;
|
|
214
188
|
private static getNumberOfTabs;
|
|
@@ -216,13 +190,13 @@ export declare abstract class EntityUtilities {
|
|
|
216
190
|
private static getFirstTabName;
|
|
217
191
|
/**
|
|
218
192
|
* Gets the keys of the provided entity correctly typed.
|
|
219
|
-
*
|
|
220
193
|
* @param entity - The entity to get the keys of.
|
|
194
|
+
* @param injector - An angular environment injector.
|
|
221
195
|
* @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
|
|
222
196
|
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
223
197
|
* @returns An array of keys of the entity.
|
|
224
198
|
*/
|
|
225
|
-
static keysOf<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean): (keyof EntityType)[];
|
|
199
|
+
static keysOf<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean): (keyof EntityType)[];
|
|
226
200
|
private static getDontDisplayKeys;
|
|
227
201
|
}
|
|
228
202
|
/**
|
|
@@ -7,21 +7,18 @@ import { FileData } from '../decorators/file/file-decorator.data';
|
|
|
7
7
|
export declare abstract class FileUtilities {
|
|
8
8
|
/**
|
|
9
9
|
* Gets the accept value for the html input.
|
|
10
|
-
*
|
|
11
10
|
* @param mimeTypes - The mimeTypes to get the accept string from.
|
|
12
11
|
* @returns A comma separated string of all the provided mime types.
|
|
13
12
|
*/
|
|
14
13
|
static getAcceptString(mimeTypes?: string[]): string;
|
|
15
14
|
/**
|
|
16
15
|
* Reads a url to display the given file.
|
|
17
|
-
*
|
|
18
16
|
* @param file - The file to get the url from.
|
|
19
17
|
* @returns A promise of the url. Undefined if no file was provided.
|
|
20
18
|
*/
|
|
21
19
|
static getDataURLFromFile(file?: Blob): Promise<string | undefined>;
|
|
22
20
|
/**
|
|
23
21
|
* Gets a file from the given url.
|
|
24
|
-
*
|
|
25
22
|
* @param url - The url to get the file from.
|
|
26
23
|
* @param http - The angular HttpClient. Used to fetch files.
|
|
27
24
|
* @returns A promise of the File.
|
|
@@ -29,7 +26,6 @@ export declare abstract class FileUtilities {
|
|
|
29
26
|
private static getFileFromUrl;
|
|
30
27
|
/**
|
|
31
28
|
* Gets the file data with the blob from the given File Data.
|
|
32
|
-
*
|
|
33
29
|
* @param data - The File Data to get the file data with blob from.
|
|
34
30
|
* @param http - The angular HttpClient. Used to fetch files.
|
|
35
31
|
* @returns FileDataWithFile.
|
|
@@ -37,20 +33,17 @@ export declare abstract class FileUtilities {
|
|
|
37
33
|
static getFileData(data: FileData, http: HttpClient): Promise<FileDataWithFile>;
|
|
38
34
|
/**
|
|
39
35
|
* Downloads a single file from the given File Data.
|
|
40
|
-
*
|
|
41
36
|
* @param fileData - The file data. Needs to contain a blob.
|
|
42
37
|
*/
|
|
43
38
|
static downloadSingleFile(fileData: FileDataWithFile): void;
|
|
44
39
|
/**
|
|
45
40
|
* Downloads a blob.
|
|
46
|
-
*
|
|
47
41
|
* @param blob - The blob to download.
|
|
48
42
|
* @param name - The name of the downloaded file.
|
|
49
43
|
*/
|
|
50
44
|
static downLoadBlob(blob: Blob, name?: string): void;
|
|
51
45
|
/**
|
|
52
46
|
* Downloads multiple files as a zip with the given name.
|
|
53
|
-
*
|
|
54
47
|
* @param name - The name of the zip file to generate.
|
|
55
48
|
* @param multiFileData - The file data array to put in the zip.
|
|
56
49
|
* @param http - The angular HttpClient. Used to fetch files.
|
|
@@ -58,7 +51,6 @@ export declare abstract class FileUtilities {
|
|
|
58
51
|
static downloadMultipleFiles(name: string, multiFileData: FileData[], http: HttpClient): Promise<void>;
|
|
59
52
|
/**
|
|
60
53
|
* Checks if the given file has a valid mime type.
|
|
61
|
-
*
|
|
62
54
|
* @param type - The type of the file to check.
|
|
63
55
|
* @param allowedMimeTypes - The allowed mime types.
|
|
64
56
|
* @returns Whether or not the given file has a valid mime type.
|
|
@@ -66,7 +58,6 @@ export declare abstract class FileUtilities {
|
|
|
66
58
|
static isMimeTypeValid(type: string, allowedMimeTypes: string[]): boolean;
|
|
67
59
|
/**
|
|
68
60
|
* Transform the given value to Megabytes.
|
|
69
|
-
*
|
|
70
61
|
* @param value - The original value.
|
|
71
62
|
* @param unit - If the value is B, KB or GB.
|
|
72
63
|
* @returns The given value as bytes.
|
|
@@ -7,7 +7,6 @@ export declare abstract class SelectionUtilities {
|
|
|
7
7
|
/**
|
|
8
8
|
* Checks if all items in the table have been selected.
|
|
9
9
|
* This is needed to display the "masterToggle"-checkbox correctly.
|
|
10
|
-
*
|
|
11
10
|
* @param selection - The selection to check.
|
|
12
11
|
* @param dataSource - The dataSource of the selection.
|
|
13
12
|
* @returns Whether or not all items in the table have been selected.
|
|
@@ -15,14 +14,12 @@ export declare abstract class SelectionUtilities {
|
|
|
15
14
|
static isAllSelected(selection: SelectionModel<any>, dataSource: MatTableDataSource<any>): boolean;
|
|
16
15
|
/**
|
|
17
16
|
* Toggles all items in the table.
|
|
18
|
-
*
|
|
19
17
|
* @param selection - The selection to toggle.
|
|
20
18
|
* @param dataSource - The dataSource of the selection.
|
|
21
19
|
*/
|
|
22
20
|
static masterToggle(selection: SelectionModel<any>, dataSource: MatTableDataSource<any>): void;
|
|
23
21
|
/**
|
|
24
22
|
* Removes all selected entries from the array.
|
|
25
|
-
*
|
|
26
23
|
* @param selection - The selection containing the items to remove.
|
|
27
24
|
* @param values - The values of the dataSource.
|
|
28
25
|
* @param dataSource - The dataSource.
|
|
@@ -20,7 +20,6 @@ export declare abstract class ValidationUtilities {
|
|
|
20
20
|
/**
|
|
21
21
|
* Checks if the values on an entity are valid.
|
|
22
22
|
* Also checks all the validators given by the metadata ("required", "maxLength" etc.).
|
|
23
|
-
*
|
|
24
23
|
* @param entity - The entity to validate.
|
|
25
24
|
* @param omit - Whether to check for creating or editing validity.
|
|
26
25
|
* @returns Whether or not the entity is valid.
|
|
@@ -28,7 +27,6 @@ export declare abstract class ValidationUtilities {
|
|
|
28
27
|
static isEntityValid<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit?: 'create' | 'update'): boolean;
|
|
29
28
|
/**
|
|
30
29
|
* Gets all validation errors on the given entity.
|
|
31
|
-
*
|
|
32
30
|
* @param entity - The entity to validate.
|
|
33
31
|
* @param omit - What keys not to check. An empty value means no keys are omitted.
|
|
34
32
|
* @returns An array of validation errors on the provided entity.
|
|
@@ -36,7 +34,6 @@ export declare abstract class ValidationUtilities {
|
|
|
36
34
|
static getEntityValidationErrors<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit?: 'create' | 'update'): ValidationError[];
|
|
37
35
|
/**
|
|
38
36
|
* Validates the property on the given entity with the given key.
|
|
39
|
-
*
|
|
40
37
|
* @param entity - The entity on which the property to check is.
|
|
41
38
|
* @param key - The key of the property to validate.
|
|
42
39
|
* @param omit - What keys not to check. An empty value means no keys are omitted.
|
|
@@ -46,6 +43,7 @@ export declare abstract class ValidationUtilities {
|
|
|
46
43
|
static getPropertyValidationError<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType, omit?: 'create' | 'update'): ValidationError | undefined;
|
|
47
44
|
private static getBooleanValidationError;
|
|
48
45
|
private static getStringValidationError;
|
|
46
|
+
private static getAutocompleteStringValidationError;
|
|
49
47
|
private static getTextboxValidationError;
|
|
50
48
|
private static getPasswordValidationError;
|
|
51
49
|
private static getNumberValidationError;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { BaseBuilder } from '../../../classes/base.builder';
|
|
2
|
-
import { getConfigValue } from '../../../functions/get-config-value.function';
|
|
3
|
-
import { ConfirmDialogDataBuilder } from '../../confirm-dialog/confirm-dialog-data.builder';
|
|
4
|
-
/**
|
|
5
|
-
* The internal CreateDialogData. Requires all default values the user can leave out.
|
|
6
|
-
*/
|
|
7
|
-
export class CreateDialogDataInternal {
|
|
8
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
9
|
-
title;
|
|
10
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
11
|
-
createButtonLabel;
|
|
12
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
13
|
-
cancelButtonLabel;
|
|
14
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
15
|
-
createRequiresConfirmDialog;
|
|
16
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
17
|
-
confirmCreateDialogData;
|
|
18
|
-
constructor(title, createButtonLabel, cancelButtonLabel, createRequiresConfirmDialog, confirmCreateDialogData) {
|
|
19
|
-
this.title = title;
|
|
20
|
-
this.createButtonLabel = createButtonLabel;
|
|
21
|
-
this.cancelButtonLabel = cancelButtonLabel;
|
|
22
|
-
this.createRequiresConfirmDialog = createRequiresConfirmDialog;
|
|
23
|
-
this.confirmCreateDialogData = confirmCreateDialogData;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The Builder for the CreateDialogData. Sets default values.
|
|
28
|
-
*/
|
|
29
|
-
export class CreateDialogDataBuilder extends BaseBuilder {
|
|
30
|
-
constructor(globalConfig, data) {
|
|
31
|
-
super(globalConfig, data);
|
|
32
|
-
}
|
|
33
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
34
|
-
generateBaseData(data) {
|
|
35
|
-
// eslint-disable-next-line max-len
|
|
36
|
-
const confirmCreateDialogData = new ConfirmDialogDataBuilder(this.globalConfig, data?.confirmCreateDialogData)
|
|
37
|
-
.withDefault('confirmButtonLabel', this.globalConfig.createLabel)
|
|
38
|
-
.withDefault('text', this.globalConfig.confirmCreateText)
|
|
39
|
-
.withDefault('title', this.globalConfig.createLabel)
|
|
40
|
-
.getResult();
|
|
41
|
-
return new CreateDialogDataInternal(getConfigValue(this.globalConfig.createLabel, data?.title), getConfigValue(this.globalConfig.createLabel, data?.createButtonLabel), getConfigValue(this.globalConfig.cancelLabel, data?.cancelButtonLabel), data?.createRequiresConfirmDialog ?? false, confirmCreateDialogData);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3J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