{"version":3,"sources":["kendo.mobile.buttongroup.js"],"names":["f","define","$","undefined","createBadge","value","kendo","window","ui","mobile","Widget","ACTIVE","DISABLE","SELECT","SELECTOR","ButtonGroup","extend","init","element","options","that","this","fn","call","addClass","find","each","_button","on","selectOn","_enable","select","index","enable","wrapper","events","name","current","li","is","removeClass","children","nodeType","selectedIndex","badge","item","buttongroup","isNaN","get","appendTo","html","empty","remove","button","icon","attrValue","span","image","wrapInner","prepend","_select","e","which","isDefaultPrevented","currentTarget","trigger","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,4BAA6B,cAAeD,IACrD,WAwGE,MAhGC,UAAUE,EAAGC,GAEV,QAASC,GAAYC,GACjB,MAAOH,GAAE,0BAA4BG,EAAQ,WAHpD,GACOC,GAAQC,OAAOD,MAAOE,EAAKF,EAAMG,OAAOD,GAAIE,EAASF,EAAGE,OAAQC,EAAS,kBAAmBC,EAAU,oBAAqBC,EAAS,SAAUC,EAAW,WAAaH,EAAS,IAI/KI,EAAcL,EAAOM,QACrBC,KAAM,SAAUC,EAASC,GACrB,GAAIC,GAAOC,IACXX,GAAOY,GAAGL,KAAKM,KAAKH,EAAMF,EAASC,GACnCC,EAAKF,QAAQM,SAAS,kBAAkBC,KAAK,MAAMC,KAAKN,EAAKO,SAC7DP,EAAKF,QAAQU,GAAGR,EAAKD,QAAQU,SAAUf,EAAU,WACjDM,EAAKU,SAAU,EACfV,EAAKW,OAAOX,EAAKD,QAAQa,OACpBZ,EAAKD,QAAQc,SACdb,EAAKU,SAAU,EACfV,EAAKc,QAAQV,SAASZ,KAG9BuB,QAAStB,GACTM,SACIiB,KAAM,cACNP,SAAU,OACVG,SACAC,QAAQ,GAEZI,QAAS,WACL,MAAOhB,MAAKH,QAAQO,KAAK,IAAMd,IAEnCoB,OAAQ,SAAUO,GACd,GAAIlB,GAAOC,KAAMW,IACbM,KAAOnC,GAAamC,QAAclB,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uBAAyB1C,KAAKS,UAGnDT,KAAKU,OAAO8B,EAAEG,eACd3C,KAAK4C,QAAQpD,GAAUmB,MAAOX,KAAKsB,mBAG3CnC,GAAG0D,OAAOnD,IACZR,OAAOD,MAAM6D,QACR5D,OAAOD,OACE,kBAAVL,SAAwBA,OAAOmE,IAAMnE,OAAS,SAAUoE,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.mobile.buttongroup.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.buttongroup', ['kendo.core'], f);\n}(function () {\n var __meta__ = {\n id: 'mobile.buttongroup',\n name: 'ButtonGroup',\n category: 'mobile',\n description: 'The Kendo mobile ButtonGroup widget is a linear set of grouped buttons.',\n depends: ['core']\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.mobile.ui, Widget = ui.Widget, ACTIVE = 'km-state-active', DISABLE = 'km-state-disabled', SELECT = 'select', SELECTOR = 'li:not(.' + ACTIVE + ')';\n function createBadge(value) {\n return $('' + value + '');\n }\n var ButtonGroup = Widget.extend({\n init: function (element, options) {\n var that = this;\n Widget.fn.init.call(that, element, options);\n that.element.addClass('km-buttongroup').find('li').each(that._button);\n that.element.on(that.options.selectOn, SELECTOR, '_select');\n that._enable = true;\n that.select(that.options.index);\n if (!that.options.enable) {\n that._enable = false;\n that.wrapper.addClass(DISABLE);\n }\n },\n events: [SELECT],\n options: {\n name: 'ButtonGroup',\n selectOn: 'down',\n index: -1,\n enable: true\n },\n current: function () {\n return this.element.find('.' + ACTIVE);\n },\n select: function (li) {\n var that = this, index = -1;\n if (li === undefined || li === -1 || !that._enable || $(li).is('.' + DISABLE)) {\n return;\n }\n that.current().removeClass(ACTIVE);\n if (typeof li === 'number') {\n index = li;\n li = $(that.element[0].children[li]);\n } else if (li.nodeType) {\n li = $(li);\n index = li.index();\n }\n li.addClass(ACTIVE);\n that.selectedIndex = index;\n },\n badge: function (item, value) {\n var buttongroup = this.element, badge;\n if (!isNaN(item)) {\n item = buttongroup.children().get(item);\n }\n item = buttongroup.find(item);\n badge = $(item.children('.km-badge')[0] || createBadge(value).appendTo(item));\n if (value || value === 0) {\n badge.html(value);\n return this;\n }\n if (value === false) {\n badge.empty().remove();\n return this;\n }\n return badge.html();\n },\n enable: function (enable) {\n var wrapper = this.wrapper;\n if (typeof enable == 'undefined') {\n enable = true;\n }\n if (enable) {\n wrapper.removeClass(DISABLE);\n } else {\n wrapper.addClass(DISABLE);\n }\n this._enable = this.options.enable = enable;\n },\n _button: function () {\n var button = $(this).addClass('km-button'), icon = kendo.attrValue(button, 'icon'), badge = kendo.attrValue(button, 'badge'), span = button.children('span'), image = button.find('img').addClass('km-image');\n if (!span[0]) {\n span = button.wrapInner('').children('span');\n }\n span.addClass('km-text');\n if (!image[0] && icon) {\n button.prepend($(''));\n }\n if (badge || badge === 0) {\n createBadge(badge).appendTo(button);\n }\n },\n _select: function (e) {\n if (e.which > 1 || e.isDefaultPrevented() || !this._enable) {\n return;\n }\n this.select(e.currentTarget);\n this.trigger(SELECT, { index: this.selectedIndex });\n }\n });\n ui.plugin(ButtonGroup);\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/"}