valtech-components 2.0.292 → 2.0.293

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 (65) hide show
  1. package/esm2022/lib/components/atoms/avatar/avatar.component.mjs +3 -3
  2. package/esm2022/lib/components/atoms/box/box.component.mjs +3 -3
  3. package/esm2022/lib/components/atoms/button/button.component.mjs +45 -12
  4. package/esm2022/lib/components/atoms/display/display.component.mjs +47 -11
  5. package/esm2022/lib/components/atoms/display/types.mjs +1 -1
  6. package/esm2022/lib/components/atoms/divider/divider.component.mjs +3 -3
  7. package/esm2022/lib/components/atoms/href/href.component.mjs +3 -3
  8. package/esm2022/lib/components/atoms/icon/icon.component.mjs +3 -3
  9. package/esm2022/lib/components/atoms/image/image.component.mjs +3 -3
  10. package/esm2022/lib/components/atoms/progress-bar/progress-bar.component.mjs +3 -3
  11. package/esm2022/lib/components/atoms/text/text.component.mjs +3 -3
  12. package/esm2022/lib/components/atoms/title/title.component.mjs +77 -23
  13. package/esm2022/lib/components/atoms/title/types.mjs +30 -2
  14. package/esm2022/lib/components/molecules/alert-box/alert-box.component.mjs +57 -10
  15. package/esm2022/lib/components/molecules/alert-box/types.mjs +1 -1
  16. package/esm2022/lib/components/molecules/button-group/button-group.component.mjs +3 -3
  17. package/esm2022/lib/components/molecules/card/card.component.mjs +3 -3
  18. package/esm2022/lib/components/molecules/content-loader/content-loader.component.mjs +3 -3
  19. package/esm2022/lib/components/molecules/date-input/date-input.component.mjs +3 -3
  20. package/esm2022/lib/components/molecules/file-input/file-input.component.mjs +3 -3
  21. package/esm2022/lib/components/molecules/hint/hint.component.mjs +3 -3
  22. package/esm2022/lib/components/molecules/layered-card/layered-card.component.mjs +3 -3
  23. package/esm2022/lib/components/molecules/link/link.component.mjs +3 -3
  24. package/esm2022/lib/components/molecules/links-cake/links-cake.component.mjs +3 -3
  25. package/esm2022/lib/components/molecules/notes-box/notes-box.component.mjs +3 -3
  26. package/esm2022/lib/components/molecules/password-input/password-input.component.mjs +3 -3
  27. package/esm2022/lib/components/molecules/pin-input/pin-input.component.mjs +3 -3
  28. package/esm2022/lib/components/molecules/progress-status/progress-status.component.mjs +3 -3
  29. package/esm2022/lib/components/molecules/prompter/prompter.component.mjs +3 -3
  30. package/esm2022/lib/components/molecules/searchbar/searchbar.component.mjs +3 -3
  31. package/esm2022/lib/components/molecules/text-input/text-input.component.mjs +3 -3
  32. package/esm2022/lib/components/molecules/title-block/title-block.component.mjs +3 -3
  33. package/esm2022/lib/components/organisms/banner/banner.component.mjs +3 -3
  34. package/esm2022/lib/components/organisms/form/form.component.mjs +3 -3
  35. package/esm2022/lib/components/organisms/header/header.component.mjs +3 -3
  36. package/esm2022/lib/components/organisms/item-list/item-list.component.mjs +3 -3
  37. package/esm2022/lib/components/organisms/item-list/types.mjs +1 -1
  38. package/esm2022/lib/components/organisms/no-content/no-content.component.mjs +3 -3
  39. package/esm2022/lib/components/organisms/toolbar/toolbar.component.mjs +3 -3
  40. package/esm2022/lib/components/organisms/wizard/wizard.component.mjs +3 -3
  41. package/esm2022/lib/components/templates/layout/layout.component.mjs +2 -2
  42. package/esm2022/lib/components/types.mjs +1 -1
  43. package/esm2022/lib/examples/display-demo.component.mjs +518 -0
  44. package/esm2022/lib/examples/display-simple-example.component.mjs +202 -0
  45. package/esm2022/lib/services/lang-provider/content.mjs +2 -1
  46. package/esm2022/lib/shared/utils/reactive-content.mjs +117 -0
  47. package/esm2022/public-api.mjs +4 -1
  48. package/fesm2022/valtech-components.mjs +2718 -1702
  49. package/fesm2022/valtech-components.mjs.map +1 -1
  50. package/lib/components/atoms/button/button.component.d.ts +10 -3
  51. package/lib/components/atoms/display/display.component.d.ts +12 -4
  52. package/lib/components/atoms/display/types.d.ts +13 -3
  53. package/lib/components/atoms/title/title.component.d.ts +6 -1
  54. package/lib/components/atoms/title/types.d.ts +29 -3
  55. package/lib/components/molecules/alert-box/alert-box.component.d.ts +17 -9
  56. package/lib/components/molecules/alert-box/types.d.ts +29 -0
  57. package/lib/components/organisms/item-list/types.d.ts +54 -9
  58. package/lib/components/types.d.ts +12 -3
  59. package/lib/examples/display-demo.component.d.ts +59 -0
  60. package/lib/examples/display-simple-example.component.d.ts +23 -0
  61. package/lib/shared/utils/reactive-content.d.ts +109 -0
  62. package/package.json +4 -2
  63. package/public-api.d.ts +3 -0
  64. package/src/lib/components/styles/overrides.scss +583 -0
  65. package/src/lib/components/styles/variables.scss +7 -3
@@ -1,25 +1,32 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { ContentService } from '../../../services/content.service';
2
4
  import { DownloadService } from '../../../services/download.service';
3
5
  import { IconService } from '../../../services/icons.service';
4
6
  import { NavigationService } from '../../../services/navigation.service';
5
7
  import { ButtonMetadata } from '../../types';
6
8
  import * as i0 from "@angular/core";
7
- export declare class ButtonComponent {
9
+ export declare class ButtonComponent implements OnInit, OnDestroy {
8
10
  private download;
9
11
  private navigation;
12
+ private contentService;
10
13
  states: {
11
14
  ENABLED: "ENABLED";
12
15
  DISABLED: "DISABLED";
13
16
  WORKING: "WORKING";
14
17
  ERROR: "ERROR";
15
18
  };
19
+ displayText$: Observable<string>;
20
+ private subscriptions;
16
21
  props: ButtonMetadata;
17
22
  /**
18
23
  * Event emitted when the button is clicked.
19
24
  */
20
25
  onClick: EventEmitter<string>;
21
- constructor(download: DownloadService, icon: IconService, navigation: NavigationService);
26
+ constructor(download: DownloadService, icon: IconService, navigation: NavigationService, contentService: ContentService);
22
27
  ngOnInit(): void;
28
+ ngOnDestroy(): void;
29
+ private initializeDisplayText;
23
30
  clickHandler(): void;
24
31
  static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
25
32
  static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "val-button", never, { "props": { "alias": "props"; "required": false; }; }, { "onClick": "onClick"; }, never, never, true, never>;
@@ -1,17 +1,25 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { ContentService } from '../../../services/content.service';
2
4
  import { DisplayMetadata } from './types';
3
5
  import * as i0 from "@angular/core";
4
- export declare class DisplayComponent implements OnInit {
6
+ export declare class DisplayComponent implements OnInit, OnDestroy {
7
+ private contentService;
8
+ displayContent$: Observable<string>;
9
+ private subscriptions;
5
10
  /**
6
11
  * Display configuration object.
7
12
  * @type {DisplayMetadata}
8
- * @property content - The text to display.
13
+ * @property content - Static text to display (takes precedence over contentConfig).
14
+ * @property contentConfig - Reactive content configuration.
9
15
  * @property color - The text color (Ionic color string).
10
16
  * @property size - The text size ('small' | 'medium' | 'large' | 'xlarge').
11
17
  */
12
18
  props: DisplayMetadata;
13
- constructor();
19
+ constructor(contentService: ContentService);
14
20
  ngOnInit(): void;
21
+ ngOnDestroy(): void;
22
+ private initializeDisplayContent;
15
23
  static ɵfac: i0.ɵɵFactoryDeclaration<DisplayComponent, never>;
16
24
  static ɵcmp: i0.ɵɵComponentDeclaration<DisplayComponent, "val-display", never, { "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
17
25
  }
@@ -1,13 +1,23 @@
1
1
  import { Color } from '@ionic/core';
2
2
  /**
3
- * Props for val-display component.
3
+ * Props for val-display component with reactive content support.
4
+ * Supports both static and reactive content patterns.
4
5
  *
5
6
  * @property size - The text size ('small' | 'medium' | 'large' | 'xlarge').
6
7
  * @property color - The text color (Ionic color string).
7
- * @property content - The text to display.
8
+ * @property content - Static content text (takes precedence over contentConfig).
9
+ * @property contentConfig - Reactive content configuration.
8
10
  */
9
11
  export interface DisplayMetadata {
10
12
  size: 'small' | 'medium' | 'large' | 'xlarge';
11
13
  color: Color;
12
- content: string;
14
+ /** Static content (takes precedence over contentConfig) */
15
+ content?: string;
16
+ /** Reactive content configuration */
17
+ contentConfig?: {
18
+ className?: string;
19
+ key: string;
20
+ fallback?: string;
21
+ interpolation?: Record<string, any>;
22
+ };
13
23
  }
@@ -1,17 +1,22 @@
1
1
  import { OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
2
3
  import { TitleMetadata } from './types';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class TitleComponent implements OnInit {
5
6
  /**
6
7
  * Title configuration object.
7
8
  * @type {TitleMetadata}
8
- * @property content - The title text to display.
9
+ * @property content - Static title text (takes precedence over reactive content).
10
+ * @property contentConfig - Reactive content configuration.
9
11
  * @property color - The title color (Ionic color string).
10
12
  * @property size - The title size ('small' | 'medium' | 'large' | 'xlarge').
11
13
  * @property bold - Whether the title is bold.
12
14
  * @property thin - Whether the title is thin (optional).
13
15
  */
14
16
  props: TitleMetadata;
17
+ private contentService;
18
+ private contentHelper;
19
+ displayContent$: Observable<string>;
15
20
  constructor();
16
21
  ngOnInit(): void;
17
22
  static ɵfac: i0.ɵɵFactoryDeclaration<TitleComponent, never>;
@@ -1,17 +1,43 @@
1
1
  import { Color } from '@ionic/core';
2
+ import { ReactiveTextMetadata } from '../../../shared/utils/reactive-content';
2
3
  /**
3
4
  * Props for val-title component.
5
+ * Supports both static content and reactive content from the language service.
4
6
  *
5
- * @property content - The title text to display.
7
+ * @property content - Static title text to display (takes precedence over reactive content).
8
+ * @property contentConfig - Reactive content configuration (used when content is not provided).
6
9
  * @property color - The title color (Ionic color string).
7
10
  * @property size - The title size ('small' | 'medium' | 'large' | 'xlarge').
8
11
  * @property bold - Whether the title is bold.
9
12
  * @property thin - Whether the title is thin (optional).
10
13
  */
11
- export interface TitleMetadata {
14
+ export interface TitleMetadata extends ReactiveTextMetadata {
12
15
  size: 'small' | 'medium' | 'large' | 'xlarge';
13
16
  color: Color;
14
- content: string;
15
17
  bold: boolean;
16
18
  thin?: boolean;
17
19
  }
20
+ /**
21
+ * Factory function to create title props with reactive content support.
22
+ *
23
+ * @param styleConfig - Title styling configuration
24
+ * @param contentConfig - Content configuration (static or reactive)
25
+ * @returns Complete TitleMetadata object
26
+ *
27
+ * @example Static content:
28
+ * ```typescript
29
+ * const props = createTitleProps(
30
+ * { size: 'large', color: 'primary', bold: true },
31
+ * { content: 'Static Title' }
32
+ * );
33
+ * ```
34
+ *
35
+ * @example Reactive content:
36
+ * ```typescript
37
+ * const props = createTitleProps(
38
+ * { size: 'large', color: 'primary', bold: true },
39
+ * { contentConfig: { key: 'pageTitle', fallback: 'Default Title' } }
40
+ * );
41
+ * ```
42
+ */
43
+ export declare function createTitleProps(styleConfig: Pick<TitleMetadata, 'size' | 'color' | 'bold' | 'thin'>, contentConfig: Pick<TitleMetadata, 'content' | 'contentConfig'>): TitleMetadata;
@@ -1,17 +1,25 @@
1
- import { OnInit } from '@angular/core';
2
- import { AlertBoxMetadata } from './types';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { ContentService } from '../../../services/content.service';
3
+ import { AlertBoxMetadata, ReactiveAlertBoxMetadata } from './types';
3
4
  import * as i0 from "@angular/core";
4
- export declare class AlertBoxComponent implements OnInit {
5
+ export declare class AlertBoxComponent implements OnInit, OnDestroy {
6
+ private contentService;
7
+ private subscriptions;
5
8
  /**
6
9
  * Alert box configuration object.
7
- * @type {AlertBoxMetadata}
8
- * @property box - Box configuration (see BoxMetadata).
9
- * @property icon - Icon configuration (see IconMetadata).
10
- * @property text - Text configuration (see TextMetadata).
10
+ * Supports both legacy AlertBoxMetadata and ReactiveAlertBoxMetadata patterns.
11
11
  */
12
- props: AlertBoxMetadata;
13
- constructor();
12
+ props: AlertBoxMetadata | ReactiveAlertBoxMetadata;
13
+ /** Computed text properties for reactive pattern */
14
+ computedTextProps: any;
15
+ /** Whether this is using the legacy props pattern */
16
+ get isLegacyProps(): boolean;
17
+ /** Get text props for legacy pattern */
18
+ getLegacyTextProps(): any;
19
+ constructor(contentService: ContentService);
14
20
  ngOnInit(): void;
21
+ ngOnDestroy(): void;
22
+ private initializeReactiveTextProps;
15
23
  static ɵfac: i0.ɵɵFactoryDeclaration<AlertBoxComponent, never>;
16
24
  static ɵcmp: i0.ɵɵComponentDeclaration<AlertBoxComponent, "val-alert-box", never, { "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
17
25
  }
@@ -1,8 +1,37 @@
1
1
  import { BoxMetadata } from '../../atoms/box/types';
2
2
  import { IconMetadata } from '../../atoms/icon/types';
3
3
  import { TextMetadata } from '../../atoms/text/types';
4
+ /**
5
+ * Alert box component metadata with support for reactive content.
6
+ * Provides both static and reactive content options for the text element.
7
+ */
4
8
  export interface AlertBoxMetadata {
5
9
  box: BoxMetadata;
6
10
  icon: IconMetadata;
7
11
  text: TextMetadata;
8
12
  }
13
+ /**
14
+ * Enhanced alert box metadata with simplified reactive content support.
15
+ * Alternative to the standard AlertBoxMetadata for common use cases.
16
+ */
17
+ export interface ReactiveAlertBoxMetadata {
18
+ /** Box styling configuration */
19
+ box: BoxMetadata;
20
+ /** Icon configuration */
21
+ icon: IconMetadata;
22
+ /** Static text (takes precedence over textConfig) */
23
+ text?: string;
24
+ /** Reactive content configuration for alert text */
25
+ textConfig?: {
26
+ className?: string;
27
+ key: string;
28
+ fallback?: string;
29
+ interpolation?: Record<string, any>;
30
+ };
31
+ /** Text styling options */
32
+ textStyle?: {
33
+ size?: 'small' | 'medium' | 'large' | 'xlarge';
34
+ color?: string;
35
+ bold?: boolean;
36
+ };
37
+ }
@@ -6,27 +6,40 @@ import { Color } from '@ionic/core';
6
6
  import { ComponentState } from '../../types';
7
7
  /**
8
8
  * Representa una acción disponible en un elemento de la lista.
9
+ * Ahora soporta contenido reactivo para la descripción.
9
10
  * @property token Identificador único de la acción.
10
11
  * @property icon (opcional) Icono a mostrar.
11
- * @property description Descripción de la acción.
12
+ * @property description (opcional) Descripción estática de la acción.
13
+ * @property descriptionConfig (opcional) Configuración de contenido reactivo para la descripción.
12
14
  * @property state Estado de la acción (habilitado, deshabilitado, trabajando, etc).
13
15
  */
14
16
  export type ItemAction = {
15
17
  token: string;
16
18
  icon?: string;
17
- description: string;
19
+ description?: string;
20
+ descriptionConfig?: {
21
+ className?: string;
22
+ key: string;
23
+ fallback?: string;
24
+ interpolation?: Record<string, any>;
25
+ };
18
26
  state: ComponentState;
19
27
  };
20
28
  /**
21
29
  * Metadatos de un elemento individual de la lista.
30
+ * Ahora soporta contenido reactivo para todos los campos de texto.
22
31
  * @property token (opcional) Identificador único del elemento.
23
32
  * @property mode Modo de visualización ('justext', 'subtitule', 'avatar', 'icon', 'route', 'actionable').
24
- * @property text Texto principal del elemento.
33
+ * @property text (opcional) Texto estático principal del elemento.
34
+ * @property textConfig (opcional) Configuración de contenido reactivo para el texto principal.
25
35
  * @property image (opcional) Imagen para modo avatar.
26
36
  * @property icon (opcional) Icono para modo icon.
27
- * @property comments (opcional) Comentarios o notas.
28
- * @property subtitle (opcional) Subtítulo.
29
- * @property endNote (opcional) Nota al final del elemento.
37
+ * @property comments (opcional) Comentarios estáticos.
38
+ * @property commentsConfig (opcional) Configuración de contenido reactivo para comentarios.
39
+ * @property subtitle (opcional) Subtítulo estático.
40
+ * @property subtitleConfig (opcional) Configuración de contenido reactivo para subtítulo.
41
+ * @property endNote (opcional) Nota estática al final del elemento.
42
+ * @property endNoteConfig (opcional) Configuración de contenido reactivo para la nota final.
30
43
  * @property actions (opcional) Acciones disponibles para el elemento.
31
44
  * @property color (opcional) Color personalizado.
32
45
  * @property lines (opcional) Tipo de líneas ('full', 'inset', 'none').
@@ -43,12 +56,36 @@ export type ItemAction = {
43
56
  export interface ItemMetadata {
44
57
  token?: string;
45
58
  mode: 'justext' | 'subtitule' | 'avatar' | 'icon' | 'route' | 'actionable';
46
- text: string;
59
+ text?: string;
60
+ textConfig?: {
61
+ className?: string;
62
+ key: string;
63
+ fallback?: string;
64
+ interpolation?: Record<string, any>;
65
+ };
47
66
  image?: string;
48
67
  icon?: string;
49
68
  comments?: string;
69
+ commentsConfig?: {
70
+ className?: string;
71
+ key: string;
72
+ fallback?: string;
73
+ interpolation?: Record<string, any>;
74
+ };
50
75
  subtitle?: string;
76
+ subtitleConfig?: {
77
+ className?: string;
78
+ key: string;
79
+ fallback?: string;
80
+ interpolation?: Record<string, any>;
81
+ };
51
82
  endNote?: string;
83
+ endNoteConfig?: {
84
+ className?: string;
85
+ key: string;
86
+ fallback?: string;
87
+ interpolation?: Record<string, any>;
88
+ };
52
89
  actions?: ItemAction[];
53
90
  color?: string;
54
91
  lines?: 'full' | 'inset' | 'none';
@@ -64,11 +101,13 @@ export interface ItemMetadata {
64
101
  }
65
102
  /**
66
103
  * Metadatos de la lista de elementos.
104
+ * Ahora soporta contenido reactivo para el título.
67
105
  * @property color Color principal de la lista.
68
106
  * @property bordered Si la lista tiene borde.
69
107
  * @property rounded Si la lista tiene bordes redondeados.
70
108
  * @property shadowed Si la lista tiene sombra.
71
- * @property title Título de la lista.
109
+ * @property title (opcional) Título estático de la lista.
110
+ * @property titleConfig (opcional) Configuración de contenido reactivo para el título.
72
111
  * @property items Elementos a mostrar en la lista.
73
112
  */
74
113
  export interface ListMetadata {
@@ -76,6 +115,12 @@ export interface ListMetadata {
76
115
  bordered: boolean;
77
116
  rounded: boolean;
78
117
  shadowed: boolean;
79
- title: string;
118
+ title?: string;
119
+ titleConfig?: {
120
+ className?: string;
121
+ key: string;
122
+ fallback?: string;
123
+ interpolation?: Record<string, any>;
124
+ };
80
125
  items: ItemMetadata[];
81
126
  }
@@ -177,8 +177,10 @@ export interface IconMetada {
177
177
  }
178
178
  /**
179
179
  * Button configuration object.
180
+ * Supports both static and reactive content.
180
181
  * @type {ButtonMetadata}
181
- * @property text - The button label.
182
+ * @property text - Static button label (takes precedence over textConfig).
183
+ * @property textConfig - Reactive content configuration for button text.
182
184
  * @property color - The button color (Ionic color string).
183
185
  * @property icon - Icon to display (optional).
184
186
  * @property state - Button state (enabled, disabled, working, etc.).
@@ -201,8 +203,15 @@ export interface ButtonMetadata {
201
203
  color: Color;
202
204
  /** Button state */
203
205
  state: ComponentState;
204
- /** Display text */
205
- text: string;
206
+ /** Static display text (takes precedence over textConfig) */
207
+ text?: string;
208
+ /** Reactive content configuration for button text */
209
+ textConfig?: {
210
+ className?: string;
211
+ key: string;
212
+ fallback?: string;
213
+ interpolation?: Record<string, any>;
214
+ };
206
215
  /** Associated icon */
207
216
  icon?: IconMetada;
208
217
  /** Button shape */
@@ -0,0 +1,59 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { DisplayMetadata } from '../components/atoms/display/types';
4
+ import { ContentService } from '../services/content.service';
5
+ import { LangService } from '../services/lang-provider/lang-provider.service';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Componente de demostración para val-display con contenido reactivo.
9
+ * Muestra diferentes patrones de uso y casos de ejemplo.
10
+ */
11
+ export declare class DisplayDemoComponent implements OnInit {
12
+ private contentService;
13
+ private langService;
14
+ demoTitle$: Observable<string>;
15
+ languageLabel$: Observable<string>;
16
+ staticSectionTitle$: Observable<string>;
17
+ reactiveSectionTitle$: Observable<string>;
18
+ mixedSectionTitle$: Observable<string>;
19
+ dynamicSectionTitle$: Observable<string>;
20
+ analysisTitle$: Observable<string>;
21
+ reactiveContentTitle$: Observable<string>;
22
+ interpolationTitle$: Observable<string>;
23
+ fallbackTitle$: Observable<string>;
24
+ mixedContentTitle$: Observable<string>;
25
+ dynamicContentTitle$: Observable<string>;
26
+ updateButtonText$: Observable<string>;
27
+ currentLangLabel$: Observable<string>;
28
+ availableLangsLabel$: Observable<string>;
29
+ currentLanguage$: Observable<string>;
30
+ availableLanguages$: Observable<string[]>;
31
+ private counter;
32
+ smallStaticDisplay: DisplayMetadata;
33
+ mediumStaticDisplay: DisplayMetadata;
34
+ largeStaticDisplay: DisplayMetadata;
35
+ xlargeStaticDisplay: DisplayMetadata;
36
+ primaryDisplay: DisplayMetadata;
37
+ secondaryDisplay: DisplayMetadata;
38
+ successDisplay: DisplayMetadata;
39
+ warningDisplay: DisplayMetadata;
40
+ dangerDisplay: DisplayMetadata;
41
+ welcomeDisplay: DisplayMetadata;
42
+ descriptionDisplay: DisplayMetadata;
43
+ statusDisplay: DisplayMetadata;
44
+ userWelcomeDisplay: DisplayMetadata;
45
+ counterDisplay: DisplayMetadata;
46
+ missingKeyDisplay: DisplayMetadata;
47
+ noFallbackDisplay: DisplayMetadata;
48
+ staticMixedDisplay: DisplayMetadata;
49
+ reactiveMixedDisplay: DisplayMetadata;
50
+ dynamicCounterDisplay: DisplayMetadata;
51
+ constructor(contentService: ContentService, langService: LangService);
52
+ ngOnInit(): void;
53
+ private initializeContent;
54
+ private initializeLanguageState;
55
+ changeLanguage(language: string): void;
56
+ updateCounter(): void;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<DisplayDemoComponent, never>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<DisplayDemoComponent, "val-display-demo", never, {}, {}, never, never, true, never>;
59
+ }
@@ -0,0 +1,23 @@
1
+ import { DisplayMetadata } from '../components/atoms/display/types';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Ejemplo rápido de uso del componente val-display con contenido reactivo
5
+ */
6
+ export declare class DisplayExampleComponent {
7
+ staticTitle: DisplayMetadata;
8
+ staticSubtitle: DisplayMetadata;
9
+ reactiveWelcome: DisplayMetadata;
10
+ reactiveDescription: DisplayMetadata;
11
+ userGreeting: DisplayMetadata;
12
+ statusMessage: DisplayMetadata;
13
+ smallText: DisplayMetadata;
14
+ mediumText: DisplayMetadata;
15
+ largeText: DisplayMetadata;
16
+ xlargeText: DisplayMetadata;
17
+ primaryText: DisplayMetadata;
18
+ successText: DisplayMetadata;
19
+ warningText: DisplayMetadata;
20
+ dangerText: DisplayMetadata;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<DisplayExampleComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<DisplayExampleComponent, "app-display-example", never, {}, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Enhanced content utilities for multi-language component support.
3
+ * Extends the base content utilities to provide specialized helpers for different component patterns.
4
+ */
5
+ import { Observable } from 'rxjs';
6
+ import { ContentService } from '../../services/content.service';
7
+ /**
8
+ * Base configuration for reactive content.
9
+ */
10
+ export interface ReactiveContentConfig {
11
+ /** Content class name - defaults to '_global' if not provided */
12
+ className?: string;
13
+ /** Content key */
14
+ key: string;
15
+ /** Fallback text if content is not found */
16
+ fallback?: string;
17
+ /** Interpolation data for parameterized content */
18
+ interpolation?: Record<string, any>;
19
+ }
20
+ /**
21
+ * Configuration for components that support both static and reactive content.
22
+ */
23
+ export interface HybridContentConfig {
24
+ /** Static content - takes precedence over reactive content */
25
+ content?: string;
26
+ /** Reactive content configuration */
27
+ contentConfig?: ReactiveContentConfig;
28
+ }
29
+ /**
30
+ * Configuration for components with multiple text properties.
31
+ */
32
+ export interface MultiTextConfig {
33
+ /** Map of property names to their content configurations */
34
+ textConfigs: Record<string, ReactiveContentConfig>;
35
+ }
36
+ /**
37
+ * Enhanced metadata for components that support reactive content.
38
+ */
39
+ export interface ReactiveTextMetadata extends HybridContentConfig {
40
+ size?: 'small' | 'medium' | 'large' | 'xlarge';
41
+ color?: string;
42
+ bold?: boolean;
43
+ processLinks?: boolean;
44
+ linkConfig?: any;
45
+ }
46
+ /**
47
+ * Helper class for managing reactive content in components.
48
+ */
49
+ export declare class ComponentContentHelper {
50
+ private contentService;
51
+ private defaultClassName?;
52
+ constructor(contentService: ContentService, defaultClassName?: string);
53
+ /**
54
+ * Resolves content based on hybrid configuration (static vs reactive).
55
+ */
56
+ resolveContent(config: HybridContentConfig): Observable<string> | string;
57
+ /**
58
+ * Resolves multiple text properties for components with multiple text fields.
59
+ */
60
+ resolveMultipleTexts(config: MultiTextConfig): Record<string, Observable<string>>;
61
+ /**
62
+ * Creates a reactive content configuration for array items.
63
+ * Useful for list components where items might have translatable text.
64
+ */
65
+ createArrayItemConfig(baseKey: string, index: number, fallback?: string): ReactiveContentConfig;
66
+ /**
67
+ * Helper for button/action text that commonly needs translation.
68
+ */
69
+ createActionConfig(actionKey: 'ok' | 'cancel' | 'save' | 'delete' | 'edit' | 'close' | 'back' | 'next' | 'previous' | 'finish' | 'continue' | 'add' | 'remove' | 'search' | 'filter' | 'sort' | 'refresh', fallback?: string): ReactiveContentConfig;
70
+ }
71
+ /**
72
+ * Factory function to create content helpers for components.
73
+ */
74
+ export declare function createComponentContentHelper(contentService: ContentService, componentClassName?: string): ComponentContentHelper;
75
+ /**
76
+ * Utility function to determine if content should be reactive.
77
+ */
78
+ export declare function shouldUseReactiveContent(config: HybridContentConfig): boolean;
79
+ /**
80
+ * Enhanced props factory for components that support reactive content.
81
+ */
82
+ export declare function createReactiveProps<T extends Record<string, any>>(contentHelper: ComponentContentHelper, staticProps: Omit<T, keyof HybridContentConfig>, contentConfig: HybridContentConfig): T;
83
+ /**
84
+ * Configuration for list components that mix static and dynamic content.
85
+ */
86
+ export interface ListComponentConfig<T> {
87
+ /** Static items that don't need translation */
88
+ staticItems?: T[];
89
+ /** Reactive items configuration */
90
+ reactiveItems?: {
91
+ /** Base key for the items (e.g., 'navigationLinks') */
92
+ baseKey: string;
93
+ /** Number of items expected */
94
+ count: number;
95
+ /** Template for creating individual items */
96
+ itemTemplate: (contentHelper: ComponentContentHelper, index: number) => T;
97
+ };
98
+ }
99
+ /**
100
+ * Helper for list components that need to mix static and reactive content.
101
+ */
102
+ export declare class ListContentHelper<T> {
103
+ private contentHelper;
104
+ constructor(contentHelper: ComponentContentHelper);
105
+ /**
106
+ * Resolves a list configuration into final items.
107
+ */
108
+ resolveListItems(config: ListComponentConfig<T>): T[];
109
+ }
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.292",
3
+ "version": "2.0.293",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.0.0",
6
6
  "@angular/core": "^18.0.0",
7
7
  "@ionic/angular": "^8.0.0",
8
8
  "ionicons": "^7.2.1",
9
- "rxjs": "~7.8.0"
9
+ "rxjs": "~7.8.0",
10
+ "prismjs": "^1.30.0",
11
+ "swiper": "^11.2.8"
10
12
  },
11
13
  "dependencies": {
12
14
  "@capacitor/browser": "^6.0.3",
package/public-api.d.ts CHANGED
@@ -81,6 +81,8 @@ export * from './lib/components/templates/simple/simple.component';
81
81
  export * from './lib/components/templates/simple/types';
82
82
  export * from './lib/examples/comprehensive-link-test.component';
83
83
  export * from './lib/examples/custom-content-demo.component';
84
+ export * from './lib/examples/display-demo.component';
85
+ export * from './lib/examples/display-simple-example.component';
84
86
  export * from './lib/examples/link-processing-example.component';
85
87
  export * from './lib/examples/multi-language-demo.component';
86
88
  export * from './lib/services/content.service';
@@ -101,5 +103,6 @@ export * from './lib/shared/pipes/process-links.pipe';
101
103
  export * from './lib/shared/utils/content';
102
104
  export * from './lib/shared/utils/dom';
103
105
  export * from './lib/shared/utils/form-defaults';
106
+ export * from './lib/shared/utils/reactive-content';
104
107
  export * from './lib/shared/utils/styles';
105
108
  export * from './lib/shared/utils/text';