index-legacy.404bfef6.js 3.9 KB

1
  1. !function(){function n(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,a){var t=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null==t)return;var r,e,i=[],o=!0,c=!1;try{for(t=t.call(n);!(o=(r=t.next()).done)&&(i.push(r.value),!a||i.length!==a);o=!0);}catch(s){c=!0,e=s}finally{try{o||null==t.return||t.return()}finally{if(c)throw e}}return i}(n,t)||function(n,t){if(!n)return;if("string"==typeof n)return a(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);"Object"===r&&n.constructor&&(r=n.constructor.name);if("Map"===r||"Set"===r)return Array.from(n);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(n,t)}(n,t)||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 a(n,a){(null==a||a>n.length)&&(a=n.length);for(var t=0,r=new Array(a);t<a;t++)r[t]=n[t];return r}var t=document.createElement("style");t.innerHTML=":root{--van-switch-size: .8rem;--van-switch-width: 2em;--van-switch-height: 1em;--van-switch-node-size: 1em;--van-switch-node-background-color: var(--van-white);--van-switch-node-box-shadow: 0 .08rem .02667rem 0 rgba(0, 0, 0, .05), 0 .05333rem .05333rem 0 rgba(0, 0, 0, .1), 0 .08rem .08rem 0 rgba(0, 0, 0, .05);--van-switch-background-color: var(--van-background-color-light);--van-switch-on-background-color: var(--van-primary-color);--van-switch-transition-duration: var(--van-animation-duration-base);--van-switch-disabled-opacity: var(--van-disabled-opacity);--van-switch-border: var(--van-border-width-base) solid rgba(0, 0, 0, .1)}.van-switch{position:relative;display:inline-block;box-sizing:content-box;width:var(--van-switch-width);height:var(--van-switch-height);font-size:var(--van-switch-size);background:var(--van-switch-background-color);border:var(--van-switch-border);border-radius:var(--van-switch-node-size);cursor:pointer;transition:background-color var(--van-switch-transition-duration)}.van-switch__node{position:absolute;top:0;left:0;width:var(--van-switch-node-size);height:var(--van-switch-node-size);font-size:inherit;background:var(--van-switch-node-background-color);border-radius:100%;box-shadow:var(--van-switch-node-box-shadow);transition:transform var(--van-switch-transition-duration) cubic-bezier(.3,1.05,.4,1.05)}.van-switch__loading{top:25%;left:25%;width:50%;height:50%;line-height:1}.van-switch--on{background:var(--van-switch-on-background-color)}.van-switch--on .van-switch__node{transform:translate(calc(var(--van-switch-width) - var(--van-switch-node-size)))}.van-switch--on .van-switch__loading{color:var(--van-switch-on-background-color)}.van-switch--disabled{cursor:not-allowed;opacity:var(--van-switch-disabled-opacity)}.van-switch--loading{cursor:default}\n",document.head.appendChild(t),System.register(["./ResizeObserver.es-legacy.44b91b4c.js"],(function(a){"use strict";var t,r,e,i,o,c,s,l,d;return{setters:[function(n){t=n.E,r=n.G,e=n.I,i=n.d,o=n.bf,c=n.a2,s=n.j,l=n.aT,d=n.O}],execute:function(){var v=n(t("switch"),2),u=v[0],h=v[1],b={size:r,loading:Boolean,disabled:Boolean,modelValue:e,activeColor:String,inactiveColor:String,activeValue:{type:e,default:!0},inactiveValue:{type:e,default:!1}},w=i({name:u,props:b,emits:["change","update:modelValue"],setup:function(n,a){var t=a.emit,r=function(){return n.modelValue===n.activeValue},e=function(){if(!n.disabled&&!n.loading){var a=r()?n.inactiveValue:n.activeValue;t("update:modelValue",a),t("change",a)}},i=function(){if(n.loading){var a=r()?n.activeColor:n.inactiveColor;return s(l,{class:h("loading"),color:a},null)}};return o((function(){return n.modelValue})),function(){var a=n.size,t=n.loading,o=n.disabled,l=n.activeColor,d=n.inactiveColor,v=r(),u={fontSize:c(a),backgroundColor:v?l:d};return s("div",{role:"switch",class:h({on:v,loading:t,disabled:o}),style:u,tabindex:o?void 0:0,"aria-checked":v,onClick:e},[s("div",{class:h("node")},[i()])])}}});a("S",d(w))}}}))}();