ngx-material-entity 1.1.5 → 15.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/README.md +4 -4
- package/classes/entity.utilities.d.ts +1 -0
- package/components/confirm-dialog/confirm-dialog.component.d.ts +1 -1
- package/components/input/array/array-date-input/array-date-input.component.d.ts +1 -1
- package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +3 -3
- package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +1 -1
- package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +4 -30
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +3 -11
- package/components/input/array/array-table.class.d.ts +4 -4
- package/components/input/base-input.component.d.ts +1 -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/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +1 -1
- package/components/input/custom/custom.component.d.ts +1 -1
- package/components/input/date/date-input/date-input.component.d.ts +1 -1
- package/components/input/date/date-range-input/date-range-input.component.d.ts +1 -1
- package/components/input/date/date-time-input/date-time-input.component.d.ts +1 -1
- package/components/input/file/file-default-input/file-default-input.component.d.ts +1 -1
- package/components/input/file/file-image-input/file-image-input.component.d.ts +1 -1
- package/components/input/file/file-input/dragDrop.directive.d.ts +1 -1
- package/components/input/file/file-input/file-input.component.d.ts +1 -1
- package/components/input/input.component.d.ts +1 -1
- package/components/input/input.module.d.ts +20 -19
- package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +1 -1
- package/components/input/number/number-input/number-input.component.d.ts +1 -1
- package/components/input/number/number-slider-input/number-slider-input.component.d.ts +1 -1
- package/components/input/relations/references-many-input/references-many-input.component.d.ts +27 -0
- package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +1 -1
- package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +1 -1
- package/components/input/string/string-input/string-input.component.d.ts +1 -1
- package/components/input/string/string-password-input/string-password-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-entity-dialog.component.d.ts +1 -1
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +1 -1
- package/components/table/table.component.d.ts +1 -1
- package/decorators/array/array-decorator-internal.data.d.ts +10 -10
- package/decorators/array/array-decorator.data.d.ts +5 -18
- package/decorators/base/decorator-types.enum.d.ts +3 -1
- package/decorators/file/file-decorator-internal.data.d.ts +0 -2
- package/decorators/file/file-decorator.data.d.ts +0 -7
- package/decorators/number/number-decorator-internal.data.d.ts +3 -3
- package/decorators/number/number-decorator.data.d.ts +3 -3
- package/decorators/references-many/references-many-decorator-internal.data.d.ts +20 -0
- package/decorators/references-many/references-many-decorator.data.d.ts +56 -0
- package/decorators/references-many/references-many.decorator.d.ts +9 -0
- package/esm2020/classes/entity.utilities.mjs +13 -3
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +3 -3
- package/esm2020/components/confirm-dialog/confirm-dialog.module.mjs +4 -4
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +7 -7
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +5 -5
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +7 -7
- package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +14 -59
- package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +10 -18
- package/esm2020/components/input/array/array-table.class.mjs +7 -7
- package/esm2020/components/input/base-input.component.mjs +3 -3
- package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +7 -7
- package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +3 -3
- package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +7 -7
- package/esm2020/components/input/custom/custom.component.mjs +3 -3
- package/esm2020/components/input/date/date-input/date-input.component.mjs +7 -7
- package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +5 -5
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +7 -7
- package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +3 -3
- package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +3 -3
- package/esm2020/components/input/file/file-input/dragDrop.directive.mjs +3 -3
- package/esm2020/components/input/file/file-input/file-input.component.mjs +10 -6
- package/esm2020/components/input/input.component.mjs +7 -6
- package/esm2020/components/input/input.module.mjs +35 -32
- package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +3 -3
- package/esm2020/components/input/number/number-input/number-input.component.mjs +5 -5
- package/esm2020/components/input/number/number-slider-input/number-slider-input.component.mjs +7 -7
- package/esm2020/components/input/relations/references-many-input/references-many-input.component.mjs +86 -0
- package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +5 -5
- package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +3 -3
- package/esm2020/components/input/string/string-input/string-input.component.mjs +5 -5
- package/esm2020/components/input/string/string-password-input/string-password-input.component.mjs +7 -7
- package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +5 -5
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +5 -5
- package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +4 -4
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +5 -5
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.module.mjs +4 -4
- package/esm2020/components/table/table.component.mjs +5 -5
- package/esm2020/components/table/table.module.mjs +4 -4
- package/esm2020/decorators/array/array-decorator-internal.data.mjs +2 -2
- package/esm2020/decorators/array/array-decorator.data.mjs +1 -1
- package/esm2020/decorators/base/decorator-types.enum.mjs +2 -1
- package/esm2020/decorators/file/file-decorator-internal.data.mjs +1 -3
- package/esm2020/decorators/file/file-decorator.data.mjs +1 -1
- package/esm2020/decorators/number/number-decorator-internal.data.mjs +3 -3
- package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
- package/esm2020/decorators/references-many/references-many-decorator-internal.data.mjs +30 -0
- package/esm2020/decorators/references-many/references-many-decorator.data.mjs +2 -0
- package/esm2020/decorators/references-many/references-many.decorator.mjs +13 -0
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/ngx-material-entity.mjs +650 -570
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +628 -556
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/package.json +7 -7
- package/public-api.d.ts +2 -0
|
@@ -5,6 +5,7 @@ import { DateRangeDateDecoratorConfigInternal, DateTimeDateDecoratorConfigIntern
|
|
|
5
5
|
import { DefaultFileDecoratorConfigInternal, ImageFileDecoratorConfigInternal } from '../file/file-decorator-internal.data';
|
|
6
6
|
import { DefaultNumberDecoratorConfigInternal, DropdownNumberDecoratorConfigInternal, SliderNumberDecoratorConfigInternal } from '../number/number-decorator-internal.data';
|
|
7
7
|
import { DefaultObjectDecoratorConfigInternal } from '../object/object-decorator-internal.data';
|
|
8
|
+
import { ReferencesManyDecoratorConfigInternal } from '../references-many/references-many-decorator-internal.data';
|
|
8
9
|
import { AutocompleteStringDecoratorConfigInternal, DefaultStringDecoratorConfigInternal, DropdownStringDecoratorConfigInternal, PasswordStringDecoratorConfigInternal, TextboxStringDecoratorConfigInternal } from '../string/string-decorator-internal.data';
|
|
9
10
|
/**
|
|
10
11
|
* The enum Values for all the different DecoratorTypes.
|
|
@@ -33,9 +34,10 @@ export declare enum DecoratorTypes {
|
|
|
33
34
|
DATE_TIME = "dateTime",
|
|
34
35
|
FILE_DEFAULT = "fileDefault",
|
|
35
36
|
FILE_IMAGE = "fileImage",
|
|
37
|
+
REFERENCES_MANY = "referencesMany",
|
|
36
38
|
CUSTOM = "custom"
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* Gives the metadata-config Type based on the DecoratorTypes enum.
|
|
40
42
|
*/
|
|
41
|
-
export declare 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.CUSTOM ? CustomDecoratorConfigInternal<any, any, CustomMetadataType, any> : never;
|
|
43
|
+
export declare 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.CUSTOM ? CustomDecoratorConfigInternal<any, any, CustomMetadataType, any> : never;
|
|
@@ -70,7 +70,6 @@ export declare class DefaultFileDecoratorConfigInternal extends PropertyDecorato
|
|
|
70
70
|
maxSizeErrorDialog: ConfirmDialogData;
|
|
71
71
|
maxSizeTotalErrorDialog: ConfirmDialogData;
|
|
72
72
|
dragAndDrop: boolean;
|
|
73
|
-
downloadAllButtonLabel: string;
|
|
74
73
|
constructor(data: DefaultFileDecoratorConfig);
|
|
75
74
|
}
|
|
76
75
|
/**
|
|
@@ -89,6 +88,5 @@ export declare class ImageFileDecoratorConfigInternal extends PropertyDecoratorC
|
|
|
89
88
|
maxSizeErrorDialog: ConfirmDialogData;
|
|
90
89
|
maxSizeTotalErrorDialog: ConfirmDialogData;
|
|
91
90
|
dragAndDrop: boolean;
|
|
92
|
-
downloadAllButtonLabel: string;
|
|
93
91
|
constructor(data: ImageFileDecoratorConfig);
|
|
94
92
|
}
|
|
@@ -66,13 +66,6 @@ declare abstract class FileDecoratorConfig extends PropertyDecoratorConfig {
|
|
|
66
66
|
* false // when multiple is set to false.
|
|
67
67
|
*/
|
|
68
68
|
dragAndDrop?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* The label of the button to download all files.
|
|
71
|
-
* Is only shown when the property contains multiple files.
|
|
72
|
-
*
|
|
73
|
-
* @default 'Download All'
|
|
74
|
-
*/
|
|
75
|
-
downloadAllButtonLabel?: string;
|
|
76
69
|
}
|
|
77
70
|
/**
|
|
78
71
|
* Definition for a default file.
|
|
@@ -26,8 +26,8 @@ export declare class SliderNumberDecoratorConfigInternal extends PropertyDecorat
|
|
|
26
26
|
min?: number;
|
|
27
27
|
max?: number;
|
|
28
28
|
step?: number;
|
|
29
|
-
formatThumbLabelValue: (value: number) => string
|
|
30
|
-
|
|
29
|
+
formatThumbLabelValue: (value: number) => string;
|
|
30
|
+
showTickMarks?: boolean;
|
|
31
31
|
constructor(data: SliderNumberDecoratorConfig);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -36,4 +36,4 @@ export declare class SliderNumberDecoratorConfigInternal extends PropertyDecorat
|
|
|
36
36
|
* @param value - The value of the slider.
|
|
37
37
|
* @returns Just the value without any formatting done.
|
|
38
38
|
*/
|
|
39
|
-
export declare function defaultFormatThumbLabelValue(value: number):
|
|
39
|
+
export declare function defaultFormatThumbLabelValue(value: number): string;
|
|
@@ -53,10 +53,10 @@ export interface SliderNumberDecoratorConfig extends NumberDecoratorConfig {
|
|
|
53
53
|
/**
|
|
54
54
|
* Function that transforms the value to display inside the thumb label.
|
|
55
55
|
*/
|
|
56
|
-
formatThumbLabelValue?: (value: number) => string
|
|
56
|
+
formatThumbLabelValue?: (value: number) => string;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Whether or not ticks should be displayed.
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
showTickMarks?: boolean;
|
|
61
61
|
}
|
|
62
62
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
2
|
+
import { DisplayColumn } from '../../components/table/table-data';
|
|
3
|
+
import { DropdownValue } from '../base/dropdown-value.interface';
|
|
4
|
+
import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
|
|
5
|
+
import { ReferencesManyDecoratorConfig } from './references-many-decorator.data';
|
|
6
|
+
/**
|
|
7
|
+
* The internal DefaultNumberDecoratorConfig. Sets default values.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ReferencesManyDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfigInternal implements ReferencesManyDecoratorConfig<EntityType> {
|
|
10
|
+
getReferencedEntities: () => Promise<EntityType[]>;
|
|
11
|
+
getDropdownValues: (referencedEntities: EntityType[]) => DropdownValue<string>[];
|
|
12
|
+
getEntityForId: (entityId: string, allReferencedEntities: EntityType[]) => EntityType;
|
|
13
|
+
displayColumns: DisplayColumn<EntityType>[];
|
|
14
|
+
addButtonLabel: string;
|
|
15
|
+
removeButtonLabel: string;
|
|
16
|
+
dropdownLabel: string;
|
|
17
|
+
addAll: boolean;
|
|
18
|
+
addAllButtonLabel: string;
|
|
19
|
+
constructor(data: ReferencesManyDecoratorConfig<EntityType>);
|
|
20
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
2
|
+
import { DisplayColumn } from '../../components/table/table-data';
|
|
3
|
+
import { DropdownValue } from '../base/dropdown-value.interface';
|
|
4
|
+
import { PropertyDecoratorConfig } from '../base/property-decorator.data';
|
|
5
|
+
/**
|
|
6
|
+
* Definition for the @referencesMany metadata.
|
|
7
|
+
*/
|
|
8
|
+
export interface ReferencesManyDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends PropertyDecoratorConfig {
|
|
9
|
+
/**
|
|
10
|
+
* The function that returns the values that can be referenced.
|
|
11
|
+
*/
|
|
12
|
+
getReferencedEntities: () => Promise<EntityType[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Method to get the referenced dropdown values.
|
|
15
|
+
*/
|
|
16
|
+
getDropdownValues: (referencedEntities: EntityType[]) => DropdownValue<string>[];
|
|
17
|
+
/**
|
|
18
|
+
* Gets the referenced entity for the given id.
|
|
19
|
+
*/
|
|
20
|
+
getEntityForId?: (entityId: string, allReferencedEntities: EntityType[]) => EntityType;
|
|
21
|
+
/**
|
|
22
|
+
* The definition of the columns to display. Consists of the displayName to show in the header of the row
|
|
23
|
+
* and the value, which is a function that generates the value to display inside a column.
|
|
24
|
+
*/
|
|
25
|
+
displayColumns: DisplayColumn<EntityType>[];
|
|
26
|
+
/**
|
|
27
|
+
* The label for the dropdown input.
|
|
28
|
+
*
|
|
29
|
+
* @default 'Select'
|
|
30
|
+
*/
|
|
31
|
+
dropdownLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether or not a button that adds all values exists.
|
|
34
|
+
*
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
addAll?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The label for the add all button.
|
|
40
|
+
*
|
|
41
|
+
* @default 'Add all'
|
|
42
|
+
*/
|
|
43
|
+
addAllButtonLabel?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The label for the add button when createInline is true.
|
|
46
|
+
*
|
|
47
|
+
* @default 'Add'
|
|
48
|
+
*/
|
|
49
|
+
addButtonLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The label for the remove button when createInline is true.
|
|
52
|
+
*
|
|
53
|
+
* @default 'Remove'
|
|
54
|
+
*/
|
|
55
|
+
removeButtonLabel?: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
2
|
+
import { ReferencesManyDecoratorConfig } from './references-many-decorator.data';
|
|
3
|
+
/**
|
|
4
|
+
* Decorator for setting and getting references many property metadata.
|
|
5
|
+
*
|
|
6
|
+
* @param metadata - The metadata of the references many property.
|
|
7
|
+
* @returns The method that defines the metadata.
|
|
8
|
+
*/
|
|
9
|
+
export declare function referencesMany<EntityType extends BaseEntityType<EntityType>>(metadata: ReferencesManyDecoratorConfig<EntityType>): (target: object, propertyKey: string) => void;
|