Skip to content

Commit

Permalink
feat: update intl-tel-input and google-libphonenumber dependencies (
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-CoreyArcher authored Jul 24, 2024
1 parent 1100230 commit 434d886
Show file tree
Hide file tree
Showing 6 changed files with 2,905 additions and 2,628 deletions.
2 changes: 1 addition & 1 deletion libs/components/lookup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@skyux/icon": "0.0.0-PLACEHOLDER",
"intl-tel-input": "19.5.5",
"intl-tel-input": "23.6.1",
"tslib": "^2.6.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { SkyInputBoxHostService } from '@skyux/forms';
import { SkyThemeService } from '@skyux/theme';

import 'intl-tel-input';
import intlTelInput from 'intl-tel-input';
import { Observable, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

Expand Down Expand Up @@ -459,13 +459,9 @@ export class SkyCountryFieldComponent
/**
* The json functions here ensures that we get a copy of the array and not the global original.
* This ensures that multiple instances of the component don't overwrite the original data.
*
* We must type the window object as any here as the intl-tel-input library adds its object
* to the main window object.
*/
this.countries = JSON.parse(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
JSON.stringify((window as any).intlTelInputGlobals.getCountryData()),
JSON.stringify(intlTelInput.getCountryData()),
).map((country: SkyCountryFieldCountry & { nodeById: unknown }) => {
// `intl-tel-input` version 19.2.6 added a `nodeById` property that is used internally to that library to this object.
// We need to remove it as it is not useful to our consumers and would muddle the object type.
Expand Down
4 changes: 2 additions & 2 deletions libs/components/phone-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"dependencies": {
"@skyux/icon": "0.0.0-PLACEHOLDER",
"google-libphonenumber": "3.2.34",
"intl-tel-input": "19.5.5",
"google-libphonenumber": "3.2.37",
"intl-tel-input": "23.6.1",
"tslib": "^2.6.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
PhoneNumberType,
PhoneNumberUtil,
} from 'google-libphonenumber';
import 'intl-tel-input';
import intlTelInput from 'intl-tel-input';
import { Subject, takeUntil } from 'rxjs';

import { SkyPhoneFieldAdapterService } from './phone-field-adapter.service';
Expand Down Expand Up @@ -304,14 +304,8 @@ export class SkyPhoneFieldComponent implements OnDestroy, OnInit {
/**
* The json functions here ensures that we get a copy of the array and not the global original.
* This ensures that multiple instances of the component don't overwrite the original data.
*
* We must type the window object as any here as the intl-tel-input library adds its object
* to the main window object.
*/
this.countries = JSON.parse(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
JSON.stringify((window as any).intlTelInputGlobals.getCountryData()),
);
this.countries = JSON.parse(JSON.stringify(intlTelInput.getCountryData()));

for (const country of this.countries) {
country.dialCode = '+' + country.dialCode;
Expand Down
Loading

0 comments on commit 434d886

Please sign in to comment.