ui-core-abv 0.6.81 → 0.7.2
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/fesm2022/ui-core-abv.mjs +911 -128
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/components/dynamic-form/form/dynamic-form.component.d.ts +5 -2
- package/lib/components/dynamic-form/form-wrapper/form-wrapper.component.d.ts +27 -2
- package/lib/components/dynamic-form/form.models.d.ts +41 -1
- package/lib/components/dynamic-form/repeater/repeater.component.d.ts +21 -0
- package/lib/components/excel-table/excel-table.component.d.ts +4 -0
- package/lib/components/inputs/select/select.component.d.ts +3 -0
- package/lib/components/inputs/time-picker/time-picker.component.d.ts +6 -0
- package/lib/components/user-formbuilder/block-editor/block-editor.component.d.ts +18 -2
- package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts +10 -3
- package/lib/components/user-formbuilder/block-editor/field-type-selector/field-type-selector.component.d.ts +4 -3
- package/lib/components/user-formbuilder/user-formbuilder.component.d.ts +10 -0
- package/lib/translate/dictionary.en.d.ts +17 -2
- package/lib/translate/dictionary.es.d.ts +17 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NgZone, OnDestroy } from '@angular/core';
|
|
2
|
-
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
2
|
+
import { AbstractControl, FormArray, FormGroup } from '@angular/forms';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ButtonColor } from '../../button/button.component';
|
|
5
5
|
import { FormField, SelectOptionsResolver } from '../form.models';
|
|
@@ -26,6 +26,7 @@ export declare class UicDynamicFormComponent implements OnDestroy {
|
|
|
26
26
|
private voiceStopTimer;
|
|
27
27
|
set fields(value: FormField[]);
|
|
28
28
|
get fields(): FormField[];
|
|
29
|
+
isSubForm: boolean;
|
|
29
30
|
set form(value: FormGroup);
|
|
30
31
|
get form(): FormGroup;
|
|
31
32
|
set disabled(value: boolean);
|
|
@@ -37,6 +38,7 @@ export declare class UicDynamicFormComponent implements OnDestroy {
|
|
|
37
38
|
listeningField: string | null;
|
|
38
39
|
readonly fieldStates: import("@angular/core").Signal<DynamicFieldState[]>;
|
|
39
40
|
readonly visibleFieldStates: import("@angular/core").Signal<DynamicFieldState[]>;
|
|
41
|
+
private readonly formSyncEffect;
|
|
40
42
|
private readonly fieldStateSyncEffect;
|
|
41
43
|
readonly colorToIcon: Record<string, string>;
|
|
42
44
|
constructor(ngZone: NgZone);
|
|
@@ -54,6 +56,7 @@ export declare class UicDynamicFormComponent implements OnDestroy {
|
|
|
54
56
|
private arrayIncludesVisibilityValue;
|
|
55
57
|
private parseBooleanLike;
|
|
56
58
|
getControlErrorMessages(control: AbstractControl | null, field: FormField): string[];
|
|
59
|
+
asFormArray(control: AbstractControl | null): FormArray;
|
|
57
60
|
isListening(fieldName: string): boolean;
|
|
58
61
|
private readonly errorMessages;
|
|
59
62
|
getInputColor(field: FormField, value: string | number): ButtonColor;
|
|
@@ -71,6 +74,6 @@ export declare class UicDynamicFormComponent implements OnDestroy {
|
|
|
71
74
|
private scheduleVoiceStop;
|
|
72
75
|
voiceToText(target: HTMLTextAreaElement, fieldName: string): void;
|
|
73
76
|
static ɵfac: i0.ɵɵFactoryDeclaration<UicDynamicFormComponent, never>;
|
|
74
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UicDynamicFormComponent, "ui-dynamic-form", never, { "fields": { "alias": "fields"; "required": false; }; "form": { "alias": "form"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; "voiceToTextSilenceMs": { "alias": "voiceToTextSilenceMs"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "fileUidResolverFn": { "alias": "fileUidResolverFn"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; }, {}, never, never, true, never>;
|
|
77
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicDynamicFormComponent, "ui-dynamic-form", never, { "fields": { "alias": "fields"; "required": false; }; "isSubForm": { "alias": "isSubForm"; "required": false; }; "form": { "alias": "form"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; "voiceToTextSilenceMs": { "alias": "voiceToTextSilenceMs"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "fileUidResolverFn": { "alias": "fileUidResolverFn"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; }, {}, never, never, true, never>;
|
|
75
78
|
}
|
|
76
79
|
export {};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
3
|
import { AppSelectOption } from '../../inputs/select/select.component';
|
|
4
|
-
import { FormField, FormResult, FormSchema, SelectOptionsResolver, SelectOptionsSource, uicFormValuesRecord } from '../form.models';
|
|
4
|
+
import { ComputedFieldResolver, FormField, FormResult, FormSchema, SelectOptionsResolver, SelectOptionsSource, uicFormValuesRecord } from '../form.models';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class UicFormWrapperComponent implements OnInit, OnChanges, OnDestroy {
|
|
7
7
|
private readonly fb;
|
|
8
8
|
private readonly elementRef;
|
|
9
|
+
private readonly titleLineHeightRatio;
|
|
10
|
+
private readonly subtitleLineHeightRatio;
|
|
9
11
|
form: FormGroup;
|
|
10
12
|
effectiveSchema: FormSchema;
|
|
13
|
+
private readonly blockTitleStyles;
|
|
14
|
+
private readonly blockSubtitleStyles;
|
|
11
15
|
schema?: FormSchema;
|
|
12
16
|
fields: FormField[];
|
|
13
17
|
cols: number;
|
|
14
18
|
externalData: Record<string, AppSelectOption[]>;
|
|
15
19
|
selectOptionsResolver?: SelectOptionsResolver;
|
|
20
|
+
computedFieldResolver?: ComputedFieldResolver;
|
|
16
21
|
loading: boolean;
|
|
17
22
|
disabled: boolean;
|
|
18
23
|
showButtons: boolean;
|
|
@@ -31,11 +36,20 @@ export declare class UicFormWrapperComponent implements OnInit, OnChanges, OnDes
|
|
|
31
36
|
private formValueSub;
|
|
32
37
|
private readonly optionSourceSubs;
|
|
33
38
|
private readonly optionSourceDependencyValueByField;
|
|
39
|
+
private readonly computedFieldSubs;
|
|
34
40
|
private hasFocusedCurrentTrigger;
|
|
35
41
|
ngOnInit(): void;
|
|
42
|
+
getBlockTitleStyles(index: number): Record<string, string> | null;
|
|
43
|
+
getBlockSubtitleStyles(index: number): Record<string, string> | null;
|
|
36
44
|
ngOnChanges(changes: SimpleChanges): void;
|
|
37
45
|
ngOnDestroy(): void;
|
|
46
|
+
private initializeTypographyStyles;
|
|
47
|
+
private buildTypographyStyles;
|
|
48
|
+
private toValidFontSize;
|
|
49
|
+
private toValidMargin;
|
|
38
50
|
private buildForm;
|
|
51
|
+
private buildRepeaterGroup;
|
|
52
|
+
private repeaterArrayValidator;
|
|
39
53
|
private focusConfiguredField;
|
|
40
54
|
private findFocusableFieldElement;
|
|
41
55
|
private updateDisabledState;
|
|
@@ -45,6 +59,9 @@ export declare class UicFormWrapperComponent implements OnInit, OnChanges, OnDes
|
|
|
45
59
|
private handleFormChange;
|
|
46
60
|
private updateFieldOptions;
|
|
47
61
|
private updateOptionsSources;
|
|
62
|
+
private updateRepeaterSubFieldOptionsSources;
|
|
63
|
+
private resolveRepeaterSubFieldOptionsSource;
|
|
64
|
+
private updateRepeaterSubFieldOptionsState;
|
|
48
65
|
private updateDependentOptionsSources;
|
|
49
66
|
private resolveOptionsSourceField;
|
|
50
67
|
private handleOptionsSourceError;
|
|
@@ -61,6 +78,14 @@ export declare class UicFormWrapperComponent implements OnInit, OnChanges, OnDes
|
|
|
61
78
|
private getValueByPath;
|
|
62
79
|
private safeStringify;
|
|
63
80
|
private clearOptionSourceSubscriptions;
|
|
81
|
+
private clearComputedFieldSubs;
|
|
82
|
+
/**
|
|
83
|
+
* Recalcula todos los campos autocalculados (computeFn o computedSource).
|
|
84
|
+
* Se llama en cada valueChanges y al inicializar el formulario.
|
|
85
|
+
* Usa emitEvent:false para evitar bucles infinitos.
|
|
86
|
+
*/
|
|
87
|
+
private resolveComputedFields;
|
|
88
|
+
private toComputedObservable;
|
|
64
89
|
private collectAllFields;
|
|
65
90
|
updateFieldValue(name: string, value: any): void;
|
|
66
91
|
updateFieldConfig(name: string, config: Omit<FormField, 'name' | 'type'>): void;
|
|
@@ -84,5 +109,5 @@ export declare class UicFormWrapperComponent implements OnInit, OnChanges, OnDes
|
|
|
84
109
|
private setNestedValue;
|
|
85
110
|
private syncEffectiveSchema;
|
|
86
111
|
static ɵfac: i0.ɵɵFactoryDeclaration<UicFormWrapperComponent, never>;
|
|
87
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UicFormWrapperComponent, "ui-form-wrapper", never, { "schema": { "alias": "schema"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "externalData": { "alias": "externalData"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "showButtons": { "alias": "showButtons"; "required": false; }; "fillSelects": { "alias": "fillSelects"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "focusFieldName": { "alias": "focusFieldName"; "required": false; }; "focusFieldTrigger": { "alias": "focusFieldTrigger"; "required": false; }; "fileUidResolverFn": { "alias": "fileUidResolverFn"; "required": false; }; }, { "formSubmit": "formSubmit"; "formChange": "formChange"; "optionsSourceError": "optionsSourceError"; }, never, never, true, never>;
|
|
112
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicFormWrapperComponent, "ui-form-wrapper", never, { "schema": { "alias": "schema"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "externalData": { "alias": "externalData"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; "computedFieldResolver": { "alias": "computedFieldResolver"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "showButtons": { "alias": "showButtons"; "required": false; }; "fillSelects": { "alias": "fillSelects"; "required": false; }; "initialValues": { "alias": "initialValues"; "required": false; }; "focusFieldName": { "alias": "focusFieldName"; "required": false; }; "focusFieldTrigger": { "alias": "focusFieldTrigger"; "required": false; }; "fileUidResolverFn": { "alias": "fileUidResolverFn"; "required": false; }; }, { "formSubmit": "formSubmit"; "formChange": "formChange"; "optionsSourceError": "optionsSourceError"; }, never, never, true, never>;
|
|
88
113
|
}
|
|
@@ -11,11 +11,20 @@ export interface FormStep {
|
|
|
11
11
|
export interface FormSchema {
|
|
12
12
|
cols: number;
|
|
13
13
|
blocks?: FormBlock[];
|
|
14
|
+
titleFontSize?: number;
|
|
15
|
+
subtitleFontSize?: number;
|
|
16
|
+
titleMargin?: number;
|
|
17
|
+
subtitleMargin?: number;
|
|
14
18
|
}
|
|
15
19
|
export interface FormBlock {
|
|
16
20
|
subtitle?: string;
|
|
17
21
|
title?: string;
|
|
22
|
+
message?: string;
|
|
18
23
|
fields: FormField[];
|
|
24
|
+
titleFontSize?: number;
|
|
25
|
+
subtitleFontSize?: number;
|
|
26
|
+
titleMargin?: number;
|
|
27
|
+
subtitleMargin?: number;
|
|
19
28
|
}
|
|
20
29
|
export interface SelectOptionsSource {
|
|
21
30
|
key: string;
|
|
@@ -33,6 +42,21 @@ export interface SelectOptionsContext {
|
|
|
33
42
|
query?: string;
|
|
34
43
|
}
|
|
35
44
|
export type SelectOptionsResolver = (source: SelectOptionsSource, context: SelectOptionsContext) => AppSelectOption[] | unknown[] | Promise<AppSelectOption[] | unknown[]> | Observable<AppSelectOption[] | unknown[]>;
|
|
45
|
+
export interface ComputedFieldSource {
|
|
46
|
+
/** Identificador del cálculo; lo recibe el ComputedFieldResolver del consumidor */
|
|
47
|
+
key: string;
|
|
48
|
+
/** Nombres de los campos del formulario cuyo cambio dispara el recálculo */
|
|
49
|
+
dependsOn: string[];
|
|
50
|
+
}
|
|
51
|
+
export interface ComputedFieldContext {
|
|
52
|
+
field: FormField;
|
|
53
|
+
values: uicFormValuesRecord;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Función provista por el consumidor para resolver campos autocalculados declarativos.
|
|
57
|
+
* Puede retornar el valor directamente, una Promise o un Observable.
|
|
58
|
+
*/
|
|
59
|
+
export type ComputedFieldResolver = (source: ComputedFieldSource, context: ComputedFieldContext) => any | Promise<any> | Observable<any>;
|
|
36
60
|
export interface FormField {
|
|
37
61
|
name: string;
|
|
38
62
|
type: FieldType;
|
|
@@ -83,8 +107,24 @@ export interface FormField {
|
|
|
83
107
|
searchIsEnabledFn?: (item: any) => boolean;
|
|
84
108
|
pattern?: RegExp;
|
|
85
109
|
visibilityRules?: FieldVisibilityRule[] | null;
|
|
110
|
+
/**
|
|
111
|
+
* Opción A (declarativa/serializable): define la clave y dependencias del campo calculado.
|
|
112
|
+
* El wrapper llama a `computedFieldResolver` cuando algún campo de `dependsOn` cambia.
|
|
113
|
+
*/
|
|
114
|
+
computedSource?: ComputedFieldSource;
|
|
115
|
+
/**
|
|
116
|
+
* Opción B (inline): función síncrona que recibe todos los valores del formulario
|
|
117
|
+
* y retorna el valor calculado. No requiere `computedFieldResolver` en el wrapper.
|
|
118
|
+
*/
|
|
119
|
+
computeFn?: (values: uicFormValuesRecord) => any;
|
|
86
120
|
iaValidation?: boolean;
|
|
87
121
|
iaValidationPrompt?: string;
|
|
122
|
+
repeaterFields?: FormField[];
|
|
123
|
+
repeaterMinItems?: number;
|
|
124
|
+
repeaterMaxItems?: number;
|
|
125
|
+
repeaterAddLabel?: string;
|
|
126
|
+
repeaterRemoveLabel?: string;
|
|
127
|
+
repeaterItemTitle?: string;
|
|
88
128
|
}
|
|
89
129
|
export interface FieldVisibilityRule {
|
|
90
130
|
fieldName: string;
|
|
@@ -110,7 +150,7 @@ export declare const VISIBILITY_OPERATOR_OPTIONS: {
|
|
|
110
150
|
text: string;
|
|
111
151
|
}[];
|
|
112
152
|
export declare const FIELDS_CONFIG: FieldConfig[];
|
|
113
|
-
export type FieldType = 'text' | 'number' | 'phone' | 'date' | 'time' | 'select' | 'radio' | 'checkbox' | 'switch' | 'textarea' | 'pool' | 'file' | 'multyselect' | 'searcher' | 'slider';
|
|
153
|
+
export type FieldType = 'text' | 'number' | 'phone' | 'date' | 'time' | 'select' | 'radio' | 'checkbox' | 'switch' | 'textarea' | 'pool' | 'file' | 'multyselect' | 'searcher' | 'slider' | 'repeater';
|
|
114
154
|
export interface FormResult {
|
|
115
155
|
result: boolean;
|
|
116
156
|
form: uicFormValuesRecord | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { FormArray, FormGroup } from '@angular/forms';
|
|
3
|
+
import { FormField } from '../form.models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class UicRepeaterComponent implements OnInit {
|
|
6
|
+
private readonly fb;
|
|
7
|
+
formArray: FormArray;
|
|
8
|
+
field: FormField;
|
|
9
|
+
cols: number;
|
|
10
|
+
error?: string;
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
getGroup(index: number): FormGroup;
|
|
13
|
+
addGroup(): void;
|
|
14
|
+
removeGroup(index: number): void;
|
|
15
|
+
get canAdd(): boolean;
|
|
16
|
+
get canRemove(): boolean;
|
|
17
|
+
private mapValidatorsFromField;
|
|
18
|
+
private getBlankValue;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UicRepeaterComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicRepeaterComponent, "ui-repeater", never, { "formArray": { "alias": "formArray"; "required": true; }; "field": { "alias": "field"; "required": true; }; "cols": { "alias": "cols"; "required": false; }; "error": { "alias": "error"; "required": false; }; }, {}, never, never, true, never>;
|
|
21
|
+
}
|
|
@@ -16,6 +16,10 @@ export declare class UicExcelTableComponent {
|
|
|
16
16
|
resetData(): void;
|
|
17
17
|
private normalizeHeaderFormat;
|
|
18
18
|
private formatHeader;
|
|
19
|
+
private normalizeImportedCellValue;
|
|
20
|
+
private isDateLikeCellFormat;
|
|
21
|
+
private formatParsedDate;
|
|
22
|
+
private formatDate;
|
|
19
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<UicExcelTableComponent, never>;
|
|
20
24
|
static ɵcmp: i0.ɵɵComponentDeclaration<UicExcelTableComponent, "ui-excel-table", never, { "headerFormat": { "alias": "headerFormat"; "required": false; }; "title": { "alias": "title"; "required": false; }; "visibleRowsStep": { "alias": "visibleRowsStep"; "required": false; }; "record": { "alias": "record"; "required": false; }; }, { "recordChange": "recordChange"; }, never, never, true, never>;
|
|
21
25
|
}
|
|
@@ -61,6 +61,8 @@ export declare class UicSelectComponent extends base {
|
|
|
61
61
|
private setInitialActiveOption;
|
|
62
62
|
private resetActiveOption;
|
|
63
63
|
private moveActiveOption;
|
|
64
|
+
private findFirstEnabledOptionIndex;
|
|
65
|
+
private isKeyboardOptionEnabled;
|
|
64
66
|
private scrollActiveOptionIntoView;
|
|
65
67
|
private normalizeText;
|
|
66
68
|
private escapeHtml;
|
|
@@ -73,5 +75,6 @@ export interface AppSelectOption {
|
|
|
73
75
|
detail?: string;
|
|
74
76
|
icon?: string;
|
|
75
77
|
iconColor?: string;
|
|
78
|
+
disabled?: boolean;
|
|
76
79
|
}
|
|
77
80
|
export {};
|
|
@@ -39,6 +39,7 @@ export declare class UicTimePickerComponent extends base {
|
|
|
39
39
|
selectedHour12: number | null;
|
|
40
40
|
selectedMinute: number | null;
|
|
41
41
|
selectedMeridiem: 'am' | 'pm' | null;
|
|
42
|
+
isOverlayOpen: boolean;
|
|
42
43
|
ngOnInit(): void;
|
|
43
44
|
ngOnChanges(changes: SimpleChanges): void;
|
|
44
45
|
private rebuildMinutes;
|
|
@@ -47,6 +48,11 @@ export declare class UicTimePickerComponent extends base {
|
|
|
47
48
|
private syncSelectionFromValue;
|
|
48
49
|
openOverlay(): void;
|
|
49
50
|
closeOverlay(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Cierra explícitamente el overlay desde el botón confirmar.
|
|
53
|
+
* Comitea la selección actual antes de cerrar.
|
|
54
|
+
*/
|
|
55
|
+
confirmAndClose(): void;
|
|
50
56
|
pickHour(hour: number): void;
|
|
51
57
|
pickMinute(minute: number): void;
|
|
52
58
|
pickMeridiem(meridiem: 'am' | 'pm'): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
2
2
|
import { EditableBlock, EditableField } from '../user-formbuilder.component';
|
|
3
|
-
import { FieldConfig } from '../../dynamic-form/form.models';
|
|
3
|
+
import { FieldConfig, FieldType } from '../../dynamic-form/form.models';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class BlockEditorComponent {
|
|
6
6
|
block: import("@angular/core").InputSignal<EditableBlock>;
|
|
@@ -8,9 +8,25 @@ export declare class BlockEditorComponent {
|
|
|
8
8
|
addFieldRequest: import("@angular/core").OutputEmitterRef<FieldConfig>;
|
|
9
9
|
deleteBlock: import("@angular/core").OutputEmitterRef<string>;
|
|
10
10
|
notifySelectedField: import("@angular/core").OutputEmitterRef<EditableField | null>;
|
|
11
|
+
notifySelectedSubField: import("@angular/core").OutputEmitterRef<{
|
|
12
|
+
parentCode: string;
|
|
13
|
+
subField: EditableField;
|
|
14
|
+
} | null>;
|
|
11
15
|
selectedFieldId: string | null;
|
|
16
|
+
selectedSubFieldCode: string | null;
|
|
12
17
|
visibilityParentFieldCodes: Set<string>;
|
|
18
|
+
excludeSubFieldTypes: FieldType[];
|
|
19
|
+
private expandedRepeaters;
|
|
20
|
+
isRepeaterExpanded(code: string): boolean;
|
|
21
|
+
toggleRepeater(code: string, event: Event): void;
|
|
22
|
+
isRepeaterParentSelected(field: EditableField): boolean;
|
|
13
23
|
selectField(field: EditableField): void;
|
|
24
|
+
onSelectSubField(parentCode: string, subField: EditableField, event: Event): void;
|
|
25
|
+
addSubField(parentCode: string, type: FieldConfig): void;
|
|
26
|
+
deleteSubField(parentCode: string, sfCode: string, event: Event): void;
|
|
27
|
+
reorderSubFields(parentCode: string, event: CdkDragDrop<EditableField[]>): void;
|
|
28
|
+
private updateSubFields;
|
|
29
|
+
private generateSubFieldCode;
|
|
14
30
|
changeTitle(newTitle: string): void;
|
|
15
31
|
changeSubtitle(newSubtitle: string): void;
|
|
16
32
|
addField(newFieldType: FieldConfig): void;
|
|
@@ -20,5 +36,5 @@ export declare class BlockEditorComponent {
|
|
|
20
36
|
isBlockVisibilityParent(): boolean;
|
|
21
37
|
reorderFields(event: CdkDragDrop<EditableField[]>): void;
|
|
22
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<BlockEditorComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BlockEditorComponent, "lib-block-editor", never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "selectedFieldId": { "alias": "selectedFieldId"; "required": false; }; "visibilityParentFieldCodes": { "alias": "visibilityParentFieldCodes"; "required": false; }; }, { "blockChange": "blockChange"; "addFieldRequest": "addFieldRequest"; "deleteBlock": "deleteBlock"; "notifySelectedField": "notifySelectedField"; }, never, never, true, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BlockEditorComponent, "lib-block-editor", never, { "block": { "alias": "block"; "required": false; "isSignal": true; }; "selectedFieldId": { "alias": "selectedFieldId"; "required": false; }; "selectedSubFieldCode": { "alias": "selectedSubFieldCode"; "required": false; }; "visibilityParentFieldCodes": { "alias": "visibilityParentFieldCodes"; "required": false; }; }, { "blockChange": "blockChange"; "addFieldRequest": "addFieldRequest"; "deleteBlock": "deleteBlock"; "notifySelectedField": "notifySelectedField"; "notifySelectedSubField": "notifySelectedSubField"; }, never, never, true, never>;
|
|
24
40
|
}
|
package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts
CHANGED
|
@@ -9,10 +9,14 @@ export declare class FieldEditorComponent {
|
|
|
9
9
|
hasOptions: import("@angular/core").Signal<boolean>;
|
|
10
10
|
hasOptionsSourceConfig: import("@angular/core").Signal<boolean>;
|
|
11
11
|
hasExternalOptionsSource: import("@angular/core").Signal<boolean>;
|
|
12
|
+
isRepeater: import("@angular/core").Signal<boolean>;
|
|
12
13
|
config: import("@angular/core").InputSignal<EditableField>;
|
|
13
14
|
focusRequiredField: import("@angular/core").InputSignal<boolean>;
|
|
15
|
+
isSubField: import("@angular/core").InputSignal<boolean>;
|
|
14
16
|
options: import("@angular/core").InputSignal<Record<string, AppSelectOption[]>>;
|
|
15
17
|
hiddenSections: import("@angular/core").WritableSignal<string[]>;
|
|
18
|
+
editingRuleIndex: import("@angular/core").WritableSignal<number>;
|
|
19
|
+
isAddingNewRule: import("@angular/core").WritableSignal<boolean>;
|
|
16
20
|
fieldChange: import("@angular/core").OutputEmitterRef<FormField>;
|
|
17
21
|
localField: import("@angular/core").WritableSignal<FormField>;
|
|
18
22
|
requiredFields: FormField[];
|
|
@@ -28,7 +32,11 @@ export declare class FieldEditorComponent {
|
|
|
28
32
|
private scrollPropertiesToTop;
|
|
29
33
|
updateRuleValue(fr: uicFormValuesRecord): void;
|
|
30
34
|
addRule(): void;
|
|
31
|
-
|
|
35
|
+
startEditingRule(index: number): void;
|
|
36
|
+
confirmEditingRule(): void;
|
|
37
|
+
cancelEditingRule(): void;
|
|
38
|
+
removeRule(index: number): void;
|
|
39
|
+
private clearDraftRule;
|
|
32
40
|
updateFieldValues(fr: uicFormValuesRecord): void;
|
|
33
41
|
updateOptions(options: AppSelectOption[]): void;
|
|
34
42
|
private getDependencyFieldLabel;
|
|
@@ -44,8 +52,7 @@ export declare class FieldEditorComponent {
|
|
|
44
52
|
private getDependencyFieldType;
|
|
45
53
|
private getBranchValueFieldType;
|
|
46
54
|
private ruleToBranchValues;
|
|
47
|
-
private clearCurrentVisibilityRule;
|
|
48
55
|
private isValueLessVisibilityOperator;
|
|
49
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldEditorComponent, never>;
|
|
50
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FieldEditorComponent, "lib-field-editor", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "focusRequiredField": { "alias": "focusRequiredField"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "fieldChange": "fieldChange"; }, never, never, true, never>;
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldEditorComponent, "lib-field-editor", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "focusRequiredField": { "alias": "focusRequiredField"; "required": false; "isSignal": true; }; "isSubField": { "alias": "isSubField"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "fieldChange": "fieldChange"; }, never, never, true, never>;
|
|
51
58
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FieldConfig } from '../../../dynamic-form/form.models';
|
|
1
|
+
import { FieldConfig, FieldType } from '../../../dynamic-form/form.models';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class FieldTypeSelectorComponent {
|
|
4
|
-
|
|
4
|
+
excludeTypes: import("@angular/core").InputSignal<FieldType[]>;
|
|
5
|
+
types: import("@angular/core").Signal<FieldConfig[]>;
|
|
5
6
|
selectType: import("@angular/core").OutputEmitterRef<FieldConfig>;
|
|
6
7
|
addField(type: FieldConfig): void;
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldTypeSelectorComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FieldTypeSelectorComponent, "lib-field-type-selector", never, {}, { "selectType": "selectType"; }, never, never, true, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldTypeSelectorComponent, "lib-field-type-selector", never, { "excludeTypes": { "alias": "excludeTypes"; "required": false; "isSignal": true; }; }, { "selectType": "selectType"; }, never, never, true, never>;
|
|
9
10
|
}
|
|
@@ -8,6 +8,7 @@ export type EditableField = {
|
|
|
8
8
|
type?: string;
|
|
9
9
|
field?: FieldConfig;
|
|
10
10
|
fieldData: FormField;
|
|
11
|
+
repeaterSubFields?: EditableField[];
|
|
11
12
|
};
|
|
12
13
|
export type EditableBlock = {
|
|
13
14
|
id?: number | null;
|
|
@@ -39,6 +40,10 @@ export declare class UicUserFormbuilderComponent {
|
|
|
39
40
|
editingSnapshot: import("@angular/core").WritableSignal<EditableForm | null>;
|
|
40
41
|
isReadOnly: import("@angular/core").WritableSignal<boolean>;
|
|
41
42
|
selectedField: import("@angular/core").WritableSignal<EditableField | null>;
|
|
43
|
+
editingSubField: import("@angular/core").WritableSignal<{
|
|
44
|
+
parentCode: string;
|
|
45
|
+
subField: EditableField;
|
|
46
|
+
} | null>;
|
|
42
47
|
focusNewFieldCode: import("@angular/core").WritableSignal<string | null>;
|
|
43
48
|
propertiesWidth: import("@angular/core").WritableSignal<number>;
|
|
44
49
|
previewSchema: import("@angular/core").Signal<FormSchema>;
|
|
@@ -52,6 +57,11 @@ export declare class UicUserFormbuilderComponent {
|
|
|
52
57
|
deleteBlock(code: string): void;
|
|
53
58
|
addField(blockCode: string, newFieldType: FieldConfig): void;
|
|
54
59
|
selectField(field: EditableField | null): void;
|
|
60
|
+
onSelectSubField(event: {
|
|
61
|
+
parentCode: string;
|
|
62
|
+
subField: EditableField;
|
|
63
|
+
} | null): void;
|
|
64
|
+
onSubFieldChange(updatedFieldData: FormField): void;
|
|
55
65
|
startPropertiesResize(event: MouseEvent): void;
|
|
56
66
|
onPropertiesResize(event: MouseEvent): void;
|
|
57
67
|
stopPropertiesResize(): void;
|
|
@@ -56,6 +56,7 @@ export declare const DICTIONARY_EN: {
|
|
|
56
56
|
};
|
|
57
57
|
readonly time_picker: {
|
|
58
58
|
readonly placeholder: "hh:mm am/pm";
|
|
59
|
+
readonly confirm: "Confirm";
|
|
59
60
|
};
|
|
60
61
|
readonly excel_table: {
|
|
61
62
|
readonly load_file: "Upload excel";
|
|
@@ -213,7 +214,7 @@ export declare const DICTIONARY_EN: {
|
|
|
213
214
|
readonly monthMode: "Month mode";
|
|
214
215
|
readonly monthMode_tip: "Select a month date";
|
|
215
216
|
readonly monthDay: "Month day";
|
|
216
|
-
readonly monthDay_tip: "
|
|
217
|
+
readonly monthDay_tip: "To save in DB";
|
|
217
218
|
readonly minDate: "Minimum date";
|
|
218
219
|
readonly minDate_tip: "Earliest allowed date";
|
|
219
220
|
readonly maxDate: "Maximum date";
|
|
@@ -258,6 +259,13 @@ export declare const DICTIONARY_EN: {
|
|
|
258
259
|
readonly selectSearchEnabled_tip: "Enables search among options";
|
|
259
260
|
readonly selectNullable: "Allow empty option";
|
|
260
261
|
readonly selectSearchEnabled: "Enable search";
|
|
262
|
+
readonly repeaterMinItems: "Minimum items";
|
|
263
|
+
readonly repeaterMinItems_tip: "Minimum number of required items";
|
|
264
|
+
readonly repeaterMaxItems: "Maximum items";
|
|
265
|
+
readonly repeaterMaxItems_tip: "Maximum number of allowed items";
|
|
266
|
+
readonly repeaterAddLabel: "Add button label";
|
|
267
|
+
readonly repeaterRemoveLabel: "Remove button label";
|
|
268
|
+
readonly repeaterItemTitle: "Item title";
|
|
261
269
|
};
|
|
262
270
|
readonly options_editor: {
|
|
263
271
|
readonly title: "Options";
|
|
@@ -269,9 +277,11 @@ export declare const DICTIONARY_EN: {
|
|
|
269
277
|
};
|
|
270
278
|
readonly field_editor: {
|
|
271
279
|
readonly dependency_title: "Dependency";
|
|
272
|
-
readonly dependency_description: "This field is shown only if
|
|
280
|
+
readonly dependency_description: "This field is shown only if all rules are met:";
|
|
273
281
|
readonly add_relation: "Add relation";
|
|
274
282
|
readonly remove_relation: "Remove relation";
|
|
283
|
+
readonly cancel: "Cancel";
|
|
284
|
+
readonly save: "Save";
|
|
275
285
|
readonly basic: "Basic";
|
|
276
286
|
readonly parent: "Parent";
|
|
277
287
|
readonly operator: "Operator";
|
|
@@ -283,6 +293,7 @@ export declare const DICTIONARY_EN: {
|
|
|
283
293
|
readonly delete: "Delete";
|
|
284
294
|
readonly show_advanced: "Show advanced";
|
|
285
295
|
readonly hide_advanced: "Hide advanced";
|
|
296
|
+
readonly subfields: "Sub-fields";
|
|
286
297
|
};
|
|
287
298
|
readonly visibility_operators: {
|
|
288
299
|
readonly equals: "Equals";
|
|
@@ -298,6 +309,10 @@ export declare const DICTIONARY_EN: {
|
|
|
298
309
|
readonly duplicate_identifier: "The identifier \"{{identifier}}\" is used more than once.";
|
|
299
310
|
readonly duplicate_identifier_title: "Validation error";
|
|
300
311
|
};
|
|
312
|
+
readonly repeater: {
|
|
313
|
+
readonly no_subfields: "No sub-fields yet. Add one below.";
|
|
314
|
+
readonly add_subfield: "Add sub-field";
|
|
315
|
+
};
|
|
301
316
|
};
|
|
302
317
|
readonly validation: {
|
|
303
318
|
readonly invalid: "{{field}} is invalid.";
|
|
@@ -56,6 +56,7 @@ export declare const DICTIONARY_ES: {
|
|
|
56
56
|
};
|
|
57
57
|
readonly time_picker: {
|
|
58
58
|
readonly placeholder: "hh:mm am/pm";
|
|
59
|
+
readonly confirm: "Confirmar";
|
|
59
60
|
};
|
|
60
61
|
readonly excel_table: {
|
|
61
62
|
readonly load_file: "Cargar excel";
|
|
@@ -213,7 +214,7 @@ export declare const DICTIONARY_ES: {
|
|
|
213
214
|
readonly monthMode: "Modo mes";
|
|
214
215
|
readonly monthMode_tip: "Seleccionar fecha por mes";
|
|
215
216
|
readonly monthDay: "Día del mes";
|
|
216
|
-
readonly monthDay_tip: "Elegir
|
|
217
|
+
readonly monthDay_tip: "Elegir Para guardar en BBDD";
|
|
217
218
|
readonly minDate: "Fecha mínima";
|
|
218
219
|
readonly minDate_tip: "Fecha mínima permitida";
|
|
219
220
|
readonly maxDate: "Fecha máxima";
|
|
@@ -258,6 +259,13 @@ export declare const DICTIONARY_ES: {
|
|
|
258
259
|
readonly selectSearchEnabled_tip: "Habilita búsqueda entre opciones";
|
|
259
260
|
readonly selectNullable: "Permitir opción vacía";
|
|
260
261
|
readonly selectSearchEnabled: "Habilitar búsqueda";
|
|
262
|
+
readonly repeaterMinItems: "Mínimo de ítems";
|
|
263
|
+
readonly repeaterMinItems_tip: "Cantidad mínima de ítems requerida";
|
|
264
|
+
readonly repeaterMaxItems: "Máximo de ítems";
|
|
265
|
+
readonly repeaterMaxItems_tip: "Cantidad máxima de ítems permitida";
|
|
266
|
+
readonly repeaterAddLabel: "Etiqueta del botón agregar";
|
|
267
|
+
readonly repeaterRemoveLabel: "Etiqueta del botón eliminar";
|
|
268
|
+
readonly repeaterItemTitle: "Título de ítem";
|
|
261
269
|
};
|
|
262
270
|
readonly options_editor: {
|
|
263
271
|
readonly title: "Opciones";
|
|
@@ -269,9 +277,11 @@ export declare const DICTIONARY_ES: {
|
|
|
269
277
|
};
|
|
270
278
|
readonly field_editor: {
|
|
271
279
|
readonly dependency_title: "Dependencia";
|
|
272
|
-
readonly dependency_description: "Este campo solo se muestra si se
|
|
280
|
+
readonly dependency_description: "Este campo solo se muestra si se cumplen todas las reglas:";
|
|
273
281
|
readonly add_relation: "Agregar relación";
|
|
274
282
|
readonly remove_relation: "Eliminar relación";
|
|
283
|
+
readonly cancel: "Cancelar";
|
|
284
|
+
readonly save: "Guardar";
|
|
275
285
|
readonly basic: "Básico";
|
|
276
286
|
readonly parent: "Padre";
|
|
277
287
|
readonly operator: "Operador";
|
|
@@ -283,6 +293,7 @@ export declare const DICTIONARY_ES: {
|
|
|
283
293
|
readonly delete: "Eliminar";
|
|
284
294
|
readonly show_advanced: "Mostrar avanzado";
|
|
285
295
|
readonly hide_advanced: "Ocultar avanzado";
|
|
296
|
+
readonly subfields: "Sub-campos";
|
|
286
297
|
};
|
|
287
298
|
readonly visibility_operators: {
|
|
288
299
|
readonly equals: "Es igual a";
|
|
@@ -298,6 +309,10 @@ export declare const DICTIONARY_ES: {
|
|
|
298
309
|
readonly duplicate_identifier: "El identificador \"{{identifier}}\" se está usando más de una vez.";
|
|
299
310
|
readonly duplicate_identifier_title: "Error de validación";
|
|
300
311
|
};
|
|
312
|
+
readonly repeater: {
|
|
313
|
+
readonly no_subfields: "Sin sub-campos. Añade uno abajo.";
|
|
314
|
+
readonly add_subfield: "Agregar sub-campo";
|
|
315
|
+
};
|
|
301
316
|
};
|
|
302
317
|
readonly validation: {
|
|
303
318
|
readonly invalid: "{{field}} es invalido.";
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from './lib/components/tag-selector/tag-selector.component';
|
|
|
40
40
|
export * from './lib/components/progress-bar/progress-bar.component';
|
|
41
41
|
export * from './lib/animations/animatios.index';
|
|
42
42
|
export * from './lib/components/dynamic-form/form.models';
|
|
43
|
+
export * from './lib/components/dynamic-form/repeater/repeater.component';
|
|
43
44
|
export * from './lib/components/user-formbuilder/user-formbuilder.component';
|
|
44
45
|
export * from './lib/components/rule-builder/rule-builder.component';
|
|
45
46
|
export * from './lib/services/modal.service';
|