{"version":3,"sources":["kendo.mobile.listview.js"],"names":["f","define","$","undefined","whitespace","this","nodeType","Node","TEXT_NODE","nodeValue","match","whitespaceRegExp","addIcon","item","icon","querySelector","prepend","enhanceItem","attrValue","children","ICON_SELECTOR","enhanceLinkItem","parent","itemAndDetailButtons","add","kendo","roleSelector","otherNodes","contents","not","length","addClass","attr","enhanceCheckBoxItem","label","putAt","element","top","css","VirtualListViewItem","LOAD_ICON","VirtualListViewLoadingIndicator","VirtualListViewPressToLoadMore","VirtualListViewItemBinder","ListViewItemBinder","ListViewFilter","ListView","window","mobile","ui","outerHeight","_outerHeight","DataSource","data","Widget","DataBoundWidget","ITEM_SELECTOR","HIGHLIGHT_SELECTOR","proxy","GROUP_CLASS","ACTIVE_CLASS","GROUP_WRAPPER","GROUP_TEMPLATE","template","WRAPPER","SEARCH_TEMPLATE","NS","STYLED","DATABOUND","DATABINDING","ITEM_CHANGE","CLICK","CHANGE","PROGRESS","FUNCTION","buttonRegExp","HeaderFixer","Class","extend","init","listView","headerFixer","cacheHeaders","scroller","options","_shouldFixHeaders","_cacheHeaders","bind","_scrollHandler","e","_fixHeader","destroy","that","unbind","fixedHeaders","headerPair","offset","header","i","headers","scrollTop","currentHeader","fixedContainer","html","clone","type","find","each","_","unshift","position","DEFAULT_PULL_PARAMETERS","page","RefreshHandler","handler","pullParameters","setDataSource","dataSource","setOptions","pullToRefresh","pull","_pulled","read","call","_first","messages","pullTemplate","releaseTemplate","refreshTemplate","view","_change","pullHandled","VirtualList","Observable","list","fn","buffer","height","items","footer","refresh","itemConstructor","prevItem","idx","endReached","pop","viewSize","total","content","below","push","itemCount","trigger","_resize","totalHeight","bottom","averageItemHeight","remainingItemsCount","batchUpdate","nextIndex","initialOffset","lastDirection","update","above","shift","firstItem","lastItem","padding","up","lastTop","topBorder","bottomBorder","index","at","dataItem","append","offsetHeight","setDataItem","remove","appendTo","_loadIcon","enable","show","disable","hide","_loadButton","loadMoreText","loadMore","kendoMobileButton","_hideShowButton","next","_showLoadButton","removeClass","binder","chromeHeight","wrapper","empty","reset","range","makeVirtual","_scroll","_scrollEnd","pageSize","pressToLoadMore","virtualViewSize","Error","Buffer","Math","floor","updateScrollerSize","updateSize","virtualSize","itemBinder","_refreshHandler","_progressHandler","showLoading","_unbindDataSource","removedItems","addedItems","addedDataItems","adding","removing","action","dataItems","prependOnRefresh","appendOnRefresh","groups","group","groupedMode","_hasBindingTarget","findByDataItem","_filter","_shouldShowLoading","hideLoading","replaceGrouped","replace","indexOf","insertAt","ns","endlessScroll","filter","filterable","events","before","placeholder","autoFilter","searchInput","closest","on","preventDefault","end","_oldFilter","val","split","join","_filterChange","clearButton","_dataSourceChange","_refreshInput","appliedFilters","filters","field","value","_search","expr","setTimeout","_applyFilter","operator","ignoreCase","_clearFilter","scrollTreshold","scrollThreshold","_userEvents","UserEvents","fastTap","allowSelection","tap","_click","wrap","_headerFixer","_itemsCache","_templates","virtual","_style","$angular","_start","_itemBinder","_pullToRefreshHandler","_enhanceItems","notify","name","style","autoBind","headerTemplate","pullOffset","emptyDataSource","create","fetch","unwrap","_scrollerInstance","loader","triggerChange","_renderItems","eq","after","_angularItems","cancel","render","groupTemplate","angular","elements","selectors","uid","replaceItem","newItem","replaceWith","_size","getSize","callback","map","_dim","_toggle","_highlight","highlight","which","clicked","currentTarget","role","plainItem","prevented","isDefaultPrevented","toggleClass","dataIDAttribute","templateProxy","groupTemplateProxy","_headerTemplate","event","target","buttonElement","button","widgetInstance","id","getByUid","_styleGroups","rootItems","li","groupHeader","first","is","grouped","inset","parents","child","enhanced","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,yBACH,aACA,mBACA,uBACDD,IACL,WAu8BE,MA37BC,UAAUE,EAAGC,GAEV,QAASC,KACL,MAAOC,MAAKC,WAAaC,EAAKC,WAAaH,KAAKI,UAAUC,MAAMC,GAEpE,QAASC,GAAQC,EAAMC,GACfA,IAASD,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AOtB,OACE,kBAAVxB,SAAwBA,OAAOmW,IAAMnW,OAAS,SAAUoW,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.mobile.listview.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.mobile.listview', [\n 'kendo.data',\n 'kendo.userevents',\n 'kendo.mobile.button'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'mobile.listview',\n name: 'ListView',\n category: 'mobile',\n description: 'The Kendo Mobile ListView widget is used to display flat or grouped list of items.',\n depends: [\n 'data',\n 'userevents',\n 'mobile.button'\n ]\n };\n (function ($, undefined) {\n var kendo = window.kendo, Node = window.Node, mobile = kendo.mobile, ui = mobile.ui, outerHeight = kendo._outerHeight, DataSource = kendo.data.DataSource, Widget = ui.DataBoundWidget, ITEM_SELECTOR = '.km-list > li, > li:not(.km-group-container)', HIGHLIGHT_SELECTOR = '.km-listview-link, .km-listview-label', ICON_SELECTOR = '[' + kendo.attr('icon') + ']', proxy = $.proxy, attrValue = kendo.attrValue, GROUP_CLASS = 'km-group-title', ACTIVE_CLASS = 'km-state-active', GROUP_WRAPPER = '
', GROUP_TEMPLATE = kendo.template('
  • #= this.headerTemplate(data) #
  • '), WRAPPER = '
    ', SEARCH_TEMPLATE = kendo.template('
    Clear
    '), NS = '.kendoMobileListView', STYLED = 'styled', DATABOUND = 'dataBound', DATABINDING = 'dataBinding', ITEM_CHANGE = 'itemChange', CLICK = 'click', CHANGE = 'change', PROGRESS = 'progress', FUNCTION = 'function', whitespaceRegExp = /^\\s+$/, buttonRegExp = /button/;\n function whitespace() {\n return this.nodeType === Node.TEXT_NODE && this.nodeValue.match(whitespaceRegExp);\n }\n function addIcon(item, icon) {\n if (icon && !item[0].querySelector('.km-icon')) {\n item.prepend('');\n }\n }\n function enhanceItem(item) {\n addIcon(item, attrValue(item, 'icon'));\n addIcon(item, attrValue(item.children(ICON_SELECTOR), 'icon'));\n }\n function enhanceLinkItem(item) {\n var parent = item.parent(), itemAndDetailButtons = item.add(parent.children(kendo.roleSelector('detailbutton'))), otherNodes = parent.contents().not(itemAndDetailButtons).not(whitespace);\n if (otherNodes.length) {\n return;\n }\n item.addClass('km-listview-link').attr(kendo.attr('role'), 'listview-link');\n addIcon(item, attrValue(parent, 'icon'));\n addIcon(item, attrValue(item, 'icon'));\n }\n function enhanceCheckBoxItem(label) {\n if (!label[0].querySelector('input[type=checkbox],input[type=radio]')) {\n return;\n }\n var item = label.parent();\n if (item.contents().not(label).not(function () {\n return this.nodeType == 3;\n })[0]) {\n return;\n }\n label.addClass('km-listview-label');\n label.children('[type=checkbox],[type=radio]').addClass('km-widget km-icon km-check');\n }\n function putAt(element, top) {\n $(element).css('transform', 'translate3d(0px, ' + top + 'px, 0px)');\n }\n var HeaderFixer = kendo.Class.extend({\n init: function (listView) {\n var scroller = listView.scroller();\n if (!scroller) {\n return;\n }\n this.options = listView.options;\n this.element = listView.element;\n this.scroller = listView.scroller();\n this._shouldFixHeaders();\n var headerFixer = this;\n var cacheHeaders = function () {\n headerFixer._cacheHeaders();\n };\n listView.bind('resize', cacheHeaders);\n listView.bind(STYLED, cacheHeaders);\n listView.bind(DATABOUND, cacheHeaders);\n this._scrollHandler = function (e) {\n headerFixer._fixHeader(e);\n };\n scroller.bind('scroll', this._scrollHandler);\n },\n destroy: function () {\n var that = this;\n if (that.scroller) {\n that.scroller.unbind('scroll', that._scrollHandler);\n }\n },\n _fixHeader: function (e) {\n if (!this.fixedHeaders) {\n return;\n }\n var i = 0, scroller = this.scroller, headers = this.headers, scrollTop = e.scrollTop, headerPair, offset, header;\n do {\n headerPair = headers[i++];\n if (!headerPair) {\n header = $('
    ');\n break;\n }\n offset = headerPair.offset;\n header = headerPair.header;\n } while (offset + 1 > scrollTop);\n if (this.currentHeader != i) {\n scroller.fixedContainer.html(header.clone());\n this.currentHeader = i;\n }\n },\n _shouldFixHeaders: function () {\n this.fixedHeaders = this.options.type === 'group' && this.options.fixedHeaders;\n },\n _cacheHeaders: function () {\n this._shouldFixHeaders();\n if (!this.fixedHeaders) {\n return;\n }\n var headers = [], offset = this.scroller.scrollTop;\n this.element.find('.' + GROUP_CLASS).each(function (_, header) {\n header = $(header);\n headers.unshift({\n offset: header.position().top + offset,\n header: header\n });\n });\n this.headers = headers;\n this._fixHeader({ scrollTop: offset });\n }\n });\n var DEFAULT_PULL_PARAMETERS = function () {\n return { page: 1 };\n };\n var RefreshHandler = kendo.Class.extend({\n init: function (listView) {\n var handler = this, options = listView.options, scroller = listView.scroller(), pullParameters = options.pullParameters || DEFAULT_PULL_PARAMETERS;\n this.listView = listView;\n this.scroller = scroller;\n listView.bind('_dataSource', function (e) {\n handler.setDataSource(e.dataSource);\n });\n scroller.setOptions({\n pullToRefresh: true,\n pull: function () {\n if (!handler._pulled) {\n handler._pulled = true;\n handler.dataSource.read(pullParameters.call(listView, handler._first));\n }\n },\n messages: {\n pullTemplate: options.messages.pullTemplate,\n releaseTemplate: options.messages.releaseTemplate,\n refreshTemplate: options.messages.refreshTemplate\n }\n });\n },\n setDataSource: function (dataSource) {\n var handler = this;\n this._first = dataSource.view()[0];\n this.dataSource = dataSource;\n dataSource.bind('change', function () {\n handler._change();\n });\n dataSource.bind('error', function () {\n handler._change();\n });\n },\n _change: function () {\n var scroller = this.scroller, dataSource = this.dataSource;\n if (this._pulled) {\n scroller.pullHandled();\n }\n if (this._pulled || !this._first) {\n var view = dataSource.view();\n if (view[0]) {\n this._first = view[0];\n }\n }\n this._pulled = false;\n }\n });\n var VirtualList = kendo.Observable.extend({\n init: function (options) {\n var list = this;\n kendo.Observable.fn.init.call(list);\n list.buffer = options.buffer;\n list.height = options.height;\n list.item = options.item;\n list.items = [];\n list.footer = options.footer;\n list.buffer.bind('reset', function () {\n list.refresh();\n });\n },\n refresh: function () {\n var buffer = this.buffer, items = this.items, endReached = false;\n while (items.length) {\n items.pop().destroy();\n }\n this.offset = buffer.offset;\n var itemConstructor = this.item, prevItem, item;\n for (var idx = 0; idx < buffer.viewSize; idx++) {\n if (idx === buffer.total()) {\n endReached = true;\n break;\n }\n item = itemConstructor(this.content(this.offset + items.length));\n item.below(prevItem);\n prevItem = item;\n items.push(item);\n }\n this.itemCount = items.length;\n this.trigger('reset');\n this._resize();\n if (endReached) {\n this.trigger('endReached');\n }\n },\n totalHeight: function () {\n if (!this.items[0]) {\n return 0;\n }\n var list = this, items = list.items, top = items[0].top, bottom = items[items.length - 1].bottom, averageItemHeight = (bottom - top) / list.itemCount, remainingItemsCount = list.buffer.length - list.offset - list.itemCount;\n return (this.footer ? this.footer.height : 0) + bottom + remainingItemsCount * averageItemHeight;\n },\n batchUpdate: function (top) {\n var height = this.height(), items = this.items, item, initialOffset = this.offset;\n if (!items[0]) {\n return;\n }\n if (this.lastDirection) {\n while (items[items.length - 1].bottom > top + height * 2) {\n if (this.offset === 0) {\n break;\n }\n this.offset--;\n item = items.pop();\n item.update(this.content(this.offset));\n item.above(items[0]);\n items.unshift(item);\n }\n } else {\n while (items[0].top < top - height) {\n var nextIndex = this.offset + this.itemCount;\n if (nextIndex === this.buffer.total()) {\n this.trigger('endReached');\n break;\n }\n if (nextIndex === this.buffer.length) {\n break;\n }\n item = items.shift();\n item.update(this.content(this.offset + this.itemCount));\n item.below(items[items.length - 1]);\n items.push(item);\n this.offset++;\n }\n }\n if (initialOffset !== this.offset) {\n this._resize();\n }\n },\n update: function (top) {\n var list = this, items = this.items, item, firstItem, lastItem, height = this.height(), itemCount = this.itemCount, padding = height / 2, up = (this.lastTop || 0) > top, topBorder = top - padding, bottomBorder = top + height + padding;\n if (!items[0]) {\n return;\n }\n this.lastTop = top;\n this.lastDirection = up;\n if (up) {\n if (items[0].top > topBorder && items[items.length - 1].bottom > bottomBorder + padding && this.offset > 0) {\n this.offset--;\n item = items.pop();\n firstItem = items[0];\n item.update(this.content(this.offset));\n items.unshift(item);\n item.above(firstItem);\n list._resize();\n }\n } else {\n if (items[items.length - 1].bottom < bottomBorder && items[0].top < topBorder - padding) {\n var nextIndex = this.offset + itemCount;\n if (nextIndex === this.buffer.total()) {\n this.trigger('endReached');\n } else if (nextIndex !== this.buffer.length) {\n item = items.shift();\n lastItem = items[items.length - 1];\n items.push(item);\n item.update(this.content(this.offset + this.itemCount));\n list.offset++;\n item.below(lastItem);\n list._resize();\n }\n }\n }\n },\n content: function (index) {\n return this.buffer.at(index);\n },\n destroy: function () {\n this.unbind();\n },\n _resize: function () {\n var items = this.items, top = 0, bottom = 0, firstItem = items[0], lastItem = items[items.length - 1];\n if (firstItem) {\n top = firstItem.top;\n bottom = lastItem.bottom;\n }\n this.trigger('resize', {\n top: top,\n bottom: bottom\n });\n if (this.footer) {\n this.footer.below(lastItem);\n }\n }\n });\n kendo.mobile.ui.VirtualList = VirtualList;\n var VirtualListViewItem = kendo.Class.extend({\n init: function (listView, dataItem) {\n var element = listView.append([dataItem], true)[0], height = element.offsetHeight;\n $.extend(this, {\n top: 0,\n element: element,\n listView: listView,\n height: height,\n bottom: height\n });\n },\n update: function (dataItem) {\n this.element = this.listView.setDataItem(this.element, dataItem);\n },\n above: function (item) {\n if (item) {\n this.height = this.element.offsetHeight;\n this.top = item.top - this.height;\n this.bottom = item.top;\n putAt(this.element, this.top);\n }\n },\n below: function (item) {\n if (item) {\n this.height = this.element.offsetHeight;\n this.top = item.bottom;\n this.bottom = this.top + this.height;\n putAt(this.element, this.top);\n }\n },\n destroy: function () {\n kendo.destroy(this.element);\n $(this.element).remove();\n }\n });\n var LOAD_ICON = '
    ';\n var VirtualListViewLoadingIndicator = kendo.Class.extend({\n init: function (listView) {\n this.element = $('
  • ').appendTo(listView.element);\n this._loadIcon = $(LOAD_ICON).appendTo(this.element);\n },\n enable: function () {\n this.element.show();\n this.height = outerHeight(this.element, true);\n },\n disable: function () {\n this.element.hide();\n this.height = 0;\n },\n below: function (item) {\n if (item) {\n this.top = item.bottom;\n this.bottom = this.height + this.top;\n putAt(this.element, this.top);\n }\n }\n });\n var VirtualListViewPressToLoadMore = VirtualListViewLoadingIndicator.extend({\n init: function (listView, buffer) {\n this._loadIcon = $(LOAD_ICON).hide();\n this._loadButton = $('' + listView.options.messages.loadMoreText + '').hide();\n this.element = $('
  • ').append(this._loadIcon).append(this._loadButton).appendTo(listView.element);\n var loadMore = this;\n this._loadButton.kendoMobileButton().data('kendoMobileButton').bind('click', function () {\n loadMore._hideShowButton();\n buffer.next();\n });\n buffer.bind('resize', function () {\n loadMore._showLoadButton();\n });\n this.height = outerHeight(this.element, true);\n this.disable();\n },\n _hideShowButton: function () {\n this._loadButton.hide();\n this.element.addClass('km-scroller-refresh');\n this._loadIcon.css('display', 'block');\n },\n _showLoadButton: function () {\n this._loadButton.show();\n this.element.removeClass('km-scroller-refresh');\n this._loadIcon.hide();\n }\n });\n var VirtualListViewItemBinder = kendo.Class.extend({\n init: function (listView) {\n var binder = this;\n this.chromeHeight = outerHeight(listView.wrapper.children().not(listView.element));\n this.listView = listView;\n this.scroller = listView.scroller();\n this.options = listView.options;\n listView.bind('_dataSource', function (e) {\n binder.setDataSource(e.dataSource, e.empty);\n });\n listView.bind('resize', function () {\n if (!binder.list.items.length) {\n return;\n }\n binder.scroller.reset();\n binder.buffer.range(0);\n binder.list.refresh();\n });\n this.scroller.makeVirtual();\n this._scroll = function (e) {\n binder.list.update(e.scrollTop);\n };\n this.scroller.bind('scroll', this._scroll);\n this._scrollEnd = function (e) {\n binder.list.batchUpdate(e.scrollTop);\n };\n this.scroller.bind('scrollEnd', this._scrollEnd);\n },\n destroy: function () {\n this.list.unbind();\n this.buffer.unbind();\n this.scroller.unbind('scroll', this._scroll);\n this.scroller.unbind('scrollEnd', this._scrollEnd);\n },\n setDataSource: function (dataSource, empty) {\n var binder = this, options = this.options, listView = this.listView, scroller = listView.scroller(), pressToLoadMore = options.loadMore, pageSize, buffer, footer;\n this.dataSource = dataSource;\n pageSize = dataSource.pageSize() || options.virtualViewSize;\n if (!pageSize && !empty) {\n throw new Error('the DataSource does not have page size configured. Page Size setting is mandatory for the mobile listview virtual scrolling to work as expected.');\n }\n if (this.buffer) {\n this.buffer.destroy();\n }\n buffer = new kendo.data.Buffer(dataSource, Math.floor(pageSize / 2), pressToLoadMore);\n if (pressToLoadMore) {\n footer = new VirtualListViewPressToLoadMore(listView, buffer);\n } else {\n footer = new VirtualListViewLoadingIndicator(listView);\n }\n if (this.list) {\n this.list.destroy();\n }\n var list = new VirtualList({\n buffer: buffer,\n footer: footer,\n item: function (dataItem) {\n return new VirtualListViewItem(listView, dataItem);\n },\n height: function () {\n return scroller.height();\n }\n });\n list.bind('resize', function () {\n binder.updateScrollerSize();\n listView.updateSize();\n });\n list.bind('reset', function () {\n binder.footer.enable();\n });\n list.bind('endReached', function () {\n footer.disable();\n binder.updateScrollerSize();\n });\n buffer.bind('expand', function () {\n list.lastDirection = false;\n list.batchUpdate(scroller.scrollTop);\n });\n $.extend(this, {\n buffer: buffer,\n scroller: scroller,\n list: list,\n footer: footer\n });\n },\n updateScrollerSize: function () {\n this.scroller.virtualSize(0, this.list.totalHeight() + this.chromeHeight);\n },\n refresh: function () {\n this.list.refresh();\n },\n reset: function () {\n this.buffer.range(0);\n this.list.refresh();\n }\n });\n var ListViewItemBinder = kendo.Class.extend({\n init: function (listView) {\n var binder = this;\n this.listView = listView;\n this.options = listView.options;\n var itemBinder = this;\n this._refreshHandler = function (e) {\n itemBinder.refresh(e);\n };\n this._progressHandler = function () {\n listView.showLoading();\n };\n listView.bind('_dataSource', function (e) {\n binder.setDataSource(e.dataSource);\n });\n },\n destroy: function () {\n this._unbindDataSource();\n },\n reset: function () {\n },\n refresh: function (e) {\n var action = e && e.action, dataItems = e && e.items, listView = this.listView, dataSource = this.dataSource, prependOnRefresh = this.options.appendOnRefresh, view = dataSource.view(), groups = dataSource.group(), groupedMode = groups && groups[0], item;\n if (action === 'itemchange') {\n if (!listView._hasBindingTarget()) {\n item = listView.findByDataItem(dataItems)[0];\n if (item) {\n listView.setDataItem(item, dataItems[0]);\n }\n }\n return;\n }\n var removedItems, addedItems, addedDataItems;\n var adding = action === 'add' && !groupedMode || prependOnRefresh && !listView._filter;\n var removing = action === 'remove' && !groupedMode;\n if (adding) {\n removedItems = [];\n } else if (removing) {\n removedItems = listView.findByDataItem(dataItems);\n }\n if (listView.trigger(DATABINDING, {\n action: action || 'rebind',\n items: dataItems,\n removedItems: removedItems,\n index: e && e.index\n })) {\n if (this._shouldShowLoading()) {\n listView.hideLoading();\n }\n return;\n }\n if (action === 'add' && !groupedMode) {\n var index = view.indexOf(dataItems[0]);\n if (index > -1) {\n addedItems = listView.insertAt(dataItems, index);\n addedDataItems = dataItems;\n }\n } else if (action === 'remove' && !groupedMode) {\n addedItems = [];\n listView.remove(dataItems);\n } else if (groupedMode) {\n listView.replaceGrouped(view);\n } else if (prependOnRefresh && !listView._filter) {\n addedItems = listView.prepend(view);\n addedDataItems = view;\n } else {\n listView.replace(view);\n }\n if (this._shouldShowLoading()) {\n listView.hideLoading();\n }\n listView.trigger(DATABOUND, {\n ns: ui,\n addedItems: addedItems,\n addedDataItems: addedDataItems\n });\n },\n setDataSource: function (dataSource) {\n if (this.dataSource) {\n this._unbindDataSource();\n }\n this.dataSource = dataSource;\n dataSource.bind(CHANGE, this._refreshHandler);\n if (this._shouldShowLoading()) {\n this.dataSource.bind(PROGRESS, this._progressHandler);\n }\n },\n _unbindDataSource: function () {\n this.dataSource.unbind(CHANGE, this._refreshHandler).unbind(PROGRESS, this._progressHandler);\n },\n _shouldShowLoading: function () {\n var options = this.options;\n return !options.pullToRefresh && !options.loadMore && !options.endlessScroll;\n }\n });\n var ListViewFilter = kendo.Class.extend({\n init: function (listView) {\n var filter = this, filterable = listView.options.filterable, events = 'change paste', that = this;\n this.listView = listView;\n this.options = filterable;\n listView.element.before(SEARCH_TEMPLATE({ placeholder: filterable.placeholder || 'Search...' }));\n if (filterable.autoFilter !== false) {\n events += ' keyup';\n }\n this.element = listView.wrapper.find('.km-search-form');\n this.searchInput = listView.wrapper.find('input[type=search]').closest('form').on('submit' + NS, function (e) {\n e.preventDefault();\n }).end().on('focus' + NS, function () {\n filter._oldFilter = filter.searchInput.val();\n }).on(events.split(' ').join(NS + ' ') + NS, proxy(this._filterChange, this));\n this.clearButton = listView.wrapper.find('.km-filter-reset').on(CLICK, proxy(this, '_clearFilter')).hide();\n this._dataSourceChange = $.proxy(this._refreshInput, this);\n listView.bind('_dataSource', function (e) {\n e.dataSource.bind('change', that._dataSourceChange);\n });\n },\n _refreshInput: function () {\n var appliedFilters = this.listView.dataSource.filter();\n var searchInput = this.listView._filter.searchInput;\n if (!appliedFilters || appliedFilters.filters[0].field !== this.listView.options.filterable.field) {\n searchInput.val('');\n } else {\n searchInput.val(appliedFilters.filters[0].value);\n }\n },\n _search: function (expr) {\n this._filter = true;\n this.clearButton[expr ? 'show' : 'hide']();\n this.listView.dataSource.filter(expr);\n },\n _filterChange: function (e) {\n var filter = this;\n if (e.type == 'paste' && this.options.autoFilter !== false) {\n setTimeout(function () {\n filter._applyFilter();\n }, 1);\n } else {\n this._applyFilter();\n }\n },\n _applyFilter: function () {\n var options = this.options, value = this.searchInput.val(), expr = value.length ? {\n field: options.field,\n operator: options.operator || 'startswith',\n ignoreCase: options.ignoreCase,\n value: value\n } : null;\n if (value === this._oldFilter) {\n return;\n }\n this._oldFilter = value;\n this._search(expr);\n },\n _clearFilter: function (e) {\n this.searchInput.val('');\n this._search(null);\n e.preventDefault();\n }\n });\n var ListView = Widget.extend({\n init: function (element, options) {\n var listView = this;\n Widget.fn.init.call(this, element, options);\n element = this.element;\n options = this.options;\n if (options.scrollTreshold) {\n options.scrollThreshold = options.scrollTreshold;\n }\n element.on('down', HIGHLIGHT_SELECTOR, '_highlight').on('move up cancel', HIGHLIGHT_SELECTOR, '_dim');\n this._userEvents = new kendo.UserEvents(element, {\n fastTap: true,\n filter: ITEM_SELECTOR,\n allowSelection: true,\n tap: function (e) {\n listView._click(e);\n }\n });\n element.css('-ms-touch-action', 'auto');\n element.wrap(WRAPPER);\n this.wrapper = this.element.parent();\n this._headerFixer = new HeaderFixer(this);\n this._itemsCache = {};\n this._templates();\n this.virtual = options.endlessScroll || options.loadMore;\n this._style();\n if (this.options.$angular && (this.virtual || this.options.pullToRefresh)) {\n setTimeout($.proxy(this, '_start'));\n } else {\n this._start();\n }\n },\n _start: function () {\n var options = this.options;\n if (this.options.filterable) {\n this._filter = new ListViewFilter(this);\n }\n if (this.virtual) {\n this._itemBinder = new VirtualListViewItemBinder(this);\n } else {\n this._itemBinder = new ListViewItemBinder(this);\n }\n if (this.options.pullToRefresh) {\n this._pullToRefreshHandler = new RefreshHandler(this);\n }\n this.setDataSource(options.dataSource);\n this._enhanceItems(this.items());\n kendo.notify(this, ui);\n },\n events: [\n CLICK,\n DATABINDING,\n DATABOUND,\n ITEM_CHANGE\n ],\n options: {\n name: 'ListView',\n style: '',\n type: 'flat',\n autoBind: true,\n fixedHeaders: false,\n template: '#:data#',\n headerTemplate: '#:value#',\n appendOnRefresh: false,\n loadMore: false,\n endlessScroll: false,\n scrollThreshold: 30,\n pullToRefresh: false,\n messages: {\n loadMoreText: 'Press to load more',\n pullTemplate: 'Pull to refresh',\n releaseTemplate: 'Release to refresh',\n refreshTemplate: 'Refreshing'\n },\n pullOffset: 140,\n filterable: false,\n virtualViewSize: null\n },\n refresh: function () {\n this._itemBinder.refresh();\n },\n reset: function () {\n this._itemBinder.reset();\n },\n setDataSource: function (dataSource) {\n var emptyDataSource = !dataSource;\n this.dataSource = DataSource.create(dataSource);\n this.trigger('_dataSource', {\n dataSource: this.dataSource,\n empty: emptyDataSource\n });\n if (this.options.autoBind && !emptyDataSource) {\n this.items().remove();\n this.dataSource.fetch();\n }\n },\n destroy: function () {\n Widget.fn.destroy.call(this);\n kendo.destroy(this.element);\n this._userEvents.destroy();\n if (this._itemBinder) {\n this._itemBinder.destroy();\n }\n if (this._headerFixer) {\n this._headerFixer.destroy();\n }\n this.element.unwrap();\n delete this.element;\n delete this.wrapper;\n delete this._userEvents;\n },\n items: function () {\n if (this.options.type === 'group') {\n return this.element.find('.km-list').children();\n } else {\n return this.element.children().not('.km-load-more');\n }\n },\n scroller: function () {\n if (!this._scrollerInstance) {\n this._scrollerInstance = this.element.closest('.km-scroll-wrapper').data('kendoMobileScroller');\n }\n return this._scrollerInstance;\n },\n showLoading: function () {\n var view = this.view();\n if (view && view.loader) {\n view.loader.show();\n }\n },\n hideLoading: function () {\n var view = this.view();\n if (view && view.loader) {\n view.loader.hide();\n }\n },\n insertAt: function (dataItems, index, triggerChange) {\n var listView = this;\n return listView._renderItems(dataItems, function (items) {\n if (index === 0) {\n listView.element.prepend(items);\n } else if (index === -1) {\n listView.element.append(items);\n } else {\n listView.items().eq(index - 1).after(items);\n }\n if (triggerChange) {\n for (var i = 0; i < items.length; i++) {\n listView.trigger(ITEM_CHANGE, {\n item: items.eq(i),\n data: dataItems[i],\n ns: ui\n });\n }\n }\n });\n },\n append: function (dataItems, triggerChange) {\n return this.insertAt(dataItems, -1, triggerChange);\n },\n prepend: function (dataItems, triggerChange) {\n return this.insertAt(dataItems, 0, triggerChange);\n },\n replace: function (dataItems) {\n this.options.type = 'flat';\n this._angularItems('cleanup');\n kendo.destroy(this.element.children());\n this.element.empty();\n this._userEvents.cancel();\n this._style();\n return this.insertAt(dataItems, 0);\n },\n replaceGrouped: function (groups) {\n this.options.type = 'group';\n this._angularItems('cleanup');\n this.element.empty();\n var items = $(kendo.render(this.groupTemplate, groups));\n this._enhanceItems(items.children('ul').children('li'));\n this.element.append(items);\n mobile.init(items);\n this._style();\n this._angularItems('compile');\n },\n remove: function (dataItems) {\n var items = this.findByDataItem(dataItems);\n this.angular('cleanup', function () {\n return { elements: items };\n });\n kendo.destroy(items);\n items.remove();\n },\n findByDataItem: function (dataItems) {\n var selectors = [];\n for (var idx = 0, length = dataItems.length; idx < length; idx++) {\n selectors[idx] = '[data-' + kendo.ns + 'uid=' + dataItems[idx].uid + ']';\n }\n return this.element.find(selectors.join(','));\n },\n setDataItem: function (item, dataItem) {\n var listView = this, replaceItem = function (items) {\n var newItem = $(items[0]);\n kendo.destroy(item);\n listView.angular('cleanup', function () {\n return { elements: [$(item)] };\n });\n $(item).replaceWith(newItem);\n listView.trigger(ITEM_CHANGE, {\n item: newItem,\n data: dataItem,\n ns: ui\n });\n };\n return this._renderItems([dataItem], replaceItem)[0];\n },\n updateSize: function () {\n this._size = this.getSize();\n },\n _renderItems: function (dataItems, callback) {\n var items = $(kendo.render(this.template, dataItems));\n callback(items);\n this.angular('compile', function () {\n return {\n elements: items,\n data: dataItems.map(function (data) {\n return { dataItem: data };\n })\n };\n });\n mobile.init(items);\n this._enhanceItems(items);\n return items;\n },\n _dim: function (e) {\n this._toggle(e, false);\n },\n _highlight: function (e) {\n this._toggle(e, true);\n },\n _toggle: function (e, highlight) {\n if (e.which > 1) {\n return;\n }\n var clicked = $(e.currentTarget), item = clicked.parent(), role = attrValue(clicked, 'role') || '', plainItem = !role.match(buttonRegExp), prevented = e.isDefaultPrevented();\n if (plainItem) {\n item.toggleClass(ACTIVE_CLASS, highlight && !prevented);\n }\n },\n _templates: function () {\n var template = this.options.template, headerTemplate = this.options.headerTemplate, dataIDAttribute = ' data-uid=\"#=arguments[0].uid || \"\"#\"', templateProxy = {}, groupTemplateProxy = {};\n if (typeof template === FUNCTION) {\n templateProxy.template = template;\n template = '#=this.template(data)#';\n }\n this.template = proxy(kendo.template('' + template + ''), templateProxy);\n groupTemplateProxy.template = this.template;\n if (typeof headerTemplate === FUNCTION) {\n groupTemplateProxy._headerTemplate = headerTemplate;\n headerTemplate = '#=this._headerTemplate(data)#';\n }\n groupTemplateProxy.headerTemplate = kendo.template(headerTemplate);\n this.groupTemplate = proxy(GROUP_TEMPLATE, groupTemplateProxy);\n },\n _click: function (e) {\n if (e.event.which > 1 || e.event.isDefaultPrevented()) {\n return;\n }\n var dataItem, item = e.target, target = $(e.event.target), buttonElement = target.closest(kendo.roleSelector('button', 'detailbutton', 'backbutton')), button = kendo.widgetInstance(buttonElement, ui), id = item.attr(kendo.attr('uid'));\n if (id) {\n dataItem = this.dataSource.getByUid(id);\n }\n if (this.trigger(CLICK, {\n target: target,\n item: item,\n dataItem: dataItem,\n button: button\n })) {\n e.preventDefault();\n }\n },\n _styleGroups: function () {\n var rootItems = this.element.children();\n rootItems.children('ul').addClass('km-list');\n rootItems.each(function () {\n var li = $(this), groupHeader = li.contents().first();\n li.addClass('km-group-container');\n if (!groupHeader.is('ul') && !groupHeader.is('div.' + GROUP_CLASS)) {\n groupHeader.wrap(GROUP_WRAPPER);\n }\n });\n },\n _style: function () {\n var options = this.options, grouped = options.type === 'group', element = this.element, inset = options.style === 'inset';\n element.addClass('km-listview').toggleClass('km-list', !grouped).toggleClass('km-virtual-list', this.virtual).toggleClass('km-listinset', !grouped && inset).toggleClass('km-listgroup', grouped && !inset).toggleClass('km-listgroupinset', grouped && inset);\n if (!element.parents('.km-listview')[0]) {\n element.closest('.km-content').toggleClass('km-insetcontent', inset);\n }\n if (grouped) {\n this._styleGroups();\n }\n this.trigger(STYLED);\n },\n _enhanceItems: function (items) {\n items.each(function () {\n var item = $(this), child, enhanced = false;\n item.children().each(function () {\n child = $(this);\n if (child.is('a')) {\n enhanceLinkItem(child);\n enhanced = true;\n } else if (child.is('label')) {\n enhanceCheckBoxItem(child);\n enhanced = true;\n }\n });\n if (!enhanced) {\n enhanceItem(item);\n }\n });\n }\n });\n ui.plugin(ListView);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}