UNPKG

ng2-materialize

Version:

An Angular 2+ wrap around Materialize library

42 lines (41 loc) 1.93 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var tab_item_component_1 = require("./tab-item/tab-item.component"); var MzTabComponent = (function () { function MzTabComponent() { } MzTabComponent.prototype.ngAfterViewInit = function () { this.initTabs(); }; MzTabComponent.prototype.initTabs = function () { var options = { onShow: this.onShow, responsiveThreshold: this.responsiveThreshold, swipeable: this.swipeable, }; $(this.tabs.nativeElement).tabs(options); }; MzTabComponent.prototype.selectTab = function (tabItemId) { $(this.tabs.nativeElement).tabs('select_tab', tabItemId); }; return MzTabComponent; }()); MzTabComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'mz-tab', template: "<ul #tabs class=\"tabs\" [class.tabs-fixed-width]=\"fixedTabWidth\"><li class=\"tab\" [class.disabled]=\"tabItem.disabled\" *ngFor=\"let tabItem of tabItems.toArray()\"><a [class.active]=\"tabItem.active\" href=\"{{ tabItem.href ? tabItem.href : '#' + tabItem.link }}\" target=\"{{ tabItem.target }}\">{{ tabItem.label }}</a></li></ul><div><ng-content select=\"mz-tab-item\"></ng-content></div>", styles: [""], },] }, ]; /** @nocollapse */ MzTabComponent.ctorParameters = function () { return []; }; MzTabComponent.propDecorators = { 'fixedTabWidth': [{ type: core_1.Input },], 'onShow': [{ type: core_1.Input },], 'responsiveThreshold': [{ type: core_1.Input },], 'swipeable': [{ type: core_1.Input },], 'tabs': [{ type: core_1.ViewChild, args: ['tabs',] },], 'tabItems': [{ type: core_1.ContentChildren, args: [tab_item_component_1.MzTabItemComponent,] },], }; exports.MzTabComponent = MzTabComponent;