@meshmakers/shared-ui 2.0.2304-13005 → 2.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 (42) hide show
  1. package/README.md +24 -27
  2. package/esm2020/lib/confirmation-dialog/confirmation-dialog.module.mjs +40 -40
  3. package/esm2020/lib/confirmation-dialog/confirmation-window/confirmation-window.component.mjs +69 -65
  4. package/esm2020/lib/confirmation-dialog/services/confirmation.service.mjs +68 -68
  5. package/esm2020/lib/confirmation-dialog/shared/confirmation.mjs +15 -15
  6. package/esm2020/lib/ia-shared-ui/ia-autocomplete-input/ia-autocomplete-input.mjs +276 -263
  7. package/esm2020/lib/ia-shared-ui/ia-entity-select-input/ia-entity-select-input.component.mjs +276 -264
  8. package/esm2020/lib/ia-shared-ui/ia-multiple-entity-select-input/ia-multiple-entity-select-input.component.mjs +300 -285
  9. package/esm2020/lib/ia-shared-ui/ia-notification-bar/ia-notification-bar.component.mjs +36 -35
  10. package/esm2020/lib/ia-shared-ui/ia-shared-ui.module.mjs +88 -88
  11. package/esm2020/lib/ia-shared-ui/message-details/message-details.component.mjs +24 -24
  12. package/esm2020/lib/progress-notifier/progress-notifier.module.mjs +44 -44
  13. package/esm2020/lib/progress-notifier/progress-window/progress-window.component.mjs +34 -33
  14. package/esm2020/lib/progress-notifier/services/progress-notifier.service.mjs +59 -58
  15. package/esm2020/lib/progress-notifier/shared/progressValue.mjs +7 -3
  16. package/esm2020/lib/shared/abstractDetailsComponent.mjs +38 -37
  17. package/esm2020/lib/shared/commonValidators.mjs +30 -29
  18. package/esm2020/meshmakers-shared-ui.mjs +4 -4
  19. package/esm2020/public-api.mjs +16 -16
  20. package/fesm2015/meshmakers-shared-ui.mjs +1273 -1212
  21. package/fesm2015/meshmakers-shared-ui.mjs.map +1 -1
  22. package/fesm2020/meshmakers-shared-ui.mjs +1251 -1202
  23. package/fesm2020/meshmakers-shared-ui.mjs.map +1 -1
  24. package/index.d.ts +5 -5
  25. package/lib/confirmation-dialog/confirmation-dialog.module.d.ts +13 -13
  26. package/lib/confirmation-dialog/confirmation-window/confirmation-window.component.d.ts +21 -21
  27. package/lib/confirmation-dialog/services/confirmation.service.d.ts +14 -14
  28. package/lib/confirmation-dialog/shared/confirmation.d.ts +20 -20
  29. package/lib/ia-shared-ui/ia-autocomplete-input/ia-autocomplete-input.d.ts +69 -69
  30. package/lib/ia-shared-ui/ia-entity-select-input/ia-entity-select-input.component.d.ts +70 -70
  31. package/lib/ia-shared-ui/ia-multiple-entity-select-input/ia-multiple-entity-select-input.component.d.ts +73 -73
  32. package/lib/ia-shared-ui/ia-notification-bar/ia-notification-bar.component.d.ts +15 -15
  33. package/lib/ia-shared-ui/ia-shared-ui.module.d.ts +22 -22
  34. package/lib/ia-shared-ui/message-details/message-details.component.d.ts +13 -13
  35. package/lib/progress-notifier/progress-notifier.module.d.ts +14 -14
  36. package/lib/progress-notifier/progress-window/progress-window.component.d.ts +23 -23
  37. package/lib/progress-notifier/services/progress-notifier.service.d.ts +17 -17
  38. package/lib/progress-notifier/shared/progressValue.d.ts +5 -4
  39. package/lib/shared/abstractDetailsComponent.d.ts +15 -15
  40. package/lib/shared/commonValidators.d.ts +10 -10
  41. package/package.json +8 -4
  42. package/public-api.d.ts +12 -12
@@ -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';
@@ -35,1249 +35,1310 @@ import * as i5$1 from '@angular/material/progress-bar';
35
35
  import { MatProgressBarModule } from '@angular/material/progress-bar';
36
36
  import { FlexLayoutModule } from '@angular/flex-layout';
37
37
 
38
- class MessageDetailsComponent {
39
- constructor(dialogRef, data) {
40
- this.dialogRef = dialogRef;
41
- this.data = data;
42
- this.errorMessage = data.errorMessage;
43
- }
44
- ngOnInit() {
45
- }
46
- }
47
- MessageDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", 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.3", type: MessageDetailsComponent, selector: "app-message-details", ngImport: i0, template: "<mat-dialog-content>\r\n\r\n <h2>{{errorMessage.title}}</h2>\r\n <p>{{errorMessage.message}}</p>\r\n\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions align=\"end\">\r\n <button color=\"primary\" mat-dialog-close mat-raised-button>OK</button>\r\n</mat-dialog-actions>\r\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.3", ngImport: i0, type: MessageDetailsComponent, decorators: [{
50
- type: Component,
51
- args: [{ selector: 'app-message-details', template: "<mat-dialog-content>\r\n\r\n <h2>{{errorMessage.title}}</h2>\r\n <p>{{errorMessage.message}}</p>\r\n\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions align=\"end\">\r\n <button color=\"primary\" mat-dialog-close mat-raised-button>OK</button>\r\n</mat-dialog-actions>\r\n" }]
52
- }], ctorParameters: function () {
53
- return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
54
- type: Inject,
55
- args: [MAT_DIALOG_DATA]
56
- }] }];
38
+ class MessageDetailsComponent {
39
+ constructor(dialogRef, data) {
40
+ this.dialogRef = dialogRef;
41
+ this.data = data;
42
+ this.errorMessage = data.errorMessage;
43
+ }
44
+ ngOnInit() {
45
+ }
46
+ }
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: [{
50
+ type: Component,
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" }]
52
+ }], ctorParameters: function () {
53
+ return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
54
+ type: Inject,
55
+ args: [MAT_DIALOG_DATA]
56
+ }] }];
57
57
  } });
58
58
 
59
- class IaNotificationBarComponent {
60
- constructor(messageService, dialog) {
61
- this.messageService = messageService;
62
- this.dialog = dialog;
63
- }
64
- ngOnInit() {
65
- this.messageService.getLatestErrorMessage().subscribe(value => {
66
- this.errorMessage = value;
67
- });
68
- }
69
- onHide() {
70
- this.errorMessage = null;
71
- }
72
- onShowDetails() {
73
- this.dialog.open(MessageDetailsComponent, {
74
- data: {
75
- errorMessage: this.errorMessage
76
- }
77
- });
78
- }
79
- }
80
- IaNotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaNotificationBarComponent, deps: [{ token: i1$1.MessageService }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
81
- IaNotificationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: IaNotificationBarComponent, selector: "ia-notification-bar", ngImport: i0, template: "<mat-toolbar [hidden]=\"!errorMessage\" color=\"warn\">\r\n <a (click)=\"onShowDetails()\"><span class=\"mat-small\"><u>{{ errorMessage?.title }}</u></span></a>\r\n\r\n <!-- This fills the remaining space of the current row -->\r\n <span class=\"notification-fill-remaining-space\"></span>\r\n\r\n <button (click)=\"onHide()\" color=\"warn\" mat-raised-button><i class=\"pi pi-angle-double-up\"></i></button>\r\n</mat-toolbar>\r\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"] }] });
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaNotificationBarComponent, decorators: [{
83
- type: Component,
84
- args: [{ selector: 'ia-notification-bar', template: "<mat-toolbar [hidden]=\"!errorMessage\" color=\"warn\">\r\n <a (click)=\"onShowDetails()\"><span class=\"mat-small\"><u>{{ errorMessage?.title }}</u></span></a>\r\n\r\n <!-- This fills the remaining space of the current row -->\r\n <span class=\"notification-fill-remaining-space\"></span>\r\n\r\n <button (click)=\"onHide()\" color=\"warn\" mat-raised-button><i class=\"pi pi-angle-double-up\"></i></button>\r\n</mat-toolbar>\r\n", styles: [".notification-fill-remaining-space{flex:1 1 auto}\n"] }]
59
+ class IaNotificationBarComponent {
60
+ constructor(messageService, dialog) {
61
+ this.messageService = messageService;
62
+ this.dialog = dialog;
63
+ this.errorMessage = null;
64
+ }
65
+ ngOnInit() {
66
+ this.messageService.getLatestErrorMessage().subscribe(value => {
67
+ this.errorMessage = value;
68
+ });
69
+ }
70
+ onHide() {
71
+ this.errorMessage = null;
72
+ }
73
+ onShowDetails() {
74
+ this.dialog.open(MessageDetailsComponent, {
75
+ data: {
76
+ errorMessage: this.errorMessage
77
+ }
78
+ });
79
+ }
80
+ }
81
+ 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 });
82
+ 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"] }] });
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaNotificationBarComponent, decorators: [{
84
+ type: Component,
85
+ 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"] }]
85
86
  }], ctorParameters: function () { return [{ type: i1$1.MessageService }, { type: i1.MatDialog }]; } });
86
87
 
87
- class IaAutocompleteInput {
88
- constructor(elRef, injector, fm) {
89
- this.elRef = elRef;
90
- this.injector = injector;
91
- this.fm = fm;
92
- this.filteredStrings = [];
93
- this.stateChanges = new Subject();
94
- this.id = `ia-autocomplete-${IaAutocompleteInput.nextId++}`;
95
- this.valueChange = new EventEmitter();
96
- this.describedBy = '';
97
- this._disabled = false;
98
- this._required = false;
99
- this._propagateChange = (_) => {
100
- };
101
- this._onTouched = () => {
102
- };
103
- this.searchFormControl = new FormControl();
104
- this.isLoading = false;
105
- this._disabled = false;
106
- this.focused = false;
107
- fm.monitor(elRef.nativeElement, true).subscribe(origin => {
108
- this.focused = !!origin;
109
- this.stateChanges.next();
110
- });
111
- }
112
- get dataSource() {
113
- return this._dataSource;
114
- }
115
- set dataSource(value) {
116
- this._dataSource = value;
117
- }
118
- get disabled() {
119
- return this._disabled;
120
- }
121
- set disabled(dis) {
122
- this._disabled = coerceBooleanProperty(dis);
123
- this._disabled ? this.searchFormControl.disable() : this.searchFormControl.enable();
124
- this.stateChanges.next();
125
- }
126
- get placeholder() {
127
- return this._placeholder;
128
- }
129
- set placeholder(plh) {
130
- this._placeholder = plh;
131
- this.stateChanges.next();
132
- }
133
- get required() {
134
- return this._required;
135
- }
136
- set required(req) {
137
- this._required = coerceBooleanProperty(req);
138
- this.inputField.required = this._required;
139
- this.stateChanges.next();
140
- }
141
- get prefix() {
142
- return this._prefix;
143
- }
144
- set prefix(value) {
145
- if (value !== this._prefix) {
146
- this._prefix = value;
147
- }
148
- }
149
- get value() {
150
- return this._selectedString;
151
- }
152
- set value(value) {
153
- if (value !== this._selectedString) {
154
- this._selectedString = value;
155
- this.searchFormControl.setValue(value);
156
- this.valueChange.emit(value);
157
- this._propagateChange(this._selectedString);
158
- this.stateChanges.next();
159
- }
160
- }
161
- get empty() {
162
- let n = this.searchFormControl.value;
163
- return !!!n;
164
- }
165
- get shouldLabelFloat() {
166
- return this.focused || !this.empty;
167
- }
168
- ngOnInit() {
169
- this.ngControl = this.injector.get(NgControl, null);
170
- if (this.ngControl != null) {
171
- this.ngControl.valueAccessor = this;
172
- }
173
- // If prefix defined, usually this is used for a code scanner.
174
- // The goal is to select the entity in direct way.
175
- if (this._prefix) {
176
- this.searchFormControl
177
- .valueChanges
178
- .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)))
179
- .subscribe(resultSet => {
180
- if (resultSet.list.length === 1) {
181
- this.value = resultSet[0];
182
- }
183
- else {
184
- this.filteredStrings = resultSet.list;
185
- this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
186
- }
187
- this.isLoading = false;
188
- });
189
- }
190
- // This is the search functionality when search by human.
191
- this.searchFormControl
192
- .valueChanges
193
- .pipe(debounceTime(300), tap(value => {
194
- this.filteredStrings = [];
195
- }), 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)))
196
- .subscribe(resultSet => {
197
- this.filteredStrings = resultSet.list;
198
- this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
199
- this.isLoading = false;
200
- });
201
- }
202
- ngOnDestroy() {
203
- this.stateChanges.complete();
204
- this.fm.stopMonitoring(this.elRef.nativeElement);
205
- }
206
- ngDoCheck() {
207
- if (this.ngControl) {
208
- this.errorState = this.ngControl.invalid && this.ngControl.touched;
209
- this.stateChanges.next();
210
- }
211
- }
212
- clear() {
213
- this.filteredStrings = [];
214
- this.searchFormControl.reset(null);
215
- }
216
- focus() {
217
- this.elRef.nativeElement.querySelector('input').focus();
218
- }
219
- onOptionSelected(event) {
220
- this.value = event.option.value;
221
- this.filteredStrings = [];
222
- }
223
- onOptionActivated(event) {
224
- var _a;
225
- this.activatedValue = (_a = event.option) === null || _a === void 0 ? void 0 : _a.value;
226
- }
227
- onAutoCompleteClosed() {
228
- if (this.activatedValue) {
229
- this.value = this.activatedValue;
230
- this.activatedValue = null;
231
- }
232
- }
233
- reset() {
234
- this.value = null;
235
- }
236
- onFocusOut() {
237
- if (this.filteredStrings.length === 1) {
238
- this.activatedValue = this.filteredStrings[0];
239
- this.value = this.filteredStrings[0];
240
- }
241
- }
242
- onTouched() {
243
- this._onTouched();
244
- this.stateChanges.next();
245
- }
246
- registerOnChange(fn) {
247
- this._propagateChange = fn;
248
- }
249
- registerOnTouched(fn) {
250
- this.onTouched = fn;
251
- }
252
- writeValue(obj) {
253
- this.clear();
254
- this.value = obj;
255
- }
256
- setDisabledState(isDisabled) {
257
- this.disabled = isDisabled;
258
- }
259
- onContainerClick(event) {
260
- if (event.target.tagName.toLowerCase() != 'input') {
261
- this.focus();
262
- }
263
- }
264
- setDescribedByIds(ids) {
265
- this.describedBy = ids.join(' ');
266
- }
267
- validate(control) {
268
- const selection = control.value;
269
- if (typeof selection === 'string' && selection.length < 1) {
270
- return { incorrect: true };
271
- }
272
- return null;
273
- }
274
- }
275
- IaAutocompleteInput.nextId = 0;
276
- IaAutocompleteInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaAutocompleteInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
277
- IaAutocompleteInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", 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: [
278
- {
279
- provide: NG_VALUE_ACCESSOR,
280
- useExisting: forwardRef(() => IaAutocompleteInput),
281
- multi: true
282
- },
283
- {
284
- provide: MatFormFieldControl,
285
- useExisting: IaAutocompleteInput
286
- },
287
- {
288
- provide: NG_VALIDATORS,
289
- useExisting: forwardRef(() => IaAutocompleteInput),
290
- multi: true
291
- }
292
- ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\r\n [placeholder]=\"placeholder\" matInput>\r\n<mat-autocomplete #auto=\"matAutocomplete\"\r\n (closed)=\"onAutoCompleteClosed()\" (optionActivated)=\"onOptionActivated($event)\"\r\n (optionSelected)=\"onOptionSelected($event)\">\r\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\r\n <mat-spinner diameter=\"50\"></mat-spinner>\r\n </mat-option>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <mat-option *ngFor=\"let str of filteredStrings\" [value]=\"str\">\r\n {{str}}\r\n </mat-option>\r\n </ng-container>\r\n</mat-autocomplete>\r\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"] }] });
293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaAutocompleteInput, decorators: [{
294
- type: Component,
295
- args: [{ selector: 'ia-autocomplete', host: {
296
- '[id]': 'id',
297
- '[attr.aria-describedby]': 'describedBy'
298
- }, providers: [
299
- {
300
- provide: NG_VALUE_ACCESSOR,
301
- useExisting: forwardRef(() => IaAutocompleteInput),
302
- multi: true
303
- },
304
- {
305
- provide: MatFormFieldControl,
306
- useExisting: IaAutocompleteInput
307
- },
308
- {
309
- provide: NG_VALIDATORS,
310
- useExisting: forwardRef(() => IaAutocompleteInput),
311
- multi: true
312
- }
313
- ], template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\r\n [placeholder]=\"placeholder\" matInput>\r\n<mat-autocomplete #auto=\"matAutocomplete\"\r\n (closed)=\"onAutoCompleteClosed()\" (optionActivated)=\"onOptionActivated($event)\"\r\n (optionSelected)=\"onOptionSelected($event)\">\r\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\r\n <mat-spinner diameter=\"50\"></mat-spinner>\r\n </mat-option>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <mat-option *ngFor=\"let str of filteredStrings\" [value]=\"str\">\r\n {{str}}\r\n </mat-option>\r\n </ng-container>\r\n</mat-autocomplete>\r\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"] }]
314
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
315
- type: HostBinding
316
- }], inputField: [{
317
- type: ViewChild,
318
- args: ['input']
319
- }], describedBy: [{
320
- type: HostBinding,
321
- args: ['attr.aria-describedby']
322
- }], dataSource: [{
323
- type: Input
324
- }], disabled: [{
325
- type: Input
326
- }], placeholder: [{
327
- type: Input
328
- }], required: [{
329
- type: Input
330
- }], prefix: [{
331
- type: Input
332
- }], shouldLabelFloat: [{
333
- type: HostBinding,
334
- args: ['class.floating']
88
+ class IaAutocompleteInput {
89
+ constructor(elRef, injector, fm) {
90
+ this.elRef = elRef;
91
+ this.injector = injector;
92
+ this.fm = fm;
93
+ this.filteredStrings = [];
94
+ this.stateChanges = new Subject();
95
+ this.id = `ia-autocomplete-${IaAutocompleteInput.nextId++}`;
96
+ this.valueChange = new EventEmitter();
97
+ this.describedBy = '';
98
+ this._disabled = false;
99
+ this._required = false;
100
+ this._propagateChange = (_) => {
101
+ };
102
+ this._onTouched = () => {
103
+ };
104
+ this.ngControl = null;
105
+ this.errorState = false;
106
+ this._selectedString = null;
107
+ this.inputField = null;
108
+ this._dataSource = null;
109
+ this._placeholder = "";
110
+ this._prefix = "";
111
+ this.searchFormControl = new FormControl();
112
+ this.isLoading = false;
113
+ this._disabled = false;
114
+ this.focused = false;
115
+ fm.monitor(elRef.nativeElement, true).subscribe(origin => {
116
+ this.focused = !!origin;
117
+ this.stateChanges.next();
118
+ });
119
+ }
120
+ get dataSource() {
121
+ return this._dataSource;
122
+ }
123
+ set dataSource(value) {
124
+ this._dataSource = value;
125
+ }
126
+ get disabled() {
127
+ return this._disabled;
128
+ }
129
+ set disabled(dis) {
130
+ this._disabled = coerceBooleanProperty(dis);
131
+ this._disabled ? this.searchFormControl.disable() : this.searchFormControl.enable();
132
+ this.stateChanges.next();
133
+ }
134
+ get placeholder() {
135
+ return this._placeholder;
136
+ }
137
+ set placeholder(plh) {
138
+ this._placeholder = plh;
139
+ this.stateChanges.next();
140
+ }
141
+ get required() {
142
+ return this._required;
143
+ }
144
+ set required(req) {
145
+ this._required = coerceBooleanProperty(req);
146
+ if (this.inputField) {
147
+ this.inputField.required = this._required;
148
+ }
149
+ this.stateChanges.next();
150
+ }
151
+ get prefix() {
152
+ return this._prefix;
153
+ }
154
+ set prefix(value) {
155
+ if (value !== this._prefix) {
156
+ this._prefix = value;
157
+ }
158
+ }
159
+ get value() {
160
+ return this._selectedString;
161
+ }
162
+ set value(value) {
163
+ if (value !== this._selectedString) {
164
+ this._selectedString = value;
165
+ this.searchFormControl.setValue(value);
166
+ this.valueChange.emit(value);
167
+ this._propagateChange(this._selectedString);
168
+ this.stateChanges.next();
169
+ }
170
+ }
171
+ get empty() {
172
+ let n = this.searchFormControl.value;
173
+ return !n;
174
+ }
175
+ get shouldLabelFloat() {
176
+ return this.focused || !this.empty;
177
+ }
178
+ ngOnInit() {
179
+ this.ngControl = this.injector.get(NgControl, null);
180
+ if (this.ngControl != null) {
181
+ this.ngControl.valueAccessor = this;
182
+ }
183
+ // If prefix defined, usually this is used for a code scanner.
184
+ // The goal is to select the entity in direct way.
185
+ if (this._prefix) {
186
+ this.searchFormControl
187
+ .valueChanges
188
+ .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.value = null), tap(() => this.isLoading = true), map(value => { var _a, _b; return (_b = (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onPreprocessSearchString(value)) !== null && _b !== void 0 ? _b : ""; }), switchMap(value => { var _a, _b; return (_b = (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onFilter(value)) !== null && _b !== void 0 ? _b : of(null); }))
189
+ .subscribe(resultSet => {
190
+ if (resultSet && resultSet.list) {
191
+ if (resultSet.list.length === 1) {
192
+ this.value = resultSet.list[0];
193
+ }
194
+ else {
195
+ this.filteredStrings = resultSet.list;
196
+ this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
197
+ }
198
+ }
199
+ this.isLoading = false;
200
+ });
201
+ }
202
+ // This is the search functionality when search by human.
203
+ this.searchFormControl
204
+ .valueChanges
205
+ .pipe(debounceTime(300), tap(_ => {
206
+ this.filteredStrings = [];
207
+ }), filter(value => value != null && value.toString().length >= 1), tap(() => this.isLoading = true), map(value => { var _a; return (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onPreprocessSearchString(value); }), tap(value => this.value = value), switchMap(value => { var _a, _b; return (_b = (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onFilter(value)) !== null && _b !== void 0 ? _b : of(null); }))
208
+ .subscribe(resultSet => {
209
+ if (resultSet && resultSet.list) {
210
+ this.filteredStrings = resultSet.list;
211
+ this.searchFormControl.patchValue(resultSet.searchTerm, { emitEvent: false });
212
+ }
213
+ this.isLoading = false;
214
+ });
215
+ }
216
+ ngOnDestroy() {
217
+ this.stateChanges.complete();
218
+ this.fm.stopMonitoring(this.elRef.nativeElement);
219
+ }
220
+ ngDoCheck() {
221
+ var _a;
222
+ if (this.ngControl) {
223
+ this.errorState = (_a = (this.ngControl.invalid && this.ngControl.touched)) !== null && _a !== void 0 ? _a : false;
224
+ this.stateChanges.next();
225
+ }
226
+ }
227
+ clear() {
228
+ this.filteredStrings = [];
229
+ this.searchFormControl.reset(null);
230
+ }
231
+ focus() {
232
+ this.elRef.nativeElement.querySelector('input').focus();
233
+ }
234
+ onOptionSelected(event) {
235
+ this.value = event.option.value;
236
+ this.filteredStrings = [];
237
+ }
238
+ onOptionActivated(event) {
239
+ var _a;
240
+ this.activatedValue = (_a = event.option) === null || _a === void 0 ? void 0 : _a.value;
241
+ }
242
+ onAutoCompleteClosed() {
243
+ if (this.activatedValue) {
244
+ this.value = this.activatedValue;
245
+ this.activatedValue = null;
246
+ }
247
+ }
248
+ reset() {
249
+ this.value = null;
250
+ }
251
+ onFocusOut() {
252
+ if (this.filteredStrings.length === 1) {
253
+ this.activatedValue = this.filteredStrings[0];
254
+ this.value = this.filteredStrings[0];
255
+ }
256
+ }
257
+ onTouched() {
258
+ this._onTouched();
259
+ this.stateChanges.next();
260
+ }
261
+ registerOnChange(fn) {
262
+ this._propagateChange = fn;
263
+ }
264
+ registerOnTouched(fn) {
265
+ this.onTouched = fn;
266
+ }
267
+ writeValue(obj) {
268
+ this.clear();
269
+ this.value = obj;
270
+ }
271
+ setDisabledState(isDisabled) {
272
+ this.disabled = isDisabled;
273
+ }
274
+ onContainerClick(event) {
275
+ if (event.target.tagName.toLowerCase() != 'input') {
276
+ this.focus();
277
+ }
278
+ }
279
+ setDescribedByIds(ids) {
280
+ this.describedBy = ids.join(' ');
281
+ }
282
+ validate(control) {
283
+ const selection = control.value;
284
+ if (typeof selection === 'string' && selection.length < 1) {
285
+ return { incorrect: true };
286
+ }
287
+ return null;
288
+ }
289
+ }
290
+ IaAutocompleteInput.nextId = 0;
291
+ 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 });
292
+ 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: [
293
+ {
294
+ provide: NG_VALUE_ACCESSOR,
295
+ useExisting: forwardRef(() => IaAutocompleteInput),
296
+ multi: true
297
+ },
298
+ {
299
+ provide: MatFormFieldControl,
300
+ useExisting: IaAutocompleteInput
301
+ },
302
+ {
303
+ provide: NG_VALIDATORS,
304
+ useExisting: forwardRef(() => IaAutocompleteInput),
305
+ multi: true
306
+ }
307
+ ], 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"] }] });
308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaAutocompleteInput, decorators: [{
309
+ type: Component,
310
+ args: [{ selector: 'ia-autocomplete', host: {
311
+ '[id]': 'id',
312
+ '[attr.aria-describedby]': 'describedBy'
313
+ }, providers: [
314
+ {
315
+ provide: NG_VALUE_ACCESSOR,
316
+ useExisting: forwardRef(() => IaAutocompleteInput),
317
+ multi: true
318
+ },
319
+ {
320
+ provide: MatFormFieldControl,
321
+ useExisting: IaAutocompleteInput
322
+ },
323
+ {
324
+ provide: NG_VALIDATORS,
325
+ useExisting: forwardRef(() => IaAutocompleteInput),
326
+ multi: true
327
+ }
328
+ ], 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"] }]
329
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
330
+ type: HostBinding
331
+ }], inputField: [{
332
+ type: ViewChild,
333
+ args: ['input']
334
+ }], describedBy: [{
335
+ type: HostBinding,
336
+ args: ['attr.aria-describedby']
337
+ }], dataSource: [{
338
+ type: Input
339
+ }], disabled: [{
340
+ type: Input
341
+ }], placeholder: [{
342
+ type: Input
343
+ }], required: [{
344
+ type: Input
345
+ }], prefix: [{
346
+ type: Input
347
+ }], shouldLabelFloat: [{
348
+ type: HostBinding,
349
+ args: ['class.floating']
335
350
  }] } });
336
351
 
337
- class IaEntitySelectInput {
338
- constructor(elRef, injector, fm) {
339
- this.elRef = elRef;
340
- this.injector = injector;
341
- this.fm = fm;
342
- this.filteredEntities = [];
343
- this.stateChanges = new Subject();
344
- this.id = `ia-entity-select-${IaEntitySelectInput.nextId++}`;
345
- this.valueChange = new EventEmitter();
346
- this.describedBy = '';
347
- this._disabled = false;
348
- this._required = false;
349
- this._propagateChange = (_) => {
350
- };
351
- this._onTouched = () => {
352
- };
353
- this.searchFormControl = new FormControl();
354
- this.isLoading = false;
355
- this._disabled = false;
356
- this.focused = false;
357
- fm.monitor(elRef.nativeElement, true).subscribe(origin => {
358
- this.focused = !!origin;
359
- this.stateChanges.next();
360
- });
361
- }
362
- get dataSource() {
363
- return this._dataSource;
364
- }
365
- set dataSource(value) {
366
- this._dataSource = value;
367
- }
368
- get disabled() {
369
- return this._disabled;
370
- }
371
- set disabled(dis) {
372
- this._disabled = coerceBooleanProperty(dis);
373
- this._disabled ? this.searchFormControl.disable() : this.searchFormControl.enable();
374
- this.stateChanges.next();
375
- }
376
- get placeholder() {
377
- return this._placeholder;
378
- }
379
- set placeholder(plh) {
380
- this._placeholder = plh;
381
- this.stateChanges.next();
382
- }
383
- get required() {
384
- return this._required;
385
- }
386
- set required(req) {
387
- this._required = coerceBooleanProperty(req);
388
- this.inputField.required = this._required;
389
- this.stateChanges.next();
390
- }
391
- get prefix() {
392
- return this._prefix;
393
- }
394
- set prefix(value) {
395
- if (value !== this._prefix) {
396
- this._prefix = value;
397
- }
398
- }
399
- get value() {
400
- return this._selectedEntity;
401
- }
402
- set value(value) {
403
- if (value !== this._selectedEntity) {
404
- this.searchFormControl.setValue(value);
405
- this.setValue(value);
406
- }
407
- }
408
- get empty() {
409
- let n = this.searchFormControl.value;
410
- return !!!n;
411
- }
412
- get shouldLabelFloat() {
413
- return this.focused || !this.empty;
414
- }
415
- ngOnInit() {
416
- this.ngControl = this.injector.get(NgControl, null);
417
- if (this.ngControl != null) {
418
- this.ngControl.valueAccessor = this;
419
- }
420
- // If prefix defined, usually this is used for a code scanner.
421
- // The goal is to select the entity in direct way.
422
- if (this._prefix) {
423
- this.searchFormControl
424
- .valueChanges
425
- .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())))
426
- .subscribe(resultSet => {
427
- if (resultSet.list.length === 1) {
428
- this.value = resultSet.list[0];
429
- }
430
- else {
431
- this.filteredEntities = resultSet.list;
432
- }
433
- this.isLoading = false;
434
- });
435
- }
436
- // This is the search functionality when search by human.
437
- this.searchFormControl
438
- .valueChanges
439
- .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)))
440
- .subscribe(resultSet => {
441
- this.filteredEntities = resultSet.list;
442
- this.isLoading = false;
443
- });
444
- }
445
- ngOnDestroy() {
446
- this.stateChanges.complete();
447
- this.fm.stopMonitoring(this.elRef.nativeElement);
448
- }
449
- ngDoCheck() {
450
- if (this.ngControl) {
451
- this.errorState = this.ngControl.invalid && this.ngControl.touched;
452
- this.stateChanges.next();
453
- }
454
- }
455
- clear() {
456
- this.filteredEntities = [];
457
- this.searchFormControl.reset(null);
458
- }
459
- focus() {
460
- this.elRef.nativeElement.querySelector('input').focus();
461
- }
462
- onEntitySelected(event) {
463
- this.value = event.option.value;
464
- this.filteredEntities = [];
465
- }
466
- onEntityActivated(event) {
467
- var _a;
468
- this.activatedValue = (_a = event.option) === null || _a === void 0 ? void 0 : _a.value;
469
- }
470
- onEntityClosed() {
471
- if (this.activatedValue) {
472
- this.value = this.activatedValue;
473
- this.activatedValue = null;
474
- }
475
- }
476
- reset() {
477
- this.value = null;
478
- }
479
- onFocusOut() {
480
- if (this.filteredEntities.length === 1) {
481
- this.activatedValue = this.filteredEntities[0];
482
- this.value = this.filteredEntities[0];
483
- }
484
- }
485
- onTouched() {
486
- this._onTouched();
487
- this.stateChanges.next();
488
- }
489
- registerOnChange(fn) {
490
- this._propagateChange = fn;
491
- }
492
- registerOnTouched(fn) {
493
- this.onTouched = fn;
494
- }
495
- writeValue(obj) {
496
- this.clear();
497
- this.value = obj;
498
- }
499
- setDisabledState(isDisabled) {
500
- this.disabled = isDisabled;
501
- }
502
- onContainerClick(event) {
503
- if (event.target.tagName.toLowerCase() != 'input') {
504
- this.focus();
505
- }
506
- }
507
- setDescribedByIds(ids) {
508
- this.describedBy = ids.join(' ');
509
- }
510
- validate(control) {
511
- const selection = control.value;
512
- if (typeof selection === 'string') {
513
- return { incorrect: true };
514
- }
515
- return null;
516
- }
517
- setValue(value) {
518
- if (value !== this._selectedEntity) {
519
- this._selectedEntity = value;
520
- this.valueChange.emit(value);
521
- this._propagateChange(this._selectedEntity);
522
- this.stateChanges.next();
523
- }
524
- }
525
- }
526
- IaEntitySelectInput.nextId = 0;
527
- IaEntitySelectInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaEntitySelectInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
528
- IaEntitySelectInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", 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: [
529
- {
530
- provide: NG_VALUE_ACCESSOR,
531
- useExisting: forwardRef(() => IaEntitySelectInput),
532
- multi: true
533
- },
534
- {
535
- provide: MatFormFieldControl,
536
- useExisting: IaEntitySelectInput
537
- },
538
- {
539
- provide: NG_VALIDATORS,
540
- useExisting: forwardRef(() => IaEntitySelectInput),
541
- multi: true
542
- }
543
- ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\r\n [placeholder]=\"placeholder\" matInput>\r\n<mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\r\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\r\n [displayWith]=\"dataSource.onDisplayEntity\">\r\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\r\n <mat-spinner diameter=\"50\"></mat-spinner>\r\n </mat-option>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\r\n {{dataSource.onDisplayEntity(entity)}}\r\n </mat-option>\r\n </ng-container>\r\n</mat-autocomplete>\r\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"] }] });
544
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaEntitySelectInput, decorators: [{
545
- type: Component,
546
- args: [{ selector: 'ia-entity-select', host: {
547
- '[id]': 'id',
548
- '[attr.aria-describedby]': 'describedBy'
549
- }, providers: [
550
- {
551
- provide: NG_VALUE_ACCESSOR,
552
- useExisting: forwardRef(() => IaEntitySelectInput),
553
- multi: true
554
- },
555
- {
556
- provide: MatFormFieldControl,
557
- useExisting: IaEntitySelectInput
558
- },
559
- {
560
- provide: NG_VALIDATORS,
561
- useExisting: forwardRef(() => IaEntitySelectInput),
562
- multi: true
563
- }
564
- ], template: "<input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\" [matAutocomplete]=\"auto\"\r\n [placeholder]=\"placeholder\" matInput>\r\n<mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\r\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\r\n [displayWith]=\"dataSource.onDisplayEntity\">\r\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\r\n <mat-spinner diameter=\"50\"></mat-spinner>\r\n </mat-option>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\r\n {{dataSource.onDisplayEntity(entity)}}\r\n </mat-option>\r\n </ng-container>\r\n</mat-autocomplete>\r\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}\n"] }]
565
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
566
- type: HostBinding
567
- }], inputField: [{
568
- type: ViewChild,
569
- args: ['input']
570
- }], describedBy: [{
571
- type: HostBinding,
572
- args: ['attr.aria-describedby']
573
- }], dataSource: [{
574
- type: Input
575
- }], disabled: [{
576
- type: Input
577
- }], placeholder: [{
578
- type: Input
579
- }], required: [{
580
- type: Input
581
- }], prefix: [{
582
- type: Input
583
- }], shouldLabelFloat: [{
584
- type: HostBinding,
585
- args: ['class.floating']
352
+ class IaEntitySelectInput {
353
+ constructor(elRef, injector, fm) {
354
+ this.elRef = elRef;
355
+ this.injector = injector;
356
+ this.fm = fm;
357
+ this.filteredEntities = [];
358
+ this.stateChanges = new Subject();
359
+ this.id = `ia-entity-select-${IaEntitySelectInput.nextId++}`;
360
+ this.valueChange = new EventEmitter();
361
+ this.describedBy = '';
362
+ this._disabled = false;
363
+ this._required = false;
364
+ this._propagateChange = (_) => {
365
+ };
366
+ this._onTouched = () => {
367
+ };
368
+ this.ngControl = null;
369
+ this.errorState = false;
370
+ this.inputField = null;
371
+ this._dataSource = null;
372
+ this._placeholder = "";
373
+ this._prefix = "";
374
+ this.searchFormControl = new FormControl();
375
+ this.isLoading = false;
376
+ this._disabled = false;
377
+ this.focused = false;
378
+ fm.monitor(elRef.nativeElement, true).subscribe(origin => {
379
+ this.focused = !!origin;
380
+ this.stateChanges.next();
381
+ });
382
+ }
383
+ get dataSource() {
384
+ return this._dataSource;
385
+ }
386
+ set dataSource(value) {
387
+ this._dataSource = value;
388
+ }
389
+ get disabled() {
390
+ return this._disabled;
391
+ }
392
+ set disabled(dis) {
393
+ this._disabled = coerceBooleanProperty(dis);
394
+ this._disabled ? this.searchFormControl.disable() : this.searchFormControl.enable();
395
+ this.stateChanges.next();
396
+ }
397
+ get placeholder() {
398
+ return this._placeholder;
399
+ }
400
+ set placeholder(plh) {
401
+ this._placeholder = plh;
402
+ this.stateChanges.next();
403
+ }
404
+ get required() {
405
+ return this._required;
406
+ }
407
+ set required(req) {
408
+ this._required = coerceBooleanProperty(req);
409
+ if (this.inputField) {
410
+ this.inputField.required = this._required;
411
+ }
412
+ this.stateChanges.next();
413
+ }
414
+ get prefix() {
415
+ return this._prefix;
416
+ }
417
+ set prefix(value) {
418
+ if (value !== this._prefix) {
419
+ this._prefix = value;
420
+ }
421
+ }
422
+ get value() {
423
+ return this._selectedEntity;
424
+ }
425
+ set value(value) {
426
+ if (value !== this._selectedEntity) {
427
+ this.searchFormControl.setValue(value);
428
+ this.setValue(value);
429
+ }
430
+ }
431
+ get empty() {
432
+ let n = this.searchFormControl.value;
433
+ return !n;
434
+ }
435
+ get shouldLabelFloat() {
436
+ return this.focused || !this.empty;
437
+ }
438
+ ngOnInit() {
439
+ this.ngControl = this.injector.get(NgControl, null);
440
+ if (this.ngControl != null) {
441
+ this.ngControl.valueAccessor = this;
442
+ }
443
+ // If prefix defined, usually this is used for a code scanner.
444
+ // The goal is to select the entity in direct way.
445
+ if (this._prefix) {
446
+ this.searchFormControl
447
+ .valueChanges
448
+ .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.value = null), tap(() => this.isLoading = true), switchMap(value => { var _a, _b; return (_b = (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onFilter(value.replace(this._prefix, "").trim())) !== null && _b !== void 0 ? _b : of(null); }))
449
+ .subscribe(resultSet => {
450
+ if (resultSet && resultSet.list) {
451
+ if (resultSet.list.length === 1) {
452
+ this.value = resultSet.list[0];
453
+ }
454
+ else {
455
+ this.filteredEntities = resultSet.list;
456
+ }
457
+ }
458
+ this.isLoading = false;
459
+ });
460
+ }
461
+ // This is the search functionality when search by human.
462
+ this.searchFormControl
463
+ .valueChanges
464
+ .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 => { var _a, _b; return (_b = (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onFilter(value)) !== null && _b !== void 0 ? _b : of(null); }))
465
+ .subscribe(resultSet => {
466
+ if (resultSet && resultSet.list) {
467
+ this.filteredEntities = resultSet.list;
468
+ }
469
+ this.isLoading = false;
470
+ });
471
+ }
472
+ ngOnDestroy() {
473
+ this.stateChanges.complete();
474
+ this.fm.stopMonitoring(this.elRef.nativeElement);
475
+ }
476
+ ngDoCheck() {
477
+ var _a;
478
+ if (this.ngControl) {
479
+ this.errorState = (_a = (this.ngControl.invalid && this.ngControl.touched)) !== null && _a !== void 0 ? _a : false;
480
+ this.stateChanges.next();
481
+ }
482
+ }
483
+ clear() {
484
+ this.filteredEntities = [];
485
+ this.searchFormControl.reset(null);
486
+ }
487
+ focus() {
488
+ this.elRef.nativeElement.querySelector('input').focus();
489
+ }
490
+ onEntitySelected(event) {
491
+ this.value = event.option.value;
492
+ this.filteredEntities = [];
493
+ }
494
+ onEntityActivated(event) {
495
+ var _a;
496
+ this.activatedValue = (_a = event.option) === null || _a === void 0 ? void 0 : _a.value;
497
+ }
498
+ onEntityClosed() {
499
+ if (this.activatedValue) {
500
+ this.value = this.activatedValue;
501
+ this.activatedValue = null;
502
+ }
503
+ }
504
+ reset() {
505
+ this.value = null;
506
+ }
507
+ onFocusOut() {
508
+ if (this.filteredEntities.length === 1) {
509
+ this.activatedValue = this.filteredEntities[0];
510
+ this.value = this.filteredEntities[0];
511
+ }
512
+ }
513
+ onTouched() {
514
+ this._onTouched();
515
+ this.stateChanges.next();
516
+ }
517
+ registerOnChange(fn) {
518
+ this._propagateChange = fn;
519
+ }
520
+ registerOnTouched(fn) {
521
+ this.onTouched = fn;
522
+ }
523
+ writeValue(obj) {
524
+ this.clear();
525
+ this.value = obj;
526
+ }
527
+ setDisabledState(isDisabled) {
528
+ this.disabled = isDisabled;
529
+ }
530
+ onContainerClick(event) {
531
+ if (event.target.tagName.toLowerCase() != 'input') {
532
+ this.focus();
533
+ }
534
+ }
535
+ setDescribedByIds(ids) {
536
+ this.describedBy = ids.join(' ');
537
+ }
538
+ validate(control) {
539
+ const selection = control.value;
540
+ if (typeof selection === 'string') {
541
+ return { incorrect: true };
542
+ }
543
+ return null;
544
+ }
545
+ setValue(value) {
546
+ if (value !== this._selectedEntity) {
547
+ this._selectedEntity = value;
548
+ this.valueChange.emit(value);
549
+ this._propagateChange(this._selectedEntity);
550
+ this.stateChanges.next();
551
+ }
552
+ }
553
+ }
554
+ IaEntitySelectInput.nextId = 0;
555
+ 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 });
556
+ 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: [
557
+ {
558
+ provide: NG_VALUE_ACCESSOR,
559
+ useExisting: forwardRef(() => IaEntitySelectInput),
560
+ multi: true
561
+ },
562
+ {
563
+ provide: MatFormFieldControl,
564
+ useExisting: IaEntitySelectInput
565
+ },
566
+ {
567
+ provide: NG_VALIDATORS,
568
+ useExisting: forwardRef(() => IaEntitySelectInput),
569
+ multi: true
570
+ }
571
+ ], 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"] }] });
572
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaEntitySelectInput, decorators: [{
573
+ type: Component,
574
+ args: [{ selector: 'ia-entity-select', host: {
575
+ '[id]': 'id',
576
+ '[attr.aria-describedby]': 'describedBy'
577
+ }, providers: [
578
+ {
579
+ provide: NG_VALUE_ACCESSOR,
580
+ useExisting: forwardRef(() => IaEntitySelectInput),
581
+ multi: true
582
+ },
583
+ {
584
+ provide: MatFormFieldControl,
585
+ useExisting: IaEntitySelectInput
586
+ },
587
+ {
588
+ provide: NG_VALIDATORS,
589
+ useExisting: forwardRef(() => IaEntitySelectInput),
590
+ multi: true
591
+ }
592
+ ], 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"] }]
593
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
594
+ type: HostBinding
595
+ }], inputField: [{
596
+ type: ViewChild,
597
+ args: ['input']
598
+ }], describedBy: [{
599
+ type: HostBinding,
600
+ args: ['attr.aria-describedby']
601
+ }], dataSource: [{
602
+ type: Input
603
+ }], disabled: [{
604
+ type: Input
605
+ }], placeholder: [{
606
+ type: Input
607
+ }], required: [{
608
+ type: Input
609
+ }], prefix: [{
610
+ type: Input
611
+ }], shouldLabelFloat: [{
612
+ type: HostBinding,
613
+ args: ['class.floating']
586
614
  }] } });
587
615
 
588
- class IaMultipleEntitySelectInput {
589
- constructor(elRef, injector, fm) {
590
- this.elRef = elRef;
591
- this.injector = injector;
592
- this.fm = fm;
593
- this.filteredEntities = [];
594
- this.stateChanges = new Subject();
595
- this.id = `ia-multiple-entity-select-${IaMultipleEntitySelectInput.nextId++}`;
596
- this.valuesChange = new EventEmitter();
597
- this.describedBy = '';
598
- this.separatorKeysCodes = [ENTER, COMMA];
599
- this._disabled = false;
600
- this._required = false;
601
- this._propagateChange = (_) => {
602
- };
603
- this._onTouched = () => {
604
- };
605
- this.valuesFormControl = new FormControl();
606
- this.searchFormControl = new FormControl();
607
- this.isLoading = false;
608
- this._disabled = false;
609
- this.focused = false;
610
- fm.monitor(elRef.nativeElement, true).subscribe(origin => {
611
- this.focused = !!origin;
612
- this.stateChanges.next();
613
- });
614
- }
615
- get dataSource() {
616
- return this._dataSource;
617
- }
618
- set dataSource(value) {
619
- this._dataSource = value;
620
- }
621
- get disabled() {
622
- return this._disabled;
623
- }
624
- set disabled(dis) {
625
- this._disabled = coerceBooleanProperty(dis);
626
- this._disabled ? this.searchFormControl.disable() : this.searchFormControl.enable();
627
- this.stateChanges.next();
628
- }
629
- get placeholder() {
630
- return this._placeholder;
631
- }
632
- set placeholder(plh) {
633
- this._placeholder = plh;
634
- this.stateChanges.next();
635
- }
636
- get required() {
637
- return this._required;
638
- }
639
- set required(req) {
640
- this._required = coerceBooleanProperty(req);
641
- this.inputField.required = this._required;
642
- this.stateChanges.next();
643
- }
644
- get prefix() {
645
- return this._prefix;
646
- }
647
- set prefix(value) {
648
- if (value !== this._prefix) {
649
- this._prefix = value;
650
- }
651
- }
652
- get value() {
653
- return this._selectedEntities;
654
- }
655
- set value(value) {
656
- if (value !== this._selectedEntities) {
657
- this.valuesFormControl.setValue(value);
658
- this.setValue(value);
659
- }
660
- }
661
- get empty() {
662
- let n = this.valuesFormControl.value;
663
- return !!!n;
664
- }
665
- get shouldLabelFloat() {
666
- return this.focused || !this.empty;
667
- }
668
- ngOnInit() {
669
- this.ngControl = this.injector.get(NgControl, null);
670
- if (this.ngControl != null) {
671
- this.ngControl.valueAccessor = this;
672
- }
673
- // If prefix defined, usually this is used for a code scanner.
674
- // The goal is to select the entity in direct way.
675
- if (this._prefix) {
676
- this.searchFormControl
677
- .valueChanges
678
- .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())))
679
- .subscribe(resultSet => {
680
- this.filteredEntities = resultSet.list;
681
- this.isLoading = false;
682
- });
683
- }
684
- // This is the search functionality when search by human.
685
- this.searchFormControl
686
- .valueChanges
687
- .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)))
688
- .subscribe(resultSet => {
689
- const resultList = new Array();
690
- resultSet.list.forEach(value1 => {
691
- if (!this.value.find(value2 => this._dataSource.getIdEntity(value2) === this._dataSource.getIdEntity(value1))) {
692
- resultList.push(value1);
693
- }
694
- });
695
- this.filteredEntities = resultList;
696
- this.isLoading = false;
697
- });
698
- }
699
- ngOnDestroy() {
700
- this.stateChanges.complete();
701
- this.fm.stopMonitoring(this.elRef.nativeElement);
702
- }
703
- ngDoCheck() {
704
- if (this.ngControl) {
705
- this.errorState = this.ngControl.invalid && this.ngControl.touched;
706
- this.stateChanges.next();
707
- }
708
- }
709
- clear() {
710
- this.filteredEntities = [];
711
- this.searchFormControl.reset(null);
712
- }
713
- focus() {
714
- this.elRef.nativeElement.querySelector('input').focus();
715
- }
716
- onEntitySelected(event) {
717
- let list = this.value;
718
- if (!list) {
719
- list = new Array();
720
- }
721
- list.push(event.option.value);
722
- this.value = list;
723
- this.filteredEntities = [];
724
- this.searchFormControl.setValue(null);
725
- this.valuesFormControl.updateValueAndValidity();
726
- }
727
- onEntityActivated(event) {
728
- var _a;
729
- this.activatedValue = (_a = event.option) === null || _a === void 0 ? void 0 : _a.value;
730
- }
731
- onEntityClosed() {
732
- if (this.activatedValue) {
733
- this.value = this.activatedValue;
734
- this.activatedValue = null;
735
- }
736
- }
737
- reset() {
738
- this.value = new Array();
739
- }
740
- onFocusOut() {
741
- // if (this.filteredEntities.length === 1) {
742
- // this.activatedValue = this.filteredEntities[0];
743
- // this.value = this.filteredEntities[0];
744
- // }
745
- }
746
- onTouched() {
747
- this._onTouched();
748
- this.stateChanges.next();
749
- }
750
- registerOnChange(fn) {
751
- this._propagateChange = fn;
752
- }
753
- registerOnTouched(fn) {
754
- this.onTouched = fn;
755
- }
756
- writeValue(obj) {
757
- this.clear();
758
- this.value = obj;
759
- }
760
- setDisabledState(isDisabled) {
761
- this.disabled = isDisabled;
762
- }
763
- onContainerClick(event) {
764
- if (event.target.tagName.toLowerCase() != 'input') {
765
- this.focus();
766
- }
767
- }
768
- setDescribedByIds(ids) {
769
- this.describedBy = ids.join(' ');
770
- }
771
- validate(control) {
772
- const selection = control.value;
773
- if (typeof selection === 'string') {
774
- return { incorrect: true };
775
- }
776
- return null;
777
- }
778
- remove(value) {
779
- const list = this.value;
780
- const index = list.indexOf(value);
781
- if (index !== -1) {
782
- list.splice(index, 1);
783
- }
784
- this.valuesFormControl.updateValueAndValidity();
785
- }
786
- setValue(values) {
787
- if (values !== this._selectedEntities) {
788
- this._selectedEntities = values;
789
- this.valuesChange.emit(values);
790
- this._propagateChange(this._selectedEntities);
791
- this.stateChanges.next();
792
- }
793
- }
794
- }
795
- IaMultipleEntitySelectInput.nextId = 0;
796
- IaMultipleEntitySelectInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaMultipleEntitySelectInput, deps: [{ token: i0.ElementRef }, { token: i0.Injector }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
797
- IaMultipleEntitySelectInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", 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: [
798
- {
799
- provide: NG_VALUE_ACCESSOR,
800
- useExisting: forwardRef(() => IaMultipleEntitySelectInput),
801
- multi: true
802
- },
803
- {
804
- provide: MatFormFieldControl,
805
- useExisting: IaMultipleEntitySelectInput
806
- },
807
- {
808
- provide: NG_VALIDATORS,
809
- useExisting: forwardRef(() => IaMultipleEntitySelectInput),
810
- multi: true
811
- }
812
- ], viewQueries: [{ propertyName: "inputField", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<mat-chip-grid #list>\r\n <mat-chip-row *ngFor=\"let entity of valuesFormControl.value\"\r\n (removed)=\"remove(entity)\"\r\n [editable]=\"false\"\r\n [aria-description]=\"'press enter to edit ' + dataSource.onDisplayEntity(entity)\">\r\n {{dataSource.onDisplayEntity(entity)}}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + dataSource.onDisplayEntity(entity)\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n <input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputFor]=\"list\"\r\n matChipInputAddOnBlur=\"true\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n [placeholder]=\"placeholder\" matInput>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\r\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\r\n [displayWith]=\"dataSource.onDisplayEntity\">\r\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\r\n <mat-spinner diameter=\"50\"></mat-spinner>\r\n </mat-option>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\r\n {{dataSource.onDisplayEntity(entity)}}\r\n </mat-option>\r\n </ng-container>\r\n </mat-autocomplete>\r\n</mat-chip-grid>\r\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"] }] });
813
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaMultipleEntitySelectInput, decorators: [{
814
- type: Component,
815
- args: [{ selector: 'ia-multiple-entity-select', host: {
816
- '[id]': 'id',
817
- '[attr.aria-describedby]': 'describedBy'
818
- }, providers: [
819
- {
820
- provide: NG_VALUE_ACCESSOR,
821
- useExisting: forwardRef(() => IaMultipleEntitySelectInput),
822
- multi: true
823
- },
824
- {
825
- provide: MatFormFieldControl,
826
- useExisting: IaMultipleEntitySelectInput
827
- },
828
- {
829
- provide: NG_VALIDATORS,
830
- useExisting: forwardRef(() => IaMultipleEntitySelectInput),
831
- multi: true
832
- }
833
- ], template: "<mat-chip-grid #list>\r\n <mat-chip-row *ngFor=\"let entity of valuesFormControl.value\"\r\n (removed)=\"remove(entity)\"\r\n [editable]=\"false\"\r\n [aria-description]=\"'press enter to edit ' + dataSource.onDisplayEntity(entity)\">\r\n {{dataSource.onDisplayEntity(entity)}}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + dataSource.onDisplayEntity(entity)\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n <input #input (blur)=\"onTouched()\" (focusout)=\"onFocusOut()\" [formControl]=\"searchFormControl\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputFor]=\"list\"\r\n matChipInputAddOnBlur=\"true\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n [placeholder]=\"placeholder\" matInput>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (closed)=\"onEntityClosed()\"\r\n (optionActivated)=\"onEntityActivated($event)\" (optionSelected)=\"onEntitySelected($event)\"\r\n [displayWith]=\"dataSource.onDisplayEntity\">\r\n <mat-option *ngIf=\"isLoading\" class=\"is-loading\">\r\n <mat-spinner diameter=\"50\"></mat-spinner>\r\n </mat-option>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <mat-option *ngFor=\"let entity of filteredEntities\" [value]=\"entity\">\r\n {{dataSource.onDisplayEntity(entity)}}\r\n </mat-option>\r\n </ng-container>\r\n </mat-autocomplete>\r\n</mat-chip-grid>\r\n" }]
834
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
835
- type: HostBinding
836
- }], inputField: [{
837
- type: ViewChild,
838
- args: ['input']
839
- }], describedBy: [{
840
- type: HostBinding,
841
- args: ['attr.aria-describedby']
842
- }], dataSource: [{
843
- type: Input
844
- }], disabled: [{
845
- type: Input
846
- }], placeholder: [{
847
- type: Input
848
- }], required: [{
849
- type: Input
850
- }], prefix: [{
851
- type: Input
852
- }], shouldLabelFloat: [{
853
- type: HostBinding,
854
- args: ['class.floating']
616
+ class IaMultipleEntitySelectInput {
617
+ constructor(elRef, injector, fm) {
618
+ this.elRef = elRef;
619
+ this.injector = injector;
620
+ this.fm = fm;
621
+ this.filteredEntities = [];
622
+ this.stateChanges = new Subject();
623
+ this.id = `ia-multiple-entity-select-${IaMultipleEntitySelectInput.nextId++}`;
624
+ this.valuesChange = new EventEmitter();
625
+ this.describedBy = '';
626
+ this.separatorKeysCodes = [ENTER, COMMA];
627
+ this._disabled = false;
628
+ this._required = false;
629
+ this._propagateChange = (_) => {
630
+ };
631
+ this._onTouched = () => {
632
+ };
633
+ this.ngControl = null;
634
+ this.errorState = false;
635
+ this.inputField = null;
636
+ this._dataSource = null;
637
+ this._placeholder = "";
638
+ this._prefix = "";
639
+ this._selectedEntities = null;
640
+ this.valuesFormControl = new FormControl();
641
+ this.searchFormControl = new FormControl();
642
+ this.isLoading = false;
643
+ this._disabled = false;
644
+ this.focused = false;
645
+ fm.monitor(elRef.nativeElement, true).subscribe(origin => {
646
+ this.focused = !!origin;
647
+ this.stateChanges.next();
648
+ });
649
+ }
650
+ get dataSource() {
651
+ return this._dataSource;
652
+ }
653
+ set dataSource(value) {
654
+ this._dataSource = value;
655
+ }
656
+ get disabled() {
657
+ return this._disabled;
658
+ }
659
+ set disabled(dis) {
660
+ this._disabled = coerceBooleanProperty(dis);
661
+ this._disabled ? this.searchFormControl.disable() : this.searchFormControl.enable();
662
+ this.stateChanges.next();
663
+ }
664
+ get placeholder() {
665
+ return this._placeholder;
666
+ }
667
+ set placeholder(plh) {
668
+ this._placeholder = plh;
669
+ this.stateChanges.next();
670
+ }
671
+ get required() {
672
+ return this._required;
673
+ }
674
+ set required(req) {
675
+ this._required = coerceBooleanProperty(req);
676
+ if (this.inputField) {
677
+ this.inputField.required = this._required;
678
+ }
679
+ this.stateChanges.next();
680
+ }
681
+ get prefix() {
682
+ return this._prefix;
683
+ }
684
+ set prefix(value) {
685
+ if (value !== this._prefix) {
686
+ this._prefix = value;
687
+ }
688
+ }
689
+ get value() {
690
+ return this._selectedEntities;
691
+ }
692
+ set value(value) {
693
+ if (value !== this._selectedEntities) {
694
+ this.valuesFormControl.setValue(value);
695
+ this.setValue(value);
696
+ }
697
+ }
698
+ get empty() {
699
+ let n = this.valuesFormControl.value;
700
+ return !n;
701
+ }
702
+ get shouldLabelFloat() {
703
+ return this.focused || !this.empty;
704
+ }
705
+ ngOnInit() {
706
+ this.ngControl = this.injector.get(NgControl, null);
707
+ if (this.ngControl != null) {
708
+ this.ngControl.valueAccessor = this;
709
+ }
710
+ // If prefix defined, usually this is used for a code scanner.
711
+ // The goal is to select the entity in direct way.
712
+ if (this._prefix) {
713
+ this.searchFormControl
714
+ .valueChanges
715
+ .pipe(debounceTime(300), filter(value => typeof value === 'string'), filter(value => value.startsWith(this._prefix)), tap(() => this.isLoading = true), switchMap(value => { var _a, _b; return (_b = (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onFilter(value.replace(this._prefix, "").trim())) !== null && _b !== void 0 ? _b : of(null); }))
716
+ .subscribe(resultSet => {
717
+ if (resultSet && resultSet.list) {
718
+ this.filteredEntities = resultSet.list;
719
+ }
720
+ this.isLoading = false;
721
+ });
722
+ }
723
+ // This is the search functionality when search by human.
724
+ this.searchFormControl
725
+ .valueChanges
726
+ .pipe(debounceTime(300), tap(() => this.filteredEntities = []), filter(value => typeof value === 'string'), filter(value => value.toString().length >= 3), tap(() => this.isLoading = true), switchMap(value => { var _a, _b; return (_b = (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.onFilter(value)) !== null && _b !== void 0 ? _b : of(null); }))
727
+ .subscribe(resultSet => {
728
+ const resultList = new Array();
729
+ if (resultSet && resultSet.list) {
730
+ resultSet.list.forEach(value1 => {
731
+ var _a;
732
+ if (!((_a = this.value) === null || _a === void 0 ? void 0 : _a.find(value2 => { var _a, _b; return ((_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.getIdEntity(value2)) === ((_b = this._dataSource) === null || _b === void 0 ? void 0 : _b.getIdEntity(value1)); }))) {
733
+ resultList.push(value1);
734
+ }
735
+ });
736
+ }
737
+ this.filteredEntities = resultList;
738
+ this.isLoading = false;
739
+ });
740
+ }
741
+ ngOnDestroy() {
742
+ this.stateChanges.complete();
743
+ this.fm.stopMonitoring(this.elRef.nativeElement);
744
+ }
745
+ ngDoCheck() {
746
+ var _a;
747
+ if (this.ngControl) {
748
+ this.errorState = (_a = (this.ngControl.invalid && this.ngControl.touched)) !== null && _a !== void 0 ? _a : false;
749
+ this.stateChanges.next();
750
+ }
751
+ }
752
+ clear() {
753
+ this.filteredEntities = [];
754
+ this.searchFormControl.reset(null);
755
+ }
756
+ focus() {
757
+ this.elRef.nativeElement.querySelector('input').focus();
758
+ }
759
+ onEntitySelected(event) {
760
+ let list = this.value;
761
+ if (!list) {
762
+ list = new Array();
763
+ }
764
+ list.push(event.option.value);
765
+ this.value = list;
766
+ this.filteredEntities = [];
767
+ this.searchFormControl.setValue(null);
768
+ this.valuesFormControl.updateValueAndValidity();
769
+ }
770
+ onEntityActivated(event) {
771
+ var _a;
772
+ this.activatedValue = (_a = event.option) === null || _a === void 0 ? void 0 : _a.value;
773
+ }
774
+ onEntityClosed() {
775
+ if (this.activatedValue) {
776
+ this.value = this.activatedValue;
777
+ this.activatedValue = null;
778
+ }
779
+ }
780
+ reset() {
781
+ this.value = new Array();
782
+ }
783
+ onFocusOut() {
784
+ // if (this.filteredEntities.length === 1) {
785
+ // this.activatedValue = this.filteredEntities[0];
786
+ // this.value = this.filteredEntities[0];
787
+ // }
788
+ }
789
+ onTouched() {
790
+ this._onTouched();
791
+ this.stateChanges.next();
792
+ }
793
+ registerOnChange(fn) {
794
+ this._propagateChange = fn;
795
+ }
796
+ registerOnTouched(fn) {
797
+ this.onTouched = fn;
798
+ }
799
+ writeValue(obj) {
800
+ this.clear();
801
+ this.value = obj;
802
+ }
803
+ setDisabledState(isDisabled) {
804
+ this.disabled = isDisabled;
805
+ }
806
+ onContainerClick(event) {
807
+ if (event.target.tagName.toLowerCase() != 'input') {
808
+ this.focus();
809
+ }
810
+ }
811
+ setDescribedByIds(ids) {
812
+ this.describedBy = ids.join(' ');
813
+ }
814
+ validate(control) {
815
+ const selection = control.value;
816
+ if (typeof selection === 'string') {
817
+ return { incorrect: true };
818
+ }
819
+ return null;
820
+ }
821
+ remove(value) {
822
+ const list = this.value;
823
+ if (list) {
824
+ const index = list.indexOf(value);
825
+ if (index !== -1) {
826
+ list.splice(index, 1);
827
+ }
828
+ this.valuesFormControl.updateValueAndValidity();
829
+ }
830
+ }
831
+ setValue(values) {
832
+ var _a;
833
+ if (values !== this._selectedEntities) {
834
+ this._selectedEntities = values;
835
+ this.valuesChange.emit(values !== null && values !== void 0 ? values : []);
836
+ this._propagateChange((_a = this._selectedEntities) !== null && _a !== void 0 ? _a : []);
837
+ this.stateChanges.next();
838
+ }
839
+ }
840
+ }
841
+ IaMultipleEntitySelectInput.nextId = 0;
842
+ 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 });
843
+ 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: [
844
+ {
845
+ provide: NG_VALUE_ACCESSOR,
846
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
847
+ multi: true
848
+ },
849
+ {
850
+ provide: MatFormFieldControl,
851
+ useExisting: IaMultipleEntitySelectInput
852
+ },
853
+ {
854
+ provide: NG_VALIDATORS,
855
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
856
+ multi: true
857
+ }
858
+ ], 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"] }] });
859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaMultipleEntitySelectInput, decorators: [{
860
+ type: Component,
861
+ args: [{ selector: 'ia-multiple-entity-select', host: {
862
+ '[id]': 'id',
863
+ '[attr.aria-describedby]': 'describedBy'
864
+ }, providers: [
865
+ {
866
+ provide: NG_VALUE_ACCESSOR,
867
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
868
+ multi: true
869
+ },
870
+ {
871
+ provide: MatFormFieldControl,
872
+ useExisting: IaMultipleEntitySelectInput
873
+ },
874
+ {
875
+ provide: NG_VALIDATORS,
876
+ useExisting: forwardRef(() => IaMultipleEntitySelectInput),
877
+ multi: true
878
+ }
879
+ ], 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" }]
880
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }, { type: i1$2.FocusMonitor }]; }, propDecorators: { id: [{
881
+ type: HostBinding
882
+ }], inputField: [{
883
+ type: ViewChild,
884
+ args: ['input']
885
+ }], describedBy: [{
886
+ type: HostBinding,
887
+ args: ['attr.aria-describedby']
888
+ }], dataSource: [{
889
+ type: Input
890
+ }], disabled: [{
891
+ type: Input
892
+ }], placeholder: [{
893
+ type: Input
894
+ }], required: [{
895
+ type: Input
896
+ }], prefix: [{
897
+ type: Input
898
+ }], shouldLabelFloat: [{
899
+ type: HostBinding,
900
+ args: ['class.floating']
855
901
  }] } });
856
902
 
857
- class IaSharedUIModule {
858
- }
859
- IaSharedUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaSharedUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
860
- IaSharedUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: IaSharedUIModule, declarations: [IaNotificationBarComponent,
861
- MessageDetailsComponent,
862
- IaAutocompleteInput,
863
- IaEntitySelectInput,
864
- IaMultipleEntitySelectInput], imports: [CommonModule,
865
- MatToolbarModule,
866
- MatButtonModule,
867
- MatSnackBarModule,
868
- MatDialogModule,
869
- MatAutocompleteModule,
870
- MatInputModule,
871
- MatProgressSpinnerModule,
872
- MatChipsModule,
873
- MatIconModule,
874
- ReactiveFormsModule], exports: [IaNotificationBarComponent,
875
- IaAutocompleteInput,
876
- IaEntitySelectInput,
877
- IaMultipleEntitySelectInput] });
878
- IaSharedUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaSharedUIModule, imports: [CommonModule,
879
- MatToolbarModule,
880
- MatButtonModule,
881
- MatSnackBarModule,
882
- MatDialogModule,
883
- MatAutocompleteModule,
884
- MatInputModule,
885
- MatProgressSpinnerModule,
886
- MatChipsModule,
887
- MatIconModule,
888
- ReactiveFormsModule] });
889
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: IaSharedUIModule, decorators: [{
890
- type: NgModule,
891
- args: [{
892
- declarations: [
893
- IaNotificationBarComponent,
894
- MessageDetailsComponent,
895
- IaAutocompleteInput,
896
- IaEntitySelectInput,
897
- IaMultipleEntitySelectInput
898
- ],
899
- exports: [
900
- IaNotificationBarComponent,
901
- IaAutocompleteInput,
902
- IaEntitySelectInput,
903
- IaMultipleEntitySelectInput
904
- ],
905
- entryComponents: [
906
- MessageDetailsComponent,
907
- IaAutocompleteInput,
908
- IaEntitySelectInput,
909
- IaMultipleEntitySelectInput
910
- ],
911
- imports: [
912
- CommonModule,
913
- MatToolbarModule,
914
- MatButtonModule,
915
- MatSnackBarModule,
916
- MatDialogModule,
917
- MatAutocompleteModule,
918
- MatInputModule,
919
- MatProgressSpinnerModule,
920
- MatChipsModule,
921
- MatIconModule,
922
- ReactiveFormsModule
923
- ]
924
- }]
903
+ class IaSharedUIModule {
904
+ }
905
+ IaSharedUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
906
+ IaSharedUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, declarations: [IaNotificationBarComponent,
907
+ MessageDetailsComponent,
908
+ IaAutocompleteInput,
909
+ IaEntitySelectInput,
910
+ IaMultipleEntitySelectInput], imports: [CommonModule,
911
+ MatToolbarModule,
912
+ MatButtonModule,
913
+ MatSnackBarModule,
914
+ MatDialogModule,
915
+ MatAutocompleteModule,
916
+ MatInputModule,
917
+ MatProgressSpinnerModule,
918
+ MatChipsModule,
919
+ MatIconModule,
920
+ ReactiveFormsModule], exports: [IaNotificationBarComponent,
921
+ IaAutocompleteInput,
922
+ IaEntitySelectInput,
923
+ IaMultipleEntitySelectInput] });
924
+ IaSharedUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, imports: [CommonModule,
925
+ MatToolbarModule,
926
+ MatButtonModule,
927
+ MatSnackBarModule,
928
+ MatDialogModule,
929
+ MatAutocompleteModule,
930
+ MatInputModule,
931
+ MatProgressSpinnerModule,
932
+ MatChipsModule,
933
+ MatIconModule,
934
+ ReactiveFormsModule] });
935
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: IaSharedUIModule, decorators: [{
936
+ type: NgModule,
937
+ args: [{
938
+ declarations: [
939
+ IaNotificationBarComponent,
940
+ MessageDetailsComponent,
941
+ IaAutocompleteInput,
942
+ IaEntitySelectInput,
943
+ IaMultipleEntitySelectInput
944
+ ],
945
+ exports: [
946
+ IaNotificationBarComponent,
947
+ IaAutocompleteInput,
948
+ IaEntitySelectInput,
949
+ IaMultipleEntitySelectInput
950
+ ],
951
+ entryComponents: [
952
+ MessageDetailsComponent,
953
+ IaAutocompleteInput,
954
+ IaEntitySelectInput,
955
+ IaMultipleEntitySelectInput
956
+ ],
957
+ imports: [
958
+ CommonModule,
959
+ MatToolbarModule,
960
+ MatButtonModule,
961
+ MatSnackBarModule,
962
+ MatDialogModule,
963
+ MatAutocompleteModule,
964
+ MatInputModule,
965
+ MatProgressSpinnerModule,
966
+ MatChipsModule,
967
+ MatIconModule,
968
+ ReactiveFormsModule
969
+ ]
970
+ }]
925
971
  }] });
926
972
 
927
- class ProgressWindowComponent {
928
- constructor(data) {
929
- this.data = data;
930
- this.statusText = null;
931
- data.progress.subscribe(value => {
932
- this.statusText = value.statusText;
933
- this.progressValue = value.progressValue;
934
- });
935
- }
936
- ngOnInit() {
937
- }
938
- onCancelClick() {
939
- this.data.cancelOperation();
940
- }
941
- }
942
- ProgressWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressWindowComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
943
- ProgressWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ProgressWindowComponent, selector: "lib-progress-window", ngImport: i0, template: "<h1 mat-dialog-title>{{data.title}}</h1>\r\n<div mat-dialog-content>\r\n <div fxLayout=\"column\">\r\n <mat-progress-bar *ngIf=\"data.isDeterminate\" [value]=\"progressValue\" mode=\"determinate\"></mat-progress-bar>\r\n <mat-progress-bar *ngIf=\"!data.isDeterminate\" mode=\"indeterminate\"></mat-progress-bar>\r\n <p>{{statusText}}</p>\r\n </div>\r\n</div>\r\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\r\n <button (click)=\"onCancelClick()\" *ngIf=\"data.isCancelOperationAvailable\" mat-button>Cancel</button>\r\n</div>\r\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"] }] });
944
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressWindowComponent, decorators: [{
945
- type: Component,
946
- args: [{ selector: 'lib-progress-window', template: "<h1 mat-dialog-title>{{data.title}}</h1>\r\n<div mat-dialog-content>\r\n <div fxLayout=\"column\">\r\n <mat-progress-bar *ngIf=\"data.isDeterminate\" [value]=\"progressValue\" mode=\"determinate\"></mat-progress-bar>\r\n <mat-progress-bar *ngIf=\"!data.isDeterminate\" mode=\"indeterminate\"></mat-progress-bar>\r\n <p>{{statusText}}</p>\r\n </div>\r\n</div>\r\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\r\n <button (click)=\"onCancelClick()\" *ngIf=\"data.isCancelOperationAvailable\" mat-button>Cancel</button>\r\n</div>\r\n" }]
947
- }], ctorParameters: function () {
948
- return [{ type: undefined, decorators: [{
949
- type: Inject,
950
- args: [MAT_DIALOG_DATA]
951
- }] }];
973
+ class ProgressWindowComponent {
974
+ constructor(data) {
975
+ this.data = data;
976
+ this.statusText = null;
977
+ this.progressValue = 0;
978
+ data.progress.subscribe(value => {
979
+ this.statusText = value.statusText;
980
+ this.progressValue = value.progressValue;
981
+ });
982
+ }
983
+ ngOnInit() {
984
+ }
985
+ onCancelClick() {
986
+ this.data.cancelOperation();
987
+ }
988
+ }
989
+ 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 });
990
+ 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"] }] });
991
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressWindowComponent, decorators: [{
992
+ type: Component,
993
+ 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" }]
994
+ }], ctorParameters: function () {
995
+ return [{ type: undefined, decorators: [{
996
+ type: Inject,
997
+ args: [MAT_DIALOG_DATA]
998
+ }] }];
952
999
  } });
953
1000
 
954
- class ProgressNotifierService {
955
- constructor(dialog) {
956
- this.dialog = dialog;
957
- this._currentProgressValue = new BehaviorSubject(null);
958
- this.isCanceled = false;
959
- }
960
- get isCanceled() {
961
- return this._isCanceled;
962
- }
963
- set isCanceled(value) {
964
- this._isCanceled = value;
965
- }
966
- start(title, isDeterminate, isCancelOperationAvailable) {
967
- this.isCanceled = false;
968
- this.reportProgressDeterminate(0, 100, "Working...");
969
- this.currentDialogRef = this.dialog.open(ProgressWindowComponent, {
970
- width: '50vw',
971
- maxWidth: '50vw',
972
- data: {
973
- title: title,
974
- isDeterminate: isDeterminate,
975
- progress: this._currentProgressValue.asObservable(),
976
- isCancelOperationAvailable: isCancelOperationAvailable,
977
- cancelOperation: () => {
978
- this.reportProgressIndeterminate("Canceling operation...");
979
- this.isCanceled = true;
980
- }
981
- }
982
- });
983
- }
984
- reportProgressDeterminate(progressCurrent, progressMax, statusText) {
985
- const progressPercentage = (progressMax / 100) * progressCurrent;
986
- this._currentProgressValue.next({
987
- statusText: statusText,
988
- progressValue: progressPercentage
989
- });
990
- }
991
- reportProgressIndeterminate(statusText) {
992
- this._currentProgressValue.next({
993
- statusText: statusText,
994
- progressValue: 0
995
- });
996
- }
997
- complete() {
998
- this.currentDialogRef.close();
999
- }
1000
- }
1001
- ProgressNotifierService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressNotifierService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
1002
- ProgressNotifierService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressNotifierService });
1003
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressNotifierService, decorators: [{
1004
- type: Injectable
1001
+ class ProgressNotifierService {
1002
+ constructor(dialog) {
1003
+ this.dialog = dialog;
1004
+ this._currentProgressValue = new BehaviorSubject(null);
1005
+ this.currentDialogRef = null;
1006
+ this._isCanceled = false;
1007
+ }
1008
+ get isCanceled() {
1009
+ return this._isCanceled;
1010
+ }
1011
+ set isCanceled(value) {
1012
+ this._isCanceled = value;
1013
+ }
1014
+ start(title, isDeterminate, isCancelOperationAvailable) {
1015
+ this.isCanceled = false;
1016
+ this.reportProgressDeterminate(0, 100, "Working...");
1017
+ this.currentDialogRef = this.dialog.open(ProgressWindowComponent, {
1018
+ width: '50vw',
1019
+ maxWidth: '50vw',
1020
+ data: {
1021
+ title: title,
1022
+ isDeterminate: isDeterminate,
1023
+ progress: this._currentProgressValue.asObservable(),
1024
+ isCancelOperationAvailable: isCancelOperationAvailable,
1025
+ cancelOperation: () => {
1026
+ this.reportProgressIndeterminate("Canceling operation...");
1027
+ this.isCanceled = true;
1028
+ }
1029
+ }
1030
+ });
1031
+ }
1032
+ reportProgressDeterminate(progressCurrent, progressMax, statusText) {
1033
+ const progressPercentage = (progressMax / 100) * progressCurrent;
1034
+ this._currentProgressValue.next({
1035
+ statusText: statusText,
1036
+ progressValue: progressPercentage
1037
+ });
1038
+ }
1039
+ reportProgressIndeterminate(statusText) {
1040
+ this._currentProgressValue.next({
1041
+ statusText: statusText,
1042
+ progressValue: 0
1043
+ });
1044
+ }
1045
+ complete() {
1046
+ var _a;
1047
+ (_a = this.currentDialogRef) === null || _a === void 0 ? void 0 : _a.close();
1048
+ }
1049
+ }
1050
+ ProgressNotifierService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
1051
+ ProgressNotifierService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierService });
1052
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierService, decorators: [{
1053
+ type: Injectable
1005
1054
  }], ctorParameters: function () { return [{ type: i1.MatDialog }]; } });
1006
1055
 
1007
- class ProgressNotifierModule {
1008
- static forRoot() {
1009
- return {
1010
- ngModule: ProgressNotifierModule,
1011
- providers: [
1012
- ProgressNotifierService
1013
- ]
1014
- };
1015
- }
1016
- }
1017
- ProgressNotifierModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressNotifierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1018
- ProgressNotifierModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: ProgressNotifierModule, declarations: [ProgressWindowComponent], imports: [CommonModule,
1019
- MatDialogModule,
1020
- FlexLayoutModule,
1021
- MatButtonModule,
1022
- MatProgressBarModule] });
1023
- ProgressNotifierModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressNotifierModule, imports: [CommonModule,
1024
- MatDialogModule,
1025
- FlexLayoutModule,
1026
- MatButtonModule,
1027
- MatProgressBarModule] });
1028
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ProgressNotifierModule, decorators: [{
1029
- type: NgModule,
1030
- args: [{
1031
- declarations: [ProgressWindowComponent],
1032
- imports: [
1033
- CommonModule,
1034
- MatDialogModule,
1035
- FlexLayoutModule,
1036
- MatButtonModule,
1037
- MatProgressBarModule
1038
- ]
1039
- }]
1056
+ class ProgressNotifierModule {
1057
+ static forRoot() {
1058
+ return {
1059
+ ngModule: ProgressNotifierModule,
1060
+ providers: [
1061
+ ProgressNotifierService
1062
+ ]
1063
+ };
1064
+ }
1065
+ }
1066
+ ProgressNotifierModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1067
+ ProgressNotifierModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, declarations: [ProgressWindowComponent], imports: [CommonModule,
1068
+ MatDialogModule,
1069
+ FlexLayoutModule,
1070
+ MatButtonModule,
1071
+ MatProgressBarModule] });
1072
+ ProgressNotifierModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, imports: [CommonModule,
1073
+ MatDialogModule,
1074
+ FlexLayoutModule,
1075
+ MatButtonModule,
1076
+ MatProgressBarModule] });
1077
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProgressNotifierModule, decorators: [{
1078
+ type: NgModule,
1079
+ args: [{
1080
+ declarations: [ProgressWindowComponent],
1081
+ imports: [
1082
+ CommonModule,
1083
+ MatDialogModule,
1084
+ FlexLayoutModule,
1085
+ MatButtonModule,
1086
+ MatProgressBarModule
1087
+ ]
1088
+ }]
1040
1089
  }] });
1041
1090
 
1042
- var ButtonTypes;
1043
- (function (ButtonTypes) {
1044
- ButtonTypes[ButtonTypes["Ok"] = 0] = "Ok";
1045
- ButtonTypes[ButtonTypes["Cancel"] = 1] = "Cancel";
1046
- ButtonTypes[ButtonTypes["Yes"] = 2] = "Yes";
1047
- ButtonTypes[ButtonTypes["No"] = 3] = "No";
1048
- })(ButtonTypes || (ButtonTypes = {}));
1049
- var DialogType;
1050
- (function (DialogType) {
1051
- DialogType[DialogType["YesNo"] = 0] = "YesNo";
1052
- DialogType[DialogType["YesNoCancel"] = 1] = "YesNoCancel";
1053
- DialogType[DialogType["OkCancel"] = 2] = "OkCancel";
1054
- DialogType[DialogType["Ok"] = 3] = "Ok";
1091
+ var ButtonTypes;
1092
+ (function (ButtonTypes) {
1093
+ ButtonTypes[ButtonTypes["Ok"] = 0] = "Ok";
1094
+ ButtonTypes[ButtonTypes["Cancel"] = 1] = "Cancel";
1095
+ ButtonTypes[ButtonTypes["Yes"] = 2] = "Yes";
1096
+ ButtonTypes[ButtonTypes["No"] = 3] = "No";
1097
+ })(ButtonTypes || (ButtonTypes = {}));
1098
+ var DialogType;
1099
+ (function (DialogType) {
1100
+ DialogType[DialogType["YesNo"] = 0] = "YesNo";
1101
+ DialogType[DialogType["YesNoCancel"] = 1] = "YesNoCancel";
1102
+ DialogType[DialogType["OkCancel"] = 2] = "OkCancel";
1103
+ DialogType[DialogType["Ok"] = 3] = "Ok";
1055
1104
  })(DialogType || (DialogType = {}));
1056
1105
 
1057
- class ConfirmationWindowComponent {
1058
- constructor(dialogRef, data) {
1059
- this.dialogRef = dialogRef;
1060
- this.data = data;
1061
- if (data.dialogType === DialogType.OkCancel) {
1062
- this.button1Text = "OK";
1063
- this.button1Result = ButtonTypes.Ok;
1064
- this.button2Text = "Cancel";
1065
- this.button2Result = ButtonTypes.Cancel;
1066
- }
1067
- else if (data.dialogType === DialogType.YesNoCancel) {
1068
- this.button1Text = "Yes";
1069
- this.button1Result = ButtonTypes.Yes;
1070
- this.button2Text = "No";
1071
- this.button2Result = ButtonTypes.No;
1072
- this.button3Text = "Cancel";
1073
- this.button3Result = ButtonTypes.Cancel;
1074
- }
1075
- else if (data.dialogType === DialogType.Ok) {
1076
- this.button1Text = "OK";
1077
- this.button1Result = ButtonTypes.Ok;
1078
- }
1079
- else {
1080
- this.button1Text = "Yes";
1081
- this.button1Result = ButtonTypes.Yes;
1082
- this.button2Text = "No";
1083
- this.button2Result = ButtonTypes.No;
1084
- }
1085
- }
1086
- ngOnInit() {
1087
- }
1088
- onButton1() {
1089
- this.dialogRef.close({
1090
- result: this.button1Result
1091
- });
1092
- }
1093
- onButton2() {
1094
- this.dialogRef.close({
1095
- result: this.button2Result
1096
- });
1097
- }
1098
- onButton3() {
1099
- this.dialogRef.close({
1100
- result: this.button3Result
1101
- });
1102
- }
1103
- }
1104
- ConfirmationWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationWindowComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1105
- ConfirmationWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ConfirmationWindowComponent, selector: "lib-shared-ui-confirmation-window", ngImport: i0, template: "<h1 mat-dialog-title>{{data.title}}</h1>\r\n<div mat-dialog-content>{{data.message}}</div>\r\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\r\n <button (click)=\"onButton1()\" color=\"primary\" mat-button>{{button1Text}}</button>\r\n <button (click)=\"onButton2()\" *ngIf=\"button2Text\" mat-button>{{button2Text}}</button>\r\n <button (click)=\"onButton3()\" *ngIf=\"button3Text\" mat-button>{{button3Text}}</button>\r\n</div>\r\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"] }] });
1106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationWindowComponent, decorators: [{
1107
- type: Component,
1108
- args: [{ selector: 'lib-shared-ui-confirmation-window', template: "<h1 mat-dialog-title>{{data.title}}</h1>\r\n<div mat-dialog-content>{{data.message}}</div>\r\n<div fxLayoutAlign=\"end\" mat-dialog-actions>\r\n <button (click)=\"onButton1()\" color=\"primary\" mat-button>{{button1Text}}</button>\r\n <button (click)=\"onButton2()\" *ngIf=\"button2Text\" mat-button>{{button2Text}}</button>\r\n <button (click)=\"onButton3()\" *ngIf=\"button3Text\" mat-button>{{button3Text}}</button>\r\n</div>\r\n" }]
1109
- }], ctorParameters: function () {
1110
- return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
1111
- type: Inject,
1112
- args: [MAT_DIALOG_DATA]
1113
- }] }];
1106
+ class ConfirmationWindowComponent {
1107
+ constructor(dialogRef, data) {
1108
+ this.dialogRef = dialogRef;
1109
+ this.data = data;
1110
+ this.button2Text = null;
1111
+ this.button2Result = null;
1112
+ this.button3Text = null;
1113
+ this.button3Result = null;
1114
+ if (data.dialogType === DialogType.OkCancel) {
1115
+ this.button1Text = "OK";
1116
+ this.button1Result = ButtonTypes.Ok;
1117
+ this.button2Text = "Cancel";
1118
+ this.button2Result = ButtonTypes.Cancel;
1119
+ }
1120
+ else if (data.dialogType === DialogType.YesNoCancel) {
1121
+ this.button1Text = "Yes";
1122
+ this.button1Result = ButtonTypes.Yes;
1123
+ this.button2Text = "No";
1124
+ this.button2Result = ButtonTypes.No;
1125
+ this.button3Text = "Cancel";
1126
+ this.button3Result = ButtonTypes.Cancel;
1127
+ }
1128
+ else if (data.dialogType === DialogType.Ok) {
1129
+ this.button1Text = "OK";
1130
+ this.button1Result = ButtonTypes.Ok;
1131
+ }
1132
+ else {
1133
+ this.button1Text = "Yes";
1134
+ this.button1Result = ButtonTypes.Yes;
1135
+ this.button2Text = "No";
1136
+ this.button2Result = ButtonTypes.No;
1137
+ }
1138
+ }
1139
+ ngOnInit() {
1140
+ }
1141
+ onButton1() {
1142
+ this.dialogRef.close({
1143
+ result: this.button1Result
1144
+ });
1145
+ }
1146
+ onButton2() {
1147
+ this.dialogRef.close({
1148
+ result: this.button2Result
1149
+ });
1150
+ }
1151
+ onButton3() {
1152
+ this.dialogRef.close({
1153
+ result: this.button3Result
1154
+ });
1155
+ }
1156
+ }
1157
+ 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 });
1158
+ 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"] }] });
1159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationWindowComponent, decorators: [{
1160
+ type: Component,
1161
+ 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" }]
1162
+ }], ctorParameters: function () {
1163
+ return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
1164
+ type: Inject,
1165
+ args: [MAT_DIALOG_DATA]
1166
+ }] }];
1114
1167
  } });
1115
1168
 
1116
- class ConfirmationService {
1117
- constructor(dialog) {
1118
- this.dialog = dialog;
1119
- }
1120
- showYesNoConfirmationDialog(title, message) {
1121
- const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1122
- width: '50vw',
1123
- maxWidth: '50vw',
1124
- data: {
1125
- title: title,
1126
- message: message,
1127
- dialogType: DialogType.YesNo
1128
- }
1129
- });
1130
- return dialogRef.afterClosed().pipe(map(value => value.result == ButtonTypes.Yes));
1131
- }
1132
- showYesNoCancelConfirmationDialog(title, message) {
1133
- const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1134
- width: '50vw',
1135
- maxWidth: '50vw',
1136
- data: {
1137
- title: title,
1138
- message: message,
1139
- dialogType: DialogType.YesNoCancel
1140
- }
1141
- });
1142
- return dialogRef.afterClosed();
1143
- }
1144
- showOkCancelConfirmationDialog(title, message) {
1145
- const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1146
- width: '50vw',
1147
- maxWidth: '50vw',
1148
- data: {
1149
- title: title,
1150
- message: message,
1151
- dialogType: DialogType.OkCancel
1152
- }
1153
- });
1154
- return dialogRef.afterClosed().pipe(map(value => value.result == ButtonTypes.Ok));
1155
- }
1156
- showOkDialog(title, message) {
1157
- const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1158
- width: '50vw',
1159
- maxWidth: '50vw',
1160
- data: {
1161
- title: title,
1162
- message: message,
1163
- dialogType: DialogType.Ok
1164
- }
1165
- });
1166
- return dialogRef.afterClosed().pipe(map(value => value.result == ButtonTypes.Ok));
1167
- }
1168
- }
1169
- ConfirmationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
1170
- ConfirmationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationService, providedIn: 'root' });
1171
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationService, decorators: [{
1172
- type: Injectable,
1173
- args: [{
1174
- providedIn: 'root'
1175
- }]
1169
+ class ConfirmationService {
1170
+ constructor(dialog) {
1171
+ this.dialog = dialog;
1172
+ }
1173
+ showYesNoConfirmationDialog(title, message) {
1174
+ const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1175
+ width: '50vw',
1176
+ maxWidth: '50vw',
1177
+ data: {
1178
+ title: title,
1179
+ message: message,
1180
+ dialogType: DialogType.YesNo
1181
+ }
1182
+ });
1183
+ return dialogRef.afterClosed().pipe(map(value => (value === null || value === void 0 ? void 0 : value.result) == ButtonTypes.Yes));
1184
+ }
1185
+ showYesNoCancelConfirmationDialog(title, message) {
1186
+ const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1187
+ width: '50vw',
1188
+ maxWidth: '50vw',
1189
+ data: {
1190
+ title: title,
1191
+ message: message,
1192
+ dialogType: DialogType.YesNoCancel
1193
+ }
1194
+ });
1195
+ return dialogRef.afterClosed();
1196
+ }
1197
+ showOkCancelConfirmationDialog(title, message) {
1198
+ const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1199
+ width: '50vw',
1200
+ maxWidth: '50vw',
1201
+ data: {
1202
+ title: title,
1203
+ message: message,
1204
+ dialogType: DialogType.OkCancel
1205
+ }
1206
+ });
1207
+ return dialogRef.afterClosed().pipe(map(value => (value === null || value === void 0 ? void 0 : value.result) == ButtonTypes.Ok));
1208
+ }
1209
+ showOkDialog(title, message) {
1210
+ const dialogRef = this.dialog.open(ConfirmationWindowComponent, {
1211
+ width: '50vw',
1212
+ maxWidth: '50vw',
1213
+ data: {
1214
+ title: title,
1215
+ message: message,
1216
+ dialogType: DialogType.Ok
1217
+ }
1218
+ });
1219
+ return dialogRef.afterClosed().pipe(map(value => (value === null || value === void 0 ? void 0 : value.result) == ButtonTypes.Ok));
1220
+ }
1221
+ }
1222
+ ConfirmationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
1223
+ ConfirmationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationService, providedIn: 'root' });
1224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationService, decorators: [{
1225
+ type: Injectable,
1226
+ args: [{
1227
+ providedIn: 'root'
1228
+ }]
1176
1229
  }], ctorParameters: function () { return [{ type: i1.MatDialog }]; } });
1177
1230
 
1178
- class ConfirmationDialogModule {
1179
- static forRoot() {
1180
- return {
1181
- ngModule: ConfirmationDialogModule,
1182
- providers: [
1183
- ConfirmationService
1184
- ]
1185
- };
1186
- }
1187
- }
1188
- ConfirmationDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1189
- ConfirmationDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationDialogModule, declarations: [ConfirmationWindowComponent], imports: [CommonModule,
1190
- MatDialogModule,
1191
- FlexLayoutModule,
1192
- MatButtonModule] });
1193
- ConfirmationDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationDialogModule, imports: [CommonModule,
1194
- MatDialogModule,
1195
- FlexLayoutModule,
1196
- MatButtonModule] });
1197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConfirmationDialogModule, decorators: [{
1198
- type: NgModule,
1199
- args: [{
1200
- declarations: [ConfirmationWindowComponent],
1201
- imports: [
1202
- CommonModule,
1203
- MatDialogModule,
1204
- FlexLayoutModule,
1205
- MatButtonModule,
1206
- ]
1207
- }]
1231
+ class ConfirmationDialogModule {
1232
+ static forRoot() {
1233
+ return {
1234
+ ngModule: ConfirmationDialogModule,
1235
+ providers: [
1236
+ ConfirmationService
1237
+ ]
1238
+ };
1239
+ }
1240
+ }
1241
+ ConfirmationDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1242
+ ConfirmationDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, declarations: [ConfirmationWindowComponent], imports: [CommonModule,
1243
+ MatDialogModule,
1244
+ FlexLayoutModule,
1245
+ MatButtonModule] });
1246
+ ConfirmationDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, imports: [CommonModule,
1247
+ MatDialogModule,
1248
+ FlexLayoutModule,
1249
+ MatButtonModule] });
1250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfirmationDialogModule, decorators: [{
1251
+ type: NgModule,
1252
+ args: [{
1253
+ declarations: [ConfirmationWindowComponent],
1254
+ imports: [
1255
+ CommonModule,
1256
+ MatDialogModule,
1257
+ FlexLayoutModule,
1258
+ MatButtonModule,
1259
+ ]
1260
+ }]
1208
1261
  }] });
1209
1262
 
1210
- function isEmptyInputValue(value) {
1211
- // we don't check for string here so it also works with arrays
1212
- return value == null || value.length === 0;
1213
- }
1214
- class CommonValidators {
1215
- static phoneNumber() {
1216
- return Validators.pattern('^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$');
1217
- }
1218
- static httpUri() {
1219
- return Validators.pattern("^(http:\\/\\/|https:\\/\\/)([a-zA-Z0-9-_]+\\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+(\\.[a-zA-Z]{2,11}?)*(:[0-9]{2,5}){0,1}\\/{0,1}$");
1220
- }
1221
- static conditionalRequired(sourceControlName, sourceValueCompareExpression) {
1222
- return (control) => {
1223
- if (control.parent && sourceValueCompareExpression(control.parent.get(sourceControlName).value)) {
1224
- return isEmptyInputValue(control.value) ? { 'required': true } : null;
1225
- }
1226
- };
1227
- }
1228
- static dependentControls(controlNames) {
1229
- return (control) => {
1230
- controlNames.forEach(controlName => {
1231
- var _a;
1232
- (_a = control.parent) === null || _a === void 0 ? void 0 : _a.get(controlName).updateValueAndValidity();
1233
- });
1234
- return null;
1235
- };
1236
- }
1263
+ function isEmptyInputValue(value) {
1264
+ // we don't check for string here so it also works with arrays
1265
+ return value == null || value.length === 0;
1266
+ }
1267
+ class CommonValidators {
1268
+ static phoneNumber() {
1269
+ return Validators.pattern('^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$');
1270
+ }
1271
+ static httpUri() {
1272
+ return Validators.pattern("^(http:\\/\\/|https:\\/\\/)([a-zA-Z0-9-_]+\\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+(\\.[a-zA-Z]{2,11}?)*(:[0-9]{2,5}){0,1}\\/{0,1}$");
1273
+ }
1274
+ static conditionalRequired(sourceControlName, sourceValueCompareExpression) {
1275
+ return (control) => {
1276
+ var _a;
1277
+ if (control.parent && sourceValueCompareExpression((_a = control.parent.get(sourceControlName)) === null || _a === void 0 ? void 0 : _a.value)) {
1278
+ return isEmptyInputValue(control.value) ? { 'required': true } : null;
1279
+ }
1280
+ return null;
1281
+ };
1282
+ }
1283
+ static dependentControls(controlNames) {
1284
+ return (control) => {
1285
+ controlNames.forEach(controlName => {
1286
+ var _a, _b;
1287
+ (_b = (_a = control.parent) === null || _a === void 0 ? void 0 : _a.get(controlName)) === null || _b === void 0 ? void 0 : _b.updateValueAndValidity();
1288
+ });
1289
+ return null;
1290
+ };
1291
+ }
1237
1292
  }
1238
1293
 
1239
- class AbstractDetailsComponent {
1240
- constructor() {
1241
- this.hasError = (controlName, errorName) => {
1242
- return this.ownerForm.controls[controlName].hasError(errorName);
1243
- };
1244
- this.hasFormError = (errorName) => {
1245
- return this.ownerForm.hasError(errorName);
1246
- };
1247
- this.loading = true;
1248
- this.entity = null;
1249
- }
1250
- get ownerForm() {
1251
- return this._ownerForm;
1252
- }
1253
- get isLoaded() {
1254
- return this.entity !== null;
1255
- }
1256
- updateDateTime(controlName) {
1257
- this.ownerForm.get(controlName).setValue(IsoDateTime.utcToLocalDateTimeIso(IsoDateTime.currentUtcDateTimeIso()));
1258
- }
1259
- copyInputMessage(inputElement) {
1260
- inputElement.select();
1261
- document.execCommand('copy');
1262
- inputElement.setSelectionRange(0, 0);
1263
- }
1264
- onProgressStarting() {
1265
- this.loading = true;
1266
- this.ownerForm.disable();
1267
- this.ownerForm.updateValueAndValidity();
1268
- }
1269
- onProgressCompleted() {
1270
- this.ownerForm.enable();
1271
- this.loading = false;
1272
- }
1294
+ class AbstractDetailsComponent {
1295
+ constructor() {
1296
+ this.hasError = (controlName, errorName) => {
1297
+ var _a;
1298
+ return (_a = this.ownerForm) === null || _a === void 0 ? void 0 : _a.controls[controlName].hasError(errorName);
1299
+ };
1300
+ this.hasFormError = (errorName) => {
1301
+ var _a;
1302
+ return (_a = this.ownerForm) === null || _a === void 0 ? void 0 : _a.hasError(errorName);
1303
+ };
1304
+ this.loading = true;
1305
+ this.entity = null;
1306
+ this._ownerForm = null;
1307
+ }
1308
+ get ownerForm() {
1309
+ return this._ownerForm;
1310
+ }
1311
+ get isLoaded() {
1312
+ return this.entity !== null;
1313
+ }
1314
+ updateDateTime(controlName) {
1315
+ var _a, _b;
1316
+ (_b = (_a = this.ownerForm) === null || _a === void 0 ? void 0 : _a.get(controlName)) === null || _b === void 0 ? void 0 : _b.setValue(IsoDateTime.utcToLocalDateTimeIso(IsoDateTime.currentUtcDateTimeIso()));
1317
+ }
1318
+ copyInputMessage(inputElement) {
1319
+ inputElement.select();
1320
+ document.execCommand('copy');
1321
+ inputElement.setSelectionRange(0, 0);
1322
+ }
1323
+ onProgressStarting() {
1324
+ var _a, _b;
1325
+ this.loading = true;
1326
+ (_a = this.ownerForm) === null || _a === void 0 ? void 0 : _a.disable();
1327
+ (_b = this.ownerForm) === null || _b === void 0 ? void 0 : _b.updateValueAndValidity();
1328
+ }
1329
+ onProgressCompleted() {
1330
+ var _a;
1331
+ (_a = this.ownerForm) === null || _a === void 0 ? void 0 : _a.enable();
1332
+ this.loading = false;
1333
+ }
1273
1334
  }
1274
1335
 
1275
- /*
1276
- * Public API Surface of shared-ui
1336
+ /*
1337
+ * Public API Surface of shared-ui
1277
1338
  */
1278
1339
 
1279
- /**
1280
- * Generated bundle index. Do not edit.
1340
+ /**
1341
+ * Generated bundle index. Do not edit.
1281
1342
  */
1282
1343
 
1283
1344
  export { AbstractDetailsComponent, ButtonTypes, CommonValidators, ConfirmationDialogModule, ConfirmationService, DialogType, IaAutocompleteInput, IaEntitySelectInput, IaMultipleEntitySelectInput, IaNotificationBarComponent, IaSharedUIModule, ProgressNotifierModule, ProgressNotifierService };