ngx-material-entity 16.0.7 → 16.0.8
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/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +10 -5
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +4 -2
- package/components/input/input.component.d.ts +28 -8
- package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +12 -2
- package/components/input/relations/references-many-input/references-many-input.component.d.ts +10 -2
- package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +4 -2
- package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +12 -2
- package/components/input/string/string-password-input/string-password-input.component.d.ts +12 -0
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +1 -1
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +1 -1
- package/components/table/table-data.builder.d.ts +2 -1
- package/components/table/table-data.d.ts +10 -0
- package/decorators/array/array-decorator-internal.data.d.ts +2 -1
- package/decorators/array/array-decorator.data.d.ts +3 -1
- package/decorators/string/string-decorator-internal.data.d.ts +3 -1
- package/decorators/string/string-decorator.data.d.ts +7 -1
- package/directives/dynamic-style-class.directive.d.ts +25 -0
- package/directives/included-in.directive.d.ts +1 -1
- package/esm2022/components/create-page/create-page.component.mjs +8 -5
- package/esm2022/components/edit-page/edit-page.component.mjs +8 -5
- package/esm2022/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +28 -15
- package/esm2022/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +14 -19
- package/esm2022/components/input/base-input.component.mjs +7 -2
- package/esm2022/components/input/input.component.mjs +73 -27
- package/esm2022/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +36 -8
- package/esm2022/components/input/relations/references-many-input/references-many-input.component.mjs +29 -5
- package/esm2022/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +17 -10
- package/esm2022/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +36 -8
- package/esm2022/components/input/string/string-password-input/string-password-input.component.mjs +57 -3
- package/esm2022/components/table/create-dialog/create-entity-dialog.component.mjs +4 -4
- package/esm2022/components/table/edit-dialog/edit-entity-dialog.component.mjs +9 -5
- package/esm2022/components/table/table-data.builder.mjs +5 -1
- package/esm2022/components/table/table-data.mjs +1 -1
- package/esm2022/components/table/table.component.mjs +6 -4
- package/esm2022/decorators/array/array-decorator-internal.data.mjs +11 -3
- package/esm2022/decorators/array/array-decorator.data.mjs +1 -1
- package/esm2022/decorators/string/string-decorator-internal.data.mjs +14 -3
- package/esm2022/decorators/string/string-decorator.data.mjs +1 -1
- package/esm2022/directives/dynamic-style-class.directive.mjs +51 -0
- package/esm2022/directives/included-in.directive.mjs +2 -3
- package/esm2022/encapsulation/reflect.utilities.mjs +6 -2
- package/esm2022/functions/default-style-classes.function.mjs +7 -0
- package/esm2022/public-api.mjs +6 -1
- package/esm2022/services/entity.service.mjs +3 -1
- package/esm2022/utilities/entity.utilities.mjs +37 -33
- package/esm2022/utilities/validation.utilities.mjs +46 -12
- package/fesm2022/ngx-material-entity.mjs +485 -158
- package/fesm2022/ngx-material-entity.mjs.map +1 -1
- package/functions/default-style-classes.function.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
- package/utilities/entity.utilities.d.ts +4 -3
- package/utilities/validation.utilities.d.ts +7 -3
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -45,6 +45,10 @@ export * from './decorators/references-one/references-one-decorator.data';
|
|
|
45
45
|
export * from './decorators/references-one/references-one.decorator';
|
|
46
46
|
export * from './decorators/string/string-decorator.data';
|
|
47
47
|
export * from './decorators/string/string.decorator';
|
|
48
|
+
export * from './directives/included-in.directive';
|
|
49
|
+
export * from './directives/number.directive';
|
|
50
|
+
export * from './directives/tooltip.directive';
|
|
51
|
+
export * from './directives/dynamic-style-class.directive';
|
|
48
52
|
export * from './functions/get-validation-error-message.function';
|
|
49
53
|
export * from './functions/get-validation-errors-tooltip-content.function.ts';
|
|
50
54
|
export * from './services/entity.service';
|
|
@@ -96,7 +96,7 @@ export declare abstract class EntityUtilities {
|
|
|
96
96
|
* @returns The metadata of the property.
|
|
97
97
|
* @throws When no metadata can be found for the given property.
|
|
98
98
|
*/
|
|
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
|
|
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> | undefined;
|
|
100
100
|
/**
|
|
101
101
|
* Gets the type of the property-metadata.
|
|
102
102
|
* @param entity - The entity with the property to get the type from.
|
|
@@ -104,7 +104,7 @@ export declare abstract class EntityUtilities {
|
|
|
104
104
|
* @returns The type of the metadata.
|
|
105
105
|
* @throws Will throw an error if no metadata can be found for the given property.
|
|
106
106
|
*/
|
|
107
|
-
static getPropertyType<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, propertyKey: keyof EntityType): DecoratorTypes;
|
|
107
|
+
static getPropertyType<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, propertyKey: keyof EntityType): DecoratorTypes | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* Sets all property values based on a given entity data-object.
|
|
110
110
|
* @param target - The target object that needs to be constructed (if called inside an Entity constructor its usually this).
|
|
@@ -142,7 +142,7 @@ export declare abstract class EntityUtilities {
|
|
|
142
142
|
* @param http - The angular HttpClient. Used to fetch files.
|
|
143
143
|
* @returns Whether or not the given values are equal.
|
|
144
144
|
*/
|
|
145
|
-
static isEqual(value: unknown, valuePriorChanges: unknown, metadata: PropertyDecoratorConfigInternal<unknown
|
|
145
|
+
static isEqual(value: unknown, valuePriorChanges: unknown, metadata: PropertyDecoratorConfigInternal<unknown> | undefined, type: DecoratorTypes | undefined, http: HttpClient): Promise<boolean>;
|
|
146
146
|
private static isEqualArrayString;
|
|
147
147
|
private static isEqualArrayDate;
|
|
148
148
|
private static isEqualArrayDateRange;
|
|
@@ -164,6 +164,7 @@ export declare abstract class EntityUtilities {
|
|
|
164
164
|
* @param entity - Entity to get the bootstrap column values of the key.
|
|
165
165
|
* @param key - Key of the property to get bootstrap column values from.
|
|
166
166
|
* @returns Bootstrap column classes.
|
|
167
|
+
* @throws When no metadata for the given key was found.
|
|
167
168
|
*/
|
|
168
169
|
static getWidthClasses<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType): string;
|
|
169
170
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EnvironmentInjector } from '@angular/core';
|
|
1
2
|
import { BaseEntityType } from '../classes/entity.model';
|
|
2
3
|
/**
|
|
3
4
|
* A validation error reported by the validation utilities.
|
|
@@ -21,17 +22,19 @@ export declare abstract class ValidationUtilities {
|
|
|
21
22
|
* Checks if the values on an entity are valid.
|
|
22
23
|
* Also checks all the validators given by the metadata ("required", "maxLength" etc.).
|
|
23
24
|
* @param entity - The entity to validate.
|
|
25
|
+
* @param injector - An angular environment injector.
|
|
24
26
|
* @param omit - Whether to check for creating or editing validity.
|
|
25
27
|
* @returns Whether or not the entity is valid.
|
|
26
28
|
*/
|
|
27
|
-
static isEntityValid<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit?: 'create' | 'update'): boolean
|
|
29
|
+
static isEntityValid<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, omit?: 'create' | 'update'): Promise<boolean>;
|
|
28
30
|
/**
|
|
29
31
|
* Gets all validation errors on the given entity.
|
|
30
32
|
* @param entity - The entity to validate.
|
|
33
|
+
* @param injector - An angular environment injector.
|
|
31
34
|
* @param omit - What keys not to check. An empty value means no keys are omitted.
|
|
32
35
|
* @returns An array of validation errors on the provided entity.
|
|
33
36
|
*/
|
|
34
|
-
static getEntityValidationErrors<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit?: 'create' | 'update'): ValidationError[]
|
|
37
|
+
static getEntityValidationErrors<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, injector: EnvironmentInjector, omit?: 'create' | 'update'): Promise<ValidationError[]>;
|
|
35
38
|
/**
|
|
36
39
|
* Validates the property on the given entity with the given key.
|
|
37
40
|
* @param entity - The entity on which the property to check is.
|
|
@@ -40,7 +43,8 @@ export declare abstract class ValidationUtilities {
|
|
|
40
43
|
* @returns A validation error when the property is not valid, undefined otherwise.
|
|
41
44
|
* @throws When the type of the property is not known.
|
|
42
45
|
*/
|
|
43
|
-
static getPropertyValidationError<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType, omit?: 'create' | 'update'): ValidationError | undefined
|
|
46
|
+
static getPropertyValidationError<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType, omit?: 'create' | 'update'): Promise<ValidationError | undefined>;
|
|
47
|
+
private static getArrayStringAutocompleteChipsValidationError;
|
|
44
48
|
private static getBooleanValidationError;
|
|
45
49
|
private static getStringValidationError;
|
|
46
50
|
private static getAutocompleteStringValidationError;
|