valtech-components 2.0.317 → 2.0.318
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/atoms/display/display.component.mjs +57 -1
- package/esm2022/lib/components/atoms/display/types.mjs +1 -1
- package/fesm2022/valtech-components.mjs +57 -1
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/display/display.component.d.ts +46 -1
- package/lib/components/atoms/display/types.d.ts +10 -0
- package/lib/components/organisms/article/article.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ContentService } from '../../../services/content.service';
|
|
4
|
-
import { DisplayMetadata } from './types';
|
|
4
|
+
import { DisplayContentConfig, DisplayMetadata } from './types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class DisplayComponent implements OnInit, OnDestroy {
|
|
7
7
|
private contentService;
|
|
@@ -23,3 +23,48 @@ export declare class DisplayComponent implements OnInit, OnDestroy {
|
|
|
23
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<DisplayComponent, never>;
|
|
24
24
|
static ɵcmp: i0.ɵɵComponentDeclaration<DisplayComponent, "val-display", never, { "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Helper function to create reactive display props from content configuration.
|
|
28
|
+
* This provides a convenient way to create val-display props with reactive content.
|
|
29
|
+
*
|
|
30
|
+
* @param contentConfig - Content configuration for reactive content
|
|
31
|
+
* @param styleConfig - Optional style configuration (color and size)
|
|
32
|
+
* @returns DisplayMetadata with content properties set
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // In component
|
|
37
|
+
* titleProps: DisplayMetadata = createDisplayProps({
|
|
38
|
+
* key: 'title',
|
|
39
|
+
* className: 'HeaderComponent',
|
|
40
|
+
* fallback: 'Default Title'
|
|
41
|
+
* }, {
|
|
42
|
+
* color: 'primary',
|
|
43
|
+
* size: 'large'
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // With interpolation
|
|
50
|
+
* greetingProps: DisplayMetadata = createDisplayProps({
|
|
51
|
+
* key: 'greeting',
|
|
52
|
+
* className: 'UserComponent',
|
|
53
|
+
* fallback: 'Hello!',
|
|
54
|
+
* interpolation: { name: 'John', count: 5 }
|
|
55
|
+
* }, {
|
|
56
|
+
* color: 'secondary',
|
|
57
|
+
* size: 'medium'
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* // Using default style values
|
|
64
|
+
* simpleProps: DisplayMetadata = createDisplayProps({
|
|
65
|
+
* key: 'welcomeMessage',
|
|
66
|
+
* className: 'HomeComponent'
|
|
67
|
+
* }); // Will use default color: 'dark' and size: 'medium'
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function createDisplayProps(contentConfig: DisplayContentConfig, styleConfig?: Partial<Pick<DisplayMetadata, 'color' | 'size'>>): DisplayMetadata;
|
|
@@ -21,3 +21,13 @@ export interface DisplayMetadata {
|
|
|
21
21
|
interpolation?: Record<string, any>;
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Configuration for reactive content in val-display component.
|
|
26
|
+
* Use this interface when you only need to specify content-related properties.
|
|
27
|
+
*/
|
|
28
|
+
export interface DisplayContentConfig {
|
|
29
|
+
key: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
fallback?: string;
|
|
32
|
+
interpolation?: Record<string, string | number>;
|
|
33
|
+
}
|
|
@@ -73,7 +73,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
73
73
|
shape?: "round";
|
|
74
74
|
size?: "small" | "large" | "default";
|
|
75
75
|
fill?: "default" | "clear" | "outline" | "solid";
|
|
76
|
-
type: "
|
|
76
|
+
type: "submit" | "button" | "reset";
|
|
77
77
|
token?: string;
|
|
78
78
|
ref?: any;
|
|
79
79
|
handler?: (value: any) => any;
|