@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 '@angular/core';
2
- import { inject, ChangeDetectionStrategy, Component, Injectable, NgModule, ChangeDetectorRef } from '@angular/core';
3
- import * as i1 from '@angular/material/dialog';
4
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialog } 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';
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 (ButtonTypes) {
15
- ButtonTypes[ButtonTypes["Ok"] = 0] = "Ok";
16
- ButtonTypes[ButtonTypes["Cancel"] = 1] = "Cancel";
17
- ButtonTypes[ButtonTypes["Yes"] = 2] = "Yes";
18
- ButtonTypes[ButtonTypes["No"] = 3] = "No";
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 (DialogType) {
22
- DialogType[DialogType["YesNo"] = 0] = "YesNo";
23
- DialogType[DialogType["YesNoCancel"] = 1] = "YesNoCancel";
24
- DialogType[DialogType["OkCancel"] = 2] = "OkCancel";
25
- DialogType[DialogType["Ok"] = 3] = "Ok";
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
- class ConfirmationWindowResult {
28
- result;
29
- constructor(result) {
30
- this.result = result;
31
- }
32
- }
33
-
34
- class ConfirmationDialogComponent {
35
- dialogRef = inject(MatDialogRef);
36
- data = inject(MAT_DIALOG_DATA);
37
- button1Text = 'OK';
38
- button2Text = null;
39
- button3Text = null;
40
- button1Result = ButtonTypes.Ok;
41
- button2Result = null;
42
- button3Result = null;
43
- ngOnInit() {
44
- switch (this.data.dialogType) {
45
- case DialogType.OkCancel:
46
- this.button1Text = 'OK';
47
- this.button1Result = ButtonTypes.Ok;
48
- this.button2Text = 'Cancel';
49
- this.button2Result = ButtonTypes.Cancel;
50
- break;
51
- case DialogType.YesNoCancel:
52
- this.button1Text = 'Yes';
53
- this.button1Result = ButtonTypes.Yes;
54
- this.button2Text = 'No';
55
- this.button2Result = ButtonTypes.No;
56
- this.button3Text = 'Cancel';
57
- this.button3Result = ButtonTypes.Cancel;
58
- break;
59
- case DialogType.Ok:
60
- this.button1Text = 'OK';
61
- this.button1Result = ButtonTypes.Ok;
62
- break;
63
- default: // YesNo
64
- this.button1Text = 'Yes';
65
- this.button1Result = ButtonTypes.Yes;
66
- this.button2Text = 'No';
67
- this.button2Result = ButtonTypes.No;
68
- break;
69
- }
70
- }
71
- onButton1() {
72
- this.dialogRef.close(new ConfirmationWindowResult(this.button1Result));
73
- }
74
- onButton2() {
75
- this.dialogRef.close(new ConfirmationWindowResult(this.button2Result));
76
- }
77
- onButton3() {
78
- this.dialogRef.close(new ConfirmationWindowResult(this.button3Result));
79
- }
80
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfirmationDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: ConfirmationDialogComponent, isStandalone: true, selector: "mm-confirmation-dialog", ngImport: i0, template: `
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
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, 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] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
94
- }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
96
- type: Component,
97
- args: [{
98
- selector: 'mm-confirmation-dialog',
99
- standalone: true,
100
- imports: [MatDialogModule, MatButtonModule],
101
- changeDetection: ChangeDetectionStrategy.Eager,
102
- template: `
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
- dialog = inject(MatDialog);
120
- async showYesNoConfirmationDialog(title, message) {
121
- const result = await this.openDialog(title, message, DialogType.YesNo);
122
- if (result instanceof ConfirmationWindowResult) {
123
- return result.result === ButtonTypes.Yes;
124
- }
125
- return false;
126
- }
127
- async showYesNoCancelConfirmationDialog(title, message) {
128
- const result = await this.openDialog(title, message, DialogType.YesNoCancel);
129
- if (result instanceof ConfirmationWindowResult) {
130
- return result;
131
- }
132
- return undefined;
133
- }
134
- async showOkCancelConfirmationDialog(title, message) {
135
- const result = await this.openDialog(title, message, DialogType.OkCancel);
136
- if (result instanceof ConfirmationWindowResult) {
137
- return result.result === ButtonTypes.Ok;
138
- }
139
- return false;
140
- }
141
- async showOkDialog(title, message) {
142
- const result = await this.openDialog(title, message, DialogType.Ok);
143
- if (result instanceof ConfirmationWindowResult) {
144
- return result.result === ButtonTypes.Ok;
145
- }
146
- return false;
147
- }
148
- async openDialog(title, message, dialogType) {
149
- const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
150
- data: { title, message, dialogType },
151
- });
152
- return firstValueFrom(dialogRef.afterClosed());
153
- }
154
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfirmationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
155
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfirmationService });
156
- }
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfirmationService, decorators: [{
158
- type: Injectable
159
- }] });
160
-
161
- /**
162
- * Backward-compatible MmSharedUiModule for legacy apps that use
163
- * importProvidersFrom(MmSharedUiModule.forRoot()).
164
- *
165
- * Provides a Material-based ConfirmationService as a drop-in replacement
166
- * for the Kendo-based version from @meshmakers/shared-ui.
167
- */
168
- class MmSharedUiModule {
169
- static forRoot() {
170
- return {
171
- ngModule: MmSharedUiModule,
172
- providers: [
173
- ConfirmationService,
174
- ]
175
- };
176
- }
177
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: MmSharedUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
178
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.5", ngImport: i0, type: MmSharedUiModule });
179
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: MmSharedUiModule });
180
- }
181
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: MmSharedUiModule, decorators: [{
182
- type: NgModule,
183
- args: [{
184
- declarations: [],
185
- imports: [],
186
- exports: []
187
- }]
188
- }] });
189
-
190
- class AbstractDetailsComponent {
191
- _loading;
192
- _ownerForm;
193
- _entity;
194
- constructor(formGroup) {
195
- this._loading = true;
196
- this._entity = null;
197
- this._ownerForm = formGroup;
198
- }
199
- get loading() {
200
- return this._loading;
201
- }
202
- set loading(value) {
203
- this._loading = value;
204
- }
205
- get entity() {
206
- return this._entity;
207
- }
208
- set entity(value) {
209
- this._entity = value;
210
- }
211
- get ownerForm() {
212
- return this._ownerForm;
213
- }
214
- get isLoaded() {
215
- return this._entity !== null;
216
- }
217
- hasError = (controlName, errorName) => {
218
- return this.ownerForm?.controls[controlName].hasError(errorName);
219
- };
220
- hasFormError = (errorName) => {
221
- return this.ownerForm?.hasError(errorName);
222
- };
223
- updateDateTime(controlName) {
224
- this.ownerForm?.get(controlName)?.setValue(IsoDateTime.utcToLocalDateTimeIso(IsoDateTime.currentUtcDateTimeIso()));
225
- }
226
- copyInputMessage(inputElement) {
227
- inputElement.select();
228
- document.execCommand('copy');
229
- inputElement.setSelectionRange(0, 0);
230
- }
231
- onProgressStarting() {
232
- this._loading = true;
233
- this.ownerForm?.disable();
234
- this.ownerForm?.updateValueAndValidity();
235
- }
236
- onProgressCompleted() {
237
- this.ownerForm?.enable();
238
- this._loading = false;
239
- }
240
- }
241
-
242
- /**
243
- * Backward-compatible CommonValidators for legacy apps.
244
- */
245
- class CommonValidators {
246
- static phoneNumber() {
247
- return Validators.pattern('^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$');
248
- }
249
- static httpUri() {
250
- 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}$');
251
- }
252
- static ensureSameValue(sourceControlName) {
253
- return (control) => {
254
- const value = control.value;
255
- return value === control.parent?.get(sourceControlName)?.value ? null : { notSame: true };
256
- };
257
- }
258
- static conditionalRequired(sourceControlName, sourceValueCompareExpression) {
259
- return (control) => {
260
- if (control.parent != null && sourceValueCompareExpression(control.parent.get(sourceControlName)?.value)) {
261
- const val = control.value;
262
- const isEmpty = val == null || (typeof val === 'string' && val.length === 0) || (Array.isArray(val) && val.length === 0);
263
- return isEmpty ? { required: true } : null;
264
- }
265
- return null;
266
- };
267
- }
268
- static dependentControls(controlNames) {
269
- return (control) => {
270
- controlNames.forEach((controlName) => {
271
- control.parent?.get(controlName)?.updateValueAndValidity();
272
- });
273
- return null;
274
- };
275
- }
276
- }
277
-
278
- class ProgressValue {
279
- statusText;
280
- progressValue;
281
- constructor() {
282
- this.statusText = null;
283
- this.progressValue = 0;
284
- }
285
- }
286
-
287
- class ProgressWindowComponent {
288
- dialogRef = inject(MatDialogRef);
289
- data = inject(MAT_DIALOG_DATA);
290
- cdr = inject(ChangeDetectorRef);
291
- progressSubscription;
292
- isDeterminate;
293
- isCancelOperationAvailable;
294
- statusText = null;
295
- progressPercent = 0;
296
- constructor() {
297
- this.isDeterminate = this.data.isDeterminate;
298
- this.isCancelOperationAvailable = this.data.isCancelOperationAvailable;
299
- }
300
- ngAfterViewInit() {
301
- if (this.data.progress) {
302
- this.progressSubscription = this.data.progress.subscribe((value) => {
303
- this.statusText = value.statusText;
304
- this.progressPercent = value.progressValue;
305
- this.cdr.detectChanges();
306
- });
307
- }
308
- }
309
- ngOnDestroy() {
310
- this.progressSubscription?.unsubscribe();
311
- }
312
- onCancelClick() {
313
- if (this.data.cancelOperation) {
314
- this.data.cancelOperation();
315
- }
316
- this.dialogRef.close();
317
- }
318
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ProgressWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
319
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: ProgressWindowComponent, isStandalone: true, selector: "mm-progress-window", ngImport: i0, template: `
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
- `, isInline: true, 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"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, 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] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
338
- }
339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ProgressWindowComponent, decorators: [{
340
- type: Component,
341
- args: [{ selector: 'mm-progress-window', standalone: true, imports: [MatDialogModule, MatButtonModule, MatProgressBarModule], template: `
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
- `, changeDetection: ChangeDetectionStrategy.Eager, 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"] }]
360
- }], ctorParameters: () => [] });
361
-
362
- /**
363
- * Reference returned by showProgress methods.
364
- * Provides a close() method compatible with the Kendo DialogRef API.
365
- */
366
- class ProgressDialogRef {
367
- dialogRef;
368
- constructor(dialogRef) {
369
- this.dialogRef = dialogRef;
370
- }
371
- close() {
372
- this.dialogRef.close();
373
- }
374
- }
375
- class ProgressWindowService {
376
- dialog = inject(MatDialog);
377
- showProgress(config) {
378
- const dialogRef = this.dialog.open(ProgressWindowComponent, {
379
- data: {
380
- isDeterminate: config.isDeterminate !== false,
381
- progress: config.progress,
382
- isCancelOperationAvailable: config.isCancelOperationAvailable || false,
383
- cancelOperation: config.cancelOperation || (() => { }),
384
- },
385
- width: config.width ? `${config.width}px` : '450px',
386
- disableClose: true,
387
- });
388
- if (config.title) {
389
- // MatDialog doesn't have a built-in title on the ref, but we set it via the component
390
- }
391
- return new ProgressDialogRef(dialogRef);
392
- }
393
- showDeterminateProgress(title, progress, options) {
394
- return this.showProgress({
395
- title,
396
- isDeterminate: true,
397
- progress,
398
- ...options
399
- });
400
- }
401
- showIndeterminateProgress(title, progress, options) {
402
- return this.showProgress({
403
- title,
404
- isDeterminate: false,
405
- progress,
406
- ...options
407
- });
408
- }
409
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ProgressWindowService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
410
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ProgressWindowService });
411
- }
412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ProgressWindowService, decorators: [{
413
- type: Injectable
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 (ImportStrategyDto) {
418
- ImportStrategyDto[ImportStrategyDto["InsertOnly"] = 0] = "InsertOnly";
419
- ImportStrategyDto[ImportStrategyDto["Upsert"] = 1] = "Upsert";
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
- //# sourceMappingURL=meshmakers-shared-ui-legacy.mjs.map
574
+
575
+ //# sourceMappingURL=meshmakers-shared-ui-legacy.mjs.map