valtech-components 4.0.1012 → 4.0.1014
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 +2 -2
- package/esm2022/lib/components/organisms/data-table/data-table.component.mjs +317 -35
- package/esm2022/lib/components/organisms/data-table/types.mjs +1 -1
- package/esm2022/lib/components/organisms/field-schema-editor/field-schema-editor.component.mjs +4 -1
- package/esm2022/lib/components/organisms/field-schema-editor/types.mjs +1 -1
- package/esm2022/lib/components/organisms/form/form.component.mjs +7 -1
- package/esm2022/lib/components/organisms/request-review-panel/request-review-panel.component.mjs +12 -4
- package/esm2022/lib/components/organisms/request-review-panel/types.mjs +1 -1
- package/esm2022/lib/components/organisms/survey-builder/survey-builder.component.mjs +386 -155
- package/esm2022/lib/components/organisms/survey-builder/survey-builder.i18n.mjs +15 -1
- package/esm2022/lib/components/organisms/survey-builder/types.mjs +1 -1
- package/esm2022/lib/components/types.mjs +1 -1
- package/esm2022/lib/services/forms/form-schema-builder.service.mjs +3 -1
- package/esm2022/lib/services/forms/types.mjs +1 -1
- package/esm2022/lib/services/requests/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +739 -193
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/data-table/data-table.component.d.ts +10 -1
- package/lib/components/organisms/data-table/types.d.ts +14 -0
- package/lib/components/organisms/field-schema-editor/field-schema-editor.component.d.ts +1 -0
- package/lib/components/organisms/field-schema-editor/types.d.ts +2 -0
- package/lib/components/organisms/request-review-panel/request-review-panel.component.d.ts +6 -2
- package/lib/components/organisms/request-review-panel/types.d.ts +15 -0
- package/lib/components/organisms/survey-builder/survey-builder.component.d.ts +28 -5
- package/lib/components/organisms/survey-builder/types.d.ts +1 -0
- package/lib/components/types.d.ts +2 -0
- package/lib/services/forms/types.d.ts +2 -0
- package/lib/services/requests/types.d.ts +6 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/components/styles/typography.scss +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { DataTableMetadata, DataTableColumn, DataTableSort, DataTableRowClickEvent, DataTableSelectionChangeEvent, DataTableSortChangeEvent, DataTablePageChangeEvent, DataTableEmptyState } from './types';
|
|
2
|
+
import { DataTableMetadata, DataTableColumn, DataTableSort, DataTableRowClickEvent, DataTableSelectionChangeEvent, DataTableSortChangeEvent, DataTablePageChangeEvent, DataTableEmptyState, DataTableMobileCardLayout } from './types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DataTableComponent<T = any> implements OnInit, OnChanges {
|
|
5
5
|
props: DataTableMetadata<T>;
|
|
@@ -20,6 +20,13 @@ export declare class DataTableComponent<T = any> implements OnInit, OnChanges {
|
|
|
20
20
|
private updateDisplayedData;
|
|
21
21
|
private sortData;
|
|
22
22
|
get visibleColumns(): DataTableColumn<T>[];
|
|
23
|
+
get mobileCardLayout(): DataTableMobileCardLayout;
|
|
24
|
+
get mobileCardLayoutActive(): boolean;
|
|
25
|
+
get mobileCardPrimaryColumns(): DataTableColumn<T>[];
|
|
26
|
+
get mobileCardSecondaryColumns(): DataTableColumn<T>[];
|
|
27
|
+
get mobileCardMetaColumns(): DataTableColumn<T>[];
|
|
28
|
+
get mobileCardStatusColumns(): DataTableColumn<T>[];
|
|
29
|
+
get mobileCardAdditionalColumns(): DataTableColumn<T>[];
|
|
23
30
|
get totalColumns(): number;
|
|
24
31
|
get emptyState(): DataTableEmptyState;
|
|
25
32
|
/** Get actions column label */
|
|
@@ -46,6 +53,8 @@ export declare class DataTableComponent<T = any> implements OnInit, OnChanges {
|
|
|
46
53
|
getFormattedValue(row: T, column: DataTableColumn<T>): string;
|
|
47
54
|
getColumnClass(column: DataTableColumn<T>): string;
|
|
48
55
|
getAriaSort(column: DataTableColumn<T>): string | null;
|
|
56
|
+
getMobileCardFieldAriaLabel(column: DataTableColumn<T>, row: T): string;
|
|
57
|
+
private resolveMobileCardColumns;
|
|
49
58
|
getRowNumber(index: number): number;
|
|
50
59
|
getRowId(row: T): any;
|
|
51
60
|
trackByFn(row: T): any;
|
|
@@ -123,6 +123,18 @@ export interface DataTableEmptyState {
|
|
|
123
123
|
/** Custom template */
|
|
124
124
|
template?: TemplateRef<any>;
|
|
125
125
|
}
|
|
126
|
+
export interface DataTableMobileCardLayout {
|
|
127
|
+
/** Column key or keys used as primary content in mobile cards */
|
|
128
|
+
primary?: string | string[];
|
|
129
|
+
/** Column key or keys used as secondary content in mobile cards */
|
|
130
|
+
secondary?: string | string[];
|
|
131
|
+
/** Column keys used as metadata lines in mobile cards */
|
|
132
|
+
meta?: string[];
|
|
133
|
+
/** Column keys used as status lines in mobile cards */
|
|
134
|
+
status?: string[];
|
|
135
|
+
/** Show columns not mapped by any role after applying this layout */
|
|
136
|
+
showUnmappedColumns?: boolean;
|
|
137
|
+
}
|
|
126
138
|
/**
|
|
127
139
|
* Loading state configuration.
|
|
128
140
|
*/
|
|
@@ -208,6 +220,8 @@ export interface DataTableMetadata<T = any> {
|
|
|
208
220
|
responsiveBreakpoint?: number;
|
|
209
221
|
/** Custom template for mobile card view */
|
|
210
222
|
mobileCardTemplate?: TemplateRef<any>;
|
|
223
|
+
/** Mobile card metadata and field mapping */
|
|
224
|
+
mobileCardLayout?: DataTableMobileCardLayout;
|
|
211
225
|
}
|
|
212
226
|
/**
|
|
213
227
|
* Default pagination options.
|
|
@@ -53,6 +53,7 @@ export declare class FieldSchemaEditorComponent implements OnInit {
|
|
|
53
53
|
readonly selectedPresetId: import("@angular/core").WritableSignal<string>;
|
|
54
54
|
/** Se refresca con cada cambio de tipo — `needsOptions` no puede leer el control directo. */
|
|
55
55
|
private readonly currentType;
|
|
56
|
+
private currentSectionId;
|
|
56
57
|
/** Una vez que se toca el token a mano (o se edita un campo ya guardado) deja de derivarse del label. */
|
|
57
58
|
private nameLocked;
|
|
58
59
|
private name;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
2
2
|
import { ComponentState } from '../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { AppRequest } from '../../../services/requests/types';
|
|
4
|
+
import { RequestReviewDecision, RequestReviewItem, RequestReviewPanelConfig, RequestReviewPanelMetadata } from './types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
6
7
|
* val-request-review-panel — cola de revisión del factory (ADR-062).
|
|
@@ -41,6 +42,9 @@ import * as i0 from "@angular/core";
|
|
|
41
42
|
export declare class RequestReviewPanelComponent {
|
|
42
43
|
private i18n;
|
|
43
44
|
readonly props: import("@angular/core").InputSignal<RequestReviewPanelMetadata>;
|
|
45
|
+
requestId: string;
|
|
46
|
+
config?: RequestReviewPanelConfig;
|
|
47
|
+
loaded: EventEmitter<AppRequest>;
|
|
44
48
|
/**
|
|
45
49
|
* Cuerpo de cada card. El contexto trae el ítem como `$implicit` y también
|
|
46
50
|
* como `item`, para que el consumer pueda usar `let-item` o `let-x="item"`.
|
|
@@ -75,5 +79,5 @@ export declare class RequestReviewPanelComponent {
|
|
|
75
79
|
protected confirmReject(item: RequestReviewItem): void;
|
|
76
80
|
protected approve(item: RequestReviewItem): void;
|
|
77
81
|
static ɵfac: i0.ɵɵFactoryDeclaration<RequestReviewPanelComponent, never>;
|
|
78
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RequestReviewPanelComponent, "val-request-review-panel", never, { "props": { "alias": "props"; "required":
|
|
82
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RequestReviewPanelComponent, "val-request-review-panel", never, { "props": { "alias": "props"; "required": false; "isSignal": true; }; "requestId": { "alias": "requestId"; "required": false; }; "config": { "alias": "config"; "required": false; }; "itemBody": { "alias": "itemBody"; "required": false; }; }, { "loaded": "loaded"; "decision": "decision"; }, never, never, true, never>;
|
|
79
83
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { EmptyStateMetadata } from '../../molecules/empty-state/types';
|
|
2
|
+
import { AppRequest } from '../../../services/requests/types';
|
|
3
|
+
export interface RequestReviewEntityHeroConfig {
|
|
4
|
+
labelKey?: string;
|
|
5
|
+
nameField?: string;
|
|
6
|
+
imageField?: string;
|
|
7
|
+
placeholderIcon?: string;
|
|
8
|
+
canNavigate?: (metadata: Record<string, any>) => boolean;
|
|
9
|
+
navigate?: (metadata: Record<string, any>, request?: AppRequest) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface RequestReviewPanelConfig {
|
|
12
|
+
i18nNamespace?: string;
|
|
13
|
+
entityHero?: RequestReviewEntityHeroConfig;
|
|
14
|
+
canReview?: (request?: AppRequest) => boolean;
|
|
15
|
+
viewEntityCtaLabelKey?: string;
|
|
16
|
+
}
|
|
2
17
|
/**
|
|
3
18
|
* Un ítem de la cola de revisión, ya normalizado por el consumer.
|
|
4
19
|
*
|
|
@@ -5,6 +5,15 @@ import type { Color } from '@ionic/core';
|
|
|
5
5
|
import { EditableFieldDef, FieldSchemaEditorMetadata } from '../field-schema-editor/types';
|
|
6
6
|
import { SurveyBuilderMetadata, SurveyBuilderSaveEvent, SurveyDraftEvent } from './types';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
+
interface SurveyQuestionSection {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
rows: EditableFieldDef[];
|
|
12
|
+
}
|
|
13
|
+
interface WizardStep {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
8
17
|
/**
|
|
9
18
|
* val-survey-builder
|
|
10
19
|
*
|
|
@@ -37,6 +46,7 @@ export declare class SurveyBuilderComponent implements OnInit {
|
|
|
37
46
|
private readonly formBuilder;
|
|
38
47
|
private readonly errors;
|
|
39
48
|
private readonly modals;
|
|
49
|
+
readonly surveyNameControl: FormControl<string>;
|
|
40
50
|
readonly titleControl: FormControl<string>;
|
|
41
51
|
readonly subtitleControl: FormControl<string>;
|
|
42
52
|
readonly headerImageControl: FormControl<string>;
|
|
@@ -49,10 +59,14 @@ export declare class SurveyBuilderComponent implements OnInit {
|
|
|
49
59
|
readonly validationError: import("@angular/core").WritableSignal<string>;
|
|
50
60
|
readonly saving: import("@angular/core").WritableSignal<boolean>;
|
|
51
61
|
readonly uploadingImage: import("@angular/core").WritableSignal<"" | "success" | "header">;
|
|
52
|
-
readonly
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
readonly sectionSubtitles: import("@angular/core").WritableSignal<Record<string, string>>;
|
|
63
|
+
private readonly sectionSubtitleControls;
|
|
64
|
+
readonly questionGroups: import("@angular/core").Signal<SurveyQuestionSection[]>;
|
|
65
|
+
readonly wizardSteps: import("@angular/core").Signal<WizardStep[]>;
|
|
66
|
+
private groupQuestions;
|
|
67
|
+
private normalizeSectionId;
|
|
68
|
+
private questionGroupById;
|
|
69
|
+
sectionSubtitleControl(sectionId: string): FormControl;
|
|
56
70
|
private readonly allowedImageTypes;
|
|
57
71
|
private readonly maxImageBytes;
|
|
58
72
|
constructor();
|
|
@@ -68,10 +82,17 @@ export declare class SurveyBuilderComponent implements OnInit {
|
|
|
68
82
|
wizardBackProps(): ButtonMetadata;
|
|
69
83
|
wizardNextProps(): ButtonMetadata;
|
|
70
84
|
saveProps(): ButtonMetadata;
|
|
85
|
+
closeStep(): number;
|
|
86
|
+
reviewStep(): number;
|
|
87
|
+
sectionStepIndex(sectionIndex: number): number;
|
|
88
|
+
showCurrentSectionQuestionStep(): boolean;
|
|
71
89
|
interpolate(template: string, values: Record<string, string | number>): string;
|
|
72
90
|
editorProps(row: EditableFieldDef): FieldSchemaEditorMetadata;
|
|
73
91
|
iconAction(token: string, icon: string, label: string, disabled?: boolean, color?: Color): ButtonMetadata;
|
|
74
|
-
|
|
92
|
+
addQuestionAriaLabel(sectionLabel?: string): string;
|
|
93
|
+
addQuestion(sectionId?: string): void;
|
|
94
|
+
rowGlobalIndex(sectionId: string, groupRowIndex: number): number;
|
|
95
|
+
nextQuestionIndexForSection(rows: EditableFieldDef[], sectionId: string): number;
|
|
75
96
|
toggleEdit(row: EditableFieldDef): void;
|
|
76
97
|
removeQuestion(row: EditableFieldDef): void;
|
|
77
98
|
duplicate(row: EditableFieldDef): void;
|
|
@@ -87,6 +108,7 @@ export declare class SurveyBuilderComponent implements OnInit {
|
|
|
87
108
|
*/
|
|
88
109
|
draftQuestion(field: EditableFieldDef): void;
|
|
89
110
|
applyQuestion(field: EditableFieldDef): void;
|
|
111
|
+
private withResolvedSection;
|
|
90
112
|
onPresentationFileSelected(slot: 'header' | 'success', event: Event): Promise<void>;
|
|
91
113
|
clearPresentationImage(slot: 'header' | 'success'): void;
|
|
92
114
|
save(): Promise<void>;
|
|
@@ -103,3 +125,4 @@ export declare class SurveyBuilderComponent implements OnInit {
|
|
|
103
125
|
static ɵfac: i0.ɵɵFactoryDeclaration<SurveyBuilderComponent, never>;
|
|
104
126
|
static ɵcmp: i0.ɵɵComponentDeclaration<SurveyBuilderComponent, "val-survey-builder", never, { "props": { "alias": "props"; "required": false; }; }, { "saved": "saved"; "draft": "draft"; }, never, never, true, never>;
|
|
105
127
|
}
|
|
128
|
+
export {};
|
|
@@ -41,6 +41,8 @@ export interface FieldSchemaDef {
|
|
|
41
41
|
sectionId?: string;
|
|
42
42
|
/** Nombre visible de la sección/paso. Lo escribe la organización, no se traduce. */
|
|
43
43
|
sectionLabel?: string;
|
|
44
|
+
/** Bajada visible de la sección/paso. La escribe la organización, no se traduce. */
|
|
45
|
+
sectionSubtitle?: string;
|
|
44
46
|
/** Orden de la sección/paso. */
|
|
45
47
|
sectionOrder?: number;
|
|
46
48
|
/** Incremento para campos NUMBER_PICKER. */
|
|
@@ -71,6 +71,10 @@ export interface RequestTypeConfig {
|
|
|
71
71
|
label: string;
|
|
72
72
|
/** Bajada del enunciado (ej. encuestas). Label ya cubre el título. */
|
|
73
73
|
subtitle?: string;
|
|
74
|
+
/** Metadata libre para customización por dominio.
|
|
75
|
+
* Se usa para campos no principales como nombre interno.
|
|
76
|
+
*/
|
|
77
|
+
metadata?: Record<string, unknown>;
|
|
74
78
|
entityRef?: EntityRef;
|
|
75
79
|
presentation?: RequestTypePresentation;
|
|
76
80
|
createdBy?: RequestActor;
|
|
@@ -151,6 +155,7 @@ export interface CreateRequestTypePayload {
|
|
|
151
155
|
/** Nombre del tipo, escrito por la organización: no se traduce. */
|
|
152
156
|
label: string;
|
|
153
157
|
subtitle?: string;
|
|
158
|
+
metadata?: Record<string, unknown>;
|
|
154
159
|
entityRef?: EntityRef;
|
|
155
160
|
presentation?: RequestTypePresentation;
|
|
156
161
|
skipReview?: boolean;
|
|
@@ -168,6 +173,7 @@ export interface UpdateRequestTypePayload {
|
|
|
168
173
|
/** Nombre del tipo, escrito por la organización: no se traduce. */
|
|
169
174
|
label: string;
|
|
170
175
|
subtitle?: string;
|
|
176
|
+
metadata?: Record<string, unknown>;
|
|
171
177
|
entityRef?: EntityRef;
|
|
172
178
|
presentation?: RequestTypePresentation;
|
|
173
179
|
skipReview?: boolean;
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED