ngx-emfular-tool 1.1.0 → 1.1.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/ngx-emfular-tool.mjs +376 -0
- package/fesm2022/ngx-emfular-tool.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/alerting/alert/alert.component.d.ts +10 -0
- package/lib/alerting/alert.service.d.ts +9 -0
- package/lib/history/history.service.d.ts +29 -0
- package/lib/io/input-handler.d.ts +4 -0
- package/lib/io/io.service.d.ts +17 -0
- package/{src/lib/modal/modal-instance.ts → lib/modal/modal-instance.d.ts} +3 -4
- package/lib/modal/modal-ref.d.ts +8 -0
- package/lib/modal/modal.service.d.ts +11 -0
- package/package.json +18 -22
- package/{src/public-api.ts → public-api.d.ts} +2 -8
- package/.github/workflows/cd.yml +0 -64
- package/.github/workflows/ci.yml +0 -34
- package/ng-package.json +0 -7
- package/src/lib/alerting/alert/alert.component.css +0 -18
- package/src/lib/alerting/alert/alert.component.html +0 -7
- package/src/lib/alerting/alert/alert.component.spec.ts +0 -41
- package/src/lib/alerting/alert/alert.component.ts +0 -21
- package/src/lib/alerting/alert.service.spec.ts +0 -64
- package/src/lib/alerting/alert.service.ts +0 -28
- package/src/lib/history/history.service.spec.ts +0 -260
- package/src/lib/history/history.service.ts +0 -164
- package/src/lib/io/input-handler.spec.ts +0 -26
- package/src/lib/io/input-handler.ts +0 -15
- package/src/lib/io/io.service.spec.ts +0 -147
- package/src/lib/io/io.service.ts +0 -129
- package/src/lib/modal/modal-ref.spec.ts +0 -110
- package/src/lib/modal/modal-ref.ts +0 -23
- package/src/lib/modal/modal.service.spec.ts +0 -92
- package/src/lib/modal/modal.service.ts +0 -31
- package/src/test-setup.ts +0 -10
- package/tsconfig.lib.json +0 -18
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -13
- package/vitest.config.ts +0 -23
- package/vitest.setup.ts +0 -6
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { Subject, BehaviorSubject } from 'rxjs';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, Inject, PLATFORM_ID, Component } from '@angular/core';
|
|
4
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
6
|
+
import { __decorate, __param } from 'tslib';
|
|
7
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
8
|
+
|
|
9
|
+
class ModalRef {
|
|
10
|
+
overlayRef;
|
|
11
|
+
closedSubject = new Subject();
|
|
12
|
+
closed = this.closedSubject.asObservable();
|
|
13
|
+
constructor(overlayRef) {
|
|
14
|
+
this.overlayRef = overlayRef;
|
|
15
|
+
}
|
|
16
|
+
close(result) {
|
|
17
|
+
if (!this.overlayRef.hasAttached()) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
this.overlayRef.dispose();
|
|
21
|
+
this.closedSubject.next(result);
|
|
22
|
+
this.closedSubject.complete();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class ModalService {
|
|
27
|
+
overlay;
|
|
28
|
+
constructor(overlay) {
|
|
29
|
+
this.overlay = overlay;
|
|
30
|
+
}
|
|
31
|
+
createModal(component, config) {
|
|
32
|
+
const overlayRef = this.overlay.create(config);
|
|
33
|
+
const ref = new ModalRef(overlayRef);
|
|
34
|
+
overlayRef.backdropClick().subscribe(() => {
|
|
35
|
+
ref.close();
|
|
36
|
+
});
|
|
37
|
+
const componentRef = overlayRef.attach(new ComponentPortal(component));
|
|
38
|
+
return { ref, componentRef };
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ModalService, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ModalService, providedIn: 'root' });
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ModalService, decorators: [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{
|
|
46
|
+
providedIn: 'root'
|
|
47
|
+
}]
|
|
48
|
+
}], ctorParameters: () => [{ type: i1.Overlay }] });
|
|
49
|
+
|
|
50
|
+
let HistoryService = class HistoryService {
|
|
51
|
+
// history in a circular buffer
|
|
52
|
+
//bufferSize entries: entries are 0 to bufferSize-1, -1 is not defined
|
|
53
|
+
prefix;
|
|
54
|
+
bufferSize;
|
|
55
|
+
oldestEntryName;
|
|
56
|
+
newestEntryName;
|
|
57
|
+
currentEntryName;
|
|
58
|
+
oldestEntry = -1;
|
|
59
|
+
newestEntry = -1;
|
|
60
|
+
currentEntry = -1;
|
|
61
|
+
stateSubject = new BehaviorSubject(null);
|
|
62
|
+
state$ = this.stateSubject.asObservable();
|
|
63
|
+
constructor(prefix = 'history_', bufferSize = 50, platformId) {
|
|
64
|
+
this.prefix = prefix;
|
|
65
|
+
this.oldestEntryName = prefix + 'oldestEntry';
|
|
66
|
+
this.newestEntryName = prefix + 'newestEntry';
|
|
67
|
+
this.currentEntryName = prefix + 'currentEntry';
|
|
68
|
+
this.bufferSize = bufferSize;
|
|
69
|
+
if (isPlatformBrowser(platformId)) {
|
|
70
|
+
this.init();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
init() {
|
|
74
|
+
this.oldestEntry = this.readNumber(this.oldestEntryName);
|
|
75
|
+
this.newestEntry = this.readNumber(this.newestEntryName);
|
|
76
|
+
this.currentEntry = this.readNumber(this.currentEntryName);
|
|
77
|
+
if (this.oldestEntry == -1 || this.newestEntry == -1 || this.currentEntry == -1) {
|
|
78
|
+
this.clearHistory();
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
let entry = this.loadFromStorage(this.currentEntry);
|
|
82
|
+
this.stateSubject.next(entry);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
clearHistory() {
|
|
86
|
+
this.oldestEntry = -1;
|
|
87
|
+
this.newestEntry = -1;
|
|
88
|
+
this.currentEntry = -1;
|
|
89
|
+
this.saveNumber(this.oldestEntryName, this.oldestEntry);
|
|
90
|
+
this.saveNumber(this.newestEntryName, this.newestEntry);
|
|
91
|
+
this.saveNumber(this.currentEntryName, this.currentEntry);
|
|
92
|
+
for (let i = 1; i < this.bufferSize; i++) {
|
|
93
|
+
this.deleteEntry(i);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
save(elem) {
|
|
97
|
+
// needs to invalidate any element between the newest Entry and the current Entry, then save new Entry
|
|
98
|
+
this.invalidateTooYoungEntries();
|
|
99
|
+
// also remove one oldest entry if you need to make space
|
|
100
|
+
let next = this.incrementNumber(this.currentEntry);
|
|
101
|
+
if (next == this.oldestEntry || this.oldestEntry == -1) {
|
|
102
|
+
this.invalidateOldestEntry();
|
|
103
|
+
}
|
|
104
|
+
this.newestEntry = next;
|
|
105
|
+
this.currentEntry = next;
|
|
106
|
+
this.saveNumber(this.newestEntryName, this.newestEntry);
|
|
107
|
+
this.saveNumber(this.currentEntryName, this.currentEntry);
|
|
108
|
+
this.saveToStorage(next, elem);
|
|
109
|
+
}
|
|
110
|
+
undo() {
|
|
111
|
+
if (this.currentEntry == this.oldestEntry) { //current Entry is oldest, no decrement possible
|
|
112
|
+
console.error("Cannot undo - already reached oldest entry");
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.currentEntry = this.decrementNumber(this.currentEntry);
|
|
117
|
+
this.saveNumber(this.currentEntryName, this.currentEntry);
|
|
118
|
+
let entry = this.loadFromStorage(this.currentEntry);
|
|
119
|
+
this.stateSubject.next(entry);
|
|
120
|
+
return entry;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
isUndoNotPossible() {
|
|
124
|
+
return (this.currentEntry == this.oldestEntry);
|
|
125
|
+
}
|
|
126
|
+
redo() {
|
|
127
|
+
if (this.currentEntry == this.newestEntry) {
|
|
128
|
+
console.error("Cannot redo - already reached newest entry");
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
this.currentEntry = this.incrementNumber(this.currentEntry);
|
|
133
|
+
this.saveNumber(this.currentEntryName, this.currentEntry);
|
|
134
|
+
let entry = this.loadFromStorage(this.currentEntry);
|
|
135
|
+
this.stateSubject.next(entry);
|
|
136
|
+
return entry;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
isRedoNotPossible() {
|
|
140
|
+
return (this.currentEntry == this.newestEntry);
|
|
141
|
+
}
|
|
142
|
+
loadFromStorage(index) {
|
|
143
|
+
let itemString = localStorage.getItem(this.prefix + index);
|
|
144
|
+
if (itemString == null) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
return JSON.parse(itemString);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
saveToStorage(index, elem) {
|
|
152
|
+
localStorage.setItem(this.prefix + index, JSON.stringify(elem));
|
|
153
|
+
}
|
|
154
|
+
deleteEntry(index) {
|
|
155
|
+
localStorage.removeItem(this.prefix + index);
|
|
156
|
+
}
|
|
157
|
+
invalidateTooYoungEntries() {
|
|
158
|
+
while (this.newestEntry != this.currentEntry) {
|
|
159
|
+
this.deleteEntry(this.newestEntry);
|
|
160
|
+
this.newestEntry = this.decrementNumber(this.newestEntry);
|
|
161
|
+
}
|
|
162
|
+
this.saveNumber(this.newestEntryName, this.newestEntry);
|
|
163
|
+
}
|
|
164
|
+
invalidateOldestEntry() {
|
|
165
|
+
this.deleteEntry(this.oldestEntry);
|
|
166
|
+
this.oldestEntry = this.incrementNumber(this.oldestEntry);
|
|
167
|
+
this.saveNumber(this.oldestEntryName, this.oldestEntry);
|
|
168
|
+
}
|
|
169
|
+
readNumber(name) {
|
|
170
|
+
let maybeN = localStorage.getItem(name);
|
|
171
|
+
if (maybeN) {
|
|
172
|
+
return parseInt(maybeN, 10);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
return -1;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
saveNumber(name, num) {
|
|
179
|
+
localStorage.setItem(name, num.toString(10));
|
|
180
|
+
}
|
|
181
|
+
decrementNumber(num) {
|
|
182
|
+
if (num === 0)
|
|
183
|
+
return this.bufferSize - 1;
|
|
184
|
+
else
|
|
185
|
+
return num - 1;
|
|
186
|
+
}
|
|
187
|
+
incrementNumber(num) {
|
|
188
|
+
if (num === this.bufferSize - 1)
|
|
189
|
+
return 0;
|
|
190
|
+
else
|
|
191
|
+
return num + 1;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
HistoryService = __decorate([
|
|
195
|
+
__param(2, Inject(PLATFORM_ID))
|
|
196
|
+
], HistoryService);
|
|
197
|
+
|
|
198
|
+
class AlertComponent {
|
|
199
|
+
overlayRef;
|
|
200
|
+
message;
|
|
201
|
+
constructor(overlayRef) {
|
|
202
|
+
this.overlayRef = overlayRef;
|
|
203
|
+
}
|
|
204
|
+
closeMe() {
|
|
205
|
+
this.overlayRef.dispose();
|
|
206
|
+
}
|
|
207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AlertComponent, deps: [{ token: i1.OverlayRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
208
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: AlertComponent, isStandalone: true, selector: "alert-component", ngImport: i0, template: "<div style=\"text-align: center\">\n <h3>Warning</h3>\n <p>{{message}}</p>\n <button class=\"tool-button-text\" (click)=\"closeMe()\">\n Ok\n </button>\n</div>\n", styles: [".tool-button-text{margin:1rem;text-align:center;vertical-align:middle;color:orange;height:3rem;width:6rem;background:#fff;border:2px solid orange;border-radius:4px}.tool-button-text:hover{box-shadow:0 12px 16px #0000003d,0 17px 50px #00000030}\n"] });
|
|
209
|
+
}
|
|
210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AlertComponent, decorators: [{
|
|
211
|
+
type: Component,
|
|
212
|
+
args: [{ selector: 'alert-component', imports: [], template: "<div style=\"text-align: center\">\n <h3>Warning</h3>\n <p>{{message}}</p>\n <button class=\"tool-button-text\" (click)=\"closeMe()\">\n Ok\n </button>\n</div>\n", styles: [".tool-button-text{margin:1rem;text-align:center;vertical-align:middle;color:orange;height:3rem;width:6rem;background:#fff;border:2px solid orange;border-radius:4px}.tool-button-text:hover{box-shadow:0 12px 16px #0000003d,0 17px 50px #00000030}\n"] }]
|
|
213
|
+
}], ctorParameters: () => [{ type: i1.OverlayRef }] });
|
|
214
|
+
|
|
215
|
+
class AlertService {
|
|
216
|
+
modalService;
|
|
217
|
+
constructor(modalService) {
|
|
218
|
+
this.modalService = modalService;
|
|
219
|
+
}
|
|
220
|
+
alert(msg) {
|
|
221
|
+
const modalInstance = this.modalService.createModal(AlertComponent, {
|
|
222
|
+
width: '20%',
|
|
223
|
+
height: '30%',
|
|
224
|
+
hasBackdrop: true,
|
|
225
|
+
backdropClass: 'cdk-overlay-dark-backdrop',
|
|
226
|
+
panelClass: 'alert-overlay'
|
|
227
|
+
});
|
|
228
|
+
modalInstance.componentRef.instance.message = msg;
|
|
229
|
+
}
|
|
230
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AlertService, deps: [{ token: ModalService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
231
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AlertService, providedIn: 'root' });
|
|
232
|
+
}
|
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: AlertService, decorators: [{
|
|
234
|
+
type: Injectable,
|
|
235
|
+
args: [{
|
|
236
|
+
providedIn: 'root'
|
|
237
|
+
}]
|
|
238
|
+
}], ctorParameters: () => [{ type: ModalService }] });
|
|
239
|
+
|
|
240
|
+
class InputHandler {
|
|
241
|
+
//helps with converting an event from a number input (!) into a number...
|
|
242
|
+
// should be called on (input) while (ngModelChange) delivers the value immediately on $event
|
|
243
|
+
static getNewValueFromEvent($event) {
|
|
244
|
+
const input = $event.target;
|
|
245
|
+
return Number(input.value);
|
|
246
|
+
}
|
|
247
|
+
// this needs to be called on all input elements to allow them to accept the same value twice
|
|
248
|
+
static clearElem(event) {
|
|
249
|
+
const target = event.target;
|
|
250
|
+
target.value = '';
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
class IoService {
|
|
255
|
+
constructor() { }
|
|
256
|
+
async loadStringFromFile(event) {
|
|
257
|
+
const target = event.target;
|
|
258
|
+
const files = target.files;
|
|
259
|
+
return files[0].text();
|
|
260
|
+
}
|
|
261
|
+
saveFile(contentBlob, fileName) {
|
|
262
|
+
const link = document.createElement('a');
|
|
263
|
+
link.style.display = 'none';
|
|
264
|
+
// Attach the content to the anchor
|
|
265
|
+
link.href = URL.createObjectURL(contentBlob);
|
|
266
|
+
link.download = fileName;
|
|
267
|
+
// Append to DOM and simulate click (this will trigger the download)
|
|
268
|
+
document.body.appendChild(link);
|
|
269
|
+
link.click();
|
|
270
|
+
// Cleanup
|
|
271
|
+
document.body.removeChild(link);
|
|
272
|
+
}
|
|
273
|
+
saveJson(json, title) {
|
|
274
|
+
const contentBlob = new Blob([json], { type: 'application/json' });
|
|
275
|
+
this.saveFile(contentBlob, title + '.json');
|
|
276
|
+
}
|
|
277
|
+
cleanCopySVGAsBlob(svg) {
|
|
278
|
+
const clonedSvg = svg.cloneNode(true);
|
|
279
|
+
clonedSvg.removeAttribute('ng-version'); // remove Angular artifacts
|
|
280
|
+
const svgText = new XMLSerializer().serializeToString(clonedSvg);
|
|
281
|
+
return new Blob([svgText], { type: 'image/svg+xml' });
|
|
282
|
+
}
|
|
283
|
+
saveSVG(svgContent, title) {
|
|
284
|
+
const contentBlob = this.cleanCopySVGAsBlob(svgContent);
|
|
285
|
+
this.saveFile(contentBlob, title + '.svg');
|
|
286
|
+
}
|
|
287
|
+
saveSvgAsPng(svgContent, title) {
|
|
288
|
+
const contentBlob = this.cleanCopySVGAsBlob(svgContent);
|
|
289
|
+
this.convertSvgBlobToPngOrJpegAndDownload(contentBlob, title + '.png', true);
|
|
290
|
+
}
|
|
291
|
+
saveSvgAsJpeg(svgContent, title) {
|
|
292
|
+
const contentBlob = this.cleanCopySVGAsBlob(svgContent);
|
|
293
|
+
this.convertSvgBlobToPngOrJpegAndDownload(contentBlob, title + '.jpeg', false);
|
|
294
|
+
}
|
|
295
|
+
convertSvgBlobToPngOrJpegAndDownload(svgBlob, title, usePng) {
|
|
296
|
+
const reader = new FileReader();
|
|
297
|
+
reader.onload = () => {
|
|
298
|
+
const svgText = reader.result;
|
|
299
|
+
const img = new Image();
|
|
300
|
+
const svgBase64 = btoa(new TextEncoder()
|
|
301
|
+
.encode(svgText)
|
|
302
|
+
.reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
|
303
|
+
img.src = `data:image/svg+xml;base64,${svgBase64}`;
|
|
304
|
+
img.onload = () => {
|
|
305
|
+
this.loadImgToCanvas(img, title, usePng);
|
|
306
|
+
};
|
|
307
|
+
img.onerror = (err) => {
|
|
308
|
+
console.error('Error loading SVG image:', err);
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
reader.onerror = (err) => {
|
|
312
|
+
console.error('Error reading SVG blob:', err);
|
|
313
|
+
};
|
|
314
|
+
reader.readAsText(svgBlob);
|
|
315
|
+
}
|
|
316
|
+
canvasToPng(canvas, fileName) {
|
|
317
|
+
canvas.toBlob((pngBlob) => {
|
|
318
|
+
if (!pngBlob) {
|
|
319
|
+
console.error('Failed to convert canvas to PNG blob');
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
this.saveFile(pngBlob, fileName + '.png');
|
|
324
|
+
}
|
|
325
|
+
}, 'image/png');
|
|
326
|
+
}
|
|
327
|
+
canvasToJpeg(canvas, fileName) {
|
|
328
|
+
canvas.toBlob((jpgBlob) => {
|
|
329
|
+
if (!jpgBlob) {
|
|
330
|
+
console.error('Failed to convert canvas to JPEG blob');
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
this.saveFile(jpgBlob, fileName + '.jpeg');
|
|
335
|
+
}
|
|
336
|
+
}, 'image/jpeg', 1);
|
|
337
|
+
}
|
|
338
|
+
loadImgToCanvas(img, fileName, usePng = true) {
|
|
339
|
+
const canvas = document.createElement('canvas');
|
|
340
|
+
canvas.width = img.width;
|
|
341
|
+
canvas.height = img.height;
|
|
342
|
+
const ctx = canvas.getContext('2d');
|
|
343
|
+
if (!ctx) {
|
|
344
|
+
console.error('Canvas context not available');
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
ctx.fillStyle = '#ffffff'; // white
|
|
348
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
349
|
+
ctx.drawImage(img, 0, 0);
|
|
350
|
+
if (usePng) {
|
|
351
|
+
this.canvasToPng(canvas, fileName);
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
this.canvasToJpeg(canvas, fileName);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: IoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
358
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: IoService, providedIn: 'root' });
|
|
359
|
+
}
|
|
360
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: IoService, decorators: [{
|
|
361
|
+
type: Injectable,
|
|
362
|
+
args: [{
|
|
363
|
+
providedIn: 'root'
|
|
364
|
+
}]
|
|
365
|
+
}], ctorParameters: () => [] });
|
|
366
|
+
|
|
367
|
+
/*
|
|
368
|
+
* Public API Surface of tool
|
|
369
|
+
*/
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Generated bundle index. Do not edit.
|
|
373
|
+
*/
|
|
374
|
+
|
|
375
|
+
export { AlertComponent, AlertService, HistoryService, InputHandler, IoService, ModalRef, ModalService };
|
|
376
|
+
//# sourceMappingURL=ngx-emfular-tool.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-emfular-tool.mjs","sources":["../../src/lib/modal/modal-ref.ts","../../src/lib/modal/modal.service.ts","../../src/lib/history/history.service.ts","../../src/lib/alerting/alert/alert.component.ts","../../src/lib/alerting/alert/alert.component.html","../../src/lib/alerting/alert.service.ts","../../src/lib/io/input-handler.ts","../../src/lib/io/io.service.ts","../../src/public-api.ts","../../src/ngx-emfular-tool.ts"],"sourcesContent":["import {Subject} from 'rxjs';\nimport {OverlayRef} from \"@angular/cdk/overlay\";\n\nexport class ModalRef<R = void> {\n\n private readonly closedSubject = new Subject<R | undefined>();\n\n readonly closed = this.closedSubject.asObservable();\n\n constructor(\n private readonly overlayRef: OverlayRef\n ) {}\n\n close(result?: R): void {\n if (!this.overlayRef.hasAttached()) {\n return;\n }\n\n this.overlayRef.dispose();\n this.closedSubject.next(result);\n this.closedSubject.complete();\n }\n}","import {Injectable} from \"@angular/core\";\nimport {Overlay, OverlayConfig} from \"@angular/cdk/overlay\";\nimport {ComponentPortal, ComponentType} from \"@angular/cdk/portal\";\nimport {ModalRef} from \"./modal-ref\";\nimport {ModalInstance} from \"./modal-instance\";\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ModalService {\n\n constructor(\n private readonly overlay: Overlay,\n ) {}\n\n createModal<T, R = void>(\n component: ComponentType<T>,\n config: OverlayConfig\n ): ModalInstance<T, R> {\n const overlayRef = this.overlay.create(config);\n const ref = new ModalRef<R>(overlayRef);\n overlayRef.backdropClick().subscribe(() => {\n ref.close();\n });\n\n const componentRef = overlayRef.attach(\n new ComponentPortal(component)\n );\n return { ref, componentRef };\n }\n}","import {BehaviorSubject} from \"rxjs\";\nimport {Inject, PLATFORM_ID} from \"@angular/core\";\nimport { isPlatformBrowser } from \"@angular/common\";\n\nexport class HistoryService<T> {\n\n // history in a circular buffer\n //bufferSize entries: entries are 0 to bufferSize-1, -1 is not defined\n\n private readonly prefix: string;\n private readonly bufferSize: number;\n readonly oldestEntryName: string;\n readonly newestEntryName: string;\n readonly currentEntryName: string;\n private oldestEntry: number = -1;\n private newestEntry: number = -1;\n private currentEntry: number = -1;\n\n private stateSubject = new BehaviorSubject<T | null>(null);\n state$ = this.stateSubject.asObservable();\n\n constructor(\n prefix: string = 'history_',\n bufferSize: number = 50,\n @Inject(PLATFORM_ID) platformId: Object\n ) {\n this.prefix = prefix;\n this.oldestEntryName = prefix + 'oldestEntry';\n this.newestEntryName = prefix + 'newestEntry';\n this.currentEntryName = prefix + 'currentEntry';\n this.bufferSize = bufferSize;\n if (isPlatformBrowser(platformId)) {\n this.init()\n }\n }\n\n init() {\n this.oldestEntry = this.readNumber(this.oldestEntryName)\n this.newestEntry = this.readNumber(this.newestEntryName)\n this.currentEntry = this.readNumber(this.currentEntryName)\n if (this.oldestEntry == -1 || this.newestEntry == -1 || this.currentEntry == -1) {\n this.clearHistory()\n } else {\n let entry = this.loadFromStorage(this.currentEntry)\n this.stateSubject.next(entry)\n }\n }\n\n clearHistory() {\n this.oldestEntry = -1;\n this.newestEntry = -1;\n this.currentEntry = -1;\n this.saveNumber(this.oldestEntryName, this.oldestEntry)\n this.saveNumber(this.newestEntryName, this.newestEntry)\n this.saveNumber(this.currentEntryName, this.currentEntry)\n for (let i = 1; i < this.bufferSize; i++) {\n this.deleteEntry(i);\n }\n }\n\n save(elem: T) {\n // needs to invalidate any element between the newest Entry and the current Entry, then save new Entry\n this.invalidateTooYoungEntries()\n // also remove one oldest entry if you need to make space\n let next = this.incrementNumber(this.currentEntry)\n\n if (next == this.oldestEntry || this.oldestEntry == -1) {\n this.invalidateOldestEntry()\n }\n this.newestEntry = next\n this.currentEntry = next\n this.saveNumber(this.newestEntryName, this.newestEntry)\n this.saveNumber(this.currentEntryName, this.currentEntry)\n this.saveToStorage(next, elem)\n }\n\n undo(): T | null {\n if (this.currentEntry == this.oldestEntry) { //current Entry is oldest, no decrement possible\n console.error(\"Cannot undo - already reached oldest entry\")\n return null\n } else {\n this.currentEntry = this.decrementNumber(this.currentEntry)\n this.saveNumber(this.currentEntryName, this.currentEntry)\n let entry = this.loadFromStorage(this.currentEntry)\n this.stateSubject.next(entry)\n return entry\n }\n }\n\n isUndoNotPossible(): boolean {\n return (this.currentEntry == this.oldestEntry)\n }\n\n redo(): T | null {\n if (this.currentEntry == this.newestEntry) {\n console.error(\"Cannot redo - already reached newest entry\")\n return null\n } else {\n this.currentEntry = this.incrementNumber(this.currentEntry)\n this.saveNumber(this.currentEntryName, this.currentEntry)\n let entry = this.loadFromStorage(this.currentEntry)\n this.stateSubject.next(entry)\n return entry\n }\n }\n\n isRedoNotPossible(): boolean {\n return (this.currentEntry == this.newestEntry)\n }\n\n private loadFromStorage(index: number): T | null {\n let itemString = localStorage.getItem(this.prefix + index)\n if (itemString == null) {\n return null\n } else {\n return JSON.parse(itemString)\n }\n }\n\n private saveToStorage(index: number, elem: T): void {\n localStorage.setItem(this.prefix + index, JSON.stringify(elem))\n }\n\n private deleteEntry(index: number): void {\n localStorage.removeItem(this.prefix + index)\n }\n\n private invalidateTooYoungEntries(): void {\n while (this.newestEntry != this.currentEntry) {\n this.deleteEntry(this.newestEntry);\n this.newestEntry = this.decrementNumber(this.newestEntry)\n }\n this.saveNumber(this.newestEntryName, this.newestEntry)\n }\n\n private invalidateOldestEntry(): void {\n this.deleteEntry(this.oldestEntry)\n this.oldestEntry = this.incrementNumber(this.oldestEntry)\n this.saveNumber(this.oldestEntryName, this.oldestEntry)\n }\n\n private readNumber(name: string): number {\n let maybeN = localStorage.getItem(name)\n if (maybeN) {\n return parseInt(maybeN, 10)\n } else {\n return -1\n }\n }\n\n private saveNumber(name: string, num: number): void {\n localStorage.setItem(name, num.toString(10))\n }\n\n private decrementNumber(num: number): number {\n if (num === 0) return this.bufferSize-1\n else return num-1\n }\n\n private incrementNumber(num: number): number {\n if (num === this.bufferSize-1) return 0\n else return num+1\n }\n}\n","import { Component } from '@angular/core';\nimport {OverlayRef} from \"@angular/cdk/overlay\";\n\n@Component({\n selector: 'alert-component',\n imports: [],\n templateUrl: './alert.component.html',\n styleUrl: './alert.component.css'\n})\nexport class AlertComponent {\n\n public message!: string;\n\n constructor(\n private readonly overlayRef: OverlayRef\n ) {}\n\n closeMe(): void {\n this.overlayRef.dispose();\n }\n}\n","<div style=\"text-align: center\">\n <h3>Warning</h3>\n <p>{{message}}</p>\n <button class=\"tool-button-text\" (click)=\"closeMe()\">\n Ok\n </button>\n</div>\n","import { Injectable } from '@angular/core';\nimport {AlertComponent} from \"./alert/alert.component\";\nimport {ModalService} from \"../modal/modal.service\";\nimport {ModalInstance} from \"../modal/modal-instance\";\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AlertService {\n\n constructor(\n private readonly modalService: ModalService\n ) {}\n\n alert(msg: string): void {\n const modalInstance: ModalInstance<AlertComponent, void> = this.modalService.createModal<AlertComponent, void>(\n AlertComponent,\n {\n width: '20%',\n height: '30%',\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-dark-backdrop',\n panelClass: 'alert-overlay'\n }\n );\n modalInstance.componentRef.instance.message = msg;\n }\n}\n","export class InputHandler {\n\n //helps with converting an event from a number input (!) into a number...\n // should be called on (input) while (ngModelChange) delivers the value immediately on $event\n static getNewValueFromEvent($event: Event): number {\n const input = $event.target as HTMLInputElement;\n return Number(input.value);\n }\n\n // this needs to be called on all input elements to allow them to accept the same value twice\n static clearElem(event: Event) {\n const target = event.target as HTMLInputElement;\n target.value = ''\n }\n}\n","import {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class IoService {\n\n constructor() { }\n\n async loadStringFromFile(event: Event): Promise<string> {\n const target = event.target as HTMLInputElement;\n const files = target.files as FileList;\n return files[0].text();\n }\n\n saveFile(contentBlob: Blob, fileName: string) {\n const link = document.createElement('a')\n link.style.display = 'none'\n // Attach the content to the anchor\n link.href = URL.createObjectURL(contentBlob);\n link.download = fileName;\n // Append to DOM and simulate click (this will trigger the download)\n document.body.appendChild(link);\n link.click();\n // Cleanup\n document.body.removeChild(link);\n }\n\n saveJson(json: string, title: string) {\n const contentBlob = new Blob([json], {type: 'application/json'});\n this.saveFile(contentBlob, title+'.json');\n }\n\n cleanCopySVGAsBlob(svg: SVGElement): Blob {\n const clonedSvg = svg.cloneNode(true) as SVGElement;\n clonedSvg.removeAttribute('ng-version'); // remove Angular artifacts\n const svgText = new XMLSerializer().serializeToString(clonedSvg);\n return new Blob([svgText], { type: 'image/svg+xml' });\n }\n\n saveSVG(svgContent: SVGElement, title: string) {\n const contentBlob = this.cleanCopySVGAsBlob(svgContent);\n this.saveFile(contentBlob, title+'.svg');\n }\n\n saveSvgAsPng(svgContent: SVGElement, title: string) {\n const contentBlob = this.cleanCopySVGAsBlob(svgContent);\n this.convertSvgBlobToPngOrJpegAndDownload(contentBlob, title+'.png', true);\n }\n\n saveSvgAsJpeg(svgContent: SVGElement, title: string) {\n const contentBlob = this.cleanCopySVGAsBlob(svgContent);\n this.convertSvgBlobToPngOrJpegAndDownload(contentBlob, title+'.jpeg', false);\n }\n\n private convertSvgBlobToPngOrJpegAndDownload(svgBlob: Blob, title: string, usePng?: boolean): void {\n const reader = new FileReader();\n\n reader.onload = () => {\n const svgText = reader.result as string;\n\n const img = new Image();\n const svgBase64 = btoa(\n new TextEncoder()\n .encode(svgText)\n .reduce((data, byte) => data + String.fromCharCode(byte), '')\n )\n img.src = `data:image/svg+xml;base64,${svgBase64}`;\n\n img.onload = () => {\n this.loadImgToCanvas(img, title, usePng)\n }\n\n img.onerror = (err) => {\n console.error('Error loading SVG image:', err);\n };\n };\n\n reader.onerror = (err) => {\n console.error('Error reading SVG blob:', err);\n };\n\n reader.readAsText(svgBlob);\n }\n\n private canvasToPng(canvas: HTMLCanvasElement, fileName: string) {\n canvas.toBlob((pngBlob) => {\n if (!pngBlob) {\n console.error('Failed to convert canvas to PNG blob');\n return;\n } else {\n this.saveFile(pngBlob, fileName+'.png')\n }\n }, 'image/png');\n }\n\n private canvasToJpeg(canvas: HTMLCanvasElement, fileName: string) {\n canvas.toBlob((jpgBlob) => {\n if (!jpgBlob) {\n console.error('Failed to convert canvas to JPEG blob');\n return;\n } else {\n this.saveFile(jpgBlob, fileName+'.jpeg')\n }\n }, 'image/jpeg', 1);\n }\n\n private loadImgToCanvas(img: HTMLImageElement, fileName: string, usePng=true) {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n console.error('Canvas context not available');\n return;\n }\n\n ctx.fillStyle = '#ffffff'; // white\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(img, 0, 0);\n\n if(usePng) {\n this.canvasToPng(canvas, fileName);\n } else {\n this.canvasToJpeg(canvas, fileName);\n }\n }\n}\n","/*\n * Public API Surface of tool\n */\nexport * from './lib/modal/modal-ref';\nexport type {ModalInstance} from './lib/modal/modal-instance';\nexport * from './lib/modal/modal.service';\n\nexport * from './lib/history/history.service';\n\nexport * from './lib/alerting/alert.service';\nexport * from './lib/alerting/alert/alert.component';\n\nexport * from './lib/io/input-handler';\nexport * from './lib/io/io.service'","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ModalService"],"mappings":";;;;;;;;MAGa,QAAQ,CAAA;AAOI,IAAA,UAAA;AALJ,IAAA,aAAa,GAAG,IAAI,OAAO,EAAiB;AAEpD,IAAA,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE;AAEnD,IAAA,W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1,10 @@
|
|
|
1
|
+
import { OverlayRef } from "@angular/cdk/overlay";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AlertComponent {
|
|
4
|
+
private readonly overlayRef;
|
|
5
|
+
message: string;
|
|
6
|
+
constructor(overlayRef: OverlayRef);
|
|
7
|
+
closeMe(): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "alert-component", never, {}, {}, never, never, true, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModalService } from "../modal/modal.service";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AlertService {
|
|
4
|
+
private readonly modalService;
|
|
5
|
+
constructor(modalService: ModalService);
|
|
6
|
+
alert(msg: string): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AlertService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AlertService>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare class HistoryService<T> {
|
|
2
|
+
private readonly prefix;
|
|
3
|
+
private readonly bufferSize;
|
|
4
|
+
readonly oldestEntryName: string;
|
|
5
|
+
readonly newestEntryName: string;
|
|
6
|
+
readonly currentEntryName: string;
|
|
7
|
+
private oldestEntry;
|
|
8
|
+
private newestEntry;
|
|
9
|
+
private currentEntry;
|
|
10
|
+
private stateSubject;
|
|
11
|
+
state$: import("rxjs").Observable<T>;
|
|
12
|
+
constructor(prefix: string, bufferSize: number, platformId: Object);
|
|
13
|
+
init(): void;
|
|
14
|
+
clearHistory(): void;
|
|
15
|
+
save(elem: T): void;
|
|
16
|
+
undo(): T | null;
|
|
17
|
+
isUndoNotPossible(): boolean;
|
|
18
|
+
redo(): T | null;
|
|
19
|
+
isRedoNotPossible(): boolean;
|
|
20
|
+
private loadFromStorage;
|
|
21
|
+
private saveToStorage;
|
|
22
|
+
private deleteEntry;
|
|
23
|
+
private invalidateTooYoungEntries;
|
|
24
|
+
private invalidateOldestEntry;
|
|
25
|
+
private readNumber;
|
|
26
|
+
private saveNumber;
|
|
27
|
+
private decrementNumber;
|
|
28
|
+
private incrementNumber;
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class IoService {
|
|
3
|
+
constructor();
|
|
4
|
+
loadStringFromFile(event: Event): Promise<string>;
|
|
5
|
+
saveFile(contentBlob: Blob, fileName: string): void;
|
|
6
|
+
saveJson(json: string, title: string): void;
|
|
7
|
+
cleanCopySVGAsBlob(svg: SVGElement): Blob;
|
|
8
|
+
saveSVG(svgContent: SVGElement, title: string): void;
|
|
9
|
+
saveSvgAsPng(svgContent: SVGElement, title: string): void;
|
|
10
|
+
saveSvgAsJpeg(svgContent: SVGElement, title: string): void;
|
|
11
|
+
private convertSvgBlobToPngOrJpegAndDownload;
|
|
12
|
+
private canvasToPng;
|
|
13
|
+
private canvasToJpeg;
|
|
14
|
+
private loadImgToCanvas;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IoService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<IoService>;
|
|
17
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {ModalRef} from "./modal-ref";
|
|
2
|
-
import {ComponentRef} from "@angular/core";
|
|
3
|
-
|
|
1
|
+
import { ModalRef } from "./modal-ref";
|
|
2
|
+
import { ComponentRef } from "@angular/core";
|
|
4
3
|
export interface ModalInstance<T, R = void> {
|
|
5
4
|
readonly ref: ModalRef<R>;
|
|
6
5
|
readonly componentRef: ComponentRef<T>;
|
|
7
|
-
}
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OverlayRef } from "@angular/cdk/overlay";
|
|
2
|
+
export declare class ModalRef<R = void> {
|
|
3
|
+
private readonly overlayRef;
|
|
4
|
+
private readonly closedSubject;
|
|
5
|
+
readonly closed: import("rxjs").Observable<R>;
|
|
6
|
+
constructor(overlayRef: OverlayRef);
|
|
7
|
+
close(result?: R): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Overlay, OverlayConfig } from "@angular/cdk/overlay";
|
|
2
|
+
import { ComponentType } from "@angular/cdk/portal";
|
|
3
|
+
import { ModalInstance } from "./modal-instance";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ModalService {
|
|
6
|
+
private readonly overlay;
|
|
7
|
+
constructor(overlay: Overlay);
|
|
8
|
+
createModal<T, R = void>(component: ComponentType<T>, config: OverlayConfig): ModalInstance<T, R>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ModalService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ModalService>;
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-emfular-tool",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Small Angular library with helper schematics for EMFular, currently alerting, history, and io facilities",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"EMFular",
|
|
7
|
+
"Angular",
|
|
8
|
+
"IO",
|
|
9
|
+
"alert"
|
|
10
|
+
],
|
|
6
11
|
"author": {
|
|
7
12
|
"name": "Susanne Göbel",
|
|
8
13
|
"email": "goebel@uni-koblenz.de"
|
|
@@ -11,10 +16,6 @@
|
|
|
11
16
|
"type": "git",
|
|
12
17
|
"url": "https://github.com/softlang/EMFular-tool"
|
|
13
18
|
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "ng-packagr -p ng-package.json",
|
|
16
|
-
"test": "vitest --config vitest.config.ts"
|
|
17
|
-
},
|
|
18
19
|
"peerDependencies": {
|
|
19
20
|
"@angular/cdk": "^19.2.7",
|
|
20
21
|
"@angular/common": "^19.2.7",
|
|
@@ -26,20 +27,15 @@
|
|
|
26
27
|
"tslib": "^2.3.0"
|
|
27
28
|
},
|
|
28
29
|
"sideEffects": false,
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"jsdom": "^29.1.1",
|
|
40
|
-
"ng-packagr": "^19.2.2",
|
|
41
|
-
"playwright": "^1.61.1",
|
|
42
|
-
"vite": "^8.1.5",
|
|
43
|
-
"vitest": "^4.1.10"
|
|
30
|
+
"module": "fesm2022/ngx-emfular-tool.mjs",
|
|
31
|
+
"typings": "index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
"./package.json": {
|
|
34
|
+
"default": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./index.d.ts",
|
|
38
|
+
"default": "./fesm2022/ngx-emfular-tool.mjs"
|
|
39
|
+
}
|
|
44
40
|
}
|
|
45
|
-
}
|
|
41
|
+
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of tool
|
|
3
|
-
*/
|
|
4
1
|
export * from './lib/modal/modal-ref';
|
|
5
|
-
export type {ModalInstance} from './lib/modal/modal-instance';
|
|
2
|
+
export type { ModalInstance } from './lib/modal/modal-instance';
|
|
6
3
|
export * from './lib/modal/modal.service';
|
|
7
|
-
|
|
8
4
|
export * from './lib/history/history.service';
|
|
9
|
-
|
|
10
5
|
export * from './lib/alerting/alert.service';
|
|
11
6
|
export * from './lib/alerting/alert/alert.component';
|
|
12
|
-
|
|
13
7
|
export * from './lib/io/input-handler';
|
|
14
|
-
export * from './lib/io/io.service'
|
|
8
|
+
export * from './lib/io/io.service';
|