index-legacy.cb998bd0.js 3.2 KB

1
  1. !function(){function e(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var t,o,u=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(u.push(t.value),!n||u.length!==n);a=!0);}catch(i){l=!0,o=i}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return u}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return n(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}var r=document.createElement("style");r.innerHTML=".van-checkbox-group--horizontal{display:flex;flex-wrap:wrap}\n",document.head.appendChild(r),System.register(["./ResizeObserver.es-legacy.9ef5ac8c.js","./index-legacy.5893ff71.js"],(function(n){"use strict";var r,t,o,u,a,l,i,c,d,f,p,s,m,h,v,b,g,y;return{setters:[function(e){r=e.E,t=e.G,o=e.aY,u=e.d,a=e.aj,l=e.a3,i=e.ak,c=e.a$,d=e.j,f=e.J,p=e.H,s=e.at,m=e.W,h=e.aB,v=e.a8,b=e.O},function(e){g=e.c,y=e.s}],execute:function(){var V=e(r("checkbox-group"),2),k=V[0],x=V[1],S={max:t,disabled:Boolean,iconSize:t,direction:String,modelValue:o(),checkedColor:String},j=Symbol(k),A=(n("s",u({name:k,props:S,emits:["change","update:modelValue"],setup:function(e,n){var r=n.emit,t=n.slots,o=a(j),u=o.children,f=o.linkChildren,p=function(e){return r("update:modelValue",e)};return l((function(){return e.modelValue}),(function(e){return r("change",e)})),i({toggleAll:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"boolean"==typeof e&&(e={checked:e});var n=e,r=n.checked,t=n.skipDisabled,o=u.filter((function(e){return!!e.props.bindGroup&&(e.props.disabled&&t?e.checked.value:null!=r?r:!e.checked.value)})),a=o.map((function(e){return e.name}));p(a)}}),c((function(){return e.modelValue})),f({props:e,updateValue:p}),function(){var n;return d("div",{class:x([e.direction])},[null==(n=t.default)?void 0:n.call(t)])}}})),e(r("checkbox"),2)),G=A[0],w=A[1],O=f({},g,{bindGroup:p}),C=u({name:G,props:O,emits:["change","update:modelValue"],setup:function(e,n){var r=n.emit,t=n.slots,o=s(j).parent,u=function(n){var r=e.name,t=o.props,u=t.max,a=t.modelValue.slice();if(n){u&&a.length>=u||a.includes(r)||(a.push(r),e.bindGroup&&o.updateValue(a))}else{var l=a.indexOf(r);-1!==l&&(a.splice(l,1),e.bindGroup&&o.updateValue(a))}},a=m((function(){return o&&e.bindGroup?-1!==o.props.modelValue.indexOf(e.name):!!e.modelValue})),f=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!a.value;o&&e.bindGroup?u(n):r("update:modelValue",n)};return l((function(){return e.modelValue}),(function(e){return r("change",e)})),i({toggle:f,props:e,checked:a}),c((function(){return e.modelValue})),function(){return d(y,v({bem:w,role:"checkbox",parent:o,checked:a.value,onToggle:f},e),h(t,["default","icon"]))}}});n("C",b(C))}}}))}();