{"version":3,"sources":["kendo.buttongroup.js"],"names":["f","define","$","undefined","createBadge","badgeOptions","item","badgeEelement","constructor","Object","text","position","align","_classNames","addClass","appendTo","badge","ui","Badge","kendo","window","Widget","keys","proxy","template","NS","KWIDGET","KBUTTONGROUP","KBUTTON","KBUTTONICONTEXT","KBUTTONICON","ACTIVE","DISABLED","SELECT","CLICK","KEYDOWN","FOCUS","FOCUSOUT","MOUSEDOWN","isIE","support","browser","msie","templates","image","icon","empty","ButtonGroup","extend","init","element","options","that","this","fn","call","wrapper","items","_renderItems","selectedIndices","attr","children","each","_updateClasses","bind","_enable","enable","enabled","select","index","_attachEvents","events","name","selection","current","find","on","_click","_focus","_focusout","_keyDown","_mouseDown","forEach","renderedItem","imageUrl","iconClass","encoded","htmlEncode","attributes","selected","e","x","clientX","y","clientY","elementMouseIsOver","document","elementFromPoint","preventFocus","preventFocusOut","removeAttr","length","first","focus","setTimeout","contains","activeElement","itemToFocus","buttonGroup","focusableItems","focusedElement","currentIndex","isRtl","keyCode","LEFT","RIGHT","eq","preventDefault","ENTER","SPACEBAR","_select","button","ariaPressed","nodeType","toggleClass","indexOf","push","splice","removeClass","value","buttongroup","isNaN","validValue","data","remove","destroy","off","attrValue","isEmpty","is","hasClass","prepend","contents","filter","trim","nodeValue","target","closest","isDefaultPrevented","trigger","indices","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,qBACH,aACA,eACDD,IACL,WAqSE,MA1RC,UAAUE,EAAGC,GA4BV,QAASC,GAAYC,EAAcC,GAC/B,GAAIC,EACiB,QAAjBF,GAAyBA,IAAiBF,IAG1CE,EAAaG,cAAgBC,SAC7BJ,GAAiBK,KAAML,IAEvBA,EAAaM,WAAaR,GAAuC,KAA1BE,EAAaM,WACpDN,EAAaM,SAAW,OACpBN,EAAaO,QAAUT,GAAoC,KAAvBE,EAAaO,QACjDP,EAAaO,MAAQ,YAG7BP,EAAa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AAW5C,OAAS,KAChFqC,GAAU,MAGd9F,EAAM,IAAMC,IACZ4E,EAAO3G,SAAS4H,EAAU5G,EAAcD,IAExCb,GAAmB,IAAVA,IACTZ,EAAYY,EAAOyG,IAG3B5C,OAAQ,SAAUa,GACd,GAAIwD,GAAShJ,EAAEwF,EAAEwD,QAAQC,QAAQ,IAAMvH,EACnC8D,GAAE0D,uBAGN1D,EAAEwD,OAAO3C,QACTlD,KAAKmE,QAAQ0B,KAEjB1B,QAAS,SAAU0B,GACf,GAAIzB,GAASyB,CACR7F,MAAKY,UAAWwD,EAAOkB,GAAG,IAAM3G,KAGrCqB,KAAKe,OAAO8E,EAAO,IACnB7F,KAAKgG,QAAQpH,GAAUqH,QAASjG,KAAKM,qBAG7C1C,GAAGsI,OAAOxG,IACZ3B,OAAOD,MAAMqI,QACRpI,OAAOD,OACE,kBAAVlB,SAAwBA,OAAOwJ,IAAMxJ,OAAS,SAAUyJ,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.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.buttongroup', [\n 'kendo.core',\n 'kendo.badge'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'buttongroup',\n name: 'ButtonGroup',\n category: 'web',\n description: 'The Kendo ButtonGroup widget is a linear set of grouped buttons.',\n depends: [\n 'core',\n 'badge'\n ]\n };\n (function ($, undefined) {\n var kendo = window.kendo;\n var ui = kendo.ui;\n var Widget = ui.Widget;\n var keys = kendo.keys;\n var proxy = $.proxy;\n var template = kendo.template;\n var NS = '.kendoButtonGroup';\n var KWIDGET = 'k-widget';\n var KBUTTONGROUP = 'k-button-group';\n var KBUTTON = 'k-button';\n var KBUTTONICONTEXT = 'k-button-icontext';\n var KBUTTONICON = 'k-button-icon';\n var ACTIVE = 'k-state-active';\n var DISABLED = 'k-state-disabled';\n var SELECT = 'select';\n var CLICK = 'click';\n var KEYDOWN = 'keydown';\n var FOCUS = 'focus';\n var FOCUSOUT = 'focusout';\n var MOUSEDOWN = 'mousedown';\n var isIE = kendo.support.browser.msie;\n var templates = {\n item: template('' + '#= icon(iconClass) #' + '#= image(item) #' + '#= text #' + ''),\n image: template(''),\n icon: template(''),\n empty: template('')\n };\n function createBadge(badgeOptions, item) {\n var badgeEelement;\n if (badgeOptions === null || badgeOptions === undefined) {\n return;\n }\n if (badgeOptions.constructor !== Object) {\n badgeOptions = { text: badgeOptions };\n }\n if (badgeOptions.position === undefined || badgeOptions.position === '') {\n badgeOptions.position = 'edge';\n if (badgeOptions.align === undefined || badgeOptions.align === '') {\n badgeOptions.align = 'top end';\n }\n }\n badgeOptions._classNames = ['k-button-badge'];\n item.addClass('k-badge-container');\n badgeEelement = $('').appendTo(item);\n item.badge = new ui.Badge(badgeEelement, badgeOptions);\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.wrapper = that.element;\n if (that.options.items) {\n that._renderItems(that.options.items);\n }\n that.selectedIndices = [];\n that.element.addClass(KWIDGET + ' ' + KBUTTONGROUP).attr('role', 'group').attr('tabindex', that.element.attr('tabindex') || '0').children().each(function () {\n var item = $(this);\n that._updateClasses.bind(that)(item);\n });\n that._enable = true;\n if (!that.options.enable || !that.options.enabled) {\n that._enable = false;\n that.element.attr('aria-disabled', true).addClass(DISABLED);\n }\n that.select(that.options.index);\n that._attachEvents();\n },\n events: [SELECT],\n options: {\n name: 'ButtonGroup',\n selection: 'single',\n index: -1,\n enable: true,\n enabled: true\n },\n current: function () {\n return this.element.find('.' + ACTIVE);\n },\n _attachEvents: function () {\n var that = this;\n that.element.on(CLICK + NS, '.' + KBUTTON, proxy(that._click, that)).on(FOCUS + NS, proxy(that._focus, that)).on(FOCUSOUT + NS, proxy(that._focusout, that)).on(KEYDOWN + NS, proxy(that._keyDown, that)).on(MOUSEDOWN + NS, proxy(that._mouseDown, that));\n },\n _renderItems: function (items) {\n var that = this;\n items.forEach(function (item) {\n var renderedItem = $(templates.item({\n image: item.imageUrl ? templates.image : templates.empty,\n icon: !item.imageUrl && (item.iconClass || item.icon) ? templates.icon : templates.empty,\n iconClass: item.iconClass || 'k-icon k-i-' + item.icon,\n item: item,\n text: item.text ? item.encoded === false ? item.text : kendo.htmlEncode(item.text) : ''\n }));\n if (item.attributes) {\n renderedItem.attr(item.attributes);\n }\n if (item.selected) {\n renderedItem.addClass(ACTIVE);\n }\n if (item.iconClass || item.icon || item.imageUrl) {\n renderedItem.addClass(item.text ? 'k-button-icontext' : 'k-button-icon');\n }\n if (item.badge) {\n createBadge(item.badge, renderedItem);\n }\n renderedItem.appendTo(that.element);\n });\n },\n _mouseDown: function (e) {\n var x = e.clientX, y = e.clientY, elementMouseIsOver = document.elementFromPoint(x, y);\n if (elementMouseIsOver !== this.element[0]) {\n this.preventFocus = true;\n this.preventFocusOut = true;\n }\n if (isIE) {\n this._focus();\n }\n },\n _focus: function () {\n var element = $(this.element);\n element.removeAttr('tabindex');\n element.find('[role=\\'button\\']').attr('tabindex', '0');\n if (this.preventFocus) {\n this.preventFocus = false;\n return;\n }\n if (element.find('.' + ACTIVE).length) {\n element.find('.' + ACTIVE).first().focus();\n } else {\n element.children().first().focus();\n }\n },\n _focusout: function () {\n var that = this;\n var wrapper = that.wrapper;\n if (this.preventFocusOut) {\n this.preventFocusOut = false;\n return;\n }\n setTimeout(function () {\n if (!wrapper[0].contains(document.activeElement)) {\n wrapper.attr('tabindex', '0');\n wrapper.find('[role=\\'button\\']').removeAttr('tabindex');\n }\n });\n },\n _keyDown: function (e) {\n var that = this;\n var buttonGroup = $(that.element);\n var focusableItems = buttonGroup.find('.' + KBUTTON);\n var focusedElement = buttonGroup.find(':focus');\n var currentIndex = focusableItems.index(focusedElement);\n var isRtl = kendo.support.isRtl(that.element);\n var itemToFocus;\n if (e.keyCode === keys.LEFT && !isRtl || e.keyCode === keys.RIGHT && isRtl) {\n itemToFocus = currentIndex === 0 ? focusableItems.eq(focusableItems.length - 1) : $(focusableItems[currentIndex - 1]);\n itemToFocus.focus();\n e.preventDefault();\n } else if (e.keyCode === keys.LEFT && isRtl || e.keyCode === keys.RIGHT && !isRtl) {\n itemToFocus = currentIndex + 1 === focusableItems.length ? focusableItems.eq(0) : $(focusableItems[currentIndex + 1]);\n itemToFocus.focus();\n e.preventDefault();\n } else if (e.keyCode === keys.ENTER || e.keyCode === keys.SPACEBAR) {\n that._select(focusedElement);\n e.preventDefault();\n }\n },\n select: function (button) {\n var that = this, ariaPressed, index = -1;\n if (button === undefined || button === -1) {\n return;\n }\n if (typeof button === 'number') {\n index = button;\n button = that.element.children().eq(button);\n } else if (button.nodeType) {\n button = $(button);\n index = button.index();\n }\n if (that.options.selection === 'multiple') {\n ariaPressed = button.attr('aria-pressed') === 'true';\n button.attr('aria-pressed', !ariaPressed).toggleClass(ACTIVE);\n if (that.selectedIndices.indexOf(index) === -1) {\n that.selectedIndices.push(index);\n } else {\n that.selectedIndices.splice(that.selectedIndices.indexOf(index), 1);\n }\n } else {\n that.selectedIndices = [];\n that.current().attr('aria-pressed', false).removeClass(ACTIVE);\n button.attr('aria-pressed', true).addClass(ACTIVE);\n that.selectedIndices.push(index);\n }\n },\n badge: function (item, value) {\n var buttongroup = this.element;\n var button = !isNaN(item) ? buttongroup.children().eq(item) : buttongroup.find(item);\n var validValue = value || value === 0;\n var badge;\n if (!button.length) {\n return;\n }\n badge = button.children('.k-badge').eq(0).data('kendoBadge');\n if (!badge && validValue) {\n createBadge({ text: kendo.htmlEncode(value) }, button);\n return kendo.htmlEncode(value);\n }\n if (validValue) {\n badge.text(kendo.htmlEncode(value));\n } else if (value === false) {\n badge.element.empty().remove();\n badge.destroy();\n return;\n }\n return badge ? badge.text() : null;\n },\n enable: function (enable) {\n if (typeof enable == 'undefined') {\n enable = true;\n }\n this.element.attr('aria-disabled', !enable).toggleClass(DISABLED, !enable);\n this._enable = this.options.enable = enable;\n },\n destroy: function () {\n var that = this;\n that.element.off(NS);\n that.element.find('.k-badge').each(function () {\n $(this).data('kendoBadge').destroy();\n });\n Widget.fn.destroy.call(that);\n },\n _updateClasses: function (button) {\n var icon = kendo.attrValue(button, 'icon');\n var badge = kendo.attrValue(button, 'badge');\n var image = button.find('img').addClass('k-image');\n var isEmpty = true;\n button.attr('aria-pressed', false).attr('role', 'button').addClass(KBUTTON);\n if (button.is('[disabled]') || button.hasClass(DISABLED)) {\n button.addClass(DISABLED).attr('aria-disabled', true).removeAttr('disabled');\n }\n if (button.is('.' + ACTIVE)) {\n button.removeClass(ACTIVE);\n if (!button.hasClass(DISABLED) && this.options.selection === 'single' || this.options.selection === 'multiple') {\n this.select(button[0]);\n }\n }\n if (!image[0] && icon) {\n button.prepend($(templates.icon('k-icon k-i-' + icon)));\n }\n button.contents().filter(function () {\n return !$(this).hasClass('k-icon') && !$(this).hasClass('k-image');\n }).each(function () {\n if (this.nodeType == 1 || this.nodeType == 3 && kendo.trim(this.nodeValue).length > 0) {\n isEmpty = false;\n }\n });\n if (image[0] || icon) {\n button.addClass(isEmpty ? KBUTTONICON : KBUTTONICONTEXT);\n }\n if (badge || badge === 0) {\n createBadge(badge, button);\n }\n },\n _click: function (e) {\n var target = $(e.target).closest('.' + KBUTTON);\n if (e.isDefaultPrevented()) {\n return;\n }\n e.target.focus();\n this._select(target);\n },\n _select: function (target) {\n var button = target;\n if (!this._enable || button.is('.' + DISABLED)) {\n return;\n }\n this.select(target[0]);\n this.trigger(SELECT, { indices: this.selectedIndices });\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}));"]}