@skyux/phone-field 5.5.0 → 5.6.2

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@skyux/indicators'), require('@skyux/i18n'), require('@skyux/lookup'), require('@skyux/theme'), require('@angular/animations'), require('@skyux/forms'), require('google-libphonenumber'), require('intl-tel-input'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@skyux/phone-field', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@skyux/indicators', '@skyux/i18n', '@skyux/lookup', '@skyux/theme', '@angular/animations', '@skyux/forms', 'google-libphonenumber', 'intl-tel-input', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux["phone-field"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.i6, global.i1, global.i5, global.i3, global.ng.animations, global.i4, global.googleLibphonenumber, null, global.rxjs, global.rxjs.operators));
5
- })(this, (function (exports, i0, i7, i1$1, i6, i1, i5, i3, animations, i4, googleLibphonenumber, intlTelInput, rxjs, operators) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@skyux/i18n'), require('@skyux/indicators'), require('@skyux/lookup'), require('@skyux/theme'), require('google-libphonenumber'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@skyux/forms'), require('intl-tel-input')) :
3
+ typeof define === 'function' && define.amd ? define('@skyux/phone-field', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@skyux/i18n', '@skyux/indicators', '@skyux/lookup', '@skyux/theme', 'google-libphonenumber', 'rxjs', 'rxjs/operators', '@angular/animations', '@skyux/forms', 'intl-tel-input'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux["phone-field"] = {}), global.ng.common, global.ng.core, global.ng.forms, global.i1, global.i6, global.i5, global.i3, global.googleLibphonenumber, global.rxjs, global.rxjs.operators, global.ng.animations, global.i4));
5
+ })(this, (function (exports, i7, i0, i1$1, i1, i6, i5, i3, googleLibphonenumber, rxjs, operators, animations, i4) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -22,11 +22,11 @@
22
22
  return Object.freeze(n);
23
23
  }
24
24
 
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
25
  var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
26
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
27
27
  var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
28
- var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
29
28
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29
+ var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
30
30
  var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
31
31
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
32
32
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
@@ -94,6 +94,66 @@
94
94
  }]
95
95
  }] });
96
96
 
97
+ /**
98
+ * Service for interacting with the DOM elements of the phone field.
99
+ * @internal
100
+ */
101
+ var SkyPhoneFieldAdapterService = /** @class */ (function () {
102
+ function SkyPhoneFieldAdapterService(renderer, resourcesService) {
103
+ this.renderer = renderer;
104
+ this.resourcesService = resourcesService;
105
+ this.ngUnsubscribe = new rxjs.Subject();
106
+ }
107
+ SkyPhoneFieldAdapterService.prototype.ngOnDestroy = function () {
108
+ this.ngUnsubscribe.next();
109
+ this.ngUnsubscribe.complete();
110
+ };
111
+ SkyPhoneFieldAdapterService.prototype.addElementClass = function (elementRef, className) {
112
+ this.renderer.addClass(elementRef.nativeElement, className);
113
+ };
114
+ SkyPhoneFieldAdapterService.prototype.setElementDisabledState = function (elementRef, disabled) {
115
+ this.renderer.setProperty(elementRef.nativeElement, 'disabled', disabled);
116
+ };
117
+ SkyPhoneFieldAdapterService.prototype.setElementPlaceholder = function (elementRef, placeholder) {
118
+ this.renderer.setAttribute(elementRef.nativeElement, 'placeholder', placeholder);
119
+ };
120
+ SkyPhoneFieldAdapterService.prototype.setElementType = function (elementRef) {
121
+ this.renderer.setAttribute(elementRef.nativeElement, 'type', 'tel');
122
+ };
123
+ SkyPhoneFieldAdapterService.prototype.setElementValue = function (elementRef, value) {
124
+ if (value) {
125
+ this.renderer.setProperty(elementRef.nativeElement, 'value', value);
126
+ }
127
+ };
128
+ SkyPhoneFieldAdapterService.prototype.setAriaLabel = function (element) {
129
+ var _this = this;
130
+ /* Sanity check */
131
+ /* istanbul ignore else */
132
+ if (!element.nativeElement.getAttribute('aria-label')) {
133
+ this.resourcesService
134
+ .getString('skyux_phone_field_default_label')
135
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
136
+ .subscribe(function (value) {
137
+ _this.renderer.setAttribute(element.nativeElement, 'aria-label', value);
138
+ });
139
+ }
140
+ };
141
+ SkyPhoneFieldAdapterService.prototype.focusCountrySearchElement = function (el) {
142
+ var input = el.querySelector('textarea');
143
+ input.focus();
144
+ };
145
+ SkyPhoneFieldAdapterService.prototype.focusPhoneInput = function (el) {
146
+ var input = el.querySelector('.sky-phone-field-container input');
147
+ input.focus();
148
+ };
149
+ return SkyPhoneFieldAdapterService;
150
+ }());
151
+ SkyPhoneFieldAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPhoneFieldAdapterService, deps: [{ token: i0__namespace.Renderer2 }, { token: i1__namespace.SkyLibResourcesService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
152
+ SkyPhoneFieldAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPhoneFieldAdapterService });
153
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPhoneFieldAdapterService, decorators: [{
154
+ type: i0.Injectable
155
+ }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i1__namespace.SkyLibResourcesService }]; } });
156
+
97
157
  /*! *****************************************************************************
98
158
  Copyright (c) Microsoft Corporation.
99
159
 
@@ -412,66 +472,6 @@
412
472
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
413
473
  }
414
474
 
415
- /**
416
- * Service for interacting with the DOM elements of the phone field.
417
- * @internal
418
- */
419
- var SkyPhoneFieldAdapterService = /** @class */ (function () {
420
- function SkyPhoneFieldAdapterService(renderer, resourcesService) {
421
- this.renderer = renderer;
422
- this.resourcesService = resourcesService;
423
- this.ngUnsubscribe = new rxjs.Subject();
424
- }
425
- SkyPhoneFieldAdapterService.prototype.ngOnDestroy = function () {
426
- this.ngUnsubscribe.next();
427
- this.ngUnsubscribe.complete();
428
- };
429
- SkyPhoneFieldAdapterService.prototype.addElementClass = function (elementRef, className) {
430
- this.renderer.addClass(elementRef.nativeElement, className);
431
- };
432
- SkyPhoneFieldAdapterService.prototype.setElementDisabledState = function (elementRef, disabled) {
433
- this.renderer.setProperty(elementRef.nativeElement, 'disabled', disabled);
434
- };
435
- SkyPhoneFieldAdapterService.prototype.setElementPlaceholder = function (elementRef, placeholder) {
436
- this.renderer.setAttribute(elementRef.nativeElement, 'placeholder', placeholder);
437
- };
438
- SkyPhoneFieldAdapterService.prototype.setElementType = function (elementRef) {
439
- this.renderer.setAttribute(elementRef.nativeElement, 'type', 'tel');
440
- };
441
- SkyPhoneFieldAdapterService.prototype.setElementValue = function (elementRef, value) {
442
- if (value) {
443
- this.renderer.setProperty(elementRef.nativeElement, 'value', value);
444
- }
445
- };
446
- SkyPhoneFieldAdapterService.prototype.setAriaLabel = function (element) {
447
- var _this = this;
448
- /* Sanity check */
449
- /* istanbul ignore else */
450
- if (!element.nativeElement.getAttribute('aria-label')) {
451
- this.resourcesService
452
- .getString('skyux_phone_field_default_label')
453
- .pipe(operators.takeUntil(this.ngUnsubscribe))
454
- .subscribe(function (value) {
455
- _this.renderer.setAttribute(element.nativeElement, 'aria-label', value);
456
- });
457
- }
458
- };
459
- SkyPhoneFieldAdapterService.prototype.focusCountrySearchElement = function (el) {
460
- var input = el.querySelector('textarea');
461
- input.focus();
462
- };
463
- SkyPhoneFieldAdapterService.prototype.focusPhoneInput = function (el) {
464
- var input = el.querySelector('.sky-phone-field-container input');
465
- input.focus();
466
- };
467
- return SkyPhoneFieldAdapterService;
468
- }());
469
- SkyPhoneFieldAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPhoneFieldAdapterService, deps: [{ token: i0__namespace.Renderer2 }, { token: i1__namespace.SkyLibResourcesService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
470
- SkyPhoneFieldAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPhoneFieldAdapterService });
471
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyPhoneFieldAdapterService, decorators: [{
472
- type: i0.Injectable
473
- }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i1__namespace.SkyLibResourcesService }]; } });
474
-
475
475
  // NOTE: The no-op animation is here in order to block the input's "fade in" animation
476
476
  // from firing on initial load. For more information on this technique you can see
477
477
  // https://www.bennadel.com/blog/3417-using-no-op-transitions-to-prevent-animation-during-the-initial-render-of-ngfor-in-angular-5-2-6.htm
@@ -864,10 +864,11 @@
864
864
  this.skyPhoneFieldNoValidate = false;
865
865
  this.ngUnsubscribe = new rxjs.Subject();
866
866
  this.phoneUtils = googleLibphonenumber.PhoneNumberUtil.getInstance();
867
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
867
868
  this.onChange = function (_) { };
868
- /* istanbul ignore next */
869
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
869
870
  this.onTouched = function () { };
870
- /* istanbul ignore next */
871
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
871
872
  this.validatorChange = function () { };
872
873
  }
873
874
  Object.defineProperty(SkyPhoneFieldInputDirective.prototype, "disabled", {
@@ -34,29 +34,7 @@
34
34
  }
35
35
  }
36
36
  ],
37
- "children": [
38
- {
39
- "id": 134,
40
- "name": "constructor",
41
- "kind": 512,
42
- "kindString": "Constructor",
43
- "flags": {},
44
- "signatures": [
45
- {
46
- "id": 135,
47
- "name": "new SkyPhoneFieldModule",
48
- "kind": 16384,
49
- "kindString": "Constructor signature",
50
- "flags": {},
51
- "type": {
52
- "type": "reference",
53
- "id": 133,
54
- "name": "SkyPhoneFieldModule"
55
- }
56
- }
57
- ]
58
- }
59
- ],
37
+ "children": [],
60
38
  "groups": [
61
39
  {
62
40
  "title": "Constructors",
@@ -69,7 +47,7 @@
69
47
  "sources": [
70
48
  {
71
49
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.module.ts",
72
- "line": 35,
50
+ "line": 28,
73
51
  "character": 13
74
52
  }
75
53
  ]
@@ -104,7 +82,7 @@
104
82
  "sources": [
105
83
  {
106
84
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
107
- "line": 240,
85
+ "line": 232,
108
86
  "character": 2
109
87
  }
110
88
  ],
@@ -254,7 +232,7 @@
254
232
  "sources": [
255
233
  {
256
234
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
257
- "line": 121,
235
+ "line": 113,
258
236
  "character": 9
259
237
  }
260
238
  ],
@@ -275,7 +253,7 @@
275
253
  "sources": [
276
254
  {
277
255
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
278
- "line": 168,
256
+ "line": 160,
279
257
  "character": 9
280
258
  }
281
259
  ],
@@ -299,7 +277,7 @@
299
277
  "sources": [
300
278
  {
301
279
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
302
- "line": 176,
280
+ "line": 168,
303
281
  "character": 9
304
282
  }
305
283
  ],
@@ -321,7 +299,7 @@
321
299
  "sources": [
322
300
  {
323
301
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
324
- "line": 172,
302
+ "line": 164,
325
303
  "character": 9
326
304
  }
327
305
  ],
@@ -342,7 +320,7 @@
342
320
  "sources": [
343
321
  {
344
322
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
345
- "line": 170,
323
+ "line": 162,
346
324
  "character": 9
347
325
  }
348
326
  ],
@@ -352,20 +330,6 @@
352
330
  },
353
331
  "defaultValue": "false"
354
332
  },
355
- {
356
- "id": 36,
357
- "name": "inputBoxHostSvc",
358
- "kind": 1024,
359
- "kindString": "Property",
360
- "flags": {
361
- "isPublic": true,
362
- "isOptional": true
363
- },
364
- "type": {
365
- "type": "reference",
366
- "name": "SkyInputBoxHostService"
367
- }
368
- },
369
333
  {
370
334
  "id": 20,
371
335
  "name": "phoneInputShown",
@@ -377,7 +341,7 @@
377
341
  "sources": [
378
342
  {
379
343
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
380
- "line": 174,
344
+ "line": 166,
381
345
  "character": 9
382
346
  }
383
347
  ],
@@ -419,7 +383,7 @@
419
383
  "sources": [
420
384
  {
421
385
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
422
- "line": 151,
386
+ "line": 143,
423
387
  "character": 9
424
388
  }
425
389
  ],
@@ -456,7 +420,7 @@
456
420
  "sources": [
457
421
  {
458
422
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
459
- "line": 166,
423
+ "line": 158,
460
424
  "character": 9
461
425
  }
462
426
  ],
@@ -501,7 +465,7 @@
501
465
  "sources": [
502
466
  {
503
467
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
504
- "line": 158,
468
+ "line": 150,
505
469
  "character": 9
506
470
  }
507
471
  ],
@@ -513,20 +477,6 @@
513
477
  }
514
478
  }
515
479
  },
516
- {
517
- "id": 35,
518
- "name": "themeSvc",
519
- "kind": 1024,
520
- "kindString": "Property",
521
- "flags": {
522
- "isPublic": true,
523
- "isOptional": true
524
- },
525
- "type": {
526
- "type": "reference",
527
- "name": "SkyThemeService"
528
- }
529
- },
530
480
  {
531
481
  "id": 10,
532
482
  "name": "defaultCountry",
@@ -550,7 +500,7 @@
550
500
  "sources": [
551
501
  {
552
502
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
553
- "line": 131,
503
+ "line": 123,
554
504
  "character": 13
555
505
  }
556
506
  ],
@@ -635,7 +585,7 @@
635
585
  "sources": [
636
586
  {
637
587
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
638
- "line": 182,
588
+ "line": 174,
639
589
  "character": 13
640
590
  }
641
591
  ],
@@ -698,7 +648,7 @@
698
648
  "sources": [
699
649
  {
700
650
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
701
- "line": 334,
651
+ "line": 326,
702
652
  "character": 9
703
653
  }
704
654
  ],
@@ -742,7 +692,7 @@
742
692
  "sources": [
743
693
  {
744
694
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
745
- "line": 301,
695
+ "line": 293,
746
696
  "character": 9
747
697
  }
748
698
  ],
@@ -779,7 +729,7 @@
779
729
  "sources": [
780
730
  {
781
731
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
782
- "line": 270,
732
+ "line": 262,
783
733
  "character": 9
784
734
  }
785
735
  ],
@@ -816,7 +766,7 @@
816
766
  "sources": [
817
767
  {
818
768
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
819
- "line": 344,
769
+ "line": 336,
820
770
  "character": 9
821
771
  }
822
772
  ],
@@ -860,7 +810,7 @@
860
810
  "sources": [
861
811
  {
862
812
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
863
- "line": 357,
813
+ "line": 349,
864
814
  "character": 9
865
815
  }
866
816
  ],
@@ -902,7 +852,7 @@
902
852
  "sources": [
903
853
  {
904
854
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
905
- "line": 320,
855
+ "line": 312,
906
856
  "character": 9
907
857
  }
908
858
  ],
@@ -983,7 +933,7 @@
983
933
  "sources": [
984
934
  {
985
935
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field.component.ts",
986
- "line": 115,
936
+ "line": 107,
987
937
  "character": 13
988
938
  }
989
939
  ],
@@ -1043,7 +993,7 @@
1043
993
  "sources": [
1044
994
  {
1045
995
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1046
- "line": 125,
996
+ "line": 120,
1047
997
  "character": 2
1048
998
  }
1049
999
  ],
@@ -1175,7 +1125,7 @@
1175
1125
  "sources": [
1176
1126
  {
1177
1127
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1178
- "line": 92,
1128
+ "line": 87,
1179
1129
  "character": 9
1180
1130
  }
1181
1131
  ],
@@ -1208,7 +1158,7 @@
1208
1158
  "sources": [
1209
1159
  {
1210
1160
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1211
- "line": 74,
1161
+ "line": 69,
1212
1162
  "character": 13
1213
1163
  }
1214
1164
  ],
@@ -1281,7 +1231,7 @@
1281
1231
  "sources": [
1282
1232
  {
1283
1233
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1284
- "line": 152,
1234
+ "line": 147,
1285
1235
  "character": 9
1286
1236
  }
1287
1237
  ],
@@ -1318,7 +1268,7 @@
1318
1268
  "sources": [
1319
1269
  {
1320
1270
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1321
- "line": 172,
1271
+ "line": 167,
1322
1272
  "character": 9
1323
1273
  }
1324
1274
  ],
@@ -1355,7 +1305,7 @@
1355
1305
  "sources": [
1356
1306
  {
1357
1307
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1358
- "line": 132,
1308
+ "line": 127,
1359
1309
  "character": 9
1360
1310
  }
1361
1311
  ],
@@ -1406,7 +1356,7 @@
1406
1356
  "sources": [
1407
1357
  {
1408
1358
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1409
- "line": 194,
1359
+ "line": 189,
1410
1360
  "character": 9
1411
1361
  }
1412
1362
  ],
@@ -1453,7 +1403,7 @@
1453
1403
  "sources": [
1454
1404
  {
1455
1405
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1456
- "line": 182,
1406
+ "line": 177,
1457
1407
  "character": 9
1458
1408
  }
1459
1409
  ],
@@ -1516,7 +1466,7 @@
1516
1466
  "sources": [
1517
1467
  {
1518
1468
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1519
- "line": 199,
1469
+ "line": 194,
1520
1470
  "character": 9
1521
1471
  }
1522
1472
  ],
@@ -1558,7 +1508,7 @@
1558
1508
  "sources": [
1559
1509
  {
1560
1510
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1561
- "line": 217,
1511
+ "line": 212,
1562
1512
  "character": 9
1563
1513
  }
1564
1514
  ],
@@ -1640,7 +1590,7 @@
1640
1590
  "sources": [
1641
1591
  {
1642
1592
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1643
- "line": 221,
1593
+ "line": 216,
1644
1594
  "character": 9
1645
1595
  }
1646
1596
  ],
@@ -1709,7 +1659,7 @@
1709
1659
  "sources": [
1710
1660
  {
1711
1661
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1712
- "line": 225,
1662
+ "line": 220,
1713
1663
  "character": 9
1714
1664
  }
1715
1665
  ],
@@ -1778,7 +1728,7 @@
1778
1728
  "sources": [
1779
1729
  {
1780
1730
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1781
- "line": 233,
1731
+ "line": 228,
1782
1732
  "character": 9
1783
1733
  }
1784
1734
  ],
@@ -1834,7 +1784,7 @@
1834
1784
  "sources": [
1835
1785
  {
1836
1786
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1837
- "line": 241,
1787
+ "line": 236,
1838
1788
  "character": 9
1839
1789
  }
1840
1790
  ],
@@ -1894,7 +1844,7 @@
1894
1844
  "sources": [
1895
1845
  {
1896
1846
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1897
- "line": 211,
1847
+ "line": 206,
1898
1848
  "character": 9
1899
1849
  }
1900
1850
  ],
@@ -1984,7 +1934,7 @@
1984
1934
  "sources": [
1985
1935
  {
1986
1936
  "fileName": "projects/phone-field/src/modules/phone-field/phone-field-input.directive.ts",
1987
- "line": 66,
1937
+ "line": 61,
1988
1938
  "character": 13
1989
1939
  }
1990
1940
  ],
@@ -2227,12 +2177,12 @@
2227
2177
  {
2228
2178
  "fileName": "phone-field-demo.component.ts",
2229
2179
  "filePath": "/projects/phone-field/documentation/code-examples/phone-field/basic/phone-field-demo.component.ts",
2230
- "rawContents": "import { Component, OnInit } from '@angular/core';\n\nimport { FormControl, FormGroup } from '@angular/forms';\n\n@Component({\n selector: 'app-phone-field-demo',\n templateUrl: './phone-field-demo.component.html',\n styleUrls: ['./phone-field-demo.component.scss'],\n})\nexport class PhoneFieldDemoComponent implements OnInit {\n public phoneControl: FormControl;\n\n public phoneForm: FormGroup;\n\n public ngOnInit(): void {\n this.phoneControl = new FormControl();\n this.phoneForm = new FormGroup({\n phoneControl: this.phoneControl,\n });\n }\n}\n"
2180
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\n\n@Component({\n selector: 'app-phone-field-demo',\n templateUrl: './phone-field-demo.component.html',\n styleUrls: ['./phone-field-demo.component.scss'],\n})\nexport class PhoneFieldDemoComponent implements OnInit {\n public phoneControl: FormControl;\n\n public phoneForm: FormGroup;\n\n public ngOnInit(): void {\n this.phoneControl = new FormControl();\n this.phoneForm = new FormGroup({\n phoneControl: this.phoneControl,\n });\n }\n}\n"
2231
2181
  },
2232
2182
  {
2233
2183
  "fileName": "phone-field-demo.module.ts",
2234
2184
  "filePath": "/projects/phone-field/documentation/code-examples/phone-field/basic/phone-field-demo.module.ts",
2235
- "rawContents": "import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { SkyInputBoxModule } from '@skyux/forms';\n\nimport { SkyStatusIndicatorModule } from '@skyux/indicators';\n\nimport { SkyPhoneFieldModule } from '@skyux/phone-field';\n\nimport { PhoneFieldDemoComponent } from './phone-field-demo.component';\n\n@NgModule({\n declarations: [PhoneFieldDemoComponent],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyInputBoxModule,\n SkyPhoneFieldModule,\n SkyStatusIndicatorModule,\n ],\n exports: [PhoneFieldDemoComponent],\n})\nexport class PhoneFieldDemoModule {}\n"
2185
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyStatusIndicatorModule } from '@skyux/indicators';\nimport { SkyPhoneFieldModule } from '@skyux/phone-field';\n\nimport { PhoneFieldDemoComponent } from './phone-field-demo.component';\n\n@NgModule({\n declarations: [PhoneFieldDemoComponent],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyInputBoxModule,\n SkyPhoneFieldModule,\n SkyStatusIndicatorModule,\n ],\n exports: [PhoneFieldDemoComponent],\n})\nexport class PhoneFieldDemoModule {}\n"
2236
2186
  }
2237
2187
  ]
2238
2188
  }
@@ -1 +1 @@
1
- {"version":3,"file":"phone-field-adapter.service.js","sourceRoot":"","sources":["../../../../../../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AI,KAAK,EAAE;YACT,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;SACrE;IACH,CAAC;IAEM,YAAY,CAAC,OAAmB;QACrC,kBAAkB;QAClB,0BAA0B;QAC1B,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE;YACrD,IAAI,CAAC,gBAAgB;iBAClB,SAAS,CAAC,iCAAiC,CAAC;iBAC5C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;iBACnC,SAAS,CAAC,CAAC,KAAa,EAAE,EAAE;gBAC3B,IAAI,CAAC,QAAQ,CAAC,YAAY,CACxB,OAAO,CAAC,aAAa,EACrB,YAAY,EACZ,KAAK,CACN,CAAC;YACJ,CAAC,CAAC,CAAC;SACN;IACH,CAAC;IAEM,yBAAyB,CAAC,EAAW;QAC1C,MAAM,KAAK,GAAgB,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACxD,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;IAEM,eAAe,CAAC,EAAW;QAChC,MAAM,KAAK,GAAgB,EAAE,CAAC,aAAa,CACzC,kCAAkC,CACnC,CAAC;QACF,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;;yHAxEU,2BAA2B;6HAA3B,2BAA2B;4FAA3B,2BAA2B;kBADvC,UAAU","sourcesContent":["import { Injectable, OnDestroy, Renderer2, ElementRef } from '@angular/core';\n\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subject } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\n/**\n * Service for interacting with the DOM elements of the phone field.\n * @internal\n */\n@Injectable()\nexport class SkyPhoneFieldAdapterService implements OnDestroy {\n private ngUnsubscribe = new Subject();\n\n constructor(\n private renderer: Renderer2,\n private resourcesService: SkyLibResourcesService\n ) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public addElementClass(elementRef: ElementRef, className: string): void {\n this.renderer.addClass(elementRef.nativeElement, className);\n }\n\n public setElementDisabledState(\n elementRef: ElementRef,\n disabled: boolean\n ): void {\n this.renderer.setProperty(elementRef.nativeElement, 'disabled', disabled);\n }\n\n public setElementPlaceholder(\n elementRef: ElementRef,\n placeholder: string\n ): void {\n this.renderer.setAttribute(\n elementRef.nativeElement,\n 'placeholder',\n placeholder\n );\n }\n\n public setElementType(elementRef: ElementRef): void {\n this.renderer.setAttribute(elementRef.nativeElement, 'type', 'tel');\n }\n\n public setElementValue(elementRef: ElementRef, value: string): void {\n if (value) {\n this.renderer.setProperty(elementRef.nativeElement, 'value', value);\n }\n }\n\n public setAriaLabel(element: ElementRef): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (!element.nativeElement.getAttribute('aria-label')) {\n this.resourcesService\n .getString('skyux_phone_field_default_label')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: string) => {\n this.renderer.setAttribute(\n element.nativeElement,\n 'aria-label',\n value\n );\n });\n }\n }\n\n public focusCountrySearchElement(el: Element): void {\n const input: HTMLElement = el.querySelector('textarea');\n input.focus();\n }\n\n public focusPhoneInput(el: Element): void {\n const input: HTMLElement = el.querySelector(\n '.sky-phone-field-container input'\n );\n input.focus();\n }\n}\n"]}
1
+ {"version":3,"file":"phone-field-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;;;AAE3C;;;GAGG;AAEH,MAAM,OAAO,2BAA2B;I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AC5C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;iBACnC,SAAS,CAAC,CAAC,KAAa,EAAE,EAAE;gBAC3B,IAAI,CAAC,QAAQ,CAAC,YAAY,CACxB,OAAO,CAAC,aAAa,EACrB,YAAY,EACZ,KAAK,CACN,CAAC;YACJ,CAAC,CAAC,CAAC;SACN;IACH,CAAC;IAEM,yBAAyB,CAAC,EAAW;QAC1C,MAAM,KAAK,GAAgB,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACxD,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;IAEM,eAAe,CAAC,EAAW;QAChC,MAAM,KAAK,GAAgB,EAAE,CAAC,aAAa,CACzC,kCAAkC,CACnC,CAAC;QACF,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;;yHAxEU,2BAA2B;6HAA3B,2BAA2B;4FAA3B,2BAA2B;kBADvC,UAAU","sourcesContent":["import { ElementRef, Injectable, OnDestroy, Renderer2 } from '@angular/core';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n/**\n * Service for interacting with the DOM elements of the phone field.\n * @internal\n */\n@Injectable()\nexport class SkyPhoneFieldAdapterService implements OnDestroy {\n private ngUnsubscribe = new Subject();\n\n constructor(\n private renderer: Renderer2,\n private resourcesService: SkyLibResourcesService\n ) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public addElementClass(elementRef: ElementRef, className: string): void {\n this.renderer.addClass(elementRef.nativeElement, className);\n }\n\n public setElementDisabledState(\n elementRef: ElementRef,\n disabled: boolean\n ): void {\n this.renderer.setProperty(elementRef.nativeElement, 'disabled', disabled);\n }\n\n public setElementPlaceholder(\n elementRef: ElementRef,\n placeholder: string\n ): void {\n this.renderer.setAttribute(\n elementRef.nativeElement,\n 'placeholder',\n placeholder\n );\n }\n\n public setElementType(elementRef: ElementRef): void {\n this.renderer.setAttribute(elementRef.nativeElement, 'type', 'tel');\n }\n\n public setElementValue(elementRef: ElementRef, value: string): void {\n if (value) {\n this.renderer.setProperty(elementRef.nativeElement, 'value', value);\n }\n }\n\n public setAriaLabel(element: ElementRef): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (!element.nativeElement.getAttribute('aria-label')) {\n this.resourcesService\n .getString('skyux_phone_field_default_label')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: string) => {\n this.renderer.setAttribute(\n element.nativeElement,\n 'aria-label',\n value\n );\n });\n }\n }\n\n public focusCountrySearchElement(el: Element): void {\n const input: HTMLElement = el.querySelector('textarea');\n input.focus();\n }\n\n public focusPhoneInput(el: Element): void {\n const input: HTMLElement = el.querySelector(\n '.sky-phone-field-container input'\n );\n input.focus();\n }\n}\n"]}
@@ -1,10 +1,10 @@
1
- import { ChangeDetectorRef, Directive, ElementRef, forwardRef, HostListener, Input, Optional, } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, } from '@angular/forms';
1
+ import { ChangeDetectorRef, Directive, ElementRef, HostListener, Input, Optional, forwardRef, } from '@angular/core';
2
+ import { NG_VALIDATORS, NG_VALUE_ACCESSOR, } from '@angular/forms';
3
+ import { PhoneNumberFormat, PhoneNumberUtil } from 'google-libphonenumber';
3
4
  import { BehaviorSubject, Subject } from 'rxjs';
4
5
  import { debounceTime, takeUntil } from 'rxjs/operators';
5
- import { PhoneNumberFormat, PhoneNumberUtil } from 'google-libphonenumber';
6
- import { SkyPhoneFieldComponent } from './phone-field.component';
7
6
  import { SkyPhoneFieldAdapterService } from './phone-field-adapter.service';
7
+ import { SkyPhoneFieldComponent } from './phone-field.component';
8
8
  import * as i0 from "@angular/core";
9
9
  import * as i1 from "./phone-field-adapter.service";
10
10
  import * as i2 from "./phone-field.component";
@@ -49,10 +49,11 @@ export class SkyPhoneFieldInputDirective {
49
49
  this.skyPhoneFieldNoValidate = false;
50
50
  this.ngUnsubscribe = new Subject();
51
51
  this.phoneUtils = PhoneNumberUtil.getInstance();
52
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
52
53
  this.onChange = (_) => { };
53
- /* istanbul ignore next */
54
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
54
55
  this.onTouched = () => { };
55
- /* istanbul ignore next */
56
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
56
57
  this.validatorChange = () => { };
57
58
  }
58
59
  /**
@@ -71,7 +72,7 @@ export class SkyPhoneFieldInputDirective {
71
72
  this._modelValue = value;
72
73
  this.adapterService.setElementValue(this.elRef, value);
73
74
  if (value) {
74
- let formattedValue = this.formatNumber(value.toString());
75
+ const formattedValue = this.formatNumber(value.toString());
75
76
  this.onChange(formattedValue);
76
77
  }
77
78
  else {