index-legacy.8921f068.js 13 KB

1
  1. !function(){function e(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var t,a,i=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(t=n.next()).done)&&(i.push(t.value),!r||i.length!==r);l=!0);}catch(c){o=!0,a=c}finally{try{l||null==n.return||n.return()}finally{if(o)throw a}}return i}(e,r)||n(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 r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}function t(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}var a=document.createElement("style");a.innerHTML=':root{--van-field-label-width: 6.2em;--van-field-label-color: var(--van-gray-7);--van-field-label-margin-right: var(--van-padding-sm);--van-field-input-text-color: var(--van-text-color);--van-field-input-error-text-color: var(--van-danger-color);--van-field-input-disabled-text-color: var(--van-text-color-3);--van-field-placeholder-text-color: var(--van-text-color-3);--van-field-icon-size: .42667rem;--van-field-clear-icon-size: .42667rem;--van-field-clear-icon-color: var(--van-gray-5);--van-field-right-icon-color: var(--van-gray-6);--van-field-error-message-color: var(--van-danger-color);--van-field-error-message-font-size: .32rem;--van-field-text-area-min-height: 1.6rem;--van-field-word-limit-color: var(--van-gray-7);--van-field-word-limit-font-size: var(--van-font-size-sm);--van-field-word-limit-line-height: .42667rem;--van-field-disabled-text-color: var(--van-text-color-3);--van-field-required-mark-color: var(--van-red)}.van-field__label{flex:none;box-sizing:border-box;width:var(--van-field-label-width);margin-right:var(--van-field-label-margin-right);color:var(--van-field-label-color);text-align:left;word-wrap:break-word}.van-field__label--center{text-align:center}.van-field__label--right{text-align:right}.van-field__label--required:before{margin-right:.05333rem;color:var(--van-field-required-mark-color);content:"*"}.van-field--disabled .van-field__label{color:var(--van-field-disabled-text-color)}.van-field__value{overflow:visible}.van-field__body{display:flex;align-items:center}.van-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--van-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}.van-field__control::-moz-placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control::placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control:disabled{color:var(--van-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--van-field-input-disabled-text-color)}.van-field__control:-moz-read-only{cursor:default}.van-field__control:read-only{cursor:default}.van-field__control--center{justify-content:center;text-align:center}.van-field__control--right{justify-content:flex-end;text-align:right}.van-field__control--custom{display:flex;align-items:center;min-height:var(--van-cell-line-height)}.van-field__control--error::-moz-placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--error,.van-field__control--error::placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--min-height{min-height:var(--van-field-text-area-min-height)}.van-field__control[type=date],.van-field__control[type=time],.van-field__control[type=datetime-local]{min-height:var(--van-cell-line-height)}.van-field__control[type=search]{-webkit-appearance:none}.van-field__clear,.van-field__icon,.van-field__button,.van-field__right-icon{flex-shrink:0}.van-field__clear,.van-field__right-icon{margin-right:calc(var(--van-padding-xs) * -1);padding:0 var(--van-padding-xs);line-height:inherit}.van-field__clear{color:var(--van-field-clear-icon-color);font-size:var(--van-field-clear-icon-size);cursor:pointer}.van-field__left-icon .van-icon,.van-field__right-icon .van-icon{display:block;font-size:var(--van-field-icon-size);line-height:inherit}.van-field__left-icon{margin-right:var(--van-padding-base)}.van-field__right-icon{color:var(--van-field-right-icon-color)}.van-field__button{padding-left:var(--van-padding-xs)}.van-field__error-message{color:var(--van-field-error-message-color);font-size:var(--van-field-error-message-font-size);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{margin-top:var(--van-padding-base);color:var(--van-field-word-limit-color);font-size:var(--van-field-word-limit-font-size);line-height:var(--van-field-word-limit-line-height);text-align:right}\n',document.head.appendChild(a),System.register(["./index-legacy.fba2875c.js","./index-legacy.7dcec7b3.js","./use-id-legacy.db87b112.js"],(function(n){"use strict";var t,a,i,l,o,c,d,u,f,v,s,g,m,p,h,b,y,_,x,w,k,z,S,C,A,M,I,j,V,F,T,B,E,P,L,q;return{setters:[function(e){t=e.aH,a=e.ay,i=e.aI,l=e.aJ,o=e.aK,c=e.A,d=e.E,u=e.$,f=e.aa,v=e.I,s=e.H,g=e.d,m=e.Q,p=e.S,h=e.as,b=e.aL,y=e.V,_=e.a1,x=e.aj,w=e.aD,k=e.a2,z=e.W,S=e.U,C=e.j,A=e.L,M=e.aM,I=e.M,j=e.aN,V=e.ap,F=e.a7,T=e.z,B=e.aO,E=e.N},function(e){P=e.c,L=e.C},function(e){q=e.u}],execute:function(){function H(e,r){return(!r.required||!function(e){return Array.isArray(e)?!e.length:0!==e&&!e}(e))&&!(r.pattern&&!r.pattern.test(String(e)))}function O(e,r){var n=r.message;return o(n)?n(e,r):n||""}function W(e){e.target.composing=!0}function D(e){var r=e.target;r.composing&&(r.composing=!1,r.dispatchEvent(new Event("input")))}function K(e){return r(e).length}var N=e(c("field"),2),U=N[0],$=N[1],J=n("f",{id:String,name:String,leftIcon:String,rightIcon:String,autofocus:Boolean,clearable:Boolean,maxlength:d,formatter:Function,clearIcon:u("clear"),modelValue:f(""),inputAlign:String,placeholder:String,autocomplete:String,errorMessage:String,clearTrigger:u("focus"),formatTrigger:u("onChange"),error:{type:Boolean,default:null},disabled:{type:Boolean,default:null},readonly:{type:Boolean,default:null}}),Q=v({},P,J,{rows:d,type:u("text"),rules:Array,autosize:[Boolean,Object],labelWidth:d,labelClass:s,labelAlign:String,showWordLimit:Boolean,errorMessageAlign:String,colon:{type:Boolean,default:null}}),G=g({name:U,props:Q,emits:["blur","focus","clear","keypress","click-input","click-left-icon","click-right-icon","update:modelValue"],setup:function(e,n){var o=n.emit,c=n.slots,d=q(),u=m({focused:!1,validateFailed:!1,validateMessage:""}),f=p(),v=p(),s=h(b).parent,g=function(){var r;return String(null!=(r=e.modelValue)?r:"")},E=function(r){return A(e[r])?e[r]:s&&A(s.props[r])?s.props[r]:void 0},P=y((function(){var r=E("readonly");if(e.clearable&&!r){var n=""!==g(),t="always"===e.clearTrigger||"focus"===e.clearTrigger&&u.focused;return n&&t}return!1})),N=y((function(){return v.value&&c.input?v.value():e.modelValue})),U=function(e){return e.reduce((function(e,r){return e.then((function(){if(!u.validateFailed){var e=N.value;return r.formatter&&(e=r.formatter(e,r)),H(e,r)?r.validator?function(e,r){return new Promise((function(n){var t=r.validator(e,r);l(t)?t.then(n):n(t)}))}(e,r).then((function(n){n&&"string"==typeof n?(u.validateFailed=!0,u.validateMessage=n):!1===n&&(u.validateFailed=!0,u.validateMessage=O(e,r))})):void 0:(u.validateFailed=!0,void(u.validateMessage=O(e,r)))}}))}),Promise.resolve())},J=function(){u.validateFailed&&(u.validateFailed=!1,u.validateMessage="")},Q=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.rules;return new Promise((function(n){J(),r?U(r).then((function(){u.validateFailed?n({name:e.name,message:u.validateMessage}):n()})):n()}))},G=function(r){if(s&&e.rules){var n=s.props.validateTrigger===r,t=e.rules.filter((function(e){return e.trigger?e.trigger===r:n}));t.length&&Q(t)}},R=function(n){var t=e.maxlength;if(A(t)&&K(n)>t){var a=g();return a&&K(a)===+t?a:function(e,n){return r(e).slice(0,n).join("")}(n,+t)}return n},X=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"onChange";if(r=R(r),"number"===e.type||"digit"===e.type){var t="number"===e.type;r=M(r,t,t)}e.formatter&&n===e.formatTrigger&&(r=e.formatter(r)),f.value&&f.value.value!==r&&(f.value.value=r),r!==e.modelValue&&o("update:modelValue",r)},Y=function(e){e.target.composing||X(e.target.value)},Z=function(){var e;return null==(e=f.value)?void 0:e.blur()},ee=function(){var r=f.value;"textarea"===e.type&&e.autosize&&r&&function(e,r){var n=t();e.style.height="auto";var l=e.scrollHeight;if(i(r)){var o=r.maxHeight,c=r.minHeight;void 0!==o&&(l=Math.min(l,o)),void 0!==c&&(l=Math.max(l,c))}l&&(e.style.height="".concat(l,"px"),a(n))}(r,e.autosize)},re=function(e){u.focused=!0,o("focus",e),z(ee),E("readonly")&&Z()},ne=function(e){E("readonly")||(u.focused=!1,X(g(),"onBlur"),o("blur",e),G("onBlur"),z(ee),B())},te=function(e){return o("click-input",e)},ae=function(e){return o("click-left-icon",e)},ie=function(e){return o("click-right-icon",e)},le=function(e){V(e),o("update:modelValue",""),o("clear",e)},oe=y((function(){return"boolean"==typeof e.error?e.error:!!(s&&s.props.showError&&u.validateFailed)||void 0})),ce=y((function(){var e=E("labelWidth");if(e)return{width:_(e)}})),de=function(r){13===r.keyCode&&(s&&s.props.submitOnEnter||"textarea"===e.type||V(r),"search"===e.type&&Z());o("keypress",r)},ue=function(){return e.id||"".concat(d,"-input")},fe=function(){var r=$("control",[E("inputAlign"),{error:oe.value,custom:!!c.input,"min-height":"textarea"===e.type&&!e.autosize}]);if(c.input)return C("div",{class:r,onClick:te},[c.input()]);var n,t={id:ue(),ref:f,name:e.name,rows:void 0!==e.rows?+e.rows:void 0,class:r,value:e.modelValue,disabled:E("disabled"),readonly:E("readonly"),autofocus:e.autofocus,placeholder:e.placeholder,autocomplete:e.autocomplete,"aria-labelledby":e.label?"".concat(d,"-label"):void 0,onBlur:ne,onFocus:re,onInput:Y,onClick:te,onChange:D,onKeypress:de,onCompositionend:D,onCompositionstart:W};return"textarea"===e.type?C("textarea",t,null):C("input",F("number"===(n=e.type)?{type:"text",inputmode:"decimal"}:"digit"===n?{type:"tel",inputmode:"numeric"}:{type:n},t),null)},ve=function(){var r=c["right-icon"];if(e.rightIcon||r)return C("div",{class:$("right-icon"),onClick:ie},[r?r():C(I,{name:e.rightIcon,classPrefix:e.iconPrefix},null)])},se=function(){if(e.showWordLimit&&e.maxlength){var r=K(g());return C("div",{class:$("word-limit")},[C("span",{class:$("word-num")},[r]),T("/"),e.maxlength])}},ge=function(){if(!s||!1!==s.props.showErrorMessage){var r=e.errorMessage||u.validateMessage;if(r){var n=c["error-message"],t=E("errorMessageAlign");return C("div",{class:$("error-message",t)},[n?n({message:r}):r])}}},me=function(){return[C("div",{class:$("body")},[fe(),P.value&&C(I,{name:e.clearIcon,class:$("clear"),onTouchstart:le},null),ve(),c.button&&C("div",{class:$("button")},[c.button()])]),se(),ge()]};return x({blur:Z,focus:function(){var e;return null==(e=f.value)?void 0:e.focus()},validate:Q,formValue:N,resetValidation:J}),w(j,{customValue:v,resetValidation:J,validateWithTrigger:G}),k((function(){return e.modelValue}),(function(){X(g()),J(),G("onChange"),z(ee)})),S((function(){X(g(),e.formatTrigger),z(ee)})),function(){var r,n,t,a,i=E("disabled"),l=E("labelAlign"),o=(r=E("colon")?":":"",c.label?[c.label(),r]:e.label?C("label",{id:"".concat(d,"-label"),for:ue()},[e.label+r]):void 0),u=function(){var r=c["left-icon"];if(e.leftIcon||r)return C("div",{class:$("left-icon"),onClick:ae},[r?r():C(I,{name:e.leftIcon,classPrefix:e.iconPrefix},null)])}();return C(L,{size:e.size,icon:e.leftIcon,class:$((n={error:oe.value,disabled:i},t="label-".concat(l),a=l,t in n?Object.defineProperty(n,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[t]=a,n)),center:e.center,border:e.border,isLink:e.isLink,clickable:e.clickable,titleStyle:ce.value,valueClass:$("value"),titleClass:[$("label",[l,{required:e.required}]),e.labelClass],arrowDirection:e.arrowDirection},{icon:u?function(){return u}:null,title:o?function(){return o}:null,value:me,extra:c.extra})}}});n("F",E(G))}}}))}();