Repository URL to install this package:
|
Version:
1.0.1 ▾
|
import React from 'react';
import { Serializable } from 'exotic';
import InputState from 'src/forms/input/InputState';
import Input from 'src/forms/input/ObserverInput';
import { InputStateOptions, InputStateFromArgs } from './typings';
import FormState from './FormState';
declare class ObserverForm<Props = any, State = any> extends React.Component<Props, State> {
static FormState: typeof FormState;
static Form: (props: any) => JSX.Element;
Form: (props: any) => JSX.Element;
Input: typeof Input;
SubmitButton: (props: any) => JSX.Element;
CancelButton: (props: any) => JSX.Element;
shouldResetFormOnUnmount: boolean;
/**
* should have a simple object with wording & classnames, one property
* @todo could also pass these in via defaultProps
*/
defaultSubmitButtonLabel: string;
defaultCancelButtonLabel: string;
wording: Object;
/**
* state...
*/
isSubmitButtonNeeded: boolean;
isCancelButtonNeeded: boolean;
handleCancel: (event: any) => void;
/**
* @alias isAllInputsValid
* @todo - should be on state
*/
/**
* @todo @important @deprecated @invalid @name
*/
SubmitCustomClass: string;
CancelCustomClass: string;
ButtonGroupCustomClass: string;
/**
* @param {Array} list
* @return {Form}
*/
static from(list: Array<InputStateOptions> | InputStateFromArgs): (props: any) => JSX.Element;
/**
* @param {React.Props} props
* @description @modifies this.state
*/
constructor(props: any);
/**
* onInvalid
* onInput
*
* @todo - should put all validationType: toArray()
*/
validateInputItem: (item: any) => void;
/**
* @action
* @todo - debounce
*/
validateForm: () => any;
/**
* @tutorial https://mobx.js.org/refguide/create-transformer.html
* @description Lifecycle event hook
* @listens onSubmit
* @see handleSubmit
*/
onSubmitValid(serialized: Serializable): void;
/**
* @description Lifecycle event hook
* @listens onSubmit
* @see handleSubmit
*/
onSubmitError(serialized: Serializable): void;
/**
* @todo - using super when it's a bound fn may not work?
* @listens onSubmit
*/
goToTop: () => void;
handleSubmit: (event: Event) => any;
onCancelClick: (event: any) => void;
renderInput: (item: InputState, index: number) => JSX.Element | "";
renderInputList(): any;
/**
* @see componentWillMount
* @listens componentWillMount
* @event prefil
*/
onPrefil(inputState: InputState): void;
onInputInit(input: InputState, index?: number): void;
/**
* @private
* @inheritdoc
* @description compat
* so it returns the inputState
* will deprecate when not using .map
*/
_onPrefil: (inputState: any) => any;
_onInputInit: (input: any, index: any) => void;
_toInput: (input: any, index: any) => any;
/**
* @todo put prefil as action on state
* @todo do a timeout loader
*
* !!!!!! changed from componentWillMount => componentDidMount
*
* @name onPrefil
* @name prefilItem
* @name prefilInputItem
* @name prefilInput
*/
componentDidMount(): void;
componentWillReceiveProps(prevProps: any, nextProps: any): void;
componentWillUnmount(): void;
resetFormState(inputState: any): void;
render(): JSX.Element;
}
export { ObserverForm as ObservableForm };
export { ObserverForm as Form };
export { ObserverForm };
export default ObserverForm;