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.74 kB
/* @license */ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`kendo.core.min.js`),require(`kendo.inputgroupbase.min.js`),require(`kendo.checkbox.min.js`)):typeof define==`function`&&define.amd?define([`exports`,`kendo.core.min`,`kendo.inputgroupbase.min`,`kendo.checkbox.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Checkboxgroup={}),e.kendo._globals.Core,e.kendo._globals.Inputgroupbase,e.kendo._globals.Checkbox))})(this,function(e,t,n,r){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let i={id:`checkboxgroup`,name:`CheckBoxGroup`,category:`web`,description:`The CheckBoxGroup component.`,depends:[`core`,`inputgroupbase`,`checkbox`]};(function(e,t){var n=window.kendo,r=n.ui,i=r.InputGroupBase,a=`change`,o=`.`,s=`checked`,c=i.extend({options:{name:`CheckBoxGroup`,inputName:``,inputRounded:t,inputSize:t,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,n=t.element.find(`input`);e===!0?(n.prop(s,!0),t._value=[],n.each(function(e,n){t._value.push(n.value)})):e===!1&&(n.prop(s,!1),t._value=[])},value:function(e){var n=this,r,i=[],a,c,l;if(e===t)return n._value||=[],n._value;if(e===null||e.length===0){n._value=[],n.element.find(o+n.groupStyles.input).prop(s,!1);return}else if(!e||e.length<1)return;for(a=n.element.find(`input[value='`+e[0]+`']`),a.length&&i.push(e[0]),l=1;l<e.length;l++)r=n.element.find(`input[value='`+e[l]+`']`),c=a.add(r),c.length>a.length&&(a=c,i.push(e[l]));n._value=i,n.element.find(o+n.groupStyles.input).prop(s,!1),a.prop(s,!0)},_changeHandler:function(t){var n=e(t.target),r=n.val(),i=function(e){return e!==r};if(this._targetForPreventedChange===t.target){this._targetForPreventedChange=null;return}this._value||=[],n.is(`:checked`)?this._value.push(r):this._value=this._value.filter(i),this.trigger(a,{target:n})},_dataValRequired:function(e){e[`data-msg-required`]=this.wrapper.attr(`data-val-required`),e[`data-rule-required`]=`true`}});n.cssProperties.registerPrefix(`CheckBoxGroup`,`k-checkbox-`),n.cssProperties.registerValues(`CheckBoxGroup`,[{prop:`rounded`,values:n.cssProperties.roundedValues.concat([[`full`,`full`]])}]),r.plugin(c)})(window.kendo.jQuery);var a=kendo;e.__meta__=i,e.default=a}); //# sourceMappingURL=kendo.checkboxgroup.min.js.map