valtech-components 2.0.809 → 2.0.812
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/faq/faq.component.mjs +176 -0
- package/esm2022/lib/components/organisms/faq/types.mjs +9 -0
- package/esm2022/lib/config/company-footer.config.mjs +4 -2
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/valtech-components.mjs +484 -305
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/faq/faq.component.d.ts +46 -0
- package/lib/components/organisms/faq/types.d.ts +53 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ArticleMetadata } from '../article/types';
|
|
2
|
+
import { FaqCategory, FaqItem, FaqMetadata } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `val-faq`
|
|
6
|
+
*
|
|
7
|
+
* Organism de preguntas frecuentes. Q&A categorizado con accordion colapsable
|
|
8
|
+
* y buscador en vivo. Pensado para vistas FAQ públicas — el caller puede
|
|
9
|
+
* reusar la misma data (`FaqMetadata.categories`) para emitir el structured
|
|
10
|
+
* data `FAQPage` (JSON-LD) y ganar rich results en buscadores.
|
|
11
|
+
*
|
|
12
|
+
* Las respuestas (`FaqItem.answer`) son **Markdown** — se parsean con
|
|
13
|
+
* `parseMarkdownArticle` y se renderizan vía `val-article`. Soportan links,
|
|
14
|
+
* listas, negritas, tablas, etc.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <val-faq [props]="{ categories: faqCategories, searchable: true }" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class FaqComponent {
|
|
22
|
+
private readonly props_;
|
|
23
|
+
set props(value: FaqMetadata | undefined);
|
|
24
|
+
get props(): FaqMetadata;
|
|
25
|
+
/** Término de búsqueda actual. */
|
|
26
|
+
private readonly query;
|
|
27
|
+
/**
|
|
28
|
+
* Cache de respuestas parseadas (Markdown → ArticleMetadata). Se reconstruye
|
|
29
|
+
* solo cuando cambian las categorías — el parseo NO corre por keystroke.
|
|
30
|
+
* Keyed por id de item (los ids son únicos en toda la FAQ).
|
|
31
|
+
*/
|
|
32
|
+
private readonly parsedAnswers;
|
|
33
|
+
/** Respuesta parseada de un item — desde el cache. */
|
|
34
|
+
answerOf(item: FaqItem): ArticleMetadata;
|
|
35
|
+
/**
|
|
36
|
+
* Categorías visibles tras el filtro. Una categoría desaparece si ninguna
|
|
37
|
+
* de sus preguntas matchea. Match sobre pregunta + respuesta (raw markdown),
|
|
38
|
+
* case-insensitive.
|
|
39
|
+
*/
|
|
40
|
+
readonly visibleCategories: import("@angular/core").Signal<FaqCategory[]>;
|
|
41
|
+
/** `true` si se debe mostrar el label de cada categoría. */
|
|
42
|
+
readonly showCategoryLabel: import("@angular/core").Signal<boolean>;
|
|
43
|
+
onSearch(term: string): void;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FaqComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FaqComponent, "val-faq", never, { "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipos del organism `val-faq`.
|
|
3
|
+
*
|
|
4
|
+
* Modelo Q&A categorizado. Pensado para vistas FAQ públicas (sitio corporativo)
|
|
5
|
+
* — el caller también puede usar la misma data para emitir structured data
|
|
6
|
+
* `FAQPage` (JSON-LD) y ganar rich results en buscadores.
|
|
7
|
+
*/
|
|
8
|
+
/** Una pregunta-respuesta. */
|
|
9
|
+
export interface FaqItem {
|
|
10
|
+
/** Identificador único dentro de la FAQ — usado como track + accordion value. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** La pregunta. */
|
|
13
|
+
question: string;
|
|
14
|
+
/** La respuesta. Texto plano (los saltos de línea se respetan). */
|
|
15
|
+
answer: string;
|
|
16
|
+
}
|
|
17
|
+
/** Grupo de preguntas bajo un tema. */
|
|
18
|
+
export interface FaqCategory {
|
|
19
|
+
/** Identificador único de la categoría. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Etiqueta visible del grupo. */
|
|
22
|
+
label: string;
|
|
23
|
+
/** Preguntas del grupo. */
|
|
24
|
+
items: FaqItem[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Configuración del organism `val-faq`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```html
|
|
31
|
+
* <val-faq
|
|
32
|
+
* [props]="{
|
|
33
|
+
* categories: faqCategories,
|
|
34
|
+
* searchable: true,
|
|
35
|
+
* searchPlaceholder: 'Buscar...',
|
|
36
|
+
* }"
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export interface FaqMetadata {
|
|
41
|
+
/** Categorías con sus preguntas, en orden de aparición. */
|
|
42
|
+
categories: FaqCategory[];
|
|
43
|
+
/** Muestra el buscador que filtra preguntas en vivo. Default `true`. */
|
|
44
|
+
searchable?: boolean;
|
|
45
|
+
/** Placeholder del buscador. */
|
|
46
|
+
searchPlaceholder?: string;
|
|
47
|
+
/** Permite varias preguntas abiertas a la vez. Default `false`. */
|
|
48
|
+
multiple?: boolean;
|
|
49
|
+
/** Texto cuando la búsqueda no arroja resultados. */
|
|
50
|
+
noResultsText?: string;
|
|
51
|
+
/** Oculta el label de categoría cuando solo hay una. Default `true`. */
|
|
52
|
+
hideSingleCategoryLabel?: boolean;
|
|
53
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -226,6 +226,8 @@ export * from './lib/components/organisms/avatar-upload/avatar-upload.component'
|
|
|
226
226
|
export * from './lib/components/organisms/avatar-upload/types';
|
|
227
227
|
export * from './lib/components/organisms/skeleton-layout/skeleton-layout.component';
|
|
228
228
|
export * from './lib/components/organisms/skeleton-layout/types';
|
|
229
|
+
export * from './lib/components/organisms/faq/faq.component';
|
|
230
|
+
export * from './lib/components/organisms/faq/types';
|
|
229
231
|
export * from './lib/components/templates/simple/simple.component';
|
|
230
232
|
export * from './lib/components/templates/simple/types';
|
|
231
233
|
export * from './lib/components/templates/page-template/page-template.component';
|