UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

1 lines 1.98 kB
module.exports=function(e){var i={};function o(t){if(i[t])return i[t].exports;var n=i[t]={exports:{},id:t,loaded:!1};return e[t].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}return o.m=e,o.c=i,o.p="",o(0)}({0:function(t,n,e){t.exports=e(940)},3:function(t,n){t.exports=function(){throw Error("define cannot be used indirect")}},896:function(t,n){t.exports=require("../../kendo.core")},940:function(t,n,e){var i;e(3),e=[e(896)],void 0===(n="function"==typeof(i=function(){var o=window.kendo.jQuery,i=window.kendo,a=i.ui.Widget,n=i.keys,r=".kendoNavigator";function t(t){return i.format('<button class="k-button k-rounded-full k-button-flat k-button-flat-base k-icon-button k-navigator-{0}" aria-label="move {0}">'+'<span class="k-button-icon k-icon k-i-arrow-60-{0}"></span>'+"</button>",t)}var s=t("up")+t("right")+t("down")+t("left"),e=a.extend({init:function(t,n){a.fn.init.call(this,t,n);this._initOptions(n);this.element.addClass("k-widget k-navigator").append(s).on("click"+r,".k-button",this._click.bind(this));var e=this.element.parent().closest("["+i.attr("role")+"]");this._keyroot=e.length>0?e:this.element;this._tabindex(this._keyroot);this._keydown=this._keydown.bind(this);this._keyroot.on("keydown",this._keydown)},options:{name:"Navigator",panStep:1},events:["pan"],dispose:function(){this._keyroot.off("keydown",this._keydown)},_pan:function(t,n){var e=this.options.panStep;this.trigger("pan",{x:t*e,y:n*e})},_click:function(t){var n=0;var e=0;var i=o(t.currentTarget);if(i.is(".k-navigator-up"))e=1;else if(i.is(".k-navigator-down"))e=-1;else if(i.is(".k-navigator-right"))n=1;else if(i.is(".k-navigator-left"))n=-1;this._pan(n,e);t.preventDefault()},_keydown:function(t){switch(t.which){case n.UP:this._pan(0,1);t.preventDefault();break;case n.DOWN:this._pan(0,-1);t.preventDefault();break;case n.RIGHT:this._pan(1,0);t.preventDefault();break;case n.LEFT:this._pan(-1,0);t.preventDefault();break}}});i.dataviz.ui.plugin(e)})?i.apply(n,e):i)||(t.exports=n)}});