@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 2.29 kB
JavaScript
module.exports=function(e){function n(i){if(t[i])return t[i].exports;var o=t[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}({0:function(e,n,t){e.exports=t(1322)},3:function(e,n){e.exports=function(){throw Error("define cannot be used indirect")}},1049:function(e,n){e.exports=require("./kendo.core")},1322:function(e,n,t){var i,o,r;!function(s,define){o=[t(1049)],i=s,r="function"==typeof i?i.apply(n,o):i,!(void 0!==r&&(e.exports=r))}(function(){return function(e,n){function t(e){return"k-"+e+" km-"+e}function i(n){return e('<span class="'+t("badge")+'">'+n+"</span>")}var o=window.kendo,r=o.mobile.ui,s=r.Widget,a="state-active",d="state-disabled",l="select",c="li:not(.km-"+a+")",u=s.extend({init:function(e,n){var i=this;s.fn.init.call(i,e,n),i.element.addClass("km-buttongroup k-widget k-button-group").find("li").each(i._button),i.element.on(i.options.selectOn,c,"_select"),i._enable=!0,i.select(i.options.index),i.options.enable||(i._enable=!1,i.wrapper.addClass(t(d)))},events:[l],options:{name:"ButtonGroup",selectOn:"down",index:-1,enable:!0},current:function(){return this.element.find(".km-"+a)},select:function(i){var o=this,r=-1;i!==n&&i!==-1&&o._enable&&!e(i).is(".km-"+d)&&(o.current().removeClass(t(a)),"number"==typeof i?(r=i,i=e(o.element[0].children[i])):i.nodeType&&(i=e(i),r=i.index()),i.addClass(t(a)),o.selectedIndex=r)},badge:function(n,t){var o,r=this.element;return isNaN(n)||(n=r.children().get(n)),n=r.find(n),o=e(n.children(".km-badge")[0]||i(t).appendTo(n)),t||0===t?(o.html(t),this):t===!1?(o.empty().remove(),this):o.html()},enable:function(e){n===e&&(e=!0),this.wrapper.toggleClass(t(d),!e),this._enable=this.options.enable=e},_button:function(){var n=e(this).addClass(t("button")),r=o.attrValue(n,"icon"),s=o.attrValue(n,"badge"),a=n.children("span"),d=n.find("img").addClass(t("image"));a[0]||(a=n.wrapInner("<span/>").children("span")),a.addClass(t("text")),!d[0]&&r&&n.prepend(e('<span class="'+t("icon")+" "+t(r)+'"/>')),(s||0===s)&&i(s).appendTo(n)},_select:function(e){e.which>1||e.isDefaultPrevented()||!this._enable||(this.select(e.currentTarget),this.trigger(l,{index:this.selectedIndex}))}});r.plugin(u)}(window.kendo.jQuery),window.kendo},t(3))}});