ngx-material-entity 0.1.5 → 1.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 +416 -39
- package/capsulation/reflect.utilities.d.ts +1 -1
- package/classes/date.utilities.d.ts +3 -3
- package/classes/entity.model.d.ts +2 -1
- package/classes/entity.utilities.d.ts +35 -4
- package/components/input/array/array-date-input/array-date-input.component.d.ts +5 -16
- package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +5 -15
- package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +5 -15
- package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +5 -13
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +5 -14
- package/components/input/array/array-table.class.d.ts +13 -13
- package/components/input/base-input.component.d.ts +57 -0
- package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +5 -12
- package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +5 -13
- package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +5 -12
- package/components/input/custom/custom.component.d.ts +13 -0
- package/components/input/date/date-input/date-input.component.d.ts +5 -15
- package/components/input/date/date-range-input/date-range-input.component.d.ts +6 -14
- package/components/input/date/date-time-input/date-time-input.component.d.ts +6 -14
- package/components/input/file/file-default-input/file-default-input.component.d.ts +5 -13
- package/components/input/file/file-image-input/file-image-input.component.d.ts +5 -13
- package/components/input/file/file-input/file-input.component.d.ts +2 -1
- package/components/input/input.component.d.ts +18 -6
- package/components/input/input.module.d.ts +38 -33
- package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +5 -13
- package/components/input/number/number-input/number-input.component.d.ts +5 -13
- package/components/input/number/number-slider-input/number-slider-input.component.d.ts +9 -0
- package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +6 -13
- package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +5 -13
- package/components/input/string/string-input/string-input.component.d.ts +5 -13
- package/components/input/string/string-password-input/string-password-input.component.d.ts +15 -0
- package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +5 -13
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +2 -2
- package/components/table/create-dialog/create-entity-dialog.module.d.ts +2 -1
- package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +4 -0
- package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +2 -1
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +3 -2
- package/components/table/edit-dialog/edit-entity-dialog.module.d.ts +3 -2
- package/components/table/table-data.builder.d.ts +4 -3
- package/components/table/table-data.d.ts +12 -4
- package/decorators/base/base-property.decorator.d.ts +1 -1
- package/decorators/base/decorator-types.enum.d.ts +8 -4
- package/decorators/base/property-decorator-internal.data.d.ts +2 -0
- package/decorators/base/property-decorator.data.d.ts +15 -0
- package/decorators/custom/custom-decorator-internal.data.d.ts +17 -0
- package/decorators/custom/custom-decorator.data.d.ts +37 -0
- package/decorators/custom/custom.decorator.d.ts +11 -0
- package/decorators/number/number-decorator-internal.data.d.ts +20 -1
- package/decorators/number/number-decorator.data.d.ts +27 -1
- package/decorators/number/number.decorator.d.ts +2 -2
- package/decorators/string/string-decorator-internal.data.d.ts +14 -1
- package/decorators/string/string-decorator.data.d.ts +37 -1
- package/decorators/string/string.decorator.d.ts +2 -2
- package/esm2020/capsulation/reflect.utilities.mjs +1 -1
- package/esm2020/classes/date.utilities.mjs +3 -3
- package/esm2020/classes/entity.model.mjs +5 -1
- package/esm2020/classes/entity.utilities.mjs +107 -20
- package/esm2020/classes/file.utilities.mjs +3 -2
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +2 -2
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +16 -34
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +17 -35
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +19 -34
- package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +16 -44
- package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +15 -46
- package/esm2020/components/input/array/array-table.class.mjs +27 -15
- package/esm2020/components/input/base-input.component.mjs +65 -0
- package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +10 -27
- package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +8 -26
- package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +10 -27
- package/esm2020/components/input/custom/custom.component.mjs +26 -0
- package/esm2020/components/input/date/date-input/date-input.component.mjs +9 -25
- package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +13 -25
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +20 -31
- package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +10 -26
- package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +27 -38
- package/esm2020/components/input/file/file-input/file-input.component.mjs +7 -5
- package/esm2020/components/input/input.component.mjs +50 -38
- package/esm2020/components/input/input.module.mjs +21 -4
- package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +8 -26
- package/esm2020/components/input/number/number-input/number-input.component.mjs +8 -26
- package/esm2020/components/input/number/number-slider-input/number-slider-input.component.mjs +17 -0
- package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +11 -28
- package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +8 -26
- package/esm2020/components/input/string/string-input/string-input.component.mjs +8 -26
- package/esm2020/components/input/string/string-password-input/string-password-input.component.mjs +36 -0
- package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +8 -26
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +9 -8
- package/esm2020/components/table/create-dialog/create-entity-dialog.module.mjs +8 -4
- package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +4 -3
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +10 -8
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.module.mjs +5 -1
- package/esm2020/components/table/table-data.builder.mjs +13 -10
- package/esm2020/components/table/table-data.mjs +1 -1
- package/esm2020/components/table/table.component.mjs +16 -14
- package/esm2020/decorators/base/base-property.decorator.mjs +1 -1
- package/esm2020/decorators/base/decorator-types.enum.mjs +4 -1
- package/esm2020/decorators/base/property-decorator-internal.data.mjs +6 -1
- package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
- 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/number/number-decorator-internal.data.mjs +24 -1
- package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
- package/esm2020/decorators/number/number.decorator.mjs +9 -7
- package/esm2020/decorators/string/string-decorator-internal.data.mjs +16 -1
- package/esm2020/decorators/string/string-decorator.data.mjs +1 -1
- package/esm2020/decorators/string/string.decorator.mjs +13 -13
- package/esm2020/public-api.mjs +4 -1
- package/fesm2015/ngx-material-entity.mjs +663 -628
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +768 -740
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
|
@@ -1,43 +1,47 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import { __decorate, __metadata } from 'tslib';
|
|
3
|
-
import { BehaviorSubject, firstValueFrom, Subject, takeUntil } from 'rxjs';
|
|
4
3
|
import { isEqual, cloneDeep, omit, isNil, omitBy, isArray } from 'lodash';
|
|
4
|
+
import { BehaviorSubject, firstValueFrom, Subject, takeUntil } from 'rxjs';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { Component, Inject, NgModule, EventEmitter, Input, Output, Directive, HostListener, ViewChild } from '@angular/core';
|
|
7
7
|
import * as i1 from '@angular/material/dialog';
|
|
8
8
|
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
9
|
-
import * as
|
|
9
|
+
import * as i2 from '@angular/material/checkbox';
|
|
10
10
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i3 from '@angular/material/button';
|
|
12
12
|
import { MatButtonModule } from '@angular/material/button';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i6 from '@angular/common';
|
|
14
14
|
import { CommonModule } from '@angular/common';
|
|
15
|
-
import * as i3 from '@angular/forms';
|
|
15
|
+
import * as i3$1 from '@angular/forms';
|
|
16
16
|
import { FormsModule } from '@angular/forms';
|
|
17
|
-
import * as
|
|
17
|
+
import * as i4$1 from '@angular/material/table';
|
|
18
18
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
19
19
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
20
20
|
import * as i1$1 from '@angular/material/form-field';
|
|
21
21
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
22
|
-
import * as i4
|
|
22
|
+
import * as i4 from '@angular/material/input';
|
|
23
23
|
import { MatInputModule } from '@angular/material/input';
|
|
24
|
-
import * as i3$
|
|
25
|
-
import * as i2 from '@angular/material/autocomplete';
|
|
24
|
+
import * as i3$2 from '@angular/cdk/text-field';
|
|
25
|
+
import * as i2$1 from '@angular/material/autocomplete';
|
|
26
26
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
27
|
-
import * as i3$
|
|
28
|
-
import * as i2$
|
|
27
|
+
import * as i3$3 from '@angular/material/core';
|
|
28
|
+
import * as i2$2 from '@angular/material/select';
|
|
29
29
|
import { MatSelectModule } from '@angular/material/select';
|
|
30
|
-
import * as i2$
|
|
30
|
+
import * as i2$3 from '@angular/material/slide-toggle';
|
|
31
31
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
32
|
-
import * as
|
|
32
|
+
import * as i2$4 from '@angular/material/slider';
|
|
33
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
34
|
+
import * as i13 from '@angular/material/tabs';
|
|
35
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
36
|
+
import * as i2$5 from '@angular/material/datepicker';
|
|
33
37
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
34
|
-
import * as i2$
|
|
38
|
+
import * as i2$6 from '@angular/material/chips';
|
|
35
39
|
import { MatChipsModule } from '@angular/material/chips';
|
|
36
40
|
import { MatIconModule } from '@angular/material/icon';
|
|
37
41
|
import * as i7 from '@angular/material/paginator';
|
|
38
42
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
39
43
|
import { MatSort } from '@angular/material/sort';
|
|
40
|
-
import * as i4$
|
|
44
|
+
import * as i4$2 from '@angular/material/menu';
|
|
41
45
|
import { MatMenuModule } from '@angular/material/menu';
|
|
42
46
|
|
|
43
47
|
/**
|
|
@@ -132,8 +136,10 @@ var DecoratorTypes;
|
|
|
132
136
|
DecoratorTypes["STRING_DROPDOWN"] = "stringDropdown";
|
|
133
137
|
DecoratorTypes["STRING_AUTOCOMPLETE"] = "stringAutocomplete";
|
|
134
138
|
DecoratorTypes["STRING_TEXTBOX"] = "stringTextbox";
|
|
139
|
+
DecoratorTypes["STRING_PASSWORD"] = "stringPassword";
|
|
135
140
|
DecoratorTypes["NUMBER"] = "number";
|
|
136
141
|
DecoratorTypes["NUMBER_DROPDOWN"] = "numberDropdown";
|
|
142
|
+
DecoratorTypes["NUMBER_SLIDER"] = "numberSlider";
|
|
137
143
|
DecoratorTypes["BOOLEAN_CHECKBOX"] = "boolean";
|
|
138
144
|
DecoratorTypes["BOOLEAN_TOGGLE"] = "booleanToggle";
|
|
139
145
|
DecoratorTypes["BOOLEAN_DROPDOWN"] = "booleanDropdown";
|
|
@@ -149,6 +155,7 @@ var DecoratorTypes;
|
|
|
149
155
|
DecoratorTypes["DATE_TIME"] = "dateTime";
|
|
150
156
|
DecoratorTypes["FILE_DEFAULT"] = "fileDefault";
|
|
151
157
|
DecoratorTypes["FILE_IMAGE"] = "fileImage";
|
|
158
|
+
DecoratorTypes["CUSTOM"] = "custom";
|
|
152
159
|
})(DecoratorTypes || (DecoratorTypes = {}));
|
|
153
160
|
|
|
154
161
|
/**
|
|
@@ -159,6 +166,8 @@ class PositionInternal {
|
|
|
159
166
|
this.validateInput(data);
|
|
160
167
|
this.row = data?.row ?? -1;
|
|
161
168
|
this.order = data?.order ?? -1;
|
|
169
|
+
this.tab = data?.tab ?? -1;
|
|
170
|
+
this.tabName = data?.tabName;
|
|
162
171
|
}
|
|
163
172
|
validateInput(data) {
|
|
164
173
|
if (data?.order != null) {
|
|
@@ -172,6 +181,9 @@ class PositionInternal {
|
|
|
172
181
|
if (data?.row != null && data.row < 1) {
|
|
173
182
|
throw new Error('row must be at least 1');
|
|
174
183
|
}
|
|
184
|
+
if (data?.tab != null && data.tab < 2) {
|
|
185
|
+
throw new Error('tab must be at least 2');
|
|
186
|
+
}
|
|
175
187
|
}
|
|
176
188
|
}
|
|
177
189
|
/**
|
|
@@ -235,6 +247,21 @@ class AutocompleteStringDecoratorConfigInternal extends PropertyDecoratorConfigI
|
|
|
235
247
|
this.regex = data.regex;
|
|
236
248
|
}
|
|
237
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* The internal PasswordStringDecoratorConfig. Sets default values.
|
|
252
|
+
*/
|
|
253
|
+
class PasswordStringDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
254
|
+
constructor(data) {
|
|
255
|
+
super(data);
|
|
256
|
+
this.displayStyle = data.displayStyle;
|
|
257
|
+
this.minLength = data.minLength;
|
|
258
|
+
this.maxLength = data.maxLength;
|
|
259
|
+
this.regex = data.regex;
|
|
260
|
+
this.needsConfirmation = data.needsConfirmation ?? true;
|
|
261
|
+
this.confirmationDisplayName = data.confirmationDisplayName ?? 'Confirm Password';
|
|
262
|
+
this.passwordsDontMatchErrorMessage = data.passwordsDontMatchErrorMessage ?? 'Passwords need to match!';
|
|
263
|
+
}
|
|
264
|
+
}
|
|
238
265
|
|
|
239
266
|
/**
|
|
240
267
|
* Decorator for setting and getting string Property metadata.
|
|
@@ -243,37 +270,20 @@ class AutocompleteStringDecoratorConfigInternal extends PropertyDecoratorConfigI
|
|
|
243
270
|
* @returns The method that defines the metadata.
|
|
244
271
|
*/
|
|
245
272
|
function string(metadata) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
273
|
+
switch (metadata.displayStyle) {
|
|
274
|
+
case 'dropdown':
|
|
275
|
+
return baseProperty(new DropdownStringDecoratorConfigInternal(metadata), DecoratorTypes.STRING_DROPDOWN);
|
|
276
|
+
case 'autocomplete':
|
|
277
|
+
return baseProperty(new AutocompleteStringDecoratorConfigInternal(metadata), DecoratorTypes.STRING_AUTOCOMPLETE);
|
|
278
|
+
case 'textbox':
|
|
279
|
+
return baseProperty(new TextboxStringDecoratorConfigInternal(metadata), DecoratorTypes.STRING_TEXTBOX);
|
|
280
|
+
case 'password':
|
|
281
|
+
return baseProperty(new PasswordStringDecoratorConfigInternal(metadata), DecoratorTypes.STRING_PASSWORD);
|
|
282
|
+
default:
|
|
283
|
+
return baseProperty(new DefaultStringDecoratorConfigInternal(metadata), DecoratorTypes.STRING);
|
|
257
284
|
}
|
|
258
285
|
}
|
|
259
286
|
|
|
260
|
-
/**
|
|
261
|
-
* A base Entity class with a builtin id.
|
|
262
|
-
*/
|
|
263
|
-
class Entity {
|
|
264
|
-
}
|
|
265
|
-
__decorate([
|
|
266
|
-
string({
|
|
267
|
-
omitForCreate: true,
|
|
268
|
-
omitForUpdate: true,
|
|
269
|
-
display: false,
|
|
270
|
-
displayStyle: 'line',
|
|
271
|
-
displayName: 'ID',
|
|
272
|
-
required: true
|
|
273
|
-
}),
|
|
274
|
-
__metadata("design:type", String)
|
|
275
|
-
], Entity.prototype, "id", void 0);
|
|
276
|
-
|
|
277
287
|
/**
|
|
278
288
|
* Encapsulates all functionality of lodash.
|
|
279
289
|
*/
|
|
@@ -453,14 +463,14 @@ class DateUtilities {
|
|
|
453
463
|
/**
|
|
454
464
|
* Get all valid times for the dropdown of a datetime property.
|
|
455
465
|
*
|
|
456
|
-
* @param date - The date of the datetime.
|
|
457
466
|
* @param times - All given times to filter.
|
|
467
|
+
* @param date - The date of the datetime.
|
|
458
468
|
* @param min - The function that defines the minimum time.
|
|
459
469
|
* @param max - The function that defines the maximum time.
|
|
460
470
|
* @param filter - A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
|
|
461
471
|
* @returns All valid dropdown values for the datetime property.
|
|
462
472
|
*/
|
|
463
|
-
static getValidTimesForDropdown(
|
|
473
|
+
static getValidTimesForDropdown(times, date, min, max, filter) {
|
|
464
474
|
if (min) {
|
|
465
475
|
const minTime = min(date);
|
|
466
476
|
times = times.filter(t => !t.value
|
|
@@ -613,7 +623,7 @@ class FileUtilities {
|
|
|
613
623
|
* @returns The given value as bytes.
|
|
614
624
|
*/
|
|
615
625
|
static transformToMegaBytes(value, unit) {
|
|
616
|
-
const bytes = this.transformToBytes(value, unit);
|
|
626
|
+
const bytes = this.transformToBytes(LodashUtilities.cloneDeep(value), unit);
|
|
617
627
|
return bytes / 1000000;
|
|
618
628
|
}
|
|
619
629
|
static transformToBytes(value, unit) {
|
|
@@ -792,8 +802,10 @@ class EntityUtilities {
|
|
|
792
802
|
if (metadata.omitForUpdate && omit === 'update') {
|
|
793
803
|
return true;
|
|
794
804
|
}
|
|
795
|
-
if (metadata.required
|
|
796
|
-
|
|
805
|
+
if (metadata.required) {
|
|
806
|
+
if (entity[key] == null || entity[key] === '') {
|
|
807
|
+
return false;
|
|
808
|
+
}
|
|
797
809
|
}
|
|
798
810
|
switch (type) {
|
|
799
811
|
case DecoratorTypes.BOOLEAN_DROPDOWN:
|
|
@@ -823,9 +835,18 @@ class EntityUtilities {
|
|
|
823
835
|
return false;
|
|
824
836
|
}
|
|
825
837
|
break;
|
|
838
|
+
case DecoratorTypes.STRING_PASSWORD:
|
|
839
|
+
const entityPassword = entity[key];
|
|
840
|
+
const passwordMetadata = metadata;
|
|
841
|
+
const confirmPassword = ReflectUtilities.getMetadata('confirmPassword', entity, key);
|
|
842
|
+
if (!EntityUtilities.isPasswordValid(entityPassword, passwordMetadata, confirmPassword)) {
|
|
843
|
+
return false;
|
|
844
|
+
}
|
|
845
|
+
break;
|
|
826
846
|
case DecoratorTypes.NUMBER_DROPDOWN:
|
|
827
847
|
return true;
|
|
828
848
|
case DecoratorTypes.NUMBER:
|
|
849
|
+
case DecoratorTypes.NUMBER_SLIDER:
|
|
829
850
|
const entityNumber = entity[key];
|
|
830
851
|
const numberMetadata = metadata;
|
|
831
852
|
if (!EntityUtilities.isNumberValid(entityNumber, numberMetadata)) {
|
|
@@ -881,6 +902,13 @@ class EntityUtilities {
|
|
|
881
902
|
return false;
|
|
882
903
|
}
|
|
883
904
|
break;
|
|
905
|
+
case DecoratorTypes.CUSTOM:
|
|
906
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
907
|
+
const customMetadata = metadata;
|
|
908
|
+
if (!customMetadata.isValid(entity[key], omit)) {
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
break;
|
|
884
912
|
default:
|
|
885
913
|
throw new Error(`Could not validate the input because the DecoratorType ${type} is not known`);
|
|
886
914
|
}
|
|
@@ -913,6 +941,21 @@ class EntityUtilities {
|
|
|
913
941
|
}
|
|
914
942
|
return true;
|
|
915
943
|
}
|
|
944
|
+
static isPasswordValid(value, metadata, confirmPassword) {
|
|
945
|
+
if (value !== confirmPassword) {
|
|
946
|
+
return false;
|
|
947
|
+
}
|
|
948
|
+
if (metadata.maxLength && value.length > metadata.maxLength) {
|
|
949
|
+
return false;
|
|
950
|
+
}
|
|
951
|
+
if (metadata.minLength && value.length < metadata.minLength) {
|
|
952
|
+
return false;
|
|
953
|
+
}
|
|
954
|
+
if (metadata.regex && !value.match(metadata.regex)) {
|
|
955
|
+
return false;
|
|
956
|
+
}
|
|
957
|
+
return true;
|
|
958
|
+
}
|
|
916
959
|
static isNumberValid(value, metadata) {
|
|
917
960
|
if (metadata.max && value > metadata.max) {
|
|
918
961
|
return false;
|
|
@@ -1013,8 +1056,6 @@ class EntityUtilities {
|
|
|
1013
1056
|
}
|
|
1014
1057
|
static isFileDataValid(value, metadata) {
|
|
1015
1058
|
const files = metadata.multiple ? value : [value];
|
|
1016
|
-
const maxSize = metadata.maxSize * 1000000;
|
|
1017
|
-
const maxSizeTotal = metadata.maxSizeTotal * 1000000;
|
|
1018
1059
|
let fileSizeTotal = 0;
|
|
1019
1060
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
1020
1061
|
for (let i = 0; i < files.length; i++) {
|
|
@@ -1024,11 +1065,11 @@ class EntityUtilities {
|
|
|
1024
1065
|
if (!FileUtilities.isMimeTypeValid(files[i].type, metadata.allowedMimeTypes)) {
|
|
1025
1066
|
return false;
|
|
1026
1067
|
}
|
|
1027
|
-
if (files[i].size > maxSize) {
|
|
1068
|
+
if (FileUtilities.transformToMegaBytes(files[i].size, 'B') > metadata.maxSize) {
|
|
1028
1069
|
return false;
|
|
1029
1070
|
}
|
|
1030
1071
|
fileSizeTotal += files[i].size;
|
|
1031
|
-
if (fileSizeTotal > maxSizeTotal) {
|
|
1072
|
+
if (FileUtilities.transformToMegaBytes(fileSizeTotal, 'B') > metadata.maxSizeTotal) {
|
|
1032
1073
|
return false;
|
|
1033
1074
|
}
|
|
1034
1075
|
}
|
|
@@ -1041,7 +1082,7 @@ class EntityUtilities {
|
|
|
1041
1082
|
* @param entityPriorChanges - The entity before the changes.
|
|
1042
1083
|
* @returns Whether or not the entity is dirty.
|
|
1043
1084
|
*/
|
|
1044
|
-
static async
|
|
1085
|
+
static async isDirty(entity, entityPriorChanges) {
|
|
1045
1086
|
if (!entityPriorChanges) {
|
|
1046
1087
|
return false;
|
|
1047
1088
|
}
|
|
@@ -1093,7 +1134,6 @@ class EntityUtilities {
|
|
|
1093
1134
|
* @param type - The type of the property.
|
|
1094
1135
|
* @returns Whether or not the given values are equal.
|
|
1095
1136
|
*/
|
|
1096
|
-
// eslint-disable-next-line max-len
|
|
1097
1137
|
static async isEqual(value, valuePriorChanges, metadata, type) {
|
|
1098
1138
|
switch (type) {
|
|
1099
1139
|
case DecoratorTypes.DATE_RANGE:
|
|
@@ -1110,6 +1150,9 @@ class EntityUtilities {
|
|
|
1110
1150
|
case DecoratorTypes.FILE_IMAGE:
|
|
1111
1151
|
case DecoratorTypes.FILE_DEFAULT:
|
|
1112
1152
|
return EntityUtilities.isEqualFile(value, valuePriorChanges, metadata.multiple);
|
|
1153
|
+
case DecoratorTypes.CUSTOM:
|
|
1154
|
+
// eslint-disable-next-line max-len, @typescript-eslint/no-explicit-any
|
|
1155
|
+
return EntityUtilities.isEqualCustom(value, valuePriorChanges, metadata);
|
|
1113
1156
|
default:
|
|
1114
1157
|
return LodashUtilities.isEqual(value, valuePriorChanges);
|
|
1115
1158
|
}
|
|
@@ -1178,6 +1221,14 @@ class EntityUtilities {
|
|
|
1178
1221
|
}
|
|
1179
1222
|
return true;
|
|
1180
1223
|
}
|
|
1224
|
+
static isEqualCustom(value, valuePriorChanges,
|
|
1225
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1226
|
+
metadata) {
|
|
1227
|
+
if (!metadata.isEqual(value, valuePriorChanges, metadata)) {
|
|
1228
|
+
return false;
|
|
1229
|
+
}
|
|
1230
|
+
return true;
|
|
1231
|
+
}
|
|
1181
1232
|
/**
|
|
1182
1233
|
* Compare function for sorting entity keys by their order value.
|
|
1183
1234
|
*
|
|
@@ -1234,38 +1285,84 @@ class EntityUtilities {
|
|
|
1234
1285
|
* Gets the rows that are used to display the given entity.
|
|
1235
1286
|
*
|
|
1236
1287
|
* @param entity - The entity to get the rows from.
|
|
1288
|
+
* @param tab - The tab number for which the rows should be returned.
|
|
1237
1289
|
* @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
|
|
1238
1290
|
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
1239
1291
|
* @returns The sorted Rows containing the row number and the keys to display in that row.
|
|
1240
1292
|
*/
|
|
1241
|
-
static getEntityRows(entity, hideOmitForCreate
|
|
1293
|
+
static getEntityRows(entity, tab, hideOmitForCreate, hideOmitForEdit) {
|
|
1242
1294
|
const res = [];
|
|
1243
1295
|
const keys = EntityUtilities.keysOf(entity, hideOmitForCreate, hideOmitForEdit);
|
|
1244
|
-
const numberOfRows = EntityUtilities.getNumberOfRows(keys, entity);
|
|
1296
|
+
const numberOfRows = EntityUtilities.getNumberOfRows(keys, entity, tab);
|
|
1245
1297
|
for (let i = 1; i <= numberOfRows; i++) {
|
|
1246
1298
|
const row = {
|
|
1247
1299
|
row: i,
|
|
1248
|
-
keys: EntityUtilities.getKeysForRow(keys, entity, i)
|
|
1300
|
+
keys: EntityUtilities.getKeysForRow(keys, entity, i, tab)
|
|
1249
1301
|
};
|
|
1250
1302
|
res.push(row);
|
|
1251
1303
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1304
|
+
if (EntityUtilities.getKeysForRow(keys, entity, -1, tab).length) {
|
|
1305
|
+
const lastRow = {
|
|
1306
|
+
row: numberOfRows + 1,
|
|
1307
|
+
keys: EntityUtilities.getKeysForRow(keys, entity, -1, tab)
|
|
1308
|
+
};
|
|
1309
|
+
res.push(lastRow);
|
|
1310
|
+
}
|
|
1311
|
+
return res;
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
* Gets the tabs that are used to display the given entity.
|
|
1315
|
+
*
|
|
1316
|
+
* @param entity - The entity to get the rows from.
|
|
1317
|
+
* @param hideOmitForCreate - Whether or not keys with the metadata omitForCreate should be filtered out.
|
|
1318
|
+
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
1319
|
+
* @returns The sorted Tabs containing the rows and the keys to display in that row.
|
|
1320
|
+
*/
|
|
1321
|
+
static getEntityTabs(entity, hideOmitForCreate = false, hideOmitForEdit = false) {
|
|
1322
|
+
const res = [];
|
|
1323
|
+
const keys = EntityUtilities.keysOf(entity, hideOmitForCreate, hideOmitForEdit);
|
|
1324
|
+
const numberOfTabs = EntityUtilities.getNumberOfTabs(keys, entity);
|
|
1325
|
+
if (EntityUtilities.getEntityRows(entity, -1, hideOmitForCreate, hideOmitForEdit).length) {
|
|
1326
|
+
const firstTab = {
|
|
1327
|
+
tabName: 'Tab 1',
|
|
1328
|
+
tab: -1,
|
|
1329
|
+
rows: EntityUtilities.getEntityRows(entity, -1, hideOmitForCreate, hideOmitForEdit)
|
|
1330
|
+
};
|
|
1331
|
+
res.push(firstTab);
|
|
1332
|
+
}
|
|
1333
|
+
for (let i = 2; i <= numberOfTabs; i++) {
|
|
1334
|
+
const tab = {
|
|
1335
|
+
tabName: EntityUtilities.getTabName(entity, i),
|
|
1336
|
+
tab: i,
|
|
1337
|
+
rows: EntityUtilities.getEntityRows(entity, i, hideOmitForCreate, hideOmitForEdit)
|
|
1338
|
+
};
|
|
1339
|
+
res.push(tab);
|
|
1340
|
+
}
|
|
1257
1341
|
return res;
|
|
1258
1342
|
}
|
|
1259
|
-
static getKeysForRow(keys, entity,
|
|
1343
|
+
static getKeysForRow(keys, entity, row, tab) {
|
|
1260
1344
|
return keys
|
|
1261
|
-
.filter(k => EntityUtilities.getPropertyMetadata(entity, k).position.row ===
|
|
1345
|
+
.filter(k => EntityUtilities.getPropertyMetadata(entity, k).position.row === row)
|
|
1346
|
+
.filter(k => EntityUtilities.getPropertyMetadata(entity, k).position.tab === tab)
|
|
1262
1347
|
.sort((a, b) => EntityUtilities.compareOrder(a, b, entity));
|
|
1263
1348
|
}
|
|
1264
|
-
static getNumberOfRows(keys, entity) {
|
|
1349
|
+
static getNumberOfRows(keys, entity, tab) {
|
|
1265
1350
|
return keys
|
|
1351
|
+
.filter(k => EntityUtilities.getPropertyMetadata(entity, k).position.tab === tab)
|
|
1266
1352
|
.map(k => EntityUtilities.getPropertyMetadata(entity, k).position.row)
|
|
1267
1353
|
.sort((a, b) => (a > b ? -1 : 1))[0];
|
|
1268
1354
|
}
|
|
1355
|
+
static getNumberOfTabs(keys, entity) {
|
|
1356
|
+
return keys
|
|
1357
|
+
.map(k => EntityUtilities.getPropertyMetadata(entity, k).position.tab)
|
|
1358
|
+
.sort((a, b) => (a > b ? -1 : 1))[0];
|
|
1359
|
+
}
|
|
1360
|
+
static getTabName(entity, tab) {
|
|
1361
|
+
const providedTabName = EntityUtilities.keysOf(entity)
|
|
1362
|
+
.map(k => EntityUtilities.getPropertyMetadata(entity, k))
|
|
1363
|
+
.find(m => m.position.tab === tab && m.position.tabName)?.position.tabName;
|
|
1364
|
+
return providedTabName ?? `Tab ${tab}`;
|
|
1365
|
+
}
|
|
1269
1366
|
/**
|
|
1270
1367
|
* Gets the keys of the provided entity correctly typed.
|
|
1271
1368
|
*
|
|
@@ -1292,6 +1389,26 @@ EntityUtilities.construct = EntityUtilities.new;
|
|
|
1292
1389
|
// eslint-disable-next-line @typescript-eslint/member-ordering, jsdoc/require-jsdoc
|
|
1293
1390
|
EntityUtilities.build = EntityUtilities.new;
|
|
1294
1391
|
|
|
1392
|
+
/**
|
|
1393
|
+
* A base Entity class with a builtin id.
|
|
1394
|
+
*/
|
|
1395
|
+
class Entity {
|
|
1396
|
+
constructor(entity) {
|
|
1397
|
+
EntityUtilities.new(this, entity);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
__decorate([
|
|
1401
|
+
string({
|
|
1402
|
+
omitForCreate: true,
|
|
1403
|
+
omitForUpdate: true,
|
|
1404
|
+
display: false,
|
|
1405
|
+
displayStyle: 'line',
|
|
1406
|
+
displayName: 'ID',
|
|
1407
|
+
required: true
|
|
1408
|
+
}),
|
|
1409
|
+
__metadata("design:type", String)
|
|
1410
|
+
], Entity.prototype, "id", void 0);
|
|
1411
|
+
|
|
1295
1412
|
/**
|
|
1296
1413
|
* A generic EntityService class.
|
|
1297
1414
|
* Offers basic CRUD-functionality.
|
|
@@ -1581,10 +1698,10 @@ class NgxMatEntityConfirmDialogComponent {
|
|
|
1581
1698
|
}
|
|
1582
1699
|
}
|
|
1583
1700
|
NgxMatEntityConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityConfirmDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
1584
|
-
NgxMatEntityConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityConfirmDialogComponent, selector: "ngx-mat-entity-confirm-dialog", ngImport: i0, template: "<h2 mat-dialog-title *ngIf=\"data.title\">{{data.title}}</h2>\n\n<mat-dialog-content>\n <p *ngFor=\"let paragraph of data.text\">{{paragraph}}</p>\n <div *ngIf=\"data.requireConfirmation\" class=\"checkbox-wrapper\">\n <mat-checkbox [(ngModel)]=\"confirm\" name=\"confirm\">\n {{data.confirmationText}}\n </mat-checkbox>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button *ngIf=\"data.type === 'delete'\" mat-raised-button color=\"warn\" (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'delete'\" mat-raised-button (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'info-only'\" mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: [".checkbox-wrapper{min-height:50px;display:flex}.checkbox-wrapper>mat-checkbox{align-self:center}mat-dialog-actions{
|
|
1701
|
+
NgxMatEntityConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityConfirmDialogComponent, selector: "ngx-mat-entity-confirm-dialog", ngImport: i0, template: "<h2 mat-dialog-title *ngIf=\"data.title\">{{data.title}}</h2>\n\n<mat-dialog-content>\n <p *ngFor=\"let paragraph of data.text\">{{paragraph}}</p>\n <div *ngIf=\"data.requireConfirmation\" class=\"checkbox-wrapper\">\n <mat-checkbox [(ngModel)]=\"confirm\" name=\"confirm\">\n {{data.confirmationText}}\n </mat-checkbox>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button *ngIf=\"data.type === 'delete'\" mat-raised-button color=\"warn\" (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'delete'\" mat-raised-button (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'info-only'\" mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: [".checkbox-wrapper{min-height:50px;display:flex}.checkbox-wrapper>mat-checkbox{align-self:center}mat-dialog-actions{justify-content:space-between}\n"], components: [{ type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
|
|
1585
1702
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityConfirmDialogComponent, decorators: [{
|
|
1586
1703
|
type: Component,
|
|
1587
|
-
args: [{ selector: 'ngx-mat-entity-confirm-dialog', template: "<h2 mat-dialog-title *ngIf=\"data.title\">{{data.title}}</h2>\n\n<mat-dialog-content>\n <p *ngFor=\"let paragraph of data.text\">{{paragraph}}</p>\n <div *ngIf=\"data.requireConfirmation\" class=\"checkbox-wrapper\">\n <mat-checkbox [(ngModel)]=\"confirm\" name=\"confirm\">\n {{data.confirmationText}}\n </mat-checkbox>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button *ngIf=\"data.type === 'delete'\" mat-raised-button color=\"warn\" (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'delete'\" mat-raised-button (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'info-only'\" mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: [".checkbox-wrapper{min-height:50px;display:flex}.checkbox-wrapper>mat-checkbox{align-self:center}mat-dialog-actions{
|
|
1704
|
+
args: [{ selector: 'ngx-mat-entity-confirm-dialog', template: "<h2 mat-dialog-title *ngIf=\"data.title\">{{data.title}}</h2>\n\n<mat-dialog-content>\n <p *ngFor=\"let paragraph of data.text\">{{paragraph}}</p>\n <div *ngIf=\"data.requireConfirmation\" class=\"checkbox-wrapper\">\n <mat-checkbox [(ngModel)]=\"confirm\" name=\"confirm\">\n {{data.confirmationText}}\n </mat-checkbox>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button *ngIf=\"data.type === 'delete'\" mat-raised-button color=\"warn\" (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'delete'\" mat-raised-button (click)=\"confirmAction()\" [disabled]=\"data.requireConfirmation && !confirm\" class=\"confirm-button\">\n {{data.confirmButtonLabel}}\n </button>\n <button *ngIf=\"data.type !== 'info-only'\" mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: [".checkbox-wrapper{min-height:50px;display:flex}.checkbox-wrapper>mat-checkbox{align-self:center}mat-dialog-actions{justify-content:space-between}\n"] }]
|
|
1588
1705
|
}], ctorParameters: function () { return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
1589
1706
|
type: Inject,
|
|
1590
1707
|
args: [MAT_DIALOG_DATA]
|
|
@@ -1698,67 +1815,92 @@ class AddArrayItemDialogDataBuilder extends BaseBuilder {
|
|
|
1698
1815
|
}
|
|
1699
1816
|
}
|
|
1700
1817
|
|
|
1701
|
-
|
|
1702
|
-
class
|
|
1818
|
+
/**
|
|
1819
|
+
* The abstract base class of any ngx-mat-entity input.
|
|
1820
|
+
* Extend from this when implementing your own custom decorator.
|
|
1821
|
+
*
|
|
1822
|
+
* It already provides:
|
|
1823
|
+
*
|
|
1824
|
+
* - entity: The entity which the property is on. (type-safe due to the Generic "EntityType")
|
|
1825
|
+
* - key: The key of the property. (type-safe due to the Generic "EntityType")
|
|
1826
|
+
* - getValidationErrorMessage: The function that generates the error message when the input is invalid.
|
|
1827
|
+
* - isReadOnly: Whether or not the input is read only. Can be used to disable elements.
|
|
1828
|
+
* - propertyValue: Just the typed version of the property, its the same as entity[key].
|
|
1829
|
+
* - metadata: The metadata of the property. (type-safe due to the Generic "CustomMetadataType")
|
|
1830
|
+
* - ngOnInit: Gets the metadata for the property, be aware of this when overriding this method.
|
|
1831
|
+
* - emitChange: Should be called when the input has changed. This is needed to trigger validation and dirty checks.
|
|
1832
|
+
*/
|
|
1833
|
+
// eslint-disable-next-line max-len
|
|
1834
|
+
class NgxMatEntityBaseInputComponent {
|
|
1703
1835
|
constructor() {
|
|
1704
1836
|
this.inputChangeEvent = new EventEmitter();
|
|
1705
1837
|
}
|
|
1838
|
+
// eslint-disable-next-line jsdoc/require-returns
|
|
1839
|
+
/**
|
|
1840
|
+
* The property value of entity[key] correctly typed.
|
|
1841
|
+
* Uses getters and setters so that inputs are always linked to the original value.
|
|
1842
|
+
*/
|
|
1843
|
+
get propertyValue() {
|
|
1844
|
+
return this.entity[this.key];
|
|
1845
|
+
}
|
|
1846
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
1847
|
+
set propertyValue(value) {
|
|
1848
|
+
this.entity[this.key] = value;
|
|
1849
|
+
}
|
|
1706
1850
|
ngOnInit() {
|
|
1707
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key
|
|
1851
|
+
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key);
|
|
1708
1852
|
}
|
|
1853
|
+
/**
|
|
1854
|
+
* Should emit when the input has changed. This is needed to trigger validation and dirty checks.
|
|
1855
|
+
*/
|
|
1709
1856
|
emitChange() {
|
|
1710
1857
|
this.inputChangeEvent.emit();
|
|
1711
1858
|
}
|
|
1712
1859
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type:
|
|
1860
|
+
NgxMatEntityBaseInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityBaseInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1861
|
+
NgxMatEntityBaseInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityBaseInputComponent, selector: "ngx-mat-entity-base-input", inputs: { entity: "entity", key: "key", getValidationErrorMessage: "getValidationErrorMessage", isReadOnly: "isReadOnly" }, outputs: { inputChangeEvent: "inputChangeEvent" }, ngImport: i0, template: '', isInline: true });
|
|
1862
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityBaseInputComponent, decorators: [{
|
|
1716
1863
|
type: Component,
|
|
1717
|
-
args: [{
|
|
1718
|
-
|
|
1864
|
+
args: [{
|
|
1865
|
+
selector: 'ngx-mat-entity-base-input',
|
|
1866
|
+
template: ''
|
|
1867
|
+
}]
|
|
1868
|
+
}], propDecorators: { entity: [{
|
|
1719
1869
|
type: Input
|
|
1720
1870
|
}], key: [{
|
|
1721
1871
|
type: Input
|
|
1722
1872
|
}], getValidationErrorMessage: [{
|
|
1723
1873
|
type: Input
|
|
1874
|
+
}], isReadOnly: [{
|
|
1875
|
+
type: Input
|
|
1724
1876
|
}], inputChangeEvent: [{
|
|
1725
1877
|
type: Output
|
|
1726
1878
|
}] } });
|
|
1727
1879
|
|
|
1728
1880
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1729
|
-
class
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1881
|
+
class StringInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1882
|
+
}
|
|
1883
|
+
StringInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1884
|
+
StringInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringInputComponent, selector: "string-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i3$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1885
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringInputComponent, decorators: [{
|
|
1886
|
+
type: Component,
|
|
1887
|
+
args: [{ selector: 'string-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
1888
|
+
}] });
|
|
1889
|
+
|
|
1890
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
1891
|
+
class StringTextboxInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1739
1892
|
}
|
|
1740
|
-
StringTextboxInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringTextboxInputComponent, deps:
|
|
1741
|
-
StringTextboxInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringTextboxInputComponent, selector: "string-textbox-input",
|
|
1893
|
+
StringTextboxInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringTextboxInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1894
|
+
StringTextboxInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringTextboxInputComponent, selector: "string-textbox-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <textarea\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"10\"\n [required]=\"metadata.required\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n </textarea>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$2.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1742
1895
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringTextboxInputComponent, decorators: [{
|
|
1743
1896
|
type: Component,
|
|
1744
|
-
args: [{ selector: 'string-textbox-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <textarea\n matInput\n [(ngModel)]=\"
|
|
1745
|
-
}]
|
|
1746
|
-
type: Input
|
|
1747
|
-
}], key: [{
|
|
1748
|
-
type: Input
|
|
1749
|
-
}], getValidationErrorMessage: [{
|
|
1750
|
-
type: Input
|
|
1751
|
-
}], inputChangeEvent: [{
|
|
1752
|
-
type: Output
|
|
1753
|
-
}] } });
|
|
1897
|
+
args: [{ selector: 'string-textbox-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <textarea\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"10\"\n [required]=\"metadata.required\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n </textarea>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
1898
|
+
}] });
|
|
1754
1899
|
|
|
1755
1900
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1756
|
-
class StringAutocompleteInputComponent {
|
|
1757
|
-
constructor() {
|
|
1758
|
-
this.inputChangeEvent = new EventEmitter();
|
|
1759
|
-
}
|
|
1901
|
+
class StringAutocompleteInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1760
1902
|
ngOnInit() {
|
|
1761
|
-
|
|
1903
|
+
super.ngOnInit();
|
|
1762
1904
|
this.autocompleteStrings = this.metadata.autocompleteValues;
|
|
1763
1905
|
this.filteredAutocompleteStrings = LodashUtilities.cloneDeep(this.autocompleteStrings);
|
|
1764
1906
|
}
|
|
@@ -1768,223 +1910,144 @@ class StringAutocompleteInputComponent {
|
|
|
1768
1910
|
* @param input - The input of the user.
|
|
1769
1911
|
*/
|
|
1770
1912
|
filterAutocompleteStrings(input) {
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
const filterValue = inputString.toLowerCase();
|
|
1774
|
-
this.filteredAutocompleteStrings = this.autocompleteStrings.filter(s => s.toLowerCase().includes(filterValue));
|
|
1913
|
+
if (input) {
|
|
1914
|
+
this.filteredAutocompleteStrings = this.autocompleteStrings.filter(s => s.toLowerCase().includes(input.toLowerCase()));
|
|
1775
1915
|
}
|
|
1776
1916
|
}
|
|
1777
|
-
emitChange() {
|
|
1778
|
-
this.inputChangeEvent.emit();
|
|
1779
|
-
}
|
|
1780
1917
|
}
|
|
1781
|
-
StringAutocompleteInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringAutocompleteInputComponent, deps:
|
|
1782
|
-
StringAutocompleteInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringAutocompleteInputComponent, selector: "string-autocomplete-input",
|
|
1918
|
+
StringAutocompleteInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringAutocompleteInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1919
|
+
StringAutocompleteInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringAutocompleteInputComponent, selector: "string-autocomplete-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matAutocomplete]=\"auto\"\n (keyup)=\"filterAutocompleteStrings(propertyValue)\"\n [required]=\"metadata.required\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-autocomplete #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let value of filteredAutocompleteStrings\" [value]=\"value\">\n {{value}}\n </mat-option>\n </mat-autocomplete>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i3$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i3$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1783
1920
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringAutocompleteInputComponent, decorators: [{
|
|
1784
1921
|
type: Component,
|
|
1785
|
-
args: [{ selector: 'string-autocomplete-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"
|
|
1786
|
-
}]
|
|
1787
|
-
type: Input
|
|
1788
|
-
}], key: [{
|
|
1789
|
-
type: Input
|
|
1790
|
-
}], getValidationErrorMessage: [{
|
|
1791
|
-
type: Input
|
|
1792
|
-
}], inputChangeEvent: [{
|
|
1793
|
-
type: Output
|
|
1794
|
-
}] } });
|
|
1922
|
+
args: [{ selector: 'string-autocomplete-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matAutocomplete]=\"auto\"\n (keyup)=\"filterAutocompleteStrings(propertyValue)\"\n [required]=\"metadata.required\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-autocomplete #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let value of filteredAutocompleteStrings\" [value]=\"value\">\n {{value}}\n </mat-option>\n </mat-autocomplete>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
1923
|
+
}] });
|
|
1795
1924
|
|
|
1796
1925
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1797
|
-
class StringDropdownInputComponent {
|
|
1798
|
-
constructor() {
|
|
1799
|
-
this.inputChangeEvent = new EventEmitter();
|
|
1800
|
-
}
|
|
1801
|
-
ngOnInit() {
|
|
1802
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.STRING_DROPDOWN);
|
|
1803
|
-
}
|
|
1804
|
-
emitChange() {
|
|
1805
|
-
this.inputChangeEvent.emit();
|
|
1806
|
-
}
|
|
1926
|
+
class StringDropdownInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1807
1927
|
}
|
|
1808
|
-
StringDropdownInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringDropdownInputComponent, deps:
|
|
1809
|
-
StringDropdownInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringDropdownInputComponent, selector: "string-dropdown-input",
|
|
1928
|
+
StringDropdownInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringDropdownInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1929
|
+
StringDropdownInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringDropdownInputComponent, selector: "string-dropdown-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select (ngModelChange)=\"emitChange()\" [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\" [required]=\"metadata.required\" [disabled]=\"isReadOnly\">\n <mat-option *ngFor=\"let value of metadata.dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1810
1930
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringDropdownInputComponent, decorators: [{
|
|
1811
1931
|
type: Component,
|
|
1812
|
-
args: [{ selector: 'string-dropdown-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select (ngModelChange)=\"emitChange()\" [(ngModel)]=\"
|
|
1813
|
-
}]
|
|
1814
|
-
type: Input
|
|
1815
|
-
}], key: [{
|
|
1816
|
-
type: Input
|
|
1817
|
-
}], getValidationErrorMessage: [{
|
|
1818
|
-
type: Input
|
|
1819
|
-
}], inputChangeEvent: [{
|
|
1820
|
-
type: Output
|
|
1821
|
-
}] } });
|
|
1932
|
+
args: [{ selector: 'string-dropdown-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select (ngModelChange)=\"emitChange()\" [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\" [required]=\"metadata.required\" [disabled]=\"isReadOnly\">\n <mat-option *ngFor=\"let value of metadata.dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
1933
|
+
}] });
|
|
1822
1934
|
|
|
1823
1935
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1824
|
-
class
|
|
1936
|
+
class StringPasswordInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1825
1937
|
constructor() {
|
|
1826
|
-
|
|
1938
|
+
super(...arguments);
|
|
1939
|
+
this.hide = true;
|
|
1940
|
+
this.hideConfirm = true;
|
|
1827
1941
|
}
|
|
1828
1942
|
ngOnInit() {
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1943
|
+
super.ngOnInit();
|
|
1944
|
+
this.confirmRequired = this.metadata.required;
|
|
1945
|
+
this.confirmPassword = LodashUtilities.cloneDeep(this.propertyValue);
|
|
1946
|
+
ReflectUtilities.defineMetadata('confirmPassword', this.confirmPassword, this.entity, this.key);
|
|
1947
|
+
}
|
|
1948
|
+
passwordInput() {
|
|
1949
|
+
this.confirmRequired = Boolean(this.propertyValue);
|
|
1950
|
+
ReflectUtilities.defineMetadata('confirmPassword', this.confirmPassword, this.entity, this.key);
|
|
1951
|
+
this.emitChange();
|
|
1833
1952
|
}
|
|
1834
|
-
|
|
1835
|
-
|
|
1953
|
+
}
|
|
1954
|
+
StringPasswordInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringPasswordInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1955
|
+
StringPasswordInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: StringPasswordInputComponent, selector: "string-password-input", usesInheritance: true, ngImport: i0, template: "<div class=\"password-row\">\n <mat-form-field [class.w-50]=\"metadata.needsConfirmation\" [class.w-100]=\"!metadata.needsConfirmation\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n [type]=\"hide ? 'password' : 'text'\"\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n (ngModelChange)=\"passwordInput()\"\n [disabled]=\"isReadOnly\"\n >\n <button (click)=\"hide = !hide\" [disabled]=\"isReadOnly\" mat-icon-button matSuffix>\n <i *ngIf=\"hide\" class=\"fas fa-eye-slash\"></i>\n <i *ngIf=\"!hide\" class=\"fas fa-eye\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <div *ngIf=\"metadata.needsConfirmation\" style=\"margin-left: 5px;margin-right: 5px;\"></div>\n <mat-form-field class=\"w-50\" *ngIf=\"metadata.needsConfirmation\">\n <mat-label>{{metadata.confirmationDisplayName}}</mat-label>\n <input\n [type]=\"hideConfirm ? 'password' : 'text'\"\n matInput\n [(ngModel)]=\"confirmPassword\"\n [name]=\"key.toString() + 'confirmPassword'\"\n #confirmModel=\"ngModel\"\n [required]=\"metadata.required || confirmRequired\"\n (ngModelChange)=\"passwordInput()\"\n [disabled]=\"isReadOnly\"\n >\n <button (click)=\"hideConfirm = !hideConfirm\" [disabled]=\"isReadOnly\" mat-icon-button matSuffix>\n <i *ngIf=\"hideConfirm\" class=\"fas fa-eye-slash\"></i>\n <i *ngIf=\"!hideConfirm\" class=\"fas fa-eye\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(confirmModel)}}</mat-error>\n </mat-form-field>\n</div>\n\n<mat-error *ngIf=\"metadata.needsConfirmation && propertyValue && confirmPassword && (confirmPassword !== propertyValue)\">\n {{metadata.passwordsDontMatchErrorMessage}}\n</mat-error>", styles: [".password-row{display:flex;justify-content:space-between}.w-50{width:50%}.w-100{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i3$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i3$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StringPasswordInputComponent, decorators: [{
|
|
1957
|
+
type: Component,
|
|
1958
|
+
args: [{ selector: 'string-password-input', template: "<div class=\"password-row\">\n <mat-form-field [class.w-50]=\"metadata.needsConfirmation\" [class.w-100]=\"!metadata.needsConfirmation\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n [type]=\"hide ? 'password' : 'text'\"\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n [minlength]=\"metadata.minLength ?? null\"\n [maxlength]=\"metadata.maxLength ?? null\"\n (ngModelChange)=\"passwordInput()\"\n [disabled]=\"isReadOnly\"\n >\n <button (click)=\"hide = !hide\" [disabled]=\"isReadOnly\" mat-icon-button matSuffix>\n <i *ngIf=\"hide\" class=\"fas fa-eye-slash\"></i>\n <i *ngIf=\"!hide\" class=\"fas fa-eye\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <div *ngIf=\"metadata.needsConfirmation\" style=\"margin-left: 5px;margin-right: 5px;\"></div>\n <mat-form-field class=\"w-50\" *ngIf=\"metadata.needsConfirmation\">\n <mat-label>{{metadata.confirmationDisplayName}}</mat-label>\n <input\n [type]=\"hideConfirm ? 'password' : 'text'\"\n matInput\n [(ngModel)]=\"confirmPassword\"\n [name]=\"key.toString() + 'confirmPassword'\"\n #confirmModel=\"ngModel\"\n [required]=\"metadata.required || confirmRequired\"\n (ngModelChange)=\"passwordInput()\"\n [disabled]=\"isReadOnly\"\n >\n <button (click)=\"hideConfirm = !hideConfirm\" [disabled]=\"isReadOnly\" mat-icon-button matSuffix>\n <i *ngIf=\"hideConfirm\" class=\"fas fa-eye-slash\"></i>\n <i *ngIf=\"!hideConfirm\" class=\"fas fa-eye\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(confirmModel)}}</mat-error>\n </mat-form-field>\n</div>\n\n<mat-error *ngIf=\"metadata.needsConfirmation && propertyValue && confirmPassword && (confirmPassword !== propertyValue)\">\n {{metadata.passwordsDontMatchErrorMessage}}\n</mat-error>", styles: [".password-row{display:flex;justify-content:space-between}.w-50{width:50%}.w-100{width:100%}\n"] }]
|
|
1959
|
+
}] });
|
|
1960
|
+
|
|
1961
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
1962
|
+
class BooleanCheckboxInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1963
|
+
ngOnInit() {
|
|
1964
|
+
super.ngOnInit();
|
|
1965
|
+
this.propertyValue = this.propertyValue ?? false;
|
|
1836
1966
|
}
|
|
1837
1967
|
}
|
|
1838
|
-
BooleanCheckboxInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanCheckboxInputComponent, deps:
|
|
1839
|
-
BooleanCheckboxInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: BooleanCheckboxInputComponent, selector: "boolean-checkbox-input",
|
|
1968
|
+
BooleanCheckboxInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanCheckboxInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1969
|
+
BooleanCheckboxInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: BooleanCheckboxInputComponent, selector: "boolean-checkbox-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-checkbox\n color=\"primary\"\n (ngModelChange)=\"emitChange()\"\n (click)=\"model.control.markAsTouched()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n [disabled]=\"isReadOnly\"\n [class.disabled]=\"isReadOnly\"\n [class.mat-checkbox-disabled]=\"false\"\n >\n </mat-checkbox>\n <!-- hidden input is needed so that the checkbox can be used inside a mat-form-field -->\n <input matInput hidden\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString() + 'Helper'\"\n #model=\"ngModel\"\n [pattern]=\"metadata.required ? 'true' : '[\\\\s\\\\S]*'\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["::ng-deep .hideUnderline .mat-form-field-underline{opacity:0%}::ng-deep .disabled .mat-checkbox-ripple{display:none}::ng-deep .disabled:hover{cursor:default}mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1840
1970
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanCheckboxInputComponent, decorators: [{
|
|
1841
1971
|
type: Component,
|
|
1842
|
-
args: [{ selector: 'boolean-checkbox-input', template: "<mat-form-field class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-checkbox
|
|
1843
|
-
}]
|
|
1844
|
-
type: Input
|
|
1845
|
-
}], key: [{
|
|
1846
|
-
type: Input
|
|
1847
|
-
}], getValidationErrorMessage: [{
|
|
1848
|
-
type: Input
|
|
1849
|
-
}], inputChangeEvent: [{
|
|
1850
|
-
type: Output
|
|
1851
|
-
}] } });
|
|
1972
|
+
args: [{ selector: 'boolean-checkbox-input', template: "<mat-form-field class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-checkbox\n color=\"primary\"\n (ngModelChange)=\"emitChange()\"\n (click)=\"model.control.markAsTouched()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n [disabled]=\"isReadOnly\"\n [class.disabled]=\"isReadOnly\"\n [class.mat-checkbox-disabled]=\"false\"\n >\n </mat-checkbox>\n <!-- hidden input is needed so that the checkbox can be used inside a mat-form-field -->\n <input matInput hidden\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString() + 'Helper'\"\n #model=\"ngModel\"\n [pattern]=\"metadata.required ? 'true' : '[\\\\s\\\\S]*'\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["::ng-deep .hideUnderline .mat-form-field-underline{opacity:0%}::ng-deep .disabled .mat-checkbox-ripple{display:none}::ng-deep .disabled:hover{cursor:default}mat-form-field{width:100%}\n"] }]
|
|
1973
|
+
}] });
|
|
1852
1974
|
|
|
1853
1975
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1854
|
-
class BooleanToggleInputComponent {
|
|
1855
|
-
constructor() {
|
|
1856
|
-
this.inputChangeEvent = new EventEmitter();
|
|
1857
|
-
}
|
|
1976
|
+
class BooleanToggleInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1858
1977
|
ngOnInit() {
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
this.entity[this.key] = false;
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
emitChange() {
|
|
1865
|
-
this.inputChangeEvent.emit();
|
|
1978
|
+
super.ngOnInit();
|
|
1979
|
+
this.propertyValue = this.propertyValue ?? false;
|
|
1866
1980
|
}
|
|
1867
1981
|
}
|
|
1868
|
-
BooleanToggleInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanToggleInputComponent, deps:
|
|
1869
|
-
BooleanToggleInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: BooleanToggleInputComponent, selector: "boolean-toggle-input",
|
|
1982
|
+
BooleanToggleInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanToggleInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1983
|
+
BooleanToggleInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: BooleanToggleInputComponent, selector: "boolean-toggle-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-slide-toggle\n color=\"primary\"\n (click)=\"model.control.markAsTouched()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n [disabled]=\"isReadOnly\"\n >\n </mat-slide-toggle>\n <!-- hidden input is needed so that the toggle can be used inside a mat-form-field -->\n <input matInput hidden\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString() + 'Helper'\"\n #model=\"ngModel\"\n [pattern]=\"metadata.required ? 'true' : '[\\\\s\\\\S]*'\"\n [required]=\"metadata.required\"\n (ngModelChange)=\"emitChange()\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["::ng-deep .hideUnderline .mat-form-field-underline{opacity:0%}mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1870
1984
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanToggleInputComponent, decorators: [{
|
|
1871
1985
|
type: Component,
|
|
1872
|
-
args: [{ selector: 'boolean-toggle-input', template: "<mat-form-field class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-slide-toggle
|
|
1873
|
-
}]
|
|
1874
|
-
type: Input
|
|
1875
|
-
}], key: [{
|
|
1876
|
-
type: Input
|
|
1877
|
-
}], getValidationErrorMessage: [{
|
|
1878
|
-
type: Input
|
|
1879
|
-
}], inputChangeEvent: [{
|
|
1880
|
-
type: Output
|
|
1881
|
-
}] } });
|
|
1986
|
+
args: [{ selector: 'boolean-toggle-input', template: "<mat-form-field class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-slide-toggle\n color=\"primary\"\n (click)=\"model.control.markAsTouched()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n [disabled]=\"isReadOnly\"\n >\n </mat-slide-toggle>\n <!-- hidden input is needed so that the toggle can be used inside a mat-form-field -->\n <input matInput hidden\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString() + 'Helper'\"\n #model=\"ngModel\"\n [pattern]=\"metadata.required ? 'true' : '[\\\\s\\\\S]*'\"\n [required]=\"metadata.required\"\n (ngModelChange)=\"emitChange()\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["::ng-deep .hideUnderline .mat-form-field-underline{opacity:0%}mat-form-field{width:100%}\n"] }]
|
|
1987
|
+
}] });
|
|
1882
1988
|
|
|
1883
1989
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1884
|
-
class BooleanDropdownInputComponent {
|
|
1885
|
-
constructor() {
|
|
1886
|
-
this.inputChangeEvent = new EventEmitter();
|
|
1887
|
-
}
|
|
1888
|
-
ngOnInit() {
|
|
1889
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.BOOLEAN_DROPDOWN);
|
|
1890
|
-
}
|
|
1891
|
-
emitChange() {
|
|
1892
|
-
this.inputChangeEvent.emit();
|
|
1893
|
-
}
|
|
1990
|
+
class BooleanDropdownInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1894
1991
|
}
|
|
1895
|
-
BooleanDropdownInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanDropdownInputComponent, deps:
|
|
1896
|
-
BooleanDropdownInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: BooleanDropdownInputComponent, selector: "boolean-dropdown-input",
|
|
1992
|
+
BooleanDropdownInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanDropdownInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1993
|
+
BooleanDropdownInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: BooleanDropdownInputComponent, selector: "boolean-dropdown-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-option [value]=\"undefined\">-</mat-option>\n <mat-option [value]=\"true\">{{metadata.dropdownTrue}}</mat-option>\n <mat-option [value]=\"false\">{{metadata.dropdownFalse}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1897
1994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BooleanDropdownInputComponent, decorators: [{
|
|
1898
1995
|
type: Component,
|
|
1899
|
-
args: [{ selector: 'boolean-dropdown-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select
|
|
1900
|
-
}]
|
|
1901
|
-
type: Input
|
|
1902
|
-
}], key: [{
|
|
1903
|
-
type: Input
|
|
1904
|
-
}], getValidationErrorMessage: [{
|
|
1905
|
-
type: Input
|
|
1906
|
-
}], inputChangeEvent: [{
|
|
1907
|
-
type: Output
|
|
1908
|
-
}] } });
|
|
1996
|
+
args: [{ selector: 'boolean-dropdown-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-option [value]=\"undefined\">-</mat-option>\n <mat-option [value]=\"true\">{{metadata.dropdownTrue}}</mat-option>\n <mat-option [value]=\"false\">{{metadata.dropdownFalse}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
1997
|
+
}] });
|
|
1909
1998
|
|
|
1910
1999
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1911
|
-
class NumberInputComponent {
|
|
1912
|
-
constructor() {
|
|
1913
|
-
this.inputChangeEvent = new EventEmitter();
|
|
1914
|
-
}
|
|
1915
|
-
ngOnInit() {
|
|
1916
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.NUMBER);
|
|
1917
|
-
}
|
|
1918
|
-
emitChange() {
|
|
1919
|
-
this.inputChangeEvent.emit();
|
|
1920
|
-
}
|
|
2000
|
+
class NumberInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1921
2001
|
}
|
|
1922
|
-
NumberInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberInputComponent, deps:
|
|
1923
|
-
NumberInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NumberInputComponent, selector: "number-input",
|
|
2002
|
+
NumberInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2003
|
+
NumberInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NumberInputComponent, selector: "number-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n type=\"number\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ?? null\"\n [max]=\"metadata.max ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1924
2004
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberInputComponent, decorators: [{
|
|
1925
2005
|
type: Component,
|
|
1926
|
-
args: [{ selector: 'number-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n type=\"number\"\n [(ngModel)]=\"
|
|
1927
|
-
}]
|
|
1928
|
-
type: Input
|
|
1929
|
-
}], key: [{
|
|
1930
|
-
type: Input
|
|
1931
|
-
}], getValidationErrorMessage: [{
|
|
1932
|
-
type: Input
|
|
1933
|
-
}], inputChangeEvent: [{
|
|
1934
|
-
type: Output
|
|
1935
|
-
}] } });
|
|
2006
|
+
args: [{ selector: 'number-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n type=\"number\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ?? null\"\n [max]=\"metadata.max ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2007
|
+
}] });
|
|
1936
2008
|
|
|
1937
2009
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1938
|
-
class NumberDropdownInputComponent {
|
|
1939
|
-
constructor() {
|
|
1940
|
-
this.inputChangeEvent = new EventEmitter();
|
|
1941
|
-
}
|
|
1942
|
-
ngOnInit() {
|
|
1943
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.NUMBER_DROPDOWN);
|
|
1944
|
-
}
|
|
1945
|
-
emitChange() {
|
|
1946
|
-
this.inputChangeEvent.emit();
|
|
1947
|
-
}
|
|
2010
|
+
class NumberDropdownInputComponent extends NgxMatEntityBaseInputComponent {
|
|
1948
2011
|
}
|
|
1949
|
-
NumberDropdownInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberDropdownInputComponent, deps:
|
|
1950
|
-
NumberDropdownInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NumberDropdownInputComponent, selector: "number-dropdown-input",
|
|
2012
|
+
NumberDropdownInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberDropdownInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2013
|
+
NumberDropdownInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NumberDropdownInputComponent, selector: "number-dropdown-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select (ngModelChange)=\"emitChange()\" [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\" [required]=\"metadata.required\" [disabled]=\"isReadOnly\">\n <mat-option *ngFor=\"let value of metadata.dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
1951
2014
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberDropdownInputComponent, decorators: [{
|
|
1952
2015
|
type: Component,
|
|
1953
|
-
args: [{ selector: 'number-dropdown-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select (ngModelChange)=\"emitChange()\" [(ngModel)]=\"
|
|
1954
|
-
}]
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2016
|
+
args: [{ selector: 'number-dropdown-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-select (ngModelChange)=\"emitChange()\" [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\" [required]=\"metadata.required\" [disabled]=\"isReadOnly\">\n <mat-option *ngFor=\"let value of metadata.dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2017
|
+
}] });
|
|
2018
|
+
|
|
2019
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
2020
|
+
class NumberSliderInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2021
|
+
}
|
|
2022
|
+
NumberSliderInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberSliderInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2023
|
+
NumberSliderInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NumberSliderInputComponent, selector: "number-slider-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field floatLabel=\"always\" class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <!-- hidden input is needed so that the slider can be used inside a mat-form-field -->\n <input matInput\n #hiddenInput\n type=\"number\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString() + 'Helper'\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ?? null\"\n [max]=\"metadata.max ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-slider\n id=\"slider\"\n color=\"primary\"\n (click)=\"model.control.markAsTouched()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n [min]=\"metadata.min ?? null\"\n [max]=\"metadata.max ?? null\"\n [step]=\"metadata.step\"\n [thumbLabel]=\"true\"\n [displayWith]=\"metadata.formatThumbLabelValue\"\n [tickInterval]=\"metadata.tickInterval\"\n [disabled]=\"isReadOnly\"\n >\n </mat-slider>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}input{opacity:0%}mat-slider{width:100%;position:absolute;top:-7px;left:0}::ng-deep .hideUnderline .mat-form-field-underline{opacity:0%}::ng-deep #slider .mat-slider-thumb-label{top:-15px;display:flex;transform:rotate(45deg) scale(1);border-radius:50%}::ng-deep #slider.mat-slider-min-value.cdk-focused .mat-slider-thumb-label{background-color:#000000de}::ng-deep #slider .mat-slider-thumb{transform:scale(0)}::ng-deep #slider .mat-slider-thumb-label-text{opacity:1}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$4.MatSlider, selector: "mat-slider", inputs: ["disabled", "color", "tabIndex", "invert", "max", "min", "step", "thumbLabel", "tickInterval", "value", "displayWith", "valueText", "vertical"], outputs: ["change", "input", "valueChange"], exportAs: ["matSlider"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
2024
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NumberSliderInputComponent, decorators: [{
|
|
2025
|
+
type: Component,
|
|
2026
|
+
args: [{ selector: 'number-slider-input', template: "<mat-form-field floatLabel=\"always\" class=\"hideUnderline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <!-- hidden input is needed so that the slider can be used inside a mat-form-field -->\n <input matInput\n #hiddenInput\n type=\"number\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString() + 'Helper'\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ?? null\"\n [max]=\"metadata.max ?? null\"\n (ngModelChange)=\"emitChange()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-slider\n id=\"slider\"\n color=\"primary\"\n (click)=\"model.control.markAsTouched()\"\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n [min]=\"metadata.min ?? null\"\n [max]=\"metadata.max ?? null\"\n [step]=\"metadata.step\"\n [thumbLabel]=\"true\"\n [displayWith]=\"metadata.formatThumbLabelValue\"\n [tickInterval]=\"metadata.tickInterval\"\n [disabled]=\"isReadOnly\"\n >\n </mat-slider>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}input{opacity:0%}mat-slider{width:100%;position:absolute;top:-7px;left:0}::ng-deep .hideUnderline .mat-form-field-underline{opacity:0%}::ng-deep #slider .mat-slider-thumb-label{top:-15px;display:flex;transform:rotate(45deg) scale(1);border-radius:50%}::ng-deep #slider.mat-slider-min-value.cdk-focused .mat-slider-thumb-label{background-color:#000000de}::ng-deep #slider .mat-slider-thumb{transform:scale(0)}::ng-deep #slider .mat-slider-thumb-label-text{opacity:1}\n"] }]
|
|
2027
|
+
}] });
|
|
1963
2028
|
|
|
1964
2029
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
1965
2030
|
/**
|
|
1966
2031
|
* The base data needed for all arrays that are displayed as a table.
|
|
1967
2032
|
*/
|
|
1968
|
-
class
|
|
2033
|
+
class ArrayTableComponent extends NgxMatEntityBaseInputComponent {
|
|
1969
2034
|
constructor(matDialog) {
|
|
2035
|
+
super();
|
|
1970
2036
|
this.matDialog = matDialog;
|
|
1971
2037
|
this.input = undefined;
|
|
1972
2038
|
this.dataSource = new MatTableDataSource();
|
|
1973
2039
|
this.selection = new SelectionModel(true, []);
|
|
1974
2040
|
}
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
this.entity[this.key] = [];
|
|
1979
|
-
}
|
|
1980
|
-
this.arrayValues = this.entity[this.key];
|
|
2041
|
+
ngOnInit() {
|
|
2042
|
+
super.ngOnInit();
|
|
2043
|
+
this.propertyValue = this.propertyValue ?? [];
|
|
1981
2044
|
const givenDisplayColumns = this.metadata.displayColumns.map((v) => v.displayName);
|
|
1982
2045
|
if (givenDisplayColumns.find(s => s === 'select')) {
|
|
1983
2046
|
throw new Error(`The name "select" for a display column is reserved.
|
|
1984
2047
|
Please choose a different name.`);
|
|
1985
2048
|
}
|
|
1986
|
-
this.displayedColumns = ['select'].concat(givenDisplayColumns);
|
|
1987
|
-
this.dataSource.data = this.
|
|
2049
|
+
this.displayedColumns = this.isReadOnly ? givenDisplayColumns : ['select'].concat(givenDisplayColumns);
|
|
2050
|
+
this.dataSource.data = this.propertyValue;
|
|
1988
2051
|
}
|
|
1989
2052
|
/**
|
|
1990
2053
|
* Toggles all array-items in the table.
|
|
@@ -2015,7 +2078,7 @@ class ArrayTable {
|
|
|
2015
2078
|
add() {
|
|
2016
2079
|
if (this.input != null) {
|
|
2017
2080
|
if (!this.metadata.allowDuplicates
|
|
2018
|
-
&& this.
|
|
2081
|
+
&& this.propertyValue?.find(async (v) => await EntityUtilities.isEqual(this.input, v, this.metadata, this.metadata.itemType)) != null) {
|
|
2019
2082
|
this.matDialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
2020
2083
|
data: this.metadata.duplicatesErrorDialog,
|
|
2021
2084
|
autoFocus: false,
|
|
@@ -2023,8 +2086,8 @@ class ArrayTable {
|
|
|
2023
2086
|
});
|
|
2024
2087
|
return;
|
|
2025
2088
|
}
|
|
2026
|
-
this.
|
|
2027
|
-
this.dataSource.data = this.
|
|
2089
|
+
this.propertyValue?.push(LodashUtilities.cloneDeep(this.input));
|
|
2090
|
+
this.dataSource.data = this.propertyValue ?? [];
|
|
2028
2091
|
this.resetInput();
|
|
2029
2092
|
this.emitChange();
|
|
2030
2093
|
}
|
|
@@ -2040,54 +2103,45 @@ class ArrayTable {
|
|
|
2040
2103
|
*/
|
|
2041
2104
|
remove() {
|
|
2042
2105
|
this.selection.selected.forEach(s => {
|
|
2043
|
-
this.
|
|
2106
|
+
this.propertyValue?.splice(this.propertyValue.indexOf(s), 1);
|
|
2044
2107
|
});
|
|
2045
|
-
this.dataSource.data = this.
|
|
2108
|
+
this.dataSource.data = this.propertyValue ?? [];
|
|
2046
2109
|
this.selection.clear();
|
|
2047
2110
|
this.emitChange();
|
|
2048
2111
|
}
|
|
2049
2112
|
}
|
|
2113
|
+
ArrayTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayTableComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
2114
|
+
ArrayTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayTableComponent, selector: "ngx-mat-entity-array-table", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
2115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayTableComponent, decorators: [{
|
|
2116
|
+
type: Component,
|
|
2117
|
+
args: [{
|
|
2118
|
+
selector: 'ngx-mat-entity-array-table',
|
|
2119
|
+
template: ''
|
|
2120
|
+
}]
|
|
2121
|
+
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; } });
|
|
2050
2122
|
|
|
2051
2123
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2052
|
-
class ArrayDateInputComponent extends
|
|
2053
|
-
constructor(
|
|
2054
|
-
super(
|
|
2055
|
-
this.dialog = dialog;
|
|
2124
|
+
class ArrayDateInputComponent extends ArrayTableComponent {
|
|
2125
|
+
constructor() {
|
|
2126
|
+
super(...arguments);
|
|
2056
2127
|
this.DateUtilities = DateUtilities;
|
|
2057
|
-
this.inputChangeEvent = new EventEmitter();
|
|
2058
|
-
}
|
|
2059
|
-
ngOnInit() {
|
|
2060
|
-
this.init();
|
|
2061
|
-
}
|
|
2062
|
-
emitChange() {
|
|
2063
|
-
this.inputChangeEvent.emit();
|
|
2064
2128
|
}
|
|
2065
2129
|
}
|
|
2066
|
-
ArrayDateInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateInputComponent, deps:
|
|
2067
|
-
ArrayDateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayDateInputComponent, selector: "array-date-input",
|
|
2130
|
+
ArrayDateInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2131
|
+
ArrayDateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayDateInputComponent, selector: "array-date-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px;\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(input) : undefined\"\n [max]=\"metadata.max ? metadata.max(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"model.errors\"\n (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2$5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i4$1.MatCellDef, selector: "[matCellDef]" }, { type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
|
|
2068
2132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateInputComponent, decorators: [{
|
|
2069
2133
|
type: Component,
|
|
2070
|
-
args: [{ selector: 'array-date-input', template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <mat-form-field appearance=\"standard\">\n
|
|
2071
|
-
}]
|
|
2072
|
-
type: Input
|
|
2073
|
-
}], key: [{
|
|
2074
|
-
type: Input
|
|
2075
|
-
}], getValidationErrorMessage: [{
|
|
2076
|
-
type: Input
|
|
2077
|
-
}], inputChangeEvent: [{
|
|
2078
|
-
type: Output
|
|
2079
|
-
}] } });
|
|
2134
|
+
args: [{ selector: 'array-date-input', template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px;\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(input) : undefined\"\n [max]=\"metadata.max ? metadata.max(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"model.errors\"\n (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
2135
|
+
}] });
|
|
2080
2136
|
|
|
2081
2137
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2082
|
-
class ArrayDateTimeInputComponent extends
|
|
2083
|
-
constructor(
|
|
2084
|
-
super(
|
|
2085
|
-
this.dialog = dialog;
|
|
2138
|
+
class ArrayDateTimeInputComponent extends ArrayTableComponent {
|
|
2139
|
+
constructor() {
|
|
2140
|
+
super(...arguments);
|
|
2086
2141
|
this.DateUtilities = DateUtilities;
|
|
2087
|
-
this.inputChangeEvent = new EventEmitter();
|
|
2088
2142
|
}
|
|
2089
2143
|
ngOnInit() {
|
|
2090
|
-
|
|
2144
|
+
super.ngOnInit();
|
|
2091
2145
|
this.time = DateUtilities.getTimeFromDate(this.entity[this.key]);
|
|
2092
2146
|
this.timeDropdownValues = this.metadata.times;
|
|
2093
2147
|
if (this.entity[this.key] != null) {
|
|
@@ -2108,172 +2162,22 @@ class ArrayDateTimeInputComponent extends ArrayTable {
|
|
|
2108
2162
|
this.add();
|
|
2109
2163
|
}
|
|
2110
2164
|
}
|
|
2111
|
-
emitChange() {
|
|
2112
|
-
this.inputChangeEvent.emit();
|
|
2113
|
-
}
|
|
2114
2165
|
}
|
|
2115
|
-
ArrayDateTimeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateTimeInputComponent, deps:
|
|
2116
|
-
ArrayDateTimeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayDateTimeInputComponent, selector: "array-date-time-input",
|
|
2166
|
+
ArrayDateTimeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateTimeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2167
|
+
ArrayDateTimeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayDateTimeInputComponent, selector: "array-date-time-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px;\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <div class=\"date-time\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(input) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n input,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n </div>\n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"model.errors || timeModel.errors || DateUtilities.timeIsUnprocessable(time)\"\n (click)=\"addDateTime()\">\n {{metadata.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2$5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { type: i2$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i4$1.MatCellDef, selector: "[matCellDef]" }, { type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
|
|
2117
2168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateTimeInputComponent, decorators: [{
|
|
2118
2169
|
type: Component,
|
|
2119
|
-
args: [{ selector: 'array-date-time-input', template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n
|
|
2120
|
-
}]
|
|
2121
|
-
type: Input
|
|
2122
|
-
}], key: [{
|
|
2123
|
-
type: Input
|
|
2124
|
-
}], getValidationErrorMessage: [{
|
|
2125
|
-
type: Input
|
|
2126
|
-
}], inputChangeEvent: [{
|
|
2127
|
-
type: Output
|
|
2128
|
-
}] } });
|
|
2129
|
-
|
|
2130
|
-
/**
|
|
2131
|
-
* The internal EntityArrayDecoratorConfig. Sets default values.
|
|
2132
|
-
*/
|
|
2133
|
-
class EntityArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
2134
|
-
constructor(data) {
|
|
2135
|
-
super(data);
|
|
2136
|
-
this.createInline = data.createInline ?? true;
|
|
2137
|
-
this.itemType = data.itemType;
|
|
2138
|
-
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
2139
|
-
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
2140
|
-
this.EntityClass = data.EntityClass;
|
|
2141
|
-
this.displayColumns = data.displayColumns;
|
|
2142
|
-
this.createInline = data.createInline ?? true;
|
|
2143
|
-
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
2144
|
-
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
2145
|
-
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
2146
|
-
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
/**
|
|
2150
|
-
* The internal DateArrayDecoratorConfig. Sets default values.
|
|
2151
|
-
*/
|
|
2152
|
-
class DateArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
2153
|
-
constructor(data) {
|
|
2154
|
-
super(data);
|
|
2155
|
-
this.itemType = data.itemType;
|
|
2156
|
-
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
2157
|
-
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
2158
|
-
this.displayColumns = data.displayColumns;
|
|
2159
|
-
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
2160
|
-
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
2161
|
-
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
2162
|
-
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
2163
|
-
this.min = data.min;
|
|
2164
|
-
this.max = data.max;
|
|
2165
|
-
this.filter = data.filter;
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2168
|
-
/**
|
|
2169
|
-
* The internal DateTimeArrayDecoratorConfig. Sets default values.
|
|
2170
|
-
*/
|
|
2171
|
-
class DateTimeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
2172
|
-
constructor(data) {
|
|
2173
|
-
super(data);
|
|
2174
|
-
this.itemType = data.itemType;
|
|
2175
|
-
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
2176
|
-
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
2177
|
-
this.displayColumns = data.displayColumns;
|
|
2178
|
-
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
2179
|
-
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
2180
|
-
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
2181
|
-
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
2182
|
-
this.times = data.times ?? DateUtilities.getDefaultTimes();
|
|
2183
|
-
this.timeDisplayName = data.timeDisplayName ?? 'Time';
|
|
2184
|
-
this.minDate = data.minDate;
|
|
2185
|
-
this.maxDate = data.maxDate;
|
|
2186
|
-
this.filterDate = data.filterDate;
|
|
2187
|
-
this.minTime = data.minTime;
|
|
2188
|
-
this.maxTime = data.maxTime;
|
|
2189
|
-
this.filterTime = data.filterTime;
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
/**
|
|
2193
|
-
* The internal DateRangeArrayDecoratorConfig. Sets default values.
|
|
2194
|
-
*/
|
|
2195
|
-
class DateRangeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
2196
|
-
constructor(data) {
|
|
2197
|
-
super(data);
|
|
2198
|
-
this.itemType = data.itemType;
|
|
2199
|
-
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
2200
|
-
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
2201
|
-
this.displayColumns = data.displayColumns;
|
|
2202
|
-
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
2203
|
-
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
2204
|
-
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
2205
|
-
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
2206
|
-
this.placeholderStart = data.placeholderStart ?? 'Start';
|
|
2207
|
-
this.placeholderEnd = data.placeholderEnd ?? 'End';
|
|
2208
|
-
this.minStart = data.minStart;
|
|
2209
|
-
this.maxStart = data.maxStart;
|
|
2210
|
-
this.minEnd = data.minEnd;
|
|
2211
|
-
this.maxEnd = data.maxEnd;
|
|
2212
|
-
this.filter = data.filter;
|
|
2213
|
-
}
|
|
2214
|
-
}
|
|
2215
|
-
/**
|
|
2216
|
-
* The internal StringChipsArrayDecoratorConfig. Sets default values.
|
|
2217
|
-
*/
|
|
2218
|
-
class StringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
2219
|
-
constructor(data) {
|
|
2220
|
-
super(data);
|
|
2221
|
-
this.deleteIcon = data.deleteIcon ?? 'fas fa-circle-minus';
|
|
2222
|
-
this.itemType = data.itemType;
|
|
2223
|
-
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
2224
|
-
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
2225
|
-
this.maxLength = data.maxLength;
|
|
2226
|
-
this.minLength = data.minLength;
|
|
2227
|
-
this.regex = data.regex;
|
|
2228
|
-
this.defaultWidths = data.defaultWidths ?? [6, 12, 12];
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
/**
|
|
2232
|
-
* The internal AutocompleteStringChipsArrayDecoratorConfig. Sets default values.
|
|
2233
|
-
*/
|
|
2234
|
-
class AutocompleteStringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
2235
|
-
constructor(data) {
|
|
2236
|
-
super(data);
|
|
2237
|
-
this.autocompleteValues = data.autocompleteValues;
|
|
2238
|
-
this.deleteIcon = data.deleteIcon ?? 'fas fa-circle-minus';
|
|
2239
|
-
this.itemType = data.itemType;
|
|
2240
|
-
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
2241
|
-
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
2242
|
-
this.maxLength = data.maxLength;
|
|
2243
|
-
this.minLength = data.minLength;
|
|
2244
|
-
this.regex = data.regex;
|
|
2245
|
-
this.defaultWidths = data.defaultWidths ?? [6, 12, 12];
|
|
2246
|
-
}
|
|
2247
|
-
}
|
|
2248
|
-
/**
|
|
2249
|
-
* Gets the default dialog data for the error dialog to display when the user tries to add a duplicate value.
|
|
2250
|
-
*
|
|
2251
|
-
* @param data - The Array Decorator data.
|
|
2252
|
-
* @returns The dialog data with set default values.
|
|
2253
|
-
*/
|
|
2254
|
-
function getDefaultDuplicateErrorDialogData(data) {
|
|
2255
|
-
return {
|
|
2256
|
-
type: data.duplicatesErrorDialog?.type ?? 'info-only',
|
|
2257
|
-
// eslint-disable-next-line max-len
|
|
2258
|
-
text: data.duplicatesErrorDialog?.text ?? ['Adding duplicate entries to the array is not allowed.'],
|
|
2259
|
-
title: data.duplicatesErrorDialog?.title ?? 'Error adding duplicate item',
|
|
2260
|
-
confirmButtonLabel: data.duplicatesErrorDialog?.confirmButtonLabel,
|
|
2261
|
-
cancelButtonLabel: data.duplicatesErrorDialog?.cancelButtonLabel,
|
|
2262
|
-
requireConfirmation: data.duplicatesErrorDialog?.requireConfirmation,
|
|
2263
|
-
confirmationText: data.duplicatesErrorDialog?.confirmationText
|
|
2264
|
-
};
|
|
2265
|
-
}
|
|
2170
|
+
args: [{ selector: 'array-date-time-input', template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px;\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <div class=\"date-time\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(input) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n input,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n </div>\n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"model.errors || timeModel.errors || DateUtilities.timeIsUnprocessable(time)\"\n (click)=\"addDateTime()\">\n {{metadata.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\n"] }]
|
|
2171
|
+
}] });
|
|
2266
2172
|
|
|
2267
2173
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2268
|
-
class ArrayDateRangeInputComponent extends
|
|
2269
|
-
constructor(
|
|
2270
|
-
super(
|
|
2271
|
-
this.dialog = dialog;
|
|
2174
|
+
class ArrayDateRangeInputComponent extends ArrayTableComponent {
|
|
2175
|
+
constructor() {
|
|
2176
|
+
super(...arguments);
|
|
2272
2177
|
this.DateUtilities = DateUtilities;
|
|
2273
|
-
this.inputChangeEvent = new EventEmitter();
|
|
2274
2178
|
}
|
|
2275
2179
|
ngOnInit() {
|
|
2276
|
-
|
|
2180
|
+
super.ngOnInit();
|
|
2277
2181
|
this.input = {
|
|
2278
2182
|
start: undefined,
|
|
2279
2183
|
end: undefined,
|
|
@@ -2297,39 +2201,20 @@ class ArrayDateRangeInputComponent extends ArrayTable {
|
|
|
2297
2201
|
this.dateRangeStart = undefined;
|
|
2298
2202
|
this.dateRangeEnd = undefined;
|
|
2299
2203
|
}
|
|
2300
|
-
emitChange() {
|
|
2301
|
-
this.inputChangeEvent.emit();
|
|
2302
|
-
}
|
|
2303
2204
|
}
|
|
2304
|
-
ArrayDateRangeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateRangeInputComponent, deps:
|
|
2305
|
-
ArrayDateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayDateRangeInputComponent, selector: "array-date-range-input",
|
|
2205
|
+
ArrayDateRangeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateRangeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2206
|
+
ArrayDateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayDateRangeInputComponent, selector: "array-date-range-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px;\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ? metadata.filter : DateUtilities.defaultDateFilter\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(input?.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(input?.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(input?.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(input?.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n \n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"startModel.errors || endModel.errors\"\n (click)=\"addDateRange()\">\n {{metadata.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$5.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { type: i2$5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2$5.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatLabel, selector: "mat-label" }, { type: i2$5.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2$5.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i4$1.MatCellDef, selector: "[matCellDef]" }, { type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
|
|
2306
2207
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayDateRangeInputComponent, decorators: [{
|
|
2307
2208
|
type: Component,
|
|
2308
|
-
args: [{ selector: 'array-date-range-input', template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n
|
|
2309
|
-
}]
|
|
2310
|
-
type: Input
|
|
2311
|
-
}], key: [{
|
|
2312
|
-
type: Input
|
|
2313
|
-
}], metadata: [{
|
|
2314
|
-
type: Input
|
|
2315
|
-
}], getValidationErrorMessage: [{
|
|
2316
|
-
type: Input
|
|
2317
|
-
}], inputChangeEvent: [{
|
|
2318
|
-
type: Output
|
|
2319
|
-
}] } });
|
|
2209
|
+
args: [{ selector: 'array-date-range-input', template: "<div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px;\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ? metadata.filter : DateUtilities.defaultDateFilter\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(input?.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(input?.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(input?.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(input?.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n \n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"startModel.errors || endModel.errors\"\n (click)=\"addDateRange()\">\n {{metadata.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
2210
|
+
}] });
|
|
2320
2211
|
|
|
2321
2212
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2322
|
-
class ArrayStringChipsInputComponent {
|
|
2213
|
+
class ArrayStringChipsInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2323
2214
|
constructor() {
|
|
2324
|
-
|
|
2215
|
+
super(...arguments);
|
|
2325
2216
|
this.chipsInput = '';
|
|
2326
2217
|
}
|
|
2327
|
-
ngOnInit() {
|
|
2328
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.ARRAY_STRING_CHIPS);
|
|
2329
|
-
if (this.entity[this.key]?.length) {
|
|
2330
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
2218
|
/**
|
|
2334
2219
|
* Handles adding strings to the chipsArray.
|
|
2335
2220
|
* Checks validation and also creates a new array if it is undefined.
|
|
@@ -2353,13 +2238,8 @@ class ArrayStringChipsInputComponent {
|
|
|
2353
2238
|
if (this.metadata.regex && !value.match(this.metadata.regex)) {
|
|
2354
2239
|
return;
|
|
2355
2240
|
}
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
this.entity[this.key] = [];
|
|
2359
|
-
}
|
|
2360
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2361
|
-
}
|
|
2362
|
-
this.stringChipsArrayValues.push(value);
|
|
2241
|
+
this.propertyValue = this.propertyValue ?? [];
|
|
2242
|
+
this.propertyValue.push(value);
|
|
2363
2243
|
}
|
|
2364
2244
|
event.chipInput?.clear();
|
|
2365
2245
|
}
|
|
@@ -2374,11 +2254,8 @@ class ArrayStringChipsInputComponent {
|
|
|
2374
2254
|
* @param value - The string to remove from the array.
|
|
2375
2255
|
*/
|
|
2376
2256
|
removeStringChipArrayValue(value) {
|
|
2377
|
-
this.
|
|
2378
|
-
|
|
2379
|
-
this.entity[this.key] = undefined;
|
|
2380
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2381
|
-
}
|
|
2257
|
+
this.propertyValue?.splice(this.propertyValue.indexOf(value), 1);
|
|
2258
|
+
this.propertyValue = this.propertyValue?.length ? this.propertyValue : undefined;
|
|
2382
2259
|
}
|
|
2383
2260
|
/**
|
|
2384
2261
|
* Handles adding a string to the array when an autocomplete value has been selected.
|
|
@@ -2397,46 +2274,27 @@ class ArrayStringChipsInputComponent {
|
|
|
2397
2274
|
if (this.metadata.regex && !value.match(this.metadata.regex)) {
|
|
2398
2275
|
return;
|
|
2399
2276
|
}
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
this.entity[this.key] = [];
|
|
2403
|
-
}
|
|
2404
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2405
|
-
}
|
|
2406
|
-
this.stringChipsArrayValues.push(value);
|
|
2277
|
+
this.propertyValue = this.propertyValue ?? [];
|
|
2278
|
+
this.propertyValue.push(value);
|
|
2407
2279
|
chipsInput.value = '';
|
|
2408
2280
|
}
|
|
2409
|
-
emitChange() {
|
|
2410
|
-
this.inputChangeEvent.emit();
|
|
2411
|
-
}
|
|
2412
2281
|
}
|
|
2413
|
-
ArrayStringChipsInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayStringChipsInputComponent, deps:
|
|
2414
|
-
ArrayStringChipsInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayStringChipsInputComponent, selector: "array-string-chips-input",
|
|
2282
|
+
ArrayStringChipsInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayStringChipsInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2283
|
+
ArrayStringChipsInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayStringChipsInputComponent, selector: "array-string-chips-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-chip *ngFor=\"let value of propertyValue\" (removed)=\"removeStringChipArrayValue(value)\">\n {{value}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input matInput\n [matChipInputFor]=\"chipList\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"addStringChipArrayValue($event)\"\n [(ngModel)]=\"chipsInput\" [name]=\"key.toString()\" #chipsModel=\"ngModel\"\n [minlength]='metadata.minLength ?? null'\n [maxlength]='metadata.maxLength ?? null'\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n >\n <mat-error *ngIf=\"chipsModel.errors\">{{getValidationErrorMessage(chipsModel)}}</mat-error>\n </mat-chip-list>\n <mat-error *ngIf=\"!chipsModel.errors\">{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$6.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$6.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i2$6.MatChipRemove, selector: "[matChipRemove]" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i2$6.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i3$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
2415
2284
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayStringChipsInputComponent, decorators: [{
|
|
2416
2285
|
type: Component,
|
|
2417
|
-
args: [{ selector: 'array-string-chips-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"
|
|
2418
|
-
}]
|
|
2419
|
-
type: Input
|
|
2420
|
-
}], key: [{
|
|
2421
|
-
type: Input
|
|
2422
|
-
}], getValidationErrorMessage: [{
|
|
2423
|
-
type: Input
|
|
2424
|
-
}], inputChangeEvent: [{
|
|
2425
|
-
type: Output
|
|
2426
|
-
}] } });
|
|
2286
|
+
args: [{ selector: 'array-string-chips-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-chip *ngFor=\"let value of propertyValue\" (removed)=\"removeStringChipArrayValue(value)\">\n {{value}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input matInput\n [matChipInputFor]=\"chipList\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"addStringChipArrayValue($event)\"\n [(ngModel)]=\"chipsInput\" [name]=\"key.toString()\" #chipsModel=\"ngModel\"\n [minlength]='metadata.minLength ?? null'\n [maxlength]='metadata.maxLength ?? null'\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n >\n <mat-error *ngIf=\"chipsModel.errors\">{{getValidationErrorMessage(chipsModel)}}</mat-error>\n </mat-chip-list>\n <mat-error *ngIf=\"!chipsModel.errors\">{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2287
|
+
}] });
|
|
2427
2288
|
|
|
2428
2289
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2429
|
-
class ArrayStringAutocompleteChipsComponent {
|
|
2290
|
+
class ArrayStringAutocompleteChipsComponent extends NgxMatEntityBaseInputComponent {
|
|
2430
2291
|
constructor() {
|
|
2431
|
-
|
|
2292
|
+
super(...arguments);
|
|
2432
2293
|
this.chipsInput = '';
|
|
2433
2294
|
}
|
|
2434
2295
|
ngOnInit() {
|
|
2435
|
-
|
|
2296
|
+
super.ngOnInit();
|
|
2436
2297
|
this.filteredAutocompleteStrings = LodashUtilities.cloneDeep(this.metadata.autocompleteValues);
|
|
2437
|
-
if (this.entity[this.key]?.length) {
|
|
2438
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2439
|
-
}
|
|
2440
2298
|
}
|
|
2441
2299
|
/**
|
|
2442
2300
|
* Handles adding strings to the chipsArray.
|
|
@@ -2461,13 +2319,8 @@ class ArrayStringAutocompleteChipsComponent {
|
|
|
2461
2319
|
if (this.metadata.regex && !value.match(this.metadata.regex)) {
|
|
2462
2320
|
return;
|
|
2463
2321
|
}
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
this.entity[this.key] = [];
|
|
2467
|
-
}
|
|
2468
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2469
|
-
}
|
|
2470
|
-
this.stringChipsArrayValues.push(value);
|
|
2322
|
+
this.propertyValue = this.propertyValue ?? [];
|
|
2323
|
+
this.propertyValue.push(value);
|
|
2471
2324
|
}
|
|
2472
2325
|
event.chipInput?.clear();
|
|
2473
2326
|
}
|
|
@@ -2482,11 +2335,8 @@ class ArrayStringAutocompleteChipsComponent {
|
|
|
2482
2335
|
* @param value - The string to remove from the array.
|
|
2483
2336
|
*/
|
|
2484
2337
|
removeStringChipArrayValue(value) {
|
|
2485
|
-
this.
|
|
2486
|
-
|
|
2487
|
-
this.entity[this.key] = undefined;
|
|
2488
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2489
|
-
}
|
|
2338
|
+
this.propertyValue?.splice(this.propertyValue.indexOf(value), 1);
|
|
2339
|
+
this.propertyValue = this.propertyValue?.length ? this.propertyValue : undefined;
|
|
2490
2340
|
}
|
|
2491
2341
|
/**
|
|
2492
2342
|
* Handles adding a string to the array when an autocomplete value has been selected.
|
|
@@ -2505,13 +2355,8 @@ class ArrayStringAutocompleteChipsComponent {
|
|
|
2505
2355
|
if (this.metadata.regex && !value.match(this.metadata.regex)) {
|
|
2506
2356
|
return;
|
|
2507
2357
|
}
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
this.entity[this.key] = [];
|
|
2511
|
-
}
|
|
2512
|
-
this.stringChipsArrayValues = this.entity[this.key];
|
|
2513
|
-
}
|
|
2514
|
-
this.stringChipsArrayValues.push(value);
|
|
2358
|
+
this.propertyValue = this.propertyValue ?? [];
|
|
2359
|
+
this.propertyValue.push(value);
|
|
2515
2360
|
chipsInput.value = '';
|
|
2516
2361
|
}
|
|
2517
2362
|
/**
|
|
@@ -2525,53 +2370,27 @@ class ArrayStringAutocompleteChipsComponent {
|
|
|
2525
2370
|
this.filteredAutocompleteStrings = this.metadata.autocompleteValues.filter(s => s.toLowerCase().includes(filterValue));
|
|
2526
2371
|
}
|
|
2527
2372
|
}
|
|
2528
|
-
emitChange() {
|
|
2529
|
-
this.inputChangeEvent.emit();
|
|
2530
|
-
}
|
|
2531
2373
|
}
|
|
2532
|
-
ArrayStringAutocompleteChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayStringAutocompleteChipsComponent, deps:
|
|
2533
|
-
ArrayStringAutocompleteChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayStringAutocompleteChipsComponent, selector: "array-string-autocomplete-chips",
|
|
2374
|
+
ArrayStringAutocompleteChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayStringAutocompleteChipsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2375
|
+
ArrayStringAutocompleteChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ArrayStringAutocompleteChipsComponent, selector: "array-string-autocomplete-chips", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-chip *ngFor=\"let value of propertyValue\" (removed)=\"removeStringChipArrayValue(value)\">\n {{value}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input matInput\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"auto\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"addStringChipArrayValue($event)\"\n (keyup)=\"filterAutocompleteStrings(chipsInput)\"\n [(ngModel)]=\"chipsInput\" [name]=\"key.toString()\" #chipsModel=\"ngModel\"\n #chipsElement\n [minlength]='metadata.minLength ?? null'\n [maxlength]='metadata.maxLength ?? null'\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n >\n <mat-error *ngIf=\"chipsModel.errors\">{{getValidationErrorMessage(chipsModel)}}</mat-error>\n </mat-chip-list>\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event, chipsElement)\">\n <mat-option *ngFor=\"let value of metadata.autocompleteValues\" [value]=\"value\">\n {{value}}\n </mat-option>\n </mat-autocomplete>\n <mat-error *ngIf=\"!chipsModel.errors\">{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$6.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i2$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i3$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$6.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i2$6.MatChipRemove, selector: "[matChipRemove]" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i2$6.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i2$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i3$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
2534
2376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ArrayStringAutocompleteChipsComponent, decorators: [{
|
|
2535
2377
|
type: Component,
|
|
2536
|
-
args: [{ selector: 'array-string-autocomplete-chips', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"
|
|
2537
|
-
}]
|
|
2538
|
-
type: Input
|
|
2539
|
-
}], key: [{
|
|
2540
|
-
type: Input
|
|
2541
|
-
}], getValidationErrorMessage: [{
|
|
2542
|
-
type: Input
|
|
2543
|
-
}], inputChangeEvent: [{
|
|
2544
|
-
type: Output
|
|
2545
|
-
}] } });
|
|
2378
|
+
args: [{ selector: 'array-string-autocomplete-chips', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n (ngModelChange)=\"emitChange()\"\n [(ngModel)]=\"propertyValue\" [name]=\"key.toString()\" #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-chip *ngFor=\"let value of propertyValue\" (removed)=\"removeStringChipArrayValue(value)\">\n {{value}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input matInput\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"auto\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"addStringChipArrayValue($event)\"\n (keyup)=\"filterAutocompleteStrings(chipsInput)\"\n [(ngModel)]=\"chipsInput\" [name]=\"key.toString()\" #chipsModel=\"ngModel\"\n #chipsElement\n [minlength]='metadata.minLength ?? null'\n [maxlength]='metadata.maxLength ?? null'\n [pattern]=\"metadata.regex ?? '[\\\\s\\\\S]*'\"\n >\n <mat-error *ngIf=\"chipsModel.errors\">{{getValidationErrorMessage(chipsModel)}}</mat-error>\n </mat-chip-list>\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event, chipsElement)\">\n <mat-option *ngFor=\"let value of metadata.autocompleteValues\" [value]=\"value\">\n {{value}}\n </mat-option>\n </mat-autocomplete>\n <mat-error *ngIf=\"!chipsModel.errors\">{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2379
|
+
}] });
|
|
2546
2380
|
|
|
2547
2381
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2548
|
-
class DateInputComponent {
|
|
2382
|
+
class DateInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2549
2383
|
constructor() {
|
|
2384
|
+
super(...arguments);
|
|
2550
2385
|
this.DateUtilities = DateUtilities;
|
|
2551
|
-
this.inputChangeEvent = new EventEmitter();
|
|
2552
|
-
this.defaultDateFilter = () => true;
|
|
2553
|
-
}
|
|
2554
|
-
ngOnInit() {
|
|
2555
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.DATE);
|
|
2556
|
-
}
|
|
2557
|
-
emitChange() {
|
|
2558
|
-
this.inputChangeEvent.emit();
|
|
2559
2386
|
}
|
|
2560
2387
|
}
|
|
2561
|
-
DateInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateInputComponent, deps:
|
|
2562
|
-
DateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DateInputComponent, selector: "date-input",
|
|
2388
|
+
DateInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2389
|
+
DateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DateInputComponent, selector: "date-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n (ngModelChange)=\"emitChange()\"\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(propertyValue) : undefined\"\n [max]=\"metadata.max ? metadata.max(propertyValue) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n [disabled]=\"isReadOnly\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2$5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
2563
2390
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateInputComponent, decorators: [{
|
|
2564
2391
|
type: Component,
|
|
2565
|
-
args: [{ selector: 'date-input', template: "<mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n (ngModelChange)=\"emitChange()\"\n matInput\n [(ngModel)]=\"
|
|
2566
|
-
}]
|
|
2567
|
-
type: Input
|
|
2568
|
-
}], key: [{
|
|
2569
|
-
type: Input
|
|
2570
|
-
}], getValidationErrorMessage: [{
|
|
2571
|
-
type: Input
|
|
2572
|
-
}], inputChangeEvent: [{
|
|
2573
|
-
type: Output
|
|
2574
|
-
}] } });
|
|
2392
|
+
args: [{ selector: 'date-input', template: "<mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n (ngModelChange)=\"emitChange()\"\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(propertyValue) : undefined\"\n [max]=\"metadata.max ? metadata.max(propertyValue) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n [disabled]=\"isReadOnly\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2393
|
+
}] });
|
|
2575
2394
|
|
|
2576
2395
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2577
2396
|
const EMPTY_DATERANGE = {
|
|
@@ -2579,14 +2398,14 @@ const EMPTY_DATERANGE = {
|
|
|
2579
2398
|
end: undefined,
|
|
2580
2399
|
values: undefined
|
|
2581
2400
|
};
|
|
2582
|
-
class DateRangeInputComponent {
|
|
2401
|
+
class DateRangeInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2583
2402
|
constructor() {
|
|
2584
|
-
|
|
2585
|
-
this.defaultDateFilter =
|
|
2403
|
+
super(...arguments);
|
|
2404
|
+
this.defaultDateFilter = DateUtilities.defaultDateFilter;
|
|
2586
2405
|
}
|
|
2587
2406
|
ngOnInit() {
|
|
2588
|
-
|
|
2589
|
-
this.dateRange = LodashUtilities.cloneDeep(this.
|
|
2407
|
+
super.ngOnInit();
|
|
2408
|
+
this.dateRange = LodashUtilities.cloneDeep(this.propertyValue) ?? EMPTY_DATERANGE;
|
|
2590
2409
|
this.dateRangeStart = new Date(this.dateRange.start);
|
|
2591
2410
|
this.dateRangeEnd = new Date(this.dateRange.end);
|
|
2592
2411
|
this.setDateRangeValues();
|
|
@@ -2604,41 +2423,30 @@ class DateRangeInputComponent {
|
|
|
2604
2423
|
else {
|
|
2605
2424
|
this.dateRange.values = undefined;
|
|
2606
2425
|
}
|
|
2607
|
-
this.
|
|
2426
|
+
this.propertyValue = this.dateRange;
|
|
2608
2427
|
this.emitChange();
|
|
2609
2428
|
}
|
|
2610
|
-
emitChange() {
|
|
2611
|
-
this.inputChangeEvent.emit();
|
|
2612
|
-
}
|
|
2613
2429
|
}
|
|
2614
|
-
DateRangeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateRangeInputComponent, deps:
|
|
2615
|
-
DateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DateRangeInputComponent, selector: "date-range-input",
|
|
2430
|
+
DateRangeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateRangeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2431
|
+
DateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DateRangeInputComponent, selector: "date-range-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ?? defaultDateFilter\" [disabled]=\"isReadOnly\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(dateRange.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(dateRange.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(dateRange.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(dateRange.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n\n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$5.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { type: i2$5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2$5.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i2$5.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i2$5.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
2616
2432
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateRangeInputComponent, decorators: [{
|
|
2617
2433
|
type: Component,
|
|
2618
|
-
args: [{ selector: 'date-range-input', template: "<mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ?? defaultDateFilter\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(dateRange.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(dateRange.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(dateRange.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(dateRange.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n\n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2619
|
-
}]
|
|
2620
|
-
type: Input
|
|
2621
|
-
}], key: [{
|
|
2622
|
-
type: Input
|
|
2623
|
-
}], getValidationErrorMessage: [{
|
|
2624
|
-
type: Input
|
|
2625
|
-
}], inputChangeEvent: [{
|
|
2626
|
-
type: Output
|
|
2627
|
-
}] } });
|
|
2434
|
+
args: [{ selector: 'date-range-input', template: "<mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ?? defaultDateFilter\" [disabled]=\"isReadOnly\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(dateRange.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(dateRange.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(dateRange.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(dateRange.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n\n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2435
|
+
}] });
|
|
2628
2436
|
|
|
2629
2437
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2630
|
-
class DateTimeInputComponent {
|
|
2438
|
+
class DateTimeInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2631
2439
|
constructor() {
|
|
2440
|
+
super(...arguments);
|
|
2632
2441
|
this.DateUtilities = DateUtilities;
|
|
2633
|
-
this.inputChangeEvent = new EventEmitter();
|
|
2634
2442
|
this.defaultDateFilter = () => true;
|
|
2635
2443
|
}
|
|
2636
2444
|
ngOnInit() {
|
|
2637
|
-
|
|
2638
|
-
this.time = DateUtilities.getTimeFromDate(this.
|
|
2445
|
+
super.ngOnInit();
|
|
2446
|
+
this.time = DateUtilities.getTimeFromDate(this.propertyValue);
|
|
2639
2447
|
this.timeDropdownValues = this.metadata.times;
|
|
2640
|
-
if (this.
|
|
2641
|
-
this.
|
|
2448
|
+
if (this.propertyValue) {
|
|
2449
|
+
this.propertyValue = new Date(this.propertyValue);
|
|
2642
2450
|
}
|
|
2643
2451
|
}
|
|
2644
2452
|
/**
|
|
@@ -2649,44 +2457,34 @@ class DateTimeInputComponent {
|
|
|
2649
2457
|
* @returns Whether or not the time objects are the same.
|
|
2650
2458
|
*/
|
|
2651
2459
|
compareTimes(time1, time2) {
|
|
2652
|
-
|
|
2460
|
+
if (time1 && time2 && time1.hours === time2.hours && time1.minutes === time2.minutes) {
|
|
2461
|
+
return true;
|
|
2462
|
+
}
|
|
2463
|
+
return false;
|
|
2653
2464
|
}
|
|
2654
2465
|
/**
|
|
2655
2466
|
* Sets the time on a datetime property.
|
|
2656
2467
|
*/
|
|
2657
2468
|
setTime() {
|
|
2658
|
-
if (!this.
|
|
2659
|
-
this.entity[this.key] = undefined;
|
|
2469
|
+
if (!this.propertyValue) {
|
|
2660
2470
|
this.emitChange();
|
|
2661
2471
|
return;
|
|
2662
2472
|
}
|
|
2663
|
-
this.entity[this.key] = new Date(this.dateTime);
|
|
2664
2473
|
if (this.time?.hours != null && this.time?.minutes != null) {
|
|
2665
|
-
this.
|
|
2474
|
+
this.propertyValue.setHours(this.time.hours, this.time.minutes, 0, 0);
|
|
2666
2475
|
}
|
|
2667
2476
|
else {
|
|
2668
|
-
this.
|
|
2477
|
+
this.propertyValue.setHours(0, 0, 0, 0);
|
|
2669
2478
|
}
|
|
2670
2479
|
this.emitChange();
|
|
2671
2480
|
}
|
|
2672
|
-
emitChange() {
|
|
2673
|
-
this.inputChangeEvent.emit();
|
|
2674
|
-
}
|
|
2675
2481
|
}
|
|
2676
|
-
DateTimeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateTimeInputComponent, deps:
|
|
2677
|
-
DateTimeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DateTimeInputComponent, selector: "date-time-input",
|
|
2482
|
+
DateTimeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateTimeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2483
|
+
DateTimeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DateTimeInputComponent, selector: "date-time-input", usesInheritance: true, ngImport: i0, template: "<div class=\"date-time\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(propertyValue) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(propertyValue) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? defaultDateFilter\"\n (dateInput)=\"setTime()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n [compareWith]=\"compareTimes\"\n (ngModelChange)=\"setTime()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n propertyValue,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n</div>", styles: ["mat-form-field{width:100%}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2$5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { type: i2$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3$3.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2678
2484
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DateTimeInputComponent, decorators: [{
|
|
2679
2485
|
type: Component,
|
|
2680
|
-
args: [{ selector: 'date-time-input', template: "<div class=\"date-time\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"
|
|
2681
|
-
}]
|
|
2682
|
-
type: Input
|
|
2683
|
-
}], key: [{
|
|
2684
|
-
type: Input
|
|
2685
|
-
}], getValidationErrorMessage: [{
|
|
2686
|
-
type: Input
|
|
2687
|
-
}], inputChangeEvent: [{
|
|
2688
|
-
type: Output
|
|
2689
|
-
}] } });
|
|
2486
|
+
args: [{ selector: 'date-time-input', template: "<div class=\"date-time\">\n <mat-form-field appearance=\"standard\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"propertyValue\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(propertyValue) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(propertyValue) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? defaultDateFilter\"\n (dateInput)=\"setTime()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n [compareWith]=\"compareTimes\"\n (ngModelChange)=\"setTime()\"\n [disabled]=\"isReadOnly\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n propertyValue,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n</div>", styles: ["mat-form-field{width:100%}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\n"] }]
|
|
2487
|
+
}] });
|
|
2690
2488
|
|
|
2691
2489
|
/**
|
|
2692
2490
|
* Adds drag and drop functionality to an element.
|
|
@@ -2794,7 +2592,7 @@ class FileInputComponent {
|
|
|
2794
2592
|
this.resetFileInputs();
|
|
2795
2593
|
return;
|
|
2796
2594
|
}
|
|
2797
|
-
if (files.find(f => f.size >
|
|
2595
|
+
if (files.find(f => FileUtilities.transformToMegaBytes(f.size, 'B') > this.metadata.maxSize)) {
|
|
2798
2596
|
this.dialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
2799
2597
|
data: this.metadata.maxSizeErrorDialog,
|
|
2800
2598
|
autoFocus: false,
|
|
@@ -2807,7 +2605,7 @@ class FileInputComponent {
|
|
|
2807
2605
|
for (const file of files) {
|
|
2808
2606
|
fileSizeTotal += file.size;
|
|
2809
2607
|
}
|
|
2810
|
-
if (fileSizeTotal >
|
|
2608
|
+
if (FileUtilities.transformToMegaBytes(fileSizeTotal, 'B') > this.metadata.maxSizeTotal) {
|
|
2811
2609
|
this.dialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
2812
2610
|
data: this.metadata.maxSizeTotalErrorDialog,
|
|
2813
2611
|
autoFocus: false,
|
|
@@ -2873,79 +2671,62 @@ class FileInputComponent {
|
|
|
2873
2671
|
}
|
|
2874
2672
|
}
|
|
2875
2673
|
FileInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileInputComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
2876
|
-
FileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileInputComponent, selector: "file-input", inputs: { entity: "entity", key: "key", getValidationErrorMessage: "getValidationErrorMessage" }, outputs: { fileDataChangeEvent: "fileDataChangeEvent" }, ngImport: i0, template: "<input #fileInput\n type=\"file\" hidden\n [multiple]=\"metadata.multiple\"\n [accept]=\"FileUtilities.getAcceptString(metadata.allowedMimeTypes)\"\n (change)=\"setFileFromInput($event)\"\n>\n\n<mat-form-field floatLabel=\"always\" (click)=\"fileInput.click()\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n [(ngModel)]=\"filenames\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-chip *ngFor=\"let name of filenames\" (removed)=\"removeFile(name)\">\n {{name}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input [matChipInputFor]=\"chipList\" [readonly]=\"true\">\n </mat-chip-list>\n <button mat-icon-button matSuffix>\n <i class=\"fas fa-upload\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>\n\n<div *ngIf=\"metadata.dragAndDrop\" class=\"dropdown\" dragDrop (files)=\"setFile($event)\">\n <i class=\"fas fa-file-arrow-up\"></i>\n</div>", styles: ["mat-form-field{width:100%}input:hover,mat-form-field:hover{cursor:pointer}
|
|
2674
|
+
FileInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileInputComponent, selector: "file-input", inputs: { entity: "entity", key: "key", getValidationErrorMessage: "getValidationErrorMessage", isReadOnly: "isReadOnly" }, outputs: { fileDataChangeEvent: "fileDataChangeEvent" }, ngImport: i0, template: "<input #fileInput\n type=\"file\" hidden\n [multiple]=\"metadata.multiple\"\n [accept]=\"FileUtilities.getAcceptString(metadata.allowedMimeTypes)\"\n (change)=\"setFileFromInput($event)\"\n>\n\n<mat-form-field [class.readOnly]=\"isReadOnly\" floatLabel=\"always\" (click)=\"!isReadOnly ? fileInput.click() : null\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n [(ngModel)]=\"filenames\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-chip *ngFor=\"let name of filenames\" (removed)=\"removeFile(name)\">\n {{name}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input [matChipInputFor]=\"chipList\" [readonly]=\"true\">\n </mat-chip-list>\n <button mat-icon-button matSuffix [disabled]=\"isReadOnly\">\n <i class=\"fas fa-upload\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>\n\n<div *ngIf=\"metadata.dragAndDrop && !isReadOnly\" class=\"dropdown\" dragDrop (files)=\"setFile($event)\">\n <i class=\"fas fa-file-arrow-up\"></i>\n</div>", styles: ["mat-form-field{width:100%}.readOnly:hover,.readOnly:hover input:hover{cursor:default}input:hover,mat-form-field:hover{cursor:pointer}.dropdown{display:flex;align-items:center;justify-content:center;height:200px;border:2px dashed #757575;border-radius:15px;margin-top:5px;margin-bottom:5px}.dropdown i{font-size:30px}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$6.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$6.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i2$6.MatChipRemove, selector: "[matChipRemove]" }, { type: i2$6.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i1$1.MatSuffix, selector: "[matSuffix]" }, { type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: DragDropDirective, selector: "[dragDrop]", outputs: ["files"] }] });
|
|
2877
2675
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileInputComponent, decorators: [{
|
|
2878
2676
|
type: Component,
|
|
2879
|
-
args: [{ selector: 'file-input', template: "<input #fileInput\n type=\"file\" hidden\n [multiple]=\"metadata.multiple\"\n [accept]=\"FileUtilities.getAcceptString(metadata.allowedMimeTypes)\"\n (change)=\"setFileFromInput($event)\"\n>\n\n<mat-form-field floatLabel=\"always\" (click)=\"fileInput.click()\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n [(ngModel)]=\"filenames\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-chip *ngFor=\"let name of filenames\" (removed)=\"removeFile(name)\">\n {{name}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input [matChipInputFor]=\"chipList\" [readonly]=\"true\">\n </mat-chip-list>\n <button mat-icon-button matSuffix>\n <i class=\"fas fa-upload\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>\n\n<div *ngIf=\"metadata.dragAndDrop\" class=\"dropdown\" dragDrop (files)=\"setFile($event)\">\n <i class=\"fas fa-file-arrow-up\"></i>\n</div>", styles: ["mat-form-field{width:100%}input:hover,mat-form-field:hover{cursor:pointer}
|
|
2677
|
+
args: [{ selector: 'file-input', template: "<input #fileInput\n type=\"file\" hidden\n [multiple]=\"metadata.multiple\"\n [accept]=\"FileUtilities.getAcceptString(metadata.allowedMimeTypes)\"\n (change)=\"setFileFromInput($event)\"\n>\n\n<mat-form-field [class.readOnly]=\"isReadOnly\" floatLabel=\"always\" (click)=\"!isReadOnly ? fileInput.click() : null\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <mat-chip-list #chipList\n [(ngModel)]=\"filenames\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [required]=\"metadata.required\"\n [disabled]=\"isReadOnly\"\n >\n <mat-chip *ngFor=\"let name of filenames\" (removed)=\"removeFile(name)\">\n {{name}}\n <button matChipRemove>\n <i class=\"{{metadata.deleteIcon}}\"></i>\n </button>\n </mat-chip>\n <input [matChipInputFor]=\"chipList\" [readonly]=\"true\">\n </mat-chip-list>\n <button mat-icon-button matSuffix [disabled]=\"isReadOnly\">\n <i class=\"fas fa-upload\"></i>\n </button>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n</mat-form-field>\n\n<div *ngIf=\"metadata.dragAndDrop && !isReadOnly\" class=\"dropdown\" dragDrop (files)=\"setFile($event)\">\n <i class=\"fas fa-file-arrow-up\"></i>\n</div>", styles: ["mat-form-field{width:100%}.readOnly:hover,.readOnly:hover input:hover{cursor:default}input:hover,mat-form-field:hover{cursor:pointer}.dropdown{display:flex;align-items:center;justify-content:center;height:200px;border:2px dashed #757575;border-radius:15px;margin-top:5px;margin-bottom:5px}.dropdown i{font-size:30px}\n"] }]
|
|
2880
2678
|
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { entity: [{
|
|
2881
2679
|
type: Input
|
|
2882
2680
|
}], key: [{
|
|
2883
2681
|
type: Input
|
|
2884
2682
|
}], getValidationErrorMessage: [{
|
|
2885
2683
|
type: Input
|
|
2684
|
+
}], isReadOnly: [{
|
|
2685
|
+
type: Input
|
|
2886
2686
|
}], fileDataChangeEvent: [{
|
|
2887
2687
|
type: Output
|
|
2888
2688
|
}] } });
|
|
2889
2689
|
|
|
2890
2690
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2891
|
-
class FileDefaultInputComponent {
|
|
2691
|
+
class FileDefaultInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2892
2692
|
constructor() {
|
|
2693
|
+
super(...arguments);
|
|
2893
2694
|
this.FileUtilities = FileUtilities;
|
|
2894
|
-
this.inputChangeEvent = new EventEmitter();
|
|
2895
|
-
}
|
|
2896
|
-
async ngOnInit() {
|
|
2897
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.FILE_DEFAULT);
|
|
2898
2695
|
}
|
|
2899
2696
|
async refreshFileData(fileData) {
|
|
2900
|
-
this.
|
|
2697
|
+
this.propertyValue = fileData;
|
|
2901
2698
|
this.emitChange();
|
|
2902
2699
|
}
|
|
2903
|
-
emitChange() {
|
|
2904
|
-
this.inputChangeEvent.emit();
|
|
2905
|
-
}
|
|
2906
2700
|
}
|
|
2907
|
-
FileDefaultInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileDefaultInputComponent, deps:
|
|
2908
|
-
FileDefaultInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileDefaultInputComponent, selector: "file-default-input",
|
|
2701
|
+
FileDefaultInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileDefaultInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2702
|
+
FileDefaultInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileDefaultInputComponent, selector: "file-default-input", usesInheritance: true, ngImport: i0, template: "<div [class.file-input]=\"metadata.dragAndDrop\" [class.mat-elevation-z8]=\"metadata.dragAndDrop\">\n <file-input\n (fileDataChangeEvent)=\"refreshFileData($event)\"\n [entity]=\"entity\"\n [key]=\"key\"\n [getValidationErrorMessage]=\"getValidationErrorMessage\"\n [isReadOnly]=\"isReadOnly\"\n >\n </file-input>\n</div>", styles: [".file-input{margin-top:15px;margin-bottom:15px;padding:15px;border-radius:5px}\n"], components: [{ type: FileInputComponent, selector: "file-input", inputs: ["entity", "key", "getValidationErrorMessage", "isReadOnly"], outputs: ["fileDataChangeEvent"] }] });
|
|
2909
2703
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileDefaultInputComponent, decorators: [{
|
|
2910
2704
|
type: Component,
|
|
2911
|
-
args: [{ selector: 'file-default-input', template: "<div
|
|
2912
|
-
}]
|
|
2913
|
-
type: Input
|
|
2914
|
-
}], key: [{
|
|
2915
|
-
type: Input
|
|
2916
|
-
}], getValidationErrorMessage: [{
|
|
2917
|
-
type: Input
|
|
2918
|
-
}], inputChangeEvent: [{
|
|
2919
|
-
type: Output
|
|
2920
|
-
}] } });
|
|
2705
|
+
args: [{ selector: 'file-default-input', template: "<div [class.file-input]=\"metadata.dragAndDrop\" [class.mat-elevation-z8]=\"metadata.dragAndDrop\">\n <file-input\n (fileDataChangeEvent)=\"refreshFileData($event)\"\n [entity]=\"entity\"\n [key]=\"key\"\n [getValidationErrorMessage]=\"getValidationErrorMessage\"\n [isReadOnly]=\"isReadOnly\"\n >\n </file-input>\n</div>", styles: [".file-input{margin-top:15px;margin-bottom:15px;padding:15px;border-radius:5px}\n"] }]
|
|
2706
|
+
}] });
|
|
2921
2707
|
|
|
2922
2708
|
// eslint-disable-next-line max-len
|
|
2923
2709
|
const placeholder = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAMAAAAEPmswAAAANlBMVEXx8/XCy9LFztXu8PPs7/Lp7e/W3OHL0tnZ3+PN1NrS2d7i5urn6u7f5OjI0Nfc4ebP1tzk6excnoRZAAAXh0lEQVR42uzUAQ0AAAzDoN+/6eloAiK4B4gQFpAhLCBDWECGsIAMYQEZwgIyhAVkCAvIEBaQISwgQ1hAhrCADGEBGcICMoQFZAgLyBAWkCEsIENYQIawgAxhARnCAjKEBWQIC8gQFpAhLCBDWECGsIAMYQEZwgIyhAVkCAvIEBaQISwgQ1hAhrCADGEBGcICMoQFZAgLyBAWkCEsIENYQIawgAxhARnCAjKEBWQIC8gQFpAhLGDs1AEJAAAAgKD/r9sR6Ag3hAVsCAvYEBawISxgQ1jAhrCADWEBG8ICNoQFbAgL2BAWsCEsYENYwIawgA1hARvCAjaEBWwIC9gQFrAhLGBDWMCGsIANYQEbwgI2hAVsCAvYEBawISxgQ1jAhrCADWEBG8ICNoQFbAgL2BAWsCEsYENYwIawgA1hARvCAjaEBWwIC9gQFrAhLGBDWMCGsIANYQEbwgI2hAVsCAvYEBbETh2QAAAAAAj6/7odgY6QDWEBG8ICNoQFbAgL2BAWsCEsYENYwIawgA1hARvCAjaEBWwIC9gQFrAhLGBDWMCGsIANYQEbwgI2hAVsCAvYEBawISxgQ1jAhrCADWEBG8ICNoQFbAgL2BAWsCEsYENYwIawgA1hARvCAjaEBWwIC9gQFrAhLGBDWMCGsIANYQEbwgI2hAVsCAvYEBawISxgQ1jAhrCADWEBG8ICNoRF7NQBCQAAAICg/6/bEegIYUNYwIawgA1hARvCAjaEBWwIC9gQFrAhLGBDWMCGsIANYQEbwgI2hAVsCAvYEBawISxgQ1jAhrCADWEBG8ICNoQFbAgL2BAWsCEsYENYwIawgA1hARvCAjaEBWwIC9gQFrAhLGBDWMCGsIANYQEbwgI2hAVsCAvYEBawISxgQ1jAhrCADWEBG8ICNoQFbAgL2BAWsCEsYENYwIawgA1hxc6dJtcKAgEURgREwGn/m32Vd1Op/Ih3cO72fIs4BU0rADEIFgAxCBYAMQgWADEIFgAxCBbwm+3bFOKQ8zSV4r13zvky5a4bYgxjYyuch2ABD7ZJMRdnXnIlDyE1FY5HsADbhmFy5lM+x7GvcCSChXtrQufNCnXpQlvhIAQLt2XHONVmE2VIzLaOQLBwT230ZlsuBy6IeyNYuB+bOmd24TpOWrsiWLiZJhazKz8w09oNwcKd9NGbA9SZg9Y+CBZuw4ZijlMiE63tESzcg02TOZqnWVsjWLiDpqvNKXxkI35LBAv6pWJO5APzrM0QLChnozNnm5jBb4RgQbU2m0uoO3YdtkCwoFjy5jp85Ji1GsGCWpfK1X95rLAKwYJS4XK54pi1HsGCSuH8SfucjkWH5QgWFLpwrr6UVGEZggV10rVz9cVxM1yGYEGZthgJ6oHPdhYgWFClv8jeFcOsfRAsKGIHI8rENumHCBb0iLWRhvn7ZwgWtGgvuXj1kidZHyBY0MF2RiqS9T6CBRWCvNsgyVqAYEGBRsYqA8lajWBBPGlvg38rvBi+gWBBuvb6i+3vmdjLeolgQTYdx6tvme33FwgWRBO6yzBr4BvDpwgWJNN0vHqo+Sz6GYIFuRplx6sHx4PhPIIFsaJRigfDWQQLQvXid6+Yvn+OYEGmUfRq+2uMsv5EsCCSvmk7o6x3ECwIpPo6yCLpEwQL8iTl10G2smYRLIij/zrIvXAOwYIwvcrlq1kT74W/ESzIMmr51Plddazwg2BBlGDux7NH+oNgQRK5/0Fm+L4JgvWPvbvRSRiGAjBaBoqK+PP+L2s0xGSj3QiQ9I57zkN86brblvVItn1l8/2cYLEar1mmGWoOFlm/BIu1yLh9ZZE1IVisRNLtK4usEcFiFYbvwtYiS7BYg7zb7WPfFlmCRXj7bNOiFlkNgkV8j373lZ2siwkW4SX/PTi1+9pkJljEluhyhgsdMy+yBIvQDoWpXeLThYJFYMYZ6vJe4SBYxDWkuAv5Gu9Z78kSLMIajF8ZcBgRLOL6MH5l731MsAhrb/zK3vuEYBFV6ttk7L3XCRZBvRUcLpwSLGLSK3PvFYJFSHrls7BGsIhIr3wWVgkWATnu7G9hnWARj175LGwQLMLRK5+FLYJFNHp1jd1+k4NgEYpeXel5k4JgEYleXe24yUCwCESvXDkzR7CIxPzVTbYJxt4FizD0ynzDPMEiDr3yCtgCwSKMr8Ltnh58I0uwiOG1cA/bxz6oI1iE4L4+E1nLBIsY3IdsIusCgkUI3pu4q/fH3XoXLPob9OqXo4VLBIsAvD944tnCBYJFAN53PjFDukCw6O9Q+GPrfYlg0d2x8M+tfrMEi94+CyOm3tsEi65cKDNl6n2OYNGTA89Vpt5bBIuOHCCs8rOwSbDoaW9gtMbPwhbBohsD7k1+FjYIFv0MBkbb/CysESx6MTA6z8nCCsGiEwNYS7xOcU6w6OWlsMB4ww9794LdJgyEUXgwAsfFL/a/2Z4+T2zjWCMgnl/cbwttbxppNNwjWHgLBrByMN5wj2Ct4HztL+OxS621qTuOp/5a06HnItgw+v0uTRUI1qL2/dDao3b8qO+RRDkGGt5haGpAsJZzPbX2XDvUc/I5ExuwsrE4+QbBWsz+I9kr6VLR/XI5Nsq8SVdBsQjWIg6D5Rn5bxYbGpwYyPqPYC3iMFq+4+aTxSeevdg38xfBWsB5MJ+j/s+5Oc5cEDoxQvoPwZrvozW3SwWHCWX4RM67iX9Oh2DNc+isRFL/QVduNBRg6P0XgjVTv/nJYx9eEAYgXSyCNcNu2PpUjBMXhCEo/7AkWKVm78tM8jc2XqxEDkL4mQ7BKnZot35j48QFYRi6z3QIVqlru/kbGx8uCAORLRbBKvSD808nVoxGorrpnWCVuTIV48TKvlhEL30IVoEl1zlt5xyLlX2xaBaLYJU4J153+bCyLx7J5Q0Ey23hw+Ok+NfGiwP3iBSLRbAKDLaksdkCDtwDSnrLuwmWX29mDB57MOEelF6xCJbTGocx9R9jMeEelNxKP4Ll1tlvHGPl4psTgbVixSJYXr39wS+FuVgpE5lYsQiW0661FcgdJTiwUiY2rd8KCZbTyf7ipjAPO9yjk/o/FsHy2dstBt5fYEVDfErFIlg+g63j2FSLidHwhJ5bECyXs33GaMNLfDRVgk6xCJbLyT7jFOsVJkZFyBSLYHnsbD1C5wgOe4MElWIRLI/e7rFn+ws8eRYiUiyC5dHZelJTIZ4869C4KyRYDnu7x2TDF9gxqkWiWATL4WJrOjW14cmzFoViESyHZGtqm8rw5FmNwCsdgpXvbI8YxXqGJ8+C4heLYOXr7RE7G57gAEtS+I1+BCvfyaYwOzqFAyxR0YtFsPIle8Qh1iQOsGQFLxbByrazCQy7T2ICS1fsb+kQrGwHe4rPQN/iCaGy0MUiWNl6m8Kp+yN2YGmL/E1ogpXtYtMYHb3HDixxgYtFsLIN9gRb/G6xxF1e3AtrgpXtaM/w/vkzlrhXYGiCIljZOntAsKbsOMDSF7VYBCtbsrVV8ofBk5waBD1QreTfyPoIVh6e5NQi5kbJOv6NfAtbX9zLmVw8yanHT/buBDt1GIbCsJwRCOP+N/t62vNaphLbSZEs/98O2gOXyJFkk102BFYkAisGIzmeDMEeAitaK09REl5hJMcVg6MXHr4jb8EZVgRGcpyxl1gOviPv0stzrGv4MdLR4Iu5pZIEViQaR+cxkuOOucu/CKxIjObMYiTHIWsXUxBY0TbynPtevUiM5LhkbKEfgRWJ9TIz6GhwytZ6LAIrEgv8ZtDR4JWpZTMEViRWJM/ZCXyytGyGwIrFJRSvsGTUM0OHqwRWLK75eoUdDa7ZGYQmsOLt5CnO3EOgxd05M59NAisWV9W/MgpcszIITWAl6OUeR1ifaHH37xxMILASnOSBz5NNY/8ZGGBkSIfASjDKDZ8/YelY2lcFG0M6BFaKXh4w+UyLeyU6Cw2kBFaKQW75fHOc7CCogYUhHQIrRSN3aHMPtLjXw0CnIIGV5CT3vN8DN4eCsCb6L4YIrCRHuUYTVgi0uFdFvYGUwEpzkP/cPWxnocW9MkPQRGClGuUKPQ1sca/OOSgisJId5BsnWB/2gqqoNpASWMmaVv6ArTW00biXvkLtMaghsNIN8snXUWYeZp6rpNiORWBl2Mva+lAqZp5rtA9aCKxk36s1aWlg5rlWU1BCYOXYyQcKQmae63UKOgisLAcRoQWLgrBiQ1BBYGVpem8z8BkoCKt2DhoIrDzHztmWoXQUhHXT+dwSWJnGtvoDd2ae66ZSGRBYubbVX/ZMQVg5jXYsAivbueyzSyN/Pwo2hbcjsPJt25qfrygIodDcQGAtMHZlj5EuwFZkqBQIBNYSx16W6Ip9P0hBCJ3mBgJrkeYg+S7F9l9REEKpuYHAWmiobx4nBApCKDU3EFhLjb3k6As+vuKaHGhtbiCwlhvayh6vKAihdZEOgbWCZpI0l2L3i36ZBFD59SWwVjFOKXFVdDUYKAih101IYK0iIbKm0uMqNFyTA615WAJrNcdNL3O6TcGtV18oCKH4qpDAWtP21MnvukOxdw/+oCCE5qtCAmtlx2Hq5FE7DQ6erUKgIITqHDSB9Qea7XCaLvu+a7u+30+nYVtwT/stCkKovioksJCAgvAfe3eU6ygMBFG0GhtCSAxh/5udUWby8Z4COGCgI92ziJLLuBuc+6mQwEI+nozi9KlCAgu5KIQ4/VMhgYVMFEKc/6mQwEIeCiEcTBUSWMhDIYSDBaQEFrJQCOFhASmBhRwUQiwLve2LwEIetozCxb8KCSxk4LcT8DGjQ2BhGYUQTmZ0CCwsoxDCyYwOgYVFFEJ4mdEhsLCEQgg3MzoEFpZQCPGJ0XZDYGERhRCfGWwvBBaWUAjh6OKdwMI8CiE+drF9EFhYQCGEp4t3AgtzKIRwdfFOYGEOhRCuLt4JLMy6CvBz8U5gYU5VC/Dz4p3AwpxBgKNVMwQWJlEI4W3VDIGFGRRC+Fo1Q2BhCoUQ7na8E1iYdBHga8c7gYUJFEL4u3gnsDClFeDs4p3AwjsUQrj8uarsCP21a4Z0G+sYQwiSQoixvo9paJvHpTI4RCFEAVcrSrar/tEMY9SCeL+1zaM3OEIhhMPFDbK9VF07Bn2kTs2V45YPFEJ4XNwg20PfpKgJOallONtdgL/FDbLSqi7V2qpOHUetU1AI8eR0cYOsqKq7BRVybzlpHY5CiH+cvh+VlVN1o8oKt4ar+CNRCPHi8/2orJRrCtpDTA/DISiE2EeyUmRFVG3UfgKZdQAKIX7y+H5UVkA/BP1GZn0vCiGeHP74S7bZJek9Mus7NQL+8vh+VLZRlXSckC6GnfUCnhyOQcu2aYOOVTc80CqOQoj33O0flW3RRR0vJN5nlUUhxAR3Y9Cy9aqb8nHM+g59EPDi7hpLtloXdCKOWYVQCDHP1Ri0LJOf49VL3Rm2ohBiga9rLFkeX8er/yLNcBsKIXI4+o2ObAU//38KA7OGJY0CfvM0Bi1bofd00cHTrLUohDja3TaSfe4R5crIC/gVKIR/2Lvb5NRhGArD54RvCC3sf7N3Op07UyhJ7PQHsvU+W4BxIvlIQbkw2/zkMrFH+em/V6MgRKlIbSy50hDzX82RVYeCEMUitbHkOh9hP/60ozAsRkGIGoHaWHKVQ7D21YORI6sCkVGUC9PGkqcFTV9xZP0RBSGqRWljyb+1/J/myKrAllG8w2bwavKEwGnReXdyWXMoCPF2o1eTi719eLDUlYGdOa1kVdCvo9eSH/RwXkmbI0fWSxSEiOHmleRnTcWvpmz3RoWwYRX0afVuLLnI0FyLg1jWMwpCxHH3OnKJocUn8Ej3/QcKQoRy9Cryt/7OK7rvDygIEcvJa8hf+jyvaGX91HpcBZ1Z18aS7W7PK0kjq9+XnAS8wcUryO75vKIutE1BiJD2rifb7ut+8NmGupCCEBEdXE3dn1eSdtSFFISIZze4lvxf10soqQsnDJH3BaF3V9dSivNK2rKR9KWrgPc5u5LcyfzgogsfBPvtJuB96hcmK08/luY7BSGi2bmOMk2YMazT8Rs02vTpKvKks/pzNPr+hdGam2soWXuDhAOfyUEodSM68oRTr//mTxIOvV0Bo2l3V5BfO/R6XvGS1dAnRZDC3uWU8fro02AJFsI4uJhSfkNlx3UhM88Io2JER0nzz+mvC/vK2KFtV5dSigAWL1nMPCOyswspbzwn80tW3z1KNKd4REeJH75j3ulCIu6IZXQZ+dlHnofvJusKhyTv0GjI0UXU20bkOpeUKVIi7ojn5BJKXixsM6ZIOw+toEllIzpKeEGYPUWa7zdGC64uIJob2XrvaS5V0JizlynLBCGb/Ug0ILbN4EXK23BP2ntP1qREQ+5eJPaNfNmmyb2zowFx7b1ENGO/JSkLcxb9aMXBC5S74Z6uLMxa9KMNOy8Qz95MkSx2NCC2q+cpfcM90zh0n3v60ZObZ4nLox/ufZeFQ/aXaMS3EHgXl0d5ysK8t8Box8VzRPo5zW1h6ltgNGPvGSL9nOW2kAYWmjC7zE80sJIsT+ahhEaMniZqhSR7/f6xdy+4iQNBEEDdQYEA4Xf/y+5ukk2AYAkFKXKX3ztEWe6p6THAoouXGjUYYM1j5YyPEn2saszgX2EWK2cMsGhk/KHCwb/CTYtjJfFRopVDjRj8K8yh9m4pMr0c67bBAGsG/QZXCGlmrPA++FcY9ZwyyJr5Hg462tZNA/GDLK960dCmvhNYMxhk2cNBR7cK7wJrBoOs3QANneobgZU/yLKHg6aWdU1gxQ+ynALT1qquCKz0jTMao/T1WlcE1l121ZbGKI291CWBdZ/XrqN3A3daW9UFgZX90KqBO7091wWBFb0jy8Cd7g51TmAld0g13OlvXWcEVnCHVMOdABe3oAVW8Ojdon4S7OqLwModvdtzRoZjfRJYsaN3K2UIcfZTKLBSR+8OCImxrf8EVmjr3QEhQTb1QWBljt4dEJJk8VTvBFbm6N1DSETZ1juBFblwxpsThNnUG4GVuHBGoYE0Hz+FAivwsNCNZ/Js6x+B9VPbmiqP0pNoWX8JrLjDwpVCA4nefgoFVtph4d5KZDKdqkpgPWCxrslRwCLWskpgPWRyNwufrHAn1mJfAivqsFBekexUAivqZqGCO9GWAutRpwkdFtrYR7bFXmDlPGXvSS/SnQRWTL1BXpHPNY6Uu9AuPDMDatEhd6HlFdCl3iCvgC71BnkFdLkLbd4OdKk3yCugS71BXgFd6g367UCTeoP7zsAPHeoe9l8BU7CrX7WyXxRoUm9Yu6gA/GHvDnMThmEwgNZpF9LQUrj/ZfdvmmBMDEabSu8dIkrsz85O4g3VeQW8ZhjjPv+lAk3pa9whzgA0J8ePxBmABs3xZqP2ILCTVe/2LgI7aRYm04NA1+1iFvog3Q503S6ahZ6DwJe2FycnaQbgLY4p/lnVHQS+abj07noFXGl2TsfsIHCrydS76xVwq8lCViquV8D7fRwU24HdyPGa0aQzsJrpFM8bFa+ANfUlnnS+dADrGmo8oZobBLYwLKf4k1NRagc2M9UUD0rZWxDYVj8/cmalOotdAS2Yyhi/OBcpBqAh/WXJY4or6ZwXhxXQpGE6znMpOZdlmY+TVyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPDJHhwIAAAAAAD5vzaCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwBwcCAAAAAED+r42gqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqirswYEAAAAAAJD/ayOoqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkp7cCAAAAAAIMjfepArAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgKcAnTNeiLeG1rEAAAAASUVORK5CYII=';
|
|
2924
2710
|
|
|
2925
2711
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
2926
|
-
class FileImageInputComponent {
|
|
2712
|
+
class FileImageInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2927
2713
|
constructor() {
|
|
2714
|
+
super(...arguments);
|
|
2928
2715
|
this.FileUtilities = FileUtilities;
|
|
2929
|
-
this.inputChangeEvent = new EventEmitter();
|
|
2930
2716
|
this.imageIndex = 0;
|
|
2931
2717
|
this.placeHolder = placeholder;
|
|
2932
2718
|
}
|
|
2933
|
-
async ngOnInit() {
|
|
2934
|
-
this.metadata = EntityUtilities.getPropertyMetadata(this.entity, this.key, DecoratorTypes.FILE_IMAGE);
|
|
2935
|
-
// setting the image is done inside the refresh method
|
|
2936
|
-
}
|
|
2937
2719
|
async setSinglePreviewImage() {
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
this.singlePreviewImage = await FileUtilities.getDataURLFromFile(singleFileData.file);
|
|
2720
|
+
if (this.propertyValue) {
|
|
2721
|
+
this.propertyValue = await FileUtilities.getFileData(this.propertyValue);
|
|
2722
|
+
this.singlePreviewImage = await FileUtilities.getDataURLFromFile(this.propertyValue.file);
|
|
2942
2723
|
}
|
|
2943
2724
|
else {
|
|
2944
2725
|
this.singlePreviewImage = undefined;
|
|
2945
2726
|
}
|
|
2946
2727
|
}
|
|
2947
2728
|
async setMultiPreviewImages(index) {
|
|
2948
|
-
const multiFileData = this.
|
|
2729
|
+
const multiFileData = this.propertyValue;
|
|
2949
2730
|
const previewImages = [];
|
|
2950
2731
|
if (multiFileData?.length) {
|
|
2951
2732
|
for (let i = 0; i < multiFileData.length; i++) {
|
|
@@ -2961,10 +2742,11 @@ class FileImageInputComponent {
|
|
|
2961
2742
|
this.multiPreviewImages = previewImages;
|
|
2962
2743
|
}
|
|
2963
2744
|
async refreshFileData(fileData) {
|
|
2964
|
-
this.
|
|
2745
|
+
this.propertyValue = fileData;
|
|
2965
2746
|
this.emitChange();
|
|
2966
2747
|
if (this.metadata.multiple) {
|
|
2967
|
-
|
|
2748
|
+
fileData = fileData;
|
|
2749
|
+
if (!fileData?.[this.imageIndex]) {
|
|
2968
2750
|
this.imageIndex = 0;
|
|
2969
2751
|
}
|
|
2970
2752
|
await this.setMultiPreviewImages(this.imageIndex);
|
|
@@ -2974,39 +2756,56 @@ class FileImageInputComponent {
|
|
|
2974
2756
|
}
|
|
2975
2757
|
}
|
|
2976
2758
|
async prev() {
|
|
2977
|
-
if (this.imageIndex
|
|
2978
|
-
|
|
2979
|
-
this.imageIndex--;
|
|
2759
|
+
if (this.imageIndex <= 0) {
|
|
2760
|
+
return;
|
|
2980
2761
|
}
|
|
2762
|
+
await this.setMultiPreviewImages(this.imageIndex - 1);
|
|
2763
|
+
this.imageIndex--;
|
|
2981
2764
|
}
|
|
2982
2765
|
async next() {
|
|
2983
|
-
if (this.multiPreviewImages?.length
|
|
2984
|
-
|
|
2985
|
-
|
|
2766
|
+
if (!this.multiPreviewImages?.length) {
|
|
2767
|
+
return;
|
|
2768
|
+
}
|
|
2769
|
+
if (this.imageIndex === (this.multiPreviewImages.length - 1)) {
|
|
2770
|
+
return;
|
|
2986
2771
|
}
|
|
2772
|
+
await this.setMultiPreviewImages(this.imageIndex + 1);
|
|
2773
|
+
this.imageIndex++;
|
|
2987
2774
|
}
|
|
2988
2775
|
async setIndex(index) {
|
|
2989
2776
|
await this.setMultiPreviewImages(index);
|
|
2990
2777
|
this.imageIndex = index;
|
|
2991
2778
|
}
|
|
2992
|
-
emitChange() {
|
|
2993
|
-
this.inputChangeEvent.emit();
|
|
2994
|
-
}
|
|
2995
2779
|
}
|
|
2996
|
-
FileImageInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileImageInputComponent, deps:
|
|
2997
|
-
FileImageInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileImageInputComponent, selector: "file-image-input",
|
|
2780
|
+
FileImageInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileImageInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2781
|
+
FileImageInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileImageInputComponent, selector: "file-image-input", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"!metadata.dragAndDrop && !metadata.preview\">\n <file-input\n (fileDataChangeEvent)=\"refreshFileData($event)\"\n [entity]=\"entity\"\n [key]=\"key\"\n [getValidationErrorMessage]=\"getValidationErrorMessage\"\n [isReadOnly]=\"isReadOnly\"\n >\n </file-input>\n</div>\n\n<div *ngIf=\"metadata.dragAndDrop || metadata.preview\" class=\"file-input mat-elevation-z8\">\n <file-input\n (fileDataChangeEvent)=\"refreshFileData($event)\"\n [entity]=\"entity\"\n [key]=\"key\"\n [getValidationErrorMessage]=\"getValidationErrorMessage\"\n [isReadOnly]=\"isReadOnly\"\n >\n </file-input>\n\n <div class=\"image-preview\" *ngIf=\"metadata.preview && metadata.multiple\">\n <i (click)=\"prev()\" [class.disabled]=\"imageIndex === 0\" class=\"prev-button fa-solid fa-angle-left\"></i>\n <img *ngIf=\"multiPreviewImages?.[imageIndex]\" class=\"mat-elevation-z2\" [src]=\"multiPreviewImages?.[imageIndex]\">\n <img *ngIf=\"!multiPreviewImages?.[imageIndex]\" class=\"mat-elevation-z2\" [src]=\"metadata.previewPlaceholderUrl ?? placeHolder\">\n <i (click)=\"next()\"\n [class.disabled]=\"!multiPreviewImages || !multiPreviewImages.length || imageIndex === (multiPreviewImages.length - 1)\"\n class=\"next-button fa-solid fa-angle-right\"\n >\n </i>\n </div>\n <div class=\"preview-nav\" *ngIf=\"metadata.preview && metadata.multiple\">\n <button (click)=\"setIndex(imageIndex-4)\" mat-icon-button *ngIf=\"\n this.multiPreviewImages\n && multiPreviewImages[imageIndex-4]\n && imageIndex === (this.multiPreviewImages.length - 1)\"\n >\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex - 3}}</span>\n </button>\n <!-- eslint-disable-next-line @angular-eslint/template/conditional-complexity -->\n <button (click)=\"setIndex(imageIndex-3)\" mat-icon-button *ngIf=\"this.multiPreviewImages\n && multiPreviewImages[imageIndex-3]\n && (\n imageIndex === (this.multiPreviewImages.length - 2)\n || imageIndex === (this.multiPreviewImages.length - 1)\n )\"\n >\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex - 2}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex-2)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex-2]\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex - 1}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex-1)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex-1]\">\n <i class=\"dot\"></i>\n <span class=\"image-index\">{{imageIndex}}</span>\n </button>\n <button mat-icon-button disabled>\n <i class=\"dot selected\"></i>\n <span class=\"image-index\">{{imageIndex + 1}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+1)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+1]\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 2}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+2)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+2]\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 3}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+3)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+3] && imageIndex <= 1\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 4}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+4)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+4] && imageIndex === 0\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 5}}</span>\n </button>\n </div>\n\n <div class=\"image-preview\" *ngIf=\"metadata.preview && !metadata.multiple\">\n <i class=\"prev-button disabled fa-solid fa-angle-left\"></i>\n <img class=\"mat-elevation-z2\" [src]=\"singlePreviewImage ?? metadata.previewPlaceholderUrl ?? placeHolder\">\n <i class=\"next-button disabled fa-solid fa-angle-right\"></i>\n </div>\n <div class=\"preview-nav\" *ngIf=\"metadata.preview && !metadata.multiple\">\n <button disabled mat-icon-button>\n <span class=\"dot selected\"></span>\n <span class=\"image-index\">1</span>\n </button>\n </div>\n</div>", styles: [".file-input{margin-top:15px;margin-bottom:15px;padding:15px;border-radius:5px}.image-preview{height:250px;display:flex;align-items:center;padding-top:15px;padding-bottom:15px}.image-preview .prev-button{font-size:100px;margin-left:5px}.image-preview .next-button{font-size:100px;margin-right:5px}.image-preview .prev-button:hover,.image-preview .next-button:hover{cursor:pointer}.image-preview .prev-button.disabled,.image-preview .next-button.disabled{color:#00000042}.image-preview .prev-button.disabled:hover,.image-preview .next-button.disabled:hover{cursor:default}.image-preview img{max-width:calc(100% - 100px);max-height:100%;margin-left:auto;margin-right:auto;border-radius:3px}.preview-nav{text-align:center}.preview-nav button{display:inline-block;width:18px;height:18px;margin-left:5px;margin-right:5px}.preview-nav button .dot{height:100%;width:100%;background-color:#00000061;border-radius:50%;display:block}.preview-nav button .dot.selected{background-color:#000000de}.preview-nav button .image-index{position:absolute;height:100%;width:100%;display:block;top:-11.5px;color:#fff}.preview-nav button:hover{background-color:#000}\n"], components: [{ type: FileInputComponent, selector: "file-input", inputs: ["entity", "key", "getValidationErrorMessage", "isReadOnly"], outputs: ["fileDataChangeEvent"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2998
2782
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileImageInputComponent, decorators: [{
|
|
2999
2783
|
type: Component,
|
|
3000
|
-
args: [{ selector: 'file-image-input', template: "<div *ngIf=\"!metadata.dragAndDrop && !metadata.preview\">\n <file-input
|
|
3001
|
-
}]
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
2784
|
+
args: [{ selector: 'file-image-input', template: "<div *ngIf=\"!metadata.dragAndDrop && !metadata.preview\">\n <file-input\n (fileDataChangeEvent)=\"refreshFileData($event)\"\n [entity]=\"entity\"\n [key]=\"key\"\n [getValidationErrorMessage]=\"getValidationErrorMessage\"\n [isReadOnly]=\"isReadOnly\"\n >\n </file-input>\n</div>\n\n<div *ngIf=\"metadata.dragAndDrop || metadata.preview\" class=\"file-input mat-elevation-z8\">\n <file-input\n (fileDataChangeEvent)=\"refreshFileData($event)\"\n [entity]=\"entity\"\n [key]=\"key\"\n [getValidationErrorMessage]=\"getValidationErrorMessage\"\n [isReadOnly]=\"isReadOnly\"\n >\n </file-input>\n\n <div class=\"image-preview\" *ngIf=\"metadata.preview && metadata.multiple\">\n <i (click)=\"prev()\" [class.disabled]=\"imageIndex === 0\" class=\"prev-button fa-solid fa-angle-left\"></i>\n <img *ngIf=\"multiPreviewImages?.[imageIndex]\" class=\"mat-elevation-z2\" [src]=\"multiPreviewImages?.[imageIndex]\">\n <img *ngIf=\"!multiPreviewImages?.[imageIndex]\" class=\"mat-elevation-z2\" [src]=\"metadata.previewPlaceholderUrl ?? placeHolder\">\n <i (click)=\"next()\"\n [class.disabled]=\"!multiPreviewImages || !multiPreviewImages.length || imageIndex === (multiPreviewImages.length - 1)\"\n class=\"next-button fa-solid fa-angle-right\"\n >\n </i>\n </div>\n <div class=\"preview-nav\" *ngIf=\"metadata.preview && metadata.multiple\">\n <button (click)=\"setIndex(imageIndex-4)\" mat-icon-button *ngIf=\"\n this.multiPreviewImages\n && multiPreviewImages[imageIndex-4]\n && imageIndex === (this.multiPreviewImages.length - 1)\"\n >\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex - 3}}</span>\n </button>\n <!-- eslint-disable-next-line @angular-eslint/template/conditional-complexity -->\n <button (click)=\"setIndex(imageIndex-3)\" mat-icon-button *ngIf=\"this.multiPreviewImages\n && multiPreviewImages[imageIndex-3]\n && (\n imageIndex === (this.multiPreviewImages.length - 2)\n || imageIndex === (this.multiPreviewImages.length - 1)\n )\"\n >\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex - 2}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex-2)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex-2]\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex - 1}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex-1)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex-1]\">\n <i class=\"dot\"></i>\n <span class=\"image-index\">{{imageIndex}}</span>\n </button>\n <button mat-icon-button disabled>\n <i class=\"dot selected\"></i>\n <span class=\"image-index\">{{imageIndex + 1}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+1)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+1]\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 2}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+2)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+2]\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 3}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+3)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+3] && imageIndex <= 1\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 4}}</span>\n </button>\n <button (click)=\"setIndex(imageIndex+4)\" mat-icon-button *ngIf=\"multiPreviewImages?.[imageIndex+4] && imageIndex === 0\">\n <span class=\"dot\"></span>\n <span class=\"image-index\">{{imageIndex + 5}}</span>\n </button>\n </div>\n\n <div class=\"image-preview\" *ngIf=\"metadata.preview && !metadata.multiple\">\n <i class=\"prev-button disabled fa-solid fa-angle-left\"></i>\n <img class=\"mat-elevation-z2\" [src]=\"singlePreviewImage ?? metadata.previewPlaceholderUrl ?? placeHolder\">\n <i class=\"next-button disabled fa-solid fa-angle-right\"></i>\n </div>\n <div class=\"preview-nav\" *ngIf=\"metadata.preview && !metadata.multiple\">\n <button disabled mat-icon-button>\n <span class=\"dot selected\"></span>\n <span class=\"image-index\">1</span>\n </button>\n </div>\n</div>", styles: [".file-input{margin-top:15px;margin-bottom:15px;padding:15px;border-radius:5px}.image-preview{height:250px;display:flex;align-items:center;padding-top:15px;padding-bottom:15px}.image-preview .prev-button{font-size:100px;margin-left:5px}.image-preview .next-button{font-size:100px;margin-right:5px}.image-preview .prev-button:hover,.image-preview .next-button:hover{cursor:pointer}.image-preview .prev-button.disabled,.image-preview .next-button.disabled{color:#00000042}.image-preview .prev-button.disabled:hover,.image-preview .next-button.disabled:hover{cursor:default}.image-preview img{max-width:calc(100% - 100px);max-height:100%;margin-left:auto;margin-right:auto;border-radius:3px}.preview-nav{text-align:center}.preview-nav button{display:inline-block;width:18px;height:18px;margin-left:5px;margin-right:5px}.preview-nav button .dot{height:100%;width:100%;background-color:#00000061;border-radius:50%;display:block}.preview-nav button .dot.selected{background-color:#000000de}.preview-nav button .image-index{position:absolute;height:100%;width:100%;display:block;top:-11.5px;color:#fff}.preview-nav button:hover{background-color:#000}\n"] }]
|
|
2785
|
+
}] });
|
|
2786
|
+
|
|
2787
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
2788
|
+
class CustomInputComponent extends NgxMatEntityBaseInputComponent {
|
|
2789
|
+
constructor(viewContainerRef) {
|
|
2790
|
+
super();
|
|
2791
|
+
this.viewContainerRef = viewContainerRef;
|
|
2792
|
+
}
|
|
2793
|
+
ngOnInit() {
|
|
2794
|
+
super.ngOnInit();
|
|
2795
|
+
this.component = this.viewContainerRef.createComponent(this.metadata.component);
|
|
2796
|
+
this.component.instance.entity = this.entity;
|
|
2797
|
+
this.component.instance.key = this.key;
|
|
2798
|
+
this.component.instance.getValidationErrorMessage = this.getValidationErrorMessage;
|
|
2799
|
+
this.component.instance.inputChangeEvent.subscribe(this.inputChangeEvent);
|
|
2800
|
+
this.component.instance.isReadOnly = this.isReadOnly;
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
CustomInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomInputComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2804
|
+
CustomInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: CustomInputComponent, selector: "custom-input", usesInheritance: true, ngImport: i0, template: "", styles: [""] });
|
|
2805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomInputComponent, decorators: [{
|
|
2806
|
+
type: Component,
|
|
2807
|
+
args: [{ selector: 'custom-input', template: "", styles: [""] }]
|
|
2808
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });
|
|
3010
2809
|
|
|
3011
2810
|
/**
|
|
3012
2811
|
* The default input component. It gets the metadata of the property from the given @Input "entity" and @Input "propertyKey"
|
|
@@ -3046,8 +2845,9 @@ class NgxMatEntityInputComponent {
|
|
|
3046
2845
|
}
|
|
3047
2846
|
this.internalPropertyKey = this.propertyKey;
|
|
3048
2847
|
this.internalGetValidationErrorMessage = this.getValidationErrorMessage ?? getValidationErrorMessage;
|
|
3049
|
-
this.
|
|
3050
|
-
this.
|
|
2848
|
+
this.internalIsReadOnly = this.isReadOnly ?? false;
|
|
2849
|
+
this.type = EntityUtilities.getPropertyType(this.internalEntity, this.internalPropertyKey);
|
|
2850
|
+
this.metadata = EntityUtilities.getPropertyMetadata(this.internalEntity, this.internalPropertyKey, this.type);
|
|
3051
2851
|
if (this.type === DecoratorTypes.OBJECT) {
|
|
3052
2852
|
this.initObjectInput();
|
|
3053
2853
|
}
|
|
@@ -3071,11 +2871,11 @@ class NgxMatEntityInputComponent {
|
|
|
3071
2871
|
throw new Error(`The name "select" for a display column is reserved.
|
|
3072
2872
|
Please choose a different name.`);
|
|
3073
2873
|
}
|
|
3074
|
-
this.displayedColumns = ['select'].concat(givenDisplayColumns);
|
|
2874
|
+
this.displayedColumns = this.internalIsReadOnly ? givenDisplayColumns : ['select'].concat(givenDisplayColumns);
|
|
3075
2875
|
this.dataSource = new MatTableDataSource();
|
|
3076
2876
|
this.dataSource.data = this.entityArrayValues;
|
|
3077
2877
|
this.arrayItem = new this.metadataEntityArray.EntityClass();
|
|
3078
|
-
this.
|
|
2878
|
+
this.arrayItemInlineTabs = EntityUtilities.getEntityTabs(this.arrayItem, true);
|
|
3079
2879
|
this.arrayItemPriorChanges = LodashUtilities.cloneDeep(this.arrayItem);
|
|
3080
2880
|
this.dialogInputData = {
|
|
3081
2881
|
entity: this.arrayItem,
|
|
@@ -3083,12 +2883,12 @@ class NgxMatEntityInputComponent {
|
|
|
3083
2883
|
getValidationErrorMessage: this.getValidationErrorMessage
|
|
3084
2884
|
};
|
|
3085
2885
|
this.dialogData = new AddArrayItemDialogDataBuilder(this.dialogInputData).getResult();
|
|
3086
|
-
this.
|
|
2886
|
+
this.arrayItemDialogTabs = EntityUtilities.getEntityTabs(this.dialogData.entity, true);
|
|
3087
2887
|
}
|
|
3088
2888
|
initObjectInput() {
|
|
3089
2889
|
this.metadataDefaultObject = this.metadata;
|
|
3090
2890
|
this.objectProperty = this.internalEntity[this.internalPropertyKey];
|
|
3091
|
-
this.
|
|
2891
|
+
this.objectPropertyTabs = EntityUtilities.getEntityTabs(this.objectProperty, this.hideOmitForCreate, this.hideOmitForEdit);
|
|
3092
2892
|
}
|
|
3093
2893
|
/**
|
|
3094
2894
|
* Checks if the arrayItem is valid.
|
|
@@ -3113,20 +2913,24 @@ class NgxMatEntityInputComponent {
|
|
|
3113
2913
|
* Does this either inline if the "createInline"-metadata is set to true
|
|
3114
2914
|
* or in a separate dialog if it is set to false.
|
|
3115
2915
|
*/
|
|
3116
|
-
addEntity() {
|
|
2916
|
+
async addEntity() {
|
|
3117
2917
|
if (this.metadataEntityArray.createInline) {
|
|
3118
|
-
if (!this.metadataEntityArray.allowDuplicates
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
2918
|
+
if (!this.metadataEntityArray.allowDuplicates) {
|
|
2919
|
+
for (const v of this.entityArrayValues) {
|
|
2920
|
+
if ((await EntityUtilities.isEqual(this.arrayItem, v, this.metadata, this.metadataEntityArray.itemType))) {
|
|
2921
|
+
this.dialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
2922
|
+
data: this.metadataEntityArray.duplicatesErrorDialog,
|
|
2923
|
+
autoFocus: false,
|
|
2924
|
+
restoreFocus: false
|
|
2925
|
+
});
|
|
2926
|
+
return;
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
3126
2929
|
}
|
|
3127
2930
|
this.entityArrayValues.push(LodashUtilities.cloneDeep(this.arrayItem));
|
|
3128
2931
|
this.dataSource.data = this.entityArrayValues;
|
|
3129
2932
|
EntityUtilities.resetChangesOnEntity(this.arrayItem, this.arrayItemPriorChanges);
|
|
2933
|
+
this.checkIsArrayItemValid();
|
|
3130
2934
|
this.emitChange();
|
|
3131
2935
|
}
|
|
3132
2936
|
else {
|
|
@@ -3145,6 +2949,7 @@ class NgxMatEntityInputComponent {
|
|
|
3145
2949
|
this.entityArrayValues.push(LodashUtilities.cloneDeep(this.arrayItem));
|
|
3146
2950
|
this.dataSource.data = this.entityArrayValues;
|
|
3147
2951
|
EntityUtilities.resetChangesOnEntity(this.arrayItem, this.arrayItemPriorChanges);
|
|
2952
|
+
this.checkIsArrayItemValid();
|
|
3148
2953
|
this.emitChange();
|
|
3149
2954
|
}
|
|
3150
2955
|
/**
|
|
@@ -3202,10 +3007,10 @@ class NgxMatEntityInputComponent {
|
|
|
3202
3007
|
}
|
|
3203
3008
|
}
|
|
3204
3009
|
NgxMatEntityInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityInputComponent, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
3205
|
-
NgxMatEntityInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: { entity: "entity", propertyKey: "propertyKey", getValidationErrorMessage: "getValidationErrorMessage", hideOmitForCreate: "hideOmitForCreate", hideOmitForEdit: "hideOmitForEdit" }, outputs: { inputChangeEvent: "inputChangeEvent" }, viewQueries: [{ propertyName: "addArrayItemDialog", first: true, predicate: ["addArrayItemDialog"], descendants: true }], ngImport: i0, template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></number-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <div class=\"row\" *ngFor=\"let row of objectPropertyRows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineRows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n \n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove(selection, entityArrayValues, dataSource)\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></file-image-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <h2 mat-dialog-title>{{dialogData.createDialogData.title}}</h2>\n\n <mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogRows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </form>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-raised-button (click)=\"addArrayItem()\" [disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n\n</ng-template>", styles: ["mat-form-field{width:100%}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"], components: [{ type: StringInputComponent, selector: "string-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: StringTextboxInputComponent, selector: "string-textbox-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: StringAutocompleteInputComponent, selector: "string-autocomplete-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: StringDropdownInputComponent, selector: "string-dropdown-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: BooleanCheckboxInputComponent, selector: "boolean-checkbox-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: BooleanToggleInputComponent, selector: "boolean-toggle-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: BooleanDropdownInputComponent, selector: "boolean-dropdown-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: NumberInputComponent, selector: "number-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: NumberDropdownInputComponent, selector: "number-dropdown-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit"], outputs: ["inputChangeEvent"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: ArrayDateInputComponent, selector: "array-date-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: ArrayDateTimeInputComponent, selector: "array-date-time-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: ArrayDateRangeInputComponent, selector: "array-date-range-input", inputs: ["entity", "key", "metadata", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: ArrayStringChipsInputComponent, selector: "array-string-chips-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: ArrayStringAutocompleteChipsComponent, selector: "array-string-autocomplete-chips", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: DateInputComponent, selector: "date-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: DateRangeInputComponent, selector: "date-range-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: DateTimeInputComponent, selector: "date-time-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: FileDefaultInputComponent, selector: "file-default-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }, { type: FileImageInputComponent, selector: "file-image-input", inputs: ["entity", "key", "getValidationErrorMessage"], outputs: ["inputChangeEvent"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i5.MatCellDef, selector: "[matCellDef]" }, { type: i5.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
|
|
3010
|
+
NgxMatEntityInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: { entity: "entity", propertyKey: "propertyKey", getValidationErrorMessage: "getValidationErrorMessage", hideOmitForCreate: "hideOmitForCreate", hideOmitForEdit: "hideOmitForEdit", isReadOnly: "isReadOnly" }, outputs: { inputChangeEvent: "inputChangeEvent" }, viewQueries: [{ propertyName: "addArrayItemDialog", first: true, predicate: ["addArrayItemDialog"], descendants: true }], ngImport: i0, template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_PASSWORD\">\n <string-password-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-password-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_SLIDER\">\n <number-slider-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-slider-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <mat-tab-group *ngIf=\"objectPropertyTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of objectPropertyTabs; let tI = index; trackBy: trackByFn\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows;\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let rI = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"objectPropertyTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of objectPropertyTabs[0].rows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline && !internalIsReadOnly\">\n <mat-tab-group *ngIf=\"arrayItemInlineTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemInlineTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemInlineTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <div class=\"buttons\" *ngIf=\"!internalIsReadOnly\">\n <button mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove(selection, entityArrayValues, dataSource)\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!internalIsReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle(selection, dataSource) : null\"\n [checked]=\"selection.hasValue() && isAllSelected(selection, dataSource)\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected(selection, dataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-image-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Custom------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.CUSTOM\">\n <custom-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </custom-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <h2 mat-dialog-title>{{dialogData.createDialogData.title}}</h2>\n\n <mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <mat-tab-group *ngIf=\"arrayItemDialogTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemDialogTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemDialogTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </form>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-raised-button (click)=\"addArrayItem()\" [disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n\n</ng-template>", styles: ["mat-form-field{width:100%}mat-dialog-actions{justify-content:space-between}::ng-deep .mat-tab-body-wrapper{margin-left:-12px;margin-right:-12px}::ng-deep mat-tab-body{padding-top:10px;padding-left:12px;padding-right:12px}::ng-deep mat-tab-body .mat-tab-body-content{overflow:initial}::ng-deep .mat-form-field.mat-form-field-disabled .mat-form-field-wrapper .mat-form-field-underline{background-image:none;height:1px;background-color:#0000006b}::ng-deep .mat-form-field.mat-form-field-disabled .mat-chip.mat-standard-chip.mat-chip-disabled{opacity:1}::ng-deep .mat-form-field.mat-form-field-disabled .mat-chip.mat-standard-chip.mat-chip-disabled button{opacity:.2}::ng-deep .mat-form-field.mat-form-field-disabled .mat-select-disabled .mat-select-value{color:#000}::ng-deep .mat-form-field.mat-form-field-disabled .mat-date-range-input-inner:disabled{color:#000}::ng-deep .mat-form-field .mat-slide-toggle.mat-disabled{opacity:1}::ng-deep .mat-input-element:disabled{color:#000}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"], components: [{ type: StringInputComponent, selector: "string-input" }, { type: StringTextboxInputComponent, selector: "string-textbox-input" }, { type: StringAutocompleteInputComponent, selector: "string-autocomplete-input" }, { type: StringDropdownInputComponent, selector: "string-dropdown-input" }, { type: StringPasswordInputComponent, selector: "string-password-input" }, { type: BooleanCheckboxInputComponent, selector: "boolean-checkbox-input" }, { type: BooleanToggleInputComponent, selector: "boolean-toggle-input" }, { type: BooleanDropdownInputComponent, selector: "boolean-dropdown-input" }, { type: NumberInputComponent, selector: "number-input" }, { type: NumberDropdownInputComponent, selector: "number-dropdown-input" }, { type: NumberSliderInputComponent, selector: "number-slider-input" }, { type: i13.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i13.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit", "isReadOnly"], outputs: ["inputChangeEvent"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: ArrayDateInputComponent, selector: "array-date-input" }, { type: ArrayDateTimeInputComponent, selector: "array-date-time-input" }, { type: ArrayDateRangeInputComponent, selector: "array-date-range-input" }, { type: ArrayStringChipsInputComponent, selector: "array-string-chips-input" }, { type: ArrayStringAutocompleteChipsComponent, selector: "array-string-autocomplete-chips" }, { type: DateInputComponent, selector: "date-input" }, { type: DateRangeInputComponent, selector: "date-range-input" }, { type: DateTimeInputComponent, selector: "date-time-input" }, { type: FileDefaultInputComponent, selector: "file-default-input" }, { type: FileImageInputComponent, selector: "file-image-input" }, { type: CustomInputComponent, selector: "custom-input" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i4$1.MatCellDef, selector: "[matCellDef]" }, { type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i6.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
|
|
3206
3011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityInputComponent, decorators: [{
|
|
3207
3012
|
type: Component,
|
|
3208
|
-
args: [{ selector: 'ngx-mat-entity-input', template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></string-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></number-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <div class=\"row\" *ngFor=\"let row of objectPropertyRows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineRows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n \n <div class=\"buttons\">\n <button mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove(selection, entityArrayValues, dataSource)\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input (inputChangeEvent)=\"emitChange()\" [entity]=\"internalEntity\" [key]=\"internalPropertyKey\" [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"></file-image-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <h2 mat-dialog-title>{{dialogData.createDialogData.title}}</h2>\n\n <mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogRows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </form>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-raised-button (click)=\"addArrayItem()\" [disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n\n</ng-template>", styles: ["mat-form-field{width:100%}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
3013
|
+
args: [{ selector: 'ngx-mat-entity-input', template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_PASSWORD\">\n <string-password-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-password-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_SLIDER\">\n <number-slider-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-slider-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <mat-tab-group *ngIf=\"objectPropertyTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of objectPropertyTabs; let tI = index; trackBy: trackByFn\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows;\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let rI = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"objectPropertyTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of objectPropertyTabs[0].rows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8\" style=\"border-radius: 5px;padding: 15px;margin-bottom: 15px;margin-top: 15px;\">\n <div style=\"padding-bottom: 10px\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline && !internalIsReadOnly\">\n <mat-tab-group *ngIf=\"arrayItemInlineTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemInlineTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemInlineTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <div class=\"buttons\" *ngIf=\"!internalIsReadOnly\">\n <button mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove(selection, entityArrayValues, dataSource)\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!internalIsReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!dataSource.data.length\" (change)=\"$event ? masterToggle(selection, dataSource) : null\"\n [checked]=\"selection.hasValue() && isAllSelected(selection, dataSource)\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected(selection, dataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-image-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Custom------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.CUSTOM\">\n <custom-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </custom-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <h2 mat-dialog-title>{{dialogData.createDialogData.title}}</h2>\n\n <mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <mat-tab-group *ngIf=\"arrayItemDialogTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemDialogTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemDialogTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </form>\n </mat-dialog-content>\n\n <mat-dialog-actions>\n <button mat-raised-button (click)=\"addArrayItem()\" [disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n\n</ng-template>", styles: ["mat-form-field{width:100%}mat-dialog-actions{justify-content:space-between}::ng-deep .mat-tab-body-wrapper{margin-left:-12px;margin-right:-12px}::ng-deep mat-tab-body{padding-top:10px;padding-left:12px;padding-right:12px}::ng-deep mat-tab-body .mat-tab-body-content{overflow:initial}::ng-deep .mat-form-field.mat-form-field-disabled .mat-form-field-wrapper .mat-form-field-underline{background-image:none;height:1px;background-color:#0000006b}::ng-deep .mat-form-field.mat-form-field-disabled .mat-chip.mat-standard-chip.mat-chip-disabled{opacity:1}::ng-deep .mat-form-field.mat-form-field-disabled .mat-chip.mat-standard-chip.mat-chip-disabled button{opacity:.2}::ng-deep .mat-form-field.mat-form-field-disabled .mat-select-disabled .mat-select-value{color:#000}::ng-deep .mat-form-field.mat-form-field-disabled .mat-date-range-input-inner:disabled{color:#000}::ng-deep .mat-form-field .mat-slide-toggle.mat-disabled{opacity:1}::ng-deep .mat-input-element:disabled{color:#000}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
3209
3014
|
}], ctorParameters: function () { return [{ type: i1.MatDialog }]; }, propDecorators: { entity: [{
|
|
3210
3015
|
type: Input
|
|
3211
3016
|
}], propertyKey: [{
|
|
@@ -3216,6 +3021,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
3216
3021
|
type: Input
|
|
3217
3022
|
}], hideOmitForEdit: [{
|
|
3218
3023
|
type: Input
|
|
3024
|
+
}], isReadOnly: [{
|
|
3025
|
+
type: Input
|
|
3219
3026
|
}], inputChangeEvent: [{
|
|
3220
3027
|
type: Output
|
|
3221
3028
|
}], addArrayItemDialog: [{
|
|
@@ -3230,11 +3037,13 @@ NgxMatEntityInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
|
|
|
3230
3037
|
StringTextboxInputComponent,
|
|
3231
3038
|
StringAutocompleteInputComponent,
|
|
3232
3039
|
StringDropdownInputComponent,
|
|
3040
|
+
StringPasswordInputComponent,
|
|
3233
3041
|
BooleanCheckboxInputComponent,
|
|
3234
3042
|
BooleanToggleInputComponent,
|
|
3235
3043
|
BooleanDropdownInputComponent,
|
|
3236
3044
|
NumberInputComponent,
|
|
3237
3045
|
NumberDropdownInputComponent,
|
|
3046
|
+
NumberSliderInputComponent,
|
|
3238
3047
|
ArrayStringChipsInputComponent,
|
|
3239
3048
|
ArrayStringAutocompleteChipsComponent,
|
|
3240
3049
|
DateInputComponent,
|
|
@@ -3247,6 +3056,7 @@ NgxMatEntityInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
|
|
|
3247
3056
|
FileImageInputComponent,
|
|
3248
3057
|
FileDefaultInputComponent,
|
|
3249
3058
|
DragDropDirective,
|
|
3059
|
+
CustomInputComponent,
|
|
3250
3060
|
NgxMatEntityInputComponent], imports: [CommonModule,
|
|
3251
3061
|
MatInputModule,
|
|
3252
3062
|
FormsModule,
|
|
@@ -3260,7 +3070,9 @@ NgxMatEntityInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
|
|
|
3260
3070
|
MatTableModule,
|
|
3261
3071
|
MatDialogModule,
|
|
3262
3072
|
MatButtonModule,
|
|
3263
|
-
MatDatepickerModule
|
|
3073
|
+
MatDatepickerModule,
|
|
3074
|
+
MatSliderModule,
|
|
3075
|
+
MatTabsModule], exports: [NgxMatEntityInputComponent] });
|
|
3264
3076
|
NgxMatEntityInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityInputModule, imports: [[
|
|
3265
3077
|
CommonModule,
|
|
3266
3078
|
MatInputModule,
|
|
@@ -3275,7 +3087,9 @@ NgxMatEntityInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
3275
3087
|
MatTableModule,
|
|
3276
3088
|
MatDialogModule,
|
|
3277
3089
|
MatButtonModule,
|
|
3278
|
-
MatDatepickerModule
|
|
3090
|
+
MatDatepickerModule,
|
|
3091
|
+
MatSliderModule,
|
|
3092
|
+
MatTabsModule
|
|
3279
3093
|
]] });
|
|
3280
3094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityInputModule, decorators: [{
|
|
3281
3095
|
type: NgModule,
|
|
@@ -3285,11 +3099,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
3285
3099
|
StringTextboxInputComponent,
|
|
3286
3100
|
StringAutocompleteInputComponent,
|
|
3287
3101
|
StringDropdownInputComponent,
|
|
3102
|
+
StringPasswordInputComponent,
|
|
3288
3103
|
BooleanCheckboxInputComponent,
|
|
3289
3104
|
BooleanToggleInputComponent,
|
|
3290
3105
|
BooleanDropdownInputComponent,
|
|
3291
3106
|
NumberInputComponent,
|
|
3292
3107
|
NumberDropdownInputComponent,
|
|
3108
|
+
NumberSliderInputComponent,
|
|
3293
3109
|
ArrayStringChipsInputComponent,
|
|
3294
3110
|
ArrayStringAutocompleteChipsComponent,
|
|
3295
3111
|
DateInputComponent,
|
|
@@ -3302,6 +3118,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
3302
3118
|
FileImageInputComponent,
|
|
3303
3119
|
FileDefaultInputComponent,
|
|
3304
3120
|
DragDropDirective,
|
|
3121
|
+
CustomInputComponent,
|
|
3305
3122
|
NgxMatEntityInputComponent
|
|
3306
3123
|
],
|
|
3307
3124
|
imports: [
|
|
@@ -3318,7 +3135,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
3318
3135
|
MatTableModule,
|
|
3319
3136
|
MatDialogModule,
|
|
3320
3137
|
MatButtonModule,
|
|
3321
|
-
MatDatepickerModule
|
|
3138
|
+
MatDatepickerModule,
|
|
3139
|
+
MatSliderModule,
|
|
3140
|
+
MatTabsModule
|
|
3322
3141
|
],
|
|
3323
3142
|
exports: [NgxMatEntityInputComponent]
|
|
3324
3143
|
}]
|
|
@@ -3366,7 +3185,7 @@ class NgxMatEntityCreateDialogComponent {
|
|
|
3366
3185
|
ngOnInit() {
|
|
3367
3186
|
this.data = new CreateEntityDialogDataBuilder(this.inputData).getResult();
|
|
3368
3187
|
this.dialogRef.disableClose = true;
|
|
3369
|
-
this.
|
|
3188
|
+
this.entityTabs = EntityUtilities.getEntityTabs(this.data.entity, true);
|
|
3370
3189
|
this.entityService = this.injector.get(this.data.EntityServiceClass);
|
|
3371
3190
|
}
|
|
3372
3191
|
/**
|
|
@@ -3411,10 +3230,10 @@ class NgxMatEntityCreateDialogComponent {
|
|
|
3411
3230
|
}
|
|
3412
3231
|
}
|
|
3413
3232
|
NgxMatEntityCreateDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityCreateDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.Injector }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
3414
|
-
NgxMatEntityCreateDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityCreateDialogComponent, selector: "ngx-mat-entity-create-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{data.createDialogData.title}}</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\">\n <div class=\"row\" *ngFor=\"let row of
|
|
3233
|
+
NgxMatEntityCreateDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityCreateDialogComponent, selector: "ngx-mat-entity-create-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{data.createDialogData.title}}</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\">\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsEntityValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsEntityValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </form>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-raised-button (click)=\"create()\" [disabled]=\"!isEntityValid\">\n {{data.createDialogData.createButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.createDialogData.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: ["mat-dialog-actions{justify-content:space-between}\n"], components: [{ type: i13.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i13.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit", "isReadOnly"], outputs: ["inputChangeEvent"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
|
|
3415
3234
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityCreateDialogComponent, decorators: [{
|
|
3416
3235
|
type: Component,
|
|
3417
|
-
args: [{ selector: 'ngx-mat-entity-create-dialog', template: "<h2 mat-dialog-title>{{data.createDialogData.title}}</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\">\n <div class=\"row\" *ngFor=\"let row of
|
|
3236
|
+
args: [{ selector: 'ngx-mat-entity-create-dialog', template: "<h2 mat-dialog-title>{{data.createDialogData.title}}</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\">\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsEntityValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsEntityValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </form>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-raised-button (click)=\"create()\" [disabled]=\"!isEntityValid\">\n {{data.createDialogData.createButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.createDialogData.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: ["mat-dialog-actions{justify-content:space-between}\n"] }]
|
|
3418
3237
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
3419
3238
|
type: Inject,
|
|
3420
3239
|
args: [MAT_DIALOG_DATA]
|
|
@@ -3463,11 +3282,12 @@ class EditDialogDataBuilder extends BaseBuilder {
|
|
|
3463
3282
|
* The internal EditEntityDialogData. Requires all default values the user can leave out.
|
|
3464
3283
|
*/
|
|
3465
3284
|
class EditEntityDialogDataInternal {
|
|
3466
|
-
constructor(entity, EntityServiceClass, editDialogData, allowDelete) {
|
|
3285
|
+
constructor(entity, EntityServiceClass, editDialogData, allowUpdate, allowDelete) {
|
|
3467
3286
|
this.entity = entity;
|
|
3468
3287
|
this.EntityServiceClass = EntityServiceClass;
|
|
3469
3288
|
this.editDialogData = editDialogData;
|
|
3470
3289
|
this.allowDelete = allowDelete;
|
|
3290
|
+
this.allowUpdate = allowUpdate;
|
|
3471
3291
|
}
|
|
3472
3292
|
}
|
|
3473
3293
|
/**
|
|
@@ -3480,7 +3300,7 @@ class EditEntityDialogDataBuilder extends BaseBuilder {
|
|
|
3480
3300
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3481
3301
|
generateBaseData(data) {
|
|
3482
3302
|
const editDialogData = new EditDialogDataBuilder(data.editDialogData).getResult();
|
|
3483
|
-
return new EditEntityDialogDataInternal(data.entity, data.EntityServiceClass, editDialogData, data.allowDelete ?? (() => true));
|
|
3303
|
+
return new EditEntityDialogDataInternal(data.entity, data.EntityServiceClass, editDialogData, data.allowUpdate ?? (() => true), data.allowDelete ?? (() => true));
|
|
3484
3304
|
}
|
|
3485
3305
|
}
|
|
3486
3306
|
|
|
@@ -3502,15 +3322,16 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3502
3322
|
}
|
|
3503
3323
|
ngOnInit() {
|
|
3504
3324
|
this.data = new EditEntityDialogDataBuilder(this.inputData).getResult();
|
|
3325
|
+
this.isReadOnly = !this.data.allowUpdate(this.entityPriorChanges);
|
|
3505
3326
|
this.dialogRef.disableClose = true;
|
|
3506
|
-
this.
|
|
3327
|
+
this.entityTabs = EntityUtilities.getEntityTabs(this.data.entity, false, true);
|
|
3507
3328
|
this.entityService = this.injector.get(this.data.EntityServiceClass);
|
|
3508
3329
|
this.entityPriorChanges = LodashUtilities.cloneDeep(this.data.entity);
|
|
3509
3330
|
}
|
|
3510
3331
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3511
3332
|
checkEntity() {
|
|
3512
3333
|
this.isEntityValid = EntityUtilities.isEntityValid(this.data.entity, 'update');
|
|
3513
|
-
this.isEntityDirty = EntityUtilities.
|
|
3334
|
+
this.isEntityDirty = EntityUtilities.isDirty(this.data.entity, this.entityPriorChanges);
|
|
3514
3335
|
}
|
|
3515
3336
|
/**
|
|
3516
3337
|
* Tries to save the changes and close the dialog afterwards.
|
|
@@ -3578,10 +3399,10 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3578
3399
|
}
|
|
3579
3400
|
}
|
|
3580
3401
|
NgxMatEntityEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityEditDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.Injector }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
3581
|
-
NgxMatEntityEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityEditDialogComponent, selector: "ngx-mat-entity-edit-dialog", ngImport: i0, template: "<h2 mat-dialog-title>\n {{data.editDialogData.title(data.entity)}}\n <button *ngIf=\"data.allowDelete(data.entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editDialogData.deleteButtonLabel}}\n </button>\n</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <div class=\"row\" *ngFor=\"let row of
|
|
3402
|
+
NgxMatEntityEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityEditDialogComponent, selector: "ngx-mat-entity-edit-dialog", ngImport: i0, template: "<h2 mat-dialog-title>\n {{data.editDialogData.title(data.entity)}}\n <button *ngIf=\"data.allowDelete(data.entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editDialogData.deleteButtonLabel}}\n </button>\n</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </form>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-raised-button (click)=\"edit()\" [disabled]=\"isReadOnly || !isEntityValid || (isEntityDirty | async) === false\">\n {{data.editDialogData.confirmButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.editDialogData.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: ["mat-dialog-actions{justify-content:space-between}.delete-button{float:right}\n"], components: [{ type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i13.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i13.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit", "isReadOnly"], outputs: ["inputChangeEvent"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], pipes: { "async": i6.AsyncPipe } });
|
|
3582
3403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityEditDialogComponent, decorators: [{
|
|
3583
3404
|
type: Component,
|
|
3584
|
-
args: [{ selector: 'ngx-mat-entity-edit-dialog', template: "<h2 mat-dialog-title>\n {{data.editDialogData.title(data.entity)}}\n <button *ngIf=\"data.allowDelete(data.entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editDialogData.deleteButtonLabel}}\n </button>\n</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <div class=\"row\" *ngFor=\"let row of
|
|
3405
|
+
args: [{ selector: 'ngx-mat-entity-edit-dialog', template: "<h2 mat-dialog-title>\n {{data.editDialogData.title(data.entity)}}\n <button *ngIf=\"data.allowDelete(data.entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editDialogData.deleteButtonLabel}}\n </button>\n</h2>\n\n<mat-dialog-content>\n <form #form=\"ngForm\" class=\"row\">\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </form>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-raised-button (click)=\"edit()\" [disabled]=\"isReadOnly || !isEntityValid || (isEntityDirty | async) === false\">\n {{data.editDialogData.confirmButtonLabel}}\n </button>\n <button mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.editDialogData.cancelButtonLabel}}\n </button>\n</mat-dialog-actions>\n", styles: ["mat-dialog-actions{justify-content:space-between}.delete-button{float:right}\n"] }]
|
|
3585
3406
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
3586
3407
|
type: Inject,
|
|
3587
3408
|
args: [MAT_DIALOG_DATA]
|
|
@@ -3606,14 +3427,14 @@ class BaseDataBuilder extends BaseBuilder {
|
|
|
3606
3427
|
}
|
|
3607
3428
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3608
3429
|
generateBaseData(data) {
|
|
3609
|
-
return new BaseDataInternal(data.title, data.displayColumns, data.EntityServiceClass, data.searchLabel ?? 'Search', data.createButtonLabel ?? 'Create', data.searchString ?? defaultSearchFunction, data.allowCreate ?? true, data.
|
|
3430
|
+
return new BaseDataInternal(data.title, data.displayColumns, data.EntityServiceClass, data.searchLabel ?? 'Search', data.createButtonLabel ?? 'Create', data.searchString ?? defaultSearchFunction, data.allowCreate ?? (() => true), data.allowRead ?? (() => true), data.allowUpdate ?? (() => true), data.allowDelete ?? (() => true), data.multiSelectActions ?? [], data.multiSelectLabel ?? 'Actions', data.EntityClass, data.edit, data.create);
|
|
3610
3431
|
}
|
|
3611
3432
|
}
|
|
3612
3433
|
/**
|
|
3613
3434
|
* The internal TableData. Requires all default values the user can leave out.
|
|
3614
3435
|
*/
|
|
3615
3436
|
class BaseDataInternal {
|
|
3616
|
-
constructor(title, displayColumns, EntityServiceClass, searchLabel, createButtonLabel, searchString, allowCreate,
|
|
3437
|
+
constructor(title, displayColumns, EntityServiceClass, searchLabel, createButtonLabel, searchString, allowCreate, allowRead, allowUpdate, allowDelete, multiSelectActions, multiSelectLabel, EntityClass, edit, create) {
|
|
3617
3438
|
this.title = title;
|
|
3618
3439
|
this.displayColumns = displayColumns;
|
|
3619
3440
|
this.EntityServiceClass = EntityServiceClass;
|
|
@@ -3622,7 +3443,8 @@ class BaseDataInternal {
|
|
|
3622
3443
|
this.createButtonLabel = createButtonLabel;
|
|
3623
3444
|
this.searchString = searchString;
|
|
3624
3445
|
this.allowCreate = allowCreate;
|
|
3625
|
-
this.
|
|
3446
|
+
this.allowRead = allowRead;
|
|
3447
|
+
this.allowUpdate = allowUpdate;
|
|
3626
3448
|
this.allowDelete = allowDelete;
|
|
3627
3449
|
this.multiSelectActions = multiSelectActions;
|
|
3628
3450
|
this.multiSelectLabel = multiSelectLabel;
|
|
@@ -3650,24 +3472,26 @@ class TableDataBuilder extends BaseBuilder {
|
|
|
3650
3472
|
throw new Error(`The name "select" for a display column is reserved for the multi-select action functionality.
|
|
3651
3473
|
Please choose a different name.`);
|
|
3652
3474
|
}
|
|
3653
|
-
if ((data.baseData.
|
|
3654
|
-
|| data.baseData.
|
|
3655
|
-
|| data.baseData.
|
|
3475
|
+
if ((data.baseData.allowCreate !== (() => false)
|
|
3476
|
+
|| data.baseData.allowRead !== (() => false)
|
|
3477
|
+
|| data.baseData.allowUpdate !== (() => false)
|
|
3478
|
+
|| data.baseData.allowDelete !== (() => false))
|
|
3656
3479
|
&& !data.baseData.EntityClass) {
|
|
3657
3480
|
throw new Error(`
|
|
3658
3481
|
Missing required Input data "EntityClass".
|
|
3659
3482
|
You can only omit this value if you can neither create or update entities.`);
|
|
3660
3483
|
}
|
|
3661
|
-
if (data.baseData.allowCreate !== false && !data.baseData.create && !data.createDialogData) {
|
|
3484
|
+
if (data.baseData.allowCreate !== (() => false) && !data.baseData.create && !data.createDialogData) {
|
|
3662
3485
|
throw new Error(`Missing required Input data "createDialogData".
|
|
3663
3486
|
You can only omit this value when creation is disallowed or done with a custom create method.`);
|
|
3664
3487
|
}
|
|
3665
|
-
if ((data.baseData.
|
|
3488
|
+
if ((data.baseData.allowRead !== (() => false)
|
|
3489
|
+
|| data.baseData.allowUpdate !== (() => false)
|
|
3666
3490
|
|| data.baseData.allowDelete !== (() => false))
|
|
3667
3491
|
&& !data.baseData.edit
|
|
3668
3492
|
&& !data.editDialogData) {
|
|
3669
3493
|
throw new Error(`Missing required Input data "editDialogData".
|
|
3670
|
-
You can only omit this value when editing and deleting is disallowed or done with a custom edit method.`);
|
|
3494
|
+
You can only omit this value when viewing, editing and deleting is disallowed or done with a custom edit method.`);
|
|
3671
3495
|
}
|
|
3672
3496
|
}
|
|
3673
3497
|
}
|
|
@@ -3741,22 +3565,24 @@ class NgxMatEntityTableComponent {
|
|
|
3741
3565
|
* @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
|
|
3742
3566
|
*/
|
|
3743
3567
|
editEntity(entity) {
|
|
3744
|
-
if (this.data.baseData.
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3568
|
+
if (!(this.data.baseData.allowUpdate(entity) || this.data.baseData.allowRead(entity))) {
|
|
3569
|
+
return;
|
|
3570
|
+
}
|
|
3571
|
+
if (!this.data.baseData.EntityClass) {
|
|
3572
|
+
throw new Error('No "EntityClass" specified for this table');
|
|
3573
|
+
}
|
|
3574
|
+
if (this.data.baseData.edit) {
|
|
3575
|
+
this.data.baseData.edit(new this.data.baseData.EntityClass(entity));
|
|
3576
|
+
}
|
|
3577
|
+
else {
|
|
3578
|
+
void this.editDefault(new this.data.baseData.EntityClass(entity));
|
|
3754
3579
|
}
|
|
3755
3580
|
}
|
|
3756
3581
|
async editDefault(entity) {
|
|
3757
3582
|
const inputDialogData = {
|
|
3758
3583
|
entity: entity,
|
|
3759
3584
|
EntityServiceClass: this.data.baseData.EntityServiceClass,
|
|
3585
|
+
allowUpdate: this.data.baseData.allowUpdate,
|
|
3760
3586
|
allowDelete: this.data.baseData.allowDelete,
|
|
3761
3587
|
editDialogData: this.data.editDialogData
|
|
3762
3588
|
};
|
|
@@ -3780,7 +3606,7 @@ class NgxMatEntityTableComponent {
|
|
|
3780
3606
|
* @throws When no EntityClass was provided, as a new call is needed to initialize metadata.
|
|
3781
3607
|
*/
|
|
3782
3608
|
createEntity() {
|
|
3783
|
-
if (this.data.baseData.allowCreate) {
|
|
3609
|
+
if (this.data.baseData.allowCreate()) {
|
|
3784
3610
|
if (!this.data.baseData.EntityClass) {
|
|
3785
3611
|
throw new Error('No "EntityClass" specified for this table');
|
|
3786
3612
|
}
|
|
@@ -3886,10 +3712,10 @@ class NgxMatEntityTableComponent {
|
|
|
3886
3712
|
}
|
|
3887
3713
|
}
|
|
3888
3714
|
NgxMatEntityTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityTableComponent, deps: [{ token: i1.MatDialog }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
3889
|
-
NgxMatEntityTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityTableComponent, selector: "ngx-mat-entity-table", inputs: { tableData: "tableData" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "filter", first: true, predicate: ["filter"], descendants: true, static: true }], ngImport: i0, template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\"
|
|
3715
|
+
NgxMatEntityTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NgxMatEntityTableComponent, selector: "ngx-mat-entity-table", inputs: { tableData: "tableData" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "filter", first: true, predicate: ["filter"], descendants: true, static: true }], ngImport: i0, template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\">\n </mat-form-field>\n <div\n *ngIf=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-2]=\"data.baseData.allowCreate()\"\n [class.col-lg-4]=\"!data.baseData.allowCreate()\"\n [class.col-md-3]=\"data.baseData.allowCreate()\"\n [class.col-md-6]=\"!data.baseData.allowCreate()\"\n [class.col-sm-6]=\"data.baseData.allowCreate()\"\n [class.col-sm-12]=\"!data.baseData.allowCreate()\"\n >\n <button class=\"actions-button\" [matMenuTriggerFor]=\"menu\" mat-raised-button>\n {{data.baseData.multiSelectLabel}}\n </button>\n </div>\n <mat-menu #menu=\"matMenu\">\n <button *ngFor=\"let action of data.baseData.multiSelectActions\" [disabled]=\"multiActionDisabled(action)\" (click)=\"runMultiAction(action)\" mat-menu-item>\n {{action.displayName}}\n </button>\n </mat-menu>\n\n <div\n *ngIf=\"data.baseData.allowCreate()\"\n [class.col-lg-2]=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-4]=\"!data.baseData.multiSelectActions.length\"\n [class.col-md-3]=\"data.baseData.multiSelectActions.length\"\n [class.col-md-6]=\"!data.baseData.multiSelectActions.length\"\n [class.col-sm-6]=\"data.baseData.multiSelectActions.length\"\n [class.col-sm-12]=\"!data.baseData.multiSelectActions.length\"\n >\n <button class=\"create-button\" (click)=\"createEntity()\" mat-raised-button>\n {{data.baseData.createButtonLabel}}\n </button>\n </div>\n</div>\n\n<div class=\"mat-elevation-z8\">\n <mat-table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" matSort>\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\" class=\"module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"> </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngFor=\"let dCol of data.baseData.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" [class.enabled]=\"data.baseData.allowUpdate(entity) || data.baseData.allowRead(entity)\" (click)=\"editEntity(entity)\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <mat-paginator *ngIf=\"dataSource\" id=\"paginator\" [length]=\"dataSource.filteredData.length\" [pageIndex]=\"0\" [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\"> </mat-paginator>\n</div>\n", styles: [".title{text-align:center}button{width:100%}.mat-column-select{flex:0 0 75px}.enabled:hover{cursor:pointer}@media (max-width: 767px){.actions-button,.create-button{margin-bottom:15px}}\n"], components: [{ type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i4$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i7.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], directives: [{ type: i1$1.MatLabel, selector: "mat-label" }, { type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i4$1.MatCellDef, selector: "[matCellDef]" }, { type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
|
|
3890
3716
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityTableComponent, decorators: [{
|
|
3891
3717
|
type: Component,
|
|
3892
|
-
args: [{ selector: 'ngx-mat-entity-table', template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\"
|
|
3718
|
+
args: [{ selector: 'ngx-mat-entity-table', template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\">\n </mat-form-field>\n <div\n *ngIf=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-2]=\"data.baseData.allowCreate()\"\n [class.col-lg-4]=\"!data.baseData.allowCreate()\"\n [class.col-md-3]=\"data.baseData.allowCreate()\"\n [class.col-md-6]=\"!data.baseData.allowCreate()\"\n [class.col-sm-6]=\"data.baseData.allowCreate()\"\n [class.col-sm-12]=\"!data.baseData.allowCreate()\"\n >\n <button class=\"actions-button\" [matMenuTriggerFor]=\"menu\" mat-raised-button>\n {{data.baseData.multiSelectLabel}}\n </button>\n </div>\n <mat-menu #menu=\"matMenu\">\n <button *ngFor=\"let action of data.baseData.multiSelectActions\" [disabled]=\"multiActionDisabled(action)\" (click)=\"runMultiAction(action)\" mat-menu-item>\n {{action.displayName}}\n </button>\n </mat-menu>\n\n <div\n *ngIf=\"data.baseData.allowCreate()\"\n [class.col-lg-2]=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-4]=\"!data.baseData.multiSelectActions.length\"\n [class.col-md-3]=\"data.baseData.multiSelectActions.length\"\n [class.col-md-6]=\"!data.baseData.multiSelectActions.length\"\n [class.col-sm-6]=\"data.baseData.multiSelectActions.length\"\n [class.col-sm-12]=\"!data.baseData.multiSelectActions.length\"\n >\n <button class=\"create-button\" (click)=\"createEntity()\" mat-raised-button>\n {{data.baseData.createButtonLabel}}\n </button>\n </div>\n</div>\n\n<div class=\"mat-elevation-z8\">\n <mat-table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" matSort>\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\" [indeterminate]=\"selection.hasValue() && !isAllSelected()\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\" class=\"module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"> </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngFor=\"let dCol of data.baseData.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" [class.enabled]=\"data.baseData.allowUpdate(entity) || data.baseData.allowRead(entity)\" (click)=\"editEntity(entity)\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <mat-paginator *ngIf=\"dataSource\" id=\"paginator\" [length]=\"dataSource.filteredData.length\" [pageIndex]=\"0\" [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\"> </mat-paginator>\n</div>\n", styles: [".title{text-align:center}button{width:100%}.mat-column-select{flex:0 0 75px}.enabled:hover{cursor:pointer}@media (max-width: 767px){.actions-button,.create-button{margin-bottom:15px}}\n"] }]
|
|
3893
3719
|
}], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i0.Injector }]; }, propDecorators: { tableData: [{
|
|
3894
3720
|
type: Input
|
|
3895
3721
|
}], paginator: [{
|
|
@@ -3910,13 +3736,15 @@ NgxMatEntityCreateDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "1
|
|
|
3910
3736
|
NgxMatEntityInputModule,
|
|
3911
3737
|
MatDialogModule,
|
|
3912
3738
|
FormsModule,
|
|
3913
|
-
MatButtonModule
|
|
3739
|
+
MatButtonModule,
|
|
3740
|
+
MatTabsModule], exports: [NgxMatEntityCreateDialogComponent] });
|
|
3914
3741
|
NgxMatEntityCreateDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityCreateDialogModule, imports: [[
|
|
3915
3742
|
CommonModule,
|
|
3916
3743
|
NgxMatEntityInputModule,
|
|
3917
3744
|
MatDialogModule,
|
|
3918
3745
|
FormsModule,
|
|
3919
|
-
MatButtonModule
|
|
3746
|
+
MatButtonModule,
|
|
3747
|
+
MatTabsModule
|
|
3920
3748
|
]] });
|
|
3921
3749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityCreateDialogModule, decorators: [{
|
|
3922
3750
|
type: NgModule,
|
|
@@ -3927,7 +3755,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
3927
3755
|
NgxMatEntityInputModule,
|
|
3928
3756
|
MatDialogModule,
|
|
3929
3757
|
FormsModule,
|
|
3930
|
-
MatButtonModule
|
|
3758
|
+
MatButtonModule,
|
|
3759
|
+
MatTabsModule
|
|
3931
3760
|
],
|
|
3932
3761
|
exports: [NgxMatEntityCreateDialogComponent]
|
|
3933
3762
|
}]
|
|
@@ -3941,6 +3770,7 @@ NgxMatEntityEditDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.
|
|
|
3941
3770
|
MatDialogModule,
|
|
3942
3771
|
FormsModule,
|
|
3943
3772
|
MatButtonModule,
|
|
3773
|
+
MatTabsModule,
|
|
3944
3774
|
NgxMatEntityConfirmDialogModule], exports: [NgxMatEntityEditDialogComponent] });
|
|
3945
3775
|
NgxMatEntityEditDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityEditDialogModule, imports: [[
|
|
3946
3776
|
CommonModule,
|
|
@@ -3948,6 +3778,7 @@ NgxMatEntityEditDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.
|
|
|
3948
3778
|
MatDialogModule,
|
|
3949
3779
|
FormsModule,
|
|
3950
3780
|
MatButtonModule,
|
|
3781
|
+
MatTabsModule,
|
|
3951
3782
|
NgxMatEntityConfirmDialogModule
|
|
3952
3783
|
]] });
|
|
3953
3784
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxMatEntityEditDialogModule, decorators: [{
|
|
@@ -3960,6 +3791,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
3960
3791
|
MatDialogModule,
|
|
3961
3792
|
FormsModule,
|
|
3962
3793
|
MatButtonModule,
|
|
3794
|
+
MatTabsModule,
|
|
3963
3795
|
NgxMatEntityConfirmDialogModule
|
|
3964
3796
|
],
|
|
3965
3797
|
exports: [NgxMatEntityEditDialogComponent]
|
|
@@ -4017,6 +3849,143 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
4017
3849
|
}]
|
|
4018
3850
|
}] });
|
|
4019
3851
|
|
|
3852
|
+
/**
|
|
3853
|
+
* The internal EntityArrayDecoratorConfig. Sets default values.
|
|
3854
|
+
*/
|
|
3855
|
+
class EntityArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
3856
|
+
constructor(data) {
|
|
3857
|
+
super(data);
|
|
3858
|
+
this.createInline = data.createInline ?? true;
|
|
3859
|
+
this.itemType = data.itemType;
|
|
3860
|
+
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
3861
|
+
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
3862
|
+
this.EntityClass = data.EntityClass;
|
|
3863
|
+
this.displayColumns = data.displayColumns;
|
|
3864
|
+
this.createInline = data.createInline ?? true;
|
|
3865
|
+
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
3866
|
+
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
3867
|
+
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
3868
|
+
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3871
|
+
/**
|
|
3872
|
+
* The internal DateArrayDecoratorConfig. Sets default values.
|
|
3873
|
+
*/
|
|
3874
|
+
class DateArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
3875
|
+
constructor(data) {
|
|
3876
|
+
super(data);
|
|
3877
|
+
this.itemType = data.itemType;
|
|
3878
|
+
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
3879
|
+
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
3880
|
+
this.displayColumns = data.displayColumns;
|
|
3881
|
+
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
3882
|
+
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
3883
|
+
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
3884
|
+
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
3885
|
+
this.min = data.min;
|
|
3886
|
+
this.max = data.max;
|
|
3887
|
+
this.filter = data.filter;
|
|
3888
|
+
}
|
|
3889
|
+
}
|
|
3890
|
+
/**
|
|
3891
|
+
* The internal DateTimeArrayDecoratorConfig. Sets default values.
|
|
3892
|
+
*/
|
|
3893
|
+
class DateTimeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
3894
|
+
constructor(data) {
|
|
3895
|
+
super(data);
|
|
3896
|
+
this.itemType = data.itemType;
|
|
3897
|
+
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
3898
|
+
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
3899
|
+
this.displayColumns = data.displayColumns;
|
|
3900
|
+
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
3901
|
+
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
3902
|
+
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
3903
|
+
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
3904
|
+
this.times = data.times ?? DateUtilities.getDefaultTimes();
|
|
3905
|
+
this.timeDisplayName = data.timeDisplayName ?? 'Time';
|
|
3906
|
+
this.minDate = data.minDate;
|
|
3907
|
+
this.maxDate = data.maxDate;
|
|
3908
|
+
this.filterDate = data.filterDate;
|
|
3909
|
+
this.minTime = data.minTime;
|
|
3910
|
+
this.maxTime = data.maxTime;
|
|
3911
|
+
this.filterTime = data.filterTime;
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
/**
|
|
3915
|
+
* The internal DateRangeArrayDecoratorConfig. Sets default values.
|
|
3916
|
+
*/
|
|
3917
|
+
class DateRangeArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
3918
|
+
constructor(data) {
|
|
3919
|
+
super(data);
|
|
3920
|
+
this.itemType = data.itemType;
|
|
3921
|
+
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
3922
|
+
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
3923
|
+
this.displayColumns = data.displayColumns;
|
|
3924
|
+
this.defaultWidths = data.defaultWidths ?? [12, 12, 12];
|
|
3925
|
+
this.addButtonLabel = data.addButtonLabel ?? 'Add';
|
|
3926
|
+
this.removeButtonLabel = data.removeButtonLabel ?? 'Remove';
|
|
3927
|
+
this.missingErrorMessage = data.missingErrorMessage ?? 'Needs to contain at least one value';
|
|
3928
|
+
this.placeholderStart = data.placeholderStart ?? 'Start';
|
|
3929
|
+
this.placeholderEnd = data.placeholderEnd ?? 'End';
|
|
3930
|
+
this.minStart = data.minStart;
|
|
3931
|
+
this.maxStart = data.maxStart;
|
|
3932
|
+
this.minEnd = data.minEnd;
|
|
3933
|
+
this.maxEnd = data.maxEnd;
|
|
3934
|
+
this.filter = data.filter;
|
|
3935
|
+
}
|
|
3936
|
+
}
|
|
3937
|
+
/**
|
|
3938
|
+
* The internal StringChipsArrayDecoratorConfig. Sets default values.
|
|
3939
|
+
*/
|
|
3940
|
+
class StringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
3941
|
+
constructor(data) {
|
|
3942
|
+
super(data);
|
|
3943
|
+
this.deleteIcon = data.deleteIcon ?? 'fas fa-circle-minus';
|
|
3944
|
+
this.itemType = data.itemType;
|
|
3945
|
+
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
3946
|
+
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
3947
|
+
this.maxLength = data.maxLength;
|
|
3948
|
+
this.minLength = data.minLength;
|
|
3949
|
+
this.regex = data.regex;
|
|
3950
|
+
this.defaultWidths = data.defaultWidths ?? [6, 12, 12];
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
/**
|
|
3954
|
+
* The internal AutocompleteStringChipsArrayDecoratorConfig. Sets default values.
|
|
3955
|
+
*/
|
|
3956
|
+
class AutocompleteStringChipsArrayDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
3957
|
+
constructor(data) {
|
|
3958
|
+
super(data);
|
|
3959
|
+
this.autocompleteValues = data.autocompleteValues;
|
|
3960
|
+
this.deleteIcon = data.deleteIcon ?? 'fas fa-circle-minus';
|
|
3961
|
+
this.itemType = data.itemType;
|
|
3962
|
+
this.allowDuplicates = data.allowDuplicates ?? false;
|
|
3963
|
+
this.duplicatesErrorDialog = getDefaultDuplicateErrorDialogData(data);
|
|
3964
|
+
this.maxLength = data.maxLength;
|
|
3965
|
+
this.minLength = data.minLength;
|
|
3966
|
+
this.regex = data.regex;
|
|
3967
|
+
this.defaultWidths = data.defaultWidths ?? [6, 12, 12];
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
/**
|
|
3971
|
+
* Gets the default dialog data for the error dialog to display when the user tries to add a duplicate value.
|
|
3972
|
+
*
|
|
3973
|
+
* @param data - The Array Decorator data.
|
|
3974
|
+
* @returns The dialog data with set default values.
|
|
3975
|
+
*/
|
|
3976
|
+
function getDefaultDuplicateErrorDialogData(data) {
|
|
3977
|
+
return {
|
|
3978
|
+
type: data.duplicatesErrorDialog?.type ?? 'info-only',
|
|
3979
|
+
// eslint-disable-next-line max-len
|
|
3980
|
+
text: data.duplicatesErrorDialog?.text ?? ['Adding duplicate entries to the array is not allowed.'],
|
|
3981
|
+
title: data.duplicatesErrorDialog?.title ?? 'Error adding duplicate item',
|
|
3982
|
+
confirmButtonLabel: data.duplicatesErrorDialog?.confirmButtonLabel,
|
|
3983
|
+
cancelButtonLabel: data.duplicatesErrorDialog?.cancelButtonLabel,
|
|
3984
|
+
requireConfirmation: data.duplicatesErrorDialog?.requireConfirmation,
|
|
3985
|
+
confirmationText: data.duplicatesErrorDialog?.confirmationText
|
|
3986
|
+
};
|
|
3987
|
+
}
|
|
3988
|
+
|
|
4020
3989
|
/**
|
|
4021
3990
|
* Decorator for setting and getting array property metadata.
|
|
4022
3991
|
*
|
|
@@ -4203,6 +4172,29 @@ class DropdownNumberDecoratorConfigInternal extends PropertyDecoratorConfigInter
|
|
|
4203
4172
|
this.dropdownValues = data.dropdownValues;
|
|
4204
4173
|
}
|
|
4205
4174
|
}
|
|
4175
|
+
/**
|
|
4176
|
+
* The internal SliderNumberDecoratorConfig. Sets default values.
|
|
4177
|
+
*/
|
|
4178
|
+
class SliderNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4179
|
+
constructor(data) {
|
|
4180
|
+
super(data);
|
|
4181
|
+
this.displayStyle = data.displayStyle;
|
|
4182
|
+
this.max = data.max;
|
|
4183
|
+
this.min = data.min;
|
|
4184
|
+
this.step = data.step;
|
|
4185
|
+
this.formatThumbLabelValue = data.formatThumbLabelValue ?? defaultFormatThumbLabelValue;
|
|
4186
|
+
this.tickInterval = data.tickInterval;
|
|
4187
|
+
}
|
|
4188
|
+
}
|
|
4189
|
+
/**
|
|
4190
|
+
* The default function to format values for the number slider thumb label.
|
|
4191
|
+
*
|
|
4192
|
+
* @param value - The value of the slider.
|
|
4193
|
+
* @returns Just the value without any formatting done.
|
|
4194
|
+
*/
|
|
4195
|
+
function defaultFormatThumbLabelValue(value) {
|
|
4196
|
+
return value;
|
|
4197
|
+
}
|
|
4206
4198
|
|
|
4207
4199
|
/**
|
|
4208
4200
|
* Decorator for setting and getting number property metadata.
|
|
@@ -4211,11 +4203,13 @@ class DropdownNumberDecoratorConfigInternal extends PropertyDecoratorConfigInter
|
|
|
4211
4203
|
* @returns The method that defines the metadata.
|
|
4212
4204
|
*/
|
|
4213
4205
|
function number(metadata) {
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4206
|
+
switch (metadata.displayStyle) {
|
|
4207
|
+
case 'dropdown':
|
|
4208
|
+
return baseProperty(new DropdownNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER_DROPDOWN);
|
|
4209
|
+
case 'slider':
|
|
4210
|
+
return baseProperty(new SliderNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER_SLIDER);
|
|
4211
|
+
default:
|
|
4212
|
+
return baseProperty(new DefaultNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER);
|
|
4219
4213
|
}
|
|
4220
4214
|
}
|
|
4221
4215
|
|
|
@@ -4380,6 +4374,40 @@ function file(metadata) {
|
|
|
4380
4374
|
class FileDecoratorConfig extends PropertyDecoratorConfig {
|
|
4381
4375
|
}
|
|
4382
4376
|
|
|
4377
|
+
/**
|
|
4378
|
+
* The default function to use for checking if the value is dirty.
|
|
4379
|
+
*
|
|
4380
|
+
* @param value - The current value.
|
|
4381
|
+
* @param valuePriorChanges - The value before any changes.
|
|
4382
|
+
* @returns Whether or not the provided value has been changed.
|
|
4383
|
+
*/
|
|
4384
|
+
function defaultIsEqual(value, valuePriorChanges) {
|
|
4385
|
+
return LodashUtilities.isEqual(value, valuePriorChanges);
|
|
4386
|
+
}
|
|
4387
|
+
/**
|
|
4388
|
+
* The internal config for the @custom decorator.
|
|
4389
|
+
* Sets default values.
|
|
4390
|
+
*/
|
|
4391
|
+
class CustomDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4392
|
+
constructor(data) {
|
|
4393
|
+
super(data);
|
|
4394
|
+
this.component = data.component;
|
|
4395
|
+
this.isValid = data.isValid ?? (() => true);
|
|
4396
|
+
this.isEqual = data.isEqual ?? defaultIsEqual;
|
|
4397
|
+
this.customMetadata = data.customMetadata;
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4401
|
+
/**
|
|
4402
|
+
* Decorator for setting and getting custom property metadata.
|
|
4403
|
+
*
|
|
4404
|
+
* @param metadata - The metadata of the custom property.
|
|
4405
|
+
* @returns The method that defines the metadata.
|
|
4406
|
+
*/
|
|
4407
|
+
function custom(metadata) {
|
|
4408
|
+
return baseProperty(new CustomDecoratorConfigInternal(metadata), DecoratorTypes.CUSTOM);
|
|
4409
|
+
}
|
|
4410
|
+
|
|
4383
4411
|
/**
|
|
4384
4412
|
* Public API Surface of ngx-material-entity.
|
|
4385
4413
|
*/
|
|
@@ -4388,5 +4416,5 @@ class FileDecoratorConfig extends PropertyDecoratorConfig {
|
|
|
4388
4416
|
* Generated bundle index. Do not edit.
|
|
4389
4417
|
*/
|
|
4390
4418
|
|
|
4391
|
-
export { ArrayDecoratorConfig, DateUtilities, DecoratorTypes, Entity, EntityService, EntityUtilities, FileUtilities, NgxMatEntityConfirmDialogComponent, NgxMatEntityConfirmDialogModule, NgxMatEntityCreateDialogComponent, NgxMatEntityCreateDialogModule, NgxMatEntityEditDialogComponent, NgxMatEntityEditDialogModule, NgxMatEntityInputComponent, NgxMatEntityInputModule, NgxMatEntityTableComponent, NgxMatEntityTableModule, array, boolean, date, file, getValidationErrorMessage, number, object, string };
|
|
4419
|
+
export { ArrayDecoratorConfig, DateUtilities, DecoratorTypes, Entity, EntityService, EntityUtilities, FileUtilities, NgxMatEntityBaseInputComponent, NgxMatEntityConfirmDialogComponent, NgxMatEntityConfirmDialogModule, NgxMatEntityCreateDialogComponent, NgxMatEntityCreateDialogModule, NgxMatEntityEditDialogComponent, NgxMatEntityEditDialogModule, NgxMatEntityInputComponent, NgxMatEntityInputModule, NgxMatEntityTableComponent, NgxMatEntityTableModule, array, boolean, custom, date, file, getValidationErrorMessage, number, object, string };
|
|
4392
4420
|
//# sourceMappingURL=ngx-material-entity.mjs.map
|