Facile is an HTML form validator that is inspired by Laravel's validation style and is designed for simplicity of use.

Overview

Facile Validator

npm version npm downloads Github Actions CI License

Laravel-inspired validation for HTML forms, built for simplicity of use: 😋

Facile (French word for "easy", pronounced fa·sil) is an HTML form validator that is inspired by Laravel's validation style and is designed for simplicity of use.

DEMO

Table of Contents

Note: This package does not include any polyfills. If you want to use in old environments, add this package to your project's config transpiling list.


Installation

npm i @upjs/facile-validator

# or
yarn add @upjs/facile-validator

Usage

HTML:

">
<form>
  <input data-rules="bail|required|number|between:1,10" />
form>

The rules for each field are separated with a pipe character (vertical line) |. In this example, we've assigned 4 rules for that input:

  • bail
  • required
  • number
  • between (with two arguments: 1 and 10)

JavaScript:

import { Validator, enLang as en } from '@upjs/facile-validator';

// Select the container element that contains the fields
const form = document.querySelector('form');

// Create an instance of Validator for the container element
const v = new Validator(form, {
  lang: en,
});

form.addEventListener('submit', (e) => {
  e.preventDefault();
  
  // Call validate method to start validation
  v.validate();
});


// Handle error-free validation
v.on('validation:success', () => {
  alert('Nice! The form was validated without any errors');
});

// Handle failed validation
v.on('validation:failed', () => {
  alert('Oops! There are some errors in the form.');
});

Now every input with data-rules attribute in the form will be validated.


Handling Events

When the validation starts, ends, succeeds or fails, there are easy ways to handle these events. We do this with the help of the Hooks. A hook is simply a function that you define to be executed when a particular event occurs.

There are five type of events that can be handled with the hooks:

To attach a hook to these events, use on method:

v.on(event_name, () => {
  // This function will be executed when the respective event occurs.
});

You can also attach those hooks in the config object:

const v = new Validator(form, {
  // ...
  on: {
    'validation:success': () => {
      alert('Success! Form validated with no errors');
    },
  },
});

validation:start

As you might have guessed, this event will occur when the validation starts:

v.on('validation:start', (form) => {
  // This function will be executed when the validation starts
});

validation:end

This event will occur when the validation ends, no matter if it was successful or not:

v.on('validation:end', (form, isSuccessful) => {
  // This function will be executed when the validation ends
});

validation:success

This event will occur when the validation ends with no errors:

v.on('validation:success', (form) => {
  // Do something after successful validation e.g. send the form-data to the server
});

validation:failed

This event will occur when the validation ends while there are some errors in the form:

v.on('validation:failed', (form) => {
  // Notify the user to fix the form
});

field:error

When a particular field has errors, you can handle the errors with this event:

v.on('field:error', (form, field, errors) => {
  errors.forEach(error => {
    console.log(error.args);
    console.log(error.message);
    console.log(error.rule);
    console.log(error.element);
  });
});

This is a good place to display errors in your own format. By default, the validator automatically shows error messages below each input. However, you can disable this feature by setting renderErrors option to false in the config object:

const v = new Validator(form, {
  renderErrors: false,
});

Available Validation Rules:


accepted

The field under validation (checkbox, radio) must be checked:

">
<input data-rules="accepted" />

alpha

The field under validation must contain only alphabetic characters:

">
<input data-rules="alpha" />

Some valid inputs:

  • Hello
  • français
  • سلام

alpha-num

The field under validation must contain only alpha-numeric characters:

">
<input data-rules="alpha-num" />

Some valid inputs:

  • abc123
  • abc
  • 123

alpha-num-dash

The field under validation must contain only alpha-numeric characters, dashes, and underscores:

">
<input data-rules="alpha-num-dash" />

Some valid inputs

  • abc-123
  • abc_123
  • abc123
  • abc
  • 123

bail

Stops running validation rules for the field after the first validation failure:

">
<input data-rules="bail|required|number|between:1,10" />

required rule will be processed and if it fails, other rules will not be processed.


between

The field under validation must be a number between the given range:

">
<input data-rules="between:1,10" />

The numbers lower than 1 and higher than 10 are not accepted.


digits

The field under validation must be a number with the given length:

">
<input data-rules="digits:10" />

Only a number with the length of 10 is accepted (e.g. 1234567890)


email

The field under validation must be an email:

">
<input data-rules="email" />

ends-with

The field under validation must end with the given substring:

">
<input data-rules="ends-with:ies" />

Only the words that end with ies (technologies, parties, allies, ...) are accepted.


int

The field under validation must be an integer (positive or negative):

">
<input data-rules="int" />

You can also use integer rule.


max

This rule is used for multiple purposes.

In the combination with the number rule, the field under validation must be a number less than or equal to the given number:

">
<input data-rules="number|max:50" />

Only a number less than or equal to 50 are accepted.

If max is used without number rule, the field under validation is considered as a string and then the field under validation must be a string with a maximum length of the given number:

">
<input data-rules="max:5" />

Only strings with the length of 5 or less are accepted.


min

This rule is used for multiple purposes.

In the combination with the number rule, the field under validation must be a number greater than or equal to the given number:

">
<input data-rules="number|min:50" />

Only a number greater than or equal to 50 will be accepted.

If min rule is used without number rule, the field under validation is considered as a string and then The field under validation must be a string with a minimum length of the given number.

">
<input data-rules="min:5" />

Only strings with the length of 5 or higher will be accepted.


nullable

The field under validation can be empty:

">
<input data-rules="nullable|min:5" />

min rule will not be processed unless the field is filled. Note that the rules order is important. In this example, if nullable rule comes after min rule, the validator first processes min rule and then nullable rule.


num-dash

The field under validation must contain only numeric characters, dashes, and underscores:

">
<input data-rules="num-dash" />

1000, 123-456, 123_456 are some valid inputs for this rule.


number

The field under validation must be a number:

">
<input data-rules="number" />

required

The field under validation must not be empty:

">
<input data-rules="required" />

size

This rule is used for multiple purposes.

In the combination with the number rule, the field under validation must be a number equal to the given number:

">
<input data-rules="number|size:1000" />

Only 1000 is accepted.

If used without number rule, the field under validation is considered as a string and then the field under validation must be a string with the exact length of the given argument:

">
<input data-rules="size:5" />

Only the strings with the length of 5 are accepted.


starts-with

The field under validation must start with the given substring:

">
<input data-rules="starts-with:app" />

Only the words that start with app (apple, application, append, ...) are accepted.


in

The field under validation must be in the list of the given arguments:

">
<input data-rules="in:red,green,blue" />

Only red or green or blue are valid inputs.

in rule can also be used with a ">

<select data-rules="array|in:1,3" name="names[]" multiple>
  <option value="1">1option>
  <option value="2">2option>
  <option value="3">3option>
select>

Only 1, 3 or both are accepted.



Localization

When instantiating the Validator class, importing a language is mandatory. This allows you to keep the bundle size as minimal as possible by including only the desired language:

import { Validator, enLang as en } from '@upjs/facile-validator';

const form = document.querySelector('form');
const v = new Validator(form, {
  lang: en,
});

Facile Validator currently supports these languages by default:

  • English (import with enLang)
  • Persian (import with faLang)

We welcome any contributions for other languages. The languages are located in this path. Just copy any file, translate it into your own language and then make a PR.


Using your own language

Use createLang function to define your own error messages:

import { Validator, enLang as en, createLang } from '@upjs/facile-validator';

const myLang = createLang({
  required: 'Please fill out this field',
  accepted: 'Please accept this field',
});

const v = new Validator(form, {
  lang: myLang,
});

Note that in this case you should define a message for each existing rule. Although, to override only certain messages, pass the original language object:

import { Validator, enLang as en, createLang } from '@upjs/facile-validator';

const myLang = createLang({
  ...en,
  required: 'Please fill out this field',
  accepted: 'Please accept this field',
});

License

MIT

Comments
  • Implement new translation

    Implement new translation

    Dear Ali, May I ask you to : 1 - Describe how to add new built-in language? 2 - Why data-rule not working on "textarea" tag. 3 - How to change the language on website/web application dynamically? (laravel 9 project) thanks

    opened by AliMehraei 5
  • Not required but prevents form from submission

    Not required but prevents form from submission

    Dear @AliN11 1- How to define a data-rule on input tag that it is not required but if the user enter something in the input, the entered value must be a positive number. But now if the input element leaved blank, this package prevents form from submission. The current defined rule is : data-rules="number|min:1" note: I know that we can use "nullable", but if an input tag is not required why we have to use "nullable"? 2- we need a data rule to accept space in addition to alpha, number and dashes, like alpha-num-dash-space

    opened by AliMehraei 3
  • chore(deps): update dependency @babel/types to v7.18.4

    chore(deps): update dependency @babel/types to v7.18.4

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @babel/types (source) | 7.18.2 -> 7.18.4 | age | adoption | passing | confidence |


    Release Notes

    babel/babel

    v7.18.4

    Compare Source

    :eyeglasses: Spec Compliance
    :bug: Bug Fix
    :house: Internal
    • babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-plugin-transform-modules-systemjs

    Configuration

    📅 Schedule: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update dependency jsdom to v20.0.3

    chore(deps): update dependency jsdom to v20.0.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | jsdom | 20.0.2 -> 20.0.3 | age | adoption | passing | confidence |


    Release Notes

    jsdom/jsdom

    v20.0.3

    Compare Source

    • Updated dependencies, notably w3c-xmlserializer, which fixes using DOMParser on XML documents containing emoji.

    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency @types/ws to v8.5.4

    chore(deps): update dependency @types/ws to v8.5.4

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @types/ws (source) | 8.5.3 -> 8.5.4 | age | adoption | passing | confidence |


    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency husky to v8.0.2

    chore(deps): update dependency husky to v8.0.2

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | husky (source) | 8.0.1 -> 8.0.2 | age | adoption | passing | confidence |


    Release Notes

    typicode/husky

    v8.0.2

    Compare Source

    • docs: remove deprecated npm set-script

    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency @babel/types to v7.20.7

    chore(deps): update dependency @babel/types to v7.20.7

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @babel/types (source) | 7.20.0 -> 7.20.7 | age | adoption | passing | confidence |


    Release Notes

    babel/babel

    v7.20.7

    Compare Source

    :eyeglasses: Spec Compliance
    • babel-helper-member-expression-to-functions, babel-helper-replace-supers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes
    • babel-helpers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes, babel-plugin-transform-object-super
    :bug: Bug Fix
    • babel-parser, babel-plugin-transform-typescript
    • babel-traverse
    • babel-plugin-transform-typescript, babel-traverse
    • babel-plugin-transform-block-scoping
    • babel-plugin-proposal-async-generator-functions, babel-preset-env
    • babel-generator, babel-plugin-proposal-optional-chaining
    • babel-plugin-transform-react-jsx, babel-types
    • babel-core, babel-helpers, babel-plugin-transform-computed-properties, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
    • babel-helper-member-expression-to-functions, babel-helper-replace-supers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes
    • babel-generator
    :nail_care: Polish
    :house: Internal
    • babel-helper-define-map, babel-plugin-transform-property-mutators
    • babel-core, babel-plugin-proposal-class-properties, babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-plugin-transform-destructuring, babel-plugin-transform-parameters, babel-plugin-transform-regenerator, babel-plugin-transform-runtime, babel-preset-env, babel-traverse
    :running_woman: Performance

    v7.20.5

    Compare Source

    :eyeglasses: Spec Compliance
    • babel-helpers, babel-plugin-transform-destructuring, babel-plugin-transform-modules-commonjs, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime, babel-traverse
    • babel-cli, babel-helpers, babel-plugin-proposal-class-properties, babel-plugin-proposal-class-static-block, babel-plugin-transform-classes, babel-plugin-transform-runtime, babel-preset-env
    • babel-helper-create-class-features-plugin, babel-helpers, babel-plugin-proposal-decorators, babel-plugin-proposal-private-property-in-object, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
    :bug: Bug Fix
    • babel-parser
    • babel-helper-wrap-function, babel-preset-env, babel-traverse
    • babel-plugin-transform-arrow-functions, babel-plugin-transform-parameters, babel-traverse
    • babel-helpers, babel-node, babel-plugin-proposal-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
    • babel-helper-create-regexp-features-plugin
    • babel-parser, babel-types
    • babel-generator
    • babel-plugin-transform-block-scoping, babel-traverse
    :nail_care: Polish
    :house: Internal

    v7.20.2

    Compare Source

    :bug: Bug Fix
    • babel-core, babel-helper-create-class-features-plugin, babel-helper-module-transforms, babel-helper-plugin-utils, babel-helper-simple-access, babel-node, babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-plugin-transform-react-constant-elements, babel-preset-env, babel-standalone, babel-types
    • babel-plugin-transform-typescript
    • babel-parser
    • babel-generator
    • babel-plugin-proposal-decorators, babel-plugin-proposal-object-rest-spread, babel-plugin-transform-jscript
    • babel-plugin-transform-destructuring

    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency @babel/types to v7.20.0

    chore(deps): update dependency @babel/types to v7.20.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @babel/types (source) | 7.19.4 -> 7.20.0 | age | adoption | passing | confidence |


    Release Notes

    babel/babel

    v7.20.0

    Compare Source

    :rocket: New Feature
    • babel-compat-data, babel-helper-compilation-targets, babel-preset-env
    • babel-plugin-syntax-typescript
    • babel-generator, babel-parser, babel-plugin-syntax-explicit-resource-management, babel-plugin-transform-block-scoping, babel-plugin-transform-destructuring, babel-standalone, babel-traverse, babel-types
    • babel-generator, babel-parser, babel-plugin-syntax-import-reflection, babel-standalone, babel-types
    • babel-generator, babel-helper-skip-transparent-expression-wrappers, babel-parser, babel-plugin-transform-typescript, babel-traverse, babel-types
    :bug: Bug Fix
    :house: Internal
    • babel-helpers, babel-node, babel-plugin-proposal-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime

    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency vitest to v0.24.5

    chore(deps): update dependency vitest to v0.24.5

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | vitest | 0.24.3 -> 0.24.5 | age | adoption | passing | confidence |


    Release Notes

    vitest-dev/vitest

    v0.24.5

    Compare Source

       🚀 Features
       🐞 Bug Fixes
        View changes on GitHub

    v0.24.4

    Compare Source

       🚀 Features
       🐞 Bug Fixes
        View changes on GitHub

    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency unbuild to v0.9.4

    chore(deps): update dependency unbuild to v0.9.4

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | unbuild | 0.9.2 -> 0.9.4 | age | adoption | passing | confidence |


    Release Notes

    unjs/unbuild

    v0.9.4

    Compare Source

    📦 Build
    • Fix rollup-plugin-dts version (522687f)
    ❤️ Contributors
    • Pooya Parsa

    v0.9.3

    Compare Source

    📦 Build
    • Use latest rollup-plugin-dts (2b3953e)
    ❤️ Contributors
    • Pooya Parsa

    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency jsdom to v20.0.2

    chore(deps): update dependency jsdom to v20.0.2

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | jsdom | 20.0.1 -> 20.0.2 | age | adoption | passing | confidence |


    Release Notes

    jsdom/jsdom

    v20.0.2

    Compare Source

    • Fixed xhr.abort() to no longer give an exception when the constructed XMLHttpRequest was invalid. (whamtet)
    • Fixed event.getModifierState() on MouseEvent and KeyboardEvent instances to properly consult the ctrlKey, altKey, metaKey, and shiftKey properties of the event. (juzerzarif)
    • Fixed custom element creation to not be affected by any modifications to the window.customElements property. (bicknellr)

    Configuration

    📅 Schedule: Branch creation - "monthly" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Awaiting Schedule

    These updates are awaiting their schedule. Click on a checkbox to get an update now.

    • [ ] chore(deps): update dependency husky to v8.0.3
    • [ ] chore(deps): update dependency @unocss/preset-wind to v0.48.0
    • [ ] chore(deps): update dependency @unocss/reset to v0.48.0
    • [ ] chore(deps): update dependency eslint to v8.31.0
    • [ ] chore(deps): update dependency eslint-config-prettier to v8.6.0
    • [ ] chore(deps): update dependency lint-staged to v13.1.0
    • [ ] chore(deps): update dependency prettier to v2.8.1
    • [ ] chore(deps): update dependency typescript to v4.9.4
    • [ ] chore(deps): update dependency unocss to v0.48.0
    • [ ] chore(deps): update dependency vite to v3.2.5
    • [ ] chore(deps): update dependency vitest to v0.26.3
    • [ ] chore(deps): update typescript-eslint monorepo to v5.48.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
    • [ ] chore(deps): update dependency @types/node to v18
    • [ ] chore(deps): update dependency unbuild to v1
    • [ ] chore(deps): update dependency vite to v4

    Detected dependencies

    github-actions
    .github/workflows/deploy.yml
    • actions/checkout v3
    • JamesIves/github-pages-deploy-action v4.4.1
    .github/workflows/verify.yml
    • actions/setup-node v3
    npm
    package.json
    • @babel/types 7.20.7
    • @types/node 17.0.17
    • @types/ws 8.5.4
    • @typescript-eslint/eslint-plugin 5.40.0
    • @typescript-eslint/parser 5.40.0
    • @unocss/preset-wind 0.45.29
    • @unocss/reset 0.45.29
    • c8 7.12.0
    • eslint 8.25.0
    • eslint-config-prettier 8.5.0
    • eslint-plugin-prettier 4.2.1
    • husky 8.0.2
    • jsdom 20.0.3
    • lint-staged 13.0.3
    • path 0.12.7
    • prettier 2.7.1
    • standard-version 9.5.0
    • typescript 4.8.4
    • unbuild 0.9.4
    • unocss 0.45.29
    • vite 3.1.8
    • vitest 0.24.5

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Releases(v1.10.0)
  • v1.10.0(Aug 20, 2022)

  • v1.9.0(Aug 17, 2022)

    What's Changed

    • chore(deps): update dependency @unocss/preset-wind to v0.45.6 by @renovate in https://github.com/upjs/facile-validator/pull/230
    • chore(deps): update dependency @unocss/reset to v0.45.6 by @renovate in https://github.com/upjs/facile-validator/pull/231
    • chore(deps): update dependency eslint to v8.22.0 by @renovate in https://github.com/upjs/facile-validator/pull/235
    • chore(deps): update dependency vite to v3.0.7 by @renovate in https://github.com/upjs/facile-validator/pull/233
    • chore(deps): update dependency unbuild to v0.8.8 by @renovate in https://github.com/upjs/facile-validator/pull/234
    • chore(deps): update dependency unocss to v0.45.6 by @renovate in https://github.com/upjs/facile-validator/pull/232
    • Czech localisation file by @Jaroslav-Cerny in https://github.com/upjs/facile-validator/pull/236

    New Contributors

    • @Jaroslav-Cerny made their first contribution in https://github.com/upjs/facile-validator/pull/236

    Full Changelog: https://github.com/upjs/facile-validator/compare/v1.8.0...v1.9.0

    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(Aug 11, 2022)

    What's Changed

    • chore(deps): update dependency @babel/types to v7.18.10 by @renovate in https://github.com/upjs/facile-validator/pull/220
    • chore(deps): update dependency @unocss/preset-wind to v0.45.5 by @renovate in https://github.com/upjs/facile-validator/pull/221
    • chore(deps): update dependency eslint to v8.21.0 by @renovate in https://github.com/upjs/facile-validator/pull/224
    • chore(deps): update dependency vitest to v0.21.1 by @renovate in https://github.com/upjs/facile-validator/pull/225
    • chore(deps): update typescript-eslint monorepo to v5.33.0 by @renovate in https://github.com/upjs/facile-validator/pull/226
    • chore(deps): update dependency unocss to v0.45.5 by @renovate in https://github.com/upjs/facile-validator/pull/223
    • chore(deps): update dependency @unocss/reset to v0.45.5 by @renovate in https://github.com/upjs/facile-validator/pull/222
    • feat: Add new locales by @AliMehraei in https://github.com/upjs/facile-validator/pull/228

    New Contributors

    • @AliMehraei made their first contribution in https://github.com/upjs/facile-validator/pull/228

    Full Changelog: https://github.com/upjs/facile-validator/compare/v1.7.0...v1.8.0

    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Aug 9, 2022)

  • v1.6.0(Aug 9, 2022)

  • v1.2.0(May 26, 2022)

  • v1.1.0(May 25, 2022)

    What's Changed

    • chore(deps): update dependencies
    • Add support for regex rule by @AliN11 in https://github.com/upjs/facile-validator/pull/129

    New Contributors

    • @RealMrHex made their first contribution in https://github.com/upjs/facile-validator/pull/69

    Full Changelog: https://github.com/upjs/facile-validator/blob/main/CHANGELOG.md#110-2022-05-25

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Apr 7, 2022)

    What's Changed

    • chore(deps): update dependency vitest to v0.6.1 by @renovate in https://github.com/upjs/facile-validator/pull/39
    • fix: ignore non-required and empty inputs by @AliN11 in https://github.com/upjs/facile-validator/pull/40
    • undo strategy for handling non-required and empty inputs by @AliN11 in https://github.com/upjs/facile-validator/pull/41
    • Rename events by @AliN11 in https://github.com/upjs/facile-validator/pull/43
    • chore(deps): update dependency vitest to v0.7.4 by @renovate in https://github.com/upjs/facile-validator/pull/46
    • chore(deps): update dependency lint-staged to v12.3.7 by @renovate in https://github.com/upjs/facile-validator/pull/45
    • chore(deps): update dependency prettier to v2.6.0 by @renovate in https://github.com/upjs/facile-validator/pull/44
    • chore(deps): update typescript-eslint monorepo to v5.15.0 by @renovate in https://github.com/upjs/facile-validator/pull/42
    • feat: add nullable rule by @AliN11 in https://github.com/upjs/facile-validator/pull/47
    • chore(deps): update dependency unbuild to v0.7.2 by @renovate in https://github.com/upjs/facile-validator/pull/52
    • chore(deps): update dependency prettier to v2.6.1 by @renovate in https://github.com/upjs/facile-validator/pull/51
    • chore(deps): update dependency typescript to v4.6.3 by @renovate in https://github.com/upjs/facile-validator/pull/50
    • chore(deps): update typescript-eslint monorepo to v5.16.0 by @renovate in https://github.com/upjs/facile-validator/pull/49
    • chore(deps): update dependency vitest to v0.7.11 by @renovate in https://github.com/upjs/facile-validator/pull/48
    • chore(deps): update dependency eslint to v8.12.0 by @renovate in https://github.com/upjs/facile-validator/pull/53
    • chore(deps): update dependency vite to v2.9.1 by @renovate in https://github.com/upjs/facile-validator/pull/56
    • chore(deps): update jamesives/github-pages-deploy-action action to v4.3.0 by @renovate in https://github.com/upjs/facile-validator/pull/58
    • chore(deps): update typescript-eslint monorepo to v5.18.0 by @renovate in https://github.com/upjs/facile-validator/pull/55
    • chore(deps): update dependency prettier to v2.6.2 by @renovate in https://github.com/upjs/facile-validator/pull/57
    • chore(deps): update dependency vitest to v0.8.4 by @renovate in https://github.com/upjs/facile-validator/pull/54
    • chore(deps): update dependency vitest to v0.9.0 by @renovate in https://github.com/upjs/facile-validator/pull/59

    Full Changelog: https://github.com/upjs/facile-validator/blob/main/CHANGELOG.md#100-2022-04-07

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Mar 13, 2022)

    What's Changed

    • fix: use HTMLElement interface insteadof HTMLInputElement by @AliN11 in https://github.com/upjs/facile-validator/pull/32
    • feat: improve within to support array by @AliN11 in https://github.com/upjs/facile-validator/pull/33
    • chore(deps): update dependency vitest to v0.6.0 by @renovate in https://github.com/upjs/facile-validator/pull/34
    • chore(deps): update typescript-eslint monorepo to v5.14.0 by @renovate in https://github.com/upjs/facile-validator/pull/35
    • fix: rename files by @AliN11 in https://github.com/upjs/facile-validator/pull/36
    • chore(deps): update dependency eslint to v8.11.0 by @renovate in https://github.com/upjs/facile-validator/pull/37
    • Ali by @AliN11 in https://github.com/upjs/facile-validator/pull/38

    Full Changelog: https://github.com/upjs/facile-validator/blob/main/CHANGELOG.md#020-2022-03-13

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Mar 5, 2022)

    What's Changed

    • Refactor rules by @ms-fadaei in https://github.com/upjs/facile-validator/pull/1
    • rebase project by @ms-fadaei in https://github.com/upjs/facile-validator/pull/2
    • chore: add getType function by @AliN11 in https://github.com/upjs/facile-validator/pull/3
    • feat: add accepted rule by @AliN11 in https://github.com/upjs/facile-validator/pull/4
    • Ali by @AliN11 in https://github.com/upjs/facile-validator/pull/5
    • Refactor: support localization on error messages by @ms-fadaei in https://github.com/upjs/facile-validator/pull/6
    • refactor: refactored locale by @AliN11 in https://github.com/upjs/facile-validator/pull/7
    • feat: support for optional language by @AliN11 in https://github.com/upjs/facile-validator/pull/9
    • feat: add events support by @ms-fadaei in https://github.com/upjs/facile-validator/pull/8
    • feat: add alpha rule by @AliN11 in https://github.com/upjs/facile-validator/pull/10
    • feat: support async validation by @AliN11 in https://github.com/upjs/facile-validator/pull/11
    • refactor: refactor Validator class by @AliN11 in https://github.com/upjs/facile-validator/pull/12
    • feat: support dependency in rules by @ms-fadaei in https://github.com/upjs/facile-validator/pull/13
    • refactor: move replacers to their own files by @AliN11 in https://github.com/upjs/facile-validator/pull/14
    • refactor: refactor dependent rules by @ms-fadaei in https://github.com/upjs/facile-validator/pull/15
    • Ali by @AliN11 in https://github.com/upjs/facile-validator/pull/16
    • Added new rules by @AliN11 in https://github.com/upjs/facile-validator/pull/17
    • Configure Renovate by @renovate in https://github.com/upjs/facile-validator/pull/18
    • chore(deps): pin dependencies by @renovate in https://github.com/upjs/facile-validator/pull/19
    • chore(deps): update dependency vite to v2.8.6 by @renovate in https://github.com/upjs/facile-validator/pull/20
    • chore(deps): update jamesives/github-pages-deploy-action action to v4.2.5 by @renovate in https://github.com/upjs/facile-validator/pull/22
    • chore(deps): update dependency eslint to v8.10.0 by @renovate in https://github.com/upjs/facile-validator/pull/23
    • chore(deps): update dependency vitest to v0.5.9 by @renovate in https://github.com/upjs/facile-validator/pull/25
    • chore(deps): update dependency typescript to v4.6.2 by @renovate in https://github.com/upjs/facile-validator/pull/24
    • chore(deps): update typescript-eslint monorepo to v5.13.0 by @renovate in https://github.com/upjs/facile-validator/pull/27
    • chore(deps): update actions/checkout action to v3 by @renovate in https://github.com/upjs/facile-validator/pull/26
    • chore(deps): update dependency eslint-config-prettier to v8.5.0 by @renovate in https://github.com/upjs/facile-validator/pull/29
    • chore(deps): update actions/setup-node action to v3 by @renovate in https://github.com/upjs/facile-validator/pull/28

    New Contributors

    • @ms-fadaei made their first contribution in https://github.com/upjs/facile-validator/pull/1
    • @AliN11 made their first contribution in https://github.com/upjs/facile-validator/pull/3

    Full Changelog: https://github.com/upjs/facile-validator/commits/v0.1.0

    Source code(tar.gz)
    Source code(zip)
Vue-input-validator - 🛡️ Highly extensible & customizable input validator for Vue 2

??️ Vue-input-validator demo! What is this package all about? By using this package, you can create input validators only with the help of a single di

null 14 May 26, 2022
Easy HTML Form Validator

Easy HTML Form Validator

Ali Nazari 314 Dec 26, 2022
Lightweight JavaScript form validation library inspired by CodeIgniter.

validate.js validate.js is a lightweight JavaScript form validation library inspired by CodeIgniter. Features Validate form fields from over a dozen r

Rick Harrison 2.6k Dec 15, 2022
HTML 5 & Bootstrap Jquery Form Validation Plugin

HTML 5 & Bootstrap Jquery Form Validation Plugin HTML 5 & Bootstrap 5 & Jquery 3 jbvalidator is a fresh new jQuery based form validation plugin that i

null 37 Dec 6, 2022
The best @jquery plugin to validate form fields. Designed to use with Bootstrap + Zurb Foundation + Pure + SemanticUI + UIKit + Your own frameworks.

FormValidation - Download http://formvalidation.io - The best jQuery plugin to validate form fields, designed to use with: Bootstrap Foundation Pure S

FormValidation 2.8k Mar 29, 2021
FieldVal - multipurpose validation library. Supports both sync and async validation.

FieldVal-JS The FieldVal-JS library allows you to easily validate data and provide readable and structured error reports. Documentation and Examples D

null 137 Sep 24, 2022
Lightweight and powerfull library for declarative form validation

Formurai is a lightweight and powerfull library for declarative form validation Features Setup Usage Options Methods Rules Examples Roadmap Features ?

Illia 49 May 13, 2022
Cross Browser HTML5 Form Validation.

Validatr Cross Browser HTML5 Form Validation. Getting Started View the documentation to learn how to use Validatr. Changelog Version 0.5.1 - 2013-03-1

Jay Morrow 279 Nov 1, 2022
jQuery form validation plugin

jQuery.validationEngine v3.1.0 Looking for official contributors This project has now been going on for more than 7 years, right now I only maintain t

Cedric Dugas 2.6k Dec 23, 2022
This Login Form made using React hooks , React Js , Css, Json. This form have 3 inputs, it also validate those inputs & it also having length limitations.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Yogesh Sharma 0 Jan 3, 2022
The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

Ajv JSON schema validator The fastest JSON validator for Node.js and browser. Supports JSON Schema draft-06/07/2019-09/2020-12 (draft-04 is supported

Ajv JSON schema validator 12k Jan 4, 2023
ForgJs is a javascript lightweight object validator. Go check the Quick start section and start coding with love

Hey every one im really happy that this repo reached this many stars ?? ,but this repo needs your contibution I started to better document the code th

Hamdaoui Oussama 1.7k Dec 21, 2022
A simple environment variables validator for Node.js and web browsers

A simple environment variables validator for Node.js and web browsers

Mathieu Acthernoene 25 Jul 20, 2022
Tiny Validator for JSON Schema v4

Tiny Validator (for v4 JSON Schema) Use json-schema draft v4 to validate simple values and complex objects using a rich validation vocabulary (example

Geraint 1.2k Dec 21, 2022
A JSONSchema validator that uses code generation to be extremely fast

is-my-json-valid A JSONSchema validator that uses code generation to be extremely fast. It passes the entire JSONSchema v4 test suite except for remot

Mathias Buus 948 Dec 31, 2022
Super Fast Complex Object Validator for Javascript(& Typescript).

Super Fast Object Validator for Javascript(& Typescript). Safen supports the syntax similar to the type script interface. This makes it easy to create

Changwan Jun 31 Nov 25, 2022
Simple validator for Steuerliche Identifikationsnummer (German personal tax number) according to the official docs (see readme).

simple-de-taxid-validator Important Code of this validator is taken (with small changes like optimization or removing not needed elements) from THIS R

Wojciech 3 Feb 24, 2022
Fast, compiled, eval-free data validator/transformer

spectypes Fast, compiled, eval-free data validator/transformer Features really fast, can be even faster than ajv detailed errors, failure will result

null 65 Dec 29, 2022
Simple password validator made with Javascript 💛

Password Validator Simple password validator made with Javascript ?? Branch history base-code: a complex logic to password validator. In next branches

Lais Frigério 8 Jul 25, 2022