@stemy/ngx-dynamic-form 19.8.13 → 19.8.15
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/stemy-ngx-dynamic-form.mjs +27 -12
- package/fesm2022/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +9 -2
- package/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.d.ts +7 -3
- package/ngx-dynamic-form/services/dynamic-form.service.d.ts +2 -2
- package/ngx-dynamic-form/utils/internal.d.ts +1 -0
- package/ngx-dynamic-form/utils/misc.d.ts +1 -0
- package/package.json +3 -3
- package/public_api.d.ts +1 -1
|
@@ -188,6 +188,7 @@ export interface FormFieldConfig<T = FormFieldProps> extends FormlyFieldConfig<T
|
|
|
188
188
|
serialize?: FormFieldConditionFn;
|
|
189
189
|
serializer?: FormFieldSerializer;
|
|
190
190
|
fieldSet?: string;
|
|
191
|
+
purposes?: string[];
|
|
191
192
|
asFieldSet?: boolean;
|
|
192
193
|
priority?: number;
|
|
193
194
|
fieldGroup?: FormFieldConfig[];
|
|
@@ -230,9 +231,11 @@ export interface IDynamicForm {
|
|
|
230
231
|
readonly group: Signal<FormGroup>;
|
|
231
232
|
readonly status: Signal<DynamicFormStatus>;
|
|
232
233
|
readonly onSubmit: OutputRef<IDynamicForm>;
|
|
233
|
-
readonly
|
|
234
|
+
readonly onFieldChanges: OutputRef<FormFieldChangeEvent>;
|
|
235
|
+
readonly onValueChanges: OutputRef<FormFieldChangeEvent>;
|
|
236
|
+
readonly onInit: OutputRef<FormFieldChangeEvent>;
|
|
234
237
|
reset(): void;
|
|
235
|
-
serialize(validate?: boolean): Promise<
|
|
238
|
+
serialize(validate?: boolean, ...purposes: string[]): Promise<FormSerializeResult>;
|
|
236
239
|
getField(path: string): FormFieldConfig;
|
|
237
240
|
getControl(path: string): AbstractControl;
|
|
238
241
|
}
|
|
@@ -284,6 +287,10 @@ export type FormFieldData = Pick<FormFieldProps, "label" | "labelAlign" | "descr
|
|
|
284
287
|
* Puts the field in a custom field set
|
|
285
288
|
*/
|
|
286
289
|
fieldSet?: string;
|
|
290
|
+
/**
|
|
291
|
+
* Gives purpose to a field (can be used as a filter in serialization)
|
|
292
|
+
*/
|
|
293
|
+
purposes?: string | string[];
|
|
287
294
|
/**
|
|
288
295
|
* Puts the field in a custom order
|
|
289
296
|
*/
|
|
@@ -19,6 +19,8 @@ export declare class DynamicFormComponent implements IDynamicForm {
|
|
|
19
19
|
readonly data: import("@angular/core").InputSignal<any>;
|
|
20
20
|
readonly fields: import("@angular/core").InputSignal<FormFieldConfig<import("../../common-types").FormFieldProps>[]>;
|
|
21
21
|
readonly fieldChanges: Subject<FormFieldChangeEvent>;
|
|
22
|
+
readonly init: import("rxjs").Observable<FormFieldChangeEvent>;
|
|
23
|
+
readonly valueChanges: import("rxjs").Observable<FormFieldChangeEvent>;
|
|
22
24
|
protected readonly language: import("@angular/core").Signal<string>;
|
|
23
25
|
protected readonly enableTranslations: import("@angular/core").Signal<boolean>;
|
|
24
26
|
readonly config: import("@angular/core").Signal<FormFieldConfig<import("../../common-types").FormFieldProps>[]>;
|
|
@@ -26,14 +28,16 @@ export declare class DynamicFormComponent implements IDynamicForm {
|
|
|
26
28
|
protected readonly status$: import("@angular/core").ResourceRef<import("../../common-types").DynamicFormStatus>;
|
|
27
29
|
readonly status: import("@angular/core").Signal<import("../../common-types").DynamicFormStatus>;
|
|
28
30
|
readonly onSubmit: import("@angular/core").OutputEmitterRef<IDynamicForm>;
|
|
29
|
-
readonly
|
|
31
|
+
readonly onFieldChanges: import("@angular/core").OutputRef<FormFieldChangeEvent>;
|
|
32
|
+
readonly onValueChanges: import("@angular/core").OutputRef<FormFieldChangeEvent>;
|
|
33
|
+
readonly onInit: import("@angular/core").OutputRef<FormFieldChangeEvent>;
|
|
30
34
|
readonly options: FormlyFormOptions;
|
|
31
35
|
constructor(forms: DynamicFormService);
|
|
32
36
|
submit(): void;
|
|
33
37
|
reset(): void;
|
|
34
|
-
serialize(validate?: boolean): Promise<FormSerializeResult>;
|
|
38
|
+
serialize(validate?: boolean, ...purposes: string[]): Promise<FormSerializeResult>;
|
|
35
39
|
getField(path: string): FormFieldConfig;
|
|
36
40
|
getControl(path: string): AbstractControl;
|
|
37
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormComponent, never>;
|
|
38
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "dynamic-form", never, { "labelPrefix": { "alias": "labelPrefix"; "required": false; "isSignal": true; }; "labelCustomizer": { "alias": "labelCustomizer"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "useTabs": { "alias": "useTabs"; "required": false; "isSignal": true; }; "legacyLabels": { "alias": "legacyLabels"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; }, { "onSubmit": "onSubmit"; "
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "dynamic-form", never, { "labelPrefix": { "alias": "labelPrefix"; "required": false; "isSignal": true; }; "labelCustomizer": { "alias": "labelCustomizer"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "useTabs": { "alias": "useTabs"; "required": false; "isSignal": true; }; "legacyLabels": { "alias": "legacyLabels"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; }, { "onSubmit": "onSubmit"; "onFieldChanges": "onFieldChanges"; "onValueChanges": "onValueChanges"; "onInit": "onInit"; }, never, ["*"], false, never>;
|
|
39
43
|
}
|
|
@@ -15,8 +15,8 @@ export declare class DynamicFormService {
|
|
|
15
15
|
getFormFieldGroupForSchema(name: string, customizeOrOptions?: CustomizerOrSchemaOptions): Promise<FormFieldConfig>;
|
|
16
16
|
protected getFormFieldGroupBySchemaName(name: string, customizeOrOptions: CustomizerOrSchemaOptions, restrictedMethod: string): Promise<FormFieldConfig>;
|
|
17
17
|
validateForm(form: IDynamicForm, showErrors?: boolean): Promise<any>;
|
|
18
|
-
serializeForm(form: IDynamicForm, validate?: boolean): Promise<FormSerializeResult>;
|
|
19
|
-
serialize(fields: FormFieldConfig[]): Promise<FormSerializeResult>;
|
|
18
|
+
serializeForm(form: IDynamicForm, validate?: boolean, ...purposes: string[]): Promise<FormSerializeResult>;
|
|
19
|
+
serialize(fields: FormFieldConfig[], purposes?: string[]): Promise<FormSerializeResult>;
|
|
20
20
|
protected showErrorsForGroup(formGroup: FormGroup): void;
|
|
21
21
|
protected showErrorsForControls(controls: AbstractControl[]): void;
|
|
22
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormService, never>;
|
|
@@ -9,6 +9,7 @@ export interface ConfigForSchemaWrapOptions extends Required<FormBuilderOptionsB
|
|
|
9
9
|
customize(field: FormFieldConfig, property: OpenApiSchemaProperty, schema: OpenApiSchema): Promise<FormFieldConfig[]>;
|
|
10
10
|
}
|
|
11
11
|
export declare function toWrapOptions(customizeOrOptions: CustomizerOrSchemaOptions | ConfigForSchemaWrapOptions, injector: Injector, schema: OpenApiSchema, errorMsg?: string): Promise<ConfigForSchemaWrapOptions>;
|
|
12
|
+
export declare function toStringArray(value: string | string[]): string[];
|
|
12
13
|
export declare function handleConfigs(configs: MaybeArray<FormFieldConfig>): FormFieldConfig<FormFieldProps>[];
|
|
13
14
|
export declare function arrayItemActionToExpression(actionName: KeysOfType<FormFieldProps, FormFieldArrayItemsAction>): FormFieldExpression;
|
|
14
15
|
export declare function mergeFormFields(formFields: FormFieldConfig[][]): FormFieldConfig[];
|
|
@@ -48,6 +48,7 @@ interface SetFormFieldProps extends Omit<FormFieldProps, "min" | "max"> {
|
|
|
48
48
|
}
|
|
49
49
|
export declare function setFieldProps(field: FormFieldConfig, values: SetFormFieldProps): FormFieldConfig;
|
|
50
50
|
export declare function setFieldProp<P extends keyof SetFormFieldProps, V extends SetFormFieldProps[P]>(field: FormFieldConfig, prop: P, value: V): FormFieldConfig;
|
|
51
|
+
export declare function setFieldSerialize(field: FormFieldConfig, serialize?: FormFieldCondition): void;
|
|
51
52
|
export declare function setFieldHidden(field: FormFieldConfig, hidden?: FormFieldCondition): void;
|
|
52
53
|
export declare function setFieldDisabled(field: FormFieldConfig, disabled?: FormFieldCondition): void;
|
|
53
54
|
export declare function setFieldHooks(field: FormFieldConfig, hooks: FormHookConfig): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stemy/ngx-dynamic-form",
|
|
3
|
-
"version": "19.8.
|
|
3
|
+
"version": "19.8.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"public": true,
|
|
6
6
|
"repository": "https://github.com/stemyke/ngx-dynamic-form.git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"ngx-device-detector": "^9.0.0",
|
|
23
23
|
"@floating-ui/dom": "^1.7.1",
|
|
24
24
|
"json5": "^2.2.3",
|
|
25
|
-
"@stemy/ngx-utils": ">=19.8.
|
|
26
|
-
"@ngx-formly/core": "^7.
|
|
25
|
+
"@stemy/ngx-utils": ">=19.8.13",
|
|
26
|
+
"@ngx-formly/core": "^7.1.0",
|
|
27
27
|
"ngx-mask": "^19.0.7",
|
|
28
28
|
"@angular/material": "^19.2.18"
|
|
29
29
|
},
|
package/public_api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { FORM_ROOT_ID, FormFieldKey, FormFieldLabelCustomizer, FormBuilderOption
|
|
|
2
2
|
export { IFormFieldCustomizer, customizeFormField } from "./ngx-dynamic-form/utils/customizer";
|
|
3
3
|
export { FormInput, FormSelect, FormStatic, FormUpload, FormGroup, FormArray, FormSerializable, FormFieldSet } from "./ngx-dynamic-form/utils/decorators";
|
|
4
4
|
export { addFieldValidators, removeFieldValidators, jsonValidation, requiredValidation, translationValidation, phoneValidation, emailValidation, arrayLengthValidation, minLengthValidation, maxLengthValidation, minValueValidation, maxValueValidation } from "./ngx-dynamic-form/utils/validation";
|
|
5
|
-
export { replaceSpecialChars, controlValues, controlStatus, convertToDateFormat, convertToDate, convertToNumber, getFieldByPath, getFieldsByPredicate, getFieldsByKey, getSelectOptions, replaceFieldArray, clearFieldArray, insertToFieldArray, removeFromFieldArray, setFieldDefault, setFieldValue, setFieldProps, setFieldProp, setFieldHidden, setFieldDisabled, setFieldHooks, isFieldVisible, isFieldHidden, MIN_INPUT_NUM, MAX_INPUT_NUM, EDITOR_FORMATS } from "./ngx-dynamic-form/utils/misc";
|
|
5
|
+
export { replaceSpecialChars, controlValues, controlStatus, convertToDateFormat, convertToDate, convertToNumber, getFieldByPath, getFieldsByPredicate, getFieldsByKey, getSelectOptions, replaceFieldArray, clearFieldArray, insertToFieldArray, removeFromFieldArray, setFieldDefault, setFieldValue, setFieldProps, setFieldProp, setFieldSerialize, setFieldHidden, setFieldDisabled, setFieldHooks, isFieldVisible, isFieldHidden, MIN_INPUT_NUM, MAX_INPUT_NUM, EDITOR_FORMATS } from "./ngx-dynamic-form/utils/misc";
|
|
6
6
|
export { RichTranslationModel } from "./ngx-dynamic-form/models/rich-translation.model";
|
|
7
7
|
export { TranslationModel } from "./ngx-dynamic-form/models/translation.model";
|
|
8
8
|
export { DynamicFormBuilderService } from "./ngx-dynamic-form/services/dynamic-form-builder.service";
|