UNPKG

2.62 kBJavaScriptView Raw
1import { Component, Input, Output, EventEmitter } from '@angular/core';
2var StoreComponent = /** @class */ (function () {
3 function StoreComponent() {
4 this.items = [];
5 this.searchable = true;
6 this.itemClicked = new EventEmitter();
7 }
8 Object.defineProperty(StoreComponent.prototype, "filteredItems", {
9 get: function () {
10 var _this = this;
11 if (this.filterTerm) {
12 return this.items.filter(function (pkg) { return pkg.name.toLowerCase().indexOf(_this.filterTerm.toLowerCase()) !== -1; });
13 }
14 return this.items;
15 },
16 enumerable: true,
17 configurable: true
18 });
19 StoreComponent.decorators = [
20 { type: Component, args: [{
21 selector: 'va-store',
22 template: "\n <div class=\"toolbar\">\n <div *ngIf=\"searchable\" class=\"table-controls-row\">\n <va-search-box (update)=\"filterTerm = $event\"></va-search-box>\n </div>\n </div>\n <div class=\"row row-gutters\">\n <div *ngFor=\"let item of filteredItems\" class=\"col-flex\">\n <va-store-card [item]=\"item\" (cardClicked)=\"this.itemClicked.emit(item)\"></va-store-card>\n </div>\n </div>\n ",
23 styles: [".flex-row { display: flex; flex-direction: row; } .toolbar { padding: 0; background-color: #ffffff; color: #616161; } .toolbar .disabled { cursor: default; } .toolbar .disabled mat-icon { cursor: default; color: #9e9e9e; } .toolbar va-search-box { margin-right: 10px; width: 350px; } .toolbar .table-controls-row { padding: 0 10px 10px; display: flex; flex-direction: row; align-items: center; } .toolbar .table-controls-row:first-of-type { padding-top: 10px; } .top-border { border-top: 1px solid #ffffff; } .selected { background-color: #ffffff; } .row { display: flex; flex-wrap: wrap; } .row + .row-gutters { margin-top: 0; } .row-gutters { margin-top: -20px; margin-left: -20px; } .row-gutters > .col-flex { padding-top: 20px; padding-left: 20px; } .col-flex { position: relative; max-width: 100%; box-sizing: border-box; flex: 0 0 auto; width: 100%; } @media screen and (min-width: 480px) { .col-flex { width: 50%; } } @media screen and (min-width: 1200px) { .col-flex { width: 33.333333%; } } "]
24 },] },
25 ];
26 /** @nocollapse */
27 StoreComponent.ctorParameters = function () { return []; };
28 StoreComponent.propDecorators = {
29 "items": [{ type: Input },],
30 "searchable": [{ type: Input },],
31 "itemClicked": [{ type: Output },],
32 };
33 return StoreComponent;
34}());
35export { StoreComponent };