valtech-components 2.0.977 → 2.0.979
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/organisms/form/form.component.mjs +6 -1
- package/esm2022/lib/components/organisms/preferences-view/preferences-view.component.mjs +68 -1
- package/esm2022/lib/components/organisms/preferences-view/preferences-view.i18n.mjs +11 -1
- package/esm2022/lib/components/organisms/preferences-view/types.mjs +1 -1
- package/esm2022/lib/components/types.mjs +1 -1
- package/esm2022/lib/config/company-footer.config.mjs +69 -11
- package/esm2022/lib/services/font-size/font-size.service.mjs +53 -0
- package/esm2022/lib/services/preferences/preferences.service.mjs +31 -5
- package/esm2022/lib/services/preferences/preferences.types.mjs +1 -1
- package/esm2022/lib/services/requests/types.mjs +1 -1
- package/esm2022/lib/shared/constants/storage.mjs +2 -1
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/valtech-components.mjs +228 -14
- 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/atoms/user-avatar/user-avatar.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 +4 -7
- package/lib/components/organisms/preferences-view/preferences-view.component.d.ts +5 -1
- package/lib/components/organisms/preferences-view/types.d.ts +5 -1
- package/lib/components/types.d.ts +5 -2
- package/lib/config/company-footer.config.d.ts +42 -0
- package/lib/services/font-size/font-size.service.d.ts +16 -0
- package/lib/services/preferences/preferences.service.d.ts +8 -3
- package/lib/services/preferences/preferences.types.d.ts +4 -0
- package/lib/services/requests/types.d.ts +1 -1
- package/lib/shared/constants/storage.d.ts +1 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -43,7 +43,7 @@ export declare class RightsFooterComponent {
|
|
|
43
43
|
/**
|
|
44
44
|
* Computed helper for color prop in template.
|
|
45
45
|
*/
|
|
46
|
-
propsColor: import("@angular/core").Signal<"
|
|
46
|
+
propsColor: import("@angular/core").Signal<"success" | "medium" | "primary" | "secondary" | "tertiary" | "warning" | "danger" | "light" | "dark">;
|
|
47
47
|
/**
|
|
48
48
|
* Computed helper for withMargin prop in template.
|
|
49
49
|
*/
|
|
@@ -11,7 +11,7 @@ export declare class TextComponent {
|
|
|
11
11
|
*/
|
|
12
12
|
displayContent: import("@angular/core").Signal<string>;
|
|
13
13
|
propsColor: import("@angular/core").Signal<import("@ionic/core").Color>;
|
|
14
|
-
propsSize: import("@angular/core").Signal<"
|
|
14
|
+
propsSize: import("@angular/core").Signal<"small" | "medium" | "large" | "xlarge">;
|
|
15
15
|
propsBold: import("@angular/core").Signal<boolean>;
|
|
16
16
|
propsProcessLinks: import("@angular/core").Signal<boolean>;
|
|
17
17
|
propsAllowPartialBold: import("@angular/core").Signal<boolean>;
|
|
@@ -38,7 +38,7 @@ export declare class UserAvatarComponent {
|
|
|
38
38
|
readonly imageUrl: import("@angular/core").Signal<string>;
|
|
39
39
|
/** Iniciales — 1-2 chars derivados de name (preferred) o email prefix. */
|
|
40
40
|
readonly initials: import("@angular/core").Signal<string>;
|
|
41
|
-
readonly sizeClass: import("@angular/core").Signal<"
|
|
41
|
+
readonly sizeClass: import("@angular/core").Signal<"small" | "medium" | "large" | "xlarge" | "xsmall">;
|
|
42
42
|
readonly shapeClass: import("@angular/core").Signal<"circle" | "square">;
|
|
43
43
|
/** Background — explicito o derivado deterministicamente del user. */
|
|
44
44
|
readonly bgColor: import("@angular/core").Signal<string>;
|
|
@@ -41,7 +41,7 @@ export declare class FeaturesListComponent {
|
|
|
41
41
|
iconColor: string;
|
|
42
42
|
iconSize: number;
|
|
43
43
|
mode: "horizontal" | "vertical";
|
|
44
|
-
gap: "
|
|
44
|
+
gap: "small" | "medium" | "large";
|
|
45
45
|
alignment: "center" | "start";
|
|
46
46
|
imageShape: "circle" | "square";
|
|
47
47
|
maxVisible: number;
|
|
@@ -45,7 +45,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
45
45
|
getVideoElement(element: ArticleElement): ArticleVideoElement;
|
|
46
46
|
getCustomElement(element: ArticleElement): ArticleCustomElement;
|
|
47
47
|
getQuoteTextProps(element: ArticleElement): {
|
|
48
|
-
size: "
|
|
48
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
49
49
|
color: import("@ionic/core").Color;
|
|
50
50
|
content?: string;
|
|
51
51
|
bold: boolean;
|
|
@@ -61,7 +61,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
61
61
|
showQuoteMark?: boolean;
|
|
62
62
|
};
|
|
63
63
|
getHighlightTextProps(element: ArticleElement): {
|
|
64
|
-
size: "
|
|
64
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
65
65
|
color: import("@ionic/core").Color;
|
|
66
66
|
content?: string;
|
|
67
67
|
bold: boolean;
|
|
@@ -89,12 +89,9 @@ export declare class ArticleComponent implements OnInit {
|
|
|
89
89
|
contentFallback?: string;
|
|
90
90
|
contentInterpolation?: Record<string, string | number>;
|
|
91
91
|
icon?: import("valtech-components").IconMetada;
|
|
92
|
-
shape?: "round";
|
|
93
|
-
* Configuración del artículo
|
|
94
|
-
* @type {ArticleMetadata}
|
|
95
|
-
*/
|
|
92
|
+
shape?: "round";
|
|
96
93
|
size?: "default" | "small" | "large";
|
|
97
|
-
fill?: "
|
|
94
|
+
fill?: "default" | "clear" | "outline" | "solid";
|
|
98
95
|
type: "reset" | "submit" | "button";
|
|
99
96
|
token?: string;
|
|
100
97
|
ref?: any;
|
|
@@ -30,7 +30,7 @@ export declare class PreferencesViewComponent {
|
|
|
30
30
|
*/
|
|
31
31
|
config?: PreferencesViewConfig;
|
|
32
32
|
/** Config mergeada con defaults. @Input gana sobre route data. */
|
|
33
|
-
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<PreferencesViewConfig, "onThemeChanged" | "onLanguageChanged">> & Pick<PreferencesViewConfig, "onThemeChanged" | "onLanguageChanged">>;
|
|
33
|
+
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<PreferencesViewConfig, "onThemeChanged" | "onLanguageChanged" | "onFontSizeChanged">> & Pick<PreferencesViewConfig, "onThemeChanged" | "onLanguageChanged" | "onFontSizeChanged">>;
|
|
34
34
|
/** Namespace i18n resuelto (capturado para llamadas no-reactivas). */
|
|
35
35
|
private get ns();
|
|
36
36
|
readonly saving: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -40,10 +40,14 @@ export declare class PreferencesViewComponent {
|
|
|
40
40
|
readonly themeHint: import("@angular/core").Signal<string>;
|
|
41
41
|
readonly langTitle: import("@angular/core").Signal<string>;
|
|
42
42
|
readonly langHint: import("@angular/core").Signal<string>;
|
|
43
|
+
readonly fontSizeTitle: import("@angular/core").Signal<string>;
|
|
44
|
+
readonly fontSizeHint: import("@angular/core").Signal<string>;
|
|
43
45
|
readonly themeProps: import("@angular/core").Signal<Partial<SegmentControlMetadata>>;
|
|
44
46
|
readonly langProps: import("@angular/core").Signal<Partial<LanguageSelectorMetadata>>;
|
|
47
|
+
readonly fontSizeProps: import("@angular/core").Signal<Partial<SegmentControlMetadata>>;
|
|
45
48
|
constructor();
|
|
46
49
|
onThemeChange(value: string): Promise<void>;
|
|
50
|
+
onFontSizeChange(value: string): Promise<void>;
|
|
47
51
|
onLanguageChange(value: string): Promise<void>;
|
|
48
52
|
private dispatch;
|
|
49
53
|
/** Lee del namespace configurado. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PreferencesLanguage, PreferencesTheme } from '../../../services/preferences/preferences.types';
|
|
1
|
+
import { PreferencesFontSize, PreferencesLanguage, PreferencesTheme } from '../../../services/preferences/preferences.types';
|
|
2
2
|
/**
|
|
3
3
|
* Configuración acotada de `val-preferences-view` (object-first). Ejes
|
|
4
4
|
* permitidos:
|
|
@@ -19,6 +19,8 @@ export interface PreferencesViewConfig {
|
|
|
19
19
|
showTheme?: boolean;
|
|
20
20
|
/** Muestra la sección de idioma (language selector). Default `true`. */
|
|
21
21
|
showLanguage?: boolean;
|
|
22
|
+
/** Muestra la sección de tamaño de fuente (segment pequeño/mediano/grande). Default `true`. */
|
|
23
|
+
showFontSize?: boolean;
|
|
22
24
|
/**
|
|
23
25
|
* Idiomas ofrecidos en el selector. Default `['es', 'en']`.
|
|
24
26
|
*/
|
|
@@ -32,4 +34,6 @@ export interface PreferencesViewConfig {
|
|
|
32
34
|
onThemeChanged?: (theme: PreferencesTheme) => void;
|
|
33
35
|
/** Callback tras un cambio de idioma exitoso. */
|
|
34
36
|
onLanguageChanged?: (lang: PreferencesLanguage) => void;
|
|
37
|
+
/** Callback tras un cambio de tamaño de fuente exitoso. */
|
|
38
|
+
onFontSizeChanged?: (fontSize: PreferencesFontSize) => void;
|
|
35
39
|
}
|
|
@@ -190,8 +190,11 @@ export type FormMetadata = {
|
|
|
190
190
|
name: string;
|
|
191
191
|
/** Form sections */
|
|
192
192
|
sections: FormSection[];
|
|
193
|
-
/**
|
|
194
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Configuración del botón de submit. Opcional: en modo `controlled` el form
|
|
195
|
+
* no renderiza submit propio (lo maneja el host) y `actions` se ignora.
|
|
196
|
+
*/
|
|
197
|
+
actions?: ButtonMetadata;
|
|
195
198
|
/** Global form state */
|
|
196
199
|
state: ComponentState;
|
|
197
200
|
/**
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* When links or social profiles change, update here and publish a new version.
|
|
10
10
|
*/
|
|
11
|
+
import type { CompanyFooterMetadata } from '../components/organisms/company-footer/types';
|
|
12
|
+
import type { LegalLinkService } from '../services/legal-link/legal-link.service';
|
|
11
13
|
/**
|
|
12
14
|
* Social media links for Valtech
|
|
13
15
|
*/
|
|
@@ -120,3 +122,43 @@ export declare function buildFooterLinks(links: CompanyLink[], t: (key: string)
|
|
|
120
122
|
hoverable: boolean;
|
|
121
123
|
target?: string;
|
|
122
124
|
}>;
|
|
125
|
+
/**
|
|
126
|
+
* Translation helper for the `Layout` namespace — `(key) => translatedString`.
|
|
127
|
+
* Typically `i18n.t.bind(i18n)` scoped to the footer namespace.
|
|
128
|
+
*/
|
|
129
|
+
export type LayoutTranslator = (key: string) => string;
|
|
130
|
+
/**
|
|
131
|
+
* Builds a `CompanyLinkResolver` that rewrites cross-app `legal`/`site` links to
|
|
132
|
+
* the main brand site via `LegalLinkService`, leaving `support` (and any other)
|
|
133
|
+
* links untouched.
|
|
134
|
+
*
|
|
135
|
+
* Satellite apps (showcase, sigify, …) wire `provideValtechSite(env)` so that
|
|
136
|
+
* `legal`/`site` links resolve to the canonical main-site URLs; `support` links
|
|
137
|
+
* stay per-app. This is the generic half of an app's footer resolver — apps that
|
|
138
|
+
* need extra per-link overrides (e.g. redirecting `/feedback` to an authed route)
|
|
139
|
+
* compose this with their own logic.
|
|
140
|
+
*
|
|
141
|
+
* @param legal Injected `LegalLinkService` (no-op when running as the main site).
|
|
142
|
+
* @param locale Getter for the active locale (e.g. `() => i18n.lang()`) — appended
|
|
143
|
+
* as `?lang=` when the resolved URL is cross-origin.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* const base = buildLegalLinkResolver(legal, () => i18n.lang());
|
|
147
|
+
* const resolver: CompanyLinkResolver = (link) =>
|
|
148
|
+
* link.url === '/feedback' ? { url: '/app/feedback', external: false } : base(link);
|
|
149
|
+
*/
|
|
150
|
+
export declare function buildLegalLinkResolver(legal: LegalLinkService, locale: () => string): CompanyLinkResolver;
|
|
151
|
+
/**
|
|
152
|
+
* Builds the shared `CompanyFooterMetadata` used across Valtech apps (login,
|
|
153
|
+
* legal, public landing, …) so the footer stays consistent. Assembles the
|
|
154
|
+
* standard left/right link sections, logo, social links and language selector
|
|
155
|
+
* from the shared config.
|
|
156
|
+
*
|
|
157
|
+
* Call from a `computed()` that reads the active language for reactivity.
|
|
158
|
+
*
|
|
159
|
+
* @param t Translation helper for the `Layout` namespace.
|
|
160
|
+
* @param linkResolver Optional resolver applied to every footer link — typically
|
|
161
|
+
* `buildLegalLinkResolver(...)` (or an app wrapper) to point `legal`/`site`
|
|
162
|
+
* links at the main site when running as a satellite app.
|
|
163
|
+
*/
|
|
164
|
+
export declare function buildCompanyFooterProps(t: LayoutTranslator, linkResolver?: CompanyLinkResolver): CompanyFooterMetadata;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare enum FontSizeOption {
|
|
3
|
+
SMALL = "small",
|
|
4
|
+
MEDIUM = "medium",
|
|
5
|
+
LARGE = "large"
|
|
6
|
+
}
|
|
7
|
+
export declare class FontSizeService {
|
|
8
|
+
private readonly _size;
|
|
9
|
+
readonly size: import("@angular/core").Signal<FontSizeOption>;
|
|
10
|
+
private readonly isBrowser;
|
|
11
|
+
constructor(platformId: object);
|
|
12
|
+
setSize(size: FontSizeOption): void;
|
|
13
|
+
private applySize;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FontSizeService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FontSizeService>;
|
|
16
|
+
}
|
|
@@ -4,7 +4,8 @@ import { ValtechAuthConfig } from '../auth/types';
|
|
|
4
4
|
import { FirestoreService } from '../firebase/firestore.service';
|
|
5
5
|
import { I18nService } from '../i18n/i18n.service';
|
|
6
6
|
import { ThemeService } from '../theme.service';
|
|
7
|
-
import {
|
|
7
|
+
import { FontSizeService } from '../font-size/font-size.service';
|
|
8
|
+
import { PreferencesFontSize, PreferencesLanguage, PreferencesTheme, PreferencesUpdate, PreferencesUpdateResponse } from './preferences.types';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* PreferencesService — preferencias del user en el doc canónico Firestore
|
|
@@ -26,14 +27,17 @@ export declare class PreferencesService {
|
|
|
26
27
|
private auth;
|
|
27
28
|
private http;
|
|
28
29
|
private themeService;
|
|
30
|
+
private fontSizeService;
|
|
29
31
|
private i18n;
|
|
30
32
|
private readonly _theme;
|
|
31
33
|
private readonly _language;
|
|
34
|
+
private readonly _fontSize;
|
|
32
35
|
private readonly _notificationsMaster;
|
|
33
36
|
/** `true` después del primer snapshot Firestore. Antes, defaults sin side-effects. */
|
|
34
37
|
private readonly _synced;
|
|
35
38
|
readonly theme: import("@angular/core").Signal<PreferencesTheme>;
|
|
36
39
|
readonly language: import("@angular/core").Signal<PreferencesLanguage>;
|
|
40
|
+
readonly fontSize: import("@angular/core").Signal<PreferencesFontSize>;
|
|
37
41
|
readonly notificationsMaster: import("@angular/core").Signal<boolean>;
|
|
38
42
|
readonly synced: import("@angular/core").Signal<boolean>;
|
|
39
43
|
private subscription?;
|
|
@@ -48,14 +52,15 @@ export declare class PreferencesService {
|
|
|
48
52
|
* respuesta del backend al terminar.
|
|
49
53
|
*/
|
|
50
54
|
private _updateInFlight;
|
|
51
|
-
constructor(config: ValtechAuthConfig, firestore: FirestoreService, auth: AuthService, http: HttpClient, themeService: ThemeService | null, i18n: I18nService | null);
|
|
55
|
+
constructor(config: ValtechAuthConfig, firestore: FirestoreService, auth: AuthService, http: HttpClient, themeService: ThemeService | null, fontSizeService: FontSizeService | null, i18n: I18nService | null);
|
|
52
56
|
/** Actualiza preferencias via backend. Optimistic UI: aplica local, revierte si falla. */
|
|
53
57
|
update(partial: PreferencesUpdate): Promise<PreferencesUpdateResponse>;
|
|
54
58
|
setTheme(theme: PreferencesTheme): Promise<PreferencesUpdateResponse>;
|
|
55
59
|
setLanguage(language: PreferencesLanguage): Promise<PreferencesUpdateResponse>;
|
|
60
|
+
setFontSize(fontSize: PreferencesFontSize): Promise<PreferencesUpdateResponse>;
|
|
56
61
|
setNotificationsMaster(enabled: boolean): Promise<PreferencesUpdateResponse>;
|
|
57
62
|
private bindToUser;
|
|
58
63
|
private unbind;
|
|
59
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PreferencesService, [null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PreferencesService, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
60
65
|
static ɵprov: i0.ɵɵInjectableDeclaration<PreferencesService>;
|
|
61
66
|
}
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type PreferencesTheme = 'light' | 'dark' | 'auto';
|
|
7
7
|
export type PreferencesLanguage = 'es' | 'en';
|
|
8
|
+
export type PreferencesFontSize = 'small' | 'medium' | 'large';
|
|
8
9
|
/** Forma del doc tal como lo escribe el backend (Admin SDK). */
|
|
9
10
|
export interface PreferencesDocument {
|
|
10
11
|
theme?: PreferencesTheme;
|
|
11
12
|
language?: PreferencesLanguage;
|
|
13
|
+
fontSize?: PreferencesFontSize;
|
|
12
14
|
notifications?: {
|
|
13
15
|
master?: boolean;
|
|
14
16
|
};
|
|
@@ -19,6 +21,7 @@ export interface PreferencesDocument {
|
|
|
19
21
|
export interface PreferencesUpdate {
|
|
20
22
|
theme?: PreferencesTheme;
|
|
21
23
|
language?: PreferencesLanguage;
|
|
24
|
+
fontSize?: PreferencesFontSize;
|
|
22
25
|
notifications?: {
|
|
23
26
|
master?: boolean;
|
|
24
27
|
};
|
|
@@ -28,6 +31,7 @@ export interface PreferencesUpdateResponse {
|
|
|
28
31
|
operationId: string;
|
|
29
32
|
theme: PreferencesTheme | '';
|
|
30
33
|
language: PreferencesLanguage | '';
|
|
34
|
+
fontSize: PreferencesFontSize | '';
|
|
31
35
|
notifications: {
|
|
32
36
|
master?: boolean;
|
|
33
37
|
};
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -296,6 +296,7 @@ export * from './lib/services/local-storage.service';
|
|
|
296
296
|
export * from './lib/services/locale.service';
|
|
297
297
|
export * from './lib/services/navigation';
|
|
298
298
|
export * from './lib/services/theme.service';
|
|
299
|
+
export * from './lib/services/font-size/font-size.service';
|
|
299
300
|
export * from './lib/services/toast.service';
|
|
300
301
|
export * from './lib/services/types';
|
|
301
302
|
export * from './lib/services/errors';
|