{"version":3,"sources":["kendo.drawer.js"],"names":["f","define","$","undefined","kendo","window","ui","Widget","SHOW","HIDE","ITEMCLICK","PUSH","OVERLAY","LEFT","RIGHT","Drawer","extend","init","element","options","userEvents","tap","that","this","fn","call","_element","_wrapper","position","_mode","mini","_miniMode","_initDrawerItems","mode","_setBodyOffset","UserEvents","document","body","drawerContainer","fastTap","allowSelection","e","contains","drawerItemsWrapper","event","target","_itemClick","visible","trigger","sender","hide","preventDefault","swipeToOpen","bind","_start","_update","_end","minHeight","css","contentElement","children","first","drawerElement","template","addClass","wrap","parent","drawerWrapper","width","append","after","prepend","overlayMiniOffset","outerWidth","leftPositioned","drawerItems","find","separatorItems","_selectedItemIndex","removeClass","eq","overlayContainer","miniWidth","miniTemplate","_miniTemplate","html","minWidth","show","isExpanded","hasClass","_selectItem","value","Math","abs","x","velocity","y","triggeredByInput","cancel","drawerMini","_push","_overlay","shouldShow","elementWidth","pastHalf","velocityThreshold","moveEventArgs","updatedPosition","delta","limitedPosition","min","max","stopPropagation","item","selectedItemIndex","index","length","closest","destroy","name","events","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,gBAAiB,oBAAqBD,IAC/C,WA4VE,MApVC,UAAUE,EAAGC,GAAb,GACOC,GAAQC,OAAOD,MAAOE,EAAKF,EAAME,GAAIC,EAASD,EAAGC,OAAQC,EAAO,OAAQC,EAAO,OAAQC,EAAY,YAAaC,EAAO,OAAQC,EAAU,UAAWC,EAAO,OAAQC,EAAQ,QAC3KC,EAASX,EAAME,GAAGC,OAAOS,QACzBC,KAAM,SAAUC,EAASC,GAAnB,GAEEC,GAkBAC,EAnBAC,EAAOC,IAEXhB,GAAOiB,GAAGP,KAAKQ,KAAKF,KAAML,EAASC,GACnCA,EAAUG,EAAKH,QACfG,EAAKI,SAASR,GACdI,EAAKK,SAAST,GACdI,EAAKM,WACLN,EAAKO,QACDV,EAAQW,MACRR,E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QwE,QAAQ,kBAAkBD,OAAS,EAC5DH,EAAO/G,EAAEuC,EAAEG,MAAMC,QAAQwE,QAAQ,kBAC1BnH,EAAEuC,EAAEG,MAAMC,QAAQ4C,SAAS,oBAClCwB,EAAO/G,EAAEuC,EAAEG,MAAMC,SAErBvB,EAAKqB,mBAAmBiC,KAAK,kBAAkBG,YAAY,oBAC3DzD,EAAKoE,YAAYuB,IAErBK,QAAS,WACL,GAAInG,GAAUI,KAAKJ,OACfA,GAAQc,MAAQtB,IACZY,KAAKmD,eACLxE,EAAEkC,SAASC,MAAMqB,IAAI,eAAgB,GAErCxD,EAAEkC,SAASC,MAAMqB,IAAI,gBAAiB,IAG9CnD,EAAOiB,GAAG8F,QAAQ7F,KAAKF,MACvBA,KAAKH,WAAWkG,UAChBlH,EAAMkH,QAAQ/F,KAAKL,SACnBK,KAAKL,QAAUK,KAAK4C,cAAgB5C,KAAKuC,cAAgBvC,KAAKe,gBAAkBf,KAAKoB,mBAAqBpB,KAAK6D,cAAgB,MAEnIjE,SACIoG,KAAM,SACN3F,SAAUf,EACVoB,KAAM,UACNmB,aAAa,EACbgB,MAAO,IACPtC,MAAM,EACNiC,SAAU,IAEdyD,QACI/G,EACAD,EACAE,IAGRN,GAAME,GAAGmH,OAAO1G,IAClBV,OAAOD,MAAMsH,QACRrH,OAAOD,OACE,kBAAVH,SAAwBA,OAAO0H,IAAM1H,OAAS,SAAU2H,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.drawer.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.drawer', ['kendo.userevents'], f);\n}(function () {\n var __meta__ = {\n id: 'drawer',\n name: 'Drawer',\n category: 'web',\n description: 'The Kendo Drawer widget provides slide to reveal sidebar',\n depends: ['userevents']\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, SHOW = 'show', HIDE = 'hide', ITEMCLICK = 'itemClick', PUSH = 'push', OVERLAY = 'overlay', LEFT = 'left', RIGHT = 'right';\n var Drawer = kendo.ui.Widget.extend({\n init: function (element, options) {\n var that = this;\n var userEvents;\n Widget.fn.init.call(this, element, options);\n options = that.options;\n that._element(element);\n that._wrapper(element);\n that.position();\n that._mode();\n if (options.mini) {\n that._miniMode();\n }\n that._initDrawerItems();\n if (options.mini && options.mode != PUSH) {\n that._setBodyOffset();\n }\n userEvents = this.userEvents = new kendo.UserEvents(options.mode != PUSH ? $(document.body) : this.drawerContainer, {\n fastTap: true,\n allowSelection: true\n });\n var tap = function (e) {\n if ($.contains(that.drawerItemsWrapper[0], e.event.target)) {\n that._itemClick(e);\n }\n if (that.visible && !that.trigger('hide', { sender: this })) {\n that.hide();\n e.preventDefault();\n }\n };\n if (this.options.swipeToOpen) {\n userEvents.bind('start', function (e) {\n that._start(e);\n });\n userEvents.bind('move', function (e) {\n that._update(e);\n });\n userEvents.bind('end', function (e) {\n that._end(e);\n });\n userEvents.bind('tap', tap);\n } else {\n userEvents.bind('press', tap);\n }\n if (options.minHeight && options.mode == PUSH) {\n that.drawerContainer.css('min-height', options.minHeight);\n }\n },\n _element: function () {\n var that = this;\n var element = that.element;\n var options = that.options;\n var contentElement = that.contentElement = element.children().first();\n that.drawerElement = $(options.template);\n contentElement.addClass('k-drawer-content');\n element.addClass('k-widget k-drawer');\n },\n _wrapper: function () {\n var options = this.options;\n var drawerElement = this.drawerElement;\n var element = this.element;\n var contentElement = this.contentElement;\n var drawerItemsWrapper = this.drawerItemsWrapper = drawerElement.wrap('
').parent();\n var drawerWrapper = this.drawerWrapper = drawerItemsWrapper.wrap('').parent();\n var drawerContainer = this.drawerContainer = element.wrap('').parent();\n if (options.mini) {\n if (options.mini.width) {\n drawerWrapper.width(options.mini.width);\n }\n } else {\n drawerWrapper.width(0);\n }\n if (options.mode === PUSH) {\n drawerContainer.append(contentElement);\n } else if (options.mode === OVERLAY) {\n drawerContainer.after(contentElement);\n $(document.body).prepend(drawerContainer);\n }\n element.append(drawerWrapper);\n },\n _setBodyOffset: function () {\n var overlayMiniOffset = this.element.outerWidth();\n if (this.leftPositioned) {\n $(document.body).css('padding-left', overlayMiniOffset);\n } else {\n $(document.body).css('padding-right', overlayMiniOffset);\n }\n },\n _initDrawerItems: function () {\n var drawerItemsWrapper = this.drawerItemsWrapper;\n var drawerItems = drawerItemsWrapper.find('[data-role=\\'drawer-item\\']');\n var separatorItems = drawerItemsWrapper.find('[data-role=\\'drawer-separator\\']');\n drawerItems.addClass('k-drawer-item');\n separatorItems.addClass('k-drawer-item k-drawer-separator');\n if (this._selectedItemIndex >= 0) {\n drawerItems.removeClass('k-state-selected');\n drawerItems.eq(this._selectedItemIndex).addClass('k-state-selected');\n }\n },\n _mode: function () {\n var options = this.options;\n var drawerContainer = this.drawerContainer;\n var overlayContainer;\n if (options.mode == PUSH) {\n drawerContainer.addClass('k-drawer-' + PUSH);\n } else {\n drawerContainer.addClass('k-drawer-' + OVERLAY);\n overlayContainer = this.overlayContainer = $('');\n overlayContainer.hide();\n drawerContainer.prepend(overlayContainer);\n }\n },\n _miniMode: function () {\n var options = this.options;\n var drawerContainer = this.drawerContainer;\n var miniWidth = options.mini.width;\n var miniTemplate = this._miniTemplate = options.mini.template && $(options.mini.template);\n var drawerItemsWrapper = this.drawerItemsWrapper;\n var drawerWrapper = this.drawerWrapper;\n drawerContainer.addClass('k-drawer-mini');\n if (miniTemplate) {\n drawerItemsWrapper.html(miniTemplate);\n }\n if (miniWidth) {\n drawerWrapper.width(miniWidth);\n }\n this.minWidth = options.mini.width || this.drawerWrapper.width();\n },\n show: function () {\n var drawerWrapper = this.drawerWrapper;\n var drawerContainer = this.drawerContainer;\n var options = this.options;\n var isExpanded = drawerContainer.hasClass('k-drawer-expanded');\n var miniTemplate = this._miniTemplate;\n var drawerElement = this.drawerElement;\n var drawerItemsWrapper = this.drawerItemsWrapper;\n if (!isExpanded) {\n drawerContainer.addClass('k-drawer-expanded');\n this.visible = true;\n }\n if (miniTemplate) {\n drawerItemsWrapper.html(drawerElement);\n this._initDrawerItems();\n this._selectItem();\n }\n drawerWrapper.width(options.width);\n if (options.mode === OVERLAY) {\n this.overlayContainer.show();\n this.visible = true;\n }\n },\n hide: function () {\n var that = this;\n var drawerWrapper = that.drawerWrapper;\n var drawerContainer = that.drawerContainer;\n var options = this.options;\n var drawerItemsWrapper = this.drawerItemsWrapper;\n var miniTemplate = this._miniTemplate;\n var miniWidth = options.mini && options.mini.width;\n if (this._miniTemplate) {\n drawerItemsWrapper.html(miniTemplate);\n that._initDrawerItems();\n this._selectItem();\n }\n if (options.mini) {\n if (miniWidth) {\n drawerWrapper.width(miniWidth);\n } else {\n drawerWrapper.width('');\n }\n } else {\n drawerWrapper.width(0);\n }\n if (this.visible) {\n drawerContainer.removeClass('k-drawer-expanded');\n this.visible = false;\n }\n if (options.mode === OVERLAY) {\n this.overlayContainer.hide();\n }\n },\n position: function (value) {\n var that = this;\n var options = that.options;\n var position = value || options.position;\n var drawerContainer = that.drawerContainer;\n if (position == RIGHT) {\n drawerContainer.removeClass('k-drawer-' + LEFT);\n drawerContainer.addClass('k-drawer-' + RIGHT);\n } else {\n drawerContainer.removeClass('k-drawer-' + RIGHT);\n drawerContainer.addClass('k-drawer-' + LEFT);\n }\n this.leftPositioned = position === LEFT;\n },\n _start: function (e) {\n var that = this;\n var options = this.options;\n var drawerWrapper = this.drawerWrapper;\n var drawerItemsWrapper = this.drawerItemsWrapper;\n var userEvents = e.sender;\n if (Math.abs(e.x.velocity) < Math.abs(e.y.velocity) || kendo.triggeredByInput(e.event)) {\n userEvents.cancel();\n return;\n }\n if (this.drawerMini) {\n drawerItemsWrapper.html(that.drawerElement);\n }\n drawerWrapper.css('transition', 'none');\n if (options.mode != PUSH) {\n this.overlayContainer.show();\n }\n },\n _update: function (e) {\n var options = this.options;\n var mode = options.mode;\n if (mode == PUSH) {\n this._push(e);\n } else {\n this._overlay(e);\n }\n },\n _end: function (e) {\n var velocity = e.x.velocity;\n var options = this.options;\n var drawerWrapper = this.drawerWrapper;\n var elementWidth = drawerWrapper.width();\n var pastHalf = elementWidth > options.width / 2;\n var velocityThreshold = 0.8;\n var shouldShow;\n drawerWrapper.css('transition', 'all .3s ease-out');\n if (this.leftPositioned) {\n shouldShow = velocity > -velocityThreshold && (velocity > velocityThreshold || pastHalf);\n } else {\n shouldShow = velocity < velocityThreshold && (velocity < -velocityThreshold || pastHalf);\n }\n if (shouldShow) {\n if (this.trigger('show', { sender: this })) {\n e.preventDefault();\n this.hide();\n } else {\n this.show();\n }\n } else {\n if (this.trigger('hide', { sender: this })) {\n e.preventDefault();\n this.show();\n } else {\n this.hide();\n }\n }\n },\n _overlay: function (moveEventArgs) {\n var options = this.options;\n var minWidth = options.mini && options.mini.width || this.minWidth || 0;\n var drawerWrapper = this.drawerWrapper;\n var elementWidth = drawerWrapper.width();\n var limitedPosition;\n var updatedPosition;\n updatedPosition = elementWidth + (this.leftPositioned ? moveEventArgs.x.delta : -moveEventArgs.x.delta);\n limitedPosition = Math.min(Math.max(updatedPosition, minWidth), options.width);\n moveEventArgs.event.preventDefault();\n moveEventArgs.event.stopPropagation();\n drawerWrapper.width(limitedPosition);\n },\n _push: function (moveEventArgs) {\n var options = this.options;\n var minWidth = options.mini && options.mini.width || this.minWidth || 0;\n var drawerWrapper = this.drawerWrapper;\n var elementWidth = drawerWrapper.width();\n var limitedPosition;\n var updatedPosition;\n updatedPosition = elementWidth + (this.leftPositioned ? moveEventArgs.x.delta : -moveEventArgs.x.delta);\n limitedPosition = Math.min(Math.max(updatedPosition, minWidth), options.width);\n moveEventArgs.event.preventDefault();\n moveEventArgs.event.stopPropagation();\n drawerWrapper.width(limitedPosition);\n },\n _selectItem: function (item) {\n var selectedItemIndex;\n if (item) {\n item.addClass('k-state-selected');\n this.trigger('itemClick', {\n item: item,\n sender: this\n });\n this._selectedItemIndex = item.index();\n return;\n }\n selectedItemIndex = this._selectedItemIndex;\n if (selectedItemIndex) {\n this.drawerItemsWrapper.find('[data-role=\\'drawer-item\\']').eq(selectedItemIndex).addClass('k-state-selected');\n }\n },\n _itemClick: function (e) {\n var that = this;\n var item;\n if ($(e.event.target).find('.k-drawer-item').length > 0) {\n item = $(e.event.target).find('.k-drawer-item');\n } else if ($(e.event.target).closest('.k-drawer-item').length > 0) {\n item = $(e.event.target).closest('.k-drawer-item');\n } else if ($(e.event.target).hasClass('.k-drawer-item')) {\n item = $(e.event.target);\n }\n that.drawerItemsWrapper.find('.k-drawer-item').removeClass('k-state-selected');\n that._selectItem(item);\n },\n destroy: function () {\n var options = this.options;\n if (options.mode != PUSH) {\n if (this.leftPositioned) {\n $(document.body).css('padding-left', 0);\n } else {\n $(document.body).css('padding-right', 0);\n }\n }\n Widget.fn.destroy.call(this);\n this.userEvents.destroy();\n kendo.destroy(this.element);\n this.element = this.drawerWrapper = this.drawerElement = this.drawerContainer = this.drawerItemsWrapper = this._miniTemplate = null;\n },\n options: {\n name: 'Drawer',\n position: LEFT,\n mode: 'overlay',\n swipeToOpen: true,\n width: 280,\n mini: false,\n template: ''\n },\n events: [\n HIDE,\n SHOW,\n ITEMCLICK\n ]\n });\n kendo.ui.plugin(Drawer);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}