ngx-material-entity 20.0.4 → 20.0.6
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/fesm2022/ngx-material-entity.mjs +400 -299
- package/fesm2022/ngx-material-entity.mjs.map +1 -1
- package/index.d.ts +31 -4
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1241,6 +1241,7 @@ interface DateTimeDateDecoratorConfig extends DateDecoratorConfig<Date> {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
|
|
1243
1243
|
type StringDropdownValues = DropdownValue<string | undefined>[] | ((entity: any) => DropdownValue<string | undefined>[]) | ((entity: any) => Promise<DropdownValue<string | undefined>[]>);
|
|
1244
|
+
type RequiredStringDropdownValues = DropdownValue<string>[] | ((entity: any) => DropdownValue<string>[]) | ((entity: any) => Promise<DropdownValue<string>[]>);
|
|
1244
1245
|
type StringAutocompleteValues = string[] | ((entity: any) => string[]) | ((entity: any) => Promise<string[]>);
|
|
1245
1246
|
/**
|
|
1246
1247
|
* Definition for the @string metadata.
|
|
@@ -1594,6 +1595,17 @@ interface AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecoratorConf
|
|
|
1594
1595
|
*/
|
|
1595
1596
|
restrictToOptions?: boolean;
|
|
1596
1597
|
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Definition for an array of strings displayed in a dropdown.
|
|
1600
|
+
*/
|
|
1601
|
+
interface StringDropdownArrayDecoratorConfig extends ArrayDecoratorConfig<string[]> {
|
|
1602
|
+
itemType: DecoratorTypes.STRING_DROPDOWN;
|
|
1603
|
+
/**
|
|
1604
|
+
* The values of the dropdown, consisting of a name to display and the actual value
|
|
1605
|
+
* Can also receive a function to determine the values.
|
|
1606
|
+
*/
|
|
1607
|
+
dropdownValues: RequiredStringDropdownValues;
|
|
1608
|
+
}
|
|
1597
1609
|
|
|
1598
1610
|
/**
|
|
1599
1611
|
* The internal Position. Sets default values and validates user input.
|
|
@@ -1752,6 +1764,14 @@ declare class AutocompleteStringChipsArrayDecoratorConfigInternal extends Proper
|
|
|
1752
1764
|
constructor(data: AutocompleteStringChipsArrayDecoratorConfig, globalConfig: NgxGlobalDefaultValues);
|
|
1753
1765
|
private autocompleteValuesToFunction;
|
|
1754
1766
|
}
|
|
1767
|
+
/**
|
|
1768
|
+
* The internal StringDropdownArrayDecoratorConfig. Sets default values.
|
|
1769
|
+
*/
|
|
1770
|
+
declare class StringDropdownArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal<string[]> implements StringDropdownArrayDecoratorConfig {
|
|
1771
|
+
itemType: DecoratorTypes.STRING_DROPDOWN;
|
|
1772
|
+
dropdownValues: (entity: any) => Promise<DropdownValue<string>[]>;
|
|
1773
|
+
constructor(data: StringDropdownArrayDecoratorConfig);
|
|
1774
|
+
}
|
|
1755
1775
|
|
|
1756
1776
|
/**
|
|
1757
1777
|
* The Definition for the @boolean metadata.
|
|
@@ -2629,6 +2649,7 @@ declare enum DecoratorTypes {
|
|
|
2629
2649
|
ARRAY_DATE_RANGE = "arrayDateRange",
|
|
2630
2650
|
ARRAY_STRING_CHIPS = "arrayStringChips",
|
|
2631
2651
|
ARRAY_STRING_AUTOCOMPLETE_CHIPS = "arrayStringAutocompleteChips",
|
|
2652
|
+
ARRAY_STRING_DROPDOWN = "arrayStringDropdown",
|
|
2632
2653
|
DATE = "date",
|
|
2633
2654
|
DATE_RANGE = "dateRange",
|
|
2634
2655
|
DATE_TIME = "dateTime",
|
|
@@ -2642,7 +2663,7 @@ declare enum DecoratorTypes {
|
|
|
2642
2663
|
/**
|
|
2643
2664
|
* Gives the metadata-config Type based on the DecoratorTypes enum.
|
|
2644
2665
|
*/
|
|
2645
|
-
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.OBJECT_DROPDOWN ? DropdownObjectDecoratorConfigInternal<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;
|
|
2666
|
+
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.OBJECT_DROPDOWN ? DropdownObjectDecoratorConfigInternal<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.ARRAY_STRING_DROPDOWN ? StringDropdownArrayDecoratorConfigInternal : 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;
|
|
2646
2667
|
|
|
2647
2668
|
/**
|
|
2648
2669
|
* Shows information about differences between two entities.
|
|
@@ -2652,6 +2673,10 @@ interface Difference<EntityType extends BaseEntityType<EntityType>> {
|
|
|
2652
2673
|
* The key where the two entities have different values.
|
|
2653
2674
|
*/
|
|
2654
2675
|
key: keyof EntityType;
|
|
2676
|
+
/**
|
|
2677
|
+
* The display name resolved from metadata.
|
|
2678
|
+
*/
|
|
2679
|
+
name: string | undefined;
|
|
2655
2680
|
/**
|
|
2656
2681
|
* The value before any changes.
|
|
2657
2682
|
*/
|
|
@@ -2915,12 +2940,14 @@ declare abstract class ValidationUtilities {
|
|
|
2915
2940
|
* Validates the property on the given entity with the given key.
|
|
2916
2941
|
* @param entity - The entity on which the property to check is.
|
|
2917
2942
|
* @param key - The key of the property to validate.
|
|
2943
|
+
* @param injector - An angular environment injector.
|
|
2918
2944
|
* @param omit - What keys not to check. An empty value means no keys are omitted.
|
|
2919
2945
|
* @returns A validation error when the property is not valid, undefined otherwise.
|
|
2920
2946
|
* @throws When the type of the property is not known.
|
|
2921
2947
|
*/
|
|
2922
|
-
static getPropertyValidationError<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType, omit?: 'create' | 'update'): Promise<ValidationError | undefined>;
|
|
2948
|
+
static getPropertyValidationError<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType, injector: EnvironmentInjector, omit?: 'create' | 'update'): Promise<ValidationError | undefined>;
|
|
2923
2949
|
private static getArrayStringAutocompleteChipsValidationError;
|
|
2950
|
+
private static getArrayStringDropdownValidationError;
|
|
2924
2951
|
private static getBooleanValidationError;
|
|
2925
2952
|
private static getStringValidationError;
|
|
2926
2953
|
private static getAutocompleteStringValidationError;
|
|
@@ -4310,7 +4337,7 @@ declare class TooltipComponent {
|
|
|
4310
4337
|
* @returns The method that defines the metadata.
|
|
4311
4338
|
* @throws When the given type of the array-items is unknown.
|
|
4312
4339
|
*/
|
|
4313
|
-
declare function array<EntityType extends BaseEntityType<EntityType>>(metadata: EntityArrayDecoratorConfig<EntityType> | StringChipsArrayDecoratorConfig | AutocompleteStringChipsArrayDecoratorConfig | DateArrayDecoratorConfig | DateTimeArrayDecoratorConfig | DateRangeArrayDecoratorConfig): (target: object, propertyKey: string) => void;
|
|
4340
|
+
declare function array<EntityType extends BaseEntityType<EntityType>>(metadata: EntityArrayDecoratorConfig<EntityType> | StringChipsArrayDecoratorConfig | AutocompleteStringChipsArrayDecoratorConfig | StringDropdownArrayDecoratorConfig | DateArrayDecoratorConfig | DateTimeArrayDecoratorConfig | DateRangeArrayDecoratorConfig): (target: object, propertyKey: string) => void;
|
|
4314
4341
|
|
|
4315
4342
|
/**
|
|
4316
4343
|
* Decorator for setting and getting boolean property metadata.
|
|
@@ -4568,4 +4595,4 @@ declare abstract class FileUtilities {
|
|
|
4568
4595
|
}
|
|
4569
4596
|
|
|
4570
4597
|
export { ArrayDecoratorConfig, DateUtilities, DecoratorTypes, DynamicStyleClassDirective, Entity, EntityService, EntityUtilities, FileUtilities, IncludedInValidatorDirective, NGX_COMPLETE_GLOBAL_DEFAULT_VALUES, NGX_CREATE_DATA, NGX_CREATE_DATA_ENTITY, NGX_CREATE_DATA_ENTITY_SERVICE, NGX_EDIT_DATA, NGX_EDIT_DATA_ENTITY, NGX_EDIT_DATA_ENTITY_SERVICE, NGX_GET_VALIDATION_ERROR_MESSAGE, NGX_GLOBAL_DEFAULT_VALUES, NgxChangesTooltipTitle, NgxMatEntityBaseDisplayColumnValueComponent, NgxMatEntityBaseInputComponent, NgxMatEntityConfirmDialogComponent, NgxMatEntityCreateDialogComponent, NgxMatEntityCreatePageComponent, NgxMatEntityEditDialogComponent, NgxMatEntityEditPageComponent, NgxMatEntityFormComponent, NgxMatEntityInputComponent, NgxMatEntityTableComponent, NgxValidationErrorsTooltipTitle, NumberDirective, TooltipComponent, TooltipDirective, UnsavedChangesGuard, ValidationUtilities, array, boolean, custom, date, defaultCreateDataRoute, defaultEditDataRoute, exportAsCsvMultiAction, exportAsJsonMultiAction, exportAsXmlMultiAction, file, getChangesTooltipContent, getValidationErrorsTooltipContent, hasMany, importFromJsonMultiAction, number, object, referencesMany, referencesOne, string };
|
|
4571
|
-
export type { AutocompleteStringChipsArrayDecoratorConfig, AutocompleteStringDecoratorConfig, BaseData, BaseEntityType, BaseTableAction, CheckboxBooleanDecoratorConfig, Col, ConfirmDialogData, ConfirmDialogTypes, CreateData, CreateDataRoute, CreateEntityData, CustomDecoratorConfig, DateArrayDecoratorConfig, DateRange, DateRangeArrayDecoratorConfig, DateRangeDateDecoratorConfig, DateTimeArrayDecoratorConfig, DateTimeDateDecoratorConfig, DecoratorType, DefaultDateDecoratorConfig, DefaultFileDecoratorConfig, DefaultNumberDecoratorConfig, DefaultObjectDecoratorConfig, DefaultStringDecoratorConfig, Difference, DisplayColumn, DropdownBooleanDecoratorConfig, DropdownNumberDecoratorConfig, DropdownObjectDecoratorConfig, DropdownStringDecoratorConfig, DropdownValue, DynamicStyleClasses, EditAction, EditArrayItemDialogData, EditData, EditDataRoute, EditEntityData, EntityArrayDecoratorConfig, EntityClassNewable, EntityRow, EntityServiceClassNewable, EntityTab, FileData, HasManyDecoratorConfig, Hour, ImageFileDecoratorConfig, Minute, MultiSelectAction, NgxGlobalDefaultValues, NumberDropdownValues, ObjectDropdownValues, PageCreateData, PageEditData, PasswordStringDecoratorConfig, Position, ReferencesManyDecoratorConfig, ReferencesOneDecoratorConfig, SliderNumberDecoratorConfig, StringAutocompleteValues, StringChipsArrayDecoratorConfig, StringDropdownValues, TableAction, TableColumnValue, TableData, TextboxStringDecoratorConfig, Time, ToggleBooleanDecoratorConfig, UnsavedChangesPage, ValidationError };
|
|
4598
|
+
export type { AutocompleteStringChipsArrayDecoratorConfig, AutocompleteStringDecoratorConfig, BaseData, BaseEntityType, BaseTableAction, CheckboxBooleanDecoratorConfig, Col, ConfirmDialogData, ConfirmDialogTypes, CreateData, CreateDataRoute, CreateEntityData, CustomDecoratorConfig, DateArrayDecoratorConfig, DateRange, DateRangeArrayDecoratorConfig, DateRangeDateDecoratorConfig, DateTimeArrayDecoratorConfig, DateTimeDateDecoratorConfig, DecoratorType, DefaultDateDecoratorConfig, DefaultFileDecoratorConfig, DefaultNumberDecoratorConfig, DefaultObjectDecoratorConfig, DefaultStringDecoratorConfig, Difference, DisplayColumn, DropdownBooleanDecoratorConfig, DropdownNumberDecoratorConfig, DropdownObjectDecoratorConfig, DropdownStringDecoratorConfig, DropdownValue, DynamicStyleClasses, EditAction, EditArrayItemDialogData, EditData, EditDataRoute, EditEntityData, EntityArrayDecoratorConfig, EntityClassNewable, EntityRow, EntityServiceClassNewable, EntityTab, FileData, HasManyDecoratorConfig, Hour, ImageFileDecoratorConfig, Minute, MultiSelectAction, NgxGlobalDefaultValues, NumberDropdownValues, ObjectDropdownValues, PageCreateData, PageEditData, PasswordStringDecoratorConfig, Position, ReferencesManyDecoratorConfig, ReferencesOneDecoratorConfig, RequiredStringDropdownValues, SliderNumberDecoratorConfig, StringAutocompleteValues, StringChipsArrayDecoratorConfig, StringDropdownArrayDecoratorConfig, StringDropdownValues, TableAction, TableColumnValue, TableData, TextboxStringDecoratorConfig, Time, ToggleBooleanDecoratorConfig, UnsavedChangesPage, ValidationError };
|