@posiwise/utils 0.0.146 → 0.0.148
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/{posiwise-utils-edit-navbar-modal.component-BD9hKcnO.mjs → posiwise-utils-edit-navbar-modal.component-BYy7dCnj.mjs} +4 -4
- package/fesm2022/{posiwise-utils-edit-navbar-modal.component-BD9hKcnO.mjs.map → posiwise-utils-edit-navbar-modal.component-BYy7dCnj.mjs.map} +1 -1
- package/fesm2022/posiwise-utils-quill.mjs +355 -0
- package/fesm2022/posiwise-utils-quill.mjs.map +1 -0
- package/fesm2022/posiwise-utils.mjs +39 -386
- package/fesm2022/posiwise-utils.mjs.map +1 -1
- package/package.json +5 -1
- package/types/posiwise-utils-quill.d.ts +34 -0
- package/types/posiwise-utils.d.ts +0 -34
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Quill from "quill";
|
|
2
|
-
import * as ImageResize from "quill-resize-image";
|
|
3
1
|
import "reflect-metadata";
|
|
4
2
|
import * as i3 from "@angular/common";
|
|
5
3
|
import { CommonModule } from "@angular/common";
|
|
@@ -23,357 +21,7 @@ import * as i2 from "primeng/tooltip";
|
|
|
23
21
|
import { TooltipModule } from "primeng/tooltip";
|
|
24
22
|
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
25
23
|
import { HelperService } from "@posiwise/helper-service";
|
|
26
|
-
import * as
|
|
27
|
-
const DATA_URI_IMAGE = /^data:image\//i;
|
|
28
|
-
const PASTED_IMAGE_MESSAGE = "That image was pasted, so it would be stored inside the article itself rather than on the image host — which makes the page much heavier for every reader. Upload the image somewhere first, then use the image button in the toolbar to add it by URL.";
|
|
29
|
-
function clipboardHasImageFile(clipboardData) {
|
|
30
|
-
if (!clipboardData) return false;
|
|
31
|
-
if (Array.from(clipboardData.items ?? []).some((item) => item.kind === "file" && item.type?.startsWith("image/"))) return true;
|
|
32
|
-
return Array.from(clipboardData.files ?? []).some((file) => file.type?.startsWith("image/"));
|
|
33
|
-
}
|
|
34
|
-
function isEmbeddedImageSrc(src) {
|
|
35
|
-
return DATA_URI_IMAGE.test((src ?? "").trim());
|
|
36
|
-
}
|
|
37
|
-
var PasteGuard = class {
|
|
38
|
-
constructor(quill, options) {
|
|
39
|
-
this.notify = options?.onBlocked ?? ((message) => globalThis.alert?.(message));
|
|
40
|
-
quill.root.addEventListener("paste", (event) => this.handlePaste(event), true);
|
|
41
|
-
const Delta = Quill.import("delta");
|
|
42
|
-
quill.clipboard.addMatcher("IMG", (node, delta) => {
|
|
43
|
-
if (!isEmbeddedImageSrc(node instanceof Element ? node.getAttribute("src") : null)) return delta;
|
|
44
|
-
this.notify(PASTED_IMAGE_MESSAGE);
|
|
45
|
-
return new Delta();
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
handlePaste(event) {
|
|
49
|
-
if (!clipboardHasImageFile(event.clipboardData)) return;
|
|
50
|
-
event.preventDefault();
|
|
51
|
-
event.stopPropagation();
|
|
52
|
-
this.notify(PASTED_IMAGE_MESSAGE);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const BlockEmbed = Quill.import("formats/image");
|
|
56
|
-
var NoDragImage = class extends BlockEmbed {
|
|
57
|
-
static create(value) {
|
|
58
|
-
const node = super.create();
|
|
59
|
-
node.setAttribute("src", value.url);
|
|
60
|
-
node.setAttribute("alt", value.alt || "");
|
|
61
|
-
node.setAttribute("class", "no-drag-image");
|
|
62
|
-
node.setAttribute("draggable", "false");
|
|
63
|
-
node.style.width = value.width || "300px";
|
|
64
|
-
node.style.height = value.height || "auto";
|
|
65
|
-
if (value.align) switch (value.align) {
|
|
66
|
-
case "left":
|
|
67
|
-
node.style.float = "left";
|
|
68
|
-
node.style.marginRight = "1em";
|
|
69
|
-
break;
|
|
70
|
-
case "right":
|
|
71
|
-
node.style.float = "right";
|
|
72
|
-
node.style.marginLeft = "1em";
|
|
73
|
-
break;
|
|
74
|
-
case "center":
|
|
75
|
-
node.style.display = "block";
|
|
76
|
-
node.style.marginLeft = "auto";
|
|
77
|
-
node.style.marginRight = "auto";
|
|
78
|
-
break;
|
|
79
|
-
default: node.style.float = "none";
|
|
80
|
-
}
|
|
81
|
-
return node;
|
|
82
|
-
}
|
|
83
|
-
static value(node) {
|
|
84
|
-
return {
|
|
85
|
-
url: node.getAttribute("src"),
|
|
86
|
-
alt: node.getAttribute("alt"),
|
|
87
|
-
width: node.getAttribute("data-width") || node.style.width,
|
|
88
|
-
height: node.getAttribute("data-height") || node.style.height,
|
|
89
|
-
align: node.style.float || "center"
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
var NoDragDrop = class {
|
|
94
|
-
constructor(quill, _options) {
|
|
95
|
-
quill.root.addEventListener("drop", this.handleDrop.bind(this, quill));
|
|
96
|
-
quill.root.addEventListener("dragover", this.preventDefault);
|
|
97
|
-
}
|
|
98
|
-
preventDefault(e) {
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
e.stopPropagation();
|
|
101
|
-
}
|
|
102
|
-
handleDrop(quill, e) {
|
|
103
|
-
this.preventDefault(e);
|
|
104
|
-
const observer = new MutationObserver((mutations) => {
|
|
105
|
-
this.removeInsertedImages(quill, mutations);
|
|
106
|
-
});
|
|
107
|
-
observer.observe(quill.root, {
|
|
108
|
-
childList: true,
|
|
109
|
-
subtree: true
|
|
110
|
-
});
|
|
111
|
-
setTimeout(() => {
|
|
112
|
-
observer.disconnect();
|
|
113
|
-
}, 1e3);
|
|
114
|
-
}
|
|
115
|
-
removeInsertedImages(quill, mutations) {
|
|
116
|
-
mutations.forEach((mutation) => {
|
|
117
|
-
mutation.addedNodes.forEach((node) => {
|
|
118
|
-
if (node instanceof HTMLImageElement) node.remove();
|
|
119
|
-
else if (node.nodeType === Node.ELEMENT_NODE) node.querySelectorAll("img").forEach((img) => img.remove());
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
NoDragImage["blotName"] = "no-drag-image";
|
|
125
|
-
NoDragImage["tagName"] = "img";
|
|
126
|
-
Quill.register(NoDragImage);
|
|
127
|
-
Quill.register("modules/noDragDrop", NoDragDrop);
|
|
128
|
-
Quill.register("modules/imageResize", ImageResize.default || ImageResize);
|
|
129
|
-
const BlockEmbedVideo = Quill.import("blots/block/embed");
|
|
130
|
-
var NoDragVideo = class extends BlockEmbedVideo {
|
|
131
|
-
static create(value) {
|
|
132
|
-
const node = document.createElement("iframe");
|
|
133
|
-
node.setAttribute("src", value.url);
|
|
134
|
-
node.setAttribute("frameborder", "0");
|
|
135
|
-
node.setAttribute("allowfullscreen", "true");
|
|
136
|
-
node.setAttribute("width", value.width || "100%");
|
|
137
|
-
node.setAttribute("height", value.height || "200px");
|
|
138
|
-
node.setAttribute("class", "no-drag-media");
|
|
139
|
-
node.setAttribute("contenteditable", "false");
|
|
140
|
-
if (value.url && (value.url.includes("youtube.com") || value.url.includes("youtu.be"))) {
|
|
141
|
-
node.setAttribute("allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");
|
|
142
|
-
if (value.url && !value.url.includes("youtube-nocookie.com") && !value.url.includes("enablejsapi=1")) try {
|
|
143
|
-
const url = new URL(value.url);
|
|
144
|
-
url.searchParams.set("enablejsapi", "1");
|
|
145
|
-
if (typeof window !== "undefined" && window.location) url.searchParams.set("origin", window.location.origin);
|
|
146
|
-
node.setAttribute("src", url.toString());
|
|
147
|
-
} catch {
|
|
148
|
-
const separator = value.url.includes("?") ? "&" : "?";
|
|
149
|
-
node.setAttribute("src", `${value.url}${separator}enablejsapi=1`);
|
|
150
|
-
}
|
|
151
|
-
} else if (value.url && value.url.includes("loom.com")) node.setAttribute("allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");
|
|
152
|
-
else node.setAttribute("allow", "fullscreen");
|
|
153
|
-
const container = document.createElement("div");
|
|
154
|
-
container.setAttribute("class", "media-container");
|
|
155
|
-
container.style.position = "relative";
|
|
156
|
-
container.style.width = "100%";
|
|
157
|
-
container.style.height = "auto";
|
|
158
|
-
container.appendChild(node);
|
|
159
|
-
if (!container.querySelector(".media-remove-button")) {
|
|
160
|
-
const removeButton = this.createRemoveButton(container);
|
|
161
|
-
removeButton.setAttribute("contenteditable", "false");
|
|
162
|
-
container.appendChild(removeButton);
|
|
163
|
-
}
|
|
164
|
-
if (!container.querySelector(".media-align-buttons")) {
|
|
165
|
-
const alignButtons = this.createAlignButtons(container);
|
|
166
|
-
alignButtons.setAttribute("contenteditable", "false");
|
|
167
|
-
container.appendChild(alignButtons);
|
|
168
|
-
}
|
|
169
|
-
if (!container.querySelector(".media-resize-buttons")) {
|
|
170
|
-
const resizeButtons = this.createResizeButtons(container);
|
|
171
|
-
resizeButtons.setAttribute("contenteditable", "false");
|
|
172
|
-
container.appendChild(resizeButtons);
|
|
173
|
-
}
|
|
174
|
-
container.setAttribute("contenteditable", "false");
|
|
175
|
-
return container;
|
|
176
|
-
}
|
|
177
|
-
static createAlignButtons(container) {
|
|
178
|
-
const buttonContainer = document.createElement("div");
|
|
179
|
-
buttonContainer.setAttribute("class", "media-align-buttons");
|
|
180
|
-
buttonContainer.style.position = "absolute";
|
|
181
|
-
buttonContainer.style.top = "0";
|
|
182
|
-
buttonContainer.style.right = "0";
|
|
183
|
-
buttonContainer.style.display = "flex";
|
|
184
|
-
buttonContainer.setAttribute("contenteditable", "false");
|
|
185
|
-
const leftButton = this.createButton("Left", () => {
|
|
186
|
-
container.style.textAlign = "left";
|
|
187
|
-
container.setAttribute("data-align", "left");
|
|
188
|
-
});
|
|
189
|
-
const centerButton = this.createButton("Center", () => {
|
|
190
|
-
container.style.textAlign = "center";
|
|
191
|
-
container.setAttribute("data-align", "center");
|
|
192
|
-
});
|
|
193
|
-
const rightButton = this.createButton("Right", () => {
|
|
194
|
-
container.style.textAlign = "right";
|
|
195
|
-
container.setAttribute("data-align", "right");
|
|
196
|
-
});
|
|
197
|
-
buttonContainer.appendChild(leftButton);
|
|
198
|
-
buttonContainer.appendChild(centerButton);
|
|
199
|
-
buttonContainer.appendChild(rightButton);
|
|
200
|
-
return buttonContainer;
|
|
201
|
-
}
|
|
202
|
-
static createRemoveButton(container) {
|
|
203
|
-
const wrapper = document.createElement("div");
|
|
204
|
-
wrapper.setAttribute("class", "media-remove-button");
|
|
205
|
-
wrapper.style.position = "absolute";
|
|
206
|
-
wrapper.style.top = "0";
|
|
207
|
-
wrapper.style.left = "0";
|
|
208
|
-
wrapper.style.display = "flex";
|
|
209
|
-
wrapper.setAttribute("contenteditable", "false");
|
|
210
|
-
const removeButton = this.createButton("Remove", () => {
|
|
211
|
-
const mediaContainer = container.classList.contains("media-container") ? container : container.closest(".media-container");
|
|
212
|
-
if (mediaContainer) {
|
|
213
|
-
const blot = Quill.find(mediaContainer);
|
|
214
|
-
if (blot && "remove" in blot && typeof blot.remove === "function") blot.remove();
|
|
215
|
-
else mediaContainer.remove();
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
removeButton.style.background = "rgb(243, 67, 67)";
|
|
219
|
-
removeButton.style.color = "white";
|
|
220
|
-
removeButton.style.border = "none";
|
|
221
|
-
removeButton.style.padding = "2px 8px";
|
|
222
|
-
removeButton.style.marginTop = "2px";
|
|
223
|
-
removeButton.style.borderRadius = "4px";
|
|
224
|
-
removeButton.title = "Remove video";
|
|
225
|
-
wrapper.appendChild(removeButton);
|
|
226
|
-
return wrapper;
|
|
227
|
-
}
|
|
228
|
-
static createResizeButtons(container) {
|
|
229
|
-
const buttonContainer = document.createElement("div");
|
|
230
|
-
buttonContainer.setAttribute("class", "media-resize-buttons");
|
|
231
|
-
buttonContainer.style.position = "absolute";
|
|
232
|
-
buttonContainer.style.bottom = "5px";
|
|
233
|
-
buttonContainer.style.right = "5px";
|
|
234
|
-
buttonContainer.style.display = "flex";
|
|
235
|
-
buttonContainer.setAttribute("contenteditable", "false");
|
|
236
|
-
const updateWidthAndHeight = (mediaElement, width, height) => {
|
|
237
|
-
mediaElement.style.width = width;
|
|
238
|
-
mediaElement.style.height = height;
|
|
239
|
-
container.setAttribute("data-width", width);
|
|
240
|
-
container.setAttribute("data-height", height);
|
|
241
|
-
};
|
|
242
|
-
const increaseWidthButton = this.createButton("Increase Width", () => {
|
|
243
|
-
const mediaElement = container.querySelector(".no-drag-media");
|
|
244
|
-
const currentWidth = parseInt(mediaElement.style.width || "100%");
|
|
245
|
-
updateWidthAndHeight(mediaElement, `${currentWidth + 20}px`, mediaElement.style.height);
|
|
246
|
-
});
|
|
247
|
-
const decreaseWidthButton = this.createButton("Decrease Width", () => {
|
|
248
|
-
const mediaElement = container.querySelector(".no-drag-media");
|
|
249
|
-
const currentWidth = parseInt(mediaElement.style.width || "100%");
|
|
250
|
-
updateWidthAndHeight(mediaElement, `${Math.max(100, currentWidth - 20)}px`, mediaElement.style.height);
|
|
251
|
-
});
|
|
252
|
-
const increaseHeightButton = this.createButton("Increase Height", () => {
|
|
253
|
-
const mediaElement = container.querySelector(".no-drag-media");
|
|
254
|
-
const currentHeight = parseInt(mediaElement.style.height || "200px");
|
|
255
|
-
updateWidthAndHeight(mediaElement, mediaElement.style.width, `${currentHeight + 20}px`);
|
|
256
|
-
});
|
|
257
|
-
const decreaseHeightButton = this.createButton("Decrease Height", () => {
|
|
258
|
-
const mediaElement = container.querySelector(".no-drag-media");
|
|
259
|
-
const currentHeight = parseInt(mediaElement.style.height || "200px");
|
|
260
|
-
updateWidthAndHeight(mediaElement, mediaElement.style.width, `${Math.max(100, currentHeight - 20)}px`);
|
|
261
|
-
});
|
|
262
|
-
buttonContainer.appendChild(increaseWidthButton);
|
|
263
|
-
buttonContainer.appendChild(decreaseWidthButton);
|
|
264
|
-
buttonContainer.appendChild(increaseHeightButton);
|
|
265
|
-
buttonContainer.appendChild(decreaseHeightButton);
|
|
266
|
-
return buttonContainer;
|
|
267
|
-
}
|
|
268
|
-
static createButton(label, onClick) {
|
|
269
|
-
const button = document.createElement("button");
|
|
270
|
-
button.innerHTML = label;
|
|
271
|
-
button.style.margin = "0 5px";
|
|
272
|
-
button.style.cursor = "pointer";
|
|
273
|
-
button.setAttribute("contenteditable", "false");
|
|
274
|
-
button.style.pointerEvents = "auto";
|
|
275
|
-
button.onclick = (event) => {
|
|
276
|
-
event.preventDefault();
|
|
277
|
-
event.stopPropagation();
|
|
278
|
-
onClick();
|
|
279
|
-
};
|
|
280
|
-
return button;
|
|
281
|
-
}
|
|
282
|
-
static value(container) {
|
|
283
|
-
const iframe = container.querySelector("iframe");
|
|
284
|
-
return {
|
|
285
|
-
url: iframe?.getAttribute("src"),
|
|
286
|
-
width: container.getAttribute("data-width") || iframe?.getAttribute("width"),
|
|
287
|
-
height: container.getAttribute("data-height") || iframe?.getAttribute("height"),
|
|
288
|
-
align: container.getAttribute("data-align") || "center"
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
NoDragVideo["blotName"] = "no-drag-video";
|
|
293
|
-
NoDragVideo["tagName"] = "div";
|
|
294
|
-
Quill.register(NoDragVideo);
|
|
295
|
-
var QuillHelper = class {
|
|
296
|
-
static init() {
|
|
297
|
-
if (!Quill.imports["formats/no-drag-image"]) Quill.register(NoDragImage);
|
|
298
|
-
if (!Quill.imports["formats/no-drag-video"]) Quill.register(NoDragVideo);
|
|
299
|
-
if (!Quill.imports["modules/imageResize"]) Quill.register("modules/imageResize", ImageResize.default || ImageResize);
|
|
300
|
-
if (!Quill.imports["modules/noDragDrop"]) Quill.register("modules/noDragDrop", NoDragDrop);
|
|
301
|
-
if (!Quill.imports["modules/pasteGuard"]) Quill.register("modules/pasteGuard", PasteGuard);
|
|
302
|
-
}
|
|
303
|
-
static getEditorConfig(additionalToolbarConfig = []) {
|
|
304
|
-
return {
|
|
305
|
-
toolbar: {
|
|
306
|
-
container: [...[
|
|
307
|
-
[
|
|
308
|
-
"bold",
|
|
309
|
-
"italic",
|
|
310
|
-
"underline",
|
|
311
|
-
"strike"
|
|
312
|
-
],
|
|
313
|
-
["blockquote", "code-block"],
|
|
314
|
-
[{ header: 1 }, { header: 2 }],
|
|
315
|
-
[{ list: "ordered" }, { list: "bullet" }],
|
|
316
|
-
[{ script: "sub" }, { script: "super" }],
|
|
317
|
-
[{ indent: "-1" }, { indent: "+1" }],
|
|
318
|
-
[{ direction: "rtl" }],
|
|
319
|
-
[{ header: [
|
|
320
|
-
1,
|
|
321
|
-
2,
|
|
322
|
-
3,
|
|
323
|
-
4,
|
|
324
|
-
5,
|
|
325
|
-
6,
|
|
326
|
-
false
|
|
327
|
-
] }],
|
|
328
|
-
[{ color: [] }, { background: [] }],
|
|
329
|
-
[{ align: [] }],
|
|
330
|
-
[
|
|
331
|
-
"link",
|
|
332
|
-
"image",
|
|
333
|
-
"video"
|
|
334
|
-
],
|
|
335
|
-
["clean"],
|
|
336
|
-
["table"]
|
|
337
|
-
], ...additionalToolbarConfig],
|
|
338
|
-
handlers: {
|
|
339
|
-
image: function() {
|
|
340
|
-
const range = this.quill.getSelection();
|
|
341
|
-
const value = prompt("Enter image URL:");
|
|
342
|
-
if (value) {
|
|
343
|
-
this.quill.insertEmbed(range.index, "no-drag-image", { url: value });
|
|
344
|
-
this.quill.insertText(range.index + 1, "\n", Quill.sources.USER);
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
video: function() {
|
|
348
|
-
const range = this.quill.getSelection();
|
|
349
|
-
let value = prompt("Enter video URL:");
|
|
350
|
-
if (value?.includes("youtube.com/watch?v=")) value = `https://www.youtube.com/embed/${value.split("v=")[1]}`;
|
|
351
|
-
else if (value?.includes("youtu.be/")) value = `https://www.youtube.com/embed/${value.split(".be/")[1]}`;
|
|
352
|
-
else if (value?.includes("loom.com/share/")) value = `https://www.loom.com/embed/${value.split("share/")[1]}`;
|
|
353
|
-
else if (value?.includes("capture.dropbox.com/")) {
|
|
354
|
-
const videoId = value.split("capture.dropbox.com/")[1];
|
|
355
|
-
if (videoId.includes("embed")) value = `https://capture.dropbox.com/${videoId}`;
|
|
356
|
-
else value = `https://capture.dropbox.com/embed/${videoId}`;
|
|
357
|
-
}
|
|
358
|
-
if (value) {
|
|
359
|
-
const useIframe = value.includes("youtube.com") || value.includes("youtu.be") || value.includes("loom.com") || value.includes("drop");
|
|
360
|
-
this.quill.insertEmbed(range.index, "no-drag-video", {
|
|
361
|
-
url: value,
|
|
362
|
-
isEdit: true,
|
|
363
|
-
width: useIframe ? "560px" : "640px",
|
|
364
|
-
height: useIframe ? "315px" : "360px"
|
|
365
|
-
});
|
|
366
|
-
this.quill.insertText(range.index + 1, "\n", Quill.sources.USER);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
imageResize: { displaySize: true },
|
|
372
|
-
noDragDrop: true,
|
|
373
|
-
pasteGuard: true
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
};
|
|
24
|
+
import * as i3$1 from "@jsverse/transloco";
|
|
377
25
|
function checkFormValidation(form) {
|
|
378
26
|
if (!form.valid) {
|
|
379
27
|
form.markAllAsTouched();
|
|
@@ -484,7 +132,7 @@ var ProfileImageCropperComponent = class ProfileImageCropperComponent {
|
|
|
484
132
|
static {
|
|
485
133
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
486
134
|
minVersion: "12.0.0",
|
|
487
|
-
version: "22.2.
|
|
135
|
+
version: "22.2.3",
|
|
488
136
|
ngImport: i0,
|
|
489
137
|
type: ProfileImageCropperComponent,
|
|
490
138
|
deps: [{ token: i0.ChangeDetectorRef }],
|
|
@@ -494,7 +142,7 @@ var ProfileImageCropperComponent = class ProfileImageCropperComponent {
|
|
|
494
142
|
static {
|
|
495
143
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
496
144
|
minVersion: "17.0.0",
|
|
497
|
-
version: "22.2.
|
|
145
|
+
version: "22.2.3",
|
|
498
146
|
type: ProfileImageCropperComponent,
|
|
499
147
|
isStandalone: false,
|
|
500
148
|
selector: "pw-image-cropper",
|
|
@@ -508,8 +156,8 @@ var ProfileImageCropperComponent = class ProfileImageCropperComponent {
|
|
|
508
156
|
fileChangeEvent: "fileChangeEvent"
|
|
509
157
|
},
|
|
510
158
|
ngImport: i0,
|
|
511
|
-
template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n
|
|
512
|
-
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"],
|
|
159
|
+
template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n {{ 'Utils.ImageCropper.UploadPicture' | transloco }}\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" name=\"input_field_1\"\n [attr.aria-label]=\"'Utils.ImageCropper.UploadPicture' | transloco\"/>\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.RotateLeft' | transloco\">\n <i\n class=\"fa fa-undo-alt\"\n (click)=\"rotateLeft()\"\n (keydown.enter)=\"rotateLeft()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.RotateRight' | transloco\">\n <i\n class=\"fa fa-redo-alt\"\n (click)=\"rotateRight()\"\n (keydown.enter)=\"rotateRight()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.FlipHorizontal' | transloco\">\n <i\n class=\"fa fa-arrows-alt-h\"\n (click)=\"flipHorizontal()\"\n (keydown.enter)=\"flipHorizontal()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.FlipVertical' | transloco\">\n <i\n class=\"fa fa-arrows-alt-v\"\n (click)=\"flipVertical()\"\n (keydown.enter)=\"flipVertical()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-8\">\n @if (aspectRatio === 'auto') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [aspectRatio]=\"4 / 4\"\n [onlyScaleDown]=\"true\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'fullLogo') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"5 / 1.1\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'rectangular') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"3 / 1\"\n [onlyScaleDown]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'dynamic') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"false\"\n [resizeToWidth]=\"0\"\n [cropperStaticWidth]=\"0\"\n [cropperStaticHeight]=\"0\"\n [cropperMinWidth]=\"10\"\n [cropperMinHeight]=\"10\"\n [onlyScaleDown]=\"false\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n [imageQuality]=\"100\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [style.display]=\"showCropper ? null : 'none'\">\n </image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'custom') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [aspectRatio]=\"4 / 3\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n </div>\n @if (croppedImage) {\n <div class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n [alt]=\"'Utils.ImageCropper.CroppedAlt' | transloco\"\n width=\"128\" />\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <div class=\"float-end mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCloseModal()\">\n {{ 'Common.Close' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n {{ 'Button.Save' | transloco }}\n </button>\n </div>\n </div>\n</section>\n",
|
|
160
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--pw-hairline: #e2e5ea;--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"],
|
|
513
161
|
dependencies: [
|
|
514
162
|
{
|
|
515
163
|
kind: "component",
|
|
@@ -573,6 +221,11 @@ var ProfileImageCropperComponent = class ProfileImageCropperComponent {
|
|
|
573
221
|
kind: "directive",
|
|
574
222
|
type: i2$1.LazyImgDirective,
|
|
575
223
|
selector: "img"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
kind: "pipe",
|
|
227
|
+
type: i3$1.TranslocoPipe,
|
|
228
|
+
name: "transloco"
|
|
576
229
|
}
|
|
577
230
|
]
|
|
578
231
|
});
|
|
@@ -580,7 +233,7 @@ var ProfileImageCropperComponent = class ProfileImageCropperComponent {
|
|
|
580
233
|
};
|
|
581
234
|
i0.ɵɵngDeclareClassMetadata({
|
|
582
235
|
minVersion: "12.0.0",
|
|
583
|
-
version: "22.2.
|
|
236
|
+
version: "22.2.3",
|
|
584
237
|
ngImport: i0,
|
|
585
238
|
type: ProfileImageCropperComponent,
|
|
586
239
|
decorators: [{
|
|
@@ -588,8 +241,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
588
241
|
args: [{
|
|
589
242
|
selector: "pw-image-cropper",
|
|
590
243
|
standalone: false,
|
|
591
|
-
template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n
|
|
592
|
-
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"]
|
|
244
|
+
template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n {{ 'Utils.ImageCropper.UploadPicture' | transloco }}\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" name=\"input_field_1\"\n [attr.aria-label]=\"'Utils.ImageCropper.UploadPicture' | transloco\"/>\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.RotateLeft' | transloco\">\n <i\n class=\"fa fa-undo-alt\"\n (click)=\"rotateLeft()\"\n (keydown.enter)=\"rotateLeft()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.RotateRight' | transloco\">\n <i\n class=\"fa fa-redo-alt\"\n (click)=\"rotateRight()\"\n (keydown.enter)=\"rotateRight()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.FlipHorizontal' | transloco\">\n <i\n class=\"fa fa-arrows-alt-h\"\n (click)=\"flipHorizontal()\"\n (keydown.enter)=\"flipHorizontal()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn btn-primary btn-sm mx-2\"\n [title]=\"'Utils.ImageCropper.FlipVertical' | transloco\">\n <i\n class=\"fa fa-arrows-alt-v\"\n (click)=\"flipVertical()\"\n (keydown.enter)=\"flipVertical()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-8\">\n @if (aspectRatio === 'auto') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [aspectRatio]=\"4 / 4\"\n [onlyScaleDown]=\"true\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'fullLogo') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"5 / 1.1\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'rectangular') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"3 / 1\"\n [onlyScaleDown]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'dynamic') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"false\"\n [resizeToWidth]=\"0\"\n [cropperStaticWidth]=\"0\"\n [cropperStaticHeight]=\"0\"\n [cropperMinWidth]=\"10\"\n [cropperMinHeight]=\"10\"\n [onlyScaleDown]=\"false\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n [imageQuality]=\"100\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [style.display]=\"showCropper ? null : 'none'\">\n </image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'custom') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [aspectRatio]=\"4 / 3\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n </div>\n @if (croppedImage) {\n <div class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n [alt]=\"'Utils.ImageCropper.CroppedAlt' | transloco\"\n width=\"128\" />\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <div class=\"float-end mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCloseModal()\">\n {{ 'Common.Close' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n {{ 'Button.Save' | transloco }}\n </button>\n </div>\n </div>\n</section>\n",
|
|
245
|
+
styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--pw-hairline: #e2e5ea;--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"]
|
|
593
246
|
}]
|
|
594
247
|
}],
|
|
595
248
|
ctorParameters: () => [{ type: i0.ChangeDetectorRef }],
|
|
@@ -694,7 +347,7 @@ var CustomUploaderComponent = class CustomUploaderComponent extends AppBaseCompo
|
|
|
694
347
|
static {
|
|
695
348
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
696
349
|
minVersion: "12.0.0",
|
|
697
|
-
version: "22.2.
|
|
350
|
+
version: "22.2.3",
|
|
698
351
|
ngImport: i0,
|
|
699
352
|
type: CustomUploaderComponent,
|
|
700
353
|
deps: [
|
|
@@ -708,7 +361,7 @@ var CustomUploaderComponent = class CustomUploaderComponent extends AppBaseCompo
|
|
|
708
361
|
static {
|
|
709
362
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
710
363
|
minVersion: "17.0.0",
|
|
711
|
-
version: "22.2.
|
|
364
|
+
version: "22.2.3",
|
|
712
365
|
type: CustomUploaderComponent,
|
|
713
366
|
isStandalone: false,
|
|
714
367
|
selector: "pw-custom-uploader",
|
|
@@ -721,7 +374,7 @@ var CustomUploaderComponent = class CustomUploaderComponent extends AppBaseCompo
|
|
|
721
374
|
outputs: { saveEvent: "saveEvent" },
|
|
722
375
|
usesInheritance: true,
|
|
723
376
|
ngImport: i0,
|
|
724
|
-
template: "<div class=\"pw-uploader-card\">\n <!-- empty state — dashed dropzone (admin-edit-form.md § 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('
|
|
377
|
+
template: "<div class=\"pw-uploader-card\">\n <!-- empty state — dashed dropzone (admin-edit-form.md § 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('Utils.Uploader.UploadTitle' | transloco: { title: title }) : ('Utils.Uploader.UploadImage' | transloco)\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n <i class=\"fas fa-upload\" aria-hidden=\"true\"></i>\n <span class=\"dropzone-title\">{{ 'Utils.Uploader.UploadImage' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n <!-- populated — framed image + Change / Delete affordances -->\n @if (previewData?.url && !previewBroken) {\n <div class=\"pw-uploader-preview\">\n <a [href]=\"previewData?.url\"\n target=\"_blank\"\n class=\"pw-uploader-thumb\">\n <img [src]=\"previewSrc\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgError()\"\n class=\"img-fluid pw-uploader-img\" />\n </a>\n <div class=\"pw-uploader-actions\">\n <a class=\"pw-uploader-change\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n <i\n appendTo=\"body\"\n [pTooltip]=\"'Button.Delete' | transloco\"\n tooltipPosition=\"top\"\n (click)=\"deleteExistingFile()\"\n (keydown.enter)=\"deleteExistingFile()\"\n (keydown.space)=\"deleteExistingFile()\"\n class=\"fa fa-trash delete-icon\"\n aria-hidden=\"true\"\n ></i>\n </div>\n </div>\n }\n</div>\n<!-- image cropper -->\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ title }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end float-end\"\n [attr.aria-label]=\"'Common.Close' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n [aspectRatio]=\"aspectRatio\"\n (fileChangeEvent)=\"onFileChange($event)\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
725
378
|
styles: ["@charset \"UTF-8\";.pw-uploader-card{border:0;background:transparent;min-height:180px;padding:0}.pw-uploader-dropzone{width:100%;min-height:180px;padding:1rem}.pw-uploader-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;min-height:180px;padding:1rem;border:1px solid #e2e5ea;border-radius:8px;background:#fff}.pw-uploader-thumb{display:flex;align-items:center;justify-content:center;max-width:100%}.pw-uploader-img{max-height:120px;object-fit:contain}.pw-uploader-actions{display:flex;align-items:center;gap:1rem}.pw-uploader-change{color:var(--first, #1769e1);font-size:14px;font-weight:600;cursor:pointer;text-decoration:none}.pw-uploader-change:hover{text-decoration:underline}.delete-icon{cursor:pointer}\n"],
|
|
726
379
|
dependencies: [
|
|
727
380
|
{
|
|
@@ -770,7 +423,7 @@ var CustomUploaderComponent = class CustomUploaderComponent extends AppBaseCompo
|
|
|
770
423
|
},
|
|
771
424
|
{
|
|
772
425
|
kind: "pipe",
|
|
773
|
-
type:
|
|
426
|
+
type: i3$1.TranslocoPipe,
|
|
774
427
|
name: "transloco"
|
|
775
428
|
}
|
|
776
429
|
]
|
|
@@ -779,7 +432,7 @@ var CustomUploaderComponent = class CustomUploaderComponent extends AppBaseCompo
|
|
|
779
432
|
};
|
|
780
433
|
i0.ɵɵngDeclareClassMetadata({
|
|
781
434
|
minVersion: "12.0.0",
|
|
782
|
-
version: "22.2.
|
|
435
|
+
version: "22.2.3",
|
|
783
436
|
ngImport: i0,
|
|
784
437
|
type: CustomUploaderComponent,
|
|
785
438
|
decorators: [{
|
|
@@ -787,7 +440,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
787
440
|
args: [{
|
|
788
441
|
selector: "pw-custom-uploader",
|
|
789
442
|
standalone: false,
|
|
790
|
-
template: "<div class=\"pw-uploader-card\">\n <!-- empty state — dashed dropzone (admin-edit-form.md § 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('
|
|
443
|
+
template: "<div class=\"pw-uploader-card\">\n <!-- empty state — dashed dropzone (admin-edit-form.md § 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('Utils.Uploader.UploadTitle' | transloco: { title: title }) : ('Utils.Uploader.UploadImage' | transloco)\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n <i class=\"fas fa-upload\" aria-hidden=\"true\"></i>\n <span class=\"dropzone-title\">{{ 'Utils.Uploader.UploadImage' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n <!-- populated — framed image + Change / Delete affordances -->\n @if (previewData?.url && !previewBroken) {\n <div class=\"pw-uploader-preview\">\n <a [href]=\"previewData?.url\"\n target=\"_blank\"\n class=\"pw-uploader-thumb\">\n <img [src]=\"previewSrc\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgError()\"\n class=\"img-fluid pw-uploader-img\" />\n </a>\n <div class=\"pw-uploader-actions\">\n <a class=\"pw-uploader-change\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n <i\n appendTo=\"body\"\n [pTooltip]=\"'Button.Delete' | transloco\"\n tooltipPosition=\"top\"\n (click)=\"deleteExistingFile()\"\n (keydown.enter)=\"deleteExistingFile()\"\n (keydown.space)=\"deleteExistingFile()\"\n class=\"fa fa-trash delete-icon\"\n aria-hidden=\"true\"\n ></i>\n </div>\n </div>\n }\n</div>\n<!-- image cropper -->\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ title }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end float-end\"\n [attr.aria-label]=\"'Common.Close' | transloco\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n [aspectRatio]=\"aspectRatio\"\n (fileChangeEvent)=\"onFileChange($event)\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
791
444
|
styles: ["@charset \"UTF-8\";.pw-uploader-card{border:0;background:transparent;min-height:180px;padding:0}.pw-uploader-dropzone{width:100%;min-height:180px;padding:1rem}.pw-uploader-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;min-height:180px;padding:1rem;border:1px solid #e2e5ea;border-radius:8px;background:#fff}.pw-uploader-thumb{display:flex;align-items:center;justify-content:center;max-width:100%}.pw-uploader-img{max-height:120px;object-fit:contain}.pw-uploader-actions{display:flex;align-items:center;gap:1rem}.pw-uploader-change{color:var(--first, #1769e1);font-size:14px;font-weight:600;cursor:pointer;text-decoration:none}.pw-uploader-change:hover{text-decoration:underline}.delete-icon{cursor:pointer}\n"]
|
|
792
445
|
}]
|
|
793
446
|
}],
|
|
@@ -814,7 +467,7 @@ var ProfileImageCropperModule = class ProfileImageCropperModule {
|
|
|
814
467
|
static {
|
|
815
468
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
816
469
|
minVersion: "12.0.0",
|
|
817
|
-
version: "22.2.
|
|
470
|
+
version: "22.2.3",
|
|
818
471
|
ngImport: i0,
|
|
819
472
|
type: ProfileImageCropperModule,
|
|
820
473
|
deps: [],
|
|
@@ -824,7 +477,7 @@ var ProfileImageCropperModule = class ProfileImageCropperModule {
|
|
|
824
477
|
static {
|
|
825
478
|
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
826
479
|
minVersion: "14.0.0",
|
|
827
|
-
version: "22.2.
|
|
480
|
+
version: "22.2.3",
|
|
828
481
|
ngImport: i0,
|
|
829
482
|
type: ProfileImageCropperModule,
|
|
830
483
|
declarations: [ProfileImageCropperComponent, CustomUploaderComponent],
|
|
@@ -842,7 +495,7 @@ var ProfileImageCropperModule = class ProfileImageCropperModule {
|
|
|
842
495
|
static {
|
|
843
496
|
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
844
497
|
minVersion: "12.0.0",
|
|
845
|
-
version: "22.2.
|
|
498
|
+
version: "22.2.3",
|
|
846
499
|
ngImport: i0,
|
|
847
500
|
type: ProfileImageCropperModule,
|
|
848
501
|
imports: [
|
|
@@ -858,7 +511,7 @@ var ProfileImageCropperModule = class ProfileImageCropperModule {
|
|
|
858
511
|
};
|
|
859
512
|
i0.ɵɵngDeclareClassMetadata({
|
|
860
513
|
minVersion: "12.0.0",
|
|
861
|
-
version: "22.2.
|
|
514
|
+
version: "22.2.3",
|
|
862
515
|
ngImport: i0,
|
|
863
516
|
type: ProfileImageCropperModule,
|
|
864
517
|
decorators: [{
|
|
@@ -986,7 +639,7 @@ var ResourceHeaderComponent = class ResourceHeaderComponent extends AppBaseCompo
|
|
|
986
639
|
navbarConfig.items = navbarConfig.items ?? [];
|
|
987
640
|
this.editingNavbar = JSON.parse(JSON.stringify(navbarConfig));
|
|
988
641
|
try {
|
|
989
|
-
const { EditNavbarModalComponent } = await import("./posiwise-utils-edit-navbar-modal.component-
|
|
642
|
+
const { EditNavbarModalComponent } = await import("./posiwise-utils-edit-navbar-modal.component-BYy7dCnj.mjs");
|
|
990
643
|
const modalRef = this.modalService.open(EditNavbarModalComponent, {
|
|
991
644
|
size: "lg",
|
|
992
645
|
centered: true,
|
|
@@ -1031,7 +684,7 @@ var ResourceHeaderComponent = class ResourceHeaderComponent extends AppBaseCompo
|
|
|
1031
684
|
static {
|
|
1032
685
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1033
686
|
minVersion: "12.0.0",
|
|
1034
|
-
version: "22.2.
|
|
687
|
+
version: "22.2.3",
|
|
1035
688
|
ngImport: i0,
|
|
1036
689
|
type: ResourceHeaderComponent,
|
|
1037
690
|
deps: [
|
|
@@ -1047,7 +700,7 @@ var ResourceHeaderComponent = class ResourceHeaderComponent extends AppBaseCompo
|
|
|
1047
700
|
static {
|
|
1048
701
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1049
702
|
minVersion: "17.0.0",
|
|
1050
|
-
version: "22.2.
|
|
703
|
+
version: "22.2.3",
|
|
1051
704
|
type: ResourceHeaderComponent,
|
|
1052
705
|
isStandalone: false,
|
|
1053
706
|
selector: "pw-resource-header",
|
|
@@ -1124,7 +777,7 @@ var ResourceHeaderComponent = class ResourceHeaderComponent extends AppBaseCompo
|
|
|
1124
777
|
};
|
|
1125
778
|
i0.ɵɵngDeclareClassMetadata({
|
|
1126
779
|
minVersion: "12.0.0",
|
|
1127
|
-
version: "22.2.
|
|
780
|
+
version: "22.2.3",
|
|
1128
781
|
ngImport: i0,
|
|
1129
782
|
type: ResourceHeaderComponent,
|
|
1130
783
|
decorators: [{
|
|
@@ -1174,7 +827,7 @@ var ResourceHeaderModule = class ResourceHeaderModule {
|
|
|
1174
827
|
static {
|
|
1175
828
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1176
829
|
minVersion: "12.0.0",
|
|
1177
|
-
version: "22.2.
|
|
830
|
+
version: "22.2.3",
|
|
1178
831
|
ngImport: i0,
|
|
1179
832
|
type: ResourceHeaderModule,
|
|
1180
833
|
deps: [],
|
|
@@ -1184,7 +837,7 @@ var ResourceHeaderModule = class ResourceHeaderModule {
|
|
|
1184
837
|
static {
|
|
1185
838
|
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1186
839
|
minVersion: "14.0.0",
|
|
1187
|
-
version: "22.2.
|
|
840
|
+
version: "22.2.3",
|
|
1188
841
|
ngImport: i0,
|
|
1189
842
|
type: ResourceHeaderModule,
|
|
1190
843
|
declarations: [ResourceHeaderComponent],
|
|
@@ -1206,7 +859,7 @@ var ResourceHeaderModule = class ResourceHeaderModule {
|
|
|
1206
859
|
static {
|
|
1207
860
|
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
1208
861
|
minVersion: "12.0.0",
|
|
1209
|
-
version: "22.2.
|
|
862
|
+
version: "22.2.3",
|
|
1210
863
|
ngImport: i0,
|
|
1211
864
|
type: ResourceHeaderModule,
|
|
1212
865
|
imports: [
|
|
@@ -1226,7 +879,7 @@ var ResourceHeaderModule = class ResourceHeaderModule {
|
|
|
1226
879
|
};
|
|
1227
880
|
i0.ɵɵngDeclareClassMetadata({
|
|
1228
881
|
minVersion: "12.0.0",
|
|
1229
|
-
version: "22.2.
|
|
882
|
+
version: "22.2.3",
|
|
1230
883
|
ngImport: i0,
|
|
1231
884
|
type: ResourceHeaderModule,
|
|
1232
885
|
decorators: [{
|
|
@@ -1253,7 +906,7 @@ var FieldErrorDisplayComponent = class FieldErrorDisplayComponent {
|
|
|
1253
906
|
static {
|
|
1254
907
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1255
908
|
minVersion: "12.0.0",
|
|
1256
|
-
version: "22.2.
|
|
909
|
+
version: "22.2.3",
|
|
1257
910
|
ngImport: i0,
|
|
1258
911
|
type: FieldErrorDisplayComponent,
|
|
1259
912
|
deps: [],
|
|
@@ -1263,7 +916,7 @@ var FieldErrorDisplayComponent = class FieldErrorDisplayComponent {
|
|
|
1263
916
|
static {
|
|
1264
917
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1265
918
|
minVersion: "17.0.0",
|
|
1266
|
-
version: "22.2.
|
|
919
|
+
version: "22.2.3",
|
|
1267
920
|
type: FieldErrorDisplayComponent,
|
|
1268
921
|
isStandalone: false,
|
|
1269
922
|
selector: "pw-field-error-display",
|
|
@@ -1278,7 +931,7 @@ var FieldErrorDisplayComponent = class FieldErrorDisplayComponent {
|
|
|
1278
931
|
};
|
|
1279
932
|
i0.ɵɵngDeclareClassMetadata({
|
|
1280
933
|
minVersion: "12.0.0",
|
|
1281
|
-
version: "22.2.
|
|
934
|
+
version: "22.2.3",
|
|
1282
935
|
ngImport: i0,
|
|
1283
936
|
type: FieldErrorDisplayComponent,
|
|
1284
937
|
decorators: [{
|
|
@@ -1298,7 +951,7 @@ var FieldErrorDisplayModule = class FieldErrorDisplayModule {
|
|
|
1298
951
|
static {
|
|
1299
952
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1300
953
|
minVersion: "12.0.0",
|
|
1301
|
-
version: "22.2.
|
|
954
|
+
version: "22.2.3",
|
|
1302
955
|
ngImport: i0,
|
|
1303
956
|
type: FieldErrorDisplayModule,
|
|
1304
957
|
deps: [],
|
|
@@ -1308,7 +961,7 @@ var FieldErrorDisplayModule = class FieldErrorDisplayModule {
|
|
|
1308
961
|
static {
|
|
1309
962
|
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1310
963
|
minVersion: "14.0.0",
|
|
1311
|
-
version: "22.2.
|
|
964
|
+
version: "22.2.3",
|
|
1312
965
|
ngImport: i0,
|
|
1313
966
|
type: FieldErrorDisplayModule,
|
|
1314
967
|
declarations: [FieldErrorDisplayComponent],
|
|
@@ -1319,7 +972,7 @@ var FieldErrorDisplayModule = class FieldErrorDisplayModule {
|
|
|
1319
972
|
static {
|
|
1320
973
|
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
1321
974
|
minVersion: "12.0.0",
|
|
1322
|
-
version: "22.2.
|
|
975
|
+
version: "22.2.3",
|
|
1323
976
|
ngImport: i0,
|
|
1324
977
|
type: FieldErrorDisplayModule,
|
|
1325
978
|
imports: [CommonModule]
|
|
@@ -1328,7 +981,7 @@ var FieldErrorDisplayModule = class FieldErrorDisplayModule {
|
|
|
1328
981
|
};
|
|
1329
982
|
i0.ɵɵngDeclareClassMetadata({
|
|
1330
983
|
minVersion: "12.0.0",
|
|
1331
|
-
version: "22.2.
|
|
984
|
+
version: "22.2.3",
|
|
1332
985
|
ngImport: i0,
|
|
1333
986
|
type: FieldErrorDisplayModule,
|
|
1334
987
|
decorators: [{
|
|
@@ -1340,6 +993,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1340
993
|
}]
|
|
1341
994
|
}]
|
|
1342
995
|
});
|
|
1343
|
-
export { CustomUploaderComponent, FieldErrorDisplayComponent, FieldErrorDisplayModule, MatchPassword,
|
|
996
|
+
export { CustomUploaderComponent, FieldErrorDisplayComponent, FieldErrorDisplayModule, MatchPassword, ProfileImageCropperComponent, ProfileImageCropperModule, ResourceHeaderComponent, ResourceHeaderModule, ValidateForm, appendQueryParam, clearQueryParams, handleDateRangeSelection };
|
|
1344
997
|
|
|
1345
998
|
//# sourceMappingURL=posiwise-utils.mjs.map
|