├── examples
├── src
│ ├── assets
│ │ ├── .gitkeep
│ │ ├── github.png
│ │ └── lib
│ │ │ └── hljs
│ │ │ └── styles
│ │ │ ├── pojoaque.jpg
│ │ │ ├── school-book.png
│ │ │ ├── brown-papersq.png
│ │ │ ├── darkula.css
│ │ │ ├── ascetic.css
│ │ │ ├── mono-blue.css
│ │ │ ├── androidstudio.css
│ │ │ ├── dark.css
│ │ │ ├── codepen-embed.css
│ │ │ ├── brown-paper.css
│ │ │ ├── vs.css
│ │ │ ├── far.css
│ │ │ ├── arta.css
│ │ │ ├── color-brewer.css
│ │ │ ├── ir-black.css
│ │ │ ├── magula.css
│ │ │ ├── github-gist.css
│ │ │ ├── darcula.css
│ │ │ ├── monokai.css
│ │ │ ├── tomorrow.css
│ │ │ ├── zenburn.css
│ │ │ ├── school-book.css
│ │ │ ├── ocean.css
│ │ │ ├── paraiso-dark.css
│ │ │ ├── paraiso-light.css
│ │ │ ├── qtcreator_dark.css
│ │ │ ├── qtcreator_light.css
│ │ │ ├── dracula.css
│ │ │ ├── rainbow.css
│ │ │ ├── kimbie.dark.css
│ │ │ ├── kimbie.light.css
│ │ │ ├── atelier-dune-dark.css
│ │ │ ├── monokai-sublime.css
│ │ │ ├── atelier-dune-light.css
│ │ │ ├── atelier-heath-dark.css
│ │ │ ├── atelier-heath-light.css
│ │ │ ├── atelier-forest-dark.css
│ │ │ ├── atelier-forest-light.css
│ │ │ ├── tomorrow-night-bright.css
│ │ │ ├── tomorrow-night-eighties.css
│ │ │ ├── atelier-seaside-dark.css
│ │ │ ├── atelier-seaside-light.css
│ │ │ ├── hopscotch.css
│ │ │ ├── atelier-lakeside-dark.css
│ │ │ ├── atelier-lakeside-light.css
│ │ │ ├── xt256.css
│ │ │ ├── arduino-light.css
│ │ │ ├── googlecode.css
│ │ │ ├── atelier-sulphurpool-dark.css
│ │ │ ├── atelier-sulphurpool-light.css
│ │ │ ├── obsidian.css
│ │ │ ├── tomorrow-night.css
│ │ │ ├── xcode.css
│ │ │ ├── foundation.css
│ │ │ ├── pojoaque.css
│ │ │ ├── tomorrow-night-blue.css
│ │ │ ├── solarized-dark.css
│ │ │ ├── solarized-light.css
│ │ │ ├── default.css
│ │ │ ├── docco.css
│ │ │ ├── idea.css
│ │ │ ├── atelier-cave-dark.css
│ │ │ ├── atelier-cave-light.css
│ │ │ ├── atelier-estuary-dark.css
│ │ │ ├── atelier-estuary-light.css
│ │ │ ├── atelier-plateau-dark.css
│ │ │ ├── atelier-plateau-light.css
│ │ │ ├── atelier-savanna-dark.css
│ │ │ ├── atelier-savanna-light.css
│ │ │ ├── github.css
│ │ │ ├── atom-one-dark.css
│ │ │ ├── atom-one-light.css
│ │ │ ├── sunburst.css
│ │ │ └── railscasts.css
│ ├── app
│ │ ├── guide
│ │ │ ├── guide.component.css
│ │ │ ├── guide.component.ts
│ │ │ ├── guide.module.ts
│ │ │ ├── guide.component.spec.ts
│ │ │ └── guide.component.html
│ │ ├── util
│ │ │ ├── codeviewer
│ │ │ │ ├── codeviewer.component.css
│ │ │ │ ├── codeviewer.component.ts
│ │ │ │ ├── codeviewer.component.html
│ │ │ │ └── codeviewer.component.spec.ts
│ │ │ └── util.module.ts
│ │ ├── creditcard-validator
│ │ │ ├── form
│ │ │ │ ├── jcb
│ │ │ │ │ ├── form-jcb.component.ts
│ │ │ │ │ └── form-jcb.component.html
│ │ │ │ ├── visa
│ │ │ │ │ ├── form-visa.component.ts
│ │ │ │ │ └── form-visa.component.html
│ │ │ │ ├── maestro
│ │ │ │ │ ├── form-maestro.component.ts
│ │ │ │ │ └── form-maestro.component.html
│ │ │ │ ├── discover
│ │ │ │ │ ├── form-discover.component.ts
│ │ │ │ │ └── form-discover.component.html
│ │ │ │ ├── creditcard
│ │ │ │ │ ├── form-creditcard.component.ts
│ │ │ │ │ └── form-creditcard.component.html
│ │ │ │ ├── dinersclub
│ │ │ │ │ ├── form-dinersclub.component.ts
│ │ │ │ │ └── form-dinersclub.component.html
│ │ │ │ ├── mastercard
│ │ │ │ │ ├── form-mastercard.component.ts
│ │ │ │ │ └── form-mastercard.component.html
│ │ │ │ └── american-express
│ │ │ │ │ ├── form-american-express.component.ts
│ │ │ │ │ └── form-american-express.component.html
│ │ │ ├── reactive-form
│ │ │ │ ├── jcb
│ │ │ │ │ ├── reactive-form-jcb.component.html
│ │ │ │ │ └── reactive-form-jcb.component.ts
│ │ │ │ ├── visa
│ │ │ │ │ ├── reactive-form-visa.component.html
│ │ │ │ │ └── reactive-form-visa.component.ts
│ │ │ │ ├── maestro
│ │ │ │ │ ├── reactive-form-maestro.component.html
│ │ │ │ │ └── reactive-form-maestro.component.ts
│ │ │ │ ├── discover
│ │ │ │ │ ├── reactive-form-discover.component.html
│ │ │ │ │ └── reactive-form-discover.component.ts
│ │ │ │ ├── creditcard
│ │ │ │ │ ├── reactive-form-creditcard.component.html
│ │ │ │ │ └── reactive-form-creditcard.component.ts
│ │ │ │ ├── dinersclub
│ │ │ │ │ ├── reactive-form-dinersclub.component.html
│ │ │ │ │ └── reactive-form-dinersclub.component.ts
│ │ │ │ ├── mastercard
│ │ │ │ │ ├── reactive-form-mastercard.component.html
│ │ │ │ │ └── reactive-form-mastercard.component.ts
│ │ │ │ └── american-express
│ │ │ │ │ ├── reactive-form-american-express.component.html
│ │ │ │ │ └── reactive-form-american-express.component.ts
│ │ │ └── creditcard-validator.component.ts
│ │ ├── email-validator
│ │ │ ├── form
│ │ │ │ ├── email
│ │ │ │ │ ├── form-email.component.ts
│ │ │ │ │ └── form-email.component.html
│ │ │ │ └── suggest
│ │ │ │ │ └── form-email-suggest.component.html
│ │ │ ├── reactive-form
│ │ │ │ ├── email
│ │ │ │ │ ├── reactive-form-email.component.html
│ │ │ │ │ └── reactive-form-email.component.ts
│ │ │ │ └── suggest
│ │ │ │ │ └── reactive-form-email-suggest.component.html
│ │ │ ├── email-validator.component.ts
│ │ │ └── email-validator.component.html
│ │ ├── universal-validator
│ │ │ ├── form
│ │ │ │ ├── max
│ │ │ │ │ ├── form-max.component.ts
│ │ │ │ │ └── form-max.component.html
│ │ │ │ ├── min
│ │ │ │ │ ├── form-min.component.ts
│ │ │ │ │ └── form-min.component.html
│ │ │ │ ├── is-number
│ │ │ │ │ ├── form-is-number.component.ts
│ │ │ │ │ └── form-is-number.component.html
│ │ │ │ ├── is-in-range
│ │ │ │ │ ├── form-is-in-range.component.ts
│ │ │ │ │ └── form-is-in-range.component.html
│ │ │ │ └── no-whitespace
│ │ │ │ │ ├── form-no-whitespace.component.ts
│ │ │ │ │ └── form-no-whitespace.component.html
│ │ │ ├── reactive-form
│ │ │ │ ├── is-number
│ │ │ │ │ ├── reactive-form-is-number.component.html
│ │ │ │ │ └── reactive-form-is-number.component.ts
│ │ │ │ ├── max-length
│ │ │ │ │ ├── reactive-form-max-length.component.html
│ │ │ │ │ └── reactive-form-max-length.component.ts
│ │ │ │ ├── min-length
│ │ │ │ │ ├── reactive-form-min-length.component.html
│ │ │ │ │ └── reactive-form-min-length.component.ts
│ │ │ │ ├── no-empty-string
│ │ │ │ │ ├── reactive-form-no-empty-string.component.html
│ │ │ │ │ └── reactive-form-no-empty-string.component.ts
│ │ │ │ ├── no-whitespace
│ │ │ │ │ ├── reactive-form-no-whitespace.component.html
│ │ │ │ │ └── reactive-form-no-whitespace.component.ts
│ │ │ │ ├── max
│ │ │ │ │ ├── reactive-form-max.component.html
│ │ │ │ │ └── reactive-form-max.component.ts
│ │ │ │ ├── min
│ │ │ │ │ ├── reactive-form-min.component.html
│ │ │ │ │ └── reactive-form-min.component.ts
│ │ │ │ └── is-in-range
│ │ │ │ │ ├── reactive-form-is-in-range.component.html
│ │ │ │ │ └── reactive-form-is-in-range.component.ts
│ │ │ └── universal-validator.component.ts
│ │ ├── app.component.ts
│ │ ├── password-validator
│ │ │ ├── form
│ │ │ │ ├── digit-character-rule
│ │ │ │ │ ├── form-digit-character-rule.component.ts
│ │ │ │ │ └── form-digit-character-rule.component.html
│ │ │ │ ├── lowercase-character-rule
│ │ │ │ │ ├── form-lowercase-character-rule.component.ts
│ │ │ │ │ └── form-lowercase-character-rule.component.html
│ │ │ │ ├── uppercase-character-rule
│ │ │ │ │ ├── form-uppercase-character-rule.component.ts
│ │ │ │ │ └── form-uppercase-character-rule.component.html
│ │ │ │ ├── alphabetical-character-rule
│ │ │ │ │ ├── form-alphabetical-character-rule.component.ts
│ │ │ │ │ └── form-alphabetical-character-rule.component.html
│ │ │ │ └── repeat-character-regex-rule
│ │ │ │ │ ├── form-repeat-character-regex-rule.component.ts
│ │ │ │ │ └── form-repeat-character-regex-rule.component.html
│ │ │ ├── reactive-form
│ │ │ │ ├── digit-character-rule
│ │ │ │ │ ├── reactive-form-digit-character-rule.component.html
│ │ │ │ │ └── reactive-form-digit-character-rule.component.ts
│ │ │ │ ├── special-character-rule
│ │ │ │ │ ├── reactive-form-special-character-rule.component.html
│ │ │ │ │ └── reactive-form-special-character-rule.component.ts
│ │ │ │ ├── lowercase-character-rule
│ │ │ │ │ ├── reactive-form-lowercase-character-rule.component.html
│ │ │ │ │ └── reactive-form-lowercase-character-rule.component.ts
│ │ │ │ ├── uppercase-character-rule
│ │ │ │ │ ├── reactive-form-uppercase-character-rule.component.html
│ │ │ │ │ └── reactive-form-uppercase-character-rule.component.ts
│ │ │ │ ├── repeat-character-regex-rule
│ │ │ │ │ ├── reactive-form-repeat-character-regex-rule.component.html
│ │ │ │ │ └── reactive-form-repeat-character-regex-rule.component.ts
│ │ │ │ ├── alphabetical-character-rule
│ │ │ │ │ ├── reactive-form-alphabetical-character-rule.component.html
│ │ │ │ │ └── reactive-form-alphabetical-character-rule.component.ts
│ │ │ │ └── mismatch
│ │ │ │ │ ├── reactive-form-mismatch.component.html
│ │ │ │ │ └── reactive-form-mismatch.component.ts
│ │ │ └── password-validator.component.ts
│ │ ├── equal-to-validator
│ │ │ ├── form
│ │ │ │ └── equal-to
│ │ │ │ │ └── form-equal-to.component.ts
│ │ │ ├── reactive-form
│ │ │ │ └── equal-to
│ │ │ │ │ └── reactive-form-equal-to.component.ts
│ │ │ ├── equal-to-validator.component.ts
│ │ │ ├── equal-to-validator.component.html
│ │ │ └── equal-to-validator.module.ts
│ │ ├── app.component.css
│ │ ├── app.component.spec.ts
│ │ └── app.component.html
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── main.ts
│ ├── tsconfig.json
│ ├── index.html
│ ├── styles.css
│ └── test.ts
├── debug.log
├── e2e
│ ├── app.po.ts
│ ├── app.e2e-spec.ts
│ └── tsconfig.json
├── .editorconfig
├── .gitignore
├── .vscode
│ └── settings.json
├── karma.conf.js
└── README.md
├── .prettierignore
├── .prettierrc
├── projects
└── ngx-validators
│ ├── ng-package.json
│ ├── src
│ ├── lib
│ │ ├── creditcard
│ │ │ └── creditcards
│ │ │ │ └── creditcards.ts
│ │ ├── equal-to
│ │ │ └── equal-to-validator.ts
│ │ ├── abstract-control-util.ts
│ │ └── email
│ │ │ └── email-validators.ts
│ ├── test.ts
│ └── public-api.ts
│ ├── package.json
│ ├── tsconfig.lib.prod.json
│ ├── tsconfig.spec.json
│ ├── tsconfig.lib.json
│ ├── .eslintrc.json
│ ├── .browserslistrc
│ └── README.md
├── .editorconfig
├── .release.yml
├── .eslintrc.json
├── .gitignore
├── .npmignore
├── tsconfig.json
├── .vscode
└── settings.json
├── LICENSE
├── .github
└── workflows
│ └── main.yml
└── angular.json
/examples/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/src/app/guide/guide.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/src/app/util/codeviewer/codeviewer.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 | package-lock.json
4 | coverage
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": false,
3 | "printWidth": 120
4 | }
5 |
--------------------------------------------------------------------------------
/examples/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true,
3 | };
4 |
--------------------------------------------------------------------------------
/examples/src/assets/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nightapes/ngx-validators/HEAD/examples/src/assets/github.png
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/pojoaque.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nightapes/ngx-validators/HEAD/examples/src/assets/lib/hljs/styles/pojoaque.jpg
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/school-book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nightapes/ngx-validators/HEAD/examples/src/assets/lib/hljs/styles/school-book.png
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/brown-papersq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nightapes/ngx-validators/HEAD/examples/src/assets/lib/hljs/styles/brown-papersq.png
--------------------------------------------------------------------------------
/examples/debug.log:
--------------------------------------------------------------------------------
1 | [0221/200215:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:6004
2 | [0221/200215:ERROR:node_debugger.cc(86)] Cannot start debugger server
3 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/darkula.css:
--------------------------------------------------------------------------------
1 | /*
2 | Deprecated due to a typo in the name and left here for compatibility purpose only.
3 | Please use darcula.css instead.
4 | */
5 |
6 | @import url("darcula.css");
7 |
--------------------------------------------------------------------------------
/projects/ngx-validators/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/ngx-validators",
4 | "lib": {
5 | "entryFile": "src/public-api.ts"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/examples/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, element, by } from "protractor";
2 |
3 | export class ExamplesPage {
4 | navigateTo() {
5 | return browser.get("/");
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css("app-root h1")).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-jcb",
5 | templateUrl: "./form-jcb.component.html",
6 | })
7 | export class FormJcpComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/visa/form-visa.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-visa",
5 | templateUrl: "./form-visa.component.html",
6 | })
7 | export class FormVisaComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/form/email/form-email.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-email",
5 | templateUrl: "./form-email.component.html",
6 | })
7 | export class FormEmailComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/projects/ngx-validators/src/lib/creditcard/creditcards/creditcards.ts:
--------------------------------------------------------------------------------
1 | export * from "./americanexpress";
2 | export * from "./visa";
3 | export * from "./dinersclub";
4 | export * from "./discover";
5 | export * from "./jcb";
6 | export * from "./maestro";
7 | export * from "./mastercard";
8 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-maestro",
5 | templateUrl: "./form-maestro.component.html",
6 | })
7 | export class FormMaestroComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/discover/form-discover.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-discover",
5 | templateUrl: "./form-discover.component.html",
6 | })
7 | export class FormDiscoverComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/max/form-max.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-max",
5 | templateUrl: "./form-max.component.html",
6 | })
7 | export class FormMaxComponent {
8 | model: any = {
9 | max: "",
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-creditcard",
5 | templateUrl: "./form-creditcard.component.html",
6 | })
7 | export class FormCreditcardComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-dinersclub",
5 | templateUrl: "./form-dinersclub.component.html",
6 | })
7 | export class FormDinersclubComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-mastercard",
5 | templateUrl: "./form-mastercard.component.html",
6 | })
7 | export class FormMastercardComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/projects/ngx-validators/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ngx-validators",
3 | "version": "0.0.1",
4 | "peerDependencies": {
5 | "@angular/common": ">= 13.0.0",
6 | "@angular/core": ">= 13.0.0",
7 | "@angular/forms": ">= 13.0.0"
8 | },
9 | "dependencies": {
10 | "tslib": "^2.3.0"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/min/form-min.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-min",
5 | templateUrl: "./form-min.component.html",
6 | })
7 | export class FormMinComponent {
8 | model: any = {
9 | min: "",
10 | value: 2,
11 | };
12 | }
13 |
--------------------------------------------------------------------------------
/projects/ngx-validators/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.lib.json",
4 | "compilerOptions": {
5 | "declarationMap": false
6 | },
7 | "angularCompilerOptions": {
8 | "compilationMode": "partial"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 | import { items, Items } from "./items";
3 |
4 | @Component({
5 | selector: "app-root",
6 | templateUrl: "./app.component.html",
7 | styleUrls: ["./app.component.css"],
8 | })
9 | export class AppComponent {
10 | menuItems: Items[] = items;
11 | }
12 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-american-express",
5 | templateUrl: "./form-american-express.component.html",
6 | })
7 | export class FormAmericanExpressComponent {
8 | model: any;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/is-number/form-is-number.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-is-number",
5 | templateUrl: "./form-is-number.component.html",
6 | })
7 | export class FormIsNumberComponent {
8 | model: any = {
9 | isNumber: "",
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-is-in-range",
5 | templateUrl: "./form-is-in-range.component.html",
6 | })
7 | export class FormIsInRangeComponent {
8 | model: any = {
9 | range: "",
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/form/email/form-email.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/guide/guide.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 | import { Items, items } from "../items";
3 |
4 | @Component({
5 | selector: "app-guide",
6 | templateUrl: "./guide.component.html",
7 | styleUrls: ["./guide.component.css"],
8 | })
9 | export class GuideComponent {
10 | menuItems: Items[] = items;
11 | }
12 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-no-whitespace",
5 | templateUrl: "./form-no-whitespace.component.html",
6 | })
7 | export class FormWhitespaceComponent {
8 | model: any = {
9 | whitespace: "",
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/projects/ngx-validators/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "../../out-tsc/spec",
6 | "types": ["jasmine"]
7 | },
8 | "files": ["src/test.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-digit-character-rule",
5 | templateUrl: "./form-digit-character-rule.component.html",
6 | })
7 | export class FormDigitCharacterRuleComponent {
8 | password: string;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-lowercase-character-rule",
5 | templateUrl: "./form-lowercase-character-rule.component.html",
6 | })
7 | export class FormLowercaseCharacterRuleComponent {
8 | password: string;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-uppercase-character-rule",
5 | templateUrl: "./form-uppercase-character-rule.component.html",
6 | })
7 | export class FormUppercaseCharacterRuleComponent {
8 | password: string;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { ExamplesPage } from "./app.po";
2 |
3 | describe("examples App", () => {
4 | let page: ExamplesPage;
5 |
6 | beforeEach(() => {
7 | page = new ExamplesPage();
8 | });
9 |
10 | it("should display message saying app works", () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual("app works!");
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-alphabetical-character-rule",
5 | templateUrl: "./form-alphabetical-character-rule.component.html",
6 | })
7 | export class FormAlphabeticalCharacterRuleComponent {
8 | password: string;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-repeat-character-regex-rule",
5 | templateUrl: "./form-repeat-character-regex-rule.component.html",
6 | })
7 | export class FormRepeatCharacterRegexRuleComponent {
8 | password: string;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/projects/ngx-validators/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "../../out-tsc/lib",
6 | "declaration": true,
7 | "declarationMap": true,
8 | "inlineSources": true,
9 | "types": []
10 | },
11 | "exclude": ["src/test.ts", "**/*.spec.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/examples/src/app/util/codeviewer/codeviewer.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, Input } from "@angular/core";
2 | // import * as hljs from 'highlight.js';
3 |
4 | @Component({
5 | selector: "app-codeviewer",
6 | templateUrl: "./codeviewer.component.html",
7 | styleUrls: ["./codeviewer.component.css"],
8 | })
9 | export class CodeviewerComponent {
10 | @Input() html: any;
11 | @Input() tsCode: any;
12 | }
13 |
--------------------------------------------------------------------------------
/.release.yml:
--------------------------------------------------------------------------------
1 | release: "github"
2 | github:
3 | repo: "ngx-validators"
4 | user: "nightapes"
5 | commitFormat: angular
6 | branch:
7 | master: release
8 | hooks:
9 | preRelease:
10 | - yarn version --cwd projects/ngx-validators --new-version $(./go-semantic-release next)
11 | - yarn build
12 | - echo //registry.npmjs.org/:_authToken=$NPM_TOKEN >> ~/.npmrc
13 | - yarn publish dist/ngx-validators
14 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/jcb/form-jcb.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a JCB card
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/visa/form-visa.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a VISA card
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/is-number/form-is-number.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | Is not a number
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from "@angular/core";
2 | import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
3 |
4 | import { AppModule } from "./app/app.module";
5 | import { environment } from "./environments/environment";
6 |
7 | import "hammerjs";
8 |
9 | if (environment.production) {
10 | enableProdMode();
11 | }
12 |
13 | platformBrowserDynamic().bootstrapModule(AppModule);
14 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/creditcard/form-creditcard.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a credit card
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/maestro/form-maestro.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a Maestro card
12 |
13 |
--------------------------------------------------------------------------------
/examples/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "declaration": false,
5 | "emitDecoratorMetadata": true,
6 | "experimentalDecorators": true,
7 | "lib": ["es2016"],
8 | "module": "commonjs",
9 | "moduleResolution": "node",
10 | "outDir": "../dist/out-tsc-e2e",
11 | "sourceMap": true,
12 | "target": "es6",
13 | "typeRoots": ["../node_modules/@types"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/discover/form-discover.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a Discover card
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.html:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.html:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/examples/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false,
8 | };
9 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/dinersclub/form-dinersclub.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a Dinersclub card
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/mastercard/form-mastercard.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a Mastercard card
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/no-whitespace/form-no-whitespace.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | No whitespace allowed
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "",
4 | "declaration": false,
5 | "emitDecoratorMetadata": true,
6 | "experimentalDecorators": true,
7 | "lib": ["es2016", "dom"],
8 | "mapRoot": "./",
9 | "module": "es2015",
10 | "moduleResolution": "node",
11 | "outDir": "../dist/out-tsc",
12 | "sourceMap": true,
13 | "target": "es5",
14 | "typeRoots": ["../node_modules/@types"]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/form/american-express/form-american-express.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | This is not a AmericanExpress card
12 |
13 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/examples/src/app/equal-to-validator/form/equal-to/form-equal-to.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from "@angular/core";
2 |
3 | @Component({
4 | selector: "app-equal-to",
5 | templateUrl: "./form-equal-to.component.html",
6 | })
7 | export class FormEqualToComponent implements OnInit {
8 | model = {
9 | email: "",
10 | emailConfirm: "",
11 | password: "",
12 | passwordConfirm: "",
13 | };
14 |
15 | constructor() {}
16 |
17 | ngOnInit() {}
18 | }
19 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/max/form-max.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | Needs to be a number
12 | Number to big
13 |
14 |
--------------------------------------------------------------------------------
/projects/ngx-validators/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../.eslintrc.json",
3 | "ignorePatterns": ["!**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts"],
7 | "parserOptions": {
8 | "project": ["projects/ngx-validators/tsconfig.lib.json", "projects/ngx-validators/tsconfig.spec.json"],
9 | "createDefaultProgram": true
10 | },
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.html"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/examples/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ngx-validators
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Loading...
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/digit-character-rule/form-digit-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
2 |
12 | Password should contain at least one digit
15 |
16 |
--------------------------------------------------------------------------------
/examples/src/app/util/codeviewer/codeviewer.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Example code
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/lowercase-character-rule/form-lowercase-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
2 |
12 | Password should contain at least one lowercase character
15 |
16 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/uppercase-character-rule/form-uppercase-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
2 |
12 | Password should contain at least one uppercase character
15 |
16 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/reactive-form/suggest/reactive-form-email-suggest.component.html:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/alphabetical-character-rule/form-alphabetical-character-rule.component.html:
--------------------------------------------------------------------------------
1 |
2 |
12 | Password should contain at least one alphabetical character
15 |
16 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.html:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/form/repeat-character-regex-rule/form-repeat-character-regex-rule.component.html:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "@typescript-eslint/parser",
4 | "plugins": ["@typescript-eslint"],
5 | "env": {
6 | "node": true
7 | },
8 | "extends": [
9 | "eslint:recommended",
10 | "plugin:@typescript-eslint/recommended",
11 | "plugin:@angular-eslint/recommended",
12 | "prettier"
13 | ],
14 | "rules": {
15 | "@typescript-eslint/consistent-type-imports": "error",
16 | "@typescript-eslint/no-unused-vars": [
17 | "error",
18 | {
19 | "argsIgnorePattern": "_"
20 | }
21 | ],
22 | "@typescript-eslint/array-type": "error"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/min/form-min.component.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | Needs to be a number
12 | Number to small
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/form/suggest/form-email-suggest.component.html:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/examples/src/app/guide/guide.module.ts:
--------------------------------------------------------------------------------
1 | import { MatCardModule, MatListModule } from "@angular/material";
2 | import { GuideComponent } from "./guide.component";
3 | import { NgModule } from "@angular/core";
4 | import { CommonModule } from "@angular/common";
5 | import { RouterModule, Routes } from "@angular/router";
6 |
7 | const routes: Routes = [
8 | {
9 | path: "",
10 | component: GuideComponent,
11 | },
12 | {
13 | path: "guide",
14 | component: GuideComponent,
15 | },
16 | ];
17 |
18 | @NgModule({
19 | imports: [CommonModule, MatCardModule, MatListModule, RouterModule.forChild(routes)],
20 | declarations: [GuideComponent],
21 | })
22 | export class GuideModule {}
23 |
--------------------------------------------------------------------------------
/projects/ngx-validators/.browserslistrc:
--------------------------------------------------------------------------------
1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 |
5 | # For the full list of supported browsers by the Angular framework, please see:
6 | # https://angular.io/guide/browser-support
7 |
8 | # You can see what browsers were selected by your queries by running:
9 | # npx browserslist
10 |
11 | last 1 Chrome version
12 | last 1 Firefox version
13 | last 2 Edge major versions
14 | last 2 Safari major versions
15 | last 2 iOS major versions
16 | Firefox ESR
17 |
--------------------------------------------------------------------------------
/examples/src/app/app.component.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin: 24px;
3 | align-content: center;
4 | margin: auto;
5 | padding: 10px;
6 | }
7 |
8 | @media screen and (min-width: 768px) {
9 | .container {
10 | width: 75%;
11 | }
12 | }
13 |
14 | md-sidenav {
15 | width: 250px;
16 | }
17 |
18 | .selected {
19 | font-weight: 600;
20 | }
21 |
22 | .menu-button {
23 | min-width: 48px !important;
24 | min-height: 48px !important;
25 | }
26 |
27 | .home {
28 | padding-left: 20px;
29 | }
30 |
31 | .github {
32 | height: 30px;
33 | margin: auto;
34 | margin-top: 9px;
35 | }
36 |
37 | .mat-sidenav {
38 | width: 400px;
39 | }
40 |
41 | .fill-space {
42 | flex: 1 1 auto;
43 | }
44 |
--------------------------------------------------------------------------------
/examples/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 |
7 | # dependencies
8 | /node_modules
9 |
10 | # IDEs and editors
11 | /.idea
12 | .project
13 | .classpath
14 | .c9/
15 | *.launch
16 | .settings/
17 | *.sublime-workspace
18 |
19 | # IDE - VSCode
20 | .vscode/*
21 | !.vscode/settings.json
22 | !.vscode/tasks.json
23 | !.vscode/launch.json
24 | !.vscode/extensions.json
25 |
26 | # misc
27 | /.sass-cache
28 | /connect.lock
29 | /coverage/*
30 | /libpeerconnection.log
31 | npm-debug.log
32 | testem.log
33 | /typings
34 |
35 | # e2e
36 | /e2e/*.js
37 | /e2e/*.map
38 |
39 | #System Files
40 | .DS_Store
41 | Thumbs.db
42 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/form/is-in-range/form-is-in-range.component.html:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/jcb/reactive-form-jcb.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-jcb",
7 | templateUrl: "./reactive-form-jcb.component.html",
8 | })
9 | export class ReactiveFormJcpComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.jcb]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/visa/reactive-form-visa.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-visa",
7 | templateUrl: "./reactive-form-visa.component.html",
8 | })
9 | export class ReactiveFormVisaComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.visa]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/guide/guide.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from "@angular/core/testing";
2 |
3 | import { GuideComponent } from "./guide.component";
4 |
5 | describe("GuideComponent", () => {
6 | let component: GuideComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [GuideComponent],
12 | }).compileComponents();
13 | }));
14 |
15 | beforeEach(() => {
16 | fixture = TestBed.createComponent(GuideComponent);
17 | component = fixture.componentInstance;
18 | fixture.detectChanges();
19 | });
20 |
21 | it("should create", () => {
22 | expect(component).toBeTruthy();
23 | });
24 | });
25 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/maestro/reactive-form-maestro.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-maestro",
7 | templateUrl: "./reactive-form-maestro.component.html",
8 | })
9 | export class ReactiveFormMaestroComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.maestro]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/max/reactive-form-max.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-max",
7 | templateUrl: "./reactive-form-max.component.html",
8 | })
9 | export class ReactiveFormMaxComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | max: FormControl = new FormControl("", Validators.compose([Validators.required, UniversalValidators.max(10)]));
13 |
14 | constructor(protected _fb: FormBuilder) {}
15 |
16 | ngOnInit() {
17 | this.form = this._fb.group({
18 | max: this.max,
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/min/reactive-form-min.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-min",
7 | templateUrl: "./reactive-form-min.component.html",
8 | })
9 | export class ReactiveFormMinComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | min: FormControl = new FormControl("", Validators.compose([Validators.required, UniversalValidators.min(5)]));
13 |
14 | constructor(protected _fb: FormBuilder) {}
15 |
16 | ngOnInit() {
17 | this.form = this._fb.group({
18 | min: this.min,
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/projects/ngx-validators/src/lib/equal-to/equal-to-validator.ts:
--------------------------------------------------------------------------------
1 | import type { AbstractControl, ValidatorFn } from "@angular/forms";
2 | import { AbstractControlUtil } from "../abstract-control-util";
3 |
4 | export class EqualToValidator {
5 | static equalTo(c1Name: string, c2Name: string): ValidatorFn {
6 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
7 | const validator = (parent: AbstractControl): any => {
8 | const c1 = parent.get(c1Name);
9 | const c2 = parent.get(c2Name);
10 |
11 | if (c1?.value === c2?.value) {
12 | AbstractControlUtil.removeError(c2, "notEqualTo");
13 | } else {
14 | AbstractControlUtil.addError(c2, "notEqualTo", true);
15 | }
16 | };
17 | return validator;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/discover/reactive-form-discover.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-discover",
7 | templateUrl: "./reactive-form-discover.component.html",
8 | })
9 | export class ReactiveFormDiscoverComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.discover]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/dinersclub/reactive-form-dinersclub.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-dinersclub",
7 | templateUrl: "./reactive-form-dinersclub.component.html",
8 | })
9 | export class ReactiveFormDinersclubComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.dinersclub]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/mastercard/reactive-form-mastercard.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-mastercard",
7 | templateUrl: "./reactive-form-mastercard.component.html",
8 | })
9 | export class ReactiveFormMastercardComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.mastercard]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/creditcard/reactive-form-creditcard.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-creditcard",
7 | templateUrl: "./reactive-form-creditcard.component.html",
8 | })
9 | export class ReactiveFormCreditcardComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.isCreditCard]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/util/util.module.ts:
--------------------------------------------------------------------------------
1 | import { MatCardModule, MatListModule } from "@angular/material";
2 | import { NgModule } from "@angular/core";
3 | import { CommonModule } from "@angular/common";
4 | import { RouterModule } from "@angular/router";
5 | import { MatButtonModule, MatTabsModule } from "@angular/material";
6 | import { CodeviewerComponent } from "./codeviewer/codeviewer.component";
7 | import { HighlightModule } from "ngx-highlightjs";
8 |
9 | @NgModule({
10 | imports: [
11 | CommonModule,
12 | MatCardModule,
13 | RouterModule,
14 | MatListModule,
15 | MatButtonModule,
16 | MatTabsModule,
17 | HighlightModule.forRoot(),
18 | ],
19 | declarations: [CodeviewerComponent],
20 | exports: [CodeviewerComponent],
21 | })
22 | export class UtilModule {}
23 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/no-whitespace/reactive-form-no-whitespace.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-no-whitespace",
7 | templateUrl: "./reactive-form-no-whitespace.component.html",
8 | })
9 | export class ReactiveFormWhitespaceComponent implements OnInit {
10 | form: FormGroup;
11 | noWhitespace: FormControl = new FormControl("", UniversalValidators.noWhitespace);
12 |
13 | constructor(protected _fb: FormBuilder) {}
14 |
15 | ngOnInit() {
16 | this.form = this._fb.group({
17 | noWhitespace: this.noWhitespace,
18 | });
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/src/app/util/codeviewer/codeviewer.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from "@angular/core/testing";
2 |
3 | import { CodeviewerComponent } from "./codeviewer.component";
4 |
5 | describe("CodeviewerComponent", () => {
6 | let component: CodeviewerComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [CodeviewerComponent],
12 | }).compileComponents();
13 | }));
14 |
15 | beforeEach(() => {
16 | fixture = TestBed.createComponent(CodeviewerComponent);
17 | component = fixture.componentInstance;
18 | fixture.detectChanges();
19 | });
20 |
21 | it("should create", () => {
22 | expect(component).toBeTruthy();
23 | });
24 | });
25 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/is-number/reactive-form-is-number.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-is-number",
7 | templateUrl: "./reactive-form-is-number.component.html",
8 | })
9 | export class ReactiveFormIsNumberComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | isNumber: FormControl = new FormControl("", Validators.compose([Validators.required, UniversalValidators.isNumber]));
13 |
14 | constructor(protected _fb: FormBuilder) {}
15 |
16 | ngOnInit() {
17 | this.form = this._fb.group({
18 | isNumber: this.isNumber,
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/reactive-form/american-express/reactive-form-american-express.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { CreditCardValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-american-express",
7 | templateUrl: "./reactive-form-american-express.component.html",
8 | })
9 | export class ReactiveFormAmericanExpressComponent implements OnInit {
10 | form: FormGroup;
11 | creditcard = new FormControl("", Validators.compose([CreditCardValidators.americanExpress]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | creditcard: this.creditcard,
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/reactive-form/email/reactive-form-email.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { EmailValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-email",
7 | templateUrl: "./reactive-form-email.component.html",
8 | })
9 | export class ReactiveFormEmailComponent implements OnInit {
10 | form: FormGroup;
11 | email = new FormControl("", Validators.compose([EmailValidators.normal]));
12 | constructor(protected _fb: FormBuilder) {}
13 |
14 | ngOnInit() {
15 | this.form = this._fb.group({
16 | email: this.email,
17 | });
18 | }
19 |
20 | addToForm(email) {
21 | this.form.get("email").setValue(email);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/no-empty-string/reactive-form-no-empty-string.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-no-empty-string",
7 | templateUrl: "./reactive-form-no-empty-string.component.html",
8 | })
9 | export class ReactiveFormNoEmptyStringComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | noEmptyString: FormControl = new FormControl("", UniversalValidators.noEmptyString);
13 |
14 | constructor(protected _fb: FormBuilder) {}
15 |
16 | ngOnInit() {
17 | this.form = this._fb.group({
18 | noEmptyString: this.noEmptyString,
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | # Only exists if Bazel was run
8 | /bazel-out
9 |
10 | # dependencies
11 | /node_modules
12 |
13 | # profiling files
14 | chrome-profiler-events*.json
15 |
16 | # IDEs and editors
17 | /.idea
18 | .project
19 | .classpath
20 | .c9/
21 | *.launch
22 | .settings/
23 | *.sublime-workspace
24 |
25 | # IDE - VSCode
26 | .vscode/*
27 | !.vscode/settings.json
28 | !.vscode/tasks.json
29 | !.vscode/launch.json
30 | !.vscode/extensions.json
31 | .history/*
32 |
33 | # misc
34 | /.angular/cache
35 | /.sass-cache
36 | /connect.lock
37 | /coverage
38 | /libpeerconnection.log
39 | npm-debug.log
40 | yarn-error.log
41 | testem.log
42 | /typings
43 |
44 | # System Files
45 | .DS_Store
46 | Thumbs.db
47 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/ascetic.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: white;
12 | color: black;
13 | }
14 |
15 | .hljs-string,
16 | .hljs-variable,
17 | .hljs-template-variable,
18 | .hljs-symbol,
19 | .hljs-bullet,
20 | .hljs-section,
21 | .hljs-addition,
22 | .hljs-attribute,
23 | .hljs-link {
24 | color: #888;
25 | }
26 |
27 | .hljs-comment,
28 | .hljs-quote,
29 | .hljs-meta,
30 | .hljs-deletion {
31 | color: #ccc;
32 | }
33 |
34 | .hljs-keyword,
35 | .hljs-selector-tag,
36 | .hljs-section,
37 | .hljs-name,
38 | .hljs-type,
39 | .hljs-strong {
40 | font-weight: bold;
41 | }
42 |
43 | .hljs-emphasis {
44 | font-style: italic;
45 | }
46 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/is-in-range/reactive-form-is-in-range.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-is-in-range",
7 | templateUrl: "./reactive-form-is-in-range.component.html",
8 | })
9 | export class ReactiveFormIsInRangeComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | isInRange: FormControl = new FormControl(
13 | "",
14 | Validators.compose([Validators.required, UniversalValidators.isInRange(3, 6)])
15 | );
16 | constructor(protected _fb: FormBuilder) {}
17 |
18 | ngOnInit() {
19 | this.form = this._fb.group({
20 | isInRange: this.isInRange,
21 | });
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/max-length/reactive-form-max-length.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-max-length",
7 | templateUrl: "./reactive-form-max-length.component.html",
8 | })
9 | export class ReactiveFormMaxLengthComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | maxLength: FormControl = new FormControl(
13 | "",
14 | Validators.compose([Validators.required, UniversalValidators.maxLength(5)])
15 | );
16 |
17 | constructor(protected _fb: FormBuilder) {}
18 |
19 | ngOnInit() {
20 | this.form = this._fb.group({
21 | maxLength: this.maxLength,
22 | });
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/reactive-form/min-length/reactive-form-min-length.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-min-length",
7 | templateUrl: "./reactive-form-min-length.component.html",
8 | })
9 | export class ReactiveFormMinLengthComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | minLength: FormControl = new FormControl(
13 | "",
14 | Validators.compose([Validators.required, UniversalValidators.minLength(3)])
15 | );
16 |
17 | constructor(protected _fb: FormBuilder) {}
18 |
19 | ngOnInit() {
20 | this.form = this._fb.group({
21 | minLength: this.minLength,
22 | });
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Misc
3 | #################
4 | **/.DS_Store
5 | nbproject
6 | manifest.mf
7 | build.xml
8 | node_modules/*
9 | npm-debug.log
10 | coverage
11 | *.ts
12 | !*.d.ts
13 | tests
14 | typings.json
15 | typings/
16 | .gitignore
17 | tsconfig.json
18 | .npmignore
19 | karma-test-shim.js
20 | karma.conf.js
21 | !*.metadata.json
22 | !bundles/*.js
23 | examples/
24 | *.tgz
25 |
26 | #################
27 | ## Visual Studio Code
28 | #################
29 | .vscode/
30 |
31 | #################
32 | ## JetBrains
33 | #################
34 | .idea
35 | .project
36 | .settings
37 | .idea/*
38 | *.iml
39 |
40 | ############
41 | ## Windows
42 | ############
43 |
44 | # Windows image file caches
45 | Thumbs.db
46 |
47 | # Folder config file
48 | Desktop.ini
49 |
50 | ############
51 | ## Mac
52 | ############
53 |
54 | # Mac crap
55 | .DS_Store
56 |
57 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/special-character-rule/reactive-form-special-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators, PasswordValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-special-character-rule",
7 | templateUrl: "./reactive-form-special-character-rule.component.html",
8 | })
9 | export class ReactiveFormSpecialCharacterRuleComponent implements OnInit {
10 | form: FormGroup;
11 | specialCharacterRule: FormControl = new FormControl("", PasswordValidators.specialCharacterRule(1));
12 |
13 | constructor(protected _fb: FormBuilder) {}
14 |
15 | ngOnInit() {
16 | this.form = this._fb.group({
17 | newPassword: this.specialCharacterRule,
18 | });
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/projects/ngx-validators/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import "zone.js";
4 | import "zone.js/testing";
5 | import { getTestBed } from "@angular/core/testing";
6 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing";
7 |
8 | declare const require: {
9 | context(
10 | path: string,
11 | deep?: boolean,
12 | filter?: RegExp
13 | ): {
14 | keys(): string[];
15 | (id: string): T;
16 | };
17 | };
18 |
19 | // First, initialize the Angular testing environment.
20 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
21 |
22 | // Then we find all the tests.
23 | const context = require.context("./", true, /\.spec\.ts$/);
24 | // And load the modules.
25 | context.keys().map(context);
26 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/digit-character-rule/reactive-form-digit-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { PasswordValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-digit-character-rule",
7 | templateUrl: "./reactive-form-digit-character-rule.component.html",
8 | })
9 | export class ReactiveFormDigitCharacterRuleComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | digitCharacterRule: FormControl = new FormControl(
13 | "",
14 | Validators.compose([Validators.required, PasswordValidators.digitCharacterRule(1)])
15 | );
16 |
17 | constructor(protected _fb: FormBuilder) {}
18 |
19 | ngOnInit() {
20 | this.form = this._fb.group({
21 | newPassword: this.digitCharacterRule,
22 | });
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
3 | @import "~@angular/material/prebuilt-themes/indigo-pink.css";
4 | body {
5 | margin: 0;
6 | background-color: lightgrey;
7 | }
8 |
9 | .card {
10 | margin-bottom: 24px;
11 | }
12 |
13 | .error-container {
14 | margin-top: -15px;
15 | margin-bottom: 5px;
16 | }
17 |
18 | .success {
19 | color: green;
20 | font-size: 75%;
21 | }
22 |
23 | .grey {
24 | color: black;
25 | font-size: 75%;
26 | }
27 |
28 | .mat-tab-link {
29 | line-height: 63px !important;
30 | height: 64px !important;
31 | opacity: 1 !important;
32 | }
33 |
34 | .mat-ink-bar {
35 | background-color: white;
36 | }
37 |
38 | .mat-drawer-container {
39 | position: fixed !important;
40 | height: 100%;
41 | min-height: 100%;
42 | width: 100%;
43 | min-width: 100%;
44 | }
45 |
46 | .clickable {
47 | cursor: pointer;
48 | text-decoration: underline;
49 | }
50 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/mismatch/reactive-form-mismatch.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators, PasswordValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-mismatch",
7 | templateUrl: "./reactive-form-mismatch.component.html",
8 | })
9 | export class ReactiveFormMismatchComponent implements OnInit {
10 | form: FormGroup;
11 | password: FormControl = new FormControl("");
12 | confirmPassword: FormControl = new FormControl("");
13 |
14 | constructor(protected _fb: FormBuilder) {}
15 |
16 | ngOnInit() {
17 | this.form = this._fb.group({
18 | newPassword: this.password,
19 | confirmPassword: this.confirmPassword,
20 | });
21 | this.form.validator = PasswordValidators.mismatchedPasswords("newPassword", "confirmPassword");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/repeat-character-regex-rule/reactive-form-repeat-character-regex-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { PasswordValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-repeat-character-regex-rule",
7 | templateUrl: "./reactive-form-repeat-character-regex-rule.component.html",
8 | })
9 | export class ReactiveFormRepeatCharacterRegexRuleComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | repeatCharacterRegexRule: FormControl = new FormControl(
13 | "",
14 | Validators.compose([Validators.required, PasswordValidators.repeatCharacterRegexRule(3)])
15 | );
16 | constructor(protected _fb: FormBuilder) {}
17 |
18 | ngOnInit() {
19 | this.form = this._fb.group({
20 | newPassword: this.repeatCharacterRegexRule,
21 | });
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/alphabetical-character-rule/reactive-form-alphabetical-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { PasswordValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-alphabetical-character-rule",
7 | templateUrl: "./reactive-form-alphabetical-character-rule.component.html",
8 | })
9 | export class ReactiveFormAlphabeticalCharacterRuleComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | alphabeticalCharacterRule: FormControl = new FormControl(
13 | "",
14 | Validators.compose([Validators.required, PasswordValidators.alphabeticalCharacterRule(1)])
15 | );
16 | constructor(protected _fb: FormBuilder) {}
17 |
18 | ngOnInit() {
19 | this.form = this._fb.group({
20 | newPassword: this.alphabeticalCharacterRule,
21 | });
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/lowercase-character-rule/reactive-form-lowercase-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators, PasswordValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-lowercase-character-rule",
7 | templateUrl: "./reactive-form-lowercase-character-rule.component.html",
8 | })
9 | export class ReactiveFormLowercaseCharacterRuleComponent implements OnInit {
10 | form: FormGroup;
11 |
12 | lowercaseCharacterRule: FormControl = new FormControl(
13 | "",
14 | Validators.compose([Validators.required, PasswordValidators.lowercaseCharacterRule(1)])
15 | );
16 |
17 | constructor(protected _fb: FormBuilder) {}
18 |
19 | ngOnInit() {
20 | this.form = this._fb.group({
21 | newPassword: this.lowercaseCharacterRule,
22 | });
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/src/app/equal-to-validator/reactive-form/equal-to/reactive-form-equal-to.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { EmailValidators, EqualToValidator } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 |
5 | @Component({
6 | selector: "app-reactive-equal-to",
7 | templateUrl: "./reactive-form-equal-to.component.html",
8 | })
9 | export class ReactiveFormEqualToComponent implements OnInit {
10 | form: FormGroup;
11 | constructor(protected _fb: FormBuilder) {}
12 |
13 | ngOnInit() {
14 | this.form = this._fb.group(
15 | {
16 | email: [""],
17 | emailConfirm: [""],
18 | password: [""],
19 | passwordConfirm: [""],
20 | },
21 | {
22 | validator: [
23 | EqualToValidator.equalTo("email", "emailConfirm"),
24 | EqualToValidator.equalTo("password", "passwordConfirm"),
25 | ],
26 | }
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/reactive-form/uppercase-character-rule/reactive-form-uppercase-character-rule.component.ts:
--------------------------------------------------------------------------------
1 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
2 | import { UniversalValidators, PasswordValidators } from "ngx-validators";
3 | import { Component, OnInit } from "@angular/core";
4 | import { PasswordModule } from "../../password-validator.module";
5 |
6 | @Component({
7 | selector: "app-reactive-uppercase-character-rule",
8 | templateUrl: "./reactive-form-uppercase-character-rule.component.html",
9 | })
10 | export class ReactiveFormUppercaseCharacterRuleComponent implements OnInit {
11 | form: FormGroup;
12 |
13 | uppercaseCharacterRule: FormControl = new FormControl(
14 | "",
15 | Validators.compose([Validators.required, PasswordValidators.uppercaseCharacterRule(1)])
16 | );
17 |
18 | constructor(protected _fb: FormBuilder) {}
19 |
20 | ngOnInit() {
21 | this.form = this._fb.group({
22 | newPassword: this.uppercaseCharacterRule,
23 | });
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/mono-blue.css:
--------------------------------------------------------------------------------
1 | /*
2 | Five-color theme from a single blue hue.
3 | */
4 | .hljs {
5 | display: block;
6 | overflow-x: auto;
7 | padding: 0.5em;
8 | background: #eaeef3;
9 | }
10 |
11 | .hljs {
12 | color: #00193a;
13 | }
14 |
15 | .hljs-keyword,
16 | .hljs-selector-tag,
17 | .hljs-title,
18 | .hljs-section,
19 | .hljs-doctag,
20 | .hljs-name,
21 | .hljs-strong {
22 | font-weight: bold;
23 | }
24 |
25 | .hljs-comment {
26 | color: #738191;
27 | }
28 |
29 | .hljs-string,
30 | .hljs-title,
31 | .hljs-section,
32 | .hljs-built_in,
33 | .hljs-literal,
34 | .hljs-type,
35 | .hljs-addition,
36 | .hljs-tag,
37 | .hljs-quote,
38 | .hljs-name,
39 | .hljs-selector-id,
40 | .hljs-selector-class {
41 | color: #0048ab;
42 | }
43 |
44 | .hljs-meta,
45 | .hljs-subst,
46 | .hljs-symbol,
47 | .hljs-regexp,
48 | .hljs-attribute,
49 | .hljs-deletion,
50 | .hljs-variable,
51 | .hljs-template-variable,
52 | .hljs-link,
53 | .hljs-bullet {
54 | color: #4c81c9;
55 | }
56 |
57 | .hljs-emphasis {
58 | font-style: italic;
59 | }
60 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "compileOnSave": false,
4 | "compilerOptions": {
5 | "baseUrl": "./",
6 | "outDir": "./dist/out-tsc",
7 | "forceConsistentCasingInFileNames": true,
8 | "strict": true,
9 | "noImplicitOverride": true,
10 | "noPropertyAccessFromIndexSignature": true,
11 | "noImplicitReturns": true,
12 | "noFallthroughCasesInSwitch": true,
13 | "sourceMap": true,
14 | "paths": {
15 | "ngx-validators": ["dist/ngx-validators/ngx-validators", "dist/ngx-validators"]
16 | },
17 | "declaration": false,
18 | "downlevelIteration": true,
19 | "experimentalDecorators": true,
20 | "moduleResolution": "node",
21 | "importHelpers": true,
22 | "target": "es2017",
23 | "module": "es2020",
24 | "lib": ["es2020", "dom"]
25 | },
26 | "angularCompilerOptions": {
27 | "enableI18nLegacyMessageIdFormat": false,
28 | "strictInjectionParameters": true,
29 | "strictInputAccessModifiers": true,
30 | "strictTemplates": true
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | // 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.
3 | "editor.tabSize": 4,
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.
5 | "editor.insertSpaces": true,
6 | // Controls if the editor should automatically format the line after typing
7 | "editor.formatOnType": false,
8 | // The default character set encoding to use when reading and writing files.
9 | "files.encoding": "utf8",
10 | // When enabled, will trim trailing whitespace when you save a file.
11 | "files.trimTrailingWhitespace": false,
12 | // Control whether tslint is enabled for TypeScript files or not.
13 | "tslint.enable": true,
14 | "typescript.tsdk": "node_modules/typescript/lib",
15 | // Configure glob patterns for excluding files and folders.
16 | "files.exclude": {
17 | "**/.git": true,
18 | "node_modules": true,
19 | "dist/": true
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/src/app/equal-to-validator/equal-to-validator.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnDestroy, OnInit } from "@angular/core";
2 | import { equalTo, Validator } from "../items";
3 | import { ActivatedRoute } from "@angular/router";
4 |
5 | @Component({
6 | selector: "app-equals-to-field-validator",
7 | templateUrl: "./equal-to-validator.component.html",
8 | })
9 | export class EqualToValidatorComponent implements OnInit, OnDestroy {
10 | private sub: any;
11 | validatorItems = equalTo;
12 | item: string = this.validatorItems[0].name;
13 | currentValidator: Validator;
14 | selected = "reactiveForm";
15 |
16 | constructor(private route: ActivatedRoute) {}
17 |
18 | ngOnInit() {
19 | this.currentValidator = this.validatorItems.filter((x) => x.name === this.item)[0];
20 | this.sub = this.route.params.subscribe((params) => {
21 | this.item = params["id"];
22 | if (this.item) {
23 | this.currentValidator = this.validatorItems.filter((x) => x.name === this.item)[0];
24 | }
25 | });
26 | }
27 |
28 | ngOnDestroy() {
29 | this.sub.unsubscribe();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/androidstudio.css:
--------------------------------------------------------------------------------
1 | /*
2 | Date: 24 Fev 2015
3 | Author: Pedro Oliveira
4 | */
5 |
6 | .hljs {
7 | color: #a9b7c6;
8 | background: #282b2e;
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | }
13 |
14 | .hljs-number,
15 | .hljs-literal,
16 | .hljs-symbol,
17 | .hljs-bullet {
18 | color: #6897bb;
19 | }
20 |
21 | .hljs-keyword,
22 | .hljs-selector-tag,
23 | .hljs-deletion {
24 | color: #cc7832;
25 | }
26 |
27 | .hljs-variable,
28 | .hljs-template-variable,
29 | .hljs-link {
30 | color: #629755;
31 | }
32 |
33 | .hljs-comment,
34 | .hljs-quote {
35 | color: #808080;
36 | }
37 |
38 | .hljs-meta {
39 | color: #bbb529;
40 | }
41 |
42 | .hljs-string,
43 | .hljs-attribute,
44 | .hljs-addition {
45 | color: #6a8759;
46 | }
47 |
48 | .hljs-section,
49 | .hljs-title,
50 | .hljs-type {
51 | color: #ffc66d;
52 | }
53 |
54 | .hljs-name,
55 | .hljs-selector-id,
56 | .hljs-selector-class {
57 | color: #e8bf6a;
58 | }
59 |
60 | .hljs-emphasis {
61 | font-style: italic;
62 | }
63 |
64 | .hljs-strong {
65 | font-weight: bold;
66 | }
67 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Dark style from softwaremaniacs.org (c) Ivan Sagalaev
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #444;
12 | }
13 |
14 | .hljs-keyword,
15 | .hljs-selector-tag,
16 | .hljs-literal,
17 | .hljs-section,
18 | .hljs-link {
19 | color: white;
20 | }
21 |
22 | .hljs,
23 | .hljs-subst {
24 | color: #ddd;
25 | }
26 |
27 | .hljs-string,
28 | .hljs-title,
29 | .hljs-name,
30 | .hljs-type,
31 | .hljs-attribute,
32 | .hljs-symbol,
33 | .hljs-bullet,
34 | .hljs-built_in,
35 | .hljs-addition,
36 | .hljs-variable,
37 | .hljs-template-tag,
38 | .hljs-template-variable {
39 | color: #d88;
40 | }
41 |
42 | .hljs-comment,
43 | .hljs-quote,
44 | .hljs-deletion,
45 | .hljs-meta {
46 | color: #777;
47 | }
48 |
49 | .hljs-keyword,
50 | .hljs-selector-tag,
51 | .hljs-literal,
52 | .hljs-title,
53 | .hljs-section,
54 | .hljs-doctag,
55 | .hljs-type,
56 | .hljs-name,
57 | .hljs-strong {
58 | font-weight: bold;
59 | }
60 |
61 | .hljs-emphasis {
62 | font-style: italic;
63 | }
64 |
--------------------------------------------------------------------------------
/examples/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from "@angular/core/testing";
2 | import { AppComponent } from "./app.component";
3 |
4 | describe("AppComponent", () => {
5 | beforeEach(() => {
6 | TestBed.configureTestingModule({
7 | declarations: [AppComponent],
8 | });
9 | TestBed.compileComponents();
10 | });
11 |
12 | it("should create the app", async(() => {
13 | const fixture = TestBed.createComponent(AppComponent);
14 | const app = fixture.debugElement.componentInstance;
15 | expect(app).toBeTruthy();
16 | }));
17 |
18 | it(`should have as title 'app works!'`, async(() => {
19 | const fixture = TestBed.createComponent(AppComponent);
20 | const app = fixture.debugElement.componentInstance;
21 | expect(app.title).toEqual("app works!");
22 | }));
23 |
24 | it("should render title in a h1 tag", async(() => {
25 | const fixture = TestBed.createComponent(AppComponent);
26 | fixture.detectChanges();
27 | const compiled = fixture.debugElement.nativeElement;
28 | expect(compiled.querySelector("h1").textContent).toContain("app works!");
29 | }));
30 | });
31 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | // 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.
3 | "editor.tabSize": 4,
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.
5 | "editor.insertSpaces": true,
6 | // Controls if the editor should automatically format the line after typing
7 | "editor.formatOnType": false,
8 | // The default character set encoding to use when reading and writing files.
9 | "files.encoding": "utf8",
10 | // When enabled, will trim trailing whitespace when you save a file.
11 | "files.trimTrailingWhitespace": false,
12 | // Control whether tslint is enabled for TypeScript files or not.
13 | "tslint.enable": true,
14 | "typescript.tsdk": "node_modules/typescript/lib",
15 | // Configure glob patterns for excluding files and folders.
16 | "files.exclude": {
17 | "**/.git": true,
18 | "node_modules": true,
19 | "examples": true,
20 | "coverage/": true,
21 | "dist/": true
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Sebastian
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/codepen-embed.css:
--------------------------------------------------------------------------------
1 | /*
2 | codepen.io Embed Theme
3 | Author: Justin Perry
4 | Original theme - https://github.com/chriskempson/tomorrow-theme
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #222;
12 | color: #fff;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #777;
18 | }
19 |
20 | .hljs-variable,
21 | .hljs-template-variable,
22 | .hljs-tag,
23 | .hljs-regexp,
24 | .hljs-meta,
25 | .hljs-number,
26 | .hljs-built_in,
27 | .hljs-builtin-name,
28 | .hljs-literal,
29 | .hljs-params,
30 | .hljs-symbol,
31 | .hljs-bullet,
32 | .hljs-link,
33 | .hljs-deletion {
34 | color: #ab875d;
35 | }
36 |
37 | .hljs-section,
38 | .hljs-title,
39 | .hljs-name,
40 | .hljs-selector-id,
41 | .hljs-selector-class,
42 | .hljs-type,
43 | .hljs-attribute {
44 | color: #9b869b;
45 | }
46 |
47 | .hljs-string,
48 | .hljs-keyword,
49 | .hljs-selector-tag,
50 | .hljs-addition {
51 | color: #8f9c6c;
52 | }
53 |
54 | .hljs-emphasis {
55 | font-style: italic;
56 | }
57 |
58 | .hljs-strong {
59 | font-weight: bold;
60 | }
61 |
--------------------------------------------------------------------------------
/projects/ngx-validators/README.md:
--------------------------------------------------------------------------------
1 | # NgxValidators
2 |
3 | This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0.
4 |
5 | ## Code scaffolding
6 |
7 | Run `ng generate component component-name --project ngx-validators` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-validators`.
8 |
9 | > Note: Don't forget to add `--project ngx-validators` or else it will be added to the default project in your `angular.json` file.
10 |
11 | ## Build
12 |
13 | Run `ng build ngx-validators` to build the project. The build artifacts will be stored in the `dist/` directory.
14 |
15 | ## Publishing
16 |
17 | After building your library with `ng build ngx-validators`, go to the dist folder `cd dist/ngx-validators` and run `npm publish`.
18 |
19 | ## Running unit tests
20 |
21 | Run `ng test ngx-validators` to execute the unit tests via [Karma](https://karma-runner.github.io).
22 |
23 | ## Further help
24 |
25 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
26 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/brown-paper.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Brown Paper style from goldblog.com.ua (c) Zaripov Yura
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #b7a68e url(./brown-papersq.png);
12 | }
13 |
14 | .hljs-keyword,
15 | .hljs-selector-tag,
16 | .hljs-literal {
17 | color: #005599;
18 | font-weight: bold;
19 | }
20 |
21 | .hljs,
22 | .hljs-subst {
23 | color: #363c69;
24 | }
25 |
26 | .hljs-string,
27 | .hljs-title,
28 | .hljs-section,
29 | .hljs-type,
30 | .hljs-attribute,
31 | .hljs-symbol,
32 | .hljs-bullet,
33 | .hljs-built_in,
34 | .hljs-addition,
35 | .hljs-variable,
36 | .hljs-template-tag,
37 | .hljs-template-variable,
38 | .hljs-link,
39 | .hljs-name {
40 | color: #2c009f;
41 | }
42 |
43 | .hljs-comment,
44 | .hljs-quote,
45 | .hljs-meta,
46 | .hljs-deletion {
47 | color: #802022;
48 | }
49 |
50 | .hljs-keyword,
51 | .hljs-selector-tag,
52 | .hljs-literal,
53 | .hljs-doctag,
54 | .hljs-title,
55 | .hljs-section,
56 | .hljs-type,
57 | .hljs-name,
58 | .hljs-strong {
59 | font-weight: bold;
60 | }
61 |
62 | .hljs-emphasis {
63 | font-style: italic;
64 | }
65 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/vs.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Visual Studio-like style based on original C# coloring by Jason Diamond
4 |
5 | */
6 | .hljs {
7 | display: block;
8 | overflow-x: auto;
9 | padding: 0.5em;
10 | background: white;
11 | color: black;
12 | }
13 |
14 | .hljs-comment,
15 | .hljs-quote,
16 | .hljs-variable {
17 | color: #008000;
18 | }
19 |
20 | .hljs-keyword,
21 | .hljs-selector-tag,
22 | .hljs-built_in,
23 | .hljs-name,
24 | .hljs-tag {
25 | color: #00f;
26 | }
27 |
28 | .hljs-string,
29 | .hljs-title,
30 | .hljs-section,
31 | .hljs-attribute,
32 | .hljs-literal,
33 | .hljs-template-tag,
34 | .hljs-template-variable,
35 | .hljs-type,
36 | .hljs-addition {
37 | color: #a31515;
38 | }
39 |
40 | .hljs-deletion,
41 | .hljs-selector-attr,
42 | .hljs-selector-pseudo,
43 | .hljs-meta {
44 | color: #2b91af;
45 | }
46 |
47 | .hljs-doctag {
48 | color: #808080;
49 | }
50 |
51 | .hljs-attr {
52 | color: #f00;
53 | }
54 |
55 | .hljs-symbol,
56 | .hljs-bullet,
57 | .hljs-link {
58 | color: #00b0e8;
59 | }
60 |
61 | .hljs-emphasis {
62 | font-style: italic;
63 | }
64 |
65 | .hljs-strong {
66 | font-weight: bold;
67 | }
68 |
--------------------------------------------------------------------------------
/examples/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import "zone.js/dist/long-stack-trace-zone";
4 | import "zone.js/dist/proxy.js";
5 | import "zone.js/dist/sync-test";
6 | import "zone.js/dist/jasmine-patch";
7 | import "zone.js/dist/async-test";
8 | import "zone.js/dist/fake-async-test";
9 | import { getTestBed } from "@angular/core/testing";
10 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing";
11 |
12 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
13 | declare var __karma__: any;
14 | declare var require: any;
15 |
16 | // Prevent Karma from running prematurely.
17 | __karma__.loaded = function () {};
18 |
19 | // First, initialize the Angular testing environment.
20 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
21 | // Then we find all the tests.
22 | const context = require.context("./", true, /\.spec\.ts$/);
23 | // And load the modules.
24 | context.keys().map(context);
25 | // Finally, start Karma to run the tests.
26 | __karma__.start();
27 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/far.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | FAR Style (c) MajestiC
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #000080;
12 | }
13 |
14 | .hljs,
15 | .hljs-subst {
16 | color: #0ff;
17 | }
18 |
19 | .hljs-string,
20 | .hljs-attribute,
21 | .hljs-symbol,
22 | .hljs-bullet,
23 | .hljs-built_in,
24 | .hljs-builtin-name,
25 | .hljs-template-tag,
26 | .hljs-template-variable,
27 | .hljs-addition {
28 | color: #ff0;
29 | }
30 |
31 | .hljs-keyword,
32 | .hljs-selector-tag,
33 | .hljs-section,
34 | .hljs-type,
35 | .hljs-name,
36 | .hljs-selector-id,
37 | .hljs-selector-class,
38 | .hljs-variable {
39 | color: #fff;
40 | }
41 |
42 | .hljs-comment,
43 | .hljs-quote,
44 | .hljs-doctag,
45 | .hljs-deletion {
46 | color: #888;
47 | }
48 |
49 | .hljs-number,
50 | .hljs-regexp,
51 | .hljs-literal,
52 | .hljs-link {
53 | color: #0f0;
54 | }
55 |
56 | .hljs-meta {
57 | color: #008080;
58 | }
59 |
60 | .hljs-keyword,
61 | .hljs-selector-tag,
62 | .hljs-title,
63 | .hljs-section,
64 | .hljs-name,
65 | .hljs-strong {
66 | font-weight: bold;
67 | }
68 |
69 | .hljs-emphasis {
70 | font-style: italic;
71 | }
72 |
--------------------------------------------------------------------------------
/examples/src/app/equal-to-validator/equal-to-validator.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Form
4 | Reactive Form
5 |
6 |
7 |
8 |
9 | EqualTo validator
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
25 |
30 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/arta.css:
--------------------------------------------------------------------------------
1 | /*
2 | Date: 17.V.2011
3 | Author: pumbur
4 | */
5 |
6 | .hljs {
7 | display: block;
8 | overflow-x: auto;
9 | padding: 0.5em;
10 | background: #222;
11 | }
12 |
13 | .hljs,
14 | .hljs-subst {
15 | color: #aaa;
16 | }
17 |
18 | .hljs-section {
19 | color: #fff;
20 | }
21 |
22 | .hljs-comment,
23 | .hljs-quote,
24 | .hljs-meta {
25 | color: #444;
26 | }
27 |
28 | .hljs-string,
29 | .hljs-symbol,
30 | .hljs-bullet,
31 | .hljs-regexp {
32 | color: #ffcc33;
33 | }
34 |
35 | .hljs-number,
36 | .hljs-addition {
37 | color: #00cc66;
38 | }
39 |
40 | .hljs-built_in,
41 | .hljs-builtin-name,
42 | .hljs-literal,
43 | .hljs-type,
44 | .hljs-template-variable,
45 | .hljs-attribute,
46 | .hljs-link {
47 | color: #32aaee;
48 | }
49 |
50 | .hljs-keyword,
51 | .hljs-selector-tag,
52 | .hljs-name,
53 | .hljs-selector-id,
54 | .hljs-selector-class {
55 | color: #6644aa;
56 | }
57 |
58 | .hljs-title,
59 | .hljs-variable,
60 | .hljs-deletion,
61 | .hljs-template-tag {
62 | color: #bb1166;
63 | }
64 |
65 | .hljs-section,
66 | .hljs-doctag,
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
71 | .hljs-emphasis {
72 | font-style: italic;
73 | }
74 |
--------------------------------------------------------------------------------
/projects/ngx-validators/src/lib/abstract-control-util.ts:
--------------------------------------------------------------------------------
1 | import type { AbstractControl } from "@angular/forms";
2 |
3 | export class AbstractControlUtil {
4 | static isNotPresent(control: AbstractControl): boolean {
5 | const value = control.value;
6 | if (value === undefined || value === null) {
7 | return true;
8 | }
9 | return value !== "" ? false : true;
10 | }
11 |
12 | static addError(
13 | control: AbstractControl | null,
14 | errorId: string,
15 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
16 | value: any
17 | ) {
18 | if (!control) {
19 | return;
20 | }
21 | if (!control.errors) {
22 | control.setErrors({ [errorId]: value });
23 | } else if (!control.hasError(errorId)) {
24 | control.errors[errorId] = value;
25 | }
26 | }
27 |
28 | static removeError(control: AbstractControl | null, errorId: string) {
29 | if (!control) {
30 | return;
31 | }
32 | if (control.errors && control.hasError(errorId)) {
33 | if (Object.keys(control.errors).length > 1) {
34 | delete control.errors[errorId];
35 | } else {
36 | control.setErrors(null);
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/color-brewer.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Colorbrewer theme
4 | Original: https://github.com/mbostock/colorbrewer-theme (c) Mike Bostock
5 | Ported by Fabrício Tavares de Oliveira
6 |
7 | */
8 |
9 | .hljs {
10 | display: block;
11 | overflow-x: auto;
12 | padding: 0.5em;
13 | background: #fff;
14 | }
15 |
16 | .hljs,
17 | .hljs-subst {
18 | color: #000;
19 | }
20 |
21 | .hljs-string,
22 | .hljs-meta,
23 | .hljs-symbol,
24 | .hljs-template-tag,
25 | .hljs-template-variable,
26 | .hljs-addition {
27 | color: #756bb1;
28 | }
29 |
30 | .hljs-comment,
31 | .hljs-quote {
32 | color: #636363;
33 | }
34 |
35 | .hljs-number,
36 | .hljs-regexp,
37 | .hljs-literal,
38 | .hljs-bullet,
39 | .hljs-link {
40 | color: #31a354;
41 | }
42 |
43 | .hljs-deletion,
44 | .hljs-variable {
45 | color: #88f;
46 | }
47 |
48 | .hljs-keyword,
49 | .hljs-selector-tag,
50 | .hljs-title,
51 | .hljs-section,
52 | .hljs-built_in,
53 | .hljs-doctag,
54 | .hljs-type,
55 | .hljs-tag,
56 | .hljs-name,
57 | .hljs-selector-id,
58 | .hljs-selector-class,
59 | .hljs-strong {
60 | color: #3182bd;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-attribute {
68 | color: #e6550d;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/ir-black.css:
--------------------------------------------------------------------------------
1 | /*
2 | IR_Black style (c) Vasily Mikhailitchenko
3 | */
4 |
5 | .hljs {
6 | display: block;
7 | overflow-x: auto;
8 | padding: 0.5em;
9 | background: #000;
10 | color: #f8f8f8;
11 | }
12 |
13 | .hljs-comment,
14 | .hljs-quote,
15 | .hljs-meta {
16 | color: #7c7c7c;
17 | }
18 |
19 | .hljs-keyword,
20 | .hljs-selector-tag,
21 | .hljs-tag,
22 | .hljs-name {
23 | color: #96cbfe;
24 | }
25 |
26 | .hljs-attribute,
27 | .hljs-selector-id {
28 | color: #ffffb6;
29 | }
30 |
31 | .hljs-string,
32 | .hljs-selector-attr,
33 | .hljs-selector-pseudo,
34 | .hljs-addition {
35 | color: #a8ff60;
36 | }
37 |
38 | .hljs-subst {
39 | color: #daefa3;
40 | }
41 |
42 | .hljs-regexp,
43 | .hljs-link {
44 | color: #e9c062;
45 | }
46 |
47 | .hljs-title,
48 | .hljs-section,
49 | .hljs-type,
50 | .hljs-doctag {
51 | color: #ffffb6;
52 | }
53 |
54 | .hljs-symbol,
55 | .hljs-bullet,
56 | .hljs-variable,
57 | .hljs-template-variable,
58 | .hljs-literal {
59 | color: #c6c5fe;
60 | }
61 |
62 | .hljs-number,
63 | .hljs-deletion {
64 | color: #ff73fd;
65 | }
66 |
67 | .hljs-emphasis {
68 | font-style: italic;
69 | }
70 |
71 | .hljs-strong {
72 | font-weight: bold;
73 | }
74 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/magula.css:
--------------------------------------------------------------------------------
1 | /*
2 | Description: Magula style for highligh.js
3 | Author: Ruslan Keba
4 | Website: http://rukeba.com/
5 | Version: 1.0
6 | Date: 2009-01-03
7 | Music: Aphex Twin / Xtal
8 | */
9 |
10 | .hljs {
11 | display: block;
12 | overflow-x: auto;
13 | padding: 0.5em;
14 | background-color: #f4f4f4;
15 | }
16 |
17 | .hljs,
18 | .hljs-subst {
19 | color: black;
20 | }
21 |
22 | .hljs-string,
23 | .hljs-title,
24 | .hljs-symbol,
25 | .hljs-bullet,
26 | .hljs-attribute,
27 | .hljs-addition,
28 | .hljs-variable,
29 | .hljs-template-tag,
30 | .hljs-template-variable {
31 | color: #050;
32 | }
33 |
34 | .hljs-comment,
35 | .hljs-quote {
36 | color: #777;
37 | }
38 |
39 | .hljs-number,
40 | .hljs-regexp,
41 | .hljs-literal,
42 | .hljs-type,
43 | .hljs-link {
44 | color: #800;
45 | }
46 |
47 | .hljs-deletion,
48 | .hljs-meta {
49 | color: #00e;
50 | }
51 |
52 | .hljs-keyword,
53 | .hljs-selector-tag,
54 | .hljs-doctag,
55 | .hljs-title,
56 | .hljs-section,
57 | .hljs-built_in,
58 | .hljs-tag,
59 | .hljs-name {
60 | font-weight: bold;
61 | color: navy;
62 | }
63 |
64 | .hljs-emphasis {
65 | font-style: italic;
66 | }
67 |
68 | .hljs-strong {
69 | font-weight: bold;
70 | }
71 |
--------------------------------------------------------------------------------
/examples/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
5 | ngx-validators
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{ item.name }}
17 |
18 |
24 | {{ validator.name }}
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/github-gist.css:
--------------------------------------------------------------------------------
1 | /**
2 | * GitHub Gist Theme
3 | * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
4 | */
5 |
6 | .hljs {
7 | display: block;
8 | background: white;
9 | padding: 0.5em;
10 | color: #333333;
11 | overflow-x: auto;
12 | }
13 |
14 | .hljs-comment,
15 | .hljs-meta {
16 | color: #969896;
17 | }
18 |
19 | .hljs-string,
20 | .hljs-variable,
21 | .hljs-template-variable,
22 | .hljs-strong,
23 | .hljs-emphasis,
24 | .hljs-quote {
25 | color: #df5000;
26 | }
27 |
28 | .hljs-keyword,
29 | .hljs-selector-tag,
30 | .hljs-type {
31 | color: #a71d5d;
32 | }
33 |
34 | .hljs-literal,
35 | .hljs-symbol,
36 | .hljs-bullet,
37 | .hljs-attribute {
38 | color: #0086b3;
39 | }
40 |
41 | .hljs-section,
42 | .hljs-name {
43 | color: #63a35c;
44 | }
45 |
46 | .hljs-tag {
47 | color: #333333;
48 | }
49 |
50 | .hljs-title,
51 | .hljs-attr,
52 | .hljs-selector-id,
53 | .hljs-selector-class,
54 | .hljs-selector-attr,
55 | .hljs-selector-pseudo {
56 | color: #795da3;
57 | }
58 |
59 | .hljs-addition {
60 | color: #55a532;
61 | background-color: #eaffea;
62 | }
63 |
64 | .hljs-deletion {
65 | color: #bd2c00;
66 | background-color: #ffecec;
67 | }
68 |
69 | .hljs-link {
70 | text-decoration: underline;
71 | }
72 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/darcula.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Darcula color scheme from the JetBrains family of IDEs
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #2b2b2b;
12 | }
13 |
14 | .hljs {
15 | color: #bababa;
16 | }
17 |
18 | .hljs-strong,
19 | .hljs-emphasis {
20 | color: #a8a8a2;
21 | }
22 |
23 | .hljs-bullet,
24 | .hljs-quote,
25 | .hljs-link,
26 | .hljs-number,
27 | .hljs-regexp,
28 | .hljs-literal {
29 | color: #6896ba;
30 | }
31 |
32 | .hljs-code,
33 | .hljs-selector-class {
34 | color: #a6e22e;
35 | }
36 |
37 | .hljs-emphasis {
38 | font-style: italic;
39 | }
40 |
41 | .hljs-keyword,
42 | .hljs-selector-tag,
43 | .hljs-section,
44 | .hljs-attribute,
45 | .hljs-name,
46 | .hljs-variable {
47 | color: #cb7832;
48 | }
49 |
50 | .hljs-params {
51 | color: #b9b9b9;
52 | }
53 |
54 | .hljs-string {
55 | color: #6a8759;
56 | }
57 |
58 | .hljs-subst,
59 | .hljs-type,
60 | .hljs-built_in,
61 | .hljs-builtin-name,
62 | .hljs-symbol,
63 | .hljs-selector-id,
64 | .hljs-selector-attr,
65 | .hljs-selector-pseudo,
66 | .hljs-template-tag,
67 | .hljs-template-variable,
68 | .hljs-addition {
69 | color: #e0c46c;
70 | }
71 |
72 | .hljs-comment,
73 | .hljs-deletion,
74 | .hljs-meta {
75 | color: #7f7f7f;
76 | }
77 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/monokai.css:
--------------------------------------------------------------------------------
1 | /*
2 | Monokai style - ported by Luigi Maselli - http://grigio.org
3 | */
4 |
5 | .hljs {
6 | display: block;
7 | overflow-x: auto;
8 | padding: 0.5em;
9 | background: #272822;
10 | color: #ddd;
11 | }
12 |
13 | .hljs-tag,
14 | .hljs-keyword,
15 | .hljs-selector-tag,
16 | .hljs-literal,
17 | .hljs-strong,
18 | .hljs-name {
19 | color: #f92672;
20 | }
21 |
22 | .hljs-code {
23 | color: #66d9ef;
24 | }
25 |
26 | .hljs-class .hljs-title {
27 | color: white;
28 | }
29 |
30 | .hljs-attribute,
31 | .hljs-symbol,
32 | .hljs-regexp,
33 | .hljs-link {
34 | color: #bf79db;
35 | }
36 |
37 | .hljs-string,
38 | .hljs-bullet,
39 | .hljs-subst,
40 | .hljs-title,
41 | .hljs-section,
42 | .hljs-emphasis,
43 | .hljs-type,
44 | .hljs-built_in,
45 | .hljs-builtin-name,
46 | .hljs-selector-attr,
47 | .hljs-selector-pseudo,
48 | .hljs-addition,
49 | .hljs-variable,
50 | .hljs-template-tag,
51 | .hljs-template-variable {
52 | color: #a6e22e;
53 | }
54 |
55 | .hljs-comment,
56 | .hljs-quote,
57 | .hljs-deletion,
58 | .hljs-meta {
59 | color: #75715e;
60 | }
61 |
62 | .hljs-keyword,
63 | .hljs-selector-tag,
64 | .hljs-literal,
65 | .hljs-doctag,
66 | .hljs-title,
67 | .hljs-section,
68 | .hljs-type,
69 | .hljs-selector-id {
70 | font-weight: bold;
71 | }
72 |
--------------------------------------------------------------------------------
/examples/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/0.13/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: "",
7 | frameworks: ["jasmine", "@angular-devkit/build-angular"],
8 | plugins: [
9 | require("karma-jasmine"),
10 | require("karma-chrome-launcher"),
11 | require("karma-jasmine-html-reporter"),
12 | require("karma-coverage-istanbul-reporter"),
13 | require("@angular-devkit/build-angular/plugins/karma"),
14 | ],
15 | client: {
16 | clearContext: false, // leave Jasmine Spec Runner output visible in browser
17 | },
18 | files: [],
19 | preprocessors: {},
20 | mime: {
21 | "text/x-typescript": ["ts", "tsx"],
22 | },
23 | coverageIstanbulReporter: {
24 | dir: require("path").join(__dirname, "coverage"),
25 | reports: ["html", "lcovonly"],
26 | fixWebpackSourcePaths: true,
27 | },
28 |
29 | reporters:
30 | config.angularCli && config.angularCli.codeCoverage ? ["progress", "coverage-istanbul"] : ["progress", "kjhtml"],
31 | port: 9876,
32 | colors: true,
33 | logLevel: config.LOG_INFO,
34 | autoWatch: true,
35 | browsers: ["Chrome"],
36 | singleRun: false,
37 | });
38 | };
39 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/tomorrow.css:
--------------------------------------------------------------------------------
1 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
2 |
3 | /* Tomorrow Comment */
4 | .hljs-comment,
5 | .hljs-quote {
6 | color: #8e908c;
7 | }
8 |
9 | /* Tomorrow Red */
10 | .hljs-variable,
11 | .hljs-template-variable,
12 | .hljs-tag,
13 | .hljs-name,
14 | .hljs-selector-id,
15 | .hljs-selector-class,
16 | .hljs-regexp,
17 | .hljs-deletion {
18 | color: #c82829;
19 | }
20 |
21 | /* Tomorrow Orange */
22 | .hljs-number,
23 | .hljs-built_in,
24 | .hljs-builtin-name,
25 | .hljs-literal,
26 | .hljs-type,
27 | .hljs-params,
28 | .hljs-meta,
29 | .hljs-link {
30 | color: #f5871f;
31 | }
32 |
33 | /* Tomorrow Yellow */
34 | .hljs-attribute {
35 | color: #eab700;
36 | }
37 |
38 | /* Tomorrow Green */
39 | .hljs-string,
40 | .hljs-symbol,
41 | .hljs-bullet,
42 | .hljs-addition {
43 | color: #718c00;
44 | }
45 |
46 | /* Tomorrow Blue */
47 | .hljs-title,
48 | .hljs-section {
49 | color: #4271ae;
50 | }
51 |
52 | /* Tomorrow Purple */
53 | .hljs-keyword,
54 | .hljs-selector-tag {
55 | color: #8959a8;
56 | }
57 |
58 | .hljs {
59 | display: block;
60 | overflow-x: auto;
61 | background: white;
62 | color: #4d4d4c;
63 | padding: 0.5em;
64 | }
65 |
66 | .hljs-emphasis {
67 | font-style: italic;
68 | }
69 |
70 | .hljs-strong {
71 | font-weight: bold;
72 | }
73 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/zenburn.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov
4 | based on dark.css by Ivan Sagalaev
5 |
6 | */
7 |
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | background: #3f3f3f;
13 | color: #dcdcdc;
14 | }
15 |
16 | .hljs-keyword,
17 | .hljs-selector-tag,
18 | .hljs-tag {
19 | color: #e3ceab;
20 | }
21 |
22 | .hljs-template-tag {
23 | color: #dcdcdc;
24 | }
25 |
26 | .hljs-number {
27 | color: #8cd0d3;
28 | }
29 |
30 | .hljs-variable,
31 | .hljs-template-variable,
32 | .hljs-attribute {
33 | color: #efdcbc;
34 | }
35 |
36 | .hljs-literal {
37 | color: #efefaf;
38 | }
39 |
40 | .hljs-subst {
41 | color: #8f8f8f;
42 | }
43 |
44 | .hljs-title,
45 | .hljs-name,
46 | .hljs-selector-id,
47 | .hljs-selector-class,
48 | .hljs-section,
49 | .hljs-type {
50 | color: #efef8f;
51 | }
52 |
53 | .hljs-symbol,
54 | .hljs-bullet,
55 | .hljs-link {
56 | color: #dca3a3;
57 | }
58 |
59 | .hljs-deletion,
60 | .hljs-string,
61 | .hljs-built_in,
62 | .hljs-builtin-name {
63 | color: #cc9393;
64 | }
65 |
66 | .hljs-addition,
67 | .hljs-comment,
68 | .hljs-quote,
69 | .hljs-meta {
70 | color: #7f9f7f;
71 | }
72 |
73 | .hljs-emphasis {
74 | font-style: italic;
75 | }
76 |
77 | .hljs-strong {
78 | font-weight: bold;
79 | }
80 |
--------------------------------------------------------------------------------
/examples/README.md:
--------------------------------------------------------------------------------
1 | # Examples
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0-beta.32.3.
4 |
5 | ## Development server
6 |
7 | 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.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 | Before running the tests make sure you are serving the app via `ng serve`.
25 |
26 | ## Further help
27 |
28 | 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).
29 |
30 | ## Build for gh-pages
31 |
32 | `ng build --prod --base-href "https://Nightapes.github.io/ngx-validators/"`
33 |
34 | `ngh` to update gh-page
35 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/email-validator.component.ts:
--------------------------------------------------------------------------------
1 | import { Validator } from "./../items";
2 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
3 | import { EmailValidators } from "ngx-validators";
4 | import { ActivatedRoute } from "@angular/router";
5 |
6 | import { isNumber } from "util";
7 | import { Component } from "@angular/core";
8 | import { OnInit } from "@angular/core";
9 | import { OnDestroy } from "@angular/core";
10 | import { email } from "../items";
11 |
12 | @Component({
13 | selector: "email-validator",
14 | templateUrl: "./email-validator.component.html",
15 | })
16 | export class EmailValidatorComponent implements OnInit, OnDestroy {
17 | private sub: any;
18 | emailItems = email;
19 | item: string = this.emailItems[0].name;
20 | currentValidator: Validator;
21 | selected = "reactiveForm";
22 |
23 | constructor(private route: ActivatedRoute) {}
24 |
25 | ngOnInit() {
26 | this.currentValidator = this.emailItems.filter((x) => x.name === this.item)[0];
27 | this.sub = this.route.params.subscribe((params) => {
28 | this.item = params["id"];
29 | if (this.item) {
30 | this.currentValidator = this.emailItems.filter((x) => x.name === this.item)[0];
31 | }
32 | });
33 | }
34 |
35 | ngOnDestroy() {
36 | this.sub.unsubscribe();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/projects/ngx-validators/src/public-api.ts:
--------------------------------------------------------------------------------
1 | // validators
2 | export { PasswordValidators } from "./lib/password/password-validators";
3 | export { EmailValidators } from "./lib/email/email-validators";
4 | export * from "./lib/email/email-util";
5 | export { UniversalValidators } from "./lib/universal/universal-validators";
6 | export { CreditCardValidators } from "./lib/creditcard/creditcard-validators";
7 |
8 | // Directive
9 | export { PasswordValidatorDirective } from "./lib/password/password.directive";
10 | export { EmailValidatorDirective, EmailSuggestValidatorDirective } from "./lib/email/email.directive";
11 | export {
12 | IsInRangeValidatorDirective,
13 | IsNumberValidatorDirective,
14 | MaxValidatorDirective,
15 | MinValidatorDirective,
16 | WhiteSpaceValidatorDirective,
17 | EmptyStringValidatorDirective,
18 | TypeValidatorDirective,
19 | MinDateValidatorDirective,
20 | MaxDateValidatorDirective,
21 | } from "./lib/universal/universal.directive";
22 | export { CreditCardValidatorDirective } from "./lib/creditcard/creditcard.directive";
23 |
24 | // Module
25 | export { ValidatorsModule } from "./lib/validators.module";
26 |
27 | // Util
28 | export { AbstractControlUtil } from "./lib/abstract-control-util";
29 |
30 | // EqualTo
31 | export * from "./lib/equal-to/equal-to.directive";
32 | export * from "./lib/equal-to/equal-to-validator";
33 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/school-book.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | School Book style from goldblog.com.ua (c) Zaripov Yura
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 15px 0.5em 0.5em 30px;
11 | font-size: 11px;
12 | line-height: 16px;
13 | }
14 |
15 | pre {
16 | background: #f6f6ae url(./school-book.png);
17 | border-top: solid 2px #d2e8b9;
18 | border-bottom: solid 1px #d2e8b9;
19 | }
20 |
21 | .hljs-keyword,
22 | .hljs-selector-tag,
23 | .hljs-literal {
24 | color: #005599;
25 | font-weight: bold;
26 | }
27 |
28 | .hljs,
29 | .hljs-subst {
30 | color: #3e5915;
31 | }
32 |
33 | .hljs-string,
34 | .hljs-title,
35 | .hljs-section,
36 | .hljs-type,
37 | .hljs-symbol,
38 | .hljs-bullet,
39 | .hljs-attribute,
40 | .hljs-built_in,
41 | .hljs-builtin-name,
42 | .hljs-addition,
43 | .hljs-variable,
44 | .hljs-template-tag,
45 | .hljs-template-variable,
46 | .hljs-link {
47 | color: #2c009f;
48 | }
49 |
50 | .hljs-comment,
51 | .hljs-quote,
52 | .hljs-deletion,
53 | .hljs-meta {
54 | color: #e60415;
55 | }
56 |
57 | .hljs-keyword,
58 | .hljs-selector-tag,
59 | .hljs-literal,
60 | .hljs-doctag,
61 | .hljs-title,
62 | .hljs-section,
63 | .hljs-type,
64 | .hljs-name,
65 | .hljs-selector-id,
66 | .hljs-strong {
67 | font-weight: bold;
68 | }
69 |
70 | .hljs-emphasis {
71 | font-style: italic;
72 | }
73 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/ocean.css:
--------------------------------------------------------------------------------
1 | /* Ocean Dark Theme */
2 | /* https://github.com/gavsiu */
3 | /* Original theme - https://github.com/chriskempson/base16 */
4 |
5 | /* Ocean Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #65737e;
9 | }
10 |
11 | /* Ocean Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-tag,
15 | .hljs-name,
16 | .hljs-selector-id,
17 | .hljs-selector-class,
18 | .hljs-regexp,
19 | .hljs-deletion {
20 | color: #bf616a;
21 | }
22 |
23 | /* Ocean Orange */
24 | .hljs-number,
25 | .hljs-built_in,
26 | .hljs-builtin-name,
27 | .hljs-literal,
28 | .hljs-type,
29 | .hljs-params,
30 | .hljs-meta,
31 | .hljs-link {
32 | color: #d08770;
33 | }
34 |
35 | /* Ocean Yellow */
36 | .hljs-attribute {
37 | color: #ebcb8b;
38 | }
39 |
40 | /* Ocean Green */
41 | .hljs-string,
42 | .hljs-symbol,
43 | .hljs-bullet,
44 | .hljs-addition {
45 | color: #a3be8c;
46 | }
47 |
48 | /* Ocean Blue */
49 | .hljs-title,
50 | .hljs-section {
51 | color: #8fa1b3;
52 | }
53 |
54 | /* Ocean Purple */
55 | .hljs-keyword,
56 | .hljs-selector-tag {
57 | color: #b48ead;
58 | }
59 |
60 | .hljs {
61 | display: block;
62 | overflow-x: auto;
63 | background: #2b303b;
64 | color: #c0c5ce;
65 | padding: 0.5em;
66 | }
67 |
68 | .hljs-emphasis {
69 | font-style: italic;
70 | }
71 |
72 | .hljs-strong {
73 | font-weight: bold;
74 | }
75 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/paraiso-dark.css:
--------------------------------------------------------------------------------
1 | /*
2 | Paraíso (dark)
3 | Created by Jan T. Sott (http://github.com/idleberg)
4 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
5 | */
6 |
7 | /* Paraíso Comment */
8 | .hljs-comment,
9 | .hljs-quote {
10 | color: #8d8687;
11 | }
12 |
13 | /* Paraíso Red */
14 | .hljs-variable,
15 | .hljs-template-variable,
16 | .hljs-tag,
17 | .hljs-name,
18 | .hljs-selector-id,
19 | .hljs-selector-class,
20 | .hljs-regexp,
21 | .hljs-link,
22 | .hljs-meta {
23 | color: #ef6155;
24 | }
25 |
26 | /* Paraíso Orange */
27 | .hljs-number,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params,
33 | .hljs-deletion {
34 | color: #f99b15;
35 | }
36 |
37 | /* Paraíso Yellow */
38 | .hljs-title,
39 | .hljs-section,
40 | .hljs-attribute {
41 | color: #fec418;
42 | }
43 |
44 | /* Paraíso Green */
45 | .hljs-string,
46 | .hljs-symbol,
47 | .hljs-bullet,
48 | .hljs-addition {
49 | color: #48b685;
50 | }
51 |
52 | /* Paraíso Purple */
53 | .hljs-keyword,
54 | .hljs-selector-tag {
55 | color: #815ba4;
56 | }
57 |
58 | .hljs {
59 | display: block;
60 | overflow-x: auto;
61 | background: #2f1e2e;
62 | color: #a39e9b;
63 | padding: 0.5em;
64 | }
65 |
66 | .hljs-emphasis {
67 | font-style: italic;
68 | }
69 |
70 | .hljs-strong {
71 | font-weight: bold;
72 | }
73 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/paraiso-light.css:
--------------------------------------------------------------------------------
1 | /*
2 | Paraíso (light)
3 | Created by Jan T. Sott (http://github.com/idleberg)
4 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
5 | */
6 |
7 | /* Paraíso Comment */
8 | .hljs-comment,
9 | .hljs-quote {
10 | color: #776e71;
11 | }
12 |
13 | /* Paraíso Red */
14 | .hljs-variable,
15 | .hljs-template-variable,
16 | .hljs-tag,
17 | .hljs-name,
18 | .hljs-selector-id,
19 | .hljs-selector-class,
20 | .hljs-regexp,
21 | .hljs-link,
22 | .hljs-meta {
23 | color: #ef6155;
24 | }
25 |
26 | /* Paraíso Orange */
27 | .hljs-number,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params,
33 | .hljs-deletion {
34 | color: #f99b15;
35 | }
36 |
37 | /* Paraíso Yellow */
38 | .hljs-title,
39 | .hljs-section,
40 | .hljs-attribute {
41 | color: #fec418;
42 | }
43 |
44 | /* Paraíso Green */
45 | .hljs-string,
46 | .hljs-symbol,
47 | .hljs-bullet,
48 | .hljs-addition {
49 | color: #48b685;
50 | }
51 |
52 | /* Paraíso Purple */
53 | .hljs-keyword,
54 | .hljs-selector-tag {
55 | color: #815ba4;
56 | }
57 |
58 | .hljs {
59 | display: block;
60 | overflow-x: auto;
61 | background: #e7e9db;
62 | color: #4f424c;
63 | padding: 0.5em;
64 | }
65 |
66 | .hljs-emphasis {
67 | font-style: italic;
68 | }
69 |
70 | .hljs-strong {
71 | font-weight: bold;
72 | }
73 |
--------------------------------------------------------------------------------
/examples/src/app/password-validator/password-validator.component.ts:
--------------------------------------------------------------------------------
1 | import { Validator } from "./../items";
2 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
3 | import { PasswordValidators } from "ngx-validators";
4 | import { ActivatedRoute } from "@angular/router";
5 |
6 | import { isNumber } from "util";
7 | import { Component } from "@angular/core";
8 | import { OnInit } from "@angular/core";
9 | import { OnDestroy } from "@angular/core";
10 | import { password } from "../items";
11 |
12 | @Component({
13 | selector: "password-validator",
14 | templateUrl: "./password-validator.component.html",
15 | })
16 | export class PasswordValidatorComponent implements OnInit, OnDestroy {
17 | private sub: any;
18 | passwordItems = password;
19 | item: string = this.passwordItems[0].name;
20 | currentValidator: Validator;
21 | selected = "reactiveForm";
22 |
23 | constructor(private route: ActivatedRoute) {}
24 |
25 | ngOnInit() {
26 | this.currentValidator = this.passwordItems.filter((x) => x.name === this.item)[0];
27 | this.sub = this.route.params.subscribe((params) => {
28 | this.item = params["id"];
29 | if (this.item) {
30 | this.currentValidator = this.passwordItems.filter((x) => x.name === this.item)[0];
31 | }
32 | });
33 | }
34 |
35 | ngOnDestroy() {
36 | this.sub.unsubscribe();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/qtcreator_dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Qt Creator dark color scheme
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #000000;
12 | }
13 |
14 | .hljs,
15 | .hljs-subst,
16 | .hljs-tag,
17 | .hljs-title {
18 | color: #aaaaaa;
19 | }
20 |
21 | .hljs-strong,
22 | .hljs-emphasis {
23 | color: #a8a8a2;
24 | }
25 |
26 | .hljs-bullet,
27 | .hljs-quote,
28 | .hljs-number,
29 | .hljs-regexp,
30 | .hljs-literal {
31 | color: #ff55ff;
32 | }
33 |
34 | .hljs-code .hljs-selector-class {
35 | color: #aaaaff;
36 | }
37 |
38 | .hljs-emphasis,
39 | .hljs-stronge,
40 | .hljs-type {
41 | font-style: italic;
42 | }
43 |
44 | .hljs-keyword,
45 | .hljs-selector-tag,
46 | .hljs-function,
47 | .hljs-section,
48 | .hljs-symbol,
49 | .hljs-name {
50 | color: #ffff55;
51 | }
52 |
53 | .hljs-attribute {
54 | color: #ff5555;
55 | }
56 |
57 | .hljs-variable,
58 | .hljs-params,
59 | .hljs-class .hljs-title {
60 | color: #8888ff;
61 | }
62 |
63 | .hljs-string,
64 | .hljs-selector-id,
65 | .hljs-selector-attr,
66 | .hljs-selector-pseudo,
67 | .hljs-type,
68 | .hljs-built_in,
69 | .hljs-builtin-name,
70 | .hljs-template-tag,
71 | .hljs-template-variable,
72 | .hljs-addition,
73 | .hljs-link {
74 | color: #ff55ff;
75 | }
76 |
77 | .hljs-comment,
78 | .hljs-meta,
79 | .hljs-deletion {
80 | color: #55ffff;
81 | }
82 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/qtcreator_light.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Qt Creator light color scheme
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #ffffff;
12 | }
13 |
14 | .hljs,
15 | .hljs-subst,
16 | .hljs-tag,
17 | .hljs-title {
18 | color: #000000;
19 | }
20 |
21 | .hljs-strong,
22 | .hljs-emphasis {
23 | color: #000000;
24 | }
25 |
26 | .hljs-bullet,
27 | .hljs-quote,
28 | .hljs-number,
29 | .hljs-regexp,
30 | .hljs-literal {
31 | color: #000080;
32 | }
33 |
34 | .hljs-code .hljs-selector-class {
35 | color: #800080;
36 | }
37 |
38 | .hljs-emphasis,
39 | .hljs-stronge,
40 | .hljs-type {
41 | font-style: italic;
42 | }
43 |
44 | .hljs-keyword,
45 | .hljs-selector-tag,
46 | .hljs-function,
47 | .hljs-section,
48 | .hljs-symbol,
49 | .hljs-name {
50 | color: #808000;
51 | }
52 |
53 | .hljs-attribute {
54 | color: #800000;
55 | }
56 |
57 | .hljs-variable,
58 | .hljs-params,
59 | .hljs-class .hljs-title {
60 | color: #0055af;
61 | }
62 |
63 | .hljs-string,
64 | .hljs-selector-id,
65 | .hljs-selector-attr,
66 | .hljs-selector-pseudo,
67 | .hljs-type,
68 | .hljs-built_in,
69 | .hljs-builtin-name,
70 | .hljs-template-tag,
71 | .hljs-template-variable,
72 | .hljs-addition,
73 | .hljs-link {
74 | color: #008000;
75 | }
76 |
77 | .hljs-comment,
78 | .hljs-meta,
79 | .hljs-deletion {
80 | color: #008000;
81 | }
82 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/dracula.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Dracula Theme v1.2.0
4 |
5 | https://github.com/zenorocha/dracula-theme
6 |
7 | Copyright 2015, All rights reserved
8 |
9 | Code licensed under the MIT license
10 | http://zenorocha.mit-license.org
11 |
12 | @author Éverton Ribeiro
13 | @author Zeno Rocha
14 |
15 | */
16 |
17 | .hljs {
18 | display: block;
19 | overflow-x: auto;
20 | padding: 0.5em;
21 | background: #282a36;
22 | }
23 |
24 | .hljs-keyword,
25 | .hljs-selector-tag,
26 | .hljs-literal,
27 | .hljs-section,
28 | .hljs-link {
29 | color: #8be9fd;
30 | }
31 |
32 | .hljs-function .hljs-keyword {
33 | color: #ff79c6;
34 | }
35 |
36 | .hljs,
37 | .hljs-subst {
38 | color: #f8f8f2;
39 | }
40 |
41 | .hljs-string,
42 | .hljs-title,
43 | .hljs-name,
44 | .hljs-type,
45 | .hljs-attribute,
46 | .hljs-symbol,
47 | .hljs-bullet,
48 | .hljs-addition,
49 | .hljs-variable,
50 | .hljs-template-tag,
51 | .hljs-template-variable {
52 | color: #f1fa8c;
53 | }
54 |
55 | .hljs-comment,
56 | .hljs-quote,
57 | .hljs-deletion,
58 | .hljs-meta {
59 | color: #6272a4;
60 | }
61 |
62 | .hljs-keyword,
63 | .hljs-selector-tag,
64 | .hljs-literal,
65 | .hljs-title,
66 | .hljs-section,
67 | .hljs-doctag,
68 | .hljs-type,
69 | .hljs-name,
70 | .hljs-strong {
71 | font-weight: bold;
72 | }
73 |
74 | .hljs-emphasis {
75 | font-style: italic;
76 | }
77 |
--------------------------------------------------------------------------------
/examples/src/app/universal-validator/universal-validator.component.ts:
--------------------------------------------------------------------------------
1 | import { Validator } from "./../items";
2 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
3 | import { UniversalValidators } from "ngx-validators";
4 | import { ActivatedRoute } from "@angular/router";
5 |
6 | import { isNumber } from "util";
7 | import { Component } from "@angular/core";
8 | import { OnInit } from "@angular/core";
9 | import { OnDestroy } from "@angular/core";
10 | import { universal } from "../items";
11 |
12 | @Component({
13 | selector: "universal-validator",
14 | templateUrl: "./universal-validator.component.html",
15 | })
16 | export class UniversalValidatorComponent implements OnInit, OnDestroy {
17 | private sub: any;
18 | universalItems = universal;
19 | item: string = this.universalItems[0].name;
20 | currentValidator: Validator;
21 | selected = "reactiveForm";
22 |
23 | constructor(private route: ActivatedRoute) {}
24 |
25 | ngOnInit() {
26 | this.currentValidator = this.universalItems.filter((x) => x.name === this.item)[0];
27 | this.sub = this.route.params.subscribe((params) => {
28 | this.item = params["id"];
29 | if (this.item) {
30 | this.currentValidator = this.universalItems.filter((x) => x.name === this.item)[0];
31 | }
32 | });
33 | }
34 |
35 | ngOnDestroy() {
36 | this.sub.unsubscribe();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/rainbow.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Style with support for rainbow parens
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #474949;
12 | color: #d1d9e1;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #969896;
18 | font-style: italic;
19 | }
20 |
21 | .hljs-keyword,
22 | .hljs-selector-tag,
23 | .hljs-literal,
24 | .hljs-type,
25 | .hljs-addition {
26 | color: #cc99cc;
27 | }
28 |
29 | .hljs-number,
30 | .hljs-selector-attr,
31 | .hljs-selector-pseudo {
32 | color: #f99157;
33 | }
34 |
35 | .hljs-string,
36 | .hljs-doctag,
37 | .hljs-regexp {
38 | color: #8abeb7;
39 | }
40 |
41 | .hljs-title,
42 | .hljs-name,
43 | .hljs-section,
44 | .hljs-built_in {
45 | color: #b5bd68;
46 | }
47 |
48 | .hljs-variable,
49 | .hljs-template-variable,
50 | .hljs-selector-id,
51 | .hljs-class .hljs-title {
52 | color: #ffcc66;
53 | }
54 |
55 | .hljs-section,
56 | .hljs-name,
57 | .hljs-strong {
58 | font-weight: bold;
59 | }
60 |
61 | .hljs-symbol,
62 | .hljs-bullet,
63 | .hljs-subst,
64 | .hljs-meta,
65 | .hljs-link {
66 | color: #f99157;
67 | }
68 |
69 | .hljs-deletion {
70 | color: #dc322f;
71 | }
72 |
73 | .hljs-formula {
74 | background: #eee8d5;
75 | }
76 |
77 | .hljs-attr,
78 | .hljs-attribute {
79 | color: #81a2be;
80 | }
81 |
82 | .hljs-emphasis {
83 | font-style: italic;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/app/creditcard-validator/creditcard-validator.component.ts:
--------------------------------------------------------------------------------
1 | import { Validator } from "./../items";
2 | import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
3 | import { CreditCardValidators } from "ngx-validators";
4 | import { ActivatedRoute } from "@angular/router";
5 |
6 | import { isNumber } from "util";
7 | import { Component } from "@angular/core";
8 | import { OnInit } from "@angular/core";
9 | import { OnDestroy } from "@angular/core";
10 | import { creditcards } from "../items";
11 |
12 | @Component({
13 | selector: "creditcard-validator",
14 | templateUrl: "./creditcard-validator.component.html",
15 | })
16 | export class CreditcardValidatorComponent implements OnInit, OnDestroy {
17 | private sub: any;
18 | creditcardItems = creditcards;
19 | item: string = this.creditcardItems[0].name;
20 | currentValidator: Validator;
21 | selected = "reactiveForm";
22 |
23 | constructor(private route: ActivatedRoute) {}
24 |
25 | ngOnInit() {
26 | this.currentValidator = this.creditcardItems.filter((x) => x.name === this.item)[0];
27 | this.sub = this.route.params.subscribe((params) => {
28 | this.item = params["id"];
29 | if (this.item) {
30 | this.currentValidator = this.creditcardItems.filter((x) => x.name === this.item)[0];
31 | }
32 | });
33 | }
34 |
35 | ngOnDestroy() {
36 | this.sub.unsubscribe();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/kimbie.dark.css:
--------------------------------------------------------------------------------
1 | /*
2 | Name: Kimbie (dark)
3 | Author: Jan T. Sott
4 | License: Creative Commons Attribution-ShareAlike 4.0 Unported License
5 | URL: https://github.com/idleberg/Kimbie-highlight.js
6 | */
7 |
8 | /* Kimbie Comment */
9 | .hljs-comment,
10 | .hljs-quote {
11 | color: #d6baad;
12 | }
13 |
14 | /* Kimbie Red */
15 | .hljs-variable,
16 | .hljs-template-variable,
17 | .hljs-tag,
18 | .hljs-name,
19 | .hljs-selector-id,
20 | .hljs-selector-class,
21 | .hljs-regexp,
22 | .hljs-meta {
23 | color: #dc3958;
24 | }
25 |
26 | /* Kimbie Orange */
27 | .hljs-number,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params,
33 | .hljs-deletion,
34 | .hljs-link {
35 | color: #f79a32;
36 | }
37 |
38 | /* Kimbie Yellow */
39 | .hljs-title,
40 | .hljs-section,
41 | .hljs-attribute {
42 | color: #f06431;
43 | }
44 |
45 | /* Kimbie Green */
46 | .hljs-string,
47 | .hljs-symbol,
48 | .hljs-bullet,
49 | .hljs-addition {
50 | color: #889b4a;
51 | }
52 |
53 | /* Kimbie Purple */
54 | .hljs-keyword,
55 | .hljs-selector-tag,
56 | .hljs-function {
57 | color: #98676a;
58 | }
59 |
60 | .hljs {
61 | display: block;
62 | overflow-x: auto;
63 | background: #221a0f;
64 | color: #d3af86;
65 | padding: 0.5em;
66 | }
67 |
68 | .hljs-emphasis {
69 | font-style: italic;
70 | }
71 |
72 | .hljs-strong {
73 | font-weight: bold;
74 | }
75 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/kimbie.light.css:
--------------------------------------------------------------------------------
1 | /*
2 | Name: Kimbie (light)
3 | Author: Jan T. Sott
4 | License: Creative Commons Attribution-ShareAlike 4.0 Unported License
5 | URL: https://github.com/idleberg/Kimbie-highlight.js
6 | */
7 |
8 | /* Kimbie Comment */
9 | .hljs-comment,
10 | .hljs-quote {
11 | color: #a57a4c;
12 | }
13 |
14 | /* Kimbie Red */
15 | .hljs-variable,
16 | .hljs-template-variable,
17 | .hljs-tag,
18 | .hljs-name,
19 | .hljs-selector-id,
20 | .hljs-selector-class,
21 | .hljs-regexp,
22 | .hljs-meta {
23 | color: #dc3958;
24 | }
25 |
26 | /* Kimbie Orange */
27 | .hljs-number,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params,
33 | .hljs-deletion,
34 | .hljs-link {
35 | color: #f79a32;
36 | }
37 |
38 | /* Kimbie Yellow */
39 | .hljs-title,
40 | .hljs-section,
41 | .hljs-attribute {
42 | color: #f06431;
43 | }
44 |
45 | /* Kimbie Green */
46 | .hljs-string,
47 | .hljs-symbol,
48 | .hljs-bullet,
49 | .hljs-addition {
50 | color: #889b4a;
51 | }
52 |
53 | /* Kimbie Purple */
54 | .hljs-keyword,
55 | .hljs-selector-tag,
56 | .hljs-function {
57 | color: #98676a;
58 | }
59 |
60 | .hljs {
61 | display: block;
62 | overflow-x: auto;
63 | background: #fbebd4;
64 | color: #84613d;
65 | padding: 0.5em;
66 | }
67 |
68 | .hljs-emphasis {
69 | font-style: italic;
70 | }
71 |
72 | .hljs-strong {
73 | font-weight: bold;
74 | }
75 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-dune-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Dune Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Dune Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #999580;
9 | }
10 |
11 | /* Atelier-Dune Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #d73737;
23 | }
24 |
25 | /* Atelier-Dune Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #b65611;
34 | }
35 |
36 | /* Atelier-Dune Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #60ac39;
41 | }
42 |
43 | /* Atelier-Dune Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #6684e1;
47 | }
48 |
49 | /* Atelier-Dune Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #b854d4;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #20201d;
59 | color: #a6a28c;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/monokai-sublime.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #23241f;
12 | }
13 |
14 | .hljs,
15 | .hljs-tag,
16 | .hljs-subst {
17 | color: #f8f8f2;
18 | }
19 |
20 | .hljs-strong,
21 | .hljs-emphasis {
22 | color: #a8a8a2;
23 | }
24 |
25 | .hljs-bullet,
26 | .hljs-quote,
27 | .hljs-number,
28 | .hljs-regexp,
29 | .hljs-literal,
30 | .hljs-link {
31 | color: #ae81ff;
32 | }
33 |
34 | .hljs-code,
35 | .hljs-title,
36 | .hljs-section,
37 | .hljs-selector-class {
38 | color: #a6e22e;
39 | }
40 |
41 | .hljs-strong {
42 | font-weight: bold;
43 | }
44 |
45 | .hljs-emphasis {
46 | font-style: italic;
47 | }
48 |
49 | .hljs-keyword,
50 | .hljs-selector-tag,
51 | .hljs-name,
52 | .hljs-attr {
53 | color: #f92672;
54 | }
55 |
56 | .hljs-symbol,
57 | .hljs-attribute {
58 | color: #66d9ef;
59 | }
60 |
61 | .hljs-params,
62 | .hljs-class .hljs-title {
63 | color: #f8f8f2;
64 | }
65 |
66 | .hljs-string,
67 | .hljs-type,
68 | .hljs-built_in,
69 | .hljs-builtin-name,
70 | .hljs-selector-id,
71 | .hljs-selector-attr,
72 | .hljs-selector-pseudo,
73 | .hljs-addition,
74 | .hljs-variable,
75 | .hljs-template-variable {
76 | color: #e6db74;
77 | }
78 |
79 | .hljs-comment,
80 | .hljs-deletion,
81 | .hljs-meta {
82 | color: #75715e;
83 | }
84 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-dune-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Dune Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Dune Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #7d7a68;
9 | }
10 |
11 | /* Atelier-Dune Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #d73737;
23 | }
24 |
25 | /* Atelier-Dune Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #b65611;
34 | }
35 |
36 | /* Atelier-Dune Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #60ac39;
41 | }
42 |
43 | /* Atelier-Dune Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #6684e1;
47 | }
48 |
49 | /* Atelier-Dune Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #b854d4;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #fefbec;
59 | color: #6e6b5e;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-heath-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Heath Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Heath Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #9e8f9e;
9 | }
10 |
11 | /* Atelier-Heath Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #ca402b;
23 | }
24 |
25 | /* Atelier-Heath Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #a65926;
34 | }
35 |
36 | /* Atelier-Heath Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #918b3b;
41 | }
42 |
43 | /* Atelier-Heath Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #516aec;
47 | }
48 |
49 | /* Atelier-Heath Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #7b59c0;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #1b181b;
59 | color: #ab9bab;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-heath-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Heath Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Heath Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #776977;
9 | }
10 |
11 | /* Atelier-Heath Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #ca402b;
23 | }
24 |
25 | /* Atelier-Heath Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #a65926;
34 | }
35 |
36 | /* Atelier-Heath Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #918b3b;
41 | }
42 |
43 | /* Atelier-Heath Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #516aec;
47 | }
48 |
49 | /* Atelier-Heath Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #7b59c0;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #f7f3f7;
59 | color: #695d69;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-forest-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Forest Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Forest Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #9c9491;
9 | }
10 |
11 | /* Atelier-Forest Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #f22c40;
23 | }
24 |
25 | /* Atelier-Forest Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #df5320;
34 | }
35 |
36 | /* Atelier-Forest Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #7b9726;
41 | }
42 |
43 | /* Atelier-Forest Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #407ee7;
47 | }
48 |
49 | /* Atelier-Forest Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #6666ea;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #1b1918;
59 | color: #a8a19f;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-forest-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Forest Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Forest Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #766e6b;
9 | }
10 |
11 | /* Atelier-Forest Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #f22c40;
23 | }
24 |
25 | /* Atelier-Forest Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #df5320;
34 | }
35 |
36 | /* Atelier-Forest Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #7b9726;
41 | }
42 |
43 | /* Atelier-Forest Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #407ee7;
47 | }
48 |
49 | /* Atelier-Forest Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #6666ea;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #f1efee;
59 | color: #68615e;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/tomorrow-night-bright.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Bright Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
4 |
5 | /* Tomorrow Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #969896;
9 | }
10 |
11 | /* Tomorrow Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-tag,
15 | .hljs-name,
16 | .hljs-selector-id,
17 | .hljs-selector-class,
18 | .hljs-regexp,
19 | .hljs-deletion {
20 | color: #d54e53;
21 | }
22 |
23 | /* Tomorrow Orange */
24 | .hljs-number,
25 | .hljs-built_in,
26 | .hljs-builtin-name,
27 | .hljs-literal,
28 | .hljs-type,
29 | .hljs-params,
30 | .hljs-meta,
31 | .hljs-link {
32 | color: #e78c45;
33 | }
34 |
35 | /* Tomorrow Yellow */
36 | .hljs-attribute {
37 | color: #e7c547;
38 | }
39 |
40 | /* Tomorrow Green */
41 | .hljs-string,
42 | .hljs-symbol,
43 | .hljs-bullet,
44 | .hljs-addition {
45 | color: #b9ca4a;
46 | }
47 |
48 | /* Tomorrow Blue */
49 | .hljs-title,
50 | .hljs-section {
51 | color: #7aa6da;
52 | }
53 |
54 | /* Tomorrow Purple */
55 | .hljs-keyword,
56 | .hljs-selector-tag {
57 | color: #c397d8;
58 | }
59 |
60 | .hljs {
61 | display: block;
62 | overflow-x: auto;
63 | background: black;
64 | color: #eaeaea;
65 | padding: 0.5em;
66 | }
67 |
68 | .hljs-emphasis {
69 | font-style: italic;
70 | }
71 |
72 | .hljs-strong {
73 | font-weight: bold;
74 | }
75 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/tomorrow-night-eighties.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Eighties Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
4 |
5 | /* Tomorrow Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #999999;
9 | }
10 |
11 | /* Tomorrow Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-tag,
15 | .hljs-name,
16 | .hljs-selector-id,
17 | .hljs-selector-class,
18 | .hljs-regexp,
19 | .hljs-deletion {
20 | color: #f2777a;
21 | }
22 |
23 | /* Tomorrow Orange */
24 | .hljs-number,
25 | .hljs-built_in,
26 | .hljs-builtin-name,
27 | .hljs-literal,
28 | .hljs-type,
29 | .hljs-params,
30 | .hljs-meta,
31 | .hljs-link {
32 | color: #f99157;
33 | }
34 |
35 | /* Tomorrow Yellow */
36 | .hljs-attribute {
37 | color: #ffcc66;
38 | }
39 |
40 | /* Tomorrow Green */
41 | .hljs-string,
42 | .hljs-symbol,
43 | .hljs-bullet,
44 | .hljs-addition {
45 | color: #99cc99;
46 | }
47 |
48 | /* Tomorrow Blue */
49 | .hljs-title,
50 | .hljs-section {
51 | color: #6699cc;
52 | }
53 |
54 | /* Tomorrow Purple */
55 | .hljs-keyword,
56 | .hljs-selector-tag {
57 | color: #cc99cc;
58 | }
59 |
60 | .hljs {
61 | display: block;
62 | overflow-x: auto;
63 | background: #2d2d2d;
64 | color: #cccccc;
65 | padding: 0.5em;
66 | }
67 |
68 | .hljs-emphasis {
69 | font-style: italic;
70 | }
71 |
72 | .hljs-strong {
73 | font-weight: bold;
74 | }
75 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-seaside-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Seaside Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Seaside Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #809980;
9 | }
10 |
11 | /* Atelier-Seaside Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #e6193c;
23 | }
24 |
25 | /* Atelier-Seaside Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #87711d;
34 | }
35 |
36 | /* Atelier-Seaside Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #29a329;
41 | }
42 |
43 | /* Atelier-Seaside Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #3d62f5;
47 | }
48 |
49 | /* Atelier-Seaside Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #ad2bee;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #131513;
59 | color: #8ca68c;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-seaside-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Seaside Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Seaside Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #687d68;
9 | }
10 |
11 | /* Atelier-Seaside Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #e6193c;
23 | }
24 |
25 | /* Atelier-Seaside Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #87711d;
34 | }
35 |
36 | /* Atelier-Seaside Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #29a329;
41 | }
42 |
43 | /* Atelier-Seaside Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #3d62f5;
47 | }
48 |
49 | /* Atelier-Seaside Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #ad2bee;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #f4fbf4;
59 | color: #5e6e5e;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/hopscotch.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Hopscotch
3 | * by Jan T. Sott
4 | * https://github.com/idleberg/Hopscotch
5 | *
6 | * This work is licensed under the Creative Commons CC0 1.0 Universal License
7 | */
8 |
9 | /* Comment */
10 | .hljs-comment,
11 | .hljs-quote {
12 | color: #989498;
13 | }
14 |
15 | /* Red */
16 | .hljs-variable,
17 | .hljs-template-variable,
18 | .hljs-attribute,
19 | .hljs-tag,
20 | .hljs-name,
21 | .hljs-selector-id,
22 | .hljs-selector-class,
23 | .hljs-regexp,
24 | .hljs-link,
25 | .hljs-deletion {
26 | color: #dd464c;
27 | }
28 |
29 | /* Orange */
30 | .hljs-number,
31 | .hljs-built_in,
32 | .hljs-builtin-name,
33 | .hljs-literal,
34 | .hljs-type,
35 | .hljs-params {
36 | color: #fd8b19;
37 | }
38 |
39 | /* Yellow */
40 | .hljs-class .hljs-title {
41 | color: #fdcc59;
42 | }
43 |
44 | /* Green */
45 | .hljs-string,
46 | .hljs-symbol,
47 | .hljs-bullet,
48 | .hljs-addition {
49 | color: #8fc13e;
50 | }
51 |
52 | /* Aqua */
53 | .hljs-meta {
54 | color: #149b93;
55 | }
56 |
57 | /* Blue */
58 | .hljs-function,
59 | .hljs-section,
60 | .hljs-title {
61 | color: #1290bf;
62 | }
63 |
64 | /* Purple */
65 | .hljs-keyword,
66 | .hljs-selector-tag {
67 | color: #c85e7c;
68 | }
69 |
70 | .hljs {
71 | display: block;
72 | background: #322931;
73 | color: #b9b5b8;
74 | padding: 0.5em;
75 | }
76 |
77 | .hljs-emphasis {
78 | font-style: italic;
79 | }
80 |
81 | .hljs-strong {
82 | font-weight: bold;
83 | }
84 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-lakeside-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Lakeside Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Lakeside Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #7195a8;
9 | }
10 |
11 | /* Atelier-Lakeside Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #d22d72;
23 | }
24 |
25 | /* Atelier-Lakeside Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #935c25;
34 | }
35 |
36 | /* Atelier-Lakeside Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #568c3b;
41 | }
42 |
43 | /* Atelier-Lakeside Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #257fad;
47 | }
48 |
49 | /* Atelier-Lakeside Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #6b6bb8;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #161b1d;
59 | color: #7ea2b4;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-lakeside-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Lakeside Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Lakeside Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #5a7b8c;
9 | }
10 |
11 | /* Atelier-Lakeside Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #d22d72;
23 | }
24 |
25 | /* Atelier-Lakeside Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #935c25;
34 | }
35 |
36 | /* Atelier-Lakeside Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #568c3b;
41 | }
42 |
43 | /* Atelier-Lakeside Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #257fad;
47 | }
48 |
49 | /* Atelier-Lakeside Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #6b6bb8;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #ebf8ff;
59 | color: #516d7b;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/xt256.css:
--------------------------------------------------------------------------------
1 | /*
2 | xt256.css
3 |
4 | Contact: initbar [at] protonmail [dot] ch
5 | : github.com/initbar
6 | */
7 |
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | color: #eaeaea;
12 | background: #000;
13 | padding: 0.5;
14 | }
15 |
16 | .hljs-subst {
17 | color: #eaeaea;
18 | }
19 |
20 | .hljs-emphasis {
21 | font-style: italic;
22 | }
23 |
24 | .hljs-strong {
25 | font-weight: bold;
26 | }
27 |
28 | .hljs-builtin-name,
29 | .hljs-type {
30 | color: #eaeaea;
31 | }
32 |
33 | .hljs-params {
34 | color: #da0000;
35 | }
36 |
37 | .hljs-literal,
38 | .hljs-number,
39 | .hljs-name {
40 | color: #ff0000;
41 | font-weight: bolder;
42 | }
43 |
44 | .hljs-comment {
45 | color: #969896;
46 | }
47 |
48 | .hljs-selector-id,
49 | .hljs-quote {
50 | color: #00ffff;
51 | }
52 |
53 | .hljs-template-variable,
54 | .hljs-variable,
55 | .hljs-title {
56 | color: #00ffff;
57 | font-weight: bold;
58 | }
59 |
60 | .hljs-selector-class,
61 | .hljs-keyword,
62 | .hljs-symbol {
63 | color: #fff000;
64 | }
65 |
66 | .hljs-string,
67 | .hljs-bullet {
68 | color: #00ff00;
69 | }
70 |
71 | .hljs-tag,
72 | .hljs-section {
73 | color: #000fff;
74 | }
75 |
76 | .hljs-selector-tag {
77 | color: #000fff;
78 | font-weight: bold;
79 | }
80 |
81 | .hljs-attribute,
82 | .hljs-built_in,
83 | .hljs-regexp,
84 | .hljs-link {
85 | color: #ff00ff;
86 | }
87 |
88 | .hljs-meta {
89 | color: #fff;
90 | font-weight: bolder;
91 | }
92 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/arduino-light.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Arduino® Light Theme - Stefania Mellai
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #ffffff;
12 | }
13 |
14 | .hljs,
15 | .hljs-subst {
16 | color: #434f54;
17 | }
18 |
19 | .hljs-keyword,
20 | .hljs-attribute,
21 | .hljs-selector-tag,
22 | .hljs-doctag,
23 | .hljs-name {
24 | color: #00979d;
25 | }
26 |
27 | .hljs-built_in,
28 | .hljs-literal,
29 | .hljs-bullet,
30 | .hljs-code,
31 | .hljs-addition {
32 | color: #d35400;
33 | }
34 |
35 | .hljs-regexp,
36 | .hljs-symbol,
37 | .hljs-variable,
38 | .hljs-template-variable,
39 | .hljs-link,
40 | .hljs-selector-attr,
41 | .hljs-selector-pseudo {
42 | color: #00979d;
43 | }
44 |
45 | .hljs-type,
46 | .hljs-string,
47 | .hljs-selector-id,
48 | .hljs-selector-class,
49 | .hljs-quote,
50 | .hljs-template-tag,
51 | .hljs-deletion {
52 | color: #005c5f;
53 | }
54 |
55 | .hljs-title,
56 | .hljs-section {
57 | color: #880000;
58 | font-weight: bold;
59 | }
60 |
61 | .hljs-comment {
62 | color: rgba(149, 165, 166, 0.8);
63 | }
64 |
65 | .hljs-meta-keyword {
66 | color: #728e00;
67 | }
68 |
69 | .hljs-meta {
70 | color: #728e00;
71 | color: #434f54;
72 | }
73 |
74 | .hljs-emphasis {
75 | font-style: italic;
76 | }
77 |
78 | .hljs-strong {
79 | font-weight: bold;
80 | }
81 |
82 | .hljs-function {
83 | color: #728e00;
84 | }
85 |
86 | .hljs-number {
87 | color: #8a7b52;
88 | }
89 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/googlecode.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Google Code style (c) Aahan Krish
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: white;
12 | color: black;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #800;
18 | }
19 |
20 | .hljs-keyword,
21 | .hljs-selector-tag,
22 | .hljs-section,
23 | .hljs-title,
24 | .hljs-name {
25 | color: #008;
26 | }
27 |
28 | .hljs-variable,
29 | .hljs-template-variable {
30 | color: #660;
31 | }
32 |
33 | .hljs-string,
34 | .hljs-selector-attr,
35 | .hljs-selector-pseudo,
36 | .hljs-regexp {
37 | color: #080;
38 | }
39 |
40 | .hljs-literal,
41 | .hljs-symbol,
42 | .hljs-bullet,
43 | .hljs-meta,
44 | .hljs-number,
45 | .hljs-link {
46 | color: #066;
47 | }
48 |
49 | .hljs-title,
50 | .hljs-doctag,
51 | .hljs-type,
52 | .hljs-attr,
53 | .hljs-built_in,
54 | .hljs-builtin-name,
55 | .hljs-params {
56 | color: #606;
57 | }
58 |
59 | .hljs-attribute,
60 | .hljs-subst {
61 | color: #000;
62 | }
63 |
64 | .hljs-formula {
65 | background-color: #eee;
66 | font-style: italic;
67 | }
68 |
69 | .hljs-selector-id,
70 | .hljs-selector-class {
71 | color: #9b703f;
72 | }
73 |
74 | .hljs-addition {
75 | background-color: #baeeba;
76 | }
77 |
78 | .hljs-deletion {
79 | background-color: #ffc8bd;
80 | }
81 |
82 | .hljs-doctag,
83 | .hljs-strong {
84 | font-weight: bold;
85 | }
86 |
87 | .hljs-emphasis {
88 | font-style: italic;
89 | }
90 |
--------------------------------------------------------------------------------
/examples/src/app/guide/guide.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Guide
4 |
5 |
6 |
7 | ngx-validators
8 |
9 |

12 |
13 |
14 |

17 |
18 |
19 | An implementation of various angular validators for Angular 2+.
20 | Install
21 | npm install ngx-validators --save
22 |
23 |
24 |
25 |
26 | List of validators
27 |
28 |
29 |
30 | {{ item.name }}
31 |
32 |
33 | {{ validator.name }}
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-sulphurpool-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Sulphurpool Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Sulphurpool Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #898ea4;
9 | }
10 |
11 | /* Atelier-Sulphurpool Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #c94922;
23 | }
24 |
25 | /* Atelier-Sulphurpool Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #c76b29;
34 | }
35 |
36 | /* Atelier-Sulphurpool Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #ac9739;
41 | }
42 |
43 | /* Atelier-Sulphurpool Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #3d8fd1;
47 | }
48 |
49 | /* Atelier-Sulphurpool Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #6679cc;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #202746;
59 | color: #979db4;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-sulphurpool-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Sulphurpool Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Sulphurpool Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #6b7394;
9 | }
10 |
11 | /* Atelier-Sulphurpool Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #c94922;
23 | }
24 |
25 | /* Atelier-Sulphurpool Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #c76b29;
34 | }
35 |
36 | /* Atelier-Sulphurpool Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #ac9739;
41 | }
42 |
43 | /* Atelier-Sulphurpool Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #3d8fd1;
47 | }
48 |
49 | /* Atelier-Sulphurpool Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #6679cc;
53 | }
54 |
55 | .hljs {
56 | display: block;
57 | overflow-x: auto;
58 | background: #f5f7ff;
59 | color: #5e6687;
60 | padding: 0.5em;
61 | }
62 |
63 | .hljs-emphasis {
64 | font-style: italic;
65 | }
66 |
67 | .hljs-strong {
68 | font-weight: bold;
69 | }
70 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/obsidian.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Obsidian style
3 | * ported by Alexander Marenin (http://github.com/ioncreature)
4 | */
5 |
6 | .hljs {
7 | display: block;
8 | overflow-x: auto;
9 | padding: 0.5em;
10 | background: #282b2e;
11 | }
12 |
13 | .hljs-keyword,
14 | .hljs-selector-tag,
15 | .hljs-literal,
16 | .hljs-selector-id {
17 | color: #93c763;
18 | }
19 |
20 | .hljs-number {
21 | color: #ffcd22;
22 | }
23 |
24 | .hljs {
25 | color: #e0e2e4;
26 | }
27 |
28 | .hljs-attribute {
29 | color: #668bb0;
30 | }
31 |
32 | .hljs-code,
33 | .hljs-class .hljs-title,
34 | .hljs-section {
35 | color: white;
36 | }
37 |
38 | .hljs-regexp,
39 | .hljs-link {
40 | color: #d39745;
41 | }
42 |
43 | .hljs-meta {
44 | color: #557182;
45 | }
46 |
47 | .hljs-tag,
48 | .hljs-name,
49 | .hljs-bullet,
50 | .hljs-subst,
51 | .hljs-emphasis,
52 | .hljs-type,
53 | .hljs-built_in,
54 | .hljs-selector-attr,
55 | .hljs-selector-pseudo,
56 | .hljs-addition,
57 | .hljs-variable,
58 | .hljs-template-tag,
59 | .hljs-template-variable {
60 | color: #8cbbad;
61 | }
62 |
63 | .hljs-string,
64 | .hljs-symbol {
65 | color: #ec7600;
66 | }
67 |
68 | .hljs-comment,
69 | .hljs-quote,
70 | .hljs-deletion {
71 | color: #818e96;
72 | }
73 |
74 | .hljs-selector-class {
75 | color: #a082bd;
76 | }
77 |
78 | .hljs-keyword,
79 | .hljs-selector-tag,
80 | .hljs-literal,
81 | .hljs-doctag,
82 | .hljs-title,
83 | .hljs-section,
84 | .hljs-type,
85 | .hljs-name,
86 | .hljs-strong {
87 | font-weight: bold;
88 | }
89 |
--------------------------------------------------------------------------------
/examples/src/app/equal-to-validator/equal-to-validator.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { CommonModule } from "@angular/common";
3 | import { EqualToValidatorComponent } from "./equal-to-validator.component";
4 | import { FormEqualToComponent } from "./form/equal-to/form-equal-to.component";
5 | import { RouterModule, Routes } from "@angular/router";
6 | import {
7 | MatButtonModule,
8 | MatCardModule,
9 | MatFormFieldModule,
10 | MatInputModule,
11 | MatOptionModule,
12 | MatSelectModule,
13 | } from "@angular/material";
14 | import { UtilModule } from "../util/util.module";
15 | import { FormsModule, ReactiveFormsModule } from "@angular/forms";
16 | import { ValidatorsModule } from "ngx-validators";
17 | import { ReactiveFormEqualToComponent } from "./reactive-form/equal-to/reactive-form-equal-to.component";
18 |
19 | const routes: Routes = [
20 | { path: "equal-to", component: EqualToValidatorComponent },
21 | { path: "equal-to/:id", component: EqualToValidatorComponent },
22 | ];
23 |
24 | @NgModule({
25 | imports: [
26 | CommonModule,
27 | FormsModule,
28 | ReactiveFormsModule,
29 | RouterModule.forChild(routes),
30 | UtilModule,
31 | ValidatorsModule,
32 | MatFormFieldModule,
33 | MatInputModule,
34 | MatSelectModule,
35 | MatOptionModule,
36 | MatCardModule,
37 | MatButtonModule,
38 | ],
39 | declarations: [EqualToValidatorComponent, FormEqualToComponent, ReactiveFormEqualToComponent],
40 | })
41 | export class EqualToValidatorModule {}
42 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/tomorrow-night.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Theme */
2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
5 |
6 | /* Tomorrow Comment */
7 | .hljs-comment,
8 | .hljs-quote {
9 | color: #969896;
10 | }
11 |
12 | /* Tomorrow Red */
13 | .hljs-variable,
14 | .hljs-template-variable,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-selector-id,
18 | .hljs-selector-class,
19 | .hljs-regexp,
20 | .hljs-deletion {
21 | color: #cc6666;
22 | }
23 |
24 | /* Tomorrow Orange */
25 | .hljs-number,
26 | .hljs-built_in,
27 | .hljs-builtin-name,
28 | .hljs-literal,
29 | .hljs-type,
30 | .hljs-params,
31 | .hljs-meta,
32 | .hljs-link {
33 | color: #de935f;
34 | }
35 |
36 | /* Tomorrow Yellow */
37 | .hljs-attribute {
38 | color: #f0c674;
39 | }
40 |
41 | /* Tomorrow Green */
42 | .hljs-string,
43 | .hljs-symbol,
44 | .hljs-bullet,
45 | .hljs-addition {
46 | color: #b5bd68;
47 | }
48 |
49 | /* Tomorrow Blue */
50 | .hljs-title,
51 | .hljs-section {
52 | color: #81a2be;
53 | }
54 |
55 | /* Tomorrow Purple */
56 | .hljs-keyword,
57 | .hljs-selector-tag {
58 | color: #b294bb;
59 | }
60 |
61 | .hljs {
62 | display: block;
63 | overflow-x: auto;
64 | background: #1d1f21;
65 | color: #c5c8c6;
66 | padding: 0.5em;
67 | }
68 |
69 | .hljs-emphasis {
70 | font-style: italic;
71 | }
72 |
73 | .hljs-strong {
74 | font-weight: bold;
75 | }
76 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/xcode.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | XCode style (c) Angel Garcia
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #fff;
12 | color: black;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #006a00;
18 | }
19 |
20 | .hljs-keyword,
21 | .hljs-selector-tag,
22 | .hljs-literal {
23 | color: #aa0d91;
24 | }
25 |
26 | .hljs-name {
27 | color: #008;
28 | }
29 |
30 | .hljs-variable,
31 | .hljs-template-variable {
32 | color: #660;
33 | }
34 |
35 | .hljs-string {
36 | color: #c41a16;
37 | }
38 |
39 | .hljs-regexp,
40 | .hljs-link {
41 | color: #080;
42 | }
43 |
44 | .hljs-title,
45 | .hljs-tag,
46 | .hljs-symbol,
47 | .hljs-bullet,
48 | .hljs-number,
49 | .hljs-meta {
50 | color: #1c00cf;
51 | }
52 |
53 | .hljs-section,
54 | .hljs-class .hljs-title,
55 | .hljs-type,
56 | .hljs-attr,
57 | .hljs-built_in,
58 | .hljs-builtin-name,
59 | .hljs-params {
60 | color: #5c2699;
61 | }
62 |
63 | .hljs-attribute,
64 | .hljs-subst {
65 | color: #000;
66 | }
67 |
68 | .hljs-formula {
69 | background-color: #eee;
70 | font-style: italic;
71 | }
72 |
73 | .hljs-addition {
74 | background-color: #baeeba;
75 | }
76 |
77 | .hljs-deletion {
78 | background-color: #ffc8bd;
79 | }
80 |
81 | .hljs-selector-id,
82 | .hljs-selector-class {
83 | color: #9b703f;
84 | }
85 |
86 | .hljs-doctag,
87 | .hljs-strong {
88 | font-weight: bold;
89 | }
90 |
91 | .hljs-emphasis {
92 | font-style: italic;
93 | }
94 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/foundation.css:
--------------------------------------------------------------------------------
1 | /*
2 | Description: Foundation 4 docs style for highlight.js
3 | Author: Dan Allen
4 | Website: http://foundation.zurb.com/docs/
5 | Version: 1.0
6 | Date: 2013-04-02
7 | */
8 |
9 | .hljs {
10 | display: block;
11 | overflow-x: auto;
12 | padding: 0.5em;
13 | background: #eee;
14 | color: black;
15 | }
16 |
17 | .hljs-link,
18 | .hljs-emphasis,
19 | .hljs-attribute,
20 | .hljs-addition {
21 | color: #070;
22 | }
23 |
24 | .hljs-emphasis {
25 | font-style: italic;
26 | }
27 |
28 | .hljs-strong,
29 | .hljs-string,
30 | .hljs-deletion {
31 | color: #d14;
32 | }
33 |
34 | .hljs-strong {
35 | font-weight: bold;
36 | }
37 |
38 | .hljs-quote,
39 | .hljs-comment {
40 | color: #998;
41 | font-style: italic;
42 | }
43 |
44 | .hljs-section,
45 | .hljs-title {
46 | color: #900;
47 | }
48 |
49 | .hljs-class .hljs-title,
50 | .hljs-type {
51 | color: #458;
52 | }
53 |
54 | .hljs-variable,
55 | .hljs-template-variable {
56 | color: #336699;
57 | }
58 |
59 | .hljs-bullet {
60 | color: #997700;
61 | }
62 |
63 | .hljs-meta {
64 | color: #3344bb;
65 | }
66 |
67 | .hljs-code,
68 | .hljs-number,
69 | .hljs-literal,
70 | .hljs-keyword,
71 | .hljs-selector-tag {
72 | color: #099;
73 | }
74 |
75 | .hljs-regexp {
76 | background-color: #fff0ff;
77 | color: #880088;
78 | }
79 |
80 | .hljs-symbol {
81 | color: #990073;
82 | }
83 |
84 | .hljs-tag,
85 | .hljs-name,
86 | .hljs-selector-id,
87 | .hljs-selector-class {
88 | color: #007700;
89 | }
90 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/pojoaque.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Pojoaque Style by Jason Tate
4 | http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html
5 | Based on Solarized Style from http://ethanschoonover.com/solarized
6 |
7 | */
8 |
9 | .hljs {
10 | display: block;
11 | overflow-x: auto;
12 | padding: 0.5em;
13 | color: #dccf8f;
14 | background: url(./pojoaque.jpg) repeat scroll left top #181914;
15 | }
16 |
17 | .hljs-comment,
18 | .hljs-quote {
19 | color: #586e75;
20 | font-style: italic;
21 | }
22 |
23 | .hljs-keyword,
24 | .hljs-selector-tag,
25 | .hljs-literal,
26 | .hljs-addition {
27 | color: #b64926;
28 | }
29 |
30 | .hljs-number,
31 | .hljs-string,
32 | .hljs-doctag,
33 | .hljs-regexp {
34 | color: #468966;
35 | }
36 |
37 | .hljs-title,
38 | .hljs-section,
39 | .hljs-built_in,
40 | .hljs-name {
41 | color: #ffb03b;
42 | }
43 |
44 | .hljs-variable,
45 | .hljs-template-variable,
46 | .hljs-class .hljs-title,
47 | .hljs-type,
48 | .hljs-tag {
49 | color: #b58900;
50 | }
51 |
52 | .hljs-attribute {
53 | color: #b89859;
54 | }
55 |
56 | .hljs-symbol,
57 | .hljs-bullet,
58 | .hljs-link,
59 | .hljs-subst,
60 | .hljs-meta {
61 | color: #cb4b16;
62 | }
63 |
64 | .hljs-deletion {
65 | color: #dc322f;
66 | }
67 |
68 | .hljs-selector-id,
69 | .hljs-selector-class {
70 | color: #d3a60c;
71 | }
72 |
73 | .hljs-formula {
74 | background: #073642;
75 | }
76 |
77 | .hljs-emphasis {
78 | font-style: italic;
79 | }
80 |
81 | .hljs-strong {
82 | font-weight: bold;
83 | }
84 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/tomorrow-night-blue.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Blue Theme */
2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
5 |
6 | /* Tomorrow Comment */
7 | .hljs-comment,
8 | .hljs-quote {
9 | color: #7285b7;
10 | }
11 |
12 | /* Tomorrow Red */
13 | .hljs-variable,
14 | .hljs-template-variable,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-selector-id,
18 | .hljs-selector-class,
19 | .hljs-regexp,
20 | .hljs-deletion {
21 | color: #ff9da4;
22 | }
23 |
24 | /* Tomorrow Orange */
25 | .hljs-number,
26 | .hljs-built_in,
27 | .hljs-builtin-name,
28 | .hljs-literal,
29 | .hljs-type,
30 | .hljs-params,
31 | .hljs-meta,
32 | .hljs-link {
33 | color: #ffc58f;
34 | }
35 |
36 | /* Tomorrow Yellow */
37 | .hljs-attribute {
38 | color: #ffeead;
39 | }
40 |
41 | /* Tomorrow Green */
42 | .hljs-string,
43 | .hljs-symbol,
44 | .hljs-bullet,
45 | .hljs-addition {
46 | color: #d1f1a9;
47 | }
48 |
49 | /* Tomorrow Blue */
50 | .hljs-title,
51 | .hljs-section {
52 | color: #bbdaff;
53 | }
54 |
55 | /* Tomorrow Purple */
56 | .hljs-keyword,
57 | .hljs-selector-tag {
58 | color: #ebbbff;
59 | }
60 |
61 | .hljs {
62 | display: block;
63 | overflow-x: auto;
64 | background: #002451;
65 | color: white;
66 | padding: 0.5em;
67 | }
68 |
69 | .hljs-emphasis {
70 | font-style: italic;
71 | }
72 |
73 | .hljs-strong {
74 | font-weight: bold;
75 | }
76 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: Node
2 | on: [push, pull_request]
3 | jobs:
4 | build:
5 | name: Build
6 | runs-on: ubuntu-latest
7 | steps:
8 | - name: Set up Node 14
9 | uses: actions/setup-node@v1
10 | with:
11 | node-version: "14.x"
12 | id: node
13 |
14 | - name: Check out code
15 | uses: actions/checkout@v1
16 |
17 | - run: yarn install
18 |
19 | - name: Run tests
20 | run: yarn test
21 |
22 | - name: Lint
23 | run: yarn lint
24 |
25 | - name: Build
26 | run: yarn build
27 |
28 | - name: Download releaser
29 | env:
30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 | run: |
32 | wget https://github.com/Nightapes/go-semantic-release/releases/download/v2.0.1/go-semantic-release.linux_x86_64.zip
33 | unzip go-semantic-release.linux_x86_64.zip
34 | rm go-semantic-release.linux_x86_64.zip
35 | mv go-semantic-release.linux_x86_64 go-semantic-release
36 | chmod +x ./go-semantic-release
37 | git config user.name "Nightapes"
38 | git config user.email svbeisch@gmail.com
39 | ./go-semantic-release next
40 |
41 | - name: Release npm
42 | if: github.ref == 'refs/heads/master'
43 | env:
44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 | GITHUB_PAT: ${{ secrets.GITHUB_PAT }}
46 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47 | run: |
48 | ./go-semantic-release release -l info
49 |
--------------------------------------------------------------------------------
/examples/src/app/email-validator/email-validator.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Form
4 | Reactive Form
5 |
6 |
7 |
8 |
9 | Email validator - {{ item }}
10 |
11 |
12 |
13 |
14 |
15 | Try test@gmai.con
16 |
17 |
18 |
19 |
20 | Try test@gmai.con
21 |
22 |
23 |
24 |
29 |
34 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/solarized-dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #002b36;
12 | color: #839496;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #586e75;
18 | }
19 |
20 | /* Solarized Green */
21 | .hljs-keyword,
22 | .hljs-selector-tag,
23 | .hljs-addition {
24 | color: #859900;
25 | }
26 |
27 | /* Solarized Cyan */
28 | .hljs-number,
29 | .hljs-string,
30 | .hljs-meta .hljs-meta-string,
31 | .hljs-literal,
32 | .hljs-doctag,
33 | .hljs-regexp {
34 | color: #2aa198;
35 | }
36 |
37 | /* Solarized Blue */
38 | .hljs-title,
39 | .hljs-section,
40 | .hljs-name,
41 | .hljs-selector-id,
42 | .hljs-selector-class {
43 | color: #268bd2;
44 | }
45 |
46 | /* Solarized Yellow */
47 | .hljs-attribute,
48 | .hljs-attr,
49 | .hljs-variable,
50 | .hljs-template-variable,
51 | .hljs-class .hljs-title,
52 | .hljs-type {
53 | color: #b58900;
54 | }
55 |
56 | /* Solarized Orange */
57 | .hljs-symbol,
58 | .hljs-bullet,
59 | .hljs-subst,
60 | .hljs-meta,
61 | .hljs-meta .hljs-keyword,
62 | .hljs-selector-attr,
63 | .hljs-selector-pseudo,
64 | .hljs-link {
65 | color: #cb4b16;
66 | }
67 |
68 | /* Solarized Red */
69 | .hljs-built_in,
70 | .hljs-deletion {
71 | color: #dc322f;
72 | }
73 |
74 | .hljs-formula {
75 | background: #073642;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/solarized-light.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #fdf6e3;
12 | color: #657b83;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #93a1a1;
18 | }
19 |
20 | /* Solarized Green */
21 | .hljs-keyword,
22 | .hljs-selector-tag,
23 | .hljs-addition {
24 | color: #859900;
25 | }
26 |
27 | /* Solarized Cyan */
28 | .hljs-number,
29 | .hljs-string,
30 | .hljs-meta .hljs-meta-string,
31 | .hljs-literal,
32 | .hljs-doctag,
33 | .hljs-regexp {
34 | color: #2aa198;
35 | }
36 |
37 | /* Solarized Blue */
38 | .hljs-title,
39 | .hljs-section,
40 | .hljs-name,
41 | .hljs-selector-id,
42 | .hljs-selector-class {
43 | color: #268bd2;
44 | }
45 |
46 | /* Solarized Yellow */
47 | .hljs-attribute,
48 | .hljs-attr,
49 | .hljs-variable,
50 | .hljs-template-variable,
51 | .hljs-class .hljs-title,
52 | .hljs-type {
53 | color: #b58900;
54 | }
55 |
56 | /* Solarized Orange */
57 | .hljs-symbol,
58 | .hljs-bullet,
59 | .hljs-subst,
60 | .hljs-meta,
61 | .hljs-meta .hljs-keyword,
62 | .hljs-selector-attr,
63 | .hljs-selector-pseudo,
64 | .hljs-link {
65 | color: #cb4b16;
66 | }
67 |
68 | /* Solarized Red */
69 | .hljs-built_in,
70 | .hljs-deletion {
71 | color: #dc322f;
72 | }
73 |
74 | .hljs-formula {
75 | background: #eee8d5;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/default.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Original highlight.js style (c) Ivan Sagalaev
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #f0f0f0;
12 | }
13 |
14 | /* Base color: saturation 0; */
15 |
16 | .hljs,
17 | .hljs-subst {
18 | color: #444;
19 | }
20 |
21 | .hljs-comment {
22 | color: #888888;
23 | }
24 |
25 | .hljs-keyword,
26 | .hljs-attribute,
27 | .hljs-selector-tag,
28 | .hljs-meta-keyword,
29 | .hljs-doctag,
30 | .hljs-name {
31 | font-weight: bold;
32 | }
33 |
34 | /* User color: hue: 0 */
35 |
36 | .hljs-type,
37 | .hljs-string,
38 | .hljs-number,
39 | .hljs-selector-id,
40 | .hljs-selector-class,
41 | .hljs-quote,
42 | .hljs-template-tag,
43 | .hljs-deletion {
44 | color: #880000;
45 | }
46 |
47 | .hljs-title,
48 | .hljs-section {
49 | color: #880000;
50 | font-weight: bold;
51 | }
52 |
53 | .hljs-regexp,
54 | .hljs-symbol,
55 | .hljs-variable,
56 | .hljs-template-variable,
57 | .hljs-link,
58 | .hljs-selector-attr,
59 | .hljs-selector-pseudo {
60 | color: #bc6060;
61 | }
62 |
63 | /* Language color: hue: 90; */
64 |
65 | .hljs-literal {
66 | color: #78a960;
67 | }
68 |
69 | .hljs-built_in,
70 | .hljs-bullet,
71 | .hljs-code,
72 | .hljs-addition {
73 | color: #397300;
74 | }
75 |
76 | /* Meta color: hue: 200 */
77 |
78 | .hljs-meta {
79 | color: #1f7199;
80 | }
81 |
82 | .hljs-meta-string {
83 | color: #4d99bf;
84 | }
85 |
86 | /* Misc effects */
87 |
88 | .hljs-emphasis {
89 | font-style: italic;
90 | }
91 |
92 | .hljs-strong {
93 | font-weight: bold;
94 | }
95 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/docco.css:
--------------------------------------------------------------------------------
1 | /*
2 | Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars)
3 | */
4 |
5 | .hljs {
6 | display: block;
7 | overflow-x: auto;
8 | padding: 0.5em;
9 | color: #000;
10 | background: #f8f8ff;
11 | }
12 |
13 | .hljs-comment,
14 | .hljs-quote {
15 | color: #408080;
16 | font-style: italic;
17 | }
18 |
19 | .hljs-keyword,
20 | .hljs-selector-tag,
21 | .hljs-literal,
22 | .hljs-subst {
23 | color: #954121;
24 | }
25 |
26 | .hljs-number {
27 | color: #40a070;
28 | }
29 |
30 | .hljs-string,
31 | .hljs-doctag {
32 | color: #219161;
33 | }
34 |
35 | .hljs-selector-id,
36 | .hljs-selector-class,
37 | .hljs-section,
38 | .hljs-type {
39 | color: #19469d;
40 | }
41 |
42 | .hljs-params {
43 | color: #00f;
44 | }
45 |
46 | .hljs-title {
47 | color: #458;
48 | font-weight: bold;
49 | }
50 |
51 | .hljs-tag,
52 | .hljs-name,
53 | .hljs-attribute {
54 | color: #000080;
55 | font-weight: normal;
56 | }
57 |
58 | .hljs-variable,
59 | .hljs-template-variable {
60 | color: #008080;
61 | }
62 |
63 | .hljs-regexp,
64 | .hljs-link {
65 | color: #b68;
66 | }
67 |
68 | .hljs-symbol,
69 | .hljs-bullet {
70 | color: #990073;
71 | }
72 |
73 | .hljs-built_in,
74 | .hljs-builtin-name {
75 | color: #0086b3;
76 | }
77 |
78 | .hljs-meta {
79 | color: #999;
80 | font-weight: bold;
81 | }
82 |
83 | .hljs-deletion {
84 | background: #fdd;
85 | }
86 |
87 | .hljs-addition {
88 | background: #dfd;
89 | }
90 |
91 | .hljs-emphasis {
92 | font-style: italic;
93 | }
94 |
95 | .hljs-strong {
96 | font-weight: bold;
97 | }
98 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "ngx-validators": {
7 | "projectType": "library",
8 | "root": "projects/ngx-validators",
9 | "sourceRoot": "projects/ngx-validators/src",
10 | "prefix": "lib",
11 | "architect": {
12 | "build": {
13 | "builder": "@angular-devkit/build-angular:ng-packagr",
14 | "options": {
15 | "project": "projects/ngx-validators/ng-package.json"
16 | },
17 | "configurations": {
18 | "production": {
19 | "tsConfig": "projects/ngx-validators/tsconfig.lib.prod.json"
20 | },
21 | "development": {
22 | "tsConfig": "projects/ngx-validators/tsconfig.lib.json"
23 | }
24 | },
25 | "defaultConfiguration": "production"
26 | },
27 | "test": {
28 | "builder": "@angular-devkit/build-angular:karma",
29 | "options": {
30 | "main": "projects/ngx-validators/src/test.ts",
31 | "tsConfig": "projects/ngx-validators/tsconfig.spec.json",
32 | "karmaConfig": "projects/ngx-validators/karma.conf.js"
33 | }
34 | },
35 | "lint": {
36 | "builder": "@angular-eslint/builder:lint",
37 | "options": {
38 | "lintFilePatterns": ["projects/ngx-validators/**/*.ts", "projects/ngx-validators/**/*.html"]
39 | }
40 | }
41 | }
42 | }
43 | },
44 | "defaultProject": "ngx-validators"
45 | }
46 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/idea.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Intellij Idea-like styling (c) Vasily Polovnyov
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | color: #000;
12 | background: #fff;
13 | }
14 |
15 | .hljs-subst,
16 | .hljs-title {
17 | font-weight: normal;
18 | color: #000;
19 | }
20 |
21 | .hljs-comment,
22 | .hljs-quote {
23 | color: #808080;
24 | font-style: italic;
25 | }
26 |
27 | .hljs-meta {
28 | color: #808000;
29 | }
30 |
31 | .hljs-tag {
32 | background: #efefef;
33 | }
34 |
35 | .hljs-section,
36 | .hljs-name,
37 | .hljs-literal,
38 | .hljs-keyword,
39 | .hljs-selector-tag,
40 | .hljs-type,
41 | .hljs-selector-id,
42 | .hljs-selector-class {
43 | font-weight: bold;
44 | color: #000080;
45 | }
46 |
47 | .hljs-attribute,
48 | .hljs-number,
49 | .hljs-regexp,
50 | .hljs-link {
51 | font-weight: bold;
52 | color: #0000ff;
53 | }
54 |
55 | .hljs-number,
56 | .hljs-regexp,
57 | .hljs-link {
58 | font-weight: normal;
59 | }
60 |
61 | .hljs-string {
62 | color: #008000;
63 | font-weight: bold;
64 | }
65 |
66 | .hljs-symbol,
67 | .hljs-bullet,
68 | .hljs-formula {
69 | color: #000;
70 | background: #d0eded;
71 | font-style: italic;
72 | }
73 |
74 | .hljs-doctag {
75 | text-decoration: underline;
76 | }
77 |
78 | .hljs-variable,
79 | .hljs-template-variable {
80 | color: #660e7a;
81 | }
82 |
83 | .hljs-addition {
84 | background: #baeeba;
85 | }
86 |
87 | .hljs-deletion {
88 | background: #ffc8bd;
89 | }
90 |
91 | .hljs-emphasis {
92 | font-style: italic;
93 | }
94 |
95 | .hljs-strong {
96 | font-weight: bold;
97 | }
98 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-cave-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Cave Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Cave Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #7e7887;
9 | }
10 |
11 | /* Atelier-Cave Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-regexp,
16 | .hljs-link,
17 | .hljs-tag,
18 | .hljs-name,
19 | .hljs-selector-id,
20 | .hljs-selector-class {
21 | color: #be4678;
22 | }
23 |
24 | /* Atelier-Cave Orange */
25 | .hljs-number,
26 | .hljs-meta,
27 | .hljs-built_in,
28 | .hljs-builtin-name,
29 | .hljs-literal,
30 | .hljs-type,
31 | .hljs-params {
32 | color: #aa573c;
33 | }
34 |
35 | /* Atelier-Cave Green */
36 | .hljs-string,
37 | .hljs-symbol,
38 | .hljs-bullet {
39 | color: #2a9292;
40 | }
41 |
42 | /* Atelier-Cave Blue */
43 | .hljs-title,
44 | .hljs-section {
45 | color: #576ddb;
46 | }
47 |
48 | /* Atelier-Cave Purple */
49 | .hljs-keyword,
50 | .hljs-selector-tag {
51 | color: #955ae7;
52 | }
53 |
54 | .hljs-deletion,
55 | .hljs-addition {
56 | color: #19171c;
57 | display: inline-block;
58 | width: 100%;
59 | }
60 |
61 | .hljs-deletion {
62 | background-color: #be4678;
63 | }
64 |
65 | .hljs-addition {
66 | background-color: #2a9292;
67 | }
68 |
69 | .hljs {
70 | display: block;
71 | overflow-x: auto;
72 | background: #19171c;
73 | color: #8b8792;
74 | padding: 0.5em;
75 | }
76 |
77 | .hljs-emphasis {
78 | font-style: italic;
79 | }
80 |
81 | .hljs-strong {
82 | font-weight: bold;
83 | }
84 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-cave-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Cave Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Cave Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #655f6d;
9 | }
10 |
11 | /* Atelier-Cave Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-name,
21 | .hljs-selector-id,
22 | .hljs-selector-class {
23 | color: #be4678;
24 | }
25 |
26 | /* Atelier-Cave Orange */
27 | .hljs-number,
28 | .hljs-meta,
29 | .hljs-built_in,
30 | .hljs-builtin-name,
31 | .hljs-literal,
32 | .hljs-type,
33 | .hljs-params {
34 | color: #aa573c;
35 | }
36 |
37 | /* Atelier-Cave Green */
38 | .hljs-string,
39 | .hljs-symbol,
40 | .hljs-bullet {
41 | color: #2a9292;
42 | }
43 |
44 | /* Atelier-Cave Blue */
45 | .hljs-title,
46 | .hljs-section {
47 | color: #576ddb;
48 | }
49 |
50 | /* Atelier-Cave Purple */
51 | .hljs-keyword,
52 | .hljs-selector-tag {
53 | color: #955ae7;
54 | }
55 |
56 | .hljs-deletion,
57 | .hljs-addition {
58 | color: #19171c;
59 | display: inline-block;
60 | width: 100%;
61 | }
62 |
63 | .hljs-deletion {
64 | background-color: #be4678;
65 | }
66 |
67 | .hljs-addition {
68 | background-color: #2a9292;
69 | }
70 |
71 | .hljs {
72 | display: block;
73 | overflow-x: auto;
74 | background: #efecf4;
75 | color: #585260;
76 | padding: 0.5em;
77 | }
78 |
79 | .hljs-emphasis {
80 | font-style: italic;
81 | }
82 |
83 | .hljs-strong {
84 | font-weight: bold;
85 | }
86 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-estuary-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Estuary Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Estuary Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #878573;
9 | }
10 |
11 | /* Atelier-Estuary Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #ba6236;
23 | }
24 |
25 | /* Atelier-Estuary Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #ae7313;
34 | }
35 |
36 | /* Atelier-Estuary Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #7d9726;
41 | }
42 |
43 | /* Atelier-Estuary Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #36a166;
47 | }
48 |
49 | /* Atelier-Estuary Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #5f9182;
53 | }
54 |
55 | .hljs-deletion,
56 | .hljs-addition {
57 | color: #22221b;
58 | display: inline-block;
59 | width: 100%;
60 | }
61 |
62 | .hljs-deletion {
63 | background-color: #ba6236;
64 | }
65 |
66 | .hljs-addition {
67 | background-color: #7d9726;
68 | }
69 |
70 | .hljs {
71 | display: block;
72 | overflow-x: auto;
73 | background: #22221b;
74 | color: #929181;
75 | padding: 0.5em;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-estuary-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Estuary Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Estuary Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #6c6b5a;
9 | }
10 |
11 | /* Atelier-Estuary Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #ba6236;
23 | }
24 |
25 | /* Atelier-Estuary Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #ae7313;
34 | }
35 |
36 | /* Atelier-Estuary Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #7d9726;
41 | }
42 |
43 | /* Atelier-Estuary Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #36a166;
47 | }
48 |
49 | /* Atelier-Estuary Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #5f9182;
53 | }
54 |
55 | .hljs-deletion,
56 | .hljs-addition {
57 | color: #22221b;
58 | display: inline-block;
59 | width: 100%;
60 | }
61 |
62 | .hljs-deletion {
63 | background-color: #ba6236;
64 | }
65 |
66 | .hljs-addition {
67 | background-color: #7d9726;
68 | }
69 |
70 | .hljs {
71 | display: block;
72 | overflow-x: auto;
73 | background: #f4f3ec;
74 | color: #5f5e4e;
75 | padding: 0.5em;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-plateau-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Plateau Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/plateau) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Plateau Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #7e7777;
9 | }
10 |
11 | /* Atelier-Plateau Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #ca4949;
23 | }
24 |
25 | /* Atelier-Plateau Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #b45a3c;
34 | }
35 |
36 | /* Atelier-Plateau Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #4b8b8b;
41 | }
42 |
43 | /* Atelier-Plateau Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #7272ca;
47 | }
48 |
49 | /* Atelier-Plateau Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #8464c4;
53 | }
54 |
55 | .hljs-deletion,
56 | .hljs-addition {
57 | color: #1b1818;
58 | display: inline-block;
59 | width: 100%;
60 | }
61 |
62 | .hljs-deletion {
63 | background-color: #ca4949;
64 | }
65 |
66 | .hljs-addition {
67 | background-color: #4b8b8b;
68 | }
69 |
70 | .hljs {
71 | display: block;
72 | overflow-x: auto;
73 | background: #1b1818;
74 | color: #8a8585;
75 | padding: 0.5em;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-plateau-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Plateau Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/plateau) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Plateau Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #655d5d;
9 | }
10 |
11 | /* Atelier-Plateau Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #ca4949;
23 | }
24 |
25 | /* Atelier-Plateau Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #b45a3c;
34 | }
35 |
36 | /* Atelier-Plateau Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #4b8b8b;
41 | }
42 |
43 | /* Atelier-Plateau Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #7272ca;
47 | }
48 |
49 | /* Atelier-Plateau Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #8464c4;
53 | }
54 |
55 | .hljs-deletion,
56 | .hljs-addition {
57 | color: #1b1818;
58 | display: inline-block;
59 | width: 100%;
60 | }
61 |
62 | .hljs-deletion {
63 | background-color: #ca4949;
64 | }
65 |
66 | .hljs-addition {
67 | background-color: #4b8b8b;
68 | }
69 |
70 | .hljs {
71 | display: block;
72 | overflow-x: auto;
73 | background: #f4ecec;
74 | color: #585050;
75 | padding: 0.5em;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-savanna-dark.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Savanna Dark - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/savanna) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Savanna Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #78877d;
9 | }
10 |
11 | /* Atelier-Savanna Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #b16139;
23 | }
24 |
25 | /* Atelier-Savanna Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #9f713c;
34 | }
35 |
36 | /* Atelier-Savanna Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #489963;
41 | }
42 |
43 | /* Atelier-Savanna Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #478c90;
47 | }
48 |
49 | /* Atelier-Savanna Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #55859b;
53 | }
54 |
55 | .hljs-deletion,
56 | .hljs-addition {
57 | color: #171c19;
58 | display: inline-block;
59 | width: 100%;
60 | }
61 |
62 | .hljs-deletion {
63 | background-color: #b16139;
64 | }
65 |
66 | .hljs-addition {
67 | background-color: #489963;
68 | }
69 |
70 | .hljs {
71 | display: block;
72 | overflow-x: auto;
73 | background: #171c19;
74 | color: #87928a;
75 | padding: 0.5em;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atelier-savanna-light.css:
--------------------------------------------------------------------------------
1 | /* Base16 Atelier Savanna Light - Theme */
2 | /* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/savanna) */
3 | /* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
4 |
5 | /* Atelier-Savanna Comment */
6 | .hljs-comment,
7 | .hljs-quote {
8 | color: #5f6d64;
9 | }
10 |
11 | /* Atelier-Savanna Red */
12 | .hljs-variable,
13 | .hljs-template-variable,
14 | .hljs-attribute,
15 | .hljs-tag,
16 | .hljs-name,
17 | .hljs-regexp,
18 | .hljs-link,
19 | .hljs-name,
20 | .hljs-selector-id,
21 | .hljs-selector-class {
22 | color: #b16139;
23 | }
24 |
25 | /* Atelier-Savanna Orange */
26 | .hljs-number,
27 | .hljs-meta,
28 | .hljs-built_in,
29 | .hljs-builtin-name,
30 | .hljs-literal,
31 | .hljs-type,
32 | .hljs-params {
33 | color: #9f713c;
34 | }
35 |
36 | /* Atelier-Savanna Green */
37 | .hljs-string,
38 | .hljs-symbol,
39 | .hljs-bullet {
40 | color: #489963;
41 | }
42 |
43 | /* Atelier-Savanna Blue */
44 | .hljs-title,
45 | .hljs-section {
46 | color: #478c90;
47 | }
48 |
49 | /* Atelier-Savanna Purple */
50 | .hljs-keyword,
51 | .hljs-selector-tag {
52 | color: #55859b;
53 | }
54 |
55 | .hljs-deletion,
56 | .hljs-addition {
57 | color: #171c19;
58 | display: inline-block;
59 | width: 100%;
60 | }
61 |
62 | .hljs-deletion {
63 | background-color: #b16139;
64 | }
65 |
66 | .hljs-addition {
67 | background-color: #489963;
68 | }
69 |
70 | .hljs {
71 | display: block;
72 | overflow-x: auto;
73 | background: #ecf4ee;
74 | color: #526057;
75 | padding: 0.5em;
76 | }
77 |
78 | .hljs-emphasis {
79 | font-style: italic;
80 | }
81 |
82 | .hljs-strong {
83 | font-weight: bold;
84 | }
85 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/github.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | github.com style (c) Vasily Polovnyov
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | color: #333;
12 | background: #f8f8f8;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #998;
18 | font-style: italic;
19 | }
20 |
21 | .hljs-keyword,
22 | .hljs-selector-tag,
23 | .hljs-subst {
24 | color: #333;
25 | font-weight: bold;
26 | }
27 |
28 | .hljs-number,
29 | .hljs-literal,
30 | .hljs-variable,
31 | .hljs-template-variable,
32 | .hljs-tag .hljs-attr {
33 | color: #008080;
34 | }
35 |
36 | .hljs-string,
37 | .hljs-doctag {
38 | color: #d14;
39 | }
40 |
41 | .hljs-title,
42 | .hljs-section,
43 | .hljs-selector-id {
44 | color: #900;
45 | font-weight: bold;
46 | }
47 |
48 | .hljs-subst {
49 | font-weight: normal;
50 | }
51 |
52 | .hljs-type,
53 | .hljs-class .hljs-title {
54 | color: #458;
55 | font-weight: bold;
56 | }
57 |
58 | .hljs-tag,
59 | .hljs-name,
60 | .hljs-attribute {
61 | color: #000080;
62 | font-weight: normal;
63 | }
64 |
65 | .hljs-regexp,
66 | .hljs-link {
67 | color: #009926;
68 | }
69 |
70 | .hljs-symbol,
71 | .hljs-bullet {
72 | color: #990073;
73 | }
74 |
75 | .hljs-built_in,
76 | .hljs-builtin-name {
77 | color: #0086b3;
78 | }
79 |
80 | .hljs-meta {
81 | color: #999;
82 | font-weight: bold;
83 | }
84 |
85 | .hljs-deletion {
86 | background: #fdd;
87 | }
88 |
89 | .hljs-addition {
90 | background: #dfd;
91 | }
92 |
93 | .hljs-emphasis {
94 | font-style: italic;
95 | }
96 |
97 | .hljs-strong {
98 | font-weight: bold;
99 | }
100 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atom-one-dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Atom One Dark by Daniel Gamage
4 | Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
5 |
6 | base: #282c34
7 | mono-1: #abb2bf
8 | mono-2: #818896
9 | mono-3: #5c6370
10 | hue-1: #56b6c2
11 | hue-2: #61aeee
12 | hue-3: #c678dd
13 | hue-4: #98c379
14 | hue-5: #e06c75
15 | hue-5-2: #be5046
16 | hue-6: #d19a66
17 | hue-6-2: #e6c07b
18 |
19 | */
20 |
21 | .hljs {
22 | display: block;
23 | overflow-x: auto;
24 | padding: 0.5em;
25 | color: #abb2bf;
26 | background: #282c34;
27 | }
28 |
29 | .hljs-comment,
30 | .hljs-quote {
31 | color: #5c6370;
32 | font-style: italic;
33 | }
34 |
35 | .hljs-doctag,
36 | .hljs-keyword,
37 | .hljs-formula {
38 | color: #c678dd;
39 | }
40 |
41 | .hljs-section,
42 | .hljs-name,
43 | .hljs-selector-tag,
44 | .hljs-deletion,
45 | .hljs-subst {
46 | color: #e06c75;
47 | }
48 |
49 | .hljs-literal {
50 | color: #56b6c2;
51 | }
52 |
53 | .hljs-string,
54 | .hljs-regexp,
55 | .hljs-addition,
56 | .hljs-attribute,
57 | .hljs-meta-string {
58 | color: #98c379;
59 | }
60 |
61 | .hljs-built_in,
62 | .hljs-class .hljs-title {
63 | color: #e6c07b;
64 | }
65 |
66 | .hljs-attr,
67 | .hljs-variable,
68 | .hljs-template-variable,
69 | .hljs-type,
70 | .hljs-selector-class,
71 | .hljs-selector-attr,
72 | .hljs-selector-pseudo,
73 | .hljs-number {
74 | color: #d19a66;
75 | }
76 |
77 | .hljs-symbol,
78 | .hljs-bullet,
79 | .hljs-link,
80 | .hljs-meta,
81 | .hljs-selector-id,
82 | .hljs-title {
83 | color: #61aeee;
84 | }
85 |
86 | .hljs-emphasis {
87 | font-style: italic;
88 | }
89 |
90 | .hljs-strong {
91 | font-weight: bold;
92 | }
93 |
94 | .hljs-link {
95 | text-decoration: underline;
96 | }
97 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/atom-one-light.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Atom One Light by Daniel Gamage
4 | Original One Light Syntax theme from https://github.com/atom/one-light-syntax
5 |
6 | base: #fafafa
7 | mono-1: #383a42
8 | mono-2: #686b77
9 | mono-3: #a0a1a7
10 | hue-1: #0184bb
11 | hue-2: #4078f2
12 | hue-3: #a626a4
13 | hue-4: #50a14f
14 | hue-5: #e45649
15 | hue-5-2: #c91243
16 | hue-6: #986801
17 | hue-6-2: #c18401
18 |
19 | */
20 |
21 | .hljs {
22 | display: block;
23 | overflow-x: auto;
24 | padding: 0.5em;
25 | color: #383a42;
26 | background: #fafafa;
27 | }
28 |
29 | .hljs-comment,
30 | .hljs-quote {
31 | color: #a0a1a7;
32 | font-style: italic;
33 | }
34 |
35 | .hljs-doctag,
36 | .hljs-keyword,
37 | .hljs-formula {
38 | color: #a626a4;
39 | }
40 |
41 | .hljs-section,
42 | .hljs-name,
43 | .hljs-selector-tag,
44 | .hljs-deletion,
45 | .hljs-subst {
46 | color: #e45649;
47 | }
48 |
49 | .hljs-literal {
50 | color: #0184bb;
51 | }
52 |
53 | .hljs-string,
54 | .hljs-regexp,
55 | .hljs-addition,
56 | .hljs-attribute,
57 | .hljs-meta-string {
58 | color: #50a14f;
59 | }
60 |
61 | .hljs-built_in,
62 | .hljs-class .hljs-title {
63 | color: #c18401;
64 | }
65 |
66 | .hljs-attr,
67 | .hljs-variable,
68 | .hljs-template-variable,
69 | .hljs-type,
70 | .hljs-selector-class,
71 | .hljs-selector-attr,
72 | .hljs-selector-pseudo,
73 | .hljs-number {
74 | color: #986801;
75 | }
76 |
77 | .hljs-symbol,
78 | .hljs-bullet,
79 | .hljs-link,
80 | .hljs-meta,
81 | .hljs-selector-id,
82 | .hljs-title {
83 | color: #4078f2;
84 | }
85 |
86 | .hljs-emphasis {
87 | font-style: italic;
88 | }
89 |
90 | .hljs-strong {
91 | font-weight: bold;
92 | }
93 |
94 | .hljs-link {
95 | text-decoration: underline;
96 | }
97 |
--------------------------------------------------------------------------------
/projects/ngx-validators/src/lib/email/email-validators.ts:
--------------------------------------------------------------------------------
1 | import type { AbstractControl, ValidatorFn, ValidationErrors } from "@angular/forms";
2 | import { AbstractControlUtil } from "./../abstract-control-util";
3 | import type { EmailOptions } from "./email-util";
4 | import { EmailSuggestion } from "./email-util";
5 |
6 | export class EmailValidators {
7 | private static emailSuggestion: EmailSuggestion = new EmailSuggestion();
8 |
9 | public static simple(control: AbstractControl): ValidationErrors | null {
10 | if (AbstractControlUtil.isNotPresent(control)) {
11 | return null;
12 | }
13 |
14 | const pattern = /.+@.+\..+/i;
15 | if (pattern.test(control.value)) {
16 | return null;
17 | }
18 | return { simpleEmailRule: true };
19 | }
20 |
21 | // https://www.w3.org/TR/html5/forms.html#valid-e-mail-address
22 | public static normal(control: AbstractControl): ValidationErrors | null {
23 | if (AbstractControlUtil.isNotPresent(control)) {
24 | return null;
25 | }
26 |
27 | const pattern =
28 | // tslint:disable-next-line:max-line-length
29 | /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
30 | if (pattern.test(control.value)) {
31 | return null;
32 | }
33 | return { normalEmailRule: true };
34 | }
35 |
36 | public static suggest(options?: EmailOptions): ValidatorFn {
37 | const validator = (control: AbstractControl): ValidationErrors | null => {
38 | if (AbstractControlUtil.isNotPresent(control)) {
39 | return null;
40 | }
41 | return this.emailSuggestion.suggest(control.value, options);
42 | };
43 | return validator;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/sunburst.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Sunburst-like style (c) Vasily Polovnyov
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #000;
12 | color: #f8f8f8;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #aeaeae;
18 | font-style: italic;
19 | }
20 |
21 | .hljs-keyword,
22 | .hljs-selector-tag,
23 | .hljs-type {
24 | color: #e28964;
25 | }
26 |
27 | .hljs-string {
28 | color: #65b042;
29 | }
30 |
31 | .hljs-subst {
32 | color: #daefa3;
33 | }
34 |
35 | .hljs-regexp,
36 | .hljs-link {
37 | color: #e9c062;
38 | }
39 |
40 | .hljs-title,
41 | .hljs-section,
42 | .hljs-tag,
43 | .hljs-name {
44 | color: #89bdff;
45 | }
46 |
47 | .hljs-class .hljs-title,
48 | .hljs-doctag {
49 | text-decoration: underline;
50 | }
51 |
52 | .hljs-symbol,
53 | .hljs-bullet,
54 | .hljs-number {
55 | color: #3387cc;
56 | }
57 |
58 | .hljs-params,
59 | .hljs-variable,
60 | .hljs-template-variable {
61 | color: #3e87e3;
62 | }
63 |
64 | .hljs-attribute {
65 | color: #cda869;
66 | }
67 |
68 | .hljs-meta {
69 | color: #8996a8;
70 | }
71 |
72 | .hljs-formula {
73 | background-color: #0e2231;
74 | color: #f8f8f8;
75 | font-style: italic;
76 | }
77 |
78 | .hljs-addition {
79 | background-color: #253b22;
80 | color: #f8f8f8;
81 | }
82 |
83 | .hljs-deletion {
84 | background-color: #420e09;
85 | color: #f8f8f8;
86 | }
87 |
88 | .hljs-selector-class {
89 | color: #9b703f;
90 | }
91 |
92 | .hljs-selector-id {
93 | color: #8b98ab;
94 | }
95 |
96 | .hljs-emphasis {
97 | font-style: italic;
98 | }
99 |
100 | .hljs-strong {
101 | font-weight: bold;
102 | }
103 |
--------------------------------------------------------------------------------
/examples/src/assets/lib/hljs/styles/railscasts.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Railscasts-like style (c) Visoft, Inc. (Damien White)
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | background: #232323;
12 | color: #e6e1dc;
13 | }
14 |
15 | .hljs-comment,
16 | .hljs-quote {
17 | color: #bc9458;
18 | font-style: italic;
19 | }
20 |
21 | .hljs-keyword,
22 | .hljs-selector-tag {
23 | color: #c26230;
24 | }
25 |
26 | .hljs-string,
27 | .hljs-number,
28 | .hljs-regexp,
29 | .hljs-variable,
30 | .hljs-template-variable {
31 | color: #a5c261;
32 | }
33 |
34 | .hljs-subst {
35 | color: #519f50;
36 | }
37 |
38 | .hljs-tag,
39 | .hljs-name {
40 | color: #e8bf6a;
41 | }
42 |
43 | .hljs-type {
44 | color: #da4939;
45 | }
46 |
47 | .hljs-symbol,
48 | .hljs-bullet,
49 | .hljs-built_in,
50 | .hljs-builtin-name,
51 | .hljs-attr,
52 | .hljs-link {
53 | color: #6d9cbe;
54 | }
55 |
56 | .hljs-params {
57 | color: #d0d0ff;
58 | }
59 |
60 | .hljs-attribute {
61 | color: #cda869;
62 | }
63 |
64 | .hljs-meta {
65 | color: #9b859d;
66 | }
67 |
68 | .hljs-title,
69 | .hljs-section {
70 | color: #ffc66d;
71 | }
72 |
73 | .hljs-addition {
74 | background-color: #144212;
75 | color: #e6e1dc;
76 | display: inline-block;
77 | width: 100%;
78 | }
79 |
80 | .hljs-deletion {
81 | background-color: #600;
82 | color: #e6e1dc;
83 | display: inline-block;
84 | width: 100%;
85 | }
86 |
87 | .hljs-selector-class {
88 | color: #9b703f;
89 | }
90 |
91 | .hljs-selector-id {
92 | color: #8b98ab;
93 | }
94 |
95 | .hljs-emphasis {
96 | font-style: italic;
97 | }
98 |
99 | .hljs-strong {
100 | font-weight: bold;
101 | }
102 |
103 | .hljs-link {
104 | text-decoration: underline;
105 | }
106 |
--------------------------------------------------------------------------------