UNPKG

@firestitch/address

Version:
964 lines (890 loc) 57.1 kB
webpackJsonp([2],{ /***/ "../node_modules/css-loader/index.js?{\"sourceMap\":true}!../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../node_modules/resolve-url-loader/index.js?{\"sourceMap\":true}!../node_modules/sass-loader/lib/loader.js?{\"sourceMap\":true}!../src/components/fs-address/fs-address.component.scss": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("../node_modules/css-loader/lib/css-base.js")(true); // imports // module exports.push([module.i, "agm-map {\n width: 100%;\n height: 400px;\n background-color: grey;\n}\n\n[hidden] {\n display: none !important;\n}\n\n.map-container {\n position: relative;\n}\n\n.map-container .address-incomplete {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n background: #fff;\n border: 1px solid #efefef;\n height: 100%;\n line-height: 100%;\n opacity: 0.87;\n font-size: larger;\n padding: 40px;\n text-align: center;\n}\n\n.map-container .center {\n position: absolute;\n right: 20px;\n top: 20px;\n right: 5px;\n top: 5px;\n z-index: 5;\n background-color: #fff;\n}\n\n", "", {"version":3,"sources":["/Users/mendor/work/fs-address/src/components/fs-address/src/components/fs-address/fs-address.component.scss","/Users/mendor/work/fs-address/fs-address.component.scss","/Users/mendor/work/fs-address/src/components/fs-address/fs-address.component.scss"],"names":[],"mappings":"AAAA;EACI,YAAA;EACA,cAAA;EACA,uBAAA;CCCH;;ACCD;EFCW,yBAAA;CCEV;;ADAD;EACI,mBAAA;CCGH;;ADDG;EACI,mBAAA;EACA,OAAA;EACA,UAAA;EACA,QAAA;EACA,YAAA;EACA,iBAAA;EACA,0BAAA;EACA,aAAA;EACA,kBAAA;EACA,cAAA;EACA,kBAAA;EACA,cAAA;EACA,mBAAA;CCIP;;ADpBD;EAoBQ,mBAAA;EACA,YAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,WAAA;EACA,uBAAA;CCIP","file":"fs-address.component.scss","sourcesContent":["agm-map {\n width: 100%;\n height: 400px;\n background-color: grey;\n}\n\n[hidden] { display: none !important; }\n\n.map-container {\n position: relative;\n\n .address-incomplete {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n background: #fff;\n border: 1px solid #efefef;\n height: 100%;\n line-height: 100%;\n opacity: 0.87;\n font-size: larger;\n padding: 40px;\n text-align: center;\n }\n\n .center {\n position: absolute;\n right: 20px;\n top: 20px;\n right: 5px;\n top: 5px;\n z-index: 5;\n background-color: #fff; \n }\n}\n","agm-map {\n width: 100%;\n height: 400px;\n background-color: grey;\n}\n\n[hidden] {\n display: none !important;\n}\n\n.map-container {\n position: relative;\n}\n\n.map-container .address-incomplete {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n background: #fff;\n border: 1px solid #efefef;\n height: 100%;\n line-height: 100%;\n opacity: 0.87;\n font-size: larger;\n padding: 40px;\n text-align: center;\n}\n\n.map-container .center {\n position: absolute;\n right: 20px;\n top: 20px;\n right: 5px;\n top: 5px;\n z-index: 5;\n background-color: #fff;\n}\n\n","agm-map {\n width: 100%;\n height: 400px;\n background-color: grey; }\n\n[hidden] {\n display: none !important; }\n\n.map-container {\n position: relative; }\n .map-container .address-incomplete {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n background: #fff;\n border: 1px solid #efefef;\n height: 100%;\n line-height: 100%;\n opacity: 0.87;\n font-size: larger;\n padding: 40px;\n text-align: center; }\n .map-container .center {\n position: absolute;\n right: 20px;\n top: 20px;\n right: 5px;\n top: 5px;\n z-index: 5;\n background-color: #fff; }\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9jb21wb25lbnRzL2ZzLWFkZHJlc3MvZnMtYWRkcmVzcy5jb21wb25lbnQuc2NzcyJdLCJzb3VyY2VzQ29udGVudCI6WyJhZ20tbWFwIHtcbiAgICB3aWR0aDogMTAwJTtcbiAgICBoZWlnaHQ6IDQwMHB4O1xuICAgIGJhY2tncm91bmQtY29sb3I6IGdyZXk7XG59XG5cbltoaWRkZW5dIHsgZGlzcGxheTogbm9uZSAhaW1wb3J0YW50OyB9XG5cbi5tYXAtY29udGFpbmVyIHtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG5cbiAgICAuYWRkcmVzcy1pbmNvbXBsZXRlIHtcbiAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgICB0b3A6IDA7XG4gICAgICAgIGJvdHRvbTogMDtcbiAgICAgICAgbGVmdDogMDtcbiAgICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICAgIGJhY2tncm91bmQ6ICNmZmY7XG4gICAgICAgIGJvcmRlcjogMXB4IHNvbGlkICNlZmVmZWY7XG4gICAgICAgIGhlaWdodDogMTAwJTtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDEwMCU7XG4gICAgICAgIG9wYWNpdHk6IDAuODc7XG4gICAgICAgIGZvbnQtc2l6ZTogbGFyZ2VyO1xuICAgICAgICBwYWRkaW5nOiA0MHB4O1xuICAgICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgfVxuXG4gICAgLmNlbnRlciB7XG4gICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgICAgICAgcmlnaHQ6IDIwcHg7XG4gICAgICAgIHRvcDogMjBweDtcbiAgICAgICAgcmlnaHQ6IDVweDtcbiAgICAgICAgdG9wOiA1cHg7XG4gICAgICAgIHotaW5kZXg6IDU7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7ICAgIFxuICAgIH1cbn1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxBQUFBLE9BQU8sQ0FBQztFQUNKLEtBQUssRUFBRSxJQUFJO0VBQ1gsTUFBTSxFQUFFLEtBQUs7RUFDYixnQkFBZ0IsRUFBRSxJQUFJLEdBQ3pCOztDQUVELEFBQUEsQUFBQSxNQUFDLEFBQUEsRUFBUTtFQUFFLE9BQU8sRUFBRSxlQUFlLEdBQUs7O0FBRXhDLEFBQUEsY0FBYyxDQUFDO0VBQ1gsUUFBUSxFQUFFLFFBQVEsR0EyQnJCO0VBNUJELEFBR0ksY0FIVSxDQUdWLG1CQUFtQixDQUFDO0lBQ2hCLFFBQVEsRUFBRSxRQUFRO0lBQ2xCLEdBQUcsRUFBRSxDQUFDO0lBQ04sTUFBTSxFQUFFLENBQUM7SUFDVCxJQUFJLEVBQUUsQ0FBQztJQUNQLEtBQUssRUFBRSxJQUFJO0lBQ1gsVUFBVSxFQUFFLElBQUk7SUFDaEIsTUFBTSxFQUFFLGlCQUFpQjtJQUN6QixNQUFNLEVBQUUsSUFBSTtJQUNaLFdBQVcsRUFBRSxJQUFJO0lBQ2pCLE9BQU8sRUFBRSxJQUFJO0lBQ2IsU0FBUyxFQUFFLE1BQU07SUFDakIsT0FBTyxFQUFFLElBQUk7SUFDYixVQUFVLEVBQUUsTUFBTSxHQUNyQjtFQWpCTCxBQW1CSSxjQW5CVSxDQW1CVixPQUFPLENBQUM7SUFDSixRQUFRLEVBQUUsUUFBUTtJQUNsQixLQUFLLEVBQUUsSUFBSTtJQUNYLEdBQUcsRUFBRSxJQUFJO0lBQ1QsS0FBSyxFQUFFLEdBQUc7SUFDVixHQUFHLEVBQUUsR0FBRztJQUNSLE9BQU8sRUFBRSxDQUFDO0lBQ1YsZ0JBQWdCLEVBQUUsSUFBSSxHQUN6QiJ9 */"],"sourceRoot":""}]); // exports /***/ }), /***/ "../src/classes/googlemapconfig.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = __webpack_require__("../node_modules/@angular/core/esm2015/core.js"); var GoogleMapConfig = (function () { function GoogleMapConfig(apiKey) { this.apiKey = null; if (!apiKey) { throw new Error('GoogleMapKey injector invalid'); } this.apiKey = apiKey; } GoogleMapConfig = __decorate([ __param(0, core_1.Inject('GoogleMapKey')), __metadata("design:paramtypes", [Object]) ], GoogleMapConfig); return GoogleMapConfig; }()); exports.GoogleMapConfig = GoogleMapConfig; ; /***/ }), /***/ "../src/components/fs-address-format/fs-address-format.component.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = __webpack_require__("../node_modules/@angular/core/esm2015/core.js"); var lodash_1 = __webpack_require__("../node_modules/lodash/lodash.js"); var FsAddressFormatComponent = (function () { function FsAddressFormatComponent(differs) { this.differs = differs; this.config = {}; this.change = new core_1.EventEmitter(); this.configKeys = []; this._address = {}; this._addressDiffer = null; this._defaultKeys = ['address', 'address2', 'city', 'region', 'zip', 'country']; } Object.defineProperty(FsAddressFormatComponent.prototype, "address", { get: function () { return this._address; }, set: function (address) { this._address = address; if (!this._addressDiffer && address) { this._addressDiffer = this.differs.find(address).create(); } }, enumerable: true, configurable: true }); FsAddressFormatComponent.prototype.ngOnInit = function () { var _this = this; lodash_1.each(this._defaultKeys, function (item) { if (!lodash_1.isArrayLikeObject(_this.config[item])) { _this.config[item] = {}; } if (!_this.config[item].name) { _this.config[item].name = item; } }); this.configKeys = Object.keys(this.config); }; FsAddressFormatComponent.prototype.ngDoCheck = function () { var _this = this; if (this._addressDiffer) { var changes = this._addressDiffer.diff(this.address); if (changes) { var parts_1 = []; lodash_1.each(this.configKeys, function (key) { if (_this.address[_this.config[key]['name']]) { parts_1.push(_this.address[_this.config[key]['name']]); } }); setTimeout(function () { _this.change.emit(parts_1); }); } } }; __decorate([ core_1.Input(), __metadata("design:type", Object), __metadata("design:paramtypes", [Object]) ], FsAddressFormatComponent.prototype, "address", null); __decorate([ core_1.Input(), __metadata("design:type", Object) ], FsAddressFormatComponent.prototype, "config", void 0); __decorate([ core_1.Output(), __metadata("design:type", Object) ], FsAddressFormatComponent.prototype, "change", void 0); FsAddressFormatComponent = __decorate([ core_1.Component({ selector: 'fs-address-format', template: "\n <ng-container *ngFor=\"let key of configKeys\">\n <span class=\"{{key}}\" *ngIf=\"address[config[key]['name']]\">{{address[config[key]['name']]}}</span>\n </ng-container>", styles: [ "span::after { content: \", \"; }", "span:last-child:after { content: \"\"; }" ], }), __metadata("design:paramtypes", [core_1.KeyValueDiffers]) ], FsAddressFormatComponent); return FsAddressFormatComponent; }()); exports.FsAddressFormatComponent = FsAddressFormatComponent; /***/ }), /***/ "../src/components/fs-address/fs-address.component.html": /***/ (function(module, exports) { module.exports = "<div>\n <div fxLayout=\"row\">\n <mat-form-field fxFlex>\n <input matInput [(ngModel)]=\"address[config.address.name]\" [attr.disabled]=\"config.disabled\" [fsFormRequired]=\"config.address.required\" name=\"{{ config.address.id }}\" placeholder=\"Address\" aria-label=\"Address\" (change)=\"search()\" autocomplete=\"off\">\n </mat-form-field>\n <mat-form-field fxFlex [hidden]=\"!config.address2.show\">\n <input matInput [(ngModel)]=\"address[config.address2.name]\" [attr.disabled]=\"config.disabled\" [fsFormRequired]=\"config.address2.required\" name=\"{{ config.address2.id }}\" placeholder=\"Address 2\" aria-label=\"Address 2\" (change)=\"search()\">\n <mat-hint>Apartment, suite, unit, building, floor, etc.</mat-hint>\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\">\n <mat-form-field fxFlex>\n <input matInput [(ngModel)]=\"address[config.city.name]\" [attr.disabled]=\"config.disabled\" [fsFormRequired]=\"config.city.required\" name=\"{{ config.city.id }}\" placeholder=\"City\" aria-label=\"City\" (change)=\"search()\">\n </mat-form-field>\n <mat-form-field fxFlex>\n <input matInput [(ngModel)]=\"address[config.zip.name]\" [attr.disabled]=\"config.disabled\" [fsFormRequired]=\"config.zip.required\" name=\"{{ config.zip.id }}\" placeholder=\"{{ zipLabel }}\" (change)=\"search()\">\n </mat-form-field>\n </div>\n\n <div fxLayout=\"row\">\n <mat-form-field fxFlex>\n <mat-select [(ngModel)]=\"address[config.country.name]\" [attr.disabled]=\"config.disabled\" [fsFormRequired]=\"config.country.required\" name=\"{{ config.country.id }}\" placeholder=\"Country\" aria-label=\"Country\" (ngModelChange)=\"changeCountry()\" (change)=\"search()\">\n <mat-option *ngFor=\"let country of countries.domestic\" [value]=\"country.code\">\n <span>{{ country.name }}</span>\n </mat-option>\n <ng-container *ngIf=\"countries.international.length\">\n <mat-option *ngFor=\"let country of countries.international\" [value]=\"country.code\">\n <span>{{ country.name }}</span>\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n <mat-form-field fxFlex>\n <mat-select [(ngModel)]=\"address[config.region.name]\" [attr.disabled]=\"config.disabled\" [fsFormRequired]=\"config.region.required\" name=\"{{ config.region.id }}\" placeholder=\"{{ regionLabel }}\" (change)=\"search()\">\n <mat-option *ngFor=\"let region of regions\" [value]=\"region.code\">\n <span>{{ region.name }}</span>\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class=\"map-container\" [hidden]=\"!config.map\">\n\n <button mat-button class=\"center\"\n type=\"button\"\n *ngIf=\"(address.lat && address.lng) && (marker.coords.latitude && marker.coords.longitude)\"\n (click)=\"recenter()\">Center Map using Address</button>\n\n <agm-map\n [latitude]=\"map.center.latitude\"\n [longitude]=\"map.center.longitude\"\n [zoom]=\"map.zoom\"\n [scrollwheel]=\"mapOptions.scrollwheel\"\n [streetViewControl]=\"mapOptions.streetViewControl\"\n [mapTypeControlOptions]=\"mapOptions.mapTypeControlOptions\"\n >\n <agm-marker\n [latitude]=\"marker.coords.latitude\"\n [longitude]=\"marker.coords.longitude\"\n [markerDraggable]=\"marker.options.draggable\"\n (dragEnd)=\"marker.events.dragend($event)\"\n ></agm-marker>\n </agm-map>\n\n <div class=\"address-incomplete\" fxLayout=\"row\" fxLayoutAlign=\"center center\" *ngIf=\"!address.lat && !address.lng\">\n <div *ngIf=\"!searched\">Please populate the address above to locate it on the map</div>\n <div *ngIf=\"searched\">Could not find address \"{{ searchedAddress }}\"</div>\n </div>\n </div>\n</div>\n" /***/ }), /***/ "../src/components/fs-address/fs-address.component.scss": /***/ (function(module, exports, __webpack_require__) { var result = __webpack_require__("../node_modules/css-loader/index.js?{\"sourceMap\":true}!../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../node_modules/resolve-url-loader/index.js?{\"sourceMap\":true}!../node_modules/sass-loader/lib/loader.js?{\"sourceMap\":true}!../src/components/fs-address/fs-address.component.scss"); if (typeof result === "string") { module.exports = result; } else { module.exports = result.toString(); } /***/ }), /***/ "../src/components/fs-address/fs-address.component.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = __webpack_require__("../node_modules/@angular/core/esm2015/core.js"); var lodash_1 = __webpack_require__("../node_modules/lodash/lodash.js"); __webpack_require__("../node_modules/rxjs/add/operator/startWith.js"); __webpack_require__("../node_modules/rxjs/add/operator/map.js"); var core_2 = __webpack_require__("../node_modules/@agm/core/index.js"); var countries_1 = __webpack_require__("../src/constants/countries.ts"); var forms_1 = __webpack_require__("../node_modules/@angular/forms/esm2015/forms.js"); var FsAddressComponent = (function () { function FsAddressComponent(_wrapper, markerManager) { this._wrapper = _wrapper; this.markerManager = markerManager; this.address = {}; this.config = null; this.change = new core_1.EventEmitter(); this.regions = []; this.countries = { domestic: [], international: [] }; this.zipLabel = ''; this.regionLabel = ''; this.center = null; this.searched = false; this.searchedAddress = ''; this.map = null; this.mapOptions = null; this.marker = null; } FsAddressComponent.prototype.ngOnInit = function () { var _this = this; this.config = Object.assign({}, { cords: { lat: 43.6379967, lng: -79.3819992 }, address2: true, disabled: false, domestics: ['CA', 'US'], map: true }, this.config); this.address.lat = this.address.lat || ''; this.address.lng = this.address.lng || ''; this.map = { center: { latitude: this.address.lat || this.config.cords.lat, longitude: this.address.lng || this.config.cords.lng }, zoom: 13 }; this.mapOptions = Object.assign({ scrollwheel: false, streetViewControl: false, mapTypeControlOptions: { mapTypeIds: [] } }, this.mapOptions || {}); this.marker = { id: 0, coords: { latitude: this.address.lat, longitude: this.address.lng }, options: { draggable: true }, events: { dragend: function (marker) { _this.address.lat = marker.coords.lat; _this.address.lng = marker.coords.lng; } } }; for (var _i = 0, _a = ['address', 'address2', 'city', 'region', 'country', 'zip']; _i < _a.length; _i++) { var item = _a[_i]; var option = this.config[item]; if (lodash_1.isBoolean(option)) { option = { show: this.config[item] }; } if (!lodash_1.isArrayLikeObject(this.config[item])) { option = {}; } if (!option.id) { option.id = 'input_' + lodash_1.uniqueId(); } if (!option.name) { option.name = item; } this.config[item] = option; } ; var countries = []; if (this.config.countries) { for (var _b = 0, _c = this.config.countries; _b < _c.length; _b++) { var code = _c[_b]; var country = lodash_1.filter(countries_1.COUNTRIES, { code: code })[0]; if (country) { countries.push(country); } } ; } else { countries = countries_1.COUNTRIES.slice(); } if (this.config.domestics) { this.countries.international = countries; for (var i = this.config.domestics.length - 1; i >= 0; i--) { var item = lodash_1.remove(this.countries.international, { code: this.config.domestics[i] })[0]; if (item) { this.countries.domestic.unshift(item); } } } else { this.countries.domestic = countries; } if (!this.address.country && this.countries.domestic[0]) { this.address.country = this.countries.domestic[0].code; } if (this.address[this.config.country.name]) { this.changeCountry(); } // Example ready event. Allow to use google object and map instance if (this.agmMap) { this.mapReady$ = this.agmMap.mapReady.subscribe(function (map) { _this.agmMap.triggerResize(); if (_this.address[_this.config.address.name] || _this.address[_this.config.address2.name] || _this.address[_this.config.city.name] || _this.address[_this.config.region.name] || _this.address[_this.config.zip.name]) { _this.address.lat = 9999; _this.address.lng = 9999; _this.search(); } }); } }; FsAddressComponent.prototype.recenter = function () { var _this = this; this.map.center = { latitude: this.address.lat, longitude: this.address.lng }; this.marker.coords.latitude = this.address.lat; this.marker.coords.longitude = this.address.lng; this.agmMap.triggerResize() .then(function () { return _this.agmMap._mapsWrapper.setCenter({ lat: _this.address.lat, lng: _this.address.lng }); }); }; FsAddressComponent.prototype.changeCountry = function () { var country = lodash_1.filter(countries_1.COUNTRIES, { code: this.address[this.config.country.name] })[0]; this.regions = country ? country.regions : []; this.zipLabel = country && country.code == 'CA' ? 'Postal Code' : 'Zip'; this.regionLabel = country && country.code == 'CA' ? 'Province' : 'State'; }; FsAddressComponent.prototype.search = function () { var _this = this; var geocoder = new google.maps.Geocoder(); var country = lodash_1.filter(countries_1.COUNTRIES, { code: this.address.country })[0] || {}; var parts = [this.address[this.config.address.name], this.address[this.config.city.name], this.address[this.config.region.name], country.name ]; this.searchedAddress = parts.join(', '); geocoder.geocode({ address: this.searchedAddress }, function (results, status) { _this.searched = true; if (status == google.maps.GeocoderStatus.OK && results.length > 0) { var location_1 = results[0].geometry.location; _this.address.lat = location_1.lat(); _this.address.lng = location_1.lng(); _this.map.center = { latitude: parseFloat(location_1.lat()), longitude: parseFloat(location_1.lng()) }; _this.marker.coords.latitude = location_1.lat(); _this.marker.coords.longitude = location_1.lng(); if (_this.agmMap) { _this.agmMap.triggerResize(); } } else { _this.address.lat = null; _this.address.lng = null; } }); this.change.emit(this.address); }; FsAddressComponent.prototype.ngOnDestroy = function () { if (this.agmMap) { this.mapReady$.unsubscribe(); } }; __decorate([ core_1.ViewChild(core_2.AgmMap), __metadata("design:type", Object) ], FsAddressComponent.prototype, "agmMap", void 0); __decorate([ core_1.ViewChild(core_2.AgmMarker), __metadata("design:type", Object) ], FsAddressComponent.prototype, "agmMarker", void 0); __decorate([ core_1.Input(), __metadata("design:type", Object) ], FsAddressComponent.prototype, "address", void 0); __decorate([ core_1.Input(), __metadata("design:type", Object) ], FsAddressComponent.prototype, "config", void 0); __decorate([ core_1.Output(), __metadata("design:type", Object) ], FsAddressComponent.prototype, "change", void 0); FsAddressComponent = __decorate([ core_1.Component({ selector: 'fs-address', template: __webpack_require__("../src/components/fs-address/fs-address.component.html"), styles: [__webpack_require__("../src/components/fs-address/fs-address.component.scss")], // HACK: allow access from the parent form to inputs in child component viewProviders: [{ provide: forms_1.ControlContainer, useExisting: forms_1.NgForm }] }), __metadata("design:paramtypes", [core_2.GoogleMapsAPIWrapper, core_2.MarkerManager]) ], FsAddressComponent); return FsAddressComponent; }()); exports.FsAddressComponent = FsAddressComponent; /***/ }), /***/ "../src/constants/countries.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.COUNTRIES = [ { code: 'AF', name: 'Afghanistan' }, { code: 'AL', name: 'Albania' }, { code: 'DZ', name: 'Algeria' }, { code: 'AS', name: 'American Samoa' }, { code: 'AD', name: 'Andorra' }, { code: 'AO', name: 'Angola' }, { code: 'AI', name: 'Anguilla' }, { code: 'AQ', name: 'Antarctica' }, { code: 'AG', name: 'Antigua and Barbuda' }, { code: 'AR', name: 'Argentina' }, { code: 'AM', name: 'Armenia' }, { code: 'AW', name: 'Aruba' }, { code: 'AU', name: 'Australia' }, { code: 'AT', name: 'Austria' }, { code: 'AZ', name: 'Azerbaijan' }, { code: 'BS', name: 'Bahamas' }, { code: 'BH', name: 'Bahrain' }, { code: 'BD', name: 'Bangladesh' }, { code: 'BB', name: 'Barbados' }, { code: 'BY', name: 'Belarus' }, { code: 'BE', name: 'Belgium' }, { code: 'BZ', name: 'Belize' }, { code: 'BJ', name: 'Benin' }, { code: 'BM', name: 'Bermuda' }, { code: 'BT', name: 'Bhutan' }, { code: 'BO', name: 'Bolivia' }, { code: 'BA', name: 'Bosnia and Herzegovina' }, { code: 'BW', name: 'Botswana' }, { code: 'BV', name: 'Bouvet Island' }, { code: 'BR', name: 'Brazil' }, { code: 'IO', name: 'British Indian Ocean Territory' }, { code: 'BN', name: 'Brunei Darussalam' }, { code: 'BG', name: 'Bulgaria' }, { code: 'BF', name: 'Burkina Faso' }, { code: 'BI', name: 'Burundi' }, { code: 'KH', name: 'Cambodia' }, { code: 'CM', name: 'Cameroon' }, { code: 'CA', name: 'Canada', 'regions': [ { code: 'AB', name: 'Alberta' }, { code: 'BC', name: 'British Columbia' }, { code: 'MB', name: 'Manitoba' }, { code: 'NB', name: 'New Brunswick' }, { code: 'NL', name: 'Newfoundland and Labrador' }, { code: 'NT', name: 'Northwest Territories' }, { code: 'NS', name: 'Nova Scotia' }, { code: 'NU', name: 'Nunavut' }, { code: 'ON', name: 'Ontario' }, { code: 'PE', name: 'Prince Edward Island' }, { code: 'QC', name: 'Quebec' }, { code: 'SK', name: 'Saskatchewan' }, { code: 'YT', name: 'Yukon Territory' } ] }, { code: 'CV', name: 'Cape Verde' }, { code: 'KY', name: 'Cayman Islands' }, { code: 'CF', name: 'Central African Republic' }, { code: 'TD', name: 'Chad' }, { code: 'CL', name: 'Chile' }, { code: 'CN', name: 'China' }, { code: 'CX', name: 'Christmas Island' }, { code: 'CC', name: 'Cocos (Keeling) Islands' }, { code: 'CO', name: 'Colombia' }, { code: 'KM', name: 'Comoros' }, { code: 'CG', name: 'Congo' }, { code: 'CD', name: 'Congo, the Democratic Republic of the' }, { code: 'CK', name: 'Cook Islands' }, { code: 'CR', name: 'Costa Rica' }, { code: 'CI', name: 'Cote D\'Ivoire' }, { code: 'HR', name: 'Croatia' }, { code: 'CU', name: 'Cuba' }, { code: 'CY', name: 'Cyprus' }, { code: 'CZ', name: 'Czech Republic' }, { code: 'DK', name: 'Denmark' }, { code: 'DJ', name: 'Djibouti' }, { code: 'DM', name: 'Dominica' }, { code: 'DO', name: 'Dominican Republic' }, { code: 'EC', name: 'Ecuador' }, { code: 'EG', name: 'Egypt' }, { code: 'SV', name: 'El Salvador' }, { code: 'GQ', name: 'Equatorial Guinea' }, { code: 'ER', name: 'Eritrea' }, { code: 'EE', name: 'Estonia' }, { code: 'ET', name: 'Ethiopia' }, { code: 'FK', name: 'Falkland Islands (Malvinas)' }, { code: 'FO', name: 'Faroe Islands' }, { code: 'FJ', name: 'Fiji' }, { code: 'FI', name: 'Finland' }, { code: 'FR', name: 'France' }, { code: 'GF', name: 'French Guiana' }, { code: 'PF', name: 'French Polynesia' }, { code: 'TF', name: 'French Southern Territories' }, { code: 'GA', name: 'Gabon' }, { code: 'GM', name: 'Gambia' }, { code: 'GE', name: 'Georgia' }, { code: 'DE', name: 'Germany' }, { code: 'GH', name: 'Ghana' }, { code: 'GI', name: 'Gibraltar' }, { code: 'GR', name: 'Greece' }, { code: 'GL', name: 'Greenland' }, { code: 'GD', name: 'Grenada' }, { code: 'GP', name: 'Guadeloupe' }, { code: 'GU', name: 'Guam' }, { code: 'GT', name: 'Guatemala' }, { code: 'GN', name: 'Guinea' }, { code: 'GW', name: 'Guinea-Bissau' }, { code: 'GY', name: 'Guyana' }, { code: 'HT', name: 'Haiti' }, { code: 'HM', name: 'Heard Island and Mcdonald Islands' }, { code: 'VA', name: 'Holy See (Vatican City State)' }, { code: 'HN', name: 'Honduras' }, { code: 'HK', name: 'Hong Kong' }, { code: 'HU', name: 'Hungary' }, { code: 'IS', name: 'Iceland' }, { code: 'IN', name: 'India' }, { code: 'ID', name: 'Indonesia' }, { code: 'IR', name: 'Iran, Islamic Republic of' }, { code: 'IQ', name: 'Iraq' }, { code: 'IE', name: 'Ireland' }, { code: 'IL', name: 'Israel' }, { code: 'IT', name: 'Italy' }, { code: 'JM', name: 'Jamaica' }, { code: 'JP', name: 'Japan' }, { code: 'JO', name: 'Jordan' }, { code: 'KZ', name: 'Kazakhstan' }, { code: 'KE', name: 'Kenya' }, { code: 'KI', name: 'Kiribati' }, { code: 'KP', name: 'Korea, Democratic People\'s Republic of' }, { code: 'KR', name: 'Korea, Republic of' }, { code: 'KW', name: 'Kuwait' }, { code: 'KG', name: 'Kyrgyzstan' }, { code: 'LA', name: 'Lao People\'s Democratic Republic' }, { code: 'LV', name: 'Latvia' }, { code: 'LB', name: 'Lebanon' }, { code: 'LS', name: 'Lesotho' }, { code: 'LR', name: 'Liberia' }, { code: 'LY', name: 'Libyan Arab Jamahiriya' }, { code: 'LI', name: 'Liechtenstein' }, { code: 'LT', name: 'Lithuania' }, { code: 'LU', name: 'Luxembourg' }, { code: 'MO', name: 'Macao' }, { code: 'MK', name: 'Macedonia' }, { code: 'MG', name: 'Madagascar' }, { code: 'MW', name: 'Malawi' }, { code: 'MY', name: 'Malaysia' }, { code: 'MV', name: 'Maldives' }, { code: 'ML', name: 'Mali' }, { code: 'MT', name: 'Malta' }, { code: 'MH', name: 'Marshall Islands' }, { code: 'MQ', name: 'Martinique' }, { code: 'MR', name: 'Mauritania' }, { code: 'MU', name: 'Mauritius' }, { code: 'YT', name: 'Mayotte' }, { code: 'MX', name: 'Mexico' }, { code: 'FM', name: 'Micronesia, Federated States of' }, { code: 'MD', name: 'Moldova, Republic of' }, { code: 'MC', name: 'Monaco' }, { code: 'MN', name: 'Mongolia' }, { code: 'MS', name: 'Montserrat' }, { code: 'MA', name: 'Morocco' }, { code: 'MZ', name: 'Mozambique' }, { code: 'MM', name: 'Myanmar' }, { code: 'NA', name: 'Namibia' }, { code: 'NR', name: 'Nauru' }, { code: 'NP', name: 'Nepal' }, { code: 'NL', name: 'Netherlands' }, { code: 'AN', name: 'Netherlands Antilles' }, { code: 'NC', name: 'New Caledonia' }, { code: 'NZ', name: 'New Zealand' }, { code: 'NI', name: 'Nicaragua' }, { code: 'NE', name: 'Niger' }, { code: 'NG', name: 'Nigeria' }, { code: 'NU', name: 'Niue' }, { code: 'NF', name: 'Norfolk Island' }, { code: 'MP', name: 'Northern Mariana Islands' }, { code: 'NO', name: 'Norway' }, { code: 'OM', name: 'Oman' }, { code: 'PK', name: 'Pakistan' }, { code: 'PW', name: 'Palau' }, { code: 'PS', name: 'Palestinian Territory, Occupied' }, { code: 'PA', name: 'Panama' }, { code: 'PG', name: 'Papua New Guinea' }, { code: 'PY', name: 'Paraguay' }, { code: 'PE', name: 'Peru' }, { code: 'PH', name: 'Philippines' }, { code: 'PN', name: 'Pitcairn' }, { code: 'PL', name: 'Poland' }, { code: 'PT', name: 'Portugal' }, { code: 'PR', name: 'Puerto Rico' }, { code: 'QA', name: 'Qatar' }, { code: 'RE', name: 'Reunion' }, { code: 'RO', name: 'Romania' }, { code: 'RU', name: 'Russian Federation' }, { code: 'RW', name: 'Rwanda' }, { code: 'SH', name: 'Saint Helena' }, { code: 'KN', name: 'Saint Kitts and Nevis' }, { code: 'LC', name: 'Saint Lucia' }, { code: 'PM', name: 'Saint Pierre and Miquelon' }, { code: 'VC', name: 'Saint Vincent and the Grenadines' }, { code: 'WS', name: 'Samoa' }, { code: 'SM', name: 'San Marino' }, { code: 'ST', name: 'Sao Tome and Principe' }, { code: 'SA', name: 'Saudi Arabia' }, { code: 'SN', name: 'Senegal' }, { code: 'CS', name: 'Serbia and Montenegro' }, { code: 'SC', name: 'Seychelles' }, { code: 'SL', name: 'Sierra Leone' }, { code: 'SG', name: 'Singapore' }, { code: 'SK', name: 'Slovakia' }, { code: 'SI', name: 'Slovenia' }, { code: 'SB', name: 'Solomon Islands' }, { code: 'SO', name: 'Somalia' }, { code: 'ZA', name: 'South Africa' }, { code: 'GS', name: 'South Georgia and Sandwich Isles' }, { code: 'ES', name: 'Spain' }, { code: 'LK', name: 'Sri Lanka' }, { code: 'SD', name: 'Sudan' }, { code: 'SR', name: 'Suriname' }, { code: 'SJ', name: 'Svalbard and Jan Mayen' }, { code: 'SZ', name: 'Swaziland' }, { code: 'SE', name: 'Sweden' }, { code: 'CH', name: 'Switzerland' }, { code: 'SY', name: 'Syrian Arab Republic' }, { code: 'TW', name: 'Taiwan (ROC)' }, { code: 'TJ', name: 'Tajikistan' }, { code: 'TZ', name: 'Tanzania, United Republic of' }, { code: 'TH', name: 'Thailand' }, { code: 'TL', name: 'Timor-Leste' }, { code: 'TG', name: 'Togo' }, { code: 'TK', name: 'Tokelau' }, { code: 'TO', name: 'Tonga' }, { code: 'TT', name: 'Trinidad and Tobago' }, { code: 'TN', name: 'Tunisia' }, { code: 'TR', name: 'Turkey' }, { code: 'TM', name: 'Turkmenistan' }, { code: 'TC', name: 'Turks and Caicos Islands' }, { code: 'TV', name: 'Tuvalu' }, { code: 'UG', name: 'Uganda' }, { code: 'UA', name: 'Ukraine' }, { code: 'AE', name: 'United Arab Emirates' }, { code: 'GB', name: 'United Kingdom' }, { code: 'US', name: 'United States', 'regions': [ { code: 'AK', name: 'Alaska' }, { code: 'AL', name: 'Alabama' }, { code: 'AR', name: 'Arkansas' }, { code: 'AS', name: 'American Samoa' }, { code: 'AZ', name: 'Arizona' }, { code: 'CA', name: 'California' }, { code: 'CO', name: 'Colorado' }, { code: 'CT', name: 'Connecticut' }, { code: 'DE', name: 'Delaware' }, { code: 'FL', name: 'Florida' }, { code: 'GA', name: 'Georgia' }, { code: 'HI', name: 'Hawaii' }, { code: 'IA', name: 'Iowa' }, { code: 'ID', name: 'Idaho' }, { code: 'IL', name: 'Illinois' }, { code: 'IN', name: 'Indiana' }, { code: 'KS', name: 'Kansas' }, { code: 'KY', name: 'Kentucky' }, { code: 'LA', name: 'Louisiana' }, { code: 'MA', name: 'Massachusetts' }, { code: 'MD', name: 'Maryland' }, { code: 'ME', name: 'Maine' }, { code: 'MI', name: 'Michigan' }, { code: 'MN', name: 'Minnesota' }, { code: 'MO', name: 'Missouri' }, { code: 'MP', name: 'Northern Mariana Islands' }, { code: 'MS', name: 'Mississippi' }, { code: 'MT', name: 'Montana' }, { code: 'NC', name: 'North Carolina' }, { code: 'ND', name: 'North Dakota' }, { code: 'NE', name: 'Nebraska' }, { code: 'NH', name: 'New Hampshire' }, { code: 'NJ', name: 'New Jersey' }, { code: 'NM', name: 'New Mexico' }, { code: 'NV', name: 'Nevada' }, { code: 'NY', name: 'New York' }, { code: 'OH', name: 'Ohio' }, { code: 'OK', name: 'Oklahoma' }, { code: 'OR', name: 'Oregon' }, { code: 'PA', name: 'Pennsylvania' }, { code: 'PR', name: 'Puerto Rico' }, { code: 'RI', name: 'Rhode Island' }, { code: 'SC', name: 'South Carolina' }, { code: 'SD', name: 'South Dakota' }, { code: 'TN', name: 'Tennessee' }, { code: 'TX', name: 'Texas' }, { code: 'UT', name: 'Utah' }, { code: 'VA', name: 'Virginia' }, { code: 'VI', name: 'Virgin Islands' }, { code: 'VT', name: 'Vermont' }, { code: 'WA', name: 'Washington' }, { code: 'WI', name: 'Wisconsin' }, { code: 'WV', name: 'West Virginia' }, { code: 'WY', name: 'Wyoming' } ] }, { code: 'UM', name: 'United States Minor Outlying Islands' }, { code: 'UY', name: 'Uruguay' }, { code: 'UZ', name: 'Uzbekistan' }, { code: 'VU', name: 'Vanuatu' }, { code: 'VE', name: 'Venezuela' }, { code: 'VN', name: 'Viet Nam' }, { code: 'VG', name: 'Virgin Islands, British' }, { code: 'VI', name: 'Virgin Islands, U.s.' }, { code: 'WF', name: 'Wallis and Futuna' }, { code: 'EH', name: 'Western Sahara' }, { code: 'YE', name: 'Yemen' }, { code: 'ZM', name: 'Zambia' }, { code: 'ZW', name: 'Zimbabwe' } ]; /***/ }), /***/ "../src/constants/index.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } Object.defineProperty(exports, "__esModule", { value: true }); __export(__webpack_require__("../src/constants/countries.ts")); /***/ }), /***/ "../src/fs-address.module.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = __webpack_require__("../node_modules/@angular/core/esm2015/core.js"); var common_1 = __webpack_require__("../node_modules/@angular/common/esm2015/common.js"); var forms_1 = __webpack_require__("../node_modules/@angular/forms/esm2015/forms.js"); var form_1 = __webpack_require__("../node_modules/@firestitch/form/package/index.js"); var common_2 = __webpack_require__("../node_modules/@firestitch/common/index.js"); var fs_address_component_1 = __webpack_require__("../src/components/fs-address/fs-address.component.ts"); var fs_address_format_component_1 = __webpack_require__("../src/components/fs-address-format/fs-address-format.component.ts"); var http_1 = __webpack_require__("../node_modules/@angular/http/esm2015/http.js"); var flex_layout_1 = __webpack_require__("../node_modules/@angular/flex-layout/esm2015/flex-layout.js"); var core_2 = __webpack_require__("../node_modules/@agm/core/index.js"); var material_1 = __webpack_require__("../node_modules/@angular/material/esm2015/material.js"); var googlemapconfig_1 = __webpack_require__("../src/classes/googlemapconfig.ts"); var FsAddressModule = (function () { function FsAddressModule() { } FsAddressModule_1 = FsAddressModule; FsAddressModule.forRoot = function () { return { ngModule: FsAddressModule_1 }; }; FsAddressModule = FsAddressModule_1 = __decorate([ core_1.NgModule({ imports: [ common_1.CommonModule, forms_1.FormsModule, form_1.FsFormModule, material_1.MatInputModule, material_1.MatSelectModule, material_1.MatAutocompleteModule, http_1.JsonpModule, form_1.FsFormModule, flex_layout_1.FlexLayoutModule, material_1.MatButtonModule, common_2.FsCommonModule, core_2.AgmCoreModule.forRoot() ], exports: [ fs_address_component_1.FsAddressComponent, fs_address_format_component_1.FsAddressFormatComponent ], entryComponents: [], declarations: [ fs_address_component_1.FsAddressComponent, fs_address_format_component_1.FsAddressFormatComponent ], providers: [ core_2.GoogleMapsAPIWrapper, core_2.MarkerManager, { provide: core_2.LAZY_MAPS_API_CONFIG, useClass: googlemapconfig_1.GoogleMapConfig } ], }) ], FsAddressModule); return FsAddressModule; var FsAddressModule_1; }()); exports.FsAddressModule = FsAddressModule; /***/ }), /***/ "../src/index.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } Object.defineProperty(exports, "__esModule", { value: true }); __export(__webpack_require__("../src/fs-address.module.ts")); __export(__webpack_require__("../src/constants/index.ts")); /***/ }), /***/ "../tools lazy recursive": /***/ (function(module, exports) { function webpackEmptyAsyncContext(req) { // Here Promise.resolve().then() is used instead of new Promise() to prevent // uncatched exception popping up in devtools return Promise.resolve().then(function() { throw new Error("Cannot find module '" + req + "'."); }); } webpackEmptyAsyncContext.keys = function() { return []; }; webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; module.exports = webpackEmptyAsyncContext; webpackEmptyAsyncContext.id = "../tools lazy recursive"; /***/ }), /***/ "../tools/assets/playground.scss": /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ "./app/app.component.html": /***/ (function(module, exports) { module.exports = "<fs-examples title=\"Address Component\">\n <fs-example title=\"Example\" componentName=\"first-example\">\n <first-example></first-example>\n </fs-example>\n</fs-examples>\n" /***/ }), /***/ "./app/app.component.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = __webpack_require__("../node_modules/@angular/core/esm2015/core.js"); var AppComponent = (function () { function AppComponent() { } AppComponent = __decorate([ core_1.Component({ selector: 'app-root', template: __webpack_require__("./app/app.component.html") }) ], AppComponent); return AppComponent; }()); exports.AppComponent = AppComponent; /***/ }), /***/ "./app/components/first-example/first-example.component.html": /***/ (function(module, exports) { module.exports = "<form (ngSubmit)=\"save(form)\" #form=\"ngForm\" fsForm>\n <fs-address [(address)]=\"address\" [(config)]=\"config\" (change)=\"change($event)\"></fs-address>\n <button mat-button type=\"submit\">Save</button>\n</form>\n\n<h2>Formatted Address</h2>\n<span *ngIf=\"parts.length\">Address:</span>\n<fs-address-format [address]=\"address\" [config]=\"{ address: { name: 'address1' } }\" (change)=\"changeFormat($event)\"></fs-address-format>\n" /***/ }), /***/ "./app/components/first-example/first-example.component.ts": /***/ (function(module, exports, __webpack_require__) { "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = __webpack_require__("../node_modules/@angular/core/esm2015/core.js"); var FirstExampleComponent = (function () { function FirstExampleComponent() { this.address = { address1: '', lat: null, lng: null }; this.parts = []; this.config = { countries: ['CA', 'US'], address2: { show: true }, address: { required: true, name: 'address1' }, city: { required: true }, region: { required: true }, zip: { required: true }, country: { required: true } }; } FirstExampleComponent.prototype.change = function (address) { console.log('Changed', address); }; FirstExampleComponent.prototype.changeFormat = function (parts) { var _this = this; setTimeout(function () { _this.parts = parts; }); }; FirstExampleComponent.prototype.save = function (form) { console.log(form); }; FirstExampleComponent = __decorate([ core_1.Component({ selector: 'first-example', template: __webpack_require__("./app/components/first-example/first-example.component.html") }), __metadata("design:paramtypes", []) ], FirstExampleComponent); return FirstExampleComponent; }()); exports.FirstExampleComponent = FirstExampleComponent; /***/ }), /***/ "./