import { __decorate, __metadata } from "tslib";
import { Component, Input, Output, EventEmitter } from '@angular/core';
var StoreComponent = /** @class */ (function () {
    function StoreComponent() {
        this.items = [];
        this.showAllPrices = false;
        this.searchable = true;
        this.itemClicked = new EventEmitter();
    }
    Object.defineProperty(StoreComponent.prototype, "filteredItems", {
        get: function () {
            var _this = this;
            if (this.filterTerm) {
                return this.items.filter(function (pkg) { return pkg.name.toLowerCase().indexOf(_this.filterTerm.toLowerCase()) !== -1; });
            }
            return this.items;
        },
        enumerable: true,
        configurable: true
    });
    __decorate([
        Input(),
        __metadata("design:type", Array)
    ], StoreComponent.prototype, "items", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], StoreComponent.prototype, "showAllPrices", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], StoreComponent.prototype, "searchable", void 0);
    __decorate([
        Output(),
        __metadata("design:type", Object)
    ], StoreComponent.prototype, "itemClicked", void 0);
    StoreComponent = __decorate([
        Component({
            selector: 'va-store',
            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)\" [showAllPrices]=\"showAllPrices\"></va-store-card>\n      </div>\n  </div>\n  ",
            styles: [".flex-row{display:flex;flex-direction:row}.toolbar{padding:0;background-color:#fff;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 #fff}.selected{background-color:#fff}.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%}}"]
        })
    ], StoreComponent);
    return StoreComponent;
}());
export { StoreComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHZlbmRhc3RhL3N0b3JlLyIsInNvdXJjZXMiOlsibGliL3N0b3JlLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBVSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBQyxNQUFNLGVBQWUsQ0FBQztBQW9COUU7SUFBQTtRQUNXLFVBQUssR0FBZ0IsRUFBRSxDQUFDO1FBQ3hCLGtCQUFhLEdBQUcsS0FBSyxDQUFDO1FBQ3RCLGVBQVUsR0FBRyxJQUFJLENBQUM7UUFFakIsZ0JBQVcsR0FBRyxJQUFJLFlBQVksRUFBYSxDQUFDO0lBVXhELENBQUM7SUFOQyxzQkFBSSx5Q0FBYTthQUFqQjtZQUFBLGlCQUtDO1lBSkMsSUFBSSxJQUFJLENBQUMsVUFBVSxFQUFFO2dCQUNuQixPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLFVBQUEsR0FBRyxJQUFJLE9BQUEsR0FBRyxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBQyxPQUFPLENBQUMsS0FBSSxDQUFDLFVBQVUsQ0FBQyxXQUFXLEVBQUUsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFwRSxDQUFvRSxDQUFDLENBQUM7YUFDdkc7WUFDRCxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUM7UUFDcEIsQ0FBQzs7O09BQUE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