valtech-components 2.0.291 → 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 (73) 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/custom-content-demo.component.mjs +3 -3
  44. package/esm2022/lib/examples/display-demo.component.mjs +518 -0
  45. package/esm2022/lib/examples/display-simple-example.component.mjs +202 -0
  46. package/esm2022/lib/examples/multi-language-demo.component.mjs +304 -0
  47. package/esm2022/lib/services/lang-provider/content.mjs +34 -2
  48. package/esm2022/lib/services/lang-provider/lang-provider.service.mjs +199 -13
  49. package/esm2022/lib/services/lang-provider/types.mjs +15 -6
  50. package/esm2022/lib/shared/utils/reactive-content.mjs +117 -0
  51. package/esm2022/public-api.mjs +5 -1
  52. package/fesm2022/valtech-components.mjs +3895 -2358
  53. package/fesm2022/valtech-components.mjs.map +1 -1
  54. package/lib/components/atoms/button/button.component.d.ts +10 -3
  55. package/lib/components/atoms/display/display.component.d.ts +12 -4
  56. package/lib/components/atoms/display/types.d.ts +13 -3
  57. package/lib/components/atoms/title/title.component.d.ts +6 -1
  58. package/lib/components/atoms/title/types.d.ts +29 -3
  59. package/lib/components/molecules/alert-box/alert-box.component.d.ts +17 -9
  60. package/lib/components/molecules/alert-box/types.d.ts +29 -0
  61. package/lib/components/organisms/item-list/types.d.ts +54 -9
  62. package/lib/components/types.d.ts +12 -3
  63. package/lib/examples/display-demo.component.d.ts +59 -0
  64. package/lib/examples/display-simple-example.component.d.ts +23 -0
  65. package/lib/examples/multi-language-demo.component.d.ts +34 -0
  66. package/lib/services/lang-provider/content.d.ts +4 -1
  67. package/lib/services/lang-provider/lang-provider.service.d.ts +64 -2
  68. package/lib/services/lang-provider/types.d.ts +19 -4
  69. package/lib/shared/utils/reactive-content.d.ts +109 -0
  70. package/package.json +4 -2
  71. package/public-api.d.ts +4 -0
  72. package/src/lib/components/styles/overrides.scss +583 -0
  73. package/src/lib/components/styles/variables.scss +7 -3
@@ -9,7 +9,22 @@ export declare class TextContent {
9
9
  constructor(text: LanguagesContent);
10
10
  get Content(): LanguagesContent;
11
11
  }
12
- export declare enum LangOption {
13
- ES = "es",
14
- EN = "en"
15
- }
12
+ /**
13
+ * Language code type - supports any valid language code string.
14
+ * Common examples: 'es', 'en', 'fr', 'de', 'pt', 'it', 'zh', 'ja', etc.
15
+ */
16
+ export type LangOption = string;
17
+ /**
18
+ * Common language constants for convenience.
19
+ * Users can still use any language code string directly.
20
+ */
21
+ export declare const LANGUAGES: {
22
+ readonly ES: "es";
23
+ readonly EN: "en";
24
+ readonly FR: "fr";
25
+ readonly DE: "de";
26
+ readonly PT: "pt";
27
+ readonly IT: "it";
28
+ readonly ZH: "zh";
29
+ readonly JA: "ja";
30
+ };
@@ -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.291",
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,7 +81,10 @@ 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';
87
+ export * from './lib/examples/multi-language-demo.component';
85
88
  export * from './lib/services/content.service';
86
89
  export * from './lib/services/download.service';
87
90
  export * from './lib/services/icons.service';
@@ -100,5 +103,6 @@ export * from './lib/shared/pipes/process-links.pipe';
100
103
  export * from './lib/shared/utils/content';
101
104
  export * from './lib/shared/utils/dom';
102
105
  export * from './lib/shared/utils/form-defaults';
106
+ export * from './lib/shared/utils/reactive-content';
103
107
  export * from './lib/shared/utils/styles';
104
108
  export * from './lib/shared/utils/text';