valtech-components 2.0.292 → 2.0.294

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 (77) 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/language-selector/language-selector.component.mjs +219 -0
  23. package/esm2022/lib/components/molecules/language-selector/types.mjs +2 -0
  24. package/esm2022/lib/components/molecules/layered-card/layered-card.component.mjs +3 -3
  25. package/esm2022/lib/components/molecules/link/link.component.mjs +3 -3
  26. package/esm2022/lib/components/molecules/links-cake/links-cake.component.mjs +3 -3
  27. package/esm2022/lib/components/molecules/notes-box/notes-box.component.mjs +3 -3
  28. package/esm2022/lib/components/molecules/password-input/password-input.component.mjs +3 -3
  29. package/esm2022/lib/components/molecules/pin-input/pin-input.component.mjs +3 -3
  30. package/esm2022/lib/components/molecules/popover-selector/popover-selector.component.mjs +170 -0
  31. package/esm2022/lib/components/molecules/popover-selector/types.mjs +2 -0
  32. package/esm2022/lib/components/molecules/progress-status/progress-status.component.mjs +3 -3
  33. package/esm2022/lib/components/molecules/prompter/prompter.component.mjs +3 -3
  34. package/esm2022/lib/components/molecules/searchbar/searchbar.component.mjs +3 -3
  35. package/esm2022/lib/components/molecules/text-input/text-input.component.mjs +3 -3
  36. package/esm2022/lib/components/molecules/title-block/title-block.component.mjs +3 -3
  37. package/esm2022/lib/components/organisms/banner/banner.component.mjs +3 -3
  38. package/esm2022/lib/components/organisms/form/form.component.mjs +3 -3
  39. package/esm2022/lib/components/organisms/header/header.component.mjs +3 -3
  40. package/esm2022/lib/components/organisms/item-list/item-list.component.mjs +3 -3
  41. package/esm2022/lib/components/organisms/item-list/types.mjs +1 -1
  42. package/esm2022/lib/components/organisms/no-content/no-content.component.mjs +3 -3
  43. package/esm2022/lib/components/organisms/toolbar/toolbar.component.mjs +3 -3
  44. package/esm2022/lib/components/organisms/wizard/wizard.component.mjs +3 -3
  45. package/esm2022/lib/components/templates/layout/layout.component.mjs +2 -2
  46. package/esm2022/lib/components/types.mjs +1 -1
  47. package/esm2022/lib/examples/display-demo.component.mjs +518 -0
  48. package/esm2022/lib/examples/display-simple-example.component.mjs +202 -0
  49. package/esm2022/lib/examples/selector-examples.component.mjs +208 -0
  50. package/esm2022/lib/services/lang-provider/components/display-demo.mjs +86 -0
  51. package/esm2022/lib/services/lang-provider/content.mjs +2 -1
  52. package/esm2022/lib/shared/utils/reactive-content.mjs +117 -0
  53. package/esm2022/public-api.mjs +9 -1
  54. package/fesm2022/valtech-components.mjs +3435 -1844
  55. package/fesm2022/valtech-components.mjs.map +1 -1
  56. package/lib/components/atoms/button/button.component.d.ts +10 -3
  57. package/lib/components/atoms/display/display.component.d.ts +12 -4
  58. package/lib/components/atoms/display/types.d.ts +13 -3
  59. package/lib/components/atoms/title/title.component.d.ts +6 -1
  60. package/lib/components/atoms/title/types.d.ts +29 -3
  61. package/lib/components/molecules/alert-box/alert-box.component.d.ts +17 -9
  62. package/lib/components/molecules/alert-box/types.d.ts +29 -0
  63. package/lib/components/molecules/language-selector/language-selector.component.d.ts +50 -0
  64. package/lib/components/molecules/language-selector/types.d.ts +52 -0
  65. package/lib/components/molecules/popover-selector/popover-selector.component.d.ts +29 -0
  66. package/lib/components/molecules/popover-selector/types.d.ts +69 -0
  67. package/lib/components/organisms/item-list/types.d.ts +54 -9
  68. package/lib/components/types.d.ts +12 -3
  69. package/lib/examples/display-demo.component.d.ts +62 -0
  70. package/lib/examples/display-simple-example.component.d.ts +23 -0
  71. package/lib/examples/selector-examples.component.d.ts +20 -0
  72. package/lib/services/lang-provider/components/display-demo.d.ts +3 -0
  73. package/lib/shared/utils/reactive-content.d.ts +109 -0
  74. package/package.json +4 -2
  75. package/public-api.d.ts +8 -0
  76. package/src/lib/components/styles/overrides.scss +583 -0
  77. package/src/lib/components/styles/variables.scss +7 -3
@@ -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,20 @@
1
+ import { LanguageSelectorMetadata } from '../components/molecules/language-selector/types';
2
+ import { PopoverSelectorMetadata } from '../components/molecules/popover-selector/types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Ejemplo de uso de los componentes popover-selector y language-selector
6
+ */
7
+ export declare class SelectorExamplesComponent {
8
+ categorySelector: PopoverSelectorMetadata;
9
+ prioritySelector: PopoverSelectorMetadata;
10
+ multipleSelector: PopoverSelectorMetadata;
11
+ basicLanguageSelector: LanguageSelectorMetadata;
12
+ flagLanguageSelector: LanguageSelectorMetadata;
13
+ customLanguageSelector: LanguageSelectorMetadata;
14
+ onCategoryChange(category: string | string[]): void;
15
+ onPriorityChange(priority: string | string[]): void;
16
+ onMultipleChange(notifications: string | string[]): void;
17
+ onLanguageChange(language: string): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectorExamplesComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectorExamplesComponent, "app-selector-examples", never, {}, {}, never, never, true, never>;
20
+ }
@@ -0,0 +1,3 @@
1
+ import { TextContent } from '../types';
2
+ declare const _default: TextContent;
3
+ export default _default;
@@ -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.294",
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
@@ -37,6 +37,8 @@ export * from './lib/components/molecules/expandable-text/types';
37
37
  export * from './lib/components/molecules/file-input/file-input.component';
38
38
  export * from './lib/components/molecules/hint/hint.component';
39
39
  export * from './lib/components/molecules/hour-input/hour-input.component';
40
+ export * from './lib/components/molecules/language-selector/language-selector.component';
41
+ export * from './lib/components/molecules/language-selector/types';
40
42
  export * from './lib/components/molecules/layered-card/layered-card.component';
41
43
  export * from './lib/components/molecules/layered-card/types';
42
44
  export * from './lib/components/molecules/link/link.component';
@@ -48,6 +50,8 @@ export * from './lib/components/molecules/notes-box/types';
48
50
  export * from './lib/components/molecules/number-input/number-input.component';
49
51
  export * from './lib/components/molecules/password-input/password-input.component';
50
52
  export * from './lib/components/molecules/pin-input/pin-input.component';
53
+ export * from './lib/components/molecules/popover-selector/popover-selector.component';
54
+ export * from './lib/components/molecules/popover-selector/types';
51
55
  export * from './lib/components/molecules/progress-status/progress-status.component';
52
56
  export * from './lib/components/molecules/progress-status/types';
53
57
  export * from './lib/components/molecules/prompter/prompter.component';
@@ -81,8 +85,11 @@ export * from './lib/components/templates/simple/simple.component';
81
85
  export * from './lib/components/templates/simple/types';
82
86
  export * from './lib/examples/comprehensive-link-test.component';
83
87
  export * from './lib/examples/custom-content-demo.component';
88
+ export * from './lib/examples/display-demo.component';
89
+ export * from './lib/examples/display-simple-example.component';
84
90
  export * from './lib/examples/link-processing-example.component';
85
91
  export * from './lib/examples/multi-language-demo.component';
92
+ export * from './lib/examples/selector-examples.component';
86
93
  export * from './lib/services/content.service';
87
94
  export * from './lib/services/download.service';
88
95
  export * from './lib/services/icons.service';
@@ -101,5 +108,6 @@ export * from './lib/shared/pipes/process-links.pipe';
101
108
  export * from './lib/shared/utils/content';
102
109
  export * from './lib/shared/utils/dom';
103
110
  export * from './lib/shared/utils/form-defaults';
111
+ export * from './lib/shared/utils/reactive-content';
104
112
  export * from './lib/shared/utils/styles';
105
113
  export * from './lib/shared/utils/text';