Home Reference Source

References

summary
public

JediValidate - validation

i18n

summary
public

Dictionary for translation

lib

summary
public

F ajax(options: Object, translate: function, RequestType: function): Promise

Sending request

public

F convertData(data: object, type: string, FileListType: function, FormDataType: function): string | FormData

Convert data object to a value for sending

public

Convert input name to path array

public

F getQueryPart(name: string, data: object | Array | string): string

Create query portion of url for serialize method

public

F deepmerge(first: Object | Array | *, second: Object | Array | *): Object | Array | *

Merge literal object deeply and concat arrays

public

F createObject(path: Array, value: string | FileList): object

Create object by path and value

public

F getData(inputs: object): object

Get data object with values from inputs object

public

F getInputData(input: HTMLInputElement | Array): object

Get input value as an object keyed by input name

public

F getInputName(input: HTMLInputElement | Array): string

Get name from input or array of inputs

public

F getInputValue(input: Element | HTMLInputElement | HTMLSelectElement | Array): string | Date | FileList | Array

Get form input value

public

Get value from radio group

public

F getValueByName(name: string, data: object): *

Get value from data object by name

public

F getValueByPath(path: Array, data: object): string

Get value from data object by path

public

F getFormOptions(form: HTMLFormElement): {ajax: {url: string, method: string, enctype: string, sendType: *}}

Get ajax options from form

public

F getInputRules(input: HTMLInputElement | HTMLSelectElement): object

Get validatation options from input attribute of className

public

F email(value: string): boolean

Check value is an email

public

F extension(value: FileList, extensions: string): boolean

Check file extensions

public

F filesize(value: FileList, size: number): boolean

Check file sizes are less than max

public

F max(value: number, number: number): boolean

Check value is less than max number

public

F maxDate(date: Date, maxdate: Date): boolean

Check date is less than max date

public

F min(value: number, number: number): boolean

Check value is greater than min number

public

F minDate(date: Date, mindate: Date): boolean

Check value is greater than min date

public

F regexp(value: string, exp: RegExp): boolean

Test RegExp

public

F required(value: string | FileList | Array): boolean

Check value is not empty

public

F step(value: number, number: number): boolean

Check value is multiple of number

public

F tel(value: string): boolean

Check value is phone number

public

F url(value: string): boolean

Check value is url

private

F initErrorMessages(rules: object, messages: object, methods: object): Object<string, Object<string, string>>

Init error messages

private

F markError(field: Element, message: Element, classes: object, errors: Array<string>)

Mark field as invalid

private

F markField(field: Element, message: *, states: *, errors: *)

Mark field

private

F markValid(field: Element, message: Element, classes: object)

Mark field as valid

public

F isCheckable(params: *, data: object): *

Check rule for dependencies

public

F validateData(rules: object, methods: object, data: object, errorMessages: object, translate: function): object<string, Array<string>>

Validate data object

public

F validateField(rules: object, methods: object, value: string | FileList | Array, name: string, errorMessages: object, data: object, translate: function): Array<string>

Validate field

Directories