valtech-components 2.0.305 → 2.0.306
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/organisms/article/article.component.mjs +494 -0
- package/esm2022/lib/components/organisms/article/types.mjs +157 -0
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/valtech-components.mjs +645 -1
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/article/article.component.d.ts +82 -0
- package/lib/components/organisms/article/types.d.ts +293 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ArticleButtonElement, ArticleCodeElement, ArticleCustomElement, ArticleElement, ArticleHighlightElement, ArticleImageElement, ArticleListElement, ArticleMetadata, ArticleQuoteElement, ArticleSeparatorElement, ArticleSubtitleElement, ArticleTextElement, ArticleTitleElement, ArticleVideoElement } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ArticleComponent implements OnInit {
|
|
5
|
+
/**
|
|
6
|
+
* Configuración del artículo
|
|
7
|
+
* @type {ArticleMetadata}
|
|
8
|
+
*/
|
|
9
|
+
props: ArticleMetadata;
|
|
10
|
+
constructor();
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Función de trackBy para optimizar el rendering de elementos
|
|
14
|
+
*/
|
|
15
|
+
trackByFn(index: number, element: ArticleElement): any;
|
|
16
|
+
/**
|
|
17
|
+
* Obtiene las clases CSS para el espaciado del elemento
|
|
18
|
+
*/
|
|
19
|
+
getElementSpacingClass(element: ArticleElement): string;
|
|
20
|
+
getTitleElement(element: ArticleElement): ArticleTitleElement;
|
|
21
|
+
getSubtitleElement(element: ArticleElement): ArticleSubtitleElement;
|
|
22
|
+
getTextElement(element: ArticleElement): ArticleTextElement;
|
|
23
|
+
getQuoteElement(element: ArticleElement): ArticleQuoteElement;
|
|
24
|
+
getHighlightElement(element: ArticleElement): ArticleHighlightElement;
|
|
25
|
+
getCodeElement(element: ArticleElement): ArticleCodeElement;
|
|
26
|
+
getListElement(element: ArticleElement): ArticleListElement;
|
|
27
|
+
getButtonElement(element: ArticleElement): ArticleButtonElement;
|
|
28
|
+
getSeparatorElement(element: ArticleElement): ArticleSeparatorElement;
|
|
29
|
+
getImageElement(element: ArticleElement): ArticleImageElement;
|
|
30
|
+
getVideoElement(element: ArticleElement): ArticleVideoElement;
|
|
31
|
+
getCustomElement(element: ArticleElement): ArticleCustomElement;
|
|
32
|
+
getQuoteTextProps(element: ArticleElement): {
|
|
33
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
34
|
+
color: import("@ionic/core").Color;
|
|
35
|
+
content?: string;
|
|
36
|
+
bold: boolean;
|
|
37
|
+
contentKey?: string;
|
|
38
|
+
contentClass?: string;
|
|
39
|
+
contentFallback?: string;
|
|
40
|
+
contentInterpolation?: Record<string, string | number>;
|
|
41
|
+
processLinks?: boolean;
|
|
42
|
+
linkConfig?: import("valtech-components").LinkProcessorConfig;
|
|
43
|
+
};
|
|
44
|
+
getHighlightTextProps(element: ArticleElement): {
|
|
45
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
46
|
+
color: import("@ionic/core").Color;
|
|
47
|
+
content?: string;
|
|
48
|
+
bold: boolean;
|
|
49
|
+
contentKey?: string;
|
|
50
|
+
contentClass?: string;
|
|
51
|
+
contentFallback?: string;
|
|
52
|
+
contentInterpolation?: Record<string, string | number>;
|
|
53
|
+
processLinks?: boolean;
|
|
54
|
+
linkConfig?: import("valtech-components").LinkProcessorConfig;
|
|
55
|
+
};
|
|
56
|
+
getHighlightColor(element: ArticleElement): string;
|
|
57
|
+
getButtonProps(element: ArticleElement): {
|
|
58
|
+
actionType?: import("valtech-components").ActionType;
|
|
59
|
+
expand?: "full" | "block";
|
|
60
|
+
link?: string;
|
|
61
|
+
href?: string;
|
|
62
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
63
|
+
download?: string;
|
|
64
|
+
color: import("@ionic/core").Color;
|
|
65
|
+
state: import("valtech-components").ComponentState;
|
|
66
|
+
text?: string;
|
|
67
|
+
contentKey?: string;
|
|
68
|
+
contentClass?: string;
|
|
69
|
+
contentFallback?: string;
|
|
70
|
+
contentInterpolation?: Record<string, string | number>;
|
|
71
|
+
icon?: import("valtech-components").IconMetada;
|
|
72
|
+
shape?: "round";
|
|
73
|
+
size?: "small" | "large" | "default";
|
|
74
|
+
fill?: "default" | "clear" | "outline" | "solid";
|
|
75
|
+
type: "button" | "submit" | "reset";
|
|
76
|
+
token?: string;
|
|
77
|
+
ref?: any;
|
|
78
|
+
handler?: (value: any) => any;
|
|
79
|
+
};
|
|
80
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArticleComponent, never>;
|
|
81
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArticleComponent, "val-article", never, { "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
82
|
+
}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { Color } from '@ionic/core';
|
|
2
|
+
import { TextMetadata } from '../../atoms/text/types';
|
|
3
|
+
import { TitleMetadata } from '../../atoms/title/types';
|
|
4
|
+
import { ButtonMetadata } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Tipos de contenido soportados en el componente val-article
|
|
7
|
+
*/
|
|
8
|
+
export type ArticleContentType = 'title' | 'subtitle' | 'text' | 'paragraph' | 'quote' | 'highlight' | 'code' | 'list' | 'button' | 'separator' | 'image' | 'video' | 'custom';
|
|
9
|
+
/**
|
|
10
|
+
* Configuración de espaciado entre elementos
|
|
11
|
+
*/
|
|
12
|
+
export interface ArticleSpacing {
|
|
13
|
+
/** Espaciado superior */
|
|
14
|
+
top?: 'none' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
15
|
+
/** Espaciado inferior */
|
|
16
|
+
bottom?: 'none' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
17
|
+
/** Espaciado lateral */
|
|
18
|
+
horizontal?: 'none' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Configuración base para cualquier elemento del artículo
|
|
22
|
+
*/
|
|
23
|
+
export interface BaseArticleElement {
|
|
24
|
+
/** Tipo de elemento */
|
|
25
|
+
type: ArticleContentType;
|
|
26
|
+
/** ID único del elemento (opcional) */
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Clases CSS adicionales */
|
|
29
|
+
cssClass?: string;
|
|
30
|
+
/** Configuración de espaciado */
|
|
31
|
+
spacing?: ArticleSpacing;
|
|
32
|
+
/** Elemento visible condicionalmente */
|
|
33
|
+
visible?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Elemento de título
|
|
37
|
+
*/
|
|
38
|
+
export interface ArticleTitleElement extends BaseArticleElement {
|
|
39
|
+
type: 'title';
|
|
40
|
+
props: TitleMetadata;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Elemento de subtítulo
|
|
44
|
+
*/
|
|
45
|
+
export interface ArticleSubtitleElement extends BaseArticleElement {
|
|
46
|
+
type: 'subtitle';
|
|
47
|
+
props: TitleMetadata;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Elemento de texto/párrafo
|
|
51
|
+
*/
|
|
52
|
+
export interface ArticleTextElement extends BaseArticleElement {
|
|
53
|
+
type: 'text' | 'paragraph';
|
|
54
|
+
props: TextMetadata;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Elemento de cita
|
|
58
|
+
*/
|
|
59
|
+
export interface ArticleQuoteElement extends BaseArticleElement {
|
|
60
|
+
type: 'quote';
|
|
61
|
+
props: TextMetadata & {
|
|
62
|
+
/** Autor de la cita */
|
|
63
|
+
author?: string;
|
|
64
|
+
/** Fuente de la cita */
|
|
65
|
+
source?: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Elemento de texto destacado
|
|
70
|
+
*/
|
|
71
|
+
export interface ArticleHighlightElement extends BaseArticleElement {
|
|
72
|
+
type: 'highlight';
|
|
73
|
+
props: TextMetadata & {
|
|
74
|
+
/** Color de fondo del highlight */
|
|
75
|
+
backgroundColor?: Color;
|
|
76
|
+
/** Esquinas redondeadas */
|
|
77
|
+
rounded?: boolean;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Elemento de código
|
|
82
|
+
*/
|
|
83
|
+
export interface ArticleCodeElement extends BaseArticleElement {
|
|
84
|
+
type: 'code';
|
|
85
|
+
props: {
|
|
86
|
+
/** Código a mostrar */
|
|
87
|
+
code: string;
|
|
88
|
+
/** Lenguaje de programación */
|
|
89
|
+
language?: string;
|
|
90
|
+
/** Mostrar números de línea */
|
|
91
|
+
showLineNumbers?: boolean;
|
|
92
|
+
/** Tema del código */
|
|
93
|
+
theme?: 'light' | 'dark';
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Elemento de lista
|
|
98
|
+
*/
|
|
99
|
+
export interface ArticleListElement extends BaseArticleElement {
|
|
100
|
+
type: 'list';
|
|
101
|
+
props: {
|
|
102
|
+
/** Elementos de la lista */
|
|
103
|
+
items: Array<{
|
|
104
|
+
/** Texto del elemento */
|
|
105
|
+
text: string;
|
|
106
|
+
/** Configuración de contenido reactivo */
|
|
107
|
+
contentKey?: string;
|
|
108
|
+
contentClass?: string;
|
|
109
|
+
contentFallback?: string;
|
|
110
|
+
contentInterpolation?: Record<string, string | number>;
|
|
111
|
+
}>;
|
|
112
|
+
/** Tipo de lista */
|
|
113
|
+
listType?: 'unordered' | 'ordered' | 'checklist';
|
|
114
|
+
/** Color de los elementos */
|
|
115
|
+
color?: Color;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Elemento de botón
|
|
120
|
+
*/
|
|
121
|
+
export interface ArticleButtonElement extends BaseArticleElement {
|
|
122
|
+
type: 'button';
|
|
123
|
+
props: ButtonMetadata & {
|
|
124
|
+
/** Alineación del botón */
|
|
125
|
+
alignment?: 'left' | 'center' | 'right';
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Elemento separador
|
|
130
|
+
*/
|
|
131
|
+
export interface ArticleSeparatorElement extends BaseArticleElement {
|
|
132
|
+
type: 'separator';
|
|
133
|
+
props: {
|
|
134
|
+
/** Tipo de separador */
|
|
135
|
+
style?: 'line' | 'dots' | 'space';
|
|
136
|
+
/** Color del separador */
|
|
137
|
+
color?: Color;
|
|
138
|
+
/** Grosor del separador */
|
|
139
|
+
thickness?: 'thin' | 'medium' | 'thick';
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Elemento de imagen
|
|
144
|
+
*/
|
|
145
|
+
export interface ArticleImageElement extends BaseArticleElement {
|
|
146
|
+
type: 'image';
|
|
147
|
+
props: {
|
|
148
|
+
/** URL de la imagen */
|
|
149
|
+
src: string;
|
|
150
|
+
/** Texto alternativo */
|
|
151
|
+
alt: string;
|
|
152
|
+
/** Título de la imagen */
|
|
153
|
+
title?: string;
|
|
154
|
+
/** Leyenda de la imagen */
|
|
155
|
+
caption?: string;
|
|
156
|
+
/** Configuración de contenido reactivo para caption */
|
|
157
|
+
captionContentKey?: string;
|
|
158
|
+
captionContentClass?: string;
|
|
159
|
+
captionContentFallback?: string;
|
|
160
|
+
/** Alineación de la imagen */
|
|
161
|
+
alignment?: 'left' | 'center' | 'right';
|
|
162
|
+
/** Ancho máximo */
|
|
163
|
+
maxWidth?: string;
|
|
164
|
+
/** Imagen con bordes redondeados */
|
|
165
|
+
rounded?: boolean;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Elemento de video
|
|
170
|
+
*/
|
|
171
|
+
export interface ArticleVideoElement extends BaseArticleElement {
|
|
172
|
+
type: 'video';
|
|
173
|
+
props: {
|
|
174
|
+
/** URL del video */
|
|
175
|
+
src: string;
|
|
176
|
+
/** Imagen de poster */
|
|
177
|
+
poster?: string;
|
|
178
|
+
/** Título del video */
|
|
179
|
+
title?: string;
|
|
180
|
+
/** Controles visibles */
|
|
181
|
+
controls?: boolean;
|
|
182
|
+
/** Reproducción automática */
|
|
183
|
+
autoplay?: boolean;
|
|
184
|
+
/** Silenciado por defecto */
|
|
185
|
+
muted?: boolean;
|
|
186
|
+
/** Ancho máximo */
|
|
187
|
+
maxWidth?: string;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Elemento personalizado
|
|
192
|
+
*/
|
|
193
|
+
export interface ArticleCustomElement extends BaseArticleElement {
|
|
194
|
+
type: 'custom';
|
|
195
|
+
props: {
|
|
196
|
+
/** Contenido HTML personalizado */
|
|
197
|
+
htmlContent?: string;
|
|
198
|
+
/** Clase de componente personalizado */
|
|
199
|
+
componentClass?: any;
|
|
200
|
+
/** Props para el componente personalizado */
|
|
201
|
+
componentProps?: any;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Unión de todos los tipos de elementos posibles
|
|
206
|
+
*/
|
|
207
|
+
export type ArticleElement = ArticleTitleElement | ArticleSubtitleElement | ArticleTextElement | ArticleQuoteElement | ArticleHighlightElement | ArticleCodeElement | ArticleListElement | ArticleButtonElement | ArticleSeparatorElement | ArticleImageElement | ArticleVideoElement | ArticleCustomElement;
|
|
208
|
+
/**
|
|
209
|
+
* Configuración del artículo completo
|
|
210
|
+
*/
|
|
211
|
+
export interface ArticleMetadata {
|
|
212
|
+
/** Elementos del artículo */
|
|
213
|
+
elements: ArticleElement[];
|
|
214
|
+
/** Configuración de espaciado global */
|
|
215
|
+
defaultSpacing?: ArticleSpacing;
|
|
216
|
+
/** Ancho máximo del artículo */
|
|
217
|
+
maxWidth?: string;
|
|
218
|
+
/** Centrar el artículo */
|
|
219
|
+
centered?: boolean;
|
|
220
|
+
/** Tema del artículo */
|
|
221
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
222
|
+
/** Clases CSS adicionales */
|
|
223
|
+
cssClass?: string;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Configuración de espaciado predefinida
|
|
227
|
+
*/
|
|
228
|
+
export declare const ARTICLE_SPACING: {
|
|
229
|
+
readonly NONE: ArticleSpacing;
|
|
230
|
+
readonly SMALL: ArticleSpacing;
|
|
231
|
+
readonly MEDIUM: ArticleSpacing;
|
|
232
|
+
readonly LARGE: ArticleSpacing;
|
|
233
|
+
readonly XLARGE: ArticleSpacing;
|
|
234
|
+
readonly TITLE: ArticleSpacing;
|
|
235
|
+
readonly SUBTITLE: ArticleSpacing;
|
|
236
|
+
readonly PARAGRAPH: ArticleSpacing;
|
|
237
|
+
readonly QUOTE: ArticleSpacing;
|
|
238
|
+
readonly CODE: ArticleSpacing;
|
|
239
|
+
readonly LIST: ArticleSpacing;
|
|
240
|
+
readonly BUTTON: ArticleSpacing;
|
|
241
|
+
readonly IMAGE: ArticleSpacing;
|
|
242
|
+
readonly SEPARATOR: ArticleSpacing;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Función helper para crear elementos de artículo de forma fácil
|
|
246
|
+
*/
|
|
247
|
+
export declare class ArticleBuilder {
|
|
248
|
+
private elements;
|
|
249
|
+
/**
|
|
250
|
+
* Añade un título al artículo
|
|
251
|
+
*/
|
|
252
|
+
title(props: TitleMetadata, options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
253
|
+
/**
|
|
254
|
+
* Añade un subtítulo al artículo
|
|
255
|
+
*/
|
|
256
|
+
subtitle(props: TitleMetadata, options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
257
|
+
/**
|
|
258
|
+
* Añade un párrafo al artículo
|
|
259
|
+
*/
|
|
260
|
+
paragraph(props: TextMetadata, options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
261
|
+
/**
|
|
262
|
+
* Añade una cita al artículo
|
|
263
|
+
*/
|
|
264
|
+
quote(props: ArticleQuoteElement['props'], options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
265
|
+
/**
|
|
266
|
+
* Añade código al artículo
|
|
267
|
+
*/
|
|
268
|
+
code(code: string, language?: string, options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
269
|
+
/**
|
|
270
|
+
* Añade una lista al artículo
|
|
271
|
+
*/
|
|
272
|
+
list(items: ArticleListElement['props']['items'], listType?: ArticleListElement['props']['listType'], options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
273
|
+
/**
|
|
274
|
+
* Añade un botón al artículo
|
|
275
|
+
*/
|
|
276
|
+
button(props: ButtonMetadata, alignment?: 'left' | 'center' | 'right', options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
277
|
+
/**
|
|
278
|
+
* Añade un separador al artículo
|
|
279
|
+
*/
|
|
280
|
+
separator(style?: 'line' | 'dots' | 'space', options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
281
|
+
/**
|
|
282
|
+
* Añade una imagen al artículo
|
|
283
|
+
*/
|
|
284
|
+
image(src: string, alt: string, caption?: string, options?: Partial<BaseArticleElement>): ArticleBuilder;
|
|
285
|
+
/**
|
|
286
|
+
* Construye el artículo final
|
|
287
|
+
*/
|
|
288
|
+
build(config?: Partial<ArticleMetadata>): ArticleMetadata;
|
|
289
|
+
/**
|
|
290
|
+
* Resetea el builder para crear un nuevo artículo
|
|
291
|
+
*/
|
|
292
|
+
clear(): ArticleBuilder;
|
|
293
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export * from './lib/components/molecules/select-search/select-search.component'
|
|
|
63
63
|
export * from './lib/components/molecules/text-input/text-input.component';
|
|
64
64
|
export * from './lib/components/molecules/title-block/title-block.component';
|
|
65
65
|
export * from './lib/components/molecules/title-block/types';
|
|
66
|
+
export * from './lib/components/organisms/article/article.component';
|
|
67
|
+
export * from './lib/components/organisms/article/types';
|
|
66
68
|
export * from './lib/components/organisms/banner/banner.component';
|
|
67
69
|
export * from './lib/components/organisms/banner/types';
|
|
68
70
|
export * from './lib/components/organisms/footer/footer.component';
|
|
@@ -80,6 +82,8 @@ export * from './lib/components/organisms/toolbar/types';
|
|
|
80
82
|
export * from './lib/components/organisms/wizard/types';
|
|
81
83
|
export * from './lib/components/organisms/wizard/wizard-footer/wizard-footer.component';
|
|
82
84
|
export * from './lib/components/organisms/wizard/wizard.component';
|
|
85
|
+
export * from './lib/components/organisms/article/article.component';
|
|
86
|
+
export * from './lib/components/organisms/article/types';
|
|
83
87
|
export * from './lib/components/templates/layout/layout.component';
|
|
84
88
|
export * from './lib/components/templates/simple/simple.component';
|
|
85
89
|
export * from './lib/components/templates/simple/types';
|