valtech-components 2.0.752 → 2.0.754
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/username-input/username-input.component.mjs +3 -3
- package/esm2022/lib/components/organisms/form/form.component.mjs +10 -4
- package/esm2022/lib/services/firebase/messaging.service.mjs +14 -30
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +25 -35
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/services/firebase/messaging.service.d.ts +16 -12
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -34,14 +34,15 @@ import { Analytics, logEvent, setUserId, setUserProperties, provideAnalytics, ge
|
|
|
34
34
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
35
35
|
import * as i1$6 from '@angular/fire/auth';
|
|
36
36
|
import { provideAuth, getAuth, connectAuthEmulator, authState, signInWithCustomToken, signOut } from '@angular/fire/auth';
|
|
37
|
-
import { provideMessaging, getMessaging,
|
|
37
|
+
import { provideMessaging, getMessaging, getToken, deleteToken, onMessage } from '@angular/fire/messaging';
|
|
38
38
|
import * as i1$7 from '@angular/fire/storage';
|
|
39
39
|
import { provideStorage, getStorage, connectStorageEmulator, ref, uploadBytesResumable, getDownloadURL, getMetadata, deleteObject, listAll } from '@angular/fire/storage';
|
|
40
40
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
41
41
|
import { filter, catchError, switchMap, finalize, take, tap, map as map$1, debounceTime as debounceTime$1, takeUntil as takeUntil$1 } from 'rxjs/operators';
|
|
42
42
|
import * as i1$8 from '@angular/common/http';
|
|
43
43
|
import { provideHttpClient, withInterceptors, HttpErrorResponse, HttpClient } from '@angular/common/http';
|
|
44
|
-
import { isSupported } from 'firebase/messaging';
|
|
44
|
+
import { isSupported, getMessaging as getMessaging$1 } from 'firebase/messaging';
|
|
45
|
+
import { getApps, getApp, initializeApp as initializeApp$1 } from 'firebase/app';
|
|
45
46
|
import { ImageCropperComponent } from 'ngx-image-cropper';
|
|
46
47
|
import { Capacitor } from '@capacitor/core';
|
|
47
48
|
import 'prismjs/components/prism-scss';
|
|
@@ -51,7 +52,7 @@ import 'prismjs/components/prism-json';
|
|
|
51
52
|
* Current version of valtech-components.
|
|
52
53
|
* This is automatically updated during the publish process.
|
|
53
54
|
*/
|
|
54
|
-
const VERSION = '2.0.
|
|
55
|
+
const VERSION = '2.0.754';
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
58
|
* Servicio para gestionar presets de componentes.
|
|
@@ -21757,34 +21758,17 @@ class MessagingService {
|
|
|
21757
21758
|
console.warn('[Messaging] FCM not supported in this browser');
|
|
21758
21759
|
return null;
|
|
21759
21760
|
}
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
try {
|
|
21771
|
-
const instance = this.injector.get(Messaging, null);
|
|
21772
|
-
if (!instance) {
|
|
21773
|
-
// Provider no registrado (enableMessaging: false). No reintentar.
|
|
21774
|
-
console.warn('[Messaging] Messaging not provided. Verify provideValtechFirebase({ enableMessaging: true }).');
|
|
21775
|
-
return null;
|
|
21776
|
-
}
|
|
21777
|
-
return instance;
|
|
21778
|
-
}
|
|
21779
|
-
catch (err) {
|
|
21780
|
-
if (i === MAX_RETRIES - 1) {
|
|
21781
|
-
console.error('[Messaging] AngularFire APP_INITIALIZER never resolved after', MAX_RETRIES * DELAY_MS, 'ms:', err);
|
|
21782
|
-
return null;
|
|
21783
|
-
}
|
|
21784
|
-
await new Promise(r => setTimeout(r, DELAY_MS));
|
|
21785
|
-
}
|
|
21761
|
+
try {
|
|
21762
|
+
const app = getApps().length > 0 ? getApp() : initializeApp$1(this.config.firebase);
|
|
21763
|
+
// Cast a Messaging (token de AngularFire) — el tipo subyacente del SDK
|
|
21764
|
+
// es el mismo. Las funciones getToken/deleteToken/onMessage de
|
|
21765
|
+
// @angular/fire/messaging son re-exports del SDK y aceptan esta instance.
|
|
21766
|
+
return getMessaging$1(app);
|
|
21767
|
+
}
|
|
21768
|
+
catch (err) {
|
|
21769
|
+
console.error('[Messaging] firebase getMessaging() threw:', err);
|
|
21770
|
+
return null;
|
|
21786
21771
|
}
|
|
21787
|
-
return null;
|
|
21788
21772
|
}
|
|
21789
21773
|
// ===========================================================================
|
|
21790
21774
|
// INICIALIZACIÓN
|
|
@@ -24444,7 +24428,7 @@ class UsernameInputComponent {
|
|
|
24444
24428
|
</ion-text>
|
|
24445
24429
|
}
|
|
24446
24430
|
</div>
|
|
24447
|
-
`, isInline: true, styles: [".username-input-container{margin-bottom:1rem}.username-label{display:block;font-size:.875rem;font-weight:
|
|
24431
|
+
`, isInline: true, styles: [".username-input-container{margin-bottom:1rem}.username-label{display:block;font-size:.875rem;font-weight:700;color:var(--ion-color-dark);margin-bottom:.5rem}.username-prefix{font-size:1rem;font-weight:500;color:var(--ion-color-medium);-webkit-user-select:none;user-select:none;margin-inline-end:.25rem;display:inline-flex;align-items:center}.username-field{width:100%}.username-field.has-error{--highlight-color: var(--ion-color-danger)}.availability-indicator{display:inline-flex;align-items:center;justify-content:center;margin-inline-start:.5rem}.checking-spinner{width:18px;height:18px;--color: var(--ion-color-medium)}.status-icon{font-size:1.25rem}.status-icon.available{color:var(--ion-color-success)}.status-icon.taken{color:var(--ion-color-danger)}.status-icon.invalid{color:var(--ion-color-warning)}.status-message,.error-message{display:block;margin-top:.25rem;padding-left:.25rem}:host-context(body.dark){.username-input-wrapper{background:var(--ion-color-step-50);border-color:var(--ion-color-step-150)}.username-label{color:var(--ion-color-light)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonText, selector: "ion-text", inputs: ["color", "mode"] }] }); }
|
|
24448
24432
|
}
|
|
24449
24433
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: UsernameInputComponent, decorators: [{
|
|
24450
24434
|
type: Component,
|
|
@@ -24500,7 +24484,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
24500
24484
|
</ion-text>
|
|
24501
24485
|
}
|
|
24502
24486
|
</div>
|
|
24503
|
-
`, styles: [".username-input-container{margin-bottom:1rem}.username-label{display:block;font-size:.875rem;font-weight:
|
|
24487
|
+
`, styles: [".username-input-container{margin-bottom:1rem}.username-label{display:block;font-size:.875rem;font-weight:700;color:var(--ion-color-dark);margin-bottom:.5rem}.username-prefix{font-size:1rem;font-weight:500;color:var(--ion-color-medium);-webkit-user-select:none;user-select:none;margin-inline-end:.25rem;display:inline-flex;align-items:center}.username-field{width:100%}.username-field.has-error{--highlight-color: var(--ion-color-danger)}.availability-indicator{display:inline-flex;align-items:center;justify-content:center;margin-inline-start:.5rem}.checking-spinner{width:18px;height:18px;--color: var(--ion-color-medium)}.status-icon{font-size:1.25rem}.status-icon.available{color:var(--ion-color-success)}.status-icon.taken{color:var(--ion-color-danger)}.status-icon.invalid{color:var(--ion-color-warning)}.status-message,.error-message{display:block;margin-top:.25rem;padding-left:.25rem}:host-context(body.dark){.username-input-wrapper{background:var(--ion-color-step-50);border-color:var(--ion-color-step-150)}.username-label{color:var(--ion-color-light)}}\n"] }]
|
|
24504
24488
|
}], propDecorators: { props: [{
|
|
24505
24489
|
type: Input
|
|
24506
24490
|
}] } });
|
|
@@ -26120,13 +26104,19 @@ class FormComponent {
|
|
|
26120
26104
|
const formControls = {};
|
|
26121
26105
|
this.props.sections.forEach(section => {
|
|
26122
26106
|
section.fields.forEach(field => {
|
|
26107
|
+
// Honra `field.value` al construir el FormGroup para que controles tipo
|
|
26108
|
+
// HANDLE (que consumen el control directo via [formControl]) reciban el
|
|
26109
|
+
// valor inicial sin que el caller tenga que patchValue post-mount.
|
|
26110
|
+
// El helper applyDefaultValueToControl (val-text-input etc.) sigue
|
|
26111
|
+
// funcionando — escribe sobre un control ya inicializado, idempotente.
|
|
26112
|
+
const initialValue = field.value ?? null;
|
|
26123
26113
|
if (field.type === this.types.NUMBER_FROM_TO) {
|
|
26124
26114
|
// Crear dos controles para campos NUMBER_FROM_TO
|
|
26125
|
-
formControls[`${field.name}_from`] = [
|
|
26126
|
-
formControls[`${field.name}_to`] = [
|
|
26115
|
+
formControls[`${field.name}_from`] = [initialValue, field.validators || []];
|
|
26116
|
+
formControls[`${field.name}_to`] = [initialValue, field.validators || []];
|
|
26127
26117
|
}
|
|
26128
26118
|
else {
|
|
26129
|
-
formControls[field.name] = [
|
|
26119
|
+
formControls[field.name] = [initialValue, field.validators || []];
|
|
26130
26120
|
}
|
|
26131
26121
|
});
|
|
26132
26122
|
});
|