index-legacy-943132a2.js 4.4 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){var t,l,o,a,i=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===n){if(Object(r)!==r)return;u=!1}else for(;!(u=(t=o.call(r)).done)&&(i.push(t.value),i.length!==n);u=!0);}catch(d){c=!0,l=d}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw l}}return i}}(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}System.register(["./index-legacy-9572cf39.js"],(function(n,r){"use strict";var t,l,o,a,i,u,c,d,s,f,p,b,m,v,h,g,k,y,S,V,x,C;return{setters:[function(e){t=e.x,l=e.n,o=e.t,a=e.d,i=e.A,u=e.ag,c=e.v,d=e.i,s=e.E,f=e.g,p=e.I,b=e.G,m=e.j,v=e.ac,h=e.w,g=e.ad,k=e.q,y=e.an,S=e.ae,V=e.p,x=e.m,C=e.D}],execute:function(){var r=n("c",{name:t,shape:l("round"),disabled:Boolean,iconSize:o,modelValue:t,checkedColor:String,labelPosition:String,labelDisabled:Boolean}),G=n("s",a({props:i({},r,{bem:u(Function),role:String,parent:Object,checked:Boolean,bindGroup:c}),emits:["click","toggle"],setup:function(e,n){var r=n.emit,t=n.slots,l=d(),o=function(n){if(e.parent&&e.bindGroup)return e.parent.props[n]},a=s((function(){return o("disabled")||e.disabled})),i=s((function(){return o("direction")})),u=s((function(){var n=e.checkedColor||o("checkedColor");if(n&&e.checked&&!a.value)return{borderColor:n,backgroundColor:n}})),c=function(n){var t=n.target,o=l.value,i=o===t||(null==o?void 0:o.contains(t));a.value||!i&&e.labelDisabled||r("toggle"),r("click",n)},m=function(){var n=e.bem,r=e.shape,i=e.checked,c=e.iconSize||o("iconSize");return f("div",{ref:l,class:n("icon",[r,{disabled:a.value,checked:i}]),style:{fontSize:b(c)}},[t.icon?t.icon({checked:i,disabled:a.value}):f(p,{name:"success",style:u.value},null)])},v=function(){if(t.default)return f("span",{class:e.bem("label",[e.labelPosition,{disabled:a.value}])},[t.default()])};return function(){var n="left"===e.labelPosition?[v(),m()]:[m(),v()];return f("div",{role:e.role,class:e.bem([{disabled:a.value,"label-disabled":e.labelDisabled},i.value]),tabindex:a.value?void 0:0,"aria-checked":e.checked,onClick:c},[n])}}})),j=e(m("checkbox-group"),2),A=j[0],O=j[1],w={max:o,disabled:Boolean,iconSize:o,direction:String,modelValue:k(),checkedColor:String},z=Symbol(A),D=a({name:A,props:w,emits:["change","update:modelValue"],setup:function(e,n){var r=n.emit,t=n.slots,l=v(z),o=l.children,a=l.linkChildren,i=function(e){return r("update:modelValue",e)};return h((function(){return e.modelValue}),(function(e){return r("change",e)})),y({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,l=o.filter((function(e){return!!e.props.bindGroup&&(e.props.disabled&&t?e.checked.value:null!=r?r:!e.checked.value)})).map((function(e){return e.name}));i(l)}}),g((function(){return e.modelValue})),a({props:e,updateValue:i}),function(){var n;return f("div",{class:O([e.direction])},[null==(n=t.default)?void 0:n.call(t)])}}}),B=e(m("checkbox"),2),I=B[0],P=B[1],E=i({},r,{bindGroup:c}),T=a({name:I,props:E,emits:["change","update:modelValue"],setup:function(e,n){var r=n.emit,t=n.slots,l=S(z).parent,o=s((function(){return l&&e.bindGroup?-1!==l.props.modelValue.indexOf(e.name):!!e.modelValue})),a=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!o.value;l&&e.bindGroup?function(n){var r=e.name,t=l.props,o=t.max,a=t.modelValue.slice();if(n)o&&a.length>=+o||a.includes(r)||(a.push(r),e.bindGroup&&l.updateValue(a));else{var i=a.indexOf(r);-1!==i&&(a.splice(i,1),e.bindGroup&&l.updateValue(a))}}(n):r("update:modelValue",n)};return h((function(){return e.modelValue}),(function(e){return r("change",e)})),y({toggle:a,props:e,checked:o}),g((function(){return e.modelValue})),function(){return f(G,x({bem:P,role:"checkbox",parent:l,checked:o.value,onToggle:a},e),V(t,["default","icon"]))}}});n("a",C(T)),n("C",C(D))}}}))}();