1 |
- !function(){function n(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null==e)return;var t,o,i=[],a=!0,u=!1;try{for(e=e.call(n);!(a=(t=e.next()).done)&&(i.push(t.value),!r||i.length!==r);a=!0);}catch(l){u=!0,o=l}finally{try{a||null==e.return||e.return()}finally{if(u)throw o}}return i}(n,e)||function(n,e){if(!n)return;if("string"==typeof n)return r(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(n);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(n,e)}(n,e)||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(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);e<r;e++)t[e]=n[e];return t}System.register(["./ResizeObserver.es-legacy.8d60aee1.js"],(function(r){"use strict";var e,t,o,i,a,u,l,c,f,s,m;return{setters:[function(n){e=n.E,t=n.G,o=n.H,i=n.a0,a=n.d,u=n.aj,l=n.aM,c=n.ak,f=n.j,s=n.aq,m=n.O}],execute:function(){var d=n(e("form"),2),v=d[0],h=d[1],g={colon:Boolean,disabled:Boolean,readonly:Boolean,showError:Boolean,labelWidth:t,labelAlign:String,inputAlign:String,scrollToError:Boolean,validateFirst:Boolean,submitOnEnter:o,validateTrigger:i("onBlur"),showErrorMessage:o,errorMessageAlign:String},y=a({name:v,props:g,emits:["submit","failed"],setup:function(n,r){var e=r.emit,t=r.slots,o=u(l),i=o.children,a=o.linkChildren,m=function(n){return n?i.filter((function(r){return n.includes(r.name)})):i},d=function(r){return"string"==typeof r?function(n){var r=i.find((function(r){return r.name===n}));return r?new Promise((function(n,e){r.validate().then((function(r){r?e(r):n()}))})):Promise.reject()}(r):n.validateFirst?(e=r,new Promise((function(n,r){var t=[];m(e).reduce((function(n,r){return n.then((function(){if(!t.length)return r.validate().then((function(n){n&&t.push(n)}))}))}),Promise.resolve()).then((function(){t.length?r(t):n()}))}))):function(n){return new Promise((function(r,e){var t=m(n);Promise.all(t.map((function(n){return n.validate()}))).then((function(n){(n=n.filter(Boolean)).length?e(n):r()}))}))}(r);var e},v=function(n,r){i.some((function(e){return e.name===n&&(e.$el.scrollIntoView(r),!0)}))},g=function(){var r=i.reduce((function(n,r){return n[r.name]=r.formValue.value,n}),{});d().then((function(){return e("submit",r)})).catch((function(t){e("failed",{values:r,errors:t}),n.scrollToError&&t[0].name&&v(t[0].name)}))},y=function(n){s(n),g()};return a({props:n}),c({submit:g,validate:d,scrollToField:v,resetValidation:function(n){"string"==typeof n&&(n=[n]),m(n).forEach((function(n){n.resetValidation()}))}}),function(){var n;return f("form",{class:h(),onSubmit:y},[null==(n=t.default)?void 0:n.call(t)])}}});r("F",m(y))}}}))}();
|