{"version":3,"sources":["kendo.virtuallist.js"],"names":["f","define","$","undefined","lastFrom","array","length","toArray","value","Array","isPrimitive","dataItem","getItemCount","screenHeight","listScreens","itemHeight","Math","ceil","appendChild","parent","className","tagName","element","document","createElement","getDefaultItemHeight","lineHeight","mockList","css","position","left","visibility","appendTo","body","parseFloat","kendo","getComputedStyles","find","remove","bufferSizes","opposite","down","up","listValidator","options","downThreshold","threshold","upThreshold","list","scrollTop","lastScrollTop","top","scrollCallback","callback","force","syncList","reorder","items","index","y","support","browser","msie","version","style","webkitTransform","transform","map2","templates","arr1","arr2","i","len","item","this","trigger","ITEMCHANGE","data","ns","ui","reshift","diff","range","splice","push","apply","unshift","render","itemTemplate","template","placeholderTemplate","angular","elements","attr","uid","html","toggleClass","FOCUSED","current","SELECTED","selected","newGroup","GROUPITEM","groupTemplate","group","mapChangedItems","itemsToMatch","found","j","itemsLength","selectedLength","changed","unchanged","isActivePromise","promise","state","window","Widget","DataBoundWidget","proxy","WRAPPER","VIRTUALLIST","CONTENT","LIST","HEADER","VIRTUALITEM","ITEM","HEIGHTCONTAINER","HOVER","CHANGE","CLICK","LISTBOUND","ACTIVATE","DEACTIVATE","VIRTUAL_LIST_NS","VirtualList","extend","init","that","bound","_fetching","fn","call","addClass","content","wrap","wrapper","header","before","prev","on","removeClass","_values","_selectedDataItems","_selectedIndexes","_rangesList","_promisesList","_optionID","guid","_templates","setDataSource","dataSource","throttle","_renderItems","_triggerListBound","delay","_selectable","name","autoBind","height","oppositeBuffer","type","selectable","dataValueField","fixedGroupTemplate","mapValueTo","valueMapper","events","setOptions","_selectProxy","off","refresh","_items","destroy","unbind","_refreshHandler","source","isArray","DataSource","create","_clean","_deferValueSet","mute","bind","setDSFilter","filter","view","fetch","skip","currentRangeStart","_selectingValue","_skip","_getValues","dataItems","getter","_valueGetter","map","e","result","action","isItemChange","filtered","isFiltered","_mute","focus","_createList","skipUpdateOnBind","done","removeAt","setValue","_forcePrefetch","shouldClear","slice","_valueDeferred","Deferred","select","_prefetchByValue","idx","dataView","_dataView","valueGetter","match","forSelection","success","response","mapValueToIndex","mapValueToDataItem","indexes","removed","_deselect","_triggerChange","added","resolve","deferredRange","take","itemCount","ranges","defs","low","floor","high","pages","each","_","deferred","end","existingRange","_multiplePrefetch","when","then","prefetch","isEmptyList","_activeDeferred","_getSkip","_findDataItem","_getRange","_findRange","min","total","dataItemByIndex","selectedDataItems","scrollWith","scrollTo","scrollToIndex","candidate","id","triggerEvent","flatView","isNaN","parseInt","_getElementByIndex","_focusedIndex","hasClass","removeAttr","_getElementLocation","_screenHeight","focusIndex","focusFirst","focusLast","lastIndex","heightContainer","offsetHeight","focusPrev","focusNext","indices","isAlreadySelected","singleSelection","prefetchStarted","_selectDeferred","_getIndecies","_deselectCurrentValues","_select","_listCreated","_lastDSFilter","Query","compareFilters","skipUpdate","noop","_getElementByDataItem","_lastScrollTop","empty","_height","hasData","setScreenHeight","yPosition","yDownPostion","screenEnd","key","_generateItems","count","tabIndex","setAttribute","minHeight","_saveInitialRanges","_ranges","start","get","_buildValueGetter","_setHeight","hide","show","_getter","_onScroll","getList","_listItems","_fixedHeader","_whenChanged","_reorderList","_calculateGroupPadding","currentHeight","padHeight","innerHTML","lastRequestedRange","lastRangeStart","pageSize","flatGroups","rangeStart","flatGroup","groups","groupLength","inRange","_getterDeferred","reject","firstItemIndex","_indexConstraint","firstVisibleGroup","currentVisibleGroup","firstVisibleDataItemIndex","firstVisibleDataItem","_itemMapper","listType","currentIndex","_currentGroup","_range","_view","_getDataItemsCollection","_listIndex","theValidator","theNew","currentOffset","Infinity","list2","offset","range2","abs","_bufferSizes","max","buffers","getElementIndex","jQuery","elementIndex","selectedIndex","selectedIndexes","removedindexesCounter","inArray","_deselectSingleItem","children","values","page","oldSkip","_clickHandler","currentTarget","isDefaultPrevented","firstItem","first","groupHeader","padding","display","scrollbar","plugin","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OA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,EAAUzW,EAAMyB,QAAQkV,aAE5BF,GAAW1W,WAAWuW,EAAU7W,IAAI,sBAAuB,IAAMM,WAAWuW,EAAUP,SAAS,YAAYtW,IAAI,SAAU,IACzH+W,EAAY/W,IAAI,gBAAiBgX,MAI7CzW,GAAM4C,GAAGwD,YAAcA,EACvBpG,EAAM4C,GAAGgU,OAAOxQ,IAClBnB,OAAOjF,MAAMwV,QACRvQ,OAAOjF,OACE,kBAAVlC,SAAwBA,OAAO+Y,IAAM/Y,OAAS,SAAUgZ,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.virtuallist.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.virtuallist', ['kendo.data'], f);\n}(function () {\n var __meta__ = {\n id: 'virtuallist',\n name: 'VirtualList',\n category: 'framework',\n depends: ['data'],\n hidden: true\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, DataBoundWidget = ui.DataBoundWidget, proxy = $.proxy, WRAPPER = 'k-virtual-wrap', VIRTUALLIST = 'k-virtual-list', CONTENT = 'k-virtual-content', LIST = 'k-list', HEADER = 'k-group-header', VIRTUALITEM = 'k-virtual-item', ITEM = 'k-item', HEIGHTCONTAINER = 'k-height-container', GROUPITEM = 'k-group', SELECTED = 'k-state-selected', FOCUSED = 'k-state-focused', HOVER = 'k-state-hover', CHANGE = 'change', CLICK = 'click', LISTBOUND = 'listBound', ITEMCHANGE = 'itemChange', ACTIVATE = 'activate', DEACTIVATE = 'deactivate', VIRTUAL_LIST_NS = '.VirtualList';\n function lastFrom(array) {\n return array[array.length - 1];\n }\n function toArray(value) {\n return value instanceof Array ? value : [value];\n }\n function isPrimitive(dataItem) {\n return typeof dataItem === 'string' || typeof dataItem === 'number' || typeof dataItem === 'boolean';\n }\n function getItemCount(screenHeight, listScreens, itemHeight) {\n return Math.ceil(screenHeight * listScreens / itemHeight);\n }\n function appendChild(parent, className, tagName) {\n var element = document.createElement(tagName || 'div');\n if (className) {\n element.className = className;\n }\n parent.appendChild(element);\n return element;\n }\n function getDefaultItemHeight() {\n var mockList = $('
'), lineHeight;\n mockList.css({\n position: 'absolute',\n left: '-200000px',\n visibility: 'hidden'\n });\n mockList.appendTo(document.body);\n lineHeight = parseFloat(kendo.getComputedStyles(mockList.find('.k-item')[0], ['line-height'])['line-height']);\n mockList.remove();\n return lineHeight;\n }\n function bufferSizes(screenHeight, listScreens, opposite) {\n return {\n down: screenHeight * opposite,\n up: screenHeight * (listScreens - 1 - opposite)\n };\n }\n function listValidator(options, screenHeight) {\n var downThreshold = (options.listScreens - 1 - options.threshold) * screenHeight;\n var upThreshold = options.threshold * screenHeight;\n return function (list, scrollTop, lastScrollTop) {\n if (scrollTop > lastScrollTop) {\n return scrollTop - list.top < downThreshold;\n } else {\n return list.top === 0 || scrollTop - list.top > upThreshold;\n }\n };\n }\n function scrollCallback(element, callback) {\n return function (force) {\n return callback(element.scrollTop, force);\n };\n }\n function syncList(reorder) {\n return function (list, force) {\n reorder(list.items, list.index, force);\n return list;\n };\n }\n function position(element, y) {\n if (kendo.support.browser.msie && kendo.support.browser.version < 10) {\n element.style.top = y + 'px';\n } else {\n element.style.webkitTransform = 'translateY(' + y + 'px)';\n element.style.transform = 'translateY(' + y + 'px)';\n }\n }\n function map2(callback, templates) {\n return function (arr1, arr2) {\n for (var i = 0, len = arr1.length; i < len; i++) {\n callback(arr1[i], arr2[i], templates);\n if (arr2[i].item) {\n this.trigger(ITEMCHANGE, {\n item: $(arr1[i]),\n data: arr2[i].item,\n ns: kendo.ui\n });\n }\n }\n };\n }\n function reshift(items, diff) {\n var range;\n if (diff > 0) {\n range = items.splice(0, diff);\n items.push.apply(items, range);\n } else {\n range = items.splice(diff, -diff);\n items.unshift.apply(items, range);\n }\n return range;\n }\n function render(element, data, templates) {\n var itemTemplate = templates.template;\n element = $(element);\n if (!data.item) {\n itemTemplate = templates.placeholderTemplate;\n }\n this.angular('cleanup', function () {\n return { elements: [element] };\n });\n element.attr('data-uid', data.item ? data.item.uid : '').attr('data-offset-index', data.index).html(itemTemplate(data.item || {}));\n element.toggleClass(FOCUSED, data.current);\n element.toggleClass(SELECTED, data.selected);\n element.toggleClass('k-first', data.newGroup);\n element.toggleClass('k-loading-item', !data.item);\n if (data.index !== 0 && data.newGroup) {\n $('
').appendTo(element).html(templates.groupTemplate(data.group));\n }\n if (data.top !== undefined) {\n position(element[0], data.top);\n }\n this.angular('compile', function () {\n return {\n elements: [element],\n data: [{\n dataItem: data.item,\n group: data.group,\n newGroup: data.newGroup\n }]\n };\n });\n }\n function mapChangedItems(selected, itemsToMatch) {\n var itemsLength = itemsToMatch.length;\n var selectedLength = selected.length;\n var dataItem;\n var found;\n var i, j;\n var changed = [];\n var unchanged = [];\n if (selectedLength) {\n for (i = 0; i < selectedLength; i++) {\n dataItem = selected[i];\n found = false;\n for (j = 0; j < itemsLength; j++) {\n if (dataItem === itemsToMatch[j]) {\n found = true;\n changed.push({\n index: i,\n item: dataItem\n });\n break;\n }\n }\n if (!found) {\n unchanged.push(dataItem);\n }\n }\n }\n return {\n changed: changed,\n unchanged: unchanged\n };\n }\n function isActivePromise(promise) {\n return promise && promise.state() !== 'resolved';\n }\n var VirtualList = DataBoundWidget.extend({\n init: function (element, options) {\n var that = this;\n that.bound(false);\n that._fetching = false;\n Widget.fn.init.call(that, element, options);\n if (!that.options.itemHeight) {\n that.options.itemHeight = getDefaultItemHeight();\n }\n options = that.options;\n that.element.addClass(LIST + ' ' + VIRTUALLIST).attr('role', 'listbox');\n that.content = that.element.wrap('
').parent();\n that.wrapper = that.content.wrap('
').parent();\n that.header = that.content.before('
').prev();\n that.element.on('mouseenter' + VIRTUAL_LIST_NS, 'li:not(.k-loading-item)', function () {\n $(this).addClass(HOVER);\n }).on('mouseleave' + VIRTUAL_LIST_NS, 'li', function () {\n $(this).removeClass(HOVER);\n });\n that._values = toArray(that.options.value);\n that._selectedDataItems = [];\n that._selectedIndexes = [];\n that._rangesList = {};\n that._promisesList = [];\n that._optionID = kendo.guid();\n that._templates();\n that.setDataSource(options.dataSource);\n that.content.on('scroll' + VIRTUAL_LIST_NS, kendo.throttle(function () {\n that._renderItems();\n that._triggerListBound();\n }, options.delay));\n that._selectable();\n },\n options: {\n name: 'VirtualList',\n autoBind: true,\n delay: 100,\n height: null,\n listScreens: 4,\n threshold: 0.5,\n itemHeight: null,\n oppositeBuffer: 1,\n type: 'flat',\n selectable: false,\n value: [],\n dataValueField: null,\n template: '#:data#',\n placeholderTemplate: 'loading...',\n groupTemplate: '#:data#',\n fixedGroupTemplate: 'fixed header template',\n mapValueTo: 'index',\n valueMapper: null\n },\n events: [\n CHANGE,\n CLICK,\n LISTBOUND,\n ITEMCHANGE,\n ACTIVATE,\n DEACTIVATE\n ],\n setOptions: function (options) {\n Widget.fn.setOptions.call(this, options);\n if (this._selectProxy && this.options.selectable === false) {\n this.element.off(CLICK, '.' + VIRTUALITEM, this._selectProxy);\n } else if (!this._selectProxy && this.options.selectable) {\n this._selectable();\n }\n this._templates();\n this.refresh();\n },\n items: function () {\n return $(this._items);\n },\n destroy: function () {\n this.wrapper.off(VIRTUAL_LIST_NS);\n this.dataSource.unbind(CHANGE, this._refreshHandler);\n Widget.fn.destroy.call(this);\n },\n setDataSource: function (source) {\n var that = this;\n var dataSource = source || {};\n var value;\n dataSource = $.isArray(dataSource) ? { data: dataSource } : dataSource;\n dataSource = kendo.data.DataSource.create(dataSource);\n if (that.dataSource) {\n that.dataSource.unbind(CHANGE, that._refreshHandler);\n that._clean();\n that.bound(false);\n that._deferValueSet = true;\n value = that.value();\n that.value([]);\n that.mute(function () {\n that.value(value);\n });\n } else {\n that._refreshHandler = $.proxy(that.refresh, that);\n }\n that.dataSource = dataSource.bind(CHANGE, that._refreshHandler);\n that.setDSFilter(dataSource.filter());\n if (dataSource.view().length !== 0) {\n that.refresh();\n } else if (that.options.autoBind) {\n dataSource.fetch();\n }\n },\n skip: function () {\n return this.dataSource.currentRangeStart();\n },\n _triggerListBound: function () {\n var that = this;\n var skip = that.skip();\n if (that.bound() && !that._selectingValue && that._skip !== skip) {\n that._skip = skip;\n that.trigger(LISTBOUND);\n }\n },\n _getValues: function (dataItems) {\n var getter = this._valueGetter;\n return $.map(dataItems, function (dataItem) {\n return getter(dataItem);\n });\n },\n refresh: function (e) {\n var that = this;\n var action = e && e.action;\n var isItemChange = action === 'itemchange';\n var filtered = this.isFiltered();\n var result;\n if (that._mute) {\n return;\n }\n that._deferValueSet = false;\n if (!that._fetching) {\n if (filtered) {\n that.focus(0);\n }\n that._createList();\n if (!action && that._values.length && !filtered && !that.options.skipUpdateOnBind) {\n that._selectingValue = true;\n that.value(that._values, true).done(function () {\n that.bound(true);\n that._selectingValue = false;\n that._triggerListBound();\n });\n } else {\n that.bound(true);\n that._triggerListBound();\n }\n } else {\n if (that._renderItems) {\n that._renderItems(true);\n }\n that._triggerListBound();\n }\n if (isItemChange || action === 'remove') {\n result = mapChangedItems(that._selectedDataItems, e.items);\n if (result.changed.length) {\n if (isItemChange) {\n that.trigger('selectedItemChange', { items: result.changed });\n } else {\n that.value(that._getValues(result.unchanged));\n }\n }\n }\n that._fetching = false;\n },\n removeAt: function (position) {\n this._selectedIndexes.splice(position, 1);\n this._values.splice(position, 1);\n return {\n position: position,\n dataItem: this._selectedDataItems.splice(position, 1)[0]\n };\n },\n setValue: function (value) {\n this._values = toArray(value);\n },\n value: function (value, _forcePrefetch) {\n var that = this;\n if (value === undefined) {\n return that._values.slice();\n }\n if (value === null) {\n value = [];\n }\n value = toArray(value);\n if (!that._valueDeferred || that._valueDeferred.state() === 'resolved') {\n that._valueDeferred = $.Deferred();\n }\n var shouldClear = that.options.selectable === 'multiple' && that.select().length && value.length;\n if (shouldClear || !value.length) {\n that.select(-1);\n }\n that._values = value;\n if (that.bound() && !that._mute && !that._deferValueSet || _forcePrefetch) {\n that._prefetchByValue(value);\n }\n return that._valueDeferred;\n },\n _prefetchByValue: function (value) {\n var that = this, dataView = that._dataView, valueGetter = that._valueGetter, mapValueTo = that.options.mapValueTo, item, match = false, forSelection = [];\n for (var i = 0; i < value.length; i++) {\n for (var idx = 0; idx < dataView.length; idx++) {\n item = dataView[idx].item;\n if (item) {\n match = isPrimitive(item) ? value[i] === item : value[i] === valueGetter(item);\n if (match) {\n forSelection.push(dataView[idx].index);\n }\n }\n }\n }\n if (forSelection.length === value.length) {\n that._values = [];\n that.select(forSelection);\n return;\n }\n if (typeof that.options.valueMapper === 'function') {\n that.options.valueMapper({\n value: this.options.selectable === 'multiple' ? value : value[0],\n success: function (response) {\n if (mapValueTo === 'index') {\n that.mapValueToIndex(response);\n } else if (mapValueTo === 'dataItem') {\n that.mapValueToDataItem(response);\n }\n }\n });\n } else {\n that.select([-1]);\n }\n },\n mapValueToIndex: function (indexes) {\n if (indexes === undefined || indexes === -1 || indexes === null) {\n indexes = [];\n } else {\n indexes = toArray(indexes);\n }\n if (!indexes.length) {\n indexes = [-1];\n } else {\n var removed = this._deselect([]).removed;\n if (removed.length) {\n this._triggerChange(removed, []);\n }\n }\n this.select(indexes);\n },\n mapValueToDataItem: function (dataItems) {\n var removed, added;\n if (dataItems === undefined || dataItems === null) {\n dataItems = [];\n } else {\n dataItems = toArray(dataItems);\n }\n if (!dataItems.length) {\n this.select([-1]);\n } else {\n removed = $.map(this._selectedDataItems, function (item, index) {\n return {\n index: index,\n dataItem: item\n };\n });\n added = $.map(dataItems, function (item, index) {\n return {\n index: index,\n dataItem: item\n };\n });\n this._selectedDataItems = dataItems;\n this._selectedIndexes = [];\n for (var i = 0; i < this._selectedDataItems.length; i++) {\n this._selectedIndexes.push(undefined);\n }\n this._triggerChange(removed, added);\n if (this._valueDeferred) {\n this._valueDeferred.resolve();\n }\n }\n },\n deferredRange: function (index) {\n var dataSource = this.dataSource;\n var take = this.itemCount;\n var ranges = this._rangesList;\n var result = $.Deferred();\n var defs = [];\n var low = Math.floor(index / take) * take;\n var high = Math.ceil(index / take) * take;\n var pages = high === low ? [high] : [\n low,\n high\n ];\n $.each(pages, function (_, skip) {\n var end = skip + take;\n var existingRange = ranges[skip];\n var deferred;\n if (!existingRange || existingRange.end !== end) {\n deferred = $.Deferred();\n ranges[skip] = {\n end: end,\n deferred: deferred\n };\n dataSource._multiplePrefetch(skip, take, function () {\n deferred.resolve();\n });\n } else {\n deferred = existingRange.deferred;\n }\n defs.push(deferred);\n });\n $.when.apply($, defs).then(function () {\n result.resolve();\n });\n return result;\n },\n prefetch: function (indexes) {\n var that = this, take = this.itemCount, isEmptyList = !that._promisesList.length;\n if (!isActivePromise(that._activeDeferred)) {\n that._activeDeferred = $.Deferred();\n that._promisesList = [];\n }\n $.each(indexes, function (_, index) {\n that._promisesList.push(that.deferredRange(that._getSkip(index, take)));\n });\n if (isEmptyList) {\n $.when.apply($, that._promisesList).done(function () {\n that._promisesList = [];\n that._activeDeferred.resolve();\n });\n }\n return that._activeDeferred;\n },\n _findDataItem: function (view, index) {\n var group;\n if (this.options.type === 'group') {\n for (var i = 0; i < view.length; i++) {\n group = view[i].items;\n if (group.length <= index) {\n index = index - group.length;\n } else {\n return group[index];\n }\n }\n }\n return view[index];\n },\n _getRange: function (skip, take) {\n return this.dataSource._findRange(skip, Math.min(skip + take, this.dataSource.total()));\n },\n dataItemByIndex: function (index) {\n var take = this.itemCount;\n var skip = this._getSkip(index, take);\n var view = this._getRange(skip, take);\n return this._findDataItem(view, [index - skip]);\n },\n selectedDataItems: function () {\n return this._selectedDataItems.slice();\n },\n scrollWith: function (value) {\n this.content.scrollTop(this.content.scrollTop() + value);\n },\n scrollTo: function (y) {\n this.content.scrollTop(y);\n },\n scrollToIndex: function (index) {\n this.scrollTo(index * this.options.itemHeight);\n },\n focus: function (candidate) {\n var element, index, data, current, itemHeight = this.options.itemHeight, id = this._optionID, triggerEvent = true;\n if (candidate === undefined) {\n current = this.element.find('.' + FOCUSED);\n return current.length ? current : null;\n }\n if (typeof candidate === 'function') {\n data = this.dataSource.flatView();\n for (var idx = 0; idx < data.length; idx++) {\n if (candidate(data[idx])) {\n candidate = idx;\n break;\n }\n }\n }\n if (candidate instanceof Array) {\n candidate = lastFrom(candidate);\n }\n if (isNaN(candidate)) {\n element = $(candidate);\n index = parseInt($(element).attr('data-offset-index'), 10);\n } else {\n index = candidate;\n element = this._getElementByIndex(index);\n }\n if (index === -1) {\n this.element.find('.' + FOCUSED).removeClass(FOCUSED);\n this._focusedIndex = undefined;\n return;\n }\n if (element.length) {\n if (element.hasClass(FOCUSED)) {\n triggerEvent = false;\n }\n if (this._focusedIndex !== undefined) {\n current = this._getElementByIndex(this._focusedIndex);\n current.removeClass(FOCUSED).removeAttr('id');\n if (triggerEvent) {\n this.trigger(DEACTIVATE);\n }\n }\n this._focusedIndex = index;\n element.addClass(FOCUSED).attr('id', id);\n var position = this._getElementLocation(index);\n if (position === 'top') {\n this.scrollTo(index * itemHeight);\n } else if (position === 'bottom') {\n this.scrollTo(index * itemHeight + itemHeight - this._screenHeight);\n } else if (position === 'outScreen') {\n this.scrollTo(index * itemHeight);\n }\n if (triggerEvent) {\n this.trigger(ACTIVATE);\n }\n } else {\n this._focusedIndex = index;\n this.items().removeClass(FOCUSED);\n this.scrollToIndex(index);\n }\n },\n focusIndex: function () {\n return this._focusedIndex;\n },\n focusFirst: function () {\n this.scrollTo(0);\n this.focus(0);\n },\n focusLast: function () {\n var lastIndex = this.dataSource.total();\n this.scrollTo(this.heightContainer.offsetHeight);\n this.focus(lastIndex);\n },\n focusPrev: function () {\n var index = this._focusedIndex;\n var current;\n if (!isNaN(index) && index > 0) {\n index -= 1;\n this.focus(index);\n current = this.focus();\n if (current && current.hasClass('k-loading-item')) {\n index += 1;\n this.focus(index);\n }\n return index;\n } else {\n index = this.dataSource.total() - 1;\n this.focus(index);\n return index;\n }\n },\n focusNext: function () {\n var index = this._focusedIndex;\n var lastIndex = this.dataSource.total() - 1;\n var current;\n if (!isNaN(index) && index < lastIndex) {\n index += 1;\n this.focus(index);\n current = this.focus();\n if (current && current.hasClass('k-loading-item')) {\n index -= 1;\n this.focus(index);\n }\n return index;\n } else {\n index = 0;\n this.focus(index);\n return index;\n }\n },\n _triggerChange: function (removed, added) {\n removed = removed || [];\n added = added || [];\n if (removed.length || added.length) {\n this.trigger(CHANGE, {\n removed: removed,\n added: added\n });\n }\n },\n select: function (candidate) {\n var that = this, indices, singleSelection = that.options.selectable !== 'multiple', prefetchStarted = isActivePromise(that._activeDeferred), filtered = this.isFiltered(), isAlreadySelected, deferred, result, removed = [];\n if (candidate === undefined) {\n return that._selectedIndexes.slice();\n }\n if (!that._selectDeferred || that._selectDeferred.state() === 'resolved') {\n that._selectDeferred = $.Deferred();\n }\n indices = that._getIndecies(candidate);\n isAlreadySelected = singleSelection && !filtered && lastFrom(indices) === lastFrom(this._selectedIndexes);\n removed = that._deselectCurrentValues(indices);\n if (removed.length || !indices.length || isAlreadySelected) {\n that._triggerChange(removed);\n if (that._valueDeferred) {\n that._valueDeferred.resolve();\n }\n return that._selectDeferred.resolve().promise();\n }\n if (indices.length === 1 && indices[0] === -1) {\n indices = [];\n }\n result = that._deselect(indices);\n removed = result.removed;\n indices = result.indices;\n if (singleSelection) {\n prefetchStarted = false;\n if (indices.length) {\n indices = [lastFrom(indices)];\n }\n }\n var done = function () {\n var added = that._select(indices);\n that.focus(indices);\n that._triggerChange(removed, added);\n if (that._valueDeferred) {\n that._valueDeferred.resolve();\n }\n that._selectDeferred.resolve();\n };\n deferred = that.prefetch(indices);\n if (!prefetchStarted) {\n if (deferred) {\n deferred.done(done);\n } else {\n done();\n }\n }\n return that._selectDeferred.promise();\n },\n bound: function (bound) {\n if (bound === undefined) {\n return this._listCreated;\n }\n this._listCreated = bound;\n },\n mute: function (callback) {\n this._mute = true;\n proxy(callback(), this);\n this._mute = false;\n },\n setDSFilter: function (filter) {\n this._lastDSFilter = $.extend({}, filter);\n },\n isFiltered: function () {\n if (!this._lastDSFilter) {\n this.setDSFilter(this.dataSource.filter());\n }\n return !kendo.data.Query.compareFilters(this.dataSource.filter(), this._lastDSFilter);\n },\n skipUpdate: $.noop,\n _getElementByIndex: function (index) {\n return this.items().filter(function (idx, element) {\n return index === parseInt($(element).attr('data-offset-index'), 10);\n });\n },\n _getElementByDataItem: function (dataItem) {\n var dataView = this._dataView, valueGetter = this._valueGetter, element, match;\n for (var i = 0; i < dataView.length; i++) {\n match = dataView[i].item && isPrimitive(dataView[i].item) ? dataView[i].item === dataItem : valueGetter(dataView[i].item) === valueGetter(dataItem);\n if (match) {\n element = dataView[i];\n break;\n }\n }\n return element ? this._getElementByIndex(element.index) : $();\n },\n _clean: function () {\n this.result = undefined;\n this._lastScrollTop = undefined;\n this._skip = undefined;\n $(this.heightContainer).remove();\n this.heightContainer = undefined;\n this.element.empty();\n },\n _height: function () {\n var hasData = !!this.dataSource.view().length, height = this.options.height, itemHeight = this.options.itemHeight, total = this.dataSource.total();\n if (!hasData) {\n height = 0;\n } else if (height / itemHeight > total) {\n height = total * itemHeight;\n }\n return height;\n },\n setScreenHeight: function () {\n var height = this._height();\n this.content.height(height);\n this._screenHeight = height;\n },\n screenHeight: function () {\n return this._screenHeight;\n },\n _getElementLocation: function (index) {\n var scrollTop = this.content.scrollTop(), screenHeight = this._screenHeight, itemHeight = this.options.itemHeight, yPosition = index * itemHeight, yDownPostion = yPosition + itemHeight, screenEnd = scrollTop + screenHeight, position;\n if (yPosition === scrollTop - itemHeight || yDownPostion > scrollTop && yPosition < scrollTop) {\n position = 'top';\n } else if (yPosition === screenEnd || yPosition < screenEnd && screenEnd < yDownPostion) {\n position = 'bottom';\n } else if (yPosition >= scrollTop && yPosition <= scrollTop + (screenHeight - itemHeight)) {\n position = 'inScreen';\n } else {\n position = 'outScreen';\n }\n return position;\n },\n _templates: function () {\n var options = this.options;\n var templates = {\n template: options.template,\n placeholderTemplate: options.placeholderTemplate,\n groupTemplate: options.groupTemplate,\n fixedGroupTemplate: options.fixedGroupTemplate\n };\n for (var key in templates) {\n if (typeof templates[key] !== 'function') {\n templates[key] = kendo.template(templates[key] || '');\n }\n }\n this.templates = templates;\n },\n _generateItems: function (element, count) {\n var items = [], item, itemHeight = this.options.itemHeight + 'px';\n while (count-- > 0) {\n item = document.createElement('li');\n item.tabIndex = -1;\n item.className = VIRTUALITEM + ' ' + ITEM;\n item.setAttribute('role', 'option');\n item.style.height = itemHeight;\n item.style.minHeight = itemHeight;\n element.appendChild(item);\n items.push(item);\n }\n return items;\n },\n _saveInitialRanges: function () {\n var ranges = this.dataSource._ranges;\n var deferred = $.Deferred();\n deferred.resolve();\n this._rangesList = {};\n for (var i = 0; i < ranges.length; i++) {\n this._rangesList[ranges[i].start] = {\n end: ranges[i].end,\n deferred: deferred\n };\n }\n },\n _createList: function () {\n var that = this, content = that.content.get(0), options = that.options, dataSource = that.dataSource;\n if (that.bound()) {\n that._clean();\n }\n that._saveInitialRanges();\n that._buildValueGetter();\n that.setScreenHeight();\n that.itemCount = getItemCount(that._screenHeight, options.listScreens, options.itemHeight);\n if (that.itemCount > dataSource.total()) {\n that.itemCount = dataSource.total();\n }\n that._items = that._generateItems(that.element[0], that.itemCount);\n that._setHeight(options.itemHeight * dataSource.total());\n that.options.type = (dataSource.group() || []).length ? 'group' : 'flat';\n if (that.options.type === 'flat') {\n that.header.hide();\n } else {\n that.header.show();\n }\n that.getter = that._getter(function () {\n that._renderItems(true);\n });\n that._onScroll = function (scrollTop, force) {\n var getList = that._listItems(that.getter);\n return that._fixedHeader(scrollTop, getList(scrollTop, force));\n };\n that._renderItems = that._whenChanged(scrollCallback(content, that._onScroll), syncList(that._reorderList(that._items, $.proxy(render, that))));\n that._renderItems();\n that._calculateGroupPadding(that._screenHeight);\n },\n _setHeight: function (height) {\n var currentHeight, heightContainer = this.heightContainer;\n if (!heightContainer) {\n heightContainer = this.heightContainer = appendChild(this.content[0], HEIGHTCONTAINER);\n } else {\n currentHeight = heightContainer.offsetHeight;\n }\n if (height !== currentHeight) {\n heightContainer.innerHTML = '';\n while (height > 0) {\n var padHeight = Math.min(height, 250000);\n appendChild(heightContainer).style.height = padHeight + 'px';\n height -= padHeight;\n }\n }\n },\n _getter: function () {\n var lastRequestedRange = null, dataSource = this.dataSource, lastRangeStart = dataSource.skip(), type = this.options.type, pageSize = this.itemCount, flatGroups = {};\n if (dataSource.pageSize() < pageSize) {\n this.mute(function () {\n dataSource.pageSize(pageSize);\n });\n }\n return function (index, rangeStart) {\n var that = this;\n if (!dataSource.inRange(rangeStart, pageSize)) {\n if (lastRequestedRange !== rangeStart) {\n lastRequestedRange = rangeStart;\n lastRangeStart = rangeStart;\n if (that._getterDeferred) {\n that._getterDeferred.reject();\n }\n that._getterDeferred = that.deferredRange(rangeStart);\n that._getterDeferred.then(function () {\n var firstItemIndex = that._indexConstraint(that.content[0].scrollTop);\n that._getterDeferred = null;\n if (rangeStart <= firstItemIndex && firstItemIndex <= rangeStart + pageSize) {\n that._fetching = true;\n dataSource.range(rangeStart, pageSize);\n }\n });\n }\n return null;\n } else {\n if (lastRangeStart !== rangeStart) {\n this.mute(function () {\n dataSource.range(rangeStart, pageSize);\n lastRangeStart = rangeStart;\n });\n }\n var result;\n if (type === 'group') {\n if (!flatGroups[rangeStart]) {\n var flatGroup = flatGroups[rangeStart] = [];\n var groups = dataSource.view();\n for (var i = 0, len = groups.length; i < len; i++) {\n var group = groups[i];\n for (var j = 0, groupLength = group.items.length; j < groupLength; j++) {\n flatGroup.push({\n item: group.items[j],\n group: group.value\n });\n }\n }\n }\n result = flatGroups[rangeStart][index - rangeStart];\n } else {\n result = dataSource.view()[index - rangeStart];\n }\n return result;\n }\n };\n },\n _fixedHeader: function (scrollTop, list) {\n var group = this.currentVisibleGroup, itemHeight = this.options.itemHeight, firstVisibleDataItemIndex = Math.floor((scrollTop - list.top) / itemHeight), firstVisibleDataItem = list.items[firstVisibleDataItemIndex];\n if (firstVisibleDataItem && firstVisibleDataItem.item) {\n var firstVisibleGroup = firstVisibleDataItem.group;\n if (firstVisibleGroup !== group) {\n this.header[0].innerHTML = firstVisibleGroup || '';\n this.currentVisibleGroup = firstVisibleGroup;\n }\n }\n return list;\n },\n _itemMapper: function (item, index, value) {\n var listType = this.options.type, itemHeight = this.options.itemHeight, currentIndex = this._focusedIndex, selected = false, current = false, newGroup = false, group = null, match = false, valueGetter = this._valueGetter;\n if (listType === 'group') {\n if (item) {\n newGroup = index === 0 || this._currentGroup && this._currentGroup !== item.group;\n this._currentGroup = item.group;\n }\n group = item ? item.group : null;\n item = item ? item.item : null;\n }\n if (!this.isFiltered() && value.length && item) {\n for (var i = 0; i < value.length; i++) {\n match = isPrimitive(item) ? value[i] === item : value[i] === valueGetter(item);\n if (match) {\n value.splice(i, 1);\n selected = true;\n break;\n }\n }\n }\n if (currentIndex === index) {\n current = true;\n }\n return {\n item: item ? item : null,\n group: group,\n newGroup: newGroup,\n selected: selected,\n current: current,\n index: index,\n top: index * itemHeight\n };\n },\n _range: function (index) {\n var itemCount = this.itemCount, value = this._values.slice(), items = [], item;\n this._view = {};\n this._currentGroup = null;\n for (var i = index, length = index + itemCount; i < length; i++) {\n item = this._itemMapper(this.getter(i, index), i, value);\n items.push(item);\n this._view[item.index] = item;\n }\n this._dataView = items;\n return items;\n },\n _getDataItemsCollection: function (scrollTop, lastScrollTop) {\n var items = this._range(this._listIndex(scrollTop, lastScrollTop));\n return {\n index: items.length ? items[0].index : 0,\n top: items.length ? items[0].top : 0,\n items: items\n };\n },\n _listItems: function () {\n var screenHeight = this._screenHeight, options = this.options;\n var theValidator = listValidator(options, screenHeight);\n return $.proxy(function (value, force) {\n var result = this.result, lastScrollTop = this._lastScrollTop;\n if (force || !result || !theValidator(result, value, lastScrollTop)) {\n result = this._getDataItemsCollection(value, lastScrollTop);\n }\n this._lastScrollTop = value;\n this.result = result;\n return result;\n }, this);\n },\n _whenChanged: function (getter, callback) {\n var current;\n return function (force) {\n var theNew = getter(force);\n if (theNew !== current) {\n current = theNew;\n callback(theNew, force);\n }\n };\n },\n _reorderList: function (list, reorder) {\n var that = this;\n var length = list.length;\n var currentOffset = -Infinity;\n reorder = $.proxy(map2(reorder, this.templates), this);\n return function (list2, offset, force) {\n var diff = offset - currentOffset;\n var range, range2;\n if (force || Math.abs(diff) >= length) {\n range = list;\n range2 = list2;\n } else {\n range = reshift(list, diff);\n range2 = diff > 0 ? list2.slice(-diff) : list2.slice(0, -diff);\n }\n reorder(range, range2, that.bound());\n currentOffset = offset;\n };\n },\n _bufferSizes: function () {\n var options = this.options;\n return bufferSizes(this._screenHeight, options.listScreens, options.oppositeBuffer);\n },\n _indexConstraint: function (position) {\n var itemCount = this.itemCount, itemHeight = this.options.itemHeight, total = this.dataSource.total();\n return Math.min(Math.max(total - itemCount, 0), Math.max(0, Math.floor(position / itemHeight)));\n },\n _listIndex: function (scrollTop, lastScrollTop) {\n var buffers = this._bufferSizes(), position;\n position = scrollTop - (scrollTop > lastScrollTop ? buffers.down : buffers.up);\n return this._indexConstraint(position);\n },\n _selectable: function () {\n if (this.options.selectable) {\n this._selectProxy = $.proxy(this, '_clickHandler');\n this.element.on(CLICK + VIRTUAL_LIST_NS, '.' + VIRTUALITEM, this._selectProxy);\n }\n },\n getElementIndex: function (element) {\n if (!(element instanceof jQuery)) {\n return undefined;\n }\n return parseInt(element.attr('data-offset-index'), 10);\n },\n _getIndecies: function (candidate) {\n var result = [], data;\n if (typeof candidate === 'function') {\n data = this.dataSource.flatView();\n for (var idx = 0; idx < data.length; idx++) {\n if (candidate(data[idx])) {\n result.push(idx);\n break;\n }\n }\n }\n if (typeof candidate === 'number') {\n result.push(candidate);\n }\n var elementIndex = this.getElementIndex(candidate);\n if (!isNaN(elementIndex)) {\n result.push(elementIndex);\n }\n if (candidate instanceof Array) {\n result = candidate;\n }\n return result;\n },\n _deselect: function (indices) {\n var removed = [], selectedIndex, dataItem, selectedIndexes = this._selectedIndexes, selectedDataItems = this._selectedDataItems, position = 0, selectable = this.options.selectable, removedindexesCounter = 0, valueGetter = this._valueGetter, item, match, result = null;\n indices = indices.slice();\n if (selectable === true || !indices.length) {\n for (var idx = 0; idx < selectedIndexes.length; idx++) {\n if (selectedIndexes[idx] !== undefined) {\n this._getElementByIndex(selectedIndexes[idx]).removeClass(SELECTED);\n } else if (selectedDataItems[idx]) {\n this._getElementByDataItem(selectedDataItems[idx]).removeClass(SELECTED);\n }\n removed.push({\n index: selectedIndexes[idx],\n position: idx,\n dataItem: selectedDataItems[idx]\n });\n }\n this._values = [];\n this._selectedDataItems = [];\n this._selectedIndexes = [];\n } else if (selectable === 'multiple') {\n for (var i = 0; i < indices.length; i++) {\n result = null;\n position = $.inArray(indices[i], selectedIndexes);\n dataItem = this.dataItemByIndex(indices[i]);\n if (position === -1 && dataItem) {\n for (var j = 0; j < selectedDataItems.length; j++) {\n match = isPrimitive(dataItem) ? selectedDataItems[j] === dataItem : valueGetter(selectedDataItems[j]) === valueGetter(dataItem);\n if (match) {\n item = this._getElementByIndex(indices[i]);\n result = this._deselectSingleItem(item, j, indices[i], removedindexesCounter);\n }\n }\n } else {\n selectedIndex = selectedIndexes[position];\n if (selectedIndex !== undefined) {\n item = this._getElementByIndex(selectedIndex);\n result = this._deselectSingleItem(item, position, selectedIndex, removedindexesCounter);\n }\n }\n if (result) {\n indices.splice(i, 1);\n removed.push(result);\n removedindexesCounter++;\n i--;\n }\n }\n }\n return {\n indices: indices,\n removed: removed\n };\n },\n _deselectSingleItem: function (item, position, selectedIndex, removedindexesCounter) {\n var dataItem;\n if (!item.hasClass('k-state-selected')) {\n return;\n }\n item.removeClass(SELECTED);\n this._values.splice(position, 1);\n this._selectedIndexes.splice(position, 1);\n dataItem = this._selectedDataItems.splice(position, 1)[0];\n return {\n index: selectedIndex,\n position: position + removedindexesCounter,\n dataItem: dataItem\n };\n },\n _deselectCurrentValues: function (indices) {\n var children = this.element[0].children;\n var value, index, position;\n var values = this._values;\n var removed = [];\n var idx = 0;\n var j;\n if (this.options.selectable !== 'multiple' || !this.isFiltered()) {\n return [];\n }\n if (indices[0] === -1) {\n $(children).removeClass('k-state-selected');\n removed = $.map(this._selectedDataItems.slice(0), function (dataItem, idx) {\n return {\n dataItem: dataItem,\n position: idx\n };\n });\n this._selectedIndexes = [];\n this._selectedDataItems = [];\n this._values = [];\n return removed;\n }\n for (; idx < indices.length; idx++) {\n position = -1;\n index = indices[idx];\n value = this._valueGetter(this.dataItemByIndex(index));\n for (j = 0; j < values.length; j++) {\n if (value == values[j]) {\n position = j;\n break;\n }\n }\n if (position > -1) {\n removed.push(this.removeAt(position));\n $(children[index]).removeClass('k-state-selected');\n }\n }\n return removed;\n },\n _getSkip: function (index, take) {\n var page = index < take ? 1 : Math.floor(index / take) + 1;\n return (page - 1) * take;\n },\n _select: function (indexes) {\n var that = this, singleSelection = this.options.selectable !== 'multiple', dataSource = this.dataSource, dataItem, oldSkip, take = this.itemCount, valueGetter = this._valueGetter, added = [];\n if (singleSelection) {\n that._selectedIndexes = [];\n that._selectedDataItems = [];\n that._values = [];\n }\n oldSkip = dataSource.skip();\n $.each(indexes, function (_, index) {\n var skip = that._getSkip(index, take);\n that.mute(function () {\n dataSource.range(skip, take);\n dataItem = that._findDataItem(dataSource.view(), [index - skip]);\n that._selectedIndexes.push(index);\n that._selectedDataItems.push(dataItem);\n that._values.push(isPrimitive(dataItem) ? dataItem : valueGetter(dataItem));\n added.push({\n index: index,\n dataItem: dataItem\n });\n that._getElementByIndex(index).addClass(SELECTED);\n dataSource.range(oldSkip, take);\n });\n });\n return added;\n },\n _clickHandler: function (e) {\n var item = $(e.currentTarget);\n if (!e.isDefaultPrevented() && item.attr('data-uid')) {\n this.trigger(CLICK, { item: item });\n }\n },\n _buildValueGetter: function () {\n this._valueGetter = kendo.getter(this.options.dataValueField);\n },\n _calculateGroupPadding: function (height) {\n var firstItem = this.items().first(), groupHeader = this.header, padding = 0;\n if (groupHeader[0] && groupHeader[0].style.display !== 'none') {\n if (height !== 'auto') {\n padding = kendo.support.scrollbar();\n }\n padding += parseFloat(firstItem.css('border-right-width'), 10) + parseFloat(firstItem.children('.k-group').css('right'), 10);\n groupHeader.css('padding-right', padding);\n }\n }\n });\n kendo.ui.VirtualList = VirtualList;\n kendo.ui.plugin(VirtualList);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"],"sourceRoot":"/source/"}