/*! * 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 } from '@angular/core'; 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'; @Component({ selector: 'dxi-toolbar-item', template: '', styles: [':host { display: block; }'], providers: [NestedOptionHost, DxTemplateHost] }) export class DxiToolbarItemComponent extends CollectionNestedOption implements AfterViewInit, IDxTemplateHost { @Input() get disabled(): boolean { return this._getOption('disabled'); } set disabled(value: boolean) { this._setOption('disabled', value); } @Input() get html(): string { return this._getOption('html'); } set html(value: string) { this._setOption('html', value); } @Input() get location(): string { return this._getOption('location'); } set location(value: string) { this._setOption('location', value); } @Input() get options(): any { return this._getOption('options'); } set options(value: any) { this._setOption('options', value); } @Input() get template(): any { return this._getOption('template'); } set template(value: any) { this._setOption('template', value); } @Input() get text(): string { return this._getOption('text'); } set text(value: string) { this._setOption('text', value); } @Input() get toolbar(): string { return this._getOption('toolbar'); } set toolbar(value: string) { this._setOption('toolbar', value); } @Input() get visible(): boolean { return this._getOption('visible'); } set visible(value: boolean) { this._setOption('visible', value); } @Input() get widget(): string { return this._getOption('widget'); } set widget(value: string) { this._setOption('widget', value); } protected get _optionPath() { return 'toolbarItems'; } 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: [ DxiToolbarItemComponent ], exports: [ DxiToolbarItemComponent ], }) export class DxiToolbarItemModule { }