ngx-material-entity 0.1.3 → 1.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 +914 -336
- package/capsulation/lodash.utilities.d.ts +62 -0
- package/capsulation/reflect.utilities.d.ts +56 -0
- package/classes/{base-builder.class.d.ts → base.builder.d.ts} +2 -1
- package/classes/date.utilities.d.ts +70 -0
- package/classes/entity.model.d.ts +20 -0
- package/classes/entity.service.d.ts +108 -0
- package/classes/{entity-utilities.class.d.ts → entity.utilities.d.ts} +52 -16
- package/classes/file.utilities.d.ts +52 -0
- package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +1 -1
- package/components/input/add-array-item-dialog-data.builder.d.ts +4 -4
- package/components/input/add-array-item-dialog-data.d.ts +2 -2
- package/components/input/array/array-date-input/array-date-input.component.d.ts +11 -0
- package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +20 -0
- package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +22 -0
- package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +51 -0
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +44 -0
- package/components/input/array/array-table.class.d.ts +49 -0
- package/components/input/base-input.component.d.ts +31 -0
- package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +10 -0
- package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +9 -0
- package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +10 -0
- package/components/input/custom/custom.component.d.ts +13 -0
- package/components/input/date/date-input/date-input.component.d.ts +13 -0
- package/components/input/date/date-range-input/date-range-input.component.d.ts +20 -0
- package/components/input/date/date-time-input/date-time-input.component.d.ts +31 -0
- package/components/input/file/file-default-input/file-default-input.component.d.ts +13 -0
- package/components/input/file/file-image-input/file-image-input.component.d.ts +22 -0
- package/components/input/file/file-input/dragDrop.directive.d.ts +32 -0
- package/components/input/file/file-input/file-input.component.d.ts +32 -0
- package/components/input/input.component.d.ts +49 -73
- package/components/input/input.module.d.ts +38 -15
- package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +9 -0
- package/components/input/number/number-input/number-input.component.d.ts +9 -0
- package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +18 -0
- package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +9 -0
- package/components/input/string/string-input/string-input.component.d.ts +9 -0
- package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +9 -0
- package/components/table/create-dialog/create-dialog-data.builder.d.ts +1 -1
- package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +5 -5
- package/components/table/create-dialog/create-entity-dialog-data.d.ts +3 -3
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +9 -5
- package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +4 -4
- package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +3 -3
- package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +5 -5
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +7 -5
- package/components/table/table-data.builder.d.ts +9 -9
- package/components/table/table-data.d.ts +8 -8
- package/components/table/table.component.d.ts +2 -2
- package/decorators/array/array-decorator-internal.data.d.ts +72 -7
- package/decorators/array/array-decorator.data.d.ts +179 -13
- package/decorators/array/array.decorator.d.ts +3 -3
- package/decorators/base/base-property.decorator.d.ts +2 -3
- package/decorators/base/decorator-types.enum.d.ts +15 -4
- package/decorators/base/dropdown-value.interface.d.ts +14 -0
- package/decorators/custom/custom-decorator-internal.data.d.ts +17 -0
- package/decorators/custom/custom-decorator.data.d.ts +33 -0
- package/decorators/custom/custom.decorator.d.ts +11 -0
- package/decorators/date/date-decorator-internal.data.d.ts +44 -0
- package/decorators/date/date-decorator.data.d.ts +129 -0
- package/decorators/date/date.decorator.d.ts +8 -0
- package/decorators/file/file-decorator-internal.data.d.ts +92 -0
- package/decorators/file/file-decorator.data.d.ts +92 -0
- package/decorators/file/file.decorator.d.ts +9 -0
- package/decorators/number/number-decorator-internal.data.d.ts +2 -4
- package/decorators/number/number-decorator.data.d.ts +2 -4
- package/decorators/number/number.decorator.d.ts +2 -2
- package/decorators/object/object-decorator-internal.data.d.ts +3 -3
- package/decorators/object/object-decorator.data.d.ts +5 -5
- package/decorators/object/object.decorator.d.ts +2 -2
- package/decorators/string/string-decorator-internal.data.d.ts +2 -4
- package/decorators/string/string-decorator.data.d.ts +2 -4
- package/esm2020/capsulation/lodash.utilities.mjs +75 -0
- package/esm2020/capsulation/reflect.utilities.mjs +69 -0
- package/esm2020/classes/base.builder.mjs +42 -0
- package/esm2020/classes/date.utilities.mjs +158 -0
- package/esm2020/classes/entity.model.mjs +23 -0
- package/esm2020/classes/entity.service.mjs +180 -0
- package/esm2020/classes/entity.utilities.mjs +686 -0
- package/esm2020/classes/file.utilities.mjs +123 -0
- package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +5 -5
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +3 -3
- package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +4 -4
- package/esm2020/components/input/add-array-item-dialog-data.mjs +1 -1
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +26 -0
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +50 -0
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +50 -0
- package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +119 -0
- package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +104 -0
- package/esm2020/components/input/array/array-table.class.mjs +107 -0
- package/esm2020/components/input/base-input.component.mjs +39 -0
- package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +23 -0
- package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +17 -0
- package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +23 -0
- package/esm2020/components/input/custom/custom.component.mjs +25 -0
- package/esm2020/components/input/date/date-input/date-input.component.mjs +23 -0
- package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +51 -0
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +63 -0
- package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +24 -0
- package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +79 -0
- package/esm2020/components/input/file/file-input/dragDrop.directive.mjs +64 -0
- package/esm2020/components/input/file/file-input/file-input.component.mjs +152 -0
- package/esm2020/components/input/input.component.mjs +143 -179
- package/esm2020/components/input/input.module.mjs +76 -6
- package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +18 -0
- package/esm2020/components/input/number/number-input/number-input.component.mjs +16 -0
- package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +37 -0
- package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +18 -0
- package/esm2020/components/input/string/string-input/string-input.component.mjs +16 -0
- package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +17 -0
- package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +3 -3
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +2 -2
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +16 -9
- package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +3 -3
- package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +3 -3
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +19 -11
- package/esm2020/components/table/table-data.builder.mjs +4 -4
- package/esm2020/components/table/table-data.mjs +1 -1
- package/esm2020/components/table/table.component.mjs +21 -23
- package/esm2020/decorators/array/array-decorator-internal.data.mjs +102 -14
- package/esm2020/decorators/array/array-decorator.data.mjs +2 -2
- package/esm2020/decorators/array/array.decorator.mjs +8 -2
- package/esm2020/decorators/base/base-property.decorator.mjs +4 -3
- package/esm2020/decorators/base/decorator-types.enum.mjs +10 -1
- package/esm2020/decorators/base/dropdown-value.interface.mjs +2 -0
- package/esm2020/decorators/base/property-decorator-internal.data.mjs +10 -10
- package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
- package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +3 -3
- package/esm2020/decorators/custom/custom-decorator-internal.data.mjs +26 -0
- package/esm2020/decorators/custom/custom-decorator.data.mjs +2 -0
- package/esm2020/decorators/custom/custom.decorator.mjs +13 -0
- package/esm2020/decorators/date/date-decorator-internal.data.mjs +48 -0
- package/esm2020/decorators/date/date-decorator.data.mjs +7 -0
- package/esm2020/decorators/date/date.decorator.mjs +21 -0
- package/esm2020/decorators/file/file-decorator-internal.data.mjs +98 -0
- package/esm2020/decorators/file/file-decorator.data.mjs +7 -0
- package/esm2020/decorators/file/file.decorator.mjs +22 -0
- package/esm2020/decorators/number/number-decorator-internal.data.mjs +1 -1
- package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
- package/esm2020/decorators/number/number.decorator.mjs +3 -3
- package/esm2020/decorators/object/object-decorator-internal.data.mjs +2 -2
- package/esm2020/decorators/object/object-decorator.data.mjs +1 -1
- package/esm2020/decorators/object/object.decorator.mjs +1 -1
- package/esm2020/decorators/string/string-decorator-internal.data.mjs +1 -1
- package/esm2020/decorators/string/string-decorator.data.mjs +1 -1
- package/esm2020/decorators/string/string.decorator.mjs +1 -1
- package/esm2020/mocks/placeholder-data.png.mjs +3 -0
- package/esm2020/public-api.mjs +15 -5
- package/fesm2015/ngx-material-entity.mjs +2649 -422
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +2537 -397
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/mocks/placeholder-data.png.d.ts +1 -0
- package/package.json +7 -1
- package/public-api.d.ts +15 -4
- package/classes/entity-model.class.d.ts +0 -9
- package/classes/entity-service.class.d.ts +0 -66
- package/esm2020/classes/base-builder.class.mjs +0 -43
- package/esm2020/classes/entity-model.class.mjs +0 -19
- package/esm2020/classes/entity-service.class.mjs +0 -76
- package/esm2020/classes/entity-utilities.class.mjs +0 -377
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { Entity } from '../../classes/entity-model.class';
|
|
2
1
|
import { CreateDialogData } from '../../components/table/table-data';
|
|
2
|
+
import { BaseEntityType, EntityClassNewable } from '../../classes/entity.model';
|
|
3
3
|
import { DecoratorTypes } from '../base/decorator-types.enum';
|
|
4
4
|
import { PropertyDecoratorConfig } from '../base/property-decorator.data';
|
|
5
|
+
import { DateFilterFn } from '@angular/material/datepicker';
|
|
6
|
+
import { Time } from '@angular/common';
|
|
7
|
+
import { DropdownValue } from '../base/dropdown-value.interface';
|
|
8
|
+
import { DateRange } from '../date/date-decorator.data';
|
|
9
|
+
import { ConfirmDialogData } from '../../components/confirm-dialog/confirm-dialog-data';
|
|
5
10
|
/**
|
|
6
11
|
* The configuration options for an array property displayed as a table.
|
|
7
12
|
*/
|
|
8
|
-
export interface ArrayTableDisplayColumn<EntityType extends
|
|
13
|
+
export interface ArrayTableDisplayColumn<EntityType extends BaseEntityType<EntityType>> {
|
|
9
14
|
/**
|
|
10
15
|
* The name inside the header.
|
|
11
16
|
*/
|
|
@@ -18,26 +23,31 @@ export interface ArrayTableDisplayColumn<EntityType extends Entity> {
|
|
|
18
23
|
/**
|
|
19
24
|
* Interface definition for the @array metadata.
|
|
20
25
|
*/
|
|
21
|
-
declare abstract class ArrayDecoratorConfig extends PropertyDecoratorConfig {
|
|
22
|
-
/**
|
|
23
|
-
* How to display the string.
|
|
24
|
-
*/
|
|
25
|
-
displayStyle: 'table' | 'chips';
|
|
26
|
+
export declare abstract class ArrayDecoratorConfig extends PropertyDecoratorConfig {
|
|
26
27
|
/**
|
|
27
28
|
* The type of the items inside the array.
|
|
28
29
|
*/
|
|
29
30
|
itemType: DecoratorTypes;
|
|
31
|
+
/**
|
|
32
|
+
* Whether or not duplicate values are allowed inside the array.
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
allowDuplicates?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The error dialog to display when the user tries to add a duplicate entry.
|
|
39
|
+
*/
|
|
40
|
+
duplicatesErrorDialog?: ConfirmDialogData;
|
|
30
41
|
}
|
|
31
42
|
/**
|
|
32
43
|
* Definition for an array of Entities.
|
|
33
44
|
*/
|
|
34
|
-
export interface EntityArrayDecoratorConfig<EntityType extends
|
|
45
|
+
export interface EntityArrayDecoratorConfig<EntityType extends BaseEntityType<EntityType>> extends ArrayDecoratorConfig {
|
|
35
46
|
itemType: DecoratorTypes.OBJECT;
|
|
36
|
-
displayStyle: 'table';
|
|
37
47
|
/**
|
|
38
48
|
* The EntityClass used for generating the create inputs.
|
|
39
49
|
*/
|
|
40
|
-
EntityClass:
|
|
50
|
+
EntityClass: EntityClassNewable<EntityType>;
|
|
41
51
|
/**
|
|
42
52
|
* The definition of the columns to display. Consists of the displayName to show in the header of the row
|
|
43
53
|
* and the value, which is a function that generates the value to display inside a column.
|
|
@@ -72,12 +82,170 @@ export interface EntityArrayDecoratorConfig<EntityType extends Entity> extends A
|
|
|
72
82
|
*/
|
|
73
83
|
missingErrorMessage?: string;
|
|
74
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Definition for an array of Dates.
|
|
87
|
+
*/
|
|
88
|
+
export interface DateArrayDecoratorConfig extends ArrayDecoratorConfig {
|
|
89
|
+
itemType: DecoratorTypes.DATE;
|
|
90
|
+
/**
|
|
91
|
+
* The definition of the columns to display. Consists of the displayName to show in the header of the row
|
|
92
|
+
* and the value, which is a function that generates the value to display inside a column.
|
|
93
|
+
*/
|
|
94
|
+
displayColumns: ArrayTableDisplayColumn<Date>[];
|
|
95
|
+
/**
|
|
96
|
+
* The label for the add button.
|
|
97
|
+
*
|
|
98
|
+
* @default 'Add'
|
|
99
|
+
*/
|
|
100
|
+
addButtonLabel?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The label for the remove button.
|
|
103
|
+
*
|
|
104
|
+
* @default 'Remove'
|
|
105
|
+
*/
|
|
106
|
+
removeButtonLabel?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The error-message to display when the array is required but contains no values.
|
|
109
|
+
*/
|
|
110
|
+
missingErrorMessage?: string;
|
|
111
|
+
/**
|
|
112
|
+
* A function to get the minimum value of the date.
|
|
113
|
+
*/
|
|
114
|
+
min?: (date?: Date) => Date;
|
|
115
|
+
/**
|
|
116
|
+
* A function to get the maximum value of the date.
|
|
117
|
+
*/
|
|
118
|
+
max?: (date?: Date) => Date;
|
|
119
|
+
/**
|
|
120
|
+
* A filter function to do more specific filtering. This could be the removal of e.g. All weekends.
|
|
121
|
+
*/
|
|
122
|
+
filter?: DateFilterFn<Date | null | undefined>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Definition for an array of DateTimes.
|
|
126
|
+
*/
|
|
127
|
+
export interface DateTimeArrayDecoratorConfig extends ArrayDecoratorConfig {
|
|
128
|
+
itemType: DecoratorTypes.DATE_TIME;
|
|
129
|
+
/**
|
|
130
|
+
* The definition of the columns to display. Consists of the displayName to show in the header of the row
|
|
131
|
+
* and the value, which is a function that generates the value to display inside a column.
|
|
132
|
+
*/
|
|
133
|
+
displayColumns: ArrayTableDisplayColumn<Date>[];
|
|
134
|
+
/**
|
|
135
|
+
* The label for the add button.
|
|
136
|
+
*
|
|
137
|
+
* @default 'Add'
|
|
138
|
+
*/
|
|
139
|
+
addButtonLabel?: string;
|
|
140
|
+
/**
|
|
141
|
+
* The label for the remove button.
|
|
142
|
+
*
|
|
143
|
+
* @default 'Remove'
|
|
144
|
+
*/
|
|
145
|
+
removeButtonLabel?: string;
|
|
146
|
+
/**
|
|
147
|
+
* The error-message to display when the array is required but contains no values.
|
|
148
|
+
*/
|
|
149
|
+
missingErrorMessage?: string;
|
|
150
|
+
/**
|
|
151
|
+
* The selectable times.
|
|
152
|
+
*/
|
|
153
|
+
times?: DropdownValue<Time>[];
|
|
154
|
+
/**
|
|
155
|
+
* The name to use as a label for the time form field.
|
|
156
|
+
*
|
|
157
|
+
* @default 'Time'
|
|
158
|
+
*/
|
|
159
|
+
timeDisplayName?: string;
|
|
160
|
+
/**
|
|
161
|
+
* A function to get the minimum value of the date.
|
|
162
|
+
*/
|
|
163
|
+
minDate?: (date?: Date) => Date;
|
|
164
|
+
/**
|
|
165
|
+
* A function to get the maximum value of the date.
|
|
166
|
+
*/
|
|
167
|
+
maxDate?: (date?: Date) => Date;
|
|
168
|
+
/**
|
|
169
|
+
* A filter function to do more specific date filtering. This could be the removal of e.g. All weekends.
|
|
170
|
+
*/
|
|
171
|
+
filterDate?: DateFilterFn<Date | null | undefined>;
|
|
172
|
+
/**
|
|
173
|
+
* A function to get the minimum value of the time.
|
|
174
|
+
*/
|
|
175
|
+
minTime?: (date?: Date) => Time;
|
|
176
|
+
/**
|
|
177
|
+
* A function to get the maximum value of the time.
|
|
178
|
+
*/
|
|
179
|
+
maxTime?: (date?: Date) => Time;
|
|
180
|
+
/**
|
|
181
|
+
* A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
|
|
182
|
+
*/
|
|
183
|
+
filterTime?: ((time: Time) => boolean) | (() => boolean);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Definition for an array of DateRanges.
|
|
187
|
+
*/
|
|
188
|
+
export interface DateRangeArrayDecoratorConfig extends ArrayDecoratorConfig {
|
|
189
|
+
itemType: DecoratorTypes.DATE_RANGE;
|
|
190
|
+
/**
|
|
191
|
+
* The definition of the columns to display. Consists of the displayName to show in the header of the row
|
|
192
|
+
* and the value, which is a function that generates the value to display inside a column.
|
|
193
|
+
*/
|
|
194
|
+
displayColumns: ArrayTableDisplayColumn<DateRange>[];
|
|
195
|
+
/**
|
|
196
|
+
* The label for the add button.
|
|
197
|
+
*
|
|
198
|
+
* @default 'Add'
|
|
199
|
+
*/
|
|
200
|
+
addButtonLabel?: string;
|
|
201
|
+
/**
|
|
202
|
+
* The label for the remove button.
|
|
203
|
+
*
|
|
204
|
+
* @default 'Remove'
|
|
205
|
+
*/
|
|
206
|
+
removeButtonLabel?: string;
|
|
207
|
+
/**
|
|
208
|
+
* The error-message to display when the array is required but contains no values.
|
|
209
|
+
*/
|
|
210
|
+
missingErrorMessage?: string;
|
|
211
|
+
/**
|
|
212
|
+
* A function to get the minimum value of the start date.
|
|
213
|
+
*/
|
|
214
|
+
minStart?: (date?: Date) => Date;
|
|
215
|
+
/**
|
|
216
|
+
* A function to get the maximum value of the start date.
|
|
217
|
+
*/
|
|
218
|
+
maxStart?: (date?: Date) => Date;
|
|
219
|
+
/**
|
|
220
|
+
* A function to get the minimum value of the end date.
|
|
221
|
+
*/
|
|
222
|
+
minEnd?: (date?: Date) => Date;
|
|
223
|
+
/**
|
|
224
|
+
* A function to get the maximum value of the end date.
|
|
225
|
+
*/
|
|
226
|
+
maxEnd?: (date?: Date) => Date;
|
|
227
|
+
/**
|
|
228
|
+
* A filter function to do more specific filtering on the disallowed end date values. This could be the removal of e.g. All weekends.
|
|
229
|
+
*/
|
|
230
|
+
filter?: DateFilterFn<Date>;
|
|
231
|
+
/**
|
|
232
|
+
* The placeholder for the start date of the date range picker.
|
|
233
|
+
*
|
|
234
|
+
* @default "Start"
|
|
235
|
+
*/
|
|
236
|
+
placeholderStart?: string;
|
|
237
|
+
/**
|
|
238
|
+
* The placeholder for the end date of the date range picker.
|
|
239
|
+
*
|
|
240
|
+
* @default "End"
|
|
241
|
+
*/
|
|
242
|
+
placeholderEnd?: string;
|
|
243
|
+
}
|
|
75
244
|
/**
|
|
76
245
|
* Definition for an array of strings displayed as a chips list.
|
|
77
246
|
*/
|
|
78
247
|
export interface StringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
|
|
79
248
|
itemType: DecoratorTypes.STRING;
|
|
80
|
-
displayStyle: 'chips';
|
|
81
249
|
/**
|
|
82
250
|
* The class for the <i> tag used to remove an entry from the array.
|
|
83
251
|
*
|
|
@@ -102,7 +270,6 @@ export interface StringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
|
|
|
102
270
|
*/
|
|
103
271
|
export interface AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecoratorConfig {
|
|
104
272
|
itemType: DecoratorTypes.STRING_AUTOCOMPLETE;
|
|
105
|
-
displayStyle: 'chips';
|
|
106
273
|
/**
|
|
107
274
|
* The class for the <i> tag used to remove an entry from the array.
|
|
108
275
|
*
|
|
@@ -126,4 +293,3 @@ export interface AutocompleteStringChipsArrayDecoratorConfig extends ArrayDecora
|
|
|
126
293
|
*/
|
|
127
294
|
regex?: RegExp;
|
|
128
295
|
}
|
|
129
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AutocompleteStringChipsArrayDecoratorConfig, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from './array-decorator.data';
|
|
1
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
2
|
+
import { AutocompleteStringChipsArrayDecoratorConfig, DateArrayDecoratorConfig, DateRangeArrayDecoratorConfig, DateTimeArrayDecoratorConfig, EntityArrayDecoratorConfig, StringChipsArrayDecoratorConfig } from './array-decorator.data';
|
|
3
3
|
/**
|
|
4
4
|
* Decorator for setting and getting array property metadata.
|
|
5
5
|
*
|
|
@@ -7,4 +7,4 @@ import { AutocompleteStringChipsArrayDecoratorConfig, EntityArrayDecoratorConfig
|
|
|
7
7
|
* @returns The method that defines the metadata.
|
|
8
8
|
* @throws When the given type of the array-items is unknown.
|
|
9
9
|
*/
|
|
10
|
-
export declare function array<EntityType extends
|
|
10
|
+
export declare function array<EntityType extends BaseEntityType<EntityType>>(metadata: EntityArrayDecoratorConfig<EntityType> | StringChipsArrayDecoratorConfig | AutocompleteStringChipsArrayDecoratorConfig | DateArrayDecoratorConfig | DateTimeArrayDecoratorConfig | DateRangeArrayDecoratorConfig): (target: object, propertyKey: string) => void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { DecoratorTypes } from './decorator-types.enum';
|
|
2
|
-
import { PropertyDecoratorConfigInternal } from './property-decorator-internal.data';
|
|
1
|
+
import { DecoratorType, DecoratorTypes } from './decorator-types.enum';
|
|
3
2
|
/**
|
|
4
3
|
* The base decorator for setting metadata on properties.
|
|
5
4
|
*
|
|
@@ -7,4 +6,4 @@ import { PropertyDecoratorConfigInternal } from './property-decorator-internal.d
|
|
|
7
6
|
* @param type - The type of metadata.
|
|
8
7
|
* @returns The method that sets the metadata.
|
|
9
8
|
*/
|
|
10
|
-
export declare function baseProperty(metadata:
|
|
9
|
+
export declare function baseProperty<T extends DecoratorTypes, CustomMetadataType extends Record<string, unknown>>(metadata: DecoratorType<T, CustomMetadataType>, type: T): (target: object, propertyKey: string) => void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AutocompleteStringChipsArrayDecoratorConfigInternal, EntityArrayDecoratorConfigInternal, StringChipsArrayDecoratorConfigInternal } from '../array/array-decorator-internal.data';
|
|
1
|
+
import { AutocompleteStringChipsArrayDecoratorConfigInternal, EntityArrayDecoratorConfigInternal, DateArrayDecoratorConfigInternal, StringChipsArrayDecoratorConfigInternal, DateTimeArrayDecoratorConfigInternal, DateRangeArrayDecoratorConfigInternal } from '../array/array-decorator-internal.data';
|
|
3
2
|
import { CheckboxBooleanDecoratorConfigInternal, DropdownBooleanDecoratorConfigInternal, ToggleBooleanDecoratorConfigInternal } from '../boolean/boolean-decorator-internal.data';
|
|
3
|
+
import { CustomDecoratorConfigInternal } from '../custom/custom-decorator-internal.data';
|
|
4
|
+
import { DateRangeDateDecoratorConfigInternal, DateTimeDateDecoratorConfigInternal, DefaultDateDecoratorConfigInternal } from '../date/date-decorator-internal.data';
|
|
5
|
+
import { DefaultFileDecoratorConfigInternal, ImageFileDecoratorConfigInternal } from '../file/file-decorator-internal.data';
|
|
4
6
|
import { DefaultNumberDecoratorConfigInternal, DropdownNumberDecoratorConfigInternal } from '../number/number-decorator-internal.data';
|
|
5
7
|
import { DefaultObjectDecoratorConfigInternal } from '../object/object-decorator-internal.data';
|
|
6
8
|
import { AutocompleteStringDecoratorConfigInternal, DefaultStringDecoratorConfigInternal, DropdownStringDecoratorConfigInternal, TextboxStringDecoratorConfigInternal } from '../string/string-decorator-internal.data';
|
|
@@ -19,10 +21,19 @@ export declare enum DecoratorTypes {
|
|
|
19
21
|
BOOLEAN_DROPDOWN = "booleanDropdown",
|
|
20
22
|
OBJECT = "object",
|
|
21
23
|
ARRAY = "array",
|
|
24
|
+
ARRAY_DATE = "arrayDate",
|
|
25
|
+
ARRAY_DATE_TIME = "arrayDateTime",
|
|
26
|
+
ARRAY_DATE_RANGE = "arrayDateRange",
|
|
22
27
|
ARRAY_STRING_CHIPS = "arrayStringChips",
|
|
23
|
-
ARRAY_STRING_AUTOCOMPLETE_CHIPS = "arrayStringAutocompleteChips"
|
|
28
|
+
ARRAY_STRING_AUTOCOMPLETE_CHIPS = "arrayStringAutocompleteChips",
|
|
29
|
+
DATE = "date",
|
|
30
|
+
DATE_RANGE = "dateRange",
|
|
31
|
+
DATE_TIME = "dateTime",
|
|
32
|
+
FILE_DEFAULT = "fileDefault",
|
|
33
|
+
FILE_IMAGE = "fileImage",
|
|
34
|
+
CUSTOM = "custom"
|
|
24
35
|
}
|
|
25
36
|
/**
|
|
26
37
|
* Gives the metadata-config Type based on the DecoratorTypes enum.
|
|
27
38
|
*/
|
|
28
|
-
export declare type DecoratorType<T
|
|
39
|
+
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.NUMBER ? DefaultNumberDecoratorConfigInternal : T extends DecoratorTypes.NUMBER_DROPDOWN ? DropdownNumberDecoratorConfigInternal : 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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The definition for a dropdown value.
|
|
3
|
+
* Consists of the name to display in the dropdown and the actual value.
|
|
4
|
+
*/
|
|
5
|
+
export interface DropdownValue<T> {
|
|
6
|
+
/**
|
|
7
|
+
* The name to display in the dropdown.
|
|
8
|
+
*/
|
|
9
|
+
displayName: string;
|
|
10
|
+
/**
|
|
11
|
+
* The actual value.
|
|
12
|
+
*/
|
|
13
|
+
value: T;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
3
|
+
import { NgxMatEntityBaseInputComponent } from '../../components/input/base-input.component';
|
|
4
|
+
import { DecoratorTypes } from '../base/decorator-types.enum';
|
|
5
|
+
import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
|
|
6
|
+
import { CustomDecoratorConfig } from './custom-decorator.data';
|
|
7
|
+
/**
|
|
8
|
+
* The internal config for the @custom decorator.
|
|
9
|
+
* Sets default values.
|
|
10
|
+
*/
|
|
11
|
+
export declare class CustomDecoratorConfigInternal<EntityType extends BaseEntityType<EntityType>, ValueType, MetadataType extends BaseEntityType<MetadataType>, ComponentType extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.CUSTOM, MetadataType>> extends PropertyDecoratorConfigInternal implements CustomDecoratorConfig<EntityType, ValueType, MetadataType, ComponentType> {
|
|
12
|
+
component: Type<ComponentType>;
|
|
13
|
+
isValid: (value: ValueType, omit: 'create' | 'update') => boolean;
|
|
14
|
+
isEqual: (value: ValueType, valuePriorChanges: ValueType, metadata: CustomDecoratorConfig<EntityType, ValueType, MetadataType, ComponentType>) => boolean;
|
|
15
|
+
customMetadata: MetadataType;
|
|
16
|
+
constructor(data: CustomDecoratorConfig<EntityType, ValueType, MetadataType, ComponentType>);
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NgxMatEntityBaseInputComponent } from '../../components/input/base-input.component';
|
|
2
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
3
|
+
import { DecoratorTypes } from '../base/decorator-types.enum';
|
|
4
|
+
import { PropertyDecoratorConfig } from '../base/property-decorator.data';
|
|
5
|
+
import { Type } from '@angular/core';
|
|
6
|
+
/**
|
|
7
|
+
* Definition for a custom property. Use this if the provided decorators don't fit your needs.
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomDecoratorConfig<EntityType extends BaseEntityType<EntityType>, ValueType, MetadataType extends BaseEntityType<MetadataType>, ComponentType extends NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.CUSTOM, MetadataType>> extends PropertyDecoratorConfig {
|
|
10
|
+
/**
|
|
11
|
+
* The component to use for this input.
|
|
12
|
+
*/
|
|
13
|
+
component: Type<ComponentType>;
|
|
14
|
+
/**
|
|
15
|
+
* The function that defines whether or not the value is valid.
|
|
16
|
+
* Used in addition to default checks like required etc.
|
|
17
|
+
* Needed for the edit and create dialogs.
|
|
18
|
+
*
|
|
19
|
+
* @default () => true
|
|
20
|
+
*/
|
|
21
|
+
isValid?: (value: ValueType, omit: 'create' | 'update') => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The function that defines whether or not two of your custom values are equal.
|
|
24
|
+
* Needed for the edit and create dialogs.
|
|
25
|
+
*
|
|
26
|
+
* @default (value: ValueType, valuePriorChanges: ValueType) => LodashUtilities.isEqual(value, valuePriorChanges)
|
|
27
|
+
*/
|
|
28
|
+
isEqual?: (value: ValueType, valuePriorChanges: ValueType, metadata: CustomDecoratorConfig<EntityType, ValueType, MetadataType, ComponentType>) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Any custom metadata you want to add to the property.
|
|
31
|
+
*/
|
|
32
|
+
customMetadata: MetadataType;
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
2
|
+
import { NgxMatEntityBaseInputComponent } from '../../components/input/base-input.component';
|
|
3
|
+
import { DecoratorTypes } from '../base/decorator-types.enum';
|
|
4
|
+
import { CustomDecoratorConfig } from './custom-decorator.data';
|
|
5
|
+
/**
|
|
6
|
+
* Decorator for setting and getting custom property metadata.
|
|
7
|
+
*
|
|
8
|
+
* @param metadata - The metadata of the custom property.
|
|
9
|
+
* @returns The method that defines the metadata.
|
|
10
|
+
*/
|
|
11
|
+
export declare function custom<ValueType, MetadataType extends BaseEntityType<MetadataType>, EntityType extends BaseEntityType<EntityType>>(metadata: CustomDecoratorConfig<EntityType, ValueType, MetadataType, NgxMatEntityBaseInputComponent<EntityType, DecoratorTypes.CUSTOM, MetadataType>>): (target: object, propertyKey: string) => void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Time } from '@angular/common';
|
|
2
|
+
import { DateFilterFn } from '@angular/material/datepicker';
|
|
3
|
+
import { DropdownValue } from '../base/dropdown-value.interface';
|
|
4
|
+
import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
|
|
5
|
+
import { DateRangeDateDecoratorConfig, DateTimeDateDecoratorConfig, DefaultDateDecoratorConfig } from './date-decorator.data';
|
|
6
|
+
/**
|
|
7
|
+
* The internal DefaultDateDecoratorConfig. Sets default values.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DefaultDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DefaultDateDecoratorConfig {
|
|
10
|
+
displayStyle: 'date';
|
|
11
|
+
min?: (date?: Date) => Date;
|
|
12
|
+
max?: (date?: Date) => Date;
|
|
13
|
+
filter?: DateFilterFn<Date | null | undefined>;
|
|
14
|
+
constructor(data: DefaultDateDecoratorConfig);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The internal DateRangeDateDecoratorConfig. Sets default values.
|
|
18
|
+
*/
|
|
19
|
+
export declare class DateRangeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DateRangeDateDecoratorConfig {
|
|
20
|
+
displayStyle: 'daterange';
|
|
21
|
+
minStart?: (date?: Date) => Date;
|
|
22
|
+
maxStart?: (date?: Date) => Date;
|
|
23
|
+
minEnd?: (date?: Date) => Date;
|
|
24
|
+
maxEnd?: (date?: Date) => Date;
|
|
25
|
+
filter?: DateFilterFn<Date>;
|
|
26
|
+
placeholderStart: string;
|
|
27
|
+
placeholderEnd: string;
|
|
28
|
+
constructor(data: DateRangeDateDecoratorConfig);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The internal DateTimeDateDecoratorConfig. Sets default values.
|
|
32
|
+
*/
|
|
33
|
+
export declare class DateTimeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DateTimeDateDecoratorConfig {
|
|
34
|
+
displayStyle: 'datetime';
|
|
35
|
+
times: DropdownValue<Time>[];
|
|
36
|
+
timeDisplayName: string;
|
|
37
|
+
minDate?: (date?: Date) => Date;
|
|
38
|
+
maxDate?: (date?: Date) => Date;
|
|
39
|
+
filterDate?: DateFilterFn<Date | null | undefined>;
|
|
40
|
+
minTime?: (date?: Date) => Time;
|
|
41
|
+
maxTime?: (date?: Date) => Time;
|
|
42
|
+
filterTime?: ((time: Time) => boolean) | (() => boolean);
|
|
43
|
+
constructor(data: DateTimeDateDecoratorConfig);
|
|
44
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Time } from '@angular/common';
|
|
2
|
+
import { DateFilterFn } from '@angular/material/datepicker';
|
|
3
|
+
import { DropdownValue } from '../base/dropdown-value.interface';
|
|
4
|
+
import { PropertyDecoratorConfig } from '../base/property-decorator.data';
|
|
5
|
+
/**
|
|
6
|
+
* This is the needed type for an property that should be displayed as a date range.
|
|
7
|
+
*/
|
|
8
|
+
export interface DateRange {
|
|
9
|
+
/**
|
|
10
|
+
* The start date of the range.
|
|
11
|
+
*/
|
|
12
|
+
start: Date;
|
|
13
|
+
/**
|
|
14
|
+
* The end date of the range.
|
|
15
|
+
*/
|
|
16
|
+
end: Date;
|
|
17
|
+
/**
|
|
18
|
+
* The actual Date values. These are needed if the date range might contain some values that are disabled.
|
|
19
|
+
* E.g. When you build a tool to request vacation you may want the user to select 3 weeks in the range picker
|
|
20
|
+
* but don't want the weekend dates in the final result.
|
|
21
|
+
*/
|
|
22
|
+
values?: Date[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Definition for the @date metadata.
|
|
26
|
+
*/
|
|
27
|
+
declare abstract class DateDecoratorConfig extends PropertyDecoratorConfig {
|
|
28
|
+
/**
|
|
29
|
+
* How to display the date.
|
|
30
|
+
*/
|
|
31
|
+
displayStyle: 'date' | 'datetime' | 'daterange';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The configuration options for a date property displayed as a default single date picker.
|
|
35
|
+
*/
|
|
36
|
+
export interface DefaultDateDecoratorConfig extends DateDecoratorConfig {
|
|
37
|
+
displayStyle: 'date';
|
|
38
|
+
/**
|
|
39
|
+
* A function to get the minimum value of the date.
|
|
40
|
+
*/
|
|
41
|
+
min?: (date?: Date) => Date;
|
|
42
|
+
/**
|
|
43
|
+
* A function to get the maximum value of the date.
|
|
44
|
+
*/
|
|
45
|
+
max?: (date?: Date) => Date;
|
|
46
|
+
/**
|
|
47
|
+
* A filter function to do more specific filtering. This could be the removal of e.g. All weekends.
|
|
48
|
+
*/
|
|
49
|
+
filter?: DateFilterFn<Date | null | undefined>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The configuration options for a date property displayed as a date range.
|
|
53
|
+
*/
|
|
54
|
+
export interface DateRangeDateDecoratorConfig extends DateDecoratorConfig {
|
|
55
|
+
displayStyle: 'daterange';
|
|
56
|
+
/**
|
|
57
|
+
* A function to get the minimum value of the start date.
|
|
58
|
+
*/
|
|
59
|
+
minStart?: (date?: Date) => Date;
|
|
60
|
+
/**
|
|
61
|
+
* A function to get the maximum value of the start date.
|
|
62
|
+
*/
|
|
63
|
+
maxStart?: (date?: Date) => Date;
|
|
64
|
+
/**
|
|
65
|
+
* A function to get the minimum value of the end date.
|
|
66
|
+
*/
|
|
67
|
+
minEnd?: (date?: Date) => Date;
|
|
68
|
+
/**
|
|
69
|
+
* A function to get the maximum value of the end date.
|
|
70
|
+
*/
|
|
71
|
+
maxEnd?: (date?: Date) => Date;
|
|
72
|
+
/**
|
|
73
|
+
* A filter function to do more specific filtering on the disallowed end date values. This could be the removal of e.g. All weekends.
|
|
74
|
+
*/
|
|
75
|
+
filter?: DateFilterFn<Date>;
|
|
76
|
+
/**
|
|
77
|
+
* The placeholder for the start date of the date range picker.
|
|
78
|
+
*
|
|
79
|
+
* @default "Start"
|
|
80
|
+
*/
|
|
81
|
+
placeholderStart?: string;
|
|
82
|
+
/**
|
|
83
|
+
* The placeholder for the end date of the date range picker.
|
|
84
|
+
*
|
|
85
|
+
* @default "End"
|
|
86
|
+
*/
|
|
87
|
+
placeholderEnd?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The configuration options for a date property displayed as date time.
|
|
91
|
+
*/
|
|
92
|
+
export interface DateTimeDateDecoratorConfig extends DateDecoratorConfig {
|
|
93
|
+
displayStyle: 'datetime';
|
|
94
|
+
/**
|
|
95
|
+
* The selectable times.
|
|
96
|
+
*/
|
|
97
|
+
times?: DropdownValue<Time>[];
|
|
98
|
+
/**
|
|
99
|
+
* The name to use as a label for the time form field.
|
|
100
|
+
*
|
|
101
|
+
* @default 'Time'
|
|
102
|
+
*/
|
|
103
|
+
timeDisplayName?: string;
|
|
104
|
+
/**
|
|
105
|
+
* A function to get the minimum value of the date.
|
|
106
|
+
*/
|
|
107
|
+
minDate?: (date?: Date) => Date;
|
|
108
|
+
/**
|
|
109
|
+
* A function to get the maximum value of the date.
|
|
110
|
+
*/
|
|
111
|
+
maxDate?: (date?: Date) => Date;
|
|
112
|
+
/**
|
|
113
|
+
* A filter function to do more specific date filtering. This could be the removal of e.g. All weekends.
|
|
114
|
+
*/
|
|
115
|
+
filterDate?: DateFilterFn<Date | null | undefined>;
|
|
116
|
+
/**
|
|
117
|
+
* A function to get the minimum value of the time.
|
|
118
|
+
*/
|
|
119
|
+
minTime?: (date?: Date) => Time;
|
|
120
|
+
/**
|
|
121
|
+
* A function to get the maximum value of the time.
|
|
122
|
+
*/
|
|
123
|
+
maxTime?: (date?: Date) => Time;
|
|
124
|
+
/**
|
|
125
|
+
* A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
|
|
126
|
+
*/
|
|
127
|
+
filterTime?: ((time: Time) => boolean) | (() => boolean);
|
|
128
|
+
}
|
|
129
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DateRangeDateDecoratorConfig, DateTimeDateDecoratorConfig, DefaultDateDecoratorConfig } from './date-decorator.data';
|
|
2
|
+
/**
|
|
3
|
+
* Decorator for setting and getting date property metadata.
|
|
4
|
+
*
|
|
5
|
+
* @param metadata - The metadata of the date property.
|
|
6
|
+
* @returns The method that defines the metadata.
|
|
7
|
+
*/
|
|
8
|
+
export declare function date(metadata: DefaultDateDecoratorConfig | DateRangeDateDecoratorConfig | DateTimeDateDecoratorConfig): (target: object, propertyKey: string) => void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ConfirmDialogData } from '../../components/confirm-dialog/confirm-dialog-data';
|
|
2
|
+
import { PropertyDecoratorConfigInternal } from '../base/property-decorator-internal.data';
|
|
3
|
+
import { DefaultFileDecoratorConfig, ImageFileDecoratorConfig } from './file-decorator.data';
|
|
4
|
+
/**
|
|
5
|
+
* Contains data about a file property where a blob exists.
|
|
6
|
+
*/
|
|
7
|
+
export interface FileDataWithFile {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the file.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The file data itself in form of a blob.
|
|
14
|
+
*/
|
|
15
|
+
file: Blob;
|
|
16
|
+
/**
|
|
17
|
+
* The mime type of the file.
|
|
18
|
+
* This is needed to increase performance when checking if the provided file is valid.
|
|
19
|
+
*/
|
|
20
|
+
type: string;
|
|
21
|
+
/**
|
|
22
|
+
* The size of the file in bytes.
|
|
23
|
+
* This is needed to increase performance when checking if the provided file is valid.
|
|
24
|
+
*/
|
|
25
|
+
size: number;
|
|
26
|
+
/**
|
|
27
|
+
* The url where the blob is saved.
|
|
28
|
+
*/
|
|
29
|
+
url?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Contains data about a file property where no blob exists.
|
|
33
|
+
*/
|
|
34
|
+
export interface FileDataWithUrl {
|
|
35
|
+
/**
|
|
36
|
+
* The name of the file.
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* The file data itself in form of a blob.
|
|
41
|
+
*/
|
|
42
|
+
file?: Blob;
|
|
43
|
+
/**
|
|
44
|
+
* The mime type of the file.
|
|
45
|
+
* This is needed to increase performance when checking if the provided file is valid.
|
|
46
|
+
*/
|
|
47
|
+
type: string;
|
|
48
|
+
/**
|
|
49
|
+
* The size of the file in bytes.
|
|
50
|
+
* This is needed to increase performance when checking if the provided file is valid.
|
|
51
|
+
*/
|
|
52
|
+
size: number;
|
|
53
|
+
/**
|
|
54
|
+
* The url where the blob is saved.
|
|
55
|
+
*/
|
|
56
|
+
url: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The internal DefaultFileDecoratorConfig. Sets default values.
|
|
60
|
+
*/
|
|
61
|
+
export declare class DefaultFileDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements DefaultFileDecoratorConfig {
|
|
62
|
+
type: 'other';
|
|
63
|
+
preview: false;
|
|
64
|
+
multiple: boolean;
|
|
65
|
+
allowedMimeTypes: string[];
|
|
66
|
+
deleteIcon: string;
|
|
67
|
+
maxSize: number;
|
|
68
|
+
maxSizeTotal: number;
|
|
69
|
+
mimeTypeErrorDialog: ConfirmDialogData;
|
|
70
|
+
maxSizeErrorDialog: ConfirmDialogData;
|
|
71
|
+
maxSizeTotalErrorDialog: ConfirmDialogData;
|
|
72
|
+
dragAndDrop: boolean;
|
|
73
|
+
constructor(data: DefaultFileDecoratorConfig);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The internal ImageFileDecoratorConfig. Sets default values.
|
|
77
|
+
*/
|
|
78
|
+
export declare class ImageFileDecoratorConfigInternal extends PropertyDecoratorConfigInternal implements ImageFileDecoratorConfig {
|
|
79
|
+
type: 'image';
|
|
80
|
+
allowedMimeTypes: string[];
|
|
81
|
+
multiple: boolean;
|
|
82
|
+
preview: boolean;
|
|
83
|
+
previewPlaceholderUrl?: string;
|
|
84
|
+
deleteIcon: string;
|
|
85
|
+
maxSize: number;
|
|
86
|
+
maxSizeTotal: number;
|
|
87
|
+
mimeTypeErrorDialog: ConfirmDialogData;
|
|
88
|
+
maxSizeErrorDialog: ConfirmDialogData;
|
|
89
|
+
maxSizeTotalErrorDialog: ConfirmDialogData;
|
|
90
|
+
dragAndDrop: boolean;
|
|
91
|
+
constructor(data: ImageFileDecoratorConfig);
|
|
92
|
+
}
|