vue3-treeselect
Version:
Tree select hierarchical component for vue 3 (next)
8,475 lines • 267 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("vue"));
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["vue3-treeselect"] = factory(require("vue"));
else
root["vue3-treeselect"] = factory(root["Vue"]);
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {
return /******/ (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");
/******/ })
/************************************************************************/
/******/ ({
/***/ "00ee":
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__("b622");
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};
test[TO_STRING_TAG] = 'z';
module.exports = String(test) === '[object z]';
/***/ }),
/***/ "00fd":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("9e69");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ }),
/***/ "0366":
/***/ (function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__("1c0b");
// optional / simple context binding
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 0: return function () {
return fn.call(that);
};
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/***/ "0481":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var flattenIntoArray = __webpack_require__("a2bf");
var toObject = __webpack_require__("7b0b");
var toLength = __webpack_require__("50c4");
var toInteger = __webpack_require__("a691");
var arraySpeciesCreate = __webpack_require__("65f0");
// `Array.prototype.flat` method
// https://tc39.es/ecma262/#sec-array.prototype.flat
$({ target: 'Array', proto: true }, {
flat: function flat(/* depthArg = 1 */) {
var depthArg = arguments.length ? arguments[0] : undefined;
var O = toObject(this);
var sourceLen = toLength(O.length);
var A = arraySpeciesCreate(O, 0);
A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
return A;
}
});
/***/ }),
/***/ "06cf":
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__("83ab");
var propertyIsEnumerableModule = __webpack_require__("d1e7");
var createPropertyDescriptor = __webpack_require__("5c6c");
var toIndexedObject = __webpack_require__("fc6a");
var toPrimitive = __webpack_require__("c04e");
var has = __webpack_require__("5135");
var IE8_DOM_DEFINE = __webpack_require__("0cfb");
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// `Object.getOwnPropertyDescriptor` method
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return nativeGetOwnPropertyDescriptor(O, P);
} catch (error) { /* empty */ }
if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
};
/***/ }),
/***/ "0cb2":
/***/ (function(module, exports, __webpack_require__) {
var toObject = __webpack_require__("7b0b");
var floor = Math.floor;
var replace = ''.replace;
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
// https://tc39.es/ecma262/#sec-getsubstitution
module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return replace.call(replacement, symbols, function (match, ch) {
var capture;
switch (ch.charAt(0)) {
case '$': return '$';
case '&': return matched;
case '`': return str.slice(0, position);
case "'": return str.slice(tailPos);
case '<':
capture = namedCaptures[ch.slice(1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
};
/***/ }),
/***/ "0cfb":
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__("83ab");
var fails = __webpack_require__("d039");
var createElement = __webpack_require__("cc12");
// Thank's IE8 for his funny defineProperty
module.exports = !DESCRIPTORS && !fails(function () {
return Object.defineProperty(createElement('div'), 'a', {
get: function () { return 7; }
}).a != 7;
});
/***/ }),
/***/ "1276":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
var isRegExp = __webpack_require__("44e7");
var anObject = __webpack_require__("825a");
var requireObjectCoercible = __webpack_require__("1d80");
var speciesConstructor = __webpack_require__("4840");
var advanceStringIndex = __webpack_require__("8aa5");
var toLength = __webpack_require__("50c4");
var callRegExpExec = __webpack_require__("14c3");
var regexpExec = __webpack_require__("9263");
var fails = __webpack_require__("d039");
var arrayPush = [].push;
var min = Math.min;
var MAX_UINT32 = 0xFFFFFFFF;
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
// @@split logic
fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
var internalSplit;
if (
'abbc'.split(/(b)*/)[1] == 'c' ||
'test'.split(/(?:)/, -1).length != 4 ||
'ab'.split(/(?:ab)*/).length != 2 ||
'.'.split(/(.?)(.?)/).length != 4 ||
'.'.split(/()()/).length > 1 ||
''.split(/.?/).length
) {
// based on es5-shim implementation, need to rework it
internalSplit = function (separator, limit) {
var string = String(requireObjectCoercible(this));
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
if (lim === 0) return [];
if (separator === undefined) return [string];
// If `separator` is not a regex, use native split
if (!isRegExp(separator)) {
return nativeSplit.call(string, separator, lim);
}
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') +
(separator.sticky ? 'y' : '');
var lastLastIndex = 0;
// Make `global` and avoid `lastIndex` issues by working with a copy
var separatorCopy = new RegExp(separator.source, flags + 'g');
var match, lastIndex, lastLength;
while (match = regexpExec.call(separatorCopy, string)) {
lastIndex = separatorCopy.lastIndex;
if (lastIndex > lastLastIndex) {
output.push(string.slice(lastLastIndex, match.index));
if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= lim) break;
}
if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
}
if (lastLastIndex === string.length) {
if (lastLength || !separatorCopy.test('')) output.push('');
} else output.push(string.slice(lastLastIndex));
return output.length > lim ? output.slice(0, lim) : output;
};
// Chakra, V8
} else if ('0'.split(undefined, 0).length) {
internalSplit = function (separator, limit) {
return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
};
} else internalSplit = nativeSplit;
return [
// `String.prototype.split` method
// https://tc39.es/ecma262/#sec-string.prototype.split
function split(separator, limit) {
var O = requireObjectCoercible(this);
var splitter = separator == undefined ? undefined : separator[SPLIT];
return splitter !== undefined
? splitter.call(separator, O, limit)
: internalSplit.call(String(O), separator, limit);
},
// `RegExp.prototype[@@split]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
//
// NOTE: This cannot be properly polyfilled in engines that don't support
// the 'y' flag.
function (regexp, limit) {
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var C = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? 'i' : '') +
(rx.multiline ? 'm' : '') +
(rx.unicode ? 'u' : '') +
(SUPPORTS_Y ? 'y' : 'g');
// ^(? + rx + ) is needed, in combination with some S slicing, to
// simulate the 'y' flag.
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
if (lim === 0) return [];
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
var p = 0;
var q = 0;
var A = [];
while (q < S.length) {
splitter.lastIndex = SUPPORTS_Y ? q : 0;
var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
var e;
if (
z === null ||
(e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
) {
q = advanceStringIndex(S, q, unicodeMatching);
} else {
A.push(S.slice(p, q));
if (A.length === lim) return A;
for (var i = 1; i <= z.length - 1; i++) {
A.push(z[i]);
if (A.length === lim) return A;
}
q = p = e;
}
}
A.push(S.slice(p));
return A;
}
];
}, !SUPPORTS_Y);
/***/ }),
/***/ "1310":
/***/ (function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ }),
/***/ "13d5":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var $reduce = __webpack_require__("d58f").left;
var arrayMethodIsStrict = __webpack_require__("a640");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var CHROME_VERSION = __webpack_require__("2d00");
var IS_NODE = __webpack_require__("605d");
var STRICT_METHOD = arrayMethodIsStrict('reduce');
var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
// Chrome 80-82 has a critical bug
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
// `Array.prototype.reduce` method
// https://tc39.es/ecma262/#sec-array.prototype.reduce
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {
reduce: function reduce(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "14c3":
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__("c6b6");
var regexpExec = __webpack_require__("9263");
// `RegExpExec` abstract operation
// https://tc39.es/ecma262/#sec-regexpexec
module.exports = function (R, S) {
var exec = R.exec;
if (typeof exec === 'function') {
var result = exec.call(R, S);
if (typeof result !== 'object') {
throw TypeError('RegExp exec method returned something other than an Object or null');
}
return result;
}
if (classof(R) !== 'RegExp') {
throw TypeError('RegExp#exec called on incompatible receiver');
}
return regexpExec.call(R, S);
};
/***/ }),
/***/ "159b":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var DOMIterables = __webpack_require__("fdbc");
var forEach = __webpack_require__("17c2");
var createNonEnumerableProperty = __webpack_require__("9112");
for (var COLLECTION_NAME in DOMIterables) {
var Collection = global[COLLECTION_NAME];
var CollectionPrototype = Collection && Collection.prototype;
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
} catch (error) {
CollectionPrototype.forEach = forEach;
}
}
/***/ }),
/***/ "17c2":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $forEach = __webpack_require__("b727").forEach;
var arrayMethodIsStrict = __webpack_require__("a640");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var STRICT_METHOD = arrayMethodIsStrict('forEach');
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
// `Array.prototype.forEach` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.foreach
module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
} : [].forEach;
/***/ }),
/***/ "1a8c":
/***/ (function(module, exports) {
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ }),
/***/ "1be4":
/***/ (function(module, exports, __webpack_require__) {
var getBuiltIn = __webpack_require__("d066");
module.exports = getBuiltIn('document', 'documentElement');
/***/ }),
/***/ "1c0b":
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') {
throw TypeError(String(it) + ' is not a function');
} return it;
};
/***/ }),
/***/ "1d80":
/***/ (function(module, exports) {
// `RequireObjectCoercible` abstract operation
// https://tc39.es/ecma262/#sec-requireobjectcoercible
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/***/ "1d92":
/***/ (function(module, exports, __webpack_require__) {
var before = __webpack_require__("e0ef");
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first invocation. The `func` is
* invoked with the `this` binding and arguments of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // => `createApplication` is invoked once
*/
function once(func) {
return before(2, func);
}
module.exports = once;
/***/ }),
/***/ "1dde":
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__("d039");
var wellKnownSymbol = __webpack_require__("b622");
var V8_VERSION = __webpack_require__("2d00");
var SPECIES = wellKnownSymbol('species');
module.exports = function (METHOD_NAME) {
// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/677
return V8_VERSION >= 51 || !fails(function () {
var array = [];
var constructor = array.constructor = {};
constructor[SPECIES] = function () {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};
/***/ }),
/***/ "23cb":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("a691");
var max = Math.max;
var min = Math.min;
// Helper for a popular repeating case of the spec:
// Let integer be ? ToInteger(index).
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
module.exports = function (index, length) {
var integer = toInteger(index);
return integer < 0 ? max(integer + length, 0) : min(integer, length);
};
/***/ }),
/***/ "23e7":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
var createNonEnumerableProperty = __webpack_require__("9112");
var redefine = __webpack_require__("6eeb");
var setGlobal = __webpack_require__("ce4e");
var copyConstructorProperties = __webpack_require__("e893");
var isForced = __webpack_require__("94ca");
/*
options.target - name of the target object
options.global - target is the global object
options.stat - export as static methods of target
options.proto - export as prototype methods of target
options.real - real prototype method for the `pure` version
options.forced - export even if the native feature is available
options.bind - bind methods to the target, required for the `pure` version
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
options.unsafe - use the simple assignment of property instead of delete + defineProperty
options.sham - add a flag to not completely full polyfills
options.enumerable - export as enumerable property
options.noTargetGet - prevent calling a getter on target
*/
module.exports = function (options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target = global;
} else if (STATIC) {
target = global[TARGET] || setGlobal(TARGET, {});
} else {
target = (global[TARGET] || {}).prototype;
}
if (target) for (key in source) {
sourceProperty = source[key];
if (options.noTargetGet) {
descriptor = getOwnPropertyDescriptor(target, key);
targetProperty = descriptor && descriptor.value;
} else targetProperty = target[key];
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
// contained in target
if (!FORCED && targetProperty !== undefined) {
if (typeof sourceProperty === typeof targetProperty) continue;
copyConstructorProperties(sourceProperty, targetProperty);
}
// add a flag to not completely full polyfills
if (options.sham || (targetProperty && targetProperty.sham)) {
createNonEnumerableProperty(sourceProperty, 'sham', true);
}
// extend global
redefine(target, key, sourceProperty, options);
}
};
/***/ }),
/***/ "241c":
/***/ (function(module, exports, __webpack_require__) {
var internalObjectKeys = __webpack_require__("ca84");
var enumBugKeys = __webpack_require__("7839");
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
// `Object.getOwnPropertyNames` method
// https://tc39.es/ecma262/#sec-object.getownpropertynames
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return internalObjectKeys(O, hiddenKeys);
};
/***/ }),
/***/ "25f0":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var redefine = __webpack_require__("6eeb");
var anObject = __webpack_require__("825a");
var fails = __webpack_require__("d039");
var flags = __webpack_require__("ad6d");
var TO_STRING = 'toString';
var RegExpPrototype = RegExp.prototype;
var nativeToString = RegExpPrototype[TO_STRING];
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
// FF44- RegExp#toString has a wrong name
var INCORRECT_NAME = nativeToString.name != TO_STRING;
// `RegExp.prototype.toString` method
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
if (NOT_GENERIC || INCORRECT_NAME) {
redefine(RegExp.prototype, TO_STRING, function toString() {
var R = anObject(this);
var p = String(R.source);
var rf = R.flags;
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
return '/' + p + '/' + f;
}, { unsafe: true });
}
/***/ }),
/***/ "2655":
/***/ (function(module, exports) {
module.exports = isPromise;
module.exports.default = isPromise;
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
/***/ }),
/***/ "29f3":
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
/***/ }),
/***/ "2b3e":
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__("585a");
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/***/ "2d00":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var userAgent = __webpack_require__("342f");
var process = global.process;
var versions = process && process.versions;
var v8 = versions && versions.v8;
var match, version;
if (v8) {
match = v8.split('.');
version = match[0] + match[1];
} else if (userAgent) {
match = userAgent.match(/Edge\/(\d+)/);
if (!match || match[1] >= 74) {
match = userAgent.match(/Chrome\/(\d+)/);
if (match) version = match[1];
}
}
module.exports = version && +version;
/***/ }),
/***/ "2e39":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function fuzzysearch (needle, haystack) {
var tlen = haystack.length;
var qlen = needle.length;
if (qlen > tlen) {
return false;
}
if (qlen === tlen) {
return needle === haystack;
}
outer: for (var i = 0, j = 0; i < qlen; i++) {
var nch = needle.charCodeAt(i);
while (j < tlen) {
if (haystack.charCodeAt(j++) === nch) {
continue outer;
}
}
return false;
}
return true;
}
module.exports = fuzzysearch;
/***/ }),
/***/ "3410":
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__("23e7");
var fails = __webpack_require__("d039");
var toObject = __webpack_require__("7b0b");
var nativeGetPrototypeOf = __webpack_require__("e163");
var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
// `Object.getPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.getprototypeof
$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
getPrototypeOf: function getPrototypeOf(it) {
return nativeGetPrototypeOf(toObject(it));
}
});
/***/ }),
/***/ "342f":
/***/ (function(module, exports, __webpack_require__) {
var getBuiltIn = __webpack_require__("d066");
module.exports = getBuiltIn('navigator', 'userAgent') || '';
/***/ }),
/***/ "3729":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("9e69"),
getRawTag = __webpack_require__("00fd"),
objectToString = __webpack_require__("29f3");
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/***/ "37e8":
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__("83ab");
var definePropertyModule = __webpack_require__("9bf2");
var anObject = __webpack_require__("825a");
var objectKeys = __webpack_require__("df75");
// `Object.defineProperties` method
// https://tc39.es/ecma262/#sec-object.defineproperties
module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = objectKeys(Properties);
var length = keys.length;
var index = 0;
var key;
while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
return O;
};
/***/ }),
/***/ "3bbe":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("861d");
module.exports = function (it) {
if (!isObject(it) && it !== null) {
throw TypeError("Can't set " + String(it) + ' as a prototype');
} return it;
};
/***/ }),
/***/ "4069":
/***/ (function(module, exports, __webpack_require__) {
// this method was added to unscopables after implementation
// in popular engines, so it's moved to a separate module
var addToUnscopables = __webpack_require__("44d2");
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('flat');
/***/ }),
/***/ "408c":
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__("2b3e");
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = function() {
return root.Date.now();
};
module.exports = now;
/***/ }),
/***/ "4160":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var forEach = __webpack_require__("17c2");
// `Array.prototype.forEach` method
// https://tc39.es/ecma262/#sec-array.prototype.foreach
$({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
forEach: forEach
});
/***/ }),
/***/ "428f":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
module.exports = global;
/***/ }),
/***/ "4416":
/***/ (function(module, exports) {
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
module.exports = last;
/***/ }),
/***/ "44ad":
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__("d039");
var classof = __webpack_require__("c6b6");
var split = ''.split;
// fallback for non-array-like ES3 and non-enumerable old V8 strings
module.exports = fails(function () {
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
// eslint-disable-next-line no-prototype-builtins
return !Object('z').propertyIsEnumerable(0);
}) ? function (it) {
return classof(it) == 'String' ? split.call(it, '') : Object(it);
} : Object;
/***/ }),
/***/ "44d2":
/***/ (function(module, exports, __webpack_require__) {
var wellKnownSymbol = __webpack_require__("b622");
var create = __webpack_require__("7c73");
var definePropertyModule = __webpack_require__("9bf2");
var UNSCOPABLES = wellKnownSymbol('unscopables');
var ArrayPrototype = Array.prototype;
// Array.prototype[@@unscopables]
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype[UNSCOPABLES] == undefined) {
definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create(null)
});
}
// add a key to Array.prototype[@@unscopables]
module.exports = function (key) {
ArrayPrototype[UNSCOPABLES][key] = true;
};
/***/ }),
/***/ "44e7":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("861d");
var classof = __webpack_require__("c6b6");
var wellKnownSymbol = __webpack_require__("b622");
var MATCH = wellKnownSymbol('match');
// `IsRegExp` abstract operation
// https://tc39.es/ecma262/#sec-isregexp
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
};
/***/ }),
/***/ "45fc":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var $some = __webpack_require__("b727").some;
var arrayMethodIsStrict = __webpack_require__("a640");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var STRICT_METHOD = arrayMethodIsStrict('some');
var USES_TO_LENGTH = arrayMethodUsesToLength('some');
// `Array.prototype.some` method
// https://tc39.es/ecma262/#sec-array.prototype.some
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
some: function some(callbackfn /* , thisArg */) {
return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "4840":
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__("825a");
var aFunction = __webpack_require__("1c0b");
var wellKnownSymbol = __webpack_require__("b622");
var SPECIES = wellKnownSymbol('species');
// `SpeciesConstructor` abstract operation
// https://tc39.es/ecma262/#sec-speciesconstructor
module.exports = function (O, defaultConstructor) {
var C = anObject(O).constructor;
var S;
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
};
/***/ }),
/***/ "4930":
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__("d039");
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
// Chrome 38 Symbol has incorrect toString conversion
// eslint-disable-next-line no-undef
return !String(Symbol());
});
/***/ }),
/***/ "498a":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var $trim = __webpack_require__("58a8").trim;
var forcedStringTrimMethod = __webpack_require__("c8d2");
// `String.prototype.trim` method
// https://tc39.es/ecma262/#sec-string.prototype.trim
$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
trim: function trim() {
return $trim(this);
}
});
/***/ }),
/***/ "4b17":
/***/ (function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__("6428");
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
module.exports = toInteger;
/***/ }),
/***/ "4d64":
/***/ (function(module, exports, __webpack_require__) {
var toIndexedObject = __webpack_require__("fc6a");
var toLength = __webpack_require__("50c4");
var toAbsoluteIndex = __webpack_require__("23cb");
// `Array.prototype.{ indexOf, includes }` methods implementation
var createMethod = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) {
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
module.exports = {
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod(true),
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod(false)
};
/***/ }),
/***/ "4de4":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var $filter = __webpack_require__("b727").filter;
var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
// Edge 14- issue
var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
// `Array.prototype.filter` method
// https://tc39.es/ecma262/#sec-array.prototype.filter
// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
filter: function filter(callbackfn /* , thisArg */) {
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "4e82":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var aFunction = __webpack_require__("1c0b");
var toObject = __webpack_require__("7b0b");
var fails = __webpack_require__("d039");
var arrayMethodIsStrict = __webpack_require__("a640");
var test = [];
var nativeSort = test.sort;
// IE8-
var FAILS_ON_UNDEFINED = fails(function () {
test.sort(undefined);
});
// V8 bug
var FAILS_ON_NULL = fails(function () {
test.sort(null);
});
// Old WebKit
var STRICT_METHOD = arrayMethodIsStrict('sort');
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;
// `Array.prototype.sort` method
// https://tc39.es/ecma262/#sec-array.prototype.sort
$({ target: 'Array', proto: true, forced: FORCED }, {
sort: function sort(comparefn) {
return comparefn === undefined
? nativeSort.call(toObject(this))
: nativeSort.call(toObject(this), aFunction(comparefn));
}
});
/***/ }),
/***/ "50c4":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("a691");
var min = Math.min;
// `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
module.exports = function (argument) {
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};
/***/ }),
/***/ "5135":
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/***/ "5319":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
var anObject = __webpack_require__("825a");
var toLength = __webpack_require__("50c4");
var toInteger = __webpack_require__("a691");
var requireObjectCoercible = __webpack_require__("1d80");
var advanceStringIndex = __webpack_require__("8aa5");
var getSubstitution = __webpack_require__("0cb2");
var regExpExec = __webpack_require__("14c3");
var max = Math.max;
var min = Math.min;
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// @@replace logic
fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
return [
// `String.prototype.replace` method
// https://tc39.es/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = requireObjectCoercible(this);
var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
return replacer !== undefined
? replacer.call(searchValue, O, replaceValue)
: nativeReplace.call(String(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
function (regexp, replaceValue) {
if (
(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
(typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
) {
var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
if (res.done) return res.value;
}
var rx = anObject(regexp);
var S = String(this);
var functionalReplace = typeof replaceValue === 'function';
if (!functionalReplace) replaceValue = String(replaceValue);
var global = rx.global;
if (global) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec(rx, S);
if (result === null) break;
results.push(result);
if (!global) break;
var matchStr = String(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = String(result[0]);
var position = max(min(toInteger(result.index), S.length), 0);
var captures = [];
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = [matched].concat(captures, position, S);
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
var replacement = String(replaceValue.apply(undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + S.slice(nextSourcePosition);
}
];
});
/***/ }),
/***/ "5692":
/***/ (function(module, exports, __webpack_require__) {
var IS_PURE = __webpack_require__("c430");
var store = __webpack_require__("c6cd");
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.8.2',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/***/ "56ef":
/***/ (function(module, exports, __webpack_require__) {
var getBuiltIn = __webpack_require__("d066");
var getOwnPropertyNamesModule = __webpack_require__("241c");
var getOwnPropertySymbolsModule = __webpack_require__("7418");
var anObject = __webpack_require__("825a");
// all object keys, includes non-enumerable and symbols
module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
var keys = getOwnPropertyNamesModule.f(anObject(it));
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
};
/***/ }),
/***/ "585a":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
/***/ }),
/***/ "5899":
/***/ (function(module, exports) {
// a string of all valid unicode whitespaces
// eslint-disable-next-line max-len
module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
/***/ }),
/***/ "58a8":
/***/ (function(module, exports, __webpack_require__) {
var requireObjectCoercible = __webpack_require__("1d80");
var whitespaces = __webpack_require__("5899");
var whitespace = '[' + whitespaces + ']';
var ltrim = RegExp('^' + whitespace + whitespace + '*');
var rtrim = RegExp(whitespace + whitespace + '*$');
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
var createMethod = function (TYPE) {
return function ($this) {
var string = String(requireObjectCoercible($this));
if (TYPE & 1) string = string.replace(ltrim, '');
if (TYPE & 2) string = string.replace(rtrim, '');
return string;
};
};
module.exports = {
// `String.prototype.{ trimLeft, trimStart }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
start: createMethod(1),
// `String.prototype.{ trimRight, trimEnd }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimend
end: createMethod(2),
// `String.prototype.trim` method
// https://tc39.es/ecma262/#sec-string.prototype.trim
trim: createMethod(3)
};
/***/ }),
/***/ "5c6c":
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/***/ "605d":
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__("c6b6");
var global = __webpack_require__("da84");
module.exports = classof(global.process) == 'process';
/***/ }),
/***/ "6428":
/***/ (function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__("b4b0");
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
module.exports = toFinite;
/***/ }),
/***/ "6547":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("a691");
var requireObjectCoercible = __webpack_require__("1d80");
// `String.prototype.{ codePointAt, at }` methods implementation
var createMethod = function (CONVERT_TO_STRING) {
return function ($this, pos) {
var S = String(requireObjectCoercible($this));
var position = toInteger(pos);
var size = S.length;
var first, second;
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
first = S.charCodeAt(position);
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
? CONVERT_TO_STRING ? S.charAt(position) : first
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
};
};
module.exports = {
// `String.prototype.codePointAt` method
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
codeAt: createMethod(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
charAt: createMethod(true)
};
/***/ }),
/***/ "65f0":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("861d");
var isArray = __webpack_require__("e8b5");
var wellKnownSymbol = __webpack_require__("b622");
var SPECIES = wellKnownSymbol('species');
// `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
module.exports = function (originalArray, length) {
var C;
if (isArray(originalArray)) {
C = originalArray.constructor;
// cross-realm fallback
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
else if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
};
/***/ }),
/***/ "69f3":
/***/ (function(module, exports, __webpack_require__) {
var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
var global = __webpack_require__("da84");
var isObject = __webpack_require__("861d");
var createNonEnumerableProperty = __webpack_require__("9112");
var objectHas = __webpack_require__("5135");
var shared = __webpack_require__("c6cd");
var sharedKey = __webpack_require__("f772");
var hiddenKeys = __webpack_require__("d012");
var WeakMap = global.WeakMap;
var set, get, has;
var enforce = function (it) {
return has(it) ? get(it) : set(it, {});
};
var getterFor = function (TYPE) {
return function (it) {
var state;
if (!isObject(it) || (state = get(it)).type !== TYPE) {
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
} return state;
};
};
if (NATIVE_WEAK_MAP) {
var store = shared.state || (shared.state = new WeakMap());
var wmget = store.get;
var wmhas = store.has;
var wmset = store.set;
set = function (it, metadata) {
metadata.facade = it;
wmset.call(store, it, metadata);
return metadata;
};
get = function (it) {
return wmget.call(store, it) || {};
};
has = function (it) {
return wmhas.call(store, it);
};
} else {
var STATE = sharedKey('state');
hiddenKeys[STATE] = true;
set = function (it, metadata) {
metadata.facade = it;
createNonEnumerableProperty(it, STATE, metadata);
return metadata;
};
get = function (it) {
return objectHas(it, STATE) ? it[STATE] : {};
};
has = function (it) {
return objectHas(it, STATE);
};
}
module.exports = {
set: set,
get: get,
has: has,
enforce: enforce,
getterFor: getterFor
};
/***/ }),
/***/ "6eeb":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var createNonEnumerableProperty = __webpack_require__("9112");
var has = __webpack_require__("5135");
var setGlobal = __webpack_require__("ce4e");
var inspectSource = __webpack_require__("8925");
var InternalStateModule = __webpack_require__("69f3");
var getInternalState = InternalStateModule.get;
var enforceInternalState = InternalStateModule.enforce;
var TEMPLATE = String(String).split('String');
(module.exports = function (O, key, value, options) {
var unsafe = options ? !!options.unsafe : false;
var simple = options ? !!options.enumerable : false;
var noTargetGet = options ? !!options.noTargetGet : false;
var state;
if (typeof value == 'function') {
if (typeof key == 'string' && !has(value, 'name')) {
createNonEnumerableProperty(value, 'name', key);
}
state = enforceInternalState(value);
if (!state.source) {
state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
}
}
if (O === global) {
if (simple) O[key] = value;
else setGlobal(key, value);
return;
} else if (!unsafe) {
delete O[key];
} else if (!noTargetGet && O[key]) {
simple = true;
}
if (simple) O[key] = value;
else createNonEnumerableProperty(O, key, value);
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, 'toString', function toString() {
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
});
/***/ }),
/***/ "7156":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("861d");
var setPrototypeOf = __webpack_require__("d2bb");
// makes subclassing work correct for wrapped built-ins
module.exports = function ($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (
// it can work only with native `setPrototypeOf`
setPrototypeOf &&
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
typeof (NewTarget = dummy.constructor) == 'function' &&
NewTarget !== Wrapper &&
isObject(NewTargetPrototype = NewTarget.prototype) &&
NewTargetPrototype !== Wrapper.prototype
) setPrototypeOf($this, NewTargetPrototype);
return $this;
};
/***/ }),
/***/ "72f0":
/***/ (function(module, exports) {
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;
/***/ }),
/***/ "7418":
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/***/ "7839":
/***/ (function(module, exports) {
// IE8- don't enum bug keys
module.exports = [
'constructor',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toLocaleString',
'toString',
'valueOf'
];
/***/ }),
/***/ "7b0b":
/***/ (function(module, exports, __webpack_require__) {
var requireObjectCoercible = __webpack_require__("1d80");
// `ToObject` abstract operation
// https://tc39.es/ecma262/#sec-toobject
module.exports = function (argument) {
return Object(requireObjectCoercible(argument));
};
/***/ }),
/***/ "7c73":
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__("825a");
var defineProperties = __webpack_require__("37e8");
var enumBugKeys = __webpack_require__("7839");
var hiddenKeys = __webpack_require__("d012");
var html = __webpack_require__("1be4");
var documentCreateElement = __webpack_require__("cc12");
var sharedKey = __webpack_require__("f772");
var GT = '>';
var LT = '<';
var PROTOTYPE = 'prototype';
var SCRIPT = 'script';
var IE_PROTO = sharedKey('IE_PROTO');
var EmptyConstructor = function () { /* empty */ };
var scriptTag = function (content) {
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
};
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
var NullProtoObjectViaActiveX = function (activeXDocument) {
activeXDocument.write(scriptTag(''));
activeXDocument.close();
var temp = activeXDocument.parentWindow.Object;
activeXDocument = null; // avoid memory leak
return temp;
};
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var NullProtoObjectViaIFrame = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = documentCreateElement('iframe');
var JS = 'java' + SCRIPT + ':';
var iframeDocument;
iframe.style.display = 'none';
html.appendChild(iframe);
// https://github.com/zloirock/core-js/issues/475
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag('document.F=Object'));
iframeDocument.close();
return iframeDocument.F;
};
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
// avoid IE GC bug
var activeXDocument;
var NullProtoObject = function () {
try {
/* global ActiveXObject */
activeXDocument = document.domain && new ActiveXObject('htmlfile');
} catch (error) { /* ignore */ }
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
var length = enumBugKeys.length;
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO] = true;
// `Object.create` method
// https://tc39.es/ecma262/#sec-object.create
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
EmptyConstructor[PROTOTYPE] = anObject(O);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = NullProtoObject();
return Properties === undefined ? result : defineProperties(result, Properties);
};
/***/ }),
/***/ "7f9a":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var inspectSource = __webpack_require__("8925");
var WeakMap = global.WeakMap;
module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
/***/ }),
/***/ "825a":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("861d");
module.exports = function (it) {
if (!isObject(it)) {
throw TypeError(String(it) + ' is not an object');
} return it;
};
/***/ }),
/***/ "83ab":
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__("d039");
// Detect IE8's incomplete defineProperty implementation
module.exports = !fails(function () {
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
});
/***/ }),
/***/ "8418":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toPrimitive = __webpack_require__("c04e");
var definePropertyModule = __webpack_require__("9bf2");
var createPropertyDescriptor = __webpack_require__("5c6c");
module.exports = function (object, key, value) {
var propertyKey = toPrimitive(key);
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
else object[propertyKey] = value;
};
/***/ }),
/***/ "861d":
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/***/ "8925":
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__("c6cd");
var functionToString = Function.toString;
// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
if (typeof store.inspectSource != 'function') {
store.inspectSource = function (it) {
return functionToString.call(it);
};
}
module.exports = store.inspectSource;
/***/ }),
/***/ "8aa5":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var charAt = __webpack_require__("6547").charAt;
// `AdvanceStringIndex` abstract operation
// https://tc39.es/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? charAt(S, index).length : 1);
};
/***/ }),
/***/ "8bbf":
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;
/***/ }),
/***/ "90e3":
/***/ (function(module, exports) {
var id = 0;
var postfix = Math.random();
module.exports = function (key) {
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
};
/***/ }),
/***/ "9112":
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__("83ab");
var definePropertyModule = __webpack_require__("9bf2");
var createPropertyDescriptor = __webpack_require__("5c6c");
module.exports = DESCRIPTORS ? function (object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/***/ "9263":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpFlags = __webpack_require__("ad6d");
var stickyHelpers = __webpack_require__("9f7f");
var nativeExec = RegExp.prototype.exec;
// This always refers to the native implementation, because the
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
// which loads this file before patching the method.
var nativeReplace = String.prototype.replace;
var patchedExec = nativeExec;
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/;
var re2 = /b*/g;
nativeExec.call(re1, 'a');
nativeExec.call(re2, 'a');
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
})();
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
if (PATCH) {
patchedExec = function exec(str) {
var re = this;
var lastIndex, reCopy, match, i;
var sticky = UNSUPPORTED_Y && re.sticky;
var flags = regexpFlags.call(re);
var source = re.source;
var charsAdded = 0;
var strCopy = str;
if (sticky) {
flags = flags.replace('y', '');
if (flags.indexOf('g') === -1) {
flags += 'g';
}
strCopy = String(str).slice(re.lastIndex);
// Support anchored sticky behavior.
if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
source = '(?: ' + source + ')';
strCopy = ' ' + strCopy;
charsAdded++;
}
// ^(? + rx + ) is needed, in combination with some str slicing, to
// simulate the 'y' flag.
reCopy = new RegExp('^(?:' + source + ')', flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
match = nativeExec.call(sticky ? reCopy : re, strCopy);
if (sticky) {
if (match) {
match.input = match.input.slice(charsAdded);
match[0] = match[0].slice(charsAdded);
match.index = re.lastIndex;
re.lastIndex += match[0].length;
} else re.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match) {
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
nativeReplace.call(match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
return match;
};
}
module.exports = patchedExec;
/***/ }),
/***/ "94ca":
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__("d039");
var replacement = /#|\.prototype\./;
var isForced = function (feature, detection) {
var value = data[normalize(feature)];
return value == POLYFILL ? true
: value == NATIVE ? false
: typeof detection == 'function' ? fails(detection)
: !!detection;
};
var normalize = isForced.normalize = function (string) {
return String(string).replace(replacement, '.').toLowerCase();
};
var data = isForced.data = {};
var NATIVE = isForced.NATIVE = 'N';
var POLYFILL = isForced.POLYFILL = 'P';
module.exports = isForced;
/***/ }),
/***/ "99af":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var fails = __webpack_require__("d039");
var isArray = __webpack_require__("e8b5");
var isObject = __webpack_require__("861d");
var toObject = __webpack_require__("7b0b");
var toLength = __webpack_require__("50c4");
var createProperty = __webpack_require__("8418");
var arraySpeciesCreate = __webpack_require__("65f0");
var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
var wellKnownSymbol = __webpack_require__("b622");
var V8_VERSION = __webpack_require__("2d00");
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/679
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
var array = [];
array[IS_CONCAT_SPREADABLE] = false;
return array.concat()[0] !== array;
});
var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
var isConcatSpreadable = function (O) {
if (!isObject(O)) return false;
var spreadable = O[IS_CONCAT_SPREADABLE];
return spreadable !== undefined ? !!spreadable : isArray(O);
};
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
// `Array.prototype.concat` method
// https://tc39.es/ecma262/#sec-array.prototype.concat
// with adding support of @@isConcatSpreadable and @@species
$({ target: 'Array', proto: true, forced: FORCED }, {
concat: function concat(arg) { // eslint-disable-line no-unused-vars
var O = toObject(this);
var A = arraySpeciesCreate(O, 0);
var n = 0;
var i, k, length, len, E;
for (i = -1, length = arguments.length; i < length; i++) {
E = i === -1 ? O : arguments[i];
if (isConcatSpreadable(E)) {
len = toLength(E.length);
if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
} else {
if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
createProperty(A, n++, E);
}
}
A.length = n;
return A;
}
});
/***/ }),
/***/ "9bf2":
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__("83ab");
var IE8_DOM_DEFINE = __webpack_require__("0cfb");
var anObject = __webpack_require__("825a");
var toPrimitive = __webpack_require__("c04e");
var nativeDefineProperty = Object.defineProperty;
// `Object.defineProperty` method
// https://tc39.es/ecma262/#sec-object.defineproperty
exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return nativeDefineProperty(O, P, Attributes);
} catch (error) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/***/ "9e69":
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__("2b3e");
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/***/ "9f7f":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fails = __webpack_require__("d039");
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
// so we use an intermediate function.
function RE(s, f) {
return RegExp(s, f);
}
exports.UNSUPPORTED_Y = fails(function () {
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
var re = RE('a', 'y');
re.lastIndex = 2;
return re.exec('abcd') != null;
});
exports.BROKEN_CARET = fails(function () {
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
var re = RE('^r', 'gy');
re.lastIndex = 2;
return re.exec('str') != null;
});
/***/ }),
/***/ "a15b":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var IndexedObject = __webpack_require__("44ad");
var toIndexedObject = __webpack_require__("fc6a");
var arrayMethodIsStrict = __webpack_require__("a640");
var nativeJoin = [].join;
var ES3_STRINGS = IndexedObject != Object;
var STRICT_METHOD = arrayMethodIsStrict('join', ',');
// `Array.prototype.join` method
// https://tc39.es/ecma262/#sec-array.prototype.join
$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
join: function join(separator) {
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
}
});
/***/ }),
/***/ "a2bf":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var isArray = __webpack_require__("e8b5");
var toLength = __webpack_require__("50c4");
var bind = __webpack_require__("0366");
// `FlattenIntoArray` abstract operation
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
var targetIndex = start;
var sourceIndex = 0;
var mapFn = mapper ? bind(mapper, thisArg, 3) : false;
var element;
while (sourceIndex < sourceLen) {
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
if (depth > 0 && isArray(element)) {
targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
} else {
if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
target[targetIndex] = element;
}
targetIndex++;
}
sourceIndex++;
}
return targetIndex;
};
module.exports = flattenIntoArray;
/***/ }),
/***/ "a434":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var toAbsoluteIndex = __webpack_require__("23cb");
var toInteger = __webpack_require__("a691");
var toLength = __webpack_require__("50c4");
var toObject = __webpack_require__("7b0b");
var arraySpeciesCreate = __webpack_require__("65f0");
var createProperty = __webpack_require__("8418");
var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
var max = Math.max;
var min = Math.min;
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
// `Array.prototype.splice` method
// https://tc39.es/ecma262/#sec-array.prototype.splice
// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
splice: function splice(start, deleteCount /* , ...items */) {
var O = toObject(this);
var len = toLength(O.length);
var actualStart = toAbsoluteIndex(start, len);
var argumentsLength = arguments.length;
var insertCount, actualDeleteCount, A, k, from, to;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
}
if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
}
A = arraySpeciesCreate(O, actualDeleteCount);
for (k = 0; k < actualDeleteCount; k++) {
from = actualStart + k;
if (from in O) createProperty(A, k, O[from]);
}
A.length = actualDeleteCount;
if (insertCount < actualDeleteCount) {
for (k = actualStart; k < len - actualDeleteCount; k++) {
from = k + actualDeleteCount;
to = k + insertCount;
if (from in O) O[to] = O[from];
else delete O[to];
}
for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
} else if (insertCount > actualDeleteCount) {
for (k = len - actualDeleteCount; k > actualStart; k--) {
from = k + actualDeleteCount - 1;
to = k + insertCount - 1;
if (from in O) O[to] = O[from];
else delete O[to];
}
}
for (k = 0; k < insertCount; k++) {
O[k + actualStart] = arguments[k + 2];
}
O.length = len - actualDeleteCount + insertCount;
return A;
}
});
/***/ }),
/***/ "a623":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var $every = __webpack_require__("b727").every;
var arrayMethodIsStrict = __webpack_require__("a640");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var STRICT_METHOD = arrayMethodIsStrict('every');
var USES_TO_LENGTH = arrayMethodUsesToLength('every');
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "a640":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fails = __webpack_require__("d039");
module.exports = function (METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call,no-throw-literal
method.call(null, argument || function () { throw 1; }, 1);
});
};
/***/ }),
/***/ "a691":
/***/ (function(module, exports) {
var ceil = Math.ceil;
var floor = Math.floor;
// `ToInteger` abstract operation
// https://tc39.es/ecma262/#sec-tointeger
module.exports = function (argument) {
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
};
/***/ }),
/***/ "a9e3":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var DESCRIPTORS = __webpack_require__("83ab");
var global = __webpack_require__("da84");
var isForced = __webpack_require__("94ca");
var redefine = __webpack_require__("6eeb");
var has = __webpack_require__("5135");
var classof = __webpack_require__("c6b6");
var inheritIfRequired = __webpack_require__("7156");
var toPrimitive = __webpack_require__("c04e");
var fails = __webpack_require__("d039");
var create = __webpack_require__("7c73");
var getOwnPropertyNames = __webpack_require__("241c").f;
var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
var defineProperty = __webpack_require__("9bf2").f;
var trim = __webpack_require__("58a8").trim;
var NUMBER = 'Number';
var NativeNumber = global[NUMBER];
var NumberPrototype = NativeNumber.prototype;
// Opera ~12 has broken Object#toString
var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
// `ToNumber` abstract operation
// https://tc39.es/ecma262/#sec-tonumber
var toNumber = function (argument) {
var it = toPrimitive(argument, false);
var first, third, radix, maxCode, digits, length, index, code;
if (typeof it == 'string' && it.length > 2) {
it = trim(it);
first = it.charCodeAt(0);
if (first === 43 || first === 45) {
third = it.charCodeAt(2);
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
} else if (first === 48) {
switch (it.charCodeAt(1)) {
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
default: return +it;
}
digits = it.slice(2);
length = digits.length;
for (index = 0; index < length; index++) {
code = digits.charCodeAt(index);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if (code < 48 || code > maxCode) return NaN;
} return parseInt(digits, radix);
}
} return +it;
};
// `Number` constructor
// https://tc39.es/ecma262/#sec-number-constructor
if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
var NumberWrapper = function Number(value) {
var it = arguments.length < 1 ? 0 : value;
var dummy = this;
return dummy instanceof NumberWrapper
// check on 1..constructor(foo) case
&& (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
};
for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
// ES3:
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
// ES2015 (in case, if modules with ES2015 Number statics required before):
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +
// ESNext
'fromString,range'
).split(','), j = 0, key; keys.length > j; j++) {
if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
}
}
NumberWrapper.prototype = NumberPrototype;
NumberPrototype.constructor = NumberWrapper;
redefine(global, NUMBER, NumberWrapper);
}
/***/ }),
/***/ "ac1f":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var exec = __webpack_require__("9263");
// `RegExp.prototype.exec` method
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
exec: exec
});
/***/ }),
/***/ "ad6d":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__("825a");
// `RegExp.prototype.flags` getter implementation
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.dotAll) result += 's';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
/***/ }),
/***/ "ae40":
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__("83ab");
var fails = __webpack_require__("d039");
var has = __webpack_require__("5135");
var defineProperty = Object.defineProperty;
var cache = {};
var thrower = function (it) { throw it; };
module.exports = function (METHOD_NAME, options) {
if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
if (!options) options = {};
var method = [][METHOD_NAME];
var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
var argument0 = has(options, 0) ? options[0] : thrower;
var argument1 = has(options, 1) ? options[1] : undefined;
return cache[METHOD_NAME] = !!method && !fails(function () {
if (ACCESSORS && !DESCRIPTORS) return true;
var O = { length: -1 };
if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
else O[1] = 1;
method.call(O, argument0, argument1);
});
};
/***/ }),
/***/ "b041":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
var classof = __webpack_require__("f5df");
// `Object.prototype.toString` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.tostring
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
return '[object ' + classof(this) + ']';
};
/***/ }),
/***/ "b047":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("1a8c"),
now = __webpack_require__("408c"),
toNumber = __webpack_require__("b4b0");
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
timeWaiting = wait - timeSinceLastCall;
return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
module.exports = debounce;
/***/ }),
/***/ "b4b0":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("1a8c"),
isSymbol = __webpack_require__("ffd6");
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
/***/ }),
/***/ "b622":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var shared = __webpack_require__("5692");
var has = __webpack_require__("5135");
var uid = __webpack_require__("90e3");
var NATIVE_SYMBOL = __webpack_require__("4930");
var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
var WellKnownSymbolsStore = shared('wks');
var Symbol = global.Symbol;
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
module.exports = function (name) {
if (!has(WellKnownSymbolsStore, name)) {
if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
} return WellKnownSymbolsStore[name];
};
/***/ }),
/***/ "b64b":
/***/ (function(module, exports, __webpack_require__) {
var $ = __webpack_require__("23e7");
var toObject = __webpack_require__("7b0b");
var nativeKeys = __webpack_require__("df75");
var fails = __webpack_require__("d039");
var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
// `Object.keys` method
// https://tc39.es/ecma262/#sec-object.keys
$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
keys: function keys(it) {
return nativeKeys(toObject(it));
}
});
/***/ }),
/***/ "b727":
/***/ (function(module, exports, __webpack_require__) {
var bind = __webpack_require__("0366");
var IndexedObject = __webpack_require__("44ad");
var toObject = __webpack_require__("7b0b");
var toLength = __webpack_require__("50c4");
var arraySpeciesCreate = __webpack_require__("65f0");
var push = [].push;
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
var createMethod = function (TYPE) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var IS_FILTER_OUT = TYPE == 7;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that, specificCreate) {
var O = toObject($this);
var self = IndexedObject(O);
var boundFunction = bind(callbackfn, that, 3);
var length = toLength(self.length);
var index = 0;
var create = specificCreate || arraySpeciesCreate;
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
var value, result;
for (;length > index; index++) if (NO_HOLES || index in self) {
value = self[index];
result = boundFunction(value, index, O);
if (TYPE) {
if (IS_MAP) target[index] = result; // map
else if (result) switch (TYPE) {
case 3: return true; // some
case 5: return value; // find
case 6: return index; // findIndex
case 2: push.call(target, value); // filter
} else switch (TYPE) {
case 4: return false; // every
case 7: push.call(target, value); // filterOut
}
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
module.exports = {
// `Array.prototype.forEach` method
// https://tc39.es/ecma262/#sec-array.prototype.foreach
forEach: createMethod(0),
// `Array.prototype.map` method
// https://tc39.es/ecma262/#sec-array.prototype.map
map: createMethod(1),
// `Array.prototype.filter` method
// https://tc39.es/ecma262/#sec-array.prototype.filter
filter: createMethod(2),
// `Array.prototype.some` method
// https://tc39.es/ecma262/#sec-array.prototype.some
some: createMethod(3),
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
every: createMethod(4),
// `Array.prototype.find` method
// https://tc39.es/ecma262/#sec-array.prototype.find
find: createMethod(5),
// `Array.prototype.findIndex` method
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
findIndex: createMethod(6),
// `Array.prototype.filterOut` method
// https://github.com/tc39/proposal-array-filtering
filterOut: createMethod(7)
};
/***/ }),
/***/ "bcdf":
/***/ (function(module, exports) {
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = noop;
/***/ }),
/***/ "c04e":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("861d");
// `ToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-toprimitive
// 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 (input, PREFERRED_STRING) {
if (!isObject(input)) return input;
var fn, val;
if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/***/ "c430":
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/***/ "c6b6":
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/***/ "c6cd":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var setGlobal = __webpack_require__("ce4e");
var SHARED = '__core-js_shared__';
var store = global[SHARED] || setGlobal(SHARED, {});
module.exports = store;
/***/ }),
/***/ "c8ba":
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/***/ "c8d2":
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__("d039");
var whitespaces = __webpack_require__("5899");
var non = '\u200B\u0085\u180E';
// check that a method works with the correct list
// of whitespaces and has a correct name
module.exports = function (METHOD_NAME) {
return fails(function () {
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
});
};
/***/ }),
/***/ "c975":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var $indexOf = __webpack_require__("4d64").indexOf;
var arrayMethodIsStrict = __webpack_require__("a640");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var nativeIndexOf = [].indexOf;
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
var STRICT_METHOD = arrayMethodIsStrict('indexOf');
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
return NEGATIVE_ZERO
// convert -0 to +0
? nativeIndexOf.apply(this, arguments) || 0
: $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "ca84":
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__("5135");
var toIndexedObject = __webpack_require__("fc6a");
var indexOf = __webpack_require__("4d64").indexOf;
var hiddenKeys = __webpack_require__("d012");
module.exports = function (object, names) {
var O = toIndexedObject(object);
var i = 0;
var result = [];
var key;
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~indexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/***/ "cc12":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var isObject = __webpack_require__("861d");
var document = global.document;
// typeof document.createElement is 'object' in old IE
var EXISTS = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return EXISTS ? document.createElement(it) : {};
};
/***/ }),
/***/ "cd9d":
/***/ (function(module, exports) {
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ }),
/***/ "ce4e":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var createNonEnumerableProperty = __webpack_require__("9112");
module.exports = function (key, value) {
try {
createNonEnumerableProperty(global, key, value);
} catch (error) {
global[key] = value;
} return value;
};
/***/ }),
/***/ "d012":
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/***/ "d039":
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
/***/ }),
/***/ "d066":
/***/ (function(module, exports, __webpack_require__) {
var path = __webpack_require__("428f");
var global = __webpack_require__("da84");
var aFunction = function (variable) {
return typeof variable == 'function' ? variable : undefined;
};
module.exports = function (namespace, method) {
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
: path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
};
/***/ }),
/***/ "d15f":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "d1e7":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Nashorn ~ JDK8 bug
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
// `Object.prototype.propertyIsEnumerable` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
} : nativePropertyIsEnumerable;
/***/ }),
/***/ "d2bb":
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__("825a");
var aPossiblePrototype = __webpack_require__("3bbe");
// `Object.setPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
var CORRECT_SETTER = false;
var test = {};
var setter;
try {
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
setter.call(test, []);
CORRECT_SETTER = test instanceof Array;
} catch (error) { /* empty */ }
return function setPrototypeOf(O, proto) {
anObject(O);
aPossiblePrototype(proto);
if (CORRECT_SETTER) setter.call(O, proto);
else O.__proto__ = proto;
return O;
};
}() : undefined);
/***/ }),
/***/ "d3b7":
/***/ (function(module, exports, __webpack_require__) {
var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
var redefine = __webpack_require__("6eeb");
var toString = __webpack_require__("b041");
// `Object.prototype.toString` method
// https://tc39.es/ecma262/#sec-object.prototype.tostring
if (!TO_STRING_TAG_SUPPORT) {
redefine(Object.prototype, 'toString', toString, { unsafe: true });
}
/***/ }),
/***/ "d58f":
/***/ (function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__("1c0b");
var toObject = __webpack_require__("7b0b");
var IndexedObject = __webpack_require__("44ad");
var toLength = __webpack_require__("50c4");
// `Array.prototype.{ reduce, reduceRight }` methods implementation
var createMethod = function (IS_RIGHT) {
return function (that, callbackfn, argumentsLength, memo) {
aFunction(callbackfn);
var O = toObject(that);
var self = IndexedObject(O);
var length = toLength(O.length);
var index = IS_RIGHT ? length - 1 : 0;
var i = IS_RIGHT ? -1 : 1;
if (argumentsLength < 2) while (true) {
if (index in self) {
memo = self[index];
index += i;
break;
}
index += i;
if (IS_RIGHT ? index < 0 : length <= index) {
throw TypeError('Reduce of empty array with no initial value');
}
}
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
memo = callbackfn(memo, self[index], index, O);
}
return memo;
};
};
module.exports = {
// `Array.prototype.reduce` method
// https://tc39.es/ecma262/#sec-array.prototype.reduce
left: createMethod(false),
// `Array.prototype.reduceRight` method
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
right: createMethod(true)
};
/***/ }),
/***/ "d784":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// TODO: Remove from `core-js@4` since it's moved to entry points
__webpack_require__("ac1f");
var redefine = __webpack_require__("6eeb");
var fails = __webpack_require__("d039");
var wellKnownSymbol = __webpack_require__("b622");
var regexpExec = __webpack_require__("9263");
var createNonEnumerableProperty = __webpack_require__("9112");
var SPECIES = wellKnownSymbol('species');
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
// #replace needs built-in support for named groups.
// #match works fine because it just return the exec results, even if it has
// a "grops" property.
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
return ''.replace(re, '$<a>') !== '7';
});
// IE <= 11 replaces $0 with the whole match, as if it was $&
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
var REPLACE_KEEPS_$0 = (function () {
return 'a'.replace(/./, '$0') === '$0';
})();
var REPLACE = wellKnownSymbol('replace');
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
if (/./[REPLACE]) {
return /./[REPLACE]('a', '$0') === '';
}
return false;
})();
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
var re = /(?:)/;
var originalExec = re.exec;
re.exec = function () { return originalExec.apply(this, arguments); };
var result = 'ab'.split(re);
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
});
module.exports = function (KEY, length, exec, sham) {
var SYMBOL = wellKnownSymbol(KEY);
var DELEGATES_TO_SYMBOL = !fails(function () {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
if (KEY === 'split') {
// We can't use real regex here since it causes deoptimization
// and serious performance degradation in V8
// https://github.com/zloirock/core-js/issues/306
re = {};
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
re.constructor[SPECIES] = function () { return re; };
re.flags = '';
re[SYMBOL] = /./[SYMBOL];
}
re.exec = function () { execCalled = true; return null; };
re[SYMBOL]('');
return !execCalled;
});
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
(KEY === 'replace' && !(
REPLACE_SUPPORTS_NAMED_GROUPS &&
REPLACE_KEEPS_$0 &&
!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
)) ||
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
) {
var nativeRegExpMethod = /./[SYMBOL];
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
if (regexp.exec === regexpExec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
}
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
}
return { done: false };
}, {
REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
});
var stringMethod = methods[0];
var regexMethod = methods[1];
redefine(String.prototype, KEY, stringMethod);
redefine(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return regexMethod.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return regexMethod.call(string, this); }
);
}
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
};
/***/ }),
/***/ "d81d":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var $map = __webpack_require__("b727").map;
var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
// FF49- issue
var USES_TO_LENGTH = arrayMethodUsesToLength('map');
// `Array.prototype.map` method
// https://tc39.es/ecma262/#sec-array.prototype.map
// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
map: function map(callbackfn /* , thisArg */) {
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/***/ "da84":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
return it && it.Math == Math && it;
};
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
module.exports =
// eslint-disable-next-line no-undef
check(typeof globalThis == 'object' && globalThis) ||
check(typeof window == 'object' && window) ||
check(typeof self == 'object' && self) ||
check(typeof global == 'object' && global) ||
// eslint-disable-next-line no-new-func
(function () { return this; })() || Function('return this')();
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
/***/ }),
/***/ "df75":
/***/ (function(module, exports, __webpack_require__) {
var internalObjectKeys = __webpack_require__("ca84");
var enumBugKeys = __webpack_require__("7839");
// `Object.keys` method
// https://tc39.es/ecma262/#sec-object.keys
module.exports = Object.keys || function keys(O) {
return internalObjectKeys(O, enumBugKeys);
};
/***/ }),
/***/ "e0ef":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("4b17");
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it's called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery(element).on('click', _.before(5, addContactToList));
* // => Allows adding up to 4 contacts to the list.
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
module.exports = before;
/***/ }),
/***/ "e163":
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__("5135");
var toObject = __webpack_require__("7b0b");
var sharedKey = __webpack_require__("f772");
var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
var IE_PROTO = sharedKey('IE_PROTO');
var ObjectPrototype = Object.prototype;
// `Object.getPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.getprototypeof
module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectPrototype : null;
};
/***/ }),
/***/ "e177":
/***/ (function(module, exports, __webpack_require__) {
var fails = __webpack_require__("d039");
module.exports = !fails(function () {
function F() { /* empty */ }
F.prototype.constructor = null;
return Object.getPrototypeOf(new F()) !== F.prototype;
});
/***/ }),
/***/ "e893":
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__("5135");
var ownKeys = __webpack_require__("56ef");
var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
var definePropertyModule = __webpack_require__("9bf2");
module.exports = function (target, source) {
var keys = ownKeys(source);
var defineProperty = definePropertyModule.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
};
/***/ }),
/***/ "e8b5":
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__("c6b6");
// `IsArray` abstract operation
// https://tc39.es/ecma262/#sec-isarray
module.exports = Array.isArray || function isArray(arg) {
return classof(arg) == 'Array';
};
/***/ }),
/***/ "f5df":
/***/ (function(module, exports, __webpack_require__) {
var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
var classofRaw = __webpack_require__("c6b6");
var wellKnownSymbol = __webpack_require__("b622");
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (error) { /* empty */ }
};
// getting tag from ES6+ `Object.prototype.toString`
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
var O, tag, result;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
// builtinTag case
: CORRECT_ARGUMENTS ? classofRaw(O)
// ES3 arguments fallback
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
};
/***/ }),
/***/ "f772":
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__("5692");
var uid = __webpack_require__("90e3");
var keys = shared('keys');
module.exports = function (key) {
return keys[key] || (keys[key] = uid(key));
};
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, "Treeselect", function() { return /* reexport */ Treeselect; });
__webpack_require__.d(__webpack_exports__, "treeselectMixin", function() { return /* reexport */ treeselectMixin; });
__webpack_require__.d(__webpack_exports__, "LOAD_ROOT_OPTIONS", function() { return /* reexport */ LOAD_ROOT_OPTIONS; });
__webpack_require__.d(__webpack_exports__, "LOAD_CHILDREN_OPTIONS", function() { return /* reexport */ LOAD_CHILDREN_OPTIONS; });
__webpack_require__.d(__webpack_exports__, "ASYNC_SEARCH", function() { return /* reexport */ ASYNC_SEARCH; });
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.
if (typeof window !== 'undefined') {
var currentScript = window.document.currentScript
if (false) { var getCurrentScript; }
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
if (src) {
__webpack_require__.p = src[1] // eslint-disable-line
}
}
// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Treeselect.vue?vue&type=template&id=5905dd6c
function Treeselectvue_type_template_id_5905dd6c_render(_ctx, _cache, $props, $setup, $data, $options) {
var _component_HiddenFields = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("HiddenFields");
var _component_Control = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Control");
var _component_MenuPortal = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MenuPortal");
var _component_Menu = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Menu");
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("div", {
ref: "wrapper",
class: _ctx.wrapperClass
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_HiddenFields), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Control, {
ref: "control"
}, null, 512), _ctx.appendToBody ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_MenuPortal, {
key: 0,
ref: "portal"
}, null, 512)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Menu, {
key: 1,
ref: "menu"
}, null, 512))], 2);
}
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
var es_array_concat = __webpack_require__("99af");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.every.js
var es_array_every = __webpack_require__("a623");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
var es_array_filter = __webpack_require__("4de4");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.flat.js
var es_array_flat = __webpack_require__("0481");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.for-each.js
var es_array_for_each = __webpack_require__("4160");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
var es_array_index_of = __webpack_require__("c975");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
var es_array_map = __webpack_require__("d81d");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
var es_array_reduce = __webpack_require__("13d5");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
var es_array_slice = __webpack_require__("fb6a");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.some.js
var es_array_some = __webpack_require__("45fc");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
var es_array_sort = __webpack_require__("4e82");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.unscopables.flat.js
var es_array_unscopables_flat = __webpack_require__("4069");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
var es_number_constructor = __webpack_require__("a9e3");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
var es_regexp_exec = __webpack_require__("ac1f");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
var es_string_replace = __webpack_require__("5319");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
var es_string_split = __webpack_require__("1276");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
var es_string_trim = __webpack_require__("498a");
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
var web_dom_collections_for_each = __webpack_require__("159b");
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
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;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
// EXTERNAL MODULE: ./node_modules/fuzzysearch/index.js
var fuzzysearch = __webpack_require__("2e39");
var fuzzysearch_default = /*#__PURE__*/__webpack_require__.n(fuzzysearch);
// CONCATENATED MODULE: ./src/utils/isNaN.js
function isNaN_isNaN(x) {
return x !== x;
}
// CONCATENATED MODULE: ./src/utils/includes.js
function includes(arrOrStr, elem) {
return arrOrStr.indexOf(elem) !== -1;
}
// EXTERNAL MODULE: ./node_modules/lodash/constant.js
var constant = __webpack_require__("72f0");
var constant_default = /*#__PURE__*/__webpack_require__.n(constant);
// EXTERNAL MODULE: ./node_modules/lodash/identity.js
var identity = __webpack_require__("cd9d");
var identity_default = /*#__PURE__*/__webpack_require__.n(identity);
// CONCATENATED MODULE: ./src/utils/createMap.js
var createMap = function createMap() {
return Object.create(null);
};
// CONCATENATED MODULE: ./src/utils/quickDiff.js
function quickDiff(arrA, arrB) {
if (arrA.length !== arrB.length) return true;
for (var i = 0; i < arrA.length; i++) {
if (arrA[i] !== arrB[i]) return true;
}
return false;
}
// EXTERNAL MODULE: ./node_modules/lodash/noop.js
var noop = __webpack_require__("bcdf");
var noop_default = /*#__PURE__*/__webpack_require__.n(noop);
// CONCATENATED MODULE: ./src/utils/warning.js
var warning = true ?
/* istanbul ignore next */
noop_default.a : undefined;
// CONCATENATED MODULE: ./src/utils/find.js
function find(arr, predicate, ctx) {
for (var i = 0, len = arr.length; i < len; i++) {
if (predicate.call(ctx, arr[i], i, arr)) return arr[i];
}
return undefined;
}
// CONCATENATED MODULE: ./src/utils/onLeftClick.js
function onLeftClick(mouseDownHandler) {
return function onMouseDown(evt) {
if (evt.type === 'mousedown' && evt.button === 0) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
mouseDownHandler.call.apply(mouseDownHandler, [this, evt].concat(args));
}
};
}
// CONCATENATED MODULE: ./src/utils/scrollIntoView.js
// from react-select
function scrollIntoView($scrollingEl, $focusedEl) {
var scrollingReact = $scrollingEl.getBoundingClientRect();
var focusedRect = $focusedEl.getBoundingClientRect();
var overScroll = $focusedEl.offsetHeight / 3;
if (focusedRect.bottom + overScroll > scrollingReact.bottom) {
$scrollingEl.scrollTop = Math.min($focusedEl.offsetTop + $focusedEl.clientHeight - $scrollingEl.offsetHeight + overScroll, $scrollingEl.scrollHeight);
} else if (focusedRect.top - overScroll < scrollingReact.top) {
$scrollingEl.scrollTop = Math.max($focusedEl.offsetTop - overScroll, 0);
}
}
// EXTERNAL MODULE: ./node_modules/lodash/last.js
var lodash_last = __webpack_require__("4416");
var last_default = /*#__PURE__*/__webpack_require__.n(lodash_last);
// EXTERNAL MODULE: ./node_modules/lodash/once.js
var once = __webpack_require__("1d92");
var once_default = /*#__PURE__*/__webpack_require__.n(once);
// EXTERNAL MODULE: ./node_modules/is-promise/index.js
var is_promise = __webpack_require__("2655");
var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
var es_array_splice = __webpack_require__("a434");
// CONCATENATED MODULE: ./src/utils/removeFromArray.js
function removeFromArray(arr, elem) {
var idx = arr.indexOf(elem);
if (idx !== -1) arr.splice(idx, 1);
}
// CONCATENATED MODULE: ./src/constants.js
// Magic value that indicates a root level node.
var NO_PARENT_NODE = null; // Types of checked state.
var UNCHECKED = 0;
var INDETERMINATE = 1;
var CHECKED = 2; // Types of count number.
var ALL_CHILDREN = 'ALL_CHILDREN';
var ALL_DESCENDANTS = 'ALL_DESCENDANTS';
var LEAF_CHILDREN = 'LEAF_CHILDREN';
var LEAF_DESCENDANTS = 'LEAF_DESCENDANTS'; // Action types of delayed loading.
var LOAD_ROOT_OPTIONS = 'LOAD_ROOT_OPTIONS';
var LOAD_CHILDREN_OPTIONS = 'LOAD_CHILDREN_OPTIONS';
var ASYNC_SEARCH = 'ASYNC_SEARCH'; // Acceptable values of `valueConsistsOf` prop.
var ALL = 'ALL';
var BRANCH_PRIORITY = 'BRANCH_PRIORITY';
var LEAF_PRIORITY = 'LEAF_PRIORITY';
var ALL_WITH_INDETERMINATE = 'ALL_WITH_INDETERMINATE'; // Acceptable values of `sortValueBy` prop.
var ORDER_SELECTED = 'ORDER_SELECTED';
var LEVEL = 'LEVEL';
var INDEX = 'INDEX'; // Key codes look-up table.
var KEY_CODES = {
BACKSPACE: 8,
ENTER: 13,
ESCAPE: 27,
END: 35,
HOME: 36,
ARROW_LEFT: 37,
ARROW_UP: 38,
ARROW_RIGHT: 39,
ARROW_DOWN: 40,
DELETE: 46
}; // Other constants.
var INPUT_DEBOUNCE_DELAY = false ?
/* to speed up unit testing */
undefined :
/* istanbul ignore next */
200;
var MIN_INPUT_WIDTH = 5;
var MENU_BUFFER = 40;
// CONCATENATED MODULE: ./src/mixins/treeselectMixin.js
function sortValueByIndex(a, b) {
var i = 0;
do {
if (a.level < i) return -1;
if (b.level < i) return 1;
if (a.index[i] !== b.index[i]) return a.index[i] - b.index[i];
i++;
} while (true);
}
function sortValueByLevel(a, b) {
return a.level === b.level ? sortValueByIndex(a, b) : a.level - b.level;
}
function createAsyncOptionsStates() {
return {
isLoaded: false,
isLoading: false,
loadingError: ''
};
}
function stringifyOptionPropValue(value) {
if (typeof value === 'string') return value;
if (typeof value === 'number' && !isNaN_isNaN(value)) return value + ''; // istanbul ignore next
return '';
}
function match(enableFuzzyMatch, needle, haystack) {
return enableFuzzyMatch ? fuzzysearch_default()(needle, haystack) : includes(haystack, needle);
}
function getErrorMessage(err) {
return err.message ||
/* istanbul ignore next */
String(err);
}
var instanceId = 0;
/* harmony default export */ var treeselectMixin = ({
provide: function provide() {
return {
// Enable access to the instance of root component of vue-treeselect
// across hierarchy.
instance: this
};
},
props: {
/**
* Whether to allow resetting value even if there are disabled selected nodes.
*/
allowClearingDisabled: {
type: Boolean,
default: false
},
/**
* When an ancestor node is selected/deselected, whether its disabled descendants should be selected/deselected.
* You may want to use this in conjunction with `allowClearingDisabled` prop.
*/
allowSelectingDisabledDescendants: {
type: Boolean,
default: false
},
/**
* Whether the menu should be always open.
*/
alwaysOpen: {
type: Boolean,
default: false
},
/**
* Append the menu to <body />?
*/
appendToBody: {
type: Boolean,
default: false
},
/**
* Whether to enable async search mode.
*/
async: {
type: Boolean,
default: false
},
/**
* Automatically focus the component on mount?
*/
autoFocus: {
type: Boolean,
default: false
},
/**
* Automatically load root options on mount. When set to `false`, root options will be loaded when the menu is opened.
*/
autoLoadRootOptions: {
type: Boolean,
default: true
},
/**
* When user deselects a node, automatically deselect its ancestors. Applies to flat mode only.
*/
autoDeselectAncestors: {
type: Boolean,
default: false
},
/**
* When user deselects a node, automatically deselect its descendants. Applies to flat mode only.
*/
autoDeselectDescendants: {
type: Boolean,
default: false
},
/**
* When user selects a node, automatically select its ancestors. Applies to flat mode only.
*/
autoSelectAncestors: {
type: Boolean,
default: false
},
/**
* When user selects a node, automatically select its descendants. Applies to flat mode only.
*/
autoSelectDescendants: {
type: Boolean,
default: false
},
/**
* Whether pressing backspace key removes the last item if there is no text input.
*/
backspaceRemoves: {
type: Boolean,
default: true
},
/**
* Function that processes before clearing all input fields.
* Return `false` to prevent value from being cleared.
* @type {function(): (boolean|Promise<boolean>)}
*/
beforeClearAll: {
type: Function,
default: constant_default()(true)
},
/**
* Show branch nodes before leaf nodes?
*/
branchNodesFirst: {
type: Boolean,
default: false
},
/**
* Should cache results of every search request?
*/
cacheOptions: {
type: Boolean,
default: true
},
/**
* Show an "×" button that resets value?
*/
clearable: {
type: Boolean,
default: true
},
/**
* Title for the "×" button when `multiple: true`.
*/
clearAllText: {
type: String,
default: 'Clear all'
},
/**
* Whether to clear the search input after selecting.
* Use only when `multiple` is `true`.
* For single-select mode, it **always** clears the input after selecting an option regardless of the prop value.
*/
clearOnSelect: {
type: Boolean,
default: false
},
/**
* Title for the "×" button.
*/
clearValueText: {
type: String,
default: 'Clear value'
},
/**
* Whether to close the menu after selecting an option?
* Use only when `multiple` is `true`.
*/
closeOnSelect: {
type: Boolean,
default: true
},
/**
* How many levels of branch nodes should be automatically expanded when loaded.
* Set `Infinity` to make all branch nodes expanded by default.
*/
defaultExpandLevel: {
type: Number,
default: 0
},
/**
* The default set of options to show before the user starts searching. Used for async search mode.
* When set to `true`, the results for search query as a empty string will be autoloaded.
* @type {boolean|node[]}
*/
defaultOptions: {
default: false
},
/**
* Whether pressing delete key removes the last item if there is no text input.
*/
deleteRemoves: {
type: Boolean,
default: true
},
/**
* Delimiter to use to join multiple values for the hidden field value.
*/
delimiter: {
type: String,
default: ','
},
/**
* Only show the nodes that match the search value directly, excluding its ancestors.
*
* @type {Object}
*/
flattenSearchResults: {
type: Boolean,
default: false
},
/**
* Prevent branch nodes from being selected?
*/
disableBranchNodes: {
type: Boolean,
default: false
},
/**
* Disable the control?
*/
disabled: {
type: Boolean,
default: false
},
/**
* Disable the fuzzy matching functionality?
*/
disableFuzzyMatching: {
type: Boolean,
default: false
},
/**
* Whether to enable flat mode or not. Non-flat mode (default) means:
* - Whenever a branch node gets checked, all its children will be checked too
* - Whenever a branch node has all children checked, the branch node itself will be checked too
* Set `true` to disable this mechanism
*/
flat: {
type: Boolean,
default: false
},
/**
* Will be passed with all events as the last param.
* Useful for identifying events origin.
*/
instanceId: {
// Add two trailing "$" to distinguish from explictly specified ids.
default: function _default() {
return "".concat(instanceId++, "$$");
},
type: [String, Number]
},
/**
* Joins multiple values into a single form field with the `delimiter` (legacy mode).
*/
joinValues: {
type: Boolean,
default: false
},
/**
* Limit the display of selected options.
* The rest will be hidden within the limitText string.
*/
limit: {
type: Number,
default: Infinity
},
/**
* Function that processes the message shown when selected elements pass the defined limit.
* @type {function(number): string}
*/
limitText: {
type: Function,
default: function limitTextDefault(count) {
// eslint-disable-line func-name-matching
return "and ".concat(count, " more");
}
},
/**
* Text displayed when loading options.
*/
loadingText: {
type: String,
default: 'Loading...'
},
/**
* Used for dynamically loading options.
* @type {function({action: string, callback: (function((Error|string)=): void), parentNode: node=, instanceId}): void}
*/
loadOptions: {
type: Function
},
/**
* Which node properties to filter on.
*/
matchKeys: {
type: Array,
default: constant_default()(['label'])
},
/**
* Sets `maxHeight` style value of the menu.
*/
maxHeight: {
type: Number,
default: 300
},
/**
* Set `true` to allow selecting multiple options (a.k.a., multi-select mode).
*/
multiple: {
type: Boolean,
default: false
},
/**
* Generates a hidden <input /> tag with this field name for html forms.
*/
name: {
type: String
},
/**
* Text displayed when a branch node has no children.
*/
noChildrenText: {
type: String,
default: 'No sub-options.'
},
/**
* Text displayed when there are no available options.
*/
noOptionsText: {
type: String,
default: 'No options available.'
},
/**
* Text displayed when there are no matching search results.
*/
noResultsText: {
type: String,
default: 'No results found...'
},
/**
* Used for normalizing source data.
* @type {function(node, instanceId): node}
*/
normalizer: {
type: Function,
default: identity_default.a
},
/**
* By default (`auto`), the menu will open below the control. If there is not
* enough space, vue-treeselect will automatically flip the menu.
* You can use one of other four options to force the menu to be always opened
* to specified direction.
* Acceptable values:
* - `"auto"`
* - `"below"`
* - `"bottom"`
* - `"above"`
* - `"top"`
*/
openDirection: {
type: String,
default: 'auto',
validator: function validator(value) {
var acceptableValues = ['auto', 'top', 'bottom', 'above', 'below'];
return includes(acceptableValues, value);
}
},
/**
* Whether to automatically open the menu when the control is clicked.
*/
openOnClick: {
type: Boolean,
default: true
},
/**
* Whether to automatically open the menu when the control is focused.
*/
openOnFocus: {
type: Boolean,
default: false
},
/**
* Array of available options.
* @type {node[]}
*/
options: {
type: Array
},
/**
* Field placeholder, displayed when there's no value.
*/
placeholder: {
type: String,
default: 'Select...'
},
/**
* Applies HTML5 required attribute when needed.
*/
required: {
type: Boolean,
default: false
},
/**
* Text displayed asking user whether to retry loading children options.
*/
retryText: {
type: String,
default: 'Retry?'
},
/**
* Title for the retry button.
*/
retryTitle: {
type: String,
default: 'Click to retry'
},
/**
* Enable searching feature?
*/
searchable: {
type: Boolean,
default: true
},
/**
* Search in ancestor nodes too.
*/
searchNested: {
type: Boolean,
default: false
},
/**
* Text tip to prompt for async search.
*/
searchPromptText: {
type: String,
default: 'Type to search...'
},
/**
* Whether to show a children count next to the label of each branch node.
*/
showCount: {
type: Boolean,
default: false
},
/**
* Used in conjunction with `showCount` to specify which type of count number should be displayed.
* Acceptable values:
* - "ALL_CHILDREN"
* - "ALL_DESCENDANTS"
* - "LEAF_CHILDREN"
* - "LEAF_DESCENDANTS"
*/
showCountOf: {
type: String,
default: ALL_CHILDREN,
validator: function validator(value) {
var acceptableValues = [ALL_CHILDREN, ALL_DESCENDANTS, LEAF_CHILDREN, LEAF_DESCENDANTS];
return includes(acceptableValues, value);
}
},
/**
* Whether to show children count when searching.
* Fallbacks to the value of `showCount` when not specified.
* @type {boolean}
*/
showCountOnSearch: null,
/**
* In which order the selected options should be displayed in trigger & sorted in `value` array.
* Used for multi-select mode only.
* Acceptable values:
* - "ORDER_SELECTED"
* - "LEVEL"
* - "INDEX"
*/
sortValueBy: {
type: String,
default: ORDER_SELECTED,
validator: function validator(value) {
var acceptableValues = [ORDER_SELECTED, LEVEL, INDEX];
return includes(acceptableValues, value);
}
},
/**
* Tab index of the control.
*/
tabIndex: {
type: Number,
default: 0
},
/**
* The value of the control.
* Should be `id` or `node` object for single-select mode, or an array of `id` or `node` object for multi-select mode.
* Its format depends on the `valueFormat` prop.
* For most cases, just use `v-model` instead.
* @type {?Array}
*/
modelValue: null,
/**
* Which kind of nodes should be included in the `value` array in multi-select mode.
* Acceptable values:
* - "ALL" - Any node that is checked will be included in the `value` array
* - "BRANCH_PRIORITY" (default) - If a branch node is checked, all its descendants will be excluded in the `value` array
* - "LEAF_PRIORITY" - If a branch node is checked, this node itself and its branch descendants will be excluded from the `value` array but its leaf descendants will be included
* - "ALL_WITH_INDETERMINATE" - Any node that is checked will be included in the `value` array, plus indeterminate nodes
*/
valueConsistsOf: {
type: String,
default: BRANCH_PRIORITY,
validator: function validator(value) {
var acceptableValues = [ALL, BRANCH_PRIORITY, LEAF_PRIORITY, ALL_WITH_INDETERMINATE];
return includes(acceptableValues, value);
}
},
/**
* Format of `value` prop.
* Note that, when set to `"object"`, only `id` & `label` properties are required in each `node` object in `value` prop.
* Acceptable values:
* - "id"
* - "object"
*/
valueFormat: {
type: String,
default: 'id'
},
/**
* z-index of the menu.
*/
zIndex: {
type: [Number, String],
default: 999
}
},
data: function data() {
return {
trigger: {
// Is the control focused?
isFocused: false,
// User entered search query - value of the input.
searchQuery: ''
},
menu: {
// Is the menu opened?
isOpen: false,
// Id of current highlighted option.
current: null,
// The scroll position before last menu closing.
lastScrollPosition: 0,
// Which direction to open the menu.
placement: 'bottom'
},
forest: {
// Normalized options.
normalizedOptions: [],
// <id, node> map for quick look-up.
nodeMap: createMap(),
// <id, checkedState> map, used for multi-select mode.
checkedStateMap: createMap(),
// Id list of all selected options.
selectedNodeIds: this.extractCheckedNodeIdsFromValue(),
// <id, true> map for fast checking:
// if (forest.selectedNodeIds.indexOf(id) !== -1) forest.selectedNodeMap[id] === true
selectedNodeMap: createMap()
},
// States of root options.
rootOptionsStates: createAsyncOptionsStates(),
localSearch: {
// Has user entered any query to search local options?
active: false,
// Has any options matched the search query?
noResults: true,
// <id, countObject> map for counting matched children/descendants.
countMap: createMap()
},
// <searchQuery, remoteSearchEntry> map.
remoteSearch: createMap()
};
},
computed: {
/* eslint-disable valid-jsdoc */
/**
* Normalized nodes that have been selected.
* @type {node[]}
*/
selectedNodes: function selectedNodes() {
return this.forest.selectedNodeIds.map(this.getNode);
},
/**
* Id list of selected nodes with `sortValueBy` prop applied.
* @type {nodeId[]}
*/
internalValue: function internalValue() {
var _this = this;
var internalValue; // istanbul ignore else
if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === ALL) {
internalValue = this.forest.selectedNodeIds.slice();
} else if (this.valueConsistsOf === BRANCH_PRIORITY) {
internalValue = this.forest.selectedNodeIds.filter(function (id) {
var node = _this.getNode(id);
if (node.isRootNode) return true;
return !_this.isSelected(node.parentNode);
});
} else if (this.valueConsistsOf === LEAF_PRIORITY) {
internalValue = this.forest.selectedNodeIds.filter(function (id) {
var node = _this.getNode(id);
if (node.isLeaf) return true;
return node.children.length === 0;
});
} else if (this.valueConsistsOf === ALL_WITH_INDETERMINATE) {
var _internalValue;
var indeterminateNodeIds = [];
internalValue = this.forest.selectedNodeIds.slice();
this.selectedNodes.forEach(function (selectedNode) {
selectedNode.ancestors.forEach(function (ancestor) {
if (includes(indeterminateNodeIds, ancestor.id)) return;
if (includes(internalValue, ancestor.id)) return;
indeterminateNodeIds.push(ancestor.id);
});
});
(_internalValue = internalValue).push.apply(_internalValue, indeterminateNodeIds);
}
if (this.sortValueBy === LEVEL) {
internalValue.sort(function (a, b) {
return sortValueByLevel(_this.getNode(a), _this.getNode(b));
});
} else if (this.sortValueBy === INDEX) {
internalValue.sort(function (a, b) {
return sortValueByIndex(_this.getNode(a), _this.getNode(b));
});
}
return internalValue;
},
/**
* Has any option been selected?
* @type {boolean}
*/
hasValue: function hasValue() {
return this.internalValue.length > 0;
},
/**
* Single-select mode?
* @type {boolean}
*/
single: function single() {
return !this.multiple;
},
/**
* Id list of nodes displayed in the menu. Nodes that are considered NOT visible:
* - descendants of a collapsed branch node
* - in local search mode, nodes that are not matched, unless
* - it's a branch node and has matched descendants
* - it's a leaf node and its parent node is explicitly set to show all children
* @type {id[]}
*/
visibleOptionIds: function visibleOptionIds() {
var _this2 = this;
var visibleOptionIds = [];
this.traverseAllNodesByIndex(function (node) {
if (!_this2.localSearch.active || _this2.shouldOptionBeIncludedInSearchResult(node)) {
visibleOptionIds.push(node.id);
} // Skip the traversal of descendants of a branch node if it's not expanded.
if (node.isBranch && !_this2.shouldExpand(node)) {
return false;
}
});
return visibleOptionIds;
},
/**
* Has any option should be displayed in the menu?
* @type {boolean}
*/
hasVisibleOptions: function hasVisibleOptions() {
return this.visibleOptionIds.length !== 0;
},
/**
* Should show children count when searching?
* @type {boolean}
*/
showCountOnSearchComputed: function showCountOnSearchComputed() {
// Vue doesn't allow setting default prop value based on another prop value.
// So use computed property as a workaround.
// https://github.com/vuejs/vue/issues/6358
return typeof this.showCountOnSearch === 'boolean' ? this.showCountOnSearch : this.showCount;
},
/**
* Is there any branch node?
* @type {boolean}
*/
hasBranchNodes: function hasBranchNodes() {
return this.forest.normalizedOptions.some(function (rootNode) {
return rootNode.isBranch;
});
},
shouldFlattenOptions: function shouldFlattenOptions() {
return this.localSearch.active && this.flattenSearchResults;
}
/* eslint-enable valid-jsdoc */
},
watch: {
alwaysOpen: function alwaysOpen(newValue) {
if (newValue) this.openMenu();else this.closeMenu();
},
branchNodesFirst: function branchNodesFirst() {
this.initialize();
},
disabled: function disabled(newValue) {
// force close the menu after disabling the control
if (newValue && this.menu.isOpen) this.closeMenu();else if (!newValue && !this.menu.isOpen && this.alwaysOpen) this.openMenu();
},
flat: function flat() {
this.initialize();
},
internalValue: function internalValue(newValue, oldValue) {
var hasChanged = quickDiff(newValue, oldValue); // #122
// Vue would trigger this watcher when `newValue` and `oldValue` are shallow-equal.
// We emit the `input` event only when the value actually changes.
if (hasChanged) this.$emit('update:modelValue', this.getValue(), this.getInstanceId());
},
matchKeys: function matchKeys() {
this.initialize();
},
multiple: function multiple(newValue) {
// We need to rebuild the state when switching from single-select mode
// to multi-select mode.
// istanbul ignore else
if (newValue) this.buildForestState();
},
options: {
handler: function handler() {
if (this.async) return; // Re-initialize options when the `options` prop has changed.
this.initialize();
this.rootOptionsStates.isLoaded = Array.isArray(this.options);
},
deep: true,
immediate: true
},
'trigger.searchQuery': function triggerSearchQuery() {
if (this.async) {
this.handleRemoteSearch();
} else {
this.handleLocalSearch();
}
this.$emit('search-change', this.trigger.searchQuery, this.getInstanceId());
},
value: function value() {
var nodeIdsFromValue = this.extractCheckedNodeIdsFromValue();
var hasChanged = quickDiff(nodeIdsFromValue, this.internalValue);
if (hasChanged) this.fixSelectedNodeIds(nodeIdsFromValue);
}
},
methods: {
verifyProps: function verifyProps() {
var _this3 = this;
warning(function () {
return _this3.async ? _this3.searchable : true;
}, function () {
return 'For async search mode, the value of "searchable" prop must be true.';
});
if (this.options == null && !this.loadOptions) {
warning(function () {
return false;
}, function () {
return 'Are you meant to dynamically load options? You need to use "loadOptions" prop.';
});
}
if (this.flat) {
warning(function () {
return _this3.multiple;
}, function () {
return 'You are using flat mode. But you forgot to add "multiple=true"?';
});
}
if (!this.flat) {
var propNames = ['autoSelectAncestors', 'autoSelectDescendants', 'autoDeselectAncestors', 'autoDeselectDescendants'];
propNames.forEach(function (propName) {
warning(function () {
return !_this3[propName];
}, function () {
return "\"".concat(propName, "\" only applies to flat mode.");
});
});
}
},
resetFlags: function resetFlags() {
this._blurOnSelect = false;
},
initialize: function initialize() {
var options = this.async ? this.getRemoteSearchEntry().options : this.options;
if (Array.isArray(options)) {
// In case we are re-initializing options, keep the old state tree temporarily.
var prevNodeMap = this.forest.nodeMap;
this.forest.nodeMap = createMap();
this.keepDataOfSelectedNodes(prevNodeMap);
this.forest.normalizedOptions = this.normalize(NO_PARENT_NODE, options, prevNodeMap); // Cases that need fixing `selectedNodeIds`:
// 1) Children options of a checked node have been delayed loaded,
// we should also mark these children as checked. (multi-select mode)
// 2) Root options have been delayed loaded, we need to initialize states
// of these nodes. (multi-select mode)
// 3) Async search mode.
this.fixSelectedNodeIds(this.internalValue);
} else {
this.forest.normalizedOptions = [];
}
},
getInstanceId: function getInstanceId() {
return this.instanceId == null ? this.id : this.instanceId;
},
getValue: function getValue() {
var _this4 = this;
if (this.valueFormat === 'id') {
return this.multiple ? this.internalValue.slice() : this.internalValue[0];
}
var rawNodes = this.internalValue.map(function (id) {
return _this4.getNode(id).raw;
});
return this.multiple ? rawNodes : rawNodes[0];
},
getNode: function getNode(nodeId) {
warning(function () {
return nodeId != null;
}, function () {
return "Invalid node id: ".concat(nodeId);
});
if (nodeId == null) return null;
return nodeId in this.forest.nodeMap ? this.forest.nodeMap[nodeId] : this.createFallbackNode(nodeId);
},
createFallbackNode: function createFallbackNode(id) {
// In case there is a default selected node that is not loaded into the tree yet,
// we create a fallback node to keep the component working.
// When the real data is loaded, we'll override this fake node.
var raw = this.extractNodeFromValue(id);
var label = this.enhancedNormalizer(raw).label || "".concat(id, " (unknown)");
var fallbackNode = {
id: id,
label: label,
ancestors: [],
parentNode: NO_PARENT_NODE,
isFallbackNode: true,
isRootNode: true,
isLeaf: true,
isBranch: false,
isDisabled: false,
isNew: false,
index: [-1],
level: 0,
raw: raw
};
return this.forest.nodeMap[id] = fallbackNode; // return this.$ set(this.forest.nodeMap, id, fallbackNode)
},
extractCheckedNodeIdsFromValue: function extractCheckedNodeIdsFromValue() {
var _this5 = this;
if (this.modelValue == null) return [];
if (this.valueFormat === 'id') {
return this.multiple ? this.modelValue.slice() : [this.modelValue];
}
return (this.multiple ? this.modelValue : [this.modelValue]).map(function (node) {
return _this5.enhancedNormalizer(node);
}).map(function (node) {
return node.id;
});
},
extractNodeFromValue: function extractNodeFromValue(id) {
var _this6 = this;
var defaultNode = {
id: id
};
if (this.valueFormat === 'id') {
return defaultNode;
}
var valueArray = this.multiple ? Array.isArray(this.modelValue) ? this.modelValue : [] : this.modelValue ? [this.modelValue] : [];
var matched = find(valueArray, function (node) {
return node && _this6.enhancedNormalizer(node).id === id;
});
return matched || defaultNode;
},
fixSelectedNodeIds: function fixSelectedNodeIds(nodeIdListOfPrevValue) {
var _this7 = this;
var nextSelectedNodeIds = []; // istanbul ignore else
if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === ALL) {
nextSelectedNodeIds = nodeIdListOfPrevValue;
} else if (this.valueConsistsOf === BRANCH_PRIORITY) {
nodeIdListOfPrevValue.forEach(function (nodeId) {
nextSelectedNodeIds.push(nodeId);
var node = _this7.getNode(nodeId);
if (node.isBranch) _this7.traverseDescendantsBFS(node, function (descendant) {
nextSelectedNodeIds.push(descendant.id);
});
});
} else if (this.valueConsistsOf === LEAF_PRIORITY) {
var map = createMap();
var queue = nodeIdListOfPrevValue.slice();
while (queue.length) {
var nodeId = queue.shift();
var node = this.getNode(nodeId);
nextSelectedNodeIds.push(nodeId);
if (node.isRootNode) continue;
if (!(node.parentNode.id in map)) map[node.parentNode.id] = node.parentNode.children.length;
if (--map[node.parentNode.id] === 0) queue.push(node.parentNode.id);
}
} else if (this.valueConsistsOf === ALL_WITH_INDETERMINATE) {
var _map = createMap();
var _queue = nodeIdListOfPrevValue.filter(function (nodeId) {
var node = _this7.getNode(nodeId);
return node.isLeaf || node.children.length === 0;
});
while (_queue.length) {
var _nodeId = _queue.shift();
var _node = this.getNode(_nodeId);
nextSelectedNodeIds.push(_nodeId);
if (_node.isRootNode) continue;
if (!(_node.parentNode.id in _map)) _map[_node.parentNode.id] = _node.parentNode.children.length;
if (--_map[_node.parentNode.id] === 0) _queue.push(_node.parentNode.id);
}
}
var hasChanged = quickDiff(this.forest.selectedNodeIds, nextSelectedNodeIds); // If `nextSelectedNodeIds` doesn't actually differ from old `selectedNodeIds`,
// we don't make the assignment to avoid triggering its watchers which may cause
// unnecessary calculations.
if (hasChanged) this.forest.selectedNodeIds = nextSelectedNodeIds;
this.buildForestState();
},
keepDataOfSelectedNodes: function keepDataOfSelectedNodes(prevNodeMap) {
var _this8 = this;
// In case there is any selected node that is not present in the new `options` array.
// It could be useful for async search mode.
this.forest.selectedNodeIds.forEach(function (id) {
if (!prevNodeMap[id]) return;
var node = _objectSpread2(_objectSpread2({}, prevNodeMap[id]), {}, {
isFallbackNode: true
}); // this.$ set(this.forest.nodeMap, id, node)
_this8.forest.nodeMap[id] = node;
});
},
isSelected: function isSelected(node) {
// whether a node is selected (single-select mode) or fully-checked (multi-select mode)
return this.forest.selectedNodeMap[node.id] === true;
},
traverseDescendantsBFS: function traverseDescendantsBFS(parentNode, callback) {
// istanbul ignore if
if (!parentNode.isBranch) return;
var queue = parentNode.children.slice();
while (queue.length) {
var currNode = queue[0];
if (currNode.isBranch) queue.push.apply(queue, _toConsumableArray(currNode.children));
callback(currNode);
queue.shift();
}
},
traverseDescendantsDFS: function traverseDescendantsDFS(parentNode, callback) {
var _this9 = this;
if (!parentNode.isBranch) return;
parentNode.children.forEach(function (child) {
// deep-level node first
_this9.traverseDescendantsDFS(child, callback);
callback(child);
});
},
traverseAllNodesDFS: function traverseAllNodesDFS(callback) {
var _this10 = this;
this.forest.normalizedOptions.forEach(function (rootNode) {
// deep-level node first
_this10.traverseDescendantsDFS(rootNode, callback);
callback(rootNode);
});
},
traverseAllNodesByIndex: function traverseAllNodesByIndex(callback) {
var walk = function walk(parentNode) {
parentNode.children.forEach(function (child) {
if (callback(child) !== false && child.isBranch) {
walk(child);
}
});
}; // To simplify the code logic of traversal,
// we create a fake root node that holds all the root options.
walk({
children: this.forest.normalizedOptions
});
},
toggleClickOutsideEvent: function toggleClickOutsideEvent(enabled) {
if (enabled) {
document.addEventListener('mousedown', this.handleClickOutside, false);
} else {
document.removeEventListener('mousedown', this.handleClickOutside, false);
}
},
getValueContainer: function getValueContainer() {
return this.$refs.control.$refs['value-container'];
},
getInput: function getInput() {
return this.getValueContainer().$refs.input;
},
focusInput: function focusInput() {
this.getInput().focus();
},
blurInput: function blurInput() {
this.getInput().blur();
},
handleMouseDown: onLeftClick(function handleMouseDown(evt) {
evt.preventDefault();
evt.stopPropagation();
if (this.disabled) return;
var isClickedOnValueContainer = this.getValueContainer().$el.contains(evt.target);
if (isClickedOnValueContainer && !this.menu.isOpen && (this.openOnClick || this.trigger.isFocused)) {
this.openMenu();
}
if (this._blurOnSelect) {
this.blurInput();
} else {
// Focus the input or prevent blurring.
this.focusInput();
}
this.resetFlags();
}),
handleClickOutside: function handleClickOutside(evt) {
// istanbul ignore else
if (this.$refs.wrapper && !this.$refs.wrapper.contains(evt.target)) {
this.blurInput();
this.closeMenu();
}
},
handleLocalSearch: function handleLocalSearch() {
var _this11 = this;
var searchQuery = this.trigger.searchQuery;
var done = function done() {
return _this11.resetHighlightedOptionWhenNecessary(true);
};
if (!searchQuery) {
// Exit sync search mode.
this.localSearch.active = false;
return done();
} // Enter sync search mode.
this.localSearch.active = true; // Reset states.
this.localSearch.noResults = true;
this.traverseAllNodesDFS(function (node) {
if (node.isBranch) {
var _this11$localSearch$c;
node.isExpandedOnSearch = false;
node.showAllChildrenOnSearch = false;
node.isMatched = false;
node.hasMatchedDescendants = false;
_this11.localSearch.countMap[node.id] = (_this11$localSearch$c = {}, _defineProperty(_this11$localSearch$c, ALL_CHILDREN, 0), _defineProperty(_this11$localSearch$c, ALL_DESCENDANTS, 0), _defineProperty(_this11$localSearch$c, LEAF_CHILDREN, 0), _defineProperty(_this11$localSearch$c, LEAF_DESCENDANTS, 0), _this11$localSearch$c); // this.$ set(this.localSearch.countMap, node.id, {
// [ALL_CHILDREN]: 0,
// [ALL_DESCENDANTS]: 0,
// [LEAF_CHILDREN]: 0,
// [LEAF_DESCENDANTS]: 0,
// })
}
});
var lowerCasedSearchQuery = searchQuery.trim().toLocaleLowerCase();
var splitSearchQuery = lowerCasedSearchQuery.replace(/\s+/g, ' ').split(' ');
this.traverseAllNodesDFS(function (node) {
if (_this11.searchNested && splitSearchQuery.length > 1) {
node.isMatched = splitSearchQuery.every(function (filterValue) {
return match(false, filterValue, node.nestedSearchLabel);
});
} else {
node.isMatched = _this11.matchKeys.some(function (matchKey) {
return match(!_this11.disableFuzzyMatching, lowerCasedSearchQuery, node.lowerCased[matchKey]);
});
}
if (node.isMatched) {
_this11.localSearch.noResults = false;
node.ancestors.forEach(function (ancestor) {
return _this11.localSearch.countMap[ancestor.id][ALL_DESCENDANTS]++;
});
if (node.isLeaf) node.ancestors.forEach(function (ancestor) {
return _this11.localSearch.countMap[ancestor.id][LEAF_DESCENDANTS]++;
});
if (node.parentNode !== NO_PARENT_NODE) {
_this11.localSearch.countMap[node.parentNode.id][ALL_CHILDREN] += 1; // istanbul ignore else
if (node.isLeaf) _this11.localSearch.countMap[node.parentNode.id][LEAF_CHILDREN] += 1;
}
}
if ((node.isMatched || node.isBranch && node.isExpandedOnSearch) && node.parentNode !== NO_PARENT_NODE) {
node.parentNode.isExpandedOnSearch = true;
node.parentNode.hasMatchedDescendants = true;
}
});
done();
},
handleRemoteSearch: function handleRemoteSearch() {
var _this12 = this;
var searchQuery = this.trigger.searchQuery;
var entry = this.getRemoteSearchEntry();
var done = function done() {
_this12.initialize();
_this12.resetHighlightedOptionWhenNecessary(true);
};
if ((searchQuery === '' || this.cacheOptions) && entry.isLoaded) {
return done();
}
this.callLoadOptionsProp({
action: ASYNC_SEARCH,
args: {
searchQuery: searchQuery
},
isPending: function isPending() {
return entry.isLoading;
},
start: function start() {
entry.isLoading = true;
entry.isLoaded = false;
entry.loadingError = '';
},
succeed: function succeed(options) {
entry.isLoaded = true;
entry.options = options; // When the request completes, the search query may have changed.
// We only show these options if they are for the current search query.
if (_this12.trigger.searchQuery === searchQuery) done();
},
fail: function fail(err) {
entry.loadingError = getErrorMessage(err);
},
end: function end() {
entry.isLoading = false;
}
});
},
getRemoteSearchEntry: function getRemoteSearchEntry() {
var _this13 = this;
var searchQuery = this.trigger.searchQuery;
var entry = this.remoteSearch[searchQuery] || _objectSpread2(_objectSpread2({}, createAsyncOptionsStates()), {}, {
options: []
}); // Vue doesn't support directly watching on objects.
this.$watch(function () {
return entry.options;
}, function () {
// TODO: potential redundant re-initialization.
if (_this13.trigger.searchQuery === searchQuery) _this13.initialize();
}, {
deep: true
});
if (searchQuery === '') {
if (Array.isArray(this.defaultOptions)) {
entry.options = this.defaultOptions;
entry.isLoaded = true;
return entry;
} else if (this.defaultOptions !== true) {
entry.isLoaded = true;
return entry;
}
}
if (!this.remoteSearch[searchQuery]) {
// this.$ set(this.remoteSearch, searchQuery, entry)
this.remoteSearch[searchQuery] = entry;
}
return entry;
},
shouldExpand: function shouldExpand(node) {
return this.localSearch.active ? node.isExpandedOnSearch : node.isExpanded;
},
shouldOptionBeIncludedInSearchResult: function shouldOptionBeIncludedInSearchResult(node) {
// 1) This option is matched.
if (node.isMatched) return true; // 2) This option is not matched, but has matched descendant(s).
if (node.isBranch && node.hasMatchedDescendants && !this.flattenSearchResults) return true; // 3) This option's parent has no matched descendants,
// but after being expanded, all its children should be shown.
if (!node.isRootNode && node.parentNode.showAllChildrenOnSearch) return true; // 4) The default case.
return false;
},
shouldShowOptionInMenu: function shouldShowOptionInMenu(node) {
if (this.localSearch.active && !this.shouldOptionBeIncludedInSearchResult(node)) {
return false;
}
return true;
},
getControl: function getControl() {
return this.$refs.control.$el;
},
getMenu: function getMenu() {
var ref = this.appendToBody ? this.$refs.portal.portalTarget : this;
var $menu = ref.$refs.menu.$refs.menu;
return $menu && $menu.nodeName !== '#comment' ? $menu : null;
},
setCurrentHighlightedOption: function setCurrentHighlightedOption(node) {
var _this14 = this;
var scroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var prev = this.menu.current;
if (prev != null && prev in this.forest.nodeMap) {
this.forest.nodeMap[prev].isHighlighted = false;
}
this.menu.current = node.id;
node.isHighlighted = true;
if (this.menu.isOpen && scroll) {
var scrollToOption = function scrollToOption() {
var $menu = _this14.getMenu();
var $option = $menu.querySelector(".vue-treeselect__option[data-id=\"".concat(node.id, "\"]"));
if ($option) scrollIntoView($menu, $option);
}; // In case `openMenu()` is just called and the menu is not rendered yet.
if (this.getMenu()) {
scrollToOption();
} else {
// istanbul ignore next
this.$nextTick(scrollToOption);
}
}
},
resetHighlightedOptionWhenNecessary: function resetHighlightedOptionWhenNecessary() {
var forceReset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var current = this.menu.current;
if (forceReset || current == null || !(current in this.forest.nodeMap) || !this.shouldShowOptionInMenu(this.getNode(current))) {
this.highlightFirstOption();
}
},
highlightFirstOption: function highlightFirstOption() {
if (!this.hasVisibleOptions) return;
var first = this.visibleOptionIds[0];
this.setCurrentHighlightedOption(this.getNode(first));
},
highlightPrevOption: function highlightPrevOption() {
if (!this.hasVisibleOptions) return;
var prev = this.visibleOptionIds.indexOf(this.menu.current) - 1;
if (prev === -1) return this.highlightLastOption();
this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[prev]));
},
highlightNextOption: function highlightNextOption() {
if (!this.hasVisibleOptions) return;
var next = this.visibleOptionIds.indexOf(this.menu.current) + 1;
if (next === this.visibleOptionIds.length) return this.highlightFirstOption();
this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[next]));
},
highlightLastOption: function highlightLastOption() {
if (!this.hasVisibleOptions) return;
var last = last_default()(this.visibleOptionIds);
this.setCurrentHighlightedOption(this.getNode(last));
},
resetSearchQuery: function resetSearchQuery() {
this.trigger.searchQuery = '';
},
closeMenu: function closeMenu() {
if (!this.menu.isOpen || !this.disabled && this.alwaysOpen) return;
this.saveMenuScrollPosition();
this.menu.isOpen = false;
this.toggleClickOutsideEvent(false);
this.resetSearchQuery();
this.$emit('close', this.getValue(), this.getInstanceId());
},
openMenu: function openMenu() {
if (this.disabled || this.menu.isOpen) return;
this.menu.isOpen = true;
this.$nextTick(this.resetHighlightedOptionWhenNecessary);
this.$nextTick(this.restoreMenuScrollPosition);
if (!this.options && !this.async) this.loadRootOptions();
this.toggleClickOutsideEvent(true);
this.$emit('open', this.getInstanceId());
},
toggleMenu: function toggleMenu() {
if (this.menu.isOpen) {
this.closeMenu();
} else {
this.openMenu();
}
},
toggleExpanded: function toggleExpanded(node) {
var nextState;
if (this.localSearch.active) {
nextState = node.isExpandedOnSearch = !node.isExpandedOnSearch;
if (nextState) node.showAllChildrenOnSearch = true;
} else {
nextState = node.isExpanded = !node.isExpanded;
}
if (nextState && !node.childrenStates.isLoaded) {
this.loadChildrenOptions(node);
}
},
buildForestState: function buildForestState() {
var _this15 = this;
var selectedNodeMap = createMap();
this.forest.selectedNodeIds.forEach(function (selectedNodeId) {
selectedNodeMap[selectedNodeId] = true;
});
this.forest.selectedNodeMap = selectedNodeMap;
var checkedStateMap = createMap();
if (this.multiple) {
this.traverseAllNodesByIndex(function (node) {
checkedStateMap[node.id] = UNCHECKED;
});
this.selectedNodes.forEach(function (selectedNode) {
checkedStateMap[selectedNode.id] = CHECKED;
if (!_this15.flat && !_this15.disableBranchNodes) {
selectedNode.ancestors.forEach(function (ancestorNode) {
if (!_this15.isSelected(ancestorNode)) {
checkedStateMap[ancestorNode.id] = INDETERMINATE;
}
});
}
});
}
this.forest.checkedStateMap = checkedStateMap;
},
enhancedNormalizer: function enhancedNormalizer(raw) {
return _objectSpread2(_objectSpread2({}, raw), this.normalizer(raw, this.getInstanceId()));
},
normalize: function normalize(parentNode, nodes, prevNodeMap) {
var _this16 = this;
var normalizedOptions = nodes.map(function (node) {
return [_this16.enhancedNormalizer(node), node];
}).map(function (_ref, index) {
var _ref2 = _slicedToArray(_ref, 2),
node = _ref2[0],
raw = _ref2[1];
_this16.checkDuplication(node);
_this16.verifyNodeShape(node);
var id = node.id,
label = node.label,
children = node.children,
isDefaultExpanded = node.isDefaultExpanded;
var isRootNode = parentNode === NO_PARENT_NODE;
var level = isRootNode ? 0 : parentNode.level + 1;
var isBranch = Array.isArray(children) || children === null;
var isLeaf = !isBranch;
var isDisabled = !!node.isDisabled || !_this16.flat && !isRootNode && parentNode.isDisabled;
var isNew = !!node.isNew;
var lowerCased = _this16.matchKeys.reduce(function (prev, key) {
return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty({}, key, stringifyOptionPropValue(node[key]).toLocaleLowerCase()));
}, {});
var nestedSearchLabel = isRootNode ? lowerCased.label : parentNode.nestedSearchLabel + ' ' + lowerCased.label; // this.$ set(this.forest.nodeMap, id, createMap())
_this16.forest.nodeMap[id] = createMap();
var normalized = _this16.forest.nodeMap[id];
normalized.id = id;
normalized.label = label;
normalized.level = level;
normalized.ancestors = isRootNode ? [] : [parentNode].concat(parentNode.ancestors);
normalized.index = (isRootNode ? [] : parentNode.index).concat(index);
normalized.parentNode = parentNode;
normalized.lowerCased = lowerCased;
normalized.nestedSearchLabel = nestedSearchLabel;
normalized.isDisabled = isDisabled;
normalized.isNew = isNew;
normalized.isMatched = false;
normalized.isHighlighted = false;
normalized.isBranch = isBranch;
normalized.isLeaf = isLeaf;
normalized.isRootNode = isRootNode;
normalized.raw = raw; // this.$ set(normalized, 'id', id)
// this.$ set(normalized, 'label', label)
// this.$ set(normalized, 'level', level)
// this.$ set(normalized, 'ancestors', isRootNode ? [] : [ parentNode ].concat(parentNode.ancestors))
// this.$ set(normalized, 'index', (isRootNode ? [] : parentNode.index).concat(index))
// this.$ set(normalized, 'parentNode', parentNode)
// this.$ set(normalized, 'lowerCased', lowerCased)
// this.$ set(normalized, 'nestedSearchLabel', nestedSearchLabel)
// this.$ set(normalized, 'isDisabled', isDisabled)
// this.$ set(normalized, 'isNew', isNew)
// this.$ set(normalized, 'isMatched', false)
// this.$ set(normalized, 'isHighlighted', false)
// this.$ set(normalized, 'isBranch', isBranch)
// this.$ set(normalized, 'isLeaf', isLeaf)
// this.$ set(normalized, 'isRootNode', isRootNode)
// this.$ set(normalized, 'raw', raw)
if (isBranch) {
var _normalized$count;
var isLoaded = Array.isArray(children); // this.$ set(normalized, 'childrenStates', {
// ...createAsyncOptionsStates(),
// isLoaded,
// })
normalized.childrenStates = _objectSpread2(_objectSpread2({}, createAsyncOptionsStates()), {}, {
isLoaded: isLoaded
}); // this.$ set(normalized, 'isExpanded', typeof isDefaultExpanded === 'boolean'
// ? isDefaultExpanded
// : level < this.defaultExpandLevel)
normalized.isExpanded = typeof isDefaultExpanded === 'boolean' ? isDefaultExpanded : level < _this16.defaultExpandLevel; // this.$ set(normalized, 'hasMatchedDescendants', false)
// this.$ set(normalized, 'hasDisabledDescendants', false)
// this.$ set(normalized, 'isExpandedOnSearch', false)
// this.$ set(normalized, 'showAllChildrenOnSearch', false)
// this.$ set(normalized, 'count', {
// [ALL_CHILDREN]: 0,
// [ALL_DESCENDANTS]: 0,
// [LEAF_CHILDREN]: 0,
// [LEAF_DESCENDANTS]: 0,
// })
// this.$ set(normalized, 'children', isLoaded
// ? this.normalize(normalized, children, prevNodeMap)
// : [])
normalized.hasMatchedDescendants = false;
normalized.hasDisabledDescendants = false;
normalized.isExpandedOnSearch = false;
normalized.showAllChildrenOnSearch = false;
normalized.count = (_normalized$count = {}, _defineProperty(_normalized$count, ALL_CHILDREN, 0), _defineProperty(_normalized$count, ALL_DESCENDANTS, 0), _defineProperty(_normalized$count, LEAF_CHILDREN, 0), _defineProperty(_normalized$count, LEAF_DESCENDANTS, 0), _normalized$count); // this.$ set(normalized, 'children', isLoaded
// ? this.normalize(normalized, children, prevNodeMap)
// : [])
normalized.children = isLoaded ? _this16.normalize(normalized, children, prevNodeMap) : [];
if (isDefaultExpanded === true) normalized.ancestors.forEach(function (ancestor) {
ancestor.isExpanded = true;
});
if (!isLoaded && typeof _this16.loadOptions !== 'function') {
warning(function () {
return false;
}, function () {
return 'Unloaded branch node detected. "loadOptions" prop is required to load its children.';
});
} else if (!isLoaded && normalized.isExpanded) {
_this16.loadChildrenOptions(normalized);
}
}
normalized.ancestors.forEach(function (ancestor) {
return ancestor.count[ALL_DESCENDANTS]++;
});
if (isLeaf) normalized.ancestors.forEach(function (ancestor) {
return ancestor.count[LEAF_DESCENDANTS]++;
});
if (!isRootNode) {
parentNode.count[ALL_CHILDREN] += 1;
if (isLeaf) parentNode.count[LEAF_CHILDREN] += 1;
if (isDisabled) parentNode.hasDisabledDescendants = true;
} // Preserve previous states.
if (prevNodeMap && prevNodeMap[id]) {
var prev = prevNodeMap[id];
normalized.isMatched = prev.isMatched;
normalized.showAllChildrenOnSearch = prev.showAllChildrenOnSearch;
normalized.isHighlighted = prev.isHighlighted;
if (prev.isBranch && normalized.isBranch) {
normalized.isExpanded = prev.isExpanded;
normalized.isExpandedOnSearch = prev.isExpandedOnSearch; // #97
// If `isLoaded` was true, but IS NOT now, we consider this branch node
// to be reset to unloaded state by the user of this component.
if (prev.childrenStates.isLoaded && !normalized.childrenStates.isLoaded) {
// Make sure the node is collapsed, then the user can load its
// children again (by expanding).
normalized.isExpanded = false; // We have reset `childrenStates` and don't want to preserve states here.
} else {
normalized.childrenStates = _objectSpread2({}, prev.childrenStates);
}
}
}
return normalized;
});
if (this.branchNodesFirst) {
var branchNodes = normalizedOptions.filter(function (option) {
return option.isBranch;
});
var leafNodes = normalizedOptions.filter(function (option) {
return option.isLeaf;
});
normalizedOptions = branchNodes.concat(leafNodes);
}
return normalizedOptions;
},
loadRootOptions: function loadRootOptions() {
var _this17 = this;
this.callLoadOptionsProp({
action: LOAD_ROOT_OPTIONS,
isPending: function isPending() {
return _this17.rootOptionsStates.isLoading;
},
start: function start() {
_this17.rootOptionsStates.isLoading = true;
_this17.rootOptionsStates.loadingError = '';
},
succeed: function succeed() {
_this17.rootOptionsStates.isLoaded = true; // Wait for `options` being re-initialized.
_this17.$nextTick(function () {
_this17.resetHighlightedOptionWhenNecessary(true);
});
},
fail: function fail(err) {
_this17.rootOptionsStates.loadingError = getErrorMessage(err);
},
end: function end() {
_this17.rootOptionsStates.isLoading = false;
}
});
},
loadChildrenOptions: function loadChildrenOptions(parentNode) {
var _this18 = this;
// The options may be re-initialized anytime during the loading process.
// So `parentNode` can be stale and we use `getNode()` to avoid that.
var id = parentNode.id,
raw = parentNode.raw;
this.callLoadOptionsProp({
action: LOAD_CHILDREN_OPTIONS,
args: {
// We always pass the raw node instead of the normalized node to any
// callback provided by the user of this component.
// Because the shape of the raw node is more likely to be closing to
// what the back-end API service of the application needs.
parentNode: raw
},
isPending: function isPending() {
return _this18.getNode(id).childrenStates.isLoading;
},
start: function start() {
_this18.getNode(id).childrenStates.isLoading = true;
_this18.getNode(id).childrenStates.loadingError = '';
},
succeed: function succeed() {
_this18.getNode(id).childrenStates.isLoaded = true;
},
fail: function fail(err) {
_this18.getNode(id).childrenStates.loadingError = getErrorMessage(err);
},
end: function end() {
_this18.getNode(id).childrenStates.isLoading = false;
}
});
},
callLoadOptionsProp: function callLoadOptionsProp(_ref3) {
var action = _ref3.action,
args = _ref3.args,
isPending = _ref3.isPending,
start = _ref3.start,
succeed = _ref3.succeed,
fail = _ref3.fail,
end = _ref3.end;
if (!this.loadOptions || isPending()) {
return;
}
start();
var callback = once_default()(function (err, result) {
if (err) {
fail(err);
} else {
succeed(result);
}
end();
});
var result = this.loadOptions(_objectSpread2(_objectSpread2({
id: this.getInstanceId(),
instanceId: this.getInstanceId(),
action: action
}, args), {}, {
callback: callback
}));
if (is_promise_default()(result)) {
result.then(function () {
callback();
}, function (err) {
callback(err);
}).catch(function (err) {
// istanbul ignore next
console.error(err);
});
}
},
checkDuplication: function checkDuplication(node) {
var _this19 = this;
warning(function () {
return !(node.id in _this19.forest.nodeMap && !_this19.forest.nodeMap[node.id].isFallbackNode);
}, function () {
return "Detected duplicate presence of node id ".concat(JSON.stringify(node.id), ". ") + "Their labels are \"".concat(_this19.forest.nodeMap[node.id].label, "\" and \"").concat(node.label, "\" respectively.");
});
},
verifyNodeShape: function verifyNodeShape(node) {
warning(function () {
return !(node.children === undefined && node.isBranch === true);
}, function () {
return 'Are you meant to declare an unloaded branch node? ' + '`isBranch: true` is no longer supported, please use `children: null` instead.';
});
},
select: function select(node) {
if (this.disabled || node.isDisabled) {
return;
}
if (this.single) {
this.clear();
}
var nextState = this.multiple && !this.flat ? this.forest.checkedStateMap[node.id] === UNCHECKED : !this.isSelected(node);
if (nextState) {
this._selectNode(node);
} else {
this._deselectNode(node);
}
this.buildForestState();
if (nextState) {
this.$emit('select', node.raw, this.getInstanceId());
} else {
this.$emit('deselect', node.raw, this.getInstanceId());
}
if (this.localSearch.active && nextState && (this.single || this.clearOnSelect)) {
this.resetSearchQuery();
}
if (this.single && this.closeOnSelect) {
this.closeMenu(); // istanbul ignore else
if (this.searchable) {
this._blurOnSelect = true;
}
}
},
clear: function clear() {
var _this20 = this;
if (this.hasValue) {
if (this.single || this.allowClearingDisabled) {
this.forest.selectedNodeIds = [];
} else
/* if (this.multiple && !this.allowClearingDisabled) */
{
this.forest.selectedNodeIds = this.forest.selectedNodeIds.filter(function (nodeId) {
return _this20.getNode(nodeId).isDisabled;
});
}
this.buildForestState();
}
},
// This is meant to be called only by `select()`.
_selectNode: function _selectNode(node) {
var _this21 = this;
if (this.single || this.disableBranchNodes) {
return this.addValue(node);
}
if (this.flat) {
this.addValue(node);
if (this.autoSelectAncestors) {
node.ancestors.forEach(function (ancestor) {
if (!_this21.isSelected(ancestor) && !ancestor.isDisabled) _this21.addValue(ancestor);
});
} else if (this.autoSelectDescendants) {
this.traverseDescendantsBFS(node, function (descendant) {
if (!_this21.isSelected(descendant) && !descendant.isDisabled) _this21.addValue(descendant);
});
}
return;
}
var isFullyChecked = node.isLeaf ||
/* node.isBranch && */
!node.hasDisabledDescendants ||
/* node.isBranch && */
this.allowSelectingDisabledDescendants;
if (isFullyChecked) {
this.addValue(node);
}
if (node.isBranch) {
this.traverseDescendantsBFS(node, function (descendant) {
if (!descendant.isDisabled || _this21.allowSelectingDisabledDescendants) {
_this21.addValue(descendant);
}
});
}
if (isFullyChecked) {
var curr = node;
while ((curr = curr.parentNode) !== NO_PARENT_NODE) {
if (curr.children.every(this.isSelected)) this.addValue(curr);else break;
}
}
},
// This is meant to be called only by `select()`.
_deselectNode: function _deselectNode(node) {
var _this22 = this;
if (this.disableBranchNodes) {
return this.removeValue(node);
}
if (this.flat) {
this.removeValue(node);
if (this.autoDeselectAncestors) {
node.ancestors.forEach(function (ancestor) {
if (_this22.isSelected(ancestor) && !ancestor.isDisabled) _this22.removeValue(ancestor);
});
} else if (this.autoDeselectDescendants) {
this.traverseDescendantsBFS(node, function (descendant) {
if (_this22.isSelected(descendant) && !descendant.isDisabled) _this22.removeValue(descendant);
});
}
return;
}
var hasUncheckedSomeDescendants = false;
if (node.isBranch) {
this.traverseDescendantsDFS(node, function (descendant) {
if (!descendant.isDisabled || _this22.allowSelectingDisabledDescendants) {
_this22.removeValue(descendant);
hasUncheckedSomeDescendants = true;
}
});
}
if (node.isLeaf ||
/* node.isBranch && */
hasUncheckedSomeDescendants ||
/* node.isBranch && */
node.children.length === 0) {
this.removeValue(node);
var curr = node;
while ((curr = curr.parentNode) !== NO_PARENT_NODE) {
if (this.isSelected(curr)) this.removeValue(curr);else break;
}
}
},
addValue: function addValue(node) {
this.forest.selectedNodeIds.push(node.id);
this.forest.selectedNodeMap[node.id] = true;
},
removeValue: function removeValue(node) {
removeFromArray(this.forest.selectedNodeIds, node.id);
delete this.forest.selectedNodeMap[node.id];
},
removeLastValue: function removeLastValue() {
if (!this.hasValue) return;
if (this.single) return this.clear();
var lastValue = last_default()(this.internalValue);
var lastSelectedNode = this.getNode(lastValue);
this.select(lastSelectedNode); // deselect
},
saveMenuScrollPosition: function saveMenuScrollPosition() {
var $menu = this.getMenu(); // istanbul ignore else
if ($menu) this.menu.lastScrollPosition = $menu.scrollTop;
},
restoreMenuScrollPosition: function restoreMenuScrollPosition() {
var $menu = this.getMenu(); // istanbul ignore else
if ($menu) $menu.scrollTop = this.menu.lastScrollPosition;
}
},
created: function created() {
this.verifyProps();
this.resetFlags();
},
mounted: function mounted() {
if (this.autoFocus) this.focusInput();
if (!this.options && !this.async && this.autoLoadRootOptions) this.loadRootOptions();
if (this.alwaysOpen) this.openMenu();
if (this.async && this.defaultOptions) this.handleRemoteSearch();
},
unmounted: function unmounted() {
// istanbul ignore next
this.toggleClickOutsideEvent(false);
}
});
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
var es_array_join = __webpack_require__("a15b");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/HiddenFields.vue?vue&type=script&lang=js
function stringifyValue(value) {
if (typeof value === 'string') return value; // istanbul ignore else
if (value != null && !isNaN_isNaN(value)) return JSON.stringify(value); // istanbul ignore next
return '';
}
/* harmony default export */ var HiddenFieldsvue_type_script_lang_js = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
name: 'vue-treeselect--hidden-fields',
inject: ['instance'],
functional: true,
render: function render(context) {
var h = arguments[0];
var instance = context.instance;
if (!instance.name || instance.disabled || !instance.hasValue) return null;
var stringifiedValues = instance.internalValue.map(stringifyValue);
if (instance.multiple && instance.joinValues) stringifiedValues = [stringifiedValues.join(instance.delimiter)];
return stringifiedValues.map(function (stringifiedValue, i) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("input", {
"type": "hidden",
"name": instance.name,
"value": stringifiedValue,
"key": 'hidden-field-' + i
}, null);
});
}
}));
// CONCATENATED MODULE: ./src/components/HiddenFields.vue
/* harmony default export */ var HiddenFields = (HiddenFieldsvue_type_script_lang_js);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
var es_object_to_string = __webpack_require__("d3b7");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
var es_regexp_to_string = __webpack_require__("25f0");
// EXTERNAL MODULE: ./node_modules/lodash/debounce.js
var debounce = __webpack_require__("b047");
var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-prototype-of.js
var es_object_get_prototype_of = __webpack_require__("3410");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
var es_object_keys = __webpack_require__("b64b");
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(obj) {
"@babel/helpers - typeof";
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);
}
// CONCATENATED MODULE: ./src/utils/deepExtend.js
function isPlainObject(value) {
if (value == null || _typeof(value) !== 'object') return false;
return Object.getPrototypeOf(value) === Object.prototype;
}
function copy(obj, key, value) {
if (isPlainObject(value)) {
obj[key] || (obj[key] = {});
deepExtend(obj[key], value);
} else {
obj[key] = value;
}
}
function deepExtend(target, source) {
if (isPlainObject(source)) {
var keys = Object.keys(source);
for (var i = 0, len = keys.length; i < len; i++) {
copy(target, keys[i], source[keys[i]]);
}
}
return target;
}
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Input.vue?vue&type=script&lang=js
function _isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["isVNode"])(s);
}
var keysThatRequireMenuBeingOpen = [KEY_CODES.ENTER, KEY_CODES.END, KEY_CODES.HOME, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN];
/* harmony default export */ var Inputvue_type_script_lang_js = ({
name: 'vue-treeselect--input',
inject: ['instance'],
data: function data() {
return {
inputWidth: MIN_INPUT_WIDTH,
value: ''
};
},
computed: {
needAutoSize: function needAutoSize() {
var instance = this.instance;
return instance.searchable && !instance.disabled && instance.multiple;
},
inputStyle: function inputStyle() {
return {
width: this.needAutoSize ? "".concat(this.inputWidth, "px") : null
};
}
},
watch: {
'instance.trigger.searchQuery': function instanceTriggerSearchQuery(newValue) {
this.value = newValue;
},
value: function value() {
// istanbul ignore else
if (this.needAutoSize) this.$nextTick(this.updateInputWidth);
}
},
created: function created() {
this.debouncedCallback = debounce_default()(this.updateSearchQuery, INPUT_DEBOUNCE_DELAY, {
leading: true,
trailing: true
});
},
methods: {
clear: function clear() {
this.onInput({
target: {
value: ''
}
});
},
focus: function focus() {
var instance = this.instance;
if (!instance.disabled) {
this.$refs.input && this.$refs.input.focus();
}
},
blur: function blur() {
this.$refs.input && this.$refs.input.blur();
},
onFocus: function onFocus() {
var instance = this.instance;
instance.trigger.isFocused = true; // istanbul ignore else
if (instance.openOnFocus) instance.openMenu();
},
onBlur: function onBlur() {
var instance = this.instance;
var menu = instance.getMenu(); // #15
// istanbul ignore next
if (menu && document.activeElement === menu) {
return this.focus();
}
instance.trigger.isFocused = false;
instance.closeMenu();
},
onInput: function onInput(evt) {
var value = evt.target.value;
this.value = value;
if (value) {
this.debouncedCallback();
} else {
this.debouncedCallback.cancel();
this.updateSearchQuery();
}
},
// 用 keyUp 事件存在一个问题,删除输入框最后一个字符也会导致取消选中最后一项
onKeyDown: function onKeyDown(evt) {
var instance = this.instance; // https://css-tricks.com/snippets/javascript/javascript-keycodes/
// https://stackoverflow.com/questions/4471582/javascript-keycode-vs-which
var key = 'which' in evt ? evt.which :
/* istanbul ignore next */
evt.keyCode;
if (evt.ctrlKey || evt.shiftKey || evt.altKey || evt.metaKey) return;
if (!instance.menu.isOpen && includes(keysThatRequireMenuBeingOpen, key)) {
evt.preventDefault();
return instance.openMenu();
}
switch (key) {
case KEY_CODES.BACKSPACE:
{
if (instance.backspaceRemoves && !this.value.length) {
instance.removeLastValue();
}
break;
}
case KEY_CODES.ENTER:
{
evt.preventDefault();
if (instance.menu.current === null) return;
var current = instance.getNode(instance.menu.current);
if (current.isBranch && instance.disableBranchNodes) return;
instance.select(current);
break;
}
case KEY_CODES.ESCAPE:
{
if (this.value.length) {
this.clear();
} else if (instance.menu.isOpen) {
instance.closeMenu();
}
break;
}
case KEY_CODES.END:
{
evt.preventDefault();
instance.highlightLastOption();
break;
}
case KEY_CODES.HOME:
{
evt.preventDefault();
instance.highlightFirstOption();
break;
}
case KEY_CODES.ARROW_LEFT:
{
var _current = instance.getNode(instance.menu.current);
if (_current.isBranch && instance.shouldExpand(_current)) {
evt.preventDefault();
instance.toggleExpanded(_current);
} else if (!_current.isRootNode && (_current.isLeaf || _current.isBranch && !instance.shouldExpand(_current))) {
evt.preventDefault();
instance.setCurrentHighlightedOption(_current.parentNode);
}
break;
}
case KEY_CODES.ARROW_UP:
{
evt.preventDefault();
instance.highlightPrevOption();
break;
}
case KEY_CODES.ARROW_RIGHT:
{
var _current2 = instance.getNode(instance.menu.current);
if (_current2.isBranch && !instance.shouldExpand(_current2)) {
evt.preventDefault();
instance.toggleExpanded(_current2);
}
break;
}
case KEY_CODES.ARROW_DOWN:
{
evt.preventDefault();
instance.highlightNextOption();
break;
}
case KEY_CODES.DELETE:
{
if (instance.deleteRemoves && !this.value.length) {
instance.removeLastValue();
}
break;
}
default:
{
// istanbul ignore else
instance.openMenu();
}
}
},
onMouseDown: function onMouseDown(evt) {
// istanbul ignore next
if (this.value.length) {
// Prevent it from bubbling to the top level and triggering `preventDefault()`
// to make the textbox unselectable
evt.stopPropagation();
}
},
renderInputContainer: function renderInputContainer() {
var h = this.$createElement;
var instance = this.instance;
var props = {};
var children = [];
if (instance.searchable && !instance.disabled) {
children.push(this.renderInput());
if (this.needAutoSize) children.push(this.renderSizer());
}
if (!instance.searchable) {
deepExtend(props, {
on: {
focus: this.onFocus,
blur: this.onBlur,
keydown: this.onKeyDown
},
ref: 'input'
});
}
if (!instance.searchable && !instance.disabled) {
deepExtend(props, {
attrs: {
tabIndex: instance.tabIndex
}
});
}
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({
"class": "vue-treeselect__input-container"
}, props), _isSlot(children) ? children : {
default: function _default() {
return [children];
}
});
},
renderInput: function renderInput() {
var h = this.$createElement;
var instance = this.instance;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("input", {
"ref": "input",
"class": "vue-treeselect__input",
"type": "text",
"autocomplete": "off",
"tabIndex": instance.tabIndex,
"required": instance.required && !instance.hasValue,
"value": this.value,
"style": this.inputStyle,
"onFocus": this.onFocus,
"onInput": this.onInput,
"onBlur": this.onBlur,
"onKeydown": this.onKeyDown,
"onMousedown": this.onMouseDown
}, null);
},
renderSizer: function renderSizer() {
var h = this.$createElement;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"ref": "sizer",
"class": "vue-treeselect__sizer"
}, [this.value]);
},
updateInputWidth: function updateInputWidth() {
this.inputWidth = Math.max(MIN_INPUT_WIDTH, this.$refs.sizer.scrollWidth + 15);
},
updateSearchQuery: function updateSearchQuery() {
var instance = this.instance;
instance.trigger.searchQuery = this.value;
}
},
render: function render() {
return this.renderInputContainer();
}
});
// CONCATENATED MODULE: ./src/components/Input.vue
/* harmony default export */ var Input = (Inputvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Placeholder.vue?vue&type=script&lang=js
/* harmony default export */ var Placeholdervue_type_script_lang_js = ({
name: 'vue-treeselect--placeholder',
inject: ['instance'],
render: function render() {
var h = arguments[0];
var instance = this.instance;
var placeholderClass = {
'vue-treeselect__placeholder': true,
'vue-treeselect-helper-zoom-effect-off': true,
'vue-treeselect-helper-hide': instance.hasValue || instance.trigger.searchQuery
};
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": placeholderClass
}, [instance.placeholder]);
}
});
// CONCATENATED MODULE: ./src/components/Placeholder.vue
/* harmony default export */ var Placeholder = (Placeholdervue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/SingleValue.vue?vue&type=script&lang=js
/* harmony default export */ var SingleValuevue_type_script_lang_js = ({
name: 'vue-treeselect--single-value',
inject: ['instance'],
methods: {
renderSingleValueLabel: function renderSingleValueLabel() {
var instance = this.instance;
var node = instance.selectedNodes[0];
var customValueLabelRenderer = instance.$slots['value-label'];
return customValueLabelRenderer ? customValueLabelRenderer({
node: node
}) : node.label;
}
},
render: function render() {
var h = arguments[0];
var instance = this.instance,
renderValueContainer = this.$parent.renderValueContainer;
var shouldShowValue = instance.hasValue && !instance.trigger.searchQuery;
return renderValueContainer([shouldShowValue && Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__single-value"
}, [this.renderSingleValueLabel()]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Placeholder, null, null), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Input, {
"ref": "input"
}, null)]);
}
});
// CONCATENATED MODULE: ./src/components/SingleValue.vue
/* harmony default export */ var SingleValue = (SingleValuevue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/icons/Delete.vue?vue&type=template&id=12b4a02e
var _hoisted_1 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 348.333 348.333"
};
var _hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("path", {
d: "M336.559 68.611L231.016 174.165l105.543 105.549c15.699 15.705 15.699 41.145 0 56.85-7.844 7.844-18.128 11.769-28.407 11.769-10.296 0-20.581-3.919-28.419-11.769L174.167 231.003 68.609 336.563c-7.843 7.844-18.128 11.769-28.416 11.769-10.285 0-20.563-3.919-28.413-11.769-15.699-15.698-15.699-41.139 0-56.85l105.54-105.549L11.774 68.611c-15.699-15.699-15.699-41.145 0-56.844 15.696-15.687 41.127-15.687 56.829 0l105.563 105.554L279.721 11.767c15.705-15.687 41.139-15.687 56.832 0 15.705 15.699 15.705 41.145.006 56.844z"
}, null, -1);
function Deletevue_type_template_id_12b4a02e_render(_ctx, _cache, $props, $setup, $data, $options) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("svg", _hoisted_1, [_hoisted_2]);
}
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/icons/Delete.vue?vue&type=script&lang=js
/* harmony default export */ var Deletevue_type_script_lang_js = ({
name: 'vue-treeselect--x'
});
// CONCATENATED MODULE: ./src/components/icons/Delete.vue
Deletevue_type_script_lang_js.render = Deletevue_type_template_id_12b4a02e_render
/* harmony default export */ var Delete = (Deletevue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/MultiValueItem.vue?vue&type=script&lang=js
function MultiValueItemvue_type_script_lang_js_isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["isVNode"])(s);
}
/* harmony default export */ var MultiValueItemvue_type_script_lang_js = ({
name: 'vue-treeselect--multi-value-item',
inject: ['instance'],
props: {
node: {
type: Object,
required: true
}
},
methods: {
handleMouseDown: onLeftClick(function handleMouseDown() {
var instance = this.instance,
node = this.node; // Deselect this node.
instance.select(node);
})
},
render: function render() {
var h = arguments[0];
var instance = this.instance,
node = this.node;
var itemClass = {
'vue-treeselect__multi-value-item': true,
'vue-treeselect__multi-value-item-disabled': node.isDisabled,
'vue-treeselect__multi-value-item-new': node.isNew
};
var customValueLabelRenderer = instance.$slots['value-label'];
var labelRenderer = customValueLabelRenderer ? customValueLabelRenderer({
node: node
}) : node.label;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__multi-value-item-container"
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": itemClass,
"onMousedown": this.handleMouseDown
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": "vue-treeselect__multi-value-label"
}, MultiValueItemvue_type_script_lang_js_isSlot(labelRenderer) ? labelRenderer : {
default: function _default() {
return [labelRenderer];
}
}), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": "vue-treeselect__icon vue-treeselect__value-remove"
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Delete, null, null)])])]);
}
});
// CONCATENATED MODULE: ./src/components/MultiValueItem.vue
/* harmony default export */ var MultiValueItem = (MultiValueItemvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/MultiValue.vue?vue&type=script&lang=js
/* harmony default export */ var MultiValuevue_type_script_lang_js = ({
name: 'vue-treeselect--multi-value',
inject: ['instance'],
methods: {
renderMultiValueItems: function renderMultiValueItems() {
var h = this.$createElement;
var instance = this.instance;
return instance.internalValue.slice(0, instance.limit).map(instance.getNode).map(function (node) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(MultiValueItem, {
"key": "multi-value-item-".concat(node.id),
"node": node
}, null);
});
},
renderExceedLimitTip: function renderExceedLimitTip() {
var h = this.$createElement;
var instance = this.instance;
var count = instance.internalValue.length - instance.limit;
if (count <= 0) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__limit-tip vue-treeselect-helper-zoom-effect-off",
"key": "exceed-limit-tip"
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": "vue-treeselect__limit-tip-text"
}, [instance.limitText(count)])]);
}
},
render: function render() {
var _this = this;
var h = arguments[0];
var renderValueContainer = this.$parent.renderValueContainer; // const transitionGroupProps = {
// props: {
// tag: 'div',
// name: 'vue-treeselect__multi-value-item--transition',
// appear: true,
// },
// }
return renderValueContainer(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("transition-group"), {
"class": "vue-treeselect__multi-value",
"tag": "div",
"name": "vue-treeselect__multi-value-item--transition",
"appear": true
}, {
default: function _default() {
return [_this.renderMultiValueItems(), _this.renderExceedLimitTip(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Placeholder, {
"key": "placeholder"
}, null), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Input, {
"ref": "input",
"key": "input"
}, null)];
}
}));
}
});
// CONCATENATED MODULE: ./src/components/MultiValue.vue
/* harmony default export */ var MultiValue = (MultiValuevue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/icons/Arrow.vue?vue&type=template&id=5d5151cb
var Arrowvue_type_template_id_5d5151cb_hoisted_1 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 292.362 292.362"
};
var Arrowvue_type_template_id_5d5151cb_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("path", {
d: "M286.935 69.377c-3.614-3.617-7.898-5.424-12.848-5.424H18.274c-4.952 0-9.233 1.807-12.85 5.424C1.807 72.998 0 77.279 0 82.228c0 4.948 1.807 9.229 5.424 12.847l127.907 127.907c3.621 3.617 7.902 5.428 12.85 5.428s9.233-1.811 12.847-5.428L286.935 95.074c3.613-3.617 5.427-7.898 5.427-12.847 0-4.948-1.814-9.229-5.427-12.85z"
}, null, -1);
function Arrowvue_type_template_id_5d5151cb_render(_ctx, _cache, $props, $setup, $data, $options) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("svg", Arrowvue_type_template_id_5d5151cb_hoisted_1, [Arrowvue_type_template_id_5d5151cb_hoisted_2]);
}
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/icons/Arrow.vue?vue&type=script&lang=js
/* harmony default export */ var Arrowvue_type_script_lang_js = ({
name: 'vue-treeselect--arrow'
});
// CONCATENATED MODULE: ./src/components/icons/Arrow.vue
Arrowvue_type_script_lang_js.render = Arrowvue_type_template_id_5d5151cb_render
/* harmony default export */ var Arrow = (Arrowvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Control.vue?vue&type=script&lang=js
function Controlvue_type_script_lang_js_isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["isVNode"])(s);
}
/* harmony default export */ var Controlvue_type_script_lang_js = ({
name: 'vue-treeselect--control',
inject: ['instance'],
computed: {
/* eslint-disable valid-jsdoc */
/**
* Should show the "×" button that resets value?
* @return {boolean}
*/
shouldShowX: function shouldShowX() {
var instance = this.instance;
return instance.clearable && !instance.disabled && instance.hasValue && (this.hasUndisabledValue || instance.allowClearingDisabled);
},
/**
* Should show the arrow button that toggles menu?
* @return {boolean}
*/
shouldShowArrow: function shouldShowArrow() {
var instance = this.instance;
if (!instance.alwaysOpen) return true; // Even with `alwaysOpen: true`, sometimes the menu is still closed,
// e.g. when the control is disabled.
return !instance.menu.isOpen;
},
/**
* Has any undisabled option been selected?
* @type {boolean}
*/
hasUndisabledValue: function hasUndisabledValue() {
var instance = this.instance;
return instance.hasValue && instance.internalValue.some(function (id) {
return !instance.getNode(id).isDisabled;
});
}
/* eslint-enable valid-jsdoc */
},
methods: {
renderX: function renderX() {
var h = this.$createElement;
var instance = this.instance;
var title = instance.multiple ? instance.clearAllText : instance.clearValueText;
if (!this.shouldShowX) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__x-container",
"title": title,
"onMousedown": this.handleMouseDownOnX
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Delete, {
"class": "vue-treeselect__x"
}, null)]);
},
renderArrow: function renderArrow() {
var h = this.$createElement;
var instance = this.instance;
var arrowClass = {
'vue-treeselect__control-arrow': true,
'vue-treeselect__control-arrow--rotated': instance.menu.isOpen
};
if (!this.shouldShowArrow) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__control-arrow-container",
"onMousedown": this.handleMouseDownOnArrow
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Arrow, {
"class": arrowClass
}, null)]);
},
handleMouseDownOnX: onLeftClick(function handleMouseDownOnX(evt) {
/**
* We don't use async/await here because we don't want
* to rely on Babel polyfill or regenerator runtime.
* See: https://babeljs.io/docs/plugins/transform-regenerator/
* We also don't want to assume there is a global `Promise`
* class, since we are targeting to support IE9 without the
* need of any polyfill.
*/
evt.stopPropagation();
evt.preventDefault();
var instance = this.instance;
var result = instance.beforeClearAll();
var handler = function handler(shouldClear) {
if (shouldClear) instance.clear();
};
if (is_promise_default()(result)) {
// The handler will be called async.
result.then(handler);
} else {
// Keep the same behavior here.
setTimeout(function () {
return handler(result);
}, 0); // Also, note that IE9 requires:
// setTimeout(() => fn(...args), delay)
// Instead of:
// setTimeout(fn, delay, ...args)
}
}),
handleMouseDownOnArrow: onLeftClick(function handleMouseDownOnArrow(evt) {
evt.preventDefault();
evt.stopPropagation();
var instance = this.instance; // Focus the input or prevent blurring.
instance.focusInput();
instance.toggleMenu();
}),
// This is meant to be called by child `<Value />` component.
renderValueContainer: function renderValueContainer(children) {
var h = this.$createElement;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__value-container"
}, Controlvue_type_script_lang_js_isSlot(children) ? children : {
default: function _default() {
return [children];
}
});
}
},
render: function render() {
var h = arguments[0];
var instance = this.instance;
var ValueContainer = instance.single ? SingleValue : MultiValue;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__control",
"onMousedown": instance.handleMouseDown
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(ValueContainer, {
"ref": "value-container"
}, null), this.renderX(), this.renderArrow()]);
}
});
// CONCATENATED MODULE: ./src/components/Control.vue
/* harmony default export */ var Control = (Controlvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/watch-size/index.es.mjs
var index_es_index = (function (element, listener) {
var expand = document.createElement('_');
var shrink = expand.appendChild(document.createElement('_'));
var expandChild = expand.appendChild(document.createElement('_'));
var shrinkChild = shrink.appendChild(document.createElement('_'));
var lastWidth = void 0,
lastHeight = void 0;
shrink.style.cssText = expand.style.cssText = 'height:100%;left:0;opacity:0;overflow:hidden;pointer-events:none;position:absolute;top:0;transition:0s;width:100%;z-index:-1';
shrinkChild.style.cssText = expandChild.style.cssText = 'display:block;height:100%;transition:0s;width:100%';
shrinkChild.style.width = shrinkChild.style.height = '200%';
element.appendChild(expand);
test();
return stop;
function test() {
unbind();
var width = element.offsetWidth;
var height = element.offsetHeight;
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
expandChild.style.width = width * 2 + 'px';
expandChild.style.height = height * 2 + 'px';
expand.scrollLeft = expand.scrollWidth;
expand.scrollTop = expand.scrollHeight;
shrink.scrollLeft = shrink.scrollWidth;
shrink.scrollTop = shrink.scrollHeight;
listener({ width: width, height: height });
}
shrink.addEventListener('scroll', test);
expand.addEventListener('scroll', test);
}
function unbind() {
shrink.removeEventListener('scroll', test);
expand.removeEventListener('scroll', test);
}
function stop() {
unbind();
element.removeChild(expand);
}
});
/* harmony default export */ var index_es = (index_es_index);
// CONCATENATED MODULE: ./src/utils/watchSize.js
var intervalId;
var registered = [];
var INTERVAL_DURATION = 100;
function run() {
intervalId = setInterval(function () {
registered.forEach(test);
}, INTERVAL_DURATION);
}
function stop() {
clearInterval(intervalId);
intervalId = null;
}
function test(item) {
var $el = item.$el,
listener = item.listener,
lastWidth = item.lastWidth,
lastHeight = item.lastHeight;
var width = $el.offsetWidth;
var height = $el.offsetHeight;
if (lastWidth !== width || lastHeight !== height) {
item.lastWidth = width;
item.lastHeight = height;
listener({
width: width,
height: height
});
}
}
function watchSizeForIE9($el, listener) {
var item = {
$el: $el,
listener: listener,
lastWidth: null,
lastHeight: null
};
var unwatch = function unwatch() {
removeFromArray(registered, item);
if (!registered.length) stop();
};
registered.push(item); // The original watch-size will call the listener on initialization.
// Keep the same behavior here.
test(item);
run();
return unwatch;
}
function watchSize($el, listener) {
// See: https://stackoverflow.com/a/31293352
var isIE9 = document.documentMode === 9; // watch-size will call the listener on initialization.
// Disable this behavior with a lock to achieve a clearer code logic.
var locked = true;
var wrappedListener = function wrappedListener() {
return locked || listener.apply(void 0, arguments);
};
var implementation = isIE9 ? watchSizeForIE9 : index_es;
var removeSizeWatcher = implementation($el, wrappedListener);
locked = false; // unlock after initialization
return removeSizeWatcher;
}
// CONCATENATED MODULE: ./src/utils/setupResizeAndScrollEventListeners.js
function findScrollParents($el) {
var $scrollParents = [];
var $parent = $el.parentNode;
while ($parent && $parent.nodeName !== 'BODY' && $parent.nodeType === document.ELEMENT_NODE) {
if (isScrollElment($parent)) $scrollParents.push($parent);
$parent = $parent.parentNode;
}
$scrollParents.push(window);
return $scrollParents;
}
function isScrollElment($el) {
// Firefox wants us to check `-x` and `-y` variations as well
var _getComputedStyle = getComputedStyle($el),
overflow = _getComputedStyle.overflow,
overflowX = _getComputedStyle.overflowX,
overflowY = _getComputedStyle.overflowY;
return /(auto|scroll|overlay)/.test(overflow + overflowY + overflowX);
}
function setupResizeAndScrollEventListeners($el, listener) {
var $scrollParents = findScrollParents($el);
window.addEventListener('resize', listener, {
passive: true
});
$scrollParents.forEach(function (scrollParent) {
scrollParent.addEventListener('scroll', listener, {
passive: true
});
});
return function removeEventListeners() {
window.removeEventListener('resize', listener, {
passive: true
});
$scrollParents.forEach(function ($scrollParent) {
$scrollParent.removeEventListener('scroll', listener, {
passive: true
});
});
};
}
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Tip.vue?vue&type=script&lang=js
/* harmony default export */ var Tipvue_type_script_lang_js = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
name: 'vue-treeselect--tip',
functional: true,
props: {
type: {
type: String,
required: true
},
icon: {
type: String,
required: true
}
},
render: function render(context) {
var h = arguments[0];
var type = this.type,
icon = this.icon;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__tip vue-treeselect__".concat(type, "-tip")
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__icon-container"
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": "vue-treeselect__icon-".concat(icon)
}, null)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": "vue-treeselect__tip-text vue-treeselect__".concat(type, "-tip-text")
}, [this.$slots.default()])]);
}
}));
// CONCATENATED MODULE: ./src/components/Tip.vue
/* harmony default export */ var Tip = (Tipvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Option.vue?vue&type=script&lang=js
function Optionvue_type_script_lang_js_isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["isVNode"])(s);
}
var arrowPlaceholder, checkMark, minusMark;
var Option = {
name: 'vue-treeselect--option',
inject: ['instance'],
props: {
node: {
type: Object,
required: true
}
},
computed: {
shouldExpand: function shouldExpand() {
var instance = this.instance,
node = this.node;
return node.isBranch && instance.shouldExpand(node);
},
shouldShow: function shouldShow() {
var instance = this.instance,
node = this.node;
return instance.shouldShowOptionInMenu(node);
}
},
methods: {
renderOption: function renderOption() {
var h = this.$createElement;
var instance = this.instance,
node = this.node;
var optionClass = {
'vue-treeselect__option': true,
'vue-treeselect__option--disabled': node.isDisabled,
'vue-treeselect__option--selected': instance.isSelected(node),
'vue-treeselect__option--highlight': node.isHighlighted,
'vue-treeselect__option--matched': instance.localSearch.active && node.isMatched,
'vue-treeselect__option--hide': !this.shouldShow
};
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": optionClass,
"onMouseenter": this.handleMouseEnterOption,
"data-id": node.id
}, [this.renderArrow(), this.renderLabelContainer([this.renderCheckboxContainer([this.renderCheckbox()]), this.renderLabel()])]);
},
renderSubOptionsList: function renderSubOptionsList() {
var h = this.$createElement;
if (!this.shouldExpand) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__list"
}, [this.renderSubOptions(), this.renderNoChildrenTip(), this.renderLoadingChildrenTip(), this.renderLoadingChildrenErrorTip()]);
},
renderArrow: function renderArrow() {
var h = this.$createElement;
var instance = this.instance,
node = this.node;
if (instance.shouldFlattenOptions && this.shouldShow) return null;
if (node.isBranch) {
var _slot;
var arrowClass = {
'vue-treeselect__option-arrow': true,
'vue-treeselect__option-arrow--rotated': this.shouldExpand
};
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__option-arrow-container",
"onMousedown": this.handleMouseDownOnArrow
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("transition"), {
"name": "vue-treeselect__option-arrow--prepare",
"appear": true
}, Optionvue_type_script_lang_js_isSlot(_slot = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Arrow, {
"class": arrowClass
}, null)) ? _slot : {
default: function _default() {
return [_slot];
}
})]);
} // For leaf nodes, we render a placeholder to keep its label aligned to
// branch nodes. Unless there is no branch nodes at all (a normal
// non-tree select).
if (
/*node.isLeaf && */
instance.hasBranchNodes) {
if (!arrowPlaceholder) arrowPlaceholder = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__option-arrow-placeholder"
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])("\xA0")]);
return arrowPlaceholder;
}
return null;
},
renderLabelContainer: function renderLabelContainer(children) {
var h = this.$createElement;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__label-container",
"onMousedown": this.handleMouseDownOnLabelContainer
}, Optionvue_type_script_lang_js_isSlot(children) ? children : {
default: function _default() {
return [children];
}
});
},
renderCheckboxContainer: function renderCheckboxContainer(children) {
var h = this.$createElement;
var instance = this.instance,
node = this.node;
if (instance.single) return null;
if (instance.disableBranchNodes && node.isBranch) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__checkbox-container"
}, Optionvue_type_script_lang_js_isSlot(children) ? children : {
default: function _default() {
return [children];
}
});
},
renderCheckbox: function renderCheckbox() {
var h = this.$createElement;
var instance = this.instance,
node = this.node;
var checkedState = instance.forest.checkedStateMap[node.id];
var checkboxClass = {
'vue-treeselect__checkbox': true,
'vue-treeselect__checkbox--checked': checkedState === CHECKED,
'vue-treeselect__checkbox--indeterminate': checkedState === INDETERMINATE,
'vue-treeselect__checkbox--unchecked': checkedState === UNCHECKED,
'vue-treeselect__checkbox--disabled': node.isDisabled
};
if (!checkMark) checkMark = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": "vue-treeselect__check-mark"
}, null);
if (!minusMark) minusMark = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": "vue-treeselect__minus-mark"
}, null);
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": checkboxClass
}, [checkMark, minusMark]);
},
renderLabel: function renderLabel() {
var h = this.$createElement;
var instance = this.instance,
node = this.node;
var shouldShowCount = node.isBranch && (instance.localSearch.active ? instance.showCountOnSearchComputed : instance.showCount);
var count = shouldShowCount ? instance.localSearch.active ? instance.localSearch.countMap[node.id][instance.showCountOf] : node.count[instance.showCountOf] : NaN;
var labelClassName = 'vue-treeselect__label';
var countClassName = 'vue-treeselect__count';
var customLabelRenderer = instance.$slots['option-label'];
if (customLabelRenderer) return customLabelRenderer({
node: node,
shouldShowCount: shouldShowCount,
count: count,
labelClassName: labelClassName,
countClassName: countClassName
});
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("label", {
"class": labelClassName
}, [node.label, shouldShowCount && Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("span", {
"class": countClassName
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])("("), count, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(")")])]);
},
renderSubOptions: function renderSubOptions() {
var h = this.$createElement;
var node = this.node;
if (!node.childrenStates.isLoaded) return null;
return node.children.map(function (childNode) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("vue-treeselect--option"), {
"node": childNode,
"key": childNode.id
}, null);
});
},
renderNoChildrenTip: function renderNoChildrenTip() {
var h = this.$createElement;
var instance = this.instance,
node = this.node;
if (!node.childrenStates.isLoaded || node.children.length) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "no-children",
"icon": "warning"
}, {
default: function _default() {
return [instance.noChildrenText];
}
});
},
renderLoadingChildrenTip: function renderLoadingChildrenTip() {
var h = this.$createElement;
var instance = this.instance,
node = this.node;
if (!node.childrenStates.isLoading) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "loading",
"icon": "loader"
}, {
default: function _default() {
return [instance.loadingText];
}
});
},
renderLoadingChildrenErrorTip: function renderLoadingChildrenErrorTip() {
var _this = this;
var h = this.$createElement;
var instance = this.instance,
node = this.node;
if (!node.childrenStates.loadingError) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "error",
"icon": "error"
}, {
default: function _default() {
return [node.childrenStates.loadingError, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("a", {
"class": "vue-treeselect__retry",
"title": instance.retryTitle,
"onMousedown": _this.handleMouseDownOnRetry
}, [instance.retryText])];
}
});
},
handleMouseEnterOption: function handleMouseEnterOption(evt) {
var instance = this.instance,
node = this.node; // Equivalent to `self` modifier.
// istanbul ignore next
if (evt.target !== evt.currentTarget) return;
instance.setCurrentHighlightedOption(node, false);
},
handleMouseDownOnArrow: onLeftClick(function handleMouseDownOnOptionArrow() {
var instance = this.instance,
node = this.node;
instance.toggleExpanded(node);
}),
handleMouseDownOnLabelContainer: onLeftClick(function handleMouseDownOnLabelContainer() {
var instance = this.instance,
node = this.node;
if (node.isBranch && instance.disableBranchNodes) {
instance.toggleExpanded(node);
} else {
instance.select(node);
}
}),
handleMouseDownOnRetry: onLeftClick(function handleMouseDownOnRetry() {
var instance = this.instance,
node = this.node;
instance.loadChildrenOptions(node);
})
},
render: function render() {
var _slot2;
var h = arguments[0];
var node = this.node;
var indentLevel = this.instance.shouldFlattenOptions ? 0 : node.level;
var listItemClass = _defineProperty({
'vue-treeselect__list-item': true
}, "vue-treeselect__indent-level-".concat(indentLevel), true);
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": listItemClass
}, [this.renderOption(), node.isBranch ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("transition"), {
"name": "vue-treeselect__list--transition"
}, Optionvue_type_script_lang_js_isSlot(_slot2 = this.renderSubOptionsList()) ? _slot2 : {
default: function _default() {
return [_slot2];
}
}) : '']);
}
}; // eslint-disable-next-line vue/require-direct-export
/* harmony default export */ var Optionvue_type_script_lang_js = (Option);
// CONCATENATED MODULE: ./src/components/Option.vue
/* harmony default export */ var components_Option = (Optionvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Menu.vue?vue&type=script&lang=js
function Menuvue_type_script_lang_js_isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["isVNode"])(s);
}
var directionMap = {
top: 'top',
bottom: 'bottom',
above: 'top',
below: 'bottom'
};
/* harmony default export */ var Menuvue_type_script_lang_js = ({
name: 'vue-treeselect--menu',
inject: ['instance'],
computed: {
menuStyle: function menuStyle() {
var instance = this.instance;
return {
maxHeight: instance.maxHeight + 'px'
};
},
menuContainerStyle: function menuContainerStyle() {
var instance = this.instance;
return {
zIndex: instance.appendToBody ? null : instance.zIndex
};
}
},
watch: {
'instance.menu.isOpen': function instanceMenuIsOpen(newValue) {
if (newValue) {
// In case `openMenu()` is just called and the menu is not rendered yet.
this.$nextTick(this.onMenuOpen);
} else {
this.onMenuClose();
}
}
},
created: function created() {
this.menuSizeWatcher = null;
this.menuResizeAndScrollEventListeners = null;
},
mounted: function mounted() {
var instance = this.instance;
if (instance.menu.isOpen) this.$nextTick(this.onMenuOpen);
},
unmounted: function unmounted() {
this.onMenuClose();
},
methods: {
renderMenu: function renderMenu() {
var h = this.$createElement;
var instance = this.instance;
if (!instance.menu.isOpen) return null;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"ref": "menu",
"class": "vue-treeselect__menu",
"onMousedown": instance.handleMouseDown,
"style": this.menuStyle
}, [this.renderBeforeList(), instance.async ? this.renderAsyncSearchMenuInner() : instance.localSearch.active ? this.renderLocalSearchMenuInner() : this.renderNormalMenuInner(), this.renderAfterList()]);
},
renderBeforeList: function renderBeforeList() {
var instance = this.instance;
var beforeListRenderer = instance.$slots['before-list'];
return beforeListRenderer ? beforeListRenderer() : null;
},
renderAfterList: function renderAfterList() {
var instance = this.instance;
var afterListRenderer = instance.$slots['after-list'];
return afterListRenderer ? afterListRenderer() : null;
},
renderNormalMenuInner: function renderNormalMenuInner() {
var instance = this.instance;
if (instance.rootOptionsStates.isLoading) {
return this.renderLoadingOptionsTip();
} else if (instance.rootOptionsStates.loadingError) {
return this.renderLoadingRootOptionsErrorTip();
} else if (instance.rootOptionsStates.isLoaded && instance.forest.normalizedOptions.length === 0) {
return this.renderNoAvailableOptionsTip();
} else {
return this.renderOptionList();
}
},
renderLocalSearchMenuInner: function renderLocalSearchMenuInner() {
var instance = this.instance;
if (instance.rootOptionsStates.isLoading) {
return this.renderLoadingOptionsTip();
} else if (instance.rootOptionsStates.loadingError) {
return this.renderLoadingRootOptionsErrorTip();
} else if (instance.rootOptionsStates.isLoaded && instance.forest.normalizedOptions.length === 0) {
return this.renderNoAvailableOptionsTip();
} else if (instance.localSearch.noResults) {
return this.renderNoResultsTip();
} else {
return this.renderOptionList();
}
},
renderAsyncSearchMenuInner: function renderAsyncSearchMenuInner() {
var instance = this.instance;
var entry = instance.getRemoteSearchEntry();
var shouldShowSearchPromptTip = instance.trigger.searchQuery === '' && !instance.defaultOptions;
var shouldShowNoResultsTip = shouldShowSearchPromptTip ? false : entry.isLoaded && entry.options.length === 0;
if (shouldShowSearchPromptTip) {
return this.renderSearchPromptTip();
} else if (entry.isLoading) {
return this.renderLoadingOptionsTip();
} else if (entry.loadingError) {
return this.renderAsyncSearchLoadingErrorTip();
} else if (shouldShowNoResultsTip) {
return this.renderNoResultsTip();
} else {
return this.renderOptionList();
}
},
renderOptionList: function renderOptionList() {
var h = this.$createElement;
var instance = this.instance;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__list"
}, [instance.forest.normalizedOptions.map(function (rootNode) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(components_Option, {
"node": rootNode,
"key": rootNode.id
}, null);
})]);
},
renderSearchPromptTip: function renderSearchPromptTip() {
var h = this.$createElement;
var instance = this.instance;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "search-prompt",
"icon": "warning"
}, {
default: function _default() {
return [instance.searchPromptText];
}
});
},
renderLoadingOptionsTip: function renderLoadingOptionsTip() {
var h = this.$createElement;
var instance = this.instance;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "loading",
"icon": "loader"
}, {
default: function _default() {
return [instance.loadingText];
}
});
},
renderLoadingRootOptionsErrorTip: function renderLoadingRootOptionsErrorTip() {
var h = this.$createElement;
var instance = this.instance;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "error",
"icon": "error"
}, {
default: function _default() {
return [instance.rootOptionsStates.loadingError, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("a", {
"class": "vue-treeselect__retry",
"onClick": instance.loadRootOptions,
"title": instance.retryTitle
}, [instance.retryText])];
}
});
},
renderAsyncSearchLoadingErrorTip: function renderAsyncSearchLoadingErrorTip() {
var h = this.$createElement;
var instance = this.instance;
var entry = instance.getRemoteSearchEntry(); // TODO: retryTitle?
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "error",
"icon": "error"
}, {
default: function _default() {
return [entry.loadingError, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("a", {
"class": "vue-treeselect__retry",
"onClick": instance.handleRemoteSearch,
"title": instance.retryTitle
}, [instance.retryText])];
}
});
},
renderNoAvailableOptionsTip: function renderNoAvailableOptionsTip() {
var h = this.$createElement;
var instance = this.instance;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "no-options",
"icon": "warning"
}, {
default: function _default() {
return [instance.noOptionsText];
}
});
},
renderNoResultsTip: function renderNoResultsTip() {
var h = this.$createElement;
var instance = this.instance;
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Tip, {
"type": "no-results",
"icon": "warning"
}, {
default: function _default() {
return [instance.noResultsText];
}
});
},
onMenuOpen: function onMenuOpen() {
this.adjustMenuOpenDirection();
this.setupMenuSizeWatcher();
this.setupMenuResizeAndScrollEventListeners();
},
onMenuClose: function onMenuClose() {
this.removeMenuSizeWatcher();
this.removeMenuResizeAndScrollEventListeners();
},
adjustMenuOpenDirection: function adjustMenuOpenDirection() {
var instance = this.instance;
if (!instance.menu.isOpen) return;
var $menu = instance.getMenu();
var $control = instance.getControl();
var menuRect = $menu.getBoundingClientRect();
var controlRect = $control.getBoundingClientRect();
var menuHeight = menuRect.height;
var viewportHeight = window.innerHeight;
var spaceAbove = controlRect.top;
var spaceBelow = window.innerHeight - controlRect.bottom;
var isControlInViewport = controlRect.top >= 0 && controlRect.top <= viewportHeight || controlRect.top < 0 && controlRect.bottom > 0;
var hasEnoughSpaceBelow = spaceBelow > menuHeight + MENU_BUFFER;
var hasEnoughSpaceAbove = spaceAbove > menuHeight + MENU_BUFFER;
if (!isControlInViewport) {
instance.closeMenu();
} else if (instance.openDirection !== 'auto') {
instance.menu.placement = directionMap[instance.openDirection];
} else if (hasEnoughSpaceBelow || !hasEnoughSpaceAbove) {
instance.menu.placement = 'bottom';
} else {
instance.menu.placement = 'top';
}
},
setupMenuSizeWatcher: function setupMenuSizeWatcher() {
var instance = this.instance;
var $menu = instance.getMenu(); // istanbul ignore next
if (this.menuSizeWatcher) return;
this.menuSizeWatcher = {
remove: watchSize($menu, this.adjustMenuOpenDirection)
};
},
setupMenuResizeAndScrollEventListeners: function setupMenuResizeAndScrollEventListeners() {
var instance = this.instance;
var $control = instance.getControl(); // istanbul ignore next
if (this.menuResizeAndScrollEventListeners) return;
this.menuResizeAndScrollEventListeners = {
remove: setupResizeAndScrollEventListeners($control, this.adjustMenuOpenDirection)
};
},
removeMenuSizeWatcher: function removeMenuSizeWatcher() {
if (!this.menuSizeWatcher) return;
this.menuSizeWatcher.remove();
this.menuSizeWatcher = null;
},
removeMenuResizeAndScrollEventListeners: function removeMenuResizeAndScrollEventListeners() {
if (!this.menuResizeAndScrollEventListeners) return;
this.menuResizeAndScrollEventListeners.remove();
this.menuResizeAndScrollEventListeners = null;
}
},
render: function render() {
var _slot;
var h = arguments[0];
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"ref": "menu-container",
"class": "vue-treeselect__menu-container",
"style": this.menuContainerStyle
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("transition"), {
"name": "vue-treeselect__menu--transition"
}, Menuvue_type_script_lang_js_isSlot(_slot = this.renderMenu()) ? _slot : {
default: function _default() {
return [_slot];
}
})]);
}
});
// CONCATENATED MODULE: ./src/components/Menu.vue
/* harmony default export */ var Menu = (Menuvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/MenuPortal.vue?vue&type=script&lang=js
var PortalTarget = {
name: 'vue-treeselect--portal-target',
inject: ['instance'],
watch: {
'instance.menu.isOpen': function instanceMenuIsOpen(newValue) {
if (newValue) {
this.setupHandlers();
} else {
this.removeHandlers();
}
},
'instance.menu.placement': function instanceMenuPlacement() {
this.updateMenuContainerOffset();
}
},
created: function created() {
this.controlResizeAndScrollEventListeners = null;
this.controlSizeWatcher = null;
},
mounted: function mounted() {
var instance = this.instance;
if (instance.menu.isOpen) this.setupHandlers();
},
methods: {
setupHandlers: function setupHandlers() {
this.updateWidth();
this.updateMenuContainerOffset();
this.setupControlResizeAndScrollEventListeners();
this.setupControlSizeWatcher();
},
removeHandlers: function removeHandlers() {
this.removeControlResizeAndScrollEventListeners();
this.removeControlSizeWatcher();
},
setupControlResizeAndScrollEventListeners: function setupControlResizeAndScrollEventListeners() {
var instance = this.instance;
var $control = instance.getControl(); // istanbul ignore next
if (this.controlResizeAndScrollEventListeners) return;
this.controlResizeAndScrollEventListeners = {
remove: setupResizeAndScrollEventListeners($control, this.updateMenuContainerOffset)
};
},
setupControlSizeWatcher: function setupControlSizeWatcher() {
var _this = this;
var instance = this.instance;
var $control = instance.getControl(); // istanbul ignore next
if (this.controlSizeWatcher) return;
this.controlSizeWatcher = {
remove: watchSize($control, function () {
_this.updateWidth();
_this.updateMenuContainerOffset();
})
};
},
removeControlResizeAndScrollEventListeners: function removeControlResizeAndScrollEventListeners() {
if (!this.controlResizeAndScrollEventListeners) return;
this.controlResizeAndScrollEventListeners.remove();
this.controlResizeAndScrollEventListeners = null;
},
removeControlSizeWatcher: function removeControlSizeWatcher() {
if (!this.controlSizeWatcher) return;
this.controlSizeWatcher.remove();
this.controlSizeWatcher = null;
},
updateWidth: function updateWidth() {
var instance = this.instance;
var $portalTarget = this.$el;
var $control = instance.getControl();
var controlRect = $control.getBoundingClientRect();
$portalTarget.style.width = controlRect.width + 'px';
},
updateMenuContainerOffset: function updateMenuContainerOffset() {
var instance = this.instance;
var $control = instance.getControl();
var $portalTarget = this.$el;
var controlRect = $control.getBoundingClientRect();
var portalTargetRect = $portalTarget.getBoundingClientRect();
var offsetY = instance.menu.placement === 'bottom' ? controlRect.height : 0;
var left = Math.round(controlRect.left - portalTargetRect.left) + 'px';
var top = Math.round(controlRect.top - portalTargetRect.top + offsetY) + 'px';
var menuContainerStyle = this.$refs.menu.$refs['menu-container'].style;
var transformVariations = ['transform', 'webkitTransform', 'MozTransform', 'msTransform'];
var transform = find(transformVariations, function (t) {
return t in document.body.style;
}); // IE9 doesn't support `translate3d()`.
menuContainerStyle[transform] = "translate(".concat(left, ", ").concat(top, ")");
}
},
render: function render() {
var h = arguments[0];
var instance = this.instance;
var portalTargetClass = ['vue-treeselect__portal-target', instance.wrapperClass];
var portalTargetStyle = {
zIndex: instance.zIndex
};
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": portalTargetClass,
"style": portalTargetStyle,
"data-instance-id": instance.getInstanceId()
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Menu, {
"ref": "menu"
}, null)]);
},
unmounted: function unmounted() {
this.removeHandlers();
}
};
var placeholder;
/* harmony default export */ var MenuPortalvue_type_script_lang_js = ({
name: 'vue-treeselect--menu-portal',
created: function created() {
this.portalTarget = null;
},
mounted: function mounted() {
this.setup();
},
unmounted: function unmounted() {
this.teardown();
},
methods: {
setup: function setup() {
var el = document.createElement('div');
document.body.appendChild(el);
this.portalTarget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])(_objectSpread2({
parent: this
}, PortalTarget));
this.portalTarget.mount(el); // this.portalTarget = new Vue({
// el,
// parent: this,
// ...PortalTarget,
// })
},
teardown: function teardown() {
document.body.removeChild(this.portalTarget.$el);
this.portalTarget.$el.innerHTML = '';
this.portalTarget.$destroy();
this.portalTarget = null;
}
},
render: function render() {
var h = arguments[0];
if (!placeholder) placeholder = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])("div", {
"class": "vue-treeselect__menu-placeholder"
}, null);
return placeholder;
}
});
// CONCATENATED MODULE: ./src/components/MenuPortal.vue
/* harmony default export */ var MenuPortal = (MenuPortalvue_type_script_lang_js);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/Treeselect.vue?vue&type=script&lang=js
/* harmony default export */ var Treeselectvue_type_script_lang_js = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
name: 'vue-treeselect',
mixins: [treeselectMixin],
components: {
HiddenFields: HiddenFields,
Control: Control,
Menu: Menu,
MenuPortal: MenuPortal
},
computed: {
wrapperClass: function wrapperClass() {
return {
'vue-treeselect': true,
'vue-treeselect--single': this.single,
'vue-treeselect--multi': this.multiple,
'vue-treeselect--searchable': this.searchable,
'vue-treeselect--disabled': this.disabled,
'vue-treeselect--focused': this.trigger.isFocused,
'vue-treeselect--has-value': this.hasValue,
'vue-treeselect--open': this.menu.isOpen,
'vue-treeselect--open-above': this.menu.placement === 'top',
'vue-treeselect--open-below': this.menu.placement === 'bottom',
'vue-treeselect--branch-nodes-disabled': this.disableBranchNodes,
'vue-treeselect--append-to-body': this.appendToBody
};
}
} // render() {
// return (
// <div ref="wrapper" class={this.wrapperClass}>
// <HiddenFields />
// <Control ref="control" />
// {this.appendToBody ? <MenuPortal ref="portal" /> : <Menu ref="menu" />}
// </div>
// )
// },
}));
// CONCATENATED MODULE: ./src/components/Treeselect.vue
Treeselectvue_type_script_lang_js.render = Treeselectvue_type_template_id_5905dd6c_render
/* harmony default export */ var Treeselect = (Treeselectvue_type_script_lang_js);
// EXTERNAL MODULE: ./styles/style.less
var style = __webpack_require__("d15f");
// CONCATENATED MODULE: ./src/index.js
/* harmony default export */ var src_0 = (Treeselect);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (src_0);
/***/ }),
/***/ "fb6a":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var isObject = __webpack_require__("861d");
var isArray = __webpack_require__("e8b5");
var toAbsoluteIndex = __webpack_require__("23cb");
var toLength = __webpack_require__("50c4");
var toIndexedObject = __webpack_require__("fc6a");
var createProperty = __webpack_require__("8418");
var wellKnownSymbol = __webpack_require__("b622");
var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
var arrayMethodUsesToLength = __webpack_require__("ae40");
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
var SPECIES = wellKnownSymbol('species');
var nativeSlice = [].slice;
var max = Math.max;
// `Array.prototype.slice` method
// https://tc39.es/ecma262/#sec-array.prototype.slice
// fallback for not array-like ES3 strings and DOM objects
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
slice: function slice(start, end) {
var O = toIndexedObject(this);
var length = toLength(O.length);
var k = toAbsoluteIndex(start, length);
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
// inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
var Constructor, result, n;
if (isArray(O)) {
Constructor = O.constructor;
// cross-realm fallback
if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
Constructor = undefined;
} else if (isObject(Constructor)) {
Constructor = Constructor[SPECIES];
if (Constructor === null) Constructor = undefined;
}
if (Constructor === Array || Constructor === undefined) {
return nativeSlice.call(O, k, fin);
}
}
result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
result.length = n;
return result;
}
});
/***/ }),
/***/ "fc6a":
/***/ (function(module, exports, __webpack_require__) {
// toObject with fallback for non-array-like ES3 strings
var IndexedObject = __webpack_require__("44ad");
var requireObjectCoercible = __webpack_require__("1d80");
module.exports = function (it) {
return IndexedObject(requireObjectCoercible(it));
};
/***/ }),
/***/ "fdbc":
/***/ (function(module, exports) {
// iterable DOM collections
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
module.exports = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
/***/ }),
/***/ "fdbf":
/***/ (function(module, exports, __webpack_require__) {
var NATIVE_SYMBOL = __webpack_require__("4930");
module.exports = NATIVE_SYMBOL
// eslint-disable-next-line no-undef
&& !Symbol.sham
// eslint-disable-next-line no-undef
&& typeof Symbol.iterator == 'symbol';
/***/ }),
/***/ "ffd6":
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__("3729"),
isObjectLike = __webpack_require__("1310");
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
/***/ })
/******/ });
});
//# sourceMappingURL=vue3-treeselect.umd.js.map