"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require("@angular/core");
var static_1 = require("@angular/upgrade/static");
var angular = require("angular");
var _ = require("lodash");
var moment = require("moment");
var typescript_angular_utilities_1 = require("typescript-angular-utilities");
var __timezone = typescript_angular_utilities_1.services.timezone;
var componentsDowngrade_1 = require("../../source/componentsDowngrade");
exports.moduleName = 'CardTestModule';
var CardTestController = (function () {
    function CardTestController(cardContainerBuilderFactory) {
        __timezone.timezoneService.setCurrentTimezone('-08:00');
        var items = _.map(_.range(1, 101), function (num) {
            var value = Math.floor(Math.random() * 2) + 1;
            return {
                name: 'Item' + num,
                value: value,
                date: moment().subtract(value, 'days'),
            };
        });
        this.options = [1, 2];
        this.builder = cardContainerBuilderFactory.getInstance();
        this.builder.dataSource.buildSimpleDataSource(_.cloneDeep(items));
        this.builder.usePaging();
        this.builder.addColumn({
            label: 'Name',
            size: 6,
            getValue: 'name',
        });
        this.builder.addColumn({
            label: 'Value',
            size: 6,
            getValue: 'value',
            template: '<b>{{myItem.value}}</b>',
        });
        this.builder.renderFilters();
        this.builder.filters.buildModeFilterGroup({
            label: 'Mode Filter',
            type: 'modeFilter',
            getValue: 'value',
            options: [
                {
                    label: 'All',
                    displayAll: true,
                },
                {
                    label: '1',
                    value: 1,
                },
                {
                    label: '2',
                    value: 2,
                },
            ],
        });
        this.builderWithSearch = cardContainerBuilderFactory.getInstance();
        this.builderWithSearch.dataSource.buildSimpleDataSource(_.cloneDeep(items));
        this.builder.usePaging();
        this.builderWithSearch.addColumn({
            label: 'Name',
            size: 6,
            getValue: 'name',
        });
        this.builderWithSearch.addColumn({
            label: 'Value',
            size: 6,
            getValue: 'value',
            template: '<b>{{myItem.value}}</b>',
        });
        this.builderWithSearch.useSearch();
        this.builderWithSelectFilter = cardContainerBuilderFactory.getInstance();
        this.dataSource = this.builderWithSelectFilter.dataSource.buildSimpleDataSource(_.cloneDeep(items));
        this.builderWithSelectFilter.usePaging();
        this.builderWithSelectFilter.addColumn({
            label: 'Name',
            size: 6,
            getValue: 'name',
        });
        this.builderWithSelectFilter.addColumn({
            label: 'Value',
            size: 6,
            getValue: 'value',
            template: '<b>{{myItem.value}}</b>',
        });
        this.selectFilter = this.builderWithSelectFilter.filters.buildSelectFilter({
            valueSelector: 'value',
        });
        this.builderWithDateFilter = cardContainerBuilderFactory.getInstance();
        this.dataSource = this.builderWithDateFilter.dataSource.buildSimpleDataSource(_.cloneDeep(items));
        this.builderWithDateFilter.usePaging();
        this.builderWithDateFilter.addColumn({
            label: 'Name',
            size: 6,
            getValue: 'name',
        });
        this.builderWithDateFilter.addColumn({
            label: 'Date',
            size: 6,
            getValue: 'date',
            template: '<b>{{myItem.date | rlDate}}</b>',
        });
        this.dateFilter = this.builderWithDateFilter.filters.buildDateFilter({
            type: 'dateFilter',
            valueSelector: 'date',
        });
    }
    return CardTestController;
}());
CardTestController.$inject = [componentsDowngrade_1.cardContainerBuilderServiceName];
var CardsNg1BootstrapperComponent = (function () {
    function CardsNg1BootstrapperComponent() {
    }
    return CardsNg1BootstrapperComponent;
}());
CardsNg1BootstrapperComponent = __decorate([
    core_1.Component({
        selector: 'tsCardsNg1Bootstrapper',
        template: '<tsCardsNg1></tsCardsNg1>'
    })
], CardsNg1BootstrapperComponent);
exports.CardsNg1BootstrapperComponent = CardsNg1BootstrapperComponent;
var CardsNg1Directive = (function (_super) {
    __extends(CardsNg1Directive, _super);
    function CardsNg1Directive(elementRef, injector) {
        return _super.call(this, 'tsCardsNg1', elementRef, injector) || this;
    }
    return CardsNg1Directive;
}(static_1.UpgradeComponent));
CardsNg1Directive = __decorate([
    core_1.Directive({
        selector: 'tsCardsNg1'
    }),
    __metadata("design:paramtypes", [core_1.ElementRef, core_1.Injector])
], CardsNg1Directive);
exports.CardsNg1Directive = CardsNg1Directive;
angular.module(exports.moduleName, [])
    .component('tsCardsNg1', {
    template: require('./cardsNg1.html'),
    controller: 'CardTestController',
    controllerAs: 'cards',
})
    .controller('CardTestController', CardTestController);
//# sourceMappingURL=data:application/json;base64, 