From e0595ff46ac4e84ef653a51b77d2fa8a1cbb0ddc Mon Sep 17 00:00:00 2001 From: Nightapes Date: Mon, 20 Apr 2020 21:05:59 +0200 Subject: [PATCH 1/2] style(*): update to prettier 2.0 and tslint --- .eslintrc.json | 19 - .prettierignore | 4 + .prettierrc | 4 + .vscode/settings.json | 44 +- README.md | 198 +++--- examples/.vscode/settings.json | 40 +- examples/README.md | 4 +- examples/angular.json | 28 +- examples/e2e/app.e2e-spec.ts | 8 +- examples/e2e/app.po.ts | 6 +- examples/e2e/tsconfig.json | 8 +- examples/karma.conf.js | 44 +- examples/package.json | 108 ++-- examples/src/app/app.component.css | 36 +- examples/src/app/app.component.html | 51 +- examples/src/app/app.component.spec.ts | 18 +- examples/src/app/app.component.ts | 10 +- examples/src/app/app.module.ts | 42 +- .../creditcard-validator.component.html | 78 +-- .../creditcard-validator.component.ts | 70 +-- .../creditcard-validator.module.ts | 75 +-- .../form-american-express.component.html | 14 +- .../form-american-express.component.ts | 7 +- .../creditcard/form-creditcard.component.html | 14 +- .../creditcard/form-creditcard.component.ts | 7 +- .../dinersclub/form-dinersclub.component.html | 14 +- .../dinersclub/form-dinersclub.component.ts | 7 +- .../discover/form-discover.component.html | 14 +- .../form/discover/form-discover.component.ts | 7 +- .../form/jcb/form-jcb.component.html | 14 +- .../form/jcb/form-jcb.component.ts | 7 +- .../form/maestro/form-maestro.component.html | 14 +- .../form/maestro/form-maestro.component.ts | 7 +- .../mastercard/form-mastercard.component.html | 14 +- .../mastercard/form-mastercard.component.ts | 7 +- .../form/visa/form-visa.component.html | 14 +- .../form/visa/form-visa.component.ts | 7 +- ...ctive-form-american-express.component.html | 10 +- ...eactive-form-american-express.component.ts | 17 +- .../reactive-form-creditcard.component.html | 10 +- .../reactive-form-creditcard.component.ts | 17 +- .../reactive-form-dinersclub.component.html | 10 +- .../reactive-form-dinersclub.component.ts | 17 +- .../reactive-form-discover.component.html | 10 +- .../reactive-form-discover.component.ts | 17 +- .../jcb/reactive-form-jcb.component.html | 10 +- .../jcb/reactive-form-jcb.component.ts | 17 +- .../reactive-form-maestro.component.html | 10 +- .../reactive-form-maestro.component.ts | 17 +- .../reactive-form-mastercard.component.html | 10 +- .../reactive-form-mastercard.component.ts | 17 +- .../visa/reactive-form-visa.component.html | 10 +- .../visa/reactive-form-visa.component.ts | 17 +- .../email-validator.component.html | 58 +- .../email-validator.component.ts | 69 +-- .../email-validator/email-validator.module.ts | 53 +- .../form/email/form-email.component.html | 10 +- .../form/email/form-email.component.ts | 7 +- .../suggest/form-email-suggest.component.html | 23 +- .../suggest/form-email-suggest.component.ts | 102 ++- .../email/reactive-form-email.component.html | 10 +- .../email/reactive-form-email.component.ts | 19 +- ...reactive-form-email-suggest.component.html | 15 +- .../reactive-form-email-suggest.component.ts | 113 +++- .../equal-to-validator.component.html | 16 +- .../equal-to-validator.component.ts | 23 +- .../equal-to-validator.module.ts | 37 +- .../equal-to/form-equal-to.component.html | 28 +- .../form/equal-to/form-equal-to.component.ts | 21 +- .../reactive-form-equal-to.component.html | 16 +- .../reactive-form-equal-to.component.ts | 36 +- examples/src/app/guide/guide.component.html | 64 +- .../src/app/guide/guide.component.spec.ts | 13 +- examples/src/app/guide/guide.component.ts | 10 +- examples/src/app/guide/guide.module.ts | 30 +- examples/src/app/items.ts | 262 ++++---- ...alphabetical-character-rule.component.html | 17 +- ...m-alphabetical-character-rule.component.ts | 7 +- .../form-digit-character-rule.component.html | 17 +- .../form-digit-character-rule.component.ts | 7 +- ...rm-lowercase-character-rule.component.html | 17 +- ...form-lowercase-character-rule.component.ts | 7 +- ...repeat-character-regex-rule.component.html | 21 +- ...m-repeat-character-regex-rule.component.ts | 7 +- ...rm-uppercase-character-rule.component.html | 17 +- ...form-uppercase-character-rule.component.ts | 7 +- .../password-validator.component.html | 78 ++- .../password-validator.component.ts | 70 +-- .../password-validator.module.ts | 67 +- ...alphabetical-character-rule.component.html | 12 +- ...m-alphabetical-character-rule.component.ts | 23 +- ...e-form-digit-character-rule.component.html | 12 +- ...ive-form-digit-character-rule.component.ts | 23 +- ...rm-lowercase-character-rule.component.html | 12 +- ...form-lowercase-character-rule.component.ts | 23 +- .../reactive-form-mismatch.component.html | 16 +- .../reactive-form-mismatch.component.ts | 23 +- ...repeat-character-regex-rule.component.html | 12 +- ...m-repeat-character-regex-rule.component.ts | 23 +- ...form-special-character-rule.component.html | 12 +- ...e-form-special-character-rule.component.ts | 18 +- ...rm-uppercase-character-rule.component.html | 12 +- ...form-uppercase-character-rule.component.ts | 26 +- .../form-is-in-range.component.html | 24 +- .../is-in-range/form-is-in-range.component.ts | 9 +- .../is-number/form-is-number.component.html | 14 +- .../is-number/form-is-number.component.ts | 9 +- .../form/max/form-max.component.html | 16 +- .../form/max/form-max.component.ts | 9 +- .../form/min/form-min.component.html | 19 +- .../form/min/form-min.component.ts | 10 +- .../form-no-whitespace.component.html | 14 +- .../form-no-whitespace.component.ts | 9 +- .../reactive-form-is-in-range.component.html | 14 +- .../reactive-form-is-in-range.component.ts | 23 +- .../reactive-form-is-number.component.html | 10 +- .../reactive-form-is-number.component.ts | 20 +- .../reactive-form-max-length.component.html | 10 +- .../reactive-form-max-length.component.ts | 24 +- .../max/reactive-form-max.component.html | 12 +- .../max/reactive-form-max.component.ts | 20 +- .../reactive-form-min-length.component.html | 10 +- .../reactive-form-min-length.component.ts | 24 +- .../min/reactive-form-min.component.html | 12 +- .../min/reactive-form-min.component.ts | 20 +- ...active-form-no-empty-string.component.html | 10 +- ...reactive-form-no-empty-string.component.ts | 18 +- ...reactive-form-no-whitespace.component.html | 10 +- .../reactive-form-no-whitespace.component.ts | 18 +- .../universal-validator.component.html | 72 ++- .../universal-validator.component.ts | 70 +-- .../universal-validator.module.ts | 71 ++- .../util/codeviewer/codeviewer.component.html | 28 +- .../codeviewer/codeviewer.component.spec.ts | 13 +- .../util/codeviewer/codeviewer.component.ts | 9 +- examples/src/app/util/util.module.ts | 26 +- .../assets/lib/hljs/styles/androidstudio.css | 4 +- .../assets/lib/hljs/styles/arduino-light.css | 20 +- .../assets/lib/hljs/styles/brown-paper.css | 6 +- .../assets/lib/hljs/styles/color-brewer.css | 2 - .../src/assets/lib/hljs/styles/darcula.css | 1 - .../src/assets/lib/hljs/styles/darkula.css | 2 +- .../src/assets/lib/hljs/styles/default.css | 11 +- .../src/assets/lib/hljs/styles/foundation.css | 3 +- .../src/assets/lib/hljs/styles/googlecode.css | 2 +- .../src/assets/lib/hljs/styles/grayscale.css | 17 +- .../src/assets/lib/hljs/styles/hybrid.css | 6 +- .../src/assets/lib/hljs/styles/ir-black.css | 2 +- .../src/assets/lib/hljs/styles/monokai.css | 3 +- .../src/assets/lib/hljs/styles/obsidian.css | 2 +- .../src/assets/lib/hljs/styles/purebasic.css | 37 +- .../assets/lib/hljs/styles/qtcreator_dark.css | 4 +- .../lib/hljs/styles/qtcreator_light.css | 6 +- .../src/assets/lib/hljs/styles/railscasts.css | 1 - .../src/assets/lib/hljs/styles/rainbow.css | 3 +- .../src/assets/lib/hljs/styles/routeros.css | 19 +- .../assets/lib/hljs/styles/school-book.css | 10 +- examples/src/assets/lib/hljs/styles/vs.css | 1 - .../src/assets/lib/hljs/styles/vs2015.css | 30 +- examples/src/assets/lib/hljs/styles/xt256.css | 1 - .../src/assets/lib/hljs/styles/zenburn.css | 1 - examples/src/environments/environment.prod.ts | 2 +- examples/src/environments/environment.ts | 2 +- examples/src/index.html | 24 +- examples/src/main.ts | 10 +- examples/src/polyfills.ts | 12 +- examples/src/styles.css | 42 +- examples/src/test.ts | 26 +- examples/src/tsconfig.json | 11 +- examples/tslint.json | 65 +- karma.conf.js | 14 +- package.json | 13 +- .../creditcard/creditcard-validators.spec.ts | 38 +- .../creditcard/creditcard-validators.ts | 19 +- .../creditcard/creditcards/americanexpress.ts | 2 +- .../creditcard/creditcards/dinersclub.ts | 2 +- .../creditcard/creditcards/discover.ts | 2 +- src/components/creditcard/creditcards/jcb.ts | 2 +- .../creditcard/creditcards/maestro.ts | 2 +- .../creditcard/creditcards/mastercard.ts | 2 +- src/components/creditcard/creditcards/visa.ts | 2 +- src/components/email/email-util.spec.ts | 68 +- src/components/email/email-util.ts | 113 ++-- src/components/email/email-validators.spec.ts | 16 +- .../equal-to/equal-to-validator.spec.ts | 8 +- .../password/password-validators.spec.ts | 70 +-- .../password/password-validators.ts | 45 +- .../universal/universal-validators.spec.ts | 12 +- .../universal/universal-validators.ts | 20 +- src/components/validators.module.ts | 13 +- src/public_api.ts | 13 +- tslint.json | 50 ++ yarn.lock | 583 +++++++----------- 193 files changed, 2552 insertions(+), 2522 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 tslint.json diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 0faae8e..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "extends": [ - "plugin:@typescript-eslint/recommended", - "prettier/@typescript-eslint", - "plugin:prettier/recommended" - ], - "parserOptions": { - "ecmaVersion": 2018, - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/no-use-before-define": [ - "error", - { "variables": true, "functions": false, "classes": false } - ], - "@typescript-eslint/explicit-function-return-type": "off" - } -} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0e7df4e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +dist +node_modules +package-lock.json +coverage \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b27104b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": false, + "printWidth": 120 +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 93c77ea..fd9a3e9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,23 +1,23 @@ { - // Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened. - "editor.tabSize": 4, - // Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened. - "editor.insertSpaces": true, - // Controls if the editor should automatically format the line after typing - "editor.formatOnType": false, - // The default character set encoding to use when reading and writing files. - "files.encoding": "utf8", - // When enabled, will trim trailing whitespace when you save a file. - "files.trimTrailingWhitespace": false, - // Control whether tslint is enabled for TypeScript files or not. - "tslint.enable": true, - "typescript.tsdk": "node_modules/typescript/lib", - // Configure glob patterns for excluding files and folders. - "files.exclude": { - "**/.git": true, - "node_modules": true, - "examples": true, - "coverage/": true, - "dist/": true - } -} \ No newline at end of file + // Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened. + "editor.tabSize": 4, + // Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened. + "editor.insertSpaces": true, + // Controls if the editor should automatically format the line after typing + "editor.formatOnType": false, + // The default character set encoding to use when reading and writing files. + "files.encoding": "utf8", + // When enabled, will trim trailing whitespace when you save a file. + "files.trimTrailingWhitespace": false, + // Control whether tslint is enabled for TypeScript files or not. + "tslint.enable": true, + "typescript.tsdk": "node_modules/typescript/lib", + // Configure glob patterns for excluding files and folders. + "files.exclude": { + "**/.git": true, + "node_modules": true, + "examples": true, + "coverage/": true, + "dist/": true + } +} diff --git a/README.md b/README.md index 4162a2e..27d11c1 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ Add following to `project.config.ts` ```ts let additionalPackages: ExtendPackages[] = [ - { - name: 'ngx-validators', - path: 'node_modules/ngx-validators/bundles/ngx-validators.umd.min.js' - }, - ]; - - this.addPackagesBundles(additionalPackages); + { + name: "ngx-validators", + path: "node_modules/ngx-validators/bundles/ngx-validators.umd.min.js", + }, +]; + +this.addPackagesBundles(additionalPackages); ``` ## Password validators @@ -42,39 +42,39 @@ The rules are from https://github.com/vt-middleware/passay The password validators are: -* repeatCharacterRegexRule -* whitespaceRule (moved to UniversalValidators) -* allowedCharacterRule -* alphabeticalCharacterRule -* digitCharacterRule -* lowercaseCharacterRule -* uppercaseCharacterRule -* specialCharacterRule -* more will come +- repeatCharacterRegexRule +- whitespaceRule (moved to UniversalValidators) +- allowedCharacterRule +- alphabeticalCharacterRule +- digitCharacterRule +- lowercaseCharacterRule +- uppercaseCharacterRule +- specialCharacterRule +- more will come ## Email validators -* simple (only checks if it looks like a mail) -* normal (follows the [HTML5](https://www.w3.org/TR/html5/forms.html#valid-e-mail-address) rules) +- simple (only checks if it looks like a mail) +- normal (follows the [HTML5](https://www.w3.org/TR/html5/forms.html#valid-e-mail-address) rules) ## Universal validators -* noWhitespace -* noEmptyString -* isNumber -* isInRange -* minLength -* maxLength +- noWhitespace +- noEmptyString +- isNumber +- isInRange +- minLength +- maxLength ## Creditcard validators -* americanexpress -* visa -* dinersclub -* discover -* jcb -* maestro -* mastercard +- americanexpress +- visa +- dinersclub +- discover +- jcb +- maestro +- mastercard ## Install @@ -82,10 +82,9 @@ The password validators are: npm install ngx-validators --save ``` - ## How to use [model driven] -needs: ```ReactiveFormsModule``` +needs: `ReactiveFormsModule` ### Passwords @@ -104,7 +103,6 @@ password: FormControl = new FormControl('', Validators.compose([ ])); ``` - ### Password mismatch ```ts @@ -139,7 +137,6 @@ let form = new FormGroup({ ``` - ### Email ```ts @@ -186,63 +183,75 @@ control: FormControl = new FormControl('', UniversalValidators.visa); ``` - ## How to use [template driven] -needs ```FormsModule and ValidatorsModule ``` +needs `FormsModule and ValidatorsModule` ```ts -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { FormsModule } from '@angular/forms'; -import { ValidatorsModule } from 'ngx-validators' +import { NgModule } from "@angular/core"; +import { BrowserModule } from "@angular/platform-browser"; +import { FormsModule } from "@angular/forms"; +import { ValidatorsModule } from "ngx-validators"; -import { AppComponent } from './app.component'; +import { AppComponent } from "./app.component"; @NgModule({ - imports: [BrowserModule, FormsModule, ValidatorsModule], - declarations: [AppComponent], - bootstrap: [AppComponent] + imports: [BrowserModule, FormsModule, ValidatorsModule], + declarations: [AppComponent], + bootstrap: [AppComponent], }) -export class AppModule { -} +export class AppModule {} ``` ### Password + ```html
- -Password contains repeating characters -Password should contain at least on digit -Password should contain at least on alphabetical character -Password should contain at least on lowercase character -Password should contain at least on uppercase character + + Password contains repeating characters + Password should contain at least on digit + Password should contain at least on alphabetical character + Password should contain at least on lowercase character + Password should contain at least on uppercase character
// Override values - - + ``` ### Creditcard + ```html
- - -Is not a creditcard + + Is not a creditcard
-// Override values -// Test only for a specific creditcard - - +// Override values // Test only for a specific creditcard + ``` ### Email @@ -251,8 +260,8 @@ export class AppModule { ```html
- -Is not a email + + Is not a email
``` @@ -260,8 +269,8 @@ export class AppModule { ```html
- -Maybe check the mail again + + Maybe check the mail again
``` @@ -271,8 +280,8 @@ export class AppModule { ```html
- -Should not contain a whitespace + + Should not contain a whitespace
``` @@ -280,8 +289,8 @@ export class AppModule { ```html
- -Needs to be a number + + Needs to be a number
``` @@ -289,35 +298,44 @@ export class AppModule { ```html
- -Needs to be a number -Number to small -Number to big + + Needs to be a number + Number to small + Number to big
``` + #### min ```html
- -Needs to be a number -Number to small + + Needs to be a number + Number to small
``` + #### max ```html
- -Needs to be a number -Number to small + + Needs to be a number + Number to small
``` ##Todo -* Add more password rules -* Add address validator +- Add more password rules +- Add address validator Get the complete changelog here: https://github.com/Nightapes/ngx-validators/releases - diff --git a/examples/.vscode/settings.json b/examples/.vscode/settings.json index 2766d7f..1dec31b 100644 --- a/examples/.vscode/settings.json +++ b/examples/.vscode/settings.json @@ -1,21 +1,21 @@ { - // Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened. - "editor.tabSize": 4, - // Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened. - "editor.insertSpaces": true, - // Controls if the editor should automatically format the line after typing - "editor.formatOnType": false, - // The default character set encoding to use when reading and writing files. - "files.encoding": "utf8", - // When enabled, will trim trailing whitespace when you save a file. - "files.trimTrailingWhitespace": false, - // Control whether tslint is enabled for TypeScript files or not. - "tslint.enable": true, - "typescript.tsdk": "node_modules/typescript/lib", - // Configure glob patterns for excluding files and folders. - "files.exclude": { - "**/.git": true, - "node_modules": true, - "dist/": true - } -} \ No newline at end of file + // Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened. + "editor.tabSize": 4, + // Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened. + "editor.insertSpaces": true, + // Controls if the editor should automatically format the line after typing + "editor.formatOnType": false, + // The default character set encoding to use when reading and writing files. + "files.encoding": "utf8", + // When enabled, will trim trailing whitespace when you save a file. + "files.trimTrailingWhitespace": false, + // Control whether tslint is enabled for TypeScript files or not. + "tslint.enable": true, + "typescript.tsdk": "node_modules/typescript/lib", + // Configure glob patterns for excluding files and folders. + "files.exclude": { + "**/.git": true, + "node_modules": true, + "dist/": true + } +} diff --git a/examples/README.md b/examples/README.md index b2f4328..f824dff 100644 --- a/examples/README.md +++ b/examples/README.md @@ -3,6 +3,7 @@ This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0-beta.32.3. ## Development server + Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. ## Code scaffolding @@ -26,9 +27,8 @@ Before running the tests make sure you are serving the app via `ng serve`. To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). - ## Build for gh-pages `ng build --prod --base-href "https://Nightapes.github.io/ngx-validators/"` -`ngh` to update gh-page \ No newline at end of file +`ngh` to update gh-page diff --git a/examples/angular.json b/examples/angular.json index e0b041d..f17e013 100644 --- a/examples/angular.json +++ b/examples/angular.json @@ -16,13 +16,8 @@ "main": "src/main.ts", "tsConfig": "src/tsconfig.json", "polyfills": "src/polyfills.ts", - "assets": [ - "src/assets", - "src/favicon.ico" - ], - "styles": [ - "src/styles.css" - ], + "assets": ["src/assets", "src/favicon.ico"], + "styles": ["src/styles.css"], "scripts": [] }, "configurations": { @@ -69,21 +64,14 @@ "karmaConfig": "./karma.conf.js", "polyfills": "src/polyfills.ts", "scripts": [], - "styles": [ - "src/styles.css" - ], - "assets": [ - "src/assets", - "src/favicon.ico" - ] + "styles": ["src/styles.css"], + "assets": ["src/assets", "src/favicon.ico"] } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": [ - "src/tsconfig.json" - ], + "tsConfig": ["src/tsconfig.json"], "exclude": [] } } @@ -104,9 +92,7 @@ "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": [ - "e2e/tsconfig.json" - ], + "tsConfig": ["e2e/tsconfig.json"], "exclude": [] } } @@ -123,4 +109,4 @@ "prefix": "app" } } -} \ No newline at end of file +} diff --git a/examples/e2e/app.e2e-spec.ts b/examples/e2e/app.e2e-spec.ts index c36d06d..79558e0 100644 --- a/examples/e2e/app.e2e-spec.ts +++ b/examples/e2e/app.e2e-spec.ts @@ -1,14 +1,14 @@ -import { ExamplesPage } from './app.po'; +import { ExamplesPage } from "./app.po"; -describe('examples App', () => { +describe("examples App", () => { let page: ExamplesPage; beforeEach(() => { page = new ExamplesPage(); }); - it('should display message saying app works', () => { + it("should display message saying app works", () => { page.navigateTo(); - expect(page.getParagraphText()).toEqual('app works!'); + expect(page.getParagraphText()).toEqual("app works!"); }); }); diff --git a/examples/e2e/app.po.ts b/examples/e2e/app.po.ts index c7eb8cc..b2921e5 100644 --- a/examples/e2e/app.po.ts +++ b/examples/e2e/app.po.ts @@ -1,11 +1,11 @@ -import { browser, element, by } from 'protractor'; +import { browser, element, by } from "protractor"; export class ExamplesPage { navigateTo() { - return browser.get('/'); + return browser.get("/"); } getParagraphText() { - return element(by.css('app-root h1')).getText(); + return element(by.css("app-root h1")).getText(); } } diff --git a/examples/e2e/tsconfig.json b/examples/e2e/tsconfig.json index 94da47a..c1078a6 100644 --- a/examples/e2e/tsconfig.json +++ b/examples/e2e/tsconfig.json @@ -4,16 +4,12 @@ "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "lib": [ - "es2016" - ], + "lib": ["es2016"], "module": "commonjs", "moduleResolution": "node", "outDir": "../dist/out-tsc-e2e", "sourceMap": true, "target": "es6", - "typeRoots": [ - "../node_modules/@types" - ] + "typeRoots": ["../node_modules/@types"] } } diff --git a/examples/karma.conf.js b/examples/karma.conf.js index c3b7640..43aa3af 100644 --- a/examples/karma.conf.js +++ b/examples/karma.conf.js @@ -3,40 +3,36 @@ module.exports = function (config) { config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], + basePath: "", + frameworks: ["jasmine", "@angular-devkit/build-angular"], plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') + require("karma-jasmine"), + require("karma-chrome-launcher"), + require("karma-jasmine-html-reporter"), + require("karma-coverage-istanbul-reporter"), + require("@angular-devkit/build-angular/plugins/karma"), ], - client:{ - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - files: [ - - ], - preprocessors: { - + client: { + clearContext: false, // leave Jasmine Spec Runner output visible in browser }, + files: [], + preprocessors: {}, mime: { - 'text/x-typescript': ['ts','tsx'] + "text/x-typescript": ["ts", "tsx"], }, coverageIstanbulReporter: { - dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], - fixWebpackSourcePaths: true + dir: require("path").join(__dirname, "coverage"), + reports: ["html", "lcovonly"], + fixWebpackSourcePaths: true, }, - - reporters: config.angularCli && config.angularCli.codeCoverage - ? ['progress', 'coverage-istanbul'] - : ['progress', 'kjhtml'], + + reporters: + config.angularCli && config.angularCli.codeCoverage ? ["progress", "coverage-istanbul"] : ["progress", "kjhtml"], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], - singleRun: false + browsers: ["Chrome"], + singleRun: false, }); }; diff --git a/examples/package.json b/examples/package.json index 59f232b..acdbef0 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,56 +1,56 @@ { - "name": "examples", - "version": "0.0.0", - "license": "MIT", - "angular-cli": {}, - "scripts": { - "ng": "ng", - "start": "ng serve", - "test": "ng test", - "lint": "ng lint", - "e2e": "ng e2e", - "build.prod": "ng build --prod --base-href https://Nightapes.github.io/ngx-validators/", - "ngh": "ngh --no-silent" - }, - "private": true, - "dependencies": { - "@angular/animations": "^7.0.0", - "@angular/cdk": "^7.0.1", - "@angular/common": "^7.0.0", - "@angular/compiler": "^7.0.0", - "@angular/core": "^7.0.0", - "@angular/forms": "^7.0.0", - "@angular/http": "^7.0.0", - "@angular/material": "^7.0.1", - "@angular/platform-browser": "^7.0.0", - "@angular/platform-browser-dynamic": "^7.0.0", - "@angular/router": "^7.0.0", - "core-js": "^2.4.1", - "hammerjs": "^2.0.8", - "ngx-highlightjs": "^2.1.1", - "ngx-validators": "file:../dist", - "rxjs": "^6.2.2", - "zone.js": "^0.8.5" - }, - "devDependencies": { - "@angular-devkit/build-angular": "~0.7.0", - "@angular/cli": "7.0.2", - "@angular/compiler-cli": "^7.0.0", - "@types/jasmine": "2.5.46", - "@types/node": "~7.0.11", - "angular-cli-ghpages": "^0.5.3", - "codelyzer": "~3.0.0-beta.4", - "jasmine-core": "~2.5.2", - "jasmine-spec-reporter": "~3.2.0", - "karma": "~1.5.0", - "karma-chrome-launcher": "~2.0.0", - "karma-cli": "~1.0.1", - "karma-coverage-istanbul-reporter": "^1.0.0", - "karma-jasmine": "~1.1.0", - "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "~5.1.1", - "ts-node": "~3.0.2", - "tslint": "~4.5.1", - "typescript": "3.1.3" - } + "name": "examples", + "version": "0.0.0", + "license": "MIT", + "angular-cli": {}, + "scripts": { + "ng": "ng", + "start": "ng serve", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e", + "build.prod": "ng build --prod --base-href https://Nightapes.github.io/ngx-validators/", + "ngh": "ngh --no-silent" + }, + "private": true, + "dependencies": { + "@angular/animations": "^7.0.0", + "@angular/cdk": "^7.0.1", + "@angular/common": "^7.0.0", + "@angular/compiler": "^7.0.0", + "@angular/core": "^7.0.0", + "@angular/forms": "^7.0.0", + "@angular/http": "^7.0.0", + "@angular/material": "^7.0.1", + "@angular/platform-browser": "^7.0.0", + "@angular/platform-browser-dynamic": "^7.0.0", + "@angular/router": "^7.0.0", + "core-js": "^2.4.1", + "hammerjs": "^2.0.8", + "ngx-highlightjs": "^2.1.1", + "ngx-validators": "5.2.0", + "rxjs": "^6.2.2", + "zone.js": "^0.8.5" + }, + "devDependencies": { + "@angular-devkit/build-angular": "~0.7.0", + "@angular/cli": "7.0.2", + "@angular/compiler-cli": "^7.0.0", + "@types/jasmine": "2.5.46", + "@types/node": "~7.0.11", + "angular-cli-ghpages": "^0.5.3", + "codelyzer": "~3.0.0-beta.4", + "jasmine-core": "~2.5.2", + "jasmine-spec-reporter": "~3.2.0", + "karma": "~1.5.0", + "karma-chrome-launcher": "~2.0.0", + "karma-cli": "~1.0.1", + "karma-coverage-istanbul-reporter": "^1.0.0", + "karma-jasmine": "~1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.1.1", + "ts-node": "~3.0.2", + "tslint": "~4.5.1", + "typescript": "3.1.3" + } } diff --git a/examples/src/app/app.component.css b/examples/src/app/app.component.css index cfa4979..85442ab 100644 --- a/examples/src/app/app.component.css +++ b/examples/src/app/app.component.css @@ -1,43 +1,43 @@ .container { - margin: 24px; - align-content: center; - margin: auto; - padding: 10px; + margin: 24px; + align-content: center; + margin: auto; + padding: 10px; } @media screen and (min-width: 768px) { - .container { - width: 75%; - } + .container { + width: 75%; + } } md-sidenav { - width: 250px; + width: 250px; } .selected { - font-weight: 600; + font-weight: 600; } .menu-button { - min-width: 48px !important; - min-height: 48px !important; + min-width: 48px !important; + min-height: 48px !important; } .home { - padding-left: 20px; + padding-left: 20px; } .github { - height: 30px; - margin: auto; - margin-top: 9px; + height: 30px; + margin: auto; + margin-top: 9px; } .mat-sidenav { - width: 400px; + width: 400px; } .fill-space { - flex: 1 1 auto; -} \ No newline at end of file + flex: 1 1 auto; +} diff --git a/examples/src/app/app.component.html b/examples/src/app/app.component.html index a710b9a..b18f898 100644 --- a/examples/src/app/app.component.html +++ b/examples/src/app/app.component.html @@ -1,27 +1,34 @@ - - ngx-validators - - - - + + ngx-validators + + + + - - - -
{{item.name}}
- - - {{validator.name}} - -
-
+ + + +
{{ item.name }}
+ + + {{ validator.name }} + +
+
- -
- -
-
\ No newline at end of file + +
+ +
+ diff --git a/examples/src/app/app.component.spec.ts b/examples/src/app/app.component.spec.ts index 13c632d..16d72dc 100644 --- a/examples/src/app/app.component.spec.ts +++ b/examples/src/app/app.component.spec.ts @@ -1,17 +1,15 @@ -import { TestBed, async } from '@angular/core/testing'; -import { AppComponent } from './app.component'; +import { TestBed, async } from "@angular/core/testing"; +import { AppComponent } from "./app.component"; -describe('AppComponent', () => { +describe("AppComponent", () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [ - AppComponent - ], + declarations: [AppComponent], }); TestBed.compileComponents(); }); - it('should create the app', async(() => { + it("should create the app", async(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); @@ -20,13 +18,13 @@ describe('AppComponent', () => { it(`should have as title 'app works!'`, async(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('app works!'); + expect(app.title).toEqual("app works!"); })); - it('should render title in a h1 tag', async(() => { + it("should render title in a h1 tag", async(() => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('app works!'); + expect(compiled.querySelector("h1").textContent).toContain("app works!"); })); }); diff --git a/examples/src/app/app.component.ts b/examples/src/app/app.component.ts index bd6b9de..339091b 100644 --- a/examples/src/app/app.component.ts +++ b/examples/src/app/app.component.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; -import { items, Items } from './items'; +import { Component } from "@angular/core"; +import { items, Items } from "./items"; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + selector: "app-root", + templateUrl: "./app.component.html", + styleUrls: ["./app.component.css"], }) export class AppComponent { menuItems: Items[] = items; diff --git a/examples/src/app/app.module.ts b/examples/src/app/app.module.ts index 1a98917..28e9c2b 100644 --- a/examples/src/app/app.module.ts +++ b/examples/src/app/app.module.ts @@ -1,7 +1,7 @@ -import { UniversalModule } from './universal-validator/universal-validator.module'; -import { GuideModule } from './guide/guide.module'; -import { ValidatorsModule } from 'ngx-validators'; -import { RouterModule } from '@angular/router'; +import { UniversalModule } from "./universal-validator/universal-validator.module"; +import { GuideModule } from "./guide/guide.module"; +import { ValidatorsModule } from "ngx-validators"; +import { RouterModule } from "@angular/router"; import { MatButtonModule, MatCardModule, @@ -11,23 +11,21 @@ import { MatSidenavModule, MatTabsModule, MatToolbarModule, - MAT_FORM_FIELD_DEFAULT_OPTIONS -} from '@angular/material'; -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { HttpModule } from '@angular/http'; + MAT_FORM_FIELD_DEFAULT_OPTIONS, +} from "@angular/material"; +import { BrowserModule } from "@angular/platform-browser"; +import { NgModule } from "@angular/core"; +import { HttpModule } from "@angular/http"; -import { AppComponent } from './app.component'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { EmailModule } from './email-validator/email-validator.module'; -import { PasswordModule } from './password-validator/password-validator.module'; -import { CreditcardModule } from './creditcard-validator/creditcard-validator.module'; -import { EqualToValidatorModule } from './equal-to-validator/equal-to-validator.module'; +import { AppComponent } from "./app.component"; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { EmailModule } from "./email-validator/email-validator.module"; +import { PasswordModule } from "./password-validator/password-validator.module"; +import { CreditcardModule } from "./creditcard-validator/creditcard-validator.module"; +import { EqualToValidatorModule } from "./equal-to-validator/equal-to-validator.module"; @NgModule({ - declarations: [ - AppComponent - ], + declarations: [AppComponent], imports: [ BrowserModule, RouterModule.forRoot([], { useHash: true }), @@ -47,9 +45,9 @@ import { EqualToValidatorModule } from './equal-to-validator/equal-to-validator. PasswordModule, EmailModule, CreditcardModule, - EqualToValidatorModule + EqualToValidatorModule, ], - providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'standard' } }], - bootstrap: [AppComponent] + providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: "standard" } }], + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/examples/src/app/creditcard-validator/creditcard-validator.component.html b/examples/src/app/creditcard-validator/creditcard-validator.component.html index 6ff39f2..e6c194e 100644 --- a/examples/src/app/creditcard-validator/creditcard-validator.component.html +++ b/examples/src/app/creditcard-validator/creditcard-validator.component.html @@ -1,39 +1,47 @@ - - - Form - - - Reactive Form - - + + + Form + + + Reactive Form + + - - Credit card validator - {{item}} - - - - - - - - - - - - - - - - - - - - - - - + + Credit card validator - {{ item }} + + + + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + diff --git a/examples/src/app/creditcard-validator/creditcard-validator.component.ts b/examples/src/app/creditcard-validator/creditcard-validator.component.ts index 69e0a7b..4361193 100644 --- a/examples/src/app/creditcard-validator/creditcard-validator.component.ts +++ b/examples/src/app/creditcard-validator/creditcard-validator.component.ts @@ -1,44 +1,38 @@ -import { Validator } from './../items'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { ActivatedRoute } from '@angular/router'; - - -import { isNumber } from 'util'; -import { Component } from '@angular/core'; -import { OnInit } from '@angular/core'; -import { OnDestroy } from '@angular/core'; -import { creditcards } from '../items'; - +import { Validator } from "./../items"; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { ActivatedRoute } from "@angular/router"; +import { isNumber } from "util"; +import { Component } from "@angular/core"; +import { OnInit } from "@angular/core"; +import { OnDestroy } from "@angular/core"; +import { creditcards } from "../items"; @Component({ - selector: 'creditcard-validator', - templateUrl: './creditcard-validator.component.html' + selector: "creditcard-validator", + templateUrl: "./creditcard-validator.component.html", }) export class CreditcardValidatorComponent implements OnInit, OnDestroy { - - - private sub: any; - creditcardItems = creditcards; - item: string = this.creditcardItems[0].name; - currentValidator: Validator; - selected = 'reactiveForm'; - - constructor(private route: ActivatedRoute) { } - - - ngOnInit() { - this.currentValidator = this.creditcardItems.filter(x => x.name === this.item)[0]; - this.sub = this.route.params.subscribe(params => { - this.item = params['id']; - if (this.item) { - this.currentValidator = this.creditcardItems.filter(x => x.name === this.item)[0]; - } - }); - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } + private sub: any; + creditcardItems = creditcards; + item: string = this.creditcardItems[0].name; + currentValidator: Validator; + selected = "reactiveForm"; + + constructor(private route: ActivatedRoute) {} + + ngOnInit() { + this.currentValidator = this.creditcardItems.filter((x) => x.name === this.item)[0]; + this.sub = this.route.params.subscribe((params) => { + this.item = params["id"]; + if (this.item) { + this.currentValidator = this.creditcardItems.filter((x) => x.name === this.item)[0]; + } + }); + } + + ngOnDestroy() { + this.sub.unsubscribe(); + } } diff --git a/examples/src/app/creditcard-validator/creditcard-validator.module.ts b/examples/src/app/creditcard-validator/creditcard-validator.module.ts index 7b43649..64071b3 100644 --- a/examples/src/app/creditcard-validator/creditcard-validator.module.ts +++ b/examples/src/app/creditcard-validator/creditcard-validator.module.ts @@ -1,39 +1,46 @@ -import { MatCardModule, MatListModule, MatFormFieldModule, MatTooltipModule, MatInputModule, MatSelectModule } from '@angular/material'; -import { NgModule, Component } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MatButtonModule, MatTabsModule } from '@angular/material'; -import { Routes, RouterModule } from '@angular/router'; -import { UtilModule } from '../util/util.module'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { + MatCardModule, + MatListModule, + MatFormFieldModule, + MatTooltipModule, + MatInputModule, + MatSelectModule, +} from "@angular/material"; +import { NgModule, Component } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { MatButtonModule, MatTabsModule } from "@angular/material"; +import { Routes, RouterModule } from "@angular/router"; +import { UtilModule } from "../util/util.module"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { ValidatorsModule } from 'ngx-validators'; -import { CreditcardValidatorComponent } from './creditcard-validator.component'; -import { FormDiscoverComponent } from './form/discover/form-discover.component'; -import { FormCreditcardComponent } from './form/creditcard/form-creditcard.component'; -import { FormMastercardComponent } from './form/mastercard/form-mastercard.component'; -import { FormDinersclubComponent } from './form/dinersclub/form-dinersclub.component'; -import { FormJcpComponent } from './form/jcb/form-jcb.component'; -import { FormMaestroComponent } from './form/maestro/form-maestro.component'; -import { FormVisaComponent } from './form/visa/form-visa.component'; -import { FormAmericanExpressComponent } from './form/american-express/form-american-express.component'; -import { ReactiveFormDiscoverComponent } from './reactive-form/discover/reactive-form-discover.component'; -import { ReactiveFormCreditcardComponent } from './reactive-form/creditcard/reactive-form-creditcard.component'; -import { ReactiveFormMastercardComponent } from './reactive-form/mastercard/reactive-form-mastercard.component'; -import { ReactiveFormDinersclubComponent } from './reactive-form/dinersclub/reactive-form-dinersclub.component'; -import { ReactiveFormJcpComponent } from './reactive-form/jcb/reactive-form-jcb.component'; -import { ReactiveFormMaestroComponent } from './reactive-form/maestro/reactive-form-maestro.component'; -import { ReactiveFormVisaComponent } from './reactive-form/visa/reactive-form-visa.component'; -import { ReactiveFormAmericanExpressComponent } from './reactive-form/american-express/reactive-form-american-express.component'; +import { ValidatorsModule } from "ngx-validators"; +import { CreditcardValidatorComponent } from "./creditcard-validator.component"; +import { FormDiscoverComponent } from "./form/discover/form-discover.component"; +import { FormCreditcardComponent } from "./form/creditcard/form-creditcard.component"; +import { FormMastercardComponent } from "./form/mastercard/form-mastercard.component"; +import { FormDinersclubComponent } from "./form/dinersclub/form-dinersclub.component"; +import { FormJcpComponent } from "./form/jcb/form-jcb.component"; +import { FormMaestroComponent } from "./form/maestro/form-maestro.component"; +import { FormVisaComponent } from "./form/visa/form-visa.component"; +import { FormAmericanExpressComponent } from "./form/american-express/form-american-express.component"; +import { ReactiveFormDiscoverComponent } from "./reactive-form/discover/reactive-form-discover.component"; +import { ReactiveFormCreditcardComponent } from "./reactive-form/creditcard/reactive-form-creditcard.component"; +import { ReactiveFormMastercardComponent } from "./reactive-form/mastercard/reactive-form-mastercard.component"; +import { ReactiveFormDinersclubComponent } from "./reactive-form/dinersclub/reactive-form-dinersclub.component"; +import { ReactiveFormJcpComponent } from "./reactive-form/jcb/reactive-form-jcb.component"; +import { ReactiveFormMaestroComponent } from "./reactive-form/maestro/reactive-form-maestro.component"; +import { ReactiveFormVisaComponent } from "./reactive-form/visa/reactive-form-visa.component"; +import { ReactiveFormAmericanExpressComponent } from "./reactive-form/american-express/reactive-form-american-express.component"; const routes: Routes = [ { - path: 'creditcard', + path: "creditcard", component: CreditcardValidatorComponent, }, { - path: 'creditcard/:id', + path: "creditcard/:id", component: CreditcardValidatorComponent, - } + }, ]; @NgModule({ @@ -51,11 +58,9 @@ const routes: Routes = [ MatTabsModule, MatInputModule, UtilModule, - ValidatorsModule - ], - exports: [ - RouterModule + ValidatorsModule, ], + exports: [RouterModule], declarations: [ FormAmericanExpressComponent, FormVisaComponent, @@ -75,7 +80,7 @@ const routes: Routes = [ ReactiveFormMaestroComponent, ReactiveFormCreditcardComponent, ReactiveFormMastercardComponent, - CreditcardValidatorComponent - ] + CreditcardValidatorComponent, + ], }) -export class CreditcardModule { } +export class CreditcardModule {} diff --git a/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.html b/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.html index 4a4acef..a7eebe0 100644 --- a/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.html +++ b/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.html @@ -1,4 +1,12 @@ - - This is not a AmericanExpress card - \ No newline at end of file + + This is not a AmericanExpress card + diff --git a/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.ts b/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.ts index cca70c1..e23658c 100644 --- a/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.ts +++ b/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-american-express', - templateUrl: './form-american-express.component.html' + selector: "app-american-express", + templateUrl: "./form-american-express.component.html", }) - export class FormAmericanExpressComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.html b/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.html index 87d0a0e..4337adb 100644 --- a/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.html +++ b/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.html @@ -1,4 +1,12 @@ - - This is not a credit card - \ No newline at end of file + + This is not a credit card + diff --git a/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.ts b/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.ts index ef9d02e..00e81fe 100644 --- a/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.ts +++ b/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-creditcard', - templateUrl: './form-creditcard.component.html' + selector: "app-creditcard", + templateUrl: "./form-creditcard.component.html", }) - export class FormCreditcardComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.html b/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.html index 08992ce..432cafd 100644 --- a/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.html +++ b/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.html @@ -1,4 +1,12 @@ - - This is not a Dinersclub card - \ No newline at end of file + + This is not a Dinersclub card + diff --git a/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.ts b/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.ts index bfd7e0c..58df465 100644 --- a/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.ts +++ b/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-dinersclub', - templateUrl: './form-dinersclub.component.html' + selector: "app-dinersclub", + templateUrl: "./form-dinersclub.component.html", }) - export class FormDinersclubComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/form/discover/form-discover.component.html b/examples/src/app/creditcard-validator/form/discover/form-discover.component.html index 2c75f33..a4d509b 100644 --- a/examples/src/app/creditcard-validator/form/discover/form-discover.component.html +++ b/examples/src/app/creditcard-validator/form/discover/form-discover.component.html @@ -1,4 +1,12 @@ - - This is not a Discover card - \ No newline at end of file + + This is not a Discover card + diff --git a/examples/src/app/creditcard-validator/form/discover/form-discover.component.ts b/examples/src/app/creditcard-validator/form/discover/form-discover.component.ts index 000791c..2944520 100644 --- a/examples/src/app/creditcard-validator/form/discover/form-discover.component.ts +++ b/examples/src/app/creditcard-validator/form/discover/form-discover.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-discover', - templateUrl: './form-discover.component.html' + selector: "app-discover", + templateUrl: "./form-discover.component.html", }) - export class FormDiscoverComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.html b/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.html index 3cfeef0..f05dd8c 100644 --- a/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.html +++ b/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.html @@ -1,4 +1,12 @@ - - This is not a JCB card - \ No newline at end of file + + This is not a JCB card + diff --git a/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.ts b/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.ts index 91c94b3..c19bdf5 100644 --- a/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.ts +++ b/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-jcb', - templateUrl: './form-jcb.component.html' + selector: "app-jcb", + templateUrl: "./form-jcb.component.html", }) - export class FormJcpComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.html b/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.html index f408836..7f5c674 100644 --- a/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.html +++ b/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.html @@ -1,4 +1,12 @@ - - This is not a Maestro card - \ No newline at end of file + + This is not a Maestro card + diff --git a/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.ts b/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.ts index 701c3ca..7904f51 100644 --- a/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.ts +++ b/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-maestro', - templateUrl: './form-maestro.component.html' + selector: "app-maestro", + templateUrl: "./form-maestro.component.html", }) - export class FormMaestroComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.html b/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.html index 0723eec..d56b889 100644 --- a/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.html +++ b/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.html @@ -1,4 +1,12 @@ - - This is not a Mastercard card - \ No newline at end of file + + This is not a Mastercard card + diff --git a/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.ts b/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.ts index 359fbde..9b7c2ed 100644 --- a/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.ts +++ b/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-mastercard', - templateUrl: './form-mastercard.component.html' + selector: "app-mastercard", + templateUrl: "./form-mastercard.component.html", }) - export class FormMastercardComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/form/visa/form-visa.component.html b/examples/src/app/creditcard-validator/form/visa/form-visa.component.html index cd7887f..8801b13 100644 --- a/examples/src/app/creditcard-validator/form/visa/form-visa.component.html +++ b/examples/src/app/creditcard-validator/form/visa/form-visa.component.html @@ -1,4 +1,12 @@ - - This is not a VISA card - \ No newline at end of file + + This is not a VISA card + diff --git a/examples/src/app/creditcard-validator/form/visa/form-visa.component.ts b/examples/src/app/creditcard-validator/form/visa/form-visa.component.ts index 0f9858f..9cf1118 100644 --- a/examples/src/app/creditcard-validator/form/visa/form-visa.component.ts +++ b/examples/src/app/creditcard-validator/form/visa/form-visa.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-visa', - templateUrl: './form-visa.component.html' + selector: "app-visa", + templateUrl: "./form-visa.component.html", }) - export class FormVisaComponent { model: any; } diff --git a/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.html b/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.html index 05bf5b0..9c7a580 100644 --- a/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.html @@ -1,6 +1,6 @@
- - - Is not a AmericanExpress - -
\ No newline at end of file + + + Is not a AmericanExpress + + diff --git a/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.ts b/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.ts index 9d030d0..ef5de96 100644 --- a/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-american-express', - templateUrl: './reactive-form-american-express.component.html' + selector: "app-reactive-american-express", + templateUrl: "./reactive-form-american-express.component.html", }) export class ReactiveFormAmericanExpressComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.americanExpress])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.americanExpress])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.html b/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.html index 85598d6..726b369 100644 --- a/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.html @@ -1,6 +1,6 @@
- - - Is not a credit card - -
\ No newline at end of file + + + Is not a credit card + + diff --git a/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.ts b/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.ts index f55f060..49c9fe4 100644 --- a/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-creditcard', - templateUrl: './reactive-form-creditcard.component.html' + selector: "app-reactive-creditcard", + templateUrl: "./reactive-form-creditcard.component.html", }) export class ReactiveFormCreditcardComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.isCreditCard])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.isCreditCard])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.html b/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.html index 6a63d15..eb6f56c 100644 --- a/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.html @@ -1,6 +1,6 @@
- - - Is not a Dinersclub - -
\ No newline at end of file + + + Is not a Dinersclub + + diff --git a/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.ts b/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.ts index b487123..e78756f 100644 --- a/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-dinersclub', - templateUrl: './reactive-form-dinersclub.component.html' + selector: "app-reactive-dinersclub", + templateUrl: "./reactive-form-dinersclub.component.html", }) export class ReactiveFormDinersclubComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.dinersclub])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.dinersclub])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.html b/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.html index bbeba49..610e0c0 100644 --- a/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.html @@ -1,6 +1,6 @@
- - - Is not a Discover - -
\ No newline at end of file + + + Is not a Discover + + diff --git a/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.ts b/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.ts index d262920..f65441e 100644 --- a/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-discover', - templateUrl: './reactive-form-discover.component.html' + selector: "app-reactive-discover", + templateUrl: "./reactive-form-discover.component.html", }) export class ReactiveFormDiscoverComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.discover])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.discover])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.html b/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.html index 277699b..c068753 100644 --- a/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.html @@ -1,6 +1,6 @@
- - - Is not a JCB - -
\ No newline at end of file + + + Is not a JCB + + diff --git a/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.ts b/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.ts index 7e6e514..ef5b761 100644 --- a/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-jcb', - templateUrl: './reactive-form-jcb.component.html' + selector: "app-reactive-jcb", + templateUrl: "./reactive-form-jcb.component.html", }) export class ReactiveFormJcpComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.jcb])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.jcb])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.html b/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.html index 9f95e1c..e8aaa0e 100644 --- a/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.html @@ -1,6 +1,6 @@
- - - Is not a Maestro - -
\ No newline at end of file + + + Is not a Maestro + + diff --git a/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.ts b/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.ts index 4f4334f..b974e20 100644 --- a/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-maestro', - templateUrl: './reactive-form-maestro.component.html' + selector: "app-reactive-maestro", + templateUrl: "./reactive-form-maestro.component.html", }) export class ReactiveFormMaestroComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.maestro])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.maestro])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.html b/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.html index ad408e2..7a82be3 100644 --- a/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.html @@ -1,6 +1,6 @@
- - - Is not a Mastercard - -
\ No newline at end of file + + + Is not a Mastercard + + diff --git a/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.ts b/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.ts index 3953079..ef3d8d5 100644 --- a/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-mastercard', - templateUrl: './reactive-form-mastercard.component.html' + selector: "app-reactive-mastercard", + templateUrl: "./reactive-form-mastercard.component.html", }) export class ReactiveFormMastercardComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.mastercard])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.mastercard])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.html b/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.html index efaaf1d..545991a 100644 --- a/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.html +++ b/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.html @@ -1,6 +1,6 @@
- - - Is not a VISA - -
\ No newline at end of file + + + Is not a VISA + + diff --git a/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.ts b/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.ts index 5f4056f..a5e4155 100644 --- a/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.ts +++ b/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.ts @@ -1,20 +1,19 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { CreditCardValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { CreditCardValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-visa', - templateUrl: './reactive-form-visa.component.html' + selector: "app-reactive-visa", + templateUrl: "./reactive-form-visa.component.html", }) export class ReactiveFormVisaComponent implements OnInit { - form: FormGroup; - creditcard = new FormControl('', Validators.compose([CreditCardValidators.visa])); - constructor(protected _fb: FormBuilder) { } + creditcard = new FormControl("", Validators.compose([CreditCardValidators.visa])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'creditcard': this.creditcard, + creditcard: this.creditcard, }); } } diff --git a/examples/src/app/email-validator/email-validator.component.html b/examples/src/app/email-validator/email-validator.component.html index ee31b92..a0c88f8 100644 --- a/examples/src/app/email-validator/email-validator.component.html +++ b/examples/src/app/email-validator/email-validator.component.html @@ -1,29 +1,37 @@ - - - Form - - - Reactive Form - - + + + Form + + + Reactive Form + + - - Email validator - {{item}} - - - - - -
Try test@gmai.con
-
- - - -
Try test@gmai.con
-
-
+ + Email validator - {{ item }} + + + + + +
Try test@gmai.con
+
+ + + +
Try test@gmai.con
+
+
- - \ No newline at end of file + + diff --git a/examples/src/app/email-validator/email-validator.component.ts b/examples/src/app/email-validator/email-validator.component.ts index 12cf8bd..ce81725 100644 --- a/examples/src/app/email-validator/email-validator.component.ts +++ b/examples/src/app/email-validator/email-validator.component.ts @@ -1,43 +1,38 @@ -import { Validator } from './../items'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { EmailValidators } from 'ngx-validators'; -import { ActivatedRoute } from '@angular/router'; - - -import { isNumber } from 'util'; -import { Component } from '@angular/core'; -import { OnInit } from '@angular/core'; -import { OnDestroy } from '@angular/core'; -import { email } from '../items'; +import { Validator } from "./../items"; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { EmailValidators } from "ngx-validators"; +import { ActivatedRoute } from "@angular/router"; +import { isNumber } from "util"; +import { Component } from "@angular/core"; +import { OnInit } from "@angular/core"; +import { OnDestroy } from "@angular/core"; +import { email } from "../items"; @Component({ - selector: 'email-validator', - templateUrl: './email-validator.component.html' + selector: "email-validator", + templateUrl: "./email-validator.component.html", }) export class EmailValidatorComponent implements OnInit, OnDestroy { - - - private sub: any; - emailItems = email; - item: string = this.emailItems[0].name; - currentValidator: Validator; - selected = 'reactiveForm'; - - constructor(private route: ActivatedRoute) { } - - - ngOnInit() { - this.currentValidator = this.emailItems.filter(x => x.name === this.item)[0]; - this.sub = this.route.params.subscribe(params => { - this.item = params['id']; - if (this.item) { - this.currentValidator = this.emailItems.filter(x => x.name === this.item)[0]; - } - }); - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } + private sub: any; + emailItems = email; + item: string = this.emailItems[0].name; + currentValidator: Validator; + selected = "reactiveForm"; + + constructor(private route: ActivatedRoute) {} + + ngOnInit() { + this.currentValidator = this.emailItems.filter((x) => x.name === this.item)[0]; + this.sub = this.route.params.subscribe((params) => { + this.item = params["id"]; + if (this.item) { + this.currentValidator = this.emailItems.filter((x) => x.name === this.item)[0]; + } + }); + } + + ngOnDestroy() { + this.sub.unsubscribe(); + } } diff --git a/examples/src/app/email-validator/email-validator.module.ts b/examples/src/app/email-validator/email-validator.module.ts index 893d37d..c793689 100644 --- a/examples/src/app/email-validator/email-validator.module.ts +++ b/examples/src/app/email-validator/email-validator.module.ts @@ -1,29 +1,34 @@ -import { MatCardModule, MatListModule, MatFormFieldModule, MatTooltipModule, MatInputModule, MatSelectModule } from '@angular/material'; -import { NgModule, } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MatButtonModule, MatTabsModule } from '@angular/material'; -import { Routes, RouterModule } from '@angular/router'; -import { EmailValidatorComponent } from './email-validator.component'; -import { UtilModule } from '../util/util.module'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ReactiveFormEmailComponent } from './reactive-form/email/reactive-form-email.component'; - -import { FormEmailComponent } from './form/email/form-email.component'; -import { ValidatorsModule } from 'ngx-validators'; -import { ReactiveFormEmailSuggestComponent } from './reactive-form/suggest/reactive-form-email-suggest.component'; -import { FormEmailSuggestComponent } from './form/suggest/form-email-suggest.component'; - +import { + MatCardModule, + MatListModule, + MatFormFieldModule, + MatTooltipModule, + MatInputModule, + MatSelectModule, +} from "@angular/material"; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { MatButtonModule, MatTabsModule } from "@angular/material"; +import { Routes, RouterModule } from "@angular/router"; +import { EmailValidatorComponent } from "./email-validator.component"; +import { UtilModule } from "../util/util.module"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { ReactiveFormEmailComponent } from "./reactive-form/email/reactive-form-email.component"; +import { FormEmailComponent } from "./form/email/form-email.component"; +import { ValidatorsModule } from "ngx-validators"; +import { ReactiveFormEmailSuggestComponent } from "./reactive-form/suggest/reactive-form-email-suggest.component"; +import { FormEmailSuggestComponent } from "./form/suggest/form-email-suggest.component"; const routes: Routes = [ { - path: 'email', + path: "email", component: EmailValidatorComponent, }, { - path: 'email/:id', + path: "email/:id", component: EmailValidatorComponent, - } + }, ]; @NgModule({ @@ -41,17 +46,15 @@ const routes: Routes = [ MatTabsModule, MatInputModule, UtilModule, - ValidatorsModule - ], - exports: [ - RouterModule + ValidatorsModule, ], + exports: [RouterModule], declarations: [ ReactiveFormEmailComponent, ReactiveFormEmailSuggestComponent, FormEmailComponent, EmailValidatorComponent, - FormEmailSuggestComponent - ] + FormEmailSuggestComponent, + ], }) -export class EmailModule { } +export class EmailModule {} diff --git a/examples/src/app/email-validator/form/email/form-email.component.html b/examples/src/app/email-validator/form/email/form-email.component.html index 25a2c6b..c029992 100644 --- a/examples/src/app/email-validator/form/email/form-email.component.html +++ b/examples/src/app/email-validator/form/email/form-email.component.html @@ -1,6 +1,6 @@
- - - Is not a email - -
\ No newline at end of file + + + Is not a email + + diff --git a/examples/src/app/email-validator/form/email/form-email.component.ts b/examples/src/app/email-validator/form/email/form-email.component.ts index 393dc58..76586a5 100644 --- a/examples/src/app/email-validator/form/email/form-email.component.ts +++ b/examples/src/app/email-validator/form/email/form-email.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-email', - templateUrl: './form-email.component.html' + selector: "app-email", + templateUrl: "./form-email.component.html", }) - export class FormEmailComponent { model: any; } diff --git a/examples/src/app/email-validator/form/suggest/form-email-suggest.component.html b/examples/src/app/email-validator/form/suggest/form-email-suggest.component.html index 5e7e329..da20e7f 100644 --- a/examples/src/app/email-validator/form/suggest/form-email-suggest.component.html +++ b/examples/src/app/email-validator/form/suggest/form-email-suggest.component.html @@ -1,6 +1,19 @@
- - - Did you mean:{{formControl.getError('suggestion').domain}} - -
\ No newline at end of file + + + + Did you mean:{{ + formControl.getError("suggestion").domain + }} + + + diff --git a/examples/src/app/email-validator/form/suggest/form-email-suggest.component.ts b/examples/src/app/email-validator/form/suggest/form-email-suggest.component.ts index 70aa6b8..efdc52d 100644 --- a/examples/src/app/email-validator/form/suggest/form-email-suggest.component.ts +++ b/examples/src/app/email-validator/form/suggest/form-email-suggest.component.ts @@ -1,31 +1,93 @@ -import { Component } from '@angular/core'; -import { EmailOptions } from 'ngx-validators/components/email/email-util'; +import { Component } from "@angular/core"; +import { EmailOptions } from "ngx-validators/components/email/email-util"; @Component({ - selector: 'app-email-suggest', - templateUrl: './form-email-suggest.component.html' + selector: "app-email-suggest", + templateUrl: "./form-email-suggest.component.html", }) - export class FormEmailSuggestComponent { model: any; // Add your own domains via EmailOptions customOptions: EmailOptions = { - domains: ['msn.com', 'bellsouth.net', - 'telus.net', 'comcast.net', 'optusnet.com.au', - 'earthlink.net', 'qq.com', 'sky.com', 'icloud.com', - 'mac.com', 'sympatico.ca', 'googlemail.com', - 'att.net', 'xtra.co.nz', 'web.de', 'mymail.com', - 'cox.net', 'gmail.com', 'ymail.com', 'yahoo.com', - 'aim.com', 'rogers.com', 'verizon.net', - 'rocketmail.com', 'google.com', 'optonline.net', - 'sbcglobal.net', 'aol.com', 'me.com', 'btinternet.com', - 'charter.net', 'shaw.ca'], - secondLevelDomains: ['yahoo', 'hotmail', 'mail', 'live', 'outlook', 'gmx', 'mymail'], - topLevelDomains: ['com', 'com.au', 'com.tw', 'ca', 'co.nz', 'co.uk', 'de', - 'fr', 'it', 'ru', 'net', 'org', 'edu', 'gov', 'jp', 'nl', 'kr', 'se', 'eu', - 'ie', 'co.il', 'us', 'at', 'be', 'dk', 'hk', 'es', 'gr', 'ch', 'no', 'cz', - 'in', 'net', 'net.au', 'info', 'biz', 'mil', 'co.jp', 'sg', 'hu', 'uk'] + domains: [ + "msn.com", + "bellsouth.net", + "telus.net", + "comcast.net", + "optusnet.com.au", + "earthlink.net", + "qq.com", + "sky.com", + "icloud.com", + "mac.com", + "sympatico.ca", + "googlemail.com", + "att.net", + "xtra.co.nz", + "web.de", + "mymail.com", + "cox.net", + "gmail.com", + "ymail.com", + "yahoo.com", + "aim.com", + "rogers.com", + "verizon.net", + "rocketmail.com", + "google.com", + "optonline.net", + "sbcglobal.net", + "aol.com", + "me.com", + "btinternet.com", + "charter.net", + "shaw.ca", + ], + secondLevelDomains: ["yahoo", "hotmail", "mail", "live", "outlook", "gmx", "mymail"], + topLevelDomains: [ + "com", + "com.au", + "com.tw", + "ca", + "co.nz", + "co.uk", + "de", + "fr", + "it", + "ru", + "net", + "org", + "edu", + "gov", + "jp", + "nl", + "kr", + "se", + "eu", + "ie", + "co.il", + "us", + "at", + "be", + "dk", + "hk", + "es", + "gr", + "ch", + "no", + "cz", + "in", + "net", + "net.au", + "info", + "biz", + "mil", + "co.jp", + "sg", + "hu", + "uk", + ], }; addToForm(email) { diff --git a/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.html b/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.html index 413b9c6..44a18c7 100644 --- a/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.html +++ b/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.html @@ -1,6 +1,6 @@
- - - Is not a email - -
\ No newline at end of file + + + Is not a email + + diff --git a/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.ts b/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.ts index fd15033..db6d81b 100644 --- a/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.ts +++ b/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.ts @@ -1,24 +1,23 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { EmailValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { EmailValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-email', - templateUrl: './reactive-form-email.component.html' + selector: "app-reactive-email", + templateUrl: "./reactive-form-email.component.html", }) export class ReactiveFormEmailComponent implements OnInit { - form: FormGroup; - email = new FormControl('', Validators.compose([EmailValidators.normal])); - constructor(protected _fb: FormBuilder) { } + email = new FormControl("", Validators.compose([EmailValidators.normal])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'email': this.email, + email: this.email, }); } addToForm(email) { - this.form.get('email').setValue(email); + this.form.get("email").setValue(email); } } diff --git a/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.html b/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.html index a0fe759..ea45b0a 100644 --- a/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.html +++ b/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.html @@ -1,6 +1,11 @@
- - - Did you mean:{{email.getError('suggestion').domain}} - -
\ No newline at end of file + + + + Did you mean:{{ + email.getError("suggestion").domain + }} + + + diff --git a/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.ts b/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.ts index 8b0a115..bdfc1a9 100644 --- a/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.ts +++ b/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.ts @@ -1,43 +1,104 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { EmailValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; -import { EmailOptions } from 'ngx-validators/components/email/email-util'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { EmailValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; +import { EmailOptions } from "ngx-validators/components/email/email-util"; @Component({ - selector: 'app-reactive-email-suggest', - templateUrl: './reactive-form-email-suggest.component.html' + selector: "app-reactive-email-suggest", + templateUrl: "./reactive-form-email-suggest.component.html", }) export class ReactiveFormEmailSuggestComponent implements OnInit { - // Add your own domains via EmailOptions customOptions: EmailOptions = { - domains: ['msn.com', 'bellsouth.net', - 'telus.net', 'comcast.net', 'optusnet.com.au', - 'earthlink.net', 'qq.com', 'sky.com', 'icloud.com', - 'mac.com', 'sympatico.ca', 'googlemail.com', - 'att.net', 'xtra.co.nz', 'web.de', - 'cox.net', 'gmail.com', 'ymail.com', 'yahoo.com', - 'aim.com', 'rogers.com', 'verizon.net', - 'rocketmail.com', 'google.com', 'optonline.net', - 'sbcglobal.net', 'aol.com', 'me.com', 'btinternet.com', - 'charter.net', 'shaw.ca'], - secondLevelDomains: ['yahoo', 'hotmail', 'mail', 'live', 'outlook', 'gmx'], - topLevelDomains: ['com', 'com.au', 'com.tw', 'ca', 'co.nz', 'co.uk', 'de', - 'fr', 'it', 'ru', 'net', 'org', 'edu', 'gov', 'jp', 'nl', 'kr', 'se', 'eu', - 'ie', 'co.il', 'us', 'at', 'be', 'dk', 'hk', 'es', 'gr', 'ch', 'no', 'cz', - 'in', 'net', 'net.au', 'info', 'biz', 'mil', 'co.jp', 'sg', 'hu', 'uk'] + domains: [ + "msn.com", + "bellsouth.net", + "telus.net", + "comcast.net", + "optusnet.com.au", + "earthlink.net", + "qq.com", + "sky.com", + "icloud.com", + "mac.com", + "sympatico.ca", + "googlemail.com", + "att.net", + "xtra.co.nz", + "web.de", + "cox.net", + "gmail.com", + "ymail.com", + "yahoo.com", + "aim.com", + "rogers.com", + "verizon.net", + "rocketmail.com", + "google.com", + "optonline.net", + "sbcglobal.net", + "aol.com", + "me.com", + "btinternet.com", + "charter.net", + "shaw.ca", + ], + secondLevelDomains: ["yahoo", "hotmail", "mail", "live", "outlook", "gmx"], + topLevelDomains: [ + "com", + "com.au", + "com.tw", + "ca", + "co.nz", + "co.uk", + "de", + "fr", + "it", + "ru", + "net", + "org", + "edu", + "gov", + "jp", + "nl", + "kr", + "se", + "eu", + "ie", + "co.il", + "us", + "at", + "be", + "dk", + "hk", + "es", + "gr", + "ch", + "no", + "cz", + "in", + "net", + "net.au", + "info", + "biz", + "mil", + "co.jp", + "sg", + "hu", + "uk", + ], }; form: FormGroup; - email = new FormControl('', Validators.compose([EmailValidators.suggest(this.customOptions)])); - constructor(protected _fb: FormBuilder) { } + email = new FormControl("", Validators.compose([EmailValidators.suggest(this.customOptions)])); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'email': this.email, + email: this.email, }); } addToForm(email) { - this.form.get('email').setValue(email); + this.form.get("email").setValue(email); } } diff --git a/examples/src/app/equal-to-validator/equal-to-validator.component.html b/examples/src/app/equal-to-validator/equal-to-validator.component.html index 5d356fa..a5bb03d 100644 --- a/examples/src/app/equal-to-validator/equal-to-validator.component.html +++ b/examples/src/app/equal-to-validator/equal-to-validator.component.html @@ -13,13 +13,21 @@ EqualTo validator - + - + - - + + diff --git a/examples/src/app/equal-to-validator/equal-to-validator.component.ts b/examples/src/app/equal-to-validator/equal-to-validator.component.ts index 34c7ffd..20b95ca 100644 --- a/examples/src/app/equal-to-validator/equal-to-validator.component.ts +++ b/examples/src/app/equal-to-validator/equal-to-validator.component.ts @@ -1,27 +1,26 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { equalTo, Validator } from '../items'; -import { ActivatedRoute } from '@angular/router'; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { equalTo, Validator } from "../items"; +import { ActivatedRoute } from "@angular/router"; @Component({ - selector: 'app-equals-to-field-validator', - templateUrl: './equal-to-validator.component.html' + selector: "app-equals-to-field-validator", + templateUrl: "./equal-to-validator.component.html", }) export class EqualToValidatorComponent implements OnInit, OnDestroy { - private sub: any; validatorItems = equalTo; item: string = this.validatorItems[0].name; currentValidator: Validator; - selected = 'reactiveForm'; + selected = "reactiveForm"; - constructor(private route: ActivatedRoute) { } + constructor(private route: ActivatedRoute) {} ngOnInit() { - this.currentValidator = this.validatorItems.filter(x => x.name === this.item)[0]; - this.sub = this.route.params.subscribe(params => { - this.item = params['id']; + this.currentValidator = this.validatorItems.filter((x) => x.name === this.item)[0]; + this.sub = this.route.params.subscribe((params) => { + this.item = params["id"]; if (this.item) { - this.currentValidator = this.validatorItems.filter(x => x.name === this.item)[0]; + this.currentValidator = this.validatorItems.filter((x) => x.name === this.item)[0]; } }); } diff --git a/examples/src/app/equal-to-validator/equal-to-validator.module.ts b/examples/src/app/equal-to-validator/equal-to-validator.module.ts index f34e55d..a127e93 100644 --- a/examples/src/app/equal-to-validator/equal-to-validator.module.ts +++ b/examples/src/app/equal-to-validator/equal-to-validator.module.ts @@ -1,27 +1,26 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { EqualToValidatorComponent } from './equal-to-validator.component'; -import { FormEqualToComponent } from './form/equal-to/form-equal-to.component'; -import { RouterModule, Routes } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { EqualToValidatorComponent } from "./equal-to-validator.component"; +import { FormEqualToComponent } from "./form/equal-to/form-equal-to.component"; +import { RouterModule, Routes } from "@angular/router"; import { MatButtonModule, MatCardModule, MatFormFieldModule, MatInputModule, MatOptionModule, - MatSelectModule -} from '@angular/material'; -import { UtilModule } from '../util/util.module'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ValidatorsModule } from 'ngx-validators'; -import { ReactiveFormEqualToComponent } from './reactive-form/equal-to/reactive-form-equal-to.component'; + MatSelectModule, +} from "@angular/material"; +import { UtilModule } from "../util/util.module"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { ValidatorsModule } from "ngx-validators"; +import { ReactiveFormEqualToComponent } from "./reactive-form/equal-to/reactive-form-equal-to.component"; const routes: Routes = [ - {path: 'equal-to', component: EqualToValidatorComponent}, - {path: 'equal-to/:id', component: EqualToValidatorComponent} + { path: "equal-to", component: EqualToValidatorComponent }, + { path: "equal-to/:id", component: EqualToValidatorComponent }, ]; - @NgModule({ imports: [ CommonModule, @@ -35,12 +34,8 @@ const routes: Routes = [ MatSelectModule, MatOptionModule, MatCardModule, - MatButtonModule + MatButtonModule, ], - declarations: [ - EqualToValidatorComponent, - FormEqualToComponent, - ReactiveFormEqualToComponent - ] + declarations: [EqualToValidatorComponent, FormEqualToComponent, ReactiveFormEqualToComponent], }) -export class EqualToValidatorModule { } +export class EqualToValidatorModule {} diff --git a/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.html b/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.html index 9303570..7bbf7c0 100644 --- a/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.html +++ b/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.html @@ -3,13 +3,21 @@

Passing Field Name:

Email: - + This field is required Confirm Email: - + + This field is required This field should be equal to Email field @@ -18,13 +26,21 @@

Passing Field Reference

Password: - + This field is required Confirm Password: - + + This field is required This field should be equal to Password field diff --git a/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.ts b/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.ts index e63be8b..0f07037 100644 --- a/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.ts +++ b/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.ts @@ -1,21 +1,18 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-equal-to', - templateUrl: './form-equal-to.component.html' + selector: "app-equal-to", + templateUrl: "./form-equal-to.component.html", }) export class FormEqualToComponent implements OnInit { - model = { - email: '', - emailConfirm: '', - password: '', - passwordConfirm: '' + email: "", + emailConfirm: "", + password: "", + passwordConfirm: "", }; - constructor() { } - - ngOnInit() { - } + constructor() {} + ngOnInit() {} } diff --git a/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.html b/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.html index 68665af..d3ac573 100644 --- a/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.html +++ b/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.html @@ -3,28 +3,32 @@

Passing Field Name:

Email: - + This field is required Confirm Email: - + This field is required - This field should be equal to Email field + This field should be equal to Email field

Passing Field Reference

Password: - + This field is required Confirm Password: - + This field is required - This field should be equal to Password field + This field should be equal to Password field
diff --git a/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.ts b/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.ts index c0ed5bd..0d61754 100644 --- a/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.ts +++ b/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.ts @@ -1,25 +1,29 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { EmailValidators, EqualToValidator } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { EmailValidators, EqualToValidator } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-equal-to', - templateUrl: './reactive-form-equal-to.component.html' + selector: "app-reactive-equal-to", + templateUrl: "./reactive-form-equal-to.component.html", }) export class ReactiveFormEqualToComponent implements OnInit { - form: FormGroup; - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { - this.form = this._fb.group({ - email: [''], - emailConfirm: [''], - password: [''], - passwordConfirm: [''] - }, {validator: [ - EqualToValidator.equalTo('email', 'emailConfirm'), - EqualToValidator.equalTo('password', 'passwordConfirm') - ]}); + this.form = this._fb.group( + { + email: [""], + emailConfirm: [""], + password: [""], + passwordConfirm: [""], + }, + { + validator: [ + EqualToValidator.equalTo("email", "emailConfirm"), + EqualToValidator.equalTo("password", "passwordConfirm"), + ], + } + ); } } diff --git a/examples/src/app/guide/guide.component.html b/examples/src/app/guide/guide.component.html index 91ac405..f5f2468 100644 --- a/examples/src/app/guide/guide.component.html +++ b/examples/src/app/guide/guide.component.html @@ -1,32 +1,38 @@ - - Guide - - -

ngx-validators -
- Build Status -
-
- Dependency Status -
-

-

An implementation of various angular validators for Angular 2+.

-

Install

-
npm install ngx-validators --save
-
+ + Guide + + +

+ ngx-validators +
+ Build Status +
+
+ Dependency Status +
+

+

An implementation of various angular validators for Angular 2+.

+

Install

+
npm install ngx-validators --save
+
- - List of validators - - - -
{{item.name}}
- - - {{validator.name}} - -
-
-
\ No newline at end of file + + List of validators + + + +
{{ item.name }}
+ + + {{ validator.name }} + +
+
+ diff --git a/examples/src/app/guide/guide.component.spec.ts b/examples/src/app/guide/guide.component.spec.ts index edff369..28024d9 100644 --- a/examples/src/app/guide/guide.component.spec.ts +++ b/examples/src/app/guide/guide.component.spec.ts @@ -1,16 +1,15 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; -import { GuideComponent } from './guide.component'; +import { GuideComponent } from "./guide.component"; -describe('GuideComponent', () => { +describe("GuideComponent", () => { let component: GuideComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GuideComponent ] - }) - .compileComponents(); + declarations: [GuideComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('GuideComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/examples/src/app/guide/guide.component.ts b/examples/src/app/guide/guide.component.ts index 5b46562..1e25a73 100644 --- a/examples/src/app/guide/guide.component.ts +++ b/examples/src/app/guide/guide.component.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; -import { Items, items } from '../items'; +import { Component } from "@angular/core"; +import { Items, items } from "../items"; @Component({ - selector: 'app-guide', - templateUrl: './guide.component.html', - styleUrls: ['./guide.component.css'] + selector: "app-guide", + templateUrl: "./guide.component.html", + styleUrls: ["./guide.component.css"], }) export class GuideComponent { menuItems: Items[] = items; diff --git a/examples/src/app/guide/guide.module.ts b/examples/src/app/guide/guide.module.ts index 5333c9e..10a4779 100644 --- a/examples/src/app/guide/guide.module.ts +++ b/examples/src/app/guide/guide.module.ts @@ -1,30 +1,22 @@ -import { MatCardModule, MatListModule } from '@angular/material'; -import { GuideComponent } from './guide.component'; -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule, Routes } from '@angular/router'; +import { MatCardModule, MatListModule } from "@angular/material"; +import { GuideComponent } from "./guide.component"; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule, Routes } from "@angular/router"; const routes: Routes = [ { - path: '', + path: "", component: GuideComponent, }, { - path: 'guide', + path: "guide", component: GuideComponent, - } + }, ]; - @NgModule({ - imports: [ - CommonModule, - MatCardModule, - MatListModule, - RouterModule.forChild(routes) - ], - declarations: [ - GuideComponent - ] + imports: [CommonModule, MatCardModule, MatListModule, RouterModule.forChild(routes)], + declarations: [GuideComponent], }) -export class GuideModule { } +export class GuideModule {} diff --git a/examples/src/app/items.ts b/examples/src/app/items.ts index 62098e2..34b4207 100644 --- a/examples/src/app/items.ts +++ b/examples/src/app/items.ts @@ -17,199 +17,197 @@ export interface Validator { export const password: Validator[] = [ { - name: 'alphabeticalCharacterRule', - reactiveformTS: require('!raw-loader!./password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component'), - reactiveformHTML: require('!raw-loader!./password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.html'), - formTS: require('!raw-loader!./password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component'), - formHTML: require('!raw-loader!./password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.html') + name: "alphabeticalCharacterRule", + reactiveformTS: require("!raw-loader!./password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component"), + reactiveformHTML: require("!raw-loader!./password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.html"), + formTS: require("!raw-loader!./password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component"), + formHTML: require("!raw-loader!./password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.html"), }, { - name: 'digitCharacterRule', - reactiveformTS: require('!raw-loader!./password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component'), - reactiveformHTML: require('!raw-loader!./password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.html'), - formTS: require('!raw-loader!./password-validator/form/digit-character-rule/form-digit-character-rule.component'), - formHTML: require('!raw-loader!./password-validator/form/digit-character-rule/form-digit-character-rule.component.html') + name: "digitCharacterRule", + reactiveformTS: require("!raw-loader!./password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component"), + reactiveformHTML: require("!raw-loader!./password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.html"), + formTS: require("!raw-loader!./password-validator/form/digit-character-rule/form-digit-character-rule.component"), + formHTML: require("!raw-loader!./password-validator/form/digit-character-rule/form-digit-character-rule.component.html"), }, { - name: 'lowercaseCharacterRule', - reactiveformTS: require('!raw-loader!./password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component'), - reactiveformHTML: require('!raw-loader!./password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.html'), - formTS: require('!raw-loader!./password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component'), - formHTML: require('!raw-loader!./password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.html') + name: "lowercaseCharacterRule", + reactiveformTS: require("!raw-loader!./password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component"), + reactiveformHTML: require("!raw-loader!./password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.html"), + formTS: require("!raw-loader!./password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component"), + formHTML: require("!raw-loader!./password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.html"), }, { - name: 'repeatCharacterRegexRule', - reactiveformTS: require('!raw-loader!./password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component'), - reactiveformHTML: require('!raw-loader!./password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.html'), - formTS: require('!raw-loader!./password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component'), - formHTML: require('!raw-loader!./password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.html') + name: "repeatCharacterRegexRule", + reactiveformTS: require("!raw-loader!./password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component"), + reactiveformHTML: require("!raw-loader!./password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.html"), + formTS: require("!raw-loader!./password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component"), + formHTML: require("!raw-loader!./password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.html"), }, { - name: 'uppercaseCharacterRule', - reactiveformTS: require('!raw-loader!./password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component'), - reactiveformHTML: require('!raw-loader!./password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.html'), - formTS: require('!raw-loader!./password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component'), - formHTML: require('!raw-loader!./password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.html') + name: "uppercaseCharacterRule", + reactiveformTS: require("!raw-loader!./password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component"), + reactiveformHTML: require("!raw-loader!./password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.html"), + formTS: require("!raw-loader!./password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component"), + formHTML: require("!raw-loader!./password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.html"), }, { - name: 'specialCharacterRule', - reactiveformTS: require('!raw-loader!./password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component'), - reactiveformHTML: require('!raw-loader!./password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.html') + name: "specialCharacterRule", + reactiveformTS: require("!raw-loader!./password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component"), + reactiveformHTML: require("!raw-loader!./password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.html"), }, { - name: 'mismatch', - reactiveformTS: require('!raw-loader!./password-validator/reactive-form/mismatch/reactive-form-mismatch.component'), - reactiveformHTML: require('!raw-loader!./password-validator/reactive-form/mismatch/reactive-form-mismatch.component.html') - } + name: "mismatch", + reactiveformTS: require("!raw-loader!./password-validator/reactive-form/mismatch/reactive-form-mismatch.component"), + reactiveformHTML: require("!raw-loader!./password-validator/reactive-form/mismatch/reactive-form-mismatch.component.html"), + }, ]; export const email: Validator[] = [ { - name: 'normal', - reactiveformTS: require('!raw-loader!./email-validator/reactive-form/email/reactive-form-email.component'), - reactiveformHTML: require('!raw-loader!./email-validator/reactive-form/email/reactive-form-email.component.html'), - formTS: require('!raw-loader!./email-validator/form/email/form-email.component'), - formHTML: require('!raw-loader!./email-validator/form/email/form-email.component.html'), + name: "normal", + reactiveformTS: require("!raw-loader!./email-validator/reactive-form/email/reactive-form-email.component"), + reactiveformHTML: require("!raw-loader!./email-validator/reactive-form/email/reactive-form-email.component.html"), + formTS: require("!raw-loader!./email-validator/form/email/form-email.component"), + formHTML: require("!raw-loader!./email-validator/form/email/form-email.component.html"), hint: '(follows the HTML5 rules)', }, { - name: 'suggest', - reactiveformTS: require('!raw-loader!./email-validator/reactive-form/suggest/reactive-form-email-suggest.component'), - reactiveformHTML: require('!raw-loader!./email-validator/reactive-form/suggest/reactive-form-email-suggest.component.html'), - formTS: require('!raw-loader!./email-validator/form/suggest/form-email-suggest.component'), - formHTML: require('!raw-loader!./email-validator/form/suggest/form-email-suggest.component.html'), + name: "suggest", + reactiveformTS: require("!raw-loader!./email-validator/reactive-form/suggest/reactive-form-email-suggest.component"), + reactiveformHTML: require("!raw-loader!./email-validator/reactive-form/suggest/reactive-form-email-suggest.component.html"), + formTS: require("!raw-loader!./email-validator/form/suggest/form-email-suggest.component"), + formHTML: require("!raw-loader!./email-validator/form/suggest/form-email-suggest.component.html"), hint: '(thanks to mailcheck)', - } + }, ]; export const equalTo: Validator[] = [ { - name: 'normal', - reactiveformTS: require('!raw-loader!./equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component'), - reactiveformHTML: require('!raw-loader!./equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.html'), - formTS: require('!raw-loader!./equal-to-validator/form/equal-to/form-equal-to.component'), - formHTML: require('!raw-loader!./equal-to-validator/form/equal-to/form-equal-to.component.html') - } + name: "normal", + reactiveformTS: require("!raw-loader!./equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component"), + reactiveformHTML: require("!raw-loader!./equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.html"), + formTS: require("!raw-loader!./equal-to-validator/form/equal-to/form-equal-to.component"), + formHTML: require("!raw-loader!./equal-to-validator/form/equal-to/form-equal-to.component.html"), + }, ]; export const universal: Validator[] = [ { - - name: 'noWhitespace', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.html'), - formTS: require('!raw-loader!./universal-validator/form/no-whitespace/form-no-whitespace.component'), - formHTML: require('!raw-loader!./universal-validator/form/no-whitespace/form-no-whitespace.component.html') + name: "noWhitespace", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.html"), + formTS: require("!raw-loader!./universal-validator/form/no-whitespace/form-no-whitespace.component"), + formHTML: require("!raw-loader!./universal-validator/form/no-whitespace/form-no-whitespace.component.html"), }, { - name: 'noEmptyString', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.html') + name: "noEmptyString", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.html"), }, { - name: 'isNumber', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/is-number/reactive-form-is-number.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/is-number/reactive-form-is-number.component.html'), - formTS: require('!raw-loader!./universal-validator/form/is-number/form-is-number.component'), - formHTML: require('!raw-loader!./universal-validator/form/is-number/form-is-number.component.html') + name: "isNumber", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/is-number/reactive-form-is-number.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/is-number/reactive-form-is-number.component.html"), + formTS: require("!raw-loader!./universal-validator/form/is-number/form-is-number.component"), + formHTML: require("!raw-loader!./universal-validator/form/is-number/form-is-number.component.html"), }, { - name: 'isInRange', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.html'), - formTS: require('!raw-loader!./universal-validator/form/is-in-range/form-is-in-range.component'), - formHTML: require('!raw-loader!./universal-validator/form/is-in-range/form-is-in-range.component.html') + name: "isInRange", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.html"), + formTS: require("!raw-loader!./universal-validator/form/is-in-range/form-is-in-range.component"), + formHTML: require("!raw-loader!./universal-validator/form/is-in-range/form-is-in-range.component.html"), }, { - name: 'minLength', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/min-length/reactive-form-min-length.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/min-length/reactive-form-min-length.component.html') + name: "minLength", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/min-length/reactive-form-min-length.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/min-length/reactive-form-min-length.component.html"), }, { - name: 'maxLength', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/max-length/reactive-form-max-length.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/max-length/reactive-form-max-length.component.html') + name: "maxLength", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/max-length/reactive-form-max-length.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/max-length/reactive-form-max-length.component.html"), }, { - name: 'min', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/min/reactive-form-min.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/min/reactive-form-min.component.html'), - formTS: require('!raw-loader!./universal-validator/form/min/form-min.component'), - formHTML: require('!raw-loader!./universal-validator/form/min/form-min.component.html') + name: "min", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/min/reactive-form-min.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/min/reactive-form-min.component.html"), + formTS: require("!raw-loader!./universal-validator/form/min/form-min.component"), + formHTML: require("!raw-loader!./universal-validator/form/min/form-min.component.html"), }, { - name: 'max', - reactiveformTS: require('!raw-loader!./universal-validator/reactive-form/max/reactive-form-max.component'), - reactiveformHTML: require('!raw-loader!./universal-validator/reactive-form/max/reactive-form-max.component.html'), - formTS: require('!raw-loader!./universal-validator/form/max/form-max.component'), - formHTML: require('!raw-loader!./universal-validator/form/max/form-max.component.html') - } + name: "max", + reactiveformTS: require("!raw-loader!./universal-validator/reactive-form/max/reactive-form-max.component"), + reactiveformHTML: require("!raw-loader!./universal-validator/reactive-form/max/reactive-form-max.component.html"), + formTS: require("!raw-loader!./universal-validator/form/max/form-max.component"), + formHTML: require("!raw-loader!./universal-validator/form/max/form-max.component.html"), + }, ]; export const creditcards: Validator[] = [ { - name: 'all', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/creditcard/form-creditcard.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/creditcard/form-creditcard.component.html') + name: "all", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/creditcard/form-creditcard.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/creditcard/form-creditcard.component.html"), }, { - name: 'americanexpress', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/american-express/reactive-form-american-express.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/american-express/form-american-express.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/american-express/form-american-express.component.html') + name: "americanexpress", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/american-express/reactive-form-american-express.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/american-express/form-american-express.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/american-express/form-american-express.component.html"), }, { - name: 'visa', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/visa/reactive-form-visa.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/visa/reactive-form-visa.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/visa/form-visa.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/visa/form-visa.component.html') + name: "visa", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/visa/reactive-form-visa.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/visa/reactive-form-visa.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/visa/form-visa.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/visa/form-visa.component.html"), }, { - name: 'dinersclub', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/dinersclub/form-dinersclub.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/dinersclub/form-dinersclub.component.html') + name: "dinersclub", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/dinersclub/form-dinersclub.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/dinersclub/form-dinersclub.component.html"), }, { - name: 'discover', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/discover/reactive-form-discover.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/discover/reactive-form-discover.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/discover/form-discover.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/discover/form-discover.component.html') + name: "discover", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/discover/reactive-form-discover.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/discover/reactive-form-discover.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/discover/form-discover.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/discover/form-discover.component.html"), }, { - name: 'jcb', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/jcb/reactive-form-jcb.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/jcb/form-jcb.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/jcb/form-jcb.component.html') + name: "jcb", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/jcb/reactive-form-jcb.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/jcb/form-jcb.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/jcb/form-jcb.component.html"), }, { - name: 'maestro', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/maestro/reactive-form-maestro.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/maestro/form-maestro.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/maestro/form-maestro.component.html') + name: "maestro", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/maestro/reactive-form-maestro.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/maestro/form-maestro.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/maestro/form-maestro.component.html"), }, { - name: 'mastercard', - reactiveformTS: require('!raw-loader!./creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component'), - reactiveformHTML: require('!raw-loader!./creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.html'), - formTS: require('!raw-loader!./creditcard-validator/form/mastercard/form-mastercard.component'), - formHTML: require('!raw-loader!./creditcard-validator/form/mastercard/form-mastercard.component.html') - } + name: "mastercard", + reactiveformTS: require("!raw-loader!./creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component"), + reactiveformHTML: require("!raw-loader!./creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.html"), + formTS: require("!raw-loader!./creditcard-validator/form/mastercard/form-mastercard.component"), + formHTML: require("!raw-loader!./creditcard-validator/form/mastercard/form-mastercard.component.html"), + }, ]; export const items: Items[] = [ - { linkPrefix: '/email/', validators: email, name: 'Email' }, - { linkPrefix: '/password/', validators: password, name: 'Password' }, - { linkPrefix: '/equal-to/', validators: equalTo, name: 'Equal To' }, - { linkPrefix: '/creditcard/', validators: creditcards, name: 'Creditcards' }, - { linkPrefix: '/universal/', validators: universal, name: 'Universal' } + { linkPrefix: "/email/", validators: email, name: "Email" }, + { linkPrefix: "/password/", validators: password, name: "Password" }, + { linkPrefix: "/equal-to/", validators: equalTo, name: "Equal To" }, + { linkPrefix: "/creditcard/", validators: creditcards, name: "Creditcards" }, + { linkPrefix: "/universal/", validators: universal, name: "Universal" }, ]; - diff --git a/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.html b/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.html index ccb651e..424eb2f 100644 --- a/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.html +++ b/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.html @@ -1,4 +1,15 @@ - - Password should contain at least one alphabetical character - \ No newline at end of file + + Password should contain at least one alphabetical character + diff --git a/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.ts b/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.ts index dea6bcc..3656cde 100644 --- a/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.ts +++ b/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-alphabetical-character-rule', - templateUrl: './form-alphabetical-character-rule.component.html' + selector: "app-alphabetical-character-rule", + templateUrl: "./form-alphabetical-character-rule.component.html", }) - export class FormAlphabeticalCharacterRuleComponent { password: string; } diff --git a/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.html b/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.html index 34e8737..843430c 100644 --- a/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.html +++ b/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.html @@ -1,4 +1,15 @@ - - Password should contain at least one digit - \ No newline at end of file + + Password should contain at least one digit + diff --git a/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.ts b/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.ts index 6b955e1..9f97855 100644 --- a/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.ts +++ b/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-digit-character-rule', - templateUrl: './form-digit-character-rule.component.html' + selector: "app-digit-character-rule", + templateUrl: "./form-digit-character-rule.component.html", }) - export class FormDigitCharacterRuleComponent { password: string; } diff --git a/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.html b/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.html index 074899e..b798bce 100644 --- a/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.html +++ b/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.html @@ -1,4 +1,15 @@ - - Password should contain at least one lowercase character - \ No newline at end of file + + Password should contain at least one lowercase character + diff --git a/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.ts b/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.ts index 0fa225a..63a7e9c 100644 --- a/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.ts +++ b/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-lowercase-character-rule', - templateUrl: './form-lowercase-character-rule.component.html' + selector: "app-lowercase-character-rule", + templateUrl: "./form-lowercase-character-rule.component.html", }) - export class FormLowercaseCharacterRuleComponent { password: string; } diff --git a/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.html b/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.html index 2489eaa..b0eaef0 100644 --- a/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.html +++ b/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.html @@ -1,6 +1,17 @@
- - - Password contains repeating characters - -
\ No newline at end of file + + + Password contains repeating characters + + diff --git a/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.ts b/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.ts index 1767afa..2c9e097 100644 --- a/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.ts +++ b/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-repeat-character-regex-rule', - templateUrl: './form-repeat-character-regex-rule.component.html' + selector: "app-repeat-character-regex-rule", + templateUrl: "./form-repeat-character-regex-rule.component.html", }) - export class FormRepeatCharacterRegexRuleComponent { password: string; } diff --git a/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.html b/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.html index 64bb7cb..8d25f0e 100644 --- a/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.html +++ b/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.html @@ -1,4 +1,15 @@ - - Password should contain at least one uppercase character - \ No newline at end of file + + Password should contain at least one uppercase character + diff --git a/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.ts b/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.ts index 485b8a3..093a5dc 100644 --- a/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.ts +++ b/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-uppercase-character-rule', - templateUrl: './form-uppercase-character-rule.component.html' + selector: "app-uppercase-character-rule", + templateUrl: "./form-uppercase-character-rule.component.html", }) - export class FormUppercaseCharacterRuleComponent { password: string; } diff --git a/examples/src/app/password-validator/password-validator.component.html b/examples/src/app/password-validator/password-validator.component.html index a96527c..a592610 100644 --- a/examples/src/app/password-validator/password-validator.component.html +++ b/examples/src/app/password-validator/password-validator.component.html @@ -1,35 +1,51 @@ - - - Form - - - Reactive Form - - + + + Form + + + Reactive Form + + - - Password validator - {{item}} - - - - - - - - - - - - - - - - - - - + + Password validator - {{ item }} + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + diff --git a/examples/src/app/password-validator/password-validator.component.ts b/examples/src/app/password-validator/password-validator.component.ts index eac13a7..3cf71ff 100644 --- a/examples/src/app/password-validator/password-validator.component.ts +++ b/examples/src/app/password-validator/password-validator.component.ts @@ -1,44 +1,38 @@ -import { Validator } from './../items'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { PasswordValidators } from 'ngx-validators'; -import { ActivatedRoute } from '@angular/router'; - - -import { isNumber } from 'util'; -import { Component } from '@angular/core'; -import { OnInit } from '@angular/core'; -import { OnDestroy } from '@angular/core'; -import { password } from '../items'; - +import { Validator } from "./../items"; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { PasswordValidators } from "ngx-validators"; +import { ActivatedRoute } from "@angular/router"; +import { isNumber } from "util"; +import { Component } from "@angular/core"; +import { OnInit } from "@angular/core"; +import { OnDestroy } from "@angular/core"; +import { password } from "../items"; @Component({ - selector: 'password-validator', - templateUrl: './password-validator.component.html' + selector: "password-validator", + templateUrl: "./password-validator.component.html", }) export class PasswordValidatorComponent implements OnInit, OnDestroy { - - - private sub: any; - passwordItems = password; - item: string = this.passwordItems[0].name; - currentValidator: Validator; - selected = 'reactiveForm'; - - constructor(private route: ActivatedRoute) { } - - - ngOnInit() { - this.currentValidator = this.passwordItems.filter(x => x.name === this.item)[0]; - this.sub = this.route.params.subscribe(params => { - this.item = params['id']; - if (this.item) { - this.currentValidator = this.passwordItems.filter(x => x.name === this.item)[0]; - } - }); - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } + private sub: any; + passwordItems = password; + item: string = this.passwordItems[0].name; + currentValidator: Validator; + selected = "reactiveForm"; + + constructor(private route: ActivatedRoute) {} + + ngOnInit() { + this.currentValidator = this.passwordItems.filter((x) => x.name === this.item)[0]; + this.sub = this.route.params.subscribe((params) => { + this.item = params["id"]; + if (this.item) { + this.currentValidator = this.passwordItems.filter((x) => x.name === this.item)[0]; + } + }); + } + + ngOnDestroy() { + this.sub.unsubscribe(); + } } diff --git a/examples/src/app/password-validator/password-validator.module.ts b/examples/src/app/password-validator/password-validator.module.ts index 5a9a290..864939b 100644 --- a/examples/src/app/password-validator/password-validator.module.ts +++ b/examples/src/app/password-validator/password-validator.module.ts @@ -1,35 +1,42 @@ -import { ReactiveFormDigitCharacterRuleComponent } from './reactive-form/digit-character-rule/reactive-form-digit-character-rule.component'; -import { ReactiveFormLowercaseCharacterRuleComponent } from './reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component'; -import { ReactiveFormAlphabeticalCharacterRuleComponent } from './reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component'; -import { ReactiveFormRepeatCharacterRegexRuleComponent } from './reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component'; -import { MatCardModule, MatListModule, MatFormFieldModule, MatTooltipModule, MatInputModule, MatSelectModule } from '@angular/material'; -import { NgModule, Component } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MatButtonModule, MatTabsModule } from '@angular/material'; -import { Routes, RouterModule } from '@angular/router'; -import { UtilModule } from '../util/util.module'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormDigitCharacterRuleComponent } from "./reactive-form/digit-character-rule/reactive-form-digit-character-rule.component"; +import { ReactiveFormLowercaseCharacterRuleComponent } from "./reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component"; +import { ReactiveFormAlphabeticalCharacterRuleComponent } from "./reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component"; +import { ReactiveFormRepeatCharacterRegexRuleComponent } from "./reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component"; +import { + MatCardModule, + MatListModule, + MatFormFieldModule, + MatTooltipModule, + MatInputModule, + MatSelectModule, +} from "@angular/material"; +import { NgModule, Component } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { MatButtonModule, MatTabsModule } from "@angular/material"; +import { Routes, RouterModule } from "@angular/router"; +import { UtilModule } from "../util/util.module"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { ValidatorsModule } from 'ngx-validators'; -import { PasswordValidatorComponent } from './password-validator.component'; -import { FormAlphabeticalCharacterRuleComponent } from './form/alphabetical-character-rule/form-alphabetical-character-rule.component'; -import { FormRepeatCharacterRegexRuleComponent } from './form/repeat-character-regex-rule/form-repeat-character-regex-rule.component'; -import { FormUppercaseCharacterRuleComponent } from './form/uppercase-character-rule/form-uppercase-character-rule.component'; -import { FormDigitCharacterRuleComponent } from 'app/password-validator/form/digit-character-rule/form-digit-character-rule.component'; -import { FormLowercaseCharacterRuleComponent } from 'app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component'; -import { ReactiveFormUppercaseCharacterRuleComponent } from './reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component'; -import { ReactiveFormSpecialCharacterRuleComponent } from './reactive-form/special-character-rule/reactive-form-special-character-rule.component'; -import { ReactiveFormMismatchComponent } from './reactive-form/mismatch/reactive-form-mismatch.component'; +import { ValidatorsModule } from "ngx-validators"; +import { PasswordValidatorComponent } from "./password-validator.component"; +import { FormAlphabeticalCharacterRuleComponent } from "./form/alphabetical-character-rule/form-alphabetical-character-rule.component"; +import { FormRepeatCharacterRegexRuleComponent } from "./form/repeat-character-regex-rule/form-repeat-character-regex-rule.component"; +import { FormUppercaseCharacterRuleComponent } from "./form/uppercase-character-rule/form-uppercase-character-rule.component"; +import { FormDigitCharacterRuleComponent } from "app/password-validator/form/digit-character-rule/form-digit-character-rule.component"; +import { FormLowercaseCharacterRuleComponent } from "app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component"; +import { ReactiveFormUppercaseCharacterRuleComponent } from "./reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component"; +import { ReactiveFormSpecialCharacterRuleComponent } from "./reactive-form/special-character-rule/reactive-form-special-character-rule.component"; +import { ReactiveFormMismatchComponent } from "./reactive-form/mismatch/reactive-form-mismatch.component"; const routes: Routes = [ { - path: 'password', + path: "password", component: PasswordValidatorComponent, }, { - path: 'password/:id', + path: "password/:id", component: PasswordValidatorComponent, - } + }, ]; @NgModule({ @@ -47,11 +54,9 @@ const routes: Routes = [ MatTabsModule, MatInputModule, UtilModule, - ValidatorsModule - ], - exports: [ - RouterModule + ValidatorsModule, ], + exports: [RouterModule], declarations: [ ReactiveFormRepeatCharacterRegexRuleComponent, ReactiveFormAlphabeticalCharacterRuleComponent, @@ -66,7 +71,7 @@ const routes: Routes = [ FormDigitCharacterRuleComponent, FormLowercaseCharacterRuleComponent, FormUppercaseCharacterRuleComponent, - PasswordValidatorComponent - ] + PasswordValidatorComponent, + ], }) -export class PasswordModule { } +export class PasswordModule {} diff --git a/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.html b/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.html index 362f40c..e28a7ad 100644 --- a/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.html +++ b/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.html @@ -1,6 +1,8 @@
- - - Password should contain at least one alphabetical character - -
\ No newline at end of file + + + Password should contain at least one alphabetical character + + diff --git a/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.ts b/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.ts index bb786a5..384f093 100644 --- a/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.ts +++ b/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.ts @@ -1,24 +1,23 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { PasswordValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { PasswordValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-alphabetical-character-rule', - templateUrl: './reactive-form-alphabetical-character-rule.component.html' + selector: "app-reactive-alphabetical-character-rule", + templateUrl: "./reactive-form-alphabetical-character-rule.component.html", }) export class ReactiveFormAlphabeticalCharacterRuleComponent implements OnInit { - form: FormGroup; - alphabeticalCharacterRule: FormControl = new FormControl('', Validators.compose([ - Validators.required, - PasswordValidators.alphabeticalCharacterRule(1) - ])); - constructor(protected _fb: FormBuilder) { } + alphabeticalCharacterRule: FormControl = new FormControl( + "", + Validators.compose([Validators.required, PasswordValidators.alphabeticalCharacterRule(1)]) + ); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'newPassword': this.alphabeticalCharacterRule + newPassword: this.alphabeticalCharacterRule, }); } } diff --git a/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.html b/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.html index 46db9cb..7805793 100644 --- a/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.html +++ b/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.html @@ -1,6 +1,8 @@
- - - Password should contain at least on digit character - -
\ No newline at end of file + + + Password should contain at least on digit character + + diff --git a/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.ts b/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.ts index 5eabc99..3848c8f 100644 --- a/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.ts +++ b/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.ts @@ -1,25 +1,24 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { PasswordValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { PasswordValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-digit-character-rule', - templateUrl: './reactive-form-digit-character-rule.component.html' + selector: "app-reactive-digit-character-rule", + templateUrl: "./reactive-form-digit-character-rule.component.html", }) export class ReactiveFormDigitCharacterRuleComponent implements OnInit { - form: FormGroup; - digitCharacterRule: FormControl = new FormControl('', Validators.compose([ - Validators.required, - PasswordValidators.digitCharacterRule(1) - ])); + digitCharacterRule: FormControl = new FormControl( + "", + Validators.compose([Validators.required, PasswordValidators.digitCharacterRule(1)]) + ); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'newPassword': this.digitCharacterRule + newPassword: this.digitCharacterRule, }); } } diff --git a/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.html b/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.html index 9de70fe..eed1c4c 100644 --- a/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.html +++ b/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.html @@ -1,6 +1,8 @@
- - - Password should contain at least one lowercase character - -
\ No newline at end of file + + + Password should contain at least one lowercase character + + diff --git a/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.ts b/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.ts index bde6b4c..02db258 100644 --- a/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.ts +++ b/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.ts @@ -1,25 +1,24 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators, PasswordValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators, PasswordValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-lowercase-character-rule', - templateUrl: './reactive-form-lowercase-character-rule.component.html' + selector: "app-reactive-lowercase-character-rule", + templateUrl: "./reactive-form-lowercase-character-rule.component.html", }) export class ReactiveFormLowercaseCharacterRuleComponent implements OnInit { - form: FormGroup; - lowercaseCharacterRule: FormControl = new FormControl('', Validators.compose([ - Validators.required, - PasswordValidators.lowercaseCharacterRule(1) - ])); + lowercaseCharacterRule: FormControl = new FormControl( + "", + Validators.compose([Validators.required, PasswordValidators.lowercaseCharacterRule(1)]) + ); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'newPassword': this.lowercaseCharacterRule + newPassword: this.lowercaseCharacterRule, }); } } diff --git a/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.html b/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.html index 3a5d9b8..e5ce4ba 100644 --- a/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.html +++ b/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.html @@ -1,9 +1,9 @@
- - - - - - Passwords don't match - -
\ No newline at end of file + + + + + + Passwords don't match + + diff --git a/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.ts b/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.ts index 3a3aa8f..5681481 100644 --- a/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.ts +++ b/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.ts @@ -1,24 +1,23 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators, PasswordValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators, PasswordValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-mismatch', - templateUrl: './reactive-form-mismatch.component.html' + selector: "app-reactive-mismatch", + templateUrl: "./reactive-form-mismatch.component.html", }) export class ReactiveFormMismatchComponent implements OnInit { - form: FormGroup; - password: FormControl = new FormControl(''); - confirmPassword: FormControl = new FormControl(''); + password: FormControl = new FormControl(""); + confirmPassword: FormControl = new FormControl(""); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'newPassword': this.password, - 'confirmPassword': this.confirmPassword + newPassword: this.password, + confirmPassword: this.confirmPassword, }); - this.form.validator = PasswordValidators.mismatchedPasswords('newPassword', 'confirmPassword'); + this.form.validator = PasswordValidators.mismatchedPasswords("newPassword", "confirmPassword"); } } diff --git a/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.html b/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.html index c5578b7..70263ae 100644 --- a/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.html +++ b/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.html @@ -1,6 +1,8 @@
- - - Password should not contains repeating characters - -
\ No newline at end of file + + + Password should not contains repeating characters + + diff --git a/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.ts b/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.ts index 01e7470..5707e2d 100644 --- a/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.ts +++ b/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.ts @@ -1,24 +1,23 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { PasswordValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { PasswordValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-repeat-character-regex-rule', - templateUrl: './reactive-form-repeat-character-regex-rule.component.html' + selector: "app-reactive-repeat-character-regex-rule", + templateUrl: "./reactive-form-repeat-character-regex-rule.component.html", }) export class ReactiveFormRepeatCharacterRegexRuleComponent implements OnInit { - form: FormGroup; - repeatCharacterRegexRule: FormControl = new FormControl('', Validators.compose([ - Validators.required, - PasswordValidators.repeatCharacterRegexRule(3) - ])); - constructor(protected _fb: FormBuilder) { } + repeatCharacterRegexRule: FormControl = new FormControl( + "", + Validators.compose([Validators.required, PasswordValidators.repeatCharacterRegexRule(3)]) + ); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'newPassword': this.repeatCharacterRegexRule + newPassword: this.repeatCharacterRegexRule, }); } } diff --git a/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.html b/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.html index 94e661e..4c5c010 100644 --- a/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.html +++ b/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.html @@ -1,6 +1,8 @@
- - - Password should contain at least one special character - -
\ No newline at end of file + + + Password should contain at least one special character + + diff --git a/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.ts b/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.ts index 848bc93..03ea52d 100644 --- a/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.ts +++ b/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.ts @@ -1,22 +1,20 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators, PasswordValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators, PasswordValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-special-character-rule', - templateUrl: './reactive-form-special-character-rule.component.html' + selector: "app-reactive-special-character-rule", + templateUrl: "./reactive-form-special-character-rule.component.html", }) export class ReactiveFormSpecialCharacterRuleComponent implements OnInit { - form: FormGroup; - specialCharacterRule: FormControl = new FormControl('', PasswordValidators.specialCharacterRule(1)); + specialCharacterRule: FormControl = new FormControl("", PasswordValidators.specialCharacterRule(1)); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'newPassword': this.specialCharacterRule + newPassword: this.specialCharacterRule, }); } - } diff --git a/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.html b/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.html index 2170bf3..456f67f 100644 --- a/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.html +++ b/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.html @@ -1,6 +1,8 @@
- - - Password should contain at least one uppercase character - -
\ No newline at end of file + + + Password should contain at least one uppercase character + + diff --git a/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.ts b/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.ts index 8dc1ca1..69e1f7c 100644 --- a/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.ts +++ b/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.ts @@ -1,27 +1,25 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators, PasswordValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; -import { PasswordModule } from '../../password-validator.module'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators, PasswordValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; +import { PasswordModule } from "../../password-validator.module"; @Component({ - selector: 'app-reactive-uppercase-character-rule', - templateUrl: './reactive-form-uppercase-character-rule.component.html' + selector: "app-reactive-uppercase-character-rule", + templateUrl: "./reactive-form-uppercase-character-rule.component.html", }) export class ReactiveFormUppercaseCharacterRuleComponent implements OnInit { - form: FormGroup; - uppercaseCharacterRule: FormControl = new FormControl('', Validators.compose([ - Validators.required, - PasswordValidators.uppercaseCharacterRule(1) - ])); + uppercaseCharacterRule: FormControl = new FormControl( + "", + Validators.compose([Validators.required, PasswordValidators.uppercaseCharacterRule(1)]) + ); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'newPassword': this.uppercaseCharacterRule + newPassword: this.uppercaseCharacterRule, }); } - } diff --git a/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.html b/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.html index 1579890..417f75d 100644 --- a/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.html +++ b/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.html @@ -1,8 +1,18 @@
- - - Needs to be a number - Number to small - Number to big - -
\ No newline at end of file + + + Needs to be a number + Number to small + Number to big + + diff --git a/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.ts b/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.ts index cfce647..7546b60 100644 --- a/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.ts +++ b/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.ts @@ -1,12 +1,11 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-is-in-range', - templateUrl: './form-is-in-range.component.html' + selector: "app-is-in-range", + templateUrl: "./form-is-in-range.component.html", }) - export class FormIsInRangeComponent { model: any = { - range: '', + range: "", }; } diff --git a/examples/src/app/universal-validator/form/is-number/form-is-number.component.html b/examples/src/app/universal-validator/form/is-number/form-is-number.component.html index 7922f72..6d93201 100644 --- a/examples/src/app/universal-validator/form/is-number/form-is-number.component.html +++ b/examples/src/app/universal-validator/form/is-number/form-is-number.component.html @@ -1,4 +1,12 @@ - - Is not a number - \ No newline at end of file + + Is not a number + diff --git a/examples/src/app/universal-validator/form/is-number/form-is-number.component.ts b/examples/src/app/universal-validator/form/is-number/form-is-number.component.ts index 88058f2..51794a0 100644 --- a/examples/src/app/universal-validator/form/is-number/form-is-number.component.ts +++ b/examples/src/app/universal-validator/form/is-number/form-is-number.component.ts @@ -1,12 +1,11 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-is-number', - templateUrl: './form-is-number.component.html' + selector: "app-is-number", + templateUrl: "./form-is-number.component.html", }) - export class FormIsNumberComponent { model: any = { - isNumber: '' + isNumber: "", }; } diff --git a/examples/src/app/universal-validator/form/max/form-max.component.html b/examples/src/app/universal-validator/form/max/form-max.component.html index ef88e77..68e0e68 100644 --- a/examples/src/app/universal-validator/form/max/form-max.component.html +++ b/examples/src/app/universal-validator/form/max/form-max.component.html @@ -1,5 +1,13 @@ - - Needs to be a number - Number to big - \ No newline at end of file + + Needs to be a number + Number to big + diff --git a/examples/src/app/universal-validator/form/max/form-max.component.ts b/examples/src/app/universal-validator/form/max/form-max.component.ts index 19871a1..eb712a1 100644 --- a/examples/src/app/universal-validator/form/max/form-max.component.ts +++ b/examples/src/app/universal-validator/form/max/form-max.component.ts @@ -1,12 +1,11 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-max', - templateUrl: './form-max.component.html' + selector: "app-max", + templateUrl: "./form-max.component.html", }) - export class FormMaxComponent { model: any = { - max: '' + max: "", }; } diff --git a/examples/src/app/universal-validator/form/min/form-min.component.html b/examples/src/app/universal-validator/form/min/form-min.component.html index dabce58..1f94e3a 100644 --- a/examples/src/app/universal-validator/form/min/form-min.component.html +++ b/examples/src/app/universal-validator/form/min/form-min.component.html @@ -1,5 +1,16 @@ - - Needs to be a number - Number to small - \ No newline at end of file + + Needs to be a number + Number to small + + + + diff --git a/examples/src/app/universal-validator/form/min/form-min.component.ts b/examples/src/app/universal-validator/form/min/form-min.component.ts index 385983e..e5e6462 100644 --- a/examples/src/app/universal-validator/form/min/form-min.component.ts +++ b/examples/src/app/universal-validator/form/min/form-min.component.ts @@ -1,12 +1,12 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-min', - templateUrl: './form-min.component.html' + selector: "app-min", + templateUrl: "./form-min.component.html", }) - export class FormMinComponent { model: any = { - min: '' + min: "", + value: 2, }; } diff --git a/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.html b/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.html index effdc3c..0495ac0 100644 --- a/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.html +++ b/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.html @@ -1,4 +1,12 @@ - - No whitespace allowed - \ No newline at end of file + + No whitespace allowed + diff --git a/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.ts b/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.ts index 35134d9..d649d2e 100644 --- a/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.ts +++ b/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.ts @@ -1,12 +1,11 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-no-whitespace', - templateUrl: './form-no-whitespace.component.html' + selector: "app-no-whitespace", + templateUrl: "./form-no-whitespace.component.html", }) - export class FormWhitespaceComponent { model: any = { - whitespace: '' + whitespace: "", }; } diff --git a/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.html b/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.html index 7228781..e09008d 100644 --- a/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.html +++ b/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.html @@ -1,8 +1,8 @@
- - - Is not a number - Number to small - Number to big - -
\ No newline at end of file + + + Is not a number + Number to small + Number to big + + diff --git a/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.ts b/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.ts index 6df5ae1..0d47d6b 100644 --- a/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.ts +++ b/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.ts @@ -1,24 +1,23 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-is-in-range', - templateUrl: './reactive-form-is-in-range.component.html' + selector: "app-reactive-is-in-range", + templateUrl: "./reactive-form-is-in-range.component.html", }) export class ReactiveFormIsInRangeComponent implements OnInit { - form: FormGroup; - isInRange: FormControl = new FormControl('', Validators.compose([ - Validators.required, - UniversalValidators.isInRange(3, 6) - ])); - constructor(protected _fb: FormBuilder) { } + isInRange: FormControl = new FormControl( + "", + Validators.compose([Validators.required, UniversalValidators.isInRange(3, 6)]) + ); + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'isInRange': this.isInRange + isInRange: this.isInRange, }); } } diff --git a/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.html b/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.html index 6754859..7c8b202 100644 --- a/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.html +++ b/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.html @@ -1,6 +1,6 @@
- - - Is not a number - -
\ No newline at end of file + + + Is not a number + + diff --git a/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.ts b/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.ts index b1a0af9..83096ca 100644 --- a/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.ts +++ b/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.ts @@ -1,25 +1,21 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-is-number', - templateUrl: './reactive-form-is-number.component.html' + selector: "app-reactive-is-number", + templateUrl: "./reactive-form-is-number.component.html", }) export class ReactiveFormIsNumberComponent implements OnInit { - form: FormGroup; - isNumber: FormControl = new FormControl('', Validators.compose([ - Validators.required, - UniversalValidators.isNumber - ])); + isNumber: FormControl = new FormControl("", Validators.compose([Validators.required, UniversalValidators.isNumber])); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'isNumber': this.isNumber + isNumber: this.isNumber, }); } } diff --git a/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.html b/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.html index 500d744..a97795c 100644 --- a/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.html +++ b/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.html @@ -1,6 +1,6 @@
- - - Input to long (max 5) - -
\ No newline at end of file + + + Input to long (max 5) + + diff --git a/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.ts b/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.ts index b42a342..0bdde23 100644 --- a/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.ts +++ b/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.ts @@ -1,26 +1,24 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-max-length', - templateUrl: './reactive-form-max-length.component.html' + selector: "app-reactive-max-length", + templateUrl: "./reactive-form-max-length.component.html", }) export class ReactiveFormMaxLengthComponent implements OnInit { - form: FormGroup; - maxLength: FormControl = new FormControl('', Validators.compose([ - Validators.required, - UniversalValidators.maxLength(5) - ])); + maxLength: FormControl = new FormControl( + "", + Validators.compose([Validators.required, UniversalValidators.maxLength(5)]) + ); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'maxLength': this.maxLength + maxLength: this.maxLength, }); } - } diff --git a/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.html b/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.html index f031d46..65b2cfe 100644 --- a/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.html +++ b/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.html @@ -1,7 +1,7 @@
- - - Is not a number - Number to big - -
\ No newline at end of file + + + Is not a number + Number to big + + diff --git a/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.ts b/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.ts index 5d2ea19..93d4405 100644 --- a/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.ts +++ b/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.ts @@ -1,25 +1,21 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-max', - templateUrl: './reactive-form-max.component.html' + selector: "app-reactive-max", + templateUrl: "./reactive-form-max.component.html", }) export class ReactiveFormMaxComponent implements OnInit { - form: FormGroup; - max: FormControl = new FormControl('', Validators.compose([ - Validators.required, - UniversalValidators.max(10) - ])); + max: FormControl = new FormControl("", Validators.compose([Validators.required, UniversalValidators.max(10)])); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'max': this.max + max: this.max, }); } } diff --git a/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.html b/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.html index 6ce34f5..94dc182 100644 --- a/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.html +++ b/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.html @@ -1,6 +1,6 @@
- - - Input to short (min 3) - -
\ No newline at end of file + + + Input to short (min 3) + + diff --git a/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.ts b/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.ts index 0bef471..9bfa104 100644 --- a/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.ts +++ b/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.ts @@ -1,26 +1,24 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-min-length', - templateUrl: './reactive-form-min-length.component.html' + selector: "app-reactive-min-length", + templateUrl: "./reactive-form-min-length.component.html", }) export class ReactiveFormMinLengthComponent implements OnInit { - form: FormGroup; - minLength: FormControl = new FormControl('', Validators.compose([ - Validators.required, - UniversalValidators.minLength(3) - ])); + minLength: FormControl = new FormControl( + "", + Validators.compose([Validators.required, UniversalValidators.minLength(3)]) + ); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'minLength': this.minLength + minLength: this.minLength, }); } - } diff --git a/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.html b/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.html index d8c1f38..6b06038 100644 --- a/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.html +++ b/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.html @@ -1,7 +1,7 @@
- - - Is not a number - Number to small - -
\ No newline at end of file + + + Is not a number + Number to small + + diff --git a/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.ts b/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.ts index 26f923f..ad96cbd 100644 --- a/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.ts +++ b/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.ts @@ -1,25 +1,21 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-min', - templateUrl: './reactive-form-min.component.html' + selector: "app-reactive-min", + templateUrl: "./reactive-form-min.component.html", }) export class ReactiveFormMinComponent implements OnInit { - form: FormGroup; - min: FormControl = new FormControl('', Validators.compose([ - Validators.required, - UniversalValidators.min(5) - ])); + min: FormControl = new FormControl("", Validators.compose([Validators.required, UniversalValidators.min(5)])); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'min': this.min + min: this.min, }); } } diff --git a/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.html b/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.html index 4affeb0..35a59b2 100644 --- a/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.html +++ b/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.html @@ -1,6 +1,6 @@
- - - No empty string allowed - -
\ No newline at end of file + + + No empty string allowed + + diff --git a/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.ts b/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.ts index 014a746..ea7cef1 100644 --- a/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.ts +++ b/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.ts @@ -1,23 +1,21 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-no-empty-string', - templateUrl: './reactive-form-no-empty-string.component.html' + selector: "app-reactive-no-empty-string", + templateUrl: "./reactive-form-no-empty-string.component.html", }) export class ReactiveFormNoEmptyStringComponent implements OnInit { - form: FormGroup; - noEmptyString: FormControl = new FormControl('', UniversalValidators.noEmptyString); + noEmptyString: FormControl = new FormControl("", UniversalValidators.noEmptyString); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'noEmptyString': this.noEmptyString + noEmptyString: this.noEmptyString, }); } - } diff --git a/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.html b/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.html index 6ce813f..b4d1206 100644 --- a/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.html +++ b/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.html @@ -1,6 +1,6 @@
- - - No whitespaces allowed - -
\ No newline at end of file + + + No whitespaces allowed + + diff --git a/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.ts b/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.ts index 3309fcd..7ae91cb 100644 --- a/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.ts +++ b/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.ts @@ -1,22 +1,20 @@ -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-reactive-no-whitespace', - templateUrl: './reactive-form-no-whitespace.component.html' + selector: "app-reactive-no-whitespace", + templateUrl: "./reactive-form-no-whitespace.component.html", }) export class ReactiveFormWhitespaceComponent implements OnInit { - form: FormGroup; - noWhitespace: FormControl = new FormControl('', UniversalValidators.noWhitespace); + noWhitespace: FormControl = new FormControl("", UniversalValidators.noWhitespace); - constructor(protected _fb: FormBuilder) { } + constructor(protected _fb: FormBuilder) {} ngOnInit() { this.form = this._fb.group({ - 'noWhitespace': this.noWhitespace + noWhitespace: this.noWhitespace, }); } - } diff --git a/examples/src/app/universal-validator/universal-validator.component.html b/examples/src/app/universal-validator/universal-validator.component.html index 96190da..07b9316 100644 --- a/examples/src/app/universal-validator/universal-validator.component.html +++ b/examples/src/app/universal-validator/universal-validator.component.html @@ -1,36 +1,44 @@ - - - Form - - - Reactive Form - - + + + Form + + + Reactive Form + + - - Universal validator - {{item}} - - - - - - - - - - - - - - - - - - - - + + Universal validator - {{ item }} + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + diff --git a/examples/src/app/universal-validator/universal-validator.component.ts b/examples/src/app/universal-validator/universal-validator.component.ts index 5afc4d8..082a256 100644 --- a/examples/src/app/universal-validator/universal-validator.component.ts +++ b/examples/src/app/universal-validator/universal-validator.component.ts @@ -1,44 +1,38 @@ -import { Validator } from './../items'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { UniversalValidators } from 'ngx-validators'; -import { ActivatedRoute } from '@angular/router'; - - -import { isNumber } from 'util'; -import { Component } from '@angular/core'; -import { OnInit } from '@angular/core'; -import { OnDestroy } from '@angular/core'; -import { universal } from '../items'; - +import { Validator } from "./../items"; +import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms"; +import { UniversalValidators } from "ngx-validators"; +import { ActivatedRoute } from "@angular/router"; +import { isNumber } from "util"; +import { Component } from "@angular/core"; +import { OnInit } from "@angular/core"; +import { OnDestroy } from "@angular/core"; +import { universal } from "../items"; @Component({ - selector: 'universal-validator', - templateUrl: './universal-validator.component.html' + selector: "universal-validator", + templateUrl: "./universal-validator.component.html", }) export class UniversalValidatorComponent implements OnInit, OnDestroy { - - - private sub: any; - universalItems = universal; - item: string = this.universalItems[0].name; - currentValidator: Validator; - selected = 'reactiveForm'; - - constructor(private route: ActivatedRoute) { } - - - ngOnInit() { - this.currentValidator = this.universalItems.filter(x => x.name === this.item)[0]; - this.sub = this.route.params.subscribe(params => { - this.item = params['id']; - if (this.item) { - this.currentValidator = this.universalItems.filter(x => x.name === this.item)[0]; - } - }); - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } + private sub: any; + universalItems = universal; + item: string = this.universalItems[0].name; + currentValidator: Validator; + selected = "reactiveForm"; + + constructor(private route: ActivatedRoute) {} + + ngOnInit() { + this.currentValidator = this.universalItems.filter((x) => x.name === this.item)[0]; + this.sub = this.route.params.subscribe((params) => { + this.item = params["id"]; + if (this.item) { + this.currentValidator = this.universalItems.filter((x) => x.name === this.item)[0]; + } + }); + } + + ngOnDestroy() { + this.sub.unsubscribe(); + } } diff --git a/examples/src/app/universal-validator/universal-validator.module.ts b/examples/src/app/universal-validator/universal-validator.module.ts index 3fb2de6..b92d2b2 100644 --- a/examples/src/app/universal-validator/universal-validator.module.ts +++ b/examples/src/app/universal-validator/universal-validator.module.ts @@ -1,38 +1,43 @@ -import { MatCardModule, MatListModule, MatFormFieldModule, MatTooltipModule, MatInputModule, MatSelectModule } from '@angular/material'; -import { NgModule, Component } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MatButtonModule, MatTabsModule } from '@angular/material'; -import { Routes, RouterModule } from '@angular/router'; -import { UniversalValidatorComponent } from './universal-validator.component'; -import { UtilModule } from '../util/util.module'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ReactiveFormWhitespaceComponent } from './reactive-form/no-whitespace/reactive-form-no-whitespace.component'; -import { ReactiveFormNoEmptyStringComponent } from './reactive-form/no-empty-string/reactive-form-no-empty-string.component'; -import { ReactiveFormMinLengthComponent } from './reactive-form/min-length/reactive-form-min-length.component'; -import { ReactiveFormMaxLengthComponent } from './reactive-form/max-length/reactive-form-max-length.component'; -import { ReactiveFormMinComponent } from './reactive-form/min/reactive-form-min.component'; -import { ReactiveFormMaxComponent } from './reactive-form/max/reactive-form-max.component'; -import { ReactiveFormIsInRangeComponent } from './reactive-form/is-in-range/reactive-form-is-in-range.component'; -import { ReactiveFormIsNumberComponent } from './reactive-form/is-number/reactive-form-is-number.component'; - -import { FormWhitespaceComponent } from './form/no-whitespace/form-no-whitespace.component'; -import { FormMinComponent } from './form/min/form-min.component'; -import { FormMaxComponent } from './form/max/form-max.component'; -import { FormIsInRangeComponent } from './form/is-in-range/form-is-in-range.component'; -import { FormIsNumberComponent } from './form/is-number/form-is-number.component'; -import { ValidatorsModule } from 'ngx-validators'; - +import { + MatCardModule, + MatListModule, + MatFormFieldModule, + MatTooltipModule, + MatInputModule, + MatSelectModule, +} from "@angular/material"; +import { NgModule, Component } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { MatButtonModule, MatTabsModule } from "@angular/material"; +import { Routes, RouterModule } from "@angular/router"; +import { UniversalValidatorComponent } from "./universal-validator.component"; +import { UtilModule } from "../util/util.module"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { ReactiveFormWhitespaceComponent } from "./reactive-form/no-whitespace/reactive-form-no-whitespace.component"; +import { ReactiveFormNoEmptyStringComponent } from "./reactive-form/no-empty-string/reactive-form-no-empty-string.component"; +import { ReactiveFormMinLengthComponent } from "./reactive-form/min-length/reactive-form-min-length.component"; +import { ReactiveFormMaxLengthComponent } from "./reactive-form/max-length/reactive-form-max-length.component"; +import { ReactiveFormMinComponent } from "./reactive-form/min/reactive-form-min.component"; +import { ReactiveFormMaxComponent } from "./reactive-form/max/reactive-form-max.component"; +import { ReactiveFormIsInRangeComponent } from "./reactive-form/is-in-range/reactive-form-is-in-range.component"; +import { ReactiveFormIsNumberComponent } from "./reactive-form/is-number/reactive-form-is-number.component"; +import { FormWhitespaceComponent } from "./form/no-whitespace/form-no-whitespace.component"; +import { FormMinComponent } from "./form/min/form-min.component"; +import { FormMaxComponent } from "./form/max/form-max.component"; +import { FormIsInRangeComponent } from "./form/is-in-range/form-is-in-range.component"; +import { FormIsNumberComponent } from "./form/is-number/form-is-number.component"; +import { ValidatorsModule } from "ngx-validators"; const routes: Routes = [ { - path: 'universal', + path: "universal", component: UniversalValidatorComponent, }, { - path: 'universal/:id', + path: "universal/:id", component: UniversalValidatorComponent, - } + }, ]; @NgModule({ @@ -50,11 +55,9 @@ const routes: Routes = [ MatTabsModule, MatInputModule, UtilModule, - ValidatorsModule - ], - exports: [ - RouterModule + ValidatorsModule, ], + exports: [RouterModule], declarations: [ ReactiveFormWhitespaceComponent, ReactiveFormNoEmptyStringComponent, @@ -69,7 +72,7 @@ const routes: Routes = [ FormMaxComponent, FormIsInRangeComponent, FormIsNumberComponent, - UniversalValidatorComponent - ] + UniversalValidatorComponent, + ], }) -export class UniversalModule { } +export class UniversalModule {} diff --git a/examples/src/app/util/codeviewer/codeviewer.component.html b/examples/src/app/util/codeviewer/codeviewer.component.html index dfb3feb..e700380 100644 --- a/examples/src/app/util/codeviewer/codeviewer.component.html +++ b/examples/src/app/util/codeviewer/codeviewer.component.html @@ -1,15 +1,15 @@ - - Example code - - - - -
 
-
- -
-
-
-
-
\ No newline at end of file + + Example code + + + + +
 
+
+ +
+
+
+
+ diff --git a/examples/src/app/util/codeviewer/codeviewer.component.spec.ts b/examples/src/app/util/codeviewer/codeviewer.component.spec.ts index 9f9f80d..ce7daf8 100644 --- a/examples/src/app/util/codeviewer/codeviewer.component.spec.ts +++ b/examples/src/app/util/codeviewer/codeviewer.component.spec.ts @@ -1,16 +1,15 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from "@angular/core/testing"; -import { CodeviewerComponent } from './codeviewer.component'; +import { CodeviewerComponent } from "./codeviewer.component"; -describe('CodeviewerComponent', () => { +describe("CodeviewerComponent", () => { let component: CodeviewerComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CodeviewerComponent ] - }) - .compileComponents(); + declarations: [CodeviewerComponent], + }).compileComponents(); })); beforeEach(() => { @@ -19,7 +18,7 @@ describe('CodeviewerComponent', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/examples/src/app/util/codeviewer/codeviewer.component.ts b/examples/src/app/util/codeviewer/codeviewer.component.ts index 94246de..c998820 100644 --- a/examples/src/app/util/codeviewer/codeviewer.component.ts +++ b/examples/src/app/util/codeviewer/codeviewer.component.ts @@ -1,13 +1,12 @@ -import { Component, Input } from '@angular/core'; +import { Component, Input } from "@angular/core"; // import * as hljs from 'highlight.js'; @Component({ - selector: 'app-codeviewer', - templateUrl: './codeviewer.component.html', - styleUrls: ['./codeviewer.component.css'] + selector: "app-codeviewer", + templateUrl: "./codeviewer.component.html", + styleUrls: ["./codeviewer.component.css"], }) export class CodeviewerComponent { - @Input() html: any; @Input() tsCode: any; } diff --git a/examples/src/app/util/util.module.ts b/examples/src/app/util/util.module.ts index f851628..63c102e 100644 --- a/examples/src/app/util/util.module.ts +++ b/examples/src/app/util/util.module.ts @@ -1,10 +1,10 @@ -import { MatCardModule, MatListModule } from '@angular/material'; -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { MatButtonModule, MatTabsModule } from '@angular/material'; -import { CodeviewerComponent } from './codeviewer/codeviewer.component'; -import { HighlightModule } from 'ngx-highlightjs'; +import { MatCardModule, MatListModule } from "@angular/material"; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { RouterModule } from "@angular/router"; +import { MatButtonModule, MatTabsModule } from "@angular/material"; +import { CodeviewerComponent } from "./codeviewer/codeviewer.component"; +import { HighlightModule } from "ngx-highlightjs"; @NgModule({ imports: [ @@ -14,13 +14,9 @@ import { HighlightModule } from 'ngx-highlightjs'; MatListModule, MatButtonModule, MatTabsModule, - HighlightModule.forRoot() + HighlightModule.forRoot(), ], - declarations: [ - CodeviewerComponent - ], - exports: [ - CodeviewerComponent - ] + declarations: [CodeviewerComponent], + exports: [CodeviewerComponent], }) -export class UtilModule { } +export class UtilModule {} diff --git a/examples/src/assets/lib/hljs/styles/androidstudio.css b/examples/src/assets/lib/hljs/styles/androidstudio.css index bc8e473..8adf4d5 100644 --- a/examples/src/assets/lib/hljs/styles/androidstudio.css +++ b/examples/src/assets/lib/hljs/styles/androidstudio.css @@ -15,7 +15,7 @@ Author: Pedro Oliveira .hljs-literal, .hljs-symbol, .hljs-bullet { - color: #6897BB; + color: #6897bb; } .hljs-keyword, @@ -42,7 +42,7 @@ Author: Pedro Oliveira .hljs-string, .hljs-attribute, .hljs-addition { - color: #6A8759; + color: #6a8759; } .hljs-section, diff --git a/examples/src/assets/lib/hljs/styles/arduino-light.css b/examples/src/assets/lib/hljs/styles/arduino-light.css index 4b8b7fd..fdfdff5 100644 --- a/examples/src/assets/lib/hljs/styles/arduino-light.css +++ b/examples/src/assets/lib/hljs/styles/arduino-light.css @@ -8,7 +8,7 @@ Arduino® Light Theme - Stefania Mellai display: block; overflow-x: auto; padding: 0.5em; - background: #FFFFFF; + background: #ffffff; } .hljs, @@ -21,7 +21,7 @@ Arduino® Light Theme - Stefania Mellai .hljs-selector-tag, .hljs-doctag, .hljs-name { - color: #00979D; + color: #00979d; } .hljs-built_in, @@ -29,7 +29,7 @@ Arduino® Light Theme - Stefania Mellai .hljs-bullet, .hljs-code, .hljs-addition { - color: #D35400; + color: #d35400; } .hljs-regexp, @@ -39,7 +39,7 @@ Arduino® Light Theme - Stefania Mellai .hljs-link, .hljs-selector-attr, .hljs-selector-pseudo { - color: #00979D; + color: #00979d; } .hljs-type, @@ -49,7 +49,7 @@ Arduino® Light Theme - Stefania Mellai .hljs-quote, .hljs-template-tag, .hljs-deletion { - color: #005C5F; + color: #005c5f; } .hljs-title, @@ -59,15 +59,15 @@ Arduino® Light Theme - Stefania Mellai } .hljs-comment { - color: rgba(149,165,166,.8); + color: rgba(149, 165, 166, 0.8); } .hljs-meta-keyword { - color: #728E00; + color: #728e00; } .hljs-meta { - color: #728E00; + color: #728e00; color: #434f54; } @@ -80,9 +80,9 @@ Arduino® Light Theme - Stefania Mellai } .hljs-function { - color: #728E00; + color: #728e00; } .hljs-number { - color: #8A7B52; + color: #8a7b52; } diff --git a/examples/src/assets/lib/hljs/styles/brown-paper.css b/examples/src/assets/lib/hljs/styles/brown-paper.css index f0197b9..4382c25 100644 --- a/examples/src/assets/lib/hljs/styles/brown-paper.css +++ b/examples/src/assets/lib/hljs/styles/brown-paper.css @@ -8,14 +8,14 @@ Brown Paper style from goldblog.com.ua (c) Zaripov Yura display: block; overflow-x: auto; padding: 0.5em; - background:#b7a68e url(./brown-papersq.png); + background: #b7a68e url(./brown-papersq.png); } .hljs-keyword, .hljs-selector-tag, .hljs-literal { - color:#005599; - font-weight:bold; + color: #005599; + font-weight: bold; } .hljs, diff --git a/examples/src/assets/lib/hljs/styles/color-brewer.css b/examples/src/assets/lib/hljs/styles/color-brewer.css index 7934d98..17f58af 100644 --- a/examples/src/assets/lib/hljs/styles/color-brewer.css +++ b/examples/src/assets/lib/hljs/styles/color-brewer.css @@ -45,8 +45,6 @@ Ported by Fabrício Tavares de Oliveira color: #88f; } - - .hljs-keyword, .hljs-selector-tag, .hljs-title, diff --git a/examples/src/assets/lib/hljs/styles/darcula.css b/examples/src/assets/lib/hljs/styles/darcula.css index be182d0..1d3826b 100644 --- a/examples/src/assets/lib/hljs/styles/darcula.css +++ b/examples/src/assets/lib/hljs/styles/darcula.css @@ -4,7 +4,6 @@ Darcula color scheme from the JetBrains family of IDEs */ - .hljs { display: block; overflow-x: auto; diff --git a/examples/src/assets/lib/hljs/styles/darkula.css b/examples/src/assets/lib/hljs/styles/darkula.css index f4646c3..7c57266 100644 --- a/examples/src/assets/lib/hljs/styles/darkula.css +++ b/examples/src/assets/lib/hljs/styles/darkula.css @@ -3,4 +3,4 @@ Please use darcula.css instead. */ -@import url('darcula.css'); +@import url("darcula.css"); diff --git a/examples/src/assets/lib/hljs/styles/default.css b/examples/src/assets/lib/hljs/styles/default.css index f1bfade..eba516d 100644 --- a/examples/src/assets/lib/hljs/styles/default.css +++ b/examples/src/assets/lib/hljs/styles/default.css @@ -8,10 +8,9 @@ Original highlight.js style (c) Ivan Sagalaev display: block; overflow-x: auto; padding: 0.5em; - background: #F0F0F0; + background: #f0f0f0; } - /* Base color: saturation 0; */ .hljs, @@ -32,7 +31,6 @@ Original highlight.js style (c) Ivan Sagalaev font-weight: bold; } - /* User color: hue: 0 */ .hljs-type, @@ -59,14 +57,13 @@ Original highlight.js style (c) Ivan Sagalaev .hljs-link, .hljs-selector-attr, .hljs-selector-pseudo { - color: #BC6060; + color: #bc6060; } - /* Language color: hue: 90; */ .hljs-literal { - color: #78A960; + color: #78a960; } .hljs-built_in, @@ -76,7 +73,6 @@ Original highlight.js style (c) Ivan Sagalaev color: #397300; } - /* Meta color: hue: 200 */ .hljs-meta { @@ -87,7 +83,6 @@ Original highlight.js style (c) Ivan Sagalaev color: #4d99bf; } - /* Misc effects */ .hljs-emphasis { diff --git a/examples/src/assets/lib/hljs/styles/foundation.css b/examples/src/assets/lib/hljs/styles/foundation.css index f1fe64b..67c6e10 100644 --- a/examples/src/assets/lib/hljs/styles/foundation.css +++ b/examples/src/assets/lib/hljs/styles/foundation.css @@ -10,7 +10,8 @@ Date: 2013-04-02 display: block; overflow-x: auto; padding: 0.5em; - background: #eee; color: black; + background: #eee; + color: black; } .hljs-link, diff --git a/examples/src/assets/lib/hljs/styles/googlecode.css b/examples/src/assets/lib/hljs/styles/googlecode.css index 884ad63..d7a18d2 100644 --- a/examples/src/assets/lib/hljs/styles/googlecode.css +++ b/examples/src/assets/lib/hljs/styles/googlecode.css @@ -68,7 +68,7 @@ Google Code style (c) Aahan Krish .hljs-selector-id, .hljs-selector-class { - color: #9B703F + color: #9b703f; } .hljs-addition { diff --git a/examples/src/assets/lib/hljs/styles/grayscale.css b/examples/src/assets/lib/hljs/styles/grayscale.css index 5376f34..227392e 100644 --- a/examples/src/assets/lib/hljs/styles/grayscale.css +++ b/examples/src/assets/lib/hljs/styles/grayscale.css @@ -34,7 +34,8 @@ grayscale style (c) MY Sun .hljs-doctag, .hljs-formula { color: #333; - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJ0lEQVQIW2O8e/fufwYGBgZBQUEQxcCIIfDu3Tuwivfv30NUoAsAALHpFMMLqZlPAAAAAElFTkSuQmCC) repeat; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJ0lEQVQIW2O8e/fufwYGBgZBQUEQxcCIIfDu3Tuwivfv30NUoAsAALHpFMMLqZlPAAAAAElFTkSuQmCC) + repeat; } .hljs-title, @@ -60,15 +61,17 @@ grayscale style (c) MY Sun } .hljs-regexp { - color: #333; - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAN37979r6yszIgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQDexSef15DBCwAAAABJRU5ErkJggg==) repeat; + color: #333; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAN37979r6yszIgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQDexSef15DBCwAAAABJRU5ErkJggg==) + repeat; } .hljs-symbol, .hljs-bullet, .hljs-link { color: #000; - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAO7d+/+z4gsBhJwdXVlhAvCBECKwIIwAbhKZBUwBQA6hBpm5efZsgAAAABJRU5ErkJggg==) repeat; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAO7d+/+z4gsBhJwdXVlhAvCBECKwIIwAbhKZBUwBQA6hBpm5efZsgAAAABJRU5ErkJggg==) + repeat; } .hljs-built_in, @@ -84,12 +87,14 @@ grayscale style (c) MY Sun .hljs-deletion { color: #fff; - background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAE0lEQVQIW2MMDQ39zzhz5kwIAQAyxweWgUHd1AAAAABJRU5ErkJggg==) repeat; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAE0lEQVQIW2MMDQ39zzhz5kwIAQAyxweWgUHd1AAAAABJRU5ErkJggg==) + repeat; } .hljs-addition { color: #000; - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALUlEQVQYV2N89+7dfwYk8P79ewZBQUFkIQZGOiu6e/cuiptQHAPl0NtNxAQBAM97Oejj3Dg7AAAAAElFTkSuQmCC) repeat; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALUlEQVQYV2N89+7dfwYk8P79ewZBQUFkIQZGOiu6e/cuiptQHAPl0NtNxAQBAM97Oejj3Dg7AAAAAElFTkSuQmCC) + repeat; } .hljs-emphasis { diff --git a/examples/src/assets/lib/hljs/styles/hybrid.css b/examples/src/assets/lib/hljs/styles/hybrid.css index 29735a1..34203ed 100644 --- a/examples/src/assets/lib/hljs/styles/hybrid.css +++ b/examples/src/assets/lib/hljs/styles/hybrid.css @@ -47,7 +47,7 @@ vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid) .hljs-literal, .hljs-deletion, .hljs-link { - color: #cc6666 + color: #cc6666; } /*color: fg_green*/ @@ -64,7 +64,7 @@ vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid) .hljs-attribute, .hljs-code, .hljs-selector-id { - color: #b294bb; + color: #b294bb; } /*color: fg_blue*/ @@ -72,7 +72,7 @@ vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid) .hljs-selector-tag, .hljs-bullet, .hljs-tag { - color: #81a2be; + color: #81a2be; } /*color: fg_aqua*/ diff --git a/examples/src/assets/lib/hljs/styles/ir-black.css b/examples/src/assets/lib/hljs/styles/ir-black.css index bd4c755..dda1d7a 100644 --- a/examples/src/assets/lib/hljs/styles/ir-black.css +++ b/examples/src/assets/lib/hljs/styles/ir-black.css @@ -61,7 +61,7 @@ .hljs-number, .hljs-deletion { - color:#ff73fd; + color: #ff73fd; } .hljs-emphasis { diff --git a/examples/src/assets/lib/hljs/styles/monokai.css b/examples/src/assets/lib/hljs/styles/monokai.css index 775d53f..af24834 100644 --- a/examples/src/assets/lib/hljs/styles/monokai.css +++ b/examples/src/assets/lib/hljs/styles/monokai.css @@ -6,7 +6,8 @@ Monokai style - ported by Luigi Maselli - http://grigio.org display: block; overflow-x: auto; padding: 0.5em; - background: #272822; color: #ddd; + background: #272822; + color: #ddd; } .hljs-tag, diff --git a/examples/src/assets/lib/hljs/styles/obsidian.css b/examples/src/assets/lib/hljs/styles/obsidian.css index 356630f..b33aec2 100644 --- a/examples/src/assets/lib/hljs/styles/obsidian.css +++ b/examples/src/assets/lib/hljs/styles/obsidian.css @@ -72,7 +72,7 @@ } .hljs-selector-class { - color: #A082BD + color: #a082bd; } .hljs-keyword, diff --git a/examples/src/assets/lib/hljs/styles/purebasic.css b/examples/src/assets/lib/hljs/styles/purebasic.css index 5ce9b9e..d31f096 100644 --- a/examples/src/assets/lib/hljs/styles/purebasic.css +++ b/examples/src/assets/lib/hljs/styles/purebasic.css @@ -21,12 +21,13 @@ NOTE_2: Color names provided in comments were derived using "Name that Color" on http://chir.ag/projects/name-that-color */ -.hljs { /* Common set of rules required by highlight.js (don'r remove!) */ - display: block; - overflow-x: auto; - padding: 0.5em; - background: #FFFFDF; /* Half and Half (approx.) */ -/* --- Uncomment to add PureBASIC native IDE styled font! +.hljs { + /* Common set of rules required by highlight.js (don'r remove!) */ + display: block; + overflow-x: auto; + padding: 0.5em; + background: #ffffdf; /* Half and Half (approx.) */ + /* --- Uncomment to add PureBASIC native IDE styled font! font-family: Consolas; */ } @@ -39,7 +40,7 @@ NOTE_2: Color names provided in comments were derived using "Name that Color" on .hljs-attr, .hljs-params, .hljs-subst { - color: #000000; /* Black */ + color: #000000; /* Black */ } .hljs-comment, /* --- used for PureBASIC Comments --- */ @@ -47,14 +48,14 @@ NOTE_2: Color names provided in comments were derived using "Name that Color" on .hljs-section, .hljs-selector-pseudo, .hljs-addition { - color: #00AAAA; /* Persian Green (approx.) */ + color: #00aaaa; /* Persian Green (approx.) */ } .hljs-title, /* --- used for PureBASIC Procedures Names --- */ .hljs-tag, .hljs-variable, -.hljs-code { - color: #006666; /* Blue Stone (approx.) */ +.hljs-code { + color: #006666; /* Blue Stone (approx.) */ } .hljs-keyword, /* --- used for PureBASIC Keywords --- */ @@ -63,34 +64,34 @@ NOTE_2: Color names provided in comments were derived using "Name that Color" on .hljs-selector-class, .hljs-built_in, .hljs-builtin-name { - color: #006666; /* Blue Stone (approx.) */ - font-weight: bold; + color: #006666; /* Blue Stone (approx.) */ + font-weight: bold; } .hljs-string, /* --- used for PureBASIC Strings --- */ .hljs-selector-attr { - color: #0080FF; /* Azure Radiance (approx.) */ + color: #0080ff; /* Azure Radiance (approx.) */ } .hljs-symbol, /* --- used for PureBASIC Constants --- */ .hljs-link, .hljs-deletion, .hljs-attribute { - color: #924B72; /* Cannon Pink (approx.) */ + color: #924b72; /* Cannon Pink (approx.) */ } .hljs-meta, .hljs-literal, .hljs-selector-id { - color: #924B72; /* Cannon Pink (approx.) */ - font-weight: bold; + color: #924b72; /* Cannon Pink (approx.) */ + font-weight: bold; } .hljs-strong, .hljs-name { - font-weight: bold; + font-weight: bold; } .hljs-emphasis { - font-style: italic; + font-style: italic; } diff --git a/examples/src/assets/lib/hljs/styles/qtcreator_dark.css b/examples/src/assets/lib/hljs/styles/qtcreator_dark.css index 7aa56a3..d10256d 100644 --- a/examples/src/assets/lib/hljs/styles/qtcreator_dark.css +++ b/examples/src/assets/lib/hljs/styles/qtcreator_dark.css @@ -4,7 +4,6 @@ Qt Creator dark color scheme */ - .hljs { display: block; overflow-x: auto; @@ -32,8 +31,7 @@ Qt Creator dark color scheme color: #ff55ff; } -.hljs-code -.hljs-selector-class { +.hljs-code .hljs-selector-class { color: #aaaaff; } diff --git a/examples/src/assets/lib/hljs/styles/qtcreator_light.css b/examples/src/assets/lib/hljs/styles/qtcreator_light.css index 1efa2c6..8cacde0 100644 --- a/examples/src/assets/lib/hljs/styles/qtcreator_light.css +++ b/examples/src/assets/lib/hljs/styles/qtcreator_light.css @@ -4,7 +4,6 @@ Qt Creator light color scheme */ - .hljs { display: block; overflow-x: auto; @@ -32,8 +31,7 @@ Qt Creator light color scheme color: #000080; } -.hljs-code -.hljs-selector-class { +.hljs-code .hljs-selector-class { color: #800080; } @@ -59,7 +57,7 @@ Qt Creator light color scheme .hljs-variable, .hljs-params, .hljs-class .hljs-title { - color: #0055AF; + color: #0055af; } .hljs-string, diff --git a/examples/src/assets/lib/hljs/styles/railscasts.css b/examples/src/assets/lib/hljs/styles/railscasts.css index 008cdc5..1c6e518 100644 --- a/examples/src/assets/lib/hljs/styles/railscasts.css +++ b/examples/src/assets/lib/hljs/styles/railscasts.css @@ -44,7 +44,6 @@ Railscasts-like style (c) Visoft, Inc. (Damien White) color: #da4939; } - .hljs-symbol, .hljs-bullet, .hljs-built_in, diff --git a/examples/src/assets/lib/hljs/styles/rainbow.css b/examples/src/assets/lib/hljs/styles/rainbow.css index 905eb8e..47d2a69 100644 --- a/examples/src/assets/lib/hljs/styles/rainbow.css +++ b/examples/src/assets/lib/hljs/styles/rainbow.css @@ -12,7 +12,6 @@ Style with support for rainbow parens color: #d1d9e1; } - .hljs-comment, .hljs-quote { color: #969896; @@ -50,7 +49,7 @@ Style with support for rainbow parens .hljs-template-variable, .hljs-selector-id, .hljs-class .hljs-title { - color: #ffcc66; + color: #ffcc66; } .hljs-section, diff --git a/examples/src/assets/lib/hljs/styles/routeros.css b/examples/src/assets/lib/hljs/styles/routeros.css index ebe2399..51c3cc9 100644 --- a/examples/src/assets/lib/hljs/styles/routeros.css +++ b/examples/src/assets/lib/hljs/styles/routeros.css @@ -8,7 +8,7 @@ display: block; overflow-x: auto; padding: 0.5em; - background: #F0F0F0; + background: #f0f0f0; } /* Base color: saturation 0; */ @@ -31,15 +31,15 @@ } .hljs-attribute { - color: #0E9A00; -} + color: #0e9a00; +} .hljs-function { - color: #99069A; + color: #99069a; } .hljs-builtin-name { - color: #99069A; + color: #99069a; } /* User color: hue: 0 */ @@ -68,24 +68,22 @@ .hljs-link, .hljs-selector-attr, .hljs-selector-pseudo { - color: #BC6060; + color: #bc6060; } - /* Language color: hue: 90; */ .hljs-literal { - color: #78A960; + color: #78a960; } .hljs-built_in, .hljs-bullet, .hljs-code, .hljs-addition { - color: #0C9A9A; + color: #0c9a9a; } - /* Meta color: hue: 200 */ .hljs-meta { @@ -96,7 +94,6 @@ color: #4d99bf; } - /* Misc effects */ .hljs-emphasis { diff --git a/examples/src/assets/lib/hljs/styles/school-book.css b/examples/src/assets/lib/hljs/styles/school-book.css index 964b51d..1648b06 100644 --- a/examples/src/assets/lib/hljs/styles/school-book.css +++ b/examples/src/assets/lib/hljs/styles/school-book.css @@ -9,11 +9,11 @@ School Book style from goldblog.com.ua (c) Zaripov Yura overflow-x: auto; padding: 15px 0.5em 0.5em 30px; font-size: 11px; - line-height:16px; + line-height: 16px; } -pre{ - background:#f6f6ae url(./school-book.png); +pre { + background: #f6f6ae url(./school-book.png); border-top: solid 2px #d2e8b9; border-bottom: solid 1px #d2e8b9; } @@ -21,8 +21,8 @@ pre{ .hljs-keyword, .hljs-selector-tag, .hljs-literal { - color:#005599; - font-weight:bold; + color: #005599; + font-weight: bold; } .hljs, diff --git a/examples/src/assets/lib/hljs/styles/vs.css b/examples/src/assets/lib/hljs/styles/vs.css index c5d07d3..6703b64 100644 --- a/examples/src/assets/lib/hljs/styles/vs.css +++ b/examples/src/assets/lib/hljs/styles/vs.css @@ -58,7 +58,6 @@ Visual Studio-like style based on original C# coloring by Jason Diamond + - - - + + ngx-validators - - - - - + + + + + - + Loading... - - - \ No newline at end of file + + diff --git a/examples/src/main.ts b/examples/src/main.ts index 6b163a1..46003ed 100644 --- a/examples/src/main.ts +++ b/examples/src/main.ts @@ -1,10 +1,10 @@ -import { enableProdMode } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; +import { AppModule } from "./app/app.module"; +import { environment } from "./environments/environment"; -import 'hammerjs'; +import "hammerjs"; if (environment.production) { enableProdMode(); diff --git a/examples/src/polyfills.ts b/examples/src/polyfills.ts index 53bdaf1..8f3e0fe 100644 --- a/examples/src/polyfills.ts +++ b/examples/src/polyfills.ts @@ -39,23 +39,17 @@ /** IE10 and IE11 requires the following to support `@angular/animation`. */ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. - /** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - +import "core-js/es6/reflect"; +import "core-js/es7/reflect"; /** ALL Firefox browsers require the following to support `@angular/animation`. **/ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - /*************************************************************************************************** * Zone JS is required by Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - +import "zone.js/dist/zone"; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS diff --git a/examples/src/styles.css b/examples/src/styles.css index 2814b65..a68e711 100644 --- a/examples/src/styles.css +++ b/examples/src/styles.css @@ -2,48 +2,48 @@ @import "~@angular/material/prebuilt-themes/indigo-pink.css"; body { - margin: 0; - background-color: lightgrey; + margin: 0; + background-color: lightgrey; } .card { - margin-bottom: 24px; + margin-bottom: 24px; } .error-container { - margin-top: -15px; - margin-bottom: 5px; + margin-top: -15px; + margin-bottom: 5px; } .success { - color: green; - font-size: 75%; + color: green; + font-size: 75%; } .grey { - color: black; - font-size: 75%; + color: black; + font-size: 75%; } .mat-tab-link { - line-height: 63px !important; - height: 64px !important; - opacity: 1 !important; + line-height: 63px !important; + height: 64px !important; + opacity: 1 !important; } .mat-ink-bar { - background-color: white; + background-color: white; } .mat-drawer-container { - position: fixed !important; - height: 100%; - min-height: 100%; - width: 100%; - min-width: 100%; + position: fixed !important; + height: 100%; + min-height: 100%; + width: 100%; + min-width: 100%; } .clickable { - cursor: pointer; - text-decoration: underline; -} \ No newline at end of file + cursor: pointer; + text-decoration: underline; +} diff --git a/examples/src/test.ts b/examples/src/test.ts index 9bf7226..9f42943 100644 --- a/examples/src/test.ts +++ b/examples/src/test.ts @@ -1,16 +1,13 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/long-stack-trace-zone'; -import 'zone.js/dist/proxy.js'; -import 'zone.js/dist/sync-test'; -import 'zone.js/dist/jasmine-patch'; -import 'zone.js/dist/async-test'; -import 'zone.js/dist/fake-async-test'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; +import "zone.js/dist/long-stack-trace-zone"; +import "zone.js/dist/proxy.js"; +import "zone.js/dist/sync-test"; +import "zone.js/dist/jasmine-patch"; +import "zone.js/dist/async-test"; +import "zone.js/dist/fake-async-test"; +import { getTestBed } from "@angular/core/testing"; +import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing"; // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. declare var __karma__: any; @@ -20,12 +17,9 @@ declare var require: any; __karma__.loaded = function () {}; // First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); +getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); // Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); +const context = require.context("./", true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); // Finally, start Karma to run the tests. diff --git a/examples/src/tsconfig.json b/examples/src/tsconfig.json index 77378d1..697e7fd 100644 --- a/examples/src/tsconfig.json +++ b/examples/src/tsconfig.json @@ -4,18 +4,13 @@ "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "lib": [ - "es2016", - "dom" - ], + "lib": ["es2016", "dom"], "mapRoot": "./", "module": "es2015", "moduleResolution": "node", "outDir": "../dist/out-tsc", "sourceMap": true, "target": "es5", - "typeRoots": [ - "../node_modules/@types" - ] + "typeRoots": ["../node_modules/@types"] } -} \ No newline at end of file +} diff --git a/examples/tslint.json b/examples/tslint.json index bb84fcf..86da053 100644 --- a/examples/tslint.json +++ b/examples/tslint.json @@ -1,45 +1,23 @@ { - "rulesDirectory": [ - "node_modules/codelyzer" - ], + "rulesDirectory": ["node_modules/codelyzer"], "rules": { "callable-types": true, "class-name": true, - "comment-format": [ - true, - "check-space" - ], + "comment-format": [true, "check-space"], "curly": true, "eofline": true, "forin": true, "import-blacklist": [true], "import-spacing": true, - "indent": [ - true, - "spaces" - ], + "indent": [true, "spaces"], "interface-over-type-literal": true, "label-position": true, - "max-line-length": [ - true, - 140 - ], + "max-line-length": [true, 140], "member-access": false, - "member-ordering": [ - true, - "static-before-instance", - "variables-before-functions" - ], + "member-ordering": [true, "static-before-instance", "variables-before-functions"], "no-arg": true, "no-bitwise": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], + "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], "no-construct": true, "no-debugger": true, "no-duplicate-variable": true, @@ -56,26 +34,12 @@ "no-use-before-declare": true, "no-var-keyword": true, "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], + "one-line": [true, "check-open-brace", "check-catch", "check-else", "check-whitespace"], "prefer-const": true, - "quotemark": [ - true, - "single" - ], + "quotemark": [true, "single"], "radix": true, - "semicolon": [ - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], + "semicolon": ["always"], + "triple-equals": [true, "allow-null-check"], "typedef-whitespace": [ true, { @@ -89,14 +53,7 @@ "typeof-compare": true, "unified-signatures": true, "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], + "whitespace": [true, "check-branch", "check-decl", "check-operator", "check-separator", "check-type"], "directive-selector": [true, "attribute", "app", "camelCase"], "component-selector": [true, "element", "app", "kebab-case"], diff --git a/karma.conf.js b/karma.conf.js index b9509cc..77f24d1 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,26 +1,26 @@ process.env.CHROME_BIN = require("puppeteer").executablePath(); -module.exports = function(config) { +module.exports = function (config) { config.set({ frameworks: ["jasmine", "karma-typescript"], files: ["src/**/*.ts"], preprocessors: { - "src/**/*.ts": "karma-typescript" + "src/**/*.ts": "karma-typescript", }, karmaTypescriptConfig: { include: ["src/**/*.ts"], compilerOptions: { - module: "commonjs" - } + module: "commonjs", + }, }, reporters: ["progress", "karma-typescript"], browsers: ["ChromeWithoutSecurity"], customLaunchers: { ChromeWithoutSecurity: { base: "ChromeHeadless", - flags: ["--no-sandbox", "--disable-setuid-sandbox"] - } + flags: ["--no-sandbox", "--disable-setuid-sandbox"], + }, }, - singleRun: true + singleRun: true, }); }; diff --git a/package.json b/package.json index 13d4625..c6d3720 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "test": "karma start", "test-watch": "karma start --no-single-run --auto-watch", "build": "ng-packagr -p package.json", - "lint": "eslint --fix 'src/**/*.ts'" + "lint": "tslint --project .", + "lint:fix": "tslint --fix --project .", + "format:fix": "prettier --write ." }, "repository": { "type": "git", @@ -39,21 +41,18 @@ "@angular/platform-browser-dynamic": "^8.2.14", "@types/jasmine": "3.5.0", "@types/node": "^13.1.2", - "@typescript-eslint/eslint-plugin": "^2.15.0", - "@typescript-eslint/parser": "^2.15.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.9.0", - "eslint-plugin-prettier": "^3.1.2", + "codelyzer": "^5.2.2", "jasmine-core": "3.5.0", "karma": "4.4.1", "karma-chrome-launcher": "3.1.0", "karma-jasmine": "2.0.1", "karma-typescript": "^4.1.1", "ng-packagr": "^5.7.1", - "prettier": "^1.19.1", + "prettier": "^2.0.4", "puppeteer": "^2.0.0", "rxjs": "^6.5.4", "tslib": "1.10.0", + "tslint": "~6.1.0", "typescript": "3.5.3", "zone.js": "^0.9.1" }, diff --git a/src/components/creditcard/creditcard-validators.spec.ts b/src/components/creditcard/creditcard-validators.spec.ts index d0178c1..497605f 100644 --- a/src/components/creditcard/creditcard-validators.spec.ts +++ b/src/components/creditcard/creditcard-validators.spec.ts @@ -1,14 +1,6 @@ import { CreditCardValidators } from "./creditcard-validators"; import { FormControl } from "@angular/forms"; -import { - americanexpress, - visa, - dinersclub, - discover, - jcb, - maestro, - mastercard -} from "./creditcards/creditcards"; +import { americanexpress, visa, dinersclub, discover, jcb, maestro, mastercard } from "./creditcards/creditcards"; describe("CreditCardValidators", () => { describe("creditcard", () => { @@ -19,7 +11,7 @@ describe("CreditCardValidators", () => { }); it("should work for creditcard number (americanExpress)", () => { - americanexpress.forEach(element => { + americanexpress.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.isCreditCard(control); expect(validated).toBeUndefined(); @@ -27,7 +19,7 @@ describe("CreditCardValidators", () => { }); it("should work for creditcard number (visa)", () => { - visa.forEach(element => { + visa.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.isCreditCard(control); expect(validated).toBeUndefined(); @@ -35,7 +27,7 @@ describe("CreditCardValidators", () => { }); it("should work for creditcard number (dinersclub)", () => { - dinersclub.forEach(element => { + dinersclub.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.isCreditCard(control); expect(validated).toBeUndefined(); @@ -43,7 +35,7 @@ describe("CreditCardValidators", () => { }); it("should work for creditcard number (discover)", () => { - discover.forEach(element => { + discover.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.isCreditCard(control); expect(validated).toBeUndefined(); @@ -51,7 +43,7 @@ describe("CreditCardValidators", () => { }); it("should work for creditcard number (jcb)", () => { - jcb.forEach(element => { + jcb.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.isCreditCard(control); expect(validated).toBeUndefined(); @@ -59,7 +51,7 @@ describe("CreditCardValidators", () => { }); it("should work for creditcard number (maestro)", () => { - maestro.forEach(element => { + maestro.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.isCreditCard(control); expect(validated).toBeUndefined(); @@ -67,7 +59,7 @@ describe("CreditCardValidators", () => { }); it("should work for creditcard number (mastercard)", () => { - mastercard.forEach(element => { + mastercard.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.isCreditCard(control); expect(validated).toBeUndefined(); @@ -101,7 +93,7 @@ describe("CreditCardValidators", () => { }); it("should work for americanExpress number", () => { - americanexpress.forEach(element => { + americanexpress.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.americanExpress(control); expect(validated).toBeUndefined(); @@ -135,7 +127,7 @@ describe("CreditCardValidators", () => { }); it("should work for visa number", () => { - visa.forEach(element => { + visa.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.visa(control); expect(validated).toBeUndefined(); @@ -169,7 +161,7 @@ describe("CreditCardValidators", () => { }); it("should work for dinersclub number", () => { - dinersclub.forEach(element => { + dinersclub.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.dinersclub(control); expect(validated).toBeUndefined(); @@ -203,7 +195,7 @@ describe("CreditCardValidators", () => { }); it("should work for discover number", () => { - discover.forEach(element => { + discover.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.discover(control); expect(validated).toBeUndefined(); @@ -237,7 +229,7 @@ describe("CreditCardValidators", () => { }); it("should work for jcb number", () => { - jcb.forEach(element => { + jcb.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.jcb(control); expect(validated).toBeUndefined(); @@ -271,7 +263,7 @@ describe("CreditCardValidators", () => { }); it("should work for maestro number", () => { - maestro.forEach(element => { + maestro.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.maestro(control); expect(validated).toBeUndefined(); @@ -305,7 +297,7 @@ describe("CreditCardValidators", () => { }); it("should work for mastercard number", () => { - mastercard.forEach(element => { + mastercard.forEach((element) => { const control: FormControl = new FormControl(element); const validated = CreditCardValidators.mastercard(control); expect(validated).toBeUndefined(); diff --git a/src/components/creditcard/creditcard-validators.ts b/src/components/creditcard/creditcard-validators.ts index cc90d20..42b4bad 100644 --- a/src/components/creditcard/creditcard-validators.ts +++ b/src/components/creditcard/creditcard-validators.ts @@ -7,13 +7,10 @@ const maestroRegex = "^(?:(?:5[0678]\\d\\d|6304|6390|67\\d\\d)\\d{8,15})$"; const jcbRegex = "^(?:(?:2131|1800|35\\d{3})\\d{11})$"; const discoverRegex = "^(?:6(?:011|5[0-9]{2})(?:[0-9]{12}))$"; const dinersclubRegex = "^(?:3(?:0[0-5]|[68][0-9])[0-9]{11})$"; -const mastercardRegex = - "^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$"; +const mastercardRegex = "^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$"; export class CreditCardValidators { - public static isCreditCard( - control: AbstractControl - ): { [key: string]: boolean } { + public static isCreditCard(control: AbstractControl): { [key: string]: boolean } { if (AbstractControlUtil.isNotPresent(control)) return undefined; if ( new RegExp( @@ -37,9 +34,7 @@ export class CreditCardValidators { return { creditcard: true }; } - public static americanExpress( - control: AbstractControl - ): { [key: string]: boolean } { + public static americanExpress(control: AbstractControl): { [key: string]: boolean } { if (AbstractControlUtil.isNotPresent(control)) return undefined; if (new RegExp(americanExpressRegex).test(control.value)) { return undefined; @@ -47,9 +42,7 @@ export class CreditCardValidators { return { americanExpress: true }; } - public static dinersclub( - control: AbstractControl - ): { [key: string]: boolean } { + public static dinersclub(control: AbstractControl): { [key: string]: boolean } { if (AbstractControlUtil.isNotPresent(control)) return undefined; if (new RegExp(dinersclubRegex).test(control.value)) { return undefined; @@ -79,9 +72,7 @@ export class CreditCardValidators { return { maestro: true }; } - public static mastercard( - control: AbstractControl - ): { [key: string]: boolean } { + public static mastercard(control: AbstractControl): { [key: string]: boolean } { if (AbstractControlUtil.isNotPresent(control)) return undefined; if (new RegExp(mastercardRegex).test(control.value)) { return undefined; diff --git a/src/components/creditcard/creditcards/americanexpress.ts b/src/components/creditcard/creditcards/americanexpress.ts index 2d42fa7..30ff1d1 100644 --- a/src/components/creditcard/creditcards/americanexpress.ts +++ b/src/components/creditcard/creditcards/americanexpress.ts @@ -98,5 +98,5 @@ export const americanexpress = [ "370586993845650", "344566883297843", "379811393604866", - "378167408666270" + "378167408666270", ]; diff --git a/src/components/creditcard/creditcards/dinersclub.ts b/src/components/creditcard/creditcards/dinersclub.ts index 5598436..73fa49c 100644 --- a/src/components/creditcard/creditcards/dinersclub.ts +++ b/src/components/creditcard/creditcards/dinersclub.ts @@ -98,5 +98,5 @@ export const dinersclub = [ "30324306195536", "30042294360918", "30365910478776", - "36695601420305" + "36695601420305", ]; diff --git a/src/components/creditcard/creditcards/discover.ts b/src/components/creditcard/creditcards/discover.ts index ee2e2a1..3580859 100644 --- a/src/components/creditcard/creditcards/discover.ts +++ b/src/components/creditcard/creditcards/discover.ts @@ -98,5 +98,5 @@ export const discover = [ "6011952623931470", "6011702594478120", "6011465651608985", - "6011447020500978" + "6011447020500978", ]; diff --git a/src/components/creditcard/creditcards/jcb.ts b/src/components/creditcard/creditcards/jcb.ts index dd4430b..b1a1600 100644 --- a/src/components/creditcard/creditcards/jcb.ts +++ b/src/components/creditcard/creditcards/jcb.ts @@ -98,5 +98,5 @@ export const jcb = [ "3511235128236716", "3587718314676794", "3500278409448074", - "3509173789871493" + "3509173789871493", ]; diff --git a/src/components/creditcard/creditcards/maestro.ts b/src/components/creditcard/creditcards/maestro.ts index 72f1fd8..1cef976 100644 --- a/src/components/creditcard/creditcards/maestro.ts +++ b/src/components/creditcard/creditcards/maestro.ts @@ -98,5 +98,5 @@ export const maestro = [ "502047309748386", "67633006740009700", "63041344891195", - "5018493270581155000" + "5018493270581155000", ]; diff --git a/src/components/creditcard/creditcards/mastercard.ts b/src/components/creditcard/creditcards/mastercard.ts index 931ba5b..fe83504 100644 --- a/src/components/creditcard/creditcards/mastercard.ts +++ b/src/components/creditcard/creditcards/mastercard.ts @@ -102,5 +102,5 @@ export const mastercard = [ "5206047820883843", "5337127009619341", "5371220244253435", - "5495177150592373" + "5495177150592373", ]; diff --git a/src/components/creditcard/creditcards/visa.ts b/src/components/creditcard/creditcards/visa.ts index 915abe6..07dea14 100644 --- a/src/components/creditcard/creditcards/visa.ts +++ b/src/components/creditcard/creditcards/visa.ts @@ -198,5 +198,5 @@ export const visa = [ "4716919304110", "4716357073581", "4916699504323", - "4916505486228" + "4916505486228", ]; diff --git a/src/components/email/email-util.spec.ts b/src/components/email/email-util.spec.ts index 5163285..0fca1dc 100644 --- a/src/components/email/email-util.spec.ts +++ b/src/components/email/email-util.spec.ts @@ -40,8 +40,8 @@ describe("Email util service", () => { topLevelDomain: "com", secondLevelDomain: "example", domain: "example.com", - address: "prettyandsimple" - } + address: "prettyandsimple", + }, }, { test: "very.common@example.com", @@ -49,8 +49,8 @@ describe("Email util service", () => { topLevelDomain: "com", secondLevelDomain: "example", domain: "example.com", - address: "very.common" - } + address: "very.common", + }, }, { test: "disposable.style.email.with+symbol@example.com", @@ -58,8 +58,8 @@ describe("Email util service", () => { topLevelDomain: "com", secondLevelDomain: "example", domain: "example.com", - address: "disposable.style.email.with+symbol" - } + address: "disposable.style.email.with+symbol", + }, }, { test: "other.email-with-dash@example.com", @@ -67,8 +67,8 @@ describe("Email util service", () => { topLevelDomain: "com", secondLevelDomain: "example", domain: "example.com", - address: "other.email-with-dash" - } + address: "other.email-with-dash", + }, }, { test: "example@s.solutions", @@ -76,8 +76,8 @@ describe("Email util service", () => { topLevelDomain: "solutions", secondLevelDomain: "s", domain: "s.solutions", - address: "example" - } + address: "example", + }, }, { test: "example-indeed@strange-example.com", @@ -85,19 +85,17 @@ describe("Email util service", () => { topLevelDomain: "com", secondLevelDomain: "strange-example", domain: "strange-example.com", - address: "example-indeed" - } + address: "example-indeed", + }, }, { - test: - '"()<>[]:;@,\\"!#$%&\'*+-/=?^_`{}| ~ ? ^_`{}|~.a"@allthesymbols.com', + test: "\"()<>[]:;@,\\\"!#$%&'*+-/=?^_`{}| ~ ? ^_`{}|~.a\"@allthesymbols.com", result: { topLevelDomain: "com", secondLevelDomain: "allthesymbols", domain: "allthesymbols.com", - address: - '"()<>[]:;@,\\"!#$%&\'*+-/=?^_`{}| ~ ? ^_`{}|~.a"' - } + address: "\"()<>[]:;@,\\\"!#$%&'*+-/=?^_`{}| ~ ? ^_`{}|~.a\"", + }, }, { test: "postbox@com", @@ -105,17 +103,17 @@ describe("Email util service", () => { topLevelDomain: "com", secondLevelDomain: "", domain: "com", - address: "postbox" - } + address: "postbox", + }, }, { - test: '"foo@bar"@example.com', + test: "\"foo@bar\"@example.com", result: { topLevelDomain: "com", secondLevelDomain: "example", domain: "example.com", - address: '"foo@bar"' - } + address: "\"foo@bar\"", + }, }, { test: "test@mail.randomsmallcompany.co.uk", @@ -123,37 +121,37 @@ describe("Email util service", () => { topLevelDomain: "randomsmallcompany.co.uk", secondLevelDomain: "mail", domain: "mail.randomsmallcompany.co.uk", - address: "test" - } + address: "test", + }, }, { - test: '"contains.and.@.symbols.com"@example.com', + test: "\"contains.and.@.symbols.com\"@example.com", result: { topLevelDomain: "com", secondLevelDomain: "example", domain: "example.com", - address: '"contains.and.@.symbols.com"' - } + address: "\"contains.and.@.symbols.com\"", + }, }, { test: "example-indeed-broken-strange-example.com", - result: undefined + result: undefined, }, { test: "@", - result: undefined + result: undefined, }, { test: "email@", - result: undefined + result: undefined, }, { test: "@example.com", - result: undefined - } + result: undefined, + }, ]; - mail.forEach(element => { + mail.forEach((element) => { const result = emailSuggestion.splitEmail(element.test); expect(result).toEqual(element.result); }); @@ -192,7 +190,7 @@ describe("Email util service", () => { const options: EmailOptions = { domains: ["gmail.com"], secondLevelDomains: ["gmail"], - topLevelDomains: ["com"] + topLevelDomains: ["com"], }; testSuggestion("gmailc.om", "gmail.com", options); }); @@ -201,7 +199,7 @@ describe("Email util service", () => { const options: EmailOptions = { domains: ["gmail.com"], secondLevelDomains: [], - topLevelDomains: [] + topLevelDomains: [], }; testSuggestion("gmailc.om", "gmail.com", options); }); diff --git a/src/components/email/email-util.ts b/src/components/email/email-util.ts index c1e5334..ff1da96 100644 --- a/src/components/email/email-util.ts +++ b/src/components/email/email-util.ts @@ -66,7 +66,7 @@ export class EmailSuggestion { "me.com", "btinternet.com", "charter.net", - "shaw.ca" + "shaw.ca", ], secondLevelDomains: ["yahoo", "hotmail", "mail", "live", "outlook", "gmx"], topLevelDomains: [ @@ -110,16 +110,13 @@ export class EmailSuggestion { "co.jp", "sg", "hu", - "uk" - ] + "uk", + ], }; - public suggest( - email: string, - options?: EmailOptions - ): { [key: string]: Suggestion } { + public suggest(email: string, options?: EmailOptions): { [key: string]: Suggestion } { let opt = this.defaultOptions; - if (options != undefined) { + if (options !== undefined) { opt = options; } const emailParts = this.splitEmail(email.toLowerCase()); @@ -138,13 +135,9 @@ export class EmailSuggestion { } } - let closestDomain = this.findClosestDomain( - emailParts.domain, - opt.domains, - 2 - ); + let closestDomain = this.findClosestDomain(emailParts.domain, opt.domains, 2); if (closestDomain) { - if (closestDomain == emailParts.domain) { + if (closestDomain === emailParts.domain) { // The email address exactly matches one of the supplied domains; do not return a suggestion. return undefined; } else { @@ -153,49 +146,32 @@ export class EmailSuggestion { suggestion: { address: emailParts.address, domain: closestDomain, - full: emailParts.address + "@" + closestDomain - } + full: emailParts.address + "@" + closestDomain, + }, }; } } - const closestSecondLevelDomain = this.findClosestDomain( - emailParts.secondLevelDomain, - opt.secondLevelDomains, - 2 - ); - const closestTopLevelDomain = this.findClosestDomain( - emailParts.topLevelDomain, - opt.topLevelDomains, - 2 - ); + const closestSecondLevelDomain = this.findClosestDomain(emailParts.secondLevelDomain, opt.secondLevelDomains, 2); + const closestTopLevelDomain = this.findClosestDomain(emailParts.topLevelDomain, opt.topLevelDomains, 2); if (emailParts.domain) { closestDomain = emailParts.domain; let rtrn = false; - if ( - closestSecondLevelDomain && - closestSecondLevelDomain != emailParts.secondLevelDomain - ) { + if (closestSecondLevelDomain && closestSecondLevelDomain !== emailParts.secondLevelDomain) { // The email address may have a mispelled second-level domain; return a suggestion - closestDomain = closestDomain.replace( - emailParts.secondLevelDomain, - closestSecondLevelDomain - ); + closestDomain = closestDomain.replace(emailParts.secondLevelDomain, closestSecondLevelDomain); rtrn = true; } if ( closestTopLevelDomain && - closestTopLevelDomain != emailParts.topLevelDomain && + closestTopLevelDomain !== emailParts.topLevelDomain && emailParts.secondLevelDomain !== "" ) { // The email address may have a mispelled top-level domain; return a suggestion - closestDomain = closestDomain.replace( - new RegExp(emailParts.topLevelDomain + "$"), - closestTopLevelDomain - ); + closestDomain = closestDomain.replace(new RegExp(emailParts.topLevelDomain + "$"), closestTopLevelDomain); rtrn = true; } @@ -204,8 +180,8 @@ export class EmailSuggestion { suggestion: { address: emailParts.address, domain: closestDomain, - full: emailParts.address + "@" + closestDomain - } + full: emailParts.address + "@" + closestDomain, + }, }; } } @@ -224,6 +200,7 @@ export class EmailSuggestion { return undefined; } + // tslint:disable-next-line: prefer-for-of for (let i = 0; i < parts.length; i++) { if (parts[i] === "") { return undefined; @@ -234,14 +211,14 @@ export class EmailSuggestion { topLevelDomain: "", secondLevelDomain: "", domain: parts.pop(), - address: "" + address: "", }; const domainParts = result.domain.split("."); if (domainParts.length === 0) { return undefined; - } else if (domainParts.length == 1) { + } else if (domainParts.length === 1) { result.topLevelDomain = domainParts[0]; } else { // The address has a domain and a top-level domain @@ -249,10 +226,7 @@ export class EmailSuggestion { for (let j = 1; j < domainParts.length; j++) { result.topLevelDomain += domainParts[j] + "."; } - result.topLevelDomain = result.topLevelDomain.substring( - 0, - result.topLevelDomain.length - 1 - ); + result.topLevelDomain = result.topLevelDomain.substring(0, result.topLevelDomain.length - 1); } result.address = parts.join("@"); @@ -260,11 +234,7 @@ export class EmailSuggestion { return result; } - private findClosestDomain( - domain: string, - domains: string[], - threshold: number - ): string { + private findClosestDomain(domain: string, domains: string[], threshold: number): string { let dist; let minDist = Infinity; let closestDomain = null; @@ -273,6 +243,7 @@ export class EmailSuggestion { return undefined; } + // tslint:disable-next-line: prefer-for-of for (let i = 0; i < domains.length; i++) { if (domain === domains[i]) { return domain; @@ -294,7 +265,7 @@ export class EmailSuggestion { private sift4Distance(s1: string, s2: string, maxOffset: number): number { // sift4: https://siderite.blogspot.com/2014/11/super-fast-and-accurate-string-distance.html if (maxOffset === undefined) { - maxOffset = 5; //default + maxOffset = 5; // default } if (!s1 || !s1.length) { @@ -311,18 +282,18 @@ export class EmailSuggestion { const l1 = s1.length; const l2 = s2.length; - let c1 = 0; //cursor for string 1 - let c2 = 0; //cursor for string 2 - let lcss = 0; //largest common subsequence - let localCS = 0; //local common substring - let trans = 0; //number of transpositions ('ab' vs 'ba') - const offsetArr: Offset[] = []; //offset pair array, for computing the transpositions + let c1 = 0; // cursor for string 1 + let c2 = 0; // cursor for string 2 + let lcss = 0; // largest common subsequence + let localCS = 0; // local common substring + let trans = 0; // number of transpositions ('ab' vs 'ba') + const offsetArr: Offset[] = []; // offset pair array, for computing the transpositions while (c1 < l1 && c2 < l2) { - if (s1.charAt(c1) == s2.charAt(c2)) { + if (s1.charAt(c1) === s2.charAt(c2)) { localCS++; let isTrans = false; - //see if current match is a transposition + // see if current match is a transposition let i = 0; while (i < offsetArr.length) { const ofs = offsetArr[i]; @@ -347,25 +318,25 @@ export class EmailSuggestion { } } offsetArr.push({ - c1: c1, - c2: c2, - trans: isTrans + c1, + c2, + trans: isTrans, }); } else { lcss += localCS; localCS = 0; - if (c1 != c2) { - c1 = c2 = Math.min(c1, c2); //using min allows the computation of transpositions + if (c1 !== c2) { + c1 = c2 = Math.min(c1, c2); // using min allows the computation of transpositions } - //if matching characters are found, remove 1 from both cursors (they get incremented at the end of the loop) - //so that we can have only one code block handling matches + // if matching characters are found, remove 1 from both cursors (they get incremented at the end of the loop) + // so that we can have only one code block handling matches for (let j = 0; j < maxOffset && (c1 + j < l1 || c2 + j < l2); j++) { - if (c1 + j < l1 && s1.charAt(c1 + j) == s2.charAt(c2)) { + if (c1 + j < l1 && s1.charAt(c1 + j) === s2.charAt(c2)) { c1 += j - 1; c2--; break; } - if (c2 + j < l2 && s1.charAt(c1) == s2.charAt(c2 + j)) { + if (c2 + j < l2 && s1.charAt(c1) === s2.charAt(c2 + j)) { c1--; c2 += j - 1; break; @@ -382,6 +353,6 @@ export class EmailSuggestion { } } lcss += localCS; - return Math.round(Math.max(l1, l2) - lcss + trans); //add the cost of transpositions to the final result + return Math.round(Math.max(l1, l2) - lcss + trans); // add the cost of transpositions to the final result } } diff --git a/src/components/email/email-validators.spec.ts b/src/components/email/email-validators.spec.ts index 44801f9..153b7c1 100644 --- a/src/components/email/email-validators.spec.ts +++ b/src/components/email/email-validators.spec.ts @@ -17,10 +17,10 @@ describe("Email validators service", () => { "other.email-with-dash@example.com", "x@example.com", "example@s.solutions", - "example-indeed@strange-example.com" + "example-indeed@strange-example.com", ]; - mail.forEach(element => { + mail.forEach((element) => { const control: FormControl = new FormControl(element); const validated = EmailValidators.simple(control); expect(validated).toBeUndefined(); @@ -29,12 +29,12 @@ describe("Email validators service", () => { it("should work for invalid email", () => { const invalidEmail = [ - "Abc.example.com" + "Abc.example.com", // 'A@b@c@example.com', // 'john.doe@example..com', // 'john..doe@example.com', ]; - invalidEmail.forEach(element => { + invalidEmail.forEach((element) => { const control: FormControl = new FormControl(element); const validated = EmailValidators.simple(control); expect(validated).toEqual({ simpleEmailRule: true }); @@ -57,10 +57,10 @@ describe("Email validators service", () => { "other.email-with-dash@example.com", "x@example.com", "example@s.solutions", - "example-indeed@strange-example.com" + "example-indeed@strange-example.com", ]; - mail.forEach(element => { + mail.forEach((element) => { const control: FormControl = new FormControl(element); const validated = EmailValidators.normal(control); expect(validated).toBeUndefined(); @@ -74,9 +74,9 @@ describe("Email validators service", () => { "john.doe@example..com", "john.doe123456789012345678901234567890123456789012345678901234567890@example..com", "john.doe@123456789012345678901234567890123456789012345678901234567890example..com", - "prett[~]yandsimple@example.com" + "prett[~]yandsimple@example.com", ]; - invalidEmail.forEach(element => { + invalidEmail.forEach((element) => { const control: FormControl = new FormControl(element); const validated = EmailValidators.normal(control); expect(validated).toEqual({ normalEmailRule: true }); diff --git a/src/components/equal-to/equal-to-validator.spec.ts b/src/components/equal-to/equal-to-validator.spec.ts index ba66241..3528228 100644 --- a/src/components/equal-to/equal-to-validator.spec.ts +++ b/src/components/equal-to/equal-to-validator.spec.ts @@ -1,7 +1,7 @@ import { FormControl, FormGroup } from "@angular/forms"; import { EqualToValidator } from "./equal-to-validator"; -describe("EqualTo Validator Test", function() { +describe("EqualTo Validator Test", () => { describe("equalTo", () => { it("should not show error when both values are empty", () => { const password: FormControl = new FormControl(""); @@ -9,7 +9,7 @@ describe("EqualTo Validator Test", function() { const form = new FormGroup( { newPassword: password, - confirmPassword: confirmPassword + confirmPassword, }, EqualToValidator.equalTo("newPassword", "confirmPassword") ); @@ -24,7 +24,7 @@ describe("EqualTo Validator Test", function() { const form = new FormGroup( { newPassword: password, - confirmPassword: confirmPassword + confirmPassword, }, EqualToValidator.equalTo("newPassword", "confirmPassword") ); @@ -39,7 +39,7 @@ describe("EqualTo Validator Test", function() { const form = new FormGroup( { newPassword: password, - confirmPassword: confirmPassword + confirmPassword, }, EqualToValidator.equalTo("newPassword", "confirmPassword") ); diff --git a/src/components/password/password-validators.spec.ts b/src/components/password/password-validators.spec.ts index 7314a4f..833bf5f 100644 --- a/src/components/password/password-validators.spec.ts +++ b/src/components/password/password-validators.spec.ts @@ -17,14 +17,14 @@ describe("Password validators service", () => { const control: FormControl = new FormControl("aaabbbbccc"); const validated = PasswordValidators.repeatCharacterRegexRule(4)(control); expect(validated).toEqual({ - repeatCharacterRegexRule: { repeatCount: 4 } + repeatCharacterRegexRule: { repeatCount: 4 }, }); }); it("should work for invalid password with length 9", () => { const control: FormControl = new FormControl("aaabbbbbbbbbccc"); const validated = PasswordValidators.repeatCharacterRegexRule(4)(control); expect(validated).toEqual({ - repeatCharacterRegexRule: { repeatCount: 4 } + repeatCharacterRegexRule: { repeatCount: 4 }, }); }); it("should work for valid password with length 9", () => { @@ -38,44 +38,36 @@ describe("Password validators service", () => { it("should work for empty control", () => { const control: FormControl = new FormControl(""); const allowedCharacter: string[] = ["a", "b", "c"]; - const validated = PasswordValidators.allowedCharacterRule( - allowedCharacter - )(control); + const validated = PasswordValidators.allowedCharacterRule(allowedCharacter)(control); expect(validated).toBeUndefined(); }); it("should work for valid password", () => { const control: FormControl = new FormControl("aaabbbccc"); const allowedCharacter: string[] = ["a", "b", "c"]; - const validated = PasswordValidators.allowedCharacterRule( - allowedCharacter - )(control); + const validated = PasswordValidators.allowedCharacterRule(allowedCharacter)(control); expect(validated).toBeUndefined(); }); it("should work for invalid password with one wrong char", () => { const control: FormControl = new FormControl("aaabbbcccd"); const allowedCharacter: string[] = ["a", "b", "c"]; - const validated = PasswordValidators.allowedCharacterRule( - allowedCharacter - )(control); + const validated = PasswordValidators.allowedCharacterRule(allowedCharacter)(control); expect(validated).toEqual({ allowedCharacterRule: { invalidChars: ["d"], - allowedChars: ["a", "b", "c"] - } + allowedChars: ["a", "b", "c"], + }, }); }); it("should work for invalid password with multiple wrong char", () => { const control: FormControl = new FormControl("aaafb bbccc) d!"); const allowedCharacter: string[] = ["a", "b", "c"]; - const validated = PasswordValidators.allowedCharacterRule( - allowedCharacter - )(control); + const validated = PasswordValidators.allowedCharacterRule(allowedCharacter)(control); expect(validated).toEqual({ allowedCharacterRule: { invalidChars: ["f", " ", ")", "d", "!"], - allowedChars: ["a", "b", "c"] - } + allowedChars: ["a", "b", "c"], + }, }); }); }); @@ -83,26 +75,20 @@ describe("Password validators service", () => { describe("alphabeticalCharacterRule", () => { it("should work for empty control", () => { const control: FormControl = new FormControl(""); - const validated = PasswordValidators.alphabeticalCharacterRule(5)( - control - ); + const validated = PasswordValidators.alphabeticalCharacterRule(5)(control); expect(validated).toBeUndefined(); }); it("should work for valid password", () => { - const control: FormControl = new FormControl('aAa345b!bdDb"c cc76'); - const validated = PasswordValidators.alphabeticalCharacterRule(5)( - control - ); + const control: FormControl = new FormControl("aAa345b!bdDb\"c cc76"); + const validated = PasswordValidators.alphabeticalCharacterRule(5)(control); expect(validated).toBeUndefined(); }); it("should work for invalid password", () => { const control: FormControl = new FormControl("1234Abc!"); - const validated = PasswordValidators.alphabeticalCharacterRule(5)( - control - ); + const validated = PasswordValidators.alphabeticalCharacterRule(5)(control); expect(validated).toEqual({ - alphabeticalCharacterRule: { required: 5, actual: 3 } + alphabeticalCharacterRule: { required: 5, actual: 3 }, }); }); }); @@ -114,7 +100,7 @@ describe("Password validators service", () => { expect(validated).toBeUndefined(); }); it("should work for valid password", () => { - const control: FormControl = new FormControl('aAa345b!bdDb"c cc76'); + const control: FormControl = new FormControl("aAa345b!bdDb\"c cc76"); const validated = PasswordValidators.digitCharacterRule(5)(control); expect(validated).toBeUndefined(); }); @@ -123,7 +109,7 @@ describe("Password validators service", () => { const control: FormControl = new FormControl("1234Abc!"); const validated = PasswordValidators.digitCharacterRule(5)(control); expect(validated).toEqual({ - digitCharacterRule: { required: 5, actual: 4 } + digitCharacterRule: { required: 5, actual: 4 }, }); }); }); @@ -144,7 +130,7 @@ describe("Password validators service", () => { const control: FormControl = new FormControl("1234abcADc!"); const validated = PasswordValidators.lowercaseCharacterRule(5)(control); expect(validated).toEqual({ - lowercaseCharacterRule: { required: 5, actual: 4 } + lowercaseCharacterRule: { required: 5, actual: 4 }, }); }); }); @@ -165,7 +151,7 @@ describe("Password validators service", () => { const control: FormControl = new FormControl("1234abcAbc!"); const validated = PasswordValidators.uppercaseCharacterRule(5)(control); expect(validated).toEqual({ - uppercaseCharacterRule: { required: 5, actual: 1 } + uppercaseCharacterRule: { required: 5, actual: 1 }, }); }); }); @@ -177,7 +163,7 @@ describe("Password validators service", () => { const form = new FormGroup( { newPassword: password, - confirmPassword: confirmPassword + confirmPassword, }, PasswordValidators.mismatchedPasswords() ); @@ -191,7 +177,7 @@ describe("Password validators service", () => { const form = new FormGroup( { newPassword: password, - confirmPassword: confirmPassword + confirmPassword, }, PasswordValidators.mismatchedPasswords() ); @@ -205,7 +191,7 @@ describe("Password validators service", () => { const form = new FormGroup( { test: password, - test2: confirmPassword + test2: confirmPassword, }, PasswordValidators.mismatchedPasswords("test", "test2") ); @@ -219,14 +205,12 @@ describe("Password validators service", () => { const form = new FormGroup( { test: password, - test2: confirmPassword + test2: confirmPassword, }, PasswordValidators.mismatchedPasswords("test", "test2") ); form.updateValueAndValidity(); - expect( - confirmPassword.getError("mismatchedPasswords") - ).not.toBeUndefined(); + expect(confirmPassword.getError("mismatchedPasswords")).not.toBeUndefined(); }); it("should work for invalid password", () => { @@ -235,14 +219,12 @@ describe("Password validators service", () => { const form = new FormGroup( { newPassword: password, - confirmPassword: confirmPassword + confirmPassword, }, PasswordValidators.mismatchedPasswords() ); form.updateValueAndValidity(); - expect( - confirmPassword.getError("mismatchedPasswords") - ).not.toBeUndefined(); + expect(confirmPassword.getError("mismatchedPasswords")).not.toBeUndefined(); }); }); }); diff --git a/src/components/password/password-validators.ts b/src/components/password/password-validators.ts index 0de0026..88b2c0b 100644 --- a/src/components/password/password-validators.ts +++ b/src/components/password/password-validators.ts @@ -9,7 +9,7 @@ export class PasswordValidators { const repeatDec = repeatCount - 1; const pattern = "([^\\x00-\\x1F])\\1{" + repeatDec + "}"; if (control.value !== "" && new RegExp(pattern).test(control.value)) { - return { repeatCharacterRegexRule: { repeatCount: repeatCount } }; + return { repeatCharacterRegexRule: { repeatCount } }; } return undefined; }; @@ -34,9 +34,9 @@ export class PasswordValidators { if (!valid) { return { allowedCharacterRule: { - invalidChars: invalidChars, - allowedChars: allowedChars - } + invalidChars, + allowedChars, + }, }; } return undefined; @@ -57,8 +57,8 @@ export class PasswordValidators { return { alphabeticalCharacterRule: { required: amount, - actual: stripped.length - } + actual: stripped.length, + }, }; } return undefined; @@ -77,7 +77,7 @@ export class PasswordValidators { const stripped = value.replace(pattern, ""); if (stripped.length < amount) { return { - digitCharacterRule: { required: amount, actual: stripped.length } + digitCharacterRule: { required: amount, actual: stripped.length }, }; } return undefined; @@ -96,7 +96,7 @@ export class PasswordValidators { const stripped = value.replace(pattern, ""); if (stripped.length < amount) { return { - lowercaseCharacterRule: { required: amount, actual: stripped.length } + lowercaseCharacterRule: { required: amount, actual: stripped.length }, }; } return undefined; @@ -115,7 +115,7 @@ export class PasswordValidators { const stripped = value.replace(pattern, ""); if (stripped.length < amount) { return { - uppercaseCharacterRule: { required: amount, actual: stripped.length } + uppercaseCharacterRule: { required: amount, actual: stripped.length }, }; } return undefined; @@ -134,7 +134,7 @@ export class PasswordValidators { const stripped = value.replace(pattern, ""); if (stripped.length < amount) { return { - specialCharacterRule: { required: amount, actual: stripped.length } + specialCharacterRule: { required: amount, actual: stripped.length }, }; } return undefined; @@ -142,26 +142,15 @@ export class PasswordValidators { return validator; } - public static mismatchedPasswords( - passwordControlName?: string, - confirmPasswordControlName?: string - ): ValidatorFn { + public static mismatchedPasswords(passwordControlName?: string, confirmPasswordControlName?: string): ValidatorFn { const validator = (group: AbstractControl): ValidationErrors => { - const newPasswordValue = group.get( - passwordControlName ? passwordControlName : "newPassword" - ).value; + const newPasswordValue = group.get(passwordControlName ? passwordControlName : "newPassword").value; const newPasswordConfirmValue = group.get( - confirmPasswordControlName - ? confirmPasswordControlName - : "confirmPassword" + confirmPasswordControlName ? confirmPasswordControlName : "confirmPassword" ).value; if (newPasswordValue !== newPasswordConfirmValue) { AbstractControlUtil.addError( - group.get( - confirmPasswordControlName - ? confirmPasswordControlName - : "confirmPassword" - ), + group.get(confirmPasswordControlName ? confirmPasswordControlName : "confirmPassword"), "mismatchedPasswords", true ); @@ -169,11 +158,7 @@ export class PasswordValidators { return { mismatchedPasswords: true }; } else { AbstractControlUtil.removeError( - group.get( - confirmPasswordControlName - ? confirmPasswordControlName - : "confirmPassword" - ), + group.get(confirmPasswordControlName ? confirmPasswordControlName : "confirmPassword"), "mismatchedPasswords" ); } diff --git a/src/components/universal/universal-validators.spec.ts b/src/components/universal/universal-validators.spec.ts index 20e05a5..7c7c282 100644 --- a/src/components/universal/universal-validators.spec.ts +++ b/src/components/universal/universal-validators.spec.ts @@ -118,8 +118,8 @@ describe("Universal validators service", () => { rangeValueToSmall: { requiredMinValue: 5, requiredMaxValue: 10, - actual: "4" - } + actual: "4", + }, }); }); @@ -130,8 +130,8 @@ describe("Universal validators service", () => { rangeValueToBig: { requiredMinValue: 5, requiredMaxValue: 10, - actual: "11" - } + actual: "11", + }, }); }); @@ -153,7 +153,7 @@ describe("Universal validators service", () => { const control: FormControl = new FormControl("1"); const validated = UniversalValidators.minLength(3)(control); expect(validated).toEqual({ - minLength: { requiredMinLength: 3, actualLength: 1 } + minLength: { requiredMinLength: 3, actualLength: 1 }, }); }); @@ -181,7 +181,7 @@ describe("Universal validators service", () => { const control: FormControl = new FormControl("123"); const validated = UniversalValidators.maxLength(2)(control); expect(validated).toEqual({ - maxLength: { requiredMaxLength: 2, actualLength: 3 } + maxLength: { requiredMaxLength: 2, actualLength: 3 }, }); }); }); diff --git a/src/components/universal/universal-validators.ts b/src/components/universal/universal-validators.ts index 97e1749..9ac0097 100644 --- a/src/components/universal/universal-validators.ts +++ b/src/components/universal/universal-validators.ts @@ -2,9 +2,7 @@ import { AbstractControl, ValidatorFn, ValidationErrors } from "@angular/forms"; import { AbstractControlUtil } from "../abstract-control-util"; export class UniversalValidators { - public static noWhitespace( - control: AbstractControl - ): { [key: string]: boolean } { + public static noWhitespace(control: AbstractControl): { [key: string]: boolean } { if (AbstractControlUtil.isNotPresent(control)) return undefined; const pattern = "\\s"; if (new RegExp(pattern).test(control.value)) { @@ -13,9 +11,7 @@ export class UniversalValidators { return undefined; } - public static noEmptyString( - control: AbstractControl - ): { [key: string]: boolean } { + public static noEmptyString(control: AbstractControl): { [key: string]: boolean } { if (AbstractControlUtil.isNotPresent(control)) return undefined; if (control.value.trim().length === 0) { return { noEmptyString: true }; @@ -42,8 +38,8 @@ export class UniversalValidators { rangeValueToSmall: { requiredMinValue: minValue, requiredMaxValue: maxValue, - actual: control.value - } + actual: control.value, + }, }; } @@ -52,8 +48,8 @@ export class UniversalValidators { rangeValueToBig: { requiredMinValue: minValue, requiredMaxValue: maxValue, - actual: control.value - } + actual: control.value, + }, }; } else { return undefined; @@ -70,7 +66,7 @@ export class UniversalValidators { return undefined; } return { - minLength: { requiredMinLength: minLength, actualLength: value.length } + minLength: { requiredMinLength: minLength, actualLength: value.length }, }; }; return validator; @@ -84,7 +80,7 @@ export class UniversalValidators { return undefined; } return { - maxLength: { requiredMaxLength: maxLength, actualLength: value.length } + maxLength: { requiredMaxLength: maxLength, actualLength: value.length }, }; }; return validator; diff --git a/src/components/validators.module.ts b/src/components/validators.module.ts index 521d7e7..82ea435 100644 --- a/src/components/validators.module.ts +++ b/src/components/validators.module.ts @@ -4,15 +4,12 @@ import { IsNumberValidatorDirective, MaxValidatorDirective, MinValidatorDirective, - WhiteSpaceValidatorDirective + WhiteSpaceValidatorDirective, } from "./universal/universal.directive"; import { NgModule } from "@angular/core"; import { CreditCardValidatorDirective } from "./creditcard/creditcard.directive"; -import { - EmailValidatorDirective, - EmailSuggestValidatorDirective -} from "./email/email.directive"; +import { EmailValidatorDirective, EmailSuggestValidatorDirective } from "./email/email.directive"; import { PasswordValidatorDirective } from "./password/password.directive"; import { EqualToDirective } from "./equal-to/equal-to.directive"; @@ -28,7 +25,7 @@ import { EqualToDirective } from "./equal-to/equal-to.directive"; MinValidatorDirective, WhiteSpaceValidatorDirective, EmptyStringValidatorDirective, - EqualToDirective + EqualToDirective, ], exports: [ CreditCardValidatorDirective, @@ -41,7 +38,7 @@ import { EqualToDirective } from "./equal-to/equal-to.directive"; MinValidatorDirective, WhiteSpaceValidatorDirective, EmptyStringValidatorDirective, - EqualToDirective - ] + EqualToDirective, + ], }) export class ValidatorsModule {} diff --git a/src/public_api.ts b/src/public_api.ts index 1b2d97e..94ea070 100644 --- a/src/public_api.ts +++ b/src/public_api.ts @@ -5,28 +5,25 @@ export * from "./components/email/email-util"; export { UniversalValidators } from "./components/universal/universal-validators"; export { CreditCardValidators } from "./components/creditcard/creditcard-validators"; -//Directive +// Directive export { PasswordValidatorDirective } from "./components/password/password.directive"; -export { - EmailValidatorDirective, - EmailSuggestValidatorDirective -} from "./components/email/email.directive"; +export { EmailValidatorDirective, EmailSuggestValidatorDirective } from "./components/email/email.directive"; export { IsInRangeValidatorDirective, IsNumberValidatorDirective, MaxValidatorDirective, MinValidatorDirective, WhiteSpaceValidatorDirective, - EmptyStringValidatorDirective + EmptyStringValidatorDirective, } from "./components/universal/universal.directive"; export { CreditCardValidatorDirective } from "./components/creditcard/creditcard.directive"; -//Module +// Module export { ValidatorsModule } from "./components/validators.module"; // Util export { AbstractControlUtil } from "./components/abstract-control-util"; -//EqualTo +// EqualTo export * from "./components/equal-to/equal-to.directive"; export * from "./components/equal-to/equal-to-validator"; diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..3aaed88 --- /dev/null +++ b/tslint.json @@ -0,0 +1,50 @@ +{ + "extends": "tslint:recommended", + "rulesDirectory": ["codelyzer"], + "rules": { + "array-type": false, + "arrow-parens": false, + "deprecation": { + "severity": "warning" + }, + "import-blacklist": [true, "rxjs/Rx"], + "interface-name": false, + "max-classes-per-file": false, + "max-line-length": [true, 140], + "member-access": false, + "member-ordering": [ + true, + { + "order": ["static-field", "instance-field", "static-method", "instance-method"] + } + ], + "no-consecutive-blank-lines": false, + "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], + "no-empty": false, + "no-inferrable-types": [true, "ignore-params"], + "no-non-null-assertion": true, + "no-redundant-jsdoc": true, + "no-switch-case-fall-through": true, + "no-var-requires": false, + "object-literal-key-quotes": [true, "as-needed"], + "object-literal-sort-keys": false, + "ordered-imports": false, + "quotemark": [true, "double"], + "trailing-comma": false, + "component-class-suffix": true, + "contextual-lifecycle": true, + "directive-class-suffix": true, + "no-conflicting-lifecycle": true, + "no-host-metadata-property": true, + "no-input-rename": true, + "no-inputs-metadata-property": true, + "no-output-native": true, + "no-output-on-prefix": true, + "no-output-rename": true, + "no-outputs-metadata-property": true, + "template-banana-in-box": true, + "template-no-negated-async": true, + "use-lifecycle-interface": true, + "use-pipe-transform-interface": true + } +} diff --git a/yarn.lock b/yarn.lock index eaa48f9..dbb15b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -163,11 +163,6 @@ dependencies: defer-to-connect "^1.0.1" -"@types/eslint-visitor-keys@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" - integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - "@types/estree@*": version "0.0.42" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.42.tgz#8d0c1f480339efedb3e46070e22dd63e0430dd11" @@ -183,11 +178,6 @@ resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.5.0.tgz#2ad2006c8a937d20df20a8fee86071d0f730ef99" integrity sha512-kGCRI9oiCxFS6soGKlyzhMzDydfcPix9PpTkr7h11huxOxhWwP37Tg7DYBaQ18eQTNreZEuLkhpbGSqVNZPnnw== -"@types/json-schema@^7.0.3": - version "7.0.4" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" - integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== - "@types/node@*", "@types/node@^13.1.2": version "13.1.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.6.tgz#076028d0b0400be8105b89a0a55550c86684ffec" @@ -205,49 +195,6 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^2.12.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.15.0.tgz#5442c30b687ffd576ff74cfea46a6d7bfb0ee893" - integrity sha512-XRJFznI5v4K1WvIrWmjFjBAdQWaUTz4xJEdqR7+wAFsv6Q9dP3mOlE6BMNT3pdlp9eF1+bC5m5LZTmLMqffCVw== - dependencies: - "@typescript-eslint/experimental-utils" "2.15.0" - eslint-utils "^1.4.3" - functional-red-black-tree "^1.0.1" - regexpp "^3.0.0" - tsutils "^3.17.1" - -"@typescript-eslint/experimental-utils@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.15.0.tgz#41e35313bfaef91650ddb5380846d1c78a780070" - integrity sha512-Qkxu5zndY5hqlcQkmA88gfLvqQulMpX/TN91XC7OuXsRf4XG5xLGie0sbpX97o/oeccjeZYRMipIsjKk/tjDHA== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.15.0" - eslint-scope "^5.0.0" - -"@typescript-eslint/parser@^2.12.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.15.0.tgz#379a71a51b0429bc3bc55c5f8aab831bf607e411" - integrity sha512-6iSgQsqAYTaHw59t0tdjzZJluRAjswdGltzKEdLtcJOxR2UVTPHYvZRqkAVGCkaMVb6Fpa60NnuozNCvsSpA9g== - dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.15.0" - "@typescript-eslint/typescript-estree" "2.15.0" - eslint-visitor-keys "^1.1.0" - -"@typescript-eslint/typescript-estree@2.15.0": - version "2.15.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.15.0.tgz#79ae52eed8701b164d91e968a65d85a9105e76d3" - integrity sha512-L6Pog+w3VZzXkAdyqA0VlwybF8WcwZX+mufso86CMxSdWmcizJ38lgBdpqTbc9bo92iyi0rOvmATKiwl+amjxg== - dependencies: - debug "^4.1.1" - eslint-visitor-keys "^1.1.0" - glob "^7.1.6" - is-glob "^4.0.1" - lodash.unescape "4.0.1" - semver "^6.3.0" - tsutils "^3.17.1" - "@yarnpkg/lockfile@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" @@ -279,11 +226,6 @@ accepts@~1.3.4: mime-types "~2.1.24" negotiator "0.6.2" -acorn-jsx@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" - integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== - acorn-walk@^6.1.1: version "6.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" @@ -325,7 +267,7 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" -ajv@6.10.2, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: +ajv@6.10.2, ajv@^6.10.2, ajv@^6.5.5: version "6.10.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== @@ -386,7 +328,7 @@ ansi-regex@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -414,6 +356,11 @@ anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +app-root-path@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.2.1.tgz#d0df4a682ee408273583d43f6f79e9892624bc9a" + integrity sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA== + aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -426,6 +373,14 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +aria-query@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" + integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w= + dependencies: + ast-types-flow "0.0.7" + commander "^2.11.0" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -497,10 +452,10 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +ast-types-flow@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= async-each@^1.0.1: version "1.0.3" @@ -562,6 +517,13 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c" integrity sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A== +axobject-query@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" + integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== + dependencies: + ast-types-flow "0.0.7" + backo2@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" @@ -823,6 +785,11 @@ buffer@^5.2.1: base64-js "^1.0.2" ieee754 "^1.1.4" +builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + builtin-modules@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" @@ -897,11 +864,6 @@ callsite@1.0.0: resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -935,7 +897,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1066,6 +1028,21 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= +codelyzer@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-5.2.2.tgz#d0530a455784e6bea0b6d7e97166c73c30a5347f" + integrity sha512-jB4FZ1Sx7kZhvZVdf+N2BaKTdrrNZOL0Bj10RRfrhHrb3zEvXjJvvq298JPMJAiyiCS/v4zs1QlGU0ip7xGqeA== + dependencies: + app-root-path "^2.2.1" + aria-query "^3.0.0" + axobject-query "2.0.2" + css-selector-tokenizer "^0.7.1" + cssauron "^1.4.0" + damerau-levenshtein "^1.0.4" + semver-dsl "^1.0.1" + source-map "^0.5.7" + sprintf-js "^1.1.2" + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -1108,7 +1085,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.20.0, commander@~2.20.3: +commander@^2.11.0, commander@^2.12.1, commander@^2.20.0, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -1269,7 +1246,7 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^6.0.0, cross-spawn@^6.0.5: +cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== @@ -1309,6 +1286,15 @@ css-parse@~2.0.0: dependencies: css "^2.0.0" +css-selector-tokenizer@^0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.2.tgz#11e5e27c9a48d90284f22d45061c303d7a25ad87" + integrity sha512-yj856NGuAymN6r8bn8/Jl46pR+OC3eEvAhfGYDUe7YPtTPAYrSSw4oAniZ9Y8T5B92hjhwTBLUen0/vKPxf6pw== + dependencies: + cssesc "^3.0.0" + fastparse "^1.1.2" + regexpu-core "^4.6.0" + css@^2.0.0: version "2.2.4" resolved "https://registry.yarnpkg.com/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929" @@ -1319,6 +1305,18 @@ css@^2.0.0: source-map-resolve "^0.5.2" urix "^0.1.0" +cssauron@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/cssauron/-/cssauron-1.4.0.tgz#a6602dff7e04a8306dc0db9a551e92e8b5662ad8" + integrity sha1-pmAt/34EqDBtwNuaVR6S6LVmKtg= + dependencies: + through X.X.X + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + cuint@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" @@ -1341,6 +1339,11 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= +damerau-levenshtein@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz#143c1641cb3d85c60c32329e26899adea8701791" + integrity sha512-JVrozIeElnj3QzfUIt8tB8YMluBJom4Vw9qTPpjGYQ9fYlB3D/rb6OordUxf3xeFB35LKWs0xqcO5U6ySvBtug== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1382,7 +1385,7 @@ debug@^3.0.0, debug@^3.1.0, debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: +debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -1512,13 +1515,6 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - dom-serialize@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" @@ -1745,92 +1741,6 @@ escodegen@1.8.x: optionalDependencies: source-map "~0.2.0" -eslint-config-prettier@^6.7.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.9.0.tgz#430d24822e82f7deb1e22a435bfa3999fae4ad64" - integrity sha512-k4E14HBtcLv0uqThaI6I/n1LEqROp8XaPu6SO9Z32u5NlGRC07Enu1Bh2KEFw4FNHbekH8yzbIU9kUGxbiGmCA== - dependencies: - get-stdin "^6.0.0" - -eslint-plugin-prettier@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" - integrity sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-scope@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" - integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-utils@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== - -eslint@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^7.0.0" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.3" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" - table "^5.2.3" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" - integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== - dependencies: - acorn "^7.1.0" - acorn-jsx "^5.1.0" - eslint-visitor-keys "^1.1.0" - esprima@2.7.x, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -1841,30 +1751,11 @@ esprima@^4.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== - dependencies: - estraverse "^4.1.0" - estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - estree-walker@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" @@ -2000,11 +1891,6 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - fast-json-stable-stringify@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -2020,6 +1906,11 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fastparse@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" + integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== + fd-slicer@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65" @@ -2039,13 +1930,6 @@ figures@^3.0.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - file-uri-to-path@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" @@ -2101,15 +1985,6 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - flatted@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" @@ -2222,11 +2097,6 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - genfun@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" @@ -2242,11 +2112,6 @@ get-stdin@^4.0.1: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -2286,7 +2151,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@^5.0.0, glob-parent@~5.1.0: +glob-parent@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== @@ -2304,7 +2169,7 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -2323,13 +2188,6 @@ global-dirs@^0.1.0: dependencies: ini "^1.3.4" -globals@^12.1.0: - version "12.3.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.3.0.tgz#1e564ee5c4dded2ab098b0f88f24702a3c56be13" - integrity sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw== - dependencies: - type-fest "^0.8.1" - got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -2575,24 +2433,11 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - image-size@~0.5.0: version "0.5.5" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" integrity sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w= -import-fresh@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" - integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" @@ -2674,25 +2519,6 @@ inquirer@6.5.1: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^7.0.0: - version "7.0.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.3.tgz#f9b4cd2dff58b9f73e8d43759436ace15bed4567" - integrity sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw== - dependencies: - ansi-escapes "^4.2.1" - chalk "^2.4.2" - cli-cursor "^3.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.15" - mute-stream "0.0.8" - run-async "^2.2.0" - rxjs "^6.5.3" - string-width "^4.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -3049,6 +2875,11 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + json-buffer@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" @@ -3069,11 +2900,6 @@ json-schema@0.2.3: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -3274,7 +3100,7 @@ less@^3.8.0: request "^2.83.0" source-map "~0.6.0" -levn@^0.3.0, levn@~0.3.0: +levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= @@ -3311,11 +3137,6 @@ lodash.memoize@~3.0.3: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= -lodash.unescape@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" - integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= - lodash@^4.17.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" @@ -3552,6 +3373,11 @@ minimist@^1.1.3, minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" @@ -3603,6 +3429,13 @@ mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.x: dependencies: minimist "0.0.8" +mkdirp@^0.5.3: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -3652,11 +3485,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -3972,7 +3800,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1, optionator@^0.8.3: +optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== @@ -4120,13 +3948,6 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - parse-asn1@^5.0.0: version "5.1.5" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" @@ -4329,17 +4150,10 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.4.tgz#2d1bae173e355996ee355ec9830a7a1ee05457ef" + integrity sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w== process-nextick-args@~2.0.0: version "2.0.1" @@ -4351,7 +4165,7 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress@^2.0.0, progress@^2.0.1: +progress@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -4658,6 +4472,18 @@ reflect-metadata@^0.1.2: resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== +regenerate-unicode-properties@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" + integrity sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA== + dependencies: + regenerate "^1.4.0" + +regenerate@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -4666,15 +4492,17 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -regexpp@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.0.0.tgz#dd63982ee3300e67b41c1956f850aa680d9d330e" - integrity sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g== +regexpu-core@^4.6.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.0.tgz#fcbf458c50431b0bb7b45d6967b8192d91f3d938" + integrity sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^8.2.0" + regjsgen "^0.5.1" + regjsparser "^0.6.4" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.2.0" registry-auth-token@^4.0.0: version "4.0.0" @@ -4691,6 +4519,18 @@ registry-url@^5.0.0: dependencies: rc "^1.2.8" +regjsgen@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.1.tgz#48f0bf1a5ea205196929c0d9798b42d1ed98443c" + integrity sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg== + +regjsparser@^0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.4.tgz#a769f8684308401a66e9b529d2436ff4d0666272" + integrity sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw== + dependencies: + jsesc "~0.5.0" + remap-istanbul@^0.13.0: version "0.13.0" resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.13.0.tgz#a529dfd080bb760f5274e3671c9c065f29923ed1" @@ -4765,11 +4605,6 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -4787,6 +4622,13 @@ resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1: dependencies: path-parse "^1.0.6" +resolve@^1.3.2: + version "1.16.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.16.1.tgz#49fac5d8bacf1fd53f200fa51247ae736175832c" + integrity sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig== + dependencies: + path-parse "^1.0.6" + responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -4817,13 +4659,6 @@ rfdc@^1.1.4: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" integrity sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug== -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - rimraf@3.0.0, rimraf@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.0.tgz#614176d4b3010b75e5c390eb0ee96f6dc0cebb9b" @@ -4920,7 +4755,7 @@ rxjs@6.4.0: dependencies: tslib "^1.9.0" -rxjs@^6.0.0, rxjs@^6.4.0, rxjs@^6.5.3, rxjs@^6.5.4: +rxjs@^6.0.0, rxjs@^6.4.0, rxjs@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c" integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q== @@ -4968,6 +4803,13 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" +semver-dsl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/semver-dsl/-/semver-dsl-1.0.1.tgz#d3678de5555e8a61f629eed025366ae5f27340a0" + integrity sha1-02eN5VVeimH2Ke7QJTZq5fJzQKA= + dependencies: + semver "^5.3.0" + semver-intersect@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/semver-intersect/-/semver-intersect-1.4.0.tgz#bdd9c06bedcdd2fedb8cd352c3c43ee8c61321f3" @@ -4975,12 +4817,12 @@ semver-intersect@1.4.0: dependencies: semver "^5.0.0" -"semver@2 || 3 || 4 || 5", semver@^5.0.0, semver@^5.0.3, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.0.0, semver@^5.0.3, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@6.3.0, semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: +semver@6.3.0, semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -5035,15 +4877,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - smart-buffer@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.1.0.tgz#91605c25d91652f4661ea69ccf45f1b331ca21ba" @@ -5175,7 +5008,7 @@ source-map@0.7.3, source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -source-map@^0.5.1, source-map@^0.5.6, source-map@~0.5.3: +source-map@^0.5.1, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -5225,6 +5058,11 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +sprintf-js@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" + integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -5386,7 +5224,7 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.1.0, strip-ansi@^5.2.0: +strip-ansi@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== @@ -5419,11 +5257,6 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" - integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== - strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -5469,16 +5302,6 @@ symbol-observable@1.2.0: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - tar@^4.4.8: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" @@ -5508,11 +5331,6 @@ terser@^4.1.2: source-map "~0.6.1" source-map-support "~0.5.12" -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - through2@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.0.tgz#468b461df9cd9fcc170f22ebf6852e467e578ff2" @@ -5529,7 +5347,7 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" -"through@>=2.2.7 <3", through@^2.3.6: +"through@>=2.2.7 <3", through@X.X.X, through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -5620,10 +5438,34 @@ tslib@1.10.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tsutils@^3.17.1: - version "3.17.1" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" - integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== +tslib@^1.10.0: + version "1.11.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" + integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== + +tslint@~6.1.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-6.1.1.tgz#ac03fbd17f85bfefaae348b353b25a88efe10cde" + integrity sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA== + dependencies: + "@babel/code-frame" "^7.0.0" + builtin-modules "^1.1.1" + chalk "^2.3.0" + commander "^2.12.1" + diff "^4.0.1" + glob "^7.1.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + mkdirp "^0.5.3" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.10.0" + tsutils "^2.29.0" + +tsutils@^2.29.0: + version "2.29.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" + integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== dependencies: tslib "^1.8.1" @@ -5697,6 +5539,29 @@ ultron@~1.1.0: resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== +unicode-canonical-property-names-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== + +unicode-match-property-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== + dependencies: + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" + +unicode-match-property-value-ecmascript@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" + integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== + +unicode-property-aliases-ecmascript@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" + integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== + union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -5851,11 +5716,6 @@ uuid@^3.0.0, uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== -v8-compile-cache@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" - integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== - validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -5953,13 +5813,6 @@ write-file-atomic@^2.0.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - ws@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" From 221fda2d786d106d1a9497ac291bb6785a3aeb0d Mon Sep 17 00:00:00 2001 From: Nightapes Date: Mon, 20 Apr 2020 21:44:31 +0200 Subject: [PATCH 2/2] fix(directives): don't trigger validation changed on the first ngOnChanges call --- examples/package-lock.json | 21 ---- examples/package.json | 2 +- .../creditcard/creditcard.directive.ts | 31 ++--- src/components/email/email.directive.ts | 44 +++---- src/components/equal-to/equal-to.directive.ts | 40 ++----- src/components/password/password.directive.ts | 86 +++++--------- .../universal/universal.directive.ts | 107 ++++++++---------- 7 files changed, 111 insertions(+), 220 deletions(-) delete mode 100644 examples/package-lock.json diff --git a/examples/package-lock.json b/examples/package-lock.json deleted file mode 100644 index 837e4e7..0000000 --- a/examples/package-lock.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "examples", - "version": "0.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ngx-highlightjs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ngx-highlightjs/-/ngx-highlightjs-2.1.1.tgz", - "integrity": "sha512-8LpImj51J8372Zztg/SHB5IznPVtujbW/Ner2KJOh1DjO7uph9jFt5AYdvtJrX9WeJ9Su+uuLlbjbSm2NgloKg==", - "requires": { - "tslib": "1.9.3" - } - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" - } - } -} diff --git a/examples/package.json b/examples/package.json index acdbef0..8667f0f 100644 --- a/examples/package.json +++ b/examples/package.json @@ -28,7 +28,7 @@ "core-js": "^2.4.1", "hammerjs": "^2.0.8", "ngx-highlightjs": "^2.1.1", - "ngx-validators": "5.2.0", + "ngx-validators": "file:../dist", "rxjs": "^6.2.2", "zone.js": "^0.8.5" }, diff --git a/src/components/creditcard/creditcard.directive.ts b/src/components/creditcard/creditcard.directive.ts index 8533c56..c89da73 100644 --- a/src/components/creditcard/creditcard.directive.ts +++ b/src/components/creditcard/creditcard.directive.ts @@ -1,33 +1,20 @@ -import { - Directive, - Input, - forwardRef, - OnInit, - SimpleChanges -} from "@angular/core"; -import { - NG_VALIDATORS, - Validator, - ValidatorFn, - AbstractControl, - ValidationErrors -} from "@angular/forms"; +import { Directive, Input, forwardRef, OnInit, SimpleChanges, OnChanges } from "@angular/core"; +import { NG_VALIDATORS, Validator, ValidatorFn, AbstractControl, ValidationErrors } from "@angular/forms"; import { CreditCardValidators } from "./creditcard-validators"; @Directive({ - selector: - "[creditCard][formControlName],[creditCard][formControl],[creditCard][ngModel]", + selector: "[creditCard][formControlName],[creditCard][formControl],[creditCard][ngModel]", providers: [ { provide: NG_VALIDATORS, // eslint-disable-next-line @typescript-eslint/no-use-before-define useExisting: forwardRef(() => CreditCardValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) -export class CreditCardValidatorDirective implements Validator, OnInit { +export class CreditCardValidatorDirective implements Validator, OnInit, OnChanges { @Input() creditCard = "all"; private validator: ValidatorFn; @@ -70,8 +57,8 @@ export class CreditCardValidatorDirective implements Validator, OnInit { } ngOnChanges(changes: SimpleChanges): void { - if (changes["creditCard"]) { - this.setCreditcardValidator(changes["creditCard"].currentValue); + if (changes.creditCard && !changes.creditCard.isFirstChange()) { + this.setCreditcardValidator(changes.creditCard.currentValue); this.onChange(); } } diff --git a/src/components/email/email.directive.ts b/src/components/email/email.directive.ts index a686685..e641e71 100644 --- a/src/components/email/email.directive.ts +++ b/src/components/email/email.directive.ts @@ -1,19 +1,6 @@ import { EmailOptions } from "./email-util"; -import { - Directive, - Input, - forwardRef, - OnInit, - OnChanges, - SimpleChanges -} from "@angular/core"; -import { - NG_VALIDATORS, - Validator, - ValidatorFn, - AbstractControl, - ValidationErrors -} from "@angular/forms"; +import { Directive, Input, forwardRef, OnInit, OnChanges, SimpleChanges } from "@angular/core"; +import { NG_VALIDATORS, Validator, ValidatorFn, AbstractControl, ValidationErrors } from "@angular/forms"; import { EmailValidators } from "./email-validators"; @@ -24,9 +11,9 @@ import { EmailValidators } from "./email-validators"; provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => EmailValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) export class EmailValidatorDirective implements Validator, OnInit, OnChanges { @Input() email: "normal" | "simple" = "normal"; @@ -53,8 +40,8 @@ export class EmailValidatorDirective implements Validator, OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes["email"]) { - this.setValidator(changes["email"].currentValue); + if (changes.email && !changes.email.isFirstChange()) { + this.setValidator(changes.email.currentValue); this.onChange(); } } @@ -69,18 +56,17 @@ export class EmailValidatorDirective implements Validator, OnInit, OnChanges { } @Directive({ - selector: - "[emailSuggest][formControlName],[emailSuggest][formControl],[emailSuggest][ngModel]", + selector: "[emailSuggest][formControlName],[emailSuggest][formControl],[emailSuggest][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => EmailSuggestValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) -export class EmailSuggestValidatorDirective implements Validator, OnInit { +export class EmailSuggestValidatorDirective implements Validator, OnInit, OnChanges { @Input() emailSuggest: EmailOptions; private validator: ValidatorFn; @@ -91,10 +77,8 @@ export class EmailSuggestValidatorDirective implements Validator, OnInit { } ngOnChanges(changes: SimpleChanges): void { - if (changes["emailSuggest"]) { - this.validator = EmailValidators.suggest( - changes["emailSuggest"].currentValue - ); + if (changes.emailSuggest && !changes.emailSuggest.isFirstChange()) { + this.validator = EmailValidators.suggest(changes.emailSuggest.currentValue); this.onChange(); } } diff --git a/src/components/equal-to/equal-to.directive.ts b/src/components/equal-to/equal-to.directive.ts index 5b7d533..6253099 100644 --- a/src/components/equal-to/equal-to.directive.ts +++ b/src/components/equal-to/equal-to.directive.ts @@ -1,31 +1,18 @@ -import { - Directive, - forwardRef, - Input, - OnDestroy, - SimpleChanges, - OnChanges -} from "@angular/core"; -import { - AbstractControl, - NG_VALIDATORS, - ValidationErrors, - Validator -} from "@angular/forms"; +import { Directive, forwardRef, Input, OnDestroy, SimpleChanges, OnChanges } from "@angular/core"; +import { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from "@angular/forms"; import { Subscription } from "rxjs"; import { delay } from "rxjs/operators"; @Directive({ - selector: - "[equalTo][ngModel], [equalTo][formControlName], [equalTo][formControl]", + selector: "[equalTo][ngModel], [equalTo][formControlName], [equalTo][formControl]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => EqualToDirective), - multi: true - } - ] + multi: true, + }, + ], }) export class EqualToDirective implements Validator, OnDestroy, OnChanges { @Input() equalTo: string | AbstractControl; @@ -34,17 +21,12 @@ export class EqualToDirective implements Validator, OnDestroy, OnChanges { private onChange: () => void; validate(c: AbstractControl): ValidationErrors | null { - const otherControl = - typeof this.equalTo === "string" - ? c.parent.get(this.equalTo) - : this.equalTo; + const otherControl = typeof this.equalTo === "string" ? c.parent.get(this.equalTo) : this.equalTo; if (!this.subscription) { - this.subscription = otherControl.valueChanges - .pipe(delay(1)) - .subscribe(() => { - c.updateValueAndValidity(); - }); + this.subscription = otherControl.valueChanges.pipe(delay(1)).subscribe(() => { + c.updateValueAndValidity(); + }); } return c.value !== otherControl.value ? { notEqualTo: true } : null; } @@ -54,7 +36,7 @@ export class EqualToDirective implements Validator, OnDestroy, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes["equalTo"]) { + if (changes.equalTo && !changes.equalTo.isFirstChange()) { this.onChange(); } } diff --git a/src/components/password/password.directive.ts b/src/components/password/password.directive.ts index 4b2d310..e79a99e 100644 --- a/src/components/password/password.directive.ts +++ b/src/components/password/password.directive.ts @@ -1,36 +1,20 @@ -import { - Directive, - Input, - forwardRef, - OnInit, - SimpleChanges, - OnChanges -} from "@angular/core"; -import { - NG_VALIDATORS, - Validator, - Validators, - ValidatorFn, - AbstractControl, - ValidationErrors -} from "@angular/forms"; +import { Directive, Input, forwardRef, OnInit, SimpleChanges, OnChanges } from "@angular/core"; +import { NG_VALIDATORS, Validator, Validators, ValidatorFn, AbstractControl, ValidationErrors } from "@angular/forms"; import { PasswordValidators } from "./password-validators"; @Directive({ - selector: - "[password][formControlName],[password][formControl],[password][ngModel]", + selector: "[password][formControlName],[password][formControl],[password][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => PasswordValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) -export class PasswordValidatorDirective - implements Validator, OnInit, OnChanges { +export class PasswordValidatorDirective implements Validator, OnInit, OnChanges { @Input() repeatCharacter = 4; @Input() alphabeticalCharacter = 1; @Input() digitCharacter = 1; @@ -45,58 +29,44 @@ export class PasswordValidatorDirective private onChange: () => void; ngOnInit() { - this.repeatCharacterValidator = PasswordValidators.repeatCharacterRegexRule( - this.repeatCharacter - ); - this.alphabeticalCharacterValidator = PasswordValidators.alphabeticalCharacterRule( - this.alphabeticalCharacter - ); - this.digitCharacterValidator = PasswordValidators.digitCharacterRule( - this.digitCharacter - ); - this.lowercaseCharacterValidator = PasswordValidators.lowercaseCharacterRule( - this.lowercaseCharacter - ); - this.uppercaseCharacterValidator = PasswordValidators.uppercaseCharacterRule( - this.uppercaseCharacter - ); + this.repeatCharacterValidator = PasswordValidators.repeatCharacterRegexRule(this.repeatCharacter); + this.alphabeticalCharacterValidator = PasswordValidators.alphabeticalCharacterRule(this.alphabeticalCharacter); + this.digitCharacterValidator = PasswordValidators.digitCharacterRule(this.digitCharacter); + this.lowercaseCharacterValidator = PasswordValidators.lowercaseCharacterRule(this.lowercaseCharacter); + this.uppercaseCharacterValidator = PasswordValidators.uppercaseCharacterRule(this.uppercaseCharacter); } ngOnChanges(changes: SimpleChanges): void { let inputChanged = false; - if (changes["repeatCharacter"]) { - this.repeatCharacterValidator = PasswordValidators.repeatCharacterRegexRule( - changes["repeatCharacter"].currentValue - ); - inputChanged = true; + if (changes.repeatCharacter) { + this.repeatCharacterValidator = PasswordValidators.repeatCharacterRegexRule(changes.repeatCharacter.currentValue); + inputChanged = changes.repeatCharacter.isFirstChange() ? false : true; } - if (changes["alphabeticalCharacter"]) { + if (changes.alphabeticalCharacter) { this.alphabeticalCharacterValidator = PasswordValidators.alphabeticalCharacterRule( - changes["alphabeticalCharacter"].currentValue + changes.alphabeticalCharacter.currentValue ); - inputChanged = true; + inputChanged = changes.alphabeticalCharacter.isFirstChange() ? false : true; } - if (changes["digitCharacter"]) { - this.digitCharacterValidator = PasswordValidators.digitCharacterRule( - changes["digitCharacter"].currentValue - ); - inputChanged = true; + if (changes.digitCharacter) { + this.digitCharacterValidator = PasswordValidators.digitCharacterRule(changes.digitCharacter.currentValue); + inputChanged = changes.digitCharacter.isFirstChange() ? false : true; } - if (changes["lowercaseCharacter"]) { + if (changes.lowercaseCharacter) { this.lowercaseCharacterValidator = PasswordValidators.lowercaseCharacterRule( - changes["lowercaseCharacter"].currentValue + changes.lowercaseCharacter.currentValue ); - inputChanged = true; + inputChanged = changes.lowercaseCharacter.isFirstChange() ? false : true; } - if (changes["uppercaseCharacter"]) { + if (changes.uppercaseCharacter) { this.uppercaseCharacterValidator = PasswordValidators.uppercaseCharacterRule( - changes["uppercaseCharacter"].currentValue + changes.uppercaseCharacter.currentValue ); - inputChanged = true; + inputChanged = changes.uppercaseCharacter.isFirstChange() ? false : true; } if (inputChanged) { @@ -110,7 +80,7 @@ export class PasswordValidatorDirective this.digitCharacterValidator, this.alphabeticalCharacterValidator, this.lowercaseCharacterValidator, - this.uppercaseCharacterValidator + this.uppercaseCharacterValidator, ]); return compose(c); } diff --git a/src/components/universal/universal.directive.ts b/src/components/universal/universal.directive.ts index 2375a91..21d6fbf 100644 --- a/src/components/universal/universal.directive.ts +++ b/src/components/universal/universal.directive.ts @@ -1,32 +1,18 @@ -import { - Directive, - forwardRef, - Input, - OnInit, - OnChanges, - SimpleChanges -} from "@angular/core"; -import { - AbstractControl, - NG_VALIDATORS, - Validator, - ValidatorFn, - ValidationErrors -} from "@angular/forms"; +import { Directive, forwardRef, Input, OnInit, OnChanges, SimpleChanges } from "@angular/core"; +import { AbstractControl, NG_VALIDATORS, Validator, ValidatorFn, ValidationErrors } from "@angular/forms"; import { UniversalValidators } from "./universal-validators"; @Directive({ - selector: - "[noWhitespace][formControlName],[noWhitespace][formControl],[noWhitespace][ngModel]", + selector: "[noWhitespace][formControlName],[noWhitespace][formControl],[noWhitespace][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => WhiteSpaceValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) export class WhiteSpaceValidatorDirective implements Validator, OnInit { private validator: ValidatorFn; @@ -41,16 +27,15 @@ export class WhiteSpaceValidatorDirective implements Validator, OnInit { } @Directive({ - selector: - "[noEmptyString][formControlName],[noEmptyString][formControl],[noEmptyString][ngModel]", + selector: "[noEmptyString][formControlName],[noEmptyString][formControl],[noEmptyString][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => EmptyStringValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) export class EmptyStringValidatorDirective implements Validator, OnInit { private validator: ValidatorFn; @@ -65,16 +50,15 @@ export class EmptyStringValidatorDirective implements Validator, OnInit { } @Directive({ - selector: - "[isNumber][formControlName],[isNumber][formControl],[isNumber][ngModel]", + selector: "[isNumber][formControlName],[isNumber][formControl],[isNumber][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => IsNumberValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) export class IsNumberValidatorDirective implements Validator, OnInit { private validator: ValidatorFn; @@ -89,18 +73,17 @@ export class IsNumberValidatorDirective implements Validator, OnInit { } @Directive({ - selector: - "[isInRange][formControlName],[isInRange][formControl],[isInRange][ngModel]", + selector: "[isInRange][formControlName],[isInRange][formControl],[isInRange][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => IsInRangeValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) -export class IsInRangeValidatorDirective implements Validator, OnInit { +export class IsInRangeValidatorDirective implements Validator, OnInit, OnChanges { @Input() minValue: number; @Input() maxValue: number; @@ -108,18 +91,26 @@ export class IsInRangeValidatorDirective implements Validator, OnInit { private onChange: () => void; ngOnInit() { - this.validator = UniversalValidators.isInRange( - this.minValue, - this.maxValue - ); + this.validator = UniversalValidators.isInRange(this.minValue, this.maxValue); } ngOnChanges(changes: SimpleChanges): void { - if (changes["minValue"] || changes["maxValue"]) { - this.validator = UniversalValidators.isInRange( - changes["minValue"].currentValue, - changes["maxValue"].currentValue - ); + let minValue = this.minValue; + let maxValue = this.maxValue; + let changed = false; + + if (changes.minValue) { + minValue = changes.minValue.currentValue; + changed = changes.minValue.isFirstChange() ? false : true; + } + + if (changes.maxValue) { + maxValue = changes.maxValue.currentValue; + changed = changes.maxValue.isFirstChange() ? false : true; + } + + if (changed) { + this.validator = UniversalValidators.isInRange(minValue, maxValue); this.onChange(); } } @@ -134,16 +125,15 @@ export class IsInRangeValidatorDirective implements Validator, OnInit { } @Directive({ - selector: - "input[type=text][max][formControlName],input[type=text][max][formControl],input[type=text][max][ngModel]", + selector: "input[type=text][max][formControlName],input[type=text][max][formControl],input[type=text][max][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => MaxValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) export class MaxValidatorDirective implements Validator, OnInit, OnChanges { @Input() max: number; @@ -156,8 +146,8 @@ export class MaxValidatorDirective implements Validator, OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes["max"]) { - this.validator = UniversalValidators.max(changes["max"].currentValue); + if (changes.max && !changes.max.isFirstChange()) { + this.validator = UniversalValidators.max(changes.max.currentValue); this.onChange(); } } @@ -172,16 +162,15 @@ export class MaxValidatorDirective implements Validator, OnInit, OnChanges { } @Directive({ - selector: - "input[type=text][min][formControlName],input[type=text][min][formControl],input[type=text][min][ngModel]", + selector: "input[type=text][min][formControlName],input[type=text][min][formControl],input[type=text][min][ngModel]", providers: [ { provide: NG_VALIDATORS, // tslint:disable-next-line:no-forward-ref useExisting: forwardRef(() => MinValidatorDirective), - multi: true - } - ] + multi: true, + }, + ], }) export class MinValidatorDirective implements Validator, OnInit, OnChanges { @Input() min: number; @@ -194,8 +183,8 @@ export class MinValidatorDirective implements Validator, OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes["min"]) { - this.validator = UniversalValidators.min(changes["min"].currentValue); + if (changes.min && !changes.min.isFirstChange()) { + this.validator = UniversalValidators.min(changes.min.currentValue); this.onChange(); } }