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