UNPKG

kendo-ui-core

Version:

Kendo UI is everything you need to build sites and apps with HTML5 & JavaScript. Kendo UI Core is the free and open-source version of Kendo UI that provides access to the web's best UI widgets and key framework features, essential for developing great exp

2 lines 2.56 kB
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`./core-R4j5Vh3b.js`),require(`./kendo.core.js`),require(`./kendo.userevents.js`);const e={id:`touch`,name:`Touch`,category:`mobile`,description:`The kendo Touch widget provides a cross-platform compatible API for handling user-initiated touch events, multi-touch gestures and event sequences (drag, swipe, etc.). `,depends:[`core`,`userevents`]};(function(e,t){var n=window.kendo,r=n.ui.Widget,i=Math.abs,a=20,o=r.extend({init:function(e,t){var i=this;r.fn.init.call(i,e,t),t=i.options,e=i.element,i.wrapper=e;function a(e){return function(t){i._triggerTouch(e,t)}}function o(e){return function(t){i.trigger(e,{touches:t.touches,distance:t.distance,center:t.center,event:t.event})}}i.events=new n.UserEvents(e,{filter:t.filter,surface:t.surface,minHold:t.minHold,multiTouch:t.multiTouch,allowSelection:!0,fastTap:t.fastTap,press:a(`touchstart`),hold:a(`hold`),tap:i._tap.bind(i),gesturestart:o(`gesturestart`),gesturechange:o(`gesturechange`),gestureend:o(`gestureend`)}),t.enableSwipe?(i.events.bind(`start`,i._swipestart.bind(i)),i.events.bind(`move`,i._swipemove.bind(i))):(i.events.bind(`start`,i._dragstart.bind(i)),i.events.bind(`move`,a(`drag`)),i.events.bind(`end`,a(`dragend`))),n.notify(i)},events:[`touchstart`,`dragstart`,`drag`,`dragend`,`tap`,`doubletap`,`hold`,`swipe`,`gesturestart`,`gesturechange`,`gestureend`],options:{name:`Touch`,surface:null,global:!1,fastTap:!1,filter:null,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},cancel:function(){this.events.cancel()},destroy:function(){r.fn.destroy.call(this),this.events.destroy()},_triggerTouch:function(e,t){this.trigger(e,{touch:t.touch,event:t.event})&&t.preventDefault()},_tap:function(e){var t=this,r=t.lastTap,i=e.touch;r&&i.endTime-r.endTime<t.options.doubleTapTimeout&&n.touchDelta(i,r).distance<a?(t._triggerTouch(`doubletap`,e),t.lastTap=null):(t._triggerTouch(`tap`,e),t.lastTap=i)},_dragstart:function(e){this._triggerTouch(`dragstart`,e)},_swipestart:function(e){i(e.x.velocity)*2>=i(e.y.velocity)&&e.sender.capture()},_swipemove:function(e){var t=this,n=t.options,r=e.touch,a=e.event.timeStamp-r.startTime,o=r.x.initialDelta>0?`right`:`left`;i(r.x.initialDelta)>=n.minXDelta&&i(r.y.initialDelta)<n.maxYDelta&&a<n.maxDuration&&(t.trigger(`swipe`,{direction:o,touch:e.touch}),r.cancel())}});n.ui.plugin(o)})(window.kendo.jQuery);var t=kendo;exports.__meta__=e,exports.default=t; //# sourceMappingURL=kendo.touch.js.map