@meshmakers/shared-ui 0.0.0-0 → 0.0.2304-23001

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.
Files changed (34) hide show
  1. package/README.md +4 -7
  2. package/esm2020/lib/confirmation-dialog/confirmation-dialog.module.mjs +4 -4
  3. package/esm2020/lib/confirmation-dialog/confirmation-window/confirmation-window.component.mjs +8 -4
  4. package/esm2020/lib/confirmation-dialog/services/confirmation.service.mjs +7 -7
  5. package/esm2020/lib/ia-shared-ui/ia-autocomplete-input/ia-autocomplete-input.mjs +33 -20
  6. package/esm2020/lib/ia-shared-ui/ia-entity-select-input/ia-entity-select-input.component.mjs +30 -18
  7. package/esm2020/lib/ia-shared-ui/ia-multiple-entity-select-input/ia-multiple-entity-select-input.component.mjs +300 -0
  8. package/esm2020/lib/ia-shared-ui/ia-notification-bar/ia-notification-bar.component.mjs +5 -4
  9. package/esm2020/lib/ia-shared-ui/ia-shared-ui.module.mjs +31 -9
  10. package/esm2020/lib/ia-shared-ui/message-details/message-details.component.mjs +3 -3
  11. package/esm2020/lib/progress-notifier/progress-notifier.module.mjs +4 -4
  12. package/esm2020/lib/progress-notifier/progress-window/progress-window.component.mjs +5 -4
  13. package/esm2020/lib/progress-notifier/services/progress-notifier.service.mjs +7 -6
  14. package/esm2020/lib/progress-notifier/shared/progressValue.mjs +5 -1
  15. package/esm2020/lib/shared/abstractDetailsComponent.mjs +8 -7
  16. package/esm2020/lib/shared/commonValidators.mjs +4 -3
  17. package/esm2020/public-api.mjs +2 -1
  18. package/fesm2015/meshmakers-shared-ui.mjs +438 -84
  19. package/fesm2015/meshmakers-shared-ui.mjs.map +1 -1
  20. package/fesm2020/meshmakers-shared-ui.mjs +424 -83
  21. package/fesm2020/meshmakers-shared-ui.mjs.map +1 -1
  22. package/lib/confirmation-dialog/confirmation-window/confirmation-window.component.d.ts +5 -5
  23. package/lib/confirmation-dialog/services/confirmation.service.d.ts +1 -1
  24. package/lib/ia-shared-ui/ia-autocomplete-input/ia-autocomplete-input.d.ts +4 -4
  25. package/lib/ia-shared-ui/ia-entity-select-input/ia-entity-select-input.component.d.ts +5 -5
  26. package/lib/ia-shared-ui/ia-multiple-entity-select-input/ia-multiple-entity-select-input.component.d.ts +73 -0
  27. package/lib/ia-shared-ui/ia-notification-bar/ia-notification-bar.component.d.ts +2 -2
  28. package/lib/ia-shared-ui/ia-shared-ui.module.d.ts +13 -10
  29. package/lib/ia-shared-ui/message-details/message-details.component.d.ts +1 -1
  30. package/lib/progress-notifier/progress-window/progress-window.component.d.ts +2 -2
  31. package/lib/progress-notifier/shared/progressValue.d.ts +2 -1
  32. package/lib/shared/abstractDetailsComponent.d.ts +5 -5
  33. package/package.json +8 -4
  34. package/public-api.d.ts +1 -0
@@ -16,7 +16,7 @@ import * as i7 from '@angular/forms';
16
16
  import { FormControl, NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS, ReactiveFormsModule, Validators } from '@angular/forms';
17
17
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
18
18
  import { debounceTime, filter, tap, map, switchMap } from 'rxjs/operators';
19
- import { Subject, BehaviorSubject } from 'rxjs';
19
+ import { Subject, of, BehaviorSubject } from 'rxjs';
20
20
  import * as i1$2 from '@angular/cdk/a11y';
21
21
  import * as i3$1 from '@angular/material/autocomplete';
22
22
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
@@ -25,6 +25,11 @@ import * as i5 from '@angular/material/input';
25
25
  import { MatInputModule } from '@angular/material/input';
26
26
  import * as i6 from '@angular/material/progress-spinner';
27
27
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
28
+ import { ENTER, COMMA } from '@angular/cdk/keycodes';
29
+ import * as i7$1 from '@angular/material/chips';
30
+ import { MatChipsModule } from '@angular/material/chips';
31
+ import * as i8 from '@angular/material/icon';
32
+ import { MatIconModule } from '@angular/material/icon';
28
33
  import * as i3$2 from '@angular/flex-layout/flex';
29
34
  import * as i5$1 from '@angular/material/progress-bar';
30
35
  import { MatProgressBarModule } from '@angular/material/progress-bar';
@@ -39,9 +44,9 @@ class MessageDetailsComponent {
39
44
  ngOnInit() {
40
45
  }
41
46
  }
42
- MessageDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MessageDetailsComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
43
- MessageDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: MessageDetailsComponent, selector: "app-message-details", ngImport: i0, template: "<mat-dialog-content>\n\n <h2>{{errorMessage.title}}</h2>\n <p>{{errorMessage.message}}</p>\n\n\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button color=\"primary\" mat-dialog-close mat-raised-button>OK</button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "component", 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"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MessageDetailsComponent, decorators: [{
47
+ MessageDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MessageDetailsComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
48
+ MessageDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: MessageDetailsComponent, selector: "app-message-details", ngImport: i0, template: "<mat-dialog-content>\n\n <h2>{{errorMessage.title}}</h2>\n <p>{{errorMessage.message}}</p>\n\n\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button color=\"primary\" mat-dialog-close mat-raised-button>OK</button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MessageDetailsComponent, decorators: [{
45
50
  type: Component,
46
51
  args: [{ selector: 'app-message-details', template: "<mat-dialog-content>\n\n <h2>{{errorMessage.title}}</h2>\n <p>{{errorMessage.message}}</p>\n\n\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button color=\"primary\" mat-dialog-close mat-raised-button>OK</button>\n</mat-dialog-actions>\n" }]
47
52
  }], ctorParameters: function () { return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
@@ -53,6 +58,7 @@ class IaNotificationBarComponent {
53
58
  constructor(messageService, dialog) {
54
59
  this.messageService = messageService;
55
60
  this.dialog = dialog;
61
+ this.errorMessage = null;
56
62
  }
57
63
  ngOnInit() {
58
64
  this.messageService.getLatestErrorMessage().subscribe(value => {
@@ -70,9 +76,9 @@ class IaNotificationBarComponent {
70
76
  });
71
77
  }
72
78
  }
73
- IaNotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaNotificationBarComponent, deps: [{ token: i1$1.MessageService }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
74
- IaNotificationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: IaNotificationBarComponent, selector: "ia-notification-bar", ngImport: i0, template: "<mat-toolbar [hidden]=\"!errorMessage\" color=\"warn\">\n <a (click)=\"onShowDetails()\"><span class=\"mat-small\"><u>{{ errorMessage?.title }}</u></span></a>\n\n <!-- This fills the remaining space of the current row -->\n <span class=\"notification-fill-remaining-space\"></span>\n\n <button (click)=\"onHide()\" color=\"warn\" mat-raised-button><i class=\"pi pi-angle-double-up\"></i></button>\n</mat-toolbar>\n", styles: [".notification-fill-remaining-space{flex:1 1 auto}\n"], dependencies: [{ kind: "component", type: i3.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", 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"] }] });
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaNotificationBarComponent, decorators: [{
79
+ IaNotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaNotificationBarComponent, deps: [{ token: i1$1.MessageService }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
80
+ IaNotificationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: IaNotificationBarComponent, selector: "ia-notification-bar", ngImport: i0, template: "<mat-toolbar [hidden]=\"!errorMessage\" color=\"warn\">\n <a (click)=\"onShowDetails()\"><span class=\"mat-small\"><u>{{ errorMessage?.title }}</u></span></a>\n\n <!-- This fills the remaining space of the current row -->\n <span class=\"notification-fill-remaining-space\"></span>\n\n <button (click)=\"onHide()\" color=\"warn\" mat-raised-button><i class=\"pi pi-angle-double-up\"></i></button>\n</mat-toolbar>\n", styles: [".notification-fill-remaining-space{flex:1 1 auto}\n"], dependencies: [{ kind: "component", type: i3.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaNotificationBarComponent, decorators: [{
76
82
  type: Component,
77
83
  args: [{ selector: 'ia-notification-bar', template: "<mat-toolbar [hidden]=\"!errorMessage\" color=\"warn\">\n <a (click)=\"onShowDetails()\"><span class=\"mat-small\"><u>{{ errorMessage?.title }}</u></span></a>\n\n <!-- This fills the remaining space of the current row -->\n <span class=\"notification-fill-remaining-space\"></span>\n\n <button (click)=\"onHide()\" color=\"warn\" mat-raised-button><i class=\"pi pi-angle-double-up\"></i></button>\n</mat-toolbar>\n", styles: [".notification-fill-remaining-space{flex:1 1 auto}\n"] }]
78
84
  }], ctorParameters: function () { return [{ type: i1$1.MessageService }, { type: i1.MatDialog }]; } });
@@ -93,6 +99,13 @@ class IaAutocompleteInput {
93
99
  };
94
100
  this._onTouched = () => {
95
101
  };
102
+ this.ngControl = null;
103
+ this.errorState = false;
104
+ this._selectedString = null;
105
+ this.inputField = null;
106
+ this._dataSource = null;
107
+ this._placeholder = "";
108
+ this._prefix = "";
96
109
  this.searchFormControl = new FormControl();
97
110
  this.isLoading = false;
98
111
  this._disabled = false;
@@ -128,7 +141,9 @@ class IaAutocompleteInput {
128
141
  }
129
142
  set required(req) {
130
143
  this._required = coerceBooleanProperty(req);
131
- this.inputField.required = this._required;
144
+ if (this.inputField) {
145
+ this.inputField.required = this._required;
146
+ }
132
147
  this.stateChanges.next();
133
148
  }
134
149
  get prefix() {
@@ -153,7 +168,7 @@ class IaAutocompleteInput {
153
168
  }
154
169
  get empty() {
155
170
  let n = this.searchFormControl.value;
156
- return !!!n;
171
+ return !n;
157
172
  }
158
173
  get shouldLabelFloat() {
159
174
  return this.focused || !this.empty;
@@ -168,14 +183,16 @@ class IaAutocompleteInput {
168
183
  if (this._prefix) {
169
184
  this.searchFormControl
170
185
  .valueChanges
171
- .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.value = null), tap(() => this.isLoading = true), map(value => this._dataSource.onPreprocessSearchString(value)), switchMap(value => this._dataSource.onFilter(value)))
186
+ .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.value = null), tap(() => this.isLoading = true), map(value => this._dataSource?.onPreprocessSearchString(value) ?? ""), switchMap(value => this._dataSource?.onFilter(value) ?? of(null)))
172
187
  .subscribe(resultSet => {
173
- if (resultSet.list.length === 1) {
174
- this.value = resultSet[0];
175
- }
176
- else {
177
- this.filteredStrings = resultSet.list;
178
- this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
188
+ if (resultSet && resultSet.list) {
189
+ if (resultSet.list.length === 1) {
190
+ this.value = resultSet.list[0];
191
+ }
192
+ else {
193
+ this.filteredStrings = resultSet.list;
194
+ this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
195
+ }
179
196
  }
180
197
  this.isLoading = false;
181
198
  });
@@ -183,12 +200,14 @@ class IaAutocompleteInput {
183
200
  // This is the search functionality when search by human.
184
201
  this.searchFormControl
185
202
  .valueChanges
186
- .pipe(debounceTime(300), tap(value => {
203
+ .pipe(debounceTime(300), tap(_ => {
187
204
  this.filteredStrings = [];
188
- }), filter(value => value != null && value.toString().length >= 1), tap(() => this.isLoading = true), map(value => this._dataSource.onPreprocessSearchString(value)), tap(value => this.value = value), switchMap(value => this._dataSource.onFilter(value)))
205
+ }), filter(value => value != null && value.toString().length >= 1), tap(() => this.isLoading = true), map(value => this._dataSource?.onPreprocessSearchString(value)), tap(value => this.value = value), switchMap(value => this._dataSource?.onFilter(value) ?? of(null)))
189
206
  .subscribe(resultSet => {
190
- this.filteredStrings = resultSet.list;
191
- this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
207
+ if (resultSet && resultSet.list) {
208
+ this.filteredStrings = resultSet.list;
209
+ this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
210
+ }
192
211
  this.isLoading = false;
193
212
  });
194
213
  }
@@ -198,7 +217,7 @@ class IaAutocompleteInput {
198
217
  }
199
218
  ngDoCheck() {
200
219
  if (this.ngControl) {
201
- this.errorState = this.ngControl.invalid && this.ngControl.touched;
220
+ this.errorState = (this.ngControl.invalid && this.ngControl.touched) ?? false;
202
221
  this.stateChanges.next();
203
222
  }
204
223
  }
@@ -265,8 +284,8 @@ class IaAutocompleteInput {
265
284
  }
266
285
  }
267
286
  IaAutocompleteInput.nextId = 0;
268
- IaAutocompleteInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaAutocompleteInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
269
- IaAutocompleteInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: IaAutocompleteInput, selector: "ia-autocomplete", inputs: { dataSource: "dataSource", disabled: "disabled", placeholder: "placeholder", required: "required", prefix: "prefix" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [
287
+ IaAutocompleteInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaAutocompleteInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
288
+ IaAutocompleteInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: IaAutocompleteInput, selector: "ia-autocomplete", inputs: { dataSource: "dataSource", disabled: "disabled", placeholder: "placeholder", required: "required", prefix: "prefix" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [
270
289
  {
271
290
  provide: NG_VALUE_ACCESSOR,
272
291
  useExisting: forwardRef(() => IaAutocompleteInput),
@@ -281,8 +300,8 @@ IaAutocompleteInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
281
300
  useExisting: forwardRef(() => IaAutocompleteInput),
282
301
  multi: true
283
302
  }
284
- ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\" matInput>\n<mat-autocomplete #auto=\"matAutocomplete\"\n (closed)=\"onAutoCompleteClosed()\" (optionActivated)=\"onOptionActivated($event)\"\n (optionSelected)=\"onOptionSelected($event)\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let str of filteredStrings\" [value]=\"str\">\n {{str}}\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i5.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"] }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaAutocompleteInput, decorators: [{
303
+ ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\" matInput>\n<mat-autocomplete #auto=\"matAutocomplete\"\n (closed)=\"onAutoCompleteClosed()\" (optionActivated)=\"onOptionActivated($event)\"\n (optionSelected)=\"onOptionSelected($event)\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let str of filteredStrings\" [value]=\"str\">\n {{str}}\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: i5.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"] }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaAutocompleteInput, decorators: [{
286
305
  type: Component,
287
306
  args: [{ selector: 'ia-autocomplete', host: {
288
307
  '[id]': 'id',
@@ -342,6 +361,12 @@ class IaEntitySelectInput {
342
361
  };
343
362
  this._onTouched = () => {
344
363
  };
364
+ this.ngControl = null;
365
+ this.errorState = false;
366
+ this.inputField = null;
367
+ this._dataSource = null;
368
+ this._placeholder = "";
369
+ this._prefix = "";
345
370
  this.searchFormControl = new FormControl();
346
371
  this.isLoading = false;
347
372
  this._disabled = false;
@@ -377,7 +402,9 @@ class IaEntitySelectInput {
377
402
  }
378
403
  set required(req) {
379
404
  this._required = coerceBooleanProperty(req);
380
- this.inputField.required = this._required;
405
+ if (this.inputField) {
406
+ this.inputField.required = this._required;
407
+ }
381
408
  this.stateChanges.next();
382
409
  }
383
410
  get prefix() {
@@ -399,7 +426,7 @@ class IaEntitySelectInput {
399
426
  }
400
427
  get empty() {
401
428
  let n = this.searchFormControl.value;
402
- return !!!n;
429
+ return !n;
403
430
  }
404
431
  get shouldLabelFloat() {
405
432
  return this.focused || !this.empty;
@@ -414,13 +441,15 @@ class IaEntitySelectInput {
414
441
  if (this._prefix) {
415
442
  this.searchFormControl
416
443
  .valueChanges
417
- .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.value = null), tap(() => this.isLoading = true), switchMap(value => this._dataSource.onFilter(value.replace(this._prefix, "").trim())))
444
+ .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.value = null), tap(() => this.isLoading = true), switchMap(value => this._dataSource?.onFilter(value.replace(this._prefix, "").trim()) ?? of(null)))
418
445
  .subscribe(resultSet => {
419
- if (resultSet.list.length === 1) {
420
- this.value = resultSet.list[0];
421
- }
422
- else {
423
- this.filteredEntities = resultSet.list;
446
+ if (resultSet && resultSet.list) {
447
+ if (resultSet.list.length === 1) {
448
+ this.value = resultSet.list[0];
449
+ }
450
+ else {
451
+ this.filteredEntities = resultSet.list;
452
+ }
424
453
  }
425
454
  this.isLoading = false;
426
455
  });
@@ -428,9 +457,11 @@ class IaEntitySelectInput {
428
457
  // This is the search functionality when search by human.
429
458
  this.searchFormControl
430
459
  .valueChanges
431
- .pipe(debounceTime(300), tap(() => this.filteredEntities = []), filter(value => typeof value === 'string'), tap(() => this.setValue(null)), filter(value => value.toString().length >= 3), tap(() => this.isLoading = true), switchMap(value => this._dataSource.onFilter(value)))
460
+ .pipe(debounceTime(300), tap(() => this.filteredEntities = []), filter(value => typeof value === 'string'), tap(() => this.setValue(null)), filter(value => value.toString().length >= 3), tap(() => this.isLoading = true), switchMap(value => this._dataSource?.onFilter(value) ?? of(null)))
432
461
  .subscribe(resultSet => {
433
- this.filteredEntities = resultSet.list;
462
+ if (resultSet && resultSet.list) {
463
+ this.filteredEntities = resultSet.list;
464
+ }
434
465
  this.isLoading = false;
435
466
  });
436
467
  }
@@ -440,7 +471,7 @@ class IaEntitySelectInput {
440
471
  }
441
472
  ngDoCheck() {
442
473
  if (this.ngControl) {
443
- this.errorState = this.ngControl.invalid && this.ngControl.touched;
474
+ this.errorState = (this.ngControl.invalid && this.ngControl.touched) ?? false;
444
475
  this.stateChanges.next();
445
476
  }
446
477
  }
@@ -515,8 +546,8 @@ class IaEntitySelectInput {
515
546
  }
516
547
  }
517
548
  IaEntitySelectInput.nextId = 0;
518
- IaEntitySelectInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaEntitySelectInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
519
- IaEntitySelectInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: IaEntitySelectInput, selector: "ia-entity-select", inputs: { dataSource: "dataSource", disabled: "disabled", placeholder: "placeholder", required: "required", prefix: "prefix" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [
549
+ IaEntitySelectInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaEntitySelectInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
550
+ IaEntitySelectInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: IaEntitySelectInput, selector: "ia-entity-select", inputs: { dataSource: "dataSource", disabled: "disabled", placeholder: "placeholder", required: "required", prefix: "prefix" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [
520
551
  {
521
552
  provide: NG_VALUE_ACCESSOR,
522
553
  useExisting: forwardRef(() => IaEntitySelectInput),
@@ -531,8 +562,8 @@ IaEntitySelectInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
531
562
  useExisting: forwardRef(() => IaEntitySelectInput),
532
563
  multi: true
533
564
  }
534
- ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\" matInput>\n<mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\n [displayWith]=\"dataSource.onDisplayEntity\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\n {{dataSource.onDisplayEntity(entity)}}\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i5.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"] }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
535
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaEntitySelectInput, decorators: [{
565
+ ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\" matInput>\n<mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\n [displayWith]=\"dataSource?.onDisplayEntity ?? null\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\n {{dataSource?.onDisplayEntity(entity) ?? null}}\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: i5.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"] }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaEntitySelectInput, decorators: [{
536
567
  type: Component,
537
568
  args: [{ selector: 'ia-entity-select', host: {
538
569
  '[id]': 'id',
@@ -552,7 +583,290 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImpor
552
583
  useExisting: forwardRef(() => IaEntitySelectInput),
553
584
  multi: true
554
585
  }
555
- ], template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\" matInput>\n<mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\n [displayWith]=\"dataSource.onDisplayEntity\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\n {{dataSource.onDisplayEntity(entity)}}\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"] }]
586
+ ], template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\" matInput>\n<mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\n [displayWith]=\"dataSource?.onDisplayEntity ?? null\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\n {{dataSource?.onDisplayEntity(entity) ?? null}}\n </mat-option>\n </ng-container>\n</mat-autocomplete>\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"] }]
587
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
588
+ type: HostBinding
589
+ }], inputField: [{
590
+ type: ViewChild,
591
+ args: ['input']
592
+ }], describedBy: [{
593
+ type: HostBinding,
594
+ args: ['attr.aria-describedby']
595
+ }], dataSource: [{
596
+ type: Input
597
+ }], disabled: [{
598
+ type: Input
599
+ }], placeholder: [{
600
+ type: Input
601
+ }], required: [{
602
+ type: Input
603
+ }], prefix: [{
604
+ type: Input
605
+ }], shouldLabelFloat: [{
606
+ type: HostBinding,
607
+ args: ['class.floating']
608
+ }] } });
609
+
610
+ class IaMultipleEntitySelectInput {
611
+ constructor(elRef, injector, fm) {
612
+ this.elRef = elRef;
613
+ this.injector = injector;
614
+ this.fm = fm;
615
+ this.filteredEntities = [];
616
+ this.stateChanges = new Subject();
617
+ this.id = `ia-multiple-entity-select-${IaMultipleEntitySelectInput.nextId++}`;
618
+ this.valuesChange = new EventEmitter();
619
+ this.describedBy = '';
620
+ this.separatorKeysCodes = [ENTER, COMMA];
621
+ this._disabled = false;
622
+ this._required = false;
623
+ this._propagateChange = (_) => {
624
+ };
625
+ this._onTouched = () => {
626
+ };
627
+ this.ngControl = null;
628
+ this.errorState = false;
629
+ this.inputField = null;
630
+ this._dataSource = null;
631
+ this._placeholder = "";
632
+ this._prefix = "";
633
+ this._selectedEntities = null;
634
+ this.valuesFormControl = new FormControl();
635
+ this.searchFormControl = new FormControl();
636
+ this.isLoading = false;
637
+ this._disabled = false;
638
+ this.focused = false;
639
+ fm.monitor(elRef.nativeElement, true).subscribe(origin => {
640
+ this.focused = !!origin;
641
+ this.stateChanges.next();
642
+ });
643
+ }
644
+ get dataSource() {
645
+ return this._dataSource;
646
+ }
647
+ set dataSource(value) {
648
+ this._dataSource = value;
649
+ }
650
+ get disabled() {
651
+ return this._disabled;
652
+ }
653
+ set disabled(dis) {
654
+ this._disabled = coerceBooleanProperty(dis);
655
+ this._disabled ? this.searchFormControl.disable() : this.searchFormControl.enable();
656
+ this.stateChanges.next();
657
+ }
658
+ get placeholder() {
659
+ return this._placeholder;
660
+ }
661
+ set placeholder(plh) {
662
+ this._placeholder = plh;
663
+ this.stateChanges.next();
664
+ }
665
+ get required() {
666
+ return this._required;
667
+ }
668
+ set required(req) {
669
+ this._required = coerceBooleanProperty(req);
670
+ if (this.inputField) {
671
+ this.inputField.required = this._required;
672
+ }
673
+ this.stateChanges.next();
674
+ }
675
+ get prefix() {
676
+ return this._prefix;
677
+ }
678
+ set prefix(value) {
679
+ if (value !== this._prefix) {
680
+ this._prefix = value;
681
+ }
682
+ }
683
+ get value() {
684
+ return this._selectedEntities;
685
+ }
686
+ set value(value) {
687
+ if (value !== this._selectedEntities) {
688
+ this.valuesFormControl.setValue(value);
689
+ this.setValue(value);
690
+ }
691
+ }
692
+ get empty() {
693
+ let n = this.valuesFormControl.value;
694
+ return !n;
695
+ }
696
+ get shouldLabelFloat() {
697
+ return this.focused || !this.empty;
698
+ }
699
+ ngOnInit() {
700
+ this.ngControl = this.injector.get(NgControl, null);
701
+ if (this.ngControl != null) {
702
+ this.ngControl.valueAccessor = this;
703
+ }
704
+ // If prefix defined, usually this is used for a code scanner.
705
+ // The goal is to select the entity in direct way.
706
+ if (this._prefix) {
707
+ this.searchFormControl
708
+ .valueChanges
709
+ .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.isLoading = true), switchMap(value => this._dataSource?.onFilter(value.replace(this._prefix, "").trim()) ?? of(null)))
710
+ .subscribe(resultSet => {
711
+ if (resultSet && resultSet.list) {
712
+ this.filteredEntities = resultSet.list;
713
+ }
714
+ this.isLoading = false;
715
+ });
716
+ }
717
+ // This is the search functionality when search by human.
718
+ this.searchFormControl
719
+ .valueChanges
720
+ .pipe(debounceTime(300), tap(() => this.filteredEntities = []), filter(value => typeof value === 'string'), filter(value => value.toString().length >= 3), tap(() => this.isLoading = true), switchMap(value => this._dataSource?.onFilter(value) ?? of(null)))
721
+ .subscribe(resultSet => {
722
+ const resultList = new Array();
723
+ if (resultSet && resultSet.list) {
724
+ resultSet.list.forEach(value1 => {
725
+ if (!this.value?.find(value2 => this._dataSource?.getIdEntity(value2) === this._dataSource?.getIdEntity(value1))) {
726
+ resultList.push(value1);
727
+ }
728
+ });
729
+ }
730
+ this.filteredEntities = resultList;
731
+ this.isLoading = false;
732
+ });
733
+ }
734
+ ngOnDestroy() {
735
+ this.stateChanges.complete();
736
+ this.fm.stopMonitoring(this.elRef.nativeElement);
737
+ }
738
+ ngDoCheck() {
739
+ if (this.ngControl) {
740
+ this.errorState = (this.ngControl.invalid && this.ngControl.touched) ?? false;
741
+ this.stateChanges.next();
742
+ }
743
+ }
744
+ clear() {
745
+ this.filteredEntities = [];
746
+ this.searchFormControl.reset(null);
747
+ }
748
+ focus() {
749
+ this.elRef.nativeElement.querySelector('input').focus();
750
+ }
751
+ onEntitySelected(event) {
752
+ let list = this.value;
753
+ if (!list) {
754
+ list = new Array();
755
+ }
756
+ list.push(event.option.value);
757
+ this.value = list;
758
+ this.filteredEntities = [];
759
+ this.searchFormControl.setValue(null);
760
+ this.valuesFormControl.updateValueAndValidity();
761
+ }
762
+ onEntityActivated(event) {
763
+ this.activatedValue = event.option?.value;
764
+ }
765
+ onEntityClosed() {
766
+ if (this.activatedValue) {
767
+ this.value = this.activatedValue;
768
+ this.activatedValue = null;
769
+ }
770
+ }
771
+ reset() {
772
+ this.value = new Array();
773
+ }
774
+ onFocusOut() {
775
+ // if (this.filteredEntities.length === 1) {
776
+ // this.activatedValue = this.filteredEntities[0];
777
+ // this.value = this.filteredEntities[0];
778
+ // }
779
+ }
780
+ onTouched() {
781
+ this._onTouched();
782
+ this.stateChanges.next();
783
+ }
784
+ registerOnChange(fn) {
785
+ this._propagateChange = fn;
786
+ }
787
+ registerOnTouched(fn) {
788
+ this.onTouched = fn;
789
+ }
790
+ writeValue(obj) {
791
+ this.clear();
792
+ this.value = obj;
793
+ }
794
+ setDisabledState(isDisabled) {
795
+ this.disabled = isDisabled;
796
+ }
797
+ onContainerClick(event) {
798
+ if (event.target.tagName.toLowerCase() != 'input') {
799
+ this.focus();
800
+ }
801
+ }
802
+ setDescribedByIds(ids) {
803
+ this.describedBy = ids.join(' ');
804
+ }
805
+ validate(control) {
806
+ const selection = control.value;
807
+ if (typeof selection === 'string') {
808
+ return { incorrect: true };
809
+ }
810
+ return null;
811
+ }
812
+ remove(value) {
813
+ const list = this.value;
814
+ if (list) {
815
+ const index = list.indexOf(value);
816
+ if (index !== -1) {
817
+ list.splice(index, 1);
818
+ }
819
+ this.valuesFormControl.updateValueAndValidity();
820
+ }
821
+ }
822
+ setValue(values) {
823
+ if (values !== this._selectedEntities) {
824
+ this._selectedEntities = values;
825
+ this.valuesChange.emit(values ?? []);
826
+ this._propagateChange(this._selectedEntities ?? []);
827
+ this.stateChanges.next();
828
+ }
829
+ }
830
+ }
831
+ IaMultipleEntitySelectInput.nextId = 0;
832
+ IaMultipleEntitySelectInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaMultipleEntitySelectInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
833
+ IaMultipleEntitySelectInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: IaMultipleEntitySelectInput, selector: "ia-multiple-entity-select", inputs: { dataSource: "dataSource", disabled: "disabled", placeholder: "placeholder", required: "required", prefix: "prefix" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [
834
+ {
835
+ provide: NG_VALUE_ACCESSOR,
836
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
837
+ multi: true
838
+ },
839
+ {
840
+ provide: MatFormFieldControl,
841
+ useExisting: IaMultipleEntitySelectInput
842
+ },
843
+ {
844
+ provide: NG_VALIDATORS,
845
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
846
+ multi: true
847
+ }
848
+ ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<mat-chip-grid #list>\n <mat-chip-row *ngFor=\"let entity of valuesFormControl.value\"\n (removed)=\"remove(entity)\"\n [editable]=\"false\"\n [aria-description]=\"'press enter to edit ' + dataSource?.onDisplayEntity(entity) ?? null\">\n {{dataSource?.onDisplayEntity(entity) ?? null}}\n <button matChipRemove [attr.aria-label]=\"'remove ' + dataSource?.onDisplayEntity(entity) ?? null\">\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n <input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"list\"\n matChipInputAddOnBlur=\"true\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [placeholder]=\"placeholder\" matInput>\n <mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\n [displayWith]=\"dataSource?.onDisplayEntity ?? null\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\n {{dataSource?.onDisplayEntity(entity) ?? null}}\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n</mat-chip-grid>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: i5.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"] }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i7$1.MatChipGrid, selector: "mat-chip-grid", inputs: ["tabIndex", "disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i7$1.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i7$1.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i7$1.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "editable"], outputs: ["edited"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaMultipleEntitySelectInput, decorators: [{
850
+ type: Component,
851
+ args: [{ selector: 'ia-multiple-entity-select', host: {
852
+ '[id]': 'id',
853
+ '[attr.aria-describedby]': 'describedBy'
854
+ }, providers: [
855
+ {
856
+ provide: NG_VALUE_ACCESSOR,
857
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
858
+ multi: true
859
+ },
860
+ {
861
+ provide: MatFormFieldControl,
862
+ useExisting: IaMultipleEntitySelectInput
863
+ },
864
+ {
865
+ provide: NG_VALIDATORS,
866
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
867
+ multi: true
868
+ }
869
+ ], template: "<mat-chip-grid #list>\n <mat-chip-row *ngFor=\"let entity of valuesFormControl.value\"\n (removed)=\"remove(entity)\"\n [editable]=\"false\"\n [aria-description]=\"'press enter to edit ' + dataSource?.onDisplayEntity(entity) ?? null\">\n {{dataSource?.onDisplayEntity(entity) ?? null}}\n <button matChipRemove [attr.aria-label]=\"'remove ' + dataSource?.onDisplayEntity(entity) ?? null\">\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n <input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"list\"\n matChipInputAddOnBlur=\"true\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [placeholder]=\"placeholder\" matInput>\n <mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\n [displayWith]=\"dataSource?.onDisplayEntity ?? null\">\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\n <mat-spinner diameter=\"50\"></mat-spinner>\n </mat-option>\n <ng-container *ngIf=\"!isLoading\">\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\n {{dataSource?.onDisplayEntity(entity) ?? null}}\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n</mat-chip-grid>\n" }]
556
870
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
557
871
  type: HostBinding
558
872
  }], inputField: [{
@@ -578,8 +892,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImpor
578
892
 
579
893
  class IaSharedUIModule {
580
894
  }
581
- IaSharedUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaSharedUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
582
- IaSharedUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: IaSharedUIModule, declarations: [IaNotificationBarComponent, MessageDetailsComponent, IaAutocompleteInput, IaEntitySelectInput], imports: [CommonModule,
895
+ IaSharedUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
896
+ IaSharedUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, declarations: [IaNotificationBarComponent,
897
+ MessageDetailsComponent,
898
+ IaAutocompleteInput,
899
+ IaEntitySelectInput,
900
+ IaMultipleEntitySelectInput], imports: [CommonModule,
583
901
  MatToolbarModule,
584
902
  MatButtonModule,
585
903
  MatSnackBarModule,
@@ -587,10 +905,13 @@ IaSharedUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
587
905
  MatAutocompleteModule,
588
906
  MatInputModule,
589
907
  MatProgressSpinnerModule,
908
+ MatChipsModule,
909
+ MatIconModule,
590
910
  ReactiveFormsModule], exports: [IaNotificationBarComponent,
591
911
  IaAutocompleteInput,
592
- IaEntitySelectInput] });
593
- IaSharedUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaSharedUIModule, imports: [CommonModule,
912
+ IaEntitySelectInput,
913
+ IaMultipleEntitySelectInput] });
914
+ IaSharedUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, imports: [CommonModule,
594
915
  MatToolbarModule,
595
916
  MatButtonModule,
596
917
  MatSnackBarModule,
@@ -598,20 +919,30 @@ IaSharedUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versio
598
919
  MatAutocompleteModule,
599
920
  MatInputModule,
600
921
  MatProgressSpinnerModule,
922
+ MatChipsModule,
923
+ MatIconModule,
601
924
  ReactiveFormsModule] });
602
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IaSharedUIModule, decorators: [{
925
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, decorators: [{
603
926
  type: NgModule,
604
927
  args: [{
605
- declarations: [IaNotificationBarComponent, MessageDetailsComponent, IaAutocompleteInput, IaEntitySelectInput],
928
+ declarations: [
929
+ IaNotificationBarComponent,
930
+ MessageDetailsComponent,
931
+ IaAutocompleteInput,
932
+ IaEntitySelectInput,
933
+ IaMultipleEntitySelectInput
934
+ ],
606
935
  exports: [
607
936
  IaNotificationBarComponent,
608
937
  IaAutocompleteInput,
609
- IaEntitySelectInput
938
+ IaEntitySelectInput,
939
+ IaMultipleEntitySelectInput
610
940
  ],
611
941
  entryComponents: [
612
942
  MessageDetailsComponent,
613
943
  IaAutocompleteInput,
614
- IaEntitySelectInput
944
+ IaEntitySelectInput,
945
+ IaMultipleEntitySelectInput
615
946
  ],
616
947
  imports: [
617
948
  CommonModule,
@@ -622,6 +953,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImpor
622
953
  MatAutocompleteModule,
623
954
  MatInputModule,
624
955
  MatProgressSpinnerModule,
956
+ MatChipsModule,
957
+ MatIconModule,
625
958
  ReactiveFormsModule
626
959
  ]
627
960
  }]
@@ -631,6 +964,7 @@ class ProgressWindowComponent {
631
964
  constructor(data) {
632
965
  this.data = data;
633
966
  this.statusText = null;
967
+ this.progressValue = 0;
634
968
  data.progress.subscribe(value => {
635
969
  this.statusText = value.statusText;
636
970
  this.progressValue = value.progressValue;
@@ -642,9 +976,9 @@ class ProgressWindowComponent {
642
976
  this.data.cancelOperation();
643
977
  }
644
978
  }
645
- ProgressWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressWindowComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
646
- ProgressWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ProgressWindowComponent, selector: "lib-progress-window", ngImport: i0, template: "<h1 mat-dialog-title>{{data.title}}</h1>\n<div mat-dialog-content>\n <div fxLayout=\"column\">\n <mat-progress-bar *ngIf=\"data.isDeterminate\" [value]=\"progressValue\" mode=\"determinate\"></mat-progress-bar>\n <mat-progress-bar *ngIf=\"!data.isDeterminate\" mode=\"indeterminate\"></mat-progress-bar>\n <p>{{statusText}}</p>\n </div>\n</div>\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\n <button (click)=\"onCancelClick()\" *ngIf=\"data.isCancelOperationAvailable\" mat-button>Cancel</button>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "component", 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"] }, { kind: "component", type: i5$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
647
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressWindowComponent, decorators: [{
979
+ ProgressWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressWindowComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
980
+ ProgressWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ProgressWindowComponent, selector: "lib-progress-window", ngImport: i0, template: "<h1 mat-dialog-title>{{data.title}}</h1>\n<div mat-dialog-content>\n <div fxLayout=\"column\">\n <mat-progress-bar *ngIf=\"data.isDeterminate\" [value]=\"progressValue\" mode=\"determinate\"></mat-progress-bar>\n <mat-progress-bar *ngIf=\"!data.isDeterminate\" mode=\"indeterminate\"></mat-progress-bar>\n <p>{{statusText}}</p>\n </div>\n</div>\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\n <button (click)=\"onCancelClick()\" *ngIf=\"data.isCancelOperationAvailable\" mat-button>Cancel</button>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
981
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressWindowComponent, decorators: [{
648
982
  type: Component,
649
983
  args: [{ selector: 'lib-progress-window', template: "<h1 mat-dialog-title>{{data.title}}</h1>\n<div mat-dialog-content>\n <div fxLayout=\"column\">\n <mat-progress-bar *ngIf=\"data.isDeterminate\" [value]=\"progressValue\" mode=\"determinate\"></mat-progress-bar>\n <mat-progress-bar *ngIf=\"!data.isDeterminate\" mode=\"indeterminate\"></mat-progress-bar>\n <p>{{statusText}}</p>\n </div>\n</div>\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\n <button (click)=\"onCancelClick()\" *ngIf=\"data.isCancelOperationAvailable\" mat-button>Cancel</button>\n</div>\n" }]
650
984
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
@@ -656,7 +990,8 @@ class ProgressNotifierService {
656
990
  constructor(dialog) {
657
991
  this.dialog = dialog;
658
992
  this._currentProgressValue = new BehaviorSubject(null);
659
- this.isCanceled = false;
993
+ this.currentDialogRef = null;
994
+ this._isCanceled = false;
660
995
  }
661
996
  get isCanceled() {
662
997
  return this._isCanceled;
@@ -696,12 +1031,12 @@ class ProgressNotifierService {
696
1031
  });
697
1032
  }
698
1033
  complete() {
699
- this.currentDialogRef.close();
1034
+ this.currentDialogRef?.close();
700
1035
  }
701
1036
  }
702
- ProgressNotifierService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressNotifierService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
703
- ProgressNotifierService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressNotifierService });
704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressNotifierService, decorators: [{
1037
+ ProgressNotifierService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
1038
+ ProgressNotifierService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierService });
1039
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierService, decorators: [{
705
1040
  type: Injectable
706
1041
  }], ctorParameters: function () { return [{ type: i1.MatDialog }]; } });
707
1042
 
@@ -715,18 +1050,18 @@ class ProgressNotifierModule {
715
1050
  };
716
1051
  }
717
1052
  }
718
- ProgressNotifierModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressNotifierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
719
- ProgressNotifierModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ProgressNotifierModule, declarations: [ProgressWindowComponent], imports: [CommonModule,
1053
+ ProgressNotifierModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1054
+ ProgressNotifierModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, declarations: [ProgressWindowComponent], imports: [CommonModule,
720
1055
  MatDialogModule,
721
1056
  FlexLayoutModule,
722
1057
  MatButtonModule,
723
1058
  MatProgressBarModule] });
724
- ProgressNotifierModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressNotifierModule, imports: [CommonModule,
1059
+ ProgressNotifierModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, imports: [CommonModule,
725
1060
  MatDialogModule,
726
1061
  FlexLayoutModule,
727
1062
  MatButtonModule,
728
1063
  MatProgressBarModule] });
729
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProgressNotifierModule, decorators: [{
1064
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, decorators: [{
730
1065
  type: NgModule,
731
1066
  args: [{
732
1067
  declarations: [ProgressWindowComponent],
@@ -759,6 +1094,10 @@ class ConfirmationWindowComponent {
759
1094
  constructor(dialogRef, data) {
760
1095
  this.dialogRef = dialogRef;
761
1096
  this.data = data;
1097
+ this.button2Text = null;
1098
+ this.button2Result = null;
1099
+ this.button3Text = null;
1100
+ this.button3Result = null;
762
1101
  if (data.dialogType === DialogType.OkCancel) {
763
1102
  this.button1Text = "OK";
764
1103
  this.button1Result = ButtonTypes.Ok;
@@ -802,9 +1141,9 @@ class ConfirmationWindowComponent {
802
1141
  });
803
1142
  }
804
1143
  }
805
- ConfirmationWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationWindowComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
806
- ConfirmationWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ConfirmationWindowComponent, selector: "lib-shared-ui-confirmation-window", ngImport: i0, template: "<h1 mat-dialog-title>{{data.title}}</h1>\n<div mat-dialog-content>{{data.message}}</div>\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\n <button (click)=\"onButton1()\" color=\"primary\" mat-button>{{button1Text}}</button>\n <button (click)=\"onButton2()\" *ngIf=\"button2Text\" mat-button>{{button2Text}}</button>\n <button (click)=\"onButton3()\" *ngIf=\"button3Text\" mat-button>{{button3Text}}</button>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "component", 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"] }] });
807
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationWindowComponent, decorators: [{
1144
+ ConfirmationWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationWindowComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1145
+ ConfirmationWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ConfirmationWindowComponent, selector: "lib-shared-ui-confirmation-window", ngImport: i0, template: "<h1 mat-dialog-title>{{data.title}}</h1>\n<div mat-dialog-content>{{data.message}}</div>\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\n <button (click)=\"onButton1()\" color=\"primary\" mat-button>{{button1Text}}</button>\n <button (click)=\"onButton2()\" *ngIf=\"button2Text\" mat-button>{{button2Text}}</button>\n <button (click)=\"onButton3()\" *ngIf=\"button3Text\" mat-button>{{button3Text}}</button>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
1146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationWindowComponent, decorators: [{
808
1147
  type: Component,
809
1148
  args: [{ selector: 'lib-shared-ui-confirmation-window', template: "<h1 mat-dialog-title>{{data.title}}</h1>\n<div mat-dialog-content>{{data.message}}</div>\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\n <button (click)=\"onButton1()\" color=\"primary\" mat-button>{{button1Text}}</button>\n <button (click)=\"onButton2()\" *ngIf=\"button2Text\" mat-button>{{button2Text}}</button>\n <button (click)=\"onButton3()\" *ngIf=\"button3Text\" mat-button>{{button3Text}}</button>\n</div>\n" }]
810
1149
  }], ctorParameters: function () { return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
@@ -826,7 +1165,7 @@ class ConfirmationService {
826
1165
  dialogType: DialogType.YesNo
827
1166
  }
828
1167
  });
829
- return dialogRef.afterClosed().pipe(map(value => value.result == ButtonTypes.Yes));
1168
+ return dialogRef.afterClosed().pipe(map(value => value?.result == ButtonTypes.Yes));
830
1169
  }
831
1170
  showYesNoCancelConfirmationDialog(title, message) {
832
1171
  const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
@@ -850,7 +1189,7 @@ class ConfirmationService {
850
1189
  dialogType: DialogType.OkCancel
851
1190
  }
852
1191
  });
853
- return dialogRef.afterClosed().pipe(map(value => value.result == ButtonTypes.Ok));
1192
+ return dialogRef.afterClosed().pipe(map(value => value?.result == ButtonTypes.Ok));
854
1193
  }
855
1194
  showOkDialog(title, message) {
856
1195
  const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
@@ -862,12 +1201,12 @@ class ConfirmationService {
862
1201
  dialogType: DialogType.Ok
863
1202
  }
864
1203
  });
865
- return dialogRef.afterClosed().pipe(map(value => value.result == ButtonTypes.Ok));
1204
+ return dialogRef.afterClosed().pipe(map(value => value?.result == ButtonTypes.Ok));
866
1205
  }
867
1206
  }
868
- ConfirmationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
869
- ConfirmationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationService, providedIn: 'root' });
870
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationService, decorators: [{
1207
+ ConfirmationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
1208
+ ConfirmationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationService, providedIn: 'root' });
1209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationService, decorators: [{
871
1210
  type: Injectable,
872
1211
  args: [{
873
1212
  providedIn: 'root'
@@ -884,16 +1223,16 @@ class ConfirmationDialogModule {
884
1223
  };
885
1224
  }
886
1225
  }
887
- ConfirmationDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
888
- ConfirmationDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationDialogModule, declarations: [ConfirmationWindowComponent], imports: [CommonModule,
1226
+ ConfirmationDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1227
+ ConfirmationDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, declarations: [ConfirmationWindowComponent], imports: [CommonModule,
889
1228
  MatDialogModule,
890
1229
  FlexLayoutModule,
891
1230
  MatButtonModule] });
892
- ConfirmationDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationDialogModule, imports: [CommonModule,
1231
+ ConfirmationDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, imports: [CommonModule,
893
1232
  MatDialogModule,
894
1233
  FlexLayoutModule,
895
1234
  MatButtonModule] });
896
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConfirmationDialogModule, decorators: [{
1235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, decorators: [{
897
1236
  type: NgModule,
898
1237
  args: [{
899
1238
  declarations: [ConfirmationWindowComponent],
@@ -919,15 +1258,16 @@ class CommonValidators {
919
1258
  }
920
1259
  static conditionalRequired(sourceControlName, sourceValueCompareExpression) {
921
1260
  return (control) => {
922
- if (control.parent && sourceValueCompareExpression(control.parent.get(sourceControlName).value)) {
1261
+ if (control.parent && sourceValueCompareExpression(control.parent.get(sourceControlName)?.value)) {
923
1262
  return isEmptyInputValue(control.value) ? { 'required': true } : null;
924
1263
  }
1264
+ return null;
925
1265
  };
926
1266
  }
927
1267
  static dependentControls(controlNames) {
928
1268
  return (control) => {
929
1269
  controlNames.forEach(controlName => {
930
- control.parent?.get(controlName).updateValueAndValidity();
1270
+ control.parent?.get(controlName)?.updateValueAndValidity();
931
1271
  });
932
1272
  return null;
933
1273
  };
@@ -937,13 +1277,14 @@ class CommonValidators {
937
1277
  class AbstractDetailsComponent {
938
1278
  constructor() {
939
1279
  this.hasError = (controlName, errorName) => {
940
- return this.ownerForm.controls[controlName].hasError(errorName);
1280
+ return this.ownerForm?.controls[controlName].hasError(errorName);
941
1281
  };
942
1282
  this.hasFormError = (errorName) => {
943
- return this.ownerForm.hasError(errorName);
1283
+ return this.ownerForm?.hasError(errorName);
944
1284
  };
945
1285
  this.loading = true;
946
1286
  this.entity = null;
1287
+ this._ownerForm = null;
947
1288
  }
948
1289
  get ownerForm() {
949
1290
  return this._ownerForm;
@@ -952,7 +1293,7 @@ class AbstractDetailsComponent {
952
1293
  return this.entity !== null;
953
1294
  }
954
1295
  updateDateTime(controlName) {
955
- this.ownerForm.get(controlName).setValue(IsoDateTime.utcToLocalDateTimeIso(IsoDateTime.currentUtcDateTimeIso()));
1296
+ this.ownerForm?.get(controlName)?.setValue(IsoDateTime.utcToLocalDateTimeIso(IsoDateTime.currentUtcDateTimeIso()));
956
1297
  }
957
1298
  copyInputMessage(inputElement) {
958
1299
  inputElement.select();
@@ -961,11 +1302,11 @@ class AbstractDetailsComponent {
961
1302
  }
962
1303
  onProgressStarting() {
963
1304
  this.loading = true;
964
- this.ownerForm.disable();
965
- this.ownerForm.updateValueAndValidity();
1305
+ this.ownerForm?.disable();
1306
+ this.ownerForm?.updateValueAndValidity();
966
1307
  }
967
1308
  onProgressCompleted() {
968
- this.ownerForm.enable();
1309
+ this.ownerForm?.enable();
969
1310
  this.loading = false;
970
1311
  }
971
1312
  }
@@ -978,5 +1319,5 @@ class AbstractDetailsComponent {
978
1319
  * Generated bundle index. Do not edit.
979
1320
  */
980
1321
 
981
- export { AbstractDetailsComponent, ButtonTypes, CommonValidators, ConfirmationDialogModule, ConfirmationService, DialogType, IaAutocompleteInput, IaEntitySelectInput, IaNotificationBarComponent, IaSharedUIModule, ProgressNotifierModule, ProgressNotifierService };
1322
+ export { AbstractDetailsComponent, ButtonTypes, CommonValidators, ConfirmationDialogModule, ConfirmationService, DialogType, IaAutocompleteInput, IaEntitySelectInput, IaMultipleEntitySelectInput, IaNotificationBarComponent, IaSharedUIModule, ProgressNotifierModule, ProgressNotifierService };
982
1323
  //# sourceMappingURL=meshmakers-shared-ui.mjs.map