@stemy/ngx-dynamic-form 19.9.22 → 19.9.24
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 +185 -143
- package/fesm2022/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +6 -6
- package/ngx-dynamic-form/components/dynamic-form-editor/dynamic-form-editor.component.d.ts +6 -0
- package/ngx-dynamic-form/components/dynamic-form-group/dynamic-form-group.component.d.ts +1 -0
- package/ngx-dynamic-form/ngx-dynamic-form.module.d.ts +19 -18
- package/ngx-dynamic-form/services/dynamic-form-builder.service.d.ts +1 -1
- package/ngx-dynamic-form/services/dynamic-form-schema.service.d.ts +3 -1
- package/ngx-dynamic-form/utils/misc.d.ts +2 -1
- package/package.json +2 -17
- package/public_api.d.ts +2 -1
|
@@ -3,7 +3,7 @@ import { AbstractControl, FormControl, FormGroup } from "@angular/forms";
|
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
import { ConfigOption, FormlyFieldConfig, FormlyFieldProps } from "@ngx-formly/core";
|
|
5
5
|
import { FormlySelectOption } from "@ngx-formly/core/select";
|
|
6
|
-
import { HttpRequestOptions, IAsyncMessage, MaybeArray, MaybePromise, OpenApiSchema, OpenApiSchemaProperty, RequireAtLeastOne, ResolveFactory, UnorderedListStyle, UploadData } from "@stemy/ngx-utils";
|
|
6
|
+
import { DiscriminatorFn, HttpRequestOptions, IAsyncMessage, MaybeArray, MaybePromise, OpenApiSchema, OpenApiSchemaProperty, RequireAtLeastOne, ResolveFactory, UnorderedListStyle, UploadData } from "@stemy/ngx-utils";
|
|
7
7
|
export declare const FORM_ROOT_ID = "__root";
|
|
8
8
|
export type DynamicFormStatus = "VALID" | "INVALID" | "PENDING" | "DISABLED" | "LOADING";
|
|
9
9
|
export type DynamicFormUpdateOn = "change" | "blur" | "submit";
|
|
@@ -228,11 +228,11 @@ export interface FormFieldConfig<T = FormFieldProps> extends FormlyFieldConfig<T
|
|
|
228
228
|
/**
|
|
229
229
|
* Possible OpenApi schemas which this field is inherited from
|
|
230
230
|
*/
|
|
231
|
-
schemas?: string
|
|
231
|
+
schemas?: Set<string>;
|
|
232
232
|
/**
|
|
233
|
-
* Discriminator
|
|
233
|
+
* Discriminator defines a function which returns a schema name based on a target object (the model value itself)
|
|
234
234
|
*/
|
|
235
|
-
discriminator?:
|
|
235
|
+
discriminator?: DiscriminatorFn;
|
|
236
236
|
/**
|
|
237
237
|
* Use this field as a field set instead of a keyed form group
|
|
238
238
|
*/
|
|
@@ -394,9 +394,9 @@ export type FormFieldData = Pick<FormFieldProps, "label" | "labelAlign" | "descr
|
|
|
394
394
|
*/
|
|
395
395
|
schemas?: string | string[];
|
|
396
396
|
/**
|
|
397
|
-
* Discriminator
|
|
397
|
+
* Discriminator defines a function which returns a schema name based on a target object (the model value itself)
|
|
398
398
|
*/
|
|
399
|
-
discriminator?:
|
|
399
|
+
discriminator?: DiscriminatorFn;
|
|
400
400
|
/**
|
|
401
401
|
* Puts the field in a custom order
|
|
402
402
|
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DynamicFieldType } from "../base/dynamic-field-type";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DynamicFormEditorComponent extends DynamicFieldType {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormEditorComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormEditorComponent, "dynamic-form-editor", never, {}, {}, never, never, false, never>;
|
|
6
|
+
}
|
|
@@ -2,6 +2,7 @@ import { FieldWrapper } from "@ngx-formly/core";
|
|
|
2
2
|
import { FormFieldConfig } from "../../common-types";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DynamicFormGroupComponent extends FieldWrapper<FormFieldConfig> {
|
|
5
|
+
get parent(): FormFieldConfig;
|
|
5
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormGroupComponent, never>;
|
|
6
7
|
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormGroupComponent, "dynamic-form-group", never, {}, {}, never, never, false, never>;
|
|
7
8
|
}
|
|
@@ -5,28 +5,29 @@ import * as i1 from "./components/base/dynamic-field-type";
|
|
|
5
5
|
import * as i2 from "./components/dynamic-form/dynamic-form.component";
|
|
6
6
|
import * as i3 from "./components/dynamic-form-array/dynamic-form-array.component";
|
|
7
7
|
import * as i4 from "./components/dynamic-form-chips/dynamic-form-chips.component";
|
|
8
|
-
import * as i5 from "./components/dynamic-form-
|
|
9
|
-
import * as i6 from "./components/dynamic-form-
|
|
10
|
-
import * as i7 from "./components/dynamic-form-
|
|
11
|
-
import * as i8 from "./components/dynamic-form-
|
|
12
|
-
import * as i9 from "./components/dynamic-form-
|
|
13
|
-
import * as i10 from "./components/dynamic-form-
|
|
14
|
-
import * as i11 from "./components/dynamic-form-
|
|
15
|
-
import * as i12 from "./components/dynamic-form-
|
|
16
|
-
import * as i13 from "./components/dynamic-form-
|
|
17
|
-
import * as i14 from "./
|
|
18
|
-
import * as i15 from "./directives/
|
|
19
|
-
import * as i16 from "./
|
|
20
|
-
import * as i17 from "
|
|
21
|
-
import * as i18 from "@angular/
|
|
22
|
-
import * as i19 from "@
|
|
23
|
-
import * as i20 from "@ngx-
|
|
24
|
-
import * as i21 from "@ngx-formly/core
|
|
8
|
+
import * as i5 from "./components/dynamic-form-editor/dynamic-form-editor.component";
|
|
9
|
+
import * as i6 from "./components/dynamic-form-password/dynamic-form-password.component";
|
|
10
|
+
import * as i7 from "./components/dynamic-form-static/dynamic-form-static.component";
|
|
11
|
+
import * as i8 from "./components/dynamic-form-translation/dynamic-form-translation.component";
|
|
12
|
+
import * as i9 from "./components/dynamic-form-upload/dynamic-form-upload.component";
|
|
13
|
+
import * as i10 from "./components/dynamic-form-wysiwyg/dynamic-form-wysiwyg.component";
|
|
14
|
+
import * as i11 from "./components/dynamic-form-alert/dynamic-form-alert.component";
|
|
15
|
+
import * as i12 from "./components/dynamic-form-field/dynamic-form-field.component";
|
|
16
|
+
import * as i13 from "./components/dynamic-form-fieldset/dynamic-form-fieldset.component";
|
|
17
|
+
import * as i14 from "./components/dynamic-form-group/dynamic-form-group.component";
|
|
18
|
+
import * as i15 from "./directives/async-submit.directive";
|
|
19
|
+
import * as i16 from "./directives/dynamic-form-template.directive";
|
|
20
|
+
import * as i17 from "./pipes/dynamic-form-template.pipe";
|
|
21
|
+
import * as i18 from "@angular/common";
|
|
22
|
+
import * as i19 from "@angular/forms";
|
|
23
|
+
import * as i20 from "@stemy/ngx-utils";
|
|
24
|
+
import * as i21 from "@ngx-formly/core";
|
|
25
|
+
import * as i22 from "@ngx-formly/core/select";
|
|
25
26
|
export declare class NgxDynamicFormModule {
|
|
26
27
|
private static getProviders;
|
|
27
28
|
static forRoot(config?: IDynamicFormModuleConfig): ModuleWithProviders<NgxDynamicFormModule>;
|
|
28
29
|
static provideForms(config?: IDynamicFormModuleConfig): EnvironmentProviders;
|
|
29
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDynamicFormModule, never>;
|
|
30
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxDynamicFormModule, [typeof i1.DynamicFieldType, typeof i2.DynamicFormComponent, typeof i3.DynamicFormArrayComponent, typeof i4.DynamicFormChipsComponent, typeof i5.
|
|
31
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxDynamicFormModule, [typeof i1.DynamicFieldType, typeof i2.DynamicFormComponent, typeof i3.DynamicFormArrayComponent, typeof i4.DynamicFormChipsComponent, typeof i5.DynamicFormEditorComponent, typeof i6.DynamicFormPasswordComponent, typeof i7.DynamicFormStaticComponent, typeof i8.DynamicFormTranslationComponent, typeof i9.DynamicFormUploadComponent, typeof i10.DynamicFormWysiwygComponent, typeof i11.DynamicFormAlertComponent, typeof i12.DynamicFormFieldComponent, typeof i13.DynamicFormFieldsetComponent, typeof i14.DynamicFormGroupComponent, typeof i15.AsyncSubmitDirective, typeof i16.DynamicFormTemplateDirective, typeof i17.DynamicFormTemplatePipe], [typeof i18.CommonModule, typeof i19.FormsModule, typeof i19.ReactiveFormsModule, typeof i20.NgxUtilsModule, typeof i21.FormlyModule, typeof i22.FormlySelectModule], [typeof i1.DynamicFieldType, typeof i2.DynamicFormComponent, typeof i3.DynamicFormArrayComponent, typeof i4.DynamicFormChipsComponent, typeof i5.DynamicFormEditorComponent, typeof i6.DynamicFormPasswordComponent, typeof i7.DynamicFormStaticComponent, typeof i8.DynamicFormTranslationComponent, typeof i9.DynamicFormUploadComponent, typeof i10.DynamicFormWysiwygComponent, typeof i11.DynamicFormAlertComponent, typeof i12.DynamicFormFieldComponent, typeof i13.DynamicFormFieldsetComponent, typeof i14.DynamicFormGroupComponent, typeof i15.AsyncSubmitDirective, typeof i16.DynamicFormTemplateDirective, typeof i17.DynamicFormTemplatePipe, typeof i19.FormsModule, typeof i19.ReactiveFormsModule, typeof i20.NgxUtilsModule, typeof i21.FormlyModule, typeof i22.FormlySelectModule]>;
|
|
31
32
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxDynamicFormModule>;
|
|
32
33
|
}
|
|
@@ -16,7 +16,7 @@ export declare class DynamicFormBuilderService {
|
|
|
16
16
|
resolveFormGroup(key: string, target: Type<any>, data: FormGroupData, parent?: FormFieldConfig, options?: FormBuilderOptions): FormFieldConfig;
|
|
17
17
|
resolveFormArray(key: string, itemType: string | FormInputData | Type<any>, data: FormArrayData, parent?: FormFieldConfig, options?: FormBuilderOptions): FormFieldConfig;
|
|
18
18
|
createFieldSet(set: FormFieldSetData, fields: FormFieldConfig[], parent: FormFieldConfig, options?: FormBuilderOptions): FormFieldConfig;
|
|
19
|
-
createFieldSets(fields: FormFieldConfig[], parent: FormFieldConfig, options?: FormBuilderOptions,
|
|
19
|
+
createFieldSets(fields: FormFieldConfig[], parent: FormFieldConfig, options?: FormBuilderOptions, data?: FormFieldSetData[]): FormFieldConfig[];
|
|
20
20
|
createFormInput(key: string, data: FormInputData, parent: FormFieldConfig, options?: FormBuilderOptions): FormFieldConfig;
|
|
21
21
|
createFormSelect(key: string, data: FormSelectData, parent: FormFieldConfig, options?: FormBuilderOptions): FormFieldConfig;
|
|
22
22
|
createFormStatic(key: string, data: FormStaticData, parent: FormFieldConfig, options?: FormBuilderOptions): FormFieldConfig;
|
|
@@ -14,14 +14,16 @@ export declare class DynamicFormSchemaService {
|
|
|
14
14
|
constructor(openApi: OpenApiService, injector: Injector, builder: DynamicFormBuilderService);
|
|
15
15
|
getSchema(name: string): Promise<OpenApiSchema>;
|
|
16
16
|
getFormFieldsForSchema(schema: OpenApiSchema, parent: FormFieldConfig, customizeOrOptions: CustomizerOrSchemaOptions): Promise<FormFieldConfig[]>;
|
|
17
|
-
protected
|
|
17
|
+
protected getFormFieldsForSchemas(parent: FormFieldConfig, options: ConfigForSchemaWrapOptions, ...schemas: OpenApiSchema[]): Promise<FormFieldConfig<import("../common-types").FormFieldProps>[]>;
|
|
18
18
|
protected getFormFieldsForProp(property: OpenApiSchemaProperty, schema: OpenApiSchema, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig[]>;
|
|
19
19
|
protected getFormFieldForProp(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig>;
|
|
20
|
+
protected checkIsEditorProperty(property: OpenApiSchemaProperty): boolean;
|
|
20
21
|
protected getFormFieldData(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions): FormFieldData;
|
|
21
22
|
protected getFormArrayConfig(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig>;
|
|
22
23
|
protected getFormGroupConfig(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig>;
|
|
23
24
|
protected getFormInputConfig(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig;
|
|
24
25
|
protected getFormTextareaConfig(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig;
|
|
26
|
+
protected getFormEditorConfig(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig;
|
|
25
27
|
protected getFormDatepickerConfig(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig;
|
|
26
28
|
protected getFormSelectConfig($enum: string[], property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig;
|
|
27
29
|
protected getFormUploadConfig(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig;
|
|
@@ -56,5 +56,6 @@ export declare function isFieldVisible(field: FormFieldConfig): boolean;
|
|
|
56
56
|
export declare function isFieldHidden(field: FormFieldConfig): boolean;
|
|
57
57
|
export declare const MIN_INPUT_NUM = -1999999999;
|
|
58
58
|
export declare const MAX_INPUT_NUM = 1999999999;
|
|
59
|
-
export declare const
|
|
59
|
+
export declare const EDITOR_TYPES: ReadonlyArray<string>;
|
|
60
|
+
export declare const CUSTOM_INPUT_TYPES: ReadonlyArray<string>;
|
|
60
61
|
export {};
|
package/package.json
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stemy/ngx-dynamic-form",
|
|
3
|
-
"version": "19.9.
|
|
3
|
+
"version": "19.9.24",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"public": true,
|
|
6
6
|
"repository": "https://github.com/stemyke/ngx-dynamic-form.git",
|
|
7
7
|
"author": "stemy <balazs.stemler@metrix.co.hu>",
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@
|
|
10
|
-
"@angular/common": "^19.2.14",
|
|
11
|
-
"@angular/compiler": "^19.2.14",
|
|
12
|
-
"@angular/core": "^19.2.14",
|
|
13
|
-
"@angular/forms": "^19.2.14",
|
|
14
|
-
"@angular/router": "^19.2.14",
|
|
15
|
-
"@angular/platform-browser": "^19.2.14",
|
|
16
|
-
"@angular/platform-server": "^19.2.14",
|
|
17
|
-
"element-resize-detector": "^1.2.4",
|
|
18
|
-
"rxjs": "^7.8.2",
|
|
19
|
-
"luxon": "^3.6.1",
|
|
20
|
-
"invokable": "^1.0.3",
|
|
21
|
-
"ngx-device-detector": "^9.0.0",
|
|
22
|
-
"@floating-ui/dom": "^1.7.1",
|
|
23
|
-
"json5": "^2.2.3",
|
|
24
|
-
"@stemy/ngx-utils": ">=19.9.31",
|
|
9
|
+
"@stemy/ngx-utils": ">=19.9.32",
|
|
25
10
|
"@ngx-formly/core": "^7.1.0",
|
|
26
11
|
"ngx-mask": "^19.0.7",
|
|
27
12
|
"@angular/material": "^19.2.18"
|
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, enumValidation, setFieldMinDate } 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, setFieldSerialize, setFieldHidden, setFieldDisabled, setFieldHooks, isFieldVisible, isFieldHidden, MIN_INPUT_NUM, MAX_INPUT_NUM,
|
|
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_TYPES } 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 { DynamicFormService } from "./ngx-dynamic-form/services/dynamic-form.service";
|
|
@@ -16,6 +16,7 @@ export { DynamicFieldType } from "./ngx-dynamic-form/components/base/dynamic-fie
|
|
|
16
16
|
export { DynamicFormComponent } from "./ngx-dynamic-form/components/dynamic-form/dynamic-form.component";
|
|
17
17
|
export { DynamicFormArrayComponent } from "./ngx-dynamic-form/components/dynamic-form-array/dynamic-form-array.component";
|
|
18
18
|
export { DynamicFormChipsComponent } from "./ngx-dynamic-form/components/dynamic-form-chips/dynamic-form-chips.component";
|
|
19
|
+
export { DynamicFormEditorComponent } from "./ngx-dynamic-form/components/dynamic-form-editor/dynamic-form-editor.component";
|
|
19
20
|
export { DynamicFormPasswordComponent } from "./ngx-dynamic-form/components/dynamic-form-password/dynamic-form-password.component";
|
|
20
21
|
export { DynamicFormStaticComponent } from "./ngx-dynamic-form/components/dynamic-form-static/dynamic-form-static.component";
|
|
21
22
|
export { DynamicFormTranslationComponent } from "./ngx-dynamic-form/components/dynamic-form-translation/dynamic-form-translation.component";
|