UNPKG

lin-view-ui

Version:
1,189 lines (1,005 loc) 36.6 kB
import Vue from 'vue'; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global$d = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods var domIterables = { 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 }; var aFunction$2 = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; var aFunction$1 = aFunction$2; // optional / simple context binding var functionBindContext = function (fn, that, length) { aFunction$1(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); }; }; var fails$7 = function (exec) { try { return !!exec(); } catch (error) { return true; } }; var toString = {}.toString; var classofRaw = function (it) { return toString.call(it).slice(8, -1); }; var fails$6 = fails$7; var classof$1 = classofRaw; var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails$6(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof$1(it) == 'String' ? split.call(it, '') : Object(it); } : Object; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible$2 = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; var requireObjectCoercible$1 = requireObjectCoercible$2; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject var toObject$3 = function (argument) { return Object(requireObjectCoercible$1(argument)); }; var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.es/ecma262/#sec-tointeger var toInteger$2 = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; var toInteger$1 = toInteger$2; var min$1 = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength var toLength$2 = function (argument) { return argument > 0 ? min$1(toInteger$1(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; var isObject$5 = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; var classof = classofRaw; // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray // eslint-disable-next-line es/no-array-isarray -- safe var isArray$1 = Array.isArray || function isArray(arg) { return classof(arg) == 'Array'; }; var shared$3 = {exports: {}}; var fails$5 = fails$7; // Detect IE8's incomplete defineProperty implementation var descriptors = !fails$5(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); var objectDefineProperty = {}; var global$c = global$d; var isObject$4 = isObject$5; var document$1 = global$c.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject$4(document$1) && isObject$4(document$1.createElement); var documentCreateElement = function (it) { return EXISTS ? document$1.createElement(it) : {}; }; var DESCRIPTORS$3 = descriptors; var fails$4 = fails$7; var createElement = documentCreateElement; // Thank's IE8 for his funny defineProperty var ie8DomDefine = !DESCRIPTORS$3 && !fails$4(function () { // eslint-disable-next-line es/no-object-defineproperty -- requied for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); var isObject$3 = isObject$5; var anObject$2 = function (it) { if (!isObject$3(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; var isObject$2 = isObject$5; // `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 var toPrimitive$2 = function (input, PREFERRED_STRING) { if (!isObject$2(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$2(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject$2(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$2(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; var DESCRIPTORS$2 = descriptors; var IE8_DOM_DEFINE$1 = ie8DomDefine; var anObject$1 = anObject$2; var toPrimitive$1 = toPrimitive$2; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty objectDefineProperty.f = DESCRIPTORS$2 ? $defineProperty : function defineProperty(O, P, Attributes) { anObject$1(O); P = toPrimitive$1(P, true); anObject$1(Attributes); if (IE8_DOM_DEFINE$1) try { return $defineProperty(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; }; var createPropertyDescriptor$2 = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var DESCRIPTORS$1 = descriptors; var definePropertyModule$1 = objectDefineProperty; var createPropertyDescriptor$1 = createPropertyDescriptor$2; var createNonEnumerableProperty$5 = DESCRIPTORS$1 ? function (object, key, value) { return definePropertyModule$1.f(object, key, createPropertyDescriptor$1(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var global$b = global$d; var createNonEnumerableProperty$4 = createNonEnumerableProperty$5; var setGlobal$3 = function (key, value) { try { createNonEnumerableProperty$4(global$b, key, value); } catch (error) { global$b[key] = value; } return value; }; var global$a = global$d; var setGlobal$2 = setGlobal$3; var SHARED = '__core-js_shared__'; var store$3 = global$a[SHARED] || setGlobal$2(SHARED, {}); var sharedStore = store$3; var store$2 = sharedStore; (shared$3.exports = function (key, value) { return store$2[key] || (store$2[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.14.0', mode: 'global', copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }); var toObject$2 = toObject$3; var hasOwnProperty = {}.hasOwnProperty; var has$6 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty.call(toObject$2(it), key); }; var id = 0; var postfix = Math.random(); var uid$2 = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; var global$9 = global$d; var path$1 = global$9; var path = path$1; var global$8 = global$d; var aFunction = function (variable) { return typeof variable == 'function' ? variable : undefined; }; var getBuiltIn$2 = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global$8[namespace]) : path[namespace] && path[namespace][method] || global$8[namespace] && global$8[namespace][method]; }; var getBuiltIn$1 = getBuiltIn$2; var engineUserAgent = getBuiltIn$1('navigator', 'userAgent') || ''; var global$7 = global$d; var userAgent = engineUserAgent; var process = global$7.process; var versions = process && process.versions; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); version = match[0] < 4 ? 1 : 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]; } } var engineV8Version = version && +version; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = engineV8Version; var fails$3 = fails$7; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$3(function () { var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL$1 = nativeSymbol; var useSymbolAsUid = NATIVE_SYMBOL$1 && !Symbol.sham && typeof Symbol.iterator == 'symbol'; var global$6 = global$d; var shared$2 = shared$3.exports; var has$5 = has$6; var uid$1 = uid$2; var NATIVE_SYMBOL = nativeSymbol; var USE_SYMBOL_AS_UID = useSymbolAsUid; var WellKnownSymbolsStore = shared$2('wks'); var Symbol$1 = global$6.Symbol; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1; var wellKnownSymbol$1 = function (name) { if (!has$5(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) { if (NATIVE_SYMBOL && has$5(Symbol$1, name)) { WellKnownSymbolsStore[name] = Symbol$1[name]; } else { WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); } } return WellKnownSymbolsStore[name]; }; var isObject$1 = isObject$5; var isArray = isArray$1; var wellKnownSymbol = wellKnownSymbol$1; var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesCreate$1 = 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$1(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); }; var bind = functionBindContext; var IndexedObject$1 = indexedObject; var toObject$1 = toObject$3; var toLength$1 = toLength$2; var arraySpeciesCreate = arraySpeciesCreate$1; var push = [].push; // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation var createMethod$1 = 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$1($this); var self = IndexedObject$1(O); var boundFunction = bind(callbackfn, that, 3); var length = toLength$1(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; }; }; var arrayIteration = { // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach forEach: createMethod$1(0), // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map map: createMethod$1(1), // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter filter: createMethod$1(2), // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some some: createMethod$1(3), // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every every: createMethod$1(4), // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find find: createMethod$1(5), // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findIndex findIndex: createMethod$1(6), // `Array.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering filterOut: createMethod$1(7) }; var fails$2 = fails$7; var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; return !!method && fails$2(function () { // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing method.call(null, argument || function () { throw 1; }, 1); }); }; var $forEach = arrayIteration.forEach; var arrayMethodIsStrict = arrayMethodIsStrict$1; var STRICT_METHOD = arrayMethodIsStrict('forEach'); // `Array.prototype.forEach` method implementation // https://tc39.es/ecma262/#sec-array.prototype.foreach var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); // eslint-disable-next-line es/no-array-prototype-foreach -- safe } : [].forEach; var global$5 = global$d; var DOMIterables = domIterables; var forEach = arrayForEach; var createNonEnumerableProperty$3 = createNonEnumerableProperty$5; for (var COLLECTION_NAME in DOMIterables) { var Collection = global$5[COLLECTION_NAME]; var CollectionPrototype = Collection && Collection.prototype; // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { createNonEnumerableProperty$3(CollectionPrototype, 'forEach', forEach); } catch (error) { CollectionPrototype.forEach = forEach; } } var objectGetOwnPropertyDescriptor = {}; var objectPropertyIsEnumerable = {}; var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor$1(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; // toObject with fallback for non-array-like ES3 strings var IndexedObject = indexedObject; var requireObjectCoercible = requireObjectCoercible$2; var toIndexedObject$3 = function (it) { return IndexedObject(requireObjectCoercible(it)); }; var DESCRIPTORS = descriptors; var propertyIsEnumerableModule = objectPropertyIsEnumerable; var createPropertyDescriptor = createPropertyDescriptor$2; var toIndexedObject$2 = toIndexedObject$3; var toPrimitive = toPrimitive$2; var has$4 = has$6; var IE8_DOM_DEFINE = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor objectGetOwnPropertyDescriptor.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject$2(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has$4(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; var redefine$1 = {exports: {}}; var store$1 = sharedStore; var functionToString = Function.toString; // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (typeof store$1.inspectSource != 'function') { store$1.inspectSource = function (it) { return functionToString.call(it); }; } var inspectSource$2 = store$1.inspectSource; var global$4 = global$d; var inspectSource$1 = inspectSource$2; var WeakMap$1 = global$4.WeakMap; var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource$1(WeakMap$1)); var shared$1 = shared$3.exports; var uid = uid$2; var keys = shared$1('keys'); var sharedKey$1 = function (key) { return keys[key] || (keys[key] = uid(key)); }; var hiddenKeys$3 = {}; var NATIVE_WEAK_MAP = nativeWeakMap; var global$3 = global$d; var isObject = isObject$5; var createNonEnumerableProperty$2 = createNonEnumerableProperty$5; var objectHas = has$6; var shared = sharedStore; var sharedKey = sharedKey$1; var hiddenKeys$2 = hiddenKeys$3; var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var WeakMap = global$3.WeakMap; var set, get, has$3; var enforce = function (it) { return has$3(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 || shared.state) { var store = shared.state || (shared.state = new WeakMap()); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function (it, metadata) { if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; wmset.call(store, it, metadata); return metadata; }; get = function (it) { return wmget.call(store, it) || {}; }; has$3 = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys$2[STATE] = true; set = function (it, metadata) { if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty$2(it, STATE, metadata); return metadata; }; get = function (it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has$3 = function (it) { return objectHas(it, STATE); }; } var internalState = { set: set, get: get, has: has$3, enforce: enforce, getterFor: getterFor }; var global$2 = global$d; var createNonEnumerableProperty$1 = createNonEnumerableProperty$5; var has$2 = has$6; var setGlobal$1 = setGlobal$3; var inspectSource = inspectSource$2; var InternalStateModule = internalState; var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(String).split('String'); (redefine$1.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$2(value, 'name')) { createNonEnumerableProperty$1(value, 'name', key); } state = enforceInternalState(value); if (!state.source) { state.source = TEMPLATE.join(typeof key == 'string' ? key : ''); } } if (O === global$2) { if (simple) O[key] = value; else setGlobal$1(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else createNonEnumerableProperty$1(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); }); var objectGetOwnPropertyNames = {}; var toInteger = toInteger$2; 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). var toAbsoluteIndex$1 = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; var toIndexedObject$1 = toIndexedObject$3; var toLength = toLength$2; var toAbsoluteIndex = toAbsoluteIndex$1; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject$1($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 -- NaN check if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check 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; }; }; var arrayIncludes = { // `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) }; var has$1 = has$6; var toIndexedObject = toIndexedObject$3; var indexOf = arrayIncludes.indexOf; var hiddenKeys$1 = hiddenKeys$3; var objectKeysInternal = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has$1(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } return result; }; // IE8- don't enum bug keys var enumBugKeys$2 = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var internalObjectKeys$1 = objectKeysInternal; var enumBugKeys$1 = enumBugKeys$2; var hiddenKeys = enumBugKeys$1.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys$1(O, hiddenKeys); }; var objectGetOwnPropertySymbols = {}; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; var getBuiltIn = getBuiltIn$2; var getOwnPropertyNamesModule = objectGetOwnPropertyNames; var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols; var anObject = anObject$2; // all object keys, includes non-enumerable and symbols var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; var has = has$6; var ownKeys = ownKeys$1; var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor; var definePropertyModule = objectDefineProperty; var copyConstructorProperties$1 = 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)); } }; var fails$1 = fails$7; var replacement = /#|\.prototype\./; var isForced$1 = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails$1(detection) : !!detection; }; var normalize = isForced$1.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced$1.data = {}; var NATIVE = isForced$1.NATIVE = 'N'; var POLYFILL = isForced$1.POLYFILL = 'P'; var isForced_1 = isForced$1; var global$1 = global$d; var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; var createNonEnumerableProperty = createNonEnumerableProperty$5; var redefine = redefine$1.exports; var setGlobal = setGlobal$3; var copyConstructorProperties = copyConstructorProperties$1; var isForced = isForced_1; /* 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 */ var _export = 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$1; } else if (STATIC) { target = global$1[TARGET] || setGlobal(TARGET, {}); } else { target = (global$1[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); } }; var internalObjectKeys = objectKeysInternal; var enumBugKeys = enumBugKeys$2; // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe var objectKeys = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; var $ = _export; var toObject = toObject$3; var nativeKeys = objectKeys; var fails = fails$7; 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)); } }); // // // // // // // // // // // // // // // // // // // var script = { name: "LinLoadingBar", data: function data() { return { // 加载器(转圈圈的那个东西),运动形式 easing: "linear", // 是否为错误类型 isError: false, // 显示加载器 showSpinner: true, // 加载的总进度 totalProgress: 0, // 每次前进的百分比 percentNum: 0, // 加载速度 speed: 5 }; } }; function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { if (typeof shadowMode !== 'boolean') { createInjectorSSR = createInjector; createInjector = shadowMode; shadowMode = false; } // Vue.extend constructor export interop. const options = typeof script === 'function' ? script.options : script; // render functions if (template && template.render) { options.render = template.render; options.staticRenderFns = template.staticRenderFns; options._compiled = true; // functional template if (isFunctionalTemplate) { options.functional = true; } } // scopedId if (scopeId) { options._scopeId = scopeId; } let hook; if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__; } // inject component styles if (style) { style.call(this, createInjectorSSR(context)); } // register component module identifier for async chunk inference if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier); } }; // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook; } else if (style) { hook = shadowMode ? function (context) { style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); } : function (context) { style.call(this, createInjector(context)); }; } if (hook) { if (options.functional) { // register for functional component in vue file const originalRender = options.render; options.render = function renderWithStyleInjection(h, context) { hook.call(context); return originalRender(h, context); }; } else { // inject component registration as beforeCreate hook const existing = options.beforeCreate; options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; } } return script; } /* script */ const __vue_script__ = script; /* template */ var __vue_render__ = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c("div", { staticClass: "lin-loading-bar" }, [ _c( "div", { staticClass: "lin-loading-bar-progress", class: { "lin-loading-bar-error": _vm.isError }, style: { transform: "translateX(-" + (100 - _vm.totalProgress) + "%)" } }, [_c("div", { staticClass: "lin-loading-bar-peg" })] ), _vm._v(" "), _vm.showSpinner ? _c("div", { staticClass: "lin-loading-bar-spinner" }, [ _c("div", { staticClass: "lin-loading-bar-icon", class: { "lin-loading-bar-icon-error": _vm.isError }, style: { "animation-timing-function": _vm.easing } }) ]) : _vm._e() ]) }; var __vue_staticRenderFns__ = []; __vue_render__._withStripped = true; /* style */ const __vue_inject_styles__ = undefined; /* scoped */ const __vue_scope_id__ = undefined; /* module identifier */ const __vue_module_identifier__ = undefined; /* functional template */ const __vue_is_functional_template__ = false; /* style inject */ /* style inject SSR */ /* style inject shadow dom */ const __vue_component__ = /*#__PURE__*/normalizeComponent( { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined ); var LoadingBarConstructor = Vue.extend(__vue_component__); var timer = null; var removeTimer = null; var LLoadingBar = function LLoadingBar() { return new LoadingBarConstructor(); }; // 设置全局配置信息 LoadingBarConstructor.prototype.config = function config(options) { var _this = this; Object.keys(options).forEach(function (key) { if (key === "isError" || key === "totalProgress") { return; } _this[key] = options[key]; }); }; // 初始化加载进度条 LoadingBarConstructor.prototype.init = function init() { clearTimeout(timer); this.totalProgress = 0; this.isError = false; this.vm = this.$mount(); document.body.appendChild(this.vm.$el); return this; }; // 显示加载进度条 LoadingBarConstructor.prototype.start = function start() { var _this2 = this; this.init(); timer = setInterval(function () { // 小于90的时候才进行前进 if (_this2.totalProgress < 90) { _this2.totalProgress += (_this2.percentNum || Math.random()) * _this2.speed; } }, 100); }; // 关闭加载进度条 LoadingBarConstructor.prototype.end = function end() { var _this3 = this; // timer || this.init(); if (!timer) { this.init(); } // 先把总进度设置为100,让他走完 this.totalProgress = 100; clearTimeout(removeTimer); removeTimer = setTimeout(function () { clearTimeout(timer); timer = null; document.body.removeChild(_this3.vm.$el); }, 200); }; // 显示错误进度条 LoadingBarConstructor.prototype.error = function error() { this.end(); this.totalProgress = 100; this.isError = true; }; var LoadingBar = LLoadingBar(); LoadingBar.install = function (Vue) { Vue.prototype.$loadingBar = LoadingBar; }; export default LoadingBar;