1
0
mirror of synced 2024-12-01 09:36:09 +03:00
vue-formulario/dist/formulario.min.js

35 lines
28 KiB
JavaScript
Raw Permalink Normal View History

2020-11-11 11:56:00 +03:00
var VueFormulario=function(t){"use strict";
2020-10-19 12:32:15 +03:00
/*!
2020-10-27 10:50:02 +03:00
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
2020-11-11 11:56:00 +03:00
function e(t){return!0==(null!=(e=t)&&"object"==typeof e&&!1===Array.isArray(e))&&"[object Object]"===Object.prototype.toString.call(t);
2020-10-19 12:32:15 +03:00
/*!
2020-10-27 10:50:02 +03:00
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
2021-10-21 12:56:04 +03:00
var e}function r(t){var r,o;return!1!==e(t)&&("function"==typeof(r=t.constructor)&&(!1!==e(o=r.prototype)&&!1!==o.hasOwnProperty("isPrototypeOf")))}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function n(t,e,i=!0){const a={};for(const s in t)o(e,s)?r(e[s])&&r(t[s])?a[s]=n(t[s],e[s],i):i&&Array.isArray(t[s])&&Array.isArray(e[s])?a[s]=t[s].concat(e[s]):a[s]=e[s]:a[s]=t[s];for(const t in e)o(a,t)||(a[t]=e[t]);return a}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var i=function(t){if("string"!=typeof t)return!1;var e=t.match(a);if(!e)return!1;var r=e[1];if(!r)return!1;if(s.test(r)||l.test(r))return!0;return!1},a=/^(?:\w+:)?\/\/(\S+)$/,s=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,l=/^[^\s\.]+\.\S{2,}$/;const u=new Map;var c;!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"}(c||(c={}));const f=t=>Object.getPrototypeOf(t).constructor;function d(t){return f(t)===Object&&0===Object.keys(Object.getPrototypeOf(t)).length}function p(t){return"object"==typeof t&&null!==t&&(d(t)||Array.isArray(t))}function h(t){switch(typeof t){case"bigint":return c.BIGINT;case"boolean":return c.BOOLEAN;case"function":return c.FUNCTION;case"number":return c.NUMBER;case"string":return c.STRING;case"symbol":return c.SYMBOL;case"undefined":return c.UNDEFINED;case"object":return null===t?c.NULL:t instanceof Date?c.DATE:Array.isArray(t)?c.ARRAY:d(t)?c.RECORD:"InstanceOf<"+f(t).name+">"}throw new Error}function m(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"symbol":case"undefined":return!0;default:return null===t}}function y(t){if(m(t)||t instanceof Blob)return t;if(t instanceof Date)return new Date(t);if(!p(t))return e=t,Object.assign(Object.create(Object.getPrototypeOf(e)),e);var e;if(Array.isArray(t))return t.slice().map(y);const r=t;return Object.keys(r).reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:y(r[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.
2021-11-11 11:41:05 +03:00
***************************************************************************** */function v(t,e,r,o){var n,i=arguments.length,a=i<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--)(n=t[s])&&(a=(i<3?n(a):i>3?n(e,r,a):n(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}const g=t=>{const e=parseInt(t);return e.toString()===t?e:NaN},_=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 b(t,e,r){const n="string"==typeof e?_(e):e;if(m(t)||0===n.length)return r;const i=n.shift(),a=g(i);if(!isNaN(a))return Array.isArray(t)&&a>=0&&a<t.length?0===n.length?t[a]:b(t[a],n,r):void 0;if(o(t,i)){const e=t;return 0===n.length?e[i]:b(e[i],n,r)}}function O(t,e,r){const o="string"==typeof e?_(e):e;if(0===o.length)return r;const n=o.shift(),i=g(n);if(!p(t))return O(isNaN(i)?{}:[],[n,...o],r);if(!isNaN(i)&&Array.isArray(t)){const e=[...t];return e[i]=0===o.length?r:O(e[i],o,r),e}const a=Object.assign({},t);return a[n]=0===o.length?r:O(a[n],o,r),a}const F=(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 n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]])}return r}(r,["symbol"==typeof o?o:o+""])};function N(t,e){if(!p(t))return t;const r="string"==typeof e?_(e):e;if(0===r.length)return t;const n=r.shift(),i=g(n);if(!isNaN(i)&&Array.isArray(t)&&i>=0&&i<t.length){const e=[...t];return 0===r.length?e.splice(i,1):e[i]=N(e[i],r),e}if(o(t,n)){const e=Object.assign({},t);return 0===r.length?F(e,n):Object.assign(Object.assign({},e),{[n]:N(e[n],r)})}return t}function E(t,e){return t===e}function $(t,e,r){const n=h(t);return n===h(e)&&(n===c.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)||n===c.DATE&&function(t,e){return t.getTime()===e.getTime()}(t,e)||n===c.RECORD&&function(t,e,r){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!o(e,n)||!r(t[n],e[n]))return!1;return!0}(t,e,r)||n.includes("InstanceOf")&&$(Object.entries(t),Object.entries(e),r))}function j(t,e){return t===e||$(t,e,j)}function w(t,e){return t===e||$(t,e,E)}function R(t){return t.replace(/([_][a-z0-9])/gi,(e=>0!==t.indexOf(e)&&"_"!==t[t.indexOf(e)-1]?e.toUpperCase().replace("_",""):e))}const A={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[o(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[o(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 n=o;return n||(n=/_confirm$/.test(r)?r.substr(0,r.length-8):r+"_confirm"),e[n]===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
2021-09-30 13:51:12 +03:00
*/function P(t){return(P="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 D(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(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 C(){return"undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function M(t,e){I(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(r){I(t.prototype,e.prototype,r)})),Object.getOwnPropertyNames(e).forEach((function(r){I(t,e,r)}))}function I(t,e,r){(r?Reflect.getOwnMetadataKeys(e,r):Reflect.getOwnMetadataKeys(e)).forEach((function(o){var n=r?Reflect.getOwnMetadata(o,e,r):Reflect.getOwnMetadata(o,e);r?Reflect.defineMetadata(o,n,t,r):Reflect.defineMetadata(o,n,t)}))}var T={__proto__:[]}instanceof Array;function B(t){return function(e,r,o){var n="function"==typeof e?e:e.constructor;n.__decorators__||(n.__decorators__=[]),"number"!=typeof o&&(o=void 0),n.__decorators__.push((function(e){return t(e,r,o)}))}}function U(t){"undefined"!=typeof console&&console.warn("[vue-class-component] "+t)}function L(e,r){var o=r.prototype._init;r.prototype._init=function(){var t=this,r=Object.getOwnPropertyNames(e);if(e.$options.props)for(var o in e.$options.props)e.hasOwnProperty(o)||r.push(o);r.forEach((function(r){"_"!==r.charAt(0)&&Object.defineProperty(t,r,{get:function(){return e[r]},set:function(t){e[r]=t},configurable:!0})}))};var n=new r;r.prototype._init=o;var i={};return Object.keys(n).forEach((function(t){void 0!==n[t]&&(i[t]=n[t])})),"production"!==process.env.NODE_ENV&&!(r.prototype instanceof t)&&Object.keys(i).length>0&&U("Component class must inherit Vue or its descendant class when class property is used."),i}var k=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function Y(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.name=r.name||e._componentTag||e.name;var o=e.prototype;Object.getOwnPropertyNames(o).forEach((function(t){if("constructor"!==t)if(k.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 D({},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 L(this,e)}});var n=e.__decorators__;n&&(n.forEach((function(t){return t(r)})),delete e.__decorators__);var i=Object.getPrototypeOf(e.prototype),a=i instanceof t?i.constructor:t,s=a.extend(r);return W(s,e,a),C()&&M(s,e),s}var G=["cid","super","options","superOptions","extendOptions","sealedOptions","component","directive","filter"],z={prototype:!0,arguments:!0,callee:!0,caller:!0};function W(t,e,r){Object.getOwnPropertyNames(e).forEach((function(o){if(!z[o]){var n=Object.getOwnPropertyDescriptor(t,o);if(!n||n.configurable){var i,a,s=Object.getOwnPropertyDescriptor(e,o);if(!T){if("cid"===o)return;var l=Object.getOwnPropertyDescriptor(r,o);if(i=s.value,a=P(i),null!=i&&("object"===a||"function"===a)&&l&&l.value===s.value)return}"production"!==process.env.NODE_ENV&&G.indexOf(o)>=0&&U("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 q(t){return"function"==typeof t?Y(t):function(e){return Y(e,t)}}q.registerHooks=function(t){k.push.apply(k,S(t)