/*! * devextreme-angular-test * Version: 17.2.8 * Build date: Mon Feb 05 2018 * * Copyright (c) 2012 - 2018 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-angular */ import { Component, NgModule, Host, ElementRef, AfterViewInit, SkipSelf, Input, ContentChildren, forwardRef, QueryList } from '@angular/core'; import DevExpress from 'devextreme/bundles/dx.all'; import { NestedOptionHost, extractTemplate } from '../../core/nested-option'; import { DxTemplateDirective } from '../../core/template'; import { IDxTemplateHost, DxTemplateHost } from '../../core/template-host'; import { CollectionNestedOption } from '../../core/nested-option'; import { DxiItemComponent } from './item-dxi'; @Component({ selector: 'dxi-tab', template: '', styles: [':host { display: block; }'], providers: [NestedOptionHost, DxTemplateHost] }) export class DxiTabComponent extends CollectionNestedOption implements AfterViewInit, IDxTemplateHost { @Input() get alignItemLabels(): boolean { return this._getOption('alignItemLabels'); } set alignItemLabels(value: boolean) { this._setOption('alignItemLabels', value); } @Input() get badge(): string { return this._getOption('badge'); } set badge(value: string) { this._setOption('badge', value); } @Input() get colCount(): number { return this._getOption('colCount'); } set colCount(value: number) { this._setOption('colCount', value); } @Input() get colCountByScreen(): any { return this._getOption('colCountByScreen'); } set colCountByScreen(value: any) { this._setOption('colCountByScreen', value); } @Input() get disabled(): boolean { return this._getOption('disabled'); } set disabled(value: boolean) { this._setOption('disabled', value); } @Input() get icon(): string { return this._getOption('icon'); } set icon(value: string) { this._setOption('icon', value); } @Input() get items(): Array { return this._getOption('items'); } set items(value: Array) { this._setOption('items', value); } @Input() get tabTemplate(): any { return this._getOption('tabTemplate'); } set tabTemplate(value: any) { this._setOption('tabTemplate', value); } @Input() get template(): any { return this._getOption('template'); } set template(value: any) { this._setOption('template', value); } @Input() get title(): string { return this._getOption('title'); } set title(value: string) { this._setOption('title', value); } protected get _optionPath() { return 'tabs'; } @ContentChildren(forwardRef(() => DxiItemComponent)) get itemsChildren(): QueryList { return this._getOption('items'); } set itemsChildren(value) { this.setChildren('items', value); } constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost, @Host() optionHost: NestedOptionHost, @Host() templateHost: DxTemplateHost, private element: ElementRef) { super(); parentOptionHost.setNestedOption(this); optionHost.setHost(this, this._fullOptionPath.bind(this)); templateHost.setHost(this); } setTemplate(template: DxTemplateDirective) { this.template = template; } ngAfterViewInit() { extractTemplate(this, this.element); } } @NgModule({ declarations: [ DxiTabComponent ], exports: [ DxiTabComponent ], }) export class DxiTabModule { }