1
0
mirror of synced 2024-11-22 13:26:06 +03:00
vue-formulario/dist/formulario.min.js

35 lines
27 KiB
JavaScript
Raw 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-08-03 14:48:41 +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 f(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:"Object"===t.constructor.name?c.RECORD:"InstanceOf<"+t.constructor.name+">"}throw new Error}function d(t){return"object"==typeof t&&null!==t&&["Array","Object"].includes(t.constructor.name)}function p(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"symbol":case"undefined":return!0;default:return null===t}}!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={}));function h(t){if(p(t))return t;if(t instanceof Date)return new Date(t);if(!d(t))return e=t,Object.assign(Object.create(Object.getPrototypeOf(e)),e);var e;if(Array.isArray(t))return t.slice().map(h);const r=t;return Object.keys(r).reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:h(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-08-03 14:48:41 +03:00
***************************************************************************** */function m(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 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 n="string"==typeof e?v(e):e;if(p(t)||0===n.length)return r;const i=n.shift(),a=y(i);if(!isNaN(a))return Array.isArray(t)&&a>=0&&a<t.length?0===n.length?t[a]:g(t[a],n,r):void 0;if(o(t,i)){const e=t;return 0===n.length?e[i]:g(e[i],n,r)}}function _(t,e,r){const o="string"==typeof e?v(e):e;if(0===o.length)return r;const n=o.shift(),i=y(n);if(!d(t))return _(isNaN(i)?{}:[],[n,...o],r);if(!isNaN(i)&&Array.isArray(t)){const e=[...t];return e[i]=0===o.length?r:_(e[i],o,r),e}const a=Object.assign({},t);return a[n]=0===o.length?r:_(a[n],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 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 O(t,e){if(!d(t))return t;const r="string"==typeof e?v(e):e;if(0===r.length)return t;const n=r.shift(),i=y(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]=O(e[i],r),e}if(o(t,n)){const e=Object.assign({},t);return 0===r.length?b(e,n):Object.assign(Object.assign({},e),{[n]:O(e[n],r)})}return t}function F(t,e){return t===e}function N(t,e,r){const n=f(t);return n===f(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")&&N(Object.entries(t),Object.entries(e),r))}function E(t,e){return t===e||N(t,e,E)}function $(t,e){return t===e||N(t,e,F)}function j(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[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-08-03 14:48:41 +03:00
*/function x(t){return(x="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 V(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(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 D(){return"undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function S(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 n=r?Reflect.getOwnMetadata(o,e,r):Reflect.getOwnMetadata(o,e);r?Reflect.defineMetadata(o,n,t,r):Reflect.defineMetadata(o,n,t)}))}var M={__proto__:[]}instanceof Array;function I(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 T(t){"undefined"!=typeof console&&console.warn("[vue-class-component] "+t)}function U(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&&T("Component class must inherit Vue or its descendant class when class property is used."),i}var B=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function L(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(B.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 V({},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 U(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 G(s,e,a),D()&&S(s,e),s}var k=["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 n=Object.getOwnPropertyDescriptor(t,o);if(!n||n.configurable){var i,a,s=Object.getOwnPropertyDescriptor(e,o);if(!M){if("cid"===o)return;var l=Object.getOwnPropertyDescriptor(r,o);if(i=s.value,a=x(i),null!=i&&("object"===a||"function"===a)&&l&&l.value===s.value)return}"production"!==process.env.NODE_ENV&&k.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?L(t):function(e){return L(e,t)}}z.registerHooks=function(t){B.push.apply(B,P(t)