@skyux/validation 5.5.0-alpha.0 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -493,7 +493,7 @@
493
493
  "sources": [
494
494
  {
495
495
  "fileName": "projects/validation/src/modules/email-validation/email-validation.directive.ts",
496
- "line": 41,
496
+ "line": 40,
497
497
  "character": 9
498
498
  }
499
499
  ],
@@ -535,7 +535,7 @@
535
535
  "sources": [
536
536
  {
537
537
  "fileName": "projects/validation/src/modules/email-validation/email-validation.directive.ts",
538
- "line": 25,
538
+ "line": 24,
539
539
  "character": 9
540
540
  }
541
541
  ],
@@ -626,7 +626,7 @@
626
626
  "sources": [
627
627
  {
628
628
  "fileName": "projects/validation/src/modules/email-validation/email-validation.directive.ts",
629
- "line": 24,
629
+ "line": 23,
630
630
  "character": 13
631
631
  }
632
632
  ],
@@ -695,7 +695,7 @@
695
695
  "sources": [
696
696
  {
697
697
  "fileName": "projects/validation/src/modules/url-validation/url-validation.directive.ts",
698
- "line": 41,
698
+ "line": 40,
699
699
  "character": 9
700
700
  }
701
701
  ],
@@ -737,7 +737,7 @@
737
737
  "sources": [
738
738
  {
739
739
  "fileName": "projects/validation/src/modules/url-validation/url-validation.directive.ts",
740
- "line": 25,
740
+ "line": 24,
741
741
  "character": 9
742
742
  }
743
743
  ],
@@ -828,7 +828,7 @@
828
828
  "sources": [
829
829
  {
830
830
  "fileName": "projects/validation/src/modules/url-validation/url-validation.directive.ts",
831
- "line": 24,
831
+ "line": 23,
832
832
  "character": 13
833
833
  }
834
834
  ],
@@ -873,12 +873,12 @@
873
873
  {
874
874
  "fileName": "email-validation-demo.component.ts",
875
875
  "filePath": "/projects/validation/documentation/code-examples/email-validation/control-validator/email-validation-demo.component.ts",
876
- "rawContents": "import { Component, OnInit } from '@angular/core';\n\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n FormGroup,\n Validators,\n} from '@angular/forms';\n\nimport { SkyValidators } from '@skyux/validation';\n\n@Component({\n selector: 'app-email-validation-demo',\n templateUrl: './email-validation-demo.component.html',\n})\nexport class EmailValidationDemoComponent implements OnInit {\n public get emailControl(): AbstractControl {\n return this.formGroup.get('email');\n }\n\n public formGroup: FormGroup;\n\n constructor(private formBuilder: FormBuilder) {}\n\n public ngOnInit(): void {\n this.formGroup = this.formBuilder.group({\n email: new FormControl(undefined, [\n Validators.required,\n SkyValidators.email,\n ]),\n });\n }\n}\n"
876
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n FormGroup,\n Validators,\n} from '@angular/forms';\nimport { SkyValidators } from '@skyux/validation';\n\n@Component({\n selector: 'app-email-validation-demo',\n templateUrl: './email-validation-demo.component.html',\n})\nexport class EmailValidationDemoComponent implements OnInit {\n public get emailControl(): AbstractControl {\n return this.formGroup.get('email');\n }\n\n public formGroup: FormGroup;\n\n constructor(private formBuilder: FormBuilder) {}\n\n public ngOnInit(): void {\n this.formGroup = this.formBuilder.group({\n email: new FormControl(undefined, [\n Validators.required,\n SkyValidators.email,\n ]),\n });\n }\n}\n"
877
877
  },
878
878
  {
879
879
  "fileName": "email-validation-demo.module.ts",
880
880
  "filePath": "/projects/validation/documentation/code-examples/email-validation/control-validator/email-validation-demo.module.ts",
881
- "rawContents": "import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { SkyIdModule } from '@skyux/core';\n\nimport { SkyInputBoxModule } from '@skyux/forms';\n\nimport { SkyEmailValidationModule } from '@skyux/validation';\n\nimport { EmailValidationDemoComponent } from './email-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyEmailValidationModule,\n SkyIdModule,\n SkyInputBoxModule,\n ],\n exports: [EmailValidationDemoComponent],\n declarations: [EmailValidationDemoComponent],\n})\nexport class EmailValidationDemoModule {}\n"
881
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyEmailValidationModule } from '@skyux/validation';\n\nimport { EmailValidationDemoComponent } from './email-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyEmailValidationModule,\n SkyIdModule,\n SkyInputBoxModule,\n ],\n exports: [EmailValidationDemoComponent],\n declarations: [EmailValidationDemoComponent],\n})\nexport class EmailValidationDemoModule {}\n"
882
882
  },
883
883
  {
884
884
  "fileName": "email-validation-demo.component.html",
@@ -893,7 +893,7 @@
893
893
  {
894
894
  "fileName": "email-validation-demo.module.ts",
895
895
  "filePath": "/projects/validation/documentation/code-examples/email-validation/directive/email-validation-demo.module.ts",
896
- "rawContents": "import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyIdModule } from '@skyux/core';\n\nimport { SkyInputBoxModule } from '@skyux/forms';\n\nimport { SkyEmailValidationModule } from '@skyux/validation';\n\nimport { EmailValidationDemoComponent } from './email-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SkyEmailValidationModule,\n SkyIdModule,\n SkyInputBoxModule,\n ],\n exports: [EmailValidationDemoComponent],\n declarations: [EmailValidationDemoComponent],\n})\nexport class EmailValidationDemoModule {}\n"
896
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyEmailValidationModule } from '@skyux/validation';\n\nimport { EmailValidationDemoComponent } from './email-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SkyEmailValidationModule,\n SkyIdModule,\n SkyInputBoxModule,\n ],\n exports: [EmailValidationDemoComponent],\n declarations: [EmailValidationDemoComponent],\n})\nexport class EmailValidationDemoModule {}\n"
897
897
  },
898
898
  {
899
899
  "fileName": "url-validation-demo.component.html",
@@ -903,12 +903,12 @@
903
903
  {
904
904
  "fileName": "url-validation-demo.component.ts",
905
905
  "filePath": "/projects/validation/documentation/code-examples/url-validation/control-validator/url-validation-demo.component.ts",
906
- "rawContents": "import { Component, OnInit } from '@angular/core';\n\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n FormGroup,\n Validators,\n} from '@angular/forms';\n\nimport { SkyValidators } from '@skyux/validation';\n\n@Component({\n selector: 'app-url-validation-demo',\n templateUrl: './url-validation-demo.component.html',\n})\nexport class UrlValidationDemoComponent implements OnInit {\n public get urlControl(): AbstractControl {\n return this.formGroup.get('url');\n }\n\n public formGroup: FormGroup;\n\n constructor(private formBuilder: FormBuilder) {}\n\n public ngOnInit(): void {\n this.formGroup = this.formBuilder.group({\n url: new FormControl(undefined, [Validators.required, SkyValidators.url]),\n });\n }\n}\n"
906
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n FormGroup,\n Validators,\n} from '@angular/forms';\nimport { SkyValidators } from '@skyux/validation';\n\n@Component({\n selector: 'app-url-validation-demo',\n templateUrl: './url-validation-demo.component.html',\n})\nexport class UrlValidationDemoComponent implements OnInit {\n public get urlControl(): AbstractControl {\n return this.formGroup.get('url');\n }\n\n public formGroup: FormGroup;\n\n constructor(private formBuilder: FormBuilder) {}\n\n public ngOnInit(): void {\n this.formGroup = this.formBuilder.group({\n url: new FormControl(undefined, [Validators.required, SkyValidators.url]),\n });\n }\n}\n"
907
907
  },
908
908
  {
909
909
  "fileName": "url-validation-demo.module.ts",
910
910
  "filePath": "/projects/validation/documentation/code-examples/url-validation/control-validator/url-validation-demo.module.ts",
911
- "rawContents": "import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { SkyIdModule } from '@skyux/core';\n\nimport { SkyInputBoxModule } from '@skyux/forms';\n\nimport { SkyUrlValidationModule } from '@skyux/validation';\n\nimport { UrlValidationDemoComponent } from './url-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyUrlValidationModule,\n ],\n exports: [UrlValidationDemoComponent],\n declarations: [UrlValidationDemoComponent],\n})\nexport class UrlValidationDemoModule {}\n"
911
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyUrlValidationModule } from '@skyux/validation';\n\nimport { UrlValidationDemoComponent } from './url-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyUrlValidationModule,\n ],\n exports: [UrlValidationDemoComponent],\n declarations: [UrlValidationDemoComponent],\n})\nexport class UrlValidationDemoModule {}\n"
912
912
  },
913
913
  {
914
914
  "fileName": "url-validation-demo.component.html",
@@ -923,7 +923,7 @@
923
923
  {
924
924
  "fileName": "url-validation-demo.module.ts",
925
925
  "filePath": "/projects/validation/documentation/code-examples/url-validation/directive/url-validation-demo.module.ts",
926
- "rawContents": "import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyIdModule } from '@skyux/core';\n\nimport { SkyInputBoxModule } from '@skyux/forms';\n\nimport { SkyUrlValidationModule } from '@skyux/validation';\n\nimport { UrlValidationDemoComponent } from './url-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyUrlValidationModule,\n ],\n exports: [UrlValidationDemoComponent],\n declarations: [UrlValidationDemoComponent],\n})\nexport class UrlValidationDemoModule {}\n"
926
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyUrlValidationModule } from '@skyux/validation';\n\nimport { UrlValidationDemoComponent } from './url-validation-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyUrlValidationModule,\n ],\n exports: [UrlValidationDemoComponent],\n declarations: [UrlValidationDemoComponent],\n})\nexport class UrlValidationDemoModule {}\n"
927
927
  }
928
928
  ]
929
929
  }
@@ -16,7 +16,7 @@ const SKY_EMAIL_VALIDATION_VALIDATOR = {
16
16
  */
17
17
  export class SkyEmailValidationDirective {
18
18
  validate(control) {
19
- let value = control.value;
19
+ const value = control.value;
20
20
  if (!value) {
21
21
  return;
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"email-validation.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/validation/src/lib/modules/email-validation/email-validation.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAa,aAAa,EAAmB,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;;AAEzD,sDAAsD;AACtD,MAAM,8BAA8B,GAAG;IACrC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,2BAA2B,CAAC;IAC1D,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAEhB;;;;GAIG;AAKH,MAAM,OAAO,2BAA2B;IAC/B,QAAQ,CAAC,OAAwB;QACtC,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE1B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QAED,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;YAC7B,OAAO;gBACL,QAAQ,EAAE;oBACR,OAAO,EAAE,OAAO,CAAC,KAAK;iBACvB;aACF,CAAC;SACH;IACH,CAAC;IAEM,YAAY,CAAC,KAAa;QAC/B,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;;yHAnBU,2BAA2B;6GAA3B,2BAA2B,+CAF3B,CAAC,8BAA8B,CAAC;4FAEhC,2BAA2B;kBAJvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EAAE,CAAC,8BAA8B,CAAC;iBAC5C","sourcesContent":["import { Directive, forwardRef } from '@angular/core';\n\nimport { Validator, NG_VALIDATORS, AbstractControl } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_EMAIL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyEmailValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate email addresses. Place this attribute on an `input` element.\n * If users enter values that are not valid email addresses, an error message appears.\n * The directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyEmailValidation]',\n providers: [SKY_EMAIL_VALIDATION_VALIDATOR],\n})\nexport class SkyEmailValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n let value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.emailIsValid(value)) {\n return {\n skyEmail: {\n invalid: control.value,\n },\n };\n }\n }\n\n public emailIsValid(email: string): boolean {\n return SkyValidation.isEmail(email);\n }\n}\n"]}
1
+ {"version":3,"file":"email-validation.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/validation/src/lib/modules/email-validation/email-validation.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAmB,aAAa,EAAa,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;;AAEzD,sDAAsD;AACtD,MAAM,8BAA8B,GAAG;IACrC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,2BAA2B,CAAC;IAC1D,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAEhB;;;;GAIG;AAKH,MAAM,OAAO,2BAA2B;IAC/B,QAAQ,CAAC,OAAwB;QACtC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QAED,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;YAC7B,OAAO;gBACL,QAAQ,EAAE;oBACR,OAAO,EAAE,OAAO,CAAC,KAAK;iBACvB;aACF,CAAC;SACH;IACH,CAAC;IAEM,YAAY,CAAC,KAAa;QAC/B,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;;yHAnBU,2BAA2B;6GAA3B,2BAA2B,+CAF3B,CAAC,8BAA8B,CAAC;4FAEhC,2BAA2B;kBAJvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EAAE,CAAC,8BAA8B,CAAC;iBAC5C","sourcesContent":["import { Directive, forwardRef } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_EMAIL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyEmailValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate email addresses. Place this attribute on an `input` element.\n * If users enter values that are not valid email addresses, an error message appears.\n * The directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyEmailValidation]',\n providers: [SKY_EMAIL_VALIDATION_VALIDATOR],\n})\nexport class SkyEmailValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.emailIsValid(value)) {\n return {\n skyEmail: {\n invalid: control.value,\n },\n };\n }\n }\n\n public emailIsValid(email: string): boolean {\n return SkyValidation.isEmail(email);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"url-validation.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/validation/src/lib/modules/url-validation/url-validation.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAa,aAAa,EAAmB,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;;AAEzD,sDAAsD;AACtD,MAAM,4BAA4B,GAAG;IACnC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC;IACxD,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAEhB;;;;GAIG;AAKH,MAAM,OAAO,yBAAyB;IAC7B,QAAQ,CAAC,OAAwB;QACtC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO;gBACL,MAAM,EAAE;oBACN,OAAO,EAAE,OAAO,CAAC,KAAK;iBACvB;aACF,CAAC;SACH;IACH,CAAC;IAEM,UAAU,CAAC,GAAW;QAC3B,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;;uHAnBU,yBAAyB;2GAAzB,yBAAyB,6CAFzB,CAAC,4BAA4B,CAAC;4FAE9B,yBAAyB;kBAJrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C","sourcesContent":["import { Directive, forwardRef } from '@angular/core';\n\nimport { Validator, NG_VALIDATORS, AbstractControl } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_URL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyUrlValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate URLs. Place this attribute on an `input` element.\n * If users enters values that are not valid URLs, an error message appears.\n * This directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyUrlValidation]',\n providers: [SKY_URL_VALIDATION_VALIDATOR],\n})\nexport class SkyUrlValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.urlIsValid(value)) {\n return {\n skyUrl: {\n invalid: control.value,\n },\n };\n }\n }\n\n public urlIsValid(url: string): boolean {\n return SkyValidation.isUrl(url);\n }\n}\n"]}
1
+ {"version":3,"file":"url-validation.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/validation/src/lib/modules/url-validation/url-validation.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAmB,aAAa,EAAa,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;;AAEzD,sDAAsD;AACtD,MAAM,4BAA4B,GAAG;IACnC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC;IACxD,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAEhB;;;;GAIG;AAKH,MAAM,OAAO,yBAAyB;IAC7B,QAAQ,CAAC,OAAwB;QACtC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO;gBACL,MAAM,EAAE;oBACN,OAAO,EAAE,OAAO,CAAC,KAAK;iBACvB;aACF,CAAC;SACH;IACH,CAAC;IAEM,UAAU,CAAC,GAAW;QAC3B,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;;uHAnBU,yBAAyB;2GAAzB,yBAAyB,6CAFzB,CAAC,4BAA4B,CAAC;4FAE9B,yBAAyB;kBAJrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C","sourcesContent":["import { Directive, forwardRef } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_URL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyUrlValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate URLs. Place this attribute on an `input` element.\n * If users enters values that are not valid URLs, an error message appears.\n * This directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyUrlValidation]',\n providers: [SKY_URL_VALIDATION_VALIDATOR],\n})\nexport class SkyUrlValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.urlIsValid(value)) {\n return {\n skyUrl: {\n invalid: control.value,\n },\n };\n }\n }\n\n public urlIsValid(url: string): boolean {\n return SkyValidation.isUrl(url);\n }\n}\n"]}
@@ -3,11 +3,11 @@ export class SkyValidation {
3
3
  // The regex was obtained from http://emailregex.com/
4
4
  // which claims to correctly handle ~99% of all email addresses.
5
5
  // tslint:disable-next-line:max-line-length
6
- let regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
6
+ const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
7
7
  return regex.test(emailAddress);
8
8
  }
9
9
  static isUrl(url) {
10
- let regex = /^((http|https):\/\/)?([\w\-]+\.)+[\w\-]+/i;
10
+ const regex = /^((http|https):\/\/)?([\w\-]+\.)+[\w\-]+/i;
11
11
  return regex.test(url);
12
12
  }
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../../../../libs/components/validation/src/lib/modules/validation/validation.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,aAAa;IAC1B,MAAM,CAAC,OAAO,CAAC,YAAoB;QACxC,qDAAqD;QACrD,gEAAgE;QAChE,2CAA2C;QAC3C,IAAI,KAAK,GACP,wJAAwJ,CAAC;QAC3J,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,GAAW;QAC7B,IAAI,KAAK,GAAG,2CAA2C,CAAC;QACxD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["export abstract class SkyValidation {\n public static isEmail(emailAddress: string): boolean {\n // The regex was obtained from http://emailregex.com/\n // which claims to correctly handle ~99% of all email addresses.\n // tslint:disable-next-line:max-line-length\n let regex =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return regex.test(emailAddress);\n }\n\n public static isUrl(url: string): boolean {\n let regex = /^((http|https):\\/\\/)?([\\w\\-]+\\.)+[\\w\\-]+/i;\n return regex.test(url);\n }\n}\n"]}
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../../../../libs/components/validation/src/lib/modules/validation/validation.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,aAAa;IAC1B,MAAM,CAAC,OAAO,CAAC,YAAoB;QACxC,qDAAqD;QACrD,gEAAgE;QAChE,2CAA2C;QAC3C,MAAM,KAAK,GACT,wJAAwJ,CAAC;QAC3J,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,GAAW;QAC7B,MAAM,KAAK,GAAG,2CAA2C,CAAC;QAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF","sourcesContent":["export abstract class SkyValidation {\n public static isEmail(emailAddress: string): boolean {\n // The regex was obtained from http://emailregex.com/\n // which claims to correctly handle ~99% of all email addresses.\n // tslint:disable-next-line:max-line-length\n const regex =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return regex.test(emailAddress);\n }\n\n public static isUrl(url: string): boolean {\n const regex = /^((http|https):\\/\\/)?([\\w\\-]+\\.)+[\\w\\-]+/i;\n return regex.test(url);\n }\n}\n"]}
@@ -7,11 +7,11 @@ class SkyValidation {
7
7
  // The regex was obtained from http://emailregex.com/
8
8
  // which claims to correctly handle ~99% of all email addresses.
9
9
  // tslint:disable-next-line:max-line-length
10
- let regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
10
+ const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
11
11
  return regex.test(emailAddress);
12
12
  }
13
13
  static isUrl(url) {
14
- let regex = /^((http|https):\/\/)?([\w\-]+\.)+[\w\-]+/i;
14
+ const regex = /^((http|https):\/\/)?([\w\-]+\.)+[\w\-]+/i;
15
15
  return regex.test(url);
16
16
  }
17
17
  }
@@ -30,7 +30,7 @@ const SKY_EMAIL_VALIDATION_VALIDATOR = {
30
30
  */
31
31
  class SkyEmailValidationDirective {
32
32
  validate(control) {
33
- let value = control.value;
33
+ const value = control.value;
34
34
  if (!value) {
35
35
  return;
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skyux-validation.js","sources":["../../../../../libs/components/validation/src/lib/modules/validation/validation.ts","../../../../../libs/components/validation/src/lib/modules/email-validation/email-validation.directive.ts","../../../../../libs/components/validation/src/lib/modules/email-validation/email-validation.module.ts","../../../../../libs/components/validation/src/lib/modules/url-validation/url-validation.directive.ts","../../../../../libs/components/validation/src/lib/modules/url-validation/url-validation.module.ts","../../../../../libs/components/validation/src/lib/modules/validators/validators.ts","../../../../../libs/components/validation/src/skyux-validation.ts"],"sourcesContent":["export abstract class SkyValidation {\n public static isEmail(emailAddress: string): boolean {\n // The regex was obtained from http://emailregex.com/\n // which claims to correctly handle ~99% of all email addresses.\n // tslint:disable-next-line:max-line-length\n let regex =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return regex.test(emailAddress);\n }\n\n public static isUrl(url: string): boolean {\n let regex = /^((http|https):\\/\\/)?([\\w\\-]+\\.)+[\\w\\-]+/i;\n return regex.test(url);\n }\n}\n","import { Directive, forwardRef } from '@angular/core';\n\nimport { Validator, NG_VALIDATORS, AbstractControl } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_EMAIL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyEmailValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate email addresses. Place this attribute on an `input` element.\n * If users enter values that are not valid email addresses, an error message appears.\n * The directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyEmailValidation]',\n providers: [SKY_EMAIL_VALIDATION_VALIDATOR],\n})\nexport class SkyEmailValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n let value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.emailIsValid(value)) {\n return {\n skyEmail: {\n invalid: control.value,\n },\n };\n }\n }\n\n public emailIsValid(email: string): boolean {\n return SkyValidation.isEmail(email);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyEmailValidationDirective } from './email-validation.directive';\n\n@NgModule({\n declarations: [SkyEmailValidationDirective],\n imports: [FormsModule],\n exports: [SkyEmailValidationDirective],\n})\nexport class SkyEmailValidationModule {}\n","import { Directive, forwardRef } from '@angular/core';\n\nimport { Validator, NG_VALIDATORS, AbstractControl } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_URL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyUrlValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate URLs. Place this attribute on an `input` element.\n * If users enters values that are not valid URLs, an error message appears.\n * This directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyUrlValidation]',\n providers: [SKY_URL_VALIDATION_VALIDATOR],\n})\nexport class SkyUrlValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.urlIsValid(value)) {\n return {\n skyUrl: {\n invalid: control.value,\n },\n };\n }\n }\n\n public urlIsValid(url: string): boolean {\n return SkyValidation.isUrl(url);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyUrlValidationDirective } from './url-validation.directive';\n\n@NgModule({\n declarations: [SkyUrlValidationDirective],\n imports: [FormsModule],\n exports: [SkyUrlValidationDirective],\n})\nexport class SkyUrlValidationModule {}\n","import { AbstractControl, ValidationErrors } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// Need to add the following to classes which contain static methods.\n// See: https://github.com/ng-packagr/ng-packagr/issues/641\n// @dynamic\nexport class SkyValidators {\n /**\n * Validates email addresses in reactive forms. Add this validator directly to the form control\n * model in the component class. If users enter values that are not valid email addresses, the\n * validator throws an error. Since this is a sync validator, it returns a set of validation\n * errors or `undefined` immediately when users enter values.\n * @param control\n */\n public static email(control: AbstractControl): ValidationErrors | null {\n const value = control.value;\n\n if (!value) {\n return undefined;\n }\n\n return SkyValidation.isEmail(value)\n ? undefined\n : { skyEmail: { invalid: value } };\n }\n\n /**\n * Validates URLs in reactive forms. Add this validator directly to the form control model in\n * the component class. If users enter values that are not valid URLs, the validator throws an\n * error. Since this is a sync validator, it returns a set of validation errors or `undefined`\n * immediately when users enter values.\n * @param control\n */\n public static url(control: AbstractControl): ValidationErrors | null {\n const value = control.value;\n\n if (!value) {\n return undefined;\n }\n\n return SkyValidation.isUrl(value)\n ? undefined\n : { skyUrl: { invalid: value } };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAAsB,aAAa;IAC1B,OAAO,OAAO,CAAC,YAAoB;;;;QAIxC,IAAI,KAAK,GACP,wJAAwJ,CAAC;QAC3J,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACjC;IAEM,OAAO,KAAK,CAAC,GAAW;QAC7B,IAAI,KAAK,GAAG,2CAA2C,CAAC;QACxD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACxB;;;ACPH;AACA,MAAM,8BAA8B,GAAG;IACrC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,MAAM,2BAA2B,CAAC;IAC1D,KAAK,EAAE,IAAI;CACZ,CAAC;AACF;AAEA;;;;;MASa,2BAA2B;IAC/B,QAAQ,CAAC,OAAwB;QACtC,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE1B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QAED,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;YAC7B,OAAO;gBACL,QAAQ,EAAE;oBACR,OAAO,EAAE,OAAO,CAAC,KAAK;iBACvB;aACF,CAAC;SACH;KACF;IAEM,YAAY,CAAC,KAAa;QAC/B,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KACrC;;yHAnBU,2BAA2B;6GAA3B,2BAA2B,+CAF3B,CAAC,8BAA8B,CAAC;4FAEhC,2BAA2B;kBAJvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EAAE,CAAC,8BAA8B,CAAC;iBAC5C;;;MCZY,wBA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AAC,WAAW,CAAC;oBACtB,OAAO,EAAE,CAAC,yBAAyB,CAAC;iBACrC;;;ACLD;AACA;AACA;MACa,aAAa;;;;;;;;IAQjB,OAAO,KAAK,CAAC,OAAwB;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC;cAC/B,SAAS;cACT,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;KACtC;;;;;;;;IASM,OAAO,GAAG,CAAC,OAAwB;QACxC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC;cAC7B,SAAS;cACT,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;KACpC;;;AC5CH;;;;;;"}
1
+ {"version":3,"file":"skyux-validation.js","sources":["../../../../../libs/components/validation/src/lib/modules/validation/validation.ts","../../../../../libs/components/validation/src/lib/modules/email-validation/email-validation.directive.ts","../../../../../libs/components/validation/src/lib/modules/email-validation/email-validation.module.ts","../../../../../libs/components/validation/src/lib/modules/url-validation/url-validation.directive.ts","../../../../../libs/components/validation/src/lib/modules/url-validation/url-validation.module.ts","../../../../../libs/components/validation/src/lib/modules/validators/validators.ts","../../../../../libs/components/validation/src/skyux-validation.ts"],"sourcesContent":["export abstract class SkyValidation {\n public static isEmail(emailAddress: string): boolean {\n // The regex was obtained from http://emailregex.com/\n // which claims to correctly handle ~99% of all email addresses.\n // tslint:disable-next-line:max-line-length\n const regex =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return regex.test(emailAddress);\n }\n\n public static isUrl(url: string): boolean {\n const regex = /^((http|https):\\/\\/)?([\\w\\-]+\\.)+[\\w\\-]+/i;\n return regex.test(url);\n }\n}\n","import { Directive, forwardRef } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_EMAIL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyEmailValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate email addresses. Place this attribute on an `input` element.\n * If users enter values that are not valid email addresses, an error message appears.\n * The directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyEmailValidation]',\n providers: [SKY_EMAIL_VALIDATION_VALIDATOR],\n})\nexport class SkyEmailValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.emailIsValid(value)) {\n return {\n skyEmail: {\n invalid: control.value,\n },\n };\n }\n }\n\n public emailIsValid(email: string): boolean {\n return SkyValidation.isEmail(email);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyEmailValidationDirective } from './email-validation.directive';\n\n@NgModule({\n declarations: [SkyEmailValidationDirective],\n imports: [FormsModule],\n exports: [SkyEmailValidationDirective],\n})\nexport class SkyEmailValidationModule {}\n","import { Directive, forwardRef } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_URL_VALIDATION_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyUrlValidationDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates an input to validate URLs. Place this attribute on an `input` element.\n * If users enters values that are not valid URLs, an error message appears.\n * This directive uses `NgModel` to bind data.\n */\n@Directive({\n selector: '[skyUrlValidation]',\n providers: [SKY_URL_VALIDATION_VALIDATOR],\n})\nexport class SkyUrlValidationDirective implements Validator {\n public validate(control: AbstractControl): { [key: string]: any } {\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (!this.urlIsValid(value)) {\n return {\n skyUrl: {\n invalid: control.value,\n },\n };\n }\n }\n\n public urlIsValid(url: string): boolean {\n return SkyValidation.isUrl(url);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { SkyUrlValidationDirective } from './url-validation.directive';\n\n@NgModule({\n declarations: [SkyUrlValidationDirective],\n imports: [FormsModule],\n exports: [SkyUrlValidationDirective],\n})\nexport class SkyUrlValidationModule {}\n","import { AbstractControl, ValidationErrors } from '@angular/forms';\n\nimport { SkyValidation } from '../validation/validation';\n\n// Need to add the following to classes which contain static methods.\n// See: https://github.com/ng-packagr/ng-packagr/issues/641\n// @dynamic\nexport class SkyValidators {\n /**\n * Validates email addresses in reactive forms. Add this validator directly to the form control\n * model in the component class. If users enter values that are not valid email addresses, the\n * validator throws an error. Since this is a sync validator, it returns a set of validation\n * errors or `undefined` immediately when users enter values.\n * @param control\n */\n public static email(control: AbstractControl): ValidationErrors | null {\n const value = control.value;\n\n if (!value) {\n return undefined;\n }\n\n return SkyValidation.isEmail(value)\n ? undefined\n : { skyEmail: { invalid: value } };\n }\n\n /**\n * Validates URLs in reactive forms. Add this validator directly to the form control model in\n * the component class. If users enter values that are not valid URLs, the validator throws an\n * error. Since this is a sync validator, it returns a set of validation errors or `undefined`\n * immediately when users enter values.\n * @param control\n */\n public static url(control: AbstractControl): ValidationErrors | null {\n const value = control.value;\n\n if (!value) {\n return undefined;\n }\n\n return SkyValidation.isUrl(value)\n ? undefined\n : { skyUrl: { invalid: value } };\n }\n}\n","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AO,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC;cAC/B,SAAS;cACT,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;KACtC;;;;;;;;IASM,OAAO,GAAG,CAAC,OAAwB;QACxC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC;cAC7B,SAAS;cACT,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;KACpC;;;AC5CH;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { Validator, AbstractControl } from '@angular/forms';
1
+ import { AbstractControl, Validator } from '@angular/forms';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Creates an input to validate email addresses. Place this attribute on an `input` element.
@@ -1,4 +1,4 @@
1
- import { Validator, AbstractControl } from '@angular/forms';
1
+ import { AbstractControl, Validator } from '@angular/forms';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Creates an input to validate URLs. Place this attribute on an `input` element.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/validation",
3
- "version": "5.5.0-alpha.0",
3
+ "version": "5.6.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^12.2.16",
6
6
  "@angular/core": "^12.2.16",
@@ -9,6 +9,20 @@
9
9
  "dependencies": {
10
10
  "tslib": "^2.3.1"
11
11
  },
12
+ "author": "Blackbaud, Inc.",
13
+ "keywords": [
14
+ "blackbaud",
15
+ "skyux"
16
+ ],
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/blackbaud/skyux.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/blackbaud/skyux/issues"
24
+ },
25
+ "homepage": "https://github.com/blackbaud/skyux#readme",
12
26
  "main": "bundles/skyux-validation.umd.js",
13
27
  "module": "fesm2015/skyux-validation.js",
14
28
  "es2015": "fesm2015/skyux-validation.js",