index-legacy.595f3a0f.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(["./ResizeObserver.es-legacy.8d60aee1.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,I;return{setters:[function(e){t=e.E,a=e.ab,o=e.H,u=e.G,i=e.d,l=e.U,s=e.W,p=e.a2,d=e.bf,v=e.a3,c=e.a$,b=e.j,m=e.a6,f=e.aF,g=e.a8,h=e.aU,_=e.aO,y=e.M,w=e.X,x=e.aP,k=e.aq,S=e.aC,z=e.bg,I=e.O}],execute:function(){var M=n(t("stepper"),2),V=M[0],C=M[1],P=function(e,n){return String(e)===String(n)},T={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},B=i({name:V,props:T,emits:["plus","blur","minus","focus","change","overlimit","update:modelValue"],setup:function(n,r){var t,a,o,u,i,I,M=r.emit,V=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},T=l(),B=l((o=null!=(a=n.modelValue)?a:n.defaultValue,u=V(o),P(u,n.modelValue)||M("update:modelValue",u),u)),j=s((function(){return n.disabled||n.disableMinus||B.value<=+n.min})),A=s((function(){return n.disabled||n.disablePlus||B.value>=+n.max})),O=s((function(){return{width:p(n.inputWidth),height:p(n.buttonSize)}})),E=s((function(){return d(n.buttonSize)})),L=function(e){n.beforeChange?S(n.beforeChange,{args:[e],done:function(){B.value=e}}):B.value=e},F=function(){if("plus"===t&&A.value||"minus"===t&&j.value)M("overlimit",t);else{var e="minus"===t?-n.step:+n.step,r=V(z(+B.value,e));L(r),M(t)}},N=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(B.value):P(t,o)||(r.value=o);var i=o===String(+o);L(i?+o:o)},U=function(e){var r;n.disableInput?null==(r=T.value)||r.blur():M("focus",e)},W=function(e){var n=e.target,r=V(n.value);n.value=String(r),B.value=r,w((function(){M("blur",e),x()}))},H=function e(){I=setTimeout((function(){F(),e()}),200)},$=function(){n.longPress&&(i=!1,clearTimeout(I),I=setTimeout((function(){i=!0,F(),H()}),600))},q=function(e){n.longPress&&(clearTimeout(I),i&&k(e))},G=function(e){n.disableInput&&k(e)},R=function(e){return{onClick:function(n){k(n),t=e,F()},onTouchstart:function(){t=e,$()},onTouchend:q,onTouchcancel:q}};return v((function(){return[n.max,n.min,n.integer,n.decimalLength]}),(function(){var e=V(B.value);P(e,B.value)||(B.value=e)})),v((function(){return n.modelValue}),(function(e){P(e,B.value)||(B.value=V(e))})),v(B,(function(e){M("update:modelValue",e),M("change",e,{name:n.name})})),c((function(){return n.modelValue})),function(){return b("div",{role:"group",class:C([n.theme])},[m(b("button",g({type:"button",style:E.value,class:[C("minus",{disabled:j.value}),e({},h,!j.value)],"aria-disabled":j.value||void 0},R("minus")),null),[[f,n.showMinus]]),m(b("input",{ref:T,type:n.integer?"tel":"text",role:"spinbutton",class:C("input"),value:B.value,style:O.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":B.value,onBlur:W,onInput:N,onFocus:U,onMousedown:G},null),[[f,n.showInput]]),m(b("button",g({type:"button",style:E.value,class:[C("plus",{disabled:A.value}),e({},h,!A.value)],"aria-disabled":A.value||void 0},R("plus")),null),[[f,n.showPlus]])])}}});r("S",I(B))}}}))}();