@meshmakers/shared-ui-legacy 3.5.790 → 3.5.800
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.
|
@@ -1,84 +1,95 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import {
|
|
5
|
-
import { firstValueFrom } from
|
|
6
|
-
import * as i2 from
|
|
7
|
-
import { MatButtonModule } from
|
|
8
|
-
import { IsoDateTime } from
|
|
9
|
-
import { Validators } from
|
|
10
|
-
import * as i3 from
|
|
11
|
-
import { MatProgressBarModule } from
|
|
12
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injectable, NgModule, inject } from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/material/dialog";
|
|
4
|
+
import { MAT_DIALOG_DATA, MatDialog, MatDialogModule, MatDialogRef } from "@angular/material/dialog";
|
|
5
|
+
import { firstValueFrom } from "rxjs";
|
|
6
|
+
import * as i2 from "@angular/material/button";
|
|
7
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
8
|
+
import { IsoDateTime } from "@meshmakers/shared-services";
|
|
9
|
+
import { Validators } from "@angular/forms";
|
|
10
|
+
import * as i3 from "@angular/material/progress-bar";
|
|
11
|
+
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
|
13
12
|
var ButtonTypes;
|
|
14
|
-
(function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
(function(ButtonTypes) {
|
|
14
|
+
ButtonTypes[ButtonTypes["Ok"] = 0] = "Ok";
|
|
15
|
+
ButtonTypes[ButtonTypes["Cancel"] = 1] = "Cancel";
|
|
16
|
+
ButtonTypes[ButtonTypes["Yes"] = 2] = "Yes";
|
|
17
|
+
ButtonTypes[ButtonTypes["No"] = 3] = "No";
|
|
19
18
|
})(ButtonTypes || (ButtonTypes = {}));
|
|
20
19
|
var DialogType;
|
|
21
|
-
(function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
(function(DialogType) {
|
|
21
|
+
DialogType[DialogType["YesNo"] = 0] = "YesNo";
|
|
22
|
+
DialogType[DialogType["YesNoCancel"] = 1] = "YesNoCancel";
|
|
23
|
+
DialogType[DialogType["OkCancel"] = 2] = "OkCancel";
|
|
24
|
+
DialogType[DialogType["Ok"] = 3] = "Ok";
|
|
26
25
|
})(DialogType || (DialogType = {}));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
26
|
+
var ConfirmationWindowResult = class {
|
|
27
|
+
result;
|
|
28
|
+
constructor(result) {
|
|
29
|
+
this.result = result;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var ConfirmationDialogComponent = class ConfirmationDialogComponent {
|
|
33
|
+
dialogRef = inject(MatDialogRef);
|
|
34
|
+
data = inject(MAT_DIALOG_DATA);
|
|
35
|
+
button1Text = "OK";
|
|
36
|
+
button2Text = null;
|
|
37
|
+
button3Text = null;
|
|
38
|
+
button1Result = ButtonTypes.Ok;
|
|
39
|
+
button2Result = null;
|
|
40
|
+
button3Result = null;
|
|
41
|
+
ngOnInit() {
|
|
42
|
+
switch (this.data.dialogType) {
|
|
43
|
+
case DialogType.OkCancel:
|
|
44
|
+
this.button1Text = "OK";
|
|
45
|
+
this.button1Result = ButtonTypes.Ok;
|
|
46
|
+
this.button2Text = "Cancel";
|
|
47
|
+
this.button2Result = ButtonTypes.Cancel;
|
|
48
|
+
break;
|
|
49
|
+
case DialogType.YesNoCancel:
|
|
50
|
+
this.button1Text = "Yes";
|
|
51
|
+
this.button1Result = ButtonTypes.Yes;
|
|
52
|
+
this.button2Text = "No";
|
|
53
|
+
this.button2Result = ButtonTypes.No;
|
|
54
|
+
this.button3Text = "Cancel";
|
|
55
|
+
this.button3Result = ButtonTypes.Cancel;
|
|
56
|
+
break;
|
|
57
|
+
case DialogType.Ok:
|
|
58
|
+
this.button1Text = "OK";
|
|
59
|
+
this.button1Result = ButtonTypes.Ok;
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
this.button1Text = "Yes";
|
|
63
|
+
this.button1Result = ButtonTypes.Yes;
|
|
64
|
+
this.button2Text = "No";
|
|
65
|
+
this.button2Result = ButtonTypes.No;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
onButton1() {
|
|
69
|
+
this.dialogRef.close(new ConfirmationWindowResult(this.button1Result));
|
|
70
|
+
}
|
|
71
|
+
onButton2() {
|
|
72
|
+
this.dialogRef.close(new ConfirmationWindowResult(this.button2Result));
|
|
73
|
+
}
|
|
74
|
+
onButton3() {
|
|
75
|
+
this.dialogRef.close(new ConfirmationWindowResult(this.button3Result));
|
|
76
|
+
}
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
78
|
+
minVersion: "12.0.0",
|
|
79
|
+
version: "22.3.0",
|
|
80
|
+
ngImport: i0,
|
|
81
|
+
type: ConfirmationDialogComponent,
|
|
82
|
+
deps: [],
|
|
83
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
84
|
+
});
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
86
|
+
minVersion: "17.0.0",
|
|
87
|
+
version: "22.3.0",
|
|
88
|
+
type: ConfirmationDialogComponent,
|
|
89
|
+
isStandalone: true,
|
|
90
|
+
selector: "mm-confirmation-dialog",
|
|
91
|
+
ngImport: i0,
|
|
92
|
+
template: `
|
|
82
93
|
<h2 mat-dialog-title>{{ data.title }}</h2>
|
|
83
94
|
<mat-dialog-content>{{ data.message }}</mat-dialog-content>
|
|
84
95
|
<mat-dialog-actions align="end">
|
|
@@ -90,16 +101,59 @@ class ConfirmationDialogComponent {
|
|
|
90
101
|
<button mat-stroked-button (click)="onButton3()">{{ button3Text }}</button>
|
|
91
102
|
}
|
|
92
103
|
</mat-dialog-actions>
|
|
93
|
-
`,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
`,
|
|
105
|
+
isInline: true,
|
|
106
|
+
dependencies: [
|
|
107
|
+
{
|
|
108
|
+
kind: "ngmodule",
|
|
109
|
+
type: MatDialogModule
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
kind: "directive",
|
|
113
|
+
type: i1.MatDialogTitle,
|
|
114
|
+
selector: "[mat-dialog-title], [matDialogTitle]",
|
|
115
|
+
inputs: ["id"],
|
|
116
|
+
exportAs: ["matDialogTitle"]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
kind: "directive",
|
|
120
|
+
type: i1.MatDialogActions,
|
|
121
|
+
selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]",
|
|
122
|
+
inputs: ["align"]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
kind: "directive",
|
|
126
|
+
type: i1.MatDialogContent,
|
|
127
|
+
selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
kind: "ngmodule",
|
|
131
|
+
type: MatButtonModule
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
kind: "component",
|
|
135
|
+
type: i2.MatButton,
|
|
136
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
137
|
+
inputs: ["matButton"],
|
|
138
|
+
exportAs: ["matButton", "matAnchor"]
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
145
|
+
minVersion: "12.0.0",
|
|
146
|
+
version: "22.3.0",
|
|
147
|
+
ngImport: i0,
|
|
148
|
+
type: ConfirmationDialogComponent,
|
|
149
|
+
decorators: [{
|
|
150
|
+
type: Component,
|
|
151
|
+
args: [{
|
|
152
|
+
selector: "mm-confirmation-dialog",
|
|
153
|
+
standalone: true,
|
|
154
|
+
imports: [MatDialogModule, MatButtonModule],
|
|
155
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
156
|
+
template: `
|
|
103
157
|
<h2 mat-dialog-title>{{ data.title }}</h2>
|
|
104
158
|
<mat-dialog-content>{{ data.message }}</mat-dialog-content>
|
|
105
159
|
<mat-dialog-actions align="end">
|
|
@@ -112,211 +166,234 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
112
166
|
}
|
|
113
167
|
</mat-dialog-actions>
|
|
114
168
|
`
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class ConfirmationService {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
169
|
+
}]
|
|
170
|
+
}]
|
|
171
|
+
});
|
|
172
|
+
var ConfirmationService = class ConfirmationService {
|
|
173
|
+
dialog = inject(MatDialog);
|
|
174
|
+
async showYesNoConfirmationDialog(title, message) {
|
|
175
|
+
const result = await this.openDialog(title, message, DialogType.YesNo);
|
|
176
|
+
if (result instanceof ConfirmationWindowResult) return result.result === ButtonTypes.Yes;
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
async showYesNoCancelConfirmationDialog(title, message) {
|
|
180
|
+
const result = await this.openDialog(title, message, DialogType.YesNoCancel);
|
|
181
|
+
if (result instanceof ConfirmationWindowResult) return result;
|
|
182
|
+
}
|
|
183
|
+
async showOkCancelConfirmationDialog(title, message) {
|
|
184
|
+
const result = await this.openDialog(title, message, DialogType.OkCancel);
|
|
185
|
+
if (result instanceof ConfirmationWindowResult) return result.result === ButtonTypes.Ok;
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
async showOkDialog(title, message) {
|
|
189
|
+
const result = await this.openDialog(title, message, DialogType.Ok);
|
|
190
|
+
if (result instanceof ConfirmationWindowResult) return result.result === ButtonTypes.Ok;
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
async openDialog(title, message, dialogType) {
|
|
194
|
+
const dialogRef = this.dialog.open(ConfirmationDialogComponent, { data: {
|
|
195
|
+
title,
|
|
196
|
+
message,
|
|
197
|
+
dialogType
|
|
198
|
+
} });
|
|
199
|
+
return firstValueFrom(dialogRef.afterClosed());
|
|
200
|
+
}
|
|
201
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
202
|
+
minVersion: "12.0.0",
|
|
203
|
+
version: "22.3.0",
|
|
204
|
+
ngImport: i0,
|
|
205
|
+
type: ConfirmationService,
|
|
206
|
+
deps: [],
|
|
207
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
208
|
+
});
|
|
209
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
210
|
+
minVersion: "12.0.0",
|
|
211
|
+
version: "22.3.0",
|
|
212
|
+
ngImport: i0,
|
|
213
|
+
type: ConfirmationService
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
217
|
+
minVersion: "12.0.0",
|
|
218
|
+
version: "22.3.0",
|
|
219
|
+
ngImport: i0,
|
|
220
|
+
type: ConfirmationService,
|
|
221
|
+
decorators: [{ type: Injectable }]
|
|
222
|
+
});
|
|
223
|
+
var MmSharedUiModule = class MmSharedUiModule {
|
|
224
|
+
static forRoot() {
|
|
225
|
+
return {
|
|
226
|
+
ngModule: MmSharedUiModule,
|
|
227
|
+
providers: [ConfirmationService]
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
231
|
+
minVersion: "12.0.0",
|
|
232
|
+
version: "22.3.0",
|
|
233
|
+
ngImport: i0,
|
|
234
|
+
type: MmSharedUiModule,
|
|
235
|
+
deps: [],
|
|
236
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
237
|
+
});
|
|
238
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
239
|
+
minVersion: "14.0.0",
|
|
240
|
+
version: "22.3.0",
|
|
241
|
+
ngImport: i0,
|
|
242
|
+
type: MmSharedUiModule
|
|
243
|
+
});
|
|
244
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
245
|
+
minVersion: "12.0.0",
|
|
246
|
+
version: "22.3.0",
|
|
247
|
+
ngImport: i0,
|
|
248
|
+
type: MmSharedUiModule
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
252
|
+
minVersion: "12.0.0",
|
|
253
|
+
version: "22.3.0",
|
|
254
|
+
ngImport: i0,
|
|
255
|
+
type: MmSharedUiModule,
|
|
256
|
+
decorators: [{
|
|
257
|
+
type: NgModule,
|
|
258
|
+
args: [{
|
|
259
|
+
declarations: [],
|
|
260
|
+
imports: [],
|
|
261
|
+
exports: []
|
|
262
|
+
}]
|
|
263
|
+
}]
|
|
264
|
+
});
|
|
265
|
+
var AbstractDetailsComponent = class {
|
|
266
|
+
_loading;
|
|
267
|
+
_ownerForm;
|
|
268
|
+
_entity;
|
|
269
|
+
constructor(formGroup) {
|
|
270
|
+
this._loading = true;
|
|
271
|
+
this._entity = null;
|
|
272
|
+
this._ownerForm = formGroup;
|
|
273
|
+
}
|
|
274
|
+
get loading() {
|
|
275
|
+
return this._loading;
|
|
276
|
+
}
|
|
277
|
+
set loading(value) {
|
|
278
|
+
this._loading = value;
|
|
279
|
+
}
|
|
280
|
+
get entity() {
|
|
281
|
+
return this._entity;
|
|
282
|
+
}
|
|
283
|
+
set entity(value) {
|
|
284
|
+
this._entity = value;
|
|
285
|
+
}
|
|
286
|
+
get ownerForm() {
|
|
287
|
+
return this._ownerForm;
|
|
288
|
+
}
|
|
289
|
+
get isLoaded() {
|
|
290
|
+
return this._entity !== null;
|
|
291
|
+
}
|
|
292
|
+
hasError = (controlName, errorName) => {
|
|
293
|
+
return this.ownerForm?.controls[controlName].hasError(errorName);
|
|
294
|
+
};
|
|
295
|
+
hasFormError = (errorName) => {
|
|
296
|
+
return this.ownerForm?.hasError(errorName);
|
|
297
|
+
};
|
|
298
|
+
updateDateTime(controlName) {
|
|
299
|
+
this.ownerForm?.get(controlName)?.setValue(IsoDateTime.utcToLocalDateTimeIso(IsoDateTime.currentUtcDateTimeIso()));
|
|
300
|
+
}
|
|
301
|
+
copyInputMessage(inputElement) {
|
|
302
|
+
inputElement.select();
|
|
303
|
+
document.execCommand("copy");
|
|
304
|
+
inputElement.setSelectionRange(0, 0);
|
|
305
|
+
}
|
|
306
|
+
onProgressStarting() {
|
|
307
|
+
this._loading = true;
|
|
308
|
+
this.ownerForm?.disable();
|
|
309
|
+
this.ownerForm?.updateValueAndValidity();
|
|
310
|
+
}
|
|
311
|
+
onProgressCompleted() {
|
|
312
|
+
this.ownerForm?.enable();
|
|
313
|
+
this._loading = false;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
var CommonValidators = class {
|
|
317
|
+
static phoneNumber() {
|
|
318
|
+
return Validators.pattern("^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$");
|
|
319
|
+
}
|
|
320
|
+
static httpUri() {
|
|
321
|
+
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}$");
|
|
322
|
+
}
|
|
323
|
+
static ensureSameValue(sourceControlName) {
|
|
324
|
+
return (control) => {
|
|
325
|
+
return control.value === control.parent?.get(sourceControlName)?.value ? null : { notSame: true };
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
static conditionalRequired(sourceControlName, sourceValueCompareExpression) {
|
|
329
|
+
return (control) => {
|
|
330
|
+
if (control.parent != null && sourceValueCompareExpression(control.parent.get(sourceControlName)?.value)) {
|
|
331
|
+
const val = control.value;
|
|
332
|
+
return val == null || typeof val === "string" && val.length === 0 || Array.isArray(val) && val.length === 0 ? { required: true } : null;
|
|
333
|
+
}
|
|
334
|
+
return null;
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
static dependentControls(controlNames) {
|
|
338
|
+
return (control) => {
|
|
339
|
+
controlNames.forEach((controlName) => {
|
|
340
|
+
control.parent?.get(controlName)?.updateValueAndValidity();
|
|
341
|
+
});
|
|
342
|
+
return null;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
var ProgressValue = class {
|
|
347
|
+
statusText;
|
|
348
|
+
progressValue;
|
|
349
|
+
constructor() {
|
|
350
|
+
this.statusText = null;
|
|
351
|
+
this.progressValue = 0;
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
var ProgressWindowComponent = class ProgressWindowComponent {
|
|
355
|
+
dialogRef = inject(MatDialogRef);
|
|
356
|
+
data = inject(MAT_DIALOG_DATA);
|
|
357
|
+
cdr = inject(ChangeDetectorRef);
|
|
358
|
+
progressSubscription;
|
|
359
|
+
isDeterminate;
|
|
360
|
+
isCancelOperationAvailable;
|
|
361
|
+
statusText = null;
|
|
362
|
+
progressPercent = 0;
|
|
363
|
+
constructor() {
|
|
364
|
+
this.isDeterminate = this.data.isDeterminate;
|
|
365
|
+
this.isCancelOperationAvailable = this.data.isCancelOperationAvailable;
|
|
366
|
+
}
|
|
367
|
+
ngAfterViewInit() {
|
|
368
|
+
if (this.data.progress) this.progressSubscription = this.data.progress.subscribe((value) => {
|
|
369
|
+
this.statusText = value.statusText;
|
|
370
|
+
this.progressPercent = value.progressValue;
|
|
371
|
+
this.cdr.detectChanges();
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
ngOnDestroy() {
|
|
375
|
+
this.progressSubscription?.unsubscribe();
|
|
376
|
+
}
|
|
377
|
+
onCancelClick() {
|
|
378
|
+
if (this.data.cancelOperation) this.data.cancelOperation();
|
|
379
|
+
this.dialogRef.close();
|
|
380
|
+
}
|
|
381
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
382
|
+
minVersion: "12.0.0",
|
|
383
|
+
version: "22.3.0",
|
|
384
|
+
ngImport: i0,
|
|
385
|
+
type: ProgressWindowComponent,
|
|
386
|
+
deps: [],
|
|
387
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
388
|
+
});
|
|
389
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
390
|
+
minVersion: "17.0.0",
|
|
391
|
+
version: "22.3.0",
|
|
392
|
+
type: ProgressWindowComponent,
|
|
393
|
+
isStandalone: true,
|
|
394
|
+
selector: "mm-progress-window",
|
|
395
|
+
ngImport: i0,
|
|
396
|
+
template: `
|
|
320
397
|
<mat-dialog-content>
|
|
321
398
|
<div class="progress-section">
|
|
322
399
|
@if (isDeterminate) {
|
|
@@ -334,11 +411,73 @@ class ProgressWindowComponent {
|
|
|
334
411
|
<button mat-stroked-button (click)="onCancelClick()">Cancel</button>
|
|
335
412
|
}
|
|
336
413
|
</mat-dialog-actions>
|
|
337
|
-
`,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
414
|
+
`,
|
|
415
|
+
isInline: true,
|
|
416
|
+
styles: [".progress-section{display:flex;flex-direction:column;gap:12px;min-width:350px}.status-text{margin:0;font-size:14px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n"],
|
|
417
|
+
dependencies: [
|
|
418
|
+
{
|
|
419
|
+
kind: "ngmodule",
|
|
420
|
+
type: MatDialogModule
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
kind: "directive",
|
|
424
|
+
type: i1.MatDialogActions,
|
|
425
|
+
selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]",
|
|
426
|
+
inputs: ["align"]
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
kind: "directive",
|
|
430
|
+
type: i1.MatDialogContent,
|
|
431
|
+
selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
kind: "ngmodule",
|
|
435
|
+
type: MatButtonModule
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
kind: "component",
|
|
439
|
+
type: i2.MatButton,
|
|
440
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
441
|
+
inputs: ["matButton"],
|
|
442
|
+
exportAs: ["matButton", "matAnchor"]
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
kind: "ngmodule",
|
|
446
|
+
type: MatProgressBarModule
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
kind: "component",
|
|
450
|
+
type: i3.MatProgressBar,
|
|
451
|
+
selector: "mat-progress-bar",
|
|
452
|
+
inputs: [
|
|
453
|
+
"color",
|
|
454
|
+
"value",
|
|
455
|
+
"bufferValue",
|
|
456
|
+
"mode"
|
|
457
|
+
],
|
|
458
|
+
outputs: ["animationEnd"],
|
|
459
|
+
exportAs: ["matProgressBar"]
|
|
460
|
+
}
|
|
461
|
+
],
|
|
462
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
463
|
+
});
|
|
464
|
+
};
|
|
465
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
466
|
+
minVersion: "12.0.0",
|
|
467
|
+
version: "22.3.0",
|
|
468
|
+
ngImport: i0,
|
|
469
|
+
type: ProgressWindowComponent,
|
|
470
|
+
decorators: [{
|
|
471
|
+
type: Component,
|
|
472
|
+
args: [{
|
|
473
|
+
selector: "mm-progress-window",
|
|
474
|
+
standalone: true,
|
|
475
|
+
imports: [
|
|
476
|
+
MatDialogModule,
|
|
477
|
+
MatButtonModule,
|
|
478
|
+
MatProgressBarModule
|
|
479
|
+
],
|
|
480
|
+
template: `
|
|
342
481
|
<mat-dialog-content>
|
|
343
482
|
<div class="progress-section">
|
|
344
483
|
@if (isDeterminate) {
|
|
@@ -356,76 +495,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
356
495
|
<button mat-stroked-button (click)="onCancelClick()">Cancel</button>
|
|
357
496
|
}
|
|
358
497
|
</mat-dialog-actions>
|
|
359
|
-
`,
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
375
|
-
class ProgressWindowService {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
498
|
+
`,
|
|
499
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
500
|
+
styles: [".progress-section{display:flex;flex-direction:column;gap:12px;min-width:350px}.status-text{margin:0;font-size:14px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n"]
|
|
501
|
+
}]
|
|
502
|
+
}],
|
|
503
|
+
ctorParameters: () => []
|
|
504
|
+
});
|
|
505
|
+
var ProgressDialogRef = class {
|
|
506
|
+
dialogRef;
|
|
507
|
+
constructor(dialogRef) {
|
|
508
|
+
this.dialogRef = dialogRef;
|
|
509
|
+
}
|
|
510
|
+
close() {
|
|
511
|
+
this.dialogRef.close();
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
var ProgressWindowService = class ProgressWindowService {
|
|
515
|
+
dialog = inject(MatDialog);
|
|
516
|
+
showProgress(config) {
|
|
517
|
+
const dialogRef = this.dialog.open(ProgressWindowComponent, {
|
|
518
|
+
data: {
|
|
519
|
+
isDeterminate: config.isDeterminate !== false,
|
|
520
|
+
progress: config.progress,
|
|
521
|
+
isCancelOperationAvailable: config.isCancelOperationAvailable || false,
|
|
522
|
+
cancelOperation: config.cancelOperation || (() => {})
|
|
523
|
+
},
|
|
524
|
+
width: config.width ? `${config.width}px` : "450px",
|
|
525
|
+
disableClose: true
|
|
526
|
+
});
|
|
527
|
+
if (config.title) {}
|
|
528
|
+
return new ProgressDialogRef(dialogRef);
|
|
529
|
+
}
|
|
530
|
+
showDeterminateProgress(title, progress, options) {
|
|
531
|
+
return this.showProgress({
|
|
532
|
+
title,
|
|
533
|
+
isDeterminate: true,
|
|
534
|
+
progress,
|
|
535
|
+
...options
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
showIndeterminateProgress(title, progress, options) {
|
|
539
|
+
return this.showProgress({
|
|
540
|
+
title,
|
|
541
|
+
isDeterminate: false,
|
|
542
|
+
progress,
|
|
543
|
+
...options
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
547
|
+
minVersion: "12.0.0",
|
|
548
|
+
version: "22.3.0",
|
|
549
|
+
ngImport: i0,
|
|
550
|
+
type: ProgressWindowService,
|
|
551
|
+
deps: [],
|
|
552
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
553
|
+
});
|
|
554
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
555
|
+
minVersion: "12.0.0",
|
|
556
|
+
version: "22.3.0",
|
|
557
|
+
ngImport: i0,
|
|
558
|
+
type: ProgressWindowService
|
|
559
|
+
});
|
|
560
|
+
};
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
562
|
+
minVersion: "12.0.0",
|
|
563
|
+
version: "22.3.0",
|
|
564
|
+
ngImport: i0,
|
|
565
|
+
type: ProgressWindowService,
|
|
566
|
+
decorators: [{ type: Injectable }]
|
|
567
|
+
});
|
|
416
568
|
var ImportStrategyDto;
|
|
417
|
-
(function
|
|
418
|
-
|
|
419
|
-
|
|
569
|
+
(function(ImportStrategyDto) {
|
|
570
|
+
ImportStrategyDto[ImportStrategyDto["InsertOnly"] = 0] = "InsertOnly";
|
|
571
|
+
ImportStrategyDto[ImportStrategyDto["Upsert"] = 1] = "Upsert";
|
|
420
572
|
})(ImportStrategyDto || (ImportStrategyDto = {}));
|
|
421
|
-
|
|
422
|
-
/*
|
|
423
|
-
* Public API Surface of shared-ui-legacy
|
|
424
|
-
*/
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Generated bundle index. Do not edit.
|
|
428
|
-
*/
|
|
429
|
-
|
|
430
573
|
export { AbstractDetailsComponent, ButtonTypes, CommonValidators, ConfirmationDialogComponent, ConfirmationService, ConfirmationWindowResult, DialogType, ImportStrategyDto, MmSharedUiModule, ProgressDialogRef, ProgressValue, ProgressWindowComponent, ProgressWindowService };
|
|
431
|
-
|
|
574
|
+
|
|
575
|
+
//# sourceMappingURL=meshmakers-shared-ui-legacy.mjs.map
|