├── lib
├── .npmignore
├── src
│ ├── consts.ts
│ ├── index.ts
│ ├── rules
│ │ ├── length.ts
│ │ ├── index.ts
│ │ ├── email.ts
│ │ ├── required.ts
│ │ ├── minLength.ts
│ │ ├── maxLength.ts
│ │ ├── pattern.ts
│ │ └── spec
│ │ │ ├── email.spec.ts
│ │ │ ├── maxLength.spec.ts
│ │ │ ├── pattern.spec.ts
│ │ │ ├── minLength.spec.ts
│ │ │ └── required.spec.ts
│ ├── fieldValidationEventFilter.ts
│ ├── entities.ts
│ ├── validationsResultBuilder.ts
│ ├── baseFormValidation.ts
│ └── validationsDispatcher.ts
├── .babelrc
├── test
│ └── test_index.js
├── tsconfig.json
├── webpack.config.js
├── karma.conf.js
├── lc-form-validation.d.ts
└── package.json
├── .editorconfig
├── samples
├── jquery
│ └── 00 ShoppingForm
│ │ ├── src
│ │ ├── index.js
│ │ ├── modules
│ │ │ └── app
│ │ │ │ ├── validation
│ │ │ │ ├── formProductValidationService.js
│ │ │ │ └── rules
│ │ │ │ │ └── nifValidator.js
│ │ │ │ └── app.js
│ │ ├── services
│ │ │ └── productsService.js
│ │ └── index.html
│ │ ├── .babelrc
│ │ ├── package.json
│ │ └── webpack.config.js
├── vuejs
│ └── typescript
│ │ └── 00 Custom Validator
│ │ ├── .babelrc
│ │ ├── src
│ │ ├── pages
│ │ │ └── recipe
│ │ │ │ └── edit
│ │ │ │ ├── components
│ │ │ │ ├── index.ts
│ │ │ │ ├── ingredientRow.tsx
│ │ │ │ ├── ingredientList.tsx
│ │ │ │ └── form.tsx
│ │ │ │ ├── index.ts
│ │ │ │ ├── validations
│ │ │ │ └── editFormValidation.ts
│ │ │ │ ├── page.tsx
│ │ │ │ └── pageContainer.tsx
│ │ ├── model
│ │ │ ├── index.ts
│ │ │ ├── recipe.ts
│ │ │ └── recipeError.ts
│ │ ├── app.tsx
│ │ ├── main.tsx
│ │ ├── common
│ │ │ ├── components
│ │ │ │ └── form
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── validation.tsx
│ │ │ │ │ ├── input.tsx
│ │ │ │ │ └── inputButton.tsx
│ │ │ └── validations
│ │ │ │ └── arrayValidation.ts
│ │ ├── api
│ │ │ └── recipe
│ │ │ │ ├── mockData.ts
│ │ │ │ └── index.ts
│ │ ├── index.html
│ │ └── router.ts
│ │ ├── tsconfig.json
│ │ ├── package.json
│ │ └── webpack.config.js
└── react
│ ├── typescript
│ ├── 00 SimpleForm
│ │ ├── .babelrc
│ │ ├── src
│ │ │ ├── reducers
│ │ │ │ ├── index.ts
│ │ │ │ └── customer.ts
│ │ │ ├── entity
│ │ │ │ ├── customerErrors.ts
│ │ │ │ └── customerEntity.ts
│ │ │ ├── index.tsx
│ │ │ ├── index.html
│ │ │ ├── actions
│ │ │ │ ├── actionsDef.ts
│ │ │ │ ├── customerSaveCompleted.ts
│ │ │ │ ├── customerUIInputStart.ts
│ │ │ │ ├── customerUInputCompleted.ts
│ │ │ │ └── customerSaveStart.ts
│ │ │ ├── components
│ │ │ │ ├── sampleForm
│ │ │ │ │ ├── validations
│ │ │ │ │ │ └── customerFormValidation.ts
│ │ │ │ │ ├── sampleForm.container.ts
│ │ │ │ │ └── sampleForm.tsx
│ │ │ │ ├── app.tsx
│ │ │ │ └── common
│ │ │ │ │ └── input.tsx
│ │ │ └── css
│ │ │ │ └── site.css
│ │ ├── tsconfig.json
│ │ ├── package.json
│ │ └── webpack.config.js
│ ├── 01 SignupForm
│ │ ├── .babelrc
│ │ ├── src
│ │ │ ├── reducers
│ │ │ │ ├── index.ts
│ │ │ │ └── signup.ts
│ │ │ ├── index.html
│ │ │ ├── index.tsx
│ │ │ ├── actions
│ │ │ │ ├── actionsDef.ts
│ │ │ │ ├── signupRequestCompleted.ts
│ │ │ │ ├── signupRequestStart.ts
│ │ │ │ ├── signupUIOnInteractionStart.ts
│ │ │ │ └── signupUIOnInteractionCompleted.ts
│ │ │ ├── entity
│ │ │ │ ├── signupErrors.ts
│ │ │ │ └── signupEntity.ts
│ │ │ ├── css
│ │ │ │ └── site.css
│ │ │ ├── components
│ │ │ │ ├── app.tsx
│ │ │ │ ├── sampleSignupForm
│ │ │ │ │ ├── sampleSignupForm.container.ts
│ │ │ │ │ ├── validations
│ │ │ │ │ │ └── signupFormValidation.ts
│ │ │ │ │ └── sampleSignupForm.tsx
│ │ │ │ └── common
│ │ │ │ │ └── input.tsx
│ │ │ └── api
│ │ │ │ └── gitHub.ts
│ │ ├── tsconfig.json
│ │ ├── package.json
│ │ └── webpack.config.js
│ └── 02 QuizForm
│ │ ├── .babelrc
│ │ ├── src
│ │ ├── reducers
│ │ │ ├── index.ts
│ │ │ └── quiz.ts
│ │ ├── index.html
│ │ ├── index.tsx
│ │ ├── actions
│ │ │ ├── actionsDef.ts
│ │ │ ├── resetQuizResolveCompleted.ts
│ │ │ ├── quizUIInputCompleted.ts
│ │ │ ├── quizResolveCompleted.ts
│ │ │ └── quizResolveStart.ts
│ │ ├── entity
│ │ │ └── quizEntity.ts
│ │ ├── css
│ │ │ └── site.css
│ │ └── components
│ │ │ ├── app.tsx
│ │ │ ├── common
│ │ │ └── question.tsx
│ │ │ └── quizForm
│ │ │ ├── validations
│ │ │ └── quizFormValidation.ts
│ │ │ ├── quizForm.container.ts
│ │ │ └── quizForm.tsx
│ │ ├── tsconfig.json
│ │ ├── package.json
│ │ └── webpack.config.js
│ └── es6
│ ├── 00 SimpleForm
│ ├── src
│ │ ├── entity
│ │ │ └── customerEntity.js
│ │ ├── reducers
│ │ │ ├── index.js
│ │ │ └── customer.js
│ │ ├── index.jsx
│ │ ├── index.html
│ │ ├── actions
│ │ │ ├── customerSaveCompleted.js
│ │ │ ├── actionsDef.js
│ │ │ ├── customerUInputCompleted.js
│ │ │ ├── customerUIInputStart.js
│ │ │ └── customerSaveStart.js
│ │ ├── components
│ │ │ ├── sampleForm
│ │ │ │ ├── validations
│ │ │ │ │ └── customerFormValidation.js
│ │ │ │ ├── sampleForm.container.js
│ │ │ │ └── sampleForm.jsx
│ │ │ ├── app.jsx
│ │ │ └── common
│ │ │ │ └── input.jsx
│ │ └── css
│ │ │ └── site.css
│ ├── .babelrc
│ ├── package.json
│ └── webpack.config.js
│ ├── 02 QuizForm
│ ├── src
│ │ ├── reducers
│ │ │ ├── index.js
│ │ │ └── quiz.js
│ │ ├── index.html
│ │ ├── index.jsx
│ │ ├── actions
│ │ │ ├── resetQuizResolveCompleted.js
│ │ │ ├── actionsDef.js
│ │ │ ├── quizResolveCompleted.js
│ │ │ ├── quizUIInputCompleted.js
│ │ │ └── quizResolveStart.js
│ │ ├── entity
│ │ │ └── quizEntity.js
│ │ ├── css
│ │ │ └── site.css
│ │ └── components
│ │ │ ├── app.jsx
│ │ │ ├── common
│ │ │ └── question.jsx
│ │ │ └── quizForm
│ │ │ ├── validations
│ │ │ └── quizFormValidation.js
│ │ │ ├── quizForm.container.js
│ │ │ └── quizForm.jsx
│ ├── .babelrc
│ ├── package.json
│ └── webpack.config.js
│ └── 01 SignupForm
│ ├── .babelrc
│ ├── src
│ ├── entity
│ │ └── signupEntity.js
│ ├── reducers
│ │ ├── index.js
│ │ └── signup.js
│ ├── index.html
│ ├── index.jsx
│ ├── actions
│ │ ├── actionsDef.js
│ │ ├── signupRequestCompleted.js
│ │ ├── signupUIOnInteractionCompleted.js
│ │ ├── signupRequestStart.js
│ │ └── signupUIOnInteractionStart.js
│ ├── css
│ │ └── site.css
│ ├── components
│ │ ├── app.jsx
│ │ ├── sampleSignupForm
│ │ │ ├── sampleSignupForm.container.js
│ │ │ ├── validations
│ │ │ │ └── signupFormValidation.js
│ │ │ └── sampleSignupForm.jsx
│ │ └── common
│ │ │ └── input.jsx
│ └── api
│ │ └── gitHub.js
│ ├── package.json
│ └── webpack.config.js
├── ReadmeResources
└── loginForm.png
├── .travis.yml
├── CHANGELOG.md
├── .gitignore
└── LICENSE
/lib/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | src/
3 | test/
4 | tsd/
5 | typings/
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
--------------------------------------------------------------------------------
/samples/jquery/00 ShoppingForm/src/index.js:
--------------------------------------------------------------------------------
1 | import { App } from './modules/app/app';
2 | const app = new App();
3 |
--------------------------------------------------------------------------------
/ReadmeResources/loginForm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Lemoncode/lcFormValidation/HEAD/ReadmeResources/loginForm.png
--------------------------------------------------------------------------------
/lib/src/consts.ts:
--------------------------------------------------------------------------------
1 | export const consts = {
2 | globalFormValidationId: "_GLOBAL_FORM_",
3 | defaultFilter: { onChange: true }
4 | }
5 |
--------------------------------------------------------------------------------
/lib/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/samples/vuejs/typescript/00 Custom Validator/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "env"
4 | ],
5 | "plugins": [
6 | "transform-vue-jsx"
7 | ]
8 | }
--------------------------------------------------------------------------------
/samples/vuejs/typescript/00 Custom Validator/src/pages/recipe/edit/components/index.ts:
--------------------------------------------------------------------------------
1 | import {FormComponent} from './form';
2 |
3 | export {
4 | FormComponent,
5 | }
--------------------------------------------------------------------------------
/samples/vuejs/typescript/00 Custom Validator/src/pages/recipe/edit/index.ts:
--------------------------------------------------------------------------------
1 | import {EditRecipeContainer} from './pageContainer';
2 |
3 | export {
4 | EditRecipeContainer
5 | }
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "5.4.0"
4 | script: cd lib && npm install && npm test
5 | after_script:
6 | - codeclimate-test-reporter < coverage/tests/lcov.info
7 |
--------------------------------------------------------------------------------
/samples/react/typescript/00 SimpleForm/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/samples/react/typescript/01 SignupForm/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/samples/react/typescript/02 QuizForm/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/samples/jquery/00 ShoppingForm/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ],
9 | "stage-3"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/samples/react/es6/00 SimpleForm/src/entity/customerEntity.js:
--------------------------------------------------------------------------------
1 | export class CustomerEntity {
2 | constructor() {
3 | this.id = -1;
4 | this.fullname = '';
5 | this.password = '';
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/samples/react/es6/02 QuizForm/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import { quizReducer as quiz } from './quiz';
3 |
4 | export default combineReducers({
5 | quiz
6 | });
7 |
--------------------------------------------------------------------------------
/samples/vuejs/typescript/00 Custom Validator/src/model/index.ts:
--------------------------------------------------------------------------------
1 | import {RecipeEntity} from './recipe';
2 | import {RecipeError} from './recipeError';
3 |
4 | export {
5 | RecipeEntity,
6 | RecipeError,
7 | }
--------------------------------------------------------------------------------
/samples/react/es6/00 SimpleForm/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ],
9 | "react",
10 | "stage-2"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/samples/react/es6/01 SignupForm/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ],
9 | "react",
10 | "stage-2"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/samples/react/es6/01 SignupForm/src/entity/signupEntity.js:
--------------------------------------------------------------------------------
1 | export class SignupEntity {
2 | constructor() {
3 | this.login = '';
4 | this.password = '';
5 | this.confirmPassword = '';
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/samples/react/es6/01 SignupForm/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import { signupReducer as signup } from './signup';
3 |
4 | export default combineReducers({
5 | signup
6 | });
7 |
--------------------------------------------------------------------------------
/samples/react/es6/02 QuizForm/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "modules": false
7 | }
8 | ],
9 | "react",
10 | "stage-2"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/samples/react/typescript/02 QuizForm/src/reducers/index.ts:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import { quizReducer as quiz } from './quiz';
3 |
4 | export default combineReducers({
5 | quiz
6 | });
7 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | This project follows [Semantic Versioning](http://semver.org) system.
4 | Every release is documented on the [Releases](https://github.com/Lemoncode/lcFormValidation/releases) section.
5 |
--------------------------------------------------------------------------------
/samples/react/es6/00 SimpleForm/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import { customerReducer as customer } from './customer';
3 |
4 | export default combineReducers({
5 | customer
6 | });
7 |
--------------------------------------------------------------------------------
/samples/react/typescript/01 SignupForm/src/reducers/index.ts:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import { signupReducer as signup } from './signup';
3 |
4 | export default combineReducers({
5 | signup
6 | });
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist/
4 | typings/
5 | *.orig
6 | .idea/
7 | lib/README.md
8 | lib/ReadmeResources/
9 | lib/coverage/
10 | yarn.lock
11 | .vscode/
12 | npm-debug.log
13 | package-lock\.json
14 |
--------------------------------------------------------------------------------
/samples/react/typescript/00 SimpleForm/src/reducers/index.ts:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import { customerReducer as customer } from './customer';
3 |
4 | export default combineReducers({
5 | customer
6 | });
7 |
--------------------------------------------------------------------------------
/lib/test/test_index.js:
--------------------------------------------------------------------------------
1 | // require all modules ending in ".spec" from the
2 | // current directory and all subdirectories
3 |
4 | var testsContext = require.context("../src", true, /.spec$/);
5 | testsContext.keys().forEach(testsContext);
6 |
--------------------------------------------------------------------------------
/samples/react/es6/00 SimpleForm/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './components/app';
4 |
5 | ReactDOM.render(
6 |