@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.61 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("kendo.core.js"),require("kendo.inputgroupbase.js"),require("kendo.checkbox.js")):"function"==typeof define&&define.amd?define(["exports","kendo.core.min","kendo.inputgroupbase","kendo.checkbox"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Checkboxgroup={}))}(this,(function(e){!function(e){var t=window.kendo,o=t.ui,n=o.InputGroupBase,i="checked",u=n.extend({options:{name:"CheckBoxGroup",inputName:"",inputRounded:"medium",inputSize:"medium",enabled:!0,labelPosition:"after",layout:"vertical",items:[]},ITEM_TEMPLATE:'<li class="k-checkbox-list-item"><input type="checkbox" class="k-checkbox" ></li>',NS:".kendoCheckBoxGroup",COMPONENT:"kendoCheckBox",groupStyles:{item:"k-checkbox-list-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,o=t.element.find("input");!0===e?(o.prop(i,!0),t._value=[],o.each((function(e,o){t._value.push(o.value)}))):!1===e&&(o.prop(i,!1),t._value=[])},value:function(e){var t,o,n,u,r=this,l=[];if(undefined===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(i,!1);if(e&&!(e.length<1)){for((o=r.element.find("input[value='"+e[0]+"']")).length&&l.push(e[0]),u=1;u<e.length;u++)t=r.element.find("input[value='"+e[u]+"']"),(n=o.add(t)).length>o.length&&(o=n,l.push(e[u]));r._value=l,r.element.find("."+r.groupStyles.input).prop(i,!1),o.prop(i,!0)}},_changeHandler:function(t){var o=e(t.target),n=o.val();this._targetForPreventedChange!==t.target?(this._value||(this._value=[]),o.is(":checked")?this._value.push(n):this._value=this._value.filter((function(e){return e!==n})),this.trigger("change",{target:o})):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"]])}]),o.plugin(u)}(window.kendo.jQuery);var t=kendo;e.__meta__={id:"checkboxgroup",name:"CheckBoxGroup",category:"web",description:"The CheckBoxGroup component.",depends:["core","inputgroupbase","checkbox"]},e.default=t,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=kendo.checkboxgroup.min.js.map