asksuite-citrus 3.11.3-beta1 → 3.11.3-beta3
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.
- package/esm2022/lib/components/phone-ddi/phone-ddi.component.mjs +8 -10
- package/esm2022/shared/services/country-flag.service.mjs +13 -8
- package/esm2022/shared/services/location-api.service.mjs +20 -0
- package/fesm2022/asksuite-citrus.mjs +35 -17
- package/fesm2022/asksuite-citrus.mjs.map +1 -1
- package/lib/components/phone-ddi/phone-ddi.component.d.ts +3 -3
- package/package.json +1 -1
- package/shared/services/country-flag.service.d.ts +5 -2
- package/shared/services/location-api.service.d.ts +20 -0
@@ -10,7 +10,7 @@ export declare class PhoneDdiComponent extends OverlayComponent implements OnIni
|
|
10
10
|
private countryFlagService;
|
11
11
|
disabled: boolean;
|
12
12
|
value: string;
|
13
|
-
|
13
|
+
useLocationApi: boolean;
|
14
14
|
valueChange: EventEmitter<string>;
|
15
15
|
onChangeFlag: EventEmitter<CountryData>;
|
16
16
|
phoneContainer: ElementRef | undefined;
|
@@ -45,9 +45,9 @@ export declare class PhoneDdiComponent extends OverlayComponent implements OnIni
|
|
45
45
|
protected readonly filterFn: (search: string) => CountryData[];
|
46
46
|
private addAvailableFlags;
|
47
47
|
private initSelectedFlag;
|
48
|
-
private
|
48
|
+
private getDefultCountryFlag;
|
49
49
|
private handleInputChange;
|
50
50
|
handlePhoneChange(event: any): void;
|
51
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<PhoneDdiComponent, never>;
|
52
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PhoneDdiComponent, "ask-phone-ddi", never, { "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; "
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PhoneDdiComponent, "ask-phone-ddi", never, { "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; "useLocationApi": { "alias": "useLocationApi"; "required": false; }; }, { "valueChange": "valueChange"; "onChangeFlag": "onChangeFlag"; }, never, never, false, never>;
|
53
53
|
}
|
package/package.json
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
import { CountryData } from "../providers/flag.provider";
|
2
2
|
import { HttpClient } from "@angular/common/http";
|
3
3
|
import { TranslateService } from "@ngx-translate/core";
|
4
|
+
import { LocationApiService } from "./location-api.service";
|
4
5
|
import * as i0 from "@angular/core";
|
5
6
|
export default class CountryFlagService {
|
6
7
|
private readonly flagUrl;
|
7
8
|
private readonly http;
|
8
9
|
private readonly translateService;
|
10
|
+
private readonly locationApiService;
|
9
11
|
private defaultCountryCode;
|
10
12
|
private defaultCountryLanguage;
|
11
13
|
private cacheList;
|
12
|
-
|
14
|
+
private countryCodeByLocation;
|
15
|
+
constructor(flagUrl: string, http: HttpClient, translateService: TranslateService, locationApiService: LocationApiService);
|
13
16
|
list: () => import("rxjs").Observable<CountryData[]>;
|
14
|
-
getDefaultCountryFlag(searchData: CountryData[]): CountryData;
|
17
|
+
getDefaultCountryFlag(searchData: CountryData[], useLocationApi?: boolean): CountryData;
|
15
18
|
getCountryDataForFlag(searchData: CountryData[], countryCode: string): CountryData;
|
16
19
|
private getDefaultCountryLanguage;
|
17
20
|
private extractCountryCode;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { HttpClient } from "@angular/common/http";
|
2
|
+
import { Observable } from "rxjs";
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
type LocationData = {
|
5
|
+
city: string;
|
6
|
+
country: string;
|
7
|
+
country_code: string;
|
8
|
+
ip: string;
|
9
|
+
location: string;
|
10
|
+
state: string;
|
11
|
+
};
|
12
|
+
export declare class LocationApiService {
|
13
|
+
private http;
|
14
|
+
private apiUrl;
|
15
|
+
constructor(http: HttpClient);
|
16
|
+
getLocation(): Observable<LocationData | null>;
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocationApiService, never>;
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LocationApiService>;
|
19
|
+
}
|
20
|
+
export {};
|