/*!
* 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
*/
/* tslint:disable:use-input-property-decorator */
import {
Component,
NgModule,
Host,
ElementRef,
AfterViewInit,
SkipSelf,
ContentChildren,
forwardRef,
QueryList
} from '@angular/core';
import { NestedOptionHost, extractTemplate } from '../../core/nested-option';
import { DxTemplateDirective } from '../../core/template';
import { IDxTemplateHost, DxTemplateHost } from '../../core/template-host';
import { DxiContextMenuItem } from './base/context-menu-item-dxi';
import { DxiValidationRuleComponent } from './validation-rule-dxi';
import { DxiTabComponent } from './tab-dxi';
import { DxiLocationComponent } from './location-dxi';
@Component({
selector: 'dxi-item',
template: '',
styles: [':host { display: block; }'],
providers: [NestedOptionHost, DxTemplateHost],
inputs: [
'disabled',
'html',
'icon',
'iconSrc',
'template',
'text',
'title',
'visible',
'onClick',
'type',
'baseSize',
'box',
'ratio',
'beginGroup',
'closeMenuOnClick',
'items',
'selectable',
'selected',
'colSpan',
'cssClass',
'dataField',
'editorOptions',
'editorType',
'helpText',
'isRequired',
'itemType',
'label',
'name',
'validationRules',
'visibleIndex',
'alignItemLabels',
'caption',
'colCount',
'colCountByScreen',
'tabPanelOptions',
'tabs',
'badge',
'tabTemplate',
'imageAlt',
'imageSrc',
'key',
'showChevron',
'titleTemplate',
'location',
'menuTemplate',
'heightRatio',
'widthRatio',
'locateInMenu',
'menuItemTemplate',
'options',
'showText',
'widget',
'expanded',
'hasItems',
'parentId'
]
})
export class DxiItemComponent extends DxiContextMenuItem implements AfterViewInit, IDxTemplateHost {
protected get _optionPath() {
return 'items';
}
@ContentChildren(forwardRef(() => DxiItemComponent))
get itemsChildren(): QueryList {
return this._getOption('items');
}
set itemsChildren(value) {
this.setChildren('items', value);
}
@ContentChildren(forwardRef(() => DxiValidationRuleComponent))
get validationRulesChildren(): QueryList {
return this._getOption('validationRules');
}
set validationRulesChildren(value) {
this.setChildren('validationRules', value);
}
@ContentChildren(forwardRef(() => DxiTabComponent))
get tabsChildren(): QueryList {
return this._getOption('tabs');
}
set tabsChildren(value) {
this.setChildren('tabs', value);
}
@ContentChildren(forwardRef(() => DxiLocationComponent))
get locationChildren(): QueryList {
return this._getOption('location');
}
set locationChildren(value) {
this.setChildren('location', 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: [
DxiItemComponent
],
exports: [
DxiItemComponent
],
})
export class DxiItemModule { }