UNPKG

@progress/kendo-ui

Version:

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

1 lines 2.82 kB
module.exports=function(t){function e(n){if(o[n])return o[n].exports;var s=o[n]={exports:{},id:n,loaded:!1};return t[n].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}({0:function(t,e,o){o(1503),t.exports=o(1503)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},19:function(t,e){t.exports=require("../kendo.core")},1503:function(t,e,o){var n,s,i;!function(r,define){s=[o(19)],n=r,i="function"==typeof n?n.apply(e,s):n,!(void 0!==i&&(t.exports=i))}(function(){!function(t){var e,o,n,s,i,r;t.support.browser.msie&&t.support.browser.version<9||(e=t.jQuery,o={8:"backspace",9:"tab",13:"enter",27:"esc",37:"left",38:"up",39:"right",40:"down",35:"end",36:"home",32:"spacebar",33:"pageup",34:"pagedown",46:"delete",113:":edit"},n=navigator.platform.toUpperCase().indexOf("MAC")>=0,s=function(t){return t>47&&t<58||t>64&&t<91||t>95&&t<112||t>185&&t<193||t>218&&t<223||229===t},i=function(t){var e=t.keyCode,n=o[e];return!n&&s(e)&&(n=":alphanum"),!n&&t.key&&1==t.key.length&&(n=":alphanum"),n},r=t.Class.extend({init:function(t,o,n){if(this._handlers={},this.target=t,this._observer=o||window,this.keyDownProxy=this.keyDown.bind(this),this.mouseProxy=this.mouse.bind(this),this.touchProxy=this.touch.bind(this),this.threshold=5,this._pressLocation=null,t.on("keydown",this.keyDownProxy),t.on("contextmenu mousedown cut copy paste scroll wheel click dblclick focus",this.mouseProxy),t.on("touchmove touchend",this.touchProxy),e(document.documentElement).on("mousemove mouseup",this.mouseProxy),e(document.documentElement).on("touchmove touchend",this.touchProxy),n)for(var s in n)this.on(s,n[s])},keyDown:function(t){this.handleEvent(t,i(t.originalEvent))},touch:function(t){this.handleEvent(t,t.type)},mouse:function(t){var e,o,n,s,i;t.which?e=3==t.which:t.button&&(e=2==t.button),o=t.type,"mousedown"===o&&(e?o="rightmousedown":this._pressLocation={x:t.pageX,y:t.pageY}),"mouseup"===o&&(e||(this._pressLocation=null)),"mousemove"===o&&this._pressLocation&&(n=this._pressLocation.x-t.pageX,s=this._pressLocation.y-t.pageY,i=Math.sqrt(n*n+s*s),i>this.threshold&&(o="mousedrag")),this.handleEvent(t,o)},handleEvent:function(t,e){var o,s,i="";t.mod=n?t.metaKey:t.ctrlKey&&!t.altKey,t.altKey&&(i+="alt+"),t.shiftKey&&(i+="shift+"),t.ctrlKey&&(i+="ctrl+"),i+=e,o=this._handlers["*+"+e],o&&o.call(this._observer,t,i),s=this._handlers[i],s&&s.call(this._observer,t,i)},on:function(t,e){var o=this._handlers;"string"==typeof e&&(e=this._observer[e]),"string"==typeof t&&(t=t.split(",")),t.forEach(function(t){o[t]=e})},destroy:function(){this.target.off("keydown",this.keyDownProxy),this.target.off("keydown",this.mouseProxy),e(document.documentElement).off("mousemove mouseup",this.mouseProxy)}}),t.spreadsheet.EventListener=r)}(window.kendo)},o(3))}});