1
0
mirror of synced 2024-12-22 11:38:45 +03:00
vue-formulario/dist/formulario.min.js

21 lines
27 KiB
JavaScript
Raw Normal View History

2023-12-28 12:11:07 +03:00
var VueFormulario=function(t,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var r=function(t){if("string"!=typeof t)return!1;var e=t.match(o);if(!e)return!1;var r=e[1];if(!r)return!1;if(i.test(r)||n.test(r))return!0;return!1},o=/^(?:\w+:)?\/\/(\S+)$/,i=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;const a=new Map;var s;!function(t){t.ARRAY="ARRAY",t.BIGINT="BIGINT",t.BOOLEAN="BOOLEAN",t.DATE="DATE",t.FUNCTION="FUNCTION",t.NUMBER="NUMBER",t.RECORD="RECORD",t.STRING="STRING",t.SYMBOL="SYMBOL",t.UNDEFINED="UNDEFINED",t.NULL="NULL"}(s||(s={}));const l=t=>Object.getPrototypeOf(t).constructor;function u(t){return l(t)===Object&&0===Object.keys(Object.getPrototypeOf(t)).length}function c(t){return"object"==typeof t&&null!==t&&(u(t)||Array.isArray(t))}function f(t){switch(typeof t){case"bigint":return s.BIGINT;case"boolean":return s.BOOLEAN;case"function":return s.FUNCTION;case"number":return s.NUMBER;case"string":return s.STRING;case"symbol":return s.SYMBOL;case"undefined":return s.UNDEFINED;case"object":return null===t?s.NULL:t instanceof Date?s.DATE:Array.isArray(t)?s.ARRAY:u(t)?s.RECORD:"InstanceOf<"+l(t).name+">"}throw new Error("[Formulario] typeOf - unknown type detected")}function d(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"symbol":case"undefined":return!0;default:return null===t}}function p(t){if(d(t)||t instanceof Blob)return t;if(t instanceof Date)return new Date(t);if(!c(t))return e=t,Object.assign(Object.create(Object.getPrototypeOf(e)),e);var e;if(Array.isArray(t))return t.slice().map(p);const r=t;return Object.keys(r).reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:p(r[e])})),{})}function h(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
2020-10-19 14:38:35 +03:00
/*! *****************************************************************************
2020-10-27 10:50:02 +03:00
Copyright (c) Microsoft Corporation.
2020-10-19 14:38:35 +03:00
2020-10-27 10:50:02 +03:00
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
2020-10-19 14:38:35 +03:00
2020-10-27 10:50:02 +03:00
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
2023-12-28 12:11:07 +03:00
***************************************************************************** */function m(t,e,r,o){var i,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,r,a):i(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a}const y=t=>{const e=parseInt(t);return e.toString()===t?e:NaN},v=t=>{const e=[];return t.split(".").forEach((t=>{/(.*)\[(\d+)]$/.test(t)?e.push(...t.substr(0,t.length-1).split("[").filter((t=>t.length))):e.push(t)})),e};function g(t,e,r){const o="string"==typeof e?v(e):e;if(d(t)||0===o.length)return r;const i=o.shift(),n=y(i);if(!isNaN(n))return Array.isArray(t)&&n>=0&&n<t.length?0===o.length?t[n]:g(t[n],o,r):void 0;if(h(t,i)){const e=t;return 0===o.length?e[i]:g(e[i],o,r)}}function _(t,e,r){const o="string"==typeof e?v(e):e;if(0===o.length)return r;const i=o.shift(),n=y(i);if(!c(t))return _(isNaN(n)?{}:[],[i,...o],r);if(!isNaN(n)&&Array.isArray(t)){const e=[...t];return e[n]=0===o.length?r:_(e[n],o,r),e}const a=Object.assign({},t);return a[i]=0===o.length?r:_(a[i],o,r),a}const b=(t,e)=>{const r=t,o=e;r[o];return function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(r[o[i]]=t[o[i]])}return r}(r,["symbol"==typeof o?o:o+""])};function O(t,e){if(!c(t))return t;const r="string"==typeof e?v(e):e;if(0===r.length)return t;const o=r.shift(),i=y(o);if(!isNaN(i)&&Array.isArray(t)&&i>=0&&i<t.length){const e=[...t];return 0===r.length?e.splice(i,1):e[i]=O(e[i],r),e}if(h(t,o)){const e=Object.assign({},t);return 0===r.length?b(e,o):Object.assign(Object.assign({},e),{[o]:O(e[o],r)})}return t}function F(t,e){return t===e}function N(t,e,r){const o=f(t);return o===f(e)&&(o===s.ARRAY&&function(t,e,r){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!r(t[o],e[o]))return!1;return!0}(t,e,r)||o===s.DATE&&function(t,e){return t.getTime()===e.getTime()}(t,e)||o===s.RECORD&&function(t,e,r){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const o in t)if(!h(e,o)||!r(t[o],e[o]))return!1;return!0}(t,e,r)||o.includes("InstanceOf")&&N(Object.entries(t),Object.entries(e),r))}function E(t,e){return t===e||N(t,e,E)}function j(t,e){return t===e||N(t,e,F)}function $(t){return t.replace(/([_][a-z0-9])/gi,(e=>0!==t.indexOf(e)&&"_"!==t[t.indexOf(e)-1]?e.toUpperCase().replace("_",""):e))}const w={accepted:({value:t})=>["yes","on","1",1,!0,"true"].includes(t),after({value:t},e=!1){const r=!1!==e?Date.parse(e):Date.now(),o=t instanceof Date?t.getTime():Date.parse(t);return!isNaN(o)&&o>r},alpha({value:t},e="default"){const r={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/};return"string"==typeof t&&r[h(r,e)?e:"default"].test(t)},alphanumeric({value:t},e="default"){const r={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/};return"string"==typeof t&&r[h(r,e)?e:"default"].test(t)},before({value:t},e=!1){const r=!1!==e?Date.parse(e):Date.now(),o=t instanceof Date?t.getTime():Date.parse(t);return!isNaN(o)&&o<r},between:({value:t},e=0,r=10,o)=>null!==e&&null!==r&&!isNaN(e)&&!isNaN(r)&&(!isNaN(Number(t))&&"length"!==o||"value"===o?(t=Number(t))>Number(e)&&t<Number(r):("string"==typeof t||"length"===o)&&((t=isNaN(Number(t))?t:t.toString()).length>e&&t.length<r)),confirm({value:t,formValues:e,name:r},o){let i=o;return i||(i=/_confirm$/.test(r)?r.substr(0,r.length-8):r+"_confirm"),e[i]===t},date:({value:t},e=!1)=>e?function(t){const e=`^${r=t,r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`;var r;const o={MM:"(0[1-9]|1[012])",M:"([1-9]|1[012])",DD:"([012][1-9]|3[01])",D:"([012]?[1-9]|3[01])",YYYY:"\\d{4}",YY:"\\d{2}"};return new RegExp(Object.keys(o).reduce(((t,e)=>t.replace(e,o[e])),e))}(e).test(t):!isNaN(Date.parse(t)),email({value:t}){if(!t)return!0;return/^(([^<>()\[\].,;:\s@"]+(\.
2020-10-19 14:38:35 +03:00
/**
2020-10-27 10:50:02 +03:00
* vue-class-component v7.2.3
* (c) 2015-present Evan You
* @license MIT
2023-12-28 12:11:07 +03:00
*/function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function S(){return"undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function D(t,e){C(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(r){C(t.prototype,e.prototype,r)})),Object.getOwnPropertyNames(e).forEach((function(r){C(t,e,r)}))}function C(t,e,r){(r?Reflect.getOwnMetadataKeys(e,r):Reflect.getOwnMetadataKeys(e)).forEach((function(o){var i=r?Reflect.getOwnMetadata(o,e,r):Reflect.getOwnMetadata(o,e);r?Reflect.defineMetadata(o,i,t,r):Reflect.defineMetadata(o,i,t)}))}var M={__proto__:[]}instanceof Array;function I(t){return function(e,r,o){var i="function"==typeof e?e:e.constructor;i.__decorators__||(i.__decorators__=[]),"number"!=typeof o&&(o=void 0),i.__decorators__.push((function(e){return t(e,r,o)}))}}function T(t){"undefined"!=typeof console&&console.warn("[vue-class-component] "+t)}function B(t,r){var o=r.prototype._init;r.prototype._init=function(){var e=this,r=Object.getOwnPropertyNames(t);if(t.$options.props)for(var o in t.$options.props)t.hasOwnProperty(o)||r.push(o);r.forEach((function(r){"_"!==r.charAt(0)&&Object.defineProperty(e,r,{get:function(){return t[r]},set:function(e){t[r]=e},configurable:!0})}))};var i=new r;r.prototype._init=o;var n={};return Object.keys(i).forEach((function(t){void 0!==i[t]&&(n[t]=i[t])})),"production"!==process.env.NODE_ENV&&!(r.prototype instanceof e)&&Object.keys(n).length>0&&T("Component class must inherit Vue or its descendant class when class property is used."),n}var U=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function k(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.name=r.name||t._componentTag||t.name;var o=t.prototype;Object.getOwnPropertyNames(o).forEach((function(t){if("constructor"!==t)if(U.indexOf(t)>-1)r[t]=o[t];else{var e=Object.getOwnPropertyDescriptor(o,t);void 0!==e.value?"function"==typeof e.value?(r.methods||(r.methods={}))[t]=e.value:(r.mixins||(r.mixins=[])).push({data:function(){return P({},t,e.value)}}):(e.get||e.set)&&((r.computed||(r.computed={}))[t]={get:e.get,set:e.set})}})),(r.mixins||(r.mixins=[])).push({data:function(){return B(this,t)}});var i=t.__decorators__;i&&(i.forEach((function(t){return t(r)})),delete t.__decorators__);var n=Object.getPrototypeOf(t.prototype),a=n instanceof e?n.constructor:e,s=a.extend(r);return G(s,t,a),S()&&D(s,t),s}var L=["cid","super","options","superOptions","extendOptions","sealedOptions","component","directive","filter"],Y={prototype:!0,arguments:!0,callee:!0,caller:!0};function G(t,e,r){Object.getOwnPropertyNames(e).forEach((function(o){if(!Y[o]){var i=Object.getOwnPropertyDescriptor(t,o);if(!i||i.configurable){var n,a,s=Object.getOwnPropertyDescriptor(e,o);if(!M){if("cid"===o)return;var l=Object.getOwnPropertyDescriptor(r,o);if(n=s.value,a=A(n),null!=n&&("object"===a||"function"===a)&&l&&l.value===s.value)return}"production"!==process.env.NODE_ENV&&L.indexOf(o)>=0&&T("Static property name '".concat(o,"' declared on class '").concat(e.name,"' ")+"conflicts with reserved property name of Vue internal. It may cause unexpected behavior of the component. Consider renaming the property."),Object.defineProperty(t,o,s)}}}))}function z(t){return"function"==typeof t?k(t):function(e){return k(e,t)}}z.registerHooks=function(t){U.push.apply(U,V(t)