├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── dist ├── index.d.ts ├── index.js ├── index.js.map └── lib │ ├── algolia-facets │ ├── algolia-facets.component.d.ts │ ├── algolia-facets.component.js │ └── algolia-facets.component.js.map │ ├── algolia-pagination │ ├── algolia-pagination.component.d.ts │ ├── algolia-pagination.component.js │ └── algolia-pagination.component.js.map │ ├── algolia-results │ ├── algolia-results.component.d.ts │ ├── algolia-results.component.js │ └── algolia-results.component.js.map │ ├── algolia-search │ ├── algolia-search.component.d.ts │ ├── algolia-search.component.js │ └── algolia-search.component.js.map │ ├── algolia-sort │ ├── algolia-sort.component.d.ts │ ├── algolia-sort.component.js │ └── algolia-sort.component.js.map │ ├── algolia-stars │ ├── algolia-stars.component.d.ts │ ├── algolia-stars.component.js │ └── algolia-stars.component.js.map │ ├── algolia-stats │ ├── algolia-stats.component.d.ts │ ├── algolia-stats.component.js │ └── algolia-stats.component.js.map │ ├── algolia.module.d.ts │ ├── algolia.module.js │ ├── algolia.module.js.map │ ├── algolia.service.d.ts │ ├── algolia.service.js │ ├── algolia.service.js.map │ ├── index.d.ts │ ├── index.js │ ├── index.js.map │ ├── map-to-iterable.pipe.d.ts │ ├── map-to-iterable.pipe.js │ └── map-to-iterable.pipe.js.map ├── package.json ├── src ├── index.ts └── lib │ ├── algolia-facets │ └── algolia-facets.component.ts │ ├── algolia-pagination │ └── algolia-pagination.component.ts │ ├── algolia-results │ └── algolia-results.component.ts │ ├── algolia-search │ └── algolia-search.component.ts │ ├── algolia-sort │ └── algolia-sort.component.ts │ ├── algolia-stars │ └── algolia-stars.component.ts │ ├── algolia-stats │ └── algolia-stats.component.ts │ ├── algolia.module.ts │ ├── algolia.service.ts │ ├── index.ts │ └── map-to-iterable.pipe.ts ├── tsconfig.json ├── typings.d.ts └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | max_line_length = 0 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /tmp 5 | #dist/ 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | *.launch 16 | .settings/ 17 | 18 | # misc 19 | /.sass-cache 20 | /connect.lock 21 | /coverage/* 22 | /libpeerconnection.log 23 | npm-debug.log 24 | testem.log 25 | /typings 26 | 27 | # e2e 28 | /e2e/*.js 29 | /e2e/*.map 30 | 31 | #System Files 32 | .DS_Store 33 | Thumbs.db 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Olivier Leplus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Algolia components library for Angular 2 | 3 | Library of components for Algolia on angular. 4 | 5 |

WARNING: THIS IS A WIP

6 | 7 | So : 8 | * Components may change, appear from nowhere or disapear in a black hole (it happens) 9 | * Documentation may not be accurate and no up to date 10 | 11 | ### Installation 12 | ```sh 13 | npm install -save @tagazok/algolia-angular-components 14 | ``` 15 | 16 | ### Usage 17 | Import the AlgoliaModule and the AlgoliaService in your app 18 | ```javascript 19 | import { AlgoliaModule, AlgoliaService } from '@tagazok/algolia-angular-components' 20 | ``` 21 | 22 | Load the module into your app passing 23 | 24 | ```javascript 25 | @NgModule({ 26 | ..., 27 | imports: [ 28 | AlgoliaModule.forRoot({appId: 'YOUR_APP_ID', apiKey: 'YOUR_APP_KEY'}), 29 | ], 30 | ... 31 | }) 32 | export class AppModule { } 33 | ``` 34 | You are now ready to use the components in your app \o/ 35 | 36 | ### List of components 37 | 38 | #### Search 39 | Displays a search bar that triggers a live search 40 | ```html 41 | 42 | ``` 43 | Parameters : 44 | * index : The algolia index 45 | * hitsPerPage : The maximum number of results you want the research to return (default is 12) 46 | * placeHolder : The placeholder of the input (default is "Search") 47 | 48 | 49 | #### Results 50 | Displays the results of your research in a custom template 51 | ```html 52 | 53 | 56 | 57 | ``` 58 | 59 | ### Facets 60 | Displays facet and manage filters on click. 61 | ```html 62 | 63 | 68 | 69 | ``` 70 | Parameters : 71 | * attribute : The attribute of which you want the facet 72 | * label : The label of the List (may be removed in future release... not sure yet) 73 | * limit : The maximum number of results per facets 74 | * selectedcssclass : The class to apply when a facet value is selected for filtering the query 75 | 76 | 77 | #### Stats 78 | Simply displays the stats of the result of the research 79 | ```html 80 | 81 | ``` 82 | 83 | 84 | #### Sort (early WIP) 85 | Allows you to specify how you want your result to be sorted. 86 | ```html 87 | 88 | ``` 89 | Parameters : 90 | * label : The placeholder/title of the search field (will be removed in future release as md- has been removed) 91 | * indices : List of items to sort with. Exemple : 92 | ```javascript 93 | const sortIndices = [ 94 | {value: 'ikea', label: 'Featured'}, 95 | {value: 'ikea_price_asc', label: 'Price asc.'}, 96 | {value: 'ikea_price_desc', label: 'Price desc.'} 97 | ]; 98 | ``` 99 | 100 | #### Pagination 101 | Add pagination to navigate in your results 102 | ```html 103 | 104 | ``` 105 | Parameters : 106 | * padding : See +/- n page numbers (default is 3 if not specified) 107 | 108 | #### Stars 109 | Display Stars, usefull for ratings 110 | ```html 111 | 112 | ``` 113 | Parameters : 114 | min: The minimum value (default is 0); 115 | max: The maximum value to display empty stars 116 | value : The number of plain stars 117 | 118 | TODO : 119 | * See what we can do with css customisation 120 | * [DONE] Better algolia-result customisation (row / card / column views) 121 | * manage OR request for filters. 122 | * In algolia-stats. Add attribute to choose which stat to display (# and time) 123 | * Add prev / new arrow on pagination 124 | * "Filter" by component 125 | * Automatic routes change when whanging page or filter, etc 126 | 127 | ## Example 128 | This app has been built with the components of this library with the idea of Algolia e-commerce demo app 129 | *To be published very soon on github :)* 130 |

131 | Screenshot 132 | View on Chrome (see Ipad and Nexus 5X screenshots) 133 |

134 | 135 | 136 | ## Thanks 137 | Created using https://github.com/manekinekko/angular-library-starter 138 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /dist/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './lib'; 2 | -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | export * from './lib'; 2 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/index.js.map -------------------------------------------------------------------------------- /dist/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"} -------------------------------------------------------------------------------- /dist/lib/algolia-facets/algolia-facets.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit, TemplateRef, ElementRef, Renderer } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | export declare class AlgoliaFacetsComponent implements OnInit { 4 | private as; 5 | attribute: string; 6 | label: string; 7 | limit: number; 8 | selectedcssclass: string; 9 | itemTemplate: TemplateRef; 10 | constructor(as: AlgoliaService, elementRef: ElementRef, renderer: Renderer); 11 | ngOnInit(): void; 12 | isFacetActive(value: any): boolean; 13 | updateSearch(facet: any): void; 14 | } 15 | -------------------------------------------------------------------------------- /dist/lib/algolia-facets/algolia-facets.component.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Component, Input, ContentChild, TemplateRef, ElementRef, Renderer } from '@angular/core'; 11 | import { AlgoliaService } from '../algolia.service'; 12 | export let AlgoliaFacetsComponent = class AlgoliaFacetsComponent { 13 | constructor(as, elementRef, renderer) { 14 | this.as = as; 15 | // renderer.listen(elementRef.nativeElement, 'click', (event) => { 16 | // debugger; 17 | // }); 18 | } 19 | ngOnInit() { 20 | this.as.addFacet(this.attribute); 21 | if (this.limit) { 22 | this.as.parameters.maxValuesPerFacet = this.limit; 23 | } 24 | } 25 | isFacetActive(value) { 26 | return (this.as.facetFilters[this.attribute] && this.as.facetFilters[this.attribute].includes(value)) ? true : false; 27 | } 28 | ; 29 | updateSearch(facet) { 30 | if ((this.as.facetFilters[this.attribute] === undefined) || !this.as.facetFilters[this.attribute].includes(facet.key)) { 31 | this.as.addFacetFilter(this.attribute, facet); 32 | } 33 | else { 34 | this.as.removeFacetFilter(this.attribute, facet); 35 | } 36 | } 37 | }; 38 | __decorate([ 39 | Input(), 40 | __metadata('design:type', String) 41 | ], AlgoliaFacetsComponent.prototype, "attribute", void 0); 42 | __decorate([ 43 | Input(), 44 | __metadata('design:type', String) 45 | ], AlgoliaFacetsComponent.prototype, "label", void 0); 46 | __decorate([ 47 | Input(), 48 | __metadata('design:type', Number) 49 | ], AlgoliaFacetsComponent.prototype, "limit", void 0); 50 | __decorate([ 51 | Input(), 52 | __metadata('design:type', String) 53 | ], AlgoliaFacetsComponent.prototype, "selectedcssclass", void 0); 54 | __decorate([ 55 | ContentChild(TemplateRef), 56 | __metadata('design:type', TemplateRef) 57 | ], AlgoliaFacetsComponent.prototype, "itemTemplate", void 0); 58 | AlgoliaFacetsComponent = __decorate([ 59 | Component({ 60 | selector: 'app-algolia-facets', 61 | template: ` 62 |
63 |

{{label}}

64 |
    65 |
  • 66 |
    67 | 68 |
    69 |
  • 70 |
71 |
72 | `, 73 | styles: [` 74 | :host { 75 | display: block; 76 | clear: both; 77 | } 78 | .facets { 79 | list-style: none; 80 | padding: 0; 81 | margin: 0; 82 | line-height: 1.42857143; 83 | } 84 | .facet-item { 85 | cursor: pointer; 86 | } 87 | `] 88 | }), 89 | __metadata('design:paramtypes', [AlgoliaService, ElementRef, Renderer]) 90 | ], AlgoliaFacetsComponent); 91 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia-facets/algolia-facets.component.js.map -------------------------------------------------------------------------------- /dist/lib/algolia-facets/algolia-facets.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia-facets.component.js","sourceRoot":"","sources":["../../src/lib/algolia-facets/algolia-facets.component.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe;OAClG,EAAE,cAAc,EAAE,MAAM,oBAAoB;AAgCnD;IAQE,YAAoB,EAAkB,EAAE,UAAsB,EAAE,QAAkB;QAA9D,OAAE,GAAF,EAAE,CAAgB;QACpC,kEAAkE;QAClE,cAAc;QACd,MAAM;IACP,CAAC;IAEF,QAAQ;QACN,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACf,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;QACpD,CAAC;IACH,CAAC;IAED,aAAa,CAAC,KAAK;QACjB,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;IACvH,CAAC;;IAED,YAAY,CAAC,KAAK;QAChB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACtH,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;AACH,CAAC;AA/BC;IAAC,KAAK,EAAE;;yDAAA;AACR;IAAC,KAAK,EAAE;;qDAAA;AACR;IAAC,KAAK,EAAE;;qDAAA;AACR;IAAC,KAAK,EAAE;;gEAAA;AAER;IAAC,YAAY,CAAC,WAAW,CAAC;;4DAAA;AApC5B;IAAC,SAAS,CAAC;QACT,QAAQ,EAAE,oBAAoB;QAC9B,QAAQ,EAAE;;;;;;;;;;;GAWT;QACD,MAAM,EAAE,CAAC;;;;;;;;;;;;;;GAcR,CAAC;KACH,CAAC;;0BAAA;AAiCD"} -------------------------------------------------------------------------------- /dist/lib/algolia-pagination/algolia-pagination.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | export declare class AlgoliaPaginationComponent implements OnInit { 4 | private as; 5 | padding: number; 6 | range: Array; 7 | nbDisplayPages: number; 8 | constructor(as: AlgoliaService); 9 | buildRange(): void; 10 | buildNbDisplayedPages(): void; 11 | buildPaddingLeft(): any; 12 | ngOnInit(): void; 13 | changePage(page: any): void; 14 | } 15 | -------------------------------------------------------------------------------- /dist/lib/algolia-pagination/algolia-pagination.component.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Component, Input } from '@angular/core'; 11 | import { AlgoliaService } from '../algolia.service'; 12 | export let AlgoliaPaginationComponent = class AlgoliaPaginationComponent { 13 | constructor(as) { 14 | this.as = as; 15 | this.padding = 3; 16 | this.range = []; 17 | this.buildRange(); 18 | } 19 | buildRange() { 20 | this.buildNbDisplayedPages(); 21 | let paddingLeft = this.buildPaddingLeft(); 22 | let paddingRight = this.nbDisplayPages - paddingLeft; 23 | let start = this.as.content.page - paddingLeft + 1; 24 | let end = this.as.content.page + paddingRight + 1; 25 | this.range = Array.from({ length: (end - start) }, (v, k) => k + start); 26 | } 27 | buildNbDisplayedPages() { 28 | this.nbDisplayPages = Math.min(2 * this.padding + 1, this.as.content.nbPages); 29 | } 30 | buildPaddingLeft() { 31 | if (this.as.content.page <= this.padding) { 32 | return this.as.content.page; 33 | } 34 | if (this.as.content.page >= this.as.content.nbPages - this.padding) { 35 | return this.nbDisplayPages - (this.as.content.nbPages - this.as.content.page); 36 | } 37 | return this.padding; 38 | } 39 | ngOnInit() { 40 | this.as.resultUpdated.subscribe(() => this.buildRange()); 41 | } 42 | changePage(page) { 43 | this.as.parameters.page = page; 44 | this.as.search(); 45 | } 46 | }; 47 | __decorate([ 48 | Input(), 49 | __metadata('design:type', Number) 50 | ], AlgoliaPaginationComponent.prototype, "padding", void 0); 51 | AlgoliaPaginationComponent = __decorate([ 52 | Component({ 53 | selector: 'app-algolia-pagination', 54 | template: ` 55 |
    56 |
  • 57 |
    {{i}}
    58 |
  • 59 |
60 | `, 61 | styles: [` 62 | .pagination { 63 | list-style-type: none; 64 | } 65 | .pagination li { 66 | list-style-type: none; 67 | display: inline-block; 68 | border-radius: 2px; 69 | text-align: center; 70 | vertical-align: top; 71 | height: 30px; 72 | width: 30px; 73 | cursor: pointer; 74 | } 75 | .pagination li div { 76 | width: 100%; 77 | height: 100%; 78 | 79 | height: 100%; 80 | box-sizing: border-box; 81 | max-height: 100%; 82 | display: flex; 83 | flex-direction: row; 84 | justify-content: center; 85 | align-items: center; 86 | align-content: center; 87 | } 88 | 89 | .pagination li.active { 90 | background-color: #20cf7d; 91 | } 92 | `] 93 | }), 94 | __metadata('design:paramtypes', [AlgoliaService]) 95 | ], AlgoliaPaginationComponent); 96 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia-pagination/algolia-pagination.component.js.map -------------------------------------------------------------------------------- /dist/lib/algolia-pagination/algolia-pagination.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia-pagination.component.js","sourceRoot":"","sources":["../../src/lib/algolia-pagination/algolia-pagination.component.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,MAAM,eAAe;OACjD,EAAE,cAAc,EAAE,MAAM,oBAAoB;AA4CnD;IAME,YAAoB,EAAkB;QAAlB,OAAE,GAAF,EAAE,CAAgB;QAL7B,YAAO,GAAW,CAAC,CAAC;QAE7B,UAAK,GAAkB,EAAE,CAAC;QAIxB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,UAAU;QACR,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,WAAW,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1C,IAAI,YAAY,GAAG,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;QACrD,IAAI,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,WAAW,GAAG,CAAC,CAAC;QACnD,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,YAAY,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,EAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;IACxE,CAAC;IAED,qBAAqB;QACnB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC;IAED,gBAAgB;QACd,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9B,CAAC;QAED,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YACnE,MAAM,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChF,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAC7B,MAAM,IAAI,CAAC,UAAU,EAAE,CACxB,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,IAAI;QACb,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;IACnB,CAAC;AACH,CAAC;AA5CC;IAAC,KAAK,EAAE;;2DAAA;AA3CV;IAAC,SAAS,CAAC;QACT,QAAQ,EAAE,wBAAwB;QAClC,QAAQ,EAAE;;;;;;GAMT;QACD,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BR,CAAC;KACH,CAAC;;8BAAA;AA8CD"} -------------------------------------------------------------------------------- /dist/lib/algolia-results/algolia-results.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit, TemplateRef } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | export declare class AlgoliaResultsComponent implements OnInit { 4 | private as; 5 | itemTemplate: TemplateRef; 6 | constructor(as: AlgoliaService); 7 | ngOnInit(): void; 8 | } 9 | -------------------------------------------------------------------------------- /dist/lib/algolia-results/algolia-results.component.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Component, ContentChild, TemplateRef } from '@angular/core'; 11 | import { AlgoliaService } from '../algolia.service'; 12 | export let AlgoliaResultsComponent = class AlgoliaResultsComponent { 13 | constructor(as) { 14 | this.as = as; 15 | } 16 | ngOnInit() { 17 | } 18 | }; 19 | __decorate([ 20 | ContentChild(TemplateRef), 21 | __metadata('design:type', TemplateRef) 22 | ], AlgoliaResultsComponent.prototype, "itemTemplate", void 0); 23 | AlgoliaResultsComponent = __decorate([ 24 | Component({ 25 | selector: 'app-algolia-results', 26 | template: ` 27 | 28 | `, 29 | styles: [` 30 | .my-item { 31 | padding: .5%; 32 | width: 100%; 33 | } 34 | `] 35 | }), 36 | __metadata('design:paramtypes', [AlgoliaService]) 37 | ], AlgoliaResultsComponent); 38 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia-results/algolia-results.component.js.map -------------------------------------------------------------------------------- /dist/lib/algolia-results/algolia-results.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia-results.component.js","sourceRoot":"","sources":["../../src/lib/algolia-results/algolia-results.component.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,SAAS,EAAiB,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe;OAC5E,EAAE,cAAc,EAAE,MAAM,oBAAoB;AAcnD;IAIE,YAAoB,EAAkB;QAAlB,OAAE,GAAF,EAAE,CAAgB;IAAI,CAAC;IAE3C,QAAQ;IAER,CAAC;AACH,CAAC;AAPC;IAAC,YAAY,CAAC,WAAW,CAAC;;6DAAA;AAd5B;IAAC,SAAS,CAAC;QACT,QAAQ,EAAE,qBAAqB;QAC/B,QAAQ,EAAE;;GAET;QACD,MAAM,EAAE,CAAC;;;;;CAKV,CAAC;KACD,CAAC;;2BAAA;AAUD"} -------------------------------------------------------------------------------- /dist/lib/algolia-search/algolia-search.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | export declare class AlgoliaSearchComponent implements OnInit { 4 | private as; 5 | index: string; 6 | hitsPerPage: number; 7 | placeHolder: string; 8 | constructor(as: AlgoliaService); 9 | ngOnInit(): void; 10 | onKey(str: string): void; 11 | } 12 | -------------------------------------------------------------------------------- /dist/lib/algolia-search/algolia-search.component.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Component, Input } from '@angular/core'; 11 | import { AlgoliaService } from '../algolia.service'; 12 | export let AlgoliaSearchComponent = class AlgoliaSearchComponent { 13 | constructor(as) { 14 | this.as = as; 15 | this.hitsPerPage = 12; 16 | this.placeHolder = "Search"; 17 | } 18 | ngOnInit() { 19 | this.as.setIndex(this.index); 20 | this.as.parameters.hitsPerPage = this.hitsPerPage; 21 | this.as.search(); 22 | } 23 | onKey(str) { 24 | this.as.query = str; 25 | this.as.search(); 26 | } 27 | }; 28 | __decorate([ 29 | Input(), 30 | __metadata('design:type', String) 31 | ], AlgoliaSearchComponent.prototype, "index", void 0); 32 | __decorate([ 33 | Input(), 34 | __metadata('design:type', Number) 35 | ], AlgoliaSearchComponent.prototype, "hitsPerPage", void 0); 36 | __decorate([ 37 | Input(), 38 | __metadata('design:type', String) 39 | ], AlgoliaSearchComponent.prototype, "placeHolder", void 0); 40 | AlgoliaSearchComponent = __decorate([ 41 | Component({ 42 | selector: 'app-algolia-search', 43 | template: ` 44 |
45 | 46 |
47 | `, 48 | styles: [` 49 | input { 50 | width: 100%; 51 | padding: 10px; 52 | font-size: 1.2em; 53 | box-sizing: border-box; 54 | }`] 55 | }), 56 | __metadata('design:paramtypes', [AlgoliaService]) 57 | ], AlgoliaSearchComponent); 58 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia-search/algolia-search.component.js.map -------------------------------------------------------------------------------- /dist/lib/algolia-search/algolia-search.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia-search.component.js","sourceRoot":"","sources":["../../src/lib/algolia-search/algolia-search.component.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,SAAS,EAAU,KAAK,EAAwB,MAAM,eAAe;OACvE,EAAE,cAAc,EAAE,MAAM,oBAAoB;AAiBnD;IAKE,YAAoB,EAAkB;QAAlB,OAAE,GAAF,EAAE,CAAgB;QAH7B,gBAAW,GAAW,EAAE,CAAC;QACzB,gBAAW,GAAW,QAAQ,CAAC;IAGxC,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAClD,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,GAAW;QACf,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;IACnB,CAAC;AACH,CAAC;AAjBC;IAAC,KAAK,EAAE;;qDAAA;AACR;IAAC,KAAK,EAAE;;2DAAA;AACR;IAAC,KAAK,EAAE;;2DAAA;AAlBV;IAAC,SAAS,CAAC;QACT,QAAQ,EAAE,oBAAoB;QAC9B,QAAQ,EAAE;;;;GAIT;QACD,MAAM,EAAE,CAAC;;;;;;MAML,CAAC;KACN,CAAC;;0BAAA;AAmBD"} -------------------------------------------------------------------------------- /dist/lib/algolia-sort/algolia-sort.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | export declare class AlgoliaSortComponent implements OnInit { 3 | indices: any[]; 4 | label: string; 5 | constructor(); 6 | ngOnInit(): void; 7 | } 8 | -------------------------------------------------------------------------------- /dist/lib/algolia-sort/algolia-sort.component.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Component, Input } from '@angular/core'; 11 | export let AlgoliaSortComponent = class AlgoliaSortComponent { 12 | constructor() { 13 | this.indices = []; 14 | this.label = ''; 15 | } 16 | ngOnInit() { 17 | } 18 | }; 19 | __decorate([ 20 | Input(), 21 | __metadata('design:type', Object) 22 | ], AlgoliaSortComponent.prototype, "indices", void 0); 23 | __decorate([ 24 | Input(), 25 | __metadata('design:type', Object) 26 | ], AlgoliaSortComponent.prototype, "label", void 0); 27 | AlgoliaSortComponent = __decorate([ 28 | Component({ 29 | selector: 'app-algolia-sort', 30 | template: ` 31 |
32 | 37 |
38 | ` 39 | }), 40 | __metadata('design:paramtypes', []) 41 | ], AlgoliaSortComponent); 42 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia-sort/algolia-sort.component.js.map -------------------------------------------------------------------------------- /dist/lib/algolia-sort/algolia-sort.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia-sort.component.js","sourceRoot":"","sources":["../../src/lib/algolia-sort/algolia-sort.component.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,MAAM,eAAe;AAcxD;IAIE;QAHS,YAAO,GAAG,EAAE,CAAC;QACb,UAAK,GAAG,EAAE,CAAC;IAEJ,CAAC;IAEjB,QAAQ;IACR,CAAC;AAEH,CAAC;AARC;IAAC,KAAK,EAAE;;qDAAA;AACR;IAAC,KAAK,EAAE;;mDAAA;AAdV;IAAC,SAAS,CAAC;QACT,QAAQ,EAAE,kBAAkB;QAC5B,QAAQ,EAAE;;;;;;;;GAQT;KACF,CAAC;;wBAAA;AAUD"} -------------------------------------------------------------------------------- /dist/lib/algolia-stars/algolia-stars.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | export declare class AlgoliaStarsComponent implements OnInit { 3 | max: number; 4 | min: number; 5 | value: number; 6 | listArray: number[]; 7 | constructor(); 8 | ngOnInit(): void; 9 | } 10 | -------------------------------------------------------------------------------- /dist/lib/algolia-stars/algolia-stars.component.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Component, Input } from '@angular/core'; 11 | export let AlgoliaStarsComponent = class AlgoliaStarsComponent { 12 | constructor() { 13 | this.max = 0; 14 | this.min = 0; 15 | this.listArray = []; 16 | } 17 | ngOnInit() { 18 | this.listArray = [...Array(this.max + 1).keys()].splice(this.min, this.max + 1); 19 | ; 20 | } 21 | }; 22 | __decorate([ 23 | Input(), 24 | __metadata('design:type', Number) 25 | ], AlgoliaStarsComponent.prototype, "max", void 0); 26 | __decorate([ 27 | Input(), 28 | __metadata('design:type', Number) 29 | ], AlgoliaStarsComponent.prototype, "min", void 0); 30 | __decorate([ 31 | Input(), 32 | __metadata('design:type', Number) 33 | ], AlgoliaStarsComponent.prototype, "value", void 0); 34 | AlgoliaStarsComponent = __decorate([ 35 | Component({ 36 | selector: 'app-algolia-stars', 37 | template: ` 38 | 39 | {{ i <= value ? '★' : '☆' }} 40 | 41 | ` 42 | }), 43 | __metadata('design:paramtypes', []) 44 | ], AlgoliaStarsComponent); 45 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia-stars/algolia-stars.component.js.map -------------------------------------------------------------------------------- /dist/lib/algolia-stars/algolia-stars.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia-stars.component.js","sourceRoot":"","sources":["../../src/lib/algolia-stars/algolia-stars.component.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,MAAM,eAAe;AAUxD;IAOE;QANS,QAAG,GAAW,CAAC,CAAC;QAChB,QAAG,GAAW,CAAC,CAAC;QAGzB,cAAS,GAAa,EAAE,CAAC;IAET,CAAC;IAEjB,QAAQ;QACN,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAAC,CAAC;IACpF,CAAC;AACH,CAAC;AAXC;IAAC,KAAK,EAAE;;kDAAA;AACR;IAAC,KAAK,EAAE;;kDAAA;AACR;IAAC,KAAK,EAAE;;oDAAA;AAXV;IAAC,SAAS,CAAC;QACT,QAAQ,EAAE,mBAAmB;QAC7B,QAAQ,EAAE;;;;GAIT;KACF,CAAC;;yBAAA;AAaD"} -------------------------------------------------------------------------------- /dist/lib/algolia-stats/algolia-stats.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | export declare class AlgoliaStatsComponent implements OnInit { 4 | private as; 5 | cssclass: string; 6 | constructor(as: AlgoliaService); 7 | ngOnInit(): void; 8 | } 9 | -------------------------------------------------------------------------------- /dist/lib/algolia-stats/algolia-stats.component.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Component, Input } from '@angular/core'; 11 | import { AlgoliaService } from '../algolia.service'; 12 | export let AlgoliaStatsComponent = class AlgoliaStatsComponent { 13 | constructor(as) { 14 | this.as = as; 15 | } 16 | ngOnInit() { 17 | } 18 | }; 19 | __decorate([ 20 | Input(), 21 | __metadata('design:type', String) 22 | ], AlgoliaStatsComponent.prototype, "cssclass", void 0); 23 | AlgoliaStatsComponent = __decorate([ 24 | Component({ 25 | selector: 'app-algolia-stats', 26 | template: ` 27 | 28 | {{as.content.nbHits |number}} results found in {{as.content.processingTimeMS}}ms 29 | 30 | ` 31 | }), 32 | __metadata('design:paramtypes', [AlgoliaService]) 33 | ], AlgoliaStatsComponent); 34 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia-stats/algolia-stats.component.js.map -------------------------------------------------------------------------------- /dist/lib/algolia-stats/algolia-stats.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia-stats.component.js","sourceRoot":"","sources":["../../src/lib/algolia-stats/algolia-stats.component.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,SAAS,EAAU,KAAK,EAAE,MAAM,eAAe;OACjD,EAAE,cAAc,EAAE,MAAM,oBAAoB;AAUnD;IAGE,YAAoB,EAAkB;QAAlB,OAAE,GAAF,EAAE,CAAgB;IAAI,CAAC;IAE3C,QAAQ;IACR,CAAC;AACH,CAAC;AANC;IAAC,KAAK,EAAE;;uDAAA;AATV;IAAC,SAAS,CAAC;QACT,QAAQ,EAAE,mBAAmB;QAC7B,QAAQ,EAAE;;;;GAIT;KACF,CAAC;;yBAAA;AAQD"} -------------------------------------------------------------------------------- /dist/lib/algolia.module.d.ts: -------------------------------------------------------------------------------- 1 | import { ModuleWithProviders } from '@angular/core'; 2 | import { ApiServiceConfig } from './algolia.service'; 3 | export declare class AlgoliaModule { 4 | constructor(parentModule: AlgoliaModule); 5 | static forRoot(config: ApiServiceConfig): ModuleWithProviders; 6 | } 7 | -------------------------------------------------------------------------------- /dist/lib/algolia.module.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | var __param = (this && this.__param) || function (paramIndex, decorator) { 11 | return function (target, key) { decorator(target, key, paramIndex); } 12 | }; 13 | import { NgModule, Optional, SkipSelf } from '@angular/core'; 14 | import { CommonModule } from '@angular/common'; 15 | import { AlgoliaSearchComponent } from './algolia-search/algolia-search.component'; 16 | import { AlgoliaResultsComponent } from './algolia-results/algolia-results.component'; 17 | import { AlgoliaFacetsComponent } from './algolia-facets/algolia-facets.component'; 18 | import { MapToIterablePipe } from './map-to-iterable.pipe'; 19 | import { AlgoliaSortComponent } from './algolia-sort/algolia-sort.component'; 20 | import { AlgoliaPaginationComponent } from './algolia-pagination/algolia-pagination.component'; 21 | import { AlgoliaStatsComponent } from './algolia-stats/algolia-stats.component'; 22 | import { AlgoliaService, ApiServiceConfig } from './algolia.service'; 23 | import { AlgoliaStarsComponent } from './algolia-stars/algolia-stars.component'; 24 | let AlgoliaModule_1 = class AlgoliaModule { 25 | constructor(parentModule) { 26 | if (parentModule) { 27 | throw new Error('CoreModule is already loaded. Import it in the AppModule only'); 28 | } 29 | } 30 | static forRoot(config) { 31 | return { 32 | ngModule: AlgoliaModule_1, 33 | providers: [ 34 | { provide: ApiServiceConfig, useValue: config } 35 | ] 36 | }; 37 | } 38 | }; 39 | export let AlgoliaModule = AlgoliaModule_1; 40 | AlgoliaModule = AlgoliaModule_1 = __decorate([ 41 | NgModule({ 42 | imports: [ 43 | CommonModule, 44 | ], 45 | exports: [AlgoliaSearchComponent, AlgoliaResultsComponent, AlgoliaFacetsComponent, AlgoliaSortComponent, AlgoliaPaginationComponent, AlgoliaStatsComponent, AlgoliaStarsComponent], 46 | declarations: [AlgoliaSearchComponent, AlgoliaResultsComponent, AlgoliaFacetsComponent, MapToIterablePipe, AlgoliaSortComponent, AlgoliaPaginationComponent, AlgoliaStatsComponent, AlgoliaStarsComponent], 47 | providers: [AlgoliaService] 48 | }), 49 | __param(0, Optional()), 50 | __param(0, SkipSelf()), 51 | __metadata('design:paramtypes', [AlgoliaModule]) 52 | ], AlgoliaModule); 53 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia.module.js.map -------------------------------------------------------------------------------- /dist/lib/algolia.module.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia.module.js","sourceRoot":"","sources":["../src/lib/algolia.module.ts"],"names":[],"mappings":";;;;;;;;;;;;OAAO,EAAE,QAAQ,EAAuB,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe;OAC1E,EAAE,YAAY,EAAE,MAAM,iBAAiB;OAMvC,EAAE,sBAAsB,EAAE,MAAM,2CAA2C;OAC3E,EAAE,uBAAuB,EAAE,MAAM,6CAA6C;OAC9E,EAAE,sBAAsB,EAAE,MAAM,2CAA2C;OAC3E,EAAE,iBAAiB,EAAE,MAAM,wBAAwB;OACnD,EAAE,oBAAoB,EAAE,MAAM,uCAAuC;OACrE,EAAE,0BAA0B,EAAE,MAAM,mDAAmD;OACvF,EAAE,qBAAqB,EAAE,MAAM,yCAAyC;OACxE,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB;OAC7D,EAAE,qBAAqB,EAAE,MAAM,yCAAyC;AAU/E;IACE,YAAqC,YAA2B;QAC9D,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,+DAA+D,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,MAAwB;QACrC,MAAM,CAAC;YACL,QAAQ,EAAE,eAAa;YACvB,SAAS,EAAE;gBACT,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE;aAC/C;SACF,CAAC;IACJ,CAAC;AACH,CAAC;;AAxBD;IAAC,QAAQ,CAAC;QACR,OAAO,EAAE;YACP,YAAY;SACX;QACH,OAAO,EAAE,CAAC,sBAAsB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,qBAAqB,CAAC;QAClL,YAAY,EAAE,CAAC,sBAAsB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,qBAAqB,CAAC;QAC1M,SAAS,EAAE,CAAC,cAAc,CAAC;KAC5B,CAAC;eAEc,QAAQ,EAAE;eAAE,QAAQ,EAAE;;iBAFpC;AAiBD"} -------------------------------------------------------------------------------- /dist/lib/algolia.service.d.ts: -------------------------------------------------------------------------------- 1 | import { EventEmitter } from '@angular/core'; 2 | export declare class ApiServiceConfig { 3 | apiKey: string; 4 | appId: string; 5 | } 6 | export declare class AlgoliaService { 7 | client: any; 8 | index: any; 9 | content: any; 10 | parameters: any; 11 | facets: any; 12 | facetFilters: any; 13 | query: string; 14 | apiKey: string; 15 | appId: string; 16 | resultUpdated: EventEmitter; 17 | constructor(config: ApiServiceConfig); 18 | connect(): void; 19 | setIndex(name: any): void; 20 | addFacet(attribute: any): void; 21 | removeFacet(attribute: any): void; 22 | addFacetFilter(facet: any, value: any): void; 23 | removeFacetFilter(facet: any, value: any): void; 24 | buildFacetFilters(): any[]; 25 | buildParameters(): void; 26 | search(): Promise; 27 | } 28 | -------------------------------------------------------------------------------- /dist/lib/algolia.service.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | var __param = (this && this.__param) || function (paramIndex, decorator) { 11 | return function (target, key) { decorator(target, key, paramIndex); } 12 | }; 13 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 14 | return new (P || (P = Promise))(function (resolve, reject) { 15 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 16 | function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } 17 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } 18 | step((generator = generator.apply(thisArg, _arguments)).next()); 19 | }); 20 | }; 21 | import { Injectable, EventEmitter, Optional } from '@angular/core'; 22 | import * as algoliasearch from 'algoliasearch'; 23 | // const ATTRIBUTES = null; 24 | export class ApiServiceConfig { 25 | constructor() { 26 | this.apiKey = 'API KEY'; 27 | this.appId = 'API KEY'; 28 | } 29 | } 30 | export let AlgoliaService = class AlgoliaService { 31 | constructor(config) { 32 | this.client = null; 33 | this.index = null; 34 | this.content = {}; 35 | this.parameters = {}; 36 | this.facets = []; 37 | this.facetFilters = {}; 38 | this.query = ''; 39 | this.apiKey = ''; 40 | this.appId = ''; 41 | this.resultUpdated = new EventEmitter(); 42 | if (config) { 43 | this.appId = config.appId; 44 | this.apiKey = config.apiKey; 45 | } 46 | this.connect(); 47 | } 48 | connect() { 49 | this.client = algoliasearch(this.appId, this.apiKey); 50 | } 51 | setIndex(name) { 52 | this.index = this.client.initIndex(name); 53 | } 54 | addFacet(attribute) { 55 | this.facets.push(attribute); 56 | } 57 | removeFacet(attribute) { 58 | let index = this.facets.indexOf(attribute); 59 | if (index !== -1) { 60 | this.facets.splice(index, 1); 61 | } 62 | } 63 | addFacetFilter(facet, value) { 64 | if (this.facetFilters[facet] === undefined) 65 | this.facetFilters[facet] = []; 66 | this.facetFilters[facet].push(value.key); 67 | this.search(); 68 | } 69 | removeFacetFilter(facet, value) { 70 | this.facetFilters[facet].splice(this.facetFilters[facet].indexOf(value), 1); 71 | this.search(); 72 | } 73 | buildFacetFilters() { 74 | let result = []; 75 | for (let key in this.facetFilters) { 76 | for (let val of this.facetFilters[key]) { 77 | result.push(`${key}:${val}`); 78 | } 79 | } 80 | // hum... 81 | // Object.entries(this.facetFilters).forEach(([key, value]) => { 82 | // }); 83 | return result; 84 | } 85 | buildParameters() { 86 | if (Object.keys(this.facets).length === 0 && this.facets.constructor === Object) { 87 | delete this.parameters.facets; 88 | } 89 | else { 90 | this.parameters.facets = this.facets; 91 | } 92 | } 93 | search() { 94 | return __awaiter(this, void 0, void 0, function* () { 95 | this.buildParameters(); 96 | this.parameters.facetFilters = this.buildFacetFilters(); 97 | this.content = yield this.index.search(this.query, this.parameters); 98 | this.resultUpdated.emit(); 99 | console.log(this.content); 100 | }); 101 | } 102 | }; 103 | AlgoliaService = __decorate([ 104 | Injectable(), 105 | __param(0, Optional()), 106 | __metadata('design:paramtypes', [ApiServiceConfig]) 107 | ], AlgoliaService); 108 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/algolia.service.js.map -------------------------------------------------------------------------------- /dist/lib/algolia.service.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"algolia.service.js","sourceRoot":"","sources":["../src/lib/algolia.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe;OAC3D,KAAK,aAAa,MAAM,eAAe;AAE9C,2BAA2B;AAE3B;IAAA;QACE,WAAM,GAAG,SAAS,CAAC;QACnB,UAAK,GAAG,SAAS,CAAC;IACpB,CAAC;AAAD,CAAC;AAGD;IAcE,YAAwB,MAAwB;QAZhD,WAAM,GAAQ,IAAI,CAAC;QACnB,UAAK,GAAQ,IAAI,CAAC;QAClB,YAAO,GAAQ,EAAE,CAAC;QAClB,eAAU,GAAQ,EAAE,CAAC;QACrB,WAAM,GAAQ,EAAE,CAAC;QACjB,iBAAY,GAAQ,EAAE,CAAC;QACvB,UAAK,GAAW,EAAE,CAAC;QACnB,WAAM,GAAW,EAAE,CAAC;QACpB,UAAK,GAAW,EAAE,CAAC;QAEnB,kBAAa,GAAsB,IAAI,YAAY,EAAE,CAAC;QAGpD,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,QAAQ,CAAC,IAAI;QACX,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,QAAQ,CAAC,SAAS;QAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,WAAW,CAAC,SAAS;QACnB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,cAAc,CAAC,KAAK,EAAE,KAAK;QACzB,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;YACzC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,iBAAiB,CAAC,KAAK,EAAE,KAAK;QAC5B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,iBAAiB;QACf,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YAClC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACvC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,SAAS;QACT,gEAAgE;QAChE,MAAM;QACN,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC;IAED,eAAe;QACb,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC;YAChF,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAChC,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACvC,CAAC;IACH,CAAC;IAEK,MAAM;;YACV,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACxD,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACpE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YAE1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC;KAAA;AACH,CAAC;AAnFD;IAAC,UAAU,EAAE;eAeE,QAAQ,EAAE;;kBAfZ;AAmFZ"} -------------------------------------------------------------------------------- /dist/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './algolia.module'; 2 | export * from './algolia.service'; 3 | -------------------------------------------------------------------------------- /dist/lib/index.js: -------------------------------------------------------------------------------- 1 | // export * from './app.module'; 2 | // export * from './app.service'; 3 | // export * from './app.pipe'; 4 | export * from './algolia.module'; 5 | export * from './algolia.service'; 6 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/index.js.map -------------------------------------------------------------------------------- /dist/lib/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,iCAAiC;AACjC,8BAA8B;AAE9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"} -------------------------------------------------------------------------------- /dist/lib/map-to-iterable.pipe.d.ts: -------------------------------------------------------------------------------- 1 | import { PipeTransform } from '@angular/core'; 2 | export declare class MapToIterablePipe implements PipeTransform { 3 | transform(dict: Object): any; 4 | } 5 | -------------------------------------------------------------------------------- /dist/lib/map-to-iterable.pipe.js: -------------------------------------------------------------------------------- 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 4 | 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; 5 | return c > 3 && r && Object.defineProperty(target, key, r), r; 6 | }; 7 | var __metadata = (this && this.__metadata) || function (k, v) { 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 9 | }; 10 | import { Pipe } from '@angular/core'; 11 | export let MapToIterablePipe = class MapToIterablePipe { 12 | transform(dict) { 13 | var a = []; 14 | for (var key in dict) { 15 | if (dict.hasOwnProperty(key)) { 16 | a.push({ key: key, val: dict[key] }); 17 | } 18 | } 19 | return a; 20 | } 21 | }; 22 | MapToIterablePipe = __decorate([ 23 | Pipe({ 24 | name: 'mapToIterable' 25 | }), 26 | __metadata('design:paramtypes', []) 27 | ], MapToIterablePipe); 28 | //# sourceMappingURL=/Users/olivier/lab/algolia/algolia-components/lib/map-to-iterable.pipe.js.map -------------------------------------------------------------------------------- /dist/lib/map-to-iterable.pipe.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"map-to-iterable.pipe.js","sourceRoot":"","sources":["../src/lib/map-to-iterable.pipe.ts"],"names":[],"mappings":";;;;;;;;;OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe;AAKnD;IAEE,SAAS,CAAC,IAAY;QACpB,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;YACrB,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC7B,CAAC,CAAC,IAAI,CAAC,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;QACD,MAAM,CAAC,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAdD;IAAC,IAAI,CAAC;QACJ,IAAI,EAAE,eAAe;KACtB,CAAC;;qBAAA;AAYD"} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tagazok/algolia-angular-components", 3 | "version": "1.0.3", 4 | "license": "MIT", 5 | "author": { 6 | "name": "Olivier Leplus", 7 | "email": "leplus.olivier@gmail.com" 8 | }, 9 | "engines": { 10 | "node": ">= 6.0.42" 11 | }, 12 | "contributors": [], 13 | "repository": { 14 | "type": "git", 15 | "url": "git@github.com:tagazok/algolia-angular-components.git" 16 | }, 17 | "homepage": "https://github.com/tagazok/algolia-angular-components", 18 | "bugs": "https://github.com/tagazok/algolia-angular-components/issues", 19 | "description": "A component library for Algolia", 20 | "main": "dist/index.js", 21 | "scripts": { 22 | "clean": "rimraf dist/", 23 | "build:aot": "ngc -p tsconfig.json", 24 | "build:jit": "tsc -p tsconfig.json", 25 | "build": "npm run clean && npm run build:jit" 26 | }, 27 | "types": "dist/index.d.ts", 28 | "private": false, 29 | "keywords": [ 30 | "angular", 31 | "algolia" 32 | ], 33 | "dependencies": { 34 | "@angular/common": "^2.4.0", 35 | "@angular/compiler": "^2.4.0", 36 | "@angular/core": "^2.4.0", 37 | "@angular/platform-browser": "^2.4.0", 38 | "@angular/platform-browser-dynamic": "^2.4.0", 39 | "core-js": "^2.4.1", 40 | "rxjs": "^5.1.0", 41 | "zone.js": "^0.7.6", 42 | "algoliasearch": "^3.20.4", 43 | "@types/algoliasearch": "^3.18.0", 44 | "@angular/http": "^2.4.0" 45 | }, 46 | "devDependencies": { 47 | "@angular/cli": "1.0.0-rc.0", 48 | "@angular/compiler-cli": "^2.4.0", 49 | "@types/jasmine": "2.5.38", 50 | "@types/node": "~6.0.60", 51 | "codelyzer": "~2.0.0", 52 | "jasmine-core": "~2.5.2", 53 | "jasmine-spec-reporter": "~3.2.0", 54 | "karma": "~1.4.1", 55 | "karma-chrome-launcher": "~2.0.0", 56 | "karma-cli": "~1.0.1", 57 | "karma-jasmine": "~1.1.0", 58 | "karma-jasmine-html-reporter": "^0.2.2", 59 | "karma-coverage-istanbul-reporter": "^0.2.0", 60 | "protractor": "~5.1.0", 61 | "ts-node": "~2.0.0", 62 | "tslint": "~4.4.2", 63 | "typescript": "~2.0.0", 64 | "@types/algoliasearch": "^3.18.0" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib'; -------------------------------------------------------------------------------- /src/lib/algolia-facets/algolia-facets.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, ContentChild, TemplateRef, ElementRef, Renderer } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | 4 | @Component({ 5 | selector: 'app-algolia-facets', 6 | template: ` 7 |
8 |

{{label}}

9 |
    10 |
  • 11 |
    12 | 13 |
    14 |
  • 15 |
16 |
17 | `, 18 | styles: [` 19 | :host { 20 | display: block; 21 | clear: both; 22 | } 23 | .facets { 24 | list-style: none; 25 | padding: 0; 26 | margin: 0; 27 | line-height: 1.42857143; 28 | } 29 | .facet-item { 30 | cursor: pointer; 31 | } 32 | `] 33 | }) 34 | export class AlgoliaFacetsComponent implements OnInit { 35 | @Input() attribute: string; 36 | @Input() label: string; 37 | @Input() limit: number; 38 | @Input() selectedcssclass: string; 39 | 40 | @ContentChild(TemplateRef) itemTemplate:TemplateRef; 41 | 42 | constructor(private as: AlgoliaService, elementRef: ElementRef, renderer: Renderer) { 43 | // renderer.listen(elementRef.nativeElement, 'click', (event) => { 44 | // debugger; 45 | // }); 46 | } 47 | 48 | ngOnInit() { 49 | this.as.addFacet(this.attribute); 50 | if (this.limit) { 51 | this.as.parameters.maxValuesPerFacet = this.limit; 52 | } 53 | } 54 | 55 | isFacetActive(value) { 56 | return (this.as.facetFilters[this.attribute] && this.as.facetFilters[this.attribute].includes(value)) ? true : false; 57 | }; 58 | 59 | updateSearch(facet) { 60 | if ((this.as.facetFilters[this.attribute] === undefined) || !this.as.facetFilters[this.attribute].includes(facet.key)) { 61 | this.as.addFacetFilter(this.attribute, facet); 62 | } else { 63 | this.as.removeFacetFilter(this.attribute, facet); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/lib/algolia-pagination/algolia-pagination.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | 4 | @Component({ 5 | selector: 'app-algolia-pagination', 6 | template: ` 7 |
    8 |
  • 9 |
    {{i}}
    10 |
  • 11 |
12 | `, 13 | styles: [` 14 | .pagination { 15 | list-style-type: none; 16 | } 17 | .pagination li { 18 | list-style-type: none; 19 | display: inline-block; 20 | border-radius: 2px; 21 | text-align: center; 22 | vertical-align: top; 23 | height: 30px; 24 | width: 30px; 25 | cursor: pointer; 26 | } 27 | .pagination li div { 28 | width: 100%; 29 | height: 100%; 30 | 31 | height: 100%; 32 | box-sizing: border-box; 33 | max-height: 100%; 34 | display: flex; 35 | flex-direction: row; 36 | justify-content: center; 37 | align-items: center; 38 | align-content: center; 39 | } 40 | 41 | .pagination li.active { 42 | background-color: #20cf7d; 43 | } 44 | `] 45 | }) 46 | export class AlgoliaPaginationComponent implements OnInit { 47 | @Input() padding: number = 3; 48 | 49 | range: Array = []; 50 | nbDisplayPages: number; 51 | 52 | constructor(private as: AlgoliaService) { 53 | this.buildRange(); 54 | } 55 | 56 | buildRange() { 57 | this.buildNbDisplayedPages(); 58 | let paddingLeft = this.buildPaddingLeft(); 59 | let paddingRight = this.nbDisplayPages - paddingLeft; 60 | let start = this.as.content.page - paddingLeft + 1; 61 | let end = this.as.content.page + paddingRight + 1; 62 | this.range = Array.from({length: (end - start)}, (v, k) => k + start); 63 | } 64 | 65 | buildNbDisplayedPages() { 66 | this.nbDisplayPages = Math.min(2 * this.padding + 1, this.as.content.nbPages); 67 | } 68 | 69 | buildPaddingLeft() { 70 | if (this.as.content.page <= this.padding) { 71 | return this.as.content.page; 72 | } 73 | 74 | if (this.as.content.page >= this.as.content.nbPages - this.padding) { 75 | return this.nbDisplayPages - (this.as.content.nbPages - this.as.content.page); 76 | } 77 | 78 | return this.padding; 79 | } 80 | 81 | ngOnInit() { 82 | this.as.resultUpdated.subscribe( 83 | () => this.buildRange() 84 | ); 85 | } 86 | 87 | changePage(page) { 88 | this.as.parameters.page = page; 89 | this.as.search(); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/lib/algolia-results/algolia-results.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, ContentChild, TemplateRef } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | 4 | @Component({ 5 | selector: 'app-algolia-results', 6 | template: ` 7 | 8 | `, 9 | styles: [` 10 | .my-item { 11 | padding: .5%; 12 | width: 100%; 13 | } 14 | `] 15 | }) 16 | export class AlgoliaResultsComponent implements OnInit { 17 | 18 | @ContentChild(TemplateRef) itemTemplate:TemplateRef; 19 | 20 | constructor(private as: AlgoliaService) { } 21 | 22 | ngOnInit() { 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/lib/algolia-search/algolia-search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service'; 3 | 4 | @Component({ 5 | selector: 'app-algolia-search', 6 | template: ` 7 |
8 | 9 |
10 | `, 11 | styles: [` 12 | input { 13 | width: 100%; 14 | padding: 10px; 15 | font-size: 1.2em; 16 | box-sizing: border-box; 17 | }`] 18 | }) 19 | export class AlgoliaSearchComponent implements OnInit { 20 | @Input() index: string; 21 | @Input() hitsPerPage: number = 12; 22 | @Input() placeHolder: string = "Search"; 23 | 24 | constructor(private as: AlgoliaService) { 25 | } 26 | 27 | ngOnInit() { 28 | this.as.setIndex(this.index); 29 | this.as.parameters.hitsPerPage = this.hitsPerPage; 30 | this.as.search(); 31 | } 32 | 33 | onKey(str: string) { 34 | this.as.query = str; 35 | this.as.search(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/lib/algolia-sort/algolia-sort.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-algolia-sort', 5 | template: ` 6 |
7 | 12 |
13 | ` 14 | }) 15 | export class AlgoliaSortComponent implements OnInit { 16 | @Input() indices = []; 17 | @Input() label = ''; 18 | 19 | constructor() { } 20 | 21 | ngOnInit() { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/lib/algolia-stars/algolia-stars.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-algolia-stars', 5 | template: ` 6 | 7 | {{ i <= value ? '★' : '☆' }} 8 | 9 | ` 10 | }) 11 | export class AlgoliaStarsComponent implements OnInit { 12 | @Input() max: number = 0; 13 | @Input() min: number = 0; 14 | @Input() value: number; 15 | 16 | listArray: number[] = []; 17 | 18 | constructor() { } 19 | 20 | ngOnInit() { 21 | this.listArray = [...Array(this.max + 1).keys()].splice(this.min, this.max + 1); ; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/lib/algolia-stats/algolia-stats.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { AlgoliaService } from '../algolia.service' 3 | 4 | @Component({ 5 | selector: 'app-algolia-stats', 6 | template: ` 7 | 8 | {{as.content.nbHits |number}} results found in {{as.content.processingTimeMS}}ms 9 | 10 | ` 11 | }) 12 | export class AlgoliaStatsComponent implements OnInit { 13 | @Input() cssclass: string; 14 | 15 | constructor(private as: AlgoliaService) { } 16 | 17 | ngOnInit() { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/lib/algolia.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, ModuleWithProviders, Optional, SkipSelf } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | // import { AppService } from './app.service'; 5 | // import { AppPipe } from './app.pipe'; 6 | // import { AppComponent } from './component/app.component'; 7 | 8 | import { AlgoliaSearchComponent } from './algolia-search/algolia-search.component'; 9 | import { AlgoliaResultsComponent } from './algolia-results/algolia-results.component'; 10 | import { AlgoliaFacetsComponent } from './algolia-facets/algolia-facets.component'; 11 | import { MapToIterablePipe } from './map-to-iterable.pipe'; 12 | import { AlgoliaSortComponent } from './algolia-sort/algolia-sort.component'; 13 | import { AlgoliaPaginationComponent } from './algolia-pagination/algolia-pagination.component'; 14 | import { AlgoliaStatsComponent } from './algolia-stats/algolia-stats.component'; 15 | import { AlgoliaService, ApiServiceConfig } from './algolia.service'; 16 | import { AlgoliaStarsComponent } from './algolia-stars/algolia-stars.component'; 17 | 18 | @NgModule({ 19 | imports: [ 20 | CommonModule, 21 | ], 22 | exports: [AlgoliaSearchComponent, AlgoliaResultsComponent, AlgoliaFacetsComponent, AlgoliaSortComponent, AlgoliaPaginationComponent, AlgoliaStatsComponent, AlgoliaStarsComponent], 23 | declarations: [AlgoliaSearchComponent, AlgoliaResultsComponent, AlgoliaFacetsComponent, MapToIterablePipe, AlgoliaSortComponent, AlgoliaPaginationComponent, AlgoliaStatsComponent, AlgoliaStarsComponent], 24 | providers: [AlgoliaService] 25 | }) 26 | export class AlgoliaModule { 27 | constructor (@Optional() @SkipSelf() parentModule: AlgoliaModule) { 28 | if (parentModule) { 29 | throw new Error( 30 | 'CoreModule is already loaded. Import it in the AppModule only'); 31 | } 32 | } 33 | 34 | static forRoot(config: ApiServiceConfig): ModuleWithProviders { 35 | return { 36 | ngModule: AlgoliaModule, 37 | providers: [ 38 | {provide: ApiServiceConfig, useValue: config } 39 | ] 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/lib/algolia.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, EventEmitter, Optional } from '@angular/core'; 2 | import * as algoliasearch from 'algoliasearch'; 3 | 4 | // const ATTRIBUTES = null; 5 | 6 | export class ApiServiceConfig { 7 | apiKey = 'API KEY'; 8 | appId = 'API KEY'; 9 | } 10 | 11 | @Injectable() 12 | export class AlgoliaService { 13 | 14 | client: any = null; 15 | index: any = null; 16 | content: any = {}; 17 | parameters: any = {}; 18 | facets: any = []; 19 | facetFilters: any = {}; 20 | query: string = ''; 21 | apiKey: string = ''; 22 | appId: string = ''; 23 | 24 | resultUpdated: EventEmitter = new EventEmitter(); 25 | 26 | constructor(@Optional() config: ApiServiceConfig) { 27 | if (config) { 28 | this.appId = config.appId; 29 | this.apiKey = config.apiKey; 30 | } 31 | this.connect(); 32 | } 33 | 34 | connect() { 35 | this.client = algoliasearch(this.appId, this.apiKey); 36 | } 37 | 38 | setIndex(name) { 39 | this.index = this.client.initIndex(name); 40 | } 41 | 42 | addFacet(attribute) { 43 | this.facets.push(attribute); 44 | } 45 | 46 | removeFacet(attribute) { 47 | let index = this.facets.indexOf(attribute); 48 | if (index !== -1) { 49 | this.facets.splice(index, 1); 50 | } 51 | } 52 | 53 | addFacetFilter(facet, value) { 54 | if (this.facetFilters[facet] === undefined) 55 | this.facetFilters[facet] = []; 56 | this.facetFilters[facet].push(value.key); 57 | this.search(); 58 | } 59 | 60 | removeFacetFilter(facet, value) { 61 | this.facetFilters[facet].splice(this.facetFilters[facet].indexOf(value), 1); 62 | this.search(); 63 | } 64 | 65 | buildFacetFilters() { 66 | let result = []; 67 | for (let key in this.facetFilters) { 68 | for (let val of this.facetFilters[key]) { 69 | result.push(`${key}:${val}`); 70 | } 71 | } 72 | // hum... 73 | // Object.entries(this.facetFilters).forEach(([key, value]) => { 74 | // }); 75 | return result; 76 | } 77 | 78 | buildParameters() { 79 | if (Object.keys(this.facets).length === 0 && this.facets.constructor === Object) { 80 | delete this.parameters.facets; 81 | } else { 82 | this.parameters.facets = this.facets; 83 | } 84 | } 85 | 86 | async search() { 87 | this.buildParameters(); 88 | this.parameters.facetFilters = this.buildFacetFilters(); 89 | this.content = await this.index.search(this.query, this.parameters); 90 | this.resultUpdated.emit(); 91 | 92 | console.log(this.content); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/lib/index.ts: -------------------------------------------------------------------------------- 1 | // export * from './app.module'; 2 | // export * from './app.service'; 3 | // export * from './app.pipe'; 4 | 5 | export * from './algolia.module'; 6 | export * from './algolia.service'; 7 | -------------------------------------------------------------------------------- /src/lib/map-to-iterable.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'mapToIterable' 5 | }) 6 | export class MapToIterablePipe implements PipeTransform { 7 | 8 | transform(dict: Object): any { 9 | var a = []; 10 | for (var key in dict) { 11 | if (dict.hasOwnProperty(key)) { 12 | a.push({key: key, val: dict[key]}); 13 | } 14 | } 15 | return a; 16 | } 17 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "", 4 | "target": "es6", 5 | "module": "es6", 6 | "moduleResolution": "node", 7 | "declaration": true, 8 | "noImplicitAny": false, 9 | "sourceMap": true, 10 | "mapRoot": "", 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "outDir": "./dist", 14 | "rootDir": "./src", 15 | "skipLibCheck": true, 16 | "typeRoots": ["./node_modules/@types"], 17 | "types": [ 18 | "node" 19 | ], 20 | "lib": [ 21 | "dom", 22 | "es6" 23 | ] 24 | }, 25 | "compileOnSave": false, 26 | "buildOnSave": false, 27 | "exclude": [ 28 | "node_modules", 29 | "dist", 30 | "**/*.ngfactory.ts", 31 | "**/*.shim.ts" 32 | ], 33 | "angularCompilerOptions": { 34 | "genDir": "dist", 35 | "entryModule": "src/lib/algolia.module#AlgoliaModule" 36 | } 37 | } -------------------------------------------------------------------------------- /typings.d.ts: -------------------------------------------------------------------------------- 1 | // Typings reference file, see links for more information 2 | // https://github.com/typings/typings 3 | // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html 4 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | "@angular/common@^2.4.1": 4 | version "2.4.1" 5 | resolved "https://registry.yarnpkg.com/@angular/common/-/common-2.4.1.tgz#a70167430574959c3423ac96ebdec98032d3500d" 6 | 7 | "@angular/compiler-cli@^2.4.1": 8 | version "2.4.1" 9 | resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-2.4.1.tgz#9291504197a199fee2f48353d67431a1a9e40833" 10 | dependencies: 11 | "@angular/tsc-wrapped" "0.5.0" 12 | minimist "^1.2.0" 13 | reflect-metadata "^0.1.2" 14 | 15 | "@angular/compiler@^2.4.1": 16 | version "2.4.1" 17 | resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-2.4.1.tgz#62b4fbfc53c934bd5def78db594cbf245b3f446a" 18 | 19 | "@angular/core@^2.4.1": 20 | version "2.4.1" 21 | resolved "https://registry.yarnpkg.com/@angular/core/-/core-2.4.1.tgz#3a6d2dc7fd86fdebe4febae7eb28abad7d04c76a" 22 | 23 | "@angular/platform-browser@^2.4.1": 24 | version "2.4.1" 25 | resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-2.4.1.tgz#4eaa829b450be34f0029796b6c3b99e27d3d5740" 26 | 27 | "@angular/platform-server@^2.4.1": 28 | version "2.4.1" 29 | resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-2.4.1.tgz#9e5e427b8226d1a073949effea00a4df352682de" 30 | dependencies: 31 | parse5 "^2.2.1" 32 | 33 | "@angular/tsc-wrapped@0.5.0": 34 | version "0.5.0" 35 | resolved "https://registry.yarnpkg.com/@angular/tsc-wrapped/-/tsc-wrapped-0.5.0.tgz#e50f81af02c6817dcaba22032e49ba8060d628b4" 36 | dependencies: 37 | tsickle "^0.2" 38 | 39 | "@types/jasmine@2.2.30": 40 | version "2.2.30" 41 | resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.2.30.tgz#754be39255479731ad841478bd29772d71cf5996" 42 | 43 | "@types/node@6.0.54": 44 | version "6.0.54" 45 | resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.54.tgz#65859962ba988052cbdd5c48881395acfdd46931" 46 | 47 | balanced-match@^0.4.1: 48 | version "0.4.2" 49 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" 50 | 51 | brace-expansion@^1.0.0: 52 | version "1.1.6" 53 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" 54 | dependencies: 55 | balanced-match "^0.4.1" 56 | concat-map "0.0.1" 57 | 58 | concat-map@0.0.1: 59 | version "0.0.1" 60 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 61 | 62 | core-js@2.4.1: 63 | version "2.4.1" 64 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" 65 | 66 | fs.realpath@^1.0.0: 67 | version "1.0.0" 68 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 69 | 70 | glob@^7.0.5: 71 | version "7.1.1" 72 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" 73 | dependencies: 74 | fs.realpath "^1.0.0" 75 | inflight "^1.0.4" 76 | inherits "2" 77 | minimatch "^3.0.2" 78 | once "^1.3.0" 79 | path-is-absolute "^1.0.0" 80 | 81 | inflight@^1.0.4: 82 | version "1.0.6" 83 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 84 | dependencies: 85 | once "^1.3.0" 86 | wrappy "1" 87 | 88 | inherits@2: 89 | version "2.0.3" 90 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 91 | 92 | minimatch@^3.0.2: 93 | version "3.0.3" 94 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" 95 | dependencies: 96 | brace-expansion "^1.0.0" 97 | 98 | minimist@^1.2.0: 99 | version "1.2.0" 100 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 101 | 102 | minimist@0.0.8: 103 | version "0.0.8" 104 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 105 | 106 | mkdirp@^0.5.1: 107 | version "0.5.1" 108 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 109 | dependencies: 110 | minimist "0.0.8" 111 | 112 | once@^1.3.0: 113 | version "1.4.0" 114 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 115 | dependencies: 116 | wrappy "1" 117 | 118 | parse5@^2.2.1: 119 | version "2.2.3" 120 | resolved "https://registry.yarnpkg.com/parse5/-/parse5-2.2.3.tgz#0c4fc41c1000c5e6b93d48b03f8083837834e9f6" 121 | 122 | path-is-absolute@^1.0.0: 123 | version "1.0.1" 124 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 125 | 126 | reflect-metadata@^0.1.2: 127 | version "0.1.9" 128 | resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.9.tgz#987238dc87a516895fe457f130435ffbd763a4d4" 129 | 130 | rimraf@^2.5.4: 131 | version "2.5.4" 132 | resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" 133 | dependencies: 134 | glob "^7.0.5" 135 | 136 | rxjs@5.0.2: 137 | version "5.0.2" 138 | resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.0.2.tgz#cc6513756daa93cab4085c1b5a19a3e28fb6c6bf" 139 | dependencies: 140 | symbol-observable "^1.0.1" 141 | 142 | source-map-support@^0.4.2: 143 | version "0.4.8" 144 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.8.tgz#4871918d8a3af07289182e974e32844327b2e98b" 145 | dependencies: 146 | source-map "^0.5.3" 147 | 148 | source-map@^0.5.3, source-map@^0.5.6: 149 | version "0.5.6" 150 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" 151 | 152 | symbol-observable@^1.0.1: 153 | version "1.0.4" 154 | resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" 155 | 156 | tsickle@^0.2: 157 | version "0.2.3" 158 | resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.2.3.tgz#3e7d3ff74bbecdadc011cfd747f991dcfd6503af" 159 | dependencies: 160 | minimist "^1.2.0" 161 | mkdirp "^0.5.1" 162 | source-map "^0.5.6" 163 | source-map-support "^0.4.2" 164 | 165 | typescript@2.0.10: 166 | version "2.0.10" 167 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.0.10.tgz#ccdd4ed86fd5550a407101a0814012e1b3fac3dd" 168 | 169 | wrappy@1: 170 | version "1.0.2" 171 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 172 | 173 | zone.js@0.7.4: 174 | version "0.7.4" 175 | resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.4.tgz#0e624fe5b724450ee433495deff15c02b3908ee0" 176 | 177 | --------------------------------------------------------------------------------