/*!
* 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,
ElementRef,
NgZone,
Input,
Output,
OnDestroy,
Injector,
EventEmitter
} from '@angular/core';
import DxValidationGroup from 'devextreme/ui/validation_group';
import { DxComponent } from '../core/component';
import { DxTemplateHost } from '../core/template-host';
import { DxTemplateModule } from '../core/template';
import { EventsRegistrator } from '../core/events-strategy';
import { NestedOptionHost } from '../core/nested-option';
import { WatcherHelper } from '../core/watcher-helper';
/**
* The widget that is used in the Knockout and AngularJS approaches to combine the editors to be validated.
*/
@Component({
selector: 'dx-validation-group',
template: '',
providers: [
DxTemplateHost,
WatcherHelper,
NestedOptionHost
]
})
export class DxValidationGroupComponent extends DxComponent implements OnDestroy {
instance: DxValidationGroup;
/**
* Specifies the attributes to be attached to the widget's root element.
*/
@Input()
get elementAttr(): any {
return this._getOption('elementAttr');
}
set elementAttr(value: any) {
this._setOption('elementAttr', value);
}
/**
* Specifies the widget's height.
*/
@Input()
get height(): number|
Function|
string {
return this._getOption('height');
}
set height(value: number|
Function|
string) {
this._setOption('height', value);
}
/**
* Specifies the widget's width.
*/
@Input()
get width(): number|
Function|
string {
return this._getOption('width');
}
set width(value: number|
Function|
string) {
this._setOption('width', value);
}
/**
* A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only.
*/
@Output() onDisposing: EventEmitter;
/**
* A handler for the initialized event. Executed only once, after the widget is initialized.
*/
@Output() onInitialized: EventEmitter;
/**
* A handler for the optionChanged event. Executed after an option of the widget is changed.
*/
@Output() onOptionChanged: EventEmitter;
/**
* A handler for the elementAttrChange event.
*/
@Output() elementAttrChange: EventEmitter;
/**
* A handler for the heightChange event.
*/
@Output() heightChange: EventEmitter;
/**
* A handler for the widthChange event.
*/
@Output() widthChange: EventEmitter;
constructor(elementRef: ElementRef, ngZone: NgZone, templateHost: DxTemplateHost, injector: Injector,
_watcherHelper: WatcherHelper, optionHost: NestedOptionHost) {
super(elementRef, ngZone, templateHost, _watcherHelper);
injector.get(EventsRegistrator);
this._createEventEmitters([
{ subscribe: 'disposing', emit: 'onDisposing' },
{ subscribe: 'initialized', emit: 'onInitialized' },
{ subscribe: 'optionChanged', emit: 'onOptionChanged' },
{ emit: 'elementAttrChange' },
{ emit: 'heightChange' },
{ emit: 'widthChange' }
]);
optionHost.setHost(this);
}
protected _createInstance(element, options) {
return new DxValidationGroup(element, options);
}
ngOnDestroy() {
this._destroyWidget();
}
}
@NgModule({
imports: [
DxTemplateModule
],
declarations: [
DxValidationGroupComponent
],
exports: [
DxValidationGroupComponent,
DxTemplateModule
],
providers: [EventsRegistrator]
})
export class DxValidationGroupModule { }