ngx-material-entity 16.0.5 → 16.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/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 +40 -35
- package/fesm2022/ngx-material-entity.mjs +1309 -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 +0 -3
- package/esm2022/components/table/create-dialog/create-dialog-data.builder.mjs +0 -44
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Gets either the provided value or the default value, depending on if and what has been provided.
|
|
3
|
-
*
|
|
4
3
|
* @param defaultValue - The default value to fallback when nothing has been provided.
|
|
5
4
|
* @param value - The specific value configured by the user.
|
|
6
5
|
* @returns Value if it is not null and not the CONFIG_NEEDS_UPDATE_KEY, defaultValue otherwise.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { ValidationError } from '../utilities/validation.utilities';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Provider for the validation errors tooltip title.
|
|
5
|
+
*/
|
|
6
|
+
export declare const NgxValidationErrorsTooltipTitle: InjectionToken<string>;
|
|
4
7
|
/**
|
|
5
8
|
* The default function that gets the validation errors tooltip content.
|
|
6
|
-
*
|
|
7
9
|
* @param validationErrors - All validation errors for which the tooltip content should be generated.
|
|
8
10
|
* @returns A html string, containing a list of the name of each invalid property.
|
|
9
11
|
*/
|
|
@@ -5,212 +5,187 @@ import { InjectionToken } from '@angular/core';
|
|
|
5
5
|
export interface NgxGlobalDefaultValues {
|
|
6
6
|
/**
|
|
7
7
|
* The label for create buttons.
|
|
8
|
-
*
|
|
9
8
|
* @default 'Create'
|
|
10
9
|
*/
|
|
11
10
|
createLabel: string;
|
|
12
11
|
/**
|
|
13
12
|
* The label for edit buttons.
|
|
14
|
-
*
|
|
15
13
|
* @default 'Edit'
|
|
16
14
|
*/
|
|
17
15
|
editLabel: string;
|
|
18
16
|
/**
|
|
19
17
|
* The label for save buttons.
|
|
20
|
-
*
|
|
21
18
|
* @default 'Save'
|
|
22
19
|
*/
|
|
23
20
|
saveLabel: string;
|
|
24
21
|
/**
|
|
25
22
|
* The label for cancel buttons.
|
|
26
|
-
*
|
|
27
23
|
* @default 'Cancel'
|
|
28
24
|
*/
|
|
29
25
|
cancelLabel: string;
|
|
30
26
|
/**
|
|
31
27
|
* The label for add buttons.
|
|
32
|
-
*
|
|
33
28
|
* @default 'Add'
|
|
34
29
|
*/
|
|
35
30
|
addLabel: string;
|
|
36
31
|
/**
|
|
37
32
|
* The label for delete buttons.
|
|
38
|
-
*
|
|
39
33
|
* @default 'Delete'
|
|
40
34
|
*/
|
|
41
35
|
deleteLabel: string;
|
|
42
36
|
/**
|
|
43
37
|
* The label for back buttons.
|
|
44
|
-
*
|
|
45
38
|
* @default 'Back'
|
|
46
39
|
*/
|
|
47
40
|
backLabel: string;
|
|
48
41
|
/**
|
|
49
42
|
* The label for actions.
|
|
50
|
-
*
|
|
51
43
|
* @default 'Actions'
|
|
52
44
|
*/
|
|
53
45
|
actionsLabel: string;
|
|
54
46
|
/**
|
|
55
47
|
* The label for searches.
|
|
56
|
-
*
|
|
57
48
|
* @default 'Search'
|
|
58
49
|
*/
|
|
59
50
|
searchLabel: string;
|
|
60
51
|
/**
|
|
61
52
|
* The display value for the "true" value in dropdowns.
|
|
62
|
-
*
|
|
63
53
|
* @default 'Yes'
|
|
64
54
|
*/
|
|
65
55
|
dropdownTrue: string;
|
|
66
56
|
/**
|
|
67
57
|
* The display value for the "false" value in dropdowns.
|
|
68
|
-
*
|
|
69
58
|
* @default 'No'
|
|
70
59
|
*/
|
|
71
60
|
dropdownFalse: string;
|
|
72
61
|
/**
|
|
73
62
|
* The label for confirm buttons.
|
|
74
|
-
*
|
|
75
63
|
* @default 'Confirm'
|
|
76
64
|
*/
|
|
77
65
|
confirmLabel: string;
|
|
78
66
|
/**
|
|
79
67
|
* The title for a confirm dialog.
|
|
80
|
-
*
|
|
81
68
|
* @default 'Confirmation'
|
|
82
69
|
*/
|
|
83
70
|
defaultConfirmDialogTitle: string;
|
|
84
71
|
/**
|
|
85
72
|
* The text for a confirm dialog.
|
|
86
|
-
*
|
|
87
73
|
* @default ['Do you really want to do this?']
|
|
88
74
|
*/
|
|
89
75
|
defaultConfirmDialogText: string[];
|
|
90
76
|
/**
|
|
91
77
|
* The text for confirming a save action.
|
|
92
|
-
*
|
|
93
78
|
* @default ['Do you really want to save all changes?']
|
|
94
79
|
*/
|
|
95
80
|
confirmSaveText: string[];
|
|
96
81
|
/**
|
|
97
82
|
* The text for confirming a delete action.
|
|
98
|
-
*
|
|
99
83
|
* @default ['Do you really want to delete this entity?']
|
|
100
84
|
*/
|
|
101
85
|
confirmDeleteText: string[];
|
|
102
86
|
/**
|
|
103
87
|
* The label for the button to leave without changes.
|
|
104
|
-
*
|
|
105
88
|
* @default 'Leave'
|
|
106
89
|
*/
|
|
107
90
|
confirmUnsavedChangesLabel: string;
|
|
108
91
|
/**
|
|
109
92
|
* The title for confirming to leave without changes.
|
|
110
|
-
*
|
|
111
93
|
* @default 'Unsaved Changes'
|
|
112
94
|
*/
|
|
113
95
|
confirmUnsavedChangesTitle: string;
|
|
114
96
|
/**
|
|
115
97
|
* The text for confirming to leave without changes.
|
|
116
|
-
*
|
|
117
98
|
* @default ['You have unsaved changes that will be deleted when you leave this page.', 'Continue?']
|
|
118
99
|
*/
|
|
119
100
|
confirmUnsavedChangesText: string[];
|
|
120
101
|
/**
|
|
121
102
|
* The title for the add array item dialog.
|
|
122
|
-
*
|
|
123
103
|
* @default 'Add to array'
|
|
124
104
|
*/
|
|
125
105
|
addArrayItemTitle: string;
|
|
126
106
|
/**
|
|
127
107
|
* The text for confirming a create action.
|
|
128
|
-
*
|
|
129
108
|
* @default ['Do you really want to create this entity?']
|
|
130
109
|
*/
|
|
131
110
|
confirmCreateText: string[];
|
|
132
111
|
/**
|
|
133
112
|
* The text for confirming a multi select action.
|
|
134
|
-
*
|
|
135
113
|
* @default selectedEntries => [`Do you really want to run this action on ${selectedEntries.length} entries?`]
|
|
136
114
|
*/
|
|
137
115
|
confirmMultiSelectActionText: (selectedEntries: unknown[]) => string[];
|
|
138
116
|
/**
|
|
139
117
|
* The text for confirming a base action.
|
|
140
|
-
*
|
|
141
118
|
* @default ['Do you really want to run this action?']
|
|
142
119
|
*/
|
|
143
120
|
confirmBaseActionText: string[];
|
|
144
121
|
/**
|
|
145
122
|
* The text for confirming the json import.
|
|
146
|
-
*
|
|
147
123
|
* @default ['Do you really want to import entities from the provided file?']
|
|
148
124
|
*/
|
|
149
125
|
confirmImportJsonText: string[];
|
|
150
126
|
/**
|
|
151
127
|
* How table entities are edited by default.
|
|
152
|
-
*
|
|
153
128
|
* @default 'dialog'
|
|
154
129
|
*/
|
|
155
130
|
defaultEditMethod: 'dialog' | 'page';
|
|
131
|
+
/**
|
|
132
|
+
* How table entities are created by default.
|
|
133
|
+
* @default 'dialog'
|
|
134
|
+
*/
|
|
135
|
+
defaultCreateMethod: 'dialog' | 'page';
|
|
156
136
|
/**
|
|
157
137
|
* The error message to display when an array property is required and empty.
|
|
138
|
+
* @default 'Needs to contain at least one value'
|
|
158
139
|
*/
|
|
159
140
|
emptyArrayErrorMessage: string;
|
|
160
141
|
/**
|
|
161
142
|
* The label for remove actions.
|
|
162
|
-
*
|
|
163
143
|
* @default 'Remove'
|
|
164
144
|
*/
|
|
165
145
|
removeLabel: string;
|
|
166
146
|
/**
|
|
167
147
|
* The label for time values.
|
|
168
148
|
* Mainly used inside date properties.
|
|
169
|
-
*
|
|
170
149
|
* @default 'Time'
|
|
171
150
|
*/
|
|
172
151
|
timeLabel: string;
|
|
173
152
|
/**
|
|
174
153
|
* The label for the date range start.
|
|
175
|
-
*
|
|
176
154
|
* @default 'Start'
|
|
177
155
|
*/
|
|
178
156
|
startLabel: string;
|
|
179
157
|
/**
|
|
180
158
|
* The label for the date range end.
|
|
181
|
-
*
|
|
182
159
|
* @default 'End'
|
|
183
160
|
*/
|
|
184
161
|
endLabel: string;
|
|
185
162
|
/**
|
|
186
163
|
* The error text for duplicate entries inside an array.
|
|
187
|
-
*
|
|
188
164
|
* @default ['Adding duplicate entries to the array is not allowed.']
|
|
189
165
|
*/
|
|
190
166
|
duplicateErrorText: string[];
|
|
191
167
|
/**
|
|
192
168
|
* The error title for duplicate entries inside an array.
|
|
193
|
-
*
|
|
194
169
|
* @default 'Error adding duplicate item'
|
|
195
170
|
*/
|
|
196
171
|
duplicateErrorTitle: string;
|
|
197
172
|
/**
|
|
198
173
|
* The title for editing an entities.
|
|
199
|
-
*
|
|
200
174
|
* @default () => 'Edit'
|
|
201
175
|
*/
|
|
202
176
|
editTitle: (entity: unknown) => string;
|
|
203
177
|
/**
|
|
204
178
|
* The label for an select action, eg. Dropdowns.
|
|
205
|
-
*
|
|
206
179
|
* @default 'Select'
|
|
207
180
|
*/
|
|
208
181
|
selectLabel: string;
|
|
209
182
|
/**
|
|
210
183
|
* The label for an "Add all" button.
|
|
211
|
-
*
|
|
212
184
|
* @default 'Add all'
|
|
213
185
|
*/
|
|
214
186
|
addAllLabel: string;
|
|
215
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* The provider for global configuration values.
|
|
190
|
+
*/
|
|
216
191
|
export declare const NGX_GLOBAL_DEFAULT_VALUES: InjectionToken<Partial<NgxGlobalDefaultValues>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const PLACEHOLDER: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-material-entity",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"crud",
|
|
9
9
|
"entity"
|
|
10
10
|
],
|
|
11
|
+
"type": "module",
|
|
11
12
|
"peerDependencies": {
|
|
12
13
|
"@angular/animations": "16",
|
|
13
14
|
"@angular/cdk": "16",
|
package/public-api.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
export * from './classes/entity.model';
|
|
5
5
|
export * from './components/confirm-dialog/confirm-dialog-data';
|
|
6
6
|
export * from './components/confirm-dialog/confirm-dialog.component';
|
|
7
|
+
export * from './components/create-page/create-data.route';
|
|
8
|
+
export * from './components/create-page/create-page.component';
|
|
7
9
|
export * from './components/edit-page/edit-data.route';
|
|
8
10
|
export * from './components/edit-page/edit-page.component';
|
|
9
11
|
export * from './components/input/base-input.component';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { EnvironmentInjector } from '@angular/core';
|
|
2
3
|
import { BehaviorSubject } from 'rxjs';
|
|
3
4
|
import { BaseEntityType } from '../classes/entity.model';
|
|
4
5
|
/**
|
|
@@ -9,6 +10,7 @@ import { BaseEntityType } from '../classes/entity.model';
|
|
|
9
10
|
*/
|
|
10
11
|
export declare abstract class EntityService<EntityType extends BaseEntityType<EntityType>> {
|
|
11
12
|
protected readonly http: HttpClient;
|
|
13
|
+
protected readonly injector: EnvironmentInjector;
|
|
12
14
|
/**
|
|
13
15
|
* The base url used for api requests. If u want to have more control over this,
|
|
14
16
|
* you can override the create, read, update and delete methods.
|
|
@@ -23,12 +25,15 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
23
25
|
*/
|
|
24
26
|
abstract readonly baseUrl: string;
|
|
25
27
|
/**
|
|
26
|
-
* The route segment that comes before the id when editing an entity in a separate page.
|
|
28
|
+
* The default route segment that comes before the id when editing an entity in a separate page, if no extra route has been provided.
|
|
27
29
|
*/
|
|
28
30
|
readonly editBaseRoute: string;
|
|
31
|
+
/**
|
|
32
|
+
* The complete route that is used to create an entity in a separate page, if no extra route has been provided.
|
|
33
|
+
*/
|
|
34
|
+
readonly createBaseRoute: string;
|
|
29
35
|
/**
|
|
30
36
|
* The key which holds the id value.
|
|
31
|
-
*
|
|
32
37
|
* @default 'id'
|
|
33
38
|
*/
|
|
34
39
|
readonly idKey: keyof EntityType;
|
|
@@ -42,21 +47,21 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
42
47
|
* you might send a lot of unnecessary requests.
|
|
43
48
|
* Therefore the findById method tries to look in the already existing entities first,
|
|
44
49
|
* IF the entities have been requested in the last READ_EXPIRATION_IN_MS milliseconds.
|
|
45
|
-
*
|
|
46
50
|
* @default 900000 (5 minutes)
|
|
47
51
|
*/
|
|
48
52
|
protected readonly READ_EXPIRATION_IN_MS: number;
|
|
49
53
|
/**
|
|
50
54
|
* Gets the entities in an array from the internal entitiesSubject.
|
|
51
|
-
*
|
|
52
55
|
* @returns The current entities in form of an array.
|
|
53
56
|
*/
|
|
54
57
|
get entities(): EntityType[];
|
|
58
|
+
/**
|
|
59
|
+
* The last time that the entities have been requested from the api.
|
|
60
|
+
*/
|
|
55
61
|
lastRead?: Date;
|
|
56
|
-
constructor(http: HttpClient);
|
|
62
|
+
constructor(http: HttpClient, injector: EnvironmentInjector);
|
|
57
63
|
/**
|
|
58
64
|
* Creates a new Entity and pushes it to the entities array.
|
|
59
|
-
*
|
|
60
65
|
* @param entity - The data of the entity to create.
|
|
61
66
|
* All values that should be omitted will be removed from it inside this method.
|
|
62
67
|
* @param baseUrl - The base url to send the post request to.
|
|
@@ -66,7 +71,6 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
66
71
|
create(entity: EntityType, baseUrl?: string): Promise<EntityType>;
|
|
67
72
|
/**
|
|
68
73
|
* Imports everything from the provided json file.
|
|
69
|
-
*
|
|
70
74
|
* @param file - The json file to import from.
|
|
71
75
|
* @returns All entities that have been imported.
|
|
72
76
|
*/
|
|
@@ -75,7 +79,6 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
75
79
|
* Creates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
76
80
|
* All file values are stored inside their respective property key and their name.
|
|
77
81
|
* Form data is able to handle setting multiple files to the same key.
|
|
78
|
-
*
|
|
79
82
|
* @param body - The body Of the request.
|
|
80
83
|
* @param filePropertyKeys - All property keys that are files and need to be added to the form data.
|
|
81
84
|
* @param entity - The entity to create. This is needed in addition to the body because the body doesn't contain any metadata.
|
|
@@ -86,7 +89,6 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
86
89
|
protected createWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType, baseUrl?: string): Promise<EntityType>;
|
|
87
90
|
/**
|
|
88
91
|
* Creates the entity with a normal json body in contrast to creating it with form data when the entity contains files.
|
|
89
|
-
*
|
|
90
92
|
* @param body - The body Of the request.
|
|
91
93
|
* @param baseUrl - The base url to send the post request to.
|
|
92
94
|
* This can be used if you want to create an entity belonging to another, like "customers/{id}/invoices".
|
|
@@ -95,21 +97,18 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
95
97
|
protected createWithJson(body: Partial<EntityType>, baseUrl?: string): Promise<EntityType>;
|
|
96
98
|
/**
|
|
97
99
|
* Gets all existing entities and pushes them to the entities array.
|
|
98
|
-
*
|
|
99
100
|
* @param baseUrl - The base url for the request. Defaults to the baseUrl on the service.
|
|
100
101
|
* @returns A Promise of all received Entities.
|
|
101
102
|
*/
|
|
102
103
|
read(baseUrl?: string): Promise<EntityType[]>;
|
|
103
104
|
/**
|
|
104
105
|
* Tries to find an entity with the given id.
|
|
105
|
-
*
|
|
106
106
|
* @param id - The id of the entity to find.
|
|
107
107
|
* @returns The found entity.
|
|
108
108
|
*/
|
|
109
109
|
findById(id: EntityType[keyof EntityType]): Promise<EntityType>;
|
|
110
110
|
/**
|
|
111
111
|
* Updates a specific Entity.
|
|
112
|
-
*
|
|
113
112
|
* @param entity - The updated Entity
|
|
114
113
|
* All values that should be omitted will be removed from it inside this method.
|
|
115
114
|
* @param entityPriorChanges - The current Entity.
|
|
@@ -118,7 +117,6 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
118
117
|
update(entity: EntityType, entityPriorChanges: EntityType): Promise<void>;
|
|
119
118
|
/**
|
|
120
119
|
* Builds the update request body from the given entity before and after its changes.
|
|
121
|
-
*
|
|
122
120
|
* @param entity - The entity with changed values.
|
|
123
121
|
* @param entityPriorChanges - The entity before any changes.
|
|
124
122
|
* @returns A partial of only the changed values.
|
|
@@ -128,7 +126,6 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
128
126
|
* Updates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
129
127
|
* All file values are stored inside their respective property key and their name.
|
|
130
128
|
* Form data is able to handle setting multiple files to the same key.
|
|
131
|
-
*
|
|
132
129
|
* @param body - The request body. Already contains only properties that have changed.
|
|
133
130
|
* @param filePropertyKeys - The keys of all properties which are files and need to separately be appended to the form data.
|
|
134
131
|
* @param entity - The original entity. Is needed to get the metadata of all the files.
|
|
@@ -137,14 +134,12 @@ export declare abstract class EntityService<EntityType extends BaseEntityType<En
|
|
|
137
134
|
protected updateWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType, id: EntityType[keyof EntityType]): Promise<void>;
|
|
138
135
|
/**
|
|
139
136
|
* Updates the entity with a normal json body in contrast to updating it with form data when the entity contains files.
|
|
140
|
-
*
|
|
141
137
|
* @param body - The body of the Request. Has already removed all unnecessary values.
|
|
142
138
|
* @param id - The id of the entity to update.
|
|
143
139
|
*/
|
|
144
140
|
protected updateWithJson(body: Partial<EntityType>, id: EntityType[keyof EntityType]): Promise<void>;
|
|
145
141
|
/**
|
|
146
142
|
* Deletes a specific Entity.
|
|
147
|
-
*
|
|
148
143
|
* @param entity - The entity to delete.
|
|
149
144
|
*/
|
|
150
145
|
delete(entity: EntityType): Promise<void>;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { UrlTree } from '@angular/router';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { NgxMatEntityCreatePageComponent } from '../components/create-page/create-page.component';
|
|
3
4
|
import { NgxMatEntityEditPageComponent } from '../components/edit-page/edit-page.component';
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Can be either an edit or an create page.
|
|
7
|
+
*/
|
|
8
|
+
type PageComponent = NgxMatEntityEditPageComponent<any> | NgxMatEntityCreatePageComponent<any>;
|
|
9
|
+
/**
|
|
10
|
+
* A guard that checks if the user has unsaved changes and then prompts a confirmation from him.
|
|
11
|
+
* Is used by the ngx-material-entity edit and create pages.
|
|
12
|
+
* @param component - The component, can be either an edit or create page.
|
|
13
|
+
* @returns An observable containing whether or not the user can continue.
|
|
14
|
+
*/
|
|
15
|
+
export declare function UnsavedChangesGuard(component: PageComponent): Observable<boolean | UrlTree>;
|
|
16
|
+
export {};
|
|
@@ -15,14 +15,12 @@ export declare abstract class DateUtilities {
|
|
|
15
15
|
static defaultDateFilter: DateFilterFn<Date | null | undefined>;
|
|
16
16
|
/**
|
|
17
17
|
* Gets the given value as a date value.
|
|
18
|
-
*
|
|
19
18
|
* @param value - The value to get as a date.
|
|
20
19
|
* @returns The given value as a date.
|
|
21
20
|
*/
|
|
22
21
|
static asDate(value: unknown): Date;
|
|
23
22
|
/**
|
|
24
23
|
* Gets the default times used by the DateTime picker when nothing is specified by the user.
|
|
25
|
-
*
|
|
26
24
|
* @param format - The time format. Defaults to 24.
|
|
27
25
|
* @param minuteSteps - The steps from one time value to the next. Defaults to 30.
|
|
28
26
|
* @returns Times in the 24 hour format from 0:00 until 23:30 in 30 minute steps.
|
|
@@ -33,14 +31,12 @@ export declare abstract class DateUtilities {
|
|
|
33
31
|
private static getFormattedMinute;
|
|
34
32
|
/**
|
|
35
33
|
* Gets the Time object from the given date.
|
|
36
|
-
*
|
|
37
34
|
* @param value - The date to get the time object from.
|
|
38
35
|
* @returns The Time object build from the date value.
|
|
39
36
|
*/
|
|
40
37
|
static getTimeFromDate(value?: Date): Time | undefined;
|
|
41
38
|
/**
|
|
42
39
|
* Gets the dates between the two given gates. Does additional filtering based on the provided DateRange metadata.
|
|
43
|
-
*
|
|
44
40
|
* @param startDate - The start date.
|
|
45
41
|
* @param endDate - The end date.
|
|
46
42
|
* @param filter - The custom filter from the metadata.
|
|
@@ -49,7 +45,6 @@ export declare abstract class DateUtilities {
|
|
|
49
45
|
static getDatesBetween(startDate: Date, endDate: Date, filter?: DateFilterFn<Date>): Date[];
|
|
50
46
|
/**
|
|
51
47
|
* Get all valid times for the dropdown of a datetime property.
|
|
52
|
-
*
|
|
53
48
|
* @param times - All given times to filter.
|
|
54
49
|
* @param date - The date of the datetime.
|
|
55
50
|
* @param min - The function that defines the minimum time.
|
|
@@ -61,7 +56,6 @@ export declare abstract class DateUtilities {
|
|
|
61
56
|
/**
|
|
62
57
|
* Checks if the time object has processable hours and minutes properties.
|
|
63
58
|
* Doesn't check custom validators like min/max from the metadata configuration.
|
|
64
|
-
*
|
|
65
59
|
* @param time - The time to check.
|
|
66
60
|
* @returns Whether or not the time object is unprocessable.
|
|
67
61
|
*/
|