Skip to main content

Class: FormService

Hierarchy

Constructors

constructor

new FormService()

Overrides

DefaultService.constructor

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:39

Properties

[combinedReducers]

[combinedReducers]: (state: any, action: any) => any

Type declaration

▸ (state, action): any

Parameters
NameType
stateany
actionany
Returns

any

Inherited from

DefaultService.[combinedReducers]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:63


[dispatch]

[dispatch]: any

Inherited from

DefaultService.[dispatch]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:62


[inReducer]

[inReducer]: boolean

Inherited from

DefaultService.[inReducer]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:64


[reducers]

[reducers]: any

Inherited from

DefaultService.[reducers]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:59


[sagas]

[sagas]: any

Inherited from

DefaultService.[sagas]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:61


[types]

[types]: any

Inherited from

DefaultService.[types]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:60


fieldIndex

Protected fieldIndex: Object

Index signature

[fieldName: string]: boolean

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:32


fields

fields: AnonymousObject<Field>

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:27


listeners

listeners: Object

Type declaration

NameType
submittingChange
validationChange
valueChange

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:28


pendingDispatch

pendingDispatch: Set<string>

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:31


state

state: FormState

Inherited from

DefaultService.state

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:66


watchIndex

Protected watchIndex: Object

Index signature

[fieldName: string]: boolean

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:35

Methods

[create]

[create](initialState): void

Parameters

NameType
initialStateFormState

Returns

void

Inherited from

DefaultService.[create]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:69


[run]

[run](): void

Returns

void

Inherited from

DefaultService.[run]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:208


[stop]

[stop](): void

Returns

void

Inherited from

DefaultService.[stop]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:226


_getSubFieldNames

Protected _getSubFieldNames(fieldName): string[]

Parameters

NameType
fieldNamestring

Returns

string[]

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:116


_getSubWatchs

Protected _getSubWatchs(watch): string[]

Parameters

NameType
watchstring

Returns

string[]

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:136


_setValues

Private _setValues(values?, validations?): void

Parameters

NameType
valuesAnonymousObject<any>
validationsAnonymousObject<FieldValidation>

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:281


addField

addField(field): void

Parameters

NameType
fieldField

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:52


clearValidation

clearValidation(fieldName, validatorName, code, compile?): void

Parameters

NameTypeDefault value
fieldNamestringundefined
validatorNamestringundefined
codeValidationCodeundefined
compilebooleantrue

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:60


compileValidations

compileValidations(fieldNames, force?): void

Parameters

NameTypeDefault value
fieldNamesstring | string[]undefined
forcebooleanfalse

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:68


getContainerFieldValidation

getContainerFieldValidation(validations, fields, prefix?, touchedOnly?): ContainerValidation

Parameters

NameTypeDefault value
validationsAnonymousObject<FieldValidation>undefined
fieldsAnonymousObject<Field>undefined
prefixstring''
touchedOnlybooleantrue

Returns

ContainerValidation

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:84


getValidation

getValidation(fieldName): FieldValidation

Parameters

NameType
fieldNamestring

Returns

FieldValidation

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:155


hasValidation

hasValidation(fieldName, validatorName, code, message?): boolean

Parameters

NameType
fieldNamestring
validatorNamestring
codeValidationCode
message?string

Returns

boolean

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:169


offChange

offChange(type, listener, watchs): void

Parameters

NameType
typeFormListenerType
listenerFormListener
watchsstring | string[]

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:181


offSubmittingChange

offSubmittingChange(listener): void

Parameters

NameType
listenerFormListener

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:201


offValidationChange

offValidationChange(listener, watchs): void

Parameters

NameType
listenerFormListener
watchsstring | string[]

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:209


offValueChange

offValueChange(listener, watchs): void

Parameters

NameType
listenerFormListener
watchsstring | string[]

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:217


onChange

onChange(type, listener, watchs, once): void

Parameters

NameType
typeFormListenerType
listenerFormListener
watchsstring | string[]
onceboolean

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:189


onSubmittingChange

onSubmittingChange(listener, once?): void

Parameters

NameTypeDefault value
listenerFormListenerundefined
oncebooleanfalse

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:205


onValidationChange

onValidationChange(listener, watchs, once?): void

Parameters

NameTypeDefault value
listenerFormListenerundefined
watchsstring | string[]undefined
oncebooleanfalse

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:213


onValueChange

onValueChange(listener, watchs, once?): void

Parameters

NameTypeDefault value
listenerFormListenerundefined
watchsstring | string[]undefined
oncebooleanfalse

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:221


reset

reset(): void

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:226


serializeValidationCode

serializeValidationCode(code): ValidationStatus

Parameters

NameType
codeValidationCode

Returns

ValidationStatus

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:249


setResetting

setResetting(resetting): void

Parameters

NameType
resettingboolean

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:245


setSubmitting

setSubmitting(submitting): void

Parameters

NameType
submittingboolean

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:265


setValidation

setValidation(fieldName, validatorName, code, message?, compile?): void

Parameters

NameTypeDefault value
fieldNamestringundefined
validatorNamestringundefined
codeValidationCodeundefined
messagestring''
compilebooleantrue

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:271


setValue

setValue(fieldName, value): Generator<void | Generator<void | ForkEffect<Generator<void | ValidationResult, void, ValidationResult>>, string[], Task>, void, string[]>

Parameters

NameType
fieldNamestring
valueany

Returns

Generator<void | Generator<void | ForkEffect<Generator<void | ValidationResult, void, ValidationResult>>, string[], Task>, void, string[]>

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:299


setValues

setValues(values): Generator<void | Generator<void | ForkEffect<Generator<void | ValidationResult, void, ValidationResult>>, string[], Task>, void, string[]>

Parameters

NameType
valuesAnonymousObject<any>

Returns

Generator<void | Generator<void | ForkEffect<Generator<void | ValidationResult, void, ValidationResult>>, string[], Task>, void, string[]>

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:310


submit

submit(values, validations, resubmit, onSuccess, onError?, onWarning?): Generator<void | ContainerValidation, void, Object>

Parameters

NameType
valuesAnonymousObject<any>
validationsAnonymousObject<FieldValidation>
resubmit() => void
onSuccessFormSubmitCallback
onError?FormErrorCallback
onWarning?FormWarningCallback

Returns

Generator<void | ContainerValidation, void, Object>

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:319


touch

touch(fieldName): void

Parameters

NameType
fieldNamestring

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:359


touchAll

touchAll(): void

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:367


validate

validate(fieldName, validatorName, validator, value): Generator<void | ValidationResult, void, ValidationResult>

Parameters

NameType
fieldNamestring
validatorNamestring
validatorValidator
valueany

Returns

Generator<void | ValidationResult, void, ValidationResult>

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:374


validateAll

validateAll(values): Generator<void | ForkEffect<Generator<void | ValidationResult, void, ValidationResult>>, string[], Task>

Parameters

NameType
valuesAnonymousObject<any>

Returns

Generator<void | ForkEffect<Generator<void | ValidationResult, void, ValidationResult>>, string[], Task>

Defined in

onekijs/packages/onekijs-framework/src/form/FormService.ts:392