source: trip-planner-front/node_modules/.cache/babel-webpack/85221b673ac63f76f798c4efbb149610.json@ 571e0df

Last change on this file since 571e0df was 76712b2, checked in by Ema <ema_spirova@…>, 3 years ago

search all locations by city or region

  • Property mode set to 100644
File size: 24.0 KB
Line 
1{"ast":null,"code":"import * as i0 from \"@angular/core\";\nimport * as i1 from \"../_services/city.service\";\nimport * as i2 from \"../_services/location.service\";\nimport * as i3 from \"../_services/region.service\";\nimport * as i4 from \"primeng/autocomplete\";\nimport * as i5 from \"@angular/forms\";\nimport * as i6 from \"@angular/material/input\";\nimport * as i7 from \"@angular/material/autocomplete\";\nimport * as i8 from \"@angular/common\";\nimport * as i9 from \"primeng/button\";\nimport * as i10 from \"@angular/material/core\";\n\nfunction ExploreComponent_mat_option_17_Template(rf, ctx) {\n if (rf & 1) {\n const _r4 = i0.ɵɵgetCurrentView();\n\n i0.ɵɵelementStart(0, \"mat-option\", 13);\n i0.ɵɵlistener(\"click\", function ExploreComponent_mat_option_17_Template_mat_option_click_0_listener() {\n i0.ɵɵrestoreView(_r4);\n const ctx_r3 = i0.ɵɵnextContext();\n return ctx_r3.OnHumanSelected(ctx_r3.SelectedHuman);\n });\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const human_r2 = ctx.$implicit;\n i0.ɵɵproperty(\"value\", human_r2);\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate2(\" \", human_r2.Name, \" - \", human_r2.Surname, \" \");\n }\n}\n\nexport class ExploreComponent {\n constructor(cityService, locationService, regionService) {\n this.cityService = cityService;\n this.locationService = locationService;\n this.regionService = regionService;\n this.loading = [false, false, false, false];\n this.regions = [];\n this.cities = [];\n this.filteredCountries = [];\n this.text = '';\n }\n\n ngOnInit() {\n this.cityService.getAllCities().subscribe(cities => {\n this.cities = cities;\n });\n this.regionService.getAllRegions().subscribe(regions => {\n this.regions = regions;\n });\n }\n\n search(event) {\n let filtered = [];\n let query = event.query;\n\n for (let i = 0; i < this.cities.length; i++) {\n let city = this.cities[i];\n\n if (city.name.toLowerCase().indexOf(query.toLowerCase()) == 0) {\n filtered.push(city);\n }\n }\n\n for (let i = 0; i < this.regions.length; i++) {\n let region = this.regions[i];\n\n if (region.name.toLowerCase().indexOf(query.toLowerCase()) == 0) {\n filtered.push(region);\n }\n }\n\n this.filteredCountries = filtered;\n }\n\n load(index) {\n this.loading[index] = true;\n setTimeout(() => this.loading[index] = false, 1000);\n }\n\n OnHumanSelected(option) {\n console.log(option.value);\n }\n\n}\n\nExploreComponent.ɵfac = function ExploreComponent_Factory(t) {\n return new (t || ExploreComponent)(i0.ɵɵdirectiveInject(i1.CityService), i0.ɵɵdirectiveInject(i2.LocationService), i0.ɵɵdirectiveInject(i3.RegionService));\n};\n\nExploreComponent.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: ExploreComponent,\n selectors: [[\"app-explore\"]],\n decls: 21,\n vars: 11,\n consts: [[\"href\", \"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css\", \"rel\", \"stylesheet\", \"integrity\", \"sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x\", \"crossorigin\", \"anonymous\"], [\"lang\", \"en\"], [\"charset\", \"utf-8\"], [1, \"navbar\", \"navbar-expand-sm\"], [1, \"navbar-brand\"], [1, \"navbar-nav\", \"ml-auto\"], [1, \"nav-item\"], [\"field\", \"name\", 3, \"ngModel\", \"suggestions\", \"minLength\", \"ngModelChange\", \"completeMethod\", \"optionSelected\"], [\"matInput\", \"\", \"placeholder\", \"Human\", 3, \"ngModel\", \"formControl\", \"matAutocomplete\", \"ngModelChange\"], [3, \"displayWith\"], [\"auto\", \"matAutocomplete\"], [3, \"value\", \"click\", 4, \"ngFor\", \"ngForOf\"], [\"label\", \"Search\", \"icon\", \"pi pi-search\", \"id\", \"button\", 3, \"loading\", \"click\"], [3, \"value\", \"click\"]],\n template: function ExploreComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"link\", 0);\n i0.ɵɵelementStart(1, \"html\", 1);\n i0.ɵɵelementStart(2, \"head\");\n i0.ɵɵelement(3, \"meta\", 2);\n i0.ɵɵelementStart(4, \"title\");\n i0.ɵɵtext(5, \"Explore\");\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(6, \"body\");\n i0.ɵɵelementStart(7, \"header\");\n i0.ɵɵelementStart(8, \"nav\", 3);\n i0.ɵɵelementStart(9, \"strong\", 4);\n i0.ɵɵtext(10, \"Trivia Trip\");\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(11, \"ul\", 5);\n i0.ɵɵelementStart(12, \"li\", 6);\n i0.ɵɵelementStart(13, \"p-autoComplete\", 7);\n i0.ɵɵlistener(\"ngModelChange\", function ExploreComponent_Template_p_autoComplete_ngModelChange_13_listener($event) {\n return ctx.text = $event;\n })(\"completeMethod\", function ExploreComponent_Template_p_autoComplete_completeMethod_13_listener($event) {\n return ctx.search($event);\n })(\"optionSelected\", function ExploreComponent_Template_p_autoComplete_optionSelected_13_listener($event) {\n return ctx.OnHumanSelected($event);\n });\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(14, \"input\", 8);\n i0.ɵɵlistener(\"ngModelChange\", function ExploreComponent_Template_input_ngModelChange_14_listener($event) {\n return ctx.SelectedHuman = $event;\n });\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(15, \"mat-autocomplete\", 9, 10);\n i0.ɵɵtemplate(17, ExploreComponent_mat_option_17_Template, 2, 3, \"mat-option\", 11);\n i0.ɵɵpipe(18, \"async\");\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(19, \"p-button\", 12);\n i0.ɵɵlistener(\"click\", function ExploreComponent_Template_p_button_click_19_listener() {\n return ctx.load(0);\n });\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelement(20, \"li\", 6);\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const _r0 = i0.ɵɵreference(16);\n\n i0.ɵɵadvance(13);\n i0.ɵɵproperty(\"ngModel\", ctx.text)(\"suggestions\", ctx.filteredCountries)(\"minLength\", 1);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngModel\", ctx.SelectedHuman)(\"formControl\", ctx.MyControl)(\"matAutocomplete\", _r0);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"displayWith\", ctx.AutoCompleteDisplay);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngForOf\", i0.ɵɵpipeBind1(18, 9, ctx.arrFilteredHumans));\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"loading\", ctx.loading[0]);\n }\n },\n directives: [i4.AutoComplete, i5.NgControlStatus, i5.NgModel, i6.MatInput, i5.DefaultValueAccessor, i7.MatAutocompleteTrigger, i5.FormControlDirective, i7.MatAutocomplete, i8.NgForOf, i9.Button, i10.MatOption],\n pipes: [i8.AsyncPipe],\n styles: [\"#button[_ngcontent-%COMP%]{\\r\\n margin-left: 20px;\\r\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV4cGxvcmUuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtJQUNJLGlCQUFpQjtBQUNyQiIsImZpbGUiOiJleHBsb3JlLmNvbXBvbmVudC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIjYnV0dG9ue1xyXG4gICAgbWFyZ2luLWxlZnQ6IDIwcHg7XHJcbn0iXX0= */\"]\n});","map":{"version":3,"sources":["C:/Users/DELL/Desktop/bachelor-thesis/trip-planner-front/src/app/explore/explore.component.ts"],"names":["i0","i1","i2","i3","i4","i5","i6","i7","i8","i9","i10","ExploreComponent_mat_option_17_Template","rf","ctx","_r4","ɵɵgetCurrentView","ɵɵelementStart","ɵɵlistener","ExploreComponent_mat_option_17_Template_mat_option_click_0_listener","ɵɵrestoreView","ctx_r3","ɵɵnextContext","OnHumanSelected","SelectedHuman","ɵɵtext","ɵɵelementEnd","human_r2","$implicit","ɵɵproperty","ɵɵadvance","ɵɵtextInterpolate2","Name","Surname","ExploreComponent","constructor","cityService","locationService","regionService","loading","regions","cities","filteredCountries","text","ngOnInit","getAllCities","subscribe","getAllRegions","search","event","filtered","query","i","length","city","name","toLowerCase","indexOf","push","region","load","index","setTimeout","option","console","log","value","ɵfac","ExploreComponent_Factory","t","ɵɵdirectiveInject","CityService","LocationService","RegionService","ɵcmp","ɵɵdefineComponent","type","selectors","decls","vars","consts","template","ExploreComponent_Template","ɵɵelement","ExploreComponent_Template_p_autoComplete_ngModelChange_13_listener","$event","ExploreComponent_Template_p_autoComplete_completeMethod_13_listener","ExploreComponent_Template_p_autoComplete_optionSelected_13_listener","ExploreComponent_Template_input_ngModelChange_14_listener","ɵɵtemplate","ɵɵpipe","ExploreComponent_Template_p_button_click_19_listener","_r0","ɵɵreference","MyControl","AutoCompleteDisplay","ɵɵpipeBind1","arrFilteredHumans","directives","AutoComplete","NgControlStatus","NgModel","MatInput","DefaultValueAccessor","MatAutocompleteTrigger","FormControlDirective","MatAutocomplete","NgForOf","Button","MatOption","pipes","AsyncPipe","styles"],"mappings":"AAAA,OAAO,KAAKA,EAAZ,MAAoB,eAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,2BAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,+BAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,6BAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,sBAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,gBAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,yBAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,gCAApB;AACA,OAAO,KAAKC,EAAZ,MAAoB,iBAApB;AACA,OAAO,KAAKC,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DxK;AAiDwLC,EAAAA,MAAM,EAAE,CAAC,+WAAD;AAjDhM,CAArB,CAAtC","sourcesContent":["import * as i0 from \"@angular/core\";\r\nimport * as i1 from \"../_services/city.service\";\r\nimport * as i2 from \"../_services/location.service\";\r\nimport * as i3 from \"../_services/region.service\";\r\nimport * as i4 from \"primeng/autocomplete\";\r\nimport * as i5 from \"@angular/forms\";\r\nimport * as i6 from \"@angular/material/input\";\r\nimport * as i7 from \"@angular/material/autocomplete\";\r\nimport * as i8 from \"@angular/common\";\r\nimport * as i9 from \"primeng/button\";\r\nimport * as i10 from \"@angular/material/core\";\r\nfunction ExploreComponent_mat_option_17_Template(rf, ctx) { if (rf & 1) {\r\n const _r4 = i0.ɵɵgetCurrentView();\r\n i0.ɵɵelementStart(0, \"mat-option\", 13);\r\n i0.ɵɵlistener(\"click\", function ExploreComponent_mat_option_17_Template_mat_option_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.OnHumanSelected(ctx_r3.SelectedHuman); });\r\n i0.ɵɵtext(1);\r\n i0.ɵɵelementEnd();\r\n} if (rf & 2) {\r\n const human_r2 = ctx.$implicit;\r\n i0.ɵɵproperty(\"value\", human_r2);\r\n i0.ɵɵadvance(1);\r\n i0.ɵɵtextInterpolate2(\" \", human_r2.Name, \" - \", human_r2.Surname, \" \");\r\n} }\r\nexport class ExploreComponent {\r\n constructor(cityService, locationService, regionService) {\r\n this.cityService = cityService;\r\n this.locationService = locationService;\r\n this.regionService = regionService;\r\n this.loading = [false, false, false, false];\r\n this.regions = [];\r\n this.cities = [];\r\n this.filteredCountries = [];\r\n this.text = '';\r\n }\r\n ngOnInit() {\r\n this.cityService.getAllCities().subscribe(cities => {\r\n this.cities = cities;\r\n });\r\n this.regionService.getAllRegions().subscribe(regions => {\r\n this.regions = regions;\r\n });\r\n }\r\n search(event) {\r\n let filtered = [];\r\n let query = event.query;\r\n for (let i = 0; i < this.cities.length; i++) {\r\n let city = this.cities[i];\r\n if (city.name.toLowerCase().indexOf(query.toLowerCase()) == 0) {\r\n filtered.push(city);\r\n }\r\n }\r\n for (let i = 0; i < this.regions.length; i++) {\r\n let region = this.regions[i];\r\n if (region.name.toLowerCase().indexOf(query.toLowerCase()) == 0) {\r\n filtered.push(region);\r\n }\r\n }\r\n this.filteredCountries = filtered;\r\n }\r\n load(index) {\r\n this.loading[index] = true;\r\n setTimeout(() => this.loading[index] = false, 1000);\r\n }\r\n OnHumanSelected(option) {\r\n console.log(option.value);\r\n }\r\n}\r\nExploreComponent.ɵfac = function ExploreComponent_Factory(t) { return new (t || ExploreComponent)(i0.ɵɵdirectiveInject(i1.CityService), i0.ɵɵdirectiveInject(i2.LocationService), i0.ɵɵdirectiveInject(i3.RegionService)); };\r\nExploreComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ExploreComponent, selectors: [[\"app-explore\"]], decls: 21, vars: 11, consts: [[\"href\", \"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css\", \"rel\", \"stylesheet\", \"integrity\", \"sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x\", \"crossorigin\", \"anonymous\"], [\"lang\", \"en\"], [\"charset\", \"utf-8\"], [1, \"navbar\", \"navbar-expand-sm\"], [1, \"navbar-brand\"], [1, \"navbar-nav\", \"ml-auto\"], [1, \"nav-item\"], [\"field\", \"name\", 3, \"ngModel\", \"suggestions\", \"minLength\", \"ngModelChange\", \"completeMethod\", \"optionSelected\"], [\"matInput\", \"\", \"placeholder\", \"Human\", 3, \"ngModel\", \"formControl\", \"matAutocomplete\", \"ngModelChange\"], [3, \"displayWith\"], [\"auto\", \"matAutocomplete\"], [3, \"value\", \"click\", 4, \"ngFor\", \"ngForOf\"], [\"label\", \"Search\", \"icon\", \"pi pi-search\", \"id\", \"button\", 3, \"loading\", \"click\"], [3, \"value\", \"click\"]], template: function ExploreComponent_Template(rf, ctx) { if (rf & 1) {\r\n i0.ɵɵelement(0, \"link\", 0);\r\n i0.ɵɵelementStart(1, \"html\", 1);\r\n i0.ɵɵelementStart(2, \"head\");\r\n i0.ɵɵelement(3, \"meta\", 2);\r\n i0.ɵɵelementStart(4, \"title\");\r\n i0.ɵɵtext(5, \"Explore\");\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementStart(6, \"body\");\r\n i0.ɵɵelementStart(7, \"header\");\r\n i0.ɵɵelementStart(8, \"nav\", 3);\r\n i0.ɵɵelementStart(9, \"strong\", 4);\r\n i0.ɵɵtext(10, \"Trivia Trip\");\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementStart(11, \"ul\", 5);\r\n i0.ɵɵelementStart(12, \"li\", 6);\r\n i0.ɵɵelementStart(13, \"p-autoComplete\", 7);\r\n i0.ɵɵlistener(\"ngModelChange\", function ExploreComponent_Template_p_autoComplete_ngModelChange_13_listener($event) { return ctx.text = $event; })(\"completeMethod\", function ExploreComponent_Template_p_autoComplete_completeMethod_13_listener($event) { return ctx.search($event); })(\"optionSelected\", function ExploreComponent_Template_p_autoComplete_optionSelected_13_listener($event) { return ctx.OnHumanSelected($event); });\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementStart(14, \"input\", 8);\r\n i0.ɵɵlistener(\"ngModelChange\", function ExploreComponent_Template_input_ngModelChange_14_listener($event) { return ctx.SelectedHuman = $event; });\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementStart(15, \"mat-autocomplete\", 9, 10);\r\n i0.ɵɵtemplate(17, ExploreComponent_mat_option_17_Template, 2, 3, \"mat-option\", 11);\r\n i0.ɵɵpipe(18, \"async\");\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementStart(19, \"p-button\", 12);\r\n i0.ɵɵlistener(\"click\", function ExploreComponent_Template_p_button_click_19_listener() { return ctx.load(0); });\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelement(20, \"li\", 6);\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementEnd();\r\n i0.ɵɵelementEnd();\r\n } if (rf & 2) {\r\n const _r0 = i0.ɵɵreference(16);\r\n i0.ɵɵadvance(13);\r\n i0.ɵɵproperty(\"ngModel\", ctx.text)(\"suggestions\", ctx.filteredCountries)(\"minLength\", 1);\r\n i0.ɵɵadvance(1);\r\n i0.ɵɵproperty(\"ngModel\", ctx.SelectedHuman)(\"formControl\", ctx.MyControl)(\"matAutocomplete\", _r0);\r\n i0.ɵɵadvance(1);\r\n i0.ɵɵproperty(\"displayWith\", ctx.AutoCompleteDisplay);\r\n i0.ɵɵadvance(2);\r\n i0.ɵɵproperty(\"ngForOf\", i0.ɵɵpipeBind1(18, 9, ctx.arrFilteredHumans));\r\n i0.ɵɵadvance(2);\r\n i0.ɵɵproperty(\"loading\", ctx.loading[0]);\r\n } }, directives: [i4.AutoComplete, i5.NgControlStatus, i5.NgModel, i6.MatInput, i5.DefaultValueAccessor, i7.MatAutocompleteTrigger, i5.FormControlDirective, i7.MatAutocomplete, i8.NgForOf, i9.Button, i10.MatOption], pipes: [i8.AsyncPipe], styles: [\"#button[_ngcontent-%COMP%]{\\r\\n margin-left: 20px;\\r\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV4cGxvcmUuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtJQUNJLGlCQUFpQjtBQUNyQiIsImZpbGUiOiJleHBsb3JlLmNvbXBvbmVudC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIjYnV0dG9ue1xyXG4gICAgbWFyZ2luLWxlZnQ6IDIwcHg7XHJcbn0iXX0= */\"] });\r\n"]},"metadata":{},"sourceType":"module"}
Note: See TracBrowser for help on using the repository browser.