Simple form validation library for React Native.

Overview

Foect Build Status npm version

Simple form validation library for React Native.

Installing

Npm

npm i --save foect

Yarn

yarn add foect

Quick Start

import { TextInput, Text, View, Button } from 'react-native';
import Foect from 'foect';

// ...

<Foect.Form
  defaultValue={{
    email: '[email protected]'
  }}
  onValidSubmit={model => {
    console.log(model); // { fullName: 'John Doe', email: '[email protected]' ... }
  }}
>
  { /* you can use form for triggering submit or checking form state(form.isSubmitted, form.isValid, ...) */ }
  { form => (
    <View>
      { /* every Foect.Control must have a name and optionally validation rules */ }
      <Foect.Control name="fullName" required minLength={2} maxLength={32}>
        { /* you can use control for getting/setting it's value, checking/updating(control.isValid, control.markAsTouched(), ...) it's state, checking it's errors(control.errors.required) */ }
        { control => (
          <View>
            <Text>Full Name</Text>

            <TextInput
              style={{height: 40, borderColor: 'gray', borderWidth: 1}}
              { /* mark control as touched on blur */ }
              onBlur={control.markAsTouched}
              { /* update control's value */ }
              onChangeText={(text) => control.onChange(text)}
              { /* get control's value */ }
              value={control.value}
            />

            { /* check control state and show error if necessary */ }
            { control.isTouched &&
              control.isInvalid && 
              <Text style={{ color: 'red' }}>Please enter your name.</Text> }
          </View>
        ) }
      </Foect.Control>

      <Foect.Control name="password" required pattern={/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/}>
        { control => (
          <View>
            <Text>Password</Text>

            <TextInput
              style={{height: 40, borderColor: 'gray', borderWidth: 1}}
              secureTextEntry={true}
              onBlur={control.markAsTouched}
              onChangeText={(text) => control.onChange(text)}
              value={control.value}
            />

            { control.isTouched &&
              control.isInvalid && 
              <View>
                { control.errors.pattern ?
                  <Text style={{ color: 'red' }}>Please provide a strong password.</Text> : 
                  <Text style={{ color: 'red' }}>Please enter your password.</Text> }
              </View> }
          </View>
        ) }
      </Foect.Control>

      <Foect.Control name="email" required email>
        { control => (
          <View>
            <Text>Email</Text>

            <TextInput
              style={{height: 40, borderColor: 'gray', borderWidth: 1}}
              keyboardType="email-address"
              onBlur={control.markAsTouched}
              onChangeText={(text) => control.onChange(text)}
              value={control.value}
            />

            { control.isTouched &&
              control.isInvalid && 
              <View>
                <Text>{control.value} is not a valid email.</Text>
              </View> }
          </View>
        ) }
      </Foect.Control>

      { /* submit form */ }
      <Button disabled={form.isInvalid} onPress={() => form.submit()} title="Register" />
    </View>
  ) }
</Foect.Form>

Documentation

Types

type Status = 'INIT' | 'VALID' | 'INVALID';
type Model = { [key: string]: any };
// { firstName: 'John', lastName: 'Doe' }
type Errors = { [key: string]: boolean };
// { required: true, email: true }
type FormErrors = { [name: string]: Errors };
// { firstName: { required: true, minLength: true } }
type Validator = (value: any, config?: any, control?: Control) => ValidatorResult;
type ValidatorResult = null | Errors;

Props

Form

  • children: (form: Form) => Element child renderer function.
  • defaultValue?: Model default values for form.
  • onChange?: (model: Model) => void callback called on value change.
  • onValidSubmit?: (model: Model) => void callback called on valid submit.
  • onInvalidSubmit?: (errors: FormErrors, model: Model) => void callback called on invalid submit.

Control

  • children: (control: Control) => Element child renderer function.
  • name: string control name.
  • [validator: string]: any; validation rules for control.

APIs

Form

  • status: Status form status.

  • errors: FormErrors form errors.

  • isValid: boolean is form valid.

  • isInvalid: boolean is form invalid.

  • isSubmitted: boolean is form submitted.

  • addControl(name: string, control: Control): void adds a new control to form.

  • removeControl(name: string): void removes a control from form.

  • getValue(name: string): any returns value of a control.

  • setValue(name: string, value: any): void sets value for a control.

  • getErrors(name: string): Status returns errors of a control.

  • setErrors(name: string, errors: Errors): void sets errors for a control.

  • validateControl(name: string): void validates a control and updates control state, errors.

  • getStatus(name: string): Status returns status of a control.

  • update(): void force updates form and all child controls.

  • submit(): void submits the form. calls onInvalidSubmit or onValidSubmit callback if provided.

Control

  • value: any control value.

  • form: Form control's form.

  • status: Status control status.

  • errors: Errors control errors.

  • isValid: boolean is control valid.

  • isInvalid: boolean is control invalid.

  • isTouched: boolean is control touched.

  • isUntouched: boolean is control untouched.

  • onChange(value: any): void updates control's value.

  • markAsTouched(): void marks control as touched.

  • markAsUntouched(): void marks control as untouched.

  • runValidation(value: any): Errors runs validation with a value and returns errors.

Validators

Default validators
Validator Options
required -
minLength length: number
maxLength length: number
pattern pattern: RegExp
email -
equalToControl controlName: string
callback (value: any, control: Control) => boolean

Options are passed via props

<Foect.Control
  name="password2"
  myValidator={{foo: 'bar'}}
>

with this definition, myValidator called with ('value of the input', {foo: 'bar'}, controlRef)

You can add your own validators via Foect.Validators.add. Validators must return null on valid value and object with errors on invalid value. For example:

Foect.Validators.add('equalToControl', (val: any, controlName: string, control: Control) => {
  if (null === val) {
    return null;
  }

  return val === control.form.getValue(controlName) ? null : { equalToControl: true };
})
  • Foect.Validators.add(validatorName: string, fn: Validator): void adds a new validator.
  • Foect.Validators.get(validatorName: string): Validator returns a validator.
  • Foect.Validators.has(validatorName: string): boolean returns whether a validator exists.
  • Foect.Validators.delete(validatorName: string): void deletes a validator.

Inspired by Angular Forms.

Comments
  • Undefined is not an object (evaluating ''control.runvalidation

    Undefined is not an object (evaluating ''control.runvalidation")

    error

    Hi, I am getting this error, may I know what's wrong with it? Previously still working fine with both Android & IOS, but afterwards i rerun again in Android, it shows me this error in Android, it is working fine in IOS, feel nothing much change on the codes. While i tried to debug it by turning on debug mode, this error gone in Android's debug mode. Weird, wish to get the solution as soon as possible. Many thanks. @unexge

    opened by JazLow 4
  • add method for mark whole form touched/untouched

    add method for mark whole form touched/untouched

    seems there is not a very easy way to just mark all controls in form as touched? this is for the case you just submit the form without any fill for now we can use form.state.controls though

    this._form.state.controls.forEach(function (item) {
          item.markAsTouched();
    });
    

    Thanks for this greate lib!

    opened by clijiac 3
  • Bump js-yaml from 3.8.2 to 3.13.1

    Bump js-yaml from 3.8.2 to 3.13.1

    Bumps js-yaml from 3.8.2 to 3.13.1.

    Changelog

    Sourced from js-yaml's changelog.

    [3.13.1] - 2019-04-05

    Security

    • Fix possible code execution in (already unsafe) .load(), #480.

    [3.13.0] - 2019-03-20

    Security

    • Security fix: safeLoad() can hang when arrays with nested refs used as key. Now throws exception for nested arrays. #475.

    [3.12.2] - 2019-02-26

    Fixed

    • Fix noArrayIndent option for root level, #468.

    [3.12.1] - 2019-01-05

    Added

    • Added noArrayIndent option, #432.

    [3.12.0] - 2018-06-02

    Changed

    • Support arrow functions without a block statement, #421.

    [3.11.0] - 2018-03-05

    Added

    • Add arrow functions suport for !!js/function.

    Fixed

    • Fix dump in bin/octal/hex formats for negative integers, #399.

    [3.10.0] - 2017-09-10

    Fixed

    • Fix condenseFlow output (quote keys for sure, instead of spaces), #371, #370.
    • Dump astrals as codepoints instead of surrogate pair, #368.

    [3.9.1] - 2017-07-08

    Fixed

    • Ensure stack is present for custom errors in node 7.+, #351.

    [3.9.0] - 2017-07-08

    Added

    • Add condenseFlow option (to create pretty URL query params), #346.

    Fixed

    ... (truncated)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump diff from 3.2.0 to 3.5.0

    Bump diff from 3.2.0 to 3.5.0

    Bumps diff from 3.2.0 to 3.5.0.

    Changelog

    Sourced from diff's changelog.

    v3.5.0 - March 4th, 2018

    • Omit redundant slice in join method of diffArrays - 1023590
    • Support patches with empty lines - fb0f208
    • Accept a custom JSON replacer function for JSON diffing - 69c7f0a
    • Optimize parch header parser - 2aec429
    • Fix typos - e89c832

    Commits

    v3.4.0 - October 7th, 2017

    • #183 - Feature request: ability to specify a custom equality checker for diffArrays
    • #173 - Bug: diffArrays gives wrong result on array of booleans
    • #158 - diffArrays will not compare the empty string in array?
    • comparator for custom equality checks - 30e141e
    • count oldLines and newLines when there are conflicts - 53bf384
    • Fix: diffArrays can compare falsey items - 9e24284
    • Docs: Replace grunt with npm test - 00e2f94

    Commits

    v3.3.1 - September 3rd, 2017

    • #141 - Cannot apply patch because my file delimiter is "/r/n" instead of "/n"
    • #192 - Fix: Bad merge when adding new files (#189)
    • correct spelling mistake - 21fa478

    Commits

    v3.3.0 - July 5th, 2017

    • #114 - /patch/merge not exported
    • Gracefully accept invalid newStart in hunks, same as patch(1) does. - d8a3635
    • Use regex rather than starts/ends with for parsePatch - 6cab62c
    • Add browser flag - e64f674
    • refactor: simplified code a bit more - 8f8e0f2
    • refactor: simplified code a bit - b094a6f
    • fix: some corrections re ignoreCase option - 3c78fd0
    • ignoreCase option - 3cbfbb5
    • Sanitize filename while parsing patches - 2fe8129
    • Added better installation methods - aced50b
    • Simple export of functionality - 8690f31

    Commits

    Commits
    • e9ab948 v3.5.0
    • b73884c Update release notes
    • 8953021 Update release notes
    • 1023590 Omit redundant slice in join method of diffArrays
    • c72ef4a Add missing test coverage
    • b9ef24f Support patches with empty lines
    • 10aaabb Support patches with empty lines
    • 196d3aa Support patches with empty lines
    • e24d789 Support patches with empty lines
    • 8616a02 Support patches with empty lines
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump stringstream from 0.0.5 to 0.0.6

    Bump stringstream from 0.0.5 to 0.0.6

    Bumps stringstream from 0.0.5 to 0.0.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump lodash.merge from 4.6.0 to 4.6.2

    Bump lodash.merge from 4.6.0 to 4.6.2

    Bumps lodash.merge from 4.6.0 to 4.6.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump handlebars from 4.0.6 to 4.7.2

    Bump handlebars from 4.0.6 to 4.7.2

    Bumps handlebars from 4.0.6 to 4.7.2.

    Changelog

    Sourced from handlebars's changelog.

    v4.7.2 - January 13th, 2020

    Bugfixes:

    • fix: don't wrap helpers that are not functions - 9d5aa36, #1639

    Chore/Build:

    • chore: execute saucelabs-task only if access-key exists - a4fd391

    Compatibility notes:

    • No breaking changes are to be expected

    Commits

    v4.7.1 - January 12th, 2020

    Bugfixes:

    • fix: fix log output in case of illegal property access - f152dfc
    • fix: log error for illegal property access only once per property - 3c1e252

    Compatibility notes:

    • no incompatibilities are to be expected.

    Commits

    v4.7.0 - January 10th, 2020

    Features:

    • feat: default options for controlling proto access - 7af1c12, #1635
      • This makes it possible to disable the prototype access restrictions added in 4.6.0
      • an error is logged in the console, if access to prototype properties is attempted and denied and no explicit configuration has taken place.

    Compatibility notes:

    • no compatibilities are expected

    Commits

    v4.6.0 - January 8th, 2020

    Features:

    • feat: access control to prototype properties via whitelist (#1633)- d03b6ec
    ... (truncated)
    Commits
    • 586e672 v4.7.2
    • f0c6c4c Update release notes
    • a4fd391 chore: execute saucelabs-task only if access-key exists
    • 9d5aa36 fix: don't wrap helpers that are not functions
    • 14ba3d0 v4.7.1
    • 4cddfe7 Update release notes
    • f152dfc fix: fix log output in case of illegal property access
    • 3c1e252 fix: log error for illegal property access only once per property
    • 0d5c807 v4.7.0
    • 1f0834b Update release notes
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by knappi, a new releaser for handlebars since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump extend from 3.0.0 to 3.0.2

    Bump extend from 3.0.0 to 3.0.2

    Bumps extend from 3.0.0 to 3.0.2.

    Changelog

    Sourced from extend's changelog.

    3.0.2 / 2018-07-19

    • [Fix] Prevent merging __proto__ property (#48)
    • [Dev Deps] update eslint, @ljharb/eslint-config, tape
    • [Tests] up to node v10.7, v9.11, v8.11, v7.10, v6.14, v4.9; use nvm install-latest-npm

    3.0.1 / 2017-04-27

    • [Fix] deep extending should work with a non-object (#46)
    • [Dev Deps] update tape, eslint, @ljharb/eslint-config
    • [Tests] up to node v7.9, v6.10, v4.8; improve matrix
    • [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG.
    • [Docs] Add example to readme (#34)
    Commits
    • 8d106d2 v3.0.2
    • e97091f [Dev Deps] update tape
    • e841aac [Tests] up to node v10.7
    • 0e68e71 [Fix] Prevent merging proto property
    • a689700 Only apps should have lockfiles
    • f13c1c4 [Dev Deps] update eslint, @ljharb/eslint-config, tape
    • f3570fe [Tests] up to node v10.0, v9.11, v8.11, v7.10, v6.14, v4.9; use...
    • 138b515 v3.0.1
    • 7e19a6f [Tests] up to node v7.9, v6.10, v4.8; improve matrix
    • 0191e27 [Dev Deps] update tape, eslint, @ljharb/eslint-config
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump lodash from 4.17.4 to 4.17.15

    Bump lodash from 4.17.4 to 4.17.15

    Bumps lodash from 4.17.4 to 4.17.15.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump brace-expansion from 1.1.6 to 1.1.11

    Bump brace-expansion from 1.1.6 to 1.1.11

    Bumps brace-expansion from 1.1.6 to 1.1.11.

    Release notes

    Sourced from brace-expansion's releases.

    1.1.11

    No release notes provided.

    v1.1.11

    brace-expansion

    Brace expansion, as known from sh/bash, in JavaScript.

    build status downloads Greenkeeper badge

    testling badge

    Example

    var expand = require('brace-expansion');
    
    expand('file-{a,b,c}.jpg')
    // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
    
    expand('-v{,,}')
    // => ['-v', '-v', '-v']
    
    expand('file{0..2}.jpg')
    // => ['file0.jpg', 'file1.jpg', 'file2.jpg']
    
    expand('file-{a..c}.jpg')
    // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
    
    expand('file{2..0}.jpg')
    // => ['file2.jpg', 'file1.jpg', 'file0.jpg']
    
    expand('file{0..4..2}.jpg')
    // => ['file0.jpg', 'file2.jpg', 'file4.jpg']
    
    expand('file-{a..e..2}.jpg')
    // => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
    
    expand('file{00..10..5}.jpg')
    // => ['file00.jpg', 'file05.jpg', 'file10.jpg']
    
    expand('{{A..C},{a..c}}')
    // => ['A', 'B', 'C', 'a', 'b', 'c']
    
    expand('ppp{,config,oe{,conf}}')
    // => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
    
    ... (truncated)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump tough-cookie from 2.3.2 to 2.3.4

    Bump tough-cookie from 2.3.2 to 2.3.4

    Bumps tough-cookie from 2.3.2 to 2.3.4.

    Commits
    • e4dfb0a 2.3.4
    • 7d66ffd Update public suffix list
    • 7564c06 Merge pull request #100 from salesforce/no-re-parser
    • 751da6d Document removal of 256 space limit
    • 8452ccd Convert date-time parser from regexp, expand tests
    • 8614dbf More String#repeat polyfill
    • 2a4775c Avoid unbounded Regexp parts in date parsing
    • c9bd79d Parse cookie-pair part without regexp
    • 12d4266 2.3.3
    • 98e0916 Merge pull request #97 from salesforce/spaces-ReDoS
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • [WIP] Mark `componentWillMount`s as unsafe

    [WIP] Mark `componentWillMount`s as unsafe

    fixes #19.

    • [ ] fix failing tests

    tests are failing because unsafe aliases available only in React 16.3+ but tests are running with React 15.4. for using 16.3+ in tests enzyme 2 also needs to be upgraded to 3

    opened by unexge 0
  • Upgrade LifeCycle event componentWillMount  to fit newest React Native version

    Upgrade LifeCycle event componentWillMount to fit newest React Native version

    the newest RN0.61.5 use React 16.9 which will warn when you use componentWillMount etc

    Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

    • Move code with side effects to componentDidMount, and set initial state in the constructor.
    • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder. Please update the following components: Form
    opened by clijiac 0
  • Control component fallback to empty string breaks type strict code

    Control component fallback to empty string breaks type strict code

    https://github.com/unexge/foect/blob/834f4a8862faea5aad9b09d0befc8ad2a267717c/src/control.ts#L70

    As you can see above link. if form value is falsy control component fallbacks to empty string. This misdirects to developers and causes to break type strict codes.

    For example; A react native date picker component requires value as Date object or undefined and control value fallbacks to empty string when passed value undefined for an unselected date. Due to react-native, it crashes the app because native code expects Date object.

    opened by EricMcRay 2
Releases(v0.1.5)
Owner
null
FM Form is a module for React Native to fast generate pages with a form.

react-native-fm-form FM Form is a module for React Native to fast generate pages with a form. It works like Backbone forms. Using this module you can

Yi Wang 13 Dec 9, 2021
📋 React Hooks for forms validation (Web + React Native)

Version 7 | Version 6 English | 日本語 Features Built with performance, UX and DX in mind Embraces native form validation Out of the box integration with

React Hook Form 32.6k Jan 8, 2023
A simple react-native component to wrap your form fields and get their values with just one single method.

react-native-form A simple react-native component to wrap your form fields and get their values without attaching listeners everywhere. Installation n

Juliano Duarte 145 Nov 11, 2022
A Formik inspired form library that uses MobX under the hood

Formix A Formik inspired form library that uses MobX under the hood and update only the changed fields. Installation Using npm: npm install @euk-labs/

Shoulders 6 Dec 29, 2021
📝 Form component for React Native.

Gifted Form Form component for React Native. Example var { GiftedForm, GiftedFormManager } = require('react-native-gifted-form'); var FormComponent =

Farid Safi 1.4k Dec 19, 2022
Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components

react-native-clean-form Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components Bi

Esben Petersen 475 Oct 30, 2022
A simple, declarative API for creating cross-platform, native-appearing forms with React Native

React Native Forms Project status I wrote this library several (many?) years ago for a use-case at work, when React Native was still quite young, comp

Michael Helvey 87 Jul 10, 2022
Forms library for react-native

Notice tcomb-form-native is looking for maintainers. If you're interested in helping, a great way to get started would just be to start weighing-in on

Giulio Canti 3.2k Dec 17, 2022
Generate forms with native look and feel in a breeze

React Native Form Generator Generate forms with native look and feel in a breeze Components Picker DatePicker TimePicker Input Link Separator Switch F

Michael Cereda 375 Dec 7, 2022
Build forms in React, without the tears 😭

Build forms in React, without the tears. Visit https://formik.org to get started with Formik. Organizations and projects using Formik List of organiza

Formium 31.7k Dec 31, 2022
Angular like reactive forms in React.

React Reactive Forms It's a library inspired by the Angular's Reactive Forms, which allows to create a tree of form control objects in the component c

Kuldeep Saxena 290 Nov 26, 2022
React component for convert the valle screens-api data structure to web component based forms.

valleForm React component for convert the valle screens-api data structure to web component based forms. Write <valleForm tabs = { [...] } but

Valle Sistemas de Gestão 7 Dec 16, 2021
Project using React Router, Styled Components, useEffect, useState and context

Before run do the steps bellow install npm or yarn To run this application you can just use npm or if you want, yarn is another option. Download NPM I

Guilherme Mello 0 Dec 29, 2021
Remix-validity-state is a small React form validation library that aims to embrace HTML input validation and play nicely with Remix primitives

Remix-validity-state is a small React form validation library that aims to embrace HTML input validation and play nicely with Remix primitives

Matt Brophy 108 Dec 17, 2022
React Hook Form Validation example with react-hook-form 7 and Bootstrap 4

React Hook Form Validation example with react-hook-form 7 and Bootstrap 4 Project setup In the project directory, you can run: npm install # or yarn i

JS-IT 4 Mar 17, 2022
React Hook Form: A Form whit some fiels and standard validation on it

React Hook Form: A Form whit some fiels and standard validation on it

null 1 Feb 10, 2022
Simple form validation library for React and React Native

React Cee Form Inspired by react hook form and their props name and rewritten in a simple way. It can be used for both React Native and ReactJs. Don't

Hung Vu 5 Aug 28, 2022
Simple form validation library for React Native.

Foect Simple form validation library for React Native. Installing Npm npm i --save foect Yarn yarn add foect Quick Start import { TextInput, Text, V

null 38 Nov 11, 2022
A simple react and react native form validator inspired by Laravel validation.

Simple React Validator is exactly as it sounds. We wanted to build a validator for react that had minimal configuration and felt natural to use. It's configuration and usage is similar to the Laravel PHP framework and make validation as easy as one line.

Dockwa 266 Jan 3, 2023
Simple-as-possible React form validation

Simple-as-possible React form validation

Zach Silveira 281 Nov 11, 2022