@manojadams/metaforms-core
Advanced tools
Comparing version 3.0.40 to 3.0.41
@@ -5,3 +5,3 @@ import { SyntheticEvent } from "react"; | ||
import BaseFormStepper from "../form/form-stepper/BaseFormStepper"; | ||
import { IDisplayProps, IEvent, IField, IFormConfig, IFormatterType, IIconConfig, IOption, IRest, IThemeConfig, IUISchema, IValidation, TParam } from "./model-interfaces"; | ||
import { IDisplayProps, IEvent, IField, IFormConfig, IFormatterType, IIconConfig, IOption, IRest, IThemeConfig, IUISchema, IValidation, TParam, TParamType } from "./model-interfaces"; | ||
import { TChangeMode, TFormType, TNextCondition, TNextResponseMode, TOperator, TSectionLayout, TValue } from "./types"; | ||
@@ -31,10 +31,19 @@ import BaseFormWizard from "../form/form-wizard/BaseFormWizard"; | ||
} | ||
export interface IFieldConfig { | ||
type?: string; | ||
export interface IRequestBody { | ||
[key: string]: TValue | IRequestBody; | ||
} | ||
export interface IApiConfig { | ||
requestType?: string; | ||
requestBody?: IRequestBody; | ||
requestBodyParams?: Array<TParamType>; | ||
requestHeaders?: Record<string, string>; | ||
queryParams?: Array<TParam>; | ||
url?: string; | ||
urlType?: string; | ||
labelKey?: string; | ||
valueKey?: string; | ||
responseKey?: string; | ||
queryParams?: Array<TParam>; | ||
url?: string; | ||
urlType?: string; | ||
} | ||
export interface IFieldConfig extends IApiConfig { | ||
type?: string; | ||
loadOn?: string | Array<string>; | ||
@@ -172,3 +181,3 @@ lazy?: boolean; | ||
} | ||
export interface IDepdendencyItem { | ||
export interface IDepdendencyItem extends IApiConfig { | ||
ref?: string; | ||
@@ -175,0 +184,0 @@ section: string; |
@@ -125,2 +125,3 @@ export declare const MSGS: { | ||
PUT: string; | ||
DELETE: string; | ||
}; |
import EventEmitter from "eventemitter3"; | ||
import React from "react"; | ||
import { IMetaForm, IForm, IFormField, IError, IDepdendencyItem, IElementTypes, IFnTypes, TCondition, TErrorCallback, TFieldRef, IFieldConfig, IEventPayload, IControlProps } from "../constants/common-interface"; | ||
import { IField, IFormConfig, IOption, IRest, ISchema, TParam } from "../constants/model-interfaces"; | ||
import { IMetaForm, IForm, IFormField, IError, IDepdendencyItem, IElementTypes, IFnTypes, TCondition, TErrorCallback, TFieldRef, IFieldConfig, IEventPayload, IControlProps, IRequestBody } from "../constants/common-interface"; | ||
import { IField, IFormConfig, IOption, IRest, ISchema, TParam, TParamType } from "../constants/model-interfaces"; | ||
import { Rest } from "./Rest"; | ||
@@ -42,3 +42,3 @@ import { Page } from "./Page"; | ||
getRestConfig(): import("../constants/model-interfaces").IConfig; | ||
api(type: string, url: string, params?: Array<TParam>, currentValue?: TValue, sectionName?: string, isRemote?: boolean): Promise<any>; | ||
api(type: string, url: string, queryParams?: Array<TParam>, requestBodyParams?: Array<TParamType>, requestBody?: IRequestBody, requestHeaders?: Record<string, string>, currentValue?: TValue, sectionName?: string, isRemote?: boolean): Promise<any>; | ||
getData(config: IFieldConfig, val: TValue, section: string, eventType?: string): Promise<Array<IOption>>; | ||
@@ -45,0 +45,0 @@ /** Theme functions */ |
@@ -1,2 +0,3 @@ | ||
import { IConfig, IRest, TParam } from "../constants/model-interfaces"; | ||
import { IRequestBody } from "../constants/common-interface"; | ||
import { IConfig, IRest } from "../constants/model-interfaces"; | ||
export declare class Rest implements IRest { | ||
@@ -6,6 +7,9 @@ config: IConfig; | ||
constructor(rest?: IRest); | ||
get(url: string, params?: Array<TParam>, isRemote?: boolean): Promise<any>; | ||
post(): void; | ||
getCommonHeaders(requestHeaders?: Record<string, string>): { | ||
"Content-Type": string; | ||
}; | ||
get(url: string, isRemote?: boolean, requestHeaders?: Record<string, string>): Promise<any>; | ||
post(url: string, requestBody: IRequestBody, isRemote?: boolean, requestHeaders?: Record<string, string>): Promise<any>; | ||
put(): void; | ||
delete(): void; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { IForm, IFormData, IFormField, IFormSection } from "../constants/common-interface"; | ||
import { IForm, IFormData, IFormField, IFormSection, IRequestBody } from "../constants/common-interface"; | ||
import { TiconPositionType, TValue } from "../constants/types"; | ||
@@ -26,3 +26,17 @@ import { Page } from "../core/Page"; | ||
static getDataFromValueKey(data: string, props: string): string; | ||
/** | ||
* Update parameters with special values ($input, $initial etc) | ||
* @param queryParams | ||
* @param eventType | ||
* @param currentValue | ||
* @returns | ||
*/ | ||
static updateParams(queryParams: Array<TParam> | undefined, eventType: string | undefined, currentValue: TValue): TParam[] | undefined; | ||
/** | ||
* Updates request payload body | ||
* @param requestBody | ||
* @param requestBodyParams | ||
* @returns | ||
*/ | ||
static updateBodyParams(requestBody: IRequestBody, requestBodyParams: Array<TValue>): any; | ||
static updateFieldProp(field: IFormField, prop: string, value: TValue): void; | ||
@@ -29,0 +43,0 @@ static getDateString(date: Date): string; |
{ | ||
"name": "@manojadams/metaforms-core", | ||
"version": "3.0.40", | ||
"version": "3.0.41", | ||
"description": "React Library for rendering dynamic forms from json schema", | ||
@@ -5,0 +5,0 @@ "author": "manojadams", |
@@ -5,3 +5,3 @@ # metaform-core | ||
## Change logs | ||
- [fix #51: spacing for default forms and linting](https://github.com/manojadams/metaforms-core/issues/51) | ||
- [fix #54: add support for post api](https://github.com/manojadams/metaforms-core/issues/54) | ||
@@ -8,0 +8,0 @@ ## Introduction |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
959129
8630
8