valtech-components 2.0.673 → 2.0.675

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.
Files changed (31) hide show
  1. package/esm2022/lib/components/atoms/button/button.component.mjs +2 -2
  2. package/esm2022/lib/components/molecules/action-card/action-card.component.mjs +2 -2
  3. package/esm2022/lib/components/molecules/footer-links/footer-links.component.mjs +2 -2
  4. package/esm2022/lib/components/molecules/glow-card/glow-card.component.mjs +2 -2
  5. package/esm2022/lib/components/molecules/link/link.component.mjs +2 -2
  6. package/esm2022/lib/components/organisms/bottom-nav/bottom-nav.component.mjs +2 -2
  7. package/esm2022/lib/components/templates/page-content/page-content.component.mjs +2 -2
  8. package/esm2022/lib/components/templates/page-wrapper/page-wrapper.component.mjs +2 -2
  9. package/esm2022/lib/services/navigation/index.mjs +3 -0
  10. package/esm2022/lib/services/navigation/navigation.service.mjs +210 -0
  11. package/esm2022/lib/services/navigation/types.mjs +16 -0
  12. package/esm2022/lib/version.mjs +6 -0
  13. package/esm2022/public-api.mjs +4 -2
  14. package/fesm2022/valtech-components.mjs +377 -214
  15. package/fesm2022/valtech-components.mjs.map +1 -1
  16. package/lib/components/atoms/button/button.component.d.ts +1 -1
  17. package/lib/components/atoms/rights-footer/rights-footer.component.d.ts +2 -2
  18. package/lib/components/atoms/text/text.component.d.ts +1 -1
  19. package/lib/components/molecules/features-list/features-list.component.d.ts +1 -1
  20. package/lib/components/molecules/link/link.component.d.ts +1 -1
  21. package/lib/components/organisms/article/article.component.d.ts +4 -4
  22. package/lib/components/organisms/toolbar/toolbar.component.d.ts +1 -1
  23. package/lib/components/templates/page-content/page-content.component.d.ts +1 -1
  24. package/lib/services/navigation/index.d.ts +2 -0
  25. package/lib/services/navigation/navigation.service.d.ts +126 -0
  26. package/lib/services/navigation/types.d.ts +65 -0
  27. package/lib/version.d.ts +5 -0
  28. package/package.json +1 -1
  29. package/public-api.d.ts +2 -1
  30. package/esm2022/lib/services/navigation.service.mjs +0 -68
  31. package/lib/services/navigation.service.d.ts +0 -45
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, Injectable, makeEnvironmentProviders, APP_INITIALIZER, inject, EventEmitter, Component, Input, Output, HostListener, Pipe, input, computed, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, ElementRef, ContentChild, PLATFORM_ID, Inject, ErrorHandler, DestroyRef, InjectionToken, runInInjectionContext, effect, Optional, TemplateRef, ViewContainerRef, isSignal, Directive, ViewEncapsulation } from '@angular/core';
2
+ import { signal, Injectable, makeEnvironmentProviders, APP_INITIALIZER, inject, EventEmitter, Component, Input, Output, computed, HostListener, Pipe, input, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, ElementRef, ContentChild, PLATFORM_ID, Inject, ErrorHandler, DestroyRef, InjectionToken, runInInjectionContext, effect, Optional, TemplateRef, ViewContainerRef, isSignal, Directive, ViewEncapsulation } from '@angular/core';
3
3
  import * as i2$1 from '@ionic/angular/standalone';
4
4
  import { IonAvatar, IonCard, IonIcon, IonButton, IonSpinner, IonText, IonModal, IonHeader, IonToolbar, IonContent, IonButtons, IonTitle, IonProgressBar, IonSkeletonText, IonFab, IonFabButton, IonFabList, IonLabel, IonCardContent, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCheckbox, IonTextarea, IonDatetime, IonDatetimeButton, IonInput, IonSelect, IonSelectOption, IonPopover, IonList, IonItem, IonRadioGroup, IonRadio, IonRange, IonSearchbar, IonSegment, IonSegmentButton, IonToggle, IonAccordion, IonAccordionGroup, IonTabBar, IonTabButton, IonBadge, IonBreadcrumb, IonBreadcrumbs, IonChip, IonNote, ToastController as ToastController$1, IonCol, IonRow, IonRefresher, IonRefresherContent, IonRippleEffect, AlertController, IonMenuButton, IonFooter, IonListHeader, IonInfiniteScroll, IonInfiniteScrollContent, IonGrid, MenuController, IonMenu, IonMenuToggle, IonSplitPane } from '@ionic/angular/standalone';
5
5
  import * as i1 from '@angular/common';
@@ -45,6 +45,12 @@ import { Capacitor } from '@capacitor/core';
45
45
  import 'prismjs/components/prism-scss';
46
46
  import 'prismjs/components/prism-json';
47
47
 
48
+ /**
49
+ * Current version of valtech-components.
50
+ * This is automatically updated during the publish process.
51
+ */
52
+ const VERSION = '2.0.675';
53
+
48
54
  /**
49
55
  * Servicio para gestionar presets de componentes.
50
56
  *
@@ -573,6 +579,230 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
573
579
  }]
574
580
  }] });
575
581
 
582
+ /**
583
+ * Valores por defecto de configuración
584
+ */
585
+ const DEFAULT_I18N_CONFIG = {
586
+ defaultLanguage: 'es',
587
+ supportedLanguages: ['es', 'en'],
588
+ detectBrowserLanguage: true,
589
+ content: {},
590
+ includeDefaultContent: true,
591
+ };
592
+ /**
593
+ * Clave para persistir idioma en localStorage
594
+ */
595
+ const LANG_STORAGE_KEY$1 = 'app_lang';
596
+
597
+ /**
598
+ * Servicio de internacionalización basado en Angular Signals.
599
+ *
600
+ * Características:
601
+ * - Sin RxJS: usa Signals para evitar memory leaks y congelamiento
602
+ * - Namespace-based: organiza traducciones por contexto
603
+ * - Fallback multi-nivel: namespace → _global → placeholder
604
+ * - Interpolación: soporta {variable} en textos
605
+ *
606
+ * @example
607
+ * // En un componente
608
+ * i18n = inject(I18nService);
609
+ *
610
+ * // Obtener texto
611
+ * const title = this.i18n.t('title', 'Login');
612
+ *
613
+ * // Con interpolación
614
+ * const welcome = this.i18n.t('welcome', 'Login', { name: 'Juan' });
615
+ *
616
+ * // Cambiar idioma
617
+ * this.i18n.setLanguage('en');
618
+ */
619
+ class I18nService {
620
+ constructor() {
621
+ // Estado interno con Signals
622
+ this._lang = signal(DEFAULT_I18N_CONFIG.defaultLanguage);
623
+ this._content = signal({});
624
+ this._supportedLanguages = signal(DEFAULT_I18N_CONFIG.supportedLanguages);
625
+ // Públicos readonly
626
+ this.lang = this._lang.asReadonly();
627
+ this.supportedLanguages = this._supportedLanguages.asReadonly();
628
+ // Computed para verificaciones rápidas
629
+ this.isSpanish = computed(() => this._lang() === 'es');
630
+ this.isEnglish = computed(() => this._lang() === 'en');
631
+ this.loadStoredLanguage();
632
+ }
633
+ /**
634
+ * Obtiene texto traducido (alias corto de getText)
635
+ *
636
+ * @param key Clave del texto
637
+ * @param namespace Namespace (default: '_global')
638
+ * @param data Variables para interpolación
639
+ * @returns Texto traducido o placeholder [namespace.key]
640
+ *
641
+ * @example
642
+ * i18n.t('submit'); // busca en _global
643
+ * i18n.t('title', 'Login'); // busca en Login
644
+ * i18n.t('welcome', 'Login', {name}); // con interpolación
645
+ */
646
+ t(key, namespace, data) {
647
+ return this.getText(key, namespace, data);
648
+ }
649
+ /**
650
+ * Obtiene texto traducido
651
+ *
652
+ * Fallback order:
653
+ * 1. content[namespace][lang][key]
654
+ * 2. content['_global'][lang][key]
655
+ * 3. "[namespace.key]" (placeholder)
656
+ */
657
+ getText(key, namespace, data) {
658
+ const content = this._content();
659
+ const lang = this._lang();
660
+ const ns = namespace || '_global';
661
+ // Buscar en namespace específico
662
+ let text = content[ns]?.[lang]?.[key];
663
+ // Fallback a _global
664
+ if (!text && ns !== '_global') {
665
+ text = content['_global']?.[lang]?.[key];
666
+ }
667
+ // Fallback a placeholder
668
+ if (!text) {
669
+ console.warn(`[i18n] Missing translation: ${ns}.${key} (${lang})`);
670
+ return `[${ns}.${key}]`;
671
+ }
672
+ // Aplicar interpolación si hay data
673
+ if (data) {
674
+ return this.interpolate(text, data);
675
+ }
676
+ return text;
677
+ }
678
+ /**
679
+ * Cambia el idioma de la aplicación
680
+ *
681
+ * @param lang Nuevo idioma
682
+ * @param forceReload Si true, recarga la página (fallback si reactividad falla)
683
+ */
684
+ setLanguage(lang, forceReload = false) {
685
+ if (!this._supportedLanguages().includes(lang)) {
686
+ console.warn(`[i18n] Language '${lang}' not in supported languages`);
687
+ return;
688
+ }
689
+ if (lang === this._lang()) {
690
+ return;
691
+ }
692
+ // Persistir en localStorage
693
+ localStorage.setItem(LANG_STORAGE_KEY$1, lang);
694
+ // Actualizar signal
695
+ this._lang.set(lang);
696
+ // Fallback: recargar si se solicita
697
+ if (forceReload) {
698
+ window.location.reload();
699
+ }
700
+ }
701
+ /**
702
+ * Registra contenido de traducciones para un namespace
703
+ *
704
+ * @param namespace Nombre del namespace
705
+ * @param content Contenido de traducciones
706
+ *
707
+ * @example
708
+ * i18n.registerContent('Login', {
709
+ * es: { title: 'Iniciar sesión' },
710
+ * en: { title: 'Sign in' }
711
+ * });
712
+ */
713
+ registerContent(namespace, content) {
714
+ this._content.update((store) => ({
715
+ ...store,
716
+ [namespace]: content,
717
+ }));
718
+ }
719
+ /**
720
+ * Registra múltiples namespaces de una vez
721
+ *
722
+ * @param contentStore Objeto con namespaces como keys
723
+ */
724
+ registerContentBulk(contentStore) {
725
+ this._content.update((store) => ({
726
+ ...store,
727
+ ...contentStore,
728
+ }));
729
+ }
730
+ /**
731
+ * Configura los idiomas soportados
732
+ */
733
+ setI18nLanguages(languages) {
734
+ this._supportedLanguages.set(languages);
735
+ }
736
+ /**
737
+ * Obtiene todos los namespaces registrados
738
+ */
739
+ getNamespaces() {
740
+ return Object.keys(this._content());
741
+ }
742
+ /**
743
+ * Verifica si un namespace tiene traducciones
744
+ */
745
+ hasNamespace(namespace) {
746
+ return namespace in this._content();
747
+ }
748
+ /**
749
+ * Carga idioma guardado en localStorage o detecta del navegador
750
+ */
751
+ loadStoredLanguage() {
752
+ const stored = localStorage.getItem(LANG_STORAGE_KEY$1);
753
+ if (stored && this.isValidLanguage(stored)) {
754
+ this._lang.set(stored);
755
+ return;
756
+ }
757
+ // Detectar idioma del navegador
758
+ const browserLang = navigator.language.split('-')[0];
759
+ if (this.isValidLanguage(browserLang)) {
760
+ this._lang.set(browserLang);
761
+ localStorage.setItem(LANG_STORAGE_KEY$1, browserLang);
762
+ }
763
+ }
764
+ /**
765
+ * Valida si un idioma está soportado
766
+ */
767
+ isValidLanguage(lang) {
768
+ return this._supportedLanguages().includes(lang);
769
+ }
770
+ /**
771
+ * Reemplaza {variable} en texto con valores de data
772
+ *
773
+ * @example
774
+ * interpolate('Hola {name}', { name: 'Juan' }) // 'Hola Juan'
775
+ */
776
+ interpolate(text, data) {
777
+ return Object.entries(data).reduce((result, [key, value]) => {
778
+ const regex = new RegExp(`\\{${key}\\}`, 'g');
779
+ return result.replace(regex, value);
780
+ }, text);
781
+ }
782
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: I18nService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
783
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: I18nService, providedIn: 'root' }); }
784
+ }
785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: I18nService, decorators: [{
786
+ type: Injectable,
787
+ args: [{ providedIn: 'root' }]
788
+ }], ctorParameters: () => [] });
789
+
790
+ /**
791
+ * Configuracion por defecto para header tipo 'home'
792
+ */
793
+ const DEFAULT_HOME_HEADER = {
794
+ type: 'home',
795
+ withMenu: false,
796
+ actions: [],
797
+ };
798
+ /**
799
+ * Configuracion por defecto para header tipo 'back'
800
+ */
801
+ const DEFAULT_BACK_HEADER = {
802
+ type: 'back',
803
+ titleKey: '',
804
+ };
805
+
576
806
  /* eslint-disable no-underscore-dangle */
577
807
  /**
578
808
  * Service for opening URLs using Capacitor's InAppBrowser plugin.
@@ -606,15 +836,140 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
606
836
  }], ctorParameters: () => [] });
607
837
 
608
838
  /**
609
- * Service for navigation and routing within the application.
610
- * Supports navigation with data transfer, in-app browser, and opening links in new tabs.
839
+ * NavigationService
840
+ *
841
+ * Servicio centralizado para navegacion y configuracion de headers.
842
+ * Permite a las paginas declarar su tipo de header de forma simple.
843
+ *
844
+ * @example
845
+ * // En una pagina con header de tipo "back"
846
+ * export class ProfilePage {
847
+ * private nav = inject(NavigationService);
848
+ *
849
+ * constructor() {
850
+ * this.nav.setBackHeader('pageTitle', 'Settings.Profile');
851
+ * }
852
+ * }
853
+ *
854
+ * @example
855
+ * // En el layout principal (tabs.page.ts)
856
+ * export class TabsPage {
857
+ * private nav = inject(NavigationService);
858
+ *
859
+ * headerConfig = this.nav.headerConfig;
860
+ * headerTitle = this.nav.headerTitle;
861
+ * }
611
862
  */
612
863
  class NavigationService {
613
864
  constructor(router, location, inAppBrowser) {
614
865
  this.router = router;
615
866
  this.location = location;
616
867
  this.inAppBrowser = inAppBrowser;
868
+ this.i18n = inject(I18nService);
869
+ // ============================================
870
+ // Header State (Signals)
871
+ // ============================================
872
+ this._headerConfig = signal(DEFAULT_HOME_HEADER);
873
+ /**
874
+ * Configuracion actual del header (readonly signal)
875
+ */
876
+ this.headerConfig = this._headerConfig.asReadonly();
877
+ /**
878
+ * Titulo del header traducido y reactivo al cambio de idioma.
879
+ * Solo aplica para headers tipo 'back' o 'custom' con titleKey.
880
+ */
881
+ this.headerTitle = computed(() => {
882
+ const config = this._headerConfig();
883
+ this.i18n.lang(); // Dependencia reactiva al idioma
884
+ if (config.type === 'back' && config.titleKey) {
885
+ return this.translateKey(config.titleKey);
886
+ }
887
+ if (config.type === 'custom') {
888
+ if (config.titleKey) {
889
+ return this.translateKey(config.titleKey);
890
+ }
891
+ return config.title || '';
892
+ }
893
+ return '';
894
+ });
895
+ /**
896
+ * Indica si el header actual tiene boton volver
897
+ */
898
+ this.hasBackButton = computed(() => {
899
+ const config = this._headerConfig();
900
+ return config.type === 'back' || (config.type === 'custom' && config.withBack);
901
+ });
617
902
  }
903
+ // ============================================
904
+ // Header Configuration Methods
905
+ // ============================================
906
+ /**
907
+ * Configura un header tipo "back" con titulo traducido.
908
+ *
909
+ * @param key Clave i18n (ej: 'pageTitle')
910
+ * @param namespace Namespace i18n (ej: 'Settings.Profile')
911
+ * @param backText Texto opcional del boton volver
912
+ *
913
+ * @example
914
+ * this.nav.setBackHeader('pageTitle', 'Settings.Profile');
915
+ */
916
+ setBackHeader(key, namespace, backText) {
917
+ const config = {
918
+ type: 'back',
919
+ titleKey: `${namespace}.${key}`,
920
+ backText,
921
+ };
922
+ this._headerConfig.set(config);
923
+ }
924
+ /**
925
+ * Configura un header tipo "home" con logo y acciones.
926
+ *
927
+ * @param options Opciones del header home
928
+ *
929
+ * @example
930
+ * this.nav.setHomeHeader({
931
+ * withMenu: true,
932
+ * actions: [
933
+ * { type: 'ICON', token: 'notifications', position: 'right', description: 'notifications-outline' }
934
+ * ]
935
+ * });
936
+ */
937
+ setHomeHeader(options = {}) {
938
+ const config = {
939
+ type: 'home',
940
+ withMenu: options.withMenu ?? false,
941
+ actions: options.actions ?? [],
942
+ logoSrc: options.logoSrc,
943
+ };
944
+ this._headerConfig.set(config);
945
+ }
946
+ /**
947
+ * Configura un header personalizado.
948
+ *
949
+ * @param options Opciones del header
950
+ */
951
+ setCustomHeader(options) {
952
+ const config = {
953
+ type: 'custom',
954
+ ...options,
955
+ };
956
+ this._headerConfig.set(config);
957
+ }
958
+ /**
959
+ * Oculta el header completamente.
960
+ */
961
+ hideHeader() {
962
+ this._headerConfig.set({ type: 'none' });
963
+ }
964
+ /**
965
+ * Resetea el header al estado por defecto (home).
966
+ */
967
+ resetHeader() {
968
+ this._headerConfig.set(DEFAULT_HOME_HEADER);
969
+ }
970
+ // ============================================
971
+ // Navigation Methods
972
+ // ============================================
618
973
  /**
619
974
  * Opens a URL using the in-app browser service.
620
975
  * @param url The URL to open
@@ -642,8 +997,8 @@ class NavigationService {
642
997
  navigateByUrl(url) {
643
998
  this.router
644
999
  .navigateByUrl(url)
645
- .then(response => { })
646
- .catch(error => { });
1000
+ .then(() => { })
1001
+ .catch(() => { });
647
1002
  }
648
1003
  /**
649
1004
  * Opens a URL in a new browser tab.
@@ -658,6 +1013,21 @@ class NavigationService {
658
1013
  back() {
659
1014
  this.location.back();
660
1015
  }
1016
+ // ============================================
1017
+ // Private Helpers
1018
+ // ============================================
1019
+ /**
1020
+ * Traduce una clave i18n en formato 'namespace.key'
1021
+ */
1022
+ translateKey(fullKey) {
1023
+ const lastDot = fullKey.lastIndexOf('.');
1024
+ if (lastDot === -1) {
1025
+ return this.i18n.t(fullKey);
1026
+ }
1027
+ const namespace = fullKey.substring(0, lastDot);
1028
+ const key = fullKey.substring(lastDot + 1);
1029
+ return this.i18n.t(key, namespace);
1030
+ }
661
1031
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, deps: [{ token: i1$1.Router }, { token: i1.Location }, { token: InAppBrowserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
662
1032
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, providedIn: 'root' }); }
663
1033
  }
@@ -3233,214 +3603,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
3233
3603
  }]
3234
3604
  }] });
3235
3605
 
3236
- /**
3237
- * Valores por defecto de configuración
3238
- */
3239
- const DEFAULT_I18N_CONFIG = {
3240
- defaultLanguage: 'es',
3241
- supportedLanguages: ['es', 'en'],
3242
- detectBrowserLanguage: true,
3243
- content: {},
3244
- includeDefaultContent: true,
3245
- };
3246
- /**
3247
- * Clave para persistir idioma en localStorage
3248
- */
3249
- const LANG_STORAGE_KEY$1 = 'app_lang';
3250
-
3251
- /**
3252
- * Servicio de internacionalización basado en Angular Signals.
3253
- *
3254
- * Características:
3255
- * - Sin RxJS: usa Signals para evitar memory leaks y congelamiento
3256
- * - Namespace-based: organiza traducciones por contexto
3257
- * - Fallback multi-nivel: namespace → _global → placeholder
3258
- * - Interpolación: soporta {variable} en textos
3259
- *
3260
- * @example
3261
- * // En un componente
3262
- * i18n = inject(I18nService);
3263
- *
3264
- * // Obtener texto
3265
- * const title = this.i18n.t('title', 'Login');
3266
- *
3267
- * // Con interpolación
3268
- * const welcome = this.i18n.t('welcome', 'Login', { name: 'Juan' });
3269
- *
3270
- * // Cambiar idioma
3271
- * this.i18n.setLanguage('en');
3272
- */
3273
- class I18nService {
3274
- constructor() {
3275
- // Estado interno con Signals
3276
- this._lang = signal(DEFAULT_I18N_CONFIG.defaultLanguage);
3277
- this._content = signal({});
3278
- this._supportedLanguages = signal(DEFAULT_I18N_CONFIG.supportedLanguages);
3279
- // Públicos readonly
3280
- this.lang = this._lang.asReadonly();
3281
- this.supportedLanguages = this._supportedLanguages.asReadonly();
3282
- // Computed para verificaciones rápidas
3283
- this.isSpanish = computed(() => this._lang() === 'es');
3284
- this.isEnglish = computed(() => this._lang() === 'en');
3285
- this.loadStoredLanguage();
3286
- }
3287
- /**
3288
- * Obtiene texto traducido (alias corto de getText)
3289
- *
3290
- * @param key Clave del texto
3291
- * @param namespace Namespace (default: '_global')
3292
- * @param data Variables para interpolación
3293
- * @returns Texto traducido o placeholder [namespace.key]
3294
- *
3295
- * @example
3296
- * i18n.t('submit'); // busca en _global
3297
- * i18n.t('title', 'Login'); // busca en Login
3298
- * i18n.t('welcome', 'Login', {name}); // con interpolación
3299
- */
3300
- t(key, namespace, data) {
3301
- return this.getText(key, namespace, data);
3302
- }
3303
- /**
3304
- * Obtiene texto traducido
3305
- *
3306
- * Fallback order:
3307
- * 1. content[namespace][lang][key]
3308
- * 2. content['_global'][lang][key]
3309
- * 3. "[namespace.key]" (placeholder)
3310
- */
3311
- getText(key, namespace, data) {
3312
- const content = this._content();
3313
- const lang = this._lang();
3314
- const ns = namespace || '_global';
3315
- // Buscar en namespace específico
3316
- let text = content[ns]?.[lang]?.[key];
3317
- // Fallback a _global
3318
- if (!text && ns !== '_global') {
3319
- text = content['_global']?.[lang]?.[key];
3320
- }
3321
- // Fallback a placeholder
3322
- if (!text) {
3323
- console.warn(`[i18n] Missing translation: ${ns}.${key} (${lang})`);
3324
- return `[${ns}.${key}]`;
3325
- }
3326
- // Aplicar interpolación si hay data
3327
- if (data) {
3328
- return this.interpolate(text, data);
3329
- }
3330
- return text;
3331
- }
3332
- /**
3333
- * Cambia el idioma de la aplicación
3334
- *
3335
- * @param lang Nuevo idioma
3336
- * @param forceReload Si true, recarga la página (fallback si reactividad falla)
3337
- */
3338
- setLanguage(lang, forceReload = false) {
3339
- if (!this._supportedLanguages().includes(lang)) {
3340
- console.warn(`[i18n] Language '${lang}' not in supported languages`);
3341
- return;
3342
- }
3343
- if (lang === this._lang()) {
3344
- return;
3345
- }
3346
- // Persistir en localStorage
3347
- localStorage.setItem(LANG_STORAGE_KEY$1, lang);
3348
- // Actualizar signal
3349
- this._lang.set(lang);
3350
- // Fallback: recargar si se solicita
3351
- if (forceReload) {
3352
- window.location.reload();
3353
- }
3354
- }
3355
- /**
3356
- * Registra contenido de traducciones para un namespace
3357
- *
3358
- * @param namespace Nombre del namespace
3359
- * @param content Contenido de traducciones
3360
- *
3361
- * @example
3362
- * i18n.registerContent('Login', {
3363
- * es: { title: 'Iniciar sesión' },
3364
- * en: { title: 'Sign in' }
3365
- * });
3366
- */
3367
- registerContent(namespace, content) {
3368
- this._content.update((store) => ({
3369
- ...store,
3370
- [namespace]: content,
3371
- }));
3372
- }
3373
- /**
3374
- * Registra múltiples namespaces de una vez
3375
- *
3376
- * @param contentStore Objeto con namespaces como keys
3377
- */
3378
- registerContentBulk(contentStore) {
3379
- this._content.update((store) => ({
3380
- ...store,
3381
- ...contentStore,
3382
- }));
3383
- }
3384
- /**
3385
- * Configura los idiomas soportados
3386
- */
3387
- setI18nLanguages(languages) {
3388
- this._supportedLanguages.set(languages);
3389
- }
3390
- /**
3391
- * Obtiene todos los namespaces registrados
3392
- */
3393
- getNamespaces() {
3394
- return Object.keys(this._content());
3395
- }
3396
- /**
3397
- * Verifica si un namespace tiene traducciones
3398
- */
3399
- hasNamespace(namespace) {
3400
- return namespace in this._content();
3401
- }
3402
- /**
3403
- * Carga idioma guardado en localStorage o detecta del navegador
3404
- */
3405
- loadStoredLanguage() {
3406
- const stored = localStorage.getItem(LANG_STORAGE_KEY$1);
3407
- if (stored && this.isValidLanguage(stored)) {
3408
- this._lang.set(stored);
3409
- return;
3410
- }
3411
- // Detectar idioma del navegador
3412
- const browserLang = navigator.language.split('-')[0];
3413
- if (this.isValidLanguage(browserLang)) {
3414
- this._lang.set(browserLang);
3415
- localStorage.setItem(LANG_STORAGE_KEY$1, browserLang);
3416
- }
3417
- }
3418
- /**
3419
- * Valida si un idioma está soportado
3420
- */
3421
- isValidLanguage(lang) {
3422
- return this._supportedLanguages().includes(lang);
3423
- }
3424
- /**
3425
- * Reemplaza {variable} en texto con valores de data
3426
- *
3427
- * @example
3428
- * interpolate('Hola {name}', { name: 'Juan' }) // 'Hola Juan'
3429
- */
3430
- interpolate(text, data) {
3431
- return Object.entries(data).reduce((result, [key, value]) => {
3432
- const regex = new RegExp(`\\{${key}\\}`, 'g');
3433
- return result.replace(regex, value);
3434
- }, text);
3435
- }
3436
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: I18nService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3437
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: I18nService, providedIn: 'root' }); }
3438
- }
3439
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: I18nService, decorators: [{
3440
- type: Injectable,
3441
- args: [{ providedIn: 'root' }]
3442
- }], ctorParameters: () => [] });
3443
-
3444
3606
  /**
3445
3607
  * Helper para resolver traducciones i18n en InputMetadata y FormMetadata.
3446
3608
  *
@@ -40932,10 +41094,11 @@ function buildFooterLinks(links, t) {
40932
41094
  /*
40933
41095
  * Public API Surface of valtech-components
40934
41096
  */
41097
+ // Version
40935
41098
 
40936
41099
  /**
40937
41100
  * Generated bundle index. Do not edit.
40938
41101
  */
40939
41102
 
40940
- export { ACTION_CARD_DEFAULTS, AD_SIZE_MAP, API_TABLE_COLUMN_LABELS, ARTICLE_SPACING, AccordionComponent, ActionCardComponent, ActionHeaderComponent, ActionType, AdSlotComponent, AdsLoaderService, AdsService, AlertBoxComponent, AnalyticsErrorHandler, AnalyticsRouterTracker, AnalyticsService, AppConfigService, ArticleBuilder, ArticleComponent, AuthBackgroundComponent, AuthService, AuthStateService, AuthStorageService, AuthSyncService, AvatarComponent, BOTTOM_NAV_DEFAULTS, BannerComponent, BaseDefault, BottomNavComponent, BoxComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, COMMON_COUNTRY_CODES, COMMON_CURRENCIES, CURRENCY_INFO, CardComponent, CardSection, CardType, CardsCarouselComponent, CheckInputComponent, ChipGroupComponent, ClearDefault, ClearDefaultBlock, ClearDefaultFull, ClearDefaultRound, ClearDefaultRoundBlock, ClearDefaultRoundFull, CodeDisplayComponent, CommandDisplayComponent, CommentComponent, CommentInputComponent, CommentSectionComponent, CompanyFooterComponent, ComponentStates, ConfirmationDialogService, ContentLoaderComponent, ContentReactionComponent, CountdownComponent, CurrencyInputComponent, DEFAULT_ADS_CONFIG, DEFAULT_APP_CONFIG_SERVICE_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CANCEL_BUTTON, DEFAULT_CONFIRM_BUTTON, DEFAULT_COUNTDOWN_LABELS, DEFAULT_COUNTDOWN_LABELS_EN, DEFAULT_EMPTY_STATE, DEFAULT_EMULATOR_CONFIG, DEFAULT_FEEDBACK_CONFIG, DEFAULT_FEEDBACK_TYPE_OPTIONS, DEFAULT_INFINITE_LIST_METADATA, DEFAULT_LEGEND_LABELS, DEFAULT_MODAL_CANCEL_BUTTON, DEFAULT_MODAL_CONFIRM_BUTTON, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PAYMENT_STATUS_COLORS, DEFAULT_PAYMENT_STATUS_LABELS, DEFAULT_PLATFORMS, DEFAULT_REFRESHER_METADATA, DEFAULT_SKELETON_CONFIG, DEFAULT_STATUS_COLORS, DEFAULT_STATUS_LABELS, DEFAULT_WINNER_LABELS, DataTableComponent, DateInputComponent, DateRangeInputComponent, DetailSkeletonComponent, DeviceService, DisplayComponent, DividerComponent, DocsApiTableComponent, DocsBreadcrumbComponent, DocsCalloutComponent, DocsCodeExampleComponent, DocsLayoutComponent, DocsNavLinksComponent, DocsNavigationService, DocsPageComponent, DocsSearchComponent, DocsSectionComponent, DocsShellComponent, DocsSidebarComponent, DocsTocComponent, DownloadService, EmailInputComponent, ExpandableTextComponent, FEATURES_LIST_DEFAULTS, FabComponent, FeaturesListComponent, FeedbackFormComponent, FeedbackService, FileInputComponent, FirebaseService, FirestoreCollectionFactory, FirestoreService, FooterComponent, FooterLinksComponent, FormComponent, FormFooterComponent, FormSkeletonComponent, FunHeaderComponent, GlowCardComponent, GridSkeletonComponent, HeaderComponent, HintComponent, HorizontalScrollComponent, HourInputComponent, HrefComponent, I18nService, INITIAL_AUTH_STATE, INITIAL_MFA_STATE, Icon, IconComponent, IconService, ImageComponent, InAppBrowserService, InfiniteListComponent, InfoComponent, InputI18nHelper, InputType, ItemListComponent, LANG_STORAGE_KEY$1 as LANG_STORAGE_KEY, LOGIN_DEFAULTS, LanguageSelectorComponent, LayeredCardComponent, LayoutComponent, LinkComponent, LinkProcessorService, LinkedProvidersComponent, LinksAccordionComponent, LinksCakeComponent, ListSkeletonComponent, LoadingDirective, LocalStorageService, LocaleService, LoginComponent, MODAL_SIZES, MOTION, MaintenancePageComponent, MenuComponent, MessagingService, MetaService, ModalService, MultiSelectSearchComponent, NavigationService, NoContentComponent, NotesBoxComponent, NotificationsService, NumberFromToComponent, NumberInputComponent, NumberStepperComponent, OAUTH_PROVIDERS_INFO, OAuthCallbackComponent, OAuthService, OutlineDefault, OutlineDefaultBlock, OutlineDefaultFull, OutlineDefaultRound, OutlineDefaultRoundBlock, OutlineDefaultRoundFull, PLATFORM_CONFIGS, PageContentComponent, PageTemplateComponent, PageWrapperComponent, PaginationComponent, PaginationService, ParticipantCardComponent, PasswordInputComponent, PhoneInputComponent, PillComponent, PinInputComponent, PlainCodeBoxComponent, PopoverSelectorComponent, PresetService, PriceTagComponent, PrimarySolidBlockButton, PrimarySolidBlockHrefButton, PrimarySolidBlockIconButton, PrimarySolidBlockIconHrefButton, PrimarySolidDefaultRoundButton, PrimarySolidDefaultRoundHrefButton, PrimarySolidDefaultRoundIconButton, PrimarySolidDefaultRoundIconHrefButton, PrimarySolidFullButton, PrimarySolidFullHrefButton, PrimarySolidFullIconButton, PrimarySolidFullIconHrefButton, PrimarySolidLargeRoundButton, PrimarySolidLargeRoundHrefButton, PrimarySolidLargeRoundIconButton, PrimarySolidLargeRoundIconHrefButton, PrimarySolidSmallRoundButton, PrimarySolidSmallRoundHrefButton, PrimarySolidSmallRoundIconButton, PrimarySolidSmallRoundIconHrefButton, ProcessLinksPipe, ProfileSkeletonComponent, ProgressBarComponent, ProgressRingComponent, ProgressStatusComponent, PrompterComponent, QR_PRESETS, QrCodeComponent, QrGeneratorService, QueryBuilder, QuoteBoxComponent, RadioInputComponent, RaffleStatusCardComponent, RangeInputComponent, RatingComponent, RecapCardComponent, RefresherComponent, RightsFooterComponent, RotatingTextComponent, SKELETON_PRESETS, SearchSelectorComponent, SearchbarComponent, SecondarySolidBlockButton, SecondarySolidBlockHrefButton, SecondarySolidBlockIconButton, SecondarySolidBlockIconHrefButton, SecondarySolidDefaultRoundButton, SecondarySolidDefaultRoundHrefButton, SecondarySolidDefaultRoundIconButton, SecondarySolidDefaultRoundIconHrefButton, SecondarySolidFullButton, SecondarySolidFullHrefButton, SecondarySolidFullIconButton, SecondarySolidFullIconHrefButton, SecondarySolidLargeRoundButton, SecondarySolidLargeRoundHrefButton, SecondarySolidLargeRoundIconButton, SecondarySolidLargeRoundIconHrefButton, SecondarySolidSmallRoundButton, SecondarySolidSmallRoundHrefButton, SecondarySolidSmallRoundIconButton, SecondarySolidSmallRoundIconHrefButton, SegmentControlComponent, SelectSearchComponent, SessionService, ShareButtonsComponent, SimpleComponent, SkeletonComponent, SkeletonService, SolidBlockButton, SolidDefault, SolidDefaultBlock, SolidDefaultButton, SolidDefaultFull, SolidDefaultRound, SolidDefaultRoundBlock, SolidDefaultRoundButton, SolidDefaultRoundFull, SolidFullButton, SolidLargeButton, SolidLargeRoundButton, SolidSmallButton, SolidSmallRoundButton, StatsCardComponent, StepperComponent, StorageService, SwipeCarouselComponent, TabbedContentComponent, TableSkeletonComponent, TabsComponent, Terminal404Component, TestimonialCardComponent, TestimonialCarouselComponent, TextComponent, TextInputComponent, TextareaInputComponent, ThemeOption, ThemeService, TicketGridComponent, TimelineComponent, TitleBlockComponent, TitleComponent, ToastService, ToggleInputComponent, TokenService, ToolbarActionType, ToolbarComponent, TranslatePipe, TypedCollection, UpdateBannerComponent, UsernameInputComponent, VALTECH_ADS_CONFIG, VALTECH_APP_CONFIG, VALTECH_AUTH_CONFIG, VALTECH_COMPANY_LINKS, VALTECH_DEFAULT_CONTENT, VALTECH_FEEDBACK_CONFIG, VALTECH_FIREBASE_CONFIG, VALTECH_FOOTER_I18N, VALTECH_FOOTER_LOGO, VALTECH_LANGUAGE_SELECTOR, VALTECH_SOCIAL_LINKS, WinnerDisplayComponent, WizardComponent, WizardFooterComponent, applyDefaultValueToControl, authGuard, authInterceptor, buildFooterLinks, buildPath, collections, createFirebaseConfig, createGlowCardProps, createInitialPaginationState, createNumberFromToField, createTitleProps, extractPathParams, getAppInfo, getAppVersion, getCollectionPath, getDocumentId, goToTop, guestGuard, hasEmulators, isAtEnd, isCollectionPath, isDocumentPath, isEmulatorMode, isValidPath, joinPath, maxLength, permissionGuard, permissionGuardFromRoute, provideValtechAds, provideValtechAppConfig, provideValtechAuth, provideValtechAuthInterceptor, provideValtechFeedback, provideValtechFirebase, provideValtechI18n, provideValtechPresets, provideValtechSkeleton, query, replaceSpecialChars, resolveColor, resolveInputDefaultValue, roleGuard, storagePaths, superAdminGuard };
41103
+ export { ACTION_CARD_DEFAULTS, AD_SIZE_MAP, API_TABLE_COLUMN_LABELS, ARTICLE_SPACING, AccordionComponent, ActionCardComponent, ActionHeaderComponent, ActionType, AdSlotComponent, AdsLoaderService, AdsService, AlertBoxComponent, AnalyticsErrorHandler, AnalyticsRouterTracker, AnalyticsService, AppConfigService, ArticleBuilder, ArticleComponent, AuthBackgroundComponent, AuthService, AuthStateService, AuthStorageService, AuthSyncService, AvatarComponent, BOTTOM_NAV_DEFAULTS, BannerComponent, BaseDefault, BottomNavComponent, BoxComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, COMMON_COUNTRY_CODES, COMMON_CURRENCIES, CURRENCY_INFO, CardComponent, CardSection, CardType, CardsCarouselComponent, CheckInputComponent, ChipGroupComponent, ClearDefault, ClearDefaultBlock, ClearDefaultFull, ClearDefaultRound, ClearDefaultRoundBlock, ClearDefaultRoundFull, CodeDisplayComponent, CommandDisplayComponent, CommentComponent, CommentInputComponent, CommentSectionComponent, CompanyFooterComponent, ComponentStates, ConfirmationDialogService, ContentLoaderComponent, ContentReactionComponent, CountdownComponent, CurrencyInputComponent, DEFAULT_ADS_CONFIG, DEFAULT_APP_CONFIG_SERVICE_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_BACK_HEADER, DEFAULT_CANCEL_BUTTON, DEFAULT_CONFIRM_BUTTON, DEFAULT_COUNTDOWN_LABELS, DEFAULT_COUNTDOWN_LABELS_EN, DEFAULT_EMPTY_STATE, DEFAULT_EMULATOR_CONFIG, DEFAULT_FEEDBACK_CONFIG, DEFAULT_FEEDBACK_TYPE_OPTIONS, DEFAULT_HOME_HEADER, DEFAULT_INFINITE_LIST_METADATA, DEFAULT_LEGEND_LABELS, DEFAULT_MODAL_CANCEL_BUTTON, DEFAULT_MODAL_CONFIRM_BUTTON, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PAYMENT_STATUS_COLORS, DEFAULT_PAYMENT_STATUS_LABELS, DEFAULT_PLATFORMS, DEFAULT_REFRESHER_METADATA, DEFAULT_SKELETON_CONFIG, DEFAULT_STATUS_COLORS, DEFAULT_STATUS_LABELS, DEFAULT_WINNER_LABELS, DataTableComponent, DateInputComponent, DateRangeInputComponent, DetailSkeletonComponent, DeviceService, DisplayComponent, DividerComponent, DocsApiTableComponent, DocsBreadcrumbComponent, DocsCalloutComponent, DocsCodeExampleComponent, DocsLayoutComponent, DocsNavLinksComponent, DocsNavigationService, DocsPageComponent, DocsSearchComponent, DocsSectionComponent, DocsShellComponent, DocsSidebarComponent, DocsTocComponent, DownloadService, EmailInputComponent, ExpandableTextComponent, FEATURES_LIST_DEFAULTS, FabComponent, FeaturesListComponent, FeedbackFormComponent, FeedbackService, FileInputComponent, FirebaseService, FirestoreCollectionFactory, FirestoreService, FooterComponent, FooterLinksComponent, FormComponent, FormFooterComponent, FormSkeletonComponent, FunHeaderComponent, GlowCardComponent, GridSkeletonComponent, HeaderComponent, HintComponent, HorizontalScrollComponent, HourInputComponent, HrefComponent, I18nService, INITIAL_AUTH_STATE, INITIAL_MFA_STATE, Icon, IconComponent, IconService, ImageComponent, InAppBrowserService, InfiniteListComponent, InfoComponent, InputI18nHelper, InputType, ItemListComponent, LANG_STORAGE_KEY$1 as LANG_STORAGE_KEY, LOGIN_DEFAULTS, LanguageSelectorComponent, LayeredCardComponent, LayoutComponent, LinkComponent, LinkProcessorService, LinkedProvidersComponent, LinksAccordionComponent, LinksCakeComponent, ListSkeletonComponent, LoadingDirective, LocalStorageService, LocaleService, LoginComponent, MODAL_SIZES, MOTION, MaintenancePageComponent, MenuComponent, MessagingService, MetaService, ModalService, MultiSelectSearchComponent, NavigationService, NoContentComponent, NotesBoxComponent, NotificationsService, NumberFromToComponent, NumberInputComponent, NumberStepperComponent, OAUTH_PROVIDERS_INFO, OAuthCallbackComponent, OAuthService, OutlineDefault, OutlineDefaultBlock, OutlineDefaultFull, OutlineDefaultRound, OutlineDefaultRoundBlock, OutlineDefaultRoundFull, PLATFORM_CONFIGS, PageContentComponent, PageTemplateComponent, PageWrapperComponent, PaginationComponent, PaginationService, ParticipantCardComponent, PasswordInputComponent, PhoneInputComponent, PillComponent, PinInputComponent, PlainCodeBoxComponent, PopoverSelectorComponent, PresetService, PriceTagComponent, PrimarySolidBlockButton, PrimarySolidBlockHrefButton, PrimarySolidBlockIconButton, PrimarySolidBlockIconHrefButton, PrimarySolidDefaultRoundButton, PrimarySolidDefaultRoundHrefButton, PrimarySolidDefaultRoundIconButton, PrimarySolidDefaultRoundIconHrefButton, PrimarySolidFullButton, PrimarySolidFullHrefButton, PrimarySolidFullIconButton, PrimarySolidFullIconHrefButton, PrimarySolidLargeRoundButton, PrimarySolidLargeRoundHrefButton, PrimarySolidLargeRoundIconButton, PrimarySolidLargeRoundIconHrefButton, PrimarySolidSmallRoundButton, PrimarySolidSmallRoundHrefButton, PrimarySolidSmallRoundIconButton, PrimarySolidSmallRoundIconHrefButton, ProcessLinksPipe, ProfileSkeletonComponent, ProgressBarComponent, ProgressRingComponent, ProgressStatusComponent, PrompterComponent, QR_PRESETS, QrCodeComponent, QrGeneratorService, QueryBuilder, QuoteBoxComponent, RadioInputComponent, RaffleStatusCardComponent, RangeInputComponent, RatingComponent, RecapCardComponent, RefresherComponent, RightsFooterComponent, RotatingTextComponent, SKELETON_PRESETS, SearchSelectorComponent, SearchbarComponent, SecondarySolidBlockButton, SecondarySolidBlockHrefButton, SecondarySolidBlockIconButton, SecondarySolidBlockIconHrefButton, SecondarySolidDefaultRoundButton, SecondarySolidDefaultRoundHrefButton, SecondarySolidDefaultRoundIconButton, SecondarySolidDefaultRoundIconHrefButton, SecondarySolidFullButton, SecondarySolidFullHrefButton, SecondarySolidFullIconButton, SecondarySolidFullIconHrefButton, SecondarySolidLargeRoundButton, SecondarySolidLargeRoundHrefButton, SecondarySolidLargeRoundIconButton, SecondarySolidLargeRoundIconHrefButton, SecondarySolidSmallRoundButton, SecondarySolidSmallRoundHrefButton, SecondarySolidSmallRoundIconButton, SecondarySolidSmallRoundIconHrefButton, SegmentControlComponent, SelectSearchComponent, SessionService, ShareButtonsComponent, SimpleComponent, SkeletonComponent, SkeletonService, SolidBlockButton, SolidDefault, SolidDefaultBlock, SolidDefaultButton, SolidDefaultFull, SolidDefaultRound, SolidDefaultRoundBlock, SolidDefaultRoundButton, SolidDefaultRoundFull, SolidFullButton, SolidLargeButton, SolidLargeRoundButton, SolidSmallButton, SolidSmallRoundButton, StatsCardComponent, StepperComponent, StorageService, SwipeCarouselComponent, TabbedContentComponent, TableSkeletonComponent, TabsComponent, Terminal404Component, TestimonialCardComponent, TestimonialCarouselComponent, TextComponent, TextInputComponent, TextareaInputComponent, ThemeOption, ThemeService, TicketGridComponent, TimelineComponent, TitleBlockComponent, TitleComponent, ToastService, ToggleInputComponent, TokenService, ToolbarActionType, ToolbarComponent, TranslatePipe, TypedCollection, UpdateBannerComponent, UsernameInputComponent, VALTECH_ADS_CONFIG, VALTECH_APP_CONFIG, VALTECH_AUTH_CONFIG, VALTECH_COMPANY_LINKS, VALTECH_DEFAULT_CONTENT, VALTECH_FEEDBACK_CONFIG, VALTECH_FIREBASE_CONFIG, VALTECH_FOOTER_I18N, VALTECH_FOOTER_LOGO, VALTECH_LANGUAGE_SELECTOR, VALTECH_SOCIAL_LINKS, VERSION, WinnerDisplayComponent, WizardComponent, WizardFooterComponent, applyDefaultValueToControl, authGuard, authInterceptor, buildFooterLinks, buildPath, collections, createFirebaseConfig, createGlowCardProps, createInitialPaginationState, createNumberFromToField, createTitleProps, extractPathParams, getAppInfo, getAppVersion, getCollectionPath, getDocumentId, goToTop, guestGuard, hasEmulators, isAtEnd, isCollectionPath, isDocumentPath, isEmulatorMode, isValidPath, joinPath, maxLength, permissionGuard, permissionGuardFromRoute, provideValtechAds, provideValtechAppConfig, provideValtechAuth, provideValtechAuthInterceptor, provideValtechFeedback, provideValtechFirebase, provideValtechI18n, provideValtechPresets, provideValtechSkeleton, query, replaceSpecialChars, resolveColor, resolveInputDefaultValue, roleGuard, storagePaths, superAdminGuard };
40941
41104
  //# sourceMappingURL=valtech-components.mjs.map