mwc-test
Version:
## Project setup ``` yarn install ```
1,798 lines (1,489 loc) • 352 kB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ "01f9":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var LIBRARY = __webpack_require__("2d00");
var $export = __webpack_require__("5ca1");
var redefine = __webpack_require__("2aba");
var hide = __webpack_require__("32e9");
var Iterators = __webpack_require__("84f2");
var $iterCreate = __webpack_require__("41a0");
var setToStringTag = __webpack_require__("7f20");
var getPrototypeOf = __webpack_require__("38fd");
var ITERATOR = __webpack_require__("2b4c")('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/***/ "0234":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.pushParams = pushParams;
exports.popParams = popParams;
exports.withParams = withParams;
exports._setTarget = exports.target = void 0;
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var stack = [];
var target = null;
exports.target = target;
var _setTarget = function _setTarget(x) {
exports.target = target = x;
};
exports._setTarget = _setTarget;
function pushParams() {
if (target !== null) {
stack.push(target);
}
exports.target = target = {};
}
function popParams() {
var lastTarget = target;
var newTarget = exports.target = target = stack.pop() || null;
if (newTarget) {
if (!Array.isArray(newTarget.$sub)) {
newTarget.$sub = [];
}
newTarget.$sub.push(lastTarget);
}
return lastTarget;
}
function addParams(params) {
if (_typeof(params) === 'object' && !Array.isArray(params)) {
exports.target = target = _objectSpread({}, target, params);
} else {
throw new Error('params must be an object');
}
}
function withParamsDirect(params, validator) {
return withParamsClosure(function (add) {
return function () {
add(params);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return validator.apply(this, args);
};
});
}
function withParamsClosure(closure) {
var validator = closure(addParams);
return function () {
pushParams();
try {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return validator.apply(this, args);
} finally {
popParams();
}
};
}
function withParams(paramsOrClosure, maybeValidator) {
if (_typeof(paramsOrClosure) === 'object' && maybeValidator !== undefined) {
return withParamsDirect(paramsOrClosure, maybeValidator);
}
return withParamsClosure(paramsOrClosure);
}
/***/ }),
/***/ "07e3":
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/***/ "0d58":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__("ce10");
var enumBugKeys = __webpack_require__("e11e");
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/***/ "11e9":
/***/ (function(module, exports, __webpack_require__) {
var pIE = __webpack_require__("52a7");
var createDesc = __webpack_require__("4630");
var toIObject = __webpack_require__("6821");
var toPrimitive = __webpack_require__("6a99");
var has = __webpack_require__("69a8");
var IE8_DOM_DEFINE = __webpack_require__("c69a");
var gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__("9e1e") ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = toIObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ }),
/***/ "1331":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _common = __webpack_require__("78ef");
var _default = (0, _common.regex)('integer', /^-?[0-9]*$/);
exports.default = _default;
/***/ }),
/***/ "1495":
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__("86cc");
var anObject = __webpack_require__("cb7c");
var getKeys = __webpack_require__("0d58");
module.exports = __webpack_require__("9e1e") ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/***/ "1bc3":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__("f772");
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/***/ "1dce":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Vuelidate = Vuelidate;
Object.defineProperty(exports, "withParams", {
enumerable: true,
get: function get() {
return _params.withParams;
}
});
exports.default = exports.validationMixin = void 0;
var _vval = __webpack_require__("fbf4");
var _params = __webpack_require__("0234");
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var NIL = function NIL() {
return null;
};
var buildFromKeys = function buildFromKeys(keys, fn, keyFn) {
return keys.reduce(function (build, key) {
build[keyFn ? keyFn(key) : key] = fn(key);
return build;
}, {});
};
function isFunction(val) {
return typeof val === 'function';
}
function isObject(val) {
return val !== null && (_typeof(val) === 'object' || isFunction(val));
}
function isPromise(object) {
return isObject(object) && isFunction(object.then);
}
var getPath = function getPath(ctx, obj, path, fallback) {
if (typeof path === 'function') {
return path.call(ctx, obj, fallback);
}
path = Array.isArray(path) ? path : path.split('.');
for (var i = 0; i < path.length; i++) {
if (obj && _typeof(obj) === 'object') {
obj = obj[path[i]];
} else {
return fallback;
}
}
return typeof obj === 'undefined' ? fallback : obj;
};
var __isVuelidateAsyncVm = '__isVuelidateAsyncVm';
function makePendingAsyncVm(Vue, promise) {
var asyncVm = new Vue({
data: {
p: true,
v: false
}
});
promise.then(function (value) {
asyncVm.p = false;
asyncVm.v = value;
}, function (error) {
asyncVm.p = false;
asyncVm.v = false;
throw error;
});
asyncVm[__isVuelidateAsyncVm] = true;
return asyncVm;
}
var validationGetters = {
$invalid: function $invalid() {
var _this = this;
var proxy = this.proxy;
return this.nestedKeys.some(function (nested) {
return _this.refProxy(nested).$invalid;
}) || this.ruleKeys.some(function (rule) {
return !proxy[rule];
});
},
$dirty: function $dirty() {
var _this2 = this;
if (this.dirty) {
return true;
}
if (this.nestedKeys.length === 0) {
return false;
}
return this.nestedKeys.every(function (key) {
return _this2.refProxy(key).$dirty;
});
},
$anyDirty: function $anyDirty() {
var _this3 = this;
if (this.dirty) {
return true;
}
if (this.nestedKeys.length === 0) {
return false;
}
return this.nestedKeys.some(function (key) {
return _this3.refProxy(key).$anyDirty;
});
},
$error: function $error() {
return this.$dirty && !this.$pending && this.$invalid;
},
$anyError: function $anyError() {
return this.$anyDirty && !this.$pending && this.$invalid;
},
$pending: function $pending() {
var _this4 = this;
return this.ruleKeys.some(function (key) {
return _this4.getRef(key).$pending;
}) || this.nestedKeys.some(function (key) {
return _this4.refProxy(key).$pending;
});
},
$params: function $params() {
var _this5 = this;
var vals = this.validations;
return _objectSpread({}, buildFromKeys(this.nestedKeys, function (key) {
return vals[key] && vals[key].$params || null;
}), buildFromKeys(this.ruleKeys, function (key) {
return _this5.getRef(key).$params;
}));
}
};
function setDirtyRecursive(newState) {
this.dirty = newState;
var proxy = this.proxy;
var method = newState ? '$touch' : '$reset';
this.nestedKeys.forEach(function (key) {
proxy[key][method]();
});
}
var validationMethods = {
$touch: function $touch() {
setDirtyRecursive.call(this, true);
},
$reset: function $reset() {
setDirtyRecursive.call(this, false);
},
$flattenParams: function $flattenParams() {
var proxy = this.proxy;
var params = [];
for (var key in this.$params) {
if (this.isNested(key)) {
var childParams = proxy[key].$flattenParams();
for (var j = 0; j < childParams.length; j++) {
childParams[j].path.unshift(key);
}
params = params.concat(childParams);
} else {
params.push({
path: [],
name: key,
params: this.$params[key]
});
}
}
return params;
}
};
var getterNames = Object.keys(validationGetters);
var methodNames = Object.keys(validationMethods);
var _cachedComponent = null;
var getComponent = function getComponent(Vue) {
if (_cachedComponent) {
return _cachedComponent;
}
var VBase = Vue.extend({
computed: {
refs: function refs() {
var oldVval = this._vval;
this._vval = this.children;
(0, _vval.patchChildren)(oldVval, this._vval);
var refs = {};
this._vval.forEach(function (c) {
refs[c.key] = c.vm;
});
return refs;
}
},
beforeCreate: function beforeCreate() {
this._vval = null;
},
beforeDestroy: function beforeDestroy() {
if (this._vval) {
(0, _vval.patchChildren)(this._vval);
this._vval = null;
}
},
methods: {
getModel: function getModel() {
return this.lazyModel ? this.lazyModel(this.prop) : this.model;
},
getModelKey: function getModelKey(key) {
var model = this.getModel();
if (model) {
return model[key];
}
},
hasIter: function hasIter() {
return false;
}
}
});
var ValidationRule = VBase.extend({
data: function data() {
return {
rule: null,
lazyModel: null,
model: null,
lazyParentModel: null,
rootModel: null
};
},
methods: {
runRule: function runRule(parent) {
var model = this.getModel();
(0, _params.pushParams)();
var rawOutput = this.rule.call(this.rootModel, model, parent);
var output = isPromise(rawOutput) ? makePendingAsyncVm(Vue, rawOutput) : rawOutput;
var rawParams = (0, _params.popParams)();
var params = rawParams && rawParams.$sub ? rawParams.$sub.length > 1 ? rawParams : rawParams.$sub[0] : null;
return {
output: output,
params: params
};
}
},
computed: {
run: function run() {
var _this6 = this;
var parent = this.lazyParentModel();
var isArrayDependant = Array.isArray(parent) && parent.__ob__;
if (isArrayDependant) {
var arrayDep = parent.__ob__.dep;
arrayDep.depend();
var target = arrayDep.constructor.target;
if (!this._indirectWatcher) {
var Watcher = target.constructor;
this._indirectWatcher = new Watcher(this, function () {
return _this6.runRule(parent);
}, null, {
lazy: true
});
}
var model = this.getModel();
if (!this._indirectWatcher.dirty && this._lastModel === model) {
this._indirectWatcher.depend();
return target.value;
}
this._lastModel = model;
this._indirectWatcher.evaluate();
this._indirectWatcher.depend();
} else if (this._indirectWatcher) {
this._indirectWatcher.teardown();
this._indirectWatcher = null;
}
return this._indirectWatcher ? this._indirectWatcher.value : this.runRule(parent);
},
$params: function $params() {
return this.run.params;
},
proxy: function proxy() {
var output = this.run.output;
if (output[__isVuelidateAsyncVm]) {
return !!output.v;
}
return !!output;
},
$pending: function $pending() {
var output = this.run.output;
if (output[__isVuelidateAsyncVm]) {
return output.p;
}
return false;
}
},
destroyed: function destroyed() {
if (this._indirectWatcher) {
this._indirectWatcher.teardown();
this._indirectWatcher = null;
}
}
});
var Validation = VBase.extend({
data: function data() {
return {
dirty: false,
validations: null,
lazyModel: null,
model: null,
prop: null,
lazyParentModel: null,
rootModel: null
};
},
methods: _objectSpread({}, validationMethods, {
refProxy: function refProxy(key) {
return this.getRef(key).proxy;
},
getRef: function getRef(key) {
return this.refs[key];
},
isNested: function isNested(key) {
return typeof this.validations[key] !== 'function';
}
}),
computed: _objectSpread({}, validationGetters, {
nestedKeys: function nestedKeys() {
return this.keys.filter(this.isNested);
},
ruleKeys: function ruleKeys() {
var _this7 = this;
return this.keys.filter(function (k) {
return !_this7.isNested(k);
});
},
keys: function keys() {
return Object.keys(this.validations).filter(function (k) {
return k !== '$params';
});
},
proxy: function proxy() {
var _this8 = this;
var keyDefs = buildFromKeys(this.keys, function (key) {
return {
enumerable: true,
configurable: true,
get: function get() {
return _this8.refProxy(key);
}
};
});
var getterDefs = buildFromKeys(getterNames, function (key) {
return {
enumerable: true,
configurable: true,
get: function get() {
return _this8[key];
}
};
});
var methodDefs = buildFromKeys(methodNames, function (key) {
return {
enumerable: false,
configurable: true,
get: function get() {
return _this8[key];
}
};
});
var iterDefs = this.hasIter() ? {
$iter: {
enumerable: true,
value: Object.defineProperties({}, _objectSpread({}, keyDefs))
}
} : {};
return Object.defineProperties({}, _objectSpread({}, keyDefs, iterDefs, {
$model: {
enumerable: true,
get: function get() {
var parent = _this8.lazyParentModel();
if (parent != null) {
return parent[_this8.prop];
} else {
return null;
}
},
set: function set(value) {
var parent = _this8.lazyParentModel();
if (parent != null) {
parent[_this8.prop] = value;
_this8.$touch();
}
}
}
}, getterDefs, methodDefs));
},
children: function children() {
var _this9 = this;
return _toConsumableArray(this.nestedKeys.map(function (key) {
return renderNested(_this9, key);
})).concat(_toConsumableArray(this.ruleKeys.map(function (key) {
return renderRule(_this9, key);
}))).filter(Boolean);
}
})
});
var GroupValidation = Validation.extend({
methods: {
isNested: function isNested(key) {
return typeof this.validations[key]() !== 'undefined';
},
getRef: function getRef(key) {
var vm = this;
return {
get proxy() {
return vm.validations[key]() || false;
}
};
}
}
});
var EachValidation = Validation.extend({
computed: {
keys: function keys() {
var model = this.getModel();
if (isObject(model)) {
return Object.keys(model);
} else {
return [];
}
},
tracker: function tracker() {
var _this10 = this;
var trackBy = this.validations.$trackBy;
return trackBy ? function (key) {
return "".concat(getPath(_this10.rootModel, _this10.getModelKey(key), trackBy));
} : function (x) {
return "".concat(x);
};
},
getModelLazy: function getModelLazy() {
var _this11 = this;
return function () {
return _this11.getModel();
};
},
children: function children() {
var _this12 = this;
var def = this.validations;
var model = this.getModel();
var validations = _objectSpread({}, def);
delete validations['$trackBy'];
var usedTracks = {};
return this.keys.map(function (key) {
var track = _this12.tracker(key);
if (usedTracks.hasOwnProperty(track)) {
return null;
}
usedTracks[track] = true;
return (0, _vval.h)(Validation, track, {
validations: validations,
prop: key,
lazyParentModel: _this12.getModelLazy,
model: model[key],
rootModel: _this12.rootModel
});
}).filter(Boolean);
}
},
methods: {
isNested: function isNested() {
return true;
},
getRef: function getRef(key) {
return this.refs[this.tracker(key)];
},
hasIter: function hasIter() {
return true;
}
}
});
var renderNested = function renderNested(vm, key) {
if (key === '$each') {
return (0, _vval.h)(EachValidation, key, {
validations: vm.validations[key],
lazyParentModel: vm.lazyParentModel,
prop: key,
lazyModel: vm.getModel,
rootModel: vm.rootModel
});
}
var validations = vm.validations[key];
if (Array.isArray(validations)) {
var root = vm.rootModel;
var refVals = buildFromKeys(validations, function (path) {
return function () {
return getPath(root, root.$v, path);
};
}, function (v) {
return Array.isArray(v) ? v.join('.') : v;
});
return (0, _vval.h)(GroupValidation, key, {
validations: refVals,
lazyParentModel: NIL,
prop: key,
lazyModel: NIL,
rootModel: root
});
}
return (0, _vval.h)(Validation, key, {
validations: validations,
lazyParentModel: vm.getModel,
prop: key,
lazyModel: vm.getModelKey,
rootModel: vm.rootModel
});
};
var renderRule = function renderRule(vm, key) {
return (0, _vval.h)(ValidationRule, key, {
rule: vm.validations[key],
lazyParentModel: vm.lazyParentModel,
lazyModel: vm.getModel,
rootModel: vm.rootModel
});
};
_cachedComponent = {
VBase: VBase,
Validation: Validation
};
return _cachedComponent;
};
var _cachedVue = null;
function getVue(rootVm) {
if (_cachedVue) return _cachedVue;
var Vue = rootVm.constructor;
while (Vue.super) {
Vue = Vue.super;
}
_cachedVue = Vue;
return Vue;
}
var validateModel = function validateModel(model, validations) {
var Vue = getVue(model);
var _getComponent = getComponent(Vue),
Validation = _getComponent.Validation,
VBase = _getComponent.VBase;
var root = new VBase({
computed: {
children: function children() {
var vals = typeof validations === 'function' ? validations.call(model) : validations;
return [(0, _vval.h)(Validation, '$v', {
validations: vals,
lazyParentModel: NIL,
prop: '$v',
model: model,
rootModel: model
})];
}
}
});
return root;
};
var validationMixin = {
data: function data() {
var vals = this.$options.validations;
if (vals) {
this._vuelidate = validateModel(this, vals);
}
return {};
},
beforeCreate: function beforeCreate() {
var options = this.$options;
var vals = options.validations;
if (!vals) return;
if (!options.computed) options.computed = {};
if (options.computed.$v) return;
options.computed.$v = function () {
return this._vuelidate ? this._vuelidate.refs.$v.proxy : null;
};
},
beforeDestroy: function beforeDestroy() {
if (this._vuelidate) {
this._vuelidate.$destroy();
this._vuelidate = null;
}
}
};
exports.validationMixin = validationMixin;
function Vuelidate(Vue) {
Vue.mixin(validationMixin);
}
var _default = Vuelidate;
exports.default = _default;
/***/ }),
/***/ "1ec9":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("f772");
var document = __webpack_require__("e53d").document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/***/ "230e":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("d3f4");
var document = __webpack_require__("7726").document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/***/ "2350":
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/***/ "2621":
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/***/ "294c":
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/***/ "2a12":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _common = __webpack_require__("78ef");
var _default = function _default(length) {
return (0, _common.withParams)({
type: 'maxLength',
max: length
}, function (value) {
return !(0, _common.req)(value) || (0, _common.len)(value) <= length;
});
};
exports.default = _default;
/***/ }),
/***/ "2aba":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("7726");
var hide = __webpack_require__("32e9");
var has = __webpack_require__("69a8");
var SRC = __webpack_require__("ca5a")('src');
var $toString = __webpack_require__("fa5b");
var TO_STRING = 'toString';
var TPL = ('' + $toString).split(TO_STRING);
__webpack_require__("8378").inspectSource = function (it) {
return $toString.call(it);
};
(module.exports = function (O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) has(val, 'name') || hide(val, 'name', key);
if (O[key] === val) return;
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if (O === global) {
O[key] = val;
} else if (!safe) {
delete O[key];
hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
/***/ }),
/***/ "2aeb":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__("cb7c");
var dPs = __webpack_require__("1495");
var enumBugKeys = __webpack_require__("e11e");
var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__("230e")('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__("fab2").appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/***/ "2b4c":
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__("5537")('wks');
var uid = __webpack_require__("ca5a");
var Symbol = __webpack_require__("7726").Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/***/ "2d00":
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/***/ "2d95":
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/***/ "2f62":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export Store */
/* unused harmony export install */
/* unused harmony export mapState */
/* unused harmony export mapMutations */
/* unused harmony export mapGetters */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return mapActions; });
/* unused harmony export createNamespacedHelpers */
/**
* vuex v3.1.1
* (c) 2019 Evan You
* @license MIT
*/
function applyMixin (Vue) {
var version = Number(Vue.version.split('.')[0]);
if (version >= 2) {
Vue.mixin({ beforeCreate: vuexInit });
} else {
// override init and inject vuex init procedure
// for 1.x backwards compatibility.
var _init = Vue.prototype._init;
Vue.prototype._init = function (options) {
if ( options === void 0 ) options = {};
options.init = options.init
? [vuexInit].concat(options.init)
: vuexInit;
_init.call(this, options);
};
}
/**
* Vuex init hook, injected into each instances init hooks list.
*/
function vuexInit () {
var options = this.$options;
// store injection
if (options.store) {
this.$store = typeof options.store === 'function'
? options.store()
: options.store;
} else if (options.parent && options.parent.$store) {
this.$store = options.parent.$store;
}
}
}
var target = typeof window !== 'undefined'
? window
: typeof global !== 'undefined'
? global
: {};
var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
function devtoolPlugin (store) {
if (!devtoolHook) { return }
store._devtoolHook = devtoolHook;
devtoolHook.emit('vuex:init', store);
devtoolHook.on('vuex:travel-to-state', function (targetState) {
store.replaceState(targetState);
});
store.subscribe(function (mutation, state) {
devtoolHook.emit('vuex:mutation', mutation, state);
});
}
/**
* Get the first item that pass the test
* by second argument function
*
* @param {Array} list
* @param {Function} f
* @return {*}
*/
/**
* forEach for object
*/
function forEachValue (obj, fn) {
Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
}
function isObject (obj) {
return obj !== null && typeof obj === 'object'
}
function isPromise (val) {
return val && typeof val.then === 'function'
}
function assert (condition, msg) {
if (!condition) { throw new Error(("[vuex] " + msg)) }
}
function partial (fn, arg) {
return function () {
return fn(arg)
}
}
// Base data struct for store's module, package with some attribute and method
var Module = function Module (rawModule, runtime) {
this.runtime = runtime;
// Store some children item
this._children = Object.create(null);
// Store the origin module object which passed by programmer
this._rawModule = rawModule;
var rawState = rawModule.state;
// Store the origin module's state
this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
};
var prototypeAccessors = { namespaced: { configurable: true } };
prototypeAccessors.namespaced.get = function () {
return !!this._rawModule.namespaced
};
Module.prototype.addChild = function addChild (key, module) {
this._children[key] = module;
};
Module.prototype.removeChild = function removeChild (key) {
delete this._children[key];
};
Module.prototype.getChild = function getChild (key) {
return this._children[key]
};
Module.prototype.update = function update (rawModule) {
this._rawModule.namespaced = rawModule.namespaced;
if (rawModule.actions) {
this._rawModule.actions = rawModule.actions;
}
if (rawModule.mutations) {
this._rawModule.mutations = rawModule.mutations;
}
if (rawModule.getters) {
this._rawModule.getters = rawModule.getters;
}
};
Module.prototype.forEachChild = function forEachChild (fn) {
forEachValue(this._children, fn);
};
Module.prototype.forEachGetter = function forEachGetter (fn) {
if (this._rawModule.getters) {
forEachValue(this._rawModule.getters, fn);
}
};
Module.prototype.forEachAction = function forEachAction (fn) {
if (this._rawModule.actions) {
forEachValue(this._rawModule.actions, fn);
}
};
Module.prototype.forEachMutation = function forEachMutation (fn) {
if (this._rawModule.mutations) {
forEachValue(this._rawModule.mutations, fn);
}
};
Object.defineProperties( Module.prototype, prototypeAccessors );
var ModuleCollection = function ModuleCollection (rawRootModule) {
// register root module (Vuex.Store options)
this.register([], rawRootModule, false);
};
ModuleCollection.prototype.get = function get (path) {
return path.reduce(function (module, key) {
return module.getChild(key)
}, this.root)
};
ModuleCollection.prototype.getNamespace = function getNamespace (path) {
var module = this.root;
return path.reduce(function (namespace, key) {
module = module.getChild(key);
return namespace + (module.namespaced ? key + '/' : '')
}, '')
};
ModuleCollection.prototype.update = function update$1 (rawRootModule) {
update([], this.root, rawRootModule);
};
ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
var this$1 = this;
if ( runtime === void 0 ) runtime = true;
if (false) {}
var newModule = new Module(rawModule, runtime);
if (path.length === 0) {
this.root = newModule;
} else {
var parent = this.get(path.slice(0, -1));
parent.addChild(path[path.length - 1], newModule);
}
// register nested modules
if (rawModule.modules) {
forEachValue(rawModule.modules, function (rawChildModule, key) {
this$1.register(path.concat(key), rawChildModule, runtime);
});
}
};
ModuleCollection.prototype.unregister = function unregister (path) {
var parent = this.get(path.slice(0, -1));
var key = path[path.length - 1];
if (!parent.getChild(key).runtime) { return }
parent.removeChild(key);
};
function update (path, targetModule, newModule) {
if (false) {}
// update target module
targetModule.update(newModule);
// update nested modules
if (newModule.modules) {
for (var key in newModule.modules) {
if (!targetModule.getChild(key)) {
if (false) {}
return
}
update(
path.concat(key),
targetModule.getChild(key),
newModule.modules[key]
);
}
}
}
var functionAssert = {
assert: function (value) { return typeof value === 'function'; },
expected: 'function'
};
var objectAssert = {
assert: function (value) { return typeof value === 'function' ||
(typeof value === 'object' && typeof value.handler === 'function'); },
expected: 'function or object with "handler" function'
};
var assertTypes = {
getters: functionAssert,
mutations: functionAssert,
actions: objectAssert
};
function assertRawModule (path, rawModule) {
Object.keys(assertTypes).forEach(function (key) {
if (!rawModule[key]) { return }
var assertOptions = assertTypes[key];
forEachValue(rawModule[key], function (value, type) {
assert(
assertOptions.assert(value),
makeAssertionMessage(path, key, type, value, assertOptions.expected)
);
});
});
}
function makeAssertionMessage (path, key, type, value, expected) {
var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
if (path.length > 0) {
buf += " in module \"" + (path.join('.')) + "\"";
}
buf += " is " + (JSON.stringify(value)) + ".";
return buf
}
var Vue; // bind on install
var Store = function Store (options) {
var this$1 = this;
if ( options === void 0 ) options = {};
// Auto install if it is not done yet and `window` has `Vue`.
// To allow users to avoid auto-installation in some cases,
// this code should be placed here. See #731
if (!Vue && typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}
if (false) {}
var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
var strict = options.strict; if ( strict === void 0 ) strict = false;
// store internal state
this._committing = false;
this._actions = Object.create(null);
this._actionSubscribers = [];
this._mutations = Object.create(null);
this._wrappedGetters = Object.create(null);
this._modules = new ModuleCollection(options);
this._modulesNamespaceMap = Object.create(null);
this._subscribers = [];
this._watcherVM = new Vue();
// bind commit and dispatch to self
var store = this;
var ref = this;
var dispatch = ref.dispatch;
var commit = ref.commit;
this.dispatch = function boundDispatch (type, payload) {
return dispatch.call(store, type, payload)
};
this.commit = function boundCommit (type, payload, options) {
return commit.call(store, type, payload, options)
};
// strict mode
this.strict = strict;
var state = this._modules.root.state;
// init root module.
// this also recursively registers all sub-modules
// and collects all module getters inside this._wrappedGetters
installModule(this, state, [], this._modules.root);
// initialize the store vm, which is responsible for the reactivity
// (also registers _wrappedGetters as computed properties)
resetStoreVM(this, state);
// apply plugins
plugins.forEach(function (plugin) { return plugin(this$1); });
var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
if (useDevtools) {
devtoolPlugin(this);
}
};
var prototypeAccessors$1 = { state: { configurable: true } };
prototypeAccessors$1.state.get = function () {
return this._vm._data.$$state
};
prototypeAccessors$1.state.set = function (v) {
if (false) {}
};
Store.prototype.commit = function commit (_type, _payload, _options) {
var this$1 = this;
// check object-style commit
var ref = unifyObjectStyle(_type, _payload, _options);
var type = ref.type;
var payload = ref.payload;
var options = ref.options;
var mutation = { type: type, payload: payload };
var entry = this._mutations[type];
if (!entry) {
if (false) {}
return
}
this._withCommit(function () {
entry.forEach(function commitIterator (handler) {
handler(payload);
});
});
this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
if (
false
) {}
};
Store.prototype.dispatch = function dispatch (_type, _payload) {
var this$1 = this;
// check object-style dispatch
var ref = unifyObjectStyle(_type, _payload);
var type = ref.type;
var payload = ref.payload;
var action = { type: type, payload: payload };
var entry = this._actions[type];
if (!entry) {
if (false) {}
return
}
try {
this._actionSubscribers
.filter(function (sub) { return sub.before; })
.forEach(function (sub) { return sub.before(action, this$1.state); });
} catch (e) {
if (false) {}
}
var result = entry.length > 1
? Promise.all(entry.map(function (handler) { return handler(payload); }))
: entry[0](payload);
return result.then(function (res) {
try {
this$1._actionSubscribers
.filter(function (sub) { return sub.after; })
.forEach(function (sub) { return sub.after(action, this$1.state); });
} catch (e) {
if (false) {}
}
return res
})
};
Store.prototype.subscribe = function subscribe (fn) {
return genericSubscribe(fn, this._subscribers)
};
Store.prototype.subscribeAction = function subscribeAction (fn) {
var subs = typeof fn === 'function' ? { before: fn } : fn;
return genericSubscribe(subs, this._actionSubscribers)
};
Store.prototype.watch = function watch (getter, cb, options) {
var this$1 = this;
if (false) {}
return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
};
Store.prototype.replaceState = function replaceState (state) {
var this$1 = this;
this._withCommit(function () {
this$1._vm._data.$$state = state;
});
};
Store.prototype.registerModule = function registerModule (path, rawModule, options) {
if ( options === void 0 ) options = {