/*!
* 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 DxResizable from 'devextreme/ui/resizable';
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 Resizable widget enables its content to be resizable in the UI.
*/
@Component({
selector: 'dx-resizable',
template: '',
providers: [
DxTemplateHost,
WatcherHelper,
NestedOptionHost
]
})
export class DxResizableComponent extends DxComponent implements OnDestroy {
instance: DxResizable;
/**
* 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 which borders of the widget element are used as a handle.
*/
@Input()
get handles(): string {
return this._getOption('handles');
}
set handles(value: string) {
this._setOption('handles', 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 upper height boundary for resizing.
*/
@Input()
get maxHeight(): number {
return this._getOption('maxHeight');
}
set maxHeight(value: number) {
this._setOption('maxHeight', value);
}
/**
* Specifies the upper width boundary for resizing.
*/
@Input()
get maxWidth(): number {
return this._getOption('maxWidth');
}
set maxWidth(value: number) {
this._setOption('maxWidth', value);
}
/**
* Specifies the lower height boundary for resizing.
*/
@Input()
get minHeight(): number {
return this._getOption('minHeight');
}
set minHeight(value: number) {
this._setOption('minHeight', value);
}
/**
* Specifies the lower width boundary for resizing.
*/
@Input()
get minWidth(): number {
return this._getOption('minWidth');
}
set minWidth(value: number) {
this._setOption('minWidth', value);
}
/**
* Switches the widget to a right-to-left representation.
*/
@Input()
get rtlEnabled(): boolean {
return this._getOption('rtlEnabled');
}
set rtlEnabled(value: boolean) {
this._setOption('rtlEnabled', 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 resize event.
*/
@Output() onResize: EventEmitter;
/**
* A handler for the resizeEnd event.
*/
@Output() onResizeEnd: EventEmitter;
/**
* A handler for the resizeStart event.
*/
@Output() onResizeStart: EventEmitter;
/**
* A handler for the elementAttrChange event.
*/
@Output() elementAttrChange: EventEmitter;
/**
* A handler for the handlesChange event.
*/
@Output() handlesChange: EventEmitter;
/**
* A handler for the heightChange event.
*/
@Output() heightChange: EventEmitter;
/**
* A handler for the maxHeightChange event.
*/
@Output() maxHeightChange: EventEmitter;
/**
* A handler for the maxWidthChange event.
*/
@Output() maxWidthChange: EventEmitter;
/**
* A handler for the minHeightChange event.
*/
@Output() minHeightChange: EventEmitter;
/**
* A handler for the minWidthChange event.
*/
@Output() minWidthChange: EventEmitter;
/**
* A handler for the rtlEnabledChange event.
*/
@Output() rtlEnabledChange: 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' },
{ subscribe: 'resize', emit: 'onResize' },
{ subscribe: 'resizeEnd', emit: 'onResizeEnd' },
{ subscribe: 'resizeStart', emit: 'onResizeStart' },
{ emit: 'elementAttrChange' },
{ emit: 'handlesChange' },
{ emit: 'heightChange' },
{ emit: 'maxHeightChange' },
{ emit: 'maxWidthChange' },
{ emit: 'minHeightChange' },
{ emit: 'minWidthChange' },
{ emit: 'rtlEnabledChange' },
{ emit: 'widthChange' }
]);
optionHost.setHost(this);
}
protected _createInstance(element, options) {
return new DxResizable(element, options);
}
ngOnDestroy() {
this._destroyWidget();
}
}
@NgModule({
imports: [
DxTemplateModule
],
declarations: [
DxResizableComponent
],
exports: [
DxResizableComponent,
DxTemplateModule
],
providers: [EventsRegistrator]
})
export class DxResizableModule { }