@manojadams/metaforms-core
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -5,4 +5,4 @@ import { SyntheticEvent } from "react"; | ||
import BaseFormStepper from "../form/form-stepper/BaseFormStepper"; | ||
import { IDisplayProps, IEvent, IField, IFormatterType, IOption, IRest, ITheme, IUISchema, IValidation, TParam } from "./model-interfaces"; | ||
import { TNextCondition, TNextResponseMode, TOperator, TValue } from "./types"; | ||
import { IDisplayProps, IEvent, IField, IFormConfig, IFormatterType, IOption, IRest, IThemeConfig, IUISchema, IValidation, TParam } from "./model-interfaces"; | ||
import { TFormType, TNextCondition, TNextResponseMode, TOperator, TSectionLayout, TValue } from "./types"; | ||
import BaseFormWizard from "../form/form-wizard/BaseFormWizard"; | ||
@@ -82,3 +82,3 @@ export interface IBasicFormControl { | ||
} | ||
export interface IFormRenderer extends IUISchema { | ||
export interface IFormRenderer extends IUISchema, IFormConfig { | ||
baseFormControl?: typeof BaseFormControl; | ||
@@ -88,4 +88,21 @@ baseFormGroup?: typeof BaseFormGroup; | ||
baseFormWizard?: typeof BaseFormWizard; | ||
/** | ||
* Basic inputs params | ||
*/ | ||
/** Form class */ | ||
className?: string; | ||
/** Form class */ | ||
type?: TFormType; | ||
/** Section layout */ | ||
sectionLayout?: TSectionLayout; | ||
/** Field layout - row | column (default) */ | ||
fieldLayout?: "row" | "column" | string; | ||
/** Spacing around the field */ | ||
spacing?: string; | ||
/** theme configuration input params */ | ||
themeConfig?: IThemeConfig; | ||
/** | ||
* Customization params | ||
*/ | ||
buttons?: IElementTypes; | ||
className?: string; | ||
controls?: IElementTypes; | ||
@@ -105,5 +122,4 @@ fns?: IFnTypes; | ||
/** | ||
* Theme information in the form | ||
* Event handling params | ||
*/ | ||
theme?: ITheme; | ||
onChange?: (change: IFieldChange) => void; | ||
@@ -165,3 +181,3 @@ onCustom?: (formData: IFormData, e: SyntheticEvent) => void; | ||
export interface IMetaForm { | ||
theme: ITheme; | ||
formConfig: IFormConfig; | ||
form: IForm; | ||
@@ -168,0 +184,0 @@ } |
import { IFieldConfig, TFieldRef } from "./common-interface"; | ||
import { TValue } from "./types"; | ||
import { TFormType, TSectionLayout, TValue } from "./types"; | ||
export interface IParamType { | ||
@@ -107,17 +107,6 @@ type?: string; | ||
} | ||
/** | ||
* Theme info related to field | ||
*/ | ||
export interface ITheme { | ||
/** Type of theme */ | ||
type: string; | ||
/** Section layout */ | ||
sectionLayout?: string; | ||
/** Field layout - row | column (default) */ | ||
fieldLayout?: "row" | "column" | string; | ||
/** Spacing around the field */ | ||
spacing?: string; | ||
/** Global classname to be used */ | ||
className?: string; | ||
/** Theme settings */ | ||
export interface IFormConfig { | ||
type?: TFormType; | ||
sectionLayout?: TSectionLayout; | ||
fieldLayout?: string; | ||
config?: IThemeConfig; | ||
@@ -124,0 +113,0 @@ } |
@@ -10,1 +10,3 @@ /// <reference types="react" /> | ||
export declare type TNextResponseMode = "form-data" | "page-data"; | ||
export declare type TSectionLayout = "default" | "tabs" | "wizard" | "stepper"; | ||
export declare type TFormType = "default" | "simple" | "grouped"; |
import EventEmitter from "eventemitter3"; | ||
import React from "react"; | ||
import { IMetaForm, IForm, IFormField, IError, IDepdendencyItem, IElementTypes, IFnTypes, TCondition, TErrorCallback, TFieldRef, IFieldConfig, IEventPayload } from "../constants/common-interface"; | ||
import { IField, IOption, IRest, ISchema, ITheme, TParam } from "../constants/model-interfaces"; | ||
import { IField, IFormConfig, IOption, IRest, ISchema, TParam } from "../constants/model-interfaces"; | ||
import { Rest } from "./Rest"; | ||
@@ -15,3 +15,3 @@ import { Page } from "./Page"; | ||
private eventEmitter; | ||
theme: ITheme; | ||
formConfig: IFormConfig; | ||
form: IForm; | ||
@@ -25,3 +25,3 @@ rest: Rest; | ||
errorHandler?: TErrorCallback; | ||
constructor(schema: ISchema, eventEmitter: EventEmitter, restConfig?: IRest, theme?: ITheme); | ||
constructor(schema: ISchema, eventEmitter: EventEmitter, formConfig: IFormConfig, restConfig?: IRest); | ||
init(): void; | ||
@@ -47,3 +47,2 @@ /** page functions */ | ||
/** Theme functions */ | ||
getThemeProp(themeName: string, prop: string): any; | ||
getSection(pageNumber: number): object | null; | ||
@@ -50,0 +49,0 @@ setSection(section: string): void; |
@@ -9,3 +9,2 @@ import React from "react"; | ||
useDefaultButtons: boolean; | ||
theme: string; | ||
onSubmit: (event: React.MouseEvent, field: IField, callback: () => void) => void; | ||
@@ -12,0 +11,0 @@ onReset: (event: React.MouseEvent, field: IField, callback: () => void) => void; |
@@ -6,3 +6,2 @@ /// <reference types="react" /> | ||
props: IRenderField; | ||
theme: string; | ||
sync: () => void; | ||
@@ -9,0 +8,0 @@ } |
import React, { SyntheticEvent } from "react"; | ||
import { IElementTypes, IForm } from "../constants/common-interface"; | ||
import { ISchema, ITheme } from "../constants/model-interfaces"; | ||
import { ISchema } from "../constants/model-interfaces"; | ||
import { TSectionLayout } from "../constants/types"; | ||
interface IProps { | ||
@@ -8,3 +9,3 @@ schema: ISchema; | ||
form: IForm; | ||
theme: ITheme; | ||
sectionLayout: TSectionLayout; | ||
onCustom: (e?: React.MouseEvent) => void; | ||
@@ -11,0 +12,0 @@ onPrevious: (e?: React.MouseEvent, data?: IForm) => void; |
import React from "react"; | ||
import { IElementTypes, IForm } from "../../constants/common-interface"; | ||
import { IField, ISchema, ITheme } from "../../constants/model-interfaces"; | ||
import { IField, ISchema } from "../../constants/model-interfaces"; | ||
import { TCallback } from "../../constants/types"; | ||
@@ -11,3 +11,2 @@ interface IProps { | ||
buttons?: IElementTypes; | ||
theme: ITheme; | ||
hasSection: boolean; | ||
@@ -14,0 +13,0 @@ useDefaultButtons: boolean; |
import React from "react"; | ||
import { IElementTypes, IForm } from "../../constants/common-interface"; | ||
import { IField, ISchema, ITheme } from "../../constants/model-interfaces"; | ||
import { IField, ISchema } from "../../constants/model-interfaces"; | ||
import { TCallback } from "../../constants/types"; | ||
@@ -11,3 +11,2 @@ interface IProps { | ||
buttons?: IElementTypes; | ||
theme: ITheme; | ||
hasSection: boolean; | ||
@@ -14,0 +13,0 @@ useDefaultButtons: boolean; |
import { IForm, IFormData, IFormField } from "../constants/common-interface"; | ||
import { TiconPositionType, TValue } from "../constants/types"; | ||
import { Page } from "../core/Page"; | ||
import { IDependency, IDisplayProps, IField, IFormatterType, IIconConfig, IMeta, IOption, ISchema, ITheme, TParam } from "./../constants/model-interfaces"; | ||
import { IDependency, IDisplayProps, IField, IFormatterType, IIconConfig, IMeta, IOption, ISchema, IThemeConfig, TParam } from "./../constants/model-interfaces"; | ||
/** | ||
@@ -18,3 +18,3 @@ * @ignore | ||
static getFormGroupDefaultButtons(): Array<IField>; | ||
static getThemeProp(themeName: string, theme: ITheme, prop: string): any; | ||
static getThemeProp(theme: IThemeConfig, prop: string): any; | ||
static getNormalizedFormData(formData: IFormData): {}; | ||
@@ -21,0 +21,0 @@ static updateFormData(formData: IForm, newFormData: IFormData, formatter: IFormatterType): IFormData; |
{ | ||
"name": "@manojadams/metaforms-core", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "React Library for rendering dynamic forms from json schema", | ||
@@ -5,0 +5,0 @@ "author": "manojadams", |
@@ -5,6 +5,3 @@ # metaform-core | ||
## Change logs | ||
- Added phone control. | ||
- Added custom control. | ||
- Removed theme and rest configuration options from schema and would now be taken as input params. | ||
- Updated form wizard functionality. | ||
- Use default section layout as tabbed if not specified | ||
@@ -11,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
869629
7964
94