@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 4.96 kB
JavaScript
module.exports=function(e){function n(i){if(t[i])return t[i].exports;var s=t[i]={exports:{},id:i,loaded:!1};return e[i].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}({0:function(e,n,t){e.exports=t(980)},3:function(e,n){e.exports=function(){throw Error("define cannot be used indirect")}},948:function(e,n){e.exports=require("../main")},976:function(e,n){e.exports=require("./resizing-utils")},980:function(e,n,t){var i,s,o;!function(r,define){s=[t(948),t(981),t(976)],i=r,o="function"==typeof i?i.apply(n,s):i,!(void 0!==o&&(e.exports=o))}(function(){!function(e,n){var t=e.jQuery,i=t.extend,s=t.noop,o=t.proxy,r=e.ui.editor,a=e.Class,d="keydown",l="mousedown",u="mouseenter",z="mouseleave",c="mousemove",f="mouseup",p=",",m=".",v=":last-child",R="table",g=a.extend({init:function(e,n){var s=this;s.options=i({},s.options,n),s.options.tags=t.isArray(s.options.tags)?s.options.tags:[s.options.tags],t(e).is(R)&&(s.element=e,s._attachEventHandlers())},destroy:function(){var e=this,n=e.options.eventNamespace;e.element&&(t(e.element).off(n),e.element=null),t(e.options.rootElement).off(d+n),e._destroyResizeHandle()},options:{tags:[],min:0,rootElement:null,eventNamespace:"",rtl:!1,handle:{dataAttribute:"",height:0,width:0,classNames:{},template:""}},_attachEventHandlers:function(){var e=this,n=e.options;t(e.element).on(c+n.eventNamespace,n.tags.join(p),o(e.detectElementBorderHovering,e))},resizingInProgress:function(){var e=this,n=e._resizable;return!!n&&!!n.resizing},resize:s,detectElementBorderHovering:function(e){var n=this,i=n.options,s=i.handle,o=t(e.currentTarget),r=n.resizeHandle,a=s.dataAttribute;n.resizingInProgress()||(!o.is(v)&&n.elementBorderHovered(o,e)?r?r.data(a)&&r.data(a)!==o[0]&&n.showResizeHandle(o,e):n.showResizeHandle(o,e):r&&n._destroyResizeHandle())},elementBorderHovered:s,showResizeHandle:function(e,n){var t=this;0===n.buttons&&(t._initResizeHandle(),t.setResizeHandlePosition(e),t.setResizeHandleDimensions(),t.setResizeHandleDataAttributes(e[0]),t._attachResizeHandleEventHandlers(),t._initResizable(e),t._hideResizeMarker(),t.resizeHandle.show())},_initResizeHandle:function(){var e=this,n=e.options;e._destroyResizeHandle(),e.resizeHandle=t(n.handle.template).appendTo(n.rootElement)},setResizeHandlePosition:s,setResizeHandleDimensions:s,setResizeHandleDataAttributes:function(e){var n=this;n.resizeHandle.data(n.options.handle.dataAttribute,e)},_attachResizeHandleEventHandlers:function(){var e=this,n=e.options,t=n.eventNamespace,i=n.handle.classNames.marker,s=e.resizeHandle;e.resizeHandle.on(l+t,function(){s.find(m+i).show()}).on(f+t,function(){s.find(m+i).hide()})},_hideResizeMarker:function(){var e=this;e.resizeHandle.find(m+e.options.handle.classNames.marker).hide()},_destroyResizeHandle:function(){var e=this;e.resizeHandle&&(e._destroyResizable(),e.resizeHandle.off(e.options.eventNamespace).remove(),e.resizeHandle=null)},_initResizable:function(n){var t=this;t.resizeHandle&&(t._destroyResizable(),t._resizable=new e.ui.Resizable(n,{draggableElement:t.resizeHandle[0],start:o(t.onResizeStart,t),resize:o(t.onResize,t),resizeend:o(t.onResizeEnd,t)}))},_destroyResizable:function(){var e=this;e._resizable&&(e._resizable.destroy(),e._resizable=null)},onResizeStart:function(){this._disableKeyboard()},onResize:function(e){this.setResizeHandleDragPosition(e)},setResizeHandleDragPosition:s,onResizeEnd:function(e){var n=this;n.resize(e),n._destroyResizeHandle(),n._enableKeyboard()},_enableKeyboard:function(){var e=this.options;t(e.rootElement).off(d+e.eventNamespace)},_disableKeyboard:function(){var e=this.options;t(e.rootElement).on(d+e.eventNamespace,function(e){e.preventDefault()})},_forceResizing:function(e){var n=this._resizable;n&&n.userEvents&&n.userEvents._end(e)}}),h=a.extend({create:function(e,n){var i=this,s=n.name,o=n.eventNamespace;t(e.body).on(u+o,R,function(t){var o=t.currentTarget,r=e[s];t.stopPropagation(),r?r.element===o||r.resizingInProgress()||(i._destroyResizing(e,n),i._initResizing(e,o,n)):i._initResizing(e,o,n)}).on(z+o,R,function(o){var r,a=e[s];o.stopPropagation(),!a||a.resizingInProgress()||a.resizeHandle||(r=t(a.element).parents(R)[0],r&&(i._destroyResizing(e,n),i._initResizing(e,r,n)))}).on(z+o,function(){var t=e[s];t&&!t.resizingInProgress()&&i._destroyResizing(e,n)}).on(f+o,function(o){var r,a=e[s];a&&a.resizingInProgress()&&(r=t(o.target).parents(R)[0],r&&(a._forceResizing(o),i._destroyResizing(e,n),i._initResizing(e,r,n)))})},dispose:function(e,n){t(e.body).off(n.eventNamespace)},_initResizing:function(n,t,i){var s=i.name,o=i.type;n[s]=new o(t,{rtl:e.support.isRtl(n.element),rootElement:n.body})},_destroyResizing:function(e,n){var t=n.name;e[t]&&(e[t].destroy(),e[t]=null)}});h.current=new h,g.create=function(e,n){h.current.create(e,n)},g.dispose=function(e,n){h.current.dispose(e,n)},i(r,{TableElementResizing:g})}(window.kendo)},t(3))},981:function(e,n){e.exports=require("../../kendo.resizable")}});