UNPKG

@angular-material-extensions/google-maps-autocomplete

Version:

Autocomplete input component and directive for google-maps built with angular and material design

1 lines 70.3 kB
{"version":3,"file":"angular-material-extensions-google-maps-autocomplete.mjs","sources":["../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/helpers/parser.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/tokens/index.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/services/script-loader.service.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/directives/address-validator/mat-address-validator.directive.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/component/mat-google-maps-autocomplete.component.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/component/mat-google-maps-autocomplete.component.html","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/animations/index.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/directives/mat-google-maps-autocomplete.directive.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/component/mat-search-google-maps-autocomplete/mat-search-google-maps-autocomplete.component.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/component/mat-search-google-maps-autocomplete/mat-search-google-maps-autocomplete.component.html","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/lib/mat-google-maps-autocomplete.module.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/public-api.ts","../../../../projects/angular-material-extensions/google-maps-autocomplete/src/angular-material-extensions-google-maps-autocomplete.ts"],"sourcesContent":["import PlaceResult = google.maps.places.PlaceResult;\nimport {GermanAddress} from '../interfaces';\n\nexport function parseGermanAddress(placeResult: PlaceResult): GermanAddress {\n const germanAddress: GermanAddress = {\n gmID: placeResult.id,\n icon: placeResult.icon,\n url: placeResult.url,\n placeID: placeResult.place_id,\n displayAddress: placeResult.formatted_address,\n name: placeResult.name,\n vicinity: placeResult.vicinity,\n locality: {},\n state: {},\n country: {},\n geoLocation: {latitude: -1, longitude: -1},\n };\n\n if (placeResult.geometry && placeResult.geometry.location) {\n germanAddress.geoLocation.latitude = placeResult.geometry.location.lat();\n germanAddress.geoLocation.longitude = placeResult.geometry.location.lng();\n }\n\n if (placeResult.address_components && placeResult.address_components.length > 0) {\n placeResult.address_components.forEach(value => {\n if (value.types.indexOf('street_number') > -1) {\n germanAddress.streetNumber = value.short_name;\n }\n if (value.types.indexOf('route') > -1) {\n germanAddress.streetName = value.long_name;\n }\n if (value.types.indexOf('postal_code') > -1) {\n germanAddress.postalCode = value.short_name;\n }\n if (value.types.indexOf('sublocality') > -1) {\n germanAddress.sublocality = value.long_name;\n }\n if (value.types.indexOf('locality') > -1) {\n germanAddress.locality.long = value.long_name;\n germanAddress.locality.short = value.short_name;\n }\n if (value.types.indexOf('administrative_area_level_1') > -1) {\n germanAddress.state.long = value.long_name;\n germanAddress.state.short = value.short_name;\n }\n if (value.types.indexOf('country') > -1) {\n germanAddress.country.long = value.long_name;\n germanAddress.country.short = value.short_name;\n }\n if (value.types.indexOf('administrative_area_level_3') > -1) {\n germanAddress.locality.short = value.short_name;\n }\n });\n }\n return germanAddress;\n}\n","import {InjectionToken} from \"@angular/core\";\n\nexport const ApiKeyToken = new InjectionToken<string>('apiKey');\n","import {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ScriptLoaderService {\n private loadedScripts: { [src: string]: boolean } = {};\n private scriptPromises: { [src: string]: Promise<void> } = {}; // Neu\n\n loadScript(src: string): Promise<void> {\n // Wenn das Skript bereits erfolgreich geladen wurde, sofort auflösen\n if (this.loadedScripts[src]) {\n return Promise.resolve();\n }\n\n // Wenn ein Ladevorgang für dieses Skript bereits im Gange ist, das vorhandene Promise zurückgeben\n if (this.scriptPromises[src]) {\n return this.scriptPromises[src];\n }\n\n // Ein neues Promise für das Skript-Laden erstellen und speichern\n this.scriptPromises[src] = new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.src = src;\n script.async = true; // Empfohlen für externe Skripte\n script.onload = () => {\n this.loadedScripts[src] = true; // Markiere das Skript als geladen\n resolve();\n };\n script.onerror = (error: any) => {\n this.scriptPromises[src] = null; // Bei Fehler, entferne das Promise, damit erneute Versuche möglich sind\n reject(error);\n };\n document.body.appendChild(script);\n });\n\n return this.scriptPromises[src];\n }\n}\n","import {Directive, EventEmitter, forwardRef} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\nimport PlaceResult = google.maps.places.PlaceResult;\n\n// https://github.com/angular/angular/blob/master/packages/forms/src/directives/validators.ts\n\n@Directive({\n selector: '[mat-address-validate][formControlName],[MatValidateAddress][formControl],[MatValidateAddress][ngModel]',\n providers: [\n {provide: NG_VALIDATORS, useExisting: forwardRef(() => MatValidateAddressDirective), multi: true}\n ]\n})\nexport class MatValidateAddressDirective implements Validator {\n\n public subscription: any;\n\n private _address: PlaceResult;\n\n\n constructor() {\n }\n\n public validate(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | any => {\n return this.address ? null : {\n validateAddress: {\n valid: false\n }\n };\n }\n }\n\n public subscribe(eventEmitter: EventEmitter<any>) {\n this.subscription = eventEmitter.subscribe((address: PlaceResult) => {\n this.address = address;\n });\n }\n\n public unsubscribe() {\n this.subscription.unsubscribe();\n }\n\n get address() {\n return this._address;\n }\n\n set address(value) {\n this._address = value;\n }\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n ViewChild\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR, UntypedFormControl, Validators} from '@angular/forms';\nimport {MatValidateAddressDirective} from '../directives/address-validator/mat-address-validator.directive';\nimport {Location} from '../interfaces/location.interface';\nimport {GermanAddress} from '../interfaces';\nimport {ScriptLoaderService} from \"../services/script-loader.service\";\nimport {ApiKeyToken} from \"../tokens\";\nimport PlaceResult = google.maps.places.PlaceResult;\nimport AutocompleteOptions = google.maps.places.AutocompleteOptions;\n\nexport enum Appearance {\n STANDARD = 'standard',\n FILL = 'fill',\n OUTLINE = 'outline',\n LEGACY = 'legacy',\n}\n\n@Component({\n selector: 'mat-google-maps-autocomplete',\n exportAs: 'matGoogleMapsAutocomplete',\n templateUrl: './mat-google-maps-autocomplete.component.html',\n styleUrls: ['./mat-google-maps-autocomplete.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatGoogleMapsAutocompleteComponent),\n multi: true\n }\n ]\n})\nexport class MatGoogleMapsAutocompleteComponent implements OnInit, OnDestroy, ControlValueAccessor {\n\n autocomplete: google.maps.places.Autocomplete | undefined;\n\n @ViewChild('search')\n public searchElementRef: ElementRef;\n\n @Input()\n addressLabelText = 'Address';\n\n @Input()\n placeholderText = 'Please enter the address';\n\n @Input()\n requiredErrorText = 'The address is required';\n\n @Input()\n invalidErrorText = 'The address is not valid';\n\n @Input()\n appearance: string | Appearance = Appearance.STANDARD;\n\n @Input()\n value: PlaceResult;\n\n @Input()\n address: PlaceResult | string;\n\n @Input()\n country: string | string[];\n\n @Input()\n placeIdOnly?: boolean;\n\n @Input()\n strictBounds?: boolean;\n\n @Input()\n types?: string[];\n // types: string[] = ['address'];\n\n @Input()\n type?: string;\n\n @Input()\n autoCompleteOptions: AutocompleteOptions = {};\n\n @Output()\n onChange: EventEmitter<PlaceResult | string | null> = new EventEmitter<PlaceResult | string | null>();\n\n @Output()\n onAutocompleteSelected: EventEmitter<PlaceResult> = new EventEmitter<PlaceResult>();\n\n @Output()\n onGermanAddressMapped: EventEmitter<GermanAddress> = new EventEmitter<GermanAddress>();\n\n @Output()\n onLocationSelected: EventEmitter<Location> = new EventEmitter<Location>();\n\n\n private onNewPlaceResult: EventEmitter<any> = new EventEmitter();\n private addressValidator: MatValidateAddressDirective = new MatValidateAddressDirective();\n\n public addressSearchControl: UntypedFormControl = new UntypedFormControl({value: null}, Validators.compose([\n Validators.required,\n this.addressValidator.validate()])\n );\n\n propagateChange = (_: any) => {\n };\n\n constructor(private ngZone: NgZone,\n @Inject(ApiKeyToken)\n public apiKey: string,\n private loaderService: ScriptLoaderService,) {\n }\n\n ngOnInit(): void {\n this.addressValidator.subscribe(this.onNewPlaceResult);\n\n const options: AutocompleteOptions = {\n // types: ['address'],\n // componentRestrictions: {country: this.country},\n placeIdOnly: this.placeIdOnly,\n strictBounds: this.strictBounds,\n // types: this.types,\n type: this.type\n };\n\n // tslint:disable-next-line:no-unused-expression\n this.country ? options.componentRestrictions = {country: this.country} : null;\n // tslint:disable-next-line:no-unused-expression\n this.country ? options.types = this.types : null;\n\n this.autoCompleteOptions = Object.assign(this.autoCompleteOptions, options);\n this.initGoogleMapsAutocomplete();\n }\n\n ngOnDestroy(): void {\n if (this.autocomplete) {\n google.maps.event.clearInstanceListeners(this.autocomplete);\n }\n }\n\n public initGoogleMapsAutocomplete() {\n this.loaderService\n .loadScript(`https://maps.googleapis.com/maps/api/js?key=${this.apiKey}&libraries=places`)\n .then(() => {\n this.autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.nativeElement, this.autoCompleteOptions);\n this.autocomplete.addListener('place_changed', () => {\n this.ngZone.run(() => {\n // get the place result\n const place: PlaceResult = this.autocomplete.getPlace();\n\n const germanAddress: GermanAddress = {\n gmID: place.id,\n icon: place.icon,\n url: place.url,\n placeID: place.place_id,\n displayAddress: place.formatted_address,\n name: place.name,\n vicinity: place.vicinity,\n locality: {},\n state: {},\n country: {},\n geoLocation: {latitude: -1, longitude: -1},\n };\n\n if (place.geometry && place.geometry.location) {\n germanAddress.geoLocation.latitude = place.geometry.location.lat();\n germanAddress.geoLocation.longitude = place.geometry.location.lng();\n }\n\n if (place.address_components) {\n // console.log(\"place.address_components --> \", place.address_components);\n place.address_components.forEach(value => {\n if (value.types.indexOf('street_number') > -1) {\n germanAddress.streetNumber = value.short_name;\n }\n if (value.types.indexOf('route') > -1) {\n germanAddress.streetName = value.long_name;\n }\n if (value.types.indexOf('postal_code') > -1) {\n germanAddress.postalCode = value.short_name;\n }\n if (value.types.indexOf('sublocality') > -1) {\n germanAddress.sublocality = value.long_name;\n }\n if (value.types.indexOf('locality') > -1) {\n germanAddress.locality.long = value.long_name;\n germanAddress.locality.short = value.short_name;\n }\n if (value.types.indexOf('administrative_area_level_1') > -1) {\n germanAddress.state.long = value.long_name;\n germanAddress.state.short = value.short_name;\n }\n if (value.types.indexOf('country') > -1) {\n germanAddress.country.long = value.long_name;\n germanAddress.country.short = value.short_name;\n }\n if (value.types.indexOf('administrative_area_level_3') > -1) {\n germanAddress.locality.short = value.short_name;\n }\n });\n }\n\n this.onGermanAddressMapped.emit(germanAddress);\n\n if (!place.place_id || place.geometry === undefined || place.geometry === null) {\n // place result is not valid\n return;\n } else {\n // show dialog to select a address from the input\n // emit failed event\n this.value = place;\n this.propagateChange(this.value)\n }\n this.address = place.formatted_address;\n this.onAutocompleteSelected.emit(place);\n this.onLocationSelected.emit(\n {\n latitude: place.geometry.location.lat(),\n longitude: place.geometry.location.lng()\n });\n });\n });\n })\n .catch((err) => console.log(err));\n }\n\n public onQuery(event: any) {\n this.onChange.emit(this.address);\n }\n\n private resetAddress() {\n this.address = null;\n this.addressSearchControl.updateValueAndValidity();\n }\n\n writeValue(obj: any): void {\n if (obj) {\n this.value = obj;\n }\n }\n\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n throw new Error('Method not implemented.');\n }\n\n setDisabledState?(isDisabled: boolean): void {\n throw new Error('Method not implemented.');\n }\n\n}\n","<mat-form-field class=\"full-width\" [appearance]=\"appearance\">\n <mat-label>{{addressLabelText}}</mat-label>\n <input matInput\n [(ngModel)]=\"address\"\n (change)=\"onQuery($event)\"\n placeholder=\"{{placeholderText}}\"\n class=\"form-control\"\n #search\n MatValidateAddress\n required>\n <mat-error *ngIf=\"addressSearchControl.hasError('required')\">\n {{requiredErrorText}}\n </mat-error>\n <mat-error *ngIf=\"addressSearchControl.hasError('validateAddress')\">\n {{invalidErrorText}}\n </mat-error>\n</mat-form-field>\n","import {animate, animateChild, animation, query, stagger, state, style, transition, trigger, useAnimation} from '@angular/animations';\n\nconst customAnimation = animation(\n [\n style({\n opacity: '{{opacity}}',\n transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})'\n }),\n animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', style('*'))\n ],\n {\n params: {\n duration: '200ms',\n delay: '0ms',\n opacity: '0',\n scale: '1',\n x: '0',\n y: '0',\n z: '0'\n }\n }\n);\n\nexport const InputAnimations = [\n trigger('animate', [transition('void => *', [useAnimation(customAnimation)])]),\n\n trigger('animateStagger', [\n state('50', style('*')),\n state('100', style('*')),\n state('200', style('*')),\n\n transition('void => 50', query('@*', [stagger('50ms', [animateChild()])], {optional: true})),\n transition('void => 100', query('@*', [stagger('100ms', [animateChild()])], {optional: true})),\n transition('void => 200', query('@*', [stagger('200ms', [animateChild()])], {optional: true}))\n ]),\n];\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostListener,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n PLATFORM_ID,\n ViewChild\n} from '@angular/core';\nimport {ControlValueAccessor, FormControl, NG_VALIDATORS, Validators} from '@angular/forms';\nimport {GermanAddress, Location} from '../interfaces';\nimport {isPlatformBrowser} from '@angular/common';\nimport {ScriptLoaderService} from \"../services/script-loader.service\";\nimport {ApiKeyToken} from \"../tokens\";\nimport PlaceResult = google.maps.places.PlaceResult;\nimport AutocompleteOptions = google.maps.places.AutocompleteOptions;\n\n@Directive({\n selector: '[matGoogleMapsAutocomplete]',\n exportAs: 'matGoogleMapsAutocomplete',\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MatGoogleMapsAutocompleteDirective),\n multi: true\n }\n ]\n})\nexport class MatGoogleMapsAutocompleteDirective implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor {\n\n @ViewChild('inputField')\n inputField!: ElementRef;\n\n autocomplete: google.maps.places.Autocomplete | undefined;\n\n @Input()\n address: PlaceResult | string;\n\n @Input()\n country: string | string[];\n\n @Input()\n placeIdOnly?: boolean;\n\n @Input()\n strictBounds?: boolean;\n\n @Input()\n types?: string[];\n\n @Input()\n type?: string;\n\n @Input()\n autoCompleteOptions: AutocompleteOptions = {};\n\n @Output()\n onChange: EventEmitter<PlaceResult | string | null> = new EventEmitter<PlaceResult | string | null>();\n\n @Output()\n onAutocompleteSelected: EventEmitter<PlaceResult> = new EventEmitter<PlaceResult>();\n\n @Output()\n onGermanAddressMapped: EventEmitter<GermanAddress> = new EventEmitter<GermanAddress>();\n\n @Output()\n onLocationSelected: EventEmitter<Location> = new EventEmitter<Location>();\n\n disabled: boolean\n\n _value: string;\n\n get value(): string {\n return this._value;\n }\n\n @Input()\n set value(value: string) {\n this._value = value;\n this.propagateChange(this.value);\n this.cf.markForCheck();\n }\n\n private onNewPlaceResult: EventEmitter<any> = new EventEmitter();\n\n propagateChange = (_: any) => {\n };\n\n constructor(@Inject(PLATFORM_ID) public platformId: string,\n @Inject(ApiKeyToken)\n public apiKey: string,\n public elemRef: ElementRef,\n private cf: ChangeDetectorRef,\n private loaderService: ScriptLoaderService,\n private ngZone: NgZone) {\n }\n\n ngOnDestroy(): void {\n if (this.autocomplete) {\n google.maps.event.clearInstanceListeners(this.autocomplete);\n }\n }\n\n ngAfterViewInit(): void {\n this.loadMap();\n }\n\n ngOnInit(): void {\n }\n\n validate(fc: FormControl) {\n return fc.hasValidator(Validators.required) ? !!fc?.value : true;\n }\n\n @HostListener('change')\n onChangeInputValue(): void {\n const value = (this.elemRef.nativeElement as HTMLInputElement)?.value;\n this.value = value;\n }\n\n public initGoogleMapsAutocomplete() {\n const autocomplete = new google.maps.places.Autocomplete(this.elemRef.nativeElement, this.autoCompleteOptions);\n autocomplete.addListener('place_changed', () => {\n this.ngZone.run(() => {\n // get the place result\n const place: PlaceResult = autocomplete.getPlace();\n\n const germanAddress: GermanAddress = {\n gmID: place.id,\n icon: place.icon,\n url: place.url,\n placeID: place.place_id,\n displayAddress: place.formatted_address,\n name: place.name,\n vicinity: place.vicinity,\n locality: {},\n state: {},\n country: {},\n geoLocation: {latitude: -1, longitude: -1},\n };\n\n if (place.geometry && place.geometry.location) {\n germanAddress.geoLocation.latitude = place.geometry.location.lat();\n germanAddress.geoLocation.longitude = place.geometry.location.lng();\n }\n\n // console.log(\"place.address_components --> \", place.address_components);\n place.address_components.forEach(value => {\n if (value.types.indexOf('street_number') > -1) {\n germanAddress.streetNumber = value.short_name;\n }\n if (value.types.indexOf('route') > -1) {\n germanAddress.streetName = value.long_name;\n }\n if (value.types.indexOf('postal_code') > -1) {\n germanAddress.postalCode = value.short_name;\n }\n if (value.types.indexOf('sublocality') > -1) {\n germanAddress.sublocality = value.long_name;\n }\n if (value.types.indexOf('locality') > -1) {\n germanAddress.locality.long = value.long_name;\n germanAddress.locality.short = value.short_name;\n }\n if (value.types.indexOf('administrative_area_level_1') > -1) {\n germanAddress.state.long = value.long_name;\n germanAddress.state.short = value.short_name;\n }\n if (value.types.indexOf('country') > -1) {\n germanAddress.country.long = value.long_name;\n germanAddress.country.short = value.short_name;\n }\n if (value.types.indexOf('administrative_area_level_3') > -1) {\n germanAddress.locality.short = value.short_name;\n }\n });\n\n this.onGermanAddressMapped.emit(germanAddress);\n\n this.value = place.formatted_address;\n this.address = place.formatted_address;\n this.onAutocompleteSelected.emit(place);\n this.onLocationSelected.emit(\n {\n latitude: place.geometry.location.lat(),\n longitude: place.geometry.location.lng()\n });\n });\n });\n }\n\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n writeValue(obj: any): void {\n if (obj) {\n this.value = obj;\n }\n }\n\n loadMap(): void {\n this.loaderService.loadScript(`https://maps.googleapis.com/maps/api/js?key=${this.apiKey}&libraries=places`)\n .then(() => {\n this.initMap();\n })\n .catch(error => console.error('Google Maps loading failed: ', error));\n }\n\n initMap() {\n if (isPlatformBrowser(this.platformId)) {\n\n console.log(\"on after view init --> \", this.elemRef.nativeElement)\n\n this.autocomplete = new google.maps.places.Autocomplete(\n this.elemRef.nativeElement\n );\n\n const options: AutocompleteOptions = {\n // types: ['address'],\n // componentRestrictions: {country: this.country},\n placeIdOnly: this.placeIdOnly,\n strictBounds: this.strictBounds,\n // types: this.types,\n type: this.type\n };\n\n // tslint:disable-next-line:no-unused-expression\n this.country ? options.componentRestrictions = {country: this.country} : null;\n // tslint:disable-next-line:no-unused-expression\n this.country ? options.types = this.types : null;\n\n this.autoCompleteOptions = Object.assign(this.autoCompleteOptions, options);\n this.initGoogleMapsAutocomplete();\n }\n }\n\n}\n","import {Component, EventEmitter, forwardRef, Input, OnInit, Output} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n UntypedFormBuilder,\n UntypedFormGroup,\n Validators\n} from '@angular/forms';\n\nimport {parseGermanAddress} from '../../helpers/parser';\nimport {GermanAddress} from '../../interfaces';\nimport {Appearance} from '../mat-google-maps-autocomplete.component';\nimport {InputAnimations} from '../../animations';\nimport {debounceTime, distinctUntilChanged, takeUntil} from 'rxjs/operators';\nimport {Subject} from 'rxjs';\n\n@Component({\n selector: 'mat-search-google-maps-autocomplete',\n templateUrl: './mat-search-google-maps-autocomplete.component.html',\n styleUrls: ['./mat-search-google-maps-autocomplete.component.scss'],\n animations: InputAnimations,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatSearchGoogleMapsAutocompleteComponent),\n multi: true\n }\n ]\n})\nexport class MatSearchGoogleMapsAutocompleteComponent implements OnInit, ControlValueAccessor {\n\n constructor(private formBuilder: UntypedFormBuilder) {\n // Set the private defaults\n this._unsubscribeAll = new Subject();\n }\n\n @Input()\n searchBarAppearance: string | Appearance;\n\n @Input()\n appearance: string | Appearance = Appearance.STANDARD;\n\n @Input()\n searchAddressLabel = 'Search Address';\n\n @Input()\n streetNameLabel = 'Street';\n\n @Input()\n streetNumberLabel = 'Nr.';\n\n @Input()\n postalCodeLabel = 'PLZ';\n\n @Input()\n localityLabel = 'Locality';\n\n @Input()\n vicinityLabel = 'Vicinity';\n\n @Input()\n showVicinity: boolean;\n\n @Input()\n country: string | string[];\n\n @Input()\n placeIdOnly?: boolean;\n\n @Input()\n strictBounds?: boolean;\n\n @Input()\n types?: string[];\n // types: string[] = ['address'];\n\n @Input()\n type?: string;\n\n @Input()\n readonly: boolean;\n\n @Input()\n disableSearch: boolean;\n\n @Input() private _value: GermanAddress;\n\n @Output()\n onGermanAddressMapped: EventEmitter<GermanAddress> = new EventEmitter<GermanAddress>();\n\n germanAddress: GermanAddress;\n addressFormGroup: UntypedFormGroup;\n\n firstInit = true;\n\n // Private\n private _unsubscribeAll: Subject<any>;\n\n propagateChange = (_: any) => {\n };\n\n\n get value(): GermanAddress {\n return this._value;\n }\n\n @Input()\n set value(value: GermanAddress) {\n this._value = value;\n this.propagateChange(this.value);\n }\n\n ngOnInit() {\n this.createAddressFormGroup();\n this.enableCustomInput();\n }\n\n createAddressFormGroup(): void {\n this.addressFormGroup = this.formBuilder.group({\n streetName: [this.value && this.value.streetName ? this.value.streetName : null, Validators.required],\n streetNumber: [this.value && this.value.streetNumber ? this.value.streetNumber : null, Validators.required],\n postalCode: [this.value && this.value.postalCode ? this.value.postalCode : null, Validators.required],\n vicinity: [this.value && this.value.vicinity ? this.value.vicinity : null],\n locality: this.formBuilder.group({\n long: [this.value && this.value.locality && this.value.locality.long ? this.value.locality.long : null, Validators.required],\n }),\n });\n }\n\n enableCustomInput() {\n this.addressFormGroup\n .get('streetName')\n .valueChanges\n .pipe(distinctUntilChanged(), debounceTime(400), takeUntil(this._unsubscribeAll))\n .subscribe(streetName => {\n !this.value ? this.value = {streetName} : this.value.streetName = streetName;\n this.value.displayAddress = this.parseDisplayAddress();\n this.propagateChange(this.value);\n });\n this.addressFormGroup\n .get('streetNumber')\n .valueChanges\n .pipe(distinctUntilChanged(), debounceTime(400), takeUntil(this._unsubscribeAll))\n .subscribe(streetNumber => {\n !this.value ? this.value = {streetNumber} : this.value.streetNumber = streetNumber;\n this.value.displayAddress = this.parseDisplayAddress();\n this.propagateChange(this.value);\n });\n this.addressFormGroup\n .get('postalCode')\n .valueChanges\n .pipe(distinctUntilChanged(), debounceTime(400), takeUntil(this._unsubscribeAll))\n .subscribe(postalCode => {\n !this.value ? this.value = {postalCode} : this.value.postalCode = postalCode;\n this.value.displayAddress = this.parseDisplayAddress();\n this.propagateChange(this.value);\n });\n this.addressFormGroup\n .get('vicinity')\n .valueChanges\n .pipe(distinctUntilChanged(), debounceTime(400), takeUntil(this._unsubscribeAll))\n .subscribe(vicinity => {\n !this.value ? this.value = {vicinity} : this.value.vicinity = vicinity;\n this.value.displayAddress = this.parseDisplayAddress();\n this.propagateChange(this.value);\n });\n this.addressFormGroup\n .get('locality')\n .valueChanges\n .pipe(distinctUntilChanged(), debounceTime(400), takeUntil(this._unsubscribeAll))\n .subscribe(locality => {\n !this.value ? this.value = {locality} : this.value.locality = locality;\n this.value.displayAddress = this.parseDisplayAddress();\n this.propagateChange(this.value);\n });\n }\n\n parseDisplayAddress() {\n return `${this.value?.streetName ? this.value?.streetName : ''} ${this.value?.streetNumber ? this.value?.streetNumber : ''}${this.value?.postalCode || this.value?.locality?.long ? ', ' : ''}${this.value?.postalCode ? this.value?.postalCode : ''} ${this.value?.locality?.long ? this.value?.locality?.long : ''}`\n }\n\n syncAutoComplete($event: google.maps.places.PlaceResult) {\n if (this.germanAddress) {\n this.addressFormGroup.reset();\n }\n const germanAddress: GermanAddress = parseGermanAddress($event);\n this.germanAddress = germanAddress;\n if (germanAddress.vicinity) {\n this.addressFormGroup.get('vicinity').patchValue(germanAddress.vicinity, {emitEvent: false, onlySelf: true});\n }\n if (germanAddress.streetName) {\n this.addressFormGroup.get('streetName').patchValue(germanAddress.streetName, {emitEvent: false, onlySelf: true});\n }\n if (germanAddress.streetNumber) {\n this.addressFormGroup.get('streetNumber').patchValue(germanAddress.streetNumber.toString(), {\n emitEvent: false,\n onlySelf: true\n });\n }\n if (germanAddress.postalCode) {\n this.addressFormGroup.get('postalCode').patchValue(germanAddress.postalCode, {emitEvent: false, onlySelf: true});\n }\n if (germanAddress.locality && germanAddress.locality.long) {\n this.addressFormGroup.get('locality.long').patchValue(germanAddress.locality.long, {\n emitEvent: false,\n onlySelf: true\n });\n }\n\n this.value = germanAddress;\n this.onGermanAddressMapped.emit(germanAddress);\n }\n\n writeValue(obj: any): void {\n let shouldRecreateFG = false;\n if (obj) {\n if (!this.value && this.firstInit) {\n shouldRecreateFG = true;\n }\n this.value = obj;\n if (shouldRecreateFG) {\n this.createAddressFormGroup();\n this.firstInit = false;\n }\n }\n }\n\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n }\n\n setDisabledState(isDisabled: boolean): void {\n }\n\n}\n","<div fxLayout=\"column\">\n <div *ngIf=\"!disableSearch\" fxFlex=\"100\">\n <!--search address-->\n <mat-form-field fxFlex=\"auto\" [appearance]=\"searchBarAppearance\" [@animate]=\"{ value: '*', params: { y: '100%' } }\">\n <mat-label>{{searchAddressLabel}}</mat-label>\n <input\n (onAutocompleteSelected)=\"syncAutoComplete($event)\"\n [country]=\"country\"\n [placeIdOnly]=\"placeIdOnly\"\n [strictBounds]=\"strictBounds\"\n [types]=\"types\"\n [type]=\"type\"\n matGoogleMapsAutocomplete\n matInput\n required\n />\n <mat-icon color=\"primary\" matSuffix>search</mat-icon>\n <!-- <mat-error>{{ 'msa.contactData.currentAddress.error' | translate }}</mat-error>-->\n </mat-form-field>\n </div>\n\n <form [formGroup]=\"addressFormGroup\" fxFlex fxLayoutGap=\"10px\">\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"80\"\n [appearance]=\"appearance\"\n [@animate]=\"{ value: '*', params: { y: '100%' } }\">\n <mat-label>{{streetNameLabel}}</mat-label>\n <input\n [readonly]=\"readonly\"\n formControlName=\"streetName\"\n matInput\n required\n />\n <!-- <mat-icon color=\"primary\" matSuffix>add_location</mat-icon>-->\n <!-- <mat-error>{{ 'msa.contactData.currentAddress.error' | translate }}</mat-error>-->\n </mat-form-field>\n <mat-form-field fxFlex=\"20\" [appearance]=\"appearance\" [@animate]=\"{ value: '*', params: { y: '100%' } }\">\n <mat-label>{{streetNumberLabel}}</mat-label>\n <input\n [readonly]=\"readonly\"\n formControlName=\"streetNumber\"\n matInput\n required\n />\n <!-- <mat-icon color=\"primary\" matSuffix>add_location</mat-icon>-->\n <!-- <mat-error>{{ 'msa.contactData.currentAddress.error' | translate }}</mat-error>-->\n </mat-form-field>\n </div>\n <div fxLayout=\"row\" fxLayoutGap=\"10px\">\n <mat-form-field fxFlex=\"20\" [appearance]=\"appearance\" [@animate]=\"{ value: '*', params: { y: '100%' } }\">\n <mat-label>{{postalCodeLabel}}</mat-label>\n <input\n [readonly]=\"readonly\"\n formControlName=\"postalCode\"\n type=\"number\"\n matInput\n required\n />\n <!-- <mat-icon color=\"primary\" matSuffix>add_location</mat-icon>-->\n <!-- <mat-error>{{ 'msa.contactData.currentAddress.error' | translate }}</mat-error>-->\n </mat-form-field>\n <mat-form-field *ngIf=\"showVicinity\" fxFlex=\"auto\"\n [appearance]=\"appearance\"\n [@animate]=\"{ value: '*', params: { y: '100%' } }\">\n <mat-label>{{vicinityLabel}}</mat-label>\n <input\n [readonly]=\"readonly\"\n matInput\n formControlName=\"vicinity\"\n />\n </mat-form-field>\n <div formGroupName=\"locality\" fxFlex=\"auto\">\n <mat-form-field fxFlex=\"auto\" [appearance]=\"appearance\" [@animate]=\"{ value: '*', params: { y: '100%' } }\">\n <mat-label>{{localityLabel}}</mat-label>\n <input\n [readonly]=\"readonly\"\n formControlName=\"long\"\n matInput\n required\n />\n <mat-icon color=\"primary\" matSuffix>add_location</mat-icon>\n <!-- <mat-error>{{ 'msa.contactData.currentAddress.error' | translate }}</mat-error>-->\n </mat-form-field>\n </div>\n </div>\n </form>\n</div>\n","import {CommonModule} from '@angular/common';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {FlexLayoutModule} from '@angular/flex-layout';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatGoogleMapsAutocompleteDirective} from './directives/mat-google-maps-autocomplete.directive';\nimport {MatValidateAddressDirective} from './directives/address-validator/mat-address-validator.directive';\n// tslint:disable-next-line:max-line-length\nimport {MatGoogleMapsAutocompleteComponent, MatSearchGoogleMapsAutocompleteComponent} from './component';\nimport {MatInputModule} from '@angular/material/input';\nimport {ApiKeyToken} from \"./tokens\";\nimport {ScriptLoaderService} from \"./services/script-loader.service\";\n\n\n@NgModule({\n imports:\n [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n FlexLayoutModule,\n MatInputModule,\n MatIconModule\n ],\n exports: [\n MatGoogleMapsAutocompleteComponent,\n MatGoogleMapsAutocompleteDirective,\n MatValidateAddressDirective,\n MatSearchGoogleMapsAutocompleteComponent,\n ],\n declarations: [\n MatGoogleMapsAutocompleteComponent,\n MatGoogleMapsAutocompleteDirective,\n MatValidateAddressDirective,\n MatSearchGoogleMapsAutocompleteComponent\n ],\n providers: [\n // {\n // provide: NG_VALUE_ACCESSOR,\n // useExisting: forwardRef(() => MatGoogleMapsAutocompleteDirective),\n // multi: true\n // }\n ]\n})\nexport class MatGoogleMapsAutocompleteModule {\n\n constructor() {\n }\n\n static forRoot(\n apiKey: string,\n ): ModuleWithProviders<MatGoogleMapsAutocompleteModule> {\n\n return {\n ngModule: MatGoogleMapsAutocompleteModule,\n providers:\n [\n {\n provide: ApiKeyToken,\n useValue: apiKey\n },\n ]\n };\n }\n}\n","/*\n * Public API Surface of google-maps-autocomplete\n */\n\nexport * from './lib/helpers/parser';\nexport * from './lib/interfaces';\nexport * from './lib/tokens';\nexport * from './lib/services/script-loader.service';\nexport * from './lib/component';\nexport * from './lib/directives/mat-google-maps-autocomplete.directive';\nexport * from './lib/directives/address-validator/mat-address-validator.directive';\nexport * from './lib/mat-google-maps-autocomplete.module';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ScriptLoaderService","i3","i6.MatValidateAddressDirective"],"mappings":";;;;;;;;;;;;;;;;;AAGM,SAAU,kBAAkB,CAAC,WAAwB,EAAA;AACzD,IAAA,MAAM,aAAa,GAAkB;QACnC,IAAI,EAAE,WAAW,CAAC,EAAE;QACpB,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,GAAG,EAAE,WAAW,CAAC,GAAG;QACpB,OAAO,EAAE,WAAW,CAAC,QAAQ;QAC7B,cAAc,EAAE,WAAW,CAAC,iBAAiB;QAC7C,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,QAAQ,EAAE,WAAW,CAAC,QAAQ;AAC9B,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAC;KAC3C,CAAC;IAEF,IAAI,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE;AACzD,QAAA,aAAa,CAAC,WAAW,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;AACzE,QAAA,aAAa,CAAC,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;AAC3E,KAAA;IAED,IAAI,WAAW,CAAC,kBAAkB,IAAI,WAAW,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;AAC/E,QAAA,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,IAAG;YAC7C,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,C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