You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/u-form.711cedfd.js

2 lines
26 KiB

11 months ago
import{x as e,o as t,c as r,w as i,a as n,n as a,f as l,e as s,t as o,A as u,j as d,k as f,i as p,l as c,a3 as h,I as m}from"./index-ae8bbb19.js";import{_ as g}from"./u-icon.b463ad8a.js";import{r as y}from"./uni-app.es.ee1d5b08.js";import{_ as b}from"./_plugin-vue_export-helper.1b428a4d.js";function v(e,t,r){}const S={methods:{dispatch(e,t,r){let i=this.$parent||this.$root,n=i.$options.name;for(;i&&(!n||n!==e);)i=i.$parent,i&&(n=i.$options.name);i&&i[t](r)},broadcast(e,t,r){v.call(this,e,t,r)}}};function _(){return _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},_.apply(this,arguments)}var w=/%[sdj%]/g,x=function(){};function q(e){if(!e||!e.length)return null;var t={};return e.forEach((function(e){var r=e.field;t[r]=t[r]||[],t[r].push(e)})),t}function O(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=1,n=t[0],a=t.length;if("function"==typeof n)return n.apply(null,t.slice(1));if("string"==typeof n){for(var l=String(n).replace(w,(function(e){if("%%"===e)return"%";if(i>=a)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(r){return"[Circular]"}break;default:return e}})),s=t[i];i<a;s=t[++i])l+=" "+s;return l}return n}function A(e,t){return null==e||(!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"pattern"===e}(t)||"string"!=typeof e||e))}function F(e,t,r){var i=0,n=e.length;!function a(l){if(l&&l.length)r(l);else{var s=i;i+=1,s<n?t(e[s],a):r([])}}([])}function j(e,t,r,i){if(t.first){var n=new Promise((function(t,n){var a=function(e){var t=[];return Object.keys(e).forEach((function(r){t.push.apply(t,e[r])})),t}(e);F(a,r,(function(e){return i(e),e.length?n({errors:e,fields:q(e)}):t()}))}));return n.catch((function(e){return e})),n}var a=t.firstFields||[];!0===a&&(a=Object.keys(e));var l=Object.keys(e),s=l.length,o=0,u=[],d=new Promise((function(t,n){var d=function(e){if(u.push.apply(u,e),++o===s)return i(u),u.length?n({errors:u,fields:q(u)}):t()};l.length||(i(u),t()),l.forEach((function(t){var i=e[t];-1!==a.indexOf(t)?F(i,r,d):function(e,t,r){var i=[],n=0,a=e.length;function l(e){i.push.apply(i,e),++n===a&&r(i)}e.forEach((function(e){t(e,l)}))}(i,r,d)}))}));return d.catch((function(e){return e})),d}function P(e){return function(t){return t&&t.message?(t.field=t.field||e.fullField,t):{message:"function"==typeof t?t():t,field:t.field||e.fullField}}}function C(e,t){if(t)for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];"object"==typeof i&&"object"==typeof e[r]?e[r]=_({},e[r],{},i):e[r]=i}return e}function k(e,t,r,i,n,a){!e.required||r.hasOwnProperty(e.field)&&!A(t,a||e.type)||i.push(O(n.messages.required,e.fullField))}"undefined"!=typeof process&&process.env;var B={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},I={integer:function(e){return I.number(e)&&parseInt(e,10)===e},float:function(e){return I.number(e)&&!I.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(t){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear},number:function(e){return!isNaN(e)&&"number"==typeof+e},object:function(e){return"object"==typeof e&&!I.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&!!e.