{"version":3,"file":"kendo.pager.min.js","sources":["kendo.pager.js"],"sourcesContent":["(function(f, define) {\n define('kendo.pager',[ \"kendo.data\" ], f);\n})(function() {\n\nvar __meta__ = {\n id: \"pager\",\n name: \"Pager\",\n category: \"framework\",\n depends: [ \"data\" ],\n advanced: true\n};\n\n(function($, undefined) {\n var kendo = window.kendo,\n ui = kendo.ui,\n Widget = ui.Widget,\n keys = kendo.keys,\n template = kendo.template,\n FIRST = \".k-i-arrow-end-left\",\n LAST = \".k-i-arrow-end-right\",\n PREV = \".k-i-arrow-60-left\",\n NEXT = \".k-i-arrow-60-right\",\n SIZE = \"k-pager-md k-pager-sm\",\n FOCUSABLE = \":kendoFocusable:not([tabindex='-1'])\",\n CHANGE = \"change\",\n NS = \".kendoPager\",\n CLICK = \"click\",\n KEYDOWN = \"keydown\",\n DISABLED = \"disabled\",\n MOUSEDOWN = \"down\",\n MAX_VALUE = Number.MAX_VALUE,\n isRtl = false,\n iconTemplate = kendo.template('');\n\n function button(options) {\n return options.template( {\n idx: options.idx,\n text: options.text,\n ns: kendo.ns,\n numeric: options.numeric,\n title: options.title || \"\",\n tabindex: options.navigatable ? 0 : -1,\n navigatable: options.navigatable\n });\n }\n\n function selectOption(template, idx, text, selected) {\n return template( {\n idx: idx,\n text: text || idx,\n selected: selected || false\n });\n }\n\n function icon(className, text, wrapClassName, id) {\n return iconTemplate({\n className: className.substring(1),\n text: text,\n wrapClassName: wrapClassName || \"\",\n id: id || \"\"\n });\n }\n\n function update(element, selector, page, disabled) {\n element.find(selector)\n .parent()\n .attr(kendo.attr(\"page\"), page)\n .attr(\"tabindex\", disabled ? -1 : 0)\n .attr(\"aria-disabled\", disabled)\n .toggleClass(\"k-disabled\", disabled);\n }\n\n function first(element, page) {\n update(element, FIRST, 1, page <= 1);\n }\n\n function prev(element, page) {\n update(element, PREV, Math.max(1, page - 1), page <= 1);\n }\n\n function next(element, page, totalPages) {\n update(element, NEXT, Math.min(totalPages, page + 1), page >= totalPages);\n }\n\n function last(element, page, totalPages) {\n update(element, LAST, totalPages, page >= totalPages);\n }\n\n var Pager = Widget.extend( {\n init: function(element, options) {\n var that = this, page, totalPages;\n var sizeClassName = null;\n\n Widget.fn.init.call(that, element, options);\n\n options = that.options;\n that._createDataSource(options);\n that.linkTemplate = kendo.template(that.options.linkTemplate);\n that.selectTemplate = kendo.template(that.options.selectTemplate);\n that.numericSelectItemTemplate = kendo.template(that.options.numericSelectItemTemplate);\n\n page = that.page();\n totalPages = that.totalPages();\n\n that._refreshHandler = that.refresh.bind(that);\n\n that.dataSource.bind(CHANGE, that._refreshHandler);\n that.downEvent = kendo.applyEventMap(MOUSEDOWN, kendo.guid());\n\n isRtl = kendo.support.isRtl(element);\n\n if (options.navigatable) {\n that._id = that.element.attr(\"id\") || kendo.guid();\n }\n that._template();\n\n if (options.previousNext) {\n if (!that.element.find(FIRST).length) {\n that.element.append(icon(FIRST, options.messages.first, \"k-pager-first\", that._id));\n\n first(that.element, page, totalPages);\n }\n\n if (!that.element.find(PREV).length) {\n that.element.append(icon(PREV, options.messages.previous, null, that._id));\n\n prev(that.element, page, totalPages);\n }\n }\n\n if (options.numeric) {\n if (!that._numericWrap) {\n that._numericWrap = that.element.find(\".k-pager-numbers-wrap\");\n\n if (that._numericWrap.length === 0) {\n that._numericWrap = $(\"
\").appendTo(that.element);\n }\n }\n\n if (!that._numericSelect) {\n that._numericSelect = that._numericWrap.find(\".k-dropdown\");\n\n if (that._numericSelect.length === 0) {\n that._numericSelect = $(\"\").appendTo(that._numericWrap);\n }\n }\n\n if (!that.list) {\n that.list = that._numericWrap.find(\".k-pager-numbers\");\n\n if (that.list.length === 0) {\n that.list = $('