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(["./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.610f0a70.js","./use-id-legacy.54528695.js"],(function(n){"use strict";var t,a,i,l,o,c,d,u,f,v,s,g,m,h,p,b,y,_,x,w,k,z,S,C,A,M,I,V,j,F,T,B,E,P,O,q;return{setters:[function(e){t=e.aI,a=e.az,i=e.aJ,l=e.aK,o=e.aL,c=e.E,d=e.G,u=e.a0,f=e.ab,v=e.J,s=e.I,g=e.d,m=e.S,h=e.U,p=e.at,b=e.aM,y=e.W,_=e.a2,x=e.ak,w=e.aE,k=e.aN,z=e.a3,S=e.X,C=e.V,A=e.j,M=e.M,I=e.aO,V=e.N,j=e.aq,F=e.a8,T=e.A,B=e.aP,E=e.O},function(e){P=e.c,O=e.C},function(e){q=e.u}],execute:function(){function L(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 W(e,r){var n=r.message;return o(n)?n(e,r):n||""}function H(e){e.target.composing=!0}function D(e){var r=e.target;r.composing&&(r.composing=!1,r.dispatchEvent(new Event("input")))}function J(e){return r(e).length}var K=e(c("field"),2),N=K[0],U=K[1],G=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}}),R=v({},P,G,{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}}),X=g({name:N,props:R,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=h(),v=h(),s=p(b).parent,g=function(){var r;return String(null!=(r=e.modelValue)?r:"")},E=function(r){return M(e[r])?e[r]:s&&M(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})),K=y((function(){return v.value&&c.input?v.value():e.modelValue})),N=function(e){return e.reduce((function(e,r){return e.then((function(){if(!u.validateFailed){var e=K.value;return r.formatter&&(e=r.formatter(e,r)),L(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=W(e,r))})):void 0:(u.validateFailed=!0,void(u.validateMessage=W(e,r)))}}))}),Promise.resolve())},G=function(){u.validateFailed&&(u.validateFailed=!1,u.validateMessage="")},R=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.rules;return new Promise((function(n){G(),r?N(r).then((function(){u.validateFailed?n({name:e.name,message:u.validateMessage}):n()})):n()}))},X=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&&R(t)}},$=function(n){var t=e.maxlength;if(M(t)&&J(n)>t){var a=g();return a&&J(a)===+t?a:function(e,n){return r(e).slice(0,n).join("")}(n,+t)}return n},Q=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"onChange";if(r=$(r),"number"===e.type||"digit"===e.type){var t="number"===e.type;r=I(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||Q(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),S(ee),E("readonly")&&Z()},ne=function(e){E("readonly")||(u.focused=!1,Q(g(),"onBlur"),o("blur",e),X("onBlur"),S(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){j(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||j(r),"search"===e.type&&Z());o("keypress",r)},ue=function(){return e.id||"".concat(d,"-input")},fe=function(){var r=U("control",[E("inputAlign"),{error:oe.value,custom:!!c.input,"min-height":"textarea"===e.type&&!e.autosize}]);if(c.input)return A("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:H};return"textarea"===e.type?A("textarea",t,null):A("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 A("div",{class:U("right-icon"),onClick:ie},[r?r():A(V,{name:e.rightIcon,classPrefix:e.iconPrefix},null)])},se=function(){if(e.showWordLimit&&e.maxlength){var r=J(g());return A("div",{class:U("word-limit")},[A("span",{class:U("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 A("div",{class:U("error-message",t)},[n?n({message:r}):r])}}},me=function(){return[A("div",{class:U("body")},[fe(),P.value&&A(V,{name:e.clearIcon,class:U("clear"),onTouchstart:le},null),ve(),c.button&&A("div",{class:U("button")},[c.button()])]),se(),ge()]};return x({blur:Z,focus:function(){var e;return null==(e=f.value)?void 0:e.focus()},validate:R,formValue:K,resetValidation:G}),w(k,{customValue:v,resetValidation:G,validateWithTrigger:X}),z((function(){return e.modelValue}),(function(){Q(g()),G(),X("onChange"),S(ee)})),C((function(){Q(g(),e.formatTrigger),S(ee)})),function(){var r,n,t,a,i=E("disabled"),l=E("labelAlign"),o=(r=E("colon")?":":"",c.label?[c.label(),r]:e.label?A("label",{id:"".concat(d,"-label"),for:ue()},[e.label+r]):void 0),u=function(){var r=c["left-icon"];if(e.leftIcon||r)return A("div",{class:U("left-icon"),onClick:ae},[r?r():A(V,{name:e.leftIcon,classPrefix:e.iconPrefix},null)])}();return A(O,{size:e.size,icon:e.leftIcon,class:U((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:U("value"),titleClass:[U("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(X))}}}))}();
|