@stemy/ngx-dynamic-form 19.9.19 → 19.9.22
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 +67 -40
- package/fesm2022/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +28 -0
- package/ngx-dynamic-form/services/dynamic-form-schema.service.d.ts +1 -0
- package/ngx-dynamic-form/utils/internal.d.ts +0 -1
- package/ngx-dynamic-form/utils/validation.d.ts +1 -0
- package/package.json +2 -2
- package/public_api.d.ts +1 -1
|
@@ -225,11 +225,25 @@ export interface FormFieldConfig<T = FormFieldProps> extends FormlyFieldConfig<T
|
|
|
225
225
|
* Gives purpose to a field (can be used as a filter in serialization)
|
|
226
226
|
*/
|
|
227
227
|
purposes?: string[];
|
|
228
|
+
/**
|
|
229
|
+
* Possible OpenApi schemas which this field is inherited from
|
|
230
|
+
*/
|
|
231
|
+
schemas?: string[];
|
|
232
|
+
/**
|
|
233
|
+
* Discriminator decides which property values we choose the possible schemas from
|
|
234
|
+
*/
|
|
235
|
+
discriminator?: any;
|
|
228
236
|
/**
|
|
229
237
|
* Use this field as a field set instead of a keyed form group
|
|
230
238
|
*/
|
|
231
239
|
asFieldSet?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Defines the sorting priority of the field
|
|
242
|
+
*/
|
|
232
243
|
priority?: number;
|
|
244
|
+
/**
|
|
245
|
+
* Definition of how group items look
|
|
246
|
+
*/
|
|
233
247
|
fieldGroup?: FormFieldConfig[];
|
|
234
248
|
/**
|
|
235
249
|
* Definition of how array items look
|
|
@@ -239,7 +253,13 @@ export interface FormFieldConfig<T = FormFieldProps> extends FormlyFieldConfig<T
|
|
|
239
253
|
* Custom field hook definitions
|
|
240
254
|
*/
|
|
241
255
|
hooks: FormHookConfig;
|
|
256
|
+
/**
|
|
257
|
+
* Custom field expressions
|
|
258
|
+
*/
|
|
242
259
|
expressions: FormFieldExpressions;
|
|
260
|
+
/**
|
|
261
|
+
* Readonly parent of the field
|
|
262
|
+
*/
|
|
243
263
|
readonly parent?: FormFieldConfig;
|
|
244
264
|
readonly display?: boolean;
|
|
245
265
|
readonly valid?: boolean;
|
|
@@ -369,6 +389,14 @@ export type FormFieldData = Pick<FormFieldProps, "label" | "labelAlign" | "descr
|
|
|
369
389
|
* Gives purpose to a field (can be used as a filter in serialization)
|
|
370
390
|
*/
|
|
371
391
|
purposes?: string | string[];
|
|
392
|
+
/**
|
|
393
|
+
* Possible OpenApi schemas which this field is inherited from
|
|
394
|
+
*/
|
|
395
|
+
schemas?: string | string[];
|
|
396
|
+
/**
|
|
397
|
+
* Discriminator decides which property values we choose the possible schemas from
|
|
398
|
+
*/
|
|
399
|
+
discriminator?: any;
|
|
372
400
|
/**
|
|
373
401
|
* Puts the field in a custom order
|
|
374
402
|
*/
|
|
@@ -14,6 +14,7 @@ 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 getFormFieldsForRefs(subSchemas: OpenApiSchema[], parent: FormFieldConfig, options: ConfigForSchemaWrapOptions): Promise<FormFieldConfig<import("../common-types").FormFieldProps>[]>;
|
|
17
18
|
protected getFormFieldsForProp(property: OpenApiSchemaProperty, schema: OpenApiSchema, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig[]>;
|
|
18
19
|
protected getFormFieldForProp(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig>;
|
|
19
20
|
protected getFormFieldData(property: OpenApiSchemaProperty, options: ConfigForSchemaWrapOptions): FormFieldData;
|
|
@@ -12,7 +12,6 @@ export declare function toWrapOptions(customizeOrOptions: CustomizerOrSchemaOpti
|
|
|
12
12
|
export declare function toStringArray(value: string | string[]): string[];
|
|
13
13
|
export declare function handleConfigs(configs: MaybeArray<FormFieldConfig>): FormFieldConfig<FormFieldProps>[];
|
|
14
14
|
export declare function arrayItemActionToExpression(actionName: KeysOfType<FormFieldProps, FormFieldArrayItemsAction>): FormFieldExpression;
|
|
15
|
-
export declare function mergeFormFields(formFields: FormFieldConfig[][]): FormFieldConfig[];
|
|
16
15
|
interface FormGroupControls {
|
|
17
16
|
[key: string]: AbstractControl;
|
|
18
17
|
}
|
|
@@ -11,4 +11,5 @@ export declare function minLengthValidation(minLength: number): ValidatorFn;
|
|
|
11
11
|
export declare function maxLengthValidation(maxLength: number): ValidatorFn;
|
|
12
12
|
export declare function minValueValidation(): ValidatorFn;
|
|
13
13
|
export declare function maxValueValidation(): ValidatorFn;
|
|
14
|
+
export declare function enumValidation($enum: any[]): ValidatorFn;
|
|
14
15
|
export declare function setFieldMinDate(field: FormFieldConfig, min: Date): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stemy/ngx-dynamic-form",
|
|
3
|
-
"version": "19.9.
|
|
3
|
+
"version": "19.9.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"public": true,
|
|
6
6
|
"repository": "https://github.com/stemyke/ngx-dynamic-form.git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"ngx-device-detector": "^9.0.0",
|
|
22
22
|
"@floating-ui/dom": "^1.7.1",
|
|
23
23
|
"json5": "^2.2.3",
|
|
24
|
-
"@stemy/ngx-utils": ">=19.9.
|
|
24
|
+
"@stemy/ngx-utils": ">=19.9.31",
|
|
25
25
|
"@ngx-formly/core": "^7.1.0",
|
|
26
26
|
"ngx-mask": "^19.0.7",
|
|
27
27
|
"@angular/material": "^19.2.18"
|
package/public_api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { FORM_ROOT_ID, FormFieldKey, FormFieldLabelCustomizer, FormBuilderOptions, FormFieldArrayItemsAction, FormFieldProps, FormFieldSerializer, FormHookFn, FormHookConfig, FormFieldExpression, FormFieldExpressions, FormFieldConfig, FormFieldLookup, FormFieldType, FormFieldChangeEvent, FormSerializeResult, FormSelectOption, FormSelectOptions, FormSelectOptionsFactory, FormFieldConditionFn, FormFieldCondition, IDynamicForm, ValidationMessageFn, ValidatorFn, ValidatorFactory, ValidatorExpression, Validators, AsyncValidatorFn, AsyncValidatorExpression, AsyncValidators, AllValidationErrors, FormFieldCustom, FormFieldData, FormInputData, FormSelectData, FormStaticData, FormUploadData, FormGroupData, FormArrayData, FormSerializerData, FormFieldSetData, AsyncSubmitMode, AsyncSubmitMethod, FormTemplateType, FormFieldCustomizer, ConfigForSchemaOptions, DynamicFormStatus, DynamicFormUpdateOn, DEFAULT_NUMERIC_STEP, IDynamicFormModuleConfig, } from "./ngx-dynamic-form/common-types";
|
|
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
|
-
export { addFieldValidators, removeFieldValidators, jsonValidation, requiredValidation, translationValidation, phoneValidation, emailValidation, arrayLengthValidation, minLengthValidation, maxLengthValidation, minValueValidation, maxValueValidation, setFieldMinDate } from "./ngx-dynamic-form/utils/validation";
|
|
4
|
+
export { addFieldValidators, removeFieldValidators, jsonValidation, requiredValidation, translationValidation, phoneValidation, emailValidation, arrayLengthValidation, minLengthValidation, maxLengthValidation, minValueValidation, maxValueValidation, enumValidation, setFieldMinDate } from "./ngx-dynamic-form/utils/validation";
|
|
5
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";
|