ngssm-toolkit 22.1.0 → 22.2.1
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/fesm2022/ngssm-toolkit-testing.mjs +4 -9
- package/fesm2022/ngssm-toolkit-testing.mjs.map +1 -1
- package/fesm2022/ngssm-toolkit.mjs +1171 -562
- package/fesm2022/ngssm-toolkit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngssm-toolkit-testing.d.ts +2 -5
- package/types/ngssm-toolkit.d.ts +241 -217
|
@@ -1,588 +1,1197 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Logger, provideEffects } from
|
|
6
|
-
import * as i1 from
|
|
7
|
-
import { MatCardModule } from
|
|
8
|
-
import * as i2 from
|
|
9
|
-
import { MatProgressSpinnerModule } from
|
|
10
|
-
import { ErrorStateMatcher } from
|
|
11
|
-
import { coerceBooleanProperty } from
|
|
12
|
-
import * as i1$
|
|
13
|
-
import { CommonModule } from
|
|
14
|
-
import { NgControl } from
|
|
15
|
-
import { MatFormFieldControl } from
|
|
16
|
-
import { Subject } from
|
|
17
|
-
import { MAT_SNACK_BAR_DATA, MatSnackBar } from
|
|
18
|
-
import * as i1$
|
|
19
|
-
import { MatIconModule } from
|
|
20
|
-
import { MAT_DIALOG_DATA,
|
|
21
|
-
import * as i1
|
|
22
|
-
import { MatButton, MatButtonModule } from
|
|
23
|
-
import * as i3 from
|
|
24
|
-
import { MatMenuModule } from
|
|
25
|
-
import { DateTime } from
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, Directive, ElementRef, EnvironmentInjector, HostBinding, Injectable, InjectionToken, Injector, Input, Pipe, Renderer2, ViewChild, ViewContainerRef, effect, inject, input, makeEnvironmentProviders, runInInjectionContext, signal } from "@angular/core";
|
|
3
|
+
import { Overlay, OverlayContainer, createOverlayRef, createRepositionScrollStrategy } from "@angular/cdk/overlay";
|
|
4
|
+
import { ComponentPortal, TemplatePortal } from "@angular/cdk/portal";
|
|
5
|
+
import { Logger, provideEffects } from "ngssm-store";
|
|
6
|
+
import * as i1$3 from "@angular/material/card";
|
|
7
|
+
import { MatCardModule } from "@angular/material/card";
|
|
8
|
+
import * as i2 from "@angular/material/progress-spinner";
|
|
9
|
+
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
|
|
10
|
+
import { ErrorStateMatcher } from "@angular/material/core";
|
|
11
|
+
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
12
|
+
import * as i1$2 from "@angular/common";
|
|
13
|
+
import { CommonModule } from "@angular/common";
|
|
14
|
+
import { NgControl } from "@angular/forms";
|
|
15
|
+
import { MatFormFieldControl } from "@angular/material/form-field";
|
|
16
|
+
import { Subject } from "rxjs";
|
|
17
|
+
import { MAT_SNACK_BAR_DATA, MatSnackBar } from "@angular/material/snack-bar";
|
|
18
|
+
import * as i1$1 from "@angular/material/icon";
|
|
19
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
20
|
+
import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogClose, MatDialogContent } from "@angular/material/dialog";
|
|
21
|
+
import * as i1 from "@angular/material/button";
|
|
22
|
+
import { MatButton, MatButtonModule } from "@angular/material/button";
|
|
23
|
+
import * as i3 from "@angular/material/menu";
|
|
24
|
+
import { MatMenuModule } from "@angular/material/menu";
|
|
25
|
+
import { DateTime } from "luxon";
|
|
26
|
+
var NgssmMessageOverlayComponent = class NgssmMessageOverlayComponent {
|
|
27
|
+
message = signal("", ...ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []);
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
29
|
+
minVersion: "12.0.0",
|
|
30
|
+
version: "22.2.0",
|
|
31
|
+
ngImport: i0,
|
|
32
|
+
type: NgssmMessageOverlayComponent,
|
|
33
|
+
deps: [],
|
|
34
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
35
|
+
});
|
|
36
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
37
|
+
minVersion: "14.0.0",
|
|
38
|
+
version: "22.2.0",
|
|
39
|
+
type: NgssmMessageOverlayComponent,
|
|
40
|
+
isStandalone: true,
|
|
41
|
+
selector: "ngssm-message-overlay",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
template: `
|
|
32
44
|
<mat-card>
|
|
33
45
|
<mat-card-content class="message-container">
|
|
34
46
|
<mat-spinner></mat-spinner>
|
|
35
47
|
{{ message() }}
|
|
36
48
|
</mat-card-content>
|
|
37
49
|
</mat-card>
|
|
38
|
-
`,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
`,
|
|
51
|
+
isInline: true,
|
|
52
|
+
styles: [".message-container{display:flex!important;flex-direction:column;align-items:center}\n"],
|
|
53
|
+
dependencies: [
|
|
54
|
+
{
|
|
55
|
+
kind: "ngmodule",
|
|
56
|
+
type: MatCardModule
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
kind: "component",
|
|
60
|
+
type: i1$3.MatCard,
|
|
61
|
+
selector: "mat-card",
|
|
62
|
+
inputs: ["appearance"],
|
|
63
|
+
exportAs: ["matCard"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
kind: "directive",
|
|
67
|
+
type: i1$3.MatCardContent,
|
|
68
|
+
selector: "mat-card-content"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
kind: "ngmodule",
|
|
72
|
+
type: MatProgressSpinnerModule
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
kind: "component",
|
|
76
|
+
type: i2.MatProgressSpinner,
|
|
77
|
+
selector: "mat-progress-spinner, mat-spinner",
|
|
78
|
+
inputs: [
|
|
79
|
+
"color",
|
|
80
|
+
"mode",
|
|
81
|
+
"value",
|
|
82
|
+
"diameter",
|
|
83
|
+
"strokeWidth"
|
|
84
|
+
],
|
|
85
|
+
exportAs: ["matProgressSpinner"]
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
91
|
+
minVersion: "12.0.0",
|
|
92
|
+
version: "22.2.0",
|
|
93
|
+
ngImport: i0,
|
|
94
|
+
type: NgssmMessageOverlayComponent,
|
|
95
|
+
decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{
|
|
98
|
+
selector: "ngssm-message-overlay",
|
|
99
|
+
imports: [MatCardModule, MatProgressSpinnerModule],
|
|
100
|
+
template: `
|
|
43
101
|
<mat-card>
|
|
44
102
|
<mat-card-content class="message-container">
|
|
45
103
|
<mat-spinner></mat-spinner>
|
|
46
104
|
{{ message() }}
|
|
47
105
|
</mat-card-content>
|
|
48
106
|
</mat-card>
|
|
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
|
-
overlay = inject(Overlay);
|
|
77
|
-
viewContainerRef = inject(ViewContainerRef);
|
|
78
|
-
renderer = inject(Renderer2);
|
|
79
|
-
overlayInjector;
|
|
80
|
-
id = NgssmOverlayBuilder.nextId++;
|
|
81
|
-
overlayRef;
|
|
82
|
-
constructor() {
|
|
83
|
-
this.logger.information(`[NgssmOverlayBuilder] Creating overlay ${this.id}`);
|
|
84
|
-
this.renderer.setStyle(this.elementRef.nativeElement, 'position', 'relative');
|
|
85
|
-
this.overlayInjector = Injector.create({
|
|
86
|
-
providers: [{ provide: OverlayContainer, useClass: NgssmOverlayContainer }],
|
|
87
|
-
parent: this.injector
|
|
88
|
-
});
|
|
89
|
-
const overlayContainer = this.overlayInjector.get(OverlayContainer);
|
|
90
|
-
overlayContainer.setContainerRef(this.elementRef);
|
|
91
|
-
this.overlayRef = createOverlayRef(this.overlayInjector, {
|
|
92
|
-
positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),
|
|
93
|
-
scrollStrategy: createRepositionScrollStrategy(this.injector),
|
|
94
|
-
hasBackdrop: true,
|
|
95
|
-
usePopover: false
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
ngOnDestroy() {
|
|
99
|
-
this.logger.information(`[NgssmOverlayBuilder] Destroying overlay ${this.id}`);
|
|
100
|
-
this.overlayRef.detach();
|
|
101
|
-
this.overlayInjector?.destroy();
|
|
102
|
-
}
|
|
103
|
-
showOverlay() {
|
|
104
|
-
if (this.overlayTemplate) {
|
|
105
|
-
this.overlayRef.attach(new TemplatePortal(this.overlayTemplate, this.viewContainerRef));
|
|
106
|
-
}
|
|
107
|
-
else if (this.overlayComponent) {
|
|
108
|
-
const ref = this.overlayRef.attach(new ComponentPortal(this.overlayComponent, this.viewContainerRef));
|
|
109
|
-
if (this.overlayComponent === NgssmMessageOverlayComponent) {
|
|
110
|
-
ref.instance.message = this.overlayMessage;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
const ref = this.overlayRef.attach(new ComponentPortal(NgssmMessageOverlayComponent, this.viewContainerRef));
|
|
115
|
-
ref.instance.message = this.overlayMessage;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
hideOverlay() {
|
|
119
|
-
this.overlayRef.detach();
|
|
120
|
-
}
|
|
121
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmOverlayBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
122
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmOverlayBuilder });
|
|
123
|
-
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmOverlayBuilder, decorators: [{
|
|
125
|
-
type: Injectable
|
|
126
|
-
}], ctorParameters: () => [] });
|
|
127
|
-
|
|
128
|
-
class NgssmComponentOverlayDirective {
|
|
129
|
-
overlayTemplate = input(/* @ts-ignore */
|
|
130
|
-
...(ngDevMode ? [undefined, { debugName: "overlayTemplate" }] : /* istanbul ignore next */ []));
|
|
131
|
-
overlayComponent = input(/* @ts-ignore */
|
|
132
|
-
...(ngDevMode ? [undefined, { debugName: "overlayComponent" }] : /* istanbul ignore next */ []));
|
|
133
|
-
overlayMessage = input('Please wait', /* @ts-ignore */
|
|
134
|
-
...(ngDevMode ? [{ debugName: "overlayMessage" }] : /* istanbul ignore next */ []));
|
|
135
|
-
ngssmDisplayOverlay = input(false, /* @ts-ignore */
|
|
136
|
-
...(ngDevMode ? [{ debugName: "ngssmDisplayOverlay" }] : /* istanbul ignore next */ []));
|
|
137
|
-
overlayBuilder = inject(NgssmOverlayBuilder);
|
|
138
|
-
constructor() {
|
|
139
|
-
effect(() => {
|
|
140
|
-
this.overlayBuilder.overlayTemplate = this.overlayTemplate() ?? undefined;
|
|
141
|
-
this.overlayBuilder.overlayComponent = this.overlayComponent() ?? undefined;
|
|
142
|
-
this.overlayBuilder.overlayMessage.set(this.overlayMessage() ?? '');
|
|
143
|
-
});
|
|
144
|
-
effect(() => {
|
|
145
|
-
const doRenderOveralay = this.ngssmDisplayOverlay();
|
|
146
|
-
if (doRenderOveralay === true) {
|
|
147
|
-
this.overlayBuilder.showOverlay();
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
this.overlayBuilder.hideOverlay();
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmComponentOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
155
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: NgssmComponentOverlayDirective, isStandalone: true, selector: "[ngssmDisplayOverlay]", inputs: { overlayTemplate: { classPropertyName: "overlayTemplate", publicName: "overlayTemplate", isSignal: true, isRequired: false, transformFunction: null }, overlayComponent: { classPropertyName: "overlayComponent", publicName: "overlayComponent", isSignal: true, isRequired: false, transformFunction: null }, overlayMessage: { classPropertyName: "overlayMessage", publicName: "overlayMessage", isSignal: true, isRequired: false, transformFunction: null }, ngssmDisplayOverlay: { classPropertyName: "ngssmDisplayOverlay", publicName: "ngssmDisplayOverlay", isSignal: true, isRequired: false, transformFunction: null } }, providers: [NgssmOverlayBuilder], ngImport: i0 });
|
|
156
|
-
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmComponentOverlayDirective, decorators: [{
|
|
158
|
-
type: Directive,
|
|
159
|
-
args: [{
|
|
160
|
-
selector: '[ngssmDisplayOverlay]',
|
|
161
|
-
providers: [NgssmOverlayBuilder]
|
|
162
|
-
}]
|
|
163
|
-
}], ctorParameters: () => [], propDecorators: { overlayTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayTemplate", required: false }] }], overlayComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayComponent", required: false }] }], overlayMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayMessage", required: false }] }], ngssmDisplayOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngssmDisplayOverlay", required: false }] }] } });
|
|
164
|
-
|
|
165
|
-
class NgssmEmptyOverlayComponent {
|
|
166
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmEmptyOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
167
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: NgssmEmptyOverlayComponent, isStandalone: true, selector: "ngssm-empty-overlay", ngImport: i0, template: ``, isInline: true });
|
|
168
|
-
}
|
|
169
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmEmptyOverlayComponent, decorators: [{
|
|
170
|
-
type: Component,
|
|
171
|
-
args: [{ selector: 'ngssm-empty-overlay', template: `` }]
|
|
172
|
-
}] });
|
|
173
|
-
|
|
174
|
-
class DefaultErrorStateMatcher {
|
|
175
|
-
isErrorState(control) {
|
|
176
|
-
return !!(control && control.invalid);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
const useDefaultErrorStateMatcher = { provide: ErrorStateMatcher, useClass: DefaultErrorStateMatcher };
|
|
180
|
-
|
|
181
|
-
class NotFoundComponent {
|
|
182
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
183
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: NotFoundComponent, isStandalone: true, selector: "ngssm-not-found", ngImport: i0, template: ` <img src="./assets/404-not-found.png" alt="not found" /> `, isInline: true, styles: [":host{display:flex;flex-direction:row;flex:1;align-items:center;justify-content:center}\n"] });
|
|
184
|
-
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NotFoundComponent, decorators: [{
|
|
186
|
-
type: Component,
|
|
187
|
-
args: [{ selector: 'ngssm-not-found', imports: [], template: ` <img src="./assets/404-not-found.png" alt="not found" /> `, styles: [":host{display:flex;flex-direction:row;flex:1;align-items:center;justify-content:center}\n"] }]
|
|
188
|
-
}] });
|
|
189
|
-
|
|
190
|
-
class NgssmFileSizePipe {
|
|
191
|
-
units = ['bytes', 'KB', 'MB', 'GB'];
|
|
192
|
-
transform(value, precision = 2) {
|
|
193
|
-
let bytes = value;
|
|
194
|
-
if (isNaN(bytes) || !isFinite(bytes)) {
|
|
195
|
-
return '?';
|
|
196
|
-
}
|
|
197
|
-
let unit = 0;
|
|
198
|
-
while (bytes >= 1024 && unit < this.units.length) {
|
|
199
|
-
bytes /= 1024;
|
|
200
|
-
unit++;
|
|
201
|
-
}
|
|
202
|
-
if (unit === 0) {
|
|
203
|
-
return `${bytes} ${this.units[unit]}`;
|
|
204
|
-
}
|
|
205
|
-
return `${bytes.toFixed(+precision)} ${this.units[unit]}`;
|
|
206
|
-
}
|
|
207
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmFileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
208
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: NgssmFileSizePipe, isStandalone: true, name: "ngssmFileSize" });
|
|
209
|
-
}
|
|
210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: NgssmFileSizePipe, decorators: [{
|
|
211
|
-
type: Pipe,
|
|
212
|
-
args: [{
|
|
213
|
-
name: 'ngssmFileSize'
|
|
214
|
-
}]
|
|
215
|
-
}] });
|
|
216
|
-
|
|
217
|
-
/* eslint-disable @typescript-eslint/member-ordering */
|
|
218
|
-
const noop = () => {
|
|
219
|
-
// nothing to do
|
|
107
|
+
`,
|
|
108
|
+
styles: [".message-container{display:flex!important;flex-direction:column;align-items:center}\n"]
|
|
109
|
+
}]
|
|
110
|
+
}]
|
|
111
|
+
});
|
|
112
|
+
var NgssmOverlayContainer = class NgssmOverlayContainer extends OverlayContainer {
|
|
113
|
+
elementRef;
|
|
114
|
+
setContainerRef(elementRef) {
|
|
115
|
+
this.elementRef = elementRef;
|
|
116
|
+
}
|
|
117
|
+
getContainerElement() {
|
|
118
|
+
return this.elementRef?.nativeElement;
|
|
119
|
+
}
|
|
120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
121
|
+
minVersion: "12.0.0",
|
|
122
|
+
version: "22.2.0",
|
|
123
|
+
ngImport: i0,
|
|
124
|
+
type: NgssmOverlayContainer,
|
|
125
|
+
deps: null,
|
|
126
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
127
|
+
});
|
|
128
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
129
|
+
minVersion: "12.0.0",
|
|
130
|
+
version: "22.2.0",
|
|
131
|
+
ngImport: i0,
|
|
132
|
+
type: NgssmOverlayContainer
|
|
133
|
+
});
|
|
220
134
|
};
|
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
136
|
+
minVersion: "12.0.0",
|
|
137
|
+
version: "22.2.0",
|
|
138
|
+
ngImport: i0,
|
|
139
|
+
type: NgssmOverlayContainer,
|
|
140
|
+
decorators: [{ type: Injectable }]
|
|
141
|
+
});
|
|
142
|
+
var NgssmOverlayBuilder = class NgssmOverlayBuilder {
|
|
143
|
+
static nextId = 1;
|
|
144
|
+
overlayMessage = signal("Please wait", ...ngDevMode ? [{ debugName: "overlayMessage" }] : /* istanbul ignore next */ []);
|
|
145
|
+
overlayTemplate;
|
|
146
|
+
overlayComponent;
|
|
147
|
+
logger = inject(Logger);
|
|
148
|
+
injector = inject(Injector);
|
|
149
|
+
elementRef = inject(ElementRef);
|
|
150
|
+
overlay = inject(Overlay);
|
|
151
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
152
|
+
renderer = inject(Renderer2);
|
|
153
|
+
overlayInjector;
|
|
154
|
+
id = NgssmOverlayBuilder.nextId++;
|
|
155
|
+
overlayRef;
|
|
156
|
+
constructor() {
|
|
157
|
+
this.logger.information(`[NgssmOverlayBuilder] Creating overlay ${this.id}`);
|
|
158
|
+
this.renderer.setStyle(this.elementRef.nativeElement, "position", "relative");
|
|
159
|
+
this.overlayInjector = Injector.create({
|
|
160
|
+
providers: [{
|
|
161
|
+
provide: OverlayContainer,
|
|
162
|
+
useClass: NgssmOverlayContainer
|
|
163
|
+
}],
|
|
164
|
+
parent: this.injector
|
|
165
|
+
});
|
|
166
|
+
this.overlayInjector.get(OverlayContainer).setContainerRef(this.elementRef);
|
|
167
|
+
this.overlayRef = createOverlayRef(this.overlayInjector, {
|
|
168
|
+
positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),
|
|
169
|
+
scrollStrategy: createRepositionScrollStrategy(this.injector),
|
|
170
|
+
hasBackdrop: true,
|
|
171
|
+
usePopover: false
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
ngOnDestroy() {
|
|
175
|
+
this.logger.information(`[NgssmOverlayBuilder] Destroying overlay ${this.id}`);
|
|
176
|
+
this.overlayRef.detach();
|
|
177
|
+
this.overlayInjector?.destroy();
|
|
178
|
+
}
|
|
179
|
+
showOverlay() {
|
|
180
|
+
if (this.overlayTemplate) this.overlayRef.attach(new TemplatePortal(this.overlayTemplate, this.viewContainerRef));
|
|
181
|
+
else if (this.overlayComponent) {
|
|
182
|
+
const ref = this.overlayRef.attach(new ComponentPortal(this.overlayComponent, this.viewContainerRef));
|
|
183
|
+
if (this.overlayComponent === NgssmMessageOverlayComponent) ref.instance.message = this.overlayMessage;
|
|
184
|
+
} else {
|
|
185
|
+
const ref = this.overlayRef.attach(new ComponentPortal(NgssmMessageOverlayComponent, this.viewContainerRef));
|
|
186
|
+
ref.instance.message = this.overlayMessage;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
hideOverlay() {
|
|
190
|
+
this.overlayRef.detach();
|
|
191
|
+
}
|
|
192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
193
|
+
minVersion: "12.0.0",
|
|
194
|
+
version: "22.2.0",
|
|
195
|
+
ngImport: i0,
|
|
196
|
+
type: NgssmOverlayBuilder,
|
|
197
|
+
deps: [],
|
|
198
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
199
|
+
});
|
|
200
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
201
|
+
minVersion: "12.0.0",
|
|
202
|
+
version: "22.2.0",
|
|
203
|
+
ngImport: i0,
|
|
204
|
+
type: NgssmOverlayBuilder
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
208
|
+
minVersion: "12.0.0",
|
|
209
|
+
version: "22.2.0",
|
|
210
|
+
ngImport: i0,
|
|
211
|
+
type: NgssmOverlayBuilder,
|
|
212
|
+
decorators: [{ type: Injectable }],
|
|
213
|
+
ctorParameters: () => []
|
|
214
|
+
});
|
|
215
|
+
var NgssmComponentOverlayDirective = class NgssmComponentOverlayDirective {
|
|
216
|
+
overlayTemplate = input(...ngDevMode ? [void 0, { debugName: "overlayTemplate" }] : /* istanbul ignore next */ []);
|
|
217
|
+
overlayComponent = input(...ngDevMode ? [void 0, { debugName: "overlayComponent" }] : /* istanbul ignore next */ []);
|
|
218
|
+
overlayMessage = input("Please wait", ...ngDevMode ? [{ debugName: "overlayMessage" }] : /* istanbul ignore next */ []);
|
|
219
|
+
ngssmDisplayOverlay = input(false, ...ngDevMode ? [{ debugName: "ngssmDisplayOverlay" }] : /* istanbul ignore next */ []);
|
|
220
|
+
overlayBuilder = inject(NgssmOverlayBuilder);
|
|
221
|
+
constructor() {
|
|
222
|
+
effect(() => {
|
|
223
|
+
this.overlayBuilder.overlayTemplate = this.overlayTemplate() ?? void 0;
|
|
224
|
+
this.overlayBuilder.overlayComponent = this.overlayComponent() ?? void 0;
|
|
225
|
+
this.overlayBuilder.overlayMessage.set(this.overlayMessage() ?? "");
|
|
226
|
+
});
|
|
227
|
+
effect(() => {
|
|
228
|
+
if (this.ngssmDisplayOverlay() === true) this.overlayBuilder.showOverlay();
|
|
229
|
+
else this.overlayBuilder.hideOverlay();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
233
|
+
minVersion: "12.0.0",
|
|
234
|
+
version: "22.2.0",
|
|
235
|
+
ngImport: i0,
|
|
236
|
+
type: NgssmComponentOverlayDirective,
|
|
237
|
+
deps: [],
|
|
238
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
239
|
+
});
|
|
240
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
241
|
+
minVersion: "17.1.0",
|
|
242
|
+
version: "22.2.0",
|
|
243
|
+
type: NgssmComponentOverlayDirective,
|
|
244
|
+
isStandalone: true,
|
|
245
|
+
selector: "[ngssmDisplayOverlay]",
|
|
246
|
+
inputs: {
|
|
247
|
+
overlayTemplate: {
|
|
248
|
+
classPropertyName: "overlayTemplate",
|
|
249
|
+
publicName: "overlayTemplate",
|
|
250
|
+
isSignal: true,
|
|
251
|
+
isRequired: false,
|
|
252
|
+
transformFunction: null
|
|
253
|
+
},
|
|
254
|
+
overlayComponent: {
|
|
255
|
+
classPropertyName: "overlayComponent",
|
|
256
|
+
publicName: "overlayComponent",
|
|
257
|
+
isSignal: true,
|
|
258
|
+
isRequired: false,
|
|
259
|
+
transformFunction: null
|
|
260
|
+
},
|
|
261
|
+
overlayMessage: {
|
|
262
|
+
classPropertyName: "overlayMessage",
|
|
263
|
+
publicName: "overlayMessage",
|
|
264
|
+
isSignal: true,
|
|
265
|
+
isRequired: false,
|
|
266
|
+
transformFunction: null
|
|
267
|
+
},
|
|
268
|
+
ngssmDisplayOverlay: {
|
|
269
|
+
classPropertyName: "ngssmDisplayOverlay",
|
|
270
|
+
publicName: "ngssmDisplayOverlay",
|
|
271
|
+
isSignal: true,
|
|
272
|
+
isRequired: false,
|
|
273
|
+
transformFunction: null
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
providers: [NgssmOverlayBuilder],
|
|
277
|
+
ngImport: i0
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
281
|
+
minVersion: "12.0.0",
|
|
282
|
+
version: "22.2.0",
|
|
283
|
+
ngImport: i0,
|
|
284
|
+
type: NgssmComponentOverlayDirective,
|
|
285
|
+
decorators: [{
|
|
286
|
+
type: Directive,
|
|
287
|
+
args: [{
|
|
288
|
+
selector: "[ngssmDisplayOverlay]",
|
|
289
|
+
providers: [NgssmOverlayBuilder]
|
|
290
|
+
}]
|
|
291
|
+
}],
|
|
292
|
+
ctorParameters: () => [],
|
|
293
|
+
propDecorators: {
|
|
294
|
+
overlayTemplate: [{
|
|
295
|
+
type: i0.Input,
|
|
296
|
+
args: [{
|
|
297
|
+
isSignal: true,
|
|
298
|
+
alias: "overlayTemplate",
|
|
299
|
+
required: false
|
|
300
|
+
}]
|
|
301
|
+
}],
|
|
302
|
+
overlayComponent: [{
|
|
303
|
+
type: i0.Input,
|
|
304
|
+
args: [{
|
|
305
|
+
isSignal: true,
|
|
306
|
+
alias: "overlayComponent",
|
|
307
|
+
required: false
|
|
308
|
+
}]
|
|
309
|
+
}],
|
|
310
|
+
overlayMessage: [{
|
|
311
|
+
type: i0.Input,
|
|
312
|
+
args: [{
|
|
313
|
+
isSignal: true,
|
|
314
|
+
alias: "overlayMessage",
|
|
315
|
+
required: false
|
|
316
|
+
}]
|
|
317
|
+
}],
|
|
318
|
+
ngssmDisplayOverlay: [{
|
|
319
|
+
type: i0.Input,
|
|
320
|
+
args: [{
|
|
321
|
+
isSignal: true,
|
|
322
|
+
alias: "ngssmDisplayOverlay",
|
|
323
|
+
required: false
|
|
324
|
+
}]
|
|
325
|
+
}]
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
var NgssmEmptyOverlayComponent = class NgssmEmptyOverlayComponent {
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
330
|
+
minVersion: "12.0.0",
|
|
331
|
+
version: "22.2.0",
|
|
332
|
+
ngImport: i0,
|
|
333
|
+
type: NgssmEmptyOverlayComponent,
|
|
334
|
+
deps: [],
|
|
335
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
336
|
+
});
|
|
337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
338
|
+
minVersion: "14.0.0",
|
|
339
|
+
version: "22.2.0",
|
|
340
|
+
type: NgssmEmptyOverlayComponent,
|
|
341
|
+
isStandalone: true,
|
|
342
|
+
selector: "ngssm-empty-overlay",
|
|
343
|
+
ngImport: i0,
|
|
344
|
+
template: ``,
|
|
345
|
+
isInline: true
|
|
346
|
+
});
|
|
347
|
+
};
|
|
348
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
349
|
+
minVersion: "12.0.0",
|
|
350
|
+
version: "22.2.0",
|
|
351
|
+
ngImport: i0,
|
|
352
|
+
type: NgssmEmptyOverlayComponent,
|
|
353
|
+
decorators: [{
|
|
354
|
+
type: Component,
|
|
355
|
+
args: [{
|
|
356
|
+
selector: "ngssm-empty-overlay",
|
|
357
|
+
template: ``
|
|
358
|
+
}]
|
|
359
|
+
}]
|
|
360
|
+
});
|
|
361
|
+
var DefaultErrorStateMatcher = class {
|
|
362
|
+
isErrorState(control) {
|
|
363
|
+
return !!(control && control.invalid);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
const useDefaultErrorStateMatcher = {
|
|
367
|
+
provide: ErrorStateMatcher,
|
|
368
|
+
useClass: DefaultErrorStateMatcher
|
|
369
|
+
};
|
|
370
|
+
var NotFoundComponent = class NotFoundComponent {
|
|
371
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
372
|
+
minVersion: "12.0.0",
|
|
373
|
+
version: "22.2.0",
|
|
374
|
+
ngImport: i0,
|
|
375
|
+
type: NotFoundComponent,
|
|
376
|
+
deps: [],
|
|
377
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
378
|
+
});
|
|
379
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
380
|
+
minVersion: "14.0.0",
|
|
381
|
+
version: "22.2.0",
|
|
382
|
+
type: NotFoundComponent,
|
|
383
|
+
isStandalone: true,
|
|
384
|
+
selector: "ngssm-not-found",
|
|
385
|
+
ngImport: i0,
|
|
386
|
+
template: ` <img src="./assets/404-not-found.png" alt="not found" /> `,
|
|
387
|
+
isInline: true,
|
|
388
|
+
styles: [":host{display:flex;flex-direction:row;flex:1;align-items:center;justify-content:center}\n"]
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
392
|
+
minVersion: "12.0.0",
|
|
393
|
+
version: "22.2.0",
|
|
394
|
+
ngImport: i0,
|
|
395
|
+
type: NotFoundComponent,
|
|
396
|
+
decorators: [{
|
|
397
|
+
type: Component,
|
|
398
|
+
args: [{
|
|
399
|
+
selector: "ngssm-not-found",
|
|
400
|
+
imports: [],
|
|
401
|
+
template: ` <img src="./assets/404-not-found.png" alt="not found" /> `,
|
|
402
|
+
styles: [":host{display:flex;flex-direction:row;flex:1;align-items:center;justify-content:center}\n"]
|
|
403
|
+
}]
|
|
404
|
+
}]
|
|
405
|
+
});
|
|
406
|
+
var NgssmFileSizePipe = class NgssmFileSizePipe {
|
|
407
|
+
units = [
|
|
408
|
+
"bytes",
|
|
409
|
+
"KB",
|
|
410
|
+
"MB",
|
|
411
|
+
"GB"
|
|
412
|
+
];
|
|
413
|
+
transform(value, precision = 2) {
|
|
414
|
+
let bytes = value;
|
|
415
|
+
if (isNaN(bytes) || !isFinite(bytes)) return "?";
|
|
416
|
+
let unit = 0;
|
|
417
|
+
while (bytes >= 1024 && unit < this.units.length) {
|
|
418
|
+
bytes /= 1024;
|
|
419
|
+
unit++;
|
|
420
|
+
}
|
|
421
|
+
if (unit === 0) return `${bytes} ${this.units[unit]}`;
|
|
422
|
+
return `${bytes.toFixed(+precision)} ${this.units[unit]}`;
|
|
423
|
+
}
|
|
424
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
425
|
+
minVersion: "12.0.0",
|
|
426
|
+
version: "22.2.0",
|
|
427
|
+
ngImport: i0,
|
|
428
|
+
type: NgssmFileSizePipe,
|
|
429
|
+
deps: [],
|
|
430
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
431
|
+
});
|
|
432
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
433
|
+
minVersion: "14.0.0",
|
|
434
|
+
version: "22.2.0",
|
|
435
|
+
ngImport: i0,
|
|
436
|
+
type: NgssmFileSizePipe,
|
|
437
|
+
isStandalone: true,
|
|
438
|
+
name: "ngssmFileSize"
|
|
439
|
+
});
|
|
440
|
+
};
|
|
441
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
442
|
+
minVersion: "12.0.0",
|
|
443
|
+
version: "22.2.0",
|
|
444
|
+
ngImport: i0,
|
|
445
|
+
type: NgssmFileSizePipe,
|
|
446
|
+
decorators: [{
|
|
447
|
+
type: Pipe,
|
|
448
|
+
args: [{ name: "ngssmFileSize" }]
|
|
449
|
+
}]
|
|
450
|
+
});
|
|
451
|
+
const noop = () => {};
|
|
452
|
+
var NgssmFilePickerComponent = class NgssmFilePickerComponent {
|
|
453
|
+
static nextId = 0;
|
|
454
|
+
fileInput;
|
|
455
|
+
id = `file-picker-${NgssmFilePickerComponent.nextId++}`;
|
|
456
|
+
ngControl = inject(NgControl, {
|
|
457
|
+
optional: true,
|
|
458
|
+
self: true
|
|
459
|
+
});
|
|
460
|
+
displayDetails = input(true, ...ngDevMode ? [{ debugName: "displayDetails" }] : /* istanbul ignore next */ []);
|
|
461
|
+
controlType = "file-picker";
|
|
462
|
+
placeholder = "";
|
|
463
|
+
focused = false;
|
|
464
|
+
stateChanges = new Subject();
|
|
465
|
+
value = null;
|
|
466
|
+
autofilled;
|
|
467
|
+
userAriaDescribedBy;
|
|
468
|
+
onChangeCallback = noop;
|
|
469
|
+
_required = false;
|
|
470
|
+
_disabled = false;
|
|
471
|
+
constructor() {
|
|
472
|
+
if (this.ngControl != null) this.ngControl.valueAccessor = this;
|
|
473
|
+
}
|
|
474
|
+
get required() {
|
|
475
|
+
return this._required;
|
|
476
|
+
}
|
|
477
|
+
set required(value) {
|
|
478
|
+
this._required = coerceBooleanProperty(value);
|
|
479
|
+
this.stateChanges.next();
|
|
480
|
+
}
|
|
481
|
+
get disabled() {
|
|
482
|
+
return this._disabled;
|
|
483
|
+
}
|
|
484
|
+
set disabled(value) {
|
|
485
|
+
this._disabled = coerceBooleanProperty(value);
|
|
486
|
+
this.stateChanges.next();
|
|
487
|
+
}
|
|
488
|
+
get empty() {
|
|
489
|
+
return this.value === null;
|
|
490
|
+
}
|
|
491
|
+
get shouldLabelFloat() {
|
|
492
|
+
return this.value !== null;
|
|
493
|
+
}
|
|
494
|
+
get errorState() {
|
|
495
|
+
return this.ngControl?.invalid ?? false;
|
|
496
|
+
}
|
|
497
|
+
get lastModificationDate() {
|
|
498
|
+
if (this.value) return new Date(this.value.lastModified).toISOString();
|
|
499
|
+
return "";
|
|
500
|
+
}
|
|
501
|
+
setDescribedByIds() {}
|
|
502
|
+
setDisabledState(isDisabled) {
|
|
503
|
+
this.disabled = isDisabled;
|
|
504
|
+
}
|
|
505
|
+
onContainerClick() {
|
|
506
|
+
if (!this.disabled) this.fileInput?.nativeElement.click();
|
|
507
|
+
}
|
|
508
|
+
writeValue(obj) {
|
|
509
|
+
this.value = obj ?? null;
|
|
510
|
+
if (!this.value && this.fileInput) this.fileInput.nativeElement.value = null;
|
|
511
|
+
this.stateChanges.next();
|
|
512
|
+
}
|
|
513
|
+
registerOnChange(fn) {
|
|
514
|
+
this.onChangeCallback = fn;
|
|
515
|
+
}
|
|
516
|
+
registerOnTouched() {}
|
|
517
|
+
ngOnDestroy() {
|
|
518
|
+
this.stateChanges.complete();
|
|
519
|
+
}
|
|
520
|
+
onDrop(event) {
|
|
521
|
+
this.preventAndStop(event);
|
|
522
|
+
if (!this.disabled && event.dataTransfer !== null) this.updateValue(event.dataTransfer.files);
|
|
523
|
+
}
|
|
524
|
+
onDragOver(event) {
|
|
525
|
+
this.preventAndStop(event);
|
|
526
|
+
}
|
|
527
|
+
onDragLeave(event) {
|
|
528
|
+
this.preventAndStop(event);
|
|
529
|
+
}
|
|
530
|
+
onFileSelected() {
|
|
531
|
+
this.updateValue(this.fileInput?.nativeElement.files);
|
|
532
|
+
}
|
|
533
|
+
preventAndStop(event) {
|
|
534
|
+
event.stopPropagation();
|
|
535
|
+
event.preventDefault();
|
|
536
|
+
}
|
|
537
|
+
updateValue(files) {
|
|
538
|
+
if (files.length > 0) {
|
|
539
|
+
this.value = files[0];
|
|
540
|
+
this.stateChanges.next();
|
|
541
|
+
this.onChangeCallback(this.value);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
545
|
+
minVersion: "12.0.0",
|
|
546
|
+
version: "22.2.0",
|
|
547
|
+
ngImport: i0,
|
|
548
|
+
type: NgssmFilePickerComponent,
|
|
549
|
+
deps: [],
|
|
550
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
551
|
+
});
|
|
552
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
553
|
+
minVersion: "17.0.0",
|
|
554
|
+
version: "22.2.0",
|
|
555
|
+
type: NgssmFilePickerComponent,
|
|
556
|
+
isStandalone: true,
|
|
557
|
+
selector: "ngssm-file-picker",
|
|
558
|
+
inputs: {
|
|
559
|
+
displayDetails: {
|
|
560
|
+
classPropertyName: "displayDetails",
|
|
561
|
+
publicName: "displayDetails",
|
|
562
|
+
isSignal: true,
|
|
563
|
+
isRequired: false,
|
|
564
|
+
transformFunction: null
|
|
565
|
+
},
|
|
566
|
+
required: {
|
|
567
|
+
classPropertyName: "required",
|
|
568
|
+
publicName: "required",
|
|
569
|
+
isSignal: false,
|
|
570
|
+
isRequired: false,
|
|
571
|
+
transformFunction: null
|
|
572
|
+
},
|
|
573
|
+
disabled: {
|
|
574
|
+
classPropertyName: "disabled",
|
|
575
|
+
publicName: "disabled",
|
|
576
|
+
isSignal: false,
|
|
577
|
+
isRequired: false,
|
|
578
|
+
transformFunction: null
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
host: { properties: { "id": "this.id" } },
|
|
582
|
+
providers: [{
|
|
583
|
+
provide: MatFormFieldControl,
|
|
584
|
+
useExisting: NgssmFilePickerComponent
|
|
585
|
+
}],
|
|
586
|
+
viewQueries: [{
|
|
587
|
+
propertyName: "fileInput",
|
|
588
|
+
first: true,
|
|
589
|
+
predicate: ["fileInput"],
|
|
590
|
+
descendants: true,
|
|
591
|
+
static: true
|
|
592
|
+
}],
|
|
593
|
+
ngImport: i0,
|
|
594
|
+
template: "<div\n class=\"file-picker-container\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n [ngClass]=\"{ 'picker-disabled': disabled }\">\n <input type=\"file\" class=\"hidden\" #fileInput (change)=\"onFileSelected()\" />\n @if (!empty) {\n <div class=\"flex-column-stretch\">\n <div class=\"file-picker-file-name\">\n {{ value?.name }}\n </div>\n @if (displayDetails()) {\n <div class=\"file-picker-file-information\">\n {{ $safeNavigationMigration(value?.size) | ngssmFileSize }}, last modified on {{ lastModificationDate }}\n </div>\n }\n </div>\n }\n</div>\n",
|
|
595
|
+
styles: [""],
|
|
596
|
+
dependencies: [
|
|
597
|
+
{
|
|
598
|
+
kind: "ngmodule",
|
|
599
|
+
type: CommonModule
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
kind: "directive",
|
|
603
|
+
type: i1$2.NgClass,
|
|
604
|
+
selector: "[ngClass]",
|
|
605
|
+
inputs: ["class", "ngClass"]
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
kind: "pipe",
|
|
609
|
+
type: NgssmFileSizePipe,
|
|
610
|
+
name: "ngssmFileSize"
|
|
611
|
+
}
|
|
612
|
+
]
|
|
613
|
+
});
|
|
614
|
+
};
|
|
615
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
616
|
+
minVersion: "12.0.0",
|
|
617
|
+
version: "22.2.0",
|
|
618
|
+
ngImport: i0,
|
|
619
|
+
type: NgssmFilePickerComponent,
|
|
620
|
+
decorators: [{
|
|
621
|
+
type: Component,
|
|
622
|
+
args: [{
|
|
623
|
+
selector: "ngssm-file-picker",
|
|
624
|
+
imports: [CommonModule, NgssmFileSizePipe],
|
|
625
|
+
providers: [{
|
|
626
|
+
provide: MatFormFieldControl,
|
|
627
|
+
useExisting: NgssmFilePickerComponent
|
|
628
|
+
}],
|
|
629
|
+
template: "<div\n class=\"file-picker-container\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n [ngClass]=\"{ 'picker-disabled': disabled }\">\n <input type=\"file\" class=\"hidden\" #fileInput (change)=\"onFileSelected()\" />\n @if (!empty) {\n <div class=\"flex-column-stretch\">\n <div class=\"file-picker-file-name\">\n {{ value?.name }}\n </div>\n @if (displayDetails()) {\n <div class=\"file-picker-file-information\">\n {{ $safeNavigationMigration(value?.size) | ngssmFileSize }}, last modified on {{ lastModificationDate }}\n </div>\n }\n </div>\n }\n</div>\n"
|
|
630
|
+
}]
|
|
631
|
+
}],
|
|
632
|
+
ctorParameters: () => [],
|
|
633
|
+
propDecorators: {
|
|
634
|
+
fileInput: [{
|
|
635
|
+
type: ViewChild,
|
|
636
|
+
args: ["fileInput", { static: true }]
|
|
637
|
+
}],
|
|
638
|
+
id: [{
|
|
639
|
+
type: HostBinding,
|
|
640
|
+
args: ["id"]
|
|
641
|
+
}],
|
|
642
|
+
displayDetails: [{
|
|
643
|
+
type: i0.Input,
|
|
644
|
+
args: [{
|
|
645
|
+
isSignal: true,
|
|
646
|
+
alias: "displayDetails",
|
|
647
|
+
required: false
|
|
648
|
+
}]
|
|
649
|
+
}],
|
|
650
|
+
required: [{ type: Input }],
|
|
651
|
+
disabled: [{ type: Input }]
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
var NgssmNotificationErrorComponent = class NgssmNotificationErrorComponent {
|
|
655
|
+
message = inject(MAT_SNACK_BAR_DATA);
|
|
656
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
657
|
+
minVersion: "12.0.0",
|
|
658
|
+
version: "22.2.0",
|
|
659
|
+
ngImport: i0,
|
|
660
|
+
type: NgssmNotificationErrorComponent,
|
|
661
|
+
deps: [],
|
|
662
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
663
|
+
});
|
|
664
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
665
|
+
minVersion: "14.0.0",
|
|
666
|
+
version: "22.2.0",
|
|
667
|
+
type: NgssmNotificationErrorComponent,
|
|
668
|
+
isStandalone: true,
|
|
669
|
+
selector: "ngssm-notification-error",
|
|
670
|
+
ngImport: i0,
|
|
671
|
+
template: "<mat-icon class=\"fa-solid fa-triangle-exclamation with-margin-right-12\" color=\"accent\"></mat-icon>\n<span class=\"ngssm-notification-error-message\">{{message}}</span>\n",
|
|
672
|
+
styles: [":host{display:flex;flex-direction:row;align-items:center}\n"],
|
|
673
|
+
dependencies: [{
|
|
674
|
+
kind: "ngmodule",
|
|
675
|
+
type: MatIconModule
|
|
676
|
+
}, {
|
|
677
|
+
kind: "component",
|
|
678
|
+
type: i1$1.MatIcon,
|
|
679
|
+
selector: "mat-icon",
|
|
680
|
+
inputs: [
|
|
681
|
+
"color",
|
|
682
|
+
"inline",
|
|
683
|
+
"svgIcon",
|
|
684
|
+
"fontSet",
|
|
685
|
+
"fontIcon"
|
|
686
|
+
],
|
|
687
|
+
exportAs: ["matIcon"]
|
|
688
|
+
}]
|
|
689
|
+
});
|
|
690
|
+
};
|
|
691
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
692
|
+
minVersion: "12.0.0",
|
|
693
|
+
version: "22.2.0",
|
|
694
|
+
ngImport: i0,
|
|
695
|
+
type: NgssmNotificationErrorComponent,
|
|
696
|
+
decorators: [{
|
|
697
|
+
type: Component,
|
|
698
|
+
args: [{
|
|
699
|
+
selector: "ngssm-notification-error",
|
|
700
|
+
imports: [MatIconModule],
|
|
701
|
+
template: "<mat-icon class=\"fa-solid fa-triangle-exclamation with-margin-right-12\" color=\"accent\"></mat-icon>\n<span class=\"ngssm-notification-error-message\">{{message}}</span>\n",
|
|
702
|
+
styles: [":host{display:flex;flex-direction:row;align-items:center}\n"]
|
|
703
|
+
}]
|
|
704
|
+
}]
|
|
705
|
+
});
|
|
706
|
+
var NgssmNotificationSuccessComponent = class NgssmNotificationSuccessComponent {
|
|
707
|
+
message = inject(MAT_SNACK_BAR_DATA);
|
|
708
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
709
|
+
minVersion: "12.0.0",
|
|
710
|
+
version: "22.2.0",
|
|
711
|
+
ngImport: i0,
|
|
712
|
+
type: NgssmNotificationSuccessComponent,
|
|
713
|
+
deps: [],
|
|
714
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
715
|
+
});
|
|
716
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
717
|
+
minVersion: "14.0.0",
|
|
718
|
+
version: "22.2.0",
|
|
719
|
+
type: NgssmNotificationSuccessComponent,
|
|
720
|
+
isStandalone: true,
|
|
721
|
+
selector: "ngssm-notification-success",
|
|
722
|
+
ngImport: i0,
|
|
723
|
+
template: "<mat-icon class=\"fa-solid fa-check with-margin-right-12 ngssm-notification-success-icon\" color=\"primary\"></mat-icon>\n<span class=\"ngssm-notification-success-message\">{{message}}</span>\n\n",
|
|
724
|
+
styles: [":host{display:flex;flex-direction:row;align-items:center}\n"],
|
|
725
|
+
dependencies: [{
|
|
726
|
+
kind: "ngmodule",
|
|
727
|
+
type: MatIconModule
|
|
728
|
+
}, {
|
|
729
|
+
kind: "component",
|
|
730
|
+
type: i1$1.MatIcon,
|
|
731
|
+
selector: "mat-icon",
|
|
732
|
+
inputs: [
|
|
733
|
+
"color",
|
|
734
|
+
"inline",
|
|
735
|
+
"svgIcon",
|
|
736
|
+
"fontSet",
|
|
737
|
+
"fontIcon"
|
|
738
|
+
],
|
|
739
|
+
exportAs: ["matIcon"]
|
|
740
|
+
}]
|
|
741
|
+
});
|
|
742
|
+
};
|
|
743
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
744
|
+
minVersion: "12.0.0",
|
|
745
|
+
version: "22.2.0",
|
|
746
|
+
ngImport: i0,
|
|
747
|
+
type: NgssmNotificationSuccessComponent,
|
|
748
|
+
decorators: [{
|
|
749
|
+
type: Component,
|
|
750
|
+
args: [{
|
|
751
|
+
selector: "ngssm-notification-success",
|
|
752
|
+
imports: [MatIconModule],
|
|
753
|
+
template: "<mat-icon class=\"fa-solid fa-check with-margin-right-12 ngssm-notification-success-icon\" color=\"primary\"></mat-icon>\n<span class=\"ngssm-notification-success-message\">{{message}}</span>\n\n",
|
|
754
|
+
styles: [":host{display:flex;flex-direction:row;align-items:center}\n"]
|
|
755
|
+
}]
|
|
756
|
+
}]
|
|
757
|
+
});
|
|
758
|
+
var NgssmNotifierService = class NgssmNotifierService {
|
|
759
|
+
matSnackBar = inject(MatSnackBar);
|
|
760
|
+
notifyError(message, detail) {
|
|
761
|
+
this.matSnackBar.openFromComponent(NgssmNotificationErrorComponent, {
|
|
762
|
+
panelClass: "ngssm-notification-panel",
|
|
763
|
+
data: detail ? `${message}: ${detail}` : message
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
notifySuccess(message) {
|
|
767
|
+
this.matSnackBar.openFromComponent(NgssmNotificationSuccessComponent, {
|
|
768
|
+
panelClass: "ngssm-notification-panel",
|
|
769
|
+
data: message
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
773
|
+
minVersion: "12.0.0",
|
|
774
|
+
version: "22.2.0",
|
|
775
|
+
ngImport: i0,
|
|
776
|
+
type: NgssmNotifierService,
|
|
777
|
+
deps: [],
|
|
778
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
779
|
+
});
|
|
780
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
781
|
+
minVersion: "12.0.0",
|
|
782
|
+
version: "22.2.0",
|
|
783
|
+
ngImport: i0,
|
|
784
|
+
type: NgssmNotifierService,
|
|
785
|
+
providedIn: "root"
|
|
786
|
+
});
|
|
787
|
+
};
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
789
|
+
minVersion: "12.0.0",
|
|
790
|
+
version: "22.2.0",
|
|
791
|
+
ngImport: i0,
|
|
792
|
+
type: NgssmNotifierService,
|
|
793
|
+
decorators: [{
|
|
794
|
+
type: Injectable,
|
|
795
|
+
args: [{ providedIn: "root" }]
|
|
796
|
+
}]
|
|
797
|
+
});
|
|
391
798
|
const defaultRegexEditorValidator = {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
catch {
|
|
412
|
-
return false;
|
|
413
|
-
}
|
|
414
|
-
return false;
|
|
415
|
-
}
|
|
799
|
+
validatePattern: (pattern) => {
|
|
800
|
+
try {
|
|
801
|
+
if (new RegExp(pattern).test("")) return { isValid: true };
|
|
802
|
+
} catch (error) {
|
|
803
|
+
return {
|
|
804
|
+
isValid: false,
|
|
805
|
+
error: error.message
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
return { isValid: true };
|
|
809
|
+
},
|
|
810
|
+
isMatch: (pattern, testString) => {
|
|
811
|
+
try {
|
|
812
|
+
if (new RegExp(pattern).test(testString)) return true;
|
|
813
|
+
} catch {
|
|
814
|
+
return false;
|
|
815
|
+
}
|
|
816
|
+
return false;
|
|
817
|
+
}
|
|
416
818
|
};
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
819
|
+
var NgssmConfirmationDialogComponent = class NgssmConfirmationDialogComponent {
|
|
820
|
+
data = inject(MAT_DIALOG_DATA);
|
|
821
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
822
|
+
minVersion: "12.0.0",
|
|
823
|
+
version: "22.2.0",
|
|
824
|
+
ngImport: i0,
|
|
825
|
+
type: NgssmConfirmationDialogComponent,
|
|
826
|
+
deps: [],
|
|
827
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
828
|
+
});
|
|
829
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
830
|
+
minVersion: "14.0.0",
|
|
831
|
+
version: "22.2.0",
|
|
832
|
+
type: NgssmConfirmationDialogComponent,
|
|
833
|
+
isStandalone: true,
|
|
834
|
+
selector: "ngssm-confirmation-dialog",
|
|
835
|
+
ngImport: i0,
|
|
836
|
+
template: "<mat-dialog-content class=\"flex-column-stretch fxFlex message-container\">\n{{data.message}}\n</mat-dialog-content>\n<mat-dialog-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button [matDialogClose]=\"data.cancelLabel\" id=\"cancelButton\">{{data.cancelLabel}}</button>\n <button mat-raised-button [color]=\"data.submitButtonColor\" [matDialogClose]=\"data.submitLabel\" id=\"submitButton\">\n {{data.submitLabel}}\n </button>\n</mat-dialog-actions>\n",
|
|
837
|
+
styles: [":host .message-container{font-weight:700}\n"],
|
|
838
|
+
dependencies: [
|
|
839
|
+
{
|
|
840
|
+
kind: "directive",
|
|
841
|
+
type: MatDialogContent,
|
|
842
|
+
selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
kind: "directive",
|
|
846
|
+
type: MatDialogActions,
|
|
847
|
+
selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]",
|
|
848
|
+
inputs: ["align"]
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
kind: "directive",
|
|
852
|
+
type: MatDialogClose,
|
|
853
|
+
selector: "[mat-dialog-close], [matDialogClose]",
|
|
854
|
+
inputs: [
|
|
855
|
+
"aria-label",
|
|
856
|
+
"type",
|
|
857
|
+
"mat-dialog-close",
|
|
858
|
+
"matDialogClose"
|
|
859
|
+
],
|
|
860
|
+
exportAs: ["matDialogClose"]
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
kind: "component",
|
|
864
|
+
type: MatButton,
|
|
865
|
+
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] ",
|
|
866
|
+
inputs: ["matButton"],
|
|
867
|
+
exportAs: ["matButton", "matAnchor"]
|
|
868
|
+
}
|
|
869
|
+
]
|
|
870
|
+
});
|
|
871
|
+
};
|
|
872
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
873
|
+
minVersion: "12.0.0",
|
|
874
|
+
version: "22.2.0",
|
|
875
|
+
ngImport: i0,
|
|
876
|
+
type: NgssmConfirmationDialogComponent,
|
|
877
|
+
decorators: [{
|
|
878
|
+
type: Component,
|
|
879
|
+
args: [{
|
|
880
|
+
selector: "ngssm-confirmation-dialog",
|
|
881
|
+
imports: [
|
|
882
|
+
MatDialogContent,
|
|
883
|
+
MatDialogActions,
|
|
884
|
+
MatDialogClose,
|
|
885
|
+
MatButton
|
|
886
|
+
],
|
|
887
|
+
template: "<mat-dialog-content class=\"flex-column-stretch fxFlex message-container\">\n{{data.message}}\n</mat-dialog-content>\n<mat-dialog-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button [matDialogClose]=\"data.cancelLabel\" id=\"cancelButton\">{{data.cancelLabel}}</button>\n <button mat-raised-button [color]=\"data.submitButtonColor\" [matDialogClose]=\"data.submitLabel\" id=\"submitButton\">\n {{data.submitLabel}}\n </button>\n</mat-dialog-actions>\n",
|
|
888
|
+
styles: [":host .message-container{font-weight:700}\n"]
|
|
889
|
+
}]
|
|
890
|
+
}]
|
|
891
|
+
});
|
|
892
|
+
var NgssmConfirmationDialogService = class NgssmConfirmationDialogService {
|
|
893
|
+
matDialog = inject(MatDialog);
|
|
894
|
+
displayConfirmationDialog(config) {
|
|
895
|
+
return this.matDialog.open(NgssmConfirmationDialogComponent, {
|
|
896
|
+
disableClose: true,
|
|
897
|
+
data: config,
|
|
898
|
+
minWidth: config.minWidth,
|
|
899
|
+
minHeight: config.minHeight
|
|
900
|
+
}).afterClosed();
|
|
901
|
+
}
|
|
902
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
903
|
+
minVersion: "12.0.0",
|
|
904
|
+
version: "22.2.0",
|
|
905
|
+
ngImport: i0,
|
|
906
|
+
type: NgssmConfirmationDialogService,
|
|
907
|
+
deps: [],
|
|
908
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
909
|
+
});
|
|
910
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
911
|
+
minVersion: "12.0.0",
|
|
912
|
+
version: "22.2.0",
|
|
913
|
+
ngImport: i0,
|
|
914
|
+
type: NgssmConfirmationDialogService,
|
|
915
|
+
providedIn: "root"
|
|
916
|
+
});
|
|
917
|
+
};
|
|
918
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
919
|
+
minVersion: "12.0.0",
|
|
920
|
+
version: "22.2.0",
|
|
921
|
+
ngImport: i0,
|
|
922
|
+
type: NgssmConfirmationDialogService,
|
|
923
|
+
decorators: [{
|
|
924
|
+
type: Injectable,
|
|
925
|
+
args: [{ providedIn: "root" }]
|
|
926
|
+
}]
|
|
927
|
+
});
|
|
928
|
+
const isNullOrUndefined = (value) => value === null || value === void 0;
|
|
929
|
+
var NgssmComponentDisplayDirective = class NgssmComponentDisplayDirective {
|
|
930
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
931
|
+
componentRef;
|
|
932
|
+
componentAction;
|
|
933
|
+
set ngssmComponentDisplay(value) {
|
|
934
|
+
this.componentRef = void 0;
|
|
935
|
+
this.viewContainerRef.clear();
|
|
936
|
+
if (value) {
|
|
937
|
+
this.componentRef = this.viewContainerRef.createComponent(value);
|
|
938
|
+
if (this.componentRef && this.componentAction) this.componentAction(this.componentRef.instance);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
set ngssmComponentAction(value) {
|
|
942
|
+
this.componentAction = value;
|
|
943
|
+
if (this.componentRef && this.componentAction) this.componentAction(this.componentRef.instance);
|
|
944
|
+
}
|
|
945
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
946
|
+
minVersion: "12.0.0",
|
|
947
|
+
version: "22.2.0",
|
|
948
|
+
ngImport: i0,
|
|
949
|
+
type: NgssmComponentDisplayDirective,
|
|
950
|
+
deps: [],
|
|
951
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
952
|
+
});
|
|
953
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
954
|
+
minVersion: "14.0.0",
|
|
955
|
+
version: "22.2.0",
|
|
956
|
+
type: NgssmComponentDisplayDirective,
|
|
957
|
+
isStandalone: true,
|
|
958
|
+
selector: "[ngssmComponentDisplay]",
|
|
959
|
+
inputs: {
|
|
960
|
+
ngssmComponentDisplay: "ngssmComponentDisplay",
|
|
961
|
+
ngssmComponentAction: "ngssmComponentAction"
|
|
962
|
+
},
|
|
963
|
+
ngImport: i0
|
|
964
|
+
});
|
|
965
|
+
};
|
|
966
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
967
|
+
minVersion: "12.0.0",
|
|
968
|
+
version: "22.2.0",
|
|
969
|
+
ngImport: i0,
|
|
970
|
+
type: NgssmComponentDisplayDirective,
|
|
971
|
+
decorators: [{
|
|
972
|
+
type: Directive,
|
|
973
|
+
args: [{ selector: "[ngssmComponentDisplay]" }]
|
|
974
|
+
}],
|
|
975
|
+
propDecorators: {
|
|
976
|
+
ngssmComponentDisplay: [{ type: Input }],
|
|
977
|
+
ngssmComponentAction: [{ type: Input }]
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
var NgssmHelpComponent = class NgssmHelpComponent {
|
|
981
|
+
help = input(...ngDevMode ? [void 0, { debugName: "help" }] : /* istanbul ignore next */ []);
|
|
982
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
983
|
+
minVersion: "12.0.0",
|
|
984
|
+
version: "22.2.0",
|
|
985
|
+
ngImport: i0,
|
|
986
|
+
type: NgssmHelpComponent,
|
|
987
|
+
deps: [],
|
|
988
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
989
|
+
});
|
|
990
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
991
|
+
minVersion: "17.0.0",
|
|
992
|
+
version: "22.2.0",
|
|
993
|
+
type: NgssmHelpComponent,
|
|
994
|
+
isStandalone: true,
|
|
995
|
+
selector: "ngssm-help",
|
|
996
|
+
inputs: { help: {
|
|
997
|
+
classPropertyName: "help",
|
|
998
|
+
publicName: "help",
|
|
999
|
+
isSignal: true,
|
|
1000
|
+
isRequired: false,
|
|
1001
|
+
transformFunction: null
|
|
1002
|
+
} },
|
|
1003
|
+
ngImport: i0,
|
|
1004
|
+
template: "<button mat-icon-button color=\"primary\" [matMenuTriggerFor]=\"helpMenu\" id=\"helpButton\">\n <mat-icon class=\"fa-solid fa-circle-question\"></mat-icon>\n</button>\n<mat-menu #helpMenu=\"matMenu\">\n @if (help(); as content) {\n <div class=\"ngssm-help-panel\" [innerHTML]=\"content\"></div>\n } @else {\n <div class=\"ngssm-help-panel\">\n <ng-content></ng-content>\n </div>\n }\n</mat-menu>\n",
|
|
1005
|
+
dependencies: [
|
|
1006
|
+
{
|
|
1007
|
+
kind: "ngmodule",
|
|
1008
|
+
type: MatButtonModule
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
kind: "component",
|
|
1012
|
+
type: i1.MatIconButton,
|
|
1013
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
1014
|
+
exportAs: ["matButton", "matAnchor"]
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
kind: "ngmodule",
|
|
1018
|
+
type: MatIconModule
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
kind: "component",
|
|
1022
|
+
type: i1$1.MatIcon,
|
|
1023
|
+
selector: "mat-icon",
|
|
1024
|
+
inputs: [
|
|
1025
|
+
"color",
|
|
1026
|
+
"inline",
|
|
1027
|
+
"svgIcon",
|
|
1028
|
+
"fontSet",
|
|
1029
|
+
"fontIcon"
|
|
1030
|
+
],
|
|
1031
|
+
exportAs: ["matIcon"]
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
kind: "ngmodule",
|
|
1035
|
+
type: MatMenuModule
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
kind: "component",
|
|
1039
|
+
type: i3.MatMenu,
|
|
1040
|
+
selector: "mat-menu",
|
|
1041
|
+
inputs: [
|
|
1042
|
+
"backdropClass",
|
|
1043
|
+
"aria-label",
|
|
1044
|
+
"aria-labelledby",
|
|
1045
|
+
"aria-describedby",
|
|
1046
|
+
"xPosition",
|
|
1047
|
+
"yPosition",
|
|
1048
|
+
"overlapTrigger",
|
|
1049
|
+
"hasBackdrop",
|
|
1050
|
+
"class",
|
|
1051
|
+
"classList"
|
|
1052
|
+
],
|
|
1053
|
+
outputs: ["closed", "close"],
|
|
1054
|
+
exportAs: ["matMenu"]
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
kind: "directive",
|
|
1058
|
+
type: i3.MatMenuTrigger,
|
|
1059
|
+
selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
|
|
1060
|
+
inputs: [
|
|
1061
|
+
"mat-menu-trigger-for",
|
|
1062
|
+
"matMenuTriggerFor",
|
|
1063
|
+
"matMenuTriggerData",
|
|
1064
|
+
"matMenuTriggerRestoreFocus"
|
|
1065
|
+
],
|
|
1066
|
+
outputs: [
|
|
1067
|
+
"menuOpened",
|
|
1068
|
+
"onMenuOpen",
|
|
1069
|
+
"menuClosed",
|
|
1070
|
+
"onMenuClose"
|
|
1071
|
+
],
|
|
1072
|
+
exportAs: ["matMenuTrigger"]
|
|
1073
|
+
}
|
|
1074
|
+
]
|
|
1075
|
+
});
|
|
1076
|
+
};
|
|
1077
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1078
|
+
minVersion: "12.0.0",
|
|
1079
|
+
version: "22.2.0",
|
|
1080
|
+
ngImport: i0,
|
|
1081
|
+
type: NgssmHelpComponent,
|
|
1082
|
+
decorators: [{
|
|
1083
|
+
type: Component,
|
|
1084
|
+
args: [{
|
|
1085
|
+
selector: "ngssm-help",
|
|
1086
|
+
imports: [
|
|
1087
|
+
MatButtonModule,
|
|
1088
|
+
MatIconModule,
|
|
1089
|
+
MatMenuModule
|
|
1090
|
+
],
|
|
1091
|
+
template: "<button mat-icon-button color=\"primary\" [matMenuTriggerFor]=\"helpMenu\" id=\"helpButton\">\n <mat-icon class=\"fa-solid fa-circle-question\"></mat-icon>\n</button>\n<mat-menu #helpMenu=\"matMenu\">\n @if (help(); as content) {\n <div class=\"ngssm-help-panel\" [innerHTML]=\"content\"></div>\n } @else {\n <div class=\"ngssm-help-panel\">\n <ng-content></ng-content>\n </div>\n }\n</mat-menu>\n"
|
|
1092
|
+
}]
|
|
1093
|
+
}],
|
|
1094
|
+
propDecorators: { help: [{
|
|
1095
|
+
type: i0.Input,
|
|
1096
|
+
args: [{
|
|
1097
|
+
isSignal: true,
|
|
1098
|
+
alias: "help",
|
|
1099
|
+
required: false
|
|
1100
|
+
}]
|
|
1101
|
+
}] }
|
|
1102
|
+
});
|
|
497
1103
|
const defaultBlobContentReaderAsString = (file) => {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
1104
|
+
const observable = new Subject();
|
|
1105
|
+
const reader = new FileReader();
|
|
1106
|
+
reader.onloadend = () => {
|
|
1107
|
+
const data = reader.result;
|
|
1108
|
+
reader.onload = null;
|
|
1109
|
+
observable.next(data);
|
|
1110
|
+
observable.complete();
|
|
1111
|
+
};
|
|
1112
|
+
reader.onerror = (error) => {
|
|
1113
|
+
observable.error(error);
|
|
1114
|
+
};
|
|
1115
|
+
reader.readAsText(file);
|
|
1116
|
+
return observable;
|
|
511
1117
|
};
|
|
512
|
-
const BLOB_CONTENT_READER_AS_STRING = new InjectionToken(
|
|
1118
|
+
const BLOB_CONTENT_READER_AS_STRING = new InjectionToken("BLOB_CONTENT_READER_AS_STRING");
|
|
513
1119
|
const provideBlobHelpers = () => {
|
|
514
|
-
|
|
1120
|
+
return makeEnvironmentProviders([{
|
|
1121
|
+
provide: BLOB_CONTENT_READER_AS_STRING,
|
|
1122
|
+
useValue: defaultBlobContentReaderAsString
|
|
1123
|
+
}]);
|
|
515
1124
|
};
|
|
516
|
-
|
|
517
1125
|
const compareDateTime = (left, right) => {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
if (left > right) {
|
|
522
|
-
return 1;
|
|
523
|
-
}
|
|
524
|
-
return 0;
|
|
1126
|
+
if (left < right) return -1;
|
|
1127
|
+
if (left > right) return 1;
|
|
1128
|
+
return 0;
|
|
525
1129
|
};
|
|
526
|
-
const toUtcDate = (value) => DateTime.fromISO(value, { zone:
|
|
527
|
-
|
|
528
|
-
const NGSSM_MAT_DIALOG_CONFIG = new InjectionToken('NGSSM_MAT_DIALOG_CONFIG');
|
|
1130
|
+
const toUtcDate = (value) => DateTime.fromISO(value, { zone: "utc" });
|
|
1131
|
+
const NGSSM_MAT_DIALOG_CONFIG = new InjectionToken("NGSSM_MAT_DIALOG_CONFIG");
|
|
529
1132
|
const provideNgssmMatDialogConfigs = (...configs) => {
|
|
530
|
-
|
|
1133
|
+
return makeEnvironmentProviders(configs.map((config) => ({
|
|
1134
|
+
provide: NGSSM_MAT_DIALOG_CONFIG,
|
|
1135
|
+
useValue: config,
|
|
1136
|
+
multi: true
|
|
1137
|
+
})));
|
|
531
1138
|
};
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
1139
|
+
var MatDialogOpeningEffect = class MatDialogOpeningEffect {
|
|
1140
|
+
processedActions = [];
|
|
1141
|
+
configs = inject(NGSSM_MAT_DIALOG_CONFIG, { optional: true });
|
|
1142
|
+
matDialog = inject(MatDialog);
|
|
1143
|
+
injector = inject(EnvironmentInjector);
|
|
1144
|
+
extendedConfigs;
|
|
1145
|
+
constructor() {
|
|
1146
|
+
const allActions = (this.configs ?? []).flatMap((c) => [c.openingAction, ...c.closingActions]);
|
|
1147
|
+
const actions = new Set(allActions);
|
|
1148
|
+
this.processedActions.push(...actions);
|
|
1149
|
+
this.extendedConfigs = (this.configs ?? []).map((c) => ({ config: c }));
|
|
1150
|
+
}
|
|
1151
|
+
processAction(actionDispatcher, state, action) {
|
|
1152
|
+
this.processActionAsClosingOne(action);
|
|
1153
|
+
this.processActionAsOpeningOne(state, action);
|
|
1154
|
+
}
|
|
1155
|
+
processActionAsOpeningOne(state, action) {
|
|
1156
|
+
const extendedConfig = this.extendedConfigs.find((c) => c.config.openingAction === action.type);
|
|
1157
|
+
if (extendedConfig) {
|
|
1158
|
+
const beforeOpeningDialog = extendedConfig.config.beforeOpeningDialog;
|
|
1159
|
+
if (beforeOpeningDialog) runInInjectionContext(this.injector, () => beforeOpeningDialog(state));
|
|
1160
|
+
extendedConfig.dialog = this.matDialog.open(extendedConfig.config.component, extendedConfig.config.matDialogConfig);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
processActionAsClosingOne(action) {
|
|
1164
|
+
this.extendedConfigs.filter((c) => c.config.closingActions.includes(action.type)).forEach((config) => {
|
|
1165
|
+
config.dialog?.close();
|
|
1166
|
+
config.dialog = void 0;
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1170
|
+
minVersion: "12.0.0",
|
|
1171
|
+
version: "22.2.0",
|
|
1172
|
+
ngImport: i0,
|
|
1173
|
+
type: MatDialogOpeningEffect,
|
|
1174
|
+
deps: [],
|
|
1175
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1176
|
+
});
|
|
1177
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1178
|
+
minVersion: "12.0.0",
|
|
1179
|
+
version: "22.2.0",
|
|
1180
|
+
ngImport: i0,
|
|
1181
|
+
type: MatDialogOpeningEffect
|
|
1182
|
+
});
|
|
1183
|
+
};
|
|
1184
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1185
|
+
minVersion: "12.0.0",
|
|
1186
|
+
version: "22.2.0",
|
|
1187
|
+
ngImport: i0,
|
|
1188
|
+
type: MatDialogOpeningEffect,
|
|
1189
|
+
decorators: [{ type: Injectable }],
|
|
1190
|
+
ctorParameters: () => []
|
|
1191
|
+
});
|
|
575
1192
|
const provideNgssmMatDialog = () => {
|
|
576
|
-
|
|
1193
|
+
return makeEnvironmentProviders([provideEffects(MatDialogOpeningEffect)]);
|
|
577
1194
|
};
|
|
578
|
-
|
|
579
|
-
/*
|
|
580
|
-
* Public API Surface of ngssm-toolkit
|
|
581
|
-
*/
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Generated bundle index. Do not edit.
|
|
585
|
-
*/
|
|
586
|
-
|
|
587
1195
|
export { BLOB_CONTENT_READER_AS_STRING, DefaultErrorStateMatcher, NGSSM_MAT_DIALOG_CONFIG, NgssmComponentDisplayDirective, NgssmComponentOverlayDirective, NgssmConfirmationDialogComponent, NgssmConfirmationDialogService, NgssmEmptyOverlayComponent, NgssmFilePickerComponent, NgssmFileSizePipe, NgssmHelpComponent, NgssmMessageOverlayComponent, NgssmNotificationErrorComponent, NgssmNotificationSuccessComponent, NgssmNotifierService, NgssmOverlayBuilder, NgssmOverlayContainer, NotFoundComponent, compareDateTime, defaultBlobContentReaderAsString, defaultRegexEditorValidator, isNullOrUndefined, noop, provideBlobHelpers, provideNgssmMatDialog, provideNgssmMatDialogConfigs, toUtcDate, useDefaultErrorStateMatcher };
|
|
588
|
-
|
|
1196
|
+
|
|
1197
|
+
//# sourceMappingURL=ngssm-toolkit.mjs.map
|