valtech-components 2.0.764 → 2.0.766
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/lib/components/molecules/segment-control/segment-control.component.mjs +5 -13
- package/esm2022/lib/components/organisms/avatar-upload/avatar-upload.component.mjs +15 -62
- package/esm2022/lib/services/firebase/storage.service.mjs +17 -5
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +33 -76
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/rights-footer/rights-footer.component.d.ts +1 -1
- package/lib/components/atoms/text/text.component.d.ts +1 -1
- package/lib/components/molecules/features-list/features-list.component.d.ts +1 -1
- package/lib/components/organisms/article/article.component.d.ts +2 -2
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -52,7 +52,7 @@ import 'prismjs/components/prism-json';
|
|
|
52
52
|
* Current version of valtech-components.
|
|
53
53
|
* This is automatically updated during the publish process.
|
|
54
54
|
*/
|
|
55
|
-
const VERSION = '2.0.
|
|
55
|
+
const VERSION = '2.0.766';
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Servicio para gestionar presets de componentes.
|
|
@@ -9662,16 +9662,12 @@ class SegmentControlComponent {
|
|
|
9662
9662
|
[color]="resolvedProps.color || 'primary'"
|
|
9663
9663
|
[disabled]="resolvedProps.state === states.DISABLED || resolvedProps.disabled"
|
|
9664
9664
|
[scrollable]="resolvedProps.scrollable ?? false"
|
|
9665
|
-
[swipeGesture]="resolvedProps.swipeGesture ??
|
|
9665
|
+
[swipeGesture]="resolvedProps.swipeGesture ?? false"
|
|
9666
9666
|
[mode]="resolvedProps.mode"
|
|
9667
9667
|
(ionChange)="onSegmentChange($event)"
|
|
9668
9668
|
>
|
|
9669
9669
|
@for (option of resolvedProps.options; track option.value) {
|
|
9670
|
-
<ion-segment-button
|
|
9671
|
-
[value]="option.value"
|
|
9672
|
-
[disabled]="option.disabled"
|
|
9673
|
-
[layout]="option.layout || 'icon-top'"
|
|
9674
|
-
>
|
|
9670
|
+
<ion-segment-button [value]="option.value" [disabled]="option.disabled" [layout]="option.layout || 'icon-top'">
|
|
9675
9671
|
@if (option.icon) {
|
|
9676
9672
|
<ion-icon [name]="option.icon"></ion-icon>
|
|
9677
9673
|
}
|
|
@@ -9691,16 +9687,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
9691
9687
|
[color]="resolvedProps.color || 'primary'"
|
|
9692
9688
|
[disabled]="resolvedProps.state === states.DISABLED || resolvedProps.disabled"
|
|
9693
9689
|
[scrollable]="resolvedProps.scrollable ?? false"
|
|
9694
|
-
[swipeGesture]="resolvedProps.swipeGesture ??
|
|
9690
|
+
[swipeGesture]="resolvedProps.swipeGesture ?? false"
|
|
9695
9691
|
[mode]="resolvedProps.mode"
|
|
9696
9692
|
(ionChange)="onSegmentChange($event)"
|
|
9697
9693
|
>
|
|
9698
9694
|
@for (option of resolvedProps.options; track option.value) {
|
|
9699
|
-
<ion-segment-button
|
|
9700
|
-
[value]="option.value"
|
|
9701
|
-
[disabled]="option.disabled"
|
|
9702
|
-
[layout]="option.layout || 'icon-top'"
|
|
9703
|
-
>
|
|
9695
|
+
<ion-segment-button [value]="option.value" [disabled]="option.disabled" [layout]="option.layout || 'icon-top'">
|
|
9704
9696
|
@if (option.icon) {
|
|
9705
9697
|
<ion-icon [name]="option.icon"></ion-icon>
|
|
9706
9698
|
}
|
|
@@ -21321,7 +21313,7 @@ class StorageService {
|
|
|
21321
21313
|
percentage: Math.round((snapshot.bytesTransferred / snapshot.totalBytes) * 100),
|
|
21322
21314
|
state: this.mapTaskState(snapshot.state),
|
|
21323
21315
|
});
|
|
21324
|
-
},
|
|
21316
|
+
}, error => {
|
|
21325
21317
|
progress$.next({
|
|
21326
21318
|
bytesTransferred: 0,
|
|
21327
21319
|
totalBytes: file.size,
|
|
@@ -21356,6 +21348,7 @@ class StorageService {
|
|
|
21356
21348
|
*/
|
|
21357
21349
|
async uploadAndGetUrl(path, file, metadata) {
|
|
21358
21350
|
const prefixedPath = this.prefixStoragePath(path, metadata?.skipPrefix);
|
|
21351
|
+
console.log('[Storage] uploadAndGetUrl start:', { path: prefixedPath, size: file.size });
|
|
21359
21352
|
return new Promise((resolve, reject) => {
|
|
21360
21353
|
this.upload(path, file, metadata).subscribe({
|
|
21361
21354
|
complete: async () => {
|
|
@@ -21363,6 +21356,10 @@ class StorageService {
|
|
|
21363
21356
|
const storageRef = ref(this.storage, prefixedPath);
|
|
21364
21357
|
const downloadUrl = await getDownloadURL(storageRef);
|
|
21365
21358
|
const storedMetadata = await getMetadata(storageRef);
|
|
21359
|
+
console.log('[Storage] upload OK:', {
|
|
21360
|
+
path: prefixedPath,
|
|
21361
|
+
url: downloadUrl.slice(0, 60) + '…',
|
|
21362
|
+
});
|
|
21366
21363
|
resolve({
|
|
21367
21364
|
downloadUrl,
|
|
21368
21365
|
fullPath: storedMetadata.fullPath,
|
|
@@ -21373,10 +21370,17 @@ class StorageService {
|
|
|
21373
21370
|
});
|
|
21374
21371
|
}
|
|
21375
21372
|
catch (error) {
|
|
21373
|
+
console.error('[Storage] getDownloadURL/metadata failed:', {
|
|
21374
|
+
path: prefixedPath,
|
|
21375
|
+
error,
|
|
21376
|
+
});
|
|
21376
21377
|
reject(this.getErrorMessage(error));
|
|
21377
21378
|
}
|
|
21378
21379
|
},
|
|
21379
|
-
error:
|
|
21380
|
+
error: error => {
|
|
21381
|
+
console.error('[Storage] upload failed:', { path: prefixedPath, error });
|
|
21382
|
+
reject(error);
|
|
21383
|
+
},
|
|
21380
21384
|
});
|
|
21381
21385
|
});
|
|
21382
21386
|
}
|
|
@@ -21501,7 +21505,7 @@ class StorageService {
|
|
|
21501
21505
|
* ```
|
|
21502
21506
|
*/
|
|
21503
21507
|
async deleteMultiple(paths) {
|
|
21504
|
-
await Promise.all(paths.map(
|
|
21508
|
+
await Promise.all(paths.map(path => this.delete(path)));
|
|
21505
21509
|
}
|
|
21506
21510
|
// ===========================================================================
|
|
21507
21511
|
// LIST
|
|
@@ -21524,7 +21528,7 @@ class StorageService {
|
|
|
21524
21528
|
const storageRef = ref(this.storage, prefixedPath);
|
|
21525
21529
|
const result = await listAll(storageRef);
|
|
21526
21530
|
return {
|
|
21527
|
-
items: result.items.map(
|
|
21531
|
+
items: result.items.map(item => item.fullPath),
|
|
21528
21532
|
nextPageToken: undefined, // listAll no soporta paginación
|
|
21529
21533
|
};
|
|
21530
21534
|
}
|
|
@@ -33573,6 +33577,7 @@ class AvatarUploadComponent {
|
|
|
33573
33577
|
this.uploaded.emit(result);
|
|
33574
33578
|
}
|
|
33575
33579
|
catch (err) {
|
|
33580
|
+
console.error('[AvatarUpload] processAndUpload failed:', err);
|
|
33576
33581
|
// Revert preview on error
|
|
33577
33582
|
this.previewUrl.set(null);
|
|
33578
33583
|
// Determine error message based on error type
|
|
@@ -33588,9 +33593,7 @@ class AvatarUploadComponent {
|
|
|
33588
33593
|
}
|
|
33589
33594
|
}
|
|
33590
33595
|
else {
|
|
33591
|
-
message =
|
|
33592
|
-
this.i18n.t('uploadError', this.config().i18nNamespace) ||
|
|
33593
|
-
'Error al subir la imagen';
|
|
33596
|
+
message = this.i18n.t('uploadError', this.config().i18nNamespace) || 'Error al subir la imagen';
|
|
33594
33597
|
}
|
|
33595
33598
|
this.emitError('uploadFailed', message, err);
|
|
33596
33599
|
}
|
|
@@ -33604,37 +33607,20 @@ class AvatarUploadComponent {
|
|
|
33604
33607
|
}
|
|
33605
33608
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AvatarUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33606
33609
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: AvatarUploadComponent, isStandalone: true, selector: "val-avatar-upload", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { uploaded: "uploaded", error: "error", uploadStart: "uploadStart" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: `
|
|
33607
|
-
<div
|
|
33608
|
-
class="avatar-upload"
|
|
33609
|
-
[style.--avatar-size.px]="config().size"
|
|
33610
|
-
[class.avatar-upload--loading]="loading()"
|
|
33611
|
-
>
|
|
33610
|
+
<div class="avatar-upload" [style.--avatar-size.px]="config().size" [class.avatar-upload--loading]="loading()">
|
|
33612
33611
|
<div class="avatar-container">
|
|
33613
33612
|
<!-- Avatar Image or Initials -->
|
|
33614
33613
|
@if (displayUrl()) {
|
|
33615
|
-
<img
|
|
33616
|
-
class="avatar-image"
|
|
33617
|
-
[src]="displayUrl()"
|
|
33618
|
-
alt="Avatar"
|
|
33619
|
-
(error)="onImageError()"
|
|
33620
|
-
/>
|
|
33614
|
+
<img class="avatar-image" [src]="displayUrl()" alt="Avatar" (error)="onImageError()" />
|
|
33621
33615
|
} @else {
|
|
33622
|
-
<div
|
|
33623
|
-
class="avatar-initials"
|
|
33624
|
-
[style.background-color]="config().backgroundColor"
|
|
33625
|
-
>
|
|
33616
|
+
<div class="avatar-initials" [style.background-color]="config().backgroundColor">
|
|
33626
33617
|
{{ config().initials || '?' }}
|
|
33627
33618
|
</div>
|
|
33628
33619
|
}
|
|
33629
33620
|
|
|
33630
33621
|
<!-- Edit Button -->
|
|
33631
33622
|
@if (config().editable && !loading()) {
|
|
33632
|
-
<button
|
|
33633
|
-
class="edit-button"
|
|
33634
|
-
type="button"
|
|
33635
|
-
(click)="openFilePicker()"
|
|
33636
|
-
[attr.aria-label]="editButtonLabel()"
|
|
33637
|
-
>
|
|
33623
|
+
<button class="edit-button" type="button" (click)="openFilePicker()" [attr.aria-label]="editButtonLabel()">
|
|
33638
33624
|
<ion-icon name="camera-outline"></ion-icon>
|
|
33639
33625
|
</button>
|
|
33640
33626
|
}
|
|
@@ -33648,13 +33634,7 @@ class AvatarUploadComponent {
|
|
|
33648
33634
|
</div>
|
|
33649
33635
|
|
|
33650
33636
|
<!-- Hidden File Input -->
|
|
33651
|
-
<input
|
|
33652
|
-
#fileInput
|
|
33653
|
-
type="file"
|
|
33654
|
-
accept="image/jpeg,image/png,image/webp"
|
|
33655
|
-
(change)="onFileSelected($event)"
|
|
33656
|
-
hidden
|
|
33657
|
-
/>
|
|
33637
|
+
<input #fileInput type="file" accept="image/jpeg,image/png,image/webp" (change)="onFileSelected($event)" hidden />
|
|
33658
33638
|
|
|
33659
33639
|
<!-- Crop Modal -->
|
|
33660
33640
|
<ion-modal
|
|
@@ -33683,37 +33663,20 @@ class AvatarUploadComponent {
|
|
|
33683
33663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AvatarUploadComponent, decorators: [{
|
|
33684
33664
|
type: Component,
|
|
33685
33665
|
args: [{ selector: 'val-avatar-upload', standalone: true, imports: [CommonModule, IonIcon, IonSpinner, IonModal, ImageCropComponent], template: `
|
|
33686
|
-
<div
|
|
33687
|
-
class="avatar-upload"
|
|
33688
|
-
[style.--avatar-size.px]="config().size"
|
|
33689
|
-
[class.avatar-upload--loading]="loading()"
|
|
33690
|
-
>
|
|
33666
|
+
<div class="avatar-upload" [style.--avatar-size.px]="config().size" [class.avatar-upload--loading]="loading()">
|
|
33691
33667
|
<div class="avatar-container">
|
|
33692
33668
|
<!-- Avatar Image or Initials -->
|
|
33693
33669
|
@if (displayUrl()) {
|
|
33694
|
-
<img
|
|
33695
|
-
class="avatar-image"
|
|
33696
|
-
[src]="displayUrl()"
|
|
33697
|
-
alt="Avatar"
|
|
33698
|
-
(error)="onImageError()"
|
|
33699
|
-
/>
|
|
33670
|
+
<img class="avatar-image" [src]="displayUrl()" alt="Avatar" (error)="onImageError()" />
|
|
33700
33671
|
} @else {
|
|
33701
|
-
<div
|
|
33702
|
-
class="avatar-initials"
|
|
33703
|
-
[style.background-color]="config().backgroundColor"
|
|
33704
|
-
>
|
|
33672
|
+
<div class="avatar-initials" [style.background-color]="config().backgroundColor">
|
|
33705
33673
|
{{ config().initials || '?' }}
|
|
33706
33674
|
</div>
|
|
33707
33675
|
}
|
|
33708
33676
|
|
|
33709
33677
|
<!-- Edit Button -->
|
|
33710
33678
|
@if (config().editable && !loading()) {
|
|
33711
|
-
<button
|
|
33712
|
-
class="edit-button"
|
|
33713
|
-
type="button"
|
|
33714
|
-
(click)="openFilePicker()"
|
|
33715
|
-
[attr.aria-label]="editButtonLabel()"
|
|
33716
|
-
>
|
|
33679
|
+
<button class="edit-button" type="button" (click)="openFilePicker()" [attr.aria-label]="editButtonLabel()">
|
|
33717
33680
|
<ion-icon name="camera-outline"></ion-icon>
|
|
33718
33681
|
</button>
|
|
33719
33682
|
}
|
|
@@ -33727,13 +33690,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
33727
33690
|
</div>
|
|
33728
33691
|
|
|
33729
33692
|
<!-- Hidden File Input -->
|
|
33730
|
-
<input
|
|
33731
|
-
#fileInput
|
|
33732
|
-
type="file"
|
|
33733
|
-
accept="image/jpeg,image/png,image/webp"
|
|
33734
|
-
(change)="onFileSelected($event)"
|
|
33735
|
-
hidden
|
|
33736
|
-
/>
|
|
33693
|
+
<input #fileInput type="file" accept="image/jpeg,image/png,image/webp" (change)="onFileSelected($event)" hidden />
|
|
33737
33694
|
|
|
33738
33695
|
<!-- Crop Modal -->
|
|
33739
33696
|
<ion-modal
|