index-legacy.009d5444.js 7.9 KB

1
  1. !function(){function e(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function n(e,n){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,a,o=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(t=r.next()).done)&&(o.push(t.value),!n||o.length!==n);u=!0);}catch(l){i=!0,a=l}finally{try{u||null==r.return||r.return()}finally{if(i)throw a}}return o}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return r(e,n);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 r(e,n)}(e,n)||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 r(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 t=document.createElement("style");t.innerHTML=':root{--van-stepper-background-color: var(--van-active-color);--van-stepper-button-icon-color: var(--van-text-color);--van-stepper-button-disabled-color: var(--van-background-color);--van-stepper-button-disabled-icon-color: var(--van-gray-5);--van-stepper-button-round-theme-color: var(--van-danger-color);--van-stepper-input-width: .85333rem;--van-stepper-input-height: .74667rem;--van-stepper-input-font-size: var(--van-font-size-md);--van-stepper-input-line-height: normal;--van-stepper-input-text-color: var(--van-text-color);--van-stepper-input-disabled-text-color: var(--van-text-color-3);--van-stepper-input-disabled-background-color: var(--van-active-color);--van-stepper-border-radius: var(--van-border-radius-md)}.van-stepper{display:inline-block;-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-stepper__minus,.van-stepper__plus{position:relative;box-sizing:border-box;width:var(--van-stepper-input-height);height:var(--van-stepper-input-height);margin:0;padding:0;color:var(--van-stepper-button-icon-color);vertical-align:middle;background:var(--van-stepper-background-color);border:0}.van-stepper__minus:before,.van-stepper__plus:before{width:50%;height:.02667rem}.van-stepper__minus:after,.van-stepper__plus:after{width:.02667rem;height:50%}.van-stepper__minus:before,.van-stepper__plus:before,.van-stepper__minus:after,.van-stepper__plus:after{position:absolute;top:50%;left:50%;background-color:currentColor;transform:translate(-50%,-50%);content:""}.van-stepper__minus--disabled,.van-stepper__plus--disabled{color:var(--van-stepper-button-disabled-icon-color);background-color:var(--van-stepper-button-disabled-color);cursor:not-allowed}.van-stepper__minus{border-radius:var(--van-stepper-border-radius) 0 0 var(--van-stepper-border-radius)}.van-stepper__minus:after{display:none}.van-stepper__plus{border-radius:0 var(--van-stepper-border-radius) var(--van-stepper-border-radius) 0}.van-stepper__input{box-sizing:border-box;width:var(--van-stepper-input-width);height:var(--van-stepper-input-height);margin:0 .05333rem;padding:0;color:var(--van-stepper-input-text-color);font-size:var(--van-stepper-input-font-size);line-height:var(--van-stepper-input-line-height);text-align:center;vertical-align:middle;background:var(--van-stepper-background-color);border:0;border-width:.02667rem 0;border-radius:0;-webkit-appearance:none}.van-stepper__input:disabled{color:var(--van-stepper-input-disabled-text-color);background-color:var(--van-stepper-input-disabled-background-color);-webkit-text-fill-color:var(--van-stepper-input-disabled-text-color);opacity:1}.van-stepper__input:-moz-read-only{cursor:default}.van-stepper__input:read-only{cursor:default}.van-stepper--round .van-stepper__input{background-color:transparent}.van-stepper--round .van-stepper__plus,.van-stepper--round .van-stepper__minus{border-radius:100%}.van-stepper--round .van-stepper__plus--disabled,.van-stepper--round .van-stepper__minus--disabled{opacity:.3;cursor:not-allowed}.van-stepper--round .van-stepper__plus{color:var(--van-white);background:var(--van-stepper-button-round-theme-color)}.van-stepper--round .van-stepper__minus{color:var(--van-stepper-button-round-theme-color);background-color:var(--van-background-color-light);border:.02667rem solid var(--van-stepper-button-round-theme-color)}\n',document.head.appendChild(t),System.register(["./index-legacy.fba2875c.js"],(function(r){"use strict";var t,a,o,u,i,l,s,p,d,v,c,b,m,f,g,h,_,y,w,x,k,S,z,V;return{setters:[function(e){t=e.A,a=e.aa,o=e.G,u=e.E,i=e.d,l=e.S,s=e.V,p=e.a1,d=e.bc,v=e.a2,c=e.a_,b=e.j,m=e.a5,f=e.aE,g=e.a7,h=e.aX,_=e.aM,y=e.L,w=e.W,x=e.aO,k=e.ap,S=e.aB,z=e.bd,V=e.N}],execute:function(){var I=n(t("stepper"),2),M=I[0],T=I[1],B=function(e,n){return String(e)===String(n)},C={min:a(1),max:a(1/0),name:a(""),step:a(1),theme:String,integer:Boolean,disabled:Boolean,showPlus:o,showMinus:o,showInput:o,longPress:o,allowEmpty:Boolean,modelValue:u,inputWidth:u,buttonSize:u,placeholder:String,disablePlus:Boolean,disableMinus:Boolean,disableInput:Boolean,beforeChange:Function,defaultValue:a(1),decimalLength:u},P=i({name:M,props:C,emits:["plus","blur","minus","focus","change","overlimit","update:modelValue"],setup:function(n,r){var t,a,o,u,i,V,I=r.emit,M=function(e){var r=n.min,t=n.max,a=n.allowEmpty,o=n.decimalLength;return a&&""===e||(e=""===(e=_(String(e),!n.integer))?0:+e,e=Number.isNaN(e)?+r:e,e=Math.max(Math.min(+t,e),+r),y(o)&&(e=e.toFixed(+o))),e},C=l(),P=l((o=null!=(a=n.modelValue)?a:n.defaultValue,u=M(o),B(u,n.modelValue)||I("update:modelValue",u),u)),A=s((function(){return n.disabled||n.disableMinus||P.value<=+n.min})),j=s((function(){return n.disabled||n.disablePlus||P.value>=+n.max})),E=s((function(){return{width:p(n.inputWidth),height:p(n.buttonSize)}})),L=s((function(){return d(n.buttonSize)})),N=function(e){n.beforeChange?S(n.beforeChange,{args:[e],done:function(){P.value=e}}):P.value=e},O=function(){if("plus"===t&&j.value||"minus"===t&&A.value)I("overlimit",t);else{var e="minus"===t?-n.step:+n.step,r=M(z(+P.value,e));N(r),I(t)}},F=function(e){var r=e.target,t=r.value,a=n.decimalLength,o=_(String(t),!n.integer);if(y(a)&&o.includes(".")){var u=o.split(".");o="".concat(u[0],".").concat(u[1].slice(0,+a))}n.beforeChange?r.value=String(P.value):B(t,o)||(r.value=o);var i=o===String(+o);N(i?+o:o)},W=function(e){var r;n.disableInput?null==(r=C.value)||r.blur():I("focus",e)},G=function(e){var n=e.target,r=M(n.value);n.value=String(r),P.value=r,w((function(){I("blur",e),x()}))},H=function e(){V=setTimeout((function(){O(),e()}),200)},U=function(){n.longPress&&(i=!1,clearTimeout(V),V=setTimeout((function(){i=!0,O(),H()}),600))},X=function(e){n.longPress&&(clearTimeout(V),i&&k(e))},$=function(e){n.disableInput&&k(e)},q=function(e){return{onClick:function(n){k(n),t=e,O()},onTouchstart:function(){t=e,U()},onTouchend:X,onTouchcancel:X}};return v((function(){return[n.max,n.min,n.integer,n.decimalLength]}),(function(){var e=M(P.value);B(e,P.value)||(P.value=e)})),v((function(){return n.modelValue}),(function(e){B(e,P.value)||(P.value=M(e))})),v(P,(function(e){I("update:modelValue",e),I("change",e,{name:n.name})})),c((function(){return n.modelValue})),function(){return b("div",{role:"group",class:T([n.theme])},[m(b("button",g({type:"button",style:L.value,class:[T("minus",{disabled:A.value}),e({},h,!A.value)],"aria-disabled":A.value||void 0},q("minus")),null),[[f,n.showMinus]]),m(b("input",{ref:C,type:n.integer?"tel":"text",role:"spinbutton",class:T("input"),value:P.value,style:E.value,disabled:n.disabled,readonly:n.disableInput,inputmode:n.integer?"numeric":"decimal",placeholder:n.placeholder,"aria-valuemax":n.max,"aria-valuemin":n.min,"aria-valuenow":P.value,onBlur:G,onInput:F,onFocus:W,onMousedown:$},null),[[f,n.showInput]]),m(b("button",g({type:"button",style:L.value,class:[T("plus",{disabled:j.value}),e({},h,!j.value)],"aria-disabled":j.value||void 0},q("plus")),null),[[f,n.showPlus]])])}}});r("S",V(P))}}}))}();