Skip to content

Commit

Permalink
Merge b761cab into 1ed8952
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalourdio committed May 29, 2019
2 parents 1ed8952 + b761cab commit 4a85ff1
Show file tree
Hide file tree
Showing 10 changed files with 1,374 additions and 1,610 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.0.7

- `angular 8` migration.

## v0.0.6

- Bump `intl-tel-input` dependency to `^15.0.0`.
Expand Down
9 changes: 5 additions & 4 deletions browserslist
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11
not IE 9-11 # For IE 9-11 support, remove 'not'.
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,53 +25,53 @@
"ng5",
"ng6",
"ng7",
"ng8",
"intl-tel-input"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/mpalourdio/intl-tel-input-ng/issues"
},
"peerDependencies": {
"@angular/common": "^7.0.0",
"@angular/core": "^7.0.0",
"@angular/forms": "^7.0.0",
"@angular/common": "^8.0.0",
"@angular/core": "^8.0.0",
"@angular/forms": "^8.0.0",
"intl-tel-input": "^15.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.0",
"@angular-devkit/build-ng-packagr": "~0.13.0",
"@angular/cli": "~7.3.0",
"@angular/common": "^7.0.0",
"@angular/compiler": "^7.0.0",
"@angular/compiler-cli": "^7.0.0",
"@angular/core": "^7.0.0",
"@angular/forms": "^7.0.0",
"@angular/language-service": "^7.0.0",
"@angular/platform-browser": "^7.0.0",
"@angular/platform-browser-dynamic": "^7.0.0",
"@types/jasmine": "~2.8.8",
"@angular-devkit/build-angular": "~0.800.0",
"@angular-devkit/build-ng-packagr": "~0.800.0",
"@angular/cli": "~8.0.0",
"@angular/common": "^8.0.0",
"@angular/compiler": "^8.0.0",
"@angular/compiler-cli": "^8.0.0",
"@angular/core": "^8.0.0",
"@angular/forms": "^8.0.0",
"@angular/language-service": "^8.0.0",
"@angular/platform-browser": "^8.0.0",
"@angular/platform-browser-dynamic": "^8.0.0",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"core-js": "^2.5.4",
"codelyzer": "^5.0.0",
"coveralls": "^3.0.1",
"intl-tel-input": "^15.0.0",
"jasmine-core": "~2.99.1",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.0.0",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^4.2.0",
"rxjs": "~6.4.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"ng-packagr": "^5.1.0",
"rxjs": "^6.4.0",
"ts-node": "~7.0.0",
"tsickle": ">=0.34.0",
"tsickle": "^0.35.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2",
"zone.js": "~0.8.26"
"tslint": "~5.15.0",
"typescript": "~3.4.3",
"zone.js": "~0.9.1"
},
"engines": {
"node": ">= 8.9.0",
Expand Down
5 changes: 1 addition & 4 deletions polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';

/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
Expand All @@ -46,7 +43,7 @@
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/intl-tel-input.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('IntlTelInputComponent', () => {
.parentNode
.querySelector('.preferred');

expect(element.getAttribute('data-country-code')).toBe(component.options['onlyCountries'][0]);
expect(element.getAttribute('data-country-code')).toBe(component.options.onlyCountries[0]);
});

it('should be possible to set localizedCountries option', () => {
Expand Down
10 changes: 3 additions & 7 deletions src/lib/components/intl-tel-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// <reference path="../@types/intl-tel-input/index.d.ts" />
import { AfterViewInit, Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';
import * as intlTelInput from 'intl-tel-input';
Expand All @@ -31,25 +30,22 @@ export class IntlTelInputComponent implements AfterViewInit {
@Input() public options: IntlTelInputOptions = {};
@Input() public required: boolean;
@Output() private E164PhoneNumberChange = new EventEmitter<string>();
@ViewChild('intlTelInput') private _inputElement: any;
@ViewChild('intlTelInput', { static: false }) private _inputElement: ElementRef;
private _phoneNumber: string;
private _intlTelInput: any;

private static modifyCountryData(): void {
(<any>window).intlTelInputGlobals.getCountryData().forEach((country: CountryData) =>
(window as any).intlTelInputGlobals.getCountryData().forEach((country: CountryData) =>
country.name = country.name.replace(/.+\((.+)\)/, '$1'));
}

public ngAfterViewInit(): void {
const phoneElement = (<ElementRef>this._inputElement).nativeElement;
const options = this.options;

if (this.onlyLocalized) {
IntlTelInputComponent.modifyCountryData();
}

const intlTelInputInstance = intlTelInput;
this._intlTelInput = intlTelInputInstance(phoneElement, options);
this._intlTelInput = intlTelInputInstance(this._inputElement.nativeElement, this.options);
}

get intlTelInput(): any {
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"intl-tel-input": [
"src/lib/@types/intl-tel-input"
]
},
"lib": [
"es2018",
"dom"
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
"compilerOptions": {
"outDir": "./out-tsc/lib",
"target": "es2015",
"module": "es2015",
"declaration": true,
"inlineSources": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"types": [],
"baseUrl": "./",
"lib": [
"dom",
"es2018"
Expand Down
138 changes: 48 additions & 90 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"extends": "tslint:recommended",
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
//to avoid warnings on private class fields
"variable-name": [
true,
"check-space"
"ban-keywords",
"check-format",
"allow-pascal-case",
"allow-leading-underscore"
],
"curly": true,
"no-namespace": false,
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
"directive-selector": [
true,
"rxjs/Rx"
"attribute",
null,
"camelCase"
],
"component-selector": [
true,
"element",
null,
"kebab-case"
],
"import-spacing": true,
"indent": [
"import-blacklist": [
true,
"spaces"
"rxjs/Rx"
],
"interface-over-type-literal": true,
"label-position": true,
"interface-name": false,
"max-classes-per-file": false,
"max-line-length": [
true,
140
Expand All @@ -43,8 +52,7 @@
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
Expand All @@ -53,91 +61,41 @@
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
"as-needed"
],
"prefer-const": true,
"object-literal-sort-keys": false,
"ordered-imports": false,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [
true,
"attribute",
null,
"camelCase"
],
"component-selector": [
true,
"element",
null,
"kebab-case"
],
"no-output-on-prefix": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"trailing-comma": false,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
}
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true
},
"rulesDirectory": [
"codelyzer"
]
}

0 comments on commit 4a85ff1

Please sign in to comment.