/*!
* 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 DxScrollView from 'devextreme/ui/scroll_view';
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 ScrollView is a widget that enables a user to scroll its content.
*/
@Component({
selector: 'dx-scroll-view',
template: '',
providers: [
DxTemplateHost,
WatcherHelper,
NestedOptionHost
]
})
export class DxScrollViewComponent extends DxComponent implements OnDestroy {
instance: DxScrollView;
/**
* A Boolean value specifying whether to enable or disable the bounce-back effect.
*/
@Input()
get bounceEnabled(): boolean {
return this._getOption('bounceEnabled');
}
set bounceEnabled(value: boolean) {
this._setOption('bounceEnabled', value);
}
/**
* A string value specifying the available scrolling directions.
*/
@Input()
get direction(): string {
return this._getOption('direction');
}
set direction(value: string) {
this._setOption('direction', value);
}
/**
* A Boolean value specifying whether or not the widget can respond to user interaction.
*/
@Input()
get disabled(): boolean {
return this._getOption('disabled');
}
set disabled(value: boolean) {
this._setOption('disabled', value);
}
/**
* 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 text shown in the pullDown panel when pulling the content down lowers the refresh threshold.
*/
@Input()
get pulledDownText(): string {
return this._getOption('pulledDownText');
}
set pulledDownText(value: string) {
this._setOption('pulledDownText', value);
}
/**
* Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold.
*/
@Input()
get pullingDownText(): string {
return this._getOption('pullingDownText');
}
set pullingDownText(value: string) {
this._setOption('pullingDownText', value);
}
/**
* Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom.
*/
@Input()
get reachBottomText(): string {
return this._getOption('reachBottomText');
}
set reachBottomText(value: string) {
this._setOption('reachBottomText', value);
}
/**
* Specifies the text shown in the pullDown panel displayed when the content is being refreshed.
*/
@Input()
get refreshingText(): string {
return this._getOption('refreshingText');
}
set refreshingText(value: string) {
this._setOption('refreshingText', 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);
}
/**
* A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. Applies only if useNative is false
*/
@Input()
get scrollByContent(): boolean {
return this._getOption('scrollByContent');
}
set scrollByContent(value: boolean) {
this._setOption('scrollByContent', value);
}
/**
* A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar.
*/
@Input()
get scrollByThumb(): boolean {
return this._getOption('scrollByThumb');
}
set scrollByThumb(value: boolean) {
this._setOption('scrollByThumb', value);
}
/**
* Specifies when the widget shows the scrollbar.
*/
@Input()
get showScrollbar(): string {
return this._getOption('showScrollbar');
}
set showScrollbar(value: string) {
this._setOption('showScrollbar', value);
}
/**
* Indicates whether to use native or simulated scrolling.
*/
@Input()
get useNative(): boolean {
return this._getOption('useNative');
}
set useNative(value: boolean) {
this._setOption('useNative', 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 pullDown event.
*/
@Output() onPullDown: EventEmitter;
/**
* A handler for the reachBottom event.
*/
@Output() onReachBottom: EventEmitter;
/**
* A handler for the scroll event.
*/
@Output() onScroll: EventEmitter;
/**
* A handler for the update event.
*/
@Output() onUpdated: EventEmitter;
/**
* A handler for the bounceEnabledChange event.
*/
@Output() bounceEnabledChange: EventEmitter;
/**
* A handler for the directionChange event.
*/
@Output() directionChange: EventEmitter;
/**
* A handler for the disabledChange event.
*/
@Output() disabledChange: EventEmitter;
/**
* A handler for the elementAttrChange event.
*/
@Output() elementAttrChange: EventEmitter;
/**
* A handler for the heightChange event.
*/
@Output() heightChange: EventEmitter;
/**
* A handler for the pulledDownTextChange event.
*/
@Output() pulledDownTextChange: EventEmitter;
/**
* A handler for the pullingDownTextChange event.
*/
@Output() pullingDownTextChange: EventEmitter;
/**
* A handler for the reachBottomTextChange event.
*/
@Output() reachBottomTextChange: EventEmitter;
/**
* A handler for the refreshingTextChange event.
*/
@Output() refreshingTextChange: EventEmitter;
/**
* A handler for the rtlEnabledChange event.
*/
@Output() rtlEnabledChange: EventEmitter;
/**
* A handler for the scrollByContentChange event.
*/
@Output() scrollByContentChange: EventEmitter;
/**
* A handler for the scrollByThumbChange event.
*/
@Output() scrollByThumbChange: EventEmitter;
/**
* A handler for the showScrollbarChange event.
*/
@Output() showScrollbarChange: EventEmitter;
/**
* A handler for the useNativeChange event.
*/
@Output() useNativeChange: 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: 'pullDown', emit: 'onPullDown' },
{ subscribe: 'reachBottom', emit: 'onReachBottom' },
{ subscribe: 'scroll', emit: 'onScroll' },
{ subscribe: 'updated', emit: 'onUpdated' },
{ emit: 'bounceEnabledChange' },
{ emit: 'directionChange' },
{ emit: 'disabledChange' },
{ emit: 'elementAttrChange' },
{ emit: 'heightChange' },
{ emit: 'pulledDownTextChange' },
{ emit: 'pullingDownTextChange' },
{ emit: 'reachBottomTextChange' },
{ emit: 'refreshingTextChange' },
{ emit: 'rtlEnabledChange' },
{ emit: 'scrollByContentChange' },
{ emit: 'scrollByThumbChange' },
{ emit: 'showScrollbarChange' },
{ emit: 'useNativeChange' },
{ emit: 'widthChange' }
]);
optionHost.setHost(this);
}
protected _createInstance(element, options) {
return new DxScrollView(element, options);
}
ngOnDestroy() {
this._destroyWidget();
}
}
@NgModule({
imports: [
DxTemplateModule
],
declarations: [
DxScrollViewComponent
],
exports: [
DxScrollViewComponent,
DxTemplateModule
],
providers: [EventsRegistrator]
})
export class DxScrollViewModule { }