ui-core-abv 0.7.2 → 0.7.5
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 +144 -37
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/components/dynamic-form/form/dynamic-form.component.d.ts +1 -1
- package/lib/components/dynamic-form/form-wrapper/form-wrapper.component.d.ts +1 -1
- package/lib/components/dynamic-form/form.models.d.ts +2 -1
- package/lib/components/dynamic-form/repeater/repeater.component.d.ts +2 -1
- package/lib/components/inputs/file-input/file-input.component.d.ts +1 -1
- package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts +3 -0
- package/lib/components/user-formbuilder/form-preview/form-preview.component.d.ts +4 -1
- package/lib/components/user-formbuilder/user-formbuilder.component.d.ts +17 -2
- package/lib/helpers.d.ts +11 -2
- package/lib/translate/dictionary.en.d.ts +10 -0
- package/lib/translate/dictionary.es.d.ts +10 -0
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ export declare class UicDynamicFormComponent implements OnDestroy {
|
|
|
33
33
|
get disabled(): boolean;
|
|
34
34
|
voiceToTextSilenceMs: number;
|
|
35
35
|
cols: number;
|
|
36
|
-
fileUidResolverFn?: (fileUid: string) => void;
|
|
36
|
+
fileUidResolverFn?: (fileUid: string, fileName: string, fieldLabel: string) => void;
|
|
37
37
|
selectOptionsResolver?: SelectOptionsResolver;
|
|
38
38
|
listeningField: string | null;
|
|
39
39
|
readonly fieldStates: import("@angular/core").Signal<DynamicFieldState[]>;
|
|
@@ -25,7 +25,7 @@ export declare class UicFormWrapperComponent implements OnInit, OnChanges, OnDes
|
|
|
25
25
|
initialValues: uicFormValuesRecord;
|
|
26
26
|
focusFieldName: string | null;
|
|
27
27
|
focusFieldTrigger: unknown;
|
|
28
|
-
fileUidResolverFn?: (fileUid: string) => void;
|
|
28
|
+
fileUidResolverFn?: (fileUid: string, fileName: string, fieldLabel: string) => void;
|
|
29
29
|
formSubmit: EventEmitter<FormResult>;
|
|
30
30
|
formChange: EventEmitter<uicFormValuesRecord>;
|
|
31
31
|
optionsSourceError: EventEmitter<{
|
|
@@ -150,12 +150,13 @@ export declare const VISIBILITY_OPERATOR_OPTIONS: {
|
|
|
150
150
|
text: string;
|
|
151
151
|
}[];
|
|
152
152
|
export declare const FIELDS_CONFIG: FieldConfig[];
|
|
153
|
-
export type FieldType = 'text' | 'number' | 'phone' | 'date' | 'time' | 'select' | 'radio' | 'checkbox' | 'switch' | 'textarea' | 'pool' | 'file' | 'multyselect' | 'searcher' | 'slider' | 'repeater';
|
|
153
|
+
export type FieldType = 'text' | 'number' | 'phone' | 'date' | 'time' | 'select' | 'radio' | 'checkbox' | 'switch' | 'textarea' | 'pool' | 'file' | 'multyselect' | 'searcher' | 'slider' | 'repeater' | 'computed';
|
|
154
154
|
export interface FormResult {
|
|
155
155
|
result: boolean;
|
|
156
156
|
form: uicFormValuesRecord | null;
|
|
157
157
|
}
|
|
158
158
|
export type uicFormValuesRecord = Record<string, any>;
|
|
159
|
+
export declare const COMPUTED_FORM_FIELDS: FormField[];
|
|
159
160
|
export declare const BASE_FORM_FIELDS: FormField[];
|
|
160
161
|
export declare const LAYOUT_FORM_FIELDS: FormField[];
|
|
161
162
|
export declare const EXTRA_FORM_FIELDS: FormField[];
|
|
@@ -8,6 +8,7 @@ export declare class UicRepeaterComponent implements OnInit {
|
|
|
8
8
|
field: FormField;
|
|
9
9
|
cols: number;
|
|
10
10
|
error?: string;
|
|
11
|
+
fileUidResolverFn?: (fileUid: string, fileName: string, fieldLabel: string) => void;
|
|
11
12
|
ngOnInit(): void;
|
|
12
13
|
getGroup(index: number): FormGroup;
|
|
13
14
|
addGroup(): void;
|
|
@@ -17,5 +18,5 @@ export declare class UicRepeaterComponent implements OnInit {
|
|
|
17
18
|
private mapValidatorsFromField;
|
|
18
19
|
private getBlankValue;
|
|
19
20
|
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
|
+
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; }; "fileUidResolverFn": { "alias": "fileUidResolverFn"; "required": false; }; }, {}, never, never, true, never>;
|
|
21
22
|
}
|
|
@@ -30,7 +30,7 @@ export declare class UicFileInputComponent extends base {
|
|
|
30
30
|
loading: boolean;
|
|
31
31
|
multy: boolean;
|
|
32
32
|
fileTypes: string[] | string | null;
|
|
33
|
-
fileUidResolverFn?: (fileUid: string) => void;
|
|
33
|
+
fileUidResolverFn?: (fileUid: string, fileName: string, fieldLabel: string) => void;
|
|
34
34
|
private fileInput?;
|
|
35
35
|
private readonly push;
|
|
36
36
|
value: UicFileInputValue[];
|
package/lib/components/user-formbuilder/block-editor/field-editor/field-editor.component.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare class FieldEditorComponent {
|
|
|
10
10
|
hasOptionsSourceConfig: import("@angular/core").Signal<boolean>;
|
|
11
11
|
hasExternalOptionsSource: import("@angular/core").Signal<boolean>;
|
|
12
12
|
isRepeater: import("@angular/core").Signal<boolean>;
|
|
13
|
+
isComputed: import("@angular/core").Signal<boolean>;
|
|
13
14
|
config: import("@angular/core").InputSignal<EditableField>;
|
|
14
15
|
focusRequiredField: import("@angular/core").InputSignal<boolean>;
|
|
15
16
|
isSubField: import("@angular/core").InputSignal<boolean>;
|
|
@@ -21,6 +22,7 @@ export declare class FieldEditorComponent {
|
|
|
21
22
|
localField: import("@angular/core").WritableSignal<FormField>;
|
|
22
23
|
requiredFields: FormField[];
|
|
23
24
|
optionsSourceFields: import("@angular/core").Signal<FormField[]>;
|
|
25
|
+
computedSourceFields: import("@angular/core").Signal<FormField[]>;
|
|
24
26
|
advancedFields: import("@angular/core").Signal<FormField[]>;
|
|
25
27
|
styleFields: import("@angular/core").Signal<FormField[]>;
|
|
26
28
|
branchDraftValues: import("@angular/core").WritableSignal<uicFormValuesRecord>;
|
|
@@ -53,6 +55,7 @@ export declare class FieldEditorComponent {
|
|
|
53
55
|
private getBranchValueFieldType;
|
|
54
56
|
private ruleToBranchValues;
|
|
55
57
|
private isValueLessVisibilityOperator;
|
|
58
|
+
private buildComputedSourceFields;
|
|
56
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldEditorComponent, never>;
|
|
57
60
|
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>;
|
|
58
61
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { FormResult, FormSchema, SelectOptionsResolver } from '../../dynamic-form/form.models';
|
|
1
|
+
import { ComputedFieldResolver, FormResult, FormSchema, SelectOptionsResolver } from '../../dynamic-form/form.models';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class FormPreviewComponent {
|
|
4
4
|
data: {
|
|
5
5
|
schema: FormSchema;
|
|
6
6
|
selectOptionsResolver?: SelectOptionsResolver;
|
|
7
|
+
computedFieldResolver?: ComputedFieldResolver;
|
|
7
8
|
};
|
|
8
9
|
schema: FormSchema;
|
|
9
10
|
selectOptionsResolver?: SelectOptionsResolver;
|
|
11
|
+
computedFieldResolver?: ComputedFieldResolver;
|
|
10
12
|
constructor(data: {
|
|
11
13
|
schema: FormSchema;
|
|
12
14
|
selectOptionsResolver?: SelectOptionsResolver;
|
|
15
|
+
computedFieldResolver?: ComputedFieldResolver;
|
|
13
16
|
});
|
|
14
17
|
save(fr: FormResult): void;
|
|
15
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormPreviewComponent, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldConfig, FormField, FormSchema, SelectOptionsResolver } from '../dynamic-form/form.models';
|
|
1
|
+
import { FieldConfig, FormField, FormSchema, SelectOptionsResolver, ComputedFieldResolver } from '../dynamic-form/form.models';
|
|
2
2
|
import { AppSelectOption } from '../inputs/select/select.component';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export type EditableField = {
|
|
@@ -21,6 +21,10 @@ export type EditableBlock = {
|
|
|
21
21
|
export type EditableForm = {
|
|
22
22
|
cols: number;
|
|
23
23
|
blocks: EditableBlock[];
|
|
24
|
+
titleFontSize?: number;
|
|
25
|
+
subtitleFontSize?: number;
|
|
26
|
+
titleMargin?: number;
|
|
27
|
+
subtitleMargin?: number;
|
|
24
28
|
};
|
|
25
29
|
export declare class UicUserFormbuilderComponent {
|
|
26
30
|
private readonly modalService;
|
|
@@ -29,13 +33,20 @@ export declare class UicUserFormbuilderComponent {
|
|
|
29
33
|
disabled: boolean;
|
|
30
34
|
formTitle: string;
|
|
31
35
|
optionSources: AppSelectOption[];
|
|
36
|
+
computedSources: AppSelectOption[];
|
|
32
37
|
selectOptionsResolver?: SelectOptionsResolver;
|
|
38
|
+
computedFieldResolver?: ComputedFieldResolver;
|
|
33
39
|
readOnly: import("@angular/core").InputSignal<boolean>;
|
|
34
40
|
editableFormInput: import("@angular/core").InputSignal<EditableForm>;
|
|
35
41
|
submitFormRequest: import("@angular/core").OutputEmitterRef<EditableForm>;
|
|
36
42
|
nextBlockId: number;
|
|
37
43
|
nextFieldId: number;
|
|
38
44
|
editableCols: import("@angular/core").WritableSignal<number>;
|
|
45
|
+
editableTitleFontSize: import("@angular/core").WritableSignal<number | null>;
|
|
46
|
+
editableSubtitleFontSize: import("@angular/core").WritableSignal<number | null>;
|
|
47
|
+
editableTitleMargin: import("@angular/core").WritableSignal<number | null>;
|
|
48
|
+
editableSubtitleMargin: import("@angular/core").WritableSignal<number | null>;
|
|
49
|
+
headerRowExpanded: import("@angular/core").WritableSignal<boolean>;
|
|
39
50
|
editableBlocks: import("@angular/core").WritableSignal<EditableBlock[]>;
|
|
40
51
|
editingSnapshot: import("@angular/core").WritableSignal<EditableForm | null>;
|
|
41
52
|
isReadOnly: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -80,5 +91,9 @@ export declare class UicUserFormbuilderComponent {
|
|
|
80
91
|
private prepareFieldDataForSubmit;
|
|
81
92
|
private deepClone;
|
|
82
93
|
static ɵfac: i0.ɵɵFactoryDeclaration<UicUserFormbuilderComponent, never>;
|
|
83
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UicUserFormbuilderComponent, "ui-user-formbuilder", never, { "disabled": { "alias": "disabled"; "required": false; }; "formTitle": { "alias": "formTitle"; "required": false; }; "optionSources": { "alias": "optionSources"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "editableFormInput": { "alias": "editableForm"; "required": false; "isSignal": true; }; }, { "submitFormRequest": "submitFormRequest"; }, never, never, true, never>;
|
|
94
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UicUserFormbuilderComponent, "ui-user-formbuilder", never, { "disabled": { "alias": "disabled"; "required": false; }; "formTitle": { "alias": "formTitle"; "required": false; }; "optionSources": { "alias": "optionSources"; "required": false; }; "computedSources": { "alias": "computedSources"; "required": false; }; "selectOptionsResolver": { "alias": "selectOptionsResolver"; "required": false; }; "computedFieldResolver": { "alias": "computedFieldResolver"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "editableFormInput": { "alias": "editableForm"; "required": false; "isSignal": true; }; }, { "submitFormRequest": "submitFormRequest"; }, never, never, true, never>;
|
|
95
|
+
}
|
|
96
|
+
export interface ComputedSourceOption {
|
|
97
|
+
id: string | number;
|
|
98
|
+
text: string;
|
|
84
99
|
}
|
package/lib/helpers.d.ts
CHANGED
|
@@ -2,7 +2,16 @@ import { EditableBlock, FormBlock, TableColums, TableRowData } from "../public-a
|
|
|
2
2
|
export declare function helperTableMapDatoToColums(data: Record<string, any>, headers: TableColums[]): TableRowData[];
|
|
3
3
|
export declare function helperFormMapFormdataToObject<T extends object>(formData: Record<string, any>, defaults: T): T;
|
|
4
4
|
export declare function isMobile(): boolean;
|
|
5
|
-
export declare function helperShowFormFromBuilder(blocks: EditableBlock[], cols: number, editable?: boolean
|
|
6
|
-
|
|
5
|
+
export declare function helperShowFormFromBuilder(blocks: EditableBlock[], cols: number, editable?: boolean, schemaOptions?: {
|
|
6
|
+
titleFontSize?: number;
|
|
7
|
+
subtitleFontSize?: number;
|
|
8
|
+
titleMargin?: number;
|
|
9
|
+
subtitleMargin?: number;
|
|
10
|
+
}): {
|
|
7
11
|
blocks: FormBlock[];
|
|
12
|
+
titleFontSize?: number;
|
|
13
|
+
subtitleFontSize?: number;
|
|
14
|
+
titleMargin?: number;
|
|
15
|
+
subtitleMargin?: number;
|
|
16
|
+
cols: number;
|
|
8
17
|
};
|
|
@@ -266,6 +266,10 @@ export declare const DICTIONARY_EN: {
|
|
|
266
266
|
readonly repeaterAddLabel: "Add button label";
|
|
267
267
|
readonly repeaterRemoveLabel: "Remove button label";
|
|
268
268
|
readonly repeaterItemTitle: "Item title";
|
|
269
|
+
readonly computedSourceKey: "Calculation key";
|
|
270
|
+
readonly computedSourceKey_tip: "Identifier the consumer resolver will receive";
|
|
271
|
+
readonly computedSourceDependsOn: "Depends on";
|
|
272
|
+
readonly computedSourceDependsOn_tip: "Fields whose change triggers recalculation";
|
|
269
273
|
};
|
|
270
274
|
readonly options_editor: {
|
|
271
275
|
readonly title: "Options";
|
|
@@ -313,6 +317,12 @@ export declare const DICTIONARY_EN: {
|
|
|
313
317
|
readonly no_subfields: "No sub-fields yet. Add one below.";
|
|
314
318
|
readonly add_subfield: "Add sub-field";
|
|
315
319
|
};
|
|
320
|
+
readonly schema: {
|
|
321
|
+
readonly title_font_size: "Title size";
|
|
322
|
+
readonly subtitle_font_size: "Subtitle size";
|
|
323
|
+
readonly title_margin: "Title margin";
|
|
324
|
+
readonly subtitle_margin: "Subtitle margin";
|
|
325
|
+
};
|
|
316
326
|
};
|
|
317
327
|
readonly validation: {
|
|
318
328
|
readonly invalid: "{{field}} is invalid.";
|
|
@@ -266,6 +266,10 @@ export declare const DICTIONARY_ES: {
|
|
|
266
266
|
readonly repeaterAddLabel: "Etiqueta del botón agregar";
|
|
267
267
|
readonly repeaterRemoveLabel: "Etiqueta del botón eliminar";
|
|
268
268
|
readonly repeaterItemTitle: "Título de ítem";
|
|
269
|
+
readonly computedSourceKey: "Clave de cálculo";
|
|
270
|
+
readonly computedSourceKey_tip: "Identificador que recibirá el resolver del consumidor";
|
|
271
|
+
readonly computedSourceDependsOn: "Depende de";
|
|
272
|
+
readonly computedSourceDependsOn_tip: "Campos cuyo cambio dispara el recálculo";
|
|
269
273
|
};
|
|
270
274
|
readonly options_editor: {
|
|
271
275
|
readonly title: "Opciones";
|
|
@@ -313,6 +317,12 @@ export declare const DICTIONARY_ES: {
|
|
|
313
317
|
readonly no_subfields: "Sin sub-campos. Añade uno abajo.";
|
|
314
318
|
readonly add_subfield: "Agregar sub-campo";
|
|
315
319
|
};
|
|
320
|
+
readonly schema: {
|
|
321
|
+
readonly title_font_size: "Tamaño título";
|
|
322
|
+
readonly subtitle_font_size: "Tamaño subtítulo";
|
|
323
|
+
readonly title_margin: "Margen título";
|
|
324
|
+
readonly subtitle_margin: "Margen subtítulo";
|
|
325
|
+
};
|
|
316
326
|
};
|
|
317
327
|
readonly validation: {
|
|
318
328
|
readonly invalid: "{{field}} es invalido.";
|