UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

3 lines (2 loc) 2.06 kB
!function(e){"function"==typeof define&&define.amd?define(["kendo.core.min","kendo.inputgroupbase.min","kendo.checkbox.min"],e):e()}((function(){var e,t,i,n,u,l;e=window.kendo.jQuery,t=window.kendo,i=t.ui,n=i.InputGroupBase,u="checked",l=n.extend({options:{name:"CheckBoxGroup",inputName:"",inputRounded:"medium",inputSize:"medium",enabled:!0,labelPosition:"after",layout:"vertical",items:[]},ITEM_TEMPLATE:'<li class="k-checkbox-item"><input type="checkbox" class="k-checkbox" ></li>',NS:".kendoCheckBoxGroup",COMPONENT:"kendoCheckBox",groupStyles:{item:"k-checkbox-item",input:"k-checkbox",label:"k-checkbox-label",list:"k-checkbox-list",vertical:"k-list-vertical",horizontal:"k-list-horizontal",disabled:"k-disabled"},checkAll:function(e){var t=this,i=t.element.find("input");!0===e?(i.prop(u,!0),t._value=[],i.each((function(e,i){t._value.push(i.value)}))):!1===e&&(i.prop(u,!1),t._value=[])},value:function(e){var t,i,n,l,r=this,a=[];if(void 0===e)return r._value||(r._value=[]),r._value;if(null===e||0===e.length)return r._value=[],void r.element.find("."+r.groupStyles.input).prop(u,!1);if(e&&!(e.length<1)){for((i=r.element.find("input[value='"+e[0]+"']")).length&&a.push(e[0]),l=1;l<e.length;l++)t=r.element.find("input[value='"+e[l]+"']"),(n=i.add(t)).length>i.length&&(i=n,a.push(e[l]));r._value=a,r.element.find("."+r.groupStyles.input).prop(u,!1),i.prop(u,!0)}},_changeHandler:function(t){var i=e(t.target),n=i.val();this._targetForPreventedChange!==t.target?(this._value||(this._value=[]),i.is(":checked")?this._value.push(n):this._value=this._value.filter((function(e){return e!==n})),this.trigger("change",{target:i})):this._targetForPreventedChange=null},_dataValRequired:function(e){e["data-msg-required"]=this.wrapper.attr("data-val-required"),e["data-rule-required"]="true"}}),t.cssProperties.registerPrefix("CheckBoxGroup","k-checkbox-"),t.cssProperties.registerValues("CheckBoxGroup",[{prop:"rounded",values:t.cssProperties.roundedValues.concat([["full","full"]])}]),i.plugin(l)})); //# sourceMappingURL=kendo.checkboxgroup.min.js.map