@skyux/validation 6.0.1 → 6.2.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.
@@ -5,7 +5,8 @@
5
5
  "SkyValidation": "class-skyvalidation",
6
6
  "SkyValidators": "class-skyvalidators",
7
7
  "SkyEmailValidationDirective": "class-skyemailvalidationdirective",
8
- "SkyUrlValidationDirective": "class-skyurlvalidationdirective"
8
+ "SkyUrlValidationDirective": "class-skyurlvalidationdirective",
9
+ "SkyUrlValidationOptions": "interface-skyurlvalidationoptions"
9
10
  },
10
11
  "typedoc": {
11
12
  "id": 0,
@@ -16,7 +17,7 @@
16
17
  "originalName": "",
17
18
  "children": [
18
19
  {
19
- "id": 25,
20
+ "id": 30,
20
21
  "name": "SkyEmailValidationModule",
21
22
  "kind": 128,
22
23
  "kindString": "Class",
@@ -41,7 +42,7 @@
41
42
  "title": "Constructors",
42
43
  "kind": 512,
43
44
  "children": [
44
- 26
45
+ 31
45
46
  ]
46
47
  }
47
48
  ],
@@ -54,7 +55,7 @@
54
55
  ]
55
56
  },
56
57
  {
57
- "id": 28,
58
+ "id": 35,
58
59
  "name": "SkyUrlValidationModule",
59
60
  "kind": 128,
60
61
  "kindString": "Class",
@@ -79,7 +80,7 @@
79
80
  "title": "Constructors",
80
81
  "kind": 512,
81
82
  "children": [
82
- 29
83
+ 36
83
84
  ]
84
85
  }
85
86
  ],
@@ -92,7 +93,7 @@
92
93
  ]
93
94
  },
94
95
  {
95
- "id": 31,
96
+ "id": 38,
96
97
  "name": "SkyValidation",
97
98
  "kind": 128,
98
99
  "kindString": "Class",
@@ -101,7 +102,7 @@
101
102
  },
102
103
  "children": [
103
104
  {
104
- "id": 32,
105
+ "id": 39,
105
106
  "name": "isEmail",
106
107
  "kind": 2048,
107
108
  "kindString": "Method",
@@ -112,20 +113,20 @@
112
113
  "sources": [
113
114
  {
114
115
  "fileName": "projects/validation/src/modules/validation/validation.ts",
115
- "line": 2,
116
+ "line": 6,
116
117
  "character": 16
117
118
  }
118
119
  ],
119
120
  "signatures": [
120
121
  {
121
- "id": 33,
122
+ "id": 40,
122
123
  "name": "isEmail",
123
124
  "kind": 4096,
124
125
  "kindString": "Call signature",
125
126
  "flags": {},
126
127
  "parameters": [
127
128
  {
128
- "id": 34,
129
+ "id": 41,
129
130
  "name": "emailAddress",
130
131
  "kind": 32768,
131
132
  "kindString": "Parameter",
@@ -144,7 +145,7 @@
144
145
  ]
145
146
  },
146
147
  {
147
- "id": 35,
148
+ "id": 42,
148
149
  "name": "isUrl",
149
150
  "kind": 2048,
150
151
  "kindString": "Method",
@@ -155,27 +156,41 @@
155
156
  "sources": [
156
157
  {
157
158
  "fileName": "projects/validation/src/modules/validation/validation.ts",
158
- "line": 10,
159
+ "line": 14,
159
160
  "character": 16
160
161
  }
161
162
  ],
162
163
  "signatures": [
163
164
  {
164
- "id": 36,
165
+ "id": 43,
165
166
  "name": "isUrl",
166
167
  "kind": 4096,
167
168
  "kindString": "Call signature",
168
169
  "flags": {},
169
170
  "parameters": [
170
171
  {
171
- "id": 37,
172
- "name": "url",
172
+ "id": 44,
173
+ "name": "value",
173
174
  "kind": 32768,
174
175
  "kindString": "Parameter",
175
176
  "flags": {},
176
177
  "type": {
177
178
  "type": "intrinsic",
178
- "name": "string"
179
+ "name": "unknown"
180
+ }
181
+ },
182
+ {
183
+ "id": 45,
184
+ "name": "options",
185
+ "kind": 32768,
186
+ "kindString": "Parameter",
187
+ "flags": {
188
+ "isOptional": true
189
+ },
190
+ "type": {
191
+ "type": "reference",
192
+ "id": 33,
193
+ "name": "SkyUrlValidationOptions"
179
194
  }
180
195
  }
181
196
  ],
@@ -192,35 +207,35 @@
192
207
  "title": "Constructors",
193
208
  "kind": 512,
194
209
  "children": [
195
- 38
210
+ 46
196
211
  ]
197
212
  },
198
213
  {
199
214
  "title": "Methods",
200
215
  "kind": 2048,
201
216
  "children": [
202
- 32,
203
- 35
217
+ 39,
218
+ 42
204
219
  ]
205
220
  }
206
221
  ],
207
222
  "sources": [
208
223
  {
209
224
  "fileName": "projects/validation/src/modules/validation/validation.ts",
210
- "line": 1,
225
+ "line": 5,
211
226
  "character": 22
212
227
  }
213
228
  ]
214
229
  },
215
230
  {
216
- "id": 40,
231
+ "id": 48,
217
232
  "name": "SkyValidators",
218
233
  "kind": 128,
219
234
  "kindString": "Class",
220
235
  "flags": {},
221
236
  "children": [
222
237
  {
223
- "id": 41,
238
+ "id": 49,
224
239
  "name": "email",
225
240
  "kind": 2048,
226
241
  "kindString": "Method",
@@ -237,24 +252,21 @@
237
252
  ],
238
253
  "signatures": [
239
254
  {
240
- "id": 42,
255
+ "id": 50,
241
256
  "name": "email",
242
257
  "kind": 4096,
243
258
  "kindString": "Call signature",
244
259
  "flags": {},
245
260
  "comment": {
246
- "shortText": "Validates email addresses in reactive forms. Add this validator directly to the form control\nmodel in the component class. If users enter values that are not valid email addresses, the\nvalidator throws an error. Since this is a sync validator, it returns a set of validation\nerrors or `undefined` immediately when users enter values."
261
+ "shortText": "Validates email addresses in reactive forms. Add this validator directly to the form control\nmodel in the component class. If users enter values that are not valid email addresses, the\nvalidator throws an error. Since this is a sync validator, it returns a set of validation\nerrors or `null` immediately when users enter values."
247
262
  },
248
263
  "parameters": [
249
264
  {
250
- "id": 43,
265
+ "id": 51,
251
266
  "name": "control",
252
267
  "kind": 32768,
253
268
  "kindString": "Parameter",
254
269
  "flags": {},
255
- "comment": {
256
- "shortText": "\n"
257
- },
258
270
  "type": {
259
271
  "type": "reference",
260
272
  "qualifiedName": "AbstractControl",
@@ -273,7 +285,7 @@
273
285
  ]
274
286
  },
275
287
  {
276
- "id": 44,
288
+ "id": 52,
277
289
  "name": "url",
278
290
  "kind": 2048,
279
291
  "kindString": "Method",
@@ -284,30 +296,27 @@
284
296
  "sources": [
285
297
  {
286
298
  "fileName": "projects/validation/src/modules/validators/validators.ts",
287
- "line": 35,
299
+ "line": 34,
288
300
  "character": 16
289
301
  }
290
302
  ],
291
303
  "signatures": [
292
304
  {
293
- "id": 45,
305
+ "id": 53,
294
306
  "name": "url",
295
307
  "kind": 4096,
296
308
  "kindString": "Call signature",
297
309
  "flags": {},
298
310
  "comment": {
299
- "shortText": "Validates URLs in reactive forms. Add this validator directly to the form control model in\nthe component class. If users enter values that are not valid URLs, the validator throws an\nerror. Since this is a sync validator, it returns a set of validation errors or `undefined`\nimmediately when users enter values."
311
+ "shortText": "Validates URLs in reactive forms. Add this validator directly to the form control model in\nthe component class. If users enter values that are not valid URLs, the validator throws an\nerror. Since this is a sync validator, it returns a set of validation errors or `null`\nimmediately when users enter values."
300
312
  },
301
313
  "parameters": [
302
314
  {
303
- "id": 46,
304
- "name": "control",
315
+ "id": 54,
316
+ "name": "abstractControl",
305
317
  "kind": 32768,
306
318
  "kindString": "Parameter",
307
319
  "flags": {},
308
- "comment": {
309
- "shortText": "\n"
310
- },
311
320
  "type": {
312
321
  "type": "reference",
313
322
  "qualifiedName": "AbstractControl",
@@ -322,6 +331,36 @@
322
331
  "package": "@angular/forms",
323
332
  "name": "ValidationErrors"
324
333
  }
334
+ },
335
+ {
336
+ "id": 55,
337
+ "name": "url",
338
+ "kind": 4096,
339
+ "kindString": "Call signature",
340
+ "flags": {},
341
+ "comment": {
342
+ "shortText": "Validates URLs in reactive forms. Add this validator with ruleset parameters directly to\nthe form control model in the component class. If users enter values that are not valid\nURLs, the validator throws an error. Since this is a sync validator, it returns a set of\nvalidation errors or `null` immediately when users enter values."
343
+ },
344
+ "parameters": [
345
+ {
346
+ "id": 56,
347
+ "name": "skyUrlValidationOptions",
348
+ "kind": 32768,
349
+ "kindString": "Parameter",
350
+ "flags": {},
351
+ "type": {
352
+ "type": "reference",
353
+ "id": 33,
354
+ "name": "SkyUrlValidationOptions"
355
+ }
356
+ }
357
+ ],
358
+ "type": {
359
+ "type": "reference",
360
+ "qualifiedName": "ValidatorFn",
361
+ "package": "@angular/forms",
362
+ "name": "ValidatorFn"
363
+ }
325
364
  }
326
365
  ]
327
366
  }
@@ -331,22 +370,22 @@
331
370
  "title": "Constructors",
332
371
  "kind": 512,
333
372
  "children": [
334
- 47
373
+ 57
335
374
  ]
336
375
  },
337
376
  {
338
377
  "title": "Methods",
339
378
  "kind": 2048,
340
379
  "children": [
341
- 41,
342
- 44
380
+ 49,
381
+ 52
343
382
  ]
344
383
  }
345
384
  ],
346
385
  "sources": [
347
386
  {
348
387
  "fileName": "projects/validation/src/modules/validators/validators.ts",
349
- "line": 8,
388
+ "line": 9,
350
389
  "character": 13
351
390
  }
352
391
  ]
@@ -557,8 +596,66 @@
557
596
  ],
558
597
  "children": [
559
598
  {
560
- "id": 22,
561
- "name": "urlIsValid",
599
+ "id": 16,
600
+ "name": "skyUrlValidation",
601
+ "kind": 262144,
602
+ "kindString": "Accessor",
603
+ "flags": {
604
+ "isPublic": true
605
+ },
606
+ "decorators": [
607
+ {
608
+ "name": "Input",
609
+ "type": {
610
+ "type": "reference",
611
+ "qualifiedName": "InputDecorator",
612
+ "package": "@angular/core",
613
+ "name": "Input"
614
+ },
615
+ "arguments": {}
616
+ }
617
+ ],
618
+ "sources": [
619
+ {
620
+ "fileName": "projects/validation/src/modules/url-validation/url-validation.directive.ts",
621
+ "line": 34,
622
+ "character": 13
623
+ }
624
+ ],
625
+ "setSignature": [
626
+ {
627
+ "id": 17,
628
+ "name": "skyUrlValidation",
629
+ "kind": 1048576,
630
+ "kindString": "Set signature",
631
+ "flags": {},
632
+ "comment": {
633
+ "shortText": "Specifies configuration options for the URL validation component."
634
+ },
635
+ "parameters": [
636
+ {
637
+ "id": 18,
638
+ "name": "value",
639
+ "kind": 32768,
640
+ "kindString": "Parameter",
641
+ "flags": {},
642
+ "type": {
643
+ "type": "reference",
644
+ "id": 33,
645
+ "name": "SkyUrlValidationOptions"
646
+ }
647
+ }
648
+ ],
649
+ "type": {
650
+ "type": "intrinsic",
651
+ "name": "void"
652
+ }
653
+ }
654
+ ]
655
+ },
656
+ {
657
+ "id": 25,
658
+ "name": "registerOnValidatorChange",
562
659
  "kind": 2048,
563
660
  "kindString": "Method",
564
661
  "flags": {
@@ -567,39 +664,66 @@
567
664
  "sources": [
568
665
  {
569
666
  "fileName": "projects/validation/src/modules/url-validation/url-validation.directive.ts",
570
- "line": 38,
667
+ "line": 56,
571
668
  "character": 9
572
669
  }
573
670
  ],
574
671
  "signatures": [
575
672
  {
576
- "id": 23,
577
- "name": "urlIsValid",
673
+ "id": 26,
674
+ "name": "registerOnValidatorChange",
578
675
  "kind": 4096,
579
676
  "kindString": "Call signature",
580
677
  "flags": {},
581
678
  "parameters": [
582
679
  {
583
- "id": 24,
584
- "name": "url",
680
+ "id": 27,
681
+ "name": "fn",
585
682
  "kind": 32768,
586
683
  "kindString": "Parameter",
587
684
  "flags": {},
588
685
  "type": {
589
- "type": "intrinsic",
590
- "name": "string"
686
+ "type": "reflection",
687
+ "declaration": {
688
+ "id": 28,
689
+ "name": "__type",
690
+ "kind": 65536,
691
+ "kindString": "Type literal",
692
+ "flags": {},
693
+ "signatures": [
694
+ {
695
+ "id": 29,
696
+ "name": "__type",
697
+ "kind": 4096,
698
+ "kindString": "Call signature",
699
+ "flags": {},
700
+ "type": {
701
+ "type": "intrinsic",
702
+ "name": "void"
703
+ }
704
+ }
705
+ ]
706
+ }
591
707
  }
592
708
  }
593
709
  ],
594
710
  "type": {
595
711
  "type": "intrinsic",
596
- "name": "boolean"
712
+ "name": "void"
713
+ },
714
+ "implementationOf": {
715
+ "type": "reference",
716
+ "name": "Validator.registerOnValidatorChange"
597
717
  }
598
718
  }
599
- ]
719
+ ],
720
+ "implementationOf": {
721
+ "type": "reference",
722
+ "name": "Validator.registerOnValidatorChange"
723
+ }
600
724
  },
601
725
  {
602
- "id": 16,
726
+ "id": 22,
603
727
  "name": "validate",
604
728
  "kind": 2048,
605
729
  "kindString": "Method",
@@ -609,20 +733,20 @@
609
733
  "sources": [
610
734
  {
611
735
  "fileName": "projects/validation/src/modules/url-validation/url-validation.directive.ts",
612
- "line": 22,
736
+ "line": 44,
613
737
  "character": 9
614
738
  }
615
739
  ],
616
740
  "signatures": [
617
741
  {
618
- "id": 17,
742
+ "id": 23,
619
743
  "name": "validate",
620
744
  "kind": 4096,
621
745
  "kindString": "Call signature",
622
746
  "flags": {},
623
747
  "parameters": [
624
748
  {
625
- "id": 18,
749
+ "id": 24,
626
750
  "name": "control",
627
751
  "kind": 32768,
628
752
  "kindString": "Parameter",
@@ -636,37 +760,10 @@
636
760
  }
637
761
  ],
638
762
  "type": {
639
- "type": "reflection",
640
- "declaration": {
641
- "id": 19,
642
- "name": "__type",
643
- "kind": 65536,
644
- "kindString": "Type literal",
645
- "flags": {},
646
- "indexSignature": {
647
- "id": 20,
648
- "name": "__index",
649
- "kind": 8192,
650
- "kindString": "Index signature",
651
- "flags": {},
652
- "parameters": [
653
- {
654
- "id": 21,
655
- "name": "key",
656
- "kind": 32768,
657
- "flags": {},
658
- "type": {
659
- "type": "intrinsic",
660
- "name": "string"
661
- }
662
- }
663
- ],
664
- "type": {
665
- "type": "intrinsic",
666
- "name": "any"
667
- }
668
- }
669
- }
763
+ "type": "reference",
764
+ "qualifiedName": "ValidationErrors",
765
+ "package": "@angular/forms",
766
+ "name": "ValidationErrors"
670
767
  },
671
768
  "implementationOf": {
672
769
  "type": "reference",
@@ -688,19 +785,26 @@
688
785
  14
689
786
  ]
690
787
  },
788
+ {
789
+ "title": "Accessors",
790
+ "kind": 262144,
791
+ "children": [
792
+ 16
793
+ ]
794
+ },
691
795
  {
692
796
  "title": "Methods",
693
797
  "kind": 2048,
694
798
  "children": [
695
- 22,
696
- 16
799
+ 25,
800
+ 22
697
801
  ]
698
802
  }
699
803
  ],
700
804
  "sources": [
701
805
  {
702
806
  "fileName": "projects/validation/src/modules/url-validation/url-validation.directive.ts",
703
- "line": 21,
807
+ "line": 29,
704
808
  "character": 13
705
809
  }
706
810
  ],
@@ -712,6 +816,64 @@
712
816
  "name": "Validator"
713
817
  }
714
818
  ]
819
+ },
820
+ {
821
+ "id": 33,
822
+ "name": "SkyUrlValidationOptions",
823
+ "kind": 256,
824
+ "kindString": "Interface",
825
+ "flags": {},
826
+ "comment": {
827
+ "shortText": "Specifies options for the URL validator component."
828
+ },
829
+ "children": [
830
+ {
831
+ "id": 34,
832
+ "name": "rulesetVersion",
833
+ "kind": 1024,
834
+ "kindString": "Property",
835
+ "flags": {},
836
+ "comment": {
837
+ "shortText": "Indicates the ruleset to use for URL validation. Ruleset 1 uses a regular expression and ruleset 2 uses the third-party [validator.js library](https://github.com/validatorjs/validator.js/)."
838
+ },
839
+ "sources": [
840
+ {
841
+ "fileName": "projects/validation/src/modules/url-validation/url-validation-options.ts",
842
+ "line": 8,
843
+ "character": 2
844
+ }
845
+ ],
846
+ "type": {
847
+ "type": "union",
848
+ "types": [
849
+ {
850
+ "type": "literal",
851
+ "value": 1
852
+ },
853
+ {
854
+ "type": "literal",
855
+ "value": 2
856
+ }
857
+ ]
858
+ }
859
+ }
860
+ ],
861
+ "groups": [
862
+ {
863
+ "title": "Properties",
864
+ "kind": 1024,
865
+ "children": [
866
+ 34
867
+ ]
868
+ }
869
+ ],
870
+ "sources": [
871
+ {
872
+ "fileName": "projects/validation/src/modules/url-validation/url-validation-options.ts",
873
+ "line": 4,
874
+ "character": 17
875
+ }
876
+ ]
715
877
  }
716
878
  ],
717
879
  "groups": [
@@ -719,13 +881,20 @@
719
881
  "title": "Classes",
720
882
  "kind": 128,
721
883
  "children": [
722
- 25,
723
- 28,
724
- 31,
725
- 40,
884
+ 30,
885
+ 35,
886
+ 38,
887
+ 48,
726
888
  1,
727
889
  13
728
890
  ]
891
+ },
892
+ {
893
+ "title": "Interfaces",
894
+ "kind": 256,
895
+ "children": [
896
+ 33
897
+ ]
729
898
  }
730
899
  ],
731
900
  "sources": [
@@ -775,7 +944,7 @@
775
944
  {
776
945
  "fileName": "url-validation-demo.component.ts",
777
946
  "filePath": "/projects/validation/documentation/code-examples/url-validation/control-validator/url-validation-demo.component.ts",
778
- "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"
947
+ "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, [\n Validators.required,\n SkyValidators.url({\n rulesetVersion: 2,\n }),\n ]),\n });\n }\n}\n"
779
948
  },
780
949
  {
781
950
  "fileName": "url-validation-demo.module.ts",
@@ -785,12 +954,12 @@
785
954
  {
786
955
  "fileName": "url-validation-demo.component.html",
787
956
  "filePath": "/projects/validation/documentation/code-examples/url-validation/directive/url-validation-demo.component.html",
788
- "rawContents": "<form novalidate>\n <div class=\"sky-form-group\">\n <sky-input-box>\n <label class=\"sky-control-label\" [for]=\"urlInput.id\"> Url </label>\n <input\n class=\"sky-form-control\"\n name=\"url\"\n skyUrlValidation\n skyId\n [(ngModel)]=\"demoModel.url\"\n #urlInput=\"skyId\"\n #urlControl=\"ngModel\"\n />\n </sky-input-box>\n </div>\n\n <div\n *ngIf=\"urlControl.errors?.skyUrl && urlControl.dirty && urlControl.touched\"\n class=\"sky-error-label\"\n >\n Enter a valid URL in the \"http(s)://site.domain\" format.\n </div>\n</form>\n"
957
+ "rawContents": "<form novalidate>\n <div class=\"sky-form-group\">\n <sky-input-box>\n <label class=\"sky-control-label\" [for]=\"urlInput.id\"> URL </label>\n <input\n class=\"sky-form-control\"\n name=\"url\"\n [skyUrlValidation]=\"skyUrlValidationOptions\"\n skyId\n [(ngModel)]=\"demoModel.url\"\n #urlInput=\"skyId\"\n #urlControl=\"ngModel\"\n />\n </sky-input-box>\n </div>\n\n <div\n *ngIf=\"urlControl.errors?.skyUrl && urlControl.dirty && urlControl.touched\"\n class=\"sky-error-label\"\n >\n Enter a valid URL in the \"http(s)://site.domain\" format.\n </div>\n</form>\n"
789
958
  },
790
959
  {
791
960
  "fileName": "url-validation-demo.component.ts",
792
961
  "filePath": "/projects/validation/documentation/code-examples/url-validation/directive/url-validation-demo.component.ts",
793
- "rawContents": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-url-validation-demo',\n templateUrl: './url-validation-demo.component.html',\n})\nexport class UrlValidationDemoComponent {\n public demoModel: {\n url?: string;\n } = {};\n}\n"
962
+ "rawContents": "import { Component } from '@angular/core';\nimport { SkyUrlValidationOptions } from '@skyux/validation';\n\n@Component({\n selector: 'app-url-validation-demo',\n templateUrl: './url-validation-demo.component.html',\n})\nexport class UrlValidationDemoComponent {\n public demoModel: {\n url?: string;\n } = {};\n\n public skyUrlValidationOptions: SkyUrlValidationOptions = {\n rulesetVersion: 2,\n };\n}\n"
794
963
  },
795
964
  {
796
965
  "fileName": "url-validation-demo.module.ts",