valtech-components 2.0.733 → 2.0.735

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.
@@ -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<"light" | "dark" | "medium" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger">;
46
+ propsColor: import("@angular/core").Signal<"medium" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | "light" | "dark">;
47
47
  /**
48
48
  * Computed helper for withMargin prop in template.
49
49
  */
@@ -23,6 +23,12 @@ import * as i0 from "@angular/core";
23
23
  */
24
24
  export declare class UsernameInputComponent implements OnInit, OnDestroy {
25
25
  props: UsernameInputMetadata;
26
+ /**
27
+ * AuthService optional — si está inyectado y `props.checkAvailability` no se provee,
28
+ * el component cae automáticamente a `AuthService.checkHandleAvailability` (backend
29
+ * de Valtech). Consumers que quieran otro endpoint pasan su propio callback.
30
+ */
31
+ private authService;
26
32
  private destroy$;
27
33
  private checkAvailability$;
28
34
  isFocused: import("@angular/core").WritableSignal<boolean>;
@@ -37,6 +43,13 @@ export declare class UsernameInputComponent implements OnInit, OnDestroy {
37
43
  onFocus(): void;
38
44
  onBlur(): void;
39
45
  onInput(event: CustomEvent): void;
46
+ /**
47
+ * Resolve la fn de check de disponibilidad:
48
+ * 1. Si el caller pasa `props.checkAvailability` → usar esa
49
+ * 2. Si AuthService está inyectado → caer a `checkHandleAvailability` (backend Valtech)
50
+ * 3. Sino → undefined (no se muestra status indicator)
51
+ */
52
+ private resolveCheckFn;
40
53
  private setupAvailabilityCheck;
41
54
  private normalizeUsername;
42
55
  private isValidFormat;
@@ -1,5 +1,6 @@
1
1
  import { DoCheck, ElementRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
+ import { UsernameInputMetadata } from '../../molecules/username-input/types';
3
4
  import { ButtonMetadata, FormMetadata, FormSubmit, InputMetadata, InputType } from '../../types';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class FormComponent implements OnInit, OnChanges, DoCheck {
@@ -34,6 +35,13 @@ export declare class FormComponent implements OnInit, OnChanges, DoCheck {
34
35
  submitHandler(token?: string): Promise<void>;
35
36
  getControl(field: string): FormControl;
36
37
  getFieldProp(field: InputMetadata): InputMetadata;
38
+ /**
39
+ * Adapter — convierte un `InputMetadata` (con type=HANDLE) a `UsernameInputMetadata`.
40
+ * El check de disponibilidad se resuelve dentro del component (AuthService inyectado);
41
+ * el caller puede sobrescribirlo pasando `field.errors` o un `UsernameInputMetadata`
42
+ * custom usando type=TEXT si necesita otra fuente de truth.
43
+ */
44
+ getUsernameProp(field: InputMetadata): UsernameInputMetadata;
37
45
  get isAtEndOfForm(): boolean;
38
46
  get Form(): FormGroup;
39
47
  get FormState(): {
@@ -61,7 +61,8 @@ export declare enum InputType {
61
61
  RANGE = 19,
62
62
  PHONE = 20,
63
63
  CURRENCY = 21,
64
- CHECKBOX_RADIO = 22
64
+ CHECKBOX_RADIO = 22,
65
+ HANDLE = 23
65
66
  }
66
67
  /**
67
68
  * Option for select, radio, etc. inputs.
@@ -336,6 +336,8 @@ export declare class AuthService implements OnDestroy {
336
336
  */
337
337
  checkHandleAvailability(handle: string): Observable<CheckHandleResponse>;
338
338
  private get baseUrl();
339
+ /** Base for /v2/users endpoints (separate from /v2/auth). */
340
+ private get usersBaseUrl();
339
341
  private handleSuccessfulAuth;
340
342
  private clearState;
341
343
  private startRefreshTimer;
@@ -34,12 +34,26 @@ export declare class LegalLinkService {
34
34
  get openInNewTab(): boolean;
35
35
  /**
36
36
  * Returns the URL to use for a given internal path. Absolute URLs pass through.
37
+ *
38
+ * When `locale` is provided AND the resolved URL would be cross-origin, appends
39
+ * `?lang={locale}` so the main site can render the legal doc in the user's
40
+ * active language (instead of its default). Locale is omitted for same-origin
41
+ * resolves since the main site reads locale from its own `LocaleService`.
42
+ *
37
43
  * @example
38
- * resolve('/legal/terms') // main site: '/legal/terms'
39
- * // satellite: 'https://myvaltech.com/legal/terms'
44
+ * resolve('/legal/terms')
45
+ * // main site: '/legal/terms'
46
+ * // satellite: 'https://myvaltech.com/legal/terms'
47
+ *
48
+ * resolve('/legal/terms', { locale: 'pt' })
49
+ * // main site: '/legal/terms' (locale stays implicit)
50
+ * // satellite: 'https://myvaltech.com/legal/terms?lang=pt'
51
+ *
40
52
  * resolve('https://x.com/y') // unchanged
41
53
  */
42
- resolve(path: string): string;
54
+ resolve(path: string, options?: {
55
+ locale?: string;
56
+ }): string;
43
57
  /** `true` if the path would be resolved to a cross-origin URL. */
44
58
  isExternal(path: string): boolean;
45
59
  static ɵfac: i0.ɵɵFactoryDeclaration<LegalLinkService, never>;
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "2.0.733";
5
+ export declare const VERSION = "2.0.735";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.733",
3
+ "version": "2.0.735",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"