Class: FormService
Hierarchy
↳
FormService
Constructors
constructor
• new FormService()
Overrides
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
Name | Type |
---|---|
state | any |
action | any |
Returns
any
Inherited from
DefaultService.[combinedReducers]
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:63
[dispatch]
• [dispatch]: any
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:62
[inReducer]
• [inReducer]: boolean
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:64
[reducers]
• [reducers]: any
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:59
[sagas]
• [sagas]: any
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:61
[types]
• [types]: any
Inherited from
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
Name | Type |
---|---|
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
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
Name | Type |
---|---|
initialState | FormState |
Returns
void
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:69
[run]
▸ [run](): void
Returns
void
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:208
[stop]
▸ [stop](): void
Returns
void
Inherited from
Defined in
onekijs/packages/onekijs-framework/src/core/Service.ts:226
_getSubFieldNames
▸ Protected
_getSubFieldNames(fieldName
): string
[]
Parameters
Name | Type |
---|---|
fieldName | string |
Returns
string
[]
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:116
_getSubWatchs
▸ Protected
_getSubWatchs(watch
): string
[]
Parameters
Name | Type |
---|---|
watch | string |
Returns
string
[]
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:136
_setValues
▸ Private
_setValues(values?
, validations?
): void
Parameters
Name | Type |
---|---|
values | AnonymousObject <any > |
validations | AnonymousObject <FieldValidation > |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:281
addField
▸ addField(field
): void
Parameters
Name | Type |
---|---|
field | Field |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:52
clearValidation
▸ clearValidation(fieldName
, validatorName
, code
, compile?
): void
Parameters
Name | Type | Default value |
---|---|---|
fieldName | string | undefined |
validatorName | string | undefined |
code | ValidationCode | undefined |
compile | boolean | true |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:60
compileValidations
▸ compileValidations(fieldNames
, force?
): void
Parameters
Name | Type | Default value |
---|---|---|
fieldNames | string | string [] | undefined |
force | boolean | false |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:68
getContainerFieldValidation
▸ getContainerFieldValidation(validations
, fields
, prefix?
, touchedOnly?
): ContainerValidation
Parameters
Name | Type | Default value |
---|---|---|
validations | AnonymousObject <FieldValidation > | undefined |
fields | AnonymousObject <Field > | undefined |
prefix | string | '' |
touchedOnly | boolean | true |
Returns
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:84
getValidation
▸ getValidation(fieldName
): FieldValidation
Parameters
Name | Type |
---|---|
fieldName | string |
Returns
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:155
hasValidation
▸ hasValidation(fieldName
, validatorName
, code
, message?
): boolean
Parameters
Name | Type |
---|---|
fieldName | string |
validatorName | string |
code | ValidationCode |
message? | string |
Returns
boolean
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:169
offChange
▸ offChange(type
, listener
, watchs
): void
Parameters
Name | Type |
---|---|
type | FormListenerType |
listener | FormListener |
watchs | string | string [] |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:181
offSubmittingChange
▸ offSubmittingChange(listener
): void
Parameters
Name | Type |
---|---|
listener | FormListener |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:201
offValidationChange
▸ offValidationChange(listener
, watchs
): void
Parameters
Name | Type |
---|---|
listener | FormListener |
watchs | string | string [] |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:209
offValueChange
▸ offValueChange(listener
, watchs
): void
Parameters
Name | Type |
---|---|
listener | FormListener |
watchs | string | string [] |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:217
onChange
▸ onChange(type
, listener
, watchs
, once
): void
Parameters
Name | Type |
---|---|
type | FormListenerType |
listener | FormListener |
watchs | string | string [] |
once | boolean |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:189
onSubmittingChange
▸ onSubmittingChange(listener
, once?
): void
Parameters
Name | Type | Default value |
---|---|---|
listener | FormListener | undefined |
once | boolean | false |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:205
onValidationChange
▸ onValidationChange(listener
, watchs
, once?
): void
Parameters
Name | Type | Default value |
---|---|---|
listener | FormListener | undefined |
watchs | string | string [] | undefined |
once | boolean | false |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:213
onValueChange
▸ onValueChange(listener
, watchs
, once?
): void
Parameters
Name | Type | Default value |
---|---|---|
listener | FormListener | undefined |
watchs | string | string [] | undefined |
once | boolean | false |
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
Name | Type |
---|---|
code | ValidationCode |
Returns
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:249
setResetting
▸ setResetting(resetting
): void
Parameters
Name | Type |
---|---|
resetting | boolean |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:245
setSubmitting
▸ setSubmitting(submitting
): void
Parameters
Name | Type |
---|---|
submitting | boolean |
Returns
void
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:265
setValidation
▸ setValidation(fieldName
, validatorName
, code
, message?
, compile?
): void
Parameters
Name | Type | Default value |
---|---|---|
fieldName | string | undefined |
validatorName | string | undefined |
code | ValidationCode | undefined |
message | string | '' |
compile | boolean | true |
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
Name | Type |
---|---|
fieldName | string |
value | 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:299
setValues
▸ setValues(values
): Generator
<void
| Generator
<void
| ForkEffect
<Generator
<void
| ValidationResult
, void
, ValidationResult
>>, string
[], Task
>, void
, string
[]>
Parameters
Name | Type |
---|---|
values | AnonymousObject <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
Name | Type |
---|---|
values | AnonymousObject <any > |
validations | AnonymousObject <FieldValidation > |
resubmit | () => void |
onSuccess | FormSubmitCallback |
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
Name | Type |
---|---|
fieldName | string |
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
Name | Type |
---|---|
fieldName | string |
validatorName | string |
validator | Validator |
value | any |
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
Name | Type |
---|---|
values | AnonymousObject <any > |
Returns
Generator
<void
| ForkEffect
<Generator
<void
| ValidationResult
, void
, ValidationResult
>>, string
[], Task
>
Defined in
onekijs/packages/onekijs-framework/src/form/FormService.ts:392