@posiwise/utils 0.0.121 → 0.0.124
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/esm2022/index.mjs +6 -1
- package/esm2022/lib/custom-uploader/custom-uploader.component.mjs +107 -0
- package/esm2022/lib/image-cropper/image-cropper.component.mjs +92 -0
- package/esm2022/lib/image-cropper/profile-image-cropper.module.mjs +45 -0
- package/esm2022/lib/resource-header/resource-header.component.mjs +240 -0
- package/esm2022/lib/resource-header/resource-header.module.mjs +59 -0
- package/fesm2022/posiwise-utils.mjs +514 -1
- package/fesm2022/posiwise-utils.mjs.map +1 -1
- package/index.d.ts +5 -0
- package/lib/custom-uploader/custom-uploader.component.d.ts +35 -0
- package/lib/image-cropper/image-cropper.component.d.ts +30 -0
- package/lib/image-cropper/profile-image-cropper.module.d.ts +19 -0
- package/lib/resource-header/resource-header.component.d.ts +53 -0
- package/lib/resource-header/resource-header.module.d.ts +17 -0
- package/package.json +1 -1
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import Quill from 'quill';
|
|
2
2
|
import * as ImageResize from 'quill-resize-image';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
|
+
import * as i6$1 from '@angular/cdk/drag-drop';
|
|
5
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
6
|
+
import * as i3 from '@angular/common';
|
|
7
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
8
|
+
import * as i0 from '@angular/core';
|
|
9
|
+
import { EventEmitter, Component, Output, Input, Inject, NgModule, ViewChild, HostListener } from '@angular/core';
|
|
10
|
+
import * as i4 from '@angular/forms';
|
|
11
|
+
import { FormsModule } from '@angular/forms';
|
|
12
|
+
import * as i5 from '@angular/router';
|
|
13
|
+
import { RouterModule } from '@angular/router';
|
|
14
|
+
import * as i1$1 from '@posiwise/admin-module-utils';
|
|
15
|
+
import { AdminModuleUtilsModule } from '@posiwise/admin-module-utils';
|
|
16
|
+
import { CoreTranslocoModule } from '@posiwise/core-transloco';
|
|
17
|
+
import * as i3$1 from '@posiwise/directives';
|
|
18
|
+
import { DirectivesModule } from '@posiwise/directives';
|
|
19
|
+
import { PipesModule } from '@posiwise/pipes';
|
|
20
|
+
import * as i1 from '@ng-bootstrap/ng-bootstrap';
|
|
21
|
+
import { NgbModalModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
22
|
+
import * as i2 from 'ngx-image-cropper';
|
|
23
|
+
import { ImageCropperModule } from 'ngx-image-cropper';
|
|
24
|
+
import * as i3$2 from 'primeng/button';
|
|
25
|
+
import { ButtonModule } from 'primeng/button';
|
|
26
|
+
import { AppBaseComponent } from '@posiwise/app-base-component';
|
|
27
|
+
import { HelperService } from '@posiwise/helper-service';
|
|
28
|
+
import * as i6 from '@jsverse/transloco';
|
|
4
29
|
|
|
5
30
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
31
|
const BlockEmbed = Quill.import('formats/image');
|
|
@@ -356,9 +381,497 @@ function handleDateRangeSelection(event, selectedDateRange) {
|
|
|
356
381
|
return selectedDateRange;
|
|
357
382
|
}
|
|
358
383
|
|
|
384
|
+
class ProfileImageCropperComponent {
|
|
385
|
+
constructor(cdr) {
|
|
386
|
+
this.cdr = cdr;
|
|
387
|
+
this.imageChangedEvent = '';
|
|
388
|
+
this.croppedImage = '';
|
|
389
|
+
this.imageSelectionEvent = new EventEmitter();
|
|
390
|
+
this.closeEvent = new EventEmitter();
|
|
391
|
+
this.fileChangeEvent = new EventEmitter();
|
|
392
|
+
this.aspectRatio = 'auto';
|
|
393
|
+
this.transform = {};
|
|
394
|
+
this.canvasRotation = 0;
|
|
395
|
+
this.showCropper = false;
|
|
396
|
+
}
|
|
397
|
+
onFileChange(event) {
|
|
398
|
+
const input = event.target;
|
|
399
|
+
if (input.files && input.files.length > 0) {
|
|
400
|
+
this.imageChangedEvent = event;
|
|
401
|
+
this.fileChangeEvent.emit(input.files[0].name);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
imageCropped(event) {
|
|
405
|
+
const reader = new FileReader();
|
|
406
|
+
reader.onloadend = () => {
|
|
407
|
+
this.croppedImage = reader.result;
|
|
408
|
+
this.cdr.detectChanges();
|
|
409
|
+
};
|
|
410
|
+
reader.readAsDataURL(event.blob);
|
|
411
|
+
}
|
|
412
|
+
imageLoaded() {
|
|
413
|
+
this.showCropper = true;
|
|
414
|
+
}
|
|
415
|
+
rotateLeft() {
|
|
416
|
+
this.canvasRotation--;
|
|
417
|
+
this.flipAfterRotate();
|
|
418
|
+
}
|
|
419
|
+
rotateRight() {
|
|
420
|
+
this.canvasRotation++;
|
|
421
|
+
this.flipAfterRotate();
|
|
422
|
+
}
|
|
423
|
+
flipAfterRotate() {
|
|
424
|
+
const flippedH = this.transform.flipH;
|
|
425
|
+
const flippedV = this.transform.flipV;
|
|
426
|
+
this.transform = {
|
|
427
|
+
...this.transform,
|
|
428
|
+
flipH: flippedV,
|
|
429
|
+
flipV: flippedH
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
flipHorizontal() {
|
|
433
|
+
this.transform = {
|
|
434
|
+
...this.transform,
|
|
435
|
+
flipH: !this.transform.flipH
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
flipVertical() {
|
|
439
|
+
this.transform = {
|
|
440
|
+
...this.transform,
|
|
441
|
+
flipV: !this.transform.flipV
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
saveProfilePicture() {
|
|
445
|
+
if (this.croppedImage) {
|
|
446
|
+
this.imageSelectionEvent.emit(this.croppedImage);
|
|
447
|
+
this.busy = true;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
onCloseModal() {
|
|
451
|
+
this.closeEvent.emit();
|
|
452
|
+
}
|
|
453
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ProfileImageCropperComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
454
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: ProfileImageCropperComponent, selector: "pw-image-cropper", inputs: { aspectRatio: "aspectRatio", dynamicData: "dynamicData" }, outputs: { imageSelectionEvent: "imageSelectionEvent", closeEvent: "closeEvent", fileChangeEvent: "fileChangeEvent" }, ngImport: i0, 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 Upload Pic\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" />\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Left\">\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=\"Rotate Right\">\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=\"Flip Horizontal\">\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=\"Flip Vertical\">\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 <div *ngIf=\"aspectRatio === 'auto'\">\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 <div *ngIf=\"aspectRatio === 'fullLogo'\">\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 <div *ngIf=\"aspectRatio === 'rectangular'\">\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 <div *ngIf=\"aspectRatio === 'dynamic'\">\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 <div *ngIf=\"aspectRatio === 'custom'\">\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 </div>\n <div *ngIf=\"croppedImage\" class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n alt=\"cropped.png\"\n width=\"128\" />\n </div>\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 Close\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n Save\n </button>\n </div>\n </div>\n</section>\n", styles: [":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: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}.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"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "cropperFrameAriaLabel", "output", "format", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "directive", type: i3$1.ButtonBusyDirective, selector: "[buttonBusy]", inputs: ["buttonBusy", "busyText"] }, { kind: "directive", type: i3$1.LazyImgDirective, selector: "img" }] }); }
|
|
455
|
+
}
|
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ProfileImageCropperComponent, decorators: [{
|
|
457
|
+
type: Component,
|
|
458
|
+
args: [{ selector: 'pw-image-cropper', 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 Upload Pic\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" />\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Left\">\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=\"Rotate Right\">\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=\"Flip Horizontal\">\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=\"Flip Vertical\">\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 <div *ngIf=\"aspectRatio === 'auto'\">\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 <div *ngIf=\"aspectRatio === 'fullLogo'\">\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 <div *ngIf=\"aspectRatio === 'rectangular'\">\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 <div *ngIf=\"aspectRatio === 'dynamic'\">\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 <div *ngIf=\"aspectRatio === 'custom'\">\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 </div>\n <div *ngIf=\"croppedImage\" class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n alt=\"cropped.png\"\n width=\"128\" />\n </div>\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 Close\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n Save\n </button>\n </div>\n </div>\n</section>\n", styles: [":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: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}.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"] }]
|
|
459
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { imageSelectionEvent: [{
|
|
460
|
+
type: Output
|
|
461
|
+
}], closeEvent: [{
|
|
462
|
+
type: Output
|
|
463
|
+
}], fileChangeEvent: [{
|
|
464
|
+
type: Output
|
|
465
|
+
}], aspectRatio: [{
|
|
466
|
+
type: Input
|
|
467
|
+
}], dynamicData: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}] } });
|
|
470
|
+
|
|
471
|
+
class CustomUploaderComponent extends AppBaseComponent {
|
|
472
|
+
constructor(injector, modalService, document) {
|
|
473
|
+
super(injector);
|
|
474
|
+
this.modalService = modalService;
|
|
475
|
+
this.document = document;
|
|
476
|
+
this.saveEvent = new EventEmitter();
|
|
477
|
+
this.aspectRatio = 'auto';
|
|
478
|
+
this.uploadedFile = null;
|
|
479
|
+
}
|
|
480
|
+
deleteExistingFile() {
|
|
481
|
+
HelperService.raiseDeletePopup().then(rep => {
|
|
482
|
+
if (rep.value) {
|
|
483
|
+
this.previewData = null;
|
|
484
|
+
this.onSaveFile();
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
onSaveFile() {
|
|
489
|
+
this.buttonBusy = true;
|
|
490
|
+
this.saveEvent.emit({
|
|
491
|
+
file: this.previewData?.url ? this.previewData : this.uploadedFile,
|
|
492
|
+
name: this.controlName
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
// modal image cropper
|
|
496
|
+
onFileChange(value) {
|
|
497
|
+
this.selectedFileName = value;
|
|
498
|
+
}
|
|
499
|
+
dataURLtoBlob(dataUrl) {
|
|
500
|
+
const arr = dataUrl?.split(',');
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
|
|
502
|
+
const mime = /^[A-Z]*[a-z]*:(.*?);[A-Z]*/.exec(arr[0])?.[1];
|
|
503
|
+
const bStr = atob(arr[1]);
|
|
504
|
+
let n = bStr.length;
|
|
505
|
+
const u8arr = new Uint8Array(n);
|
|
506
|
+
// eslint-disable-next-line no-plusplus
|
|
507
|
+
while (n--) {
|
|
508
|
+
u8arr[n] = bStr.charCodeAt(n);
|
|
509
|
+
}
|
|
510
|
+
return new Blob([u8arr], { type: mime });
|
|
511
|
+
}
|
|
512
|
+
onImageSelection(event) {
|
|
513
|
+
const blob = this.dataURLtoBlob(event);
|
|
514
|
+
const file = new File([blob], this.selectedFileName);
|
|
515
|
+
this.uploadedFile = file;
|
|
516
|
+
this.onSaveFile();
|
|
517
|
+
}
|
|
518
|
+
openModal(content) {
|
|
519
|
+
this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });
|
|
520
|
+
}
|
|
521
|
+
clearValues() {
|
|
522
|
+
this.uploadedFile = null;
|
|
523
|
+
this.selectedFileName = null;
|
|
524
|
+
this.updateHeight();
|
|
525
|
+
}
|
|
526
|
+
onClose() {
|
|
527
|
+
this.modalService.dismissAll();
|
|
528
|
+
}
|
|
529
|
+
updateHeight() {
|
|
530
|
+
// wait for update card height
|
|
531
|
+
setTimeout(() => {
|
|
532
|
+
this.onImgChange();
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
onImgChange(event) {
|
|
536
|
+
if (event) {
|
|
537
|
+
const target = event.target;
|
|
538
|
+
target.src = 'assets/img/icons/imagenotavailable.png';
|
|
539
|
+
}
|
|
540
|
+
const el = this.document.querySelectorAll('pw-domain-config-interface,pw-domain-config-build div[matchheight="card"]');
|
|
541
|
+
el.forEach((item) => {
|
|
542
|
+
HelperService.matchHeights(item, 'card');
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: CustomUploaderComponent, deps: [{ token: i0.Injector }, { token: i1.NgbModal }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
546
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: CustomUploaderComponent, selector: "pw-custom-uploader", inputs: { controlName: "controlName", previewData: "previewData", aspectRatio: "aspectRatio", title: "title" }, outputs: { saveEvent: "saveEvent" }, usesInheritance: true, ngImport: i0, template: "<div class=\"card pb-2\">\n <div class=\"card-header upload-button-bar\">\n <button pButton\n type=\"button\"\n [disabled]=\"previewData?.url || uploadedFile\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\"\n icon=\"pi pi-plus\"\n label=\"Choose\"></button>\n </div>\n <div class=\"card-body\">\n <!-- no files -->\n <div class=\"d-flex preview-wrapper\"\n *ngIf=\"!previewData?.url\">\n <div>\n <img src=\"assets/img/icons/nofilesfound.png\"\n (load)=\"onImgChange()\"\n class=\"mx-auto img-fluid\"\n alt=\"\" />\n </div>\n </div>\n <!-- existing images -->\n <div class=\"d-flex preview-wrapper\"\n *ngIf=\"previewData?.url\">\n <div>\n <a [href]=\"previewData?.url\"\n target=\"_blank\">\n <img [src]=\"previewData?.url\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgChange($event)\"\n class=\"img-fluid\" />\n </a>\n </div>\n <div class=\"ms-3\">\n <i\n container=\"body\"\n ngbTooltip=\"Delete\"\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 </div>\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 aria-label=\"Close\"\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", styles: [":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: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}.upload-button-bar{background:#efefef;padding:1rem 1.25rem}.card{min-height:270px!important;max-height:550px!important;height:auto}.preview-wrapper{align-items:center;text-align:center}.preview-wrapper div{padding:1rem;flex:1 1 auto;width:25%;word-break:break-all}button[label=Choose],button[label=Choose]:hover,button[label=Choose]:enabled:active{background-color:#616161;border-color:#616161}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i3$1.LazyImgDirective, selector: "img" }, { kind: "component", type: ProfileImageCropperComponent, selector: "pw-image-cropper", inputs: ["aspectRatio", "dynamicData"], outputs: ["imageSelectionEvent", "closeEvent", "fileChangeEvent"] }, { kind: "pipe", type: i6.TranslocoPipe, name: "transloco" }] }); }
|
|
547
|
+
}
|
|
548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: CustomUploaderComponent, decorators: [{
|
|
549
|
+
type: Component,
|
|
550
|
+
args: [{ selector: 'pw-custom-uploader', template: "<div class=\"card pb-2\">\n <div class=\"card-header upload-button-bar\">\n <button pButton\n type=\"button\"\n [disabled]=\"previewData?.url || uploadedFile\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\"\n icon=\"pi pi-plus\"\n label=\"Choose\"></button>\n </div>\n <div class=\"card-body\">\n <!-- no files -->\n <div class=\"d-flex preview-wrapper\"\n *ngIf=\"!previewData?.url\">\n <div>\n <img src=\"assets/img/icons/nofilesfound.png\"\n (load)=\"onImgChange()\"\n class=\"mx-auto img-fluid\"\n alt=\"\" />\n </div>\n </div>\n <!-- existing images -->\n <div class=\"d-flex preview-wrapper\"\n *ngIf=\"previewData?.url\">\n <div>\n <a [href]=\"previewData?.url\"\n target=\"_blank\">\n <img [src]=\"previewData?.url\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgChange($event)\"\n class=\"img-fluid\" />\n </a>\n </div>\n <div class=\"ms-3\">\n <i\n container=\"body\"\n ngbTooltip=\"Delete\"\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 </div>\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 aria-label=\"Close\"\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", styles: [":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: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}.upload-button-bar{background:#efefef;padding:1rem 1.25rem}.card{min-height:270px!important;max-height:550px!important;height:auto}.preview-wrapper{align-items:center;text-align:center}.preview-wrapper div{padding:1rem;flex:1 1 auto;width:25%;word-break:break-all}button[label=Choose],button[label=Choose]:hover,button[label=Choose]:enabled:active{background-color:#616161;border-color:#616161}\n"] }]
|
|
551
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1.NgbModal }, { type: Document, decorators: [{
|
|
552
|
+
type: Inject,
|
|
553
|
+
args: [DOCUMENT]
|
|
554
|
+
}] }], propDecorators: { saveEvent: [{
|
|
555
|
+
type: Output
|
|
556
|
+
}], controlName: [{
|
|
557
|
+
type: Input
|
|
558
|
+
}], previewData: [{
|
|
559
|
+
type: Input
|
|
560
|
+
}], aspectRatio: [{
|
|
561
|
+
type: Input
|
|
562
|
+
}], title: [{
|
|
563
|
+
type: Input
|
|
564
|
+
}] } });
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Lightweight module for pw-image-cropper component
|
|
568
|
+
*
|
|
569
|
+
* Minimal dependencies - only CommonModule, ImageCropperModule, DirectivesModule
|
|
570
|
+
* Use this instead of ResourceSharedComponentsModule when you only need image cropping
|
|
571
|
+
*/
|
|
572
|
+
class ProfileImageCropperModule {
|
|
573
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ProfileImageCropperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
574
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: ProfileImageCropperModule, declarations: [ProfileImageCropperComponent, CustomUploaderComponent], imports: [CommonModule,
|
|
575
|
+
CoreTranslocoModule,
|
|
576
|
+
ButtonModule,
|
|
577
|
+
ImageCropperModule, // for <image-cropper>
|
|
578
|
+
DirectivesModule // for [buttonBusy] directive
|
|
579
|
+
], exports: [ProfileImageCropperComponent, CustomUploaderComponent] }); }
|
|
580
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ProfileImageCropperModule, imports: [CommonModule,
|
|
581
|
+
CoreTranslocoModule,
|
|
582
|
+
ButtonModule,
|
|
583
|
+
ImageCropperModule, // for <image-cropper>
|
|
584
|
+
DirectivesModule // for [buttonBusy] directive
|
|
585
|
+
] }); }
|
|
586
|
+
}
|
|
587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ProfileImageCropperModule, decorators: [{
|
|
588
|
+
type: NgModule,
|
|
589
|
+
args: [{
|
|
590
|
+
declarations: [ProfileImageCropperComponent, CustomUploaderComponent],
|
|
591
|
+
imports: [
|
|
592
|
+
CommonModule,
|
|
593
|
+
CoreTranslocoModule,
|
|
594
|
+
ButtonModule,
|
|
595
|
+
ImageCropperModule, // for <image-cropper>
|
|
596
|
+
DirectivesModule // for [buttonBusy] directive
|
|
597
|
+
],
|
|
598
|
+
exports: [ProfileImageCropperComponent, CustomUploaderComponent]
|
|
599
|
+
}]
|
|
600
|
+
}] });
|
|
601
|
+
|
|
602
|
+
class ResourceHeaderComponent extends AppBaseComponent {
|
|
603
|
+
constructor(injector, document, adminService, modalService) {
|
|
604
|
+
super(injector);
|
|
605
|
+
this.document = document;
|
|
606
|
+
this.adminService = adminService;
|
|
607
|
+
this.modalService = modalService;
|
|
608
|
+
this.isScrolled = false;
|
|
609
|
+
this.open = false;
|
|
610
|
+
this.logo = '/assets/img/landing-page/site-logo.png'; // Static fallback for LCP optimization
|
|
611
|
+
this.navbarItems = this.appConfig?.pages_config?.navbar?.items;
|
|
612
|
+
this.domainId = this.appConfig?.domain_id;
|
|
613
|
+
this.contrastImageUrl = this.appConfig?.company?.logos?.main_contrast?.url;
|
|
614
|
+
this.darkImageUrl = this.appConfig?.company?.logos?.main_dark?.url;
|
|
615
|
+
this.editingNavbar = {
|
|
616
|
+
items: []
|
|
617
|
+
};
|
|
618
|
+
this.canEditResourcesValue = false;
|
|
619
|
+
}
|
|
620
|
+
ngOnInit() {
|
|
621
|
+
console.log('In Header');
|
|
622
|
+
// Subscribe to appConfig changes to update logo dynamically
|
|
623
|
+
this.appConfigService.appConfig$.subscribe(config => {
|
|
624
|
+
if (config?.company?.logos) {
|
|
625
|
+
const isAboutUs = this.router.url?.includes('/about-us');
|
|
626
|
+
const logos = config.company.logos;
|
|
627
|
+
// Use smaller version for better performance (100x100 instead of 1200x264)
|
|
628
|
+
this.logo = isAboutUs
|
|
629
|
+
? logos.main_contrast?.url || '/assets/img/landing-page/site-logo.png'
|
|
630
|
+
: logos.main_dark?.url || '/assets/img/landing-page/site-logo.png';
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
if (this.userLoggedIn) {
|
|
634
|
+
this.localStorage.getItem$('product').subscribe(res => {
|
|
635
|
+
const data = res ? JSON.parse(res) : null;
|
|
636
|
+
this.id = data?.subscriptionId;
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
ngOnChanges(changes) {
|
|
641
|
+
if (changes['user'] || changes['userLoggedIn']) {
|
|
642
|
+
if (this.userLoggedIn && this.user) {
|
|
643
|
+
this.updateCanEditResourcesValue();
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
openLogoEditModal() {
|
|
648
|
+
this.modalService.open(this.logoEditModal, { centered: true, size: 'md' });
|
|
649
|
+
}
|
|
650
|
+
onSaveLogo(event) {
|
|
651
|
+
const formData = new FormData();
|
|
652
|
+
formData.append('subscription_id', this.id);
|
|
653
|
+
if (event.file instanceof File) {
|
|
654
|
+
formData.append(this.isScrolled ? 'logo_main_contrast' : 'logo_main_dark', event.file);
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
formData.append(this.isScrolled ? 'remove_logo_main_contrast' : 'remove_logo_main_dark', 'true');
|
|
658
|
+
}
|
|
659
|
+
this.adminService.updateDomainConfig(this.domainId, formData).subscribe(() => {
|
|
660
|
+
if (event.file) {
|
|
661
|
+
this.logo = URL.createObjectURL(event.file);
|
|
662
|
+
if (this.isScrolled) {
|
|
663
|
+
this.contrastImageUrl = URL.createObjectURL(event.file);
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
this.darkImageUrl = URL.createObjectURL(event.file);
|
|
667
|
+
}
|
|
668
|
+
this.modalService.dismissAll();
|
|
669
|
+
}
|
|
670
|
+
this.toast.success(event.file ? 'Logo updated' : 'Logo removed');
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
onScroll() {
|
|
674
|
+
clearTimeout(this.scrollTimeout);
|
|
675
|
+
this.scrollTimeout = setTimeout(() => {
|
|
676
|
+
requestAnimationFrame(() => {
|
|
677
|
+
const isAboutUs = this.router?.url?.includes('/about-us');
|
|
678
|
+
const shouldScroll = window.scrollY > 150;
|
|
679
|
+
this.isScrolled = shouldScroll;
|
|
680
|
+
if (!isAboutUs) {
|
|
681
|
+
// Use smaller versions for better performance
|
|
682
|
+
const logos = this.appConfig?.company?.logos;
|
|
683
|
+
const newLogo = shouldScroll
|
|
684
|
+
? logos?.main_contrast?.url ??
|
|
685
|
+
this.contrastImageUrl ??
|
|
686
|
+
'/assets/img/landing-page/site-logo.png'
|
|
687
|
+
: logos?.main_dark?.url ??
|
|
688
|
+
this.darkImageUrl ??
|
|
689
|
+
'/assets/img/landing-page/site-logo.png';
|
|
690
|
+
if (this.logo !== newLogo) {
|
|
691
|
+
this.logo = newLogo;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
if (window.innerWidth < 768) {
|
|
695
|
+
this.open = false;
|
|
696
|
+
const collapseElement = this.navbarCollapse?.nativeElement;
|
|
697
|
+
if (collapseElement?.classList.contains('show')) {
|
|
698
|
+
collapseElement.classList.remove('show');
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
// Close all dropdowns when scrolling
|
|
702
|
+
this.closeAllDropdowns();
|
|
703
|
+
});
|
|
704
|
+
}, 50);
|
|
705
|
+
}
|
|
706
|
+
onDocumentClick(event) {
|
|
707
|
+
// Close all dropdowns when clicking outside
|
|
708
|
+
const target = event.target;
|
|
709
|
+
if (!target.closest('.nav-item') &&
|
|
710
|
+
!target.closest('.popup') &&
|
|
711
|
+
!target.closest('.sign-btn')) {
|
|
712
|
+
this.closeAllDropdowns();
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
closeAllDropdowns() {
|
|
716
|
+
if (this.navbarItems) {
|
|
717
|
+
this.navbarItems.forEach(item => {
|
|
718
|
+
if (item.open) {
|
|
719
|
+
item.open = false;
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
openDropdown(item) {
|
|
725
|
+
// Close other dropdowns first
|
|
726
|
+
this.navbarItems.forEach(navItem => {
|
|
727
|
+
if (navItem !== item) {
|
|
728
|
+
navItem.open = false;
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
item.open = true;
|
|
732
|
+
}
|
|
733
|
+
onDropdownItemClick(item) {
|
|
734
|
+
item.open = false;
|
|
735
|
+
}
|
|
736
|
+
openEditNavbarModal() {
|
|
737
|
+
const navbarConfig = this.appConfig.pages_config?.navbar ?? {};
|
|
738
|
+
navbarConfig.items = navbarConfig.items ?? [];
|
|
739
|
+
this.editingNavbar = JSON.parse(JSON.stringify(navbarConfig));
|
|
740
|
+
this.modalService.open(this.editNavbarModal, {
|
|
741
|
+
size: 'lg',
|
|
742
|
+
centered: true,
|
|
743
|
+
windowClass: 'modal-holder'
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
saveNavbarLinks(modal) {
|
|
747
|
+
const updatedConfig = {
|
|
748
|
+
navbar: this.editingNavbar,
|
|
749
|
+
subscription_id: this.id
|
|
750
|
+
};
|
|
751
|
+
this.adminService
|
|
752
|
+
.updateDomainConfig(this.appConfig?.domain_id, updatedConfig)
|
|
753
|
+
.subscribe(() => {
|
|
754
|
+
this.toast.success('Navbar links updated');
|
|
755
|
+
this.navbarItems = [...this.editingNavbar.items];
|
|
756
|
+
// Update the appConfig to reflect the saved changes
|
|
757
|
+
this.appConfig.pages_config = this.appConfig.pages_config ?? {};
|
|
758
|
+
this.appConfig.pages_config.navbar = { ...this.editingNavbar };
|
|
759
|
+
modal.close();
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
addNavbarItem() {
|
|
763
|
+
this.editingNavbar.items.push({
|
|
764
|
+
title: '',
|
|
765
|
+
path: '',
|
|
766
|
+
subtitles: []
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
removeNavbarItem(index) {
|
|
770
|
+
this.editingNavbar.items.splice(index, 1);
|
|
771
|
+
}
|
|
772
|
+
addNavbarSubtitle(index) {
|
|
773
|
+
this.editingNavbar.items[index].subtitles.push({
|
|
774
|
+
title: '',
|
|
775
|
+
path: ''
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
removeNavbarSubtitle(navIndex, subIndex) {
|
|
779
|
+
this.editingNavbar.items[navIndex].subtitles.splice(subIndex, 1);
|
|
780
|
+
}
|
|
781
|
+
dropNavbarItems(event) {
|
|
782
|
+
moveItemInArray(this.editingNavbar.items, event.previousIndex, event.currentIndex);
|
|
783
|
+
}
|
|
784
|
+
dropNavbarSubtitles(index, event) {
|
|
785
|
+
moveItemInArray(this.editingNavbar.items[index].subtitles, event.previousIndex, event.currentIndex);
|
|
786
|
+
}
|
|
787
|
+
updateCanEditResourcesValue() {
|
|
788
|
+
this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
|
|
789
|
+
}
|
|
790
|
+
canEditResources() {
|
|
791
|
+
return this.canEditResourcesValue;
|
|
792
|
+
}
|
|
793
|
+
navigateToLogin() {
|
|
794
|
+
window.location.href = '/login';
|
|
795
|
+
}
|
|
796
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ResourceHeaderComponent, deps: [{ token: i0.Injector }, { token: DOCUMENT }, { token: i1$1.AdminService }, { token: i1.NgbModal }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
797
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: ResourceHeaderComponent, selector: "pw-resource-header", inputs: { user: "user", userLoggedIn: "userLoggedIn" }, host: { listeners: { "window:scroll": "onScroll()", "document:click": "onDocumentClick($event)" } }, viewQueries: [{ propertyName: "navbarCollapse", first: true, predicate: ["collapsibleNavbar"], descendants: true }, { propertyName: "editNavbarModal", first: true, predicate: ["editNavbarModal"], descendants: true }, { propertyName: "logoEditModal", first: true, predicate: ["logoEditModal"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <i *ngIf=\"canEditResourcesValue\"\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-7 d-flex justify-content-start\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n\n <i *ngIf=\"canEditResourcesValue\"\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n <li class=\"nav-item\" *ngFor=\"let item of navbarItems\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n href=\"javascript:void(0)\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"item.subtitles?.length ? (item.open = !item.open) : null\"\n [attr.href]=\"!(item.subtitles?.length) ? item.path : null\"\n >\n {{ item?.title }}\n <i *ngIf=\"item.subtitles.length > 0 && item.open\" class=\"fa-solid fa-caret-down\"></i>\n </a>\n <div class=\"popup position-absolute\"\n *ngIf=\"item.subtitles.length > 0 && item.open\">\n <ul>\n <li\n *ngFor=\"let sub of item.subtitles\"\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n </ul>\n </div>\n </div>\n </li>\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </li>\n </ul>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-3 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n\n\n<ng-template #editNavbarModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Navbar Links</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <h4 class=\"mb-3\">Navbar Section</h4>\n <div cdkDropList (cdkDropListDropped)=\"dropNavbarItems($event)\">\n <div *ngFor=\"let item of editingNavbar.items; let i = index\" class=\"border p-3 mb-3\" cdkDrag>\n <div class=\"row\">\n <div class=\"col-md-5 mb-2\">\n <label for=\"navbarTitle{{i}}\" class=\"form-label\">Title</label>\n <input id=\"navbarTitle{{i}}\" class=\"form-control\" [(ngModel)]=\"item.title\" />\n </div>\n <div class=\"col-md-5 mb-2\">\n <label for=\"navbarPath{{i}}\" class=\"form-label\">Path</label>\n <input id=\"navbarPath{{i}}\" class=\"form-control\" [(ngModel)]=\"item.path\" />\n </div>\n <div class=\"col-md-2 d-flex justify-content-between align-items-center mt-4\">\n <i class=\"fa fa-trash in-page-trash-icon text-danger cursor-pointer\" (click)=\"removeNavbarItem(i)\" (keydown.enter)=\"removeNavbarItem(i)\"\n (keydown.space)=\"removeNavbarItem(i)\"></i>\n <i class=\"fa fa-bars in-page-bars-icon cursor-pointer\" cdkDragHandle></i>\n </div>\n </div>\n\n <div cdkDropList (cdkDropListDropped)=\"dropNavbarSubtitles(i, $event)\">\n <div *ngFor=\"let sub of item.subtitles; let j = index\" class=\"row border p-3 mb-2 align-items-center\" cdkDrag>\n <div class=\"col-md-5\">\n <label for=\"navbarSubtitleTitle{{i}}{{j}}\" class=\"form-label\">Subtitle Title</label>\n <input id=\"navbarSubtitleTitle{{i}}{{j}}\" class=\"form-control\" [(ngModel)]=\"sub.title\" />\n </div>\n <div class=\"col-md-5\">\n <label for=\"navbarSubtitlePath{{i}}{{j}}\" class=\"form-label\">Subtitle Path</label>\n <input id=\"navbarSubtitlePath{{i}}{{j}}\" class=\"form-control\" [(ngModel)]=\"sub.path\" />\n </div>\n <div class=\"col-md-2 d-flex justify-content-between align-items-center mt-4\">\n <i class=\"fa fa-trash in-page-trash-icon text-danger cursor-pointer\" (click)=\"removeNavbarSubtitle(i, j)\" (keydown.enter)=\"removeNavbarSubtitle(i, j)\" (keydown.space)=\"removeNavbarSubtitle(i, j)\"></i>\n <i class=\"fa fa-bars in-page-bars-icon cursor-pointer\" cdkDragHandle></i>\n </div>\n </div>\n </div>\n\n <button class=\"btn btn-outline-primary btn-sm mt-2\" (click)=\"addNavbarSubtitle(i)\">\n + Add Subtitle\n </button>\n </div>\n </div>\n\n <button class=\"btn btn-primary mt-3\" (click)=\"addNavbarItem()\">\n + Add Navbar Item\n </button>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" (click)=\"saveNavbarLinks(modal)\">Save</button>\n </div>\n</ng-template>\n\n\n\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>", styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,-webkit-transform 2s;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}@media (min-width: 500px){.navbar-nav .nav-item button{margin-top:10px}}@media (max-width: 1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}@media (min-width: 1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:var(--first)!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media (max-width: 1200px){.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media (max-width: 500px){.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}@media (max-width: 500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}.dropdown-container{position:relative;display:inline-block}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i6$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i6$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i6$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i3$1.LazyImgDirective, selector: "img" }, { kind: "component", type: CustomUploaderComponent, selector: "pw-custom-uploader", inputs: ["controlName", "previewData", "aspectRatio", "title"], outputs: ["saveEvent"] }] }); }
|
|
798
|
+
}
|
|
799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ResourceHeaderComponent, decorators: [{
|
|
800
|
+
type: Component,
|
|
801
|
+
args: [{ selector: 'pw-resource-header', template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <i *ngIf=\"canEditResourcesValue\"\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-7 d-flex justify-content-start\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n\n <i *ngIf=\"canEditResourcesValue\"\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n <li class=\"nav-item\" *ngFor=\"let item of navbarItems\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n href=\"javascript:void(0)\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"item.subtitles?.length ? (item.open = !item.open) : null\"\n [attr.href]=\"!(item.subtitles?.length) ? item.path : null\"\n >\n {{ item?.title }}\n <i *ngIf=\"item.subtitles.length > 0 && item.open\" class=\"fa-solid fa-caret-down\"></i>\n </a>\n <div class=\"popup position-absolute\"\n *ngIf=\"item.subtitles.length > 0 && item.open\">\n <ul>\n <li\n *ngFor=\"let sub of item.subtitles\"\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n </ul>\n </div>\n </div>\n </li>\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </li>\n </ul>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-3 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n\n\n<ng-template #editNavbarModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Navbar Links</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <h4 class=\"mb-3\">Navbar Section</h4>\n <div cdkDropList (cdkDropListDropped)=\"dropNavbarItems($event)\">\n <div *ngFor=\"let item of editingNavbar.items; let i = index\" class=\"border p-3 mb-3\" cdkDrag>\n <div class=\"row\">\n <div class=\"col-md-5 mb-2\">\n <label for=\"navbarTitle{{i}}\" class=\"form-label\">Title</label>\n <input id=\"navbarTitle{{i}}\" class=\"form-control\" [(ngModel)]=\"item.title\" />\n </div>\n <div class=\"col-md-5 mb-2\">\n <label for=\"navbarPath{{i}}\" class=\"form-label\">Path</label>\n <input id=\"navbarPath{{i}}\" class=\"form-control\" [(ngModel)]=\"item.path\" />\n </div>\n <div class=\"col-md-2 d-flex justify-content-between align-items-center mt-4\">\n <i class=\"fa fa-trash in-page-trash-icon text-danger cursor-pointer\" (click)=\"removeNavbarItem(i)\" (keydown.enter)=\"removeNavbarItem(i)\"\n (keydown.space)=\"removeNavbarItem(i)\"></i>\n <i class=\"fa fa-bars in-page-bars-icon cursor-pointer\" cdkDragHandle></i>\n </div>\n </div>\n\n <div cdkDropList (cdkDropListDropped)=\"dropNavbarSubtitles(i, $event)\">\n <div *ngFor=\"let sub of item.subtitles; let j = index\" class=\"row border p-3 mb-2 align-items-center\" cdkDrag>\n <div class=\"col-md-5\">\n <label for=\"navbarSubtitleTitle{{i}}{{j}}\" class=\"form-label\">Subtitle Title</label>\n <input id=\"navbarSubtitleTitle{{i}}{{j}}\" class=\"form-control\" [(ngModel)]=\"sub.title\" />\n </div>\n <div class=\"col-md-5\">\n <label for=\"navbarSubtitlePath{{i}}{{j}}\" class=\"form-label\">Subtitle Path</label>\n <input id=\"navbarSubtitlePath{{i}}{{j}}\" class=\"form-control\" [(ngModel)]=\"sub.path\" />\n </div>\n <div class=\"col-md-2 d-flex justify-content-between align-items-center mt-4\">\n <i class=\"fa fa-trash in-page-trash-icon text-danger cursor-pointer\" (click)=\"removeNavbarSubtitle(i, j)\" (keydown.enter)=\"removeNavbarSubtitle(i, j)\" (keydown.space)=\"removeNavbarSubtitle(i, j)\"></i>\n <i class=\"fa fa-bars in-page-bars-icon cursor-pointer\" cdkDragHandle></i>\n </div>\n </div>\n </div>\n\n <button class=\"btn btn-outline-primary btn-sm mt-2\" (click)=\"addNavbarSubtitle(i)\">\n + Add Subtitle\n </button>\n </div>\n </div>\n\n <button class=\"btn btn-primary mt-3\" (click)=\"addNavbarItem()\">\n + Add Navbar Item\n </button>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" (click)=\"saveNavbarLinks(modal)\">Save</button>\n </div>\n</ng-template>\n\n\n\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>", styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,-webkit-transform 2s;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}@media (min-width: 500px){.navbar-nav .nav-item button{margin-top:10px}}@media (max-width: 1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}@media (min-width: 1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:var(--first)!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media (max-width: 1200px){.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media (max-width: 500px){.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}@media (max-width: 500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}.dropdown-container{position:relative;display:inline-block}\n"] }]
|
|
802
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: Document, decorators: [{
|
|
803
|
+
type: Inject,
|
|
804
|
+
args: [DOCUMENT]
|
|
805
|
+
}] }, { type: i1$1.AdminService }, { type: i1.NgbModal }], propDecorators: { navbarCollapse: [{
|
|
806
|
+
type: ViewChild,
|
|
807
|
+
args: ['collapsibleNavbar']
|
|
808
|
+
}], editNavbarModal: [{
|
|
809
|
+
type: ViewChild,
|
|
810
|
+
args: ['editNavbarModal']
|
|
811
|
+
}], logoEditModal: [{
|
|
812
|
+
type: ViewChild,
|
|
813
|
+
args: ['logoEditModal']
|
|
814
|
+
}], user: [{
|
|
815
|
+
type: Input
|
|
816
|
+
}], userLoggedIn: [{
|
|
817
|
+
type: Input
|
|
818
|
+
}], onScroll: [{
|
|
819
|
+
type: HostListener,
|
|
820
|
+
args: ['window:scroll', []]
|
|
821
|
+
}], onDocumentClick: [{
|
|
822
|
+
type: HostListener,
|
|
823
|
+
args: ['document:click', ['$event']]
|
|
824
|
+
}] } });
|
|
825
|
+
|
|
826
|
+
class ResourceHeaderModule {
|
|
827
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ResourceHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
828
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: ResourceHeaderModule, declarations: [ResourceHeaderComponent], imports: [CommonModule,
|
|
829
|
+
FormsModule,
|
|
830
|
+
RouterModule,
|
|
831
|
+
DragDropModule,
|
|
832
|
+
NgbModalModule,
|
|
833
|
+
NgbTooltipModule,
|
|
834
|
+
CoreTranslocoModule,
|
|
835
|
+
DirectivesModule,
|
|
836
|
+
PipesModule,
|
|
837
|
+
AdminModuleUtilsModule,
|
|
838
|
+
ProfileImageCropperModule], exports: [ResourceHeaderComponent] }); }
|
|
839
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ResourceHeaderModule, imports: [CommonModule,
|
|
840
|
+
FormsModule,
|
|
841
|
+
RouterModule,
|
|
842
|
+
DragDropModule,
|
|
843
|
+
NgbModalModule,
|
|
844
|
+
NgbTooltipModule,
|
|
845
|
+
CoreTranslocoModule,
|
|
846
|
+
DirectivesModule,
|
|
847
|
+
PipesModule,
|
|
848
|
+
AdminModuleUtilsModule,
|
|
849
|
+
ProfileImageCropperModule] }); }
|
|
850
|
+
}
|
|
851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ResourceHeaderModule, decorators: [{
|
|
852
|
+
type: NgModule,
|
|
853
|
+
args: [{
|
|
854
|
+
declarations: [ResourceHeaderComponent],
|
|
855
|
+
imports: [
|
|
856
|
+
CommonModule,
|
|
857
|
+
FormsModule,
|
|
858
|
+
RouterModule,
|
|
859
|
+
DragDropModule,
|
|
860
|
+
NgbModalModule,
|
|
861
|
+
NgbTooltipModule,
|
|
862
|
+
CoreTranslocoModule,
|
|
863
|
+
DirectivesModule,
|
|
864
|
+
PipesModule,
|
|
865
|
+
AdminModuleUtilsModule,
|
|
866
|
+
ProfileImageCropperModule
|
|
867
|
+
],
|
|
868
|
+
exports: [ResourceHeaderComponent]
|
|
869
|
+
}]
|
|
870
|
+
}] });
|
|
871
|
+
|
|
359
872
|
/**
|
|
360
873
|
* Generated bundle index. Do not edit.
|
|
361
874
|
*/
|
|
362
875
|
|
|
363
|
-
export { MatchPassword, QuillHelper, ValidateForm, appendQueryParam, clearQueryParams, handleDateRangeSelection };
|
|
876
|
+
export { CustomUploaderComponent, MatchPassword, ProfileImageCropperComponent, ProfileImageCropperModule, QuillHelper, ResourceHeaderComponent, ResourceHeaderModule, ValidateForm, appendQueryParam, clearQueryParams, handleDateRangeSelection };
|
|
364
877
|
//# sourceMappingURL=posiwise-utils.mjs.map
|