{"version":3,"sources":["kendo.button.js"],"names":["f","define","$","undefined","kendo","window","Widget","ui","proxy","keys","CLICK","KBUTTON","KBUTTONICON","KBUTTONICONTEXT","NS","DISABLED","DISABLEDSTATE","FOCUSEDSTATE","SELECTEDSTATE","Button","extend","init","element","options","that","this","fn","call","wrapper","addClass","attr","enable","_tabindex","_graphics","on","_click","_focus","_blur","_keydown","_keyup","notify","destroy","off","events","name","icon","spriteCssClass","imageUrl","_isNativeButton","prop","toLowerCase","e","trigger","event","preventDefault","removeClass","keyCode","ENTER","SPACEBAR","span","img","isEmpty","contents","filter","hasClass","each","idx","el","nodeType","trim","nodeValue","length","children","first","prependTo","toggleClass","blur","err","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,gBAAiB,cAAeD,IACzC,WA6HE,MArHC,UAAUE,EAAGC,GAAb,GACOC,GAAQC,OAAOD,MAAOE,EAASF,EAAMG,GAAGD,OAAQE,EAAQN,EAAEM,MAAOC,EAAOL,EAAMK,KAAMC,EAAQ,QAASC,EAAU,WAAYC,EAAc,gBAAiBC,EAAkB,oBAAqBC,EAAK,eAAgBC,EAAW,WAAYC,EAAgB,mBAAoBC,EAAe,kBAAmBC,EAAgB,mBACnUC,EAASb,EAAOc,QAChBC,KAAM,SAAUC,EAASC,GACrB,GAAIC,GAAOC,IACXnB,GAAOoB,GAAGL,KAAKM,KAAKH,EAAMF,EAASC,GACnCD,EAAUE,EAAKI,QAAUJ,EAAKF,QAC9BC,EAAUC,EAAKD,QACfD,EAAQO,SAASlB,GAASmB,KAAK,OAAQ,UACvCP,EAAQQ,OAASR,EAAQQ,SAAWT,EAAQQ,KAAKf,GACjDS,EAAKO,OAAOR,EAAQQ,QACpBP,EAAKQ,YACLR,EAAKS,YACLX,EAAQY,GAAGxB,EAAQI,EAAIN,EAAMgB,EAAKW,OAAQX,IAAOU,GAAG,QAAUpB,EAAIN,EAAMgB,EAAKY,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cAAgB9D,EAAEuB,MAAMuC,SAAS,YAAc9D,EAAEuB,MAAMuC,SAAS,aAC1FC,KAAK,SAAUC,EAAKC,IACA,GAAfA,EAAGC,UAAgC,GAAfD,EAAGC,UAAiBlE,EAAEmE,KAAKF,EAAGG,WAAWC,OAAS,KACtEV,GAAU,KAIdvC,EAAQO,SADRgC,EACiBjD,EAEAC,IAGrBgC,GACAc,EAAOrC,EAAQkD,SAAS,eAAeC,QAClCd,EAAK,KACNA,EAAOzD,EAAE,gCAAgCwE,UAAUpD,IAEvDqC,EAAK9B,SAAS,OAASgB,IAChBC,GACPa,EAAOrC,EAAQkD,SAAS,iBAAiBC,QACpCd,EAAK,KACNA,EAAOzD,EAAE,kCAAkCwE,UAAUpD,IAEzDqC,EAAK9B,SAASiB,IACPC,IACPa,EAAMtC,EAAQkD,SAAS,eAAeC,QACjCb,EAAI,KACLA,EAAM1D,EAAE,sCAAsCwE,UAAUpD,IAE5DsC,EAAI9B,KAAK,MAAOiB,KAGxBhB,OAAQ,SAAUA,GACd,GAAIP,GAAOC,KAAMH,EAAUE,EAAKF,OAC5BS,KAAW5B,IACX4B,GAAS,GAEbA,IAAWA,EACXP,EAAKD,QAAQQ,OAASA,EACtBT,EAAQqD,YAAY3D,GAAgBe,GAAQD,KAAK,iBAAkBC,GAAQD,KAAKf,GAAWgB,EAC3F,KACIT,EAAQsD,OACV,MAAOC,OAIjBzE,GAAMG,GAAGuE,OAAO3D,IAClBd,OAAOD,MAAM2E,QACR1E,OAAOD,OACE,kBAAVH,SAAwBA,OAAO+E,IAAM/E,OAAS,SAAUgF,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.button.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.button', ['kendo.core'], f);\n}(function () {\n var __meta__ = {\n id: 'button',\n name: 'Button',\n category: 'web',\n description: 'The Button widget displays styled buttons.',\n depends: ['core']\n };\n (function ($, undefined) {\n var kendo = window.kendo, Widget = kendo.ui.Widget, proxy = $.proxy, keys = kendo.keys, CLICK = 'click', KBUTTON = 'k-button', KBUTTONICON = 'k-button-icon', KBUTTONICONTEXT = 'k-button-icontext', NS = '.kendoButton', DISABLED = 'disabled', DISABLEDSTATE = 'k-state-disabled', FOCUSEDSTATE = 'k-state-focused', SELECTEDSTATE = 'k-state-selected';\n var Button = Widget.extend({\n init: function (element, options) {\n var that = this;\n Widget.fn.init.call(that, element, options);\n element = that.wrapper = that.element;\n options = that.options;\n element.addClass(KBUTTON).attr('role', 'button');\n options.enable = options.enable && !element.attr(DISABLED);\n that.enable(options.enable);\n that._tabindex();\n that._graphics();\n element.on(CLICK + NS, proxy(that._click, that)).on('focus' + NS, proxy(that._focus, that)).on('blur' + NS, proxy(that._blur, that)).on('keydown' + NS, proxy(that._keydown, that)).on('keyup' + NS, proxy(that._keyup, that));\n kendo.notify(that);\n },\n destroy: function () {\n var that = this;\n that.wrapper.off(NS);\n Widget.fn.destroy.call(that);\n },\n events: [CLICK],\n options: {\n name: 'Button',\n icon: '',\n spriteCssClass: '',\n imageUrl: '',\n enable: true\n },\n _isNativeButton: function () {\n return this.element.prop('tagName').toLowerCase() == 'button';\n },\n _click: function (e) {\n if (this.options.enable) {\n if (this.trigger(CLICK, { event: e })) {\n e.preventDefault();\n }\n }\n },\n _focus: function () {\n if (this.options.enable) {\n this.element.addClass(FOCUSEDSTATE);\n }\n },\n _blur: function () {\n this.element.removeClass(FOCUSEDSTATE);\n },\n _keydown: function (e) {\n var that = this;\n if (!that._isNativeButton()) {\n if (e.keyCode == keys.ENTER || e.keyCode == keys.SPACEBAR) {\n if (e.keyCode == keys.SPACEBAR) {\n e.preventDefault();\n if (that.options.enable) {\n that.element.addClass(SELECTEDSTATE);\n }\n }\n that._click(e);\n }\n }\n },\n _keyup: function () {\n this.element.removeClass(SELECTEDSTATE);\n },\n _graphics: function () {\n var that = this, element = that.element, options = that.options, icon = options.icon, spriteCssClass = options.spriteCssClass, imageUrl = options.imageUrl, span, img, isEmpty;\n if (spriteCssClass || imageUrl || icon) {\n isEmpty = true;\n element.contents().filter(function () {\n return !$(this).hasClass('k-sprite') && !$(this).hasClass('k-icon') && !$(this).hasClass('k-image');\n }).each(function (idx, el) {\n if (el.nodeType == 1 || el.nodeType == 3 && $.trim(el.nodeValue).length > 0) {\n isEmpty = false;\n }\n });\n if (isEmpty) {\n element.addClass(KBUTTONICON);\n } else {\n element.addClass(KBUTTONICONTEXT);\n }\n }\n if (icon) {\n span = element.children('span.k-icon').first();\n if (!span[0]) {\n span = $('').prependTo(element);\n }\n span.addClass('k-i-' + icon);\n } else if (spriteCssClass) {\n span = element.children('span.k-sprite').first();\n if (!span[0]) {\n span = $('').prependTo(element);\n }\n span.addClass(spriteCssClass);\n } else if (imageUrl) {\n img = element.children('img.k-image').first();\n if (!img[0]) {\n img = $('').prependTo(element);\n }\n img.attr('src', imageUrl);\n }\n },\n enable: function (enable) {\n var that = this, element = that.element;\n if (enable === undefined) {\n enable = true;\n }\n enable = !!enable;\n that.options.enable = enable;\n element.toggleClass(DISABLEDSTATE, !enable).attr('aria-disabled', !enable).attr(DISABLED, !enable);\n try {\n element.blur();\n } catch (err) {\n }\n }\n });\n kendo.ui.plugin(Button);\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/"}