@progress/kendo-angular-scrollview
Advanced tools
Comparing version 0.8.4 to 0.8.5
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("rxjs/symbol/iterator"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","rxjs/symbol/iterator","@angular/common"],t):"object"==typeof exports?exports.KendoAngularScrollview=t(require("@angular/core"),require("rxjs/symbol/iterator"),require("@angular/common")):e.KendoAngularScrollview=t(e["@angular/core"],e["rxjs/symbol/iterator"],e["@angular/common"])}(this,function(e,t,n){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var i=n(1);t.ScrollViewComponent=i.ScrollViewComponent;var o=n(6);t.ScrollViewModule=o.ScrollViewModule;var r=n(8);t.ScrollViewPagerComponent=r.ScrollViewPagerComponent;var a=n(9);t.KendoDraggableDirective=a.KendoDraggableDirective},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(3),s=n(4),l=function(){function e(e,t){var n=this;this.element=e,this.application=t,this.data=[],this.endless=!1,this.animate=!0,this.pageable=!1,this.arrows=!1,this.itemChanged=new r.EventEmitter,this.animationState=null,this.transitionStyle={},this.view=new s.DataCollection(function(){return new s.DataResultIterator(n.data,n.activeIndex,n.endless,n.pageIndex)}),this.isDataSourceEmpty=!1,this._activeIndex=0,this.index=0,this.pageIndex=null,this.transforms=["translateX(-100%)","translateX(0%)","translateX(100%)"]}return Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(e){this.index=this._activeIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollViewClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostWidth",{get:function(){return this.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostHeight",{get:function(){return this.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaLive",{get:function(){return"assertive"},enumerable:!0,configurable:!0}),e.prototype.keyDown=function(e){e.keyCode===a.Keys.LeftArrow&&this.prev(),e.keyCode===a.Keys.RightArrow&&this.next()},e.prototype.ngOnChanges=function(e){this.activeIndex=Math.max(Math.min(this.activeIndex,this.view.total-1),0)},e.prototype.prev=function(){this.navigate(a.Dir.Prev)},e.prototype.next=function(){this.navigate(a.Dir.Next)},e.prototype.transitionEndHandler=function(e){this.animationState=null,"left"!==e.toState&&"right"!==e.toState||(null!==this.pageIndex&&(this.activeIndex=this.pageIndex,this.pageIndex=null),this.activeIndex=this.index,this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)}),this.application.tick())},e.prototype.handlePress=function(e){this.initialTouchCoordinate=e.pageX},e.prototype.handleDrag=function(e){var t=e.pageX-this.initialTouchCoordinate;this.animationState||this.isDragForbidden(t)||!this.draggedInsideBounds(t)||(this.transitionStyle={transform:"translateX("+t+"px)"})},e.prototype.handleRelease=function(e){var t=e.pageX-this.initialTouchCoordinate;this.isDragForbidden(t)||(this.draggedEnoughToNavigate(t)?(this.changeIndex(t>0?a.Dir.Prev:a.Dir.Next),this.animate||(this.transitionStyle=null,this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)}))):Math.abs(t)>0&&(this.animate?this.animationState="center":this.transitionStyle=null))},e.prototype.pageChange=function(e){this.animationState||this.activeIndex===e||(this.animate?(this.pageIndex=e,this.animationState=this.pageIndex>this.index?"left":"right"):this.activeIndex=e)},e.prototype.inlineStyles=function(e){return{height:this.height,transform:this.transforms[e],width:this.width}},e.prototype.displayPrevArrow=function(){return(this.endless||this.activeIndex>0)&&this.view.total>0},e.prototype.displayNextArrow=function(){return(this.endless||this.activeIndex+1<this.view.total)&&this.view.total>0},e.prototype.draggedInsideBounds=function(e){return Math.abs(e)<=this.element.nativeElement.offsetWidth},e.prototype.draggedEnoughToNavigate=function(e){return Math.abs(e)>this.element.nativeElement.offsetWidth/2},e.prototype.isDragForbidden=function(e){return!this.endless&&(0===this.activeIndex&&e>0||this.activeIndex===this.view.total-1&&e<0)},e.prototype.navigate=function(e){this.isDataSourceEmpty||this.animationState||(this.changeIndex(e),this.animate||this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)}))},e.prototype.changeIndex=function(e){e===a.Dir.Next&&this.view.canMoveNext()?(this.index=(this.index+1)%this.view.total,this.animate?this.animationState="left":this.activeIndex=this.index):this.view.canMovePrev()&&(this.index=0===this.index?this.view.total-1:this.index-1,this.animate?this.animationState="right":this.activeIndex=this.index)},i([r.Input(),o("design:type",Array)],e.prototype,"data",void 0),i([r.Input(),o("design:type",Number),o("design:paramtypes",[Number])],e.prototype,"activeIndex",null),i([r.Input(),o("design:type",String)],e.prototype,"width",void 0),i([r.Input(),o("design:type",String)],e.prototype,"height",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"endless",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"animate",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"pageable",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"arrows",void 0),i([r.Output(),o("design:type",r.EventEmitter)],e.prototype,"itemChanged",void 0),i([r.ContentChild(r.TemplateRef),o("design:type",r.TemplateRef)],e.prototype,"itemTemplateRef",void 0),i([r.HostBinding("class.k-widget"),o("design:type",Boolean)],e.prototype,"widgetClass",null),i([r.HostBinding("class.k-scrollview-wrap"),o("design:type",Boolean)],e.prototype,"scrollViewClass",null),i([r.HostBinding("style.width"),o("design:type",String)],e.prototype,"hostWidth",null),i([r.HostBinding("style.height"),o("design:type",String)],e.prototype,"hostHeight",null),i([r.HostBinding("attr.tabindex"),o("design:type",Number)],e.prototype,"tabIndex",null),i([r.HostBinding("attr.aria-live"),o("design:type",String)],e.prototype,"ariaLive",null),i([r.HostListener("keydown",["$event"]),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],e.prototype,"keyDown",null),e=i([r.Component({animations:[r.trigger("animateTo",[r.state("center, left, right",r.style({transform:"translateX(0)"})),r.transition("* => right",[r.animate("300ms ease-out",r.style({transform:"translateX(100%)"}))]),r.transition("* => left",[r.animate("300ms ease-out",r.style({transform:"translateX(-100%)"}))]),r.transition("* => center",[r.animate("300ms ease-out")])])],exportAs:"kendoScrollView",selector:"kendo-scrollview",template:'\n <ul class=\'k-scrollview\'\n [ngStyle]="transitionStyle"\n [@animateTo]="animationState"\n (@animateTo.done)= "transitionEndHandler($event)"\n (kendo.drag) = "handleDrag($event)"\n (kendo.press) = "handlePress($event)"\n (kendo.release) = "handleRelease($event)"\n kendoDraggable>\n <li *ngFor="let item of view;let i=index"\n [ngStyle]="inlineStyles(i)"\n [attr.aria-hidden]="i !== 1">\n <template\n [ngTemplateOutlet]="itemTemplateRef"\n [ngOutletContext]="{ item: item }">\n </template>\n </li>\n </ul>\n <div class=\'k-scrollview-elements\'\n [ngStyle]="{\'height\': height}"\n *ngIf="!isDataSourceEmpty && (pageable||arrows)">\n <a class="k-scrollview-prev"\n aria-label="previous"\n *ngIf="arrows && displayPrevArrow()"\n (click)="prev()">\n <span class="k-icon k-i-arrowhead-w"></span>\n </a>\n <a class="k-scrollview-next"\n aria-label="next"\n *ngIf="arrows && displayNextArrow()"\n (click)="next()">\n <span class="k-icon k-i-arrowhead-e"></span>\n </a>\n <kendo-scrollview-pager *ngIf="pageable"\n (pagerIndexChange)="pageChange($event)"\n [data]="data"\n [activeIndex]="activeIndex">\n </kendo-scrollview-pager>\n </div>\n '}),o("design:paramtypes",[r.ElementRef,r.ApplicationRef])],e)}();t.ScrollViewComponent=l},function(t,n){t.exports=e},function(e,t){"use strict";!function(e){e[e.LeftArrow=37]="LeftArrow",e[e.RightArrow=39]="RightArrow"}(t.Keys||(t.Keys={}));t.Keys;!function(e){e[e.Next=1]="Next",e[e.Prev=-1]="Prev"}(t.Dir||(t.Dir={}));t.Dir},function(e,t,n){"use strict";var i=n(5),o=function(){function e(e,t,n,i){this.source=e?e:[],this.index=t?t:0,this.endless=n,this.pageIndex=i}return Object.defineProperty(e.prototype,"data",{get:function(){var e,t=this.total;if(this.endless)e=[this.source[(this.index-1+t)%t],this.source[this.index%t],this.source[(this.index+1+t)%t]];else{var n=[{}].concat(this.source.slice(0),[{}]);e=n.slice(this.index,this.index+3)}if(null!==this.pageIndex){var i=this.pageIndex>this.index;e[i?2:0]=this.source[this.pageIndex]}return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this.source.length},enumerable:!0,configurable:!0}),e.prototype.canMoveNext=function(){return this.endless||this.index<this.total-1},e.prototype.canMovePrev=function(){return this.endless||this.index>0},e.prototype[i.$$iterator]=function(){return this.data[i.$$iterator]()},e}();t.DataResultIterator=o;var r=function(){function e(e){this.accessor=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this.accessor().data.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this.accessor().total},enumerable:!0,configurable:!0}),e.prototype.item=function(e){return this.accessor().data[e]},e.prototype.canMoveNext=function(){return this.accessor().canMoveNext()},e.prototype.canMovePrev=function(){return this.accessor().canMovePrev()},e.prototype[i.$$iterator]=function(){return this.accessor()[i.$$iterator]()},e}();t.DataCollection=r},function(e,n){e.exports=t},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(7),s=n(1),l=n(8),c=n(9),u=[s.ScrollViewComponent,l.ScrollViewPagerComponent,c.KendoDraggableDirective],d=[s.ScrollViewComponent],p=function(){function e(){}return e=i([r.NgModule({declarations:[u],exports:[d],imports:[a.CommonModule]}),o("design:paramtypes",[])],e)}();t.ScrollViewModule=p},function(e,t){e.exports=n},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(2),s=function(){function e(){this.pagerIndexChange=new a.EventEmitter}return e.prototype.itemClass=function(e){return{"k-primary":e===this.activeIndex}},e.prototype.indexChange=function(e){this.pagerIndexChange.emit(e)},i([r.Input(),o("design:type",Number)],e.prototype,"activeIndex",void 0),i([r.Input(),o("design:type",Array)],e.prototype,"data",void 0),i([r.Output(),o("design:type",a.EventEmitter)],e.prototype,"pagerIndexChange",void 0),e=i([r.Component({selector:"kendo-scrollview-pager",template:'\n <ul class="k-scrollview-pageable">\n <li class="k-button" *ngFor="let item of data; let i = index"\n [ngClass]="itemClass(i)"\n (click)="indexChange(i)">\n </li>\n </ul>\n '}),o("design:paramtypes",[])],e)}();t.ScrollViewPagerComponent=s},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(10),s=function(){function e(e){var t=this;this.kendo={drag:new r.EventEmitter,press:new r.EventEmitter,release:new r.EventEmitter},this.draggable=new a.default({drag:function(e){e.hasOwnProperty("originalEvent")&&e.originalEvent.preventDefault(),t.kendo.drag.next(e)},press:function(e){return t.kendo.press.next(e)},release:function(e){return t.kendo.release.next(e)}}),this.draggable.bindTo(e.nativeElement)}return e.prototype.ngOnDestroy=function(){this.draggable.destroy()},e=i([r.Directive({outputs:["kendo.press","kendo.drag","kendo.release"],selector:"[kendoDraggable]"}),o("design:paramtypes",[r.ElementRef])],e)}();t.KendoDraggableDirective=s},function(e,t){"use strict";function n(e){return e.type.match(a)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,type:e.type,originalEvent:e}:{pageX:e.pageX,pageY:e.pageY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){return function(n){return t(e(n))}},o=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},r=function(e,t,n){return e.removeEventListener&&e.removeEventListener(t,n)},a=/touch/,s=function(){},l=2e3,c=function(e){var t=this,a=e.press;void 0===a&&(a=s);var c=e.drag;void 0===c&&(c=s);var u=e.release;void 0===u&&(u=s),this._pressHandler=i(n,a),this._dragHandler=i(n,c),this._releaseHandler=i(n,u),this._ignoreMouse=!1,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,l))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(o(document,"mousemove",t._mousemove),o(document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){r(document,"mousemove",t._mousemove),r(document,"mouseup",t._mouseup),t._releaseHandler(e)}};c.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,o(e,"mousedown",this._mousedown),o(e,"touchstart",this._touchstart),o(e,"touchmove",this._touchmove),o(e,"touchend",this._touchend))},c.prototype._unbindFromCurrent=function(){r(this._element,"mousedown",this._mousedown),r(this._element,"touchstart",this._touchstart),r(this._element,"touchmove",this._touchmove),r(this._element,"touchend",this._touchend)},c.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},t.Draggable=c,t.default=c}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("rxjs/symbol/iterator"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","rxjs/symbol/iterator","@angular/common"],t):"object"==typeof exports?exports.KendoAngularScrollview=t(require("@angular/core"),require("rxjs/symbol/iterator"),require("@angular/common")):e.KendoAngularScrollview=t(e["@angular/core"],e["rxjs/symbol/iterator"],e["@angular/common"])}(this,function(e,t,n){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var i=n(1);t.ScrollViewComponent=i.ScrollViewComponent;var o=n(6);t.ScrollViewModule=o.ScrollViewModule;var r=n(8);t.ScrollViewPagerComponent=r.ScrollViewPagerComponent;var a=n(9);t.KendoDraggableDirective=a.KendoDraggableDirective},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(3),s=n(4),l=function(){function e(e,t){var n=this;this.element=e,this.application=t,this.data=[],this.endless=!1,this.animate=!0,this.pageable=!1,this.arrows=!1,this.itemChanged=new r.EventEmitter,this.animationState=null,this.transitionStyle={},this.view=new s.DataCollection(function(){return new s.DataResultIterator(n.data,n.activeIndex,n.endless,n.pageIndex)}),this.isDataSourceEmpty=!1,this._activeIndex=0,this.index=0,this.pageIndex=null,this.transforms=["translateX(-100%)","translateX(0%)","translateX(100%)"]}return Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(e){this.index=this._activeIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollViewClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostWidth",{get:function(){return this.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostHeight",{get:function(){return this.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaLive",{get:function(){return"assertive"},enumerable:!0,configurable:!0}),e.prototype.keyDown=function(e){e.keyCode===a.Keys.LeftArrow&&this.prev(),e.keyCode===a.Keys.RightArrow&&this.next()},e.prototype.ngOnChanges=function(e){this.activeIndex=Math.max(Math.min(this.activeIndex,this.view.total-1),0)},e.prototype.prev=function(){this.navigate(a.Dir.Prev)},e.prototype.next=function(){this.navigate(a.Dir.Next)},e.prototype.transitionEndHandler=function(e){this.animationState=null,"left"!==e.toState&&"right"!==e.toState||(null!==this.pageIndex&&(this.activeIndex=this.pageIndex,this.pageIndex=null),this.activeIndex=this.index,this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)}),this.application.tick())},e.prototype.handlePress=function(e){this.initialTouchCoordinate=e.pageX},e.prototype.handleDrag=function(e){var t=e.pageX-this.initialTouchCoordinate;this.animationState||this.isDragForbidden(t)||!this.draggedInsideBounds(t)||(this.transitionStyle={transform:"translateX("+t+"px)"})},e.prototype.handleRelease=function(e){var t=e.pageX-this.initialTouchCoordinate;this.isDragForbidden(t)||(this.draggedEnoughToNavigate(t)?(this.changeIndex(t>0?a.Dir.Prev:a.Dir.Next),this.animate||(this.transitionStyle=null,this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)}))):Math.abs(t)>0&&(this.animate?this.animationState="center":this.transitionStyle=null))},e.prototype.pageChange=function(e){this.animationState||this.activeIndex===e||(this.animate?(this.pageIndex=e,this.animationState=this.pageIndex>this.index?"left":"right"):this.activeIndex=e)},e.prototype.inlineStyles=function(e){return{height:this.height,transform:this.transforms[e],width:this.width}},e.prototype.displayPrevArrow=function(){return(this.endless||this.activeIndex>0)&&this.view.total>0},e.prototype.displayNextArrow=function(){return(this.endless||this.activeIndex+1<this.view.total)&&this.view.total>0},e.prototype.draggedInsideBounds=function(e){return Math.abs(e)<=this.element.nativeElement.offsetWidth},e.prototype.draggedEnoughToNavigate=function(e){return Math.abs(e)>this.element.nativeElement.offsetWidth/2},e.prototype.isDragForbidden=function(e){return!this.endless&&(0===this.activeIndex&&e>0||this.activeIndex===this.view.total-1&&e<0)},e.prototype.navigate=function(e){this.isDataSourceEmpty||this.animationState||(this.changeIndex(e),this.animate||this.itemChanged.emit({index:this.activeIndex,item:this.view.item(1)}))},e.prototype.changeIndex=function(e){e===a.Dir.Next&&this.view.canMoveNext()?(this.index=(this.index+1)%this.view.total,this.animate?this.animationState="left":this.activeIndex=this.index):e===a.Dir.Prev&&this.view.canMovePrev()&&(this.index=0===this.index?this.view.total-1:this.index-1,this.animate?this.animationState="right":this.activeIndex=this.index)},i([r.Input(),o("design:type",Array)],e.prototype,"data",void 0),i([r.Input(),o("design:type",Number),o("design:paramtypes",[Number])],e.prototype,"activeIndex",null),i([r.Input(),o("design:type",String)],e.prototype,"width",void 0),i([r.Input(),o("design:type",String)],e.prototype,"height",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"endless",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"animate",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"pageable",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"arrows",void 0),i([r.Output(),o("design:type",r.EventEmitter)],e.prototype,"itemChanged",void 0),i([r.ContentChild(r.TemplateRef),o("design:type",r.TemplateRef)],e.prototype,"itemTemplateRef",void 0),i([r.HostBinding("class.k-widget"),o("design:type",Boolean)],e.prototype,"widgetClass",null),i([r.HostBinding("class.k-scrollview-wrap"),o("design:type",Boolean)],e.prototype,"scrollViewClass",null),i([r.HostBinding("style.width"),o("design:type",String)],e.prototype,"hostWidth",null),i([r.HostBinding("style.height"),o("design:type",String)],e.prototype,"hostHeight",null),i([r.HostBinding("attr.tabindex"),o("design:type",Number)],e.prototype,"tabIndex",null),i([r.HostBinding("attr.aria-live"),o("design:type",String)],e.prototype,"ariaLive",null),i([r.HostListener("keydown",["$event"]),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],e.prototype,"keyDown",null),e=i([r.Component({animations:[r.trigger("animateTo",[r.state("center, left, right",r.style({transform:"translateX(0)"})),r.transition("* => right",[r.animate("300ms ease-out",r.style({transform:"translateX(100%)"}))]),r.transition("* => left",[r.animate("300ms ease-out",r.style({transform:"translateX(-100%)"}))]),r.transition("* => center",[r.animate("300ms ease-out")])])],exportAs:"kendoScrollView",selector:"kendo-scrollview",template:'\n <ul class=\'k-scrollview\'\n [ngStyle]="transitionStyle"\n [@animateTo]="animationState"\n (@animateTo.done)= "transitionEndHandler($event)"\n (kendo.drag) = "handleDrag($event)"\n (kendo.press) = "handlePress($event)"\n (kendo.release) = "handleRelease($event)"\n kendoDraggable>\n <li *ngFor="let item of view;let i=index"\n [ngStyle]="inlineStyles(i)"\n [attr.aria-hidden]="i !== 1">\n <template\n [ngTemplateOutlet]="itemTemplateRef"\n [ngOutletContext]="{ item: item }">\n </template>\n </li>\n </ul>\n <div class=\'k-scrollview-elements\'\n [ngStyle]="{\'height\': height}"\n *ngIf="!isDataSourceEmpty && (pageable||arrows)">\n <a class="k-scrollview-prev"\n aria-label="previous"\n *ngIf="arrows && displayPrevArrow()"\n (click)="prev()">\n <span class="k-icon k-i-arrowhead-w"></span>\n </a>\n <a class="k-scrollview-next"\n aria-label="next"\n *ngIf="arrows && displayNextArrow()"\n (click)="next()">\n <span class="k-icon k-i-arrowhead-e"></span>\n </a>\n <kendo-scrollview-pager *ngIf="pageable"\n (pagerIndexChange)="pageChange($event)"\n [data]="data"\n [activeIndex]="activeIndex">\n </kendo-scrollview-pager>\n </div>\n '}),o("design:paramtypes",[r.ElementRef,r.ApplicationRef])],e)}();t.ScrollViewComponent=l},function(t,n){t.exports=e},function(e,t){"use strict";!function(e){e[e.LeftArrow=37]="LeftArrow",e[e.RightArrow=39]="RightArrow"}(t.Keys||(t.Keys={}));t.Keys;!function(e){e[e.Next=1]="Next",e[e.Prev=-1]="Prev"}(t.Dir||(t.Dir={}));t.Dir},function(e,t,n){"use strict";var i=n(5),o=function(){function e(e,t,n,i){this.source=e?e:[],this.index=t?t:0,this.endless=n,this.pageIndex=i}return Object.defineProperty(e.prototype,"data",{get:function(){var e,t=this.total;if(this.endless)e=[this.source[(this.index-1+t)%t],this.source[this.index%t],this.source[(this.index+1+t)%t]];else{var n=[{}].concat(this.source.slice(0),[{}]);e=n.slice(this.index,this.index+3)}if(null!==this.pageIndex){var i=this.pageIndex>this.index;e[i?2:0]=this.source[this.pageIndex]}return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this.source.length},enumerable:!0,configurable:!0}),e.prototype.canMoveNext=function(){return this.endless||this.index<this.total-1},e.prototype.canMovePrev=function(){return this.endless||this.index>0},e.prototype[i.$$iterator]=function(){return this.data[i.$$iterator]()},e}();t.DataResultIterator=o;var r=function(){function e(e){this.accessor=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this.accessor().data.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this.accessor().total},enumerable:!0,configurable:!0}),e.prototype.item=function(e){return this.accessor().data[e]},e.prototype.canMoveNext=function(){return this.accessor().canMoveNext()},e.prototype.canMovePrev=function(){return this.accessor().canMovePrev()},e.prototype[i.$$iterator]=function(){return this.accessor()[i.$$iterator]()},e}();t.DataCollection=r},function(e,n){e.exports=t},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(7),s=n(1),l=n(8),c=n(9),u=[s.ScrollViewComponent,l.ScrollViewPagerComponent,c.KendoDraggableDirective],d=[s.ScrollViewComponent],p=function(){function e(){}return e=i([r.NgModule({declarations:[u],exports:[d],imports:[a.CommonModule]}),o("design:paramtypes",[])],e)}();t.ScrollViewModule=p},function(e,t){e.exports=n},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(2),s=function(){function e(){this.pagerIndexChange=new a.EventEmitter}return e.prototype.itemClass=function(e){return{"k-primary":e===this.activeIndex}},e.prototype.indexChange=function(e){this.pagerIndexChange.emit(e)},i([r.Input(),o("design:type",Number)],e.prototype,"activeIndex",void 0),i([r.Input(),o("design:type",Array)],e.prototype,"data",void 0),i([r.Output(),o("design:type",a.EventEmitter)],e.prototype,"pagerIndexChange",void 0),e=i([r.Component({selector:"kendo-scrollview-pager",template:'\n <ul class="k-scrollview-pageable">\n <li class="k-button" *ngFor="let item of data; let i = index"\n [ngClass]="itemClass(i)"\n (click)="indexChange(i)">\n </li>\n </ul>\n '}),o("design:paramtypes",[])],e)}();t.ScrollViewPagerComponent=s},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),a=n(10),s=function(){function e(e){var t=this;this.kendo={drag:new r.EventEmitter,press:new r.EventEmitter,release:new r.EventEmitter},this.draggable=new a.default({drag:function(e){e.hasOwnProperty("originalEvent")&&e.originalEvent.preventDefault(),t.kendo.drag.next(e)},press:function(e){return t.kendo.press.next(e)},release:function(e){return t.kendo.release.next(e)}}),this.draggable.bindTo(e.nativeElement)}return e.prototype.ngOnDestroy=function(){this.draggable.destroy()},e=i([r.Directive({outputs:["kendo.press","kendo.drag","kendo.release"],selector:"[kendoDraggable]"}),o("design:paramtypes",[r.ElementRef])],e)}();t.KendoDraggableDirective=s},function(e,t){"use strict";function n(e){return e.type.match(a)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,type:e.type,originalEvent:e}:{pageX:e.pageX,pageY:e.pageY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){return function(n){return t(e(n))}},o=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},r=function(e,t,n){return e.removeEventListener&&e.removeEventListener(t,n)},a=/touch/,s=function(){},l=2e3,c=function(e){var t=this,a=e.press;void 0===a&&(a=s);var c=e.drag;void 0===c&&(c=s);var u=e.release;void 0===u&&(u=s),this._pressHandler=i(n,a),this._dragHandler=i(n,c),this._releaseHandler=i(n,u),this._ignoreMouse=!1,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,l))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(o(document,"mousemove",t._mousemove),o(document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){r(document,"mousemove",t._mousemove),r(document,"mouseup",t._mouseup),t._releaseHandler(e)}};c.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,o(e,"mousedown",this._mousedown),o(e,"touchstart",this._touchstart),o(e,"touchmove",this._touchmove),o(e,"touchend",this._touchend))},c.prototype._unbindFromCurrent=function(){r(this._element,"mousedown",this._mousedown),r(this._element,"touchstart",this._touchstart),r(this._element,"touchmove",this._touchmove),r(this._element,"touchend",this._touchend)},c.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},t.Draggable=c,t.default=c}])}); |
@@ -301,3 +301,3 @@ import { trigger, state, style, transition, animate, Component, Input, Output, ApplicationRef, EventEmitter, ContentChild, ElementRef, TemplateRef, HostBinding, HostListener } from "@angular/core"; | ||
} | ||
else if (this.view.canMovePrev()) { | ||
else if (direction === Dir.Prev && this.view.canMovePrev()) { | ||
this.index = this.index === 0 ? this.view.total - 1 : this.index - 1; | ||
@@ -304,0 +304,0 @@ if (this.animate) { |
@@ -302,3 +302,3 @@ "use strict"; | ||
} | ||
else if (this.view.canMovePrev()) { | ||
else if (direction === enums_1.Dir.Prev && this.view.canMovePrev()) { | ||
this.index = this.index === 0 ? this.view.total - 1 : this.index - 1; | ||
@@ -305,0 +305,0 @@ if (this.animate) { |
@@ -10,5 +10,5 @@ KENDO UI BETA End-User License Agreement | ||
Telerik Kendo UI for Angular 2 is release candidate software. Release candidate software is not at the level of performance and compatibility of a final, generally available, product offering. Release candidate software may contain errors or bugs that may impact the performance or usability of the release candidate software. | ||
Telerik Kendo UI for Angular is release candidate software. Release candidate software is not at the level of performance and compatibility of a final, generally available, product offering. Release candidate software may contain errors or bugs that may impact the performance or usability of the release candidate software. | ||
Telerik Kendo UI for Angular 2 is only licensed for use by certain end users of Telerik DevCraft Complete, Telerik DevCraft Ultimate, Telerik Kendo UI Complete, and/or Telerik Kendo UI Professional products (each a “Telerik Product Collection”). For terms and conditions applicable to your use of Telerik Kendo UI for Angular 2 please see the Telerik End User License Agreement (“EULA”) accompanying that version of the Telerik Product Collection which formed the basis of your eligibility to access and use Telerik Kendo UI for Angular 2. Telerik Kendo UI for Angular 2 may only be used in accordance with the terms and conditions of such EULA. | ||
Telerik Kendo UI for Angular is only licensed for use by certain end users of Telerik DevCraft Complete, Telerik DevCraft Ultimate, Telerik Kendo UI Complete, and/or Telerik Kendo UI Professional products (each a “Telerik Product Collection”). For terms and conditions applicable to your use of Telerik Kendo UI for Angular please see the Telerik End User License Agreement (“EULA”) accompanying that version of the Telerik Product Collection which formed the basis of your eligibility to access and use Telerik Kendo UI for Angular. Telerik Kendo UI for Angular may only be used in accordance with the terms and conditions of such EULA. | ||
@@ -15,0 +15,0 @@ 1. BETA LICENSE |
{ | ||
"name": "@progress/kendo-angular-scrollview", | ||
"description": "A ScrollView Component for Angular 2", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "registry": "https://registry.npm.telerik.com" |
@@ -1,2 +0,2 @@ | ||
# Kendo UI for Angular 2: ScrollView | ||
# Kendo UI for Angular: ScrollView | ||
@@ -8,3 +8,3 @@ * [Overview](https://github.com/telerik/kendo-angular-scrollview#overview) | ||
This is the Kendo UI ScrollView package, part of the [Kendo UI for Angular 2](http://www.telerik.com/kendo-angular-ui/) suite. | ||
This is the Kendo UI ScrollView package, part of the [Kendo UI for Angular](http://www.telerik.com/kendo-angular-ui/) suite. | ||
@@ -11,0 +11,0 @@ The package includes the ScrollView component. |
140361