carriera-intern-components 1.1.176 → 1.1.178
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.
|
@@ -81,7 +81,7 @@ export declare class DropZoneComponent {
|
|
|
81
81
|
loadImageFailed(): void;
|
|
82
82
|
onTransformChange(event: ImageTransform): void;
|
|
83
83
|
cancelCrop(): void;
|
|
84
|
-
submitCrop(): void;
|
|
84
|
+
submitCrop(initial?: boolean): void;
|
|
85
85
|
/**
|
|
86
86
|
* A computed signal that derives the list of currently supported file extensions.
|
|
87
87
|
* It filters the base `fileTypes` array, removing any extensions present
|
|
@@ -3492,6 +3492,10 @@ class DropZoneComponent {
|
|
|
3492
3492
|
};
|
|
3493
3493
|
}));
|
|
3494
3494
|
}
|
|
3495
|
+
if (this.crop()) {
|
|
3496
|
+
this.base64Image = currentFiles[0].url || '';
|
|
3497
|
+
this.submitCrop(true);
|
|
3498
|
+
}
|
|
3495
3499
|
this.deletedDocs.set(this.deletedFileIds() ?? []);
|
|
3496
3500
|
}
|
|
3497
3501
|
updateRangeBackground(input) {
|
|
@@ -3573,7 +3577,7 @@ class DropZoneComponent {
|
|
|
3573
3577
|
console.log(this.croppedImage, "croppedImage", event);
|
|
3574
3578
|
}
|
|
3575
3579
|
else {
|
|
3576
|
-
this.base64Image = event.base64;
|
|
3580
|
+
this.base64Image = event.base64.replace('data:image/png;base64,', '');
|
|
3577
3581
|
this.croppedImage = null;
|
|
3578
3582
|
}
|
|
3579
3583
|
}
|
|
@@ -3594,7 +3598,7 @@ class DropZoneComponent {
|
|
|
3594
3598
|
cancelCrop() {
|
|
3595
3599
|
this.showCropper.set(false);
|
|
3596
3600
|
}
|
|
3597
|
-
submitCrop() {
|
|
3601
|
+
submitCrop(initial = false) {
|
|
3598
3602
|
const newPreviewUrl = this.base64Image;
|
|
3599
3603
|
const lastIndex = this.docs().length - 1;
|
|
3600
3604
|
if (lastIndex >= 0) {
|
|
@@ -3607,18 +3611,20 @@ class DropZoneComponent {
|
|
|
3607
3611
|
this.showCropper.set(false);
|
|
3608
3612
|
}
|
|
3609
3613
|
if (this.variant() === 'profile' && this.base64Image) {
|
|
3610
|
-
this.profileUrl = this.base64Image;
|
|
3614
|
+
this.profileUrl = initial ? this.base64Image : `data:image/png;base64,${this.base64Image}`;
|
|
3611
3615
|
}
|
|
3612
3616
|
if (this.variant() === 'cover' && this.base64Image) {
|
|
3613
|
-
this.coverUrl = this.base64Image;
|
|
3617
|
+
this.coverUrl = initial ? this.base64Image : `data:image/png;base64,${this.base64Image}`;
|
|
3614
3618
|
if (this.size() === '480px' && this.coverUrl) {
|
|
3615
3619
|
this.smallView.set(true);
|
|
3616
3620
|
}
|
|
3617
3621
|
}
|
|
3618
3622
|
if (this.variant() === 'logo' && this.base64Image) {
|
|
3619
|
-
this.logoUrl = this.base64Image;
|
|
3623
|
+
this.logoUrl = initial ? this.base64Image : `data:image/png;base64,${this.base64Image}`;
|
|
3620
3624
|
}
|
|
3621
3625
|
this.cropDimensions();
|
|
3626
|
+
if (!initial)
|
|
3627
|
+
this.emitDocs();
|
|
3622
3628
|
}
|
|
3623
3629
|
/**
|
|
3624
3630
|
* A computed signal that derives the list of currently supported file extensions.
|
|
@@ -3708,7 +3714,8 @@ class DropZoneComponent {
|
|
|
3708
3714
|
else {
|
|
3709
3715
|
this.docs.update((docs) => [...docs, filePreview]);
|
|
3710
3716
|
}
|
|
3711
|
-
this.
|
|
3717
|
+
if (!this.crop)
|
|
3718
|
+
this.emitDocs();
|
|
3712
3719
|
const visibleCount = this.size() === '480px' ? 2 : 3;
|
|
3713
3720
|
const total = this.docs().length;
|
|
3714
3721
|
if (total > visibleCount) {
|