@smart-webcomponents-angular/phoneinput 11.0.1 → 13.0.1

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.
Files changed (39) hide show
  1. package/esm2020/phoneinput/index.mjs +2 -0
  2. package/{esm2015/phoneinput/public_api.js → esm2020/phoneinput/public_api.mjs} +0 -0
  3. package/{esm2015/phoneinput/smart-webcomponents-angular-phoneinput.js → esm2020/phoneinput/smart-webcomponents-angular-phoneinput.mjs} +2 -3
  4. package/esm2020/phoneinput/smart.element.mjs +96 -0
  5. package/esm2020/phoneinput/smart.phoneinput.mjs +443 -0
  6. package/esm2020/phoneinput/smart.phoneinput.module.mjs +18 -0
  7. package/fesm2015/{smart-webcomponents-angular-phoneinput.js → smart-webcomponents-angular-phoneinput.mjs} +85 -51
  8. package/fesm2015/smart-webcomponents-angular-phoneinput.mjs.map +1 -0
  9. package/fesm2020/smart-webcomponents-angular-phoneinput.mjs +565 -0
  10. package/fesm2020/smart-webcomponents-angular-phoneinput.mjs.map +1 -0
  11. package/index.d.ts +275 -18
  12. package/package.json +26 -24
  13. package/phoneinput/index.d.ts +1 -0
  14. package/phoneinput/smart-webcomponents-angular-phoneinput.d.ts +2 -2
  15. package/phoneinput/smart.element.d.ts +4 -1
  16. package/phoneinput/smart.phoneinput.d.ts +4 -1
  17. package/phoneinput/smart.phoneinput.module.d.ts +5 -0
  18. package/source/modules/smart.input.js +1 -1
  19. package/source/modules/smart.phoneinput.js +2 -2
  20. package/source/smart.button.js +1 -1
  21. package/source/smart.countryinput.js +1 -1
  22. package/source/smart.element.js +2 -2
  23. package/source/smart.input.js +2 -2
  24. package/source/smart.phoneinput.js +1 -1
  25. package/source/smart.scrollbar.js +1 -1
  26. package/styles/font/smart-icons.eot +0 -0
  27. package/styles/font/smart-icons.svg +11 -3
  28. package/styles/font/smart-icons.ttf +0 -0
  29. package/styles/font/smart-icons.woff +0 -0
  30. package/styles/font/smart-icons.woff2 +0 -0
  31. package/styles/smart.base.css +2 -2
  32. package/styles/smart.phoneinput.css +2 -2
  33. package/bundles/smart-webcomponents-angular-phoneinput.umd.js +0 -1001
  34. package/bundles/smart-webcomponents-angular-phoneinput.umd.min.js +0 -25
  35. package/esm2015/phoneinput/smart.element.js +0 -83
  36. package/esm2015/phoneinput/smart.phoneinput.js +0 -434
  37. package/esm2015/phoneinput/smart.phoneinput.module.js +0 -13
  38. package/fesm2015/smart-webcomponents-angular-phoneinput.js.map +0 -1
  39. package/phoneinput/smart-webcomponents-angular-phoneinput.metadata.json +0 -1
@@ -1,1001 +0,0 @@
1
-
2
- if (!window['Smart']) {
3
- window['Smart'] = { RenderMode: 'manual' };
4
- }
5
- else {
6
- window['Smart'].RenderMode = 'manual';
7
- }
8
- import './../source/modules/smart.phoneinput';
9
-
10
- (function (global, factory) {
11
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms')) :
12
- typeof define === 'function' && define.amd ? define('smart-webcomponents-angular/phoneinput', ['exports', '@angular/core', '@angular/forms'], factory) :
13
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['smart-webcomponents-angular'] = global['smart-webcomponents-angular'] || {}, global['smart-webcomponents-angular'].phoneinput = {}), global.ng.core, global.ng.forms));
14
- }(this, (function (exports, core, forms) { 'use strict';
15
-
16
- /*! *****************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */
30
- /* global Reflect, Promise */
31
- var extendStatics = function (d, b) {
32
- extendStatics = Object.setPrototypeOf ||
33
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
34
- function (d, b) { for (var p in b)
35
- if (Object.prototype.hasOwnProperty.call(b, p))
36
- d[p] = b[p]; };
37
- return extendStatics(d, b);
38
- };
39
- function __extends(d, b) {
40
- if (typeof b !== "function" && b !== null)
41
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
42
- extendStatics(d, b);
43
- function __() { this.constructor = d; }
44
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
45
- }
46
- var __assign = function () {
47
- __assign = Object.assign || function __assign(t) {
48
- for (var s, i = 1, n = arguments.length; i < n; i++) {
49
- s = arguments[i];
50
- for (var p in s)
51
- if (Object.prototype.hasOwnProperty.call(s, p))
52
- t[p] = s[p];
53
- }
54
- return t;
55
- };
56
- return __assign.apply(this, arguments);
57
- };
58
- function __rest(s, e) {
59
- var t = {};
60
- for (var p in s)
61
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
62
- t[p] = s[p];
63
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
64
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
65
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
66
- t[p[i]] = s[p[i]];
67
- }
68
- return t;
69
- }
70
- function __decorate(decorators, target, key, desc) {
71
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
72
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
73
- r = Reflect.decorate(decorators, target, key, desc);
74
- else
75
- for (var i = decorators.length - 1; i >= 0; i--)
76
- if (d = decorators[i])
77
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
78
- return c > 3 && r && Object.defineProperty(target, key, r), r;
79
- }
80
- function __param(paramIndex, decorator) {
81
- return function (target, key) { decorator(target, key, paramIndex); };
82
- }
83
- function __metadata(metadataKey, metadataValue) {
84
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
85
- return Reflect.metadata(metadataKey, metadataValue);
86
- }
87
- function __awaiter(thisArg, _arguments, P, generator) {
88
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
89
- return new (P || (P = Promise))(function (resolve, reject) {
90
- function fulfilled(value) { try {
91
- step(generator.next(value));
92
- }
93
- catch (e) {
94
- reject(e);
95
- } }
96
- function rejected(value) { try {
97
- step(generator["throw"](value));
98
- }
99
- catch (e) {
100
- reject(e);
101
- } }
102
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
103
- step((generator = generator.apply(thisArg, _arguments || [])).next());
104
- });
105
- }
106
- function __generator(thisArg, body) {
107
- var _ = { label: 0, sent: function () { if (t[0] & 1)
108
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
109
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
110
- function verb(n) { return function (v) { return step([n, v]); }; }
111
- function step(op) {
112
- if (f)
113
- throw new TypeError("Generator is already executing.");
114
- while (_)
115
- try {
116
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
117
- return t;
118
- if (y = 0, t)
119
- op = [op[0] & 2, t.value];
120
- switch (op[0]) {
121
- case 0:
122
- case 1:
123
- t = op;
124
- break;
125
- case 4:
126
- _.label++;
127
- return { value: op[1], done: false };
128
- case 5:
129
- _.label++;
130
- y = op[1];
131
- op = [0];
132
- continue;
133
- case 7:
134
- op = _.ops.pop();
135
- _.trys.pop();
136
- continue;
137
- default:
138
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
139
- _ = 0;
140
- continue;
141
- }
142
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
143
- _.label = op[1];
144
- break;
145
- }
146
- if (op[0] === 6 && _.label < t[1]) {
147
- _.label = t[1];
148
- t = op;
149
- break;
150
- }
151
- if (t && _.label < t[2]) {
152
- _.label = t[2];
153
- _.ops.push(op);
154
- break;
155
- }
156
- if (t[2])
157
- _.ops.pop();
158
- _.trys.pop();
159
- continue;
160
- }
161
- op = body.call(thisArg, _);
162
- }
163
- catch (e) {
164
- op = [6, e];
165
- y = 0;
166
- }
167
- finally {
168
- f = t = 0;
169
- }
170
- if (op[0] & 5)
171
- throw op[1];
172
- return { value: op[0] ? op[1] : void 0, done: true };
173
- }
174
- }
175
- var __createBinding = Object.create ? (function (o, m, k, k2) {
176
- if (k2 === undefined)
177
- k2 = k;
178
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
179
- }) : (function (o, m, k, k2) {
180
- if (k2 === undefined)
181
- k2 = k;
182
- o[k2] = m[k];
183
- });
184
- function __exportStar(m, o) {
185
- for (var p in m)
186
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
187
- __createBinding(o, m, p);
188
- }
189
- function __values(o) {
190
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
191
- if (m)
192
- return m.call(o);
193
- if (o && typeof o.length === "number")
194
- return {
195
- next: function () {
196
- if (o && i >= o.length)
197
- o = void 0;
198
- return { value: o && o[i++], done: !o };
199
- }
200
- };
201
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
202
- }
203
- function __read(o, n) {
204
- var m = typeof Symbol === "function" && o[Symbol.iterator];
205
- if (!m)
206
- return o;
207
- var i = m.call(o), r, ar = [], e;
208
- try {
209
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
210
- ar.push(r.value);
211
- }
212
- catch (error) {
213
- e = { error: error };
214
- }
215
- finally {
216
- try {
217
- if (r && !r.done && (m = i["return"]))
218
- m.call(i);
219
- }
220
- finally {
221
- if (e)
222
- throw e.error;
223
- }
224
- }
225
- return ar;
226
- }
227
- /** @deprecated */
228
- function __spread() {
229
- for (var ar = [], i = 0; i < arguments.length; i++)
230
- ar = ar.concat(__read(arguments[i]));
231
- return ar;
232
- }
233
- /** @deprecated */
234
- function __spreadArrays() {
235
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
236
- s += arguments[i].length;
237
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
238
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
239
- r[k] = a[j];
240
- return r;
241
- }
242
- function __spreadArray(to, from) {
243
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
244
- to[j] = from[i];
245
- return to;
246
- }
247
- function __await(v) {
248
- return this instanceof __await ? (this.v = v, this) : new __await(v);
249
- }
250
- function __asyncGenerator(thisArg, _arguments, generator) {
251
- if (!Symbol.asyncIterator)
252
- throw new TypeError("Symbol.asyncIterator is not defined.");
253
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
254
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
255
- function verb(n) { if (g[n])
256
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
257
- function resume(n, v) { try {
258
- step(g[n](v));
259
- }
260
- catch (e) {
261
- settle(q[0][3], e);
262
- } }
263
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
264
- function fulfill(value) { resume("next", value); }
265
- function reject(value) { resume("throw", value); }
266
- function settle(f, v) { if (f(v), q.shift(), q.length)
267
- resume(q[0][0], q[0][1]); }
268
- }
269
- function __asyncDelegator(o) {
270
- var i, p;
271
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
272
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
273
- }
274
- function __asyncValues(o) {
275
- if (!Symbol.asyncIterator)
276
- throw new TypeError("Symbol.asyncIterator is not defined.");
277
- var m = o[Symbol.asyncIterator], i;
278
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
279
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
280
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
281
- }
282
- function __makeTemplateObject(cooked, raw) {
283
- if (Object.defineProperty) {
284
- Object.defineProperty(cooked, "raw", { value: raw });
285
- }
286
- else {
287
- cooked.raw = raw;
288
- }
289
- return cooked;
290
- }
291
- ;
292
- var __setModuleDefault = Object.create ? (function (o, v) {
293
- Object.defineProperty(o, "default", { enumerable: true, value: v });
294
- }) : function (o, v) {
295
- o["default"] = v;
296
- };
297
- function __importStar(mod) {
298
- if (mod && mod.__esModule)
299
- return mod;
300
- var result = {};
301
- if (mod != null)
302
- for (var k in mod)
303
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
304
- __createBinding(result, mod, k);
305
- __setModuleDefault(result, mod);
306
- return result;
307
- }
308
- function __importDefault(mod) {
309
- return (mod && mod.__esModule) ? mod : { default: mod };
310
- }
311
- function __classPrivateFieldGet(receiver, privateMap) {
312
- if (!privateMap.has(receiver)) {
313
- throw new TypeError("attempted to get private field on non-instance");
314
- }
315
- return privateMap.get(receiver);
316
- }
317
- function __classPrivateFieldSet(receiver, privateMap, value) {
318
- if (!privateMap.has(receiver)) {
319
- throw new TypeError("attempted to set private field on non-instance");
320
- }
321
- privateMap.set(receiver, value);
322
- return value;
323
- }
324
-
325
- var BaseElement = /** @class */ (function () {
326
- function BaseElement(ref) {
327
- this.onCreate = new core.EventEmitter();
328
- this.onReady = new core.EventEmitter();
329
- this.onAttach = new core.EventEmitter();
330
- this.onDetach = new core.EventEmitter();
331
- var that = this;
332
- this.nativeElement = ref.nativeElement;
333
- that.nativeElement.onAttached = function () {
334
- that.onAttach.emit(that.nativeElement);
335
- };
336
- that.nativeElement.onDetached = function () {
337
- that.onDetach.emit(that.nativeElement);
338
- };
339
- }
340
- BaseElement.prototype.addEventListener = function (type, listener, options) {
341
- if (options === void 0) { options = false; }
342
- this.nativeElement.addEventListener(type, listener, options);
343
- };
344
- BaseElement.prototype.removeEventListener = function (type, listener, options) {
345
- if (options === void 0) { options = false; }
346
- this.nativeElement.removeEventListener(type, listener, options);
347
- };
348
- BaseElement.prototype.dispatchEvent = function (event) {
349
- return this.nativeElement.dispatchEvent(event);
350
- };
351
- BaseElement.prototype.blur = function () {
352
- this.nativeElement.blur();
353
- };
354
- BaseElement.prototype.click = function () {
355
- this.nativeElement.click();
356
- };
357
- BaseElement.prototype.focus = function (options) {
358
- this.nativeElement.focus(options);
359
- };
360
- Object.defineProperty(BaseElement.prototype, "locale", {
361
- /** @description Sets or gets the language. Used in conjunction with the property messages. */
362
- get: function () {
363
- return this.nativeElement ? this.nativeElement.locale : undefined;
364
- },
365
- set: function (value) {
366
- this.nativeElement ? this.nativeElement.locale = value : undefined;
367
- },
368
- enumerable: false,
369
- configurable: true
370
- });
371
- Object.defineProperty(BaseElement.prototype, "localizeFormatFunction", {
372
- /** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
373
- get: function () {
374
- return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
375
- },
376
- set: function (value) {
377
- this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
378
- },
379
- enumerable: false,
380
- configurable: true
381
- });
382
- Object.defineProperty(BaseElement.prototype, "messages", {
383
- /** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
384
- get: function () {
385
- return this.nativeElement ? this.nativeElement.messages : undefined;
386
- },
387
- set: function (value) {
388
- this.nativeElement ? this.nativeElement.messages = value : undefined;
389
- },
390
- enumerable: false,
391
- configurable: true
392
- });
393
- Object.defineProperty(BaseElement.prototype, "rightToLeft", {
394
- /** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
395
- get: function () {
396
- return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
397
- },
398
- set: function (value) {
399
- this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
400
- },
401
- enumerable: false,
402
- configurable: true
403
- });
404
- Object.defineProperty(BaseElement.prototype, "theme", {
405
- /** @description Determines the theme. Theme defines the look of the element */
406
- get: function () {
407
- return this.nativeElement ? this.nativeElement.theme : undefined;
408
- },
409
- set: function (value) {
410
- this.nativeElement ? this.nativeElement.theme = value : undefined;
411
- },
412
- enumerable: false,
413
- configurable: true
414
- });
415
- return BaseElement;
416
- }());
417
- BaseElement.propDecorators = {
418
- onCreate: [{ type: core.Output }],
419
- onReady: [{ type: core.Output }],
420
- onAttach: [{ type: core.Output }],
421
- onDetach: [{ type: core.Output }],
422
- locale: [{ type: core.Input }],
423
- localizeFormatFunction: [{ type: core.Input }],
424
- messages: [{ type: core.Input }],
425
- rightToLeft: [{ type: core.Input }],
426
- theme: [{ type: core.Input }]
427
- };
428
- var Smart = window.Smart;
429
-
430
- var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
431
- provide: forms.NG_VALUE_ACCESSOR,
432
- useExisting: core.forwardRef(function () { return PhoneInputComponent; }),
433
- multi: true
434
- };
435
- var PhoneInputComponent = /** @class */ (function (_super) {
436
- __extends(PhoneInputComponent, _super);
437
- function PhoneInputComponent(ref) {
438
- var _this = _super.call(this, ref) || this;
439
- _this.eventHandlers = [];
440
- /**
441
- * @description
442
- * The registered callback function called when a change event occurs on the form elements.
443
- */
444
- _this._onChange = function () { };
445
- /**
446
- * @description
447
- * The registered callback function called when a blur event occurs on the form elements.
448
- */
449
- _this._onTouched = function () { };
450
- /** @description This event is triggered when the selection is changed.
451
- * @param event. The custom event. Custom event was created with: event.detail( label, oldLabel, oldValue, value)
452
- * label - The label of the new selected item.
453
- * oldLabel - The label of the item that was previously selected before the event was triggered.
454
- * oldValue - The value of the item that was previously selected before the event was triggered.
455
- * value - The value of the new selected item.
456
- */
457
- _this.onChange = new core.EventEmitter();
458
- /** @description This event is triggered on each key up event of the Input, if the value is changed.
459
- * @param event. The custom event. Custom event was created with: event.detail( oldValue, value)
460
- * oldValue - The previous value before it was changed.
461
- * value - The new value.
462
- */
463
- _this.onChanging = new core.EventEmitter();
464
- /** @description This event is triggered when the user clicks on an item from the popup list.
465
- * @param event. The custom event. Custom event was created with: event.detail( item, label, value)
466
- * item - The item that was clicked.
467
- * label - The label of the item that was clicked.
468
- * value - The value of the item that was clicked.
469
- */
470
- _this.onItemClick = new core.EventEmitter();
471
- _this._initialChange = true;
472
- _this.nativeElement = ref.nativeElement;
473
- return _this;
474
- }
475
- /** @description Creates the component on demand.
476
- * @param properties An optional object of properties, which will be added to the template binded ones.
477
- */
478
- PhoneInputComponent.prototype.createComponent = function (properties) {
479
- if (properties === void 0) { properties = {}; }
480
- this.nativeElement = document.createElement('smart-phone-input');
481
- for (var propertyName in properties) {
482
- this.nativeElement[propertyName] = properties[propertyName];
483
- }
484
- return this.nativeElement;
485
- };
486
- Object.defineProperty(PhoneInputComponent.prototype, "disabled", {
487
- /** @description Enables or disables the element. */
488
- get: function () {
489
- return this.nativeElement ? this.nativeElement.disabled : undefined;
490
- },
491
- set: function (value) {
492
- this.nativeElement ? this.nativeElement.disabled = value : undefined;
493
- },
494
- enumerable: false,
495
- configurable: true
496
- });
497
- Object.defineProperty(PhoneInputComponent.prototype, "dropDownClassList", {
498
- /** @description Sets additional class names to the Input drop down. */
499
- get: function () {
500
- return this.nativeElement ? this.nativeElement.dropDownClassList : undefined;
501
- },
502
- set: function (value) {
503
- this.nativeElement ? this.nativeElement.dropDownClassList = value : undefined;
504
- },
505
- enumerable: false,
506
- configurable: true
507
- });
508
- Object.defineProperty(PhoneInputComponent.prototype, "dropDownButtonPosition", {
509
- /** @description Determines the position of the drop down button. */
510
- get: function () {
511
- return this.nativeElement ? this.nativeElement.dropDownButtonPosition : undefined;
512
- },
513
- set: function (value) {
514
- this.nativeElement ? this.nativeElement.dropDownButtonPosition = value : undefined;
515
- },
516
- enumerable: false,
517
- configurable: true
518
- });
519
- Object.defineProperty(PhoneInputComponent.prototype, "dropDownHeight", {
520
- /** @description Sets the height of the drop down. By default it's set to an empty string. In this case the height of the drop down is controlled by a CSS variable. */
521
- get: function () {
522
- return this.nativeElement ? this.nativeElement.dropDownHeight : undefined;
523
- },
524
- set: function (value) {
525
- this.nativeElement ? this.nativeElement.dropDownHeight = value : undefined;
526
- },
527
- enumerable: false,
528
- configurable: true
529
- });
530
- Object.defineProperty(PhoneInputComponent.prototype, "dropDownWidth", {
531
- /** @description Sets the width of the drop down. By default it's set to an empty string. In this case the width of the drop down is controlled by a CSS variable. */
532
- get: function () {
533
- return this.nativeElement ? this.nativeElement.dropDownWidth : undefined;
534
- },
535
- set: function (value) {
536
- this.nativeElement ? this.nativeElement.dropDownWidth = value : undefined;
537
- },
538
- enumerable: false,
539
- configurable: true
540
- });
541
- Object.defineProperty(PhoneInputComponent.prototype, "messages", {
542
- /** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
543
- get: function () {
544
- return this.nativeElement ? this.nativeElement.messages : undefined;
545
- },
546
- set: function (value) {
547
- this.nativeElement ? this.nativeElement.messages = value : undefined;
548
- },
549
- enumerable: false,
550
- configurable: true
551
- });
552
- Object.defineProperty(PhoneInputComponent.prototype, "name", {
553
- /** @description Sets or gets the name attribute for the element. Name is used when submiting data inside an HTML form. */
554
- get: function () {
555
- return this.nativeElement ? this.nativeElement.name : undefined;
556
- },
557
- set: function (value) {
558
- this.nativeElement ? this.nativeElement.name = value : undefined;
559
- },
560
- enumerable: false,
561
- configurable: true
562
- });
563
- Object.defineProperty(PhoneInputComponent.prototype, "nationalMode", {
564
- /** @description Determines whether the input will be in international or national mode i.e whether the input will start with '+'. */
565
- get: function () {
566
- return this.nativeElement ? this.nativeElement.nationalMode : undefined;
567
- },
568
- set: function (value) {
569
- this.nativeElement ? this.nativeElement.nationalMode = value : undefined;
570
- },
571
- enumerable: false,
572
- configurable: true
573
- });
574
- Object.defineProperty(PhoneInputComponent.prototype, "opened", {
575
- /** @description Determines whether the drop down is opened or not. */
576
- get: function () {
577
- return this.nativeElement ? this.nativeElement.opened : undefined;
578
- },
579
- set: function (value) {
580
- this.nativeElement ? this.nativeElement.opened = value : undefined;
581
- },
582
- enumerable: false,
583
- configurable: true
584
- });
585
- Object.defineProperty(PhoneInputComponent.prototype, "onlyCountries", {
586
- /** @description Sets or gets an array of country codes which will be used instead of the default one with all countries. The country code should be ISO 3166-1 alpha-2 codes(https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). */
587
- get: function () {
588
- return this.nativeElement ? this.nativeElement.onlyCountries : undefined;
589
- },
590
- set: function (value) {
591
- this.nativeElement ? this.nativeElement.onlyCountries = value : undefined;
592
- },
593
- enumerable: false,
594
- configurable: true
595
- });
596
- Object.defineProperty(PhoneInputComponent.prototype, "placeholder", {
597
- /** @description Determines the placeholder of the input. */
598
- get: function () {
599
- return this.nativeElement ? this.nativeElement.placeholder : undefined;
600
- },
601
- set: function (value) {
602
- this.nativeElement ? this.nativeElement.placeholder = value : undefined;
603
- },
604
- enumerable: false,
605
- configurable: true
606
- });
607
- Object.defineProperty(PhoneInputComponent.prototype, "selectedCountry", {
608
- /** @description Sets or gets the selected country of the element. The country code should be ISO 3166-1 alpha-2 codes(https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). */
609
- get: function () {
610
- return this.nativeElement ? this.nativeElement.selectedCountry : undefined;
611
- },
612
- set: function (value) {
613
- this.nativeElement ? this.nativeElement.selectedCountry = value : undefined;
614
- },
615
- enumerable: false,
616
- configurable: true
617
- });
618
- Object.defineProperty(PhoneInputComponent.prototype, "rightToLeft", {
619
- /** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
620
- get: function () {
621
- return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
622
- },
623
- set: function (value) {
624
- this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
625
- },
626
- enumerable: false,
627
- configurable: true
628
- });
629
- Object.defineProperty(PhoneInputComponent.prototype, "theme", {
630
- /** @description Determines the theme for the element. Themes define the look of the elements. */
631
- get: function () {
632
- return this.nativeElement ? this.nativeElement.theme : undefined;
633
- },
634
- set: function (value) {
635
- this.nativeElement ? this.nativeElement.theme = value : undefined;
636
- },
637
- enumerable: false,
638
- configurable: true
639
- });
640
- Object.defineProperty(PhoneInputComponent.prototype, "unfocusable", {
641
- /** @description If is set to true, the element cannot be focused. */
642
- get: function () {
643
- return this.nativeElement ? this.nativeElement.unfocusable : undefined;
644
- },
645
- set: function (value) {
646
- this.nativeElement ? this.nativeElement.unfocusable = value : undefined;
647
- },
648
- enumerable: false,
649
- configurable: true
650
- });
651
- Object.defineProperty(PhoneInputComponent.prototype, "value", {
652
- /** @description Sets or gets the value of the element. */
653
- get: function () {
654
- return this.nativeElement ? this.nativeElement.value : undefined;
655
- },
656
- set: function (value) {
657
- this.nativeElement ? this.nativeElement.value = value : undefined;
658
- },
659
- enumerable: false,
660
- configurable: true
661
- });
662
- /** @description Closes the drop down.
663
- */
664
- PhoneInputComponent.prototype.close = function () {
665
- var _this = this;
666
- if (this.nativeElement.isRendered) {
667
- this.nativeElement.close();
668
- }
669
- else {
670
- this.nativeElement.whenRendered(function () {
671
- _this.nativeElement.close();
672
- });
673
- }
674
- };
675
- /** @description Ensures that the active ( selected ) item is always visible.
676
- */
677
- PhoneInputComponent.prototype.ensureVisible = function () {
678
- var _this = this;
679
- if (this.nativeElement.isRendered) {
680
- this.nativeElement.ensureVisible();
681
- }
682
- else {
683
- this.nativeElement.whenRendered(function () {
684
- _this.nativeElement.ensureVisible();
685
- });
686
- }
687
- };
688
- /** @description Returns the entered phone number with formatting.
689
- * @param {boolean} isInternational?. When you use 'false', the national phone number will be returned and the international phone number, when you use 'true' as parameter.
690
- * @returns {string}
691
- */
692
- PhoneInputComponent.prototype.getNumber = function (isInternational) {
693
- return __awaiter(this, void 0, void 0, function () {
694
- var getResultOnRender, result;
695
- var _this = this;
696
- return __generator(this, function (_a) {
697
- switch (_a.label) {
698
- case 0:
699
- getResultOnRender = function () {
700
- return new Promise(function (resolve) {
701
- _this.nativeElement.whenRendered(function () {
702
- var result = _this.nativeElement.getNumber(isInternational);
703
- resolve(result);
704
- });
705
- });
706
- };
707
- return [4 /*yield*/, getResultOnRender()];
708
- case 1:
709
- result = _a.sent();
710
- return [2 /*return*/, result];
711
- }
712
- });
713
- });
714
- };
715
- /** @description Returns an item by its country dial code. The item is an object with 'label', 'value', 'iso2' and 'dialCode' properties.
716
- * @param {string} dialCode?. Returns the national or international phone number
717
- * @returns {any}
718
- */
719
- PhoneInputComponent.prototype.getItemByDialCode = function (dialCode) {
720
- return __awaiter(this, void 0, void 0, function () {
721
- var getResultOnRender, result;
722
- var _this = this;
723
- return __generator(this, function (_a) {
724
- switch (_a.label) {
725
- case 0:
726
- getResultOnRender = function () {
727
- return new Promise(function (resolve) {
728
- _this.nativeElement.whenRendered(function () {
729
- var result = _this.nativeElement.getItemByDialCode(dialCode);
730
- resolve(result);
731
- });
732
- });
733
- };
734
- return [4 /*yield*/, getResultOnRender()];
735
- case 1:
736
- result = _a.sent();
737
- return [2 /*return*/, result];
738
- }
739
- });
740
- });
741
- };
742
- /** @description Returns the selected item. The item is an object with 'label', 'value', 'iso2' and 'dialCode' properties.
743
- * @returns {any}
744
- */
745
- PhoneInputComponent.prototype.getSelectedItem = function () {
746
- return __awaiter(this, void 0, void 0, function () {
747
- var getResultOnRender, result;
748
- var _this = this;
749
- return __generator(this, function (_a) {
750
- switch (_a.label) {
751
- case 0:
752
- getResultOnRender = function () {
753
- return new Promise(function (resolve) {
754
- _this.nativeElement.whenRendered(function () {
755
- var result = _this.nativeElement.getSelectedItem();
756
- resolve(result);
757
- });
758
- });
759
- };
760
- return [4 /*yield*/, getResultOnRender()];
761
- case 1:
762
- result = _a.sent();
763
- return [2 /*return*/, result];
764
- }
765
- });
766
- });
767
- };
768
- /** @description Returns true or false depending on whether the entered phone number is valid.
769
- * @returns {boolean}
770
- */
771
- PhoneInputComponent.prototype.isValidNumber = function () {
772
- return __awaiter(this, void 0, void 0, function () {
773
- var getResultOnRender, result;
774
- var _this = this;
775
- return __generator(this, function (_a) {
776
- switch (_a.label) {
777
- case 0:
778
- getResultOnRender = function () {
779
- return new Promise(function (resolve) {
780
- _this.nativeElement.whenRendered(function () {
781
- var result = _this.nativeElement.isValidNumber();
782
- resolve(result);
783
- });
784
- });
785
- };
786
- return [4 /*yield*/, getResultOnRender()];
787
- case 1:
788
- result = _a.sent();
789
- return [2 /*return*/, result];
790
- }
791
- });
792
- });
793
- };
794
- /** @description Validates the entered phone number.
795
- */
796
- PhoneInputComponent.prototype.validate = function () {
797
- var _this = this;
798
- if (this.nativeElement.isRendered) {
799
- this.nativeElement.validate();
800
- }
801
- else {
802
- this.nativeElement.whenRendered(function () {
803
- _this.nativeElement.validate();
804
- });
805
- }
806
- };
807
- /** @description Opens the drop down.
808
- */
809
- PhoneInputComponent.prototype.open = function () {
810
- var _this = this;
811
- if (this.nativeElement.isRendered) {
812
- this.nativeElement.open();
813
- }
814
- else {
815
- this.nativeElement.whenRendered(function () {
816
- _this.nativeElement.open();
817
- });
818
- }
819
- };
820
- /** @description Selects the text inside the input or if it is readonly then the element is focused.
821
- */
822
- PhoneInputComponent.prototype.select = function () {
823
- var _this = this;
824
- if (this.nativeElement.isRendered) {
825
- this.nativeElement.select();
826
- }
827
- else {
828
- this.nativeElement.whenRendered(function () {
829
- _this.nativeElement.select();
830
- });
831
- }
832
- };
833
- Object.defineProperty(PhoneInputComponent.prototype, "isRendered", {
834
- get: function () {
835
- return this.nativeElement ? this.nativeElement.isRendered : false;
836
- },
837
- enumerable: false,
838
- configurable: true
839
- });
840
- PhoneInputComponent.prototype.ngOnInit = function () {
841
- };
842
- PhoneInputComponent.prototype.ngAfterViewInit = function () {
843
- var that = this;
844
- that.onCreate.emit(that.nativeElement);
845
- Smart.Render();
846
- this.nativeElement.classList.add('smart-angular');
847
- this.nativeElement.whenRendered(function () { that.onReady.emit(that.nativeElement); });
848
- this.listen();
849
- };
850
- PhoneInputComponent.prototype.ngOnDestroy = function () {
851
- this.unlisten();
852
- };
853
- Object.defineProperty(PhoneInputComponent.prototype, "ngValue", {
854
- get: function () {
855
- if (!this.nativeElement) {
856
- return null;
857
- }
858
- var value = this.nativeElement.value;
859
- return value;
860
- },
861
- set: function (value) {
862
- if (this.nativeElement) {
863
- this.writeValue(value);
864
- }
865
- },
866
- enumerable: false,
867
- configurable: true
868
- });
869
- PhoneInputComponent.prototype.writeValue = function (value) {
870
- var that = this;
871
- var normalizedValue = value == null ? '' : value;
872
- that.nativeElement.whenRendered(function () {
873
- that.value = normalizedValue;
874
- if (that._initialChange === false) {
875
- that._onChange(that.value);
876
- }
877
- });
878
- };
879
- PhoneInputComponent.prototype.registerOnChange = function (fn) {
880
- this._onChange = fn;
881
- };
882
- PhoneInputComponent.prototype.registerOnTouched = function (fn) {
883
- this._onTouched = fn;
884
- };
885
- PhoneInputComponent.prototype.ngOnChanges = function (changes) {
886
- if (this.nativeElement && this.nativeElement.isRendered) {
887
- for (var propName in changes) {
888
- if (changes.hasOwnProperty(propName)) {
889
- this.nativeElement[propName] = changes[propName].currentValue;
890
- }
891
- }
892
- }
893
- };
894
- /** @description Add event listeners. */
895
- PhoneInputComponent.prototype.listen = function () {
896
- var that = this;
897
- that.eventHandlers['changeHandler'] = function (event) { that.onChange.emit(event); };
898
- that.nativeElement.addEventListener('change', that.eventHandlers['changeHandler']);
899
- that.eventHandlers['changingHandler'] = function (event) { that.onChanging.emit(event); };
900
- that.nativeElement.addEventListener('changing', that.eventHandlers['changingHandler']);
901
- that.eventHandlers['itemClickHandler'] = function (event) { that.onItemClick.emit(event); };
902
- that.nativeElement.addEventListener('itemClick', that.eventHandlers['itemClickHandler']);
903
- that.eventHandlers['changeModelHandler'] = function (event) {
904
- that._initialChange = false;
905
- that._onChange(that.nativeElement.value);
906
- };
907
- that.eventHandlers['blurModelHandler'] = function (event) {
908
- that._onTouched();
909
- };
910
- that.nativeElement.whenRendered(function () {
911
- if (that.nativeElement.querySelector('input')) {
912
- that.eventHandlers['keyupModelHandler'] = function (event) {
913
- setTimeout(function () { that.eventHandlers['changeModelHandler'](event); }, 50);
914
- };
915
- that.nativeElement.querySelector('input').addEventListener('keyup', that.eventHandlers['keyupModelHandler']);
916
- }
917
- });
918
- that.nativeElement.addEventListener('change', that.eventHandlers['changeModelHandler']);
919
- that.nativeElement.addEventListener('blur', that.eventHandlers['blurModelHandler']);
920
- };
921
- /** @description Remove event listeners. */
922
- PhoneInputComponent.prototype.unlisten = function () {
923
- var that = this;
924
- if (that.eventHandlers['changeHandler']) {
925
- that.nativeElement.removeEventListener('change', that.eventHandlers['changeHandler']);
926
- }
927
- if (that.eventHandlers['changingHandler']) {
928
- that.nativeElement.removeEventListener('changing', that.eventHandlers['changingHandler']);
929
- }
930
- if (that.eventHandlers['itemClickHandler']) {
931
- that.nativeElement.removeEventListener('itemClick', that.eventHandlers['itemClickHandler']);
932
- }
933
- if (that.eventHandlers['changeModelHandler']) {
934
- that.nativeElement.removeEventListener('change', that.eventHandlers['changeModelHandler']);
935
- if (that.nativeElement.querySelector('input')) {
936
- that.nativeElement.querySelector('input').removeEventListener('keyup', that.eventHandlers['keyupModelHandler']);
937
- }
938
- }
939
- if (that.eventHandlers['blurModelHandler']) {
940
- that.nativeElement.removeEventListener('blur', that.eventHandlers['blurModelHandler']);
941
- }
942
- };
943
- return PhoneInputComponent;
944
- }(BaseElement));
945
- PhoneInputComponent.decorators = [
946
- { type: core.Directive, args: [{
947
- selector: 'smart-phone-input, [smart-phone-input]',
948
- providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR]
949
- },] }
950
- ];
951
- PhoneInputComponent.ctorParameters = function () { return [
952
- { type: core.ElementRef }
953
- ]; };
954
- PhoneInputComponent.propDecorators = {
955
- disabled: [{ type: core.Input }],
956
- dropDownClassList: [{ type: core.Input }],
957
- dropDownButtonPosition: [{ type: core.Input }],
958
- dropDownHeight: [{ type: core.Input }],
959
- dropDownWidth: [{ type: core.Input }],
960
- messages: [{ type: core.Input }],
961
- name: [{ type: core.Input }],
962
- nationalMode: [{ type: core.Input }],
963
- opened: [{ type: core.Input }],
964
- onlyCountries: [{ type: core.Input }],
965
- placeholder: [{ type: core.Input }],
966
- selectedCountry: [{ type: core.Input }],
967
- rightToLeft: [{ type: core.Input }],
968
- theme: [{ type: core.Input }],
969
- unfocusable: [{ type: core.Input }],
970
- value: [{ type: core.Input }],
971
- onChange: [{ type: core.Output }],
972
- onChanging: [{ type: core.Output }],
973
- onItemClick: [{ type: core.Output }]
974
- };
975
-
976
- var PhoneInputModule = /** @class */ (function () {
977
- function PhoneInputModule() {
978
- }
979
- return PhoneInputModule;
980
- }());
981
- PhoneInputModule.decorators = [
982
- { type: core.NgModule, args: [{
983
- declarations: [PhoneInputComponent],
984
- schemas: [core.CUSTOM_ELEMENTS_SCHEMA],
985
- exports: [PhoneInputComponent]
986
- },] }
987
- ];
988
-
989
- /**
990
- * Generated bundle index. Do not edit.
991
- */
992
-
993
- exports.PhoneInputComponent = PhoneInputComponent;
994
- exports.PhoneInputModule = PhoneInputModule;
995
- exports.Smart = Smart;
996
- exports.ɵa = BaseElement;
997
-
998
- Object.defineProperty(exports, '__esModule', { value: true });
999
-
1000
- })));
1001
- //# sourceMappingURL=smart-webcomponents-angular-phoneinput.umd.js.map