(function webpackUniversalModuleDefinition(root, factory) {
|
if(typeof exports === 'object' && typeof module === 'object')
|
module.exports = factory();
|
else if(typeof define === 'function' && define.amd)
|
define([], factory);
|
else if(typeof exports === 'object')
|
exports["uni"] = factory();
|
else
|
root["uni"] = factory();
|
})((typeof self !== 'undefined' ? self : this), function() {
|
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 = 199);
|
/******/ })
|
/************************************************************************/
|
/******/ ([
|
/* 0 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "k", function() { return /* reexport */ supportsPassive; });
|
__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ isFn; });
|
__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ isStr; });
|
__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ isPlainObject; });
|
__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ hasOwn; });
|
__webpack_require__.d(__webpack_exports__, "m", function() { return /* reexport */ toRawType; });
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ cached; });
|
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ camelize; });
|
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ debounce; });
|
__webpack_require__.d(__webpack_exports__, "l", function() { return /* reexport */ throttle; });
|
__webpack_require__.d(__webpack_exports__, "i", function() { return /* reexport */ kebabCase; });
|
__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ deepClone; });
|
__webpack_require__.d(__webpack_exports__, "j", function() { return /* reexport */ plusReady; });
|
|
// UNUSED EXPORTS: isObject, noop, capitalize, setProperties, getLen, formatDateTime, updateElementStyle, guid, looseEqual, uniIdMixin, hexToRgba, parseQuery, stringifyQuery, decodedQuery, callback
|
|
// CONCATENATED MODULE: ./src/shared/env.js
|
var supportsPassive = false;
|
|
try {
|
var opts = {};
|
Object.defineProperty(opts, 'passive', {
|
get: function get() {
|
/* istanbul ignore next */
|
supportsPassive = true;
|
}
|
}); // https://github.com/facebook/flow/issues/285
|
|
window.addEventListener('test-passive', null, opts);
|
} catch (e) {}
|
// CONCATENATED MODULE: ./src/shared/uni-id-mixin.js
|
var realAtob;
|
var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
|
|
if (typeof atob !== 'function') {
|
realAtob = function realAtob(str) {
|
str = String(str).replace(/[\t\n\f\r ]+/g, '');
|
|
if (!b64re.test(str)) {
|
throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
|
} // Adding the padding if missing, for semplicity
|
|
|
str += '=='.slice(2 - (str.length & 3));
|
var bitmap;
|
var result = '';
|
var r1;
|
var r2;
|
var i = 0;
|
|
for (; i < str.length;) {
|
bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
|
result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
|
}
|
|
return result;
|
};
|
} else {
|
// 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
|
realAtob = atob;
|
}
|
|
function b64DecodeUnicode(str) {
|
return decodeURIComponent(realAtob(str).split('').map(function (c) {
|
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
}).join(''));
|
}
|
|
function getCurrentUserInfo() {
|
var token = ( true ? uni : undefined).getStorageSync('uni_id_token') || '';
|
var tokenArr = token.split('.');
|
|
if (!token || tokenArr.length !== 3) {
|
return {
|
uid: null,
|
role: [],
|
permission: [],
|
tokenExpired: 0
|
};
|
}
|
|
var userInfo;
|
|
try {
|
userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
|
} catch (error) {
|
throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
|
}
|
|
userInfo.tokenExpired = userInfo.exp * 1000;
|
delete userInfo.exp;
|
delete userInfo.iat;
|
return userInfo;
|
}
|
|
function uniIdMixin(Vue) {
|
Vue.prototype.uniIDHasRole = function (roleId) {
|
var _getCurrentUserInfo = getCurrentUserInfo(),
|
role = _getCurrentUserInfo.role;
|
|
return role.indexOf(roleId) > -1;
|
};
|
|
Vue.prototype.uniIDHasPermission = function (permissionId) {
|
var _getCurrentUserInfo2 = getCurrentUserInfo(),
|
permission = _getCurrentUserInfo2.permission;
|
|
return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
|
};
|
|
Vue.prototype.uniIDTokenValid = function () {
|
var _getCurrentUserInfo3 = getCurrentUserInfo(),
|
tokenExpired = _getCurrentUserInfo3.tokenExpired;
|
|
return tokenExpired > Date.now();
|
};
|
}
|
// CONCATENATED MODULE: ./src/shared/util.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); }
|
|
var _toString = Object.prototype.toString;
|
var util_hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var _completeValue = function _completeValue(value) {
|
return value > 9 ? value : '0' + value;
|
};
|
|
function isFn(fn) {
|
return typeof fn === 'function';
|
}
|
function isStr(str) {
|
return typeof str === 'string';
|
}
|
function isObject(obj) {
|
return obj !== null && _typeof(obj) === 'object';
|
}
|
function isPlainObject(obj) {
|
return _toString.call(obj) === '[object Object]';
|
}
|
function hasOwn(obj, key) {
|
return util_hasOwnProperty.call(obj, key);
|
}
|
function noop() {}
|
function toRawType(val) {
|
return _toString.call(val).slice(8, -1);
|
}
|
/**
|
* Create a cached version of a pure function.
|
*/
|
|
function cached(fn) {
|
var cache = Object.create(null);
|
return function cachedFn(str) {
|
var hit = cache[str];
|
return hit || (cache[str] = fn(str));
|
};
|
}
|
/**
|
* Camelize a hyphen-delimited string.
|
*/
|
|
var camelizeRE = /-(\w)/g;
|
var camelize = cached(function (str) {
|
return str.replace(camelizeRE, function (_, c) {
|
return c ? c.toUpperCase() : '';
|
});
|
});
|
/**
|
* Capitalize a string.
|
*/
|
|
var capitalize = cached(function (str) {
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
});
|
function setProperties(item, props, propsData) {
|
props.forEach(function (name) {
|
if (hasOwn(propsData, name)) {
|
item[name] = propsData[name];
|
}
|
});
|
}
|
function getLen() {
|
var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
/* eslint-disable no-control-regex */
|
return ('' + str).replace(/[^\x00-\xff]/g, '**').length;
|
}
|
function formatDateTime(_ref) {
|
var _ref$date = _ref.date,
|
date = _ref$date === void 0 ? new Date() : _ref$date,
|
_ref$mode = _ref.mode,
|
mode = _ref$mode === void 0 ? 'date' : _ref$mode;
|
|
if (mode === 'time') {
|
return _completeValue(date.getHours()) + ':' + _completeValue(date.getMinutes());
|
} else {
|
return date.getFullYear() + '-' + _completeValue(date.getMonth() + 1) + '-' + _completeValue(date.getDate());
|
}
|
}
|
function updateElementStyle(element, styles) {
|
for (var attrName in styles) {
|
element.style[attrName] = styles[attrName];
|
}
|
}
|
function guid() {
|
return Math.floor(4294967296 * (1 + Math.random())).toString(16).slice(1);
|
}
|
function debounce(fn, delay) {
|
var timeout;
|
|
var newFn = function newFn() {
|
var _arguments = arguments,
|
_this = this;
|
|
clearTimeout(timeout);
|
|
var timerFn = function timerFn() {
|
return fn.apply(_this, _arguments);
|
};
|
|
timeout = setTimeout(timerFn, delay);
|
};
|
|
newFn.cancel = function () {
|
clearTimeout(timeout);
|
};
|
|
return newFn;
|
}
|
function throttle(fn, wait) {
|
var last = 0;
|
var timeout;
|
|
var _waitCallback;
|
|
var newFn = function newFn() {
|
var _this2 = this;
|
|
for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
|
arg[_key] = arguments[_key];
|
}
|
|
var now = Date.now();
|
clearTimeout(timeout);
|
|
_waitCallback = function waitCallback() {
|
_waitCallback = null;
|
last = now;
|
fn.apply(_this2, arg);
|
};
|
|
if (now - last < wait) {
|
timeout = setTimeout(_waitCallback, wait - (now - last));
|
return;
|
}
|
|
_waitCallback();
|
};
|
|
newFn.cancel = function () {
|
clearTimeout(timeout);
|
_waitCallback = null;
|
};
|
|
newFn.flush = function () {
|
clearTimeout(timeout);
|
_waitCallback && _waitCallback();
|
};
|
|
return newFn;
|
}
|
function kebabCase(string) {
|
return string.replace(/[A-Z]/g, function (str) {
|
return '-' + str.toLowerCase();
|
});
|
}
|
/**
|
* Check if two values are loosely equal - that is,
|
* if they are plain objects, do they have the same shape?
|
*/
|
|
function looseEqual(a, b) {
|
if (a === b) return true;
|
var isObjectA = isObject(a);
|
var isObjectB = isObject(b);
|
|
if (isObjectA && isObjectB) {
|
try {
|
var isArrayA = Array.isArray(a);
|
var isArrayB = Array.isArray(b);
|
|
if (isArrayA && isArrayB) {
|
return a.length === b.length && a.every(function (e, i) {
|
return looseEqual(e, b[i]);
|
});
|
} else if (a instanceof Date && b instanceof Date) {
|
return a.getTime() === b.getTime();
|
} else if (!isArrayA && !isArrayB) {
|
var keysA = Object.keys(a);
|
var keysB = Object.keys(b);
|
return keysA.length === keysB.length && keysA.every(function (key) {
|
return looseEqual(a[key], b[key]);
|
});
|
} else {
|
/* istanbul ignore next */
|
return false;
|
}
|
} catch (e) {
|
/* istanbul ignore next */
|
return false;
|
}
|
} else if (!isObjectA && !isObjectB) {
|
return String(a) === String(b);
|
} else {
|
return false;
|
}
|
}
|
function deepClone(vnodes, createElement) {
|
function cloneVNode(vnode) {
|
var clonedChildren = vnode.children && vnode.children.map(cloneVNode);
|
var cloned = createElement(vnode.tag, vnode.data, clonedChildren);
|
cloned.text = vnode.text;
|
cloned.isComment = vnode.isComment;
|
cloned.componentOptions = vnode.componentOptions;
|
cloned.elm = vnode.elm;
|
cloned.context = vnode.context;
|
cloned.ns = vnode.ns;
|
cloned.isStatic = vnode.isStatic;
|
cloned.key = vnode.key;
|
return cloned;
|
}
|
|
return vnodes.map(cloneVNode);
|
}
|
|
// CONCATENATED MODULE: ./src/shared/color.js
|
function hexToRgba(hex) {
|
var r;
|
var g;
|
var b;
|
hex = hex.replace('#', '');
|
|
if (hex.length === 6) {
|
r = hex.substring(0, 2);
|
g = hex.substring(2, 4);
|
b = hex.substring(4, 6);
|
} else if (hex.length === 3) {
|
r = hex.substring(0, 1);
|
g = hex.substring(1, 2);
|
b = hex.substring(2, 3);
|
} else {
|
return false;
|
}
|
|
if (r.length === 1) {
|
r += r;
|
}
|
|
if (g.length === 1) {
|
g += g;
|
}
|
|
if (b.length === 1) {
|
b += b;
|
}
|
|
r = parseInt(r, 16);
|
g = parseInt(g, 16);
|
b = parseInt(b, 16);
|
return {
|
r: r,
|
g: g,
|
b: b
|
};
|
}
|
// CONCATENATED MODULE: ./src/shared/query.js
|
var encodeReserveRE = /[!'()*]/g;
|
|
var encodeReserveReplacer = function encodeReserveReplacer(c) {
|
return '%' + c.charCodeAt(0).toString(16);
|
};
|
|
var commaRE = /%2C/g; // fixed encodeURIComponent which is more conformant to RFC3986:
|
// - escapes [!'()*]
|
// - preserve commas
|
|
var encode = function encode(str) {
|
return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
|
};
|
|
var decode = decodeURIComponent;
|
function parseQuery(query) {
|
var res = {};
|
query = query.trim().replace(/^(\?|#|&)/, '');
|
|
if (!query) {
|
return res;
|
}
|
|
query.split('&').forEach(function (param) {
|
var parts = param.replace(/\+/g, ' ').split('=');
|
var key = decode(parts.shift());
|
var val = parts.length > 0 ? decode(parts.join('=')) : null;
|
|
if (res[key] === undefined) {
|
res[key] = val;
|
} else if (Array.isArray(res[key])) {
|
res[key].push(val);
|
} else {
|
res[key] = [res[key], val];
|
}
|
});
|
return res;
|
}
|
function stringifyQuery(obj) {
|
var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
|
var res = obj ? Object.keys(obj).map(function (key) {
|
var val = obj[key];
|
|
if (val === undefined) {
|
return '';
|
}
|
|
if (val === null) {
|
return encodeStr(key);
|
}
|
|
if (Array.isArray(val)) {
|
var result = [];
|
val.forEach(function (val2) {
|
if (val2 === undefined) {
|
return;
|
}
|
|
if (val2 === null) {
|
result.push(encodeStr(key));
|
} else {
|
result.push(encodeStr(key) + '=' + encodeStr(val2));
|
}
|
});
|
return result.join('&');
|
}
|
|
return encodeStr(key) + '=' + encodeStr(val);
|
}).filter(function (x) {
|
return x.length > 0;
|
}).join('&') : null;
|
return res ? "?".concat(res) : '';
|
}
|
function decodedQuery() {
|
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
var decodedQuery = {};
|
Object.keys(query).forEach(function (name) {
|
try {
|
decodedQuery[name] = decode(query[name]);
|
} catch (e) {
|
decodedQuery[name] = query[name];
|
}
|
});
|
return decodedQuery;
|
}
|
// CONCATENATED MODULE: ./src/shared/platform.js
|
function plusReady(callback) {
|
if (typeof callback !== 'function') {
|
return;
|
}
|
|
if (window.plus) {
|
return callback();
|
}
|
|
document.addEventListener('plusready', callback);
|
}
|
// CONCATENATED MODULE: ./src/shared/callback.js
|
var id = 0;
|
var callbacks = {};
|
|
function warp(fn) {
|
return function () {
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
var callbackId = String(id++);
|
callbacks[callbackId] = {
|
success: options.success,
|
fail: options.fail,
|
complete: options.complete
|
};
|
var data = Object.assign({}, options); // TODO 下版重构 nvue h5 callback
|
// delete data.success
|
// delete data.fail
|
// delete data.complete
|
|
var res = fn.bind(this)(data, callbackId);
|
|
if (res) {
|
invoke(callbackId, res);
|
}
|
};
|
}
|
|
function invoke(callbackId, res) {
|
var callback = callbacks[callbackId] || {};
|
delete callbacks[callbackId];
|
var errMsg = res.errMsg || '';
|
|
if (new RegExp('\\:\\s*fail').test(errMsg)) {
|
callback.fail && callback.fail(res);
|
} else {
|
callback.success && callback.success(res);
|
}
|
|
callback.complete && callback.complete(res);
|
}
|
|
var callback = {
|
warp: warp,
|
invoke: invoke
|
};
|
// CONCATENATED MODULE: ./src/shared/index.js
|
|
|
|
|
|
|
|
/***/ }),
|
/* 1 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
/* globals __VUE_SSR_CONTEXT__ */
|
|
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
// This module is a runtime utility for cleaner component module output and will
|
// be included in the final webpack user bundle.
|
|
function normalizeComponent (
|
scriptExports,
|
render,
|
staticRenderFns,
|
functionalTemplate,
|
injectStyles,
|
scopeId,
|
moduleIdentifier, /* server only */
|
shadowMode /* vue-cli only */
|
) {
|
// Vue.extend constructor export interop
|
var options = typeof scriptExports === 'function'
|
? scriptExports.options
|
: scriptExports
|
|
// render functions
|
if (render) {
|
options.render = render
|
options.staticRenderFns = staticRenderFns
|
options._compiled = true
|
}
|
|
// functional template
|
if (functionalTemplate) {
|
options.functional = true
|
}
|
|
// scopedId
|
if (scopeId) {
|
options._scopeId = 'data-v-' + scopeId
|
}
|
|
var 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 (injectStyles) {
|
injectStyles.call(this, context)
|
}
|
// register component module identifier for async chunk inferrence
|
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 (injectStyles) {
|
hook = shadowMode
|
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
: injectStyles
|
}
|
|
if (hook) {
|
if (options.functional) {
|
// for template-only hot-reload because in that case the render fn doesn't
|
// go through the normalizer
|
options._injectStyles = hook
|
// register for functional component in vue file
|
var originalRender = options.render
|
options.render = function renderWithStyleInjection (h, context) {
|
hook.call(context)
|
return originalRender(h, context)
|
}
|
} else {
|
// inject component registration as beforeCreate hook
|
var existing = options.beforeCreate
|
options.beforeCreate = existing
|
? [].concat(existing, hook)
|
: [hook]
|
}
|
}
|
|
return {
|
exports: scriptExports,
|
options: options
|
}
|
}
|
|
|
/***/ }),
|
/* 2 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _emitter__WEBPACK_IMPORTED_MODULE_0__["a"]; });
|
|
/* harmony import */ var _listeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84);
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _listeners__WEBPACK_IMPORTED_MODULE_1__["a"]; });
|
|
/* harmony import */ var _hover__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _hover__WEBPACK_IMPORTED_MODULE_2__["a"]; });
|
|
/* harmony import */ var _subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85);
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _subscriber__WEBPACK_IMPORTED_MODULE_3__["a"]; });
|
|
/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25);
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_4__["a"]; });
|
|
/* harmony import */ var _field__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(86);
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _field__WEBPACK_IMPORTED_MODULE_5__["a"]; });
|
|
/* harmony import */ var _interact__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26);
|
|
|
|
|
|
|
|
|
/***/ }),
|
/* 3 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* unused harmony export VD_SYNC_VERSION */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return PAGE_CREATE; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return MOUNTED_DATA; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return UPDATED_DATA; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return PAGE_CREATED; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return UI_EVENT; });
|
/* unused harmony export LAYOUT_READY */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return VD_SYNC; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return APP_SERVICE_ID; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return WEBVIEW_READY; });
|
/* unused harmony export WEBVIEW_UI_EVENT */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return VD_SYNC_CALLBACK; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return INVOKE_API; });
|
/* unused harmony export WEB_INVOKE_APPSERVICE */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return WEBVIEW_INSERTED; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return WEBVIEW_REMOVED; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return WEBVIEW_ID_PREFIX; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return SET_LOCALE; });
|
var VD_SYNC_VERSION = 2;
|
var PAGE_CREATE = 2;
|
var MOUNTED_DATA = 4;
|
var UPDATED_DATA = 6;
|
var PAGE_CREATED = 10;
|
var UI_EVENT = 20;
|
var LAYOUT_READY = 30;
|
var VD_SYNC = 'vdSync';
|
var APP_SERVICE_ID = '__uniapp__service';
|
var WEBVIEW_READY = 'webviewReady';
|
var WEBVIEW_UI_EVENT = 'webviewUIEvent';
|
var VD_SYNC_CALLBACK = 'vdSyncCallback';
|
var INVOKE_API = 'invokeApi';
|
var WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE';
|
var WEBVIEW_INSERTED = 'webviewInserted';
|
var WEBVIEW_REMOVED = 'webviewRemoved';
|
var WEBVIEW_ID_PREFIX = 'webviewId';
|
var SET_LOCALE = 'setLocale';
|
|
/***/ }),
|
/* 4 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "on", function() { return /* binding */ on; });
|
__webpack_require__.d(__webpack_exports__, "off", function() { return /* binding */ off; });
|
__webpack_require__.d(__webpack_exports__, "once", function() { return /* binding */ once; });
|
__webpack_require__.d(__webpack_exports__, "emit", function() { return /* binding */ emit; });
|
__webpack_require__.d(__webpack_exports__, "subscribe", function() { return /* binding */ view_bridge_subscribe; });
|
__webpack_require__.d(__webpack_exports__, "unsubscribe", function() { return /* binding */ unsubscribe; });
|
__webpack_require__.d(__webpack_exports__, "subscribeHandler", function() { return /* binding */ subscribeHandler; });
|
__webpack_require__.d(__webpack_exports__, "publishHandler", function() { return /* reexport */ bridge["a" /* publishHandler */]; });
|
|
// EXTERNAL MODULE: ./packages/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js
|
var vue_runtime_esm = __webpack_require__(9);
|
|
// CONCATENATED MODULE: ./src/core/view/bridge/subscribe/api/set-page-meta.js
|
function setPageMeta(_ref) {
|
var pageStyle = _ref.pageStyle,
|
rootFontSize = _ref.rootFontSize;
|
var pageElm = document.querySelector('uni-page-body') || document.body;
|
pageElm.setAttribute('style', pageStyle);
|
|
if (rootFontSize && document.documentElement.style.fontSize !== rootFontSize) {
|
document.documentElement.style.fontSize = rootFontSize;
|
}
|
}
|
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-component-info.js
|
var request_component_info = __webpack_require__(96);
|
|
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-component-observer.js
|
var request_component_observer = __webpack_require__(78);
|
|
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-media-query-observer.js
|
var request_media_query_observer = __webpack_require__(79);
|
|
// CONCATENATED MODULE: ./src/core/view/bridge/subscribe/api/index.js
|
|
|
|
|
/* harmony default export */ var api = ({
|
setPageMeta: setPageMeta,
|
requestComponentInfo: request_component_info["a" /* requestComponentInfo */],
|
requestComponentObserver: request_component_observer["b" /* requestComponentObserver */],
|
destroyComponentObserver: request_component_observer["a" /* destroyComponentObserver */],
|
requestMediaQueryObserver: request_media_query_observer["b" /* requestMediaQueryObserver */],
|
destroyMediaQueryObserver: request_media_query_observer["a" /* destroyMediaQueryObserver */]
|
});
|
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/scroll.js
|
var subscribe_scroll = __webpack_require__(22);
|
|
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/font.js
|
var font = __webpack_require__(97);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/bridge/subscribe/index.js
|
var bridge_subscribe = __webpack_require__(98);
|
|
// CONCATENATED MODULE: ./src/core/view/bridge/subscribe/index.js
|
|
|
|
|
function initSubscribe(subscribe) {
|
Object.keys(api).forEach(function (name) {
|
subscribe(name, api[name]);
|
});
|
subscribe('pageScrollTo', subscribe_scroll["c" /* pageScrollTo */]);
|
subscribe('loadFontFace', font["a" /* loadFontFace */]);
|
Object(bridge_subscribe["a" /* default */])(subscribe);
|
}
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/bridge.js
|
var bridge = __webpack_require__(20);
|
|
// CONCATENATED MODULE: ./src/core/view/bridge/index.js
|
|
|
var Emitter = new vue_runtime_esm["a" /* default */]();
|
var on = Emitter.$on.bind(Emitter);
|
var off = Emitter.$off.bind(Emitter);
|
var once = Emitter.$once.bind(Emitter);
|
var emit = Emitter.$emit.bind(Emitter);
|
function view_bridge_subscribe(event, callback) {
|
return on('service.' + event, callback);
|
}
|
function unsubscribe(event, callback) {
|
return off('service.' + event, callback);
|
}
|
function subscribeHandler(event, args, pageId) {
|
if (true) {
|
console.log("[subscribeHandler][".concat(Date.now(), "]:").concat(event, ", ").concat(JSON.stringify(args), ", ").concat(pageId));
|
}
|
|
emit('service.' + event, args, pageId);
|
}
|
|
initSubscribe(view_bridge_subscribe);
|
|
/***/ }),
|
/* 5 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initScrollBounce; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return disableScrollBounce; });
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
var webview;
|
var pullToRefreshStyle;
|
function initScrollBounce() {
|
Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () {
|
if (!webview) {
|
webview = plus.webview.currentWebview();
|
}
|
|
if (!pullToRefreshStyle) {
|
pullToRefreshStyle = (webview.getStyle() || {}).pullToRefresh || {};
|
}
|
});
|
}
|
function disableScrollBounce(_ref) {
|
var disable = _ref.disable;
|
|
if (pullToRefreshStyle && pullToRefreshStyle.support) {
|
webview.setPullToRefresh(Object.assign({}, pullToRefreshStyle, {
|
support: !disable
|
}));
|
}
|
}
|
|
/***/ }),
|
/* 6 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
var attrs = ['top', 'left', 'right', 'bottom'];
|
var inited;
|
var elementComputedStyle = {};
|
var support;
|
function getSupport() {
|
if (!('CSS' in window) || typeof CSS.supports != 'function') {
|
support = '';
|
}
|
else if (CSS.supports('top: env(safe-area-inset-top)')) {
|
support = 'env';
|
}
|
else if (CSS.supports('top: constant(safe-area-inset-top)')) {
|
support = 'constant';
|
}
|
else {
|
support = '';
|
}
|
return support;
|
}
|
function init() {
|
support = typeof support === 'string' ? support : getSupport();
|
if (!support) {
|
attrs.forEach(function (attr) {
|
elementComputedStyle[attr] = 0;
|
});
|
return;
|
}
|
function setStyle(el, style) {
|
var elStyle = el.style;
|
Object.keys(style).forEach(function (key) {
|
var val = style[key];
|
elStyle[key] = val;
|
});
|
}
|
var cbs = [];
|
function parentReady(callback) {
|
if (callback) {
|
cbs.push(callback);
|
}
|
else {
|
cbs.forEach(function (cb) {
|
cb();
|
});
|
}
|
}
|
var passiveEvents = false;
|
try {
|
var opts = Object.defineProperty({}, 'passive', {
|
get: function () {
|
passiveEvents = { passive: true };
|
}
|
});
|
window.addEventListener('test', null, opts);
|
}
|
catch (e) {
|
}
|
function addChild(parent, attr) {
|
var a1 = document.createElement('div');
|
var a2 = document.createElement('div');
|
var a1Children = document.createElement('div');
|
var a2Children = document.createElement('div');
|
var W = 100;
|
var MAX = 10000;
|
var aStyle = {
|
position: 'absolute',
|
width: W + 'px',
|
height: '200px',
|
boxSizing: 'border-box',
|
overflow: 'hidden',
|
paddingBottom: support + "(safe-area-inset-" + attr + ")"
|
};
|
setStyle(a1, aStyle);
|
setStyle(a2, aStyle);
|
setStyle(a1Children, {
|
transition: '0s',
|
animation: 'none',
|
width: '400px',
|
height: '400px'
|
});
|
setStyle(a2Children, {
|
transition: '0s',
|
animation: 'none',
|
width: '250%',
|
height: '250%'
|
});
|
a1.appendChild(a1Children);
|
a2.appendChild(a2Children);
|
parent.appendChild(a1);
|
parent.appendChild(a2);
|
parentReady(function () {
|
a1.scrollTop = a2.scrollTop = MAX;
|
var a1LastScrollTop = a1.scrollTop;
|
var a2LastScrollTop = a2.scrollTop;
|
function onScroll() {
|
if (this.scrollTop === (this === a1 ? a1LastScrollTop : a2LastScrollTop)) {
|
return;
|
}
|
a1.scrollTop = a2.scrollTop = MAX;
|
a1LastScrollTop = a1.scrollTop;
|
a2LastScrollTop = a2.scrollTop;
|
attrChange(attr);
|
}
|
a1.addEventListener('scroll', onScroll, passiveEvents);
|
a2.addEventListener('scroll', onScroll, passiveEvents);
|
});
|
var computedStyle = getComputedStyle(a1);
|
Object.defineProperty(elementComputedStyle, attr, {
|
configurable: true,
|
get: function () {
|
return parseFloat(computedStyle.paddingBottom);
|
}
|
});
|
}
|
var parentDiv = document.createElement('div');
|
setStyle(parentDiv, {
|
position: 'absolute',
|
left: '0',
|
top: '0',
|
width: '0',
|
height: '0',
|
zIndex: '-1',
|
overflow: 'hidden',
|
visibility: 'hidden',
|
});
|
attrs.forEach(function (key) {
|
addChild(parentDiv, key);
|
});
|
document.body.appendChild(parentDiv);
|
parentReady();
|
inited = true;
|
}
|
function getAttr(attr) {
|
if (!inited) {
|
init();
|
}
|
return elementComputedStyle[attr];
|
}
|
var changeAttrs = [];
|
function attrChange(attr) {
|
if (!changeAttrs.length) {
|
setTimeout(function () {
|
var style = {};
|
changeAttrs.forEach(function (attr) {
|
style[attr] = elementComputedStyle[attr];
|
});
|
changeAttrs.length = 0;
|
callbacks.forEach(function (callback) {
|
callback(style);
|
});
|
}, 0);
|
}
|
changeAttrs.push(attr);
|
}
|
var callbacks = [];
|
function onChange(callback) {
|
if (!getSupport()) {
|
return;
|
}
|
if (!inited) {
|
init();
|
}
|
if (typeof callback === 'function') {
|
callbacks.push(callback);
|
}
|
}
|
function offChange(callback) {
|
var index = callbacks.indexOf(callback);
|
if (index >= 0) {
|
callbacks.splice(index, 1);
|
}
|
}
|
var safeAreaInsets = {
|
get support() {
|
return (typeof support === 'string' ? support : getSupport()).length != 0;
|
},
|
get top() {
|
return getAttr('top');
|
},
|
get left() {
|
return getAttr('left');
|
},
|
get right() {
|
return getAttr('right');
|
},
|
get bottom() {
|
return getAttr('bottom');
|
},
|
onChange: onChange,
|
offChange: offChange
|
};
|
module.exports = safeAreaInsets;
|
//# sourceMappingURL=index.js.map
|
|
/***/ }),
|
/* 7 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75);
|
|
|
function getFixed($el) {
|
var fixed;
|
|
while ($el) {
|
var style = getComputedStyle($el);
|
var transform = style.transform || style.webkitTransform;
|
fixed = transform && transform !== 'none' ? false : fixed;
|
fixed = style.position === 'fixed' ? true : fixed;
|
$el = $el.parentElement;
|
}
|
|
return fixed;
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Native',
|
data: function data() {
|
return {
|
position: {
|
top: '0px',
|
left: '0px',
|
width: '0px',
|
height: '0px',
|
position: 'static'
|
},
|
hidden: false
|
};
|
},
|
provide: function provide() {
|
return {
|
parentOnDraw: this._onDraw
|
};
|
},
|
inject: {
|
parentOnDraw: {
|
default: null
|
}
|
},
|
created: function created() {
|
this.isNative = true;
|
this.onCanInsertCallbacks = [];
|
this.onDrawCallbacks = [];
|
},
|
mounted: function mounted() {
|
this._updatePosition();
|
|
this.onCanInsertCallbacks.forEach(function (callback) {
|
return callback();
|
});
|
this.onCanInsertCallbacks = null;
|
this.$on('uni-view-update', this._requestPositionUpdate);
|
},
|
methods: {
|
_updatePosition: function _updatePosition() {
|
var rect = (this.$refs.container || this.$el).getBoundingClientRect();
|
this.hidden = rect.width === 0 || rect.height === 0;
|
|
if (!this.hidden) {
|
var position = this.position;
|
position.position = getFixed(this.$el) ? 'absolute' : 'static';
|
var keys = ['top', 'left', 'width', 'height'];
|
keys.forEach(function (key) {
|
var val = rect[key];
|
val = key === 'top' ? val + (position.position === 'static' ? document.documentElement.scrollTop || document.body.scrollTop || 0 : Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getNavigationBarHeight */ "a"])()) : val;
|
position[key] = val + 'px';
|
});
|
}
|
},
|
_requestPositionUpdate: function _requestPositionUpdate() {
|
var _this = this;
|
|
if (this._positionUpdateRequest) {
|
cancelAnimationFrame(this._positionUpdateRequest);
|
}
|
|
this._positionUpdateRequest = requestAnimationFrame(function () {
|
delete _this._positionUpdateRequest;
|
|
_this._updatePosition();
|
});
|
},
|
_onParentReady: function _onParentReady(parentReadyCallback) {
|
var _this2 = this;
|
|
var callback = function callback(parentPosition) {
|
parentReadyCallback(parentPosition);
|
|
_this2.onDrawCallbacks.forEach(function (callback) {
|
return callback(_this2.position);
|
});
|
|
_this2.onDrawCallbacks = null;
|
};
|
|
this._onSelfReady(function () {
|
if (_this2.parentOnDraw) {
|
_this2.parentOnDraw(callback);
|
} else {
|
callback({
|
top: '0px',
|
left: '0px',
|
width: Number.MAX_SAFE_INTEGER + 'px',
|
height: Number.MAX_SAFE_INTEGER + 'px',
|
position: 'static'
|
});
|
}
|
});
|
},
|
_onSelfReady: function _onSelfReady(callback) {
|
if (this.onCanInsertCallbacks) {
|
this.onCanInsertCallbacks.push(callback);
|
} else {
|
callback();
|
}
|
},
|
_onDraw: function _onDraw(callback) {
|
if (this.onDrawCallbacks) {
|
this.onDrawCallbacks.push(callback);
|
} else {
|
callback(this.position);
|
}
|
}
|
}
|
});
|
|
/***/ }),
|
/* 8 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* unused harmony export isPage */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasLifecycleHook; });
|
/* unused harmony export normalizeDataset */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getTargetDataset; });
|
/* unused harmony export upx2px */
|
/* unused harmony export findExistsPageIndex */
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
var components = ['SystemAsyncLoading', 'SystemAsyncError'];
|
function isPage(vm) {
|
if (vm.$parent && vm.$parent.$options.name === 'PageBody') {
|
if (components.indexOf(vm.$options.name) !== -1) {
|
return false;
|
}
|
|
return true;
|
}
|
|
return false;
|
}
|
function hasLifecycleHook() {
|
var vueOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
var hook = arguments.length > 1 ? arguments[1] : undefined;
|
return Array.isArray(vueOptions[hook]) && vueOptions[hook].length;
|
}
|
function normalizeDataset() {
|
var dataset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
// ios8.x,9.x Object.assign({},dataset) 始终返回 {}
|
// http://ask.dcloud.net.cn/question/70246
|
var result = JSON.parse(JSON.stringify(dataset));
|
|
if (false) { var _len, key, i, len, keys; }
|
|
return result;
|
}
|
function getTargetDataset(target) {
|
var dataset = {};
|
var vm = target.__vue__;
|
|
function updateDataset(vm, force) {
|
var $attrs = vm.$attrs;
|
|
for (var key in $attrs) {
|
if (key.startsWith('data-')) {
|
var newKey = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* camelize */ "b"])(key.substr(5).toLowerCase());
|
var value = $attrs[key];
|
dataset[newKey] = force ? value : dataset[newKey] || value;
|
}
|
}
|
}
|
|
if (vm) {
|
var $child = vm;
|
|
while ($child && $child.$el === target) {
|
updateDataset($child);
|
$child = $child.$children[0];
|
}
|
|
var $parent = vm.$parent;
|
|
while ($parent && $parent.$el === target) {
|
updateDataset($parent, true);
|
$parent = $parent.$parent;
|
}
|
} else {
|
dataset = target.dataset || {};
|
}
|
|
return normalizeDataset(dataset);
|
}
|
function upx2px(str) {
|
str = str + '';
|
|
if (str.indexOf('upx') !== -1) {
|
// upx转换
|
return uni.upx2px(parseInt(str) || 0);
|
}
|
|
return parseInt(str) || 0;
|
}
|
function findExistsPageIndex(url) {
|
var pages = getCurrentPages();
|
var len = pages.length;
|
|
while (len--) {
|
var page = pages[len];
|
|
if (page.$page && page.$page.fullPath === url) {
|
return len;
|
}
|
}
|
|
return -1;
|
}
|
|
/***/ }),
|
/* 9 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(global) {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); }
|
|
/*!
|
* Vue.js v2.6.11
|
* (c) 2014-2021 Evan You
|
* Released under the MIT License.
|
*/
|
|
/* */
|
var emptyObject = Object.freeze({}); // These helpers produce better VM code in JS engines due to their
|
// explicitness and function inlining.
|
|
function isUndef(v) {
|
return v === undefined || v === null;
|
}
|
|
function isDef(v) {
|
return v !== undefined && v !== null;
|
}
|
|
function isTrue(v) {
|
return v === true;
|
}
|
|
function isFalse(v) {
|
return v === false;
|
}
|
/**
|
* Check if value is primitive.
|
*/
|
|
|
function isPrimitive(value) {
|
return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line
|
_typeof(value) === 'symbol' || typeof value === 'boolean';
|
}
|
/**
|
* Quick object check - this is primarily used to tell
|
* Objects from primitive values when we know the value
|
* is a JSON-compliant type.
|
*/
|
|
|
function isObject(obj) {
|
return obj !== null && _typeof(obj) === 'object';
|
}
|
/**
|
* Get the raw type string of a value, e.g., [object Object].
|
*/
|
|
|
var _toString = Object.prototype.toString;
|
|
function toRawType(value) {
|
return _toString.call(value).slice(8, -1);
|
}
|
/**
|
* Strict object type check. Only returns true
|
* for plain JavaScript objects.
|
*/
|
|
|
function isPlainObject(obj) {
|
return _toString.call(obj) === '[object Object]';
|
}
|
|
function isRegExp(v) {
|
return _toString.call(v) === '[object RegExp]';
|
}
|
/**
|
* Check if val is a valid array index.
|
*/
|
|
|
function isValidArrayIndex(val) {
|
var n = parseFloat(String(val));
|
return n >= 0 && Math.floor(n) === n && isFinite(val);
|
}
|
|
function isPromise(val) {
|
return isDef(val) && typeof val.then === 'function' && typeof val.catch === 'function';
|
}
|
/**
|
* Convert a value to a string that is actually rendered.
|
*/
|
|
|
function toString(val) {
|
return val == null ? '' : Array.isArray(val) || isPlainObject(val) && val.toString === _toString ? JSON.stringify(val, null, 2) : String(val);
|
}
|
/**
|
* Convert an input value to a number for persistence.
|
* If the conversion fails, return original string.
|
*/
|
|
|
function toNumber(val) {
|
var n = parseFloat(val);
|
return isNaN(n) ? val : n;
|
}
|
/**
|
* Make a map and return a function for checking if a key
|
* is in that map.
|
*/
|
|
|
function makeMap(str, expectsLowerCase) {
|
var map = Object.create(null);
|
var list = str.split(',');
|
|
for (var i = 0; i < list.length; i++) {
|
map[list[i]] = true;
|
}
|
|
return expectsLowerCase ? function (val) {
|
return map[val.toLowerCase()];
|
} : function (val) {
|
return map[val];
|
};
|
}
|
/**
|
* Check if a tag is a built-in tag.
|
*/
|
|
|
var isBuiltInTag = makeMap('slot,component', true);
|
/**
|
* Check if an attribute is a reserved attribute.
|
*/
|
|
var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
|
/**
|
* Remove an item from an array.
|
*/
|
|
function remove(arr, item) {
|
if (arr.length) {
|
var index = arr.indexOf(item);
|
|
if (index > -1) {
|
return arr.splice(index, 1);
|
}
|
}
|
}
|
/**
|
* Check whether an object has the property.
|
*/
|
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
function hasOwn(obj, key) {
|
return hasOwnProperty.call(obj, key);
|
}
|
/**
|
* Create a cached version of a pure function.
|
*/
|
|
|
function cached(fn) {
|
var cache = Object.create(null);
|
return function cachedFn(str) {
|
var hit = cache[str];
|
return hit || (cache[str] = fn(str));
|
};
|
}
|
/**
|
* Camelize a hyphen-delimited string.
|
*/
|
|
|
var camelizeRE = /-(\w)/g;
|
var camelize = cached(function (str) {
|
return str.replace(camelizeRE, function (_, c) {
|
return c ? c.toUpperCase() : '';
|
});
|
});
|
/**
|
* Capitalize a string.
|
*/
|
|
var capitalize = cached(function (str) {
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
});
|
/**
|
* Hyphenate a camelCase string.
|
*/
|
|
var hyphenateRE = /\B([A-Z])/g;
|
var hyphenate = cached(function (str) {
|
return str.replace(hyphenateRE, '-$1').toLowerCase();
|
});
|
/**
|
* Simple bind polyfill for environments that do not support it,
|
* e.g., PhantomJS 1.x. Technically, we don't need this anymore
|
* since native bind is now performant enough in most browsers.
|
* But removing it would mean breaking code that was able to run in
|
* PhantomJS 1.x, so this must be kept for backward compatibility.
|
*/
|
|
/* istanbul ignore next */
|
|
function polyfillBind(fn, ctx) {
|
function boundFn(a) {
|
var l = arguments.length;
|
return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);
|
}
|
|
boundFn._length = fn.length;
|
return boundFn;
|
}
|
|
function nativeBind(fn, ctx) {
|
return fn.bind(ctx);
|
}
|
|
var bind = Function.prototype.bind ? nativeBind : polyfillBind;
|
/**
|
* Convert an Array-like object to a real Array.
|
*/
|
|
function toArray(list, start) {
|
start = start || 0;
|
var i = list.length - start;
|
var ret = new Array(i);
|
|
while (i--) {
|
ret[i] = list[i + start];
|
}
|
|
return ret;
|
}
|
/**
|
* Mix properties into target object.
|
*/
|
|
|
function extend(to, _from) {
|
for (var key in _from) {
|
to[key] = _from[key];
|
}
|
|
return to;
|
}
|
/**
|
* Merge an Array of Objects into a single Object.
|
*/
|
|
|
function toObject(arr) {
|
var res = {};
|
|
for (var i = 0; i < arr.length; i++) {
|
if (arr[i]) {
|
extend(res, arr[i]);
|
}
|
}
|
|
return res;
|
}
|
/* eslint-disable no-unused-vars */
|
|
/**
|
* Perform no operation.
|
* Stubbing args to make Flow happy without leaving useless transpiled code
|
* with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
|
*/
|
|
|
function noop(a, b, c) {}
|
/**
|
* Always return false.
|
*/
|
|
|
var no = function no(a, b, c) {
|
return false;
|
};
|
/* eslint-enable no-unused-vars */
|
|
/**
|
* Return the same value.
|
*/
|
|
|
var identity = function identity(_) {
|
return _;
|
};
|
/**
|
* Check if two values are loosely equal - that is,
|
* if they are plain objects, do they have the same shape?
|
*/
|
|
|
function looseEqual(a, b) {
|
if (a === b) {
|
return true;
|
}
|
|
var isObjectA = isObject(a);
|
var isObjectB = isObject(b);
|
|
if (isObjectA && isObjectB) {
|
try {
|
var isArrayA = Array.isArray(a);
|
var isArrayB = Array.isArray(b);
|
|
if (isArrayA && isArrayB) {
|
return a.length === b.length && a.every(function (e, i) {
|
return looseEqual(e, b[i]);
|
});
|
} else if (a instanceof Date && b instanceof Date) {
|
return a.getTime() === b.getTime();
|
} else if (!isArrayA && !isArrayB) {
|
var keysA = Object.keys(a);
|
var keysB = Object.keys(b);
|
return keysA.length === keysB.length && keysA.every(function (key) {
|
return looseEqual(a[key], b[key]);
|
});
|
} else {
|
/* istanbul ignore next */
|
return false;
|
}
|
} catch (e) {
|
/* istanbul ignore next */
|
return false;
|
}
|
} else if (!isObjectA && !isObjectB) {
|
return String(a) === String(b);
|
} else {
|
return false;
|
}
|
}
|
/**
|
* Return the first index at which a loosely equal value can be
|
* found in the array (if value is a plain object, the array must
|
* contain an object of the same shape), or -1 if it is not present.
|
*/
|
|
|
function looseIndexOf(arr, val) {
|
for (var i = 0; i < arr.length; i++) {
|
if (looseEqual(arr[i], val)) {
|
return i;
|
}
|
}
|
|
return -1;
|
}
|
/**
|
* Ensure a function is called only once.
|
*/
|
|
|
function once(fn) {
|
var called = false;
|
return function () {
|
if (!called) {
|
called = true;
|
fn.apply(this, arguments);
|
}
|
};
|
}
|
|
var SSR_ATTR = 'data-server-rendered';
|
var ASSET_TYPES = ['component', 'directive', 'filter'];
|
var LIFECYCLE_HOOKS = ['beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 'beforeDestroy', 'destroyed', 'activated', 'deactivated', 'errorCaptured', 'serverPrefetch'];
|
/* */
|
|
var config = {
|
/**
|
* Option merge strategies (used in core/util/options)
|
*/
|
// $flow-disable-line
|
optionMergeStrategies: Object.create(null),
|
|
/**
|
* Whether to suppress warnings.
|
*/
|
silent: false,
|
|
/**
|
* Show production mode tip message on boot?
|
*/
|
productionTip: "development" !== 'production',
|
|
/**
|
* Whether to enable devtools
|
*/
|
devtools: "development" !== 'production',
|
|
/**
|
* Whether to record perf
|
*/
|
performance: false,
|
|
/**
|
* Error handler for watcher errors
|
*/
|
errorHandler: null,
|
|
/**
|
* Warn handler for watcher warns
|
*/
|
warnHandler: null,
|
|
/**
|
* Ignore certain custom elements
|
*/
|
ignoredElements: [],
|
|
/**
|
* Custom user key aliases for v-on
|
*/
|
// $flow-disable-line
|
keyCodes: Object.create(null),
|
|
/**
|
* Check if a tag is reserved so that it cannot be registered as a
|
* component. This is platform-dependent and may be overwritten.
|
*/
|
isReservedTag: no,
|
|
/**
|
* Check if an attribute is reserved so that it cannot be used as a component
|
* prop. This is platform-dependent and may be overwritten.
|
*/
|
isReservedAttr: no,
|
|
/**
|
* Check if a tag is an unknown element.
|
* Platform-dependent.
|
*/
|
isUnknownElement: no,
|
|
/**
|
* Get the namespace of an element
|
*/
|
getTagNamespace: noop,
|
|
/**
|
* Parse the real tag name for the specific platform.
|
*/
|
parsePlatformTagName: identity,
|
|
/**
|
* Check if an attribute must be bound using property, e.g. value
|
* Platform-dependent.
|
*/
|
mustUseProp: no,
|
|
/**
|
* Perform updates asynchronously. Intended to be used by Vue Test Utils
|
* This will significantly reduce performance if set to false.
|
*/
|
async: true,
|
|
/**
|
* Exposed for legacy reasons
|
*/
|
_lifecycleHooks: LIFECYCLE_HOOKS
|
};
|
/* */
|
|
/**
|
* unicode letters used for parsing html tags, component names and property paths.
|
* using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
|
* skipping \u10000-\uEFFFF due to it freezing up PhantomJS
|
*/
|
|
var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
|
/**
|
* Check if a string starts with $ or _
|
*/
|
|
function isReserved(str) {
|
var c = (str + '').charCodeAt(0);
|
return c === 0x24 || c === 0x5F;
|
}
|
/**
|
* Define a property.
|
*/
|
|
|
function def(obj, key, val, enumerable) {
|
Object.defineProperty(obj, key, {
|
value: val,
|
enumerable: !!enumerable,
|
writable: true,
|
configurable: true
|
});
|
}
|
/**
|
* Parse simple path.
|
*/
|
|
|
var bailRE = new RegExp("[^" + unicodeRegExp.source + ".$_\\d]");
|
|
function parsePath(path) {
|
if (bailRE.test(path)) {
|
return;
|
}
|
|
var segments = path.split('.');
|
return function (obj) {
|
for (var i = 0; i < segments.length; i++) {
|
if (!obj) {
|
return;
|
}
|
|
obj = obj[segments[i]];
|
}
|
|
return obj;
|
};
|
}
|
/* */
|
// can we use __proto__?
|
|
|
var hasProto = ('__proto__' in {}); // Browser environment sniffing
|
|
var inBrowser = typeof window !== 'undefined';
|
var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
|
var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
|
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
var isIE = UA && /msie|trident/.test(UA);
|
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
var isEdge = UA && UA.indexOf('edge/') > 0;
|
var isAndroid = UA && UA.indexOf('android') > 0 || weexPlatform === 'android';
|
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA) || weexPlatform === 'ios';
|
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
|
var isPhantomJS = UA && /phantomjs/.test(UA);
|
var isFF = UA && UA.match(/firefox\/(\d+)/); // Firefox has a "watch" function on Object.prototype...
|
|
var nativeWatch = {}.watch;
|
var supportsPassive = false;
|
|
if (inBrowser) {
|
try {
|
var opts = {};
|
Object.defineProperty(opts, 'passive', {
|
get: function get() {
|
/* istanbul ignore next */
|
supportsPassive = true;
|
}
|
}); // https://github.com/facebook/flow/issues/285
|
|
window.addEventListener('test-passive', null, opts);
|
} catch (e) {}
|
} // this needs to be lazy-evaled because vue may be required before
|
// vue-server-renderer can set VUE_ENV
|
|
|
var _isServer;
|
|
var isServerRendering = function isServerRendering() {
|
if (_isServer === undefined) {
|
/* istanbul ignore if */
|
if (!inBrowser && !inWeex && typeof global !== 'undefined') {
|
// detect presence of vue-server-renderer and avoid
|
// Webpack shimming the process
|
_isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
|
} else {
|
_isServer = false;
|
}
|
}
|
|
return _isServer;
|
}; // detect devtools
|
|
|
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
/* istanbul ignore next */
|
|
function isNative(Ctor) {
|
return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
|
}
|
|
var hasSymbol = typeof Symbol !== 'undefined' && isNative(Symbol) && typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
|
|
var _Set;
|
/* istanbul ignore if */
|
// $flow-disable-line
|
|
|
if (typeof Set !== 'undefined' && isNative(Set)) {
|
// use native Set when available.
|
_Set = Set;
|
} else {
|
// a non-standard Set polyfill that only works with primitive keys.
|
_Set = /*@__PURE__*/function () {
|
function Set() {
|
this.set = Object.create(null);
|
}
|
|
Set.prototype.has = function has(key) {
|
return this.set[key] === true;
|
};
|
|
Set.prototype.add = function add(key) {
|
this.set[key] = true;
|
};
|
|
Set.prototype.clear = function clear() {
|
this.set = Object.create(null);
|
};
|
|
return Set;
|
}();
|
}
|
/* */
|
|
|
var warn = noop;
|
var tip = noop;
|
var generateComponentTrace = noop; // work around flow check
|
|
var formatComponentName = noop;
|
|
if (true) {
|
var hasConsole = typeof console !== 'undefined';
|
var classifyRE = /(?:^|[-_])(\w)/g;
|
|
var classify = function classify(str) {
|
return str.replace(classifyRE, function (c) {
|
return c.toUpperCase();
|
}).replace(/[-_]/g, '');
|
};
|
|
warn = function warn(msg, vm) {
|
var trace = vm ? generateComponentTrace(vm) : '';
|
|
if (config.warnHandler) {
|
config.warnHandler.call(null, msg, vm, trace);
|
} else if (hasConsole && !config.silent) {
|
console.error("[Vue warn]: " + msg + trace);
|
}
|
};
|
|
tip = function tip(msg, vm) {
|
if (hasConsole && !config.silent) {
|
console.warn("[Vue tip]: " + msg + (vm ? generateComponentTrace(vm) : ''));
|
}
|
};
|
|
formatComponentName = function formatComponentName(vm, includeFile) {
|
if (vm.$root === vm) {
|
if (vm.$options && vm.$options.__file) {
|
// fixed by xxxxxx
|
return 'at ' + vm.$options.__file;
|
}
|
|
return '<Root>';
|
}
|
|
var options = typeof vm === 'function' && vm.cid != null ? vm.options : vm._isVue ? vm.$options || vm.constructor.options : vm;
|
var name = options.name || options._componentTag;
|
var file = options.__file;
|
|
if (!name && file) {
|
var match = file.match(/([^/\\]+)\.vue$/);
|
name = match && match[1];
|
}
|
|
return (name ? "<" + classify(name) + ">" : "<Anonymous>") + (file && includeFile !== false ? " at " + file : '');
|
};
|
|
var repeat = function repeat(str, n) {
|
var res = '';
|
|
while (n) {
|
if (n % 2 === 1) {
|
res += str;
|
}
|
|
if (n > 1) {
|
str += str;
|
}
|
|
n >>= 1;
|
}
|
|
return res;
|
};
|
|
generateComponentTrace = function generateComponentTrace(vm) {
|
if (vm._isVue && vm.$parent) {
|
var tree = [];
|
var currentRecursiveSequence = 0;
|
|
while (vm && vm.$options.name !== 'PageBody') {
|
if (tree.length > 0) {
|
var last = tree[tree.length - 1];
|
|
if (last.constructor === vm.constructor) {
|
currentRecursiveSequence++;
|
vm = vm.$parent;
|
continue;
|
} else if (currentRecursiveSequence > 0) {
|
tree[tree.length - 1] = [last, currentRecursiveSequence];
|
currentRecursiveSequence = 0;
|
}
|
}
|
|
!vm.$options.isReserved && tree.push(vm);
|
vm = vm.$parent;
|
}
|
|
return '\n\nfound in\n\n' + tree.map(function (vm, i) {
|
return "" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) ? formatComponentName(vm[0]) + "... (" + vm[1] + " recursive calls)" : formatComponentName(vm));
|
}).join('\n');
|
} else {
|
return "\n\n(found in " + formatComponentName(vm) + ")";
|
}
|
};
|
}
|
/* */
|
|
|
var uid = 0;
|
/**
|
* A dep is an observable that can have multiple
|
* directives subscribing to it.
|
*/
|
|
var Dep = function Dep() {
|
this.id = uid++;
|
this.subs = [];
|
};
|
|
Dep.prototype.addSub = function addSub(sub) {
|
this.subs.push(sub);
|
};
|
|
Dep.prototype.removeSub = function removeSub(sub) {
|
remove(this.subs, sub);
|
};
|
|
Dep.prototype.depend = function depend() {
|
if (Dep.SharedObject.target) {
|
Dep.SharedObject.target.addDep(this);
|
}
|
};
|
|
Dep.prototype.notify = function notify() {
|
// stabilize the subscriber list first
|
var subs = this.subs.slice();
|
|
if ( true && !config.async) {
|
// subs aren't sorted in scheduler if not running async
|
// we need to sort them now to make sure they fire in correct
|
// order
|
subs.sort(function (a, b) {
|
return a.id - b.id;
|
});
|
}
|
|
for (var i = 0, l = subs.length; i < l; i++) {
|
subs[i].update();
|
}
|
}; // The current target watcher being evaluated.
|
// This is globally unique because only one watcher
|
// can be evaluated at a time.
|
// fixed by xxxxxx (nvue shared vuex)
|
|
/* eslint-disable no-undef */
|
|
|
Dep.SharedObject = {};
|
Dep.SharedObject.target = null;
|
Dep.SharedObject.targetStack = [];
|
|
function pushTarget(target) {
|
Dep.SharedObject.targetStack.push(target);
|
Dep.SharedObject.target = target;
|
Dep.target = target;
|
}
|
|
function popTarget() {
|
Dep.SharedObject.targetStack.pop();
|
Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
|
Dep.target = Dep.SharedObject.target;
|
}
|
/* */
|
|
|
var VNode = function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
|
this.tag = tag;
|
this.data = data;
|
this.children = children;
|
this.text = text;
|
this.elm = elm;
|
this.ns = undefined;
|
this.context = context;
|
this.fnContext = undefined;
|
this.fnOptions = undefined;
|
this.fnScopeId = undefined;
|
this.key = data && data.key;
|
this.componentOptions = componentOptions;
|
this.componentInstance = undefined;
|
this.parent = undefined;
|
this.raw = false;
|
this.isStatic = false;
|
this.isRootInsert = true;
|
this.isComment = false;
|
this.isCloned = false;
|
this.isOnce = false;
|
this.asyncFactory = asyncFactory;
|
this.asyncMeta = undefined;
|
this.isAsyncPlaceholder = false;
|
};
|
|
var prototypeAccessors = {
|
child: {
|
configurable: true
|
}
|
}; // DEPRECATED: alias for componentInstance for backwards compat.
|
|
/* istanbul ignore next */
|
|
prototypeAccessors.child.get = function () {
|
return this.componentInstance;
|
};
|
|
Object.defineProperties(VNode.prototype, prototypeAccessors);
|
|
var createEmptyVNode = function createEmptyVNode(text) {
|
if (text === void 0) text = '';
|
var node = new VNode();
|
node.text = text;
|
node.isComment = true;
|
return node;
|
};
|
|
function createTextVNode(val) {
|
return new VNode(undefined, undefined, undefined, String(val));
|
} // optimized shallow clone
|
// used for static nodes and slot nodes because they may be reused across
|
// multiple renders, cloning them avoids errors when DOM manipulations rely
|
// on their elm reference.
|
|
|
function cloneVNode(vnode) {
|
var cloned = new VNode(vnode.tag, vnode.data, // #7975
|
// clone children array to avoid mutating original in case of cloning
|
// a child.
|
vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
|
cloned.ns = vnode.ns;
|
cloned.isStatic = vnode.isStatic;
|
cloned.key = vnode.key;
|
cloned.isComment = vnode.isComment;
|
cloned.fnContext = vnode.fnContext;
|
cloned.fnOptions = vnode.fnOptions;
|
cloned.fnScopeId = vnode.fnScopeId;
|
cloned.asyncMeta = vnode.asyncMeta;
|
cloned.isCloned = true;
|
return cloned;
|
}
|
/*
|
* not type checking this file because flow doesn't play well with
|
* dynamically accessing methods on Array prototype
|
*/
|
|
|
var arrayProto = Array.prototype;
|
var arrayMethods = Object.create(arrayProto);
|
var methodsToPatch = ['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'];
|
/**
|
* Intercept mutating methods and emit events
|
*/
|
|
methodsToPatch.forEach(function (method) {
|
// cache original method
|
var original = arrayProto[method];
|
def(arrayMethods, method, function mutator() {
|
var args = [],
|
len = arguments.length;
|
|
while (len--) {
|
args[len] = arguments[len];
|
}
|
|
var result = original.apply(this, args);
|
var ob = this.__ob__;
|
var inserted;
|
|
switch (method) {
|
case 'push':
|
case 'unshift':
|
inserted = args;
|
break;
|
|
case 'splice':
|
inserted = args.slice(2);
|
break;
|
}
|
|
if (inserted) {
|
ob.observeArray(inserted);
|
} // notify change
|
|
|
ob.dep.notify();
|
return result;
|
});
|
});
|
/* */
|
|
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
/**
|
* In some cases we may want to disable observation inside a component's
|
* update computation.
|
*/
|
|
var shouldObserve = true;
|
|
function toggleObserving(value) {
|
shouldObserve = value;
|
}
|
/**
|
* Observer class that is attached to each observed
|
* object. Once attached, the observer converts the target
|
* object's property keys into getter/setters that
|
* collect dependencies and dispatch updates.
|
*/
|
|
|
var Observer = function Observer(value) {
|
this.value = value;
|
this.dep = new Dep();
|
this.vmCount = 0;
|
def(value, '__ob__', this);
|
|
if (Array.isArray(value)) {
|
if (hasProto) {
|
{
|
protoAugment(value, arrayMethods);
|
}
|
} else {
|
copyAugment(value, arrayMethods, arrayKeys);
|
}
|
|
this.observeArray(value);
|
} else {
|
this.walk(value);
|
}
|
};
|
/**
|
* Walk through all properties and convert them into
|
* getter/setters. This method should only be called when
|
* value type is Object.
|
*/
|
|
|
Observer.prototype.walk = function walk(obj) {
|
var keys = Object.keys(obj);
|
|
for (var i = 0; i < keys.length; i++) {
|
defineReactive$$1(obj, keys[i]);
|
}
|
};
|
/**
|
* Observe a list of Array items.
|
*/
|
|
|
Observer.prototype.observeArray = function observeArray(items) {
|
for (var i = 0, l = items.length; i < l; i++) {
|
observe(items[i]);
|
}
|
}; // helpers
|
|
/**
|
* Augment a target Object or Array by intercepting
|
* the prototype chain using __proto__
|
*/
|
|
|
function protoAugment(target, src) {
|
/* eslint-disable no-proto */
|
target.__proto__ = src;
|
/* eslint-enable no-proto */
|
}
|
/**
|
* Augment a target Object or Array by defining
|
* hidden properties.
|
*/
|
|
/* istanbul ignore next */
|
|
|
function copyAugment(target, src, keys) {
|
for (var i = 0, l = keys.length; i < l; i++) {
|
var key = keys[i];
|
def(target, key, src[key]);
|
}
|
}
|
/**
|
* Attempt to create an observer instance for a value,
|
* returns the new observer if successfully observed,
|
* or the existing observer if the value already has one.
|
*/
|
|
|
function observe(value, asRootData) {
|
if (!isObject(value) || value instanceof VNode) {
|
return;
|
}
|
|
var ob;
|
|
if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
|
ob = value.__ob__;
|
} else if (shouldObserve && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {
|
ob = new Observer(value);
|
}
|
|
if (asRootData && ob) {
|
ob.vmCount++;
|
}
|
|
return ob;
|
}
|
/**
|
* Define a reactive property on an Object.
|
*/
|
|
|
function defineReactive$$1(obj, key, val, customSetter, shallow) {
|
var dep = new Dep();
|
var property = Object.getOwnPropertyDescriptor(obj, key);
|
|
if (property && property.configurable === false) {
|
return;
|
} // cater for pre-defined getter/setters
|
|
|
var getter = property && property.get;
|
var setter = property && property.set;
|
|
if ((!getter || setter) && arguments.length === 2) {
|
val = obj[key];
|
}
|
|
var childOb = !shallow && observe(val);
|
Object.defineProperty(obj, key, {
|
enumerable: true,
|
configurable: true,
|
get: function reactiveGetter() {
|
var value = getter ? getter.call(obj) : val;
|
|
if (Dep.SharedObject.target) {
|
// fixed by xxxxxx
|
dep.depend();
|
|
if (childOb) {
|
childOb.dep.depend();
|
|
if (Array.isArray(value)) {
|
dependArray(value);
|
}
|
}
|
}
|
|
return value;
|
},
|
set: function reactiveSetter(newVal) {
|
var value = getter ? getter.call(obj) : val;
|
/* eslint-disable no-self-compare */
|
|
if (newVal === value || newVal !== newVal && value !== value) {
|
return;
|
}
|
/* eslint-enable no-self-compare */
|
|
|
if ( true && customSetter) {
|
customSetter();
|
} // #7981: for accessor properties without setter
|
|
|
if (getter && !setter) {
|
return;
|
}
|
|
if (setter) {
|
setter.call(obj, newVal);
|
} else {
|
val = newVal;
|
}
|
|
childOb = !shallow && observe(newVal);
|
dep.notify();
|
}
|
});
|
}
|
/**
|
* Set a property on an object. Adds the new property and
|
* triggers change notification if the property doesn't
|
* already exist.
|
*/
|
|
|
function set(target, key, val) {
|
if ( true && (isUndef(target) || isPrimitive(target))) {
|
warn("Cannot set reactive property on undefined, null, or primitive value: " + target);
|
}
|
|
if (Array.isArray(target) && isValidArrayIndex(key)) {
|
target.length = Math.max(target.length, key);
|
target.splice(key, 1, val);
|
return val;
|
}
|
|
if (key in target && !(key in Object.prototype)) {
|
target[key] = val;
|
return val;
|
}
|
|
var ob = target.__ob__;
|
|
if (target._isVue || ob && ob.vmCount) {
|
true && warn('Avoid adding reactive properties to a Vue instance or its root $data ' + 'at runtime - declare it upfront in the data option.');
|
return val;
|
}
|
|
if (!ob) {
|
target[key] = val;
|
return val;
|
}
|
|
defineReactive$$1(ob.value, key, val);
|
ob.dep.notify();
|
return val;
|
}
|
/**
|
* Delete a property and trigger change if necessary.
|
*/
|
|
|
function del(target, key) {
|
if ( true && (isUndef(target) || isPrimitive(target))) {
|
warn("Cannot delete reactive property on undefined, null, or primitive value: " + target);
|
}
|
|
if (Array.isArray(target) && isValidArrayIndex(key)) {
|
target.splice(key, 1);
|
return;
|
}
|
|
var ob = target.__ob__;
|
|
if (target._isVue || ob && ob.vmCount) {
|
true && warn('Avoid deleting properties on a Vue instance or its root $data ' + '- just set it to null.');
|
return;
|
}
|
|
if (!hasOwn(target, key)) {
|
return;
|
}
|
|
delete target[key];
|
|
if (!ob) {
|
return;
|
}
|
|
ob.dep.notify();
|
}
|
/**
|
* Collect dependencies on array elements when the array is touched, since
|
* we cannot intercept array element access like property getters.
|
*/
|
|
|
function dependArray(value) {
|
for (var e = void 0, i = 0, l = value.length; i < l; i++) {
|
e = value[i];
|
e && e.__ob__ && e.__ob__.dep.depend();
|
|
if (Array.isArray(e)) {
|
dependArray(e);
|
}
|
}
|
}
|
/* */
|
|
/**
|
* Option overwriting strategies are functions that handle
|
* how to merge a parent option value and a child option
|
* value into the final value.
|
*/
|
|
|
var strats = config.optionMergeStrategies;
|
/**
|
* Options with restrictions
|
*/
|
|
if (true) {
|
strats.el = strats.propsData = function (parent, child, vm, key) {
|
if (!vm) {
|
warn("option \"" + key + "\" can only be used during instance " + 'creation with the `new` keyword.');
|
}
|
|
return defaultStrat(parent, child);
|
};
|
}
|
/**
|
* Helper that recursively merges two data objects together.
|
*/
|
|
|
function mergeData(to, from) {
|
if (!from) {
|
return to;
|
}
|
|
var key, toVal, fromVal;
|
var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from);
|
|
for (var i = 0; i < keys.length; i++) {
|
key = keys[i]; // in case the object is already observed...
|
|
if (key === '__ob__') {
|
continue;
|
}
|
|
toVal = to[key];
|
fromVal = from[key];
|
|
if (!hasOwn(to, key)) {
|
set(to, key, fromVal);
|
} else if (toVal !== fromVal && isPlainObject(toVal) && isPlainObject(fromVal)) {
|
mergeData(toVal, fromVal);
|
}
|
}
|
|
return to;
|
}
|
/**
|
* Data
|
*/
|
|
|
function mergeDataOrFn(parentVal, childVal, vm) {
|
if (!vm) {
|
// in a Vue.extend merge, both should be functions
|
if (!childVal) {
|
return parentVal;
|
}
|
|
if (!parentVal) {
|
return childVal;
|
} // when parentVal & childVal are both present,
|
// we need to return a function that returns the
|
// merged result of both functions... no need to
|
// check if parentVal is a function here because
|
// it has to be a function to pass previous merges.
|
|
|
return function mergedDataFn() {
|
return mergeData(typeof childVal === 'function' ? childVal.call(this, this) : childVal, typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal);
|
};
|
} else {
|
return function mergedInstanceDataFn() {
|
// instance merge
|
var instanceData = typeof childVal === 'function' ? childVal.call(vm, vm) : childVal;
|
var defaultData = typeof parentVal === 'function' ? parentVal.call(vm, vm) : parentVal;
|
|
if (instanceData) {
|
return mergeData(instanceData, defaultData);
|
} else {
|
return defaultData;
|
}
|
};
|
}
|
}
|
|
strats.data = function (parentVal, childVal, vm) {
|
if (!vm) {
|
if (childVal && typeof childVal !== 'function') {
|
true && warn('The "data" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm);
|
return parentVal;
|
}
|
|
return mergeDataOrFn(parentVal, childVal);
|
}
|
|
return mergeDataOrFn(parentVal, childVal, vm);
|
};
|
/**
|
* Hooks and props are merged as arrays.
|
*/
|
|
|
function mergeHook(parentVal, childVal) {
|
var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
|
return res ? dedupeHooks(res) : res;
|
}
|
|
function dedupeHooks(hooks) {
|
var res = [];
|
|
for (var i = 0; i < hooks.length; i++) {
|
if (res.indexOf(hooks[i]) === -1) {
|
res.push(hooks[i]);
|
}
|
}
|
|
return res;
|
}
|
|
LIFECYCLE_HOOKS.forEach(function (hook) {
|
strats[hook] = mergeHook;
|
});
|
/**
|
* Assets
|
*
|
* When a vm is present (instance creation), we need to do
|
* a three-way merge between constructor options, instance
|
* options and parent options.
|
*/
|
|
function mergeAssets(parentVal, childVal, vm, key) {
|
var res = Object.create(parentVal || null);
|
|
if (childVal) {
|
true && assertObjectType(key, childVal, vm);
|
return extend(res, childVal);
|
} else {
|
return res;
|
}
|
}
|
|
ASSET_TYPES.forEach(function (type) {
|
strats[type + 's'] = mergeAssets;
|
});
|
/**
|
* Watchers.
|
*
|
* Watchers hashes should not overwrite one
|
* another, so we merge them as arrays.
|
*/
|
|
strats.watch = function (parentVal, childVal, vm, key) {
|
// work around Firefox's Object.prototype.watch...
|
if (parentVal === nativeWatch) {
|
parentVal = undefined;
|
}
|
|
if (childVal === nativeWatch) {
|
childVal = undefined;
|
}
|
/* istanbul ignore if */
|
|
|
if (!childVal) {
|
return Object.create(parentVal || null);
|
}
|
|
if (true) {
|
assertObjectType(key, childVal, vm);
|
}
|
|
if (!parentVal) {
|
return childVal;
|
}
|
|
var ret = {};
|
extend(ret, parentVal);
|
|
for (var key$1 in childVal) {
|
var parent = ret[key$1];
|
var child = childVal[key$1];
|
|
if (parent && !Array.isArray(parent)) {
|
parent = [parent];
|
}
|
|
ret[key$1] = parent ? parent.concat(child) : Array.isArray(child) ? child : [child];
|
}
|
|
return ret;
|
};
|
/**
|
* Other object hashes.
|
*/
|
|
|
strats.props = strats.methods = strats.inject = strats.computed = function (parentVal, childVal, vm, key) {
|
if (childVal && "development" !== 'production') {
|
assertObjectType(key, childVal, vm);
|
}
|
|
if (!parentVal) {
|
return childVal;
|
}
|
|
var ret = Object.create(null);
|
extend(ret, parentVal);
|
|
if (childVal) {
|
extend(ret, childVal);
|
}
|
|
return ret;
|
};
|
|
strats.provide = mergeDataOrFn;
|
/**
|
* Default strategy.
|
*/
|
|
var defaultStrat = function defaultStrat(parentVal, childVal) {
|
return childVal === undefined ? parentVal : childVal;
|
};
|
/**
|
* Validate component names
|
*/
|
|
|
function checkComponents(options) {
|
for (var key in options.components) {
|
validateComponentName(key);
|
}
|
}
|
|
function validateComponentName(name) {
|
if (!new RegExp("^[a-zA-Z][\\-\\.0-9_" + unicodeRegExp.source + "]*$").test(name)) {
|
warn('Invalid component name: "' + name + '". Component names ' + 'should conform to valid custom element name in html5 specification.');
|
}
|
|
if (isBuiltInTag(name) || config.isReservedTag(name)) {
|
warn('Do not use built-in or reserved HTML elements as component ' + 'id: ' + name);
|
}
|
}
|
/**
|
* Ensure all props option syntax are normalized into the
|
* Object-based format.
|
*/
|
|
|
function normalizeProps(options, vm) {
|
var props = options.props;
|
|
if (!props) {
|
return;
|
}
|
|
var res = {};
|
var i, val, name;
|
|
if (Array.isArray(props)) {
|
i = props.length;
|
|
while (i--) {
|
val = props[i];
|
|
if (typeof val === 'string') {
|
name = camelize(val);
|
res[name] = {
|
type: null
|
};
|
} else if (true) {
|
warn('props must be strings when using array syntax.');
|
}
|
}
|
} else if (isPlainObject(props)) {
|
for (var key in props) {
|
val = props[key];
|
name = camelize(key);
|
res[name] = isPlainObject(val) ? val : {
|
type: val
|
};
|
}
|
} else if (true) {
|
warn("Invalid value for option \"props\": expected an Array or an Object, " + "but got " + toRawType(props) + ".", vm);
|
}
|
|
options.props = res;
|
}
|
/**
|
* Normalize all injections into Object-based format
|
*/
|
|
|
function normalizeInject(options, vm) {
|
var inject = options.inject;
|
|
if (!inject) {
|
return;
|
}
|
|
var normalized = options.inject = {};
|
|
if (Array.isArray(inject)) {
|
for (var i = 0; i < inject.length; i++) {
|
normalized[inject[i]] = {
|
from: inject[i]
|
};
|
}
|
} else if (isPlainObject(inject)) {
|
for (var key in inject) {
|
var val = inject[key];
|
normalized[key] = isPlainObject(val) ? extend({
|
from: key
|
}, val) : {
|
from: val
|
};
|
}
|
} else if (true) {
|
warn("Invalid value for option \"inject\": expected an Array or an Object, " + "but got " + toRawType(inject) + ".", vm);
|
}
|
}
|
/**
|
* Normalize raw function directives into object format.
|
*/
|
|
|
function normalizeDirectives(options) {
|
var dirs = options.directives;
|
|
if (dirs) {
|
for (var key in dirs) {
|
var def$$1 = dirs[key];
|
|
if (typeof def$$1 === 'function') {
|
dirs[key] = {
|
bind: def$$1,
|
update: def$$1
|
};
|
}
|
}
|
}
|
}
|
|
function assertObjectType(name, value, vm) {
|
if (!isPlainObject(value)) {
|
warn("Invalid value for option \"" + name + "\": expected an Object, " + "but got " + toRawType(value) + ".", vm);
|
}
|
}
|
/**
|
* Merge two option objects into a new one.
|
* Core utility used in both instantiation and inheritance.
|
*/
|
|
|
function mergeOptions(parent, child, vm) {
|
if (true) {
|
checkComponents(child);
|
}
|
|
if (typeof child === 'function') {
|
child = child.options;
|
}
|
|
normalizeProps(child, vm);
|
normalizeInject(child, vm);
|
normalizeDirectives(child); // Apply extends and mixins on the child options,
|
// but only if it is a raw options object that isn't
|
// the result of another mergeOptions call.
|
// Only merged options has the _base property.
|
|
if (!child._base) {
|
if (child.extends) {
|
parent = mergeOptions(parent, child.extends, vm);
|
}
|
|
if (child.mixins) {
|
for (var i = 0, l = child.mixins.length; i < l; i++) {
|
parent = mergeOptions(parent, child.mixins[i], vm);
|
}
|
}
|
}
|
|
var options = {};
|
var key;
|
|
for (key in parent) {
|
mergeField(key);
|
}
|
|
for (key in child) {
|
if (!hasOwn(parent, key)) {
|
mergeField(key);
|
}
|
}
|
|
function mergeField(key) {
|
var strat = strats[key] || defaultStrat;
|
options[key] = strat(parent[key], child[key], vm, key);
|
}
|
|
return options;
|
}
|
/**
|
* Resolve an asset.
|
* This function is used because child instances need access
|
* to assets defined in its ancestor chain.
|
*/
|
|
|
function resolveAsset(options, type, id, warnMissing) {
|
/* istanbul ignore if */
|
if (typeof id !== 'string') {
|
return;
|
}
|
|
var assets = options[type]; // check local registration variations first
|
|
if (hasOwn(assets, id)) {
|
return assets[id];
|
}
|
|
var camelizedId = camelize(id);
|
|
if (hasOwn(assets, camelizedId)) {
|
return assets[camelizedId];
|
}
|
|
var PascalCaseId = capitalize(camelizedId);
|
|
if (hasOwn(assets, PascalCaseId)) {
|
return assets[PascalCaseId];
|
} // fallback to prototype chain
|
|
|
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
|
|
if ( true && warnMissing && !res) {
|
warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id, options);
|
}
|
|
return res;
|
}
|
/* */
|
|
|
function validateProp(key, propOptions, propsData, vm) {
|
var prop = propOptions[key];
|
var absent = !hasOwn(propsData, key);
|
var value = propsData[key]; // boolean casting
|
|
var booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
if (booleanIndex > -1) {
|
if (absent && !hasOwn(prop, 'default')) {
|
value = false;
|
} else if (value === '' || value === hyphenate(key)) {
|
// only cast empty string / same name to boolean if
|
// boolean has higher priority
|
var stringIndex = getTypeIndex(String, prop.type);
|
|
if (stringIndex < 0 || booleanIndex < stringIndex) {
|
value = true;
|
}
|
}
|
} // check default value
|
|
|
if (value === undefined) {
|
value = getPropDefaultValue(vm, prop, key); // since the default value is a fresh copy,
|
// make sure to observe it.
|
|
var prevShouldObserve = shouldObserve;
|
toggleObserving(true);
|
observe(value);
|
toggleObserving(prevShouldObserve);
|
}
|
|
if (true) {
|
assertProp(prop, key, value, vm, absent);
|
}
|
|
return value;
|
}
|
/**
|
* Get the default value of a prop.
|
*/
|
|
|
function getPropDefaultValue(vm, prop, key) {
|
// no default, return undefined
|
if (!hasOwn(prop, 'default')) {
|
return undefined;
|
}
|
|
var def = prop.default; // warn against non-factory defaults for Object & Array
|
|
if ( true && isObject(def)) {
|
warn('Invalid default value for prop "' + key + '": ' + 'Props with type Object/Array must use a factory function ' + 'to return the default value.', vm);
|
} // the raw prop value was also undefined from previous render,
|
// return previous default value to avoid unnecessary watcher trigger
|
|
|
if (vm && vm.$options.propsData && vm.$options.propsData[key] === undefined && vm._props[key] !== undefined) {
|
return vm._props[key];
|
} // call factory function for non-Function types
|
// a value is Function if its prototype is function even across different execution context
|
|
|
return typeof def === 'function' && getType(prop.type) !== 'Function' ? def.call(vm) : def;
|
}
|
/**
|
* Assert whether a prop is valid.
|
*/
|
|
|
function assertProp(prop, name, value, vm, absent) {
|
if (prop.required && absent) {
|
warn('Missing required prop: "' + name + '"', vm);
|
return;
|
}
|
|
if (value == null && !prop.required) {
|
return;
|
}
|
|
var type = prop.type;
|
var valid = !type || type === true;
|
var expectedTypes = [];
|
|
if (type) {
|
if (!Array.isArray(type)) {
|
type = [type];
|
}
|
|
for (var i = 0; i < type.length && !valid; i++) {
|
var assertedType = assertType(value, type[i]);
|
expectedTypes.push(assertedType.expectedType || '');
|
valid = assertedType.valid;
|
}
|
}
|
|
if (!valid) {
|
warn(getInvalidTypeMessage(name, value, expectedTypes), vm);
|
return;
|
}
|
|
var validator = prop.validator;
|
|
if (validator) {
|
if (!validator(value)) {
|
warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
|
}
|
}
|
}
|
|
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
|
|
function assertType(value, type) {
|
var valid;
|
var expectedType = getType(type);
|
|
if (simpleCheckRE.test(expectedType)) {
|
var t = _typeof(value);
|
|
valid = t === expectedType.toLowerCase(); // for primitive wrapper objects
|
|
if (!valid && t === 'object') {
|
valid = value instanceof type;
|
}
|
} else if (expectedType === 'Object') {
|
valid = isPlainObject(value);
|
} else if (expectedType === 'Array') {
|
valid = Array.isArray(value);
|
} else {
|
valid = value instanceof type;
|
}
|
|
return {
|
valid: valid,
|
expectedType: expectedType
|
};
|
}
|
/**
|
* Use function string name to check built-in types,
|
* because a simple equality check will fail when running
|
* across different vms / iframes.
|
*/
|
|
|
function getType(fn) {
|
var match = fn && fn.toString().match(/^\s*function (\w+)/);
|
return match ? match[1] : '';
|
}
|
|
function isSameType(a, b) {
|
return getType(a) === getType(b);
|
}
|
|
function getTypeIndex(type, expectedTypes) {
|
if (!Array.isArray(expectedTypes)) {
|
return isSameType(expectedTypes, type) ? 0 : -1;
|
}
|
|
for (var i = 0, len = expectedTypes.length; i < len; i++) {
|
if (isSameType(expectedTypes[i], type)) {
|
return i;
|
}
|
}
|
|
return -1;
|
}
|
|
function getInvalidTypeMessage(name, value, expectedTypes) {
|
var message = "Invalid prop: type check failed for prop \"" + name + "\"." + " Expected " + expectedTypes.map(capitalize).join(', ');
|
var expectedType = expectedTypes[0];
|
var receivedType = toRawType(value);
|
var expectedValue = styleValue(value, expectedType);
|
var receivedValue = styleValue(value, receivedType); // check if we need to specify expected value
|
|
if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
|
message += " with value " + expectedValue;
|
}
|
|
message += ", got " + receivedType + " "; // check if we need to specify received value
|
|
if (isExplicable(receivedType)) {
|
message += "with value " + receivedValue + ".";
|
}
|
|
return message;
|
}
|
|
function styleValue(value, type) {
|
if (type === 'String') {
|
return "\"" + value + "\"";
|
} else if (type === 'Number') {
|
return "" + Number(value);
|
} else {
|
return "" + value;
|
}
|
}
|
|
function isExplicable(value) {
|
var explicitTypes = ['string', 'number', 'boolean'];
|
return explicitTypes.some(function (elem) {
|
return value.toLowerCase() === elem;
|
});
|
}
|
|
function isBoolean() {
|
var args = [],
|
len = arguments.length;
|
|
while (len--) {
|
args[len] = arguments[len];
|
}
|
|
return args.some(function (elem) {
|
return elem.toLowerCase() === 'boolean';
|
});
|
}
|
/* */
|
|
|
function handleError(err, vm, info) {
|
// Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
|
// See: https://github.com/vuejs/vuex/issues/1505
|
pushTarget();
|
|
try {
|
if (vm) {
|
var cur = vm;
|
|
while (cur = cur.$parent) {
|
var hooks = cur.$options.errorCaptured;
|
|
if (hooks) {
|
for (var i = 0; i < hooks.length; i++) {
|
try {
|
var capture = hooks[i].call(cur, err, vm, info) === false;
|
|
if (capture) {
|
return;
|
}
|
} catch (e) {
|
globalHandleError(e, cur, 'errorCaptured hook');
|
}
|
}
|
}
|
}
|
}
|
|
globalHandleError(err, vm, info);
|
} finally {
|
popTarget();
|
}
|
}
|
|
function invokeWithErrorHandling(handler, context, args, vm, info) {
|
var res;
|
|
try {
|
res = args ? handler.apply(context, args) : handler.call(context);
|
|
if (res && !res._isVue && isPromise(res) && !res._handled) {
|
res.catch(function (e) {
|
return handleError(e, vm, info + " (Promise/async)");
|
}); // issue #9511
|
// avoid catch triggering multiple times when nested calls
|
|
res._handled = true;
|
}
|
} catch (e) {
|
handleError(e, vm, info);
|
}
|
|
return res;
|
}
|
|
function globalHandleError(err, vm, info) {
|
if (config.errorHandler) {
|
try {
|
return config.errorHandler.call(null, err, vm, info);
|
} catch (e) {
|
// if the user intentionally throws the original error in the handler,
|
// do not log it twice
|
if (e !== err) {
|
logError(e, null, 'config.errorHandler');
|
}
|
}
|
}
|
|
logError(err, vm, info);
|
}
|
|
function logError(err, vm, info) {
|
if (true) {
|
warn("Error in " + info + ": \"" + err.toString() + "\"", vm);
|
}
|
/* istanbul ignore else */
|
|
|
if ((inBrowser || inWeex) && typeof console !== 'undefined') {
|
console.error(err);
|
} else {
|
throw err;
|
}
|
}
|
/* */
|
|
|
var isUsingMicroTask = false;
|
var callbacks = [];
|
var pending = false;
|
|
function flushCallbacks() {
|
pending = false;
|
var copies = callbacks.slice(0);
|
callbacks.length = 0;
|
|
for (var i = 0; i < copies.length; i++) {
|
copies[i]();
|
}
|
} // Here we have async deferring wrappers using microtasks.
|
// In 2.5 we used (macro) tasks (in combination with microtasks).
|
// However, it has subtle problems when state is changed right before repaint
|
// (e.g. #6813, out-in transitions).
|
// Also, using (macro) tasks in event handler would cause some weird behaviors
|
// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
|
// So we now use microtasks everywhere, again.
|
// A major drawback of this tradeoff is that there are some scenarios
|
// where microtasks have too high a priority and fire in between supposedly
|
// sequential events (e.g. #4521, #6690, which have workarounds)
|
// or even between bubbling of the same event (#6566).
|
|
|
var timerFunc; // The nextTick behavior leverages the microtask queue, which can be accessed
|
// via either native Promise.then or MutationObserver.
|
// MutationObserver has wider support, however it is seriously bugged in
|
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
|
// completely stops working after triggering a few times... so, if native
|
// Promise is available, we will use it:
|
|
/* istanbul ignore next, $flow-disable-line */
|
|
if (typeof Promise !== 'undefined' && isNative(Promise)) {
|
var p = Promise.resolve();
|
|
timerFunc = function timerFunc() {
|
p.then(flushCallbacks); // In problematic UIWebViews, Promise.then doesn't completely break, but
|
// it can get stuck in a weird state where callbacks are pushed into the
|
// microtask queue but the queue isn't being flushed, until the browser
|
// needs to do some other work, e.g. handle a timer. Therefore we can
|
// "force" the microtask queue to be flushed by adding an empty timer.
|
|
if (isIOS) {
|
setTimeout(noop);
|
}
|
};
|
|
isUsingMicroTask = true;
|
} else if (!isIE && typeof MutationObserver !== 'undefined' && (isNative(MutationObserver) || // PhantomJS and iOS 7.x
|
MutationObserver.toString() === '[object MutationObserverConstructor]')) {
|
// Use MutationObserver where native Promise is not available,
|
// e.g. PhantomJS, iOS7, Android 4.4
|
// (#6466 MutationObserver is unreliable in IE11)
|
var counter = 1;
|
var observer = new MutationObserver(flushCallbacks);
|
var textNode = document.createTextNode(String(counter));
|
observer.observe(textNode, {
|
characterData: true
|
});
|
|
timerFunc = function timerFunc() {
|
counter = (counter + 1) % 2;
|
textNode.data = String(counter);
|
};
|
|
isUsingMicroTask = true;
|
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
|
// Fallback to setImmediate.
|
// Technically it leverages the (macro) task queue,
|
// but it is still a better choice than setTimeout.
|
timerFunc = function timerFunc() {
|
setImmediate(flushCallbacks);
|
};
|
} else {
|
// Fallback to setTimeout.
|
timerFunc = function timerFunc() {
|
setTimeout(flushCallbacks, 0);
|
};
|
}
|
|
function nextTick(cb, ctx) {
|
var _resolve;
|
|
callbacks.push(function () {
|
if (cb) {
|
try {
|
cb.call(ctx);
|
} catch (e) {
|
handleError(e, ctx, 'nextTick');
|
}
|
} else if (_resolve) {
|
_resolve(ctx);
|
}
|
});
|
|
if (!pending) {
|
pending = true;
|
timerFunc();
|
} // $flow-disable-line
|
|
|
if (!cb && typeof Promise !== 'undefined') {
|
return new Promise(function (resolve) {
|
_resolve = resolve;
|
});
|
}
|
}
|
/* */
|
|
/* not type checking this file because flow doesn't play well with Proxy */
|
|
|
var initProxy;
|
|
if (true) {
|
var allowedGlobals = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + 'require' // for Webpack/Browserify
|
);
|
|
var warnNonPresent = function warnNonPresent(target, key) {
|
warn("Property or method \"" + key + "\" is not defined on the instance but " + 'referenced during render. Make sure that this property is reactive, ' + 'either in the data option, or for class-based components, by ' + 'initializing the property. ' + 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
};
|
|
var warnReservedPrefix = function warnReservedPrefix(target, key) {
|
warn("Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'prevent conflicts with Vue internals. ' + 'See: https://vuejs.org/v2/api/#data', target);
|
};
|
|
var hasProxy = typeof Proxy !== 'undefined' && isNative(Proxy);
|
|
if (hasProxy) {
|
var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
|
config.keyCodes = new Proxy(config.keyCodes, {
|
set: function set(target, key, value) {
|
if (isBuiltInModifier(key)) {
|
warn("Avoid overwriting built-in modifier in config.keyCodes: ." + key);
|
return false;
|
} else {
|
target[key] = value;
|
return true;
|
}
|
}
|
});
|
}
|
|
var hasHandler = {
|
has: function has(target, key) {
|
var has = (key in target);
|
var isAllowed = allowedGlobals(key) || typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data);
|
|
if (!has && !isAllowed) {
|
if (key in target.$data) {
|
warnReservedPrefix(target, key);
|
} else {
|
warnNonPresent(target, key);
|
}
|
}
|
|
return has || !isAllowed;
|
}
|
};
|
var getHandler = {
|
get: function get(target, key) {
|
if (typeof key === 'string' && !(key in target)) {
|
if (key in target.$data) {
|
warnReservedPrefix(target, key);
|
} else {
|
warnNonPresent(target, key);
|
}
|
}
|
|
return target[key];
|
}
|
};
|
|
initProxy = function initProxy(vm) {
|
if (hasProxy) {
|
// determine which proxy handler to use
|
var options = vm.$options;
|
var handlers = options.render && options.render._withStripped ? getHandler : hasHandler;
|
vm._renderProxy = new Proxy(vm, handlers);
|
} else {
|
vm._renderProxy = vm;
|
}
|
};
|
}
|
/* */
|
|
|
var seenObjects = new _Set();
|
/**
|
* Recursively traverse an object to evoke all converted
|
* getters, so that every nested property inside the object
|
* is collected as a "deep" dependency.
|
*/
|
|
function traverse(val) {
|
_traverse(val, seenObjects);
|
|
seenObjects.clear();
|
}
|
|
function _traverse(val, seen) {
|
var i, keys;
|
var isA = Array.isArray(val);
|
|
if (!isA && !isObject(val) || Object.isFrozen(val) || val instanceof VNode) {
|
return;
|
}
|
|
if (val.__ob__) {
|
var depId = val.__ob__.dep.id;
|
|
if (seen.has(depId)) {
|
return;
|
}
|
|
seen.add(depId);
|
}
|
|
if (isA) {
|
i = val.length;
|
|
while (i--) {
|
_traverse(val[i], seen);
|
}
|
} else {
|
keys = Object.keys(val);
|
i = keys.length;
|
|
while (i--) {
|
_traverse(val[keys[i]], seen);
|
}
|
}
|
}
|
|
var mark;
|
var measure;
|
|
if (true) {
|
var perf = inBrowser && window.performance;
|
/* istanbul ignore if */
|
|
if (perf && perf.mark && perf.measure && perf.clearMarks && perf.clearMeasures) {
|
mark = function mark(tag) {
|
return perf.mark(tag);
|
};
|
|
measure = function measure(name, startTag, endTag) {
|
perf.measure(name, startTag, endTag);
|
perf.clearMarks(startTag);
|
perf.clearMarks(endTag); // perf.clearMeasures(name)
|
};
|
}
|
}
|
/* */
|
|
|
var normalizeEvent = cached(function (name) {
|
var passive = name.charAt(0) === '&';
|
name = passive ? name.slice(1) : name;
|
var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
|
|
name = once$$1 ? name.slice(1) : name;
|
var capture = name.charAt(0) === '!';
|
name = capture ? name.slice(1) : name;
|
return {
|
name: name,
|
once: once$$1,
|
capture: capture,
|
passive: passive
|
};
|
});
|
|
function createFnInvoker(fns, vm) {
|
function invoker() {
|
var arguments$1 = arguments;
|
var fns = invoker.fns;
|
|
if (Array.isArray(fns)) {
|
var cloned = fns.slice();
|
|
for (var i = 0; i < cloned.length; i++) {
|
invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
|
}
|
} else {
|
// return handler return value for single handlers
|
return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
|
}
|
}
|
|
invoker.fns = fns;
|
return invoker;
|
}
|
|
function updateListeners(on, oldOn, add, remove$$1, createOnceHandler, vm) {
|
var name, def$$1, cur, old, event;
|
|
for (name in on) {
|
def$$1 = cur = on[name];
|
old = oldOn[name];
|
event = normalizeEvent(name);
|
|
if (isUndef(cur)) {
|
true && warn("Invalid handler for event \"" + event.name + "\": got " + String(cur), vm);
|
} else if (isUndef(old)) {
|
if (isUndef(cur.fns)) {
|
cur = on[name] = createFnInvoker(cur, vm);
|
}
|
|
if (isTrue(event.once)) {
|
cur = on[name] = createOnceHandler(event.name, cur, event.capture);
|
}
|
|
add(event.name, cur, event.capture, event.passive, event.params);
|
} else if (cur !== old) {
|
old.fns = cur;
|
on[name] = old;
|
}
|
}
|
|
for (name in oldOn) {
|
if (isUndef(on[name])) {
|
event = normalizeEvent(name);
|
remove$$1(event.name, oldOn[name], event.capture);
|
}
|
}
|
}
|
/* */
|
|
|
function mergeVNodeHook(def, hookKey, hook) {
|
if (def instanceof VNode) {
|
def = def.data.hook || (def.data.hook = {});
|
}
|
|
var invoker;
|
var oldHook = def[hookKey];
|
|
function wrappedHook() {
|
hook.apply(this, arguments); // important: remove merged hook to ensure it's called only once
|
// and prevent memory leak
|
|
remove(invoker.fns, wrappedHook);
|
}
|
|
if (isUndef(oldHook)) {
|
// no existing hook
|
invoker = createFnInvoker([wrappedHook]);
|
} else {
|
/* istanbul ignore if */
|
if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
|
// already a merged invoker
|
invoker = oldHook;
|
invoker.fns.push(wrappedHook);
|
} else {
|
// existing plain hook
|
invoker = createFnInvoker([oldHook, wrappedHook]);
|
}
|
}
|
|
invoker.merged = true;
|
def[hookKey] = invoker;
|
}
|
/* */
|
// fixed by xxxxxx (mp properties)
|
|
|
function extractPropertiesFromVNodeData(data, Ctor, res, context) {
|
var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
|
|
if (isUndef(propOptions)) {
|
return res;
|
}
|
|
var externalClasses = Ctor.options.mpOptions.externalClasses || [];
|
var attrs = data.attrs;
|
var props = data.props;
|
|
if (isDef(attrs) || isDef(props)) {
|
for (var key in propOptions) {
|
var altKey = hyphenate(key);
|
var result = checkProp(res, props, key, altKey, true) || checkProp(res, attrs, key, altKey, false); // externalClass
|
|
if (result && res[key] && externalClasses.indexOf(altKey) !== -1 && context[camelize(res[key])]) {
|
// 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
|
res[key] = context[camelize(res[key])];
|
}
|
}
|
}
|
|
return res;
|
}
|
|
function extractPropsFromVNodeData(data, Ctor, tag, context // fixed by xxxxxx
|
) {
|
// we are only extracting raw values here.
|
// validation and default values are handled in the child
|
// component itself.
|
var propOptions = Ctor.options.props;
|
|
if (isUndef(propOptions)) {
|
// fixed by xxxxxx
|
return extractPropertiesFromVNodeData(data, Ctor, {}, context);
|
}
|
|
var res = {};
|
var attrs = data.attrs;
|
var props = data.props;
|
|
if (isDef(attrs) || isDef(props)) {
|
for (var key in propOptions) {
|
var altKey = hyphenate(key);
|
|
if (true) {
|
var keyInLowerCase = key.toLowerCase();
|
|
if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
|
tip("Prop \"" + keyInLowerCase + "\" is passed to component " + formatComponentName(tag || Ctor) + ", but the declared prop name is" + " \"" + key + "\". " + "Note that HTML attributes are case-insensitive and camelCased " + "props need to use their kebab-case equivalents when using in-DOM " + "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\".");
|
}
|
}
|
|
checkProp(res, props, key, altKey, true) || checkProp(res, attrs, key, altKey, false);
|
}
|
} // fixed by xxxxxx
|
|
|
return extractPropertiesFromVNodeData(data, Ctor, res, context);
|
}
|
|
function checkProp(res, hash, key, altKey, preserve) {
|
if (isDef(hash)) {
|
if (hasOwn(hash, key)) {
|
res[key] = hash[key];
|
|
if (!preserve) {
|
delete hash[key];
|
}
|
|
return true;
|
} else if (hasOwn(hash, altKey)) {
|
res[key] = hash[altKey];
|
|
if (!preserve) {
|
delete hash[altKey];
|
}
|
|
return true;
|
}
|
}
|
|
return false;
|
}
|
/* */
|
// The template compiler attempts to minimize the need for normalization by
|
// statically analyzing the template at compile time.
|
//
|
// For plain HTML markup, normalization can be completely skipped because the
|
// generated render function is guaranteed to return Array<VNode>. There are
|
// two cases where extra normalization is needed:
|
// 1. When the children contains components - because a functional component
|
// may return an Array instead of a single root. In this case, just a simple
|
// normalization is needed - if any child is an Array, we flatten the whole
|
// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
|
// because functional components already normalize their own children.
|
|
|
function simpleNormalizeChildren(children) {
|
for (var i = 0; i < children.length; i++) {
|
if (Array.isArray(children[i])) {
|
return Array.prototype.concat.apply([], children);
|
}
|
}
|
|
return children;
|
} // 2. When the children contains constructs that always generated nested Arrays,
|
// e.g. <template>, <slot>, v-for, or when the children is provided by user
|
// with hand-written render functions / JSX. In such cases a full normalization
|
// is needed to cater to all possible types of children values.
|
|
|
function normalizeChildren(children) {
|
return isPrimitive(children) ? [createTextVNode(children)] : Array.isArray(children) ? normalizeArrayChildren(children) : undefined;
|
}
|
|
function isTextNode(node) {
|
return isDef(node) && isDef(node.text) && isFalse(node.isComment);
|
}
|
|
function normalizeArrayChildren(children, nestedIndex) {
|
var res = [];
|
var i, c, lastIndex, last;
|
|
for (i = 0; i < children.length; i++) {
|
c = children[i];
|
|
if (isUndef(c) || typeof c === 'boolean') {
|
continue;
|
}
|
|
lastIndex = res.length - 1;
|
last = res[lastIndex]; // nested
|
|
if (Array.isArray(c)) {
|
if (c.length > 0) {
|
c = normalizeArrayChildren(c, (nestedIndex || '') + "_" + i); // merge adjacent text nodes
|
|
if (isTextNode(c[0]) && isTextNode(last)) {
|
res[lastIndex] = createTextVNode(last.text + c[0].text);
|
c.shift();
|
}
|
|
res.push.apply(res, c);
|
}
|
} else if (isPrimitive(c)) {
|
if (isTextNode(last)) {
|
// merge adjacent text nodes
|
// this is necessary for SSR hydration because text nodes are
|
// essentially merged when rendered to HTML strings
|
res[lastIndex] = createTextVNode(last.text + c);
|
} else if (c !== '') {
|
// convert primitive to vnode
|
res.push(createTextVNode(c));
|
}
|
} else {
|
if (isTextNode(c) && isTextNode(last)) {
|
// merge adjacent text nodes
|
res[lastIndex] = createTextVNode(last.text + c.text);
|
} else {
|
// default key for nested array children (likely generated by v-for)
|
if (isTrue(children._isVList) && isDef(c.tag) && isUndef(c.key) && isDef(nestedIndex)) {
|
c.key = "__vlist" + nestedIndex + "_" + i + "__";
|
}
|
|
res.push(c);
|
}
|
}
|
}
|
|
return res;
|
}
|
/* */
|
|
|
function initProvide(vm) {
|
var provide = vm.$options.provide;
|
|
if (provide) {
|
vm._provided = typeof provide === 'function' ? provide.call(vm) : provide;
|
}
|
}
|
|
function initInjections(vm) {
|
var result = resolveInject(vm.$options.inject, vm);
|
|
if (result) {
|
toggleObserving(false);
|
Object.keys(result).forEach(function (key) {
|
/* istanbul ignore else */
|
if (true) {
|
defineReactive$$1(vm, key, result[key], function () {
|
warn("Avoid mutating an injected value directly since the changes will be " + "overwritten whenever the provided component re-renders. " + "injection being mutated: \"" + key + "\"", vm);
|
});
|
} else {}
|
});
|
toggleObserving(true);
|
}
|
}
|
|
function resolveInject(inject, vm) {
|
if (inject) {
|
// inject is :any because flow is not smart enough to figure out cached
|
var result = Object.create(null);
|
var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
|
|
for (var i = 0; i < keys.length; i++) {
|
var key = keys[i]; // #6574 in case the inject object is observed...
|
|
if (key === '__ob__') {
|
continue;
|
}
|
|
var provideKey = inject[key].from;
|
var source = vm;
|
|
while (source) {
|
if (source._provided && hasOwn(source._provided, provideKey)) {
|
result[key] = source._provided[provideKey];
|
break;
|
}
|
|
source = source.$parent;
|
}
|
|
if (!source) {
|
if ('default' in inject[key]) {
|
var provideDefault = inject[key].default;
|
result[key] = typeof provideDefault === 'function' ? provideDefault.call(vm) : provideDefault;
|
} else if (true) {
|
warn("Injection \"" + key + "\" not found", vm);
|
}
|
}
|
}
|
|
return result;
|
}
|
}
|
/* */
|
|
/**
|
* Runtime helper for resolving raw children VNodes into a slot object.
|
*/
|
|
|
function resolveSlots(children, context) {
|
if (!children || !children.length) {
|
return {};
|
}
|
|
var slots = {};
|
|
for (var i = 0, l = children.length; i < l; i++) {
|
var child = children[i];
|
var data = child.data; // remove slot attribute if the node is resolved as a Vue slot node
|
|
if (data && data.attrs && data.attrs.slot) {
|
delete data.attrs.slot;
|
} // named slots should only be respected if the vnode was rendered in the
|
// same context.
|
|
|
if ((child.context === context || child.fnContext === context) && data && data.slot != null) {
|
var name = data.slot;
|
var slot = slots[name] || (slots[name] = []);
|
|
if (child.tag === 'template') {
|
slot.push.apply(slot, child.children || []);
|
} else {
|
slot.push(child);
|
}
|
} else {
|
// fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
|
if (child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page') {
|
(slots['page'] || (slots['page'] = [])).push(child);
|
} else {
|
(slots.default || (slots.default = [])).push(child);
|
}
|
}
|
} // ignore slots that contains only whitespace
|
|
|
for (var name$1 in slots) {
|
if (slots[name$1].every(isWhitespace)) {
|
delete slots[name$1];
|
}
|
}
|
|
return slots;
|
}
|
|
function isWhitespace(node) {
|
return node.isComment && !node.asyncFactory || node.text === ' ';
|
}
|
/* */
|
|
|
function normalizeScopedSlots(slots, normalSlots, prevSlots) {
|
var res;
|
var hasNormalSlots = Object.keys(normalSlots).length > 0;
|
var isStable = slots ? !!slots.$stable : !hasNormalSlots;
|
var key = slots && slots.$key;
|
|
if (!slots) {
|
res = {};
|
} else if (slots._normalized) {
|
// fast path 1: child component re-render only, parent did not change
|
return slots._normalized;
|
} else if (isStable && prevSlots && prevSlots !== emptyObject && key === prevSlots.$key && !hasNormalSlots && !prevSlots.$hasNormal) {
|
// fast path 2: stable scoped slots w/ no normal slots to proxy,
|
// only need to normalize once
|
return prevSlots;
|
} else {
|
res = {};
|
|
for (var key$1 in slots) {
|
if (slots[key$1] && key$1[0] !== '$') {
|
res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
|
}
|
}
|
} // expose normal slots on scopedSlots
|
|
|
for (var key$2 in normalSlots) {
|
if (!(key$2 in res)) {
|
res[key$2] = proxyNormalSlot(normalSlots, key$2);
|
}
|
} // avoriaz seems to mock a non-extensible $scopedSlots object
|
// and when that is passed down this would cause an error
|
|
|
if (slots && Object.isExtensible(slots)) {
|
slots._normalized = res;
|
}
|
|
def(res, '$stable', isStable);
|
def(res, '$key', key);
|
def(res, '$hasNormal', hasNormalSlots);
|
return res;
|
}
|
|
function normalizeScopedSlot(normalSlots, key, fn) {
|
var normalized = function normalized() {
|
var res = arguments.length ? fn.apply(null, arguments) : fn({});
|
res = res && _typeof(res) === 'object' && !Array.isArray(res) ? [res] // single vnode
|
: normalizeChildren(res);
|
return res && (res.length === 0 || res.length === 1 && res[0].isComment // #9658
|
) ? undefined : res;
|
}; // this is a slot using the new v-slot syntax without scope. although it is
|
// compiled as a scoped slot, render fn users would expect it to be present
|
// on this.$slots because the usage is semantically a normal slot.
|
|
|
if (fn.proxy) {
|
Object.defineProperty(normalSlots, key, {
|
get: normalized,
|
enumerable: true,
|
configurable: true
|
});
|
}
|
|
return normalized;
|
}
|
|
function proxyNormalSlot(slots, key) {
|
return function () {
|
return slots[key];
|
};
|
}
|
/* */
|
|
/**
|
* Runtime helper for rendering v-for lists.
|
*/
|
|
|
function renderList(val, render) {
|
var ret, i, l, keys, key;
|
|
if (Array.isArray(val) || typeof val === 'string') {
|
ret = new Array(val.length);
|
|
for (i = 0, l = val.length; i < l; i++) {
|
ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
|
}
|
} else if (typeof val === 'number') {
|
ret = new Array(val);
|
|
for (i = 0; i < val; i++) {
|
ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
|
}
|
} else if (isObject(val)) {
|
if (hasSymbol && val[Symbol.iterator]) {
|
ret = [];
|
var iterator = val[Symbol.iterator]();
|
var result = iterator.next();
|
|
while (!result.done) {
|
ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
|
|
result = iterator.next();
|
}
|
} else {
|
keys = Object.keys(val);
|
ret = new Array(keys.length);
|
|
for (i = 0, l = keys.length; i < l; i++) {
|
key = keys[i];
|
ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
|
}
|
}
|
}
|
|
if (!isDef(ret)) {
|
ret = [];
|
}
|
|
ret._isVList = true;
|
return ret;
|
}
|
/* */
|
|
/**
|
* Runtime helper for rendering <slot>
|
*/
|
|
|
function renderSlot(name, fallback, props, bindObject) {
|
var scopedSlotFn = this.$scopedSlots[name];
|
var nodes;
|
|
if (scopedSlotFn) {
|
// scoped slot
|
props = props || {};
|
|
if (bindObject) {
|
if ( true && !isObject(bindObject)) {
|
warn('slot v-bind without argument expects an Object', this);
|
}
|
|
props = extend(extend({}, bindObject), props);
|
} // fixed by xxxxxx app-plus scopedSlot
|
|
|
nodes = scopedSlotFn(props, this, props._i) || fallback;
|
} else {
|
nodes = this.$slots[name] || fallback;
|
}
|
|
var target = props && props.slot;
|
|
if (target) {
|
return this.$createElement('template', {
|
slot: target
|
}, nodes);
|
} else {
|
return nodes;
|
}
|
}
|
/* */
|
|
/**
|
* Runtime helper for resolving filters
|
*/
|
|
|
function resolveFilter(id) {
|
return resolveAsset(this.$options, 'filters', id, true) || identity;
|
}
|
/* */
|
|
|
function isKeyNotMatch(expect, actual) {
|
if (Array.isArray(expect)) {
|
return expect.indexOf(actual) === -1;
|
} else {
|
return expect !== actual;
|
}
|
}
|
/**
|
* Runtime helper for checking keyCodes from config.
|
* exposed as Vue.prototype._k
|
* passing in eventKeyName as last argument separately for backwards compat
|
*/
|
|
|
function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
|
var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
|
|
if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
|
return isKeyNotMatch(builtInKeyName, eventKeyName);
|
} else if (mappedKeyCode) {
|
return isKeyNotMatch(mappedKeyCode, eventKeyCode);
|
} else if (eventKeyName) {
|
return hyphenate(eventKeyName) !== key;
|
}
|
}
|
/* */
|
|
/**
|
* Runtime helper for merging v-bind="object" into a VNode's data.
|
*/
|
|
|
function bindObjectProps(data, tag, value, asProp, isSync) {
|
if (value) {
|
if (!isObject(value)) {
|
true && warn('v-bind without argument expects an Object or Array value', this);
|
} else {
|
if (Array.isArray(value)) {
|
value = toObject(value);
|
}
|
|
var hash;
|
|
var loop = function loop(key) {
|
if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
|
hash = data;
|
} else {
|
var type = data.attrs && data.attrs.type;
|
hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});
|
}
|
|
var camelizedKey = camelize(key);
|
var hyphenatedKey = hyphenate(key);
|
|
if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
|
hash[key] = value[key];
|
|
if (isSync) {
|
var on = data.on || (data.on = {});
|
|
on["update:" + key] = function ($event) {
|
value[key] = $event;
|
};
|
}
|
}
|
};
|
|
for (var key in value) {
|
loop(key);
|
}
|
}
|
}
|
|
return data;
|
}
|
/* */
|
|
/**
|
* Runtime helper for rendering static trees.
|
*/
|
|
|
function renderStatic(index, isInFor) {
|
var cached = this._staticTrees || (this._staticTrees = []);
|
var tree = cached[index]; // if has already-rendered static tree and not inside v-for,
|
// we can reuse the same tree.
|
|
if (tree && !isInFor) {
|
return tree;
|
} // otherwise, render a fresh tree.
|
|
|
tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates
|
);
|
markStatic(tree, "__static__" + index, false);
|
return tree;
|
}
|
/**
|
* Runtime helper for v-once.
|
* Effectively it means marking the node as static with a unique key.
|
*/
|
|
|
function markOnce(tree, index, key) {
|
markStatic(tree, "__once__" + index + (key ? "_" + key : ""), true);
|
return tree;
|
}
|
|
function markStatic(tree, key, isOnce) {
|
if (Array.isArray(tree)) {
|
for (var i = 0; i < tree.length; i++) {
|
if (tree[i] && typeof tree[i] !== 'string') {
|
markStaticNode(tree[i], key + "_" + i, isOnce);
|
}
|
}
|
} else {
|
markStaticNode(tree, key, isOnce);
|
}
|
}
|
|
function markStaticNode(node, key, isOnce) {
|
node.isStatic = true;
|
node.key = key;
|
node.isOnce = isOnce;
|
}
|
/* */
|
|
|
function bindObjectListeners(data, value) {
|
if (value) {
|
if (!isPlainObject(value)) {
|
true && warn('v-on without argument expects an Object value', this);
|
} else {
|
var on = data.on = data.on ? extend({}, data.on) : {};
|
|
for (var key in value) {
|
var existing = on[key];
|
var ours = value[key];
|
on[key] = existing ? [].concat(existing, ours) : ours;
|
}
|
}
|
}
|
|
return data;
|
}
|
/* */
|
|
|
function resolveScopedSlots(fns, // see flow/vnode
|
res, // the following are added in 2.6
|
hasDynamicKeys, contentHashKey) {
|
res = res || {
|
$stable: !hasDynamicKeys
|
};
|
|
for (var i = 0; i < fns.length; i++) {
|
var slot = fns[i];
|
|
if (Array.isArray(slot)) {
|
resolveScopedSlots(slot, res, hasDynamicKeys);
|
} else if (slot) {
|
// marker for reverse proxying v-slot without scope on this.$slots
|
if (slot.proxy) {
|
slot.fn.proxy = true;
|
}
|
|
res[slot.key] = slot.fn;
|
}
|
}
|
|
if (contentHashKey) {
|
res.$key = contentHashKey;
|
}
|
|
return res;
|
}
|
/* */
|
|
|
function bindDynamicKeys(baseObj, values) {
|
for (var i = 0; i < values.length; i += 2) {
|
var key = values[i];
|
|
if (typeof key === 'string' && key) {
|
baseObj[values[i]] = values[i + 1];
|
} else if ( true && key !== '' && key !== null) {
|
// null is a special value for explicitly removing a binding
|
warn("Invalid value for dynamic directive argument (expected string or null): " + key, this);
|
}
|
}
|
|
return baseObj;
|
} // helper to dynamically append modifier runtime markers to event names.
|
// ensure only append when value is already string, otherwise it will be cast
|
// to string and cause the type check to miss.
|
|
|
function prependModifier(value, symbol) {
|
return typeof value === 'string' ? symbol + value : value;
|
}
|
/* */
|
|
|
function installRenderHelpers(target) {
|
target._o = markOnce;
|
target._n = toNumber;
|
target._s = toString;
|
target._l = renderList;
|
target._t = renderSlot;
|
target._q = looseEqual;
|
target._i = looseIndexOf;
|
target._m = renderStatic;
|
target._f = resolveFilter;
|
target._k = checkKeyCodes;
|
target._b = bindObjectProps;
|
target._v = createTextVNode;
|
target._e = createEmptyVNode;
|
target._u = resolveScopedSlots;
|
target._g = bindObjectListeners;
|
target._d = bindDynamicKeys;
|
target._p = prependModifier;
|
}
|
/* */
|
|
|
function FunctionalRenderContext(data, props, children, parent, Ctor) {
|
var this$1 = this;
|
var options = Ctor.options; // ensure the createElement function in functional components
|
// gets a unique context - this is necessary for correct named slot check
|
|
var contextVm;
|
|
if (hasOwn(parent, '_uid')) {
|
contextVm = Object.create(parent); // $flow-disable-line
|
|
contextVm._original = parent;
|
} else {
|
// the context vm passed in is a functional context as well.
|
// in this case we want to make sure we are able to get a hold to the
|
// real context instance.
|
contextVm = parent; // $flow-disable-line
|
|
parent = parent._original;
|
}
|
|
var isCompiled = isTrue(options._compiled);
|
var needNormalization = !isCompiled;
|
this.data = data;
|
this.props = props;
|
this.children = children;
|
this.parent = parent;
|
this.listeners = data.on || emptyObject;
|
this.injections = resolveInject(options.inject, parent);
|
|
this.slots = function () {
|
if (!this$1.$slots) {
|
normalizeScopedSlots(data.scopedSlots, this$1.$slots = resolveSlots(children, parent));
|
}
|
|
return this$1.$slots;
|
};
|
|
Object.defineProperty(this, 'scopedSlots', {
|
enumerable: true,
|
get: function get() {
|
return normalizeScopedSlots(data.scopedSlots, this.slots());
|
}
|
}); // support for compiled functional template
|
|
if (isCompiled) {
|
// exposing $options for renderStatic()
|
this.$options = options; // pre-resolve slots for renderSlot()
|
|
this.$slots = this.slots();
|
this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
|
}
|
|
if (options._scopeId) {
|
this._c = function (a, b, c, d) {
|
var vnode = createElement(contextVm, a, b, c, d, needNormalization);
|
|
if (vnode && !Array.isArray(vnode)) {
|
vnode.fnScopeId = options._scopeId;
|
vnode.fnContext = parent;
|
}
|
|
return vnode;
|
};
|
} else {
|
this._c = function (a, b, c, d) {
|
return createElement(contextVm, a, b, c, d, needNormalization);
|
};
|
}
|
}
|
|
installRenderHelpers(FunctionalRenderContext.prototype);
|
|
function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
|
var options = Ctor.options;
|
var props = {};
|
var propOptions = options.props;
|
|
if (isDef(propOptions)) {
|
for (var key in propOptions) {
|
props[key] = validateProp(key, propOptions, propsData || emptyObject);
|
}
|
} else {
|
if (isDef(data.attrs)) {
|
mergeProps(props, data.attrs);
|
}
|
|
if (isDef(data.props)) {
|
mergeProps(props, data.props);
|
}
|
}
|
|
var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
|
var vnode = options.render.call(null, renderContext._c, renderContext);
|
|
if (vnode instanceof VNode) {
|
return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
|
} else if (Array.isArray(vnode)) {
|
var vnodes = normalizeChildren(vnode) || [];
|
var res = new Array(vnodes.length);
|
|
for (var i = 0; i < vnodes.length; i++) {
|
res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
|
}
|
|
return res;
|
}
|
}
|
|
function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
|
// #7817 clone node before setting fnContext, otherwise if the node is reused
|
// (e.g. it was from a cached normal slot) the fnContext causes named slots
|
// that should not be matched to match.
|
var clone = cloneVNode(vnode);
|
clone.fnContext = contextVm;
|
clone.fnOptions = options;
|
|
if (true) {
|
(clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
|
}
|
|
if (data.slot) {
|
(clone.data || (clone.data = {})).slot = data.slot;
|
}
|
|
return clone;
|
}
|
|
function mergeProps(to, from) {
|
for (var key in from) {
|
to[camelize(key)] = from[key];
|
}
|
}
|
/* */
|
|
/* */
|
|
/* */
|
|
/* */
|
// inline hooks to be invoked on component VNodes during patch
|
|
|
var componentVNodeHooks = {
|
init: function init(vnode, hydrating) {
|
if (vnode.componentInstance && !vnode.componentInstance._isDestroyed && vnode.data.keepAlive) {
|
// kept-alive components, treat as a patch
|
var mountedNode = vnode; // work around flow
|
|
componentVNodeHooks.prepatch(mountedNode, mountedNode);
|
} else {
|
var child = vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance);
|
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
}
|
},
|
prepatch: function prepatch(oldVnode, vnode) {
|
var options = vnode.componentOptions;
|
var child = vnode.componentInstance = oldVnode.componentInstance;
|
updateChildComponent(child, options.propsData, // updated props
|
options.listeners, // updated listeners
|
vnode, // new parent vnode
|
options.children // new children
|
);
|
},
|
insert: function insert(vnode) {
|
var context = vnode.context;
|
var componentInstance = vnode.componentInstance;
|
|
if (!componentInstance._isMounted) {
|
callHook(componentInstance, 'onServiceCreated');
|
callHook(componentInstance, 'onServiceAttached');
|
componentInstance._isMounted = true;
|
callHook(componentInstance, 'mounted');
|
}
|
|
if (vnode.data.keepAlive) {
|
if (context._isMounted) {
|
// vue-router#1212
|
// During updates, a kept-alive component's child components may
|
// change, so directly walking the tree here may call activated hooks
|
// on incorrect children. Instead we push them into a queue which will
|
// be processed after the whole patch process ended.
|
queueActivatedComponent(componentInstance);
|
} else {
|
activateChildComponent(componentInstance, true
|
/* direct */
|
);
|
}
|
}
|
},
|
destroy: function destroy(vnode) {
|
var componentInstance = vnode.componentInstance;
|
|
if (!componentInstance._isDestroyed) {
|
if (!vnode.data.keepAlive) {
|
componentInstance.$destroy();
|
} else {
|
deactivateChildComponent(componentInstance, true
|
/* direct */
|
);
|
}
|
}
|
}
|
};
|
var hooksToMerge = Object.keys(componentVNodeHooks);
|
|
function createComponent(Ctor, data, context, children, tag) {
|
if (isUndef(Ctor)) {
|
return;
|
}
|
|
var baseCtor = context.$options._base; // plain options object: turn it into a constructor
|
|
if (isObject(Ctor)) {
|
Ctor = baseCtor.extend(Ctor);
|
} // if at this stage it's not a constructor or an async component factory,
|
// reject.
|
|
|
if (typeof Ctor !== 'function') {
|
if (true) {
|
warn("Invalid Component definition: " + String(Ctor), context);
|
}
|
|
return;
|
} // async component
|
|
|
var asyncFactory;
|
|
if (isUndef(Ctor.cid)) {
|
asyncFactory = Ctor;
|
Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
|
|
if (Ctor === undefined) {
|
// return a placeholder node for async component, which is rendered
|
// as a comment node but preserves all the raw information for the node.
|
// the information will be used for async server-rendering and hydration.
|
return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
|
}
|
}
|
|
data = data || {}; // resolve constructor options in case global mixins are applied after
|
// component constructor creation
|
|
resolveConstructorOptions(Ctor); // transform component v-model data into props & events
|
|
if (isDef(data.model)) {
|
transformModel(Ctor.options, data);
|
} // extract props
|
|
|
var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
|
// functional component
|
|
if (isTrue(Ctor.options.functional)) {
|
return createFunctionalComponent(Ctor, propsData, data, context, children);
|
} // extract listeners, since these needs to be treated as
|
// child component listeners instead of DOM listeners
|
|
|
var listeners = data.on; // replace with listeners with .native modifier
|
// so it gets processed during parent component patch.
|
|
data.on = data.nativeOn;
|
|
if (isTrue(Ctor.options.abstract)) {
|
// abstract components do not keep anything
|
// other than props & listeners & slot
|
// work around flow
|
var slot = data.slot;
|
data = {};
|
|
if (slot) {
|
data.slot = slot;
|
}
|
} // install component management hooks onto the placeholder node
|
|
|
installComponentHooks(data); // return a placeholder vnode
|
|
var name = Ctor.options.name || tag;
|
var vnode = new VNode("vue-component-" + Ctor.cid + (name ? "-" + name : ''), data, undefined, undefined, undefined, context, {
|
Ctor: Ctor,
|
propsData: propsData,
|
listeners: listeners,
|
tag: tag,
|
children: children
|
}, asyncFactory);
|
return vnode;
|
}
|
|
function createComponentInstanceForVnode(vnode, // we know it's MountedComponentVNode but flow doesn't
|
parent // activeInstance in lifecycle state
|
) {
|
var options = {
|
_isComponent: true,
|
_parentVnode: vnode,
|
parent: parent
|
}; // check inline-template render functions
|
|
var inlineTemplate = vnode.data.inlineTemplate;
|
|
if (isDef(inlineTemplate)) {
|
options.render = inlineTemplate.render;
|
options.staticRenderFns = inlineTemplate.staticRenderFns;
|
}
|
|
return new vnode.componentOptions.Ctor(options);
|
}
|
|
function installComponentHooks(data) {
|
var hooks = data.hook || (data.hook = {});
|
|
for (var i = 0; i < hooksToMerge.length; i++) {
|
var key = hooksToMerge[i];
|
var existing = hooks[key];
|
var toMerge = componentVNodeHooks[key];
|
|
if (existing !== toMerge && !(existing && existing._merged)) {
|
hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
|
}
|
}
|
}
|
|
function mergeHook$1(f1, f2) {
|
var merged = function merged(a, b) {
|
// flow complains about extra args which is why we use any
|
f1(a, b);
|
f2(a, b);
|
};
|
|
merged._merged = true;
|
return merged;
|
} // transform component v-model info (value and callback) into
|
// prop and event handler respectively.
|
|
|
function transformModel(options, data) {
|
var prop = options.model && options.model.prop || 'value';
|
var event = options.model && options.model.event || 'input';
|
(data.attrs || (data.attrs = {}))[prop] = data.model.value;
|
var on = data.on || (data.on = {});
|
var existing = on[event];
|
var callback = data.model.callback;
|
|
if (isDef(existing)) {
|
if (Array.isArray(existing) ? existing.indexOf(callback) === -1 : existing !== callback) {
|
on[event] = [callback].concat(existing);
|
}
|
} else {
|
on[event] = callback;
|
}
|
}
|
/* */
|
|
|
var SIMPLE_NORMALIZE = 1;
|
var ALWAYS_NORMALIZE = 2; // wrapper function for providing a more flexible interface
|
// without getting yelled at by flow
|
|
function createElement(context, tag, data, children, normalizationType, alwaysNormalize) {
|
if (Array.isArray(data) || isPrimitive(data)) {
|
normalizationType = children;
|
children = data;
|
data = undefined;
|
}
|
|
if (isTrue(alwaysNormalize)) {
|
normalizationType = ALWAYS_NORMALIZE;
|
}
|
|
return _createElement(context, tag, data, children, normalizationType);
|
}
|
|
function _createElement(context, tag, data, children, normalizationType) {
|
if (isDef(data) && isDef(data.__ob__)) {
|
true && warn("Avoid using observed data object as vnode data: " + JSON.stringify(data) + "\n" + 'Always create fresh vnode data objects in each render!', context);
|
return createEmptyVNode();
|
} // object syntax in v-bind
|
|
|
if (isDef(data) && isDef(data.is)) {
|
tag = data.is;
|
}
|
|
if (!tag) {
|
// in case of component :is set to falsy value
|
return createEmptyVNode();
|
} // warn against non-primitive key
|
|
|
if ( true && isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
|
{
|
warn('Avoid using non-primitive value as key, ' + 'use string/number value instead.', context);
|
}
|
} // support single function children as default scoped slot
|
|
|
if (Array.isArray(children) && typeof children[0] === 'function') {
|
data = data || {};
|
data.scopedSlots = {
|
default: children[0]
|
};
|
children.length = 0;
|
}
|
|
if (normalizationType === ALWAYS_NORMALIZE) {
|
children = normalizeChildren(children);
|
} else if (normalizationType === SIMPLE_NORMALIZE) {
|
children = simpleNormalizeChildren(children);
|
}
|
|
var vnode, ns;
|
|
if (typeof tag === 'string') {
|
var Ctor;
|
ns = context.$vnode && context.$vnode.ns || config.getTagNamespace(tag);
|
|
if (config.isReservedTag(tag)) {
|
// platform built-in elements
|
if ( true && isDef(data) && isDef(data.nativeOn)) {
|
warn("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">.", context);
|
}
|
|
vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
|
} else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
|
// component
|
vnode = createComponent(Ctor, data, context, children, tag);
|
} else {
|
// unknown or unlisted namespaced elements
|
// check at runtime because it may get assigned a namespace when its
|
// parent normalizes children
|
vnode = new VNode(tag, data, children, undefined, undefined, context);
|
}
|
} else {
|
// direct component options / constructor
|
vnode = createComponent(tag, data, context, children);
|
}
|
|
if (Array.isArray(vnode)) {
|
return vnode;
|
} else if (isDef(vnode)) {
|
if (isDef(ns)) {
|
applyNS(vnode, ns);
|
}
|
|
if (isDef(data)) {
|
registerDeepBindings(data);
|
}
|
|
return vnode;
|
} else {
|
return createEmptyVNode();
|
}
|
}
|
|
function applyNS(vnode, ns, force) {
|
vnode.ns = ns;
|
|
if (vnode.tag === 'foreignObject') {
|
// use default namespace inside foreignObject
|
ns = undefined;
|
force = true;
|
}
|
|
if (isDef(vnode.children)) {
|
for (var i = 0, l = vnode.children.length; i < l; i++) {
|
var child = vnode.children[i];
|
|
if (isDef(child.tag) && (isUndef(child.ns) || isTrue(force) && child.tag !== 'svg')) {
|
applyNS(child, ns, force);
|
}
|
}
|
}
|
} // ref #5318
|
// necessary to ensure parent re-render when deep bindings like :style and
|
// :class are used on slot nodes
|
|
|
function registerDeepBindings(data) {
|
if (isObject(data.style)) {
|
traverse(data.style);
|
}
|
|
if (isObject(data.class)) {
|
traverse(data.class);
|
}
|
}
|
/* */
|
|
|
function initRender(vm) {
|
vm._vnode = null; // the root of the child tree
|
|
vm._staticTrees = null; // v-once cached trees
|
|
var options = vm.$options;
|
var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
|
|
var renderContext = parentVnode && parentVnode.context;
|
vm.$slots = resolveSlots(options._renderChildren, renderContext);
|
vm.$scopedSlots = emptyObject; // bind the createElement fn to this instance
|
// so that we get proper render context inside it.
|
// args order: tag, data, children, normalizationType, alwaysNormalize
|
// internal version is used by render functions compiled from templates
|
|
vm._c = function (a, b, c, d) {
|
return createElement(vm, a, b, c, d, false);
|
}; // normalization is always applied for the public version, used in
|
// user-written render functions.
|
|
|
vm.$createElement = function (a, b, c, d) {
|
return createElement(vm, a, b, c, d, true);
|
}; // $attrs & $listeners are exposed for easier HOC creation.
|
// they need to be reactive so that HOCs using them are always updated
|
|
|
var parentData = parentVnode && parentVnode.data;
|
/* istanbul ignore else */
|
|
if (true) {
|
defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
|
!isUpdatingChildComponent && warn("$attrs is readonly.", vm);
|
}, true);
|
defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
|
!isUpdatingChildComponent && warn("$listeners is readonly.", vm);
|
}, true);
|
} else {}
|
}
|
|
var currentRenderingInstance = null;
|
|
function renderMixin(Vue) {
|
// install runtime convenience helpers
|
installRenderHelpers(Vue.prototype);
|
|
Vue.prototype.$nextTick = function (fn) {
|
return nextTick(fn, this);
|
};
|
|
Vue.prototype._render = function () {
|
var vm = this;
|
var ref = vm.$options;
|
var render = ref.render;
|
var _parentVnode = ref._parentVnode;
|
|
if (_parentVnode) {
|
vm.$scopedSlots = normalizeScopedSlots(_parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
|
} // set parent vnode. this allows render functions to have access
|
// to the data on the placeholder node.
|
|
|
vm.$vnode = _parentVnode; // render self
|
|
var vnode;
|
|
try {
|
// There's no need to maintain a stack because all render fns are called
|
// separately from one another. Nested component's render fns are called
|
// when parent component is patched.
|
currentRenderingInstance = vm;
|
vnode = render.call(vm._renderProxy, vm.$createElement);
|
} catch (e) {
|
handleError(e, vm, "render"); // return error render result,
|
// or previous vnode to prevent render error causing blank component
|
|
/* istanbul ignore else */
|
|
if ( true && vm.$options.renderError) {
|
try {
|
vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
|
} catch (e) {
|
handleError(e, vm, "renderError");
|
vnode = vm._vnode;
|
}
|
} else {
|
vnode = vm._vnode;
|
}
|
} finally {
|
currentRenderingInstance = null;
|
} // if the returned array contains only a single node, allow it
|
|
|
if (Array.isArray(vnode) && vnode.length === 1) {
|
vnode = vnode[0];
|
} // return empty vnode in case the render function errored out
|
|
|
if (!(vnode instanceof VNode)) {
|
if ( true && Array.isArray(vnode)) {
|
warn('Multiple root nodes returned from render function. Render function ' + 'should return a single root node.', vm);
|
}
|
|
vnode = createEmptyVNode();
|
} // set parent
|
|
|
vnode.parent = _parentVnode;
|
return vnode;
|
};
|
}
|
/* */
|
|
|
function ensureCtor(comp, base) {
|
if (comp.__esModule || hasSymbol && comp[Symbol.toStringTag] === 'Module') {
|
comp = comp.default;
|
}
|
|
return isObject(comp) ? base.extend(comp) : comp;
|
}
|
|
function createAsyncPlaceholder(factory, data, context, children, tag) {
|
var node = createEmptyVNode();
|
node.asyncFactory = factory;
|
node.asyncMeta = {
|
data: data,
|
context: context,
|
children: children,
|
tag: tag
|
};
|
return node;
|
}
|
|
function resolveAsyncComponent(factory, baseCtor) {
|
if (isTrue(factory.error) && isDef(factory.errorComp)) {
|
return factory.errorComp;
|
}
|
|
if (isDef(factory.resolved)) {
|
return factory.resolved;
|
}
|
|
var owner = currentRenderingInstance;
|
|
if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
|
// already pending
|
factory.owners.push(owner);
|
}
|
|
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
|
return factory.loadingComp;
|
}
|
|
if (owner && !isDef(factory.owners)) {
|
var owners = factory.owners = [owner];
|
var sync = true;
|
var timerLoading = null;
|
var timerTimeout = null;
|
owner.$on('hook:destroyed', function () {
|
return remove(owners, owner);
|
});
|
|
var forceRender = function forceRender(renderCompleted) {
|
for (var i = 0, l = owners.length; i < l; i++) {
|
owners[i].$forceUpdate();
|
}
|
|
if (renderCompleted) {
|
owners.length = 0;
|
|
if (timerLoading !== null) {
|
clearTimeout(timerLoading);
|
timerLoading = null;
|
}
|
|
if (timerTimeout !== null) {
|
clearTimeout(timerTimeout);
|
timerTimeout = null;
|
}
|
}
|
};
|
|
var resolve = once(function (res) {
|
// cache resolved
|
factory.resolved = ensureCtor(res, baseCtor); // invoke callbacks only if this is not a synchronous resolve
|
// (async resolves are shimmed as synchronous during SSR)
|
|
if (!sync) {
|
forceRender(true);
|
} else {
|
owners.length = 0;
|
}
|
});
|
var reject = once(function (reason) {
|
true && warn("Failed to resolve async component: " + String(factory) + (reason ? "\nReason: " + reason : ''));
|
|
if (isDef(factory.errorComp)) {
|
factory.error = true;
|
forceRender(true);
|
}
|
});
|
var res = factory(resolve, reject);
|
|
if (isObject(res)) {
|
if (isPromise(res)) {
|
// () => Promise
|
if (isUndef(factory.resolved)) {
|
res.then(resolve, reject);
|
}
|
} else if (isPromise(res.component)) {
|
res.component.then(resolve, reject);
|
|
if (isDef(res.error)) {
|
factory.errorComp = ensureCtor(res.error, baseCtor);
|
}
|
|
if (isDef(res.loading)) {
|
factory.loadingComp = ensureCtor(res.loading, baseCtor);
|
|
if (res.delay === 0) {
|
factory.loading = true;
|
} else {
|
timerLoading = setTimeout(function () {
|
timerLoading = null;
|
|
if (isUndef(factory.resolved) && isUndef(factory.error)) {
|
factory.loading = true;
|
forceRender(false);
|
}
|
}, res.delay || 200);
|
}
|
}
|
|
if (isDef(res.timeout)) {
|
timerTimeout = setTimeout(function () {
|
timerTimeout = null;
|
|
if (isUndef(factory.resolved)) {
|
reject( true ? "timeout (" + res.timeout + "ms)" : undefined);
|
}
|
}, res.timeout);
|
}
|
}
|
}
|
|
sync = false; // return in case resolved synchronously
|
|
return factory.loading ? factory.loadingComp : factory.resolved;
|
}
|
}
|
/* */
|
|
|
function isAsyncPlaceholder(node) {
|
return node.isComment && node.asyncFactory;
|
}
|
/* */
|
|
|
function getFirstComponentChild(children) {
|
if (Array.isArray(children)) {
|
for (var i = 0; i < children.length; i++) {
|
var c = children[i];
|
|
if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
|
return c;
|
}
|
}
|
}
|
}
|
/* */
|
|
/* */
|
|
|
function initEvents(vm) {
|
vm._events = Object.create(null);
|
vm._hasHookEvent = false; // init parent attached events
|
|
var listeners = vm.$options._parentListeners;
|
|
if (listeners) {
|
updateComponentListeners(vm, listeners);
|
}
|
}
|
|
var target;
|
|
function add(event, fn) {
|
target.$on(event, fn);
|
}
|
|
function remove$1(event, fn) {
|
target.$off(event, fn);
|
}
|
|
function createOnceHandler(event, fn) {
|
var _target = target;
|
return function onceHandler() {
|
var res = fn.apply(null, arguments);
|
|
if (res !== null) {
|
_target.$off(event, onceHandler);
|
}
|
};
|
}
|
|
function updateComponentListeners(vm, listeners, oldListeners) {
|
target = vm;
|
updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
|
target = undefined;
|
}
|
|
function eventsMixin(Vue) {
|
var hookRE = /^hook:/;
|
|
Vue.prototype.$on = function (event, fn) {
|
var vm = this;
|
|
if (Array.isArray(event)) {
|
for (var i = 0, l = event.length; i < l; i++) {
|
vm.$on(event[i], fn);
|
}
|
} else {
|
(vm._events[event] || (vm._events[event] = [])).push(fn); // optimize hook:event cost by using a boolean flag marked at registration
|
// instead of a hash lookup
|
|
if (hookRE.test(event)) {
|
vm._hasHookEvent = true;
|
}
|
}
|
|
return vm;
|
};
|
|
Vue.prototype.$once = function (event, fn) {
|
var vm = this;
|
|
function on() {
|
vm.$off(event, on);
|
fn.apply(vm, arguments);
|
}
|
|
on.fn = fn;
|
vm.$on(event, on);
|
return vm;
|
};
|
|
Vue.prototype.$off = function (event, fn) {
|
var vm = this; // all
|
|
if (!arguments.length) {
|
vm._events = Object.create(null);
|
return vm;
|
} // array of events
|
|
|
if (Array.isArray(event)) {
|
for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
|
vm.$off(event[i$1], fn);
|
}
|
|
return vm;
|
} // specific event
|
|
|
var cbs = vm._events[event];
|
|
if (!cbs) {
|
return vm;
|
}
|
|
if (!fn) {
|
vm._events[event] = null;
|
return vm;
|
} // specific handler
|
|
|
var cb;
|
var i = cbs.length;
|
|
while (i--) {
|
cb = cbs[i];
|
|
if (cb === fn || cb.fn === fn) {
|
cbs.splice(i, 1);
|
break;
|
}
|
}
|
|
return vm;
|
};
|
|
Vue.prototype.$emit = function (event) {
|
var vm = this;
|
|
if (true) {
|
var lowerCaseEvent = event.toLowerCase();
|
|
if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
|
tip("Event \"" + lowerCaseEvent + "\" is emitted in component " + formatComponentName(vm) + " but the handler is registered for \"" + event + "\". " + "Note that HTML attributes are case-insensitive and you cannot use " + "v-on to listen to camelCase events when using in-DOM templates. " + "You should probably use \"" + hyphenate(event) + "\" instead of \"" + event + "\".");
|
}
|
}
|
|
var cbs = vm._events[event];
|
|
if (cbs) {
|
cbs = cbs.length > 1 ? toArray(cbs) : cbs;
|
var args = toArray(arguments, 1);
|
var info = "event handler for \"" + event + "\"";
|
|
for (var i = 0, l = cbs.length; i < l; i++) {
|
invokeWithErrorHandling(cbs[i], vm, args, vm, info);
|
}
|
}
|
|
return vm;
|
};
|
}
|
/* */
|
|
|
var activeInstance = null;
|
var isUpdatingChildComponent = false;
|
|
function setActiveInstance(vm) {
|
var prevActiveInstance = activeInstance;
|
activeInstance = vm;
|
return function () {
|
activeInstance = prevActiveInstance;
|
};
|
}
|
|
function initLifecycle(vm) {
|
var options = vm.$options; // locate first non-abstract parent
|
|
var parent = options.parent;
|
|
if (parent && !options.abstract) {
|
while (parent.$options.abstract && parent.$parent) {
|
parent = parent.$parent;
|
}
|
|
parent.$children.push(vm);
|
}
|
|
vm.$parent = parent;
|
vm.$root = parent ? parent.$root : vm;
|
vm.$children = [];
|
vm.$refs = {};
|
vm._watcher = null;
|
vm._inactive = null;
|
vm._directInactive = false;
|
vm._isMounted = false;
|
vm._isDestroyed = false;
|
vm._isBeingDestroyed = false;
|
}
|
|
function lifecycleMixin(Vue) {
|
Vue.prototype._update = function (vnode, hydrating) {
|
var vm = this;
|
var prevEl = vm.$el;
|
var prevVnode = vm._vnode;
|
var restoreActiveInstance = setActiveInstance(vm);
|
vm._vnode = vnode; // Vue.prototype.__patch__ is injected in entry points
|
// based on the rendering backend used.
|
|
if (!prevVnode) {
|
// initial render
|
vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false
|
/* removeOnly */
|
);
|
} else {
|
// updates
|
vm.$el = vm.__patch__(prevVnode, vnode);
|
}
|
|
restoreActiveInstance(); // update __vue__ reference
|
|
if (prevEl) {
|
prevEl.__vue__ = null;
|
}
|
|
if (vm.$el) {
|
vm.$el.__vue__ = vm;
|
} // if parent is an HOC, update its $el as well
|
|
|
if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
|
vm.$parent.$el = vm.$el;
|
} // updated hook is called by the scheduler to ensure that children are
|
// updated in a parent's updated hook.
|
|
};
|
|
Vue.prototype.$forceUpdate = function () {
|
var vm = this;
|
|
if (vm._watcher) {
|
vm._watcher.update();
|
}
|
};
|
|
Vue.prototype.$destroy = function () {
|
var vm = this;
|
|
if (vm._isBeingDestroyed) {
|
return;
|
}
|
|
callHook(vm, 'beforeDestroy');
|
vm._isBeingDestroyed = true; // remove self from parent
|
|
var parent = vm.$parent;
|
|
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
|
remove(parent.$children, vm);
|
} // teardown watchers
|
|
|
if (vm._watcher) {
|
vm._watcher.teardown();
|
}
|
|
var i = vm._watchers.length;
|
|
while (i--) {
|
vm._watchers[i].teardown();
|
} // remove reference from data ob
|
// frozen object may not have observer.
|
|
|
if (vm._data.__ob__) {
|
vm._data.__ob__.vmCount--;
|
} // call the last hook...
|
|
|
vm._isDestroyed = true; // invoke destroy hooks on current rendered tree
|
|
vm.__patch__(vm._vnode, null); // fire destroyed hook
|
|
|
callHook(vm, 'destroyed'); // turn off all instance listeners.
|
|
vm.$off(); // remove __vue__ reference
|
|
if (vm.$el) {
|
vm.$el.__vue__ = null;
|
} // release circular reference (#6759)
|
|
|
if (vm.$vnode) {
|
vm.$vnode.parent = null;
|
}
|
};
|
}
|
|
function mountComponent(vm, el, hydrating) {
|
vm.$el = el;
|
|
if (!vm.$options.render) {
|
vm.$options.render = createEmptyVNode;
|
|
if (true) {
|
/* istanbul ignore if */
|
if (vm.$options.template && vm.$options.template.charAt(0) !== '#' || vm.$options.el || el) {
|
warn('You are using the runtime-only build of Vue where the template ' + 'compiler is not available. Either pre-compile the templates into ' + 'render functions, or use the compiler-included build.', vm);
|
} else {
|
warn('Failed to mount component: template or render function not defined.', vm);
|
}
|
}
|
}
|
|
callHook(vm, 'beforeMount');
|
var updateComponent;
|
/* istanbul ignore if */
|
|
if ( true && config.performance && mark) {
|
updateComponent = function updateComponent() {
|
var name = vm._name;
|
var id = vm._uid;
|
var startTag = "vue-perf-start:" + id;
|
var endTag = "vue-perf-end:" + id;
|
mark(startTag);
|
|
var vnode = vm._render();
|
|
mark(endTag);
|
measure("vue " + name + " render", startTag, endTag);
|
mark(startTag);
|
|
vm._update(vnode, hydrating);
|
|
mark(endTag);
|
measure("vue " + name + " patch", startTag, endTag);
|
};
|
} else {
|
updateComponent = function updateComponent() {
|
vm._update(vm._render(), hydrating);
|
};
|
} // we set this to vm._watcher inside the watcher's constructor
|
// since the watcher's initial patch may call $forceUpdate (e.g. inside child
|
// component's mounted hook), which relies on vm._watcher being already defined
|
|
|
new Watcher(vm, updateComponent, noop, {
|
before: function before() {
|
if (vm._isMounted && !vm._isDestroyed) {
|
callHook(vm, 'beforeUpdate');
|
}
|
}
|
}, true
|
/* isRenderWatcher */
|
);
|
hydrating = false; // manually mounted instance, call mounted on self
|
// mounted is called for render-created child components in its inserted hook
|
|
if (vm.$vnode == null) {
|
// fixed by xxxxxx
|
callHook(vm, 'onServiceCreated');
|
callHook(vm, 'onServiceAttached');
|
vm._isMounted = true;
|
callHook(vm, 'mounted');
|
}
|
|
return vm;
|
}
|
|
function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
|
if (true) {
|
isUpdatingChildComponent = true;
|
} // determine whether component has slot children
|
// we need to do this before overwriting $options._renderChildren.
|
// check if there are dynamic scopedSlots (hand-written or compiled but with
|
// dynamic slot names). Static scoped slots compiled from template has the
|
// "$stable" marker.
|
|
|
var newScopedSlots = parentVnode.data.scopedSlots;
|
var oldScopedSlots = vm.$scopedSlots;
|
var hasDynamicScopedSlot = !!(newScopedSlots && !newScopedSlots.$stable || oldScopedSlots !== emptyObject && !oldScopedSlots.$stable || newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key); // Any static slot children from the parent may have changed during parent's
|
// update. Dynamic scoped slots may also have changed. In such cases, a forced
|
// update is necessary to ensure correctness.
|
|
var needsForceUpdate = !!(renderChildren || // has new static slots
|
vm.$options._renderChildren || // has old static slots
|
hasDynamicScopedSlot);
|
vm.$options._parentVnode = parentVnode;
|
vm.$vnode = parentVnode; // update vm's placeholder node without re-render
|
|
if (vm._vnode) {
|
// update child tree's parent
|
vm._vnode.parent = parentVnode;
|
}
|
|
vm.$options._renderChildren = renderChildren; // update $attrs and $listeners hash
|
// these are also reactive so they may trigger child update if the child
|
// used them during render
|
|
vm.$attrs = parentVnode.data.attrs || emptyObject;
|
vm.$listeners = listeners || emptyObject; // update props
|
|
if (propsData && vm.$options.props) {
|
toggleObserving(false);
|
var props = vm._props;
|
var propKeys = vm.$options._propKeys || [];
|
|
for (var i = 0; i < propKeys.length; i++) {
|
var key = propKeys[i];
|
var propOptions = vm.$options.props; // wtf flow?
|
|
props[key] = validateProp(key, propOptions, propsData, vm);
|
}
|
|
toggleObserving(true); // keep a copy of raw propsData
|
|
vm.$options.propsData = propsData;
|
} // fixed by xxxxxx update properties(mp runtime)
|
|
|
vm._$updateProperties && vm._$updateProperties(vm); // update listeners
|
|
listeners = listeners || emptyObject;
|
var oldListeners = vm.$options._parentListeners;
|
vm.$options._parentListeners = listeners;
|
updateComponentListeners(vm, listeners, oldListeners); // resolve slots + force update if has children
|
|
if (needsForceUpdate) {
|
vm.$slots = resolveSlots(renderChildren, parentVnode.context);
|
vm.$forceUpdate();
|
}
|
|
if (true) {
|
isUpdatingChildComponent = false;
|
}
|
}
|
|
function isInInactiveTree(vm) {
|
while (vm && (vm = vm.$parent)) {
|
if (vm._inactive) {
|
return true;
|
}
|
}
|
|
return false;
|
}
|
|
function activateChildComponent(vm, direct) {
|
if (direct) {
|
vm._directInactive = false;
|
|
if (isInInactiveTree(vm)) {
|
return;
|
}
|
} else if (vm._directInactive) {
|
return;
|
}
|
|
if (vm._inactive || vm._inactive === null) {
|
vm._inactive = false;
|
|
for (var i = 0; i < vm.$children.length; i++) {
|
activateChildComponent(vm.$children[i]);
|
}
|
|
callHook(vm, 'activated');
|
}
|
}
|
|
function deactivateChildComponent(vm, direct) {
|
if (direct) {
|
vm._directInactive = true;
|
|
if (isInInactiveTree(vm)) {
|
return;
|
}
|
}
|
|
if (!vm._inactive) {
|
vm._inactive = true;
|
|
for (var i = 0; i < vm.$children.length; i++) {
|
deactivateChildComponent(vm.$children[i]);
|
}
|
|
callHook(vm, 'deactivated');
|
}
|
}
|
|
function callHook(vm, hook) {
|
// #7573 disable dep collection when invoking lifecycle hooks
|
pushTarget();
|
var handlers = vm.$options[hook];
|
var info = hook + " hook";
|
|
if (handlers) {
|
for (var i = 0, j = handlers.length; i < j; i++) {
|
invokeWithErrorHandling(handlers[i], vm, null, vm, info);
|
}
|
}
|
|
if (vm._hasHookEvent) {
|
vm.$emit('hook:' + hook);
|
}
|
|
popTarget();
|
}
|
/* */
|
|
|
var MAX_UPDATE_COUNT = 100;
|
var queue = [];
|
var activatedChildren = [];
|
var has = {};
|
var circular = {};
|
var waiting = false;
|
var flushing = false;
|
var index = 0;
|
/**
|
* Reset the scheduler's state.
|
*/
|
|
function resetSchedulerState() {
|
index = queue.length = activatedChildren.length = 0;
|
has = {};
|
|
if (true) {
|
circular = {};
|
}
|
|
waiting = flushing = false;
|
} // Async edge case #6566 requires saving the timestamp when event listeners are
|
// attached. However, calling performance.now() has a perf overhead especially
|
// if the page has thousands of event listeners. Instead, we take a timestamp
|
// every time the scheduler flushes and use that for all event listeners
|
// attached during that flush.
|
|
|
var currentFlushTimestamp = 0; // Async edge case fix requires storing an event listener's attach timestamp.
|
|
var getNow = Date.now; // Determine what event timestamp the browser is using. Annoyingly, the
|
// timestamp can either be hi-res (relative to page load) or low-res
|
// (relative to UNIX epoch), so in order to compare time we have to use the
|
// same timestamp type when saving the flush timestamp.
|
// All IE versions use low-res event timestamps, and have problematic clock
|
// implementations (#9632)
|
|
if (inBrowser && !isIE) {
|
var performance = window.performance;
|
|
if (performance && typeof performance.now === 'function' && getNow() > document.createEvent('Event').timeStamp) {
|
// if the event timestamp, although evaluated AFTER the Date.now(), is
|
// smaller than it, it means the event is using a hi-res timestamp,
|
// and we need to use the hi-res version for event listener timestamps as
|
// well.
|
getNow = function getNow() {
|
return performance.now();
|
};
|
}
|
}
|
/**
|
* Flush both queues and run the watchers.
|
*/
|
|
|
function flushSchedulerQueue() {
|
currentFlushTimestamp = getNow();
|
flushing = true;
|
var watcher, id; // Sort queue before flush.
|
// This ensures that:
|
// 1. Components are updated from parent to child. (because parent is always
|
// created before the child)
|
// 2. A component's user watchers are run before its render watcher (because
|
// user watchers are created before the render watcher)
|
// 3. If a component is destroyed during a parent component's watcher run,
|
// its watchers can be skipped.
|
|
queue.sort(function (a, b) {
|
return a.id - b.id;
|
}); // do not cache length because more watchers might be pushed
|
// as we run existing watchers
|
|
for (index = 0; index < queue.length; index++) {
|
watcher = queue[index];
|
|
if (watcher.before) {
|
watcher.before();
|
}
|
|
id = watcher.id;
|
has[id] = null;
|
watcher.run(); // in dev build, check and stop circular updates.
|
|
if ( true && has[id] != null) {
|
circular[id] = (circular[id] || 0) + 1;
|
|
if (circular[id] > MAX_UPDATE_COUNT) {
|
warn('You may have an infinite update loop ' + (watcher.user ? "in watcher with expression \"" + watcher.expression + "\"" : "in a component render function."), watcher.vm);
|
break;
|
}
|
}
|
} // keep copies of post queues before resetting state
|
|
|
var activatedQueue = activatedChildren.slice();
|
var updatedQueue = queue.slice();
|
resetSchedulerState(); // call component updated and activated hooks
|
|
callActivatedHooks(activatedQueue);
|
callUpdatedHooks(updatedQueue); // devtool hook
|
|
/* istanbul ignore if */
|
|
if (devtools && config.devtools) {
|
devtools.emit('flush');
|
}
|
}
|
|
function callUpdatedHooks(queue) {
|
var i = queue.length;
|
|
while (i--) {
|
var watcher = queue[i];
|
var vm = watcher.vm;
|
|
if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
|
callHook(vm, 'updated');
|
}
|
}
|
}
|
/**
|
* Queue a kept-alive component that was activated during patch.
|
* The queue will be processed after the entire tree has been patched.
|
*/
|
|
|
function queueActivatedComponent(vm) {
|
// setting _inactive to false here so that a render function can
|
// rely on checking whether it's in an inactive tree (e.g. router-view)
|
vm._inactive = false;
|
activatedChildren.push(vm);
|
}
|
|
function callActivatedHooks(queue) {
|
for (var i = 0; i < queue.length; i++) {
|
queue[i]._inactive = true;
|
activateChildComponent(queue[i], true
|
/* true */
|
);
|
}
|
}
|
/**
|
* Push a watcher into the watcher queue.
|
* Jobs with duplicate IDs will be skipped unless it's
|
* pushed when the queue is being flushed.
|
*/
|
|
|
function queueWatcher(watcher) {
|
var id = watcher.id;
|
|
if (has[id] == null) {
|
has[id] = true;
|
|
if (!flushing) {
|
queue.push(watcher);
|
} else {
|
// if already flushing, splice the watcher based on its id
|
// if already past its id, it will be run next immediately.
|
var i = queue.length - 1;
|
|
while (i > index && queue[i].id > watcher.id) {
|
i--;
|
}
|
|
queue.splice(i + 1, 0, watcher);
|
} // queue the flush
|
|
|
if (!waiting) {
|
waiting = true;
|
|
if ( true && !config.async) {
|
flushSchedulerQueue();
|
return;
|
}
|
|
nextTick(flushSchedulerQueue);
|
}
|
}
|
}
|
/* */
|
|
|
var uid$2 = 0;
|
/**
|
* A watcher parses an expression, collects dependencies,
|
* and fires callback when the expression value changes.
|
* This is used for both the $watch() api and directives.
|
*/
|
|
var Watcher = function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
|
this.vm = vm;
|
|
if (isRenderWatcher) {
|
vm._watcher = this;
|
}
|
|
vm._watchers.push(this); // options
|
|
|
if (options) {
|
this.deep = !!options.deep;
|
this.user = !!options.user;
|
this.lazy = !!options.lazy;
|
this.sync = !!options.sync;
|
this.before = options.before;
|
} else {
|
this.deep = this.user = this.lazy = this.sync = false;
|
}
|
|
this.cb = cb;
|
this.id = ++uid$2; // uid for batching
|
|
this.active = true;
|
this.dirty = this.lazy; // for lazy watchers
|
|
this.deps = [];
|
this.newDeps = [];
|
this.depIds = new _Set();
|
this.newDepIds = new _Set();
|
this.expression = true ? expOrFn.toString() : undefined; // parse expression for getter
|
|
if (typeof expOrFn === 'function') {
|
this.getter = expOrFn;
|
} else {
|
this.getter = parsePath(expOrFn);
|
|
if (!this.getter) {
|
this.getter = noop;
|
true && warn("Failed watching path: \"" + expOrFn + "\" " + 'Watcher only accepts simple dot-delimited paths. ' + 'For full control, use a function instead.', vm);
|
}
|
}
|
|
this.value = this.lazy ? undefined : this.get();
|
};
|
/**
|
* Evaluate the getter, and re-collect dependencies.
|
*/
|
|
|
Watcher.prototype.get = function get() {
|
pushTarget(this);
|
var value;
|
var vm = this.vm;
|
|
try {
|
value = this.getter.call(vm, vm);
|
} catch (e) {
|
if (this.user) {
|
handleError(e, vm, "getter for watcher \"" + this.expression + "\"");
|
} else {
|
throw e;
|
}
|
} finally {
|
// "touch" every property so they are all tracked as
|
// dependencies for deep watching
|
if (this.deep) {
|
traverse(value);
|
}
|
|
popTarget();
|
this.cleanupDeps();
|
}
|
|
return value;
|
};
|
/**
|
* Add a dependency to this directive.
|
*/
|
|
|
Watcher.prototype.addDep = function addDep(dep) {
|
var id = dep.id;
|
|
if (!this.newDepIds.has(id)) {
|
this.newDepIds.add(id);
|
this.newDeps.push(dep);
|
|
if (!this.depIds.has(id)) {
|
dep.addSub(this);
|
}
|
}
|
};
|
/**
|
* Clean up for dependency collection.
|
*/
|
|
|
Watcher.prototype.cleanupDeps = function cleanupDeps() {
|
var i = this.deps.length;
|
|
while (i--) {
|
var dep = this.deps[i];
|
|
if (!this.newDepIds.has(dep.id)) {
|
dep.removeSub(this);
|
}
|
}
|
|
var tmp = this.depIds;
|
this.depIds = this.newDepIds;
|
this.newDepIds = tmp;
|
this.newDepIds.clear();
|
tmp = this.deps;
|
this.deps = this.newDeps;
|
this.newDeps = tmp;
|
this.newDeps.length = 0;
|
};
|
/**
|
* Subscriber interface.
|
* Will be called when a dependency changes.
|
*/
|
|
|
Watcher.prototype.update = function update() {
|
/* istanbul ignore else */
|
if (this.lazy) {
|
this.dirty = true;
|
} else if (this.sync) {
|
this.run();
|
} else {
|
queueWatcher(this);
|
}
|
};
|
/**
|
* Scheduler job interface.
|
* Will be called by the scheduler.
|
*/
|
|
|
Watcher.prototype.run = function run() {
|
if (this.active) {
|
var value = this.get();
|
|
if (value !== this.value || // Deep watchers and watchers on Object/Arrays should fire even
|
// when the value is the same, because the value may
|
// have mutated.
|
isObject(value) || this.deep) {
|
// set new value
|
var oldValue = this.value;
|
this.value = value;
|
|
if (this.user) {
|
try {
|
this.cb.call(this.vm, value, oldValue);
|
} catch (e) {
|
handleError(e, this.vm, "callback for watcher \"" + this.expression + "\"");
|
}
|
} else {
|
this.cb.call(this.vm, value, oldValue);
|
}
|
}
|
}
|
};
|
/**
|
* Evaluate the value of the watcher.
|
* This only gets called for lazy watchers.
|
*/
|
|
|
Watcher.prototype.evaluate = function evaluate() {
|
this.value = this.get();
|
this.dirty = false;
|
};
|
/**
|
* Depend on all deps collected by this watcher.
|
*/
|
|
|
Watcher.prototype.depend = function depend() {
|
var i = this.deps.length;
|
|
while (i--) {
|
this.deps[i].depend();
|
}
|
};
|
/**
|
* Remove self from all dependencies' subscriber list.
|
*/
|
|
|
Watcher.prototype.teardown = function teardown() {
|
if (this.active) {
|
// remove self from vm's watcher list
|
// this is a somewhat expensive operation so we skip it
|
// if the vm is being destroyed.
|
if (!this.vm._isBeingDestroyed) {
|
remove(this.vm._watchers, this);
|
}
|
|
var i = this.deps.length;
|
|
while (i--) {
|
this.deps[i].removeSub(this);
|
}
|
|
this.active = false;
|
}
|
};
|
/* */
|
|
|
var sharedPropertyDefinition = {
|
enumerable: true,
|
configurable: true,
|
get: noop,
|
set: noop
|
};
|
|
function proxy(target, sourceKey, key) {
|
sharedPropertyDefinition.get = function proxyGetter() {
|
return this[sourceKey][key];
|
};
|
|
sharedPropertyDefinition.set = function proxySetter(val) {
|
this[sourceKey][key] = val;
|
};
|
|
Object.defineProperty(target, key, sharedPropertyDefinition);
|
}
|
|
function initState(vm) {
|
vm._watchers = [];
|
var opts = vm.$options;
|
|
if (opts.props) {
|
initProps(vm, opts.props);
|
}
|
|
if (opts.methods) {
|
initMethods(vm, opts.methods);
|
}
|
|
if (opts.data) {
|
initData(vm);
|
} else {
|
observe(vm._data = {}, true
|
/* asRootData */
|
);
|
}
|
|
if (opts.computed) {
|
initComputed(vm, opts.computed);
|
}
|
|
if (opts.watch && opts.watch !== nativeWatch) {
|
initWatch(vm, opts.watch);
|
}
|
}
|
|
function initProps(vm, propsOptions) {
|
var propsData = vm.$options.propsData || {};
|
var props = vm._props = {}; // cache prop keys so that future props updates can iterate using Array
|
// instead of dynamic object key enumeration.
|
|
var keys = vm.$options._propKeys = [];
|
var isRoot = !vm.$parent; // root instance props should be converted
|
|
if (!isRoot) {
|
toggleObserving(false);
|
}
|
|
var loop = function loop(key) {
|
keys.push(key);
|
var value = validateProp(key, propsOptions, propsData, vm);
|
/* istanbul ignore else */
|
|
if (true) {
|
var hyphenatedKey = hyphenate(key);
|
|
if (isReservedAttribute(hyphenatedKey) || config.isReservedAttr(hyphenatedKey)) {
|
warn("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop.", vm);
|
}
|
|
defineReactive$$1(props, key, value, function () {
|
if (!isRoot && !isUpdatingChildComponent) {
|
warn("Avoid mutating a prop directly since the value will be " + "overwritten whenever the parent component re-renders. " + "Instead, use a data or computed property based on the prop's " + "value. Prop being mutated: \"" + key + "\"", vm);
|
}
|
});
|
} else {} // static props are already proxied on the component's prototype
|
// during Vue.extend(). We only need to proxy props defined at
|
// instantiation here.
|
|
|
if (!(key in vm)) {
|
proxy(vm, "_props", key);
|
}
|
};
|
|
for (var key in propsOptions) {
|
loop(key);
|
}
|
|
toggleObserving(true);
|
}
|
|
function initData(vm) {
|
var data = vm.$options.data;
|
data = vm._data = typeof data === 'function' ? getData(data, vm) : data || {};
|
|
if (!isPlainObject(data)) {
|
data = {};
|
true && warn('data functions should return an object:\n' + 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
} // proxy data on instance
|
|
|
var keys = Object.keys(data);
|
var props = vm.$options.props;
|
var methods = vm.$options.methods;
|
var i = keys.length;
|
|
while (i--) {
|
var key = keys[i];
|
|
if (true) {
|
if (methods && hasOwn(methods, key)) {
|
warn("Method \"" + key + "\" has already been defined as a data property.", vm);
|
}
|
}
|
|
if (props && hasOwn(props, key)) {
|
true && warn("The data property \"" + key + "\" is already declared as a prop. " + "Use prop default value instead.", vm);
|
} else if (!isReserved(key)) {
|
proxy(vm, "_data", key);
|
}
|
} // observe data
|
|
|
observe(data, true
|
/* asRootData */
|
);
|
}
|
|
function getData(data, vm) {
|
// #7573 disable dep collection when invoking data getters
|
pushTarget();
|
|
try {
|
return data.call(vm, vm);
|
} catch (e) {
|
handleError(e, vm, "data()");
|
return {};
|
} finally {
|
popTarget();
|
}
|
}
|
|
var computedWatcherOptions = {
|
lazy: true
|
};
|
|
function initComputed(vm, computed) {
|
// $flow-disable-line
|
var watchers = vm._computedWatchers = Object.create(null); // computed properties are just getters during SSR
|
|
var isSSR = isServerRendering();
|
|
for (var key in computed) {
|
var userDef = computed[key];
|
var getter = typeof userDef === 'function' ? userDef : userDef.get;
|
|
if ( true && getter == null) {
|
warn("Getter is missing for computed property \"" + key + "\".", vm);
|
}
|
|
if (!isSSR) {
|
// create internal watcher for the computed property.
|
watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
|
} // component-defined computed properties are already defined on the
|
// component prototype. We only need to define computed properties defined
|
// at instantiation here.
|
|
|
if (!(key in vm)) {
|
defineComputed(vm, key, userDef);
|
} else if (true) {
|
if (key in vm.$data) {
|
warn("The computed property \"" + key + "\" is already defined in data.", vm);
|
} else if (vm.$options.props && key in vm.$options.props) {
|
warn("The computed property \"" + key + "\" is already defined as a prop.", vm);
|
}
|
}
|
}
|
}
|
|
function defineComputed(target, key, userDef) {
|
var shouldCache = !isServerRendering();
|
|
if (typeof userDef === 'function') {
|
sharedPropertyDefinition.get = shouldCache ? createComputedGetter(key) : createGetterInvoker(userDef);
|
sharedPropertyDefinition.set = noop;
|
} else {
|
sharedPropertyDefinition.get = userDef.get ? shouldCache && userDef.cache !== false ? createComputedGetter(key) : createGetterInvoker(userDef.get) : noop;
|
sharedPropertyDefinition.set = userDef.set || noop;
|
}
|
|
if ( true && sharedPropertyDefinition.set === noop) {
|
sharedPropertyDefinition.set = function () {
|
warn("Computed property \"" + key + "\" was assigned to but it has no setter.", this);
|
};
|
}
|
|
Object.defineProperty(target, key, sharedPropertyDefinition);
|
}
|
|
function createComputedGetter(key) {
|
return function computedGetter() {
|
var watcher = this._computedWatchers && this._computedWatchers[key];
|
|
if (watcher) {
|
if (watcher.dirty) {
|
watcher.evaluate();
|
}
|
|
if (Dep.SharedObject.target) {
|
// fixed by xxxxxx
|
watcher.depend();
|
}
|
|
return watcher.value;
|
}
|
};
|
}
|
|
function createGetterInvoker(fn) {
|
return function computedGetter() {
|
return fn.call(this, this);
|
};
|
}
|
|
function initMethods(vm, methods) {
|
var props = vm.$options.props;
|
|
for (var key in methods) {
|
if (true) {
|
if (typeof methods[key] !== 'function') {
|
warn("Method \"" + key + "\" has type \"" + _typeof(methods[key]) + "\" in the component definition. " + "Did you reference the function correctly?", vm);
|
}
|
|
if (props && hasOwn(props, key)) {
|
warn("Method \"" + key + "\" has already been defined as a prop.", vm);
|
}
|
|
if (key in vm && isReserved(key)) {
|
warn("Method \"" + key + "\" conflicts with an existing Vue instance method. " + "Avoid defining component methods that start with _ or $.");
|
}
|
}
|
|
vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
|
}
|
}
|
|
function initWatch(vm, watch) {
|
for (var key in watch) {
|
var handler = watch[key];
|
|
if (Array.isArray(handler)) {
|
for (var i = 0; i < handler.length; i++) {
|
createWatcher(vm, key, handler[i]);
|
}
|
} else {
|
createWatcher(vm, key, handler);
|
}
|
}
|
}
|
|
function createWatcher(vm, expOrFn, handler, options) {
|
if (isPlainObject(handler)) {
|
options = handler;
|
handler = handler.handler;
|
}
|
|
if (typeof handler === 'string') {
|
handler = vm[handler];
|
}
|
|
return vm.$watch(expOrFn, handler, options);
|
}
|
|
function stateMixin(Vue) {
|
// flow somehow has problems with directly declared definition object
|
// when using Object.defineProperty, so we have to procedurally build up
|
// the object here.
|
var dataDef = {};
|
|
dataDef.get = function () {
|
return this._data;
|
};
|
|
var propsDef = {};
|
|
propsDef.get = function () {
|
return this._props;
|
};
|
|
if (true) {
|
dataDef.set = function () {
|
warn('Avoid replacing instance root $data. ' + 'Use nested data properties instead.', this);
|
};
|
|
propsDef.set = function () {
|
warn("$props is readonly.", this);
|
};
|
}
|
|
Object.defineProperty(Vue.prototype, '$data', dataDef);
|
Object.defineProperty(Vue.prototype, '$props', propsDef);
|
Vue.prototype.$set = set;
|
Vue.prototype.$delete = del;
|
|
Vue.prototype.$watch = function (expOrFn, cb, options) {
|
var vm = this;
|
|
if (isPlainObject(cb)) {
|
return createWatcher(vm, expOrFn, cb, options);
|
}
|
|
options = options || {};
|
options.user = true;
|
var watcher = new Watcher(vm, expOrFn, cb, options);
|
|
if (options.immediate) {
|
try {
|
cb.call(vm, watcher.value);
|
} catch (error) {
|
handleError(error, vm, "callback for immediate watcher \"" + watcher.expression + "\"");
|
}
|
}
|
|
return function unwatchFn() {
|
watcher.teardown();
|
};
|
};
|
}
|
/* */
|
|
|
var uid$3 = 0;
|
|
function initMixin(Vue) {
|
Vue.prototype._init = function (options) {
|
var vm = this; // a uid
|
|
vm._uid = uid$3++;
|
var startTag, endTag;
|
/* istanbul ignore if */
|
|
if ( true && config.performance && mark) {
|
startTag = "vue-perf-start:" + vm._uid;
|
endTag = "vue-perf-end:" + vm._uid;
|
mark(startTag);
|
} // a flag to avoid this being observed
|
|
|
vm._isVue = true; // merge options
|
|
if (options && options._isComponent) {
|
// optimize internal component instantiation
|
// since dynamic options merging is pretty slow, and none of the
|
// internal component options needs special treatment.
|
initInternalComponent(vm, options);
|
} else {
|
vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
|
}
|
/* istanbul ignore else */
|
|
|
if (true) {
|
initProxy(vm);
|
} else {} // expose real self
|
|
|
vm._self = vm;
|
initLifecycle(vm);
|
initEvents(vm);
|
initRender(vm);
|
callHook(vm, 'beforeCreate');
|
!vm._$fallback && initInjections(vm); // resolve injections before data/props
|
|
initState(vm);
|
!vm._$fallback && initProvide(vm); // resolve provide after data/props
|
|
!vm._$fallback && callHook(vm, 'created');
|
/* istanbul ignore if */
|
|
if ( true && config.performance && mark) {
|
vm._name = formatComponentName(vm, false);
|
mark(endTag);
|
measure("vue " + vm._name + " init", startTag, endTag);
|
}
|
|
if (vm.$options.el) {
|
vm.$mount(vm.$options.el);
|
}
|
};
|
}
|
|
function initInternalComponent(vm, options) {
|
var opts = vm.$options = Object.create(vm.constructor.options); // doing this because it's faster than dynamic enumeration.
|
|
var parentVnode = options._parentVnode;
|
opts.parent = options.parent;
|
opts._parentVnode = parentVnode;
|
var vnodeComponentOptions = parentVnode.componentOptions;
|
opts.propsData = vnodeComponentOptions.propsData;
|
opts._parentListeners = vnodeComponentOptions.listeners;
|
opts._renderChildren = vnodeComponentOptions.children;
|
opts._componentTag = vnodeComponentOptions.tag;
|
|
if (options.render) {
|
opts.render = options.render;
|
opts.staticRenderFns = options.staticRenderFns;
|
}
|
}
|
|
function resolveConstructorOptions(Ctor) {
|
var options = Ctor.options;
|
|
if (Ctor.super) {
|
var superOptions = resolveConstructorOptions(Ctor.super);
|
var cachedSuperOptions = Ctor.superOptions;
|
|
if (superOptions !== cachedSuperOptions) {
|
// super option changed,
|
// need to resolve new options.
|
Ctor.superOptions = superOptions; // check if there are any late-modified/attached options (#4976)
|
|
var modifiedOptions = resolveModifiedOptions(Ctor); // update base extend options
|
|
if (modifiedOptions) {
|
extend(Ctor.extendOptions, modifiedOptions);
|
}
|
|
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
|
|
if (options.name) {
|
options.components[options.name] = Ctor;
|
}
|
}
|
}
|
|
return options;
|
}
|
|
function resolveModifiedOptions(Ctor) {
|
var modified;
|
var latest = Ctor.options;
|
var sealed = Ctor.sealedOptions;
|
|
for (var key in latest) {
|
if (latest[key] !== sealed[key]) {
|
if (!modified) {
|
modified = {};
|
}
|
|
modified[key] = latest[key];
|
}
|
}
|
|
return modified;
|
}
|
|
function Vue(options) {
|
if ( true && !(this instanceof Vue)) {
|
warn('Vue is a constructor and should be called with the `new` keyword');
|
}
|
|
this._init(options);
|
}
|
|
initMixin(Vue);
|
stateMixin(Vue);
|
eventsMixin(Vue);
|
lifecycleMixin(Vue);
|
renderMixin(Vue);
|
/* */
|
|
function initUse(Vue) {
|
Vue.use = function (plugin) {
|
var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
|
|
if (installedPlugins.indexOf(plugin) > -1) {
|
return this;
|
} // additional parameters
|
|
|
var args = toArray(arguments, 1);
|
args.unshift(this);
|
|
if (typeof plugin.install === 'function') {
|
plugin.install.apply(plugin, args);
|
} else if (typeof plugin === 'function') {
|
plugin.apply(null, args);
|
}
|
|
installedPlugins.push(plugin);
|
return this;
|
};
|
}
|
/* */
|
|
|
function initMixin$1(Vue) {
|
Vue.mixin = function (mixin) {
|
this.options = mergeOptions(this.options, mixin);
|
return this;
|
};
|
}
|
/* */
|
|
|
function initExtend(Vue) {
|
/**
|
* Each instance constructor, including Vue, has a unique
|
* cid. This enables us to create wrapped "child
|
* constructors" for prototypal inheritance and cache them.
|
*/
|
Vue.cid = 0;
|
var cid = 1;
|
/**
|
* Class inheritance
|
*/
|
|
Vue.extend = function (extendOptions) {
|
extendOptions = extendOptions || {};
|
var Super = this;
|
var SuperId = Super.cid;
|
var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
|
|
if (cachedCtors[SuperId]) {
|
return cachedCtors[SuperId];
|
}
|
|
var name = extendOptions.name || Super.options.name;
|
|
if ( true && name) {
|
validateComponentName(name);
|
}
|
|
var Sub = function VueComponent(options) {
|
this._init(options);
|
};
|
|
Sub.prototype = Object.create(Super.prototype);
|
Sub.prototype.constructor = Sub;
|
Sub.cid = cid++;
|
Sub.options = mergeOptions(Super.options, extendOptions);
|
Sub['super'] = Super; // For props and computed properties, we define the proxy getters on
|
// the Vue instances at extension time, on the extended prototype. This
|
// avoids Object.defineProperty calls for each instance created.
|
|
if (Sub.options.props) {
|
initProps$1(Sub);
|
}
|
|
if (Sub.options.computed) {
|
initComputed$1(Sub);
|
} // allow further extension/mixin/plugin usage
|
|
|
Sub.extend = Super.extend;
|
Sub.mixin = Super.mixin;
|
Sub.use = Super.use; // create asset registers, so extended classes
|
// can have their private assets too.
|
|
ASSET_TYPES.forEach(function (type) {
|
Sub[type] = Super[type];
|
}); // enable recursive self-lookup
|
|
if (name) {
|
Sub.options.components[name] = Sub;
|
} // keep a reference to the super options at extension time.
|
// later at instantiation we can check if Super's options have
|
// been updated.
|
|
|
Sub.superOptions = Super.options;
|
Sub.extendOptions = extendOptions;
|
Sub.sealedOptions = extend({}, Sub.options); // cache constructor
|
|
cachedCtors[SuperId] = Sub;
|
return Sub;
|
};
|
}
|
|
function initProps$1(Comp) {
|
var props = Comp.options.props;
|
|
for (var key in props) {
|
proxy(Comp.prototype, "_props", key);
|
}
|
}
|
|
function initComputed$1(Comp) {
|
var computed = Comp.options.computed;
|
|
for (var key in computed) {
|
defineComputed(Comp.prototype, key, computed[key]);
|
}
|
}
|
/* */
|
|
|
function initAssetRegisters(Vue) {
|
/**
|
* Create asset registration methods.
|
*/
|
ASSET_TYPES.forEach(function (type) {
|
Vue[type] = function (id, definition) {
|
if (!definition) {
|
return this.options[type + 's'][id];
|
} else {
|
/* istanbul ignore if */
|
if ( true && type === 'component') {
|
validateComponentName(id);
|
}
|
|
if (type === 'component' && isPlainObject(definition)) {
|
definition.name = definition.name || id;
|
definition = this.options._base.extend(definition);
|
}
|
|
if (type === 'directive' && typeof definition === 'function') {
|
definition = {
|
bind: definition,
|
update: definition
|
};
|
}
|
|
this.options[type + 's'][id] = definition;
|
return definition;
|
}
|
};
|
});
|
}
|
/* */
|
|
|
function getComponentName(opts) {
|
return opts && (opts.Ctor.options.name || opts.tag);
|
}
|
|
function matches(pattern, name) {
|
if (Array.isArray(pattern)) {
|
return pattern.indexOf(name) > -1;
|
} else if (typeof pattern === 'string') {
|
return pattern.split(',').indexOf(name) > -1;
|
} else if (isRegExp(pattern)) {
|
return pattern.test(name);
|
}
|
/* istanbul ignore next */
|
|
|
return false;
|
}
|
|
function pruneCache(keepAliveInstance, filter) {
|
var cache = keepAliveInstance.cache;
|
var keys = keepAliveInstance.keys;
|
var _vnode = keepAliveInstance._vnode;
|
|
for (var key in cache) {
|
var cachedNode = cache[key];
|
|
if (cachedNode) {
|
var name = getComponentName(cachedNode.componentOptions);
|
|
if (name && !filter(name)) {
|
pruneCacheEntry(cache, key, keys, _vnode);
|
}
|
}
|
}
|
}
|
|
function pruneCacheEntry(cache, key, keys, current) {
|
var cached$$1 = cache[key];
|
|
if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
|
cached$$1.componentInstance.$destroy();
|
}
|
|
cache[key] = null;
|
remove(keys, key);
|
}
|
|
var patternTypes = [String, RegExp, Array];
|
var KeepAlive = {
|
name: 'keep-alive',
|
abstract: true,
|
props: {
|
include: patternTypes,
|
exclude: patternTypes,
|
max: [String, Number]
|
},
|
created: function created() {
|
this.cache = Object.create(null);
|
this.keys = [];
|
},
|
destroyed: function destroyed() {
|
for (var key in this.cache) {
|
pruneCacheEntry(this.cache, key, this.keys);
|
}
|
},
|
mounted: function mounted() {
|
var this$1 = this;
|
this.$watch('include', function (val) {
|
pruneCache(this$1, function (name) {
|
return matches(val, name);
|
});
|
});
|
this.$watch('exclude', function (val) {
|
pruneCache(this$1, function (name) {
|
return !matches(val, name);
|
});
|
});
|
},
|
render: function render() {
|
var slot = this.$slots.default;
|
var vnode = getFirstComponentChild(slot);
|
var componentOptions = vnode && vnode.componentOptions;
|
|
if (componentOptions) {
|
// check pattern
|
var name = getComponentName(componentOptions);
|
var ref = this;
|
var include = ref.include;
|
var exclude = ref.exclude;
|
|
if ( // not included
|
include && (!name || !matches(include, name)) || // excluded
|
exclude && name && matches(exclude, name)) {
|
return vnode;
|
}
|
|
var ref$1 = this;
|
var cache = ref$1.cache;
|
var keys = ref$1.keys;
|
var key = vnode.key == null // same constructor may get registered as different local components
|
// so cid alone is not enough (#3269)
|
? componentOptions.Ctor.cid + (componentOptions.tag ? "::" + componentOptions.tag : '') : vnode.key;
|
|
if (cache[key]) {
|
vnode.componentInstance = cache[key].componentInstance; // make current key freshest
|
|
remove(keys, key);
|
keys.push(key);
|
} else {
|
cache[key] = vnode;
|
keys.push(key); // prune oldest entry
|
|
if (this.max && keys.length > parseInt(this.max)) {
|
pruneCacheEntry(cache, keys[0], keys, this._vnode);
|
}
|
}
|
|
vnode.data.keepAlive = true;
|
}
|
|
return vnode || slot && slot[0];
|
}
|
};
|
var builtInComponents = {
|
KeepAlive: KeepAlive
|
};
|
/* */
|
|
function initGlobalAPI(Vue) {
|
// config
|
var configDef = {};
|
|
configDef.get = function () {
|
return config;
|
};
|
|
if (true) {
|
configDef.set = function () {
|
warn('Do not replace the Vue.config object, set individual fields instead.');
|
};
|
}
|
|
Object.defineProperty(Vue, 'config', configDef); // exposed util methods.
|
// NOTE: these are not considered part of the public API - avoid relying on
|
// them unless you are aware of the risk.
|
|
Vue.util = {
|
warn: warn,
|
extend: extend,
|
mergeOptions: mergeOptions,
|
defineReactive: defineReactive$$1
|
};
|
Vue.set = set;
|
Vue.delete = del;
|
Vue.nextTick = nextTick; // 2.6 explicit observable API
|
|
Vue.observable = function (obj) {
|
observe(obj);
|
return obj;
|
};
|
|
Vue.options = Object.create(null);
|
ASSET_TYPES.forEach(function (type) {
|
Vue.options[type + 's'] = Object.create(null);
|
}); // this is used to identify the "base" constructor to extend all plain-object
|
// components with in Weex's multi-instance scenarios.
|
|
Vue.options._base = Vue;
|
extend(Vue.options.components, builtInComponents);
|
initUse(Vue);
|
initMixin$1(Vue);
|
initExtend(Vue);
|
initAssetRegisters(Vue);
|
}
|
|
initGlobalAPI(Vue);
|
Object.defineProperty(Vue.prototype, '$isServer', {
|
get: isServerRendering
|
});
|
Object.defineProperty(Vue.prototype, '$ssrContext', {
|
get: function get() {
|
/* istanbul ignore next */
|
return this.$vnode && this.$vnode.ssrContext;
|
}
|
}); // expose FunctionalRenderContext for ssr runtime helper installation
|
|
Object.defineProperty(Vue, 'FunctionalRenderContext', {
|
value: FunctionalRenderContext
|
});
|
Vue.version = '2.6.11';
|
/* */
|
// these are reserved for web because they are directly compiled away
|
// during template compilation
|
|
var isReservedAttr = makeMap('style,class'); // attributes that should be using props for binding
|
|
var acceptValue = makeMap('input,textarea,option,select,progress');
|
|
var mustUseProp = function mustUseProp(tag, type, attr) {
|
return attr === 'value' && acceptValue(tag) && type !== 'button' || attr === 'selected' && tag === 'option' || attr === 'checked' && tag === 'input' || attr === 'muted' && tag === 'video';
|
};
|
|
var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
|
var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
|
|
var convertEnumeratedValue = function convertEnumeratedValue(key, value) {
|
return isFalsyAttrValue(value) || value === 'false' ? 'false' // allow arbitrary string value for contenteditable
|
: key === 'contenteditable' && isValidContentEditableValue(value) ? value : 'true';
|
};
|
|
var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + 'required,reversed,scoped,seamless,selected,sortable,translate,' + 'truespeed,typemustmatch,visible');
|
var xlinkNS = 'http://www.w3.org/1999/xlink';
|
|
var isXlink = function isXlink(name) {
|
return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
|
};
|
|
var getXlinkProp = function getXlinkProp(name) {
|
return isXlink(name) ? name.slice(6, name.length) : '';
|
};
|
|
var isFalsyAttrValue = function isFalsyAttrValue(val) {
|
return val == null || val === false;
|
};
|
/* */
|
|
|
function genClassForVnode(vnode) {
|
var data = vnode.data;
|
var parentNode = vnode;
|
var childNode = vnode;
|
|
while (isDef(childNode.componentInstance)) {
|
childNode = childNode.componentInstance._vnode;
|
|
if (childNode && childNode.data) {
|
data = mergeClassData(childNode.data, data);
|
}
|
}
|
|
while (isDef(parentNode = parentNode.parent)) {
|
if (parentNode && parentNode.data) {
|
data = mergeClassData(data, parentNode.data);
|
}
|
}
|
|
return renderClass(data.staticClass, data.class);
|
}
|
|
function mergeClassData(child, parent) {
|
return {
|
staticClass: concat(child.staticClass, parent.staticClass),
|
class: isDef(child.class) ? [child.class, parent.class] : parent.class
|
};
|
}
|
|
function renderClass(staticClass, dynamicClass) {
|
if (isDef(staticClass) || isDef(dynamicClass)) {
|
return concat(staticClass, stringifyClass(dynamicClass));
|
}
|
/* istanbul ignore next */
|
|
|
return '';
|
}
|
|
function concat(a, b) {
|
return a ? b ? a + ' ' + b : a : b || '';
|
}
|
|
function stringifyClass(value) {
|
if (Array.isArray(value)) {
|
return stringifyArray(value);
|
}
|
|
if (isObject(value)) {
|
return stringifyObject(value);
|
}
|
|
if (typeof value === 'string') {
|
return value;
|
}
|
/* istanbul ignore next */
|
|
|
return '';
|
}
|
|
function stringifyArray(value) {
|
var res = '';
|
var stringified;
|
|
for (var i = 0, l = value.length; i < l; i++) {
|
if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
|
if (res) {
|
res += ' ';
|
}
|
|
res += stringified;
|
}
|
}
|
|
return res;
|
}
|
|
function stringifyObject(value) {
|
var res = '';
|
|
for (var key in value) {
|
if (value[key]) {
|
if (res) {
|
res += ' ';
|
}
|
|
res += key;
|
}
|
}
|
|
return res;
|
}
|
/* */
|
|
|
var namespaceMap = {
|
svg: 'http://www.w3.org/2000/svg',
|
math: 'http://www.w3.org/1998/Math/MathML'
|
};
|
var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' + 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + 'embed,object,param,source,canvas,script,noscript,del,ins,' + 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + 'output,progress,select,textarea,' + 'details,dialog,menu,menuitem,summary,' + 'content,element,shadow,template,blockquote,iframe,tfoot'); // this map is intentionally selective, only covering SVG elements that may
|
// contain child elements.
|
|
var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
|
|
var isReservedTag = function isReservedTag(tag) {
|
return isHTMLTag(tag) || isSVG(tag);
|
};
|
|
function getTagNamespace(tag) {
|
if (isSVG(tag)) {
|
return 'svg';
|
} // basic support for MathML
|
// note it doesn't support other MathML elements being component roots
|
|
|
if (tag === 'math') {
|
return 'math';
|
}
|
}
|
|
var unknownElementCache = Object.create(null);
|
|
function isUnknownElement(tag) {
|
/* istanbul ignore if */
|
if (!inBrowser) {
|
return true;
|
}
|
|
if (isReservedTag(tag)) {
|
return false;
|
}
|
|
tag = tag.toLowerCase();
|
/* istanbul ignore if */
|
|
if (unknownElementCache[tag] != null) {
|
return unknownElementCache[tag];
|
}
|
|
var el = document.createElement(tag);
|
|
if (tag.indexOf('-') > -1) {
|
// http://stackoverflow.com/a/28210364/1070244
|
return unknownElementCache[tag] = el.constructor === window.HTMLUnknownElement || el.constructor === window.HTMLElement;
|
} else {
|
return unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString());
|
}
|
}
|
|
var isTextInputType = makeMap('text,number,password,search,email,tel,url');
|
/* */
|
|
/**
|
* Query an element selector if it's not an element already.
|
*/
|
|
function query(el) {
|
if (typeof el === 'string') {
|
var selected = document.querySelector(el);
|
|
if (!selected) {
|
true && warn('Cannot find element: ' + el);
|
return document.createElement('div');
|
}
|
|
return selected;
|
} else {
|
return el;
|
}
|
}
|
/* */
|
|
|
function createElement$1(tagName, vnode) {
|
var elm = document.createElement(tagName);
|
|
if (tagName !== 'select') {
|
return elm;
|
} // false or null will remove the attribute but undefined will not
|
|
|
if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
|
elm.setAttribute('multiple', 'multiple');
|
}
|
|
return elm;
|
}
|
|
function createElementNS(namespace, tagName) {
|
return document.createElementNS(namespaceMap[namespace], tagName);
|
}
|
|
function createTextNode(text) {
|
return document.createTextNode(text);
|
}
|
|
function createComment(text) {
|
return document.createComment(text);
|
}
|
|
function insertBefore(parentNode, newNode, referenceNode) {
|
parentNode.insertBefore(newNode, referenceNode);
|
}
|
|
function removeChild(node, child) {
|
node.removeChild(child);
|
}
|
|
function appendChild(node, child) {
|
node.appendChild(child);
|
}
|
|
function parentNode(node) {
|
return node.parentNode;
|
}
|
|
function nextSibling(node) {
|
return node.nextSibling;
|
}
|
|
function tagName(node) {
|
return node.tagName;
|
}
|
|
function setTextContent(node, text) {
|
node.textContent = text;
|
}
|
|
function setStyleScope(node, scopeId) {
|
node.setAttribute(scopeId, '');
|
}
|
|
var nodeOps = /*#__PURE__*/Object.freeze({
|
createElement: createElement$1,
|
createElementNS: createElementNS,
|
createTextNode: createTextNode,
|
createComment: createComment,
|
insertBefore: insertBefore,
|
removeChild: removeChild,
|
appendChild: appendChild,
|
parentNode: parentNode,
|
nextSibling: nextSibling,
|
tagName: tagName,
|
setTextContent: setTextContent,
|
setStyleScope: setStyleScope
|
});
|
/* */
|
|
var ref = {
|
create: function create(_, vnode) {
|
registerRef(vnode);
|
},
|
update: function update(oldVnode, vnode) {
|
if (oldVnode.data.ref !== vnode.data.ref) {
|
registerRef(oldVnode, true);
|
registerRef(vnode);
|
}
|
},
|
destroy: function destroy(vnode) {
|
registerRef(vnode, true);
|
}
|
};
|
|
function registerRef(vnode, isRemoval) {
|
var key = vnode.data.ref;
|
|
if (!isDef(key)) {
|
return;
|
}
|
|
var vm = vnode.context;
|
var ref = vnode.componentInstance || vnode.elm;
|
var refs = vm.$refs;
|
|
if (isRemoval) {
|
if (Array.isArray(refs[key])) {
|
remove(refs[key], ref);
|
} else if (refs[key] === ref) {
|
refs[key] = undefined;
|
}
|
} else {
|
if (vnode.data.refInFor) {
|
if (!Array.isArray(refs[key])) {
|
refs[key] = [ref];
|
} else if (refs[key].indexOf(ref) < 0) {
|
// $flow-disable-line
|
refs[key].push(ref);
|
}
|
} else {
|
refs[key] = ref;
|
}
|
}
|
}
|
/**
|
* Virtual DOM patching algorithm based on Snabbdom by
|
* Simon Friis Vindum (@paldepind)
|
* Licensed under the MIT License
|
* https://github.com/paldepind/snabbdom/blob/master/LICENSE
|
*
|
* modified by Evan You (@yyx990803)
|
*
|
* Not type-checking this because this file is perf-critical and the cost
|
* of making flow understand it is not worth it.
|
*/
|
|
|
var emptyNode = new VNode('', {}, []);
|
var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
|
|
function sameVnode(a, b) {
|
return a.key === b.key && (a.tag === b.tag && a.isComment === b.isComment && isDef(a.data) === isDef(b.data) && sameInputType(a, b) || isTrue(a.isAsyncPlaceholder) && a.asyncFactory === b.asyncFactory && isUndef(b.asyncFactory.error));
|
}
|
|
function sameInputType(a, b) {
|
if (a.tag !== 'input') {
|
return true;
|
}
|
|
var i;
|
var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
|
var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
|
return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB);
|
}
|
|
function createKeyToOldIdx(children, beginIdx, endIdx) {
|
var i, key;
|
var map = {};
|
|
for (i = beginIdx; i <= endIdx; ++i) {
|
key = children[i].key;
|
|
if (isDef(key)) {
|
map[key] = i;
|
}
|
}
|
|
return map;
|
}
|
|
function createPatchFunction(backend) {
|
var i, j;
|
var cbs = {};
|
var modules = backend.modules;
|
var nodeOps = backend.nodeOps;
|
|
for (i = 0; i < hooks.length; ++i) {
|
cbs[hooks[i]] = [];
|
|
for (j = 0; j < modules.length; ++j) {
|
if (isDef(modules[j][hooks[i]])) {
|
cbs[hooks[i]].push(modules[j][hooks[i]]);
|
}
|
}
|
}
|
|
function emptyNodeAt(elm) {
|
return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
|
}
|
|
function createRmCb(childElm, listeners) {
|
function remove$$1() {
|
if (--remove$$1.listeners === 0) {
|
removeNode(childElm);
|
}
|
}
|
|
remove$$1.listeners = listeners;
|
return remove$$1;
|
}
|
|
function removeNode(el) {
|
var parent = nodeOps.parentNode(el); // element may have already been removed due to v-html / v-text
|
|
if (isDef(parent)) {
|
nodeOps.removeChild(parent, el);
|
}
|
}
|
|
function isUnknownElement$$1(vnode, inVPre) {
|
return !inVPre && !vnode.ns && !(config.ignoredElements.length && config.ignoredElements.some(function (ignore) {
|
return isRegExp(ignore) ? ignore.test(vnode.tag) : ignore === vnode.tag;
|
})) && config.isUnknownElement(vnode.tag);
|
}
|
|
var creatingElmInVPre = 0;
|
|
function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
|
if (isDef(vnode.elm) && isDef(ownerArray)) {
|
// This vnode was used in a previous render!
|
// now it's used as a new node, overwriting its elm would cause
|
// potential patch errors down the road when it's used as an insertion
|
// reference node. Instead, we clone the node on-demand before creating
|
// associated DOM element for it.
|
vnode = ownerArray[index] = cloneVNode(vnode);
|
}
|
|
vnode.isRootInsert = !nested; // for transition enter check
|
|
if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
|
return;
|
}
|
|
var data = vnode.data;
|
var children = vnode.children;
|
var tag = vnode.tag;
|
|
if (isDef(tag)) {
|
if (true) {
|
if (data && data.pre) {
|
creatingElmInVPre++;
|
}
|
|
if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
|
warn('Unknown custom element: <' + tag + '> - did you ' + 'register the component correctly? For recursive components, ' + 'make sure to provide the "name" option.', vnode.context);
|
}
|
}
|
|
vnode.elm = vnode.ns ? nodeOps.createElementNS(vnode.ns, tag) : nodeOps.createElement(tag, vnode);
|
setScope(vnode);
|
/* istanbul ignore if */
|
|
{
|
createChildren(vnode, children, insertedVnodeQueue);
|
|
if (isDef(data)) {
|
invokeCreateHooks(vnode, insertedVnodeQueue);
|
}
|
|
insert(parentElm, vnode.elm, refElm);
|
}
|
|
if ( true && data && data.pre) {
|
creatingElmInVPre--;
|
}
|
} else if (isTrue(vnode.isComment)) {
|
vnode.elm = nodeOps.createComment(vnode.text);
|
insert(parentElm, vnode.elm, refElm);
|
} else {
|
vnode.elm = nodeOps.createTextNode(vnode.text);
|
insert(parentElm, vnode.elm, refElm);
|
}
|
}
|
|
function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
|
var i = vnode.data;
|
|
if (isDef(i)) {
|
var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
|
|
if (isDef(i = i.hook) && isDef(i = i.init)) {
|
i(vnode, false
|
/* hydrating */
|
);
|
} // after calling the init hook, if the vnode is a child component
|
// it should've created a child instance and mounted it. the child
|
// component also has set the placeholder vnode's elm.
|
// in that case we can just return the element and be done.
|
|
|
if (isDef(vnode.componentInstance)) {
|
initComponent(vnode, insertedVnodeQueue);
|
insert(parentElm, vnode.elm, refElm);
|
|
if (isTrue(isReactivated)) {
|
reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
|
}
|
|
return true;
|
}
|
}
|
}
|
|
function initComponent(vnode, insertedVnodeQueue) {
|
if (isDef(vnode.data.pendingInsert)) {
|
insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
|
vnode.data.pendingInsert = null;
|
}
|
|
vnode.elm = vnode.componentInstance.$el;
|
|
if (isPatchable(vnode)) {
|
invokeCreateHooks(vnode, insertedVnodeQueue);
|
setScope(vnode);
|
} else {
|
// empty component root.
|
// skip all element-related modules except for ref (#3455)
|
registerRef(vnode); // make sure to invoke the insert hook
|
|
insertedVnodeQueue.push(vnode);
|
}
|
}
|
|
function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
|
var i; // hack for #4339: a reactivated component with inner transition
|
// does not trigger because the inner node's created hooks are not called
|
// again. It's not ideal to involve module-specific logic in here but
|
// there doesn't seem to be a better way to do it.
|
|
var innerNode = vnode;
|
|
while (innerNode.componentInstance) {
|
innerNode = innerNode.componentInstance._vnode;
|
|
if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
|
for (i = 0; i < cbs.activate.length; ++i) {
|
cbs.activate[i](emptyNode, innerNode);
|
}
|
|
insertedVnodeQueue.push(innerNode);
|
break;
|
}
|
} // unlike a newly created component,
|
// a reactivated keep-alive component doesn't insert itself
|
|
|
insert(parentElm, vnode.elm, refElm);
|
}
|
|
function insert(parent, elm, ref$$1) {
|
if (isDef(parent)) {
|
if (isDef(ref$$1)) {
|
if (nodeOps.parentNode(ref$$1) === parent) {
|
nodeOps.insertBefore(parent, elm, ref$$1);
|
}
|
} else {
|
nodeOps.appendChild(parent, elm);
|
}
|
}
|
}
|
|
function createChildren(vnode, children, insertedVnodeQueue) {
|
if (Array.isArray(children)) {
|
if (true) {
|
checkDuplicateKeys(children);
|
}
|
|
for (var i = 0; i < children.length; ++i) {
|
createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
|
}
|
} else if (isPrimitive(vnode.text)) {
|
nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
|
}
|
}
|
|
function isPatchable(vnode) {
|
while (vnode.componentInstance) {
|
vnode = vnode.componentInstance._vnode;
|
}
|
|
return isDef(vnode.tag);
|
}
|
|
function invokeCreateHooks(vnode, insertedVnodeQueue) {
|
for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
|
cbs.create[i$1](emptyNode, vnode);
|
}
|
|
i = vnode.data.hook; // Reuse variable
|
|
if (isDef(i)) {
|
if (isDef(i.create)) {
|
i.create(emptyNode, vnode);
|
}
|
|
if (isDef(i.insert)) {
|
insertedVnodeQueue.push(vnode);
|
}
|
}
|
} // set scope id attribute for scoped CSS.
|
// this is implemented as a special case to avoid the overhead
|
// of going through the normal attribute patching process.
|
|
|
function setScope(vnode) {
|
var i;
|
|
if (isDef(i = vnode.fnScopeId)) {
|
nodeOps.setStyleScope(vnode.elm, i);
|
} else {
|
var ancestor = vnode;
|
|
while (ancestor) {
|
if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
|
nodeOps.setStyleScope(vnode.elm, i);
|
}
|
|
ancestor = ancestor.parent;
|
}
|
} // for slot content they should also get the scopeId from the host instance.
|
|
|
if (isDef(i = activeInstance) && i !== vnode.context && i !== vnode.fnContext && isDef(i = i.$options._scopeId)) {
|
nodeOps.setStyleScope(vnode.elm, i);
|
}
|
}
|
|
function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
|
for (; startIdx <= endIdx; ++startIdx) {
|
createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
|
}
|
}
|
|
function invokeDestroyHook(vnode) {
|
var i, j;
|
var data = vnode.data;
|
|
if (isDef(data)) {
|
if (isDef(i = data.hook) && isDef(i = i.destroy)) {
|
i(vnode);
|
}
|
|
for (i = 0; i < cbs.destroy.length; ++i) {
|
cbs.destroy[i](vnode);
|
}
|
}
|
|
if (isDef(i = vnode.children)) {
|
for (j = 0; j < vnode.children.length; ++j) {
|
invokeDestroyHook(vnode.children[j]);
|
}
|
}
|
}
|
|
function removeVnodes(vnodes, startIdx, endIdx) {
|
for (; startIdx <= endIdx; ++startIdx) {
|
var ch = vnodes[startIdx];
|
|
if (isDef(ch)) {
|
if (isDef(ch.tag)) {
|
removeAndInvokeRemoveHook(ch);
|
invokeDestroyHook(ch);
|
} else {
|
// Text node
|
removeNode(ch.elm);
|
}
|
}
|
}
|
}
|
|
function removeAndInvokeRemoveHook(vnode, rm) {
|
if (isDef(rm) || isDef(vnode.data)) {
|
var i;
|
var listeners = cbs.remove.length + 1;
|
|
if (isDef(rm)) {
|
// we have a recursively passed down rm callback
|
// increase the listeners count
|
rm.listeners += listeners;
|
} else {
|
// directly removing
|
rm = createRmCb(vnode.elm, listeners);
|
} // recursively invoke hooks on child component root node
|
|
|
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
|
removeAndInvokeRemoveHook(i, rm);
|
}
|
|
for (i = 0; i < cbs.remove.length; ++i) {
|
cbs.remove[i](vnode, rm);
|
}
|
|
if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
|
i(vnode, rm);
|
} else {
|
rm();
|
}
|
} else {
|
removeNode(vnode.elm);
|
}
|
}
|
|
function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
|
var oldStartIdx = 0;
|
var newStartIdx = 0;
|
var oldEndIdx = oldCh.length - 1;
|
var oldStartVnode = oldCh[0];
|
var oldEndVnode = oldCh[oldEndIdx];
|
var newEndIdx = newCh.length - 1;
|
var newStartVnode = newCh[0];
|
var newEndVnode = newCh[newEndIdx];
|
var oldKeyToIdx, idxInOld, vnodeToMove, refElm; // removeOnly is a special flag used only by <transition-group>
|
// to ensure removed elements stay in correct relative positions
|
// during leaving transitions
|
|
var canMove = !removeOnly;
|
|
if (true) {
|
checkDuplicateKeys(newCh);
|
}
|
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
if (isUndef(oldStartVnode)) {
|
oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
|
} else if (isUndef(oldEndVnode)) {
|
oldEndVnode = oldCh[--oldEndIdx];
|
} else if (sameVnode(oldStartVnode, newStartVnode)) {
|
patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
oldStartVnode = oldCh[++oldStartIdx];
|
newStartVnode = newCh[++newStartIdx];
|
} else if (sameVnode(oldEndVnode, newEndVnode)) {
|
patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
|
oldEndVnode = oldCh[--oldEndIdx];
|
newEndVnode = newCh[--newEndIdx];
|
} else if (sameVnode(oldStartVnode, newEndVnode)) {
|
// Vnode moved right
|
patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
|
canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
|
oldStartVnode = oldCh[++oldStartIdx];
|
newEndVnode = newCh[--newEndIdx];
|
} else if (sameVnode(oldEndVnode, newStartVnode)) {
|
// Vnode moved left
|
patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
|
oldEndVnode = oldCh[--oldEndIdx];
|
newStartVnode = newCh[++newStartIdx];
|
} else {
|
if (isUndef(oldKeyToIdx)) {
|
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
|
}
|
|
idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
|
|
if (isUndef(idxInOld)) {
|
// New element
|
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
|
} else {
|
vnodeToMove = oldCh[idxInOld];
|
|
if (sameVnode(vnodeToMove, newStartVnode)) {
|
patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
oldCh[idxInOld] = undefined;
|
canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
|
} else {
|
// same key but different element. treat as new element
|
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
|
}
|
}
|
|
newStartVnode = newCh[++newStartIdx];
|
}
|
}
|
|
if (oldStartIdx > oldEndIdx) {
|
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
|
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
|
} else if (newStartIdx > newEndIdx) {
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
}
|
}
|
|
function checkDuplicateKeys(children) {
|
var seenKeys = {};
|
|
for (var i = 0; i < children.length; i++) {
|
var vnode = children[i];
|
var key = vnode.key;
|
|
if (isDef(key)) {
|
if (seenKeys[key]) {
|
warn("Duplicate keys detected: '" + key + "'. This may cause an update error.", vnode.context);
|
} else {
|
seenKeys[key] = true;
|
}
|
}
|
}
|
}
|
|
function findIdxInOld(node, oldCh, start, end) {
|
for (var i = start; i < end; i++) {
|
var c = oldCh[i];
|
|
if (isDef(c) && sameVnode(node, c)) {
|
return i;
|
}
|
}
|
}
|
|
function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
|
if (oldVnode === vnode) {
|
return;
|
}
|
|
if (isDef(vnode.elm) && isDef(ownerArray)) {
|
// clone reused vnode
|
vnode = ownerArray[index] = cloneVNode(vnode);
|
}
|
|
var elm = vnode.elm = oldVnode.elm;
|
|
if (isTrue(oldVnode.isAsyncPlaceholder)) {
|
if (isDef(vnode.asyncFactory.resolved)) {
|
hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
|
} else {
|
vnode.isAsyncPlaceholder = true;
|
}
|
|
return;
|
} // reuse element for static trees.
|
// note we only do this if the vnode is cloned -
|
// if the new node is not cloned it means the render functions have been
|
// reset by the hot-reload-api and we need to do a proper re-render.
|
|
|
if (isTrue(vnode.isStatic) && isTrue(oldVnode.isStatic) && vnode.key === oldVnode.key && (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
|
vnode.componentInstance = oldVnode.componentInstance;
|
return;
|
}
|
|
var i;
|
var data = vnode.data;
|
|
if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
|
i(oldVnode, vnode);
|
}
|
|
var oldCh = oldVnode.children;
|
var ch = vnode.children;
|
|
if (isDef(data) && isPatchable(vnode)) {
|
for (i = 0; i < cbs.update.length; ++i) {
|
cbs.update[i](oldVnode, vnode);
|
}
|
|
if (isDef(i = data.hook) && isDef(i = i.update)) {
|
i(oldVnode, vnode);
|
}
|
}
|
|
if (isUndef(vnode.text)) {
|
if (isDef(oldCh) && isDef(ch)) {
|
if (oldCh !== ch) {
|
updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
|
}
|
} else if (isDef(ch)) {
|
if (true) {
|
checkDuplicateKeys(ch);
|
}
|
|
if (isDef(oldVnode.text)) {
|
nodeOps.setTextContent(elm, '');
|
}
|
|
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
|
} else if (isDef(oldCh)) {
|
removeVnodes(oldCh, 0, oldCh.length - 1);
|
} else if (isDef(oldVnode.text)) {
|
nodeOps.setTextContent(elm, '');
|
}
|
} else if (oldVnode.text !== vnode.text) {
|
nodeOps.setTextContent(elm, vnode.text);
|
}
|
|
if (isDef(data)) {
|
if (isDef(i = data.hook) && isDef(i = i.postpatch)) {
|
i(oldVnode, vnode);
|
}
|
}
|
}
|
|
function invokeInsertHook(vnode, queue, initial) {
|
// delay insert hooks for component root nodes, invoke them after the
|
// element is really inserted
|
if (isTrue(initial) && isDef(vnode.parent)) {
|
vnode.parent.data.pendingInsert = queue;
|
} else {
|
for (var i = 0; i < queue.length; ++i) {
|
queue[i].data.hook.insert(queue[i]);
|
}
|
}
|
}
|
|
var hydrationBailed = false; // list of modules that can skip create hook during hydration because they
|
// are already rendered on the client or has no need for initialization
|
// Note: style is excluded because it relies on initial clone for future
|
// deep updates (#7063).
|
|
var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); // Note: this is a browser-only function so we can assume elms are DOM nodes.
|
|
function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
|
var i;
|
var tag = vnode.tag;
|
var data = vnode.data;
|
var children = vnode.children;
|
inVPre = inVPre || data && data.pre;
|
vnode.elm = elm;
|
|
if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
|
vnode.isAsyncPlaceholder = true;
|
return true;
|
} // assert node match
|
|
|
if (true) {
|
if (!assertNodeMatch(elm, vnode, inVPre)) {
|
return false;
|
}
|
}
|
|
if (isDef(data)) {
|
if (isDef(i = data.hook) && isDef(i = i.init)) {
|
i(vnode, true
|
/* hydrating */
|
);
|
}
|
|
if (isDef(i = vnode.componentInstance)) {
|
// child component. it should have hydrated its own tree.
|
initComponent(vnode, insertedVnodeQueue);
|
return true;
|
}
|
}
|
|
if (isDef(tag)) {
|
if (isDef(children)) {
|
// empty element, allow client to pick up and populate children
|
if (!elm.hasChildNodes()) {
|
createChildren(vnode, children, insertedVnodeQueue);
|
} else {
|
// v-html and domProps: innerHTML
|
if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
|
if (i !== elm.innerHTML) {
|
/* istanbul ignore if */
|
if ( true && typeof console !== 'undefined' && !hydrationBailed) {
|
hydrationBailed = true;
|
console.warn('Parent: ', elm);
|
console.warn('server innerHTML: ', i);
|
console.warn('client innerHTML: ', elm.innerHTML);
|
}
|
|
return false;
|
}
|
} else {
|
// iterate and compare children lists
|
var childrenMatch = true;
|
var childNode = elm.firstChild;
|
|
for (var i$1 = 0; i$1 < children.length; i$1++) {
|
if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
|
childrenMatch = false;
|
break;
|
}
|
|
childNode = childNode.nextSibling;
|
} // if childNode is not null, it means the actual childNodes list is
|
// longer than the virtual children list.
|
|
|
if (!childrenMatch || childNode) {
|
/* istanbul ignore if */
|
if ( true && typeof console !== 'undefined' && !hydrationBailed) {
|
hydrationBailed = true;
|
console.warn('Parent: ', elm);
|
console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
|
}
|
|
return false;
|
}
|
}
|
}
|
}
|
|
if (isDef(data)) {
|
var fullInvoke = false;
|
|
for (var key in data) {
|
if (!isRenderedModule(key)) {
|
fullInvoke = true;
|
invokeCreateHooks(vnode, insertedVnodeQueue);
|
break;
|
}
|
}
|
|
if (!fullInvoke && data['class']) {
|
// ensure collecting deps for deep class bindings for future updates
|
traverse(data['class']);
|
}
|
}
|
} else if (elm.data !== vnode.text) {
|
elm.data = vnode.text;
|
}
|
|
return true;
|
}
|
|
function assertNodeMatch(node, vnode, inVPre) {
|
if (isDef(vnode.tag)) {
|
return vnode.tag.indexOf('vue-component') === 0 || !isUnknownElement$$1(vnode, inVPre) && vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase());
|
} else {
|
return node.nodeType === (vnode.isComment ? 8 : 3);
|
}
|
}
|
|
return function patch(oldVnode, vnode, hydrating, removeOnly) {
|
if (isUndef(vnode)) {
|
if (isDef(oldVnode)) {
|
invokeDestroyHook(oldVnode);
|
}
|
|
return;
|
}
|
|
var isInitialPatch = false;
|
var insertedVnodeQueue = [];
|
|
if (isUndef(oldVnode)) {
|
// empty mount (likely as component), create new root element
|
isInitialPatch = true;
|
createElm(vnode, insertedVnodeQueue);
|
} else {
|
var isRealElement = isDef(oldVnode.nodeType);
|
|
if (!isRealElement && sameVnode(oldVnode, vnode)) {
|
// patch existing root node
|
patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
|
} else {
|
if (isRealElement) {
|
// mounting to a real element
|
// check if this is server-rendered content and if we can perform
|
// a successful hydration.
|
if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
|
oldVnode.removeAttribute(SSR_ATTR);
|
hydrating = true;
|
}
|
|
if (isTrue(hydrating)) {
|
if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
|
invokeInsertHook(vnode, insertedVnodeQueue, true);
|
return oldVnode;
|
} else if (true) {
|
warn('The client-side rendered virtual DOM tree is not matching ' + 'server-rendered content. This is likely caused by incorrect ' + 'HTML markup, for example nesting block-level elements inside ' + '<p>, or missing <tbody>. Bailing hydration and performing ' + 'full client-side render.');
|
}
|
} // either not server-rendered, or hydration failed.
|
// create an empty node and replace it
|
|
|
oldVnode = emptyNodeAt(oldVnode);
|
} // replacing existing element
|
|
|
var oldElm = oldVnode.elm;
|
var parentElm = nodeOps.parentNode(oldElm); // create new node
|
|
createElm(vnode, insertedVnodeQueue, // extremely rare edge case: do not insert if old element is in a
|
// leaving transition. Only happens when combining transition +
|
// keep-alive + HOCs. (#4590)
|
oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm)); // update parent placeholder node element, recursively
|
|
if (isDef(vnode.parent)) {
|
var ancestor = vnode.parent;
|
var patchable = isPatchable(vnode);
|
|
while (ancestor) {
|
for (var i = 0; i < cbs.destroy.length; ++i) {
|
cbs.destroy[i](ancestor);
|
}
|
|
ancestor.elm = vnode.elm;
|
|
if (patchable) {
|
for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
|
cbs.create[i$1](emptyNode, ancestor);
|
} // #6513
|
// invoke insert hooks that may have been merged by create hooks.
|
// e.g. for directives that uses the "inserted" hook.
|
|
|
var insert = ancestor.data.hook.insert;
|
|
if (insert.merged) {
|
// start at index 1 to avoid re-invoking component mounted hook
|
for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
|
insert.fns[i$2]();
|
}
|
}
|
} else {
|
registerRef(ancestor);
|
}
|
|
ancestor = ancestor.parent;
|
}
|
} // destroy old node
|
|
|
if (isDef(parentElm)) {
|
removeVnodes([oldVnode], 0, 0);
|
} else if (isDef(oldVnode.tag)) {
|
invokeDestroyHook(oldVnode);
|
}
|
}
|
}
|
|
invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
|
return vnode.elm;
|
};
|
}
|
/* */
|
|
|
var directives = {
|
create: updateDirectives,
|
update: updateDirectives,
|
destroy: function unbindDirectives(vnode) {
|
updateDirectives(vnode, emptyNode);
|
}
|
};
|
|
function updateDirectives(oldVnode, vnode) {
|
if (oldVnode.data.directives || vnode.data.directives) {
|
_update(oldVnode, vnode);
|
}
|
}
|
|
function _update(oldVnode, vnode) {
|
var isCreate = oldVnode === emptyNode;
|
var isDestroy = vnode === emptyNode;
|
var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
|
var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
|
var dirsWithInsert = [];
|
var dirsWithPostpatch = [];
|
var key, oldDir, dir;
|
|
for (key in newDirs) {
|
oldDir = oldDirs[key];
|
dir = newDirs[key];
|
|
if (!oldDir) {
|
// new directive, bind
|
callHook$1(dir, 'bind', vnode, oldVnode);
|
|
if (dir.def && dir.def.inserted) {
|
dirsWithInsert.push(dir);
|
}
|
} else {
|
// existing directive, update
|
dir.oldValue = oldDir.value;
|
dir.oldArg = oldDir.arg;
|
callHook$1(dir, 'update', vnode, oldVnode);
|
|
if (dir.def && dir.def.componentUpdated) {
|
dirsWithPostpatch.push(dir);
|
}
|
}
|
}
|
|
if (dirsWithInsert.length) {
|
var callInsert = function callInsert() {
|
for (var i = 0; i < dirsWithInsert.length; i++) {
|
callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
|
}
|
};
|
|
if (isCreate) {
|
mergeVNodeHook(vnode, 'insert', callInsert);
|
} else {
|
callInsert();
|
}
|
}
|
|
if (dirsWithPostpatch.length) {
|
mergeVNodeHook(vnode, 'postpatch', function () {
|
for (var i = 0; i < dirsWithPostpatch.length; i++) {
|
callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
|
}
|
});
|
}
|
|
if (!isCreate) {
|
for (key in oldDirs) {
|
if (!newDirs[key]) {
|
// no longer present, unbind
|
callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
|
}
|
}
|
}
|
}
|
|
var emptyModifiers = Object.create(null);
|
|
function normalizeDirectives$1(dirs, vm) {
|
var res = Object.create(null);
|
|
if (!dirs) {
|
// $flow-disable-line
|
return res;
|
}
|
|
var i, dir;
|
|
for (i = 0; i < dirs.length; i++) {
|
dir = dirs[i];
|
|
if (!dir.modifiers) {
|
// $flow-disable-line
|
dir.modifiers = emptyModifiers;
|
}
|
|
res[getRawDirName(dir)] = dir;
|
dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
|
} // $flow-disable-line
|
|
|
return res;
|
}
|
|
function getRawDirName(dir) {
|
return dir.rawName || dir.name + "." + Object.keys(dir.modifiers || {}).join('.');
|
}
|
|
function callHook$1(dir, hook, vnode, oldVnode, isDestroy) {
|
var fn = dir.def && dir.def[hook];
|
|
if (fn) {
|
try {
|
fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
|
} catch (e) {
|
handleError(e, vnode.context, "directive " + dir.name + " " + hook + " hook");
|
}
|
}
|
}
|
|
var baseModules = [ref, directives];
|
/* */
|
|
function findWxsProps(wxsProps, attrs) {
|
var ret = {};
|
Object.keys(wxsProps).forEach(function (name) {
|
if (attrs[name]) {
|
ret[wxsProps[name]] = attrs[name];
|
delete attrs[name];
|
}
|
});
|
return ret;
|
}
|
|
function updateWxsProps(oldVnode, vnode) {
|
if (isUndef(oldVnode.data.wxsProps) && isUndef(vnode.data.wxsProps)) {
|
return;
|
}
|
|
var oldWxsWatches = oldVnode.$wxsWatches;
|
var wxsPropsKey = Object.keys(vnode.data.wxsProps);
|
|
if (!oldWxsWatches && !wxsPropsKey.length) {
|
return;
|
}
|
|
if (!oldWxsWatches) {
|
oldWxsWatches = {};
|
}
|
|
var wxsProps = findWxsProps(vnode.data.wxsProps, vnode.data.attrs);
|
var context = vnode.context;
|
vnode.$wxsWatches = {};
|
Object.keys(wxsProps).forEach(function (prop) {
|
// app-plus view wxs
|
var watchProp = prop;
|
|
if (vnode.context.wxsProps) {
|
watchProp = 'wxsProps.' + prop;
|
}
|
|
vnode.$wxsWatches[prop] = oldWxsWatches[prop] || vnode.context.$watch(watchProp, function (newVal, oldVal) {
|
wxsProps[prop](newVal, oldVal, context.$getComponentDescriptor(context, true), vnode.elm.__vue__.$getComponentDescriptor(vnode.elm.__vue__, false));
|
}, {
|
deep: true
|
});
|
});
|
Object.keys(oldWxsWatches).forEach(function (oldName) {
|
if (!vnode.$wxsWatches[oldName]) {
|
oldWxsWatches[oldName]();
|
delete oldWxsWatches[oldName];
|
}
|
});
|
}
|
|
var wxs = {
|
create: updateWxsProps,
|
update: updateWxsProps
|
};
|
/* */
|
|
function updateAttrs(oldVnode, vnode) {
|
var opts = vnode.componentOptions;
|
|
if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
|
return;
|
}
|
|
if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
|
return;
|
}
|
|
var key, cur, old;
|
var elm = vnode.elm;
|
var oldAttrs = oldVnode.data.attrs || {};
|
var attrs = vnode.data.attrs || {}; // clone observed objects, as the user probably wants to mutate it
|
|
if (isDef(attrs.__ob__)) {
|
attrs = vnode.data.attrs = extend({}, attrs);
|
}
|
|
for (key in attrs) {
|
cur = attrs[key];
|
old = oldAttrs[key];
|
|
if (old !== cur) {
|
setAttr(elm, key, cur);
|
}
|
} // #4391: in IE9, setting type can reset value for input[type=radio]
|
// #6666: IE/Edge forces progress value down to 1 before setting a max
|
|
/* istanbul ignore if */
|
|
|
if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
|
setAttr(elm, 'value', attrs.value);
|
}
|
|
for (key in oldAttrs) {
|
if (isUndef(attrs[key])) {
|
if (isXlink(key)) {
|
elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
} else if (!isEnumeratedAttr(key)) {
|
elm.removeAttribute(key);
|
}
|
}
|
}
|
}
|
|
function setAttr(el, key, value) {
|
if (el.tagName.indexOf('-') > -1) {
|
baseSetAttr(el, key, value);
|
} else if (isBooleanAttr(key)) {
|
// set attribute for blank value
|
// e.g. <option disabled>Select one</option>
|
if (isFalsyAttrValue(value)) {
|
el.removeAttribute(key);
|
} else {
|
// technically allowfullscreen is a boolean attribute for <iframe>,
|
// but Flash expects a value of "true" when used on <embed> tag
|
value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
|
el.setAttribute(key, value);
|
}
|
} else if (isEnumeratedAttr(key)) {
|
el.setAttribute(key, convertEnumeratedValue(key, value));
|
} else if (isXlink(key)) {
|
if (isFalsyAttrValue(value)) {
|
el.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
} else {
|
el.setAttributeNS(xlinkNS, key, value);
|
}
|
} else {
|
baseSetAttr(el, key, value);
|
}
|
}
|
|
function baseSetAttr(el, key, value) {
|
if (isFalsyAttrValue(value)) {
|
el.removeAttribute(key);
|
} else {
|
// #7138: IE10 & 11 fires input event when setting placeholder on
|
// <textarea>... block the first input event and remove the blocker
|
// immediately.
|
|
/* istanbul ignore if */
|
if (isIE && !isIE9 && el.tagName === 'TEXTAREA' && key === 'placeholder' && value !== '' && !el.__ieph) {
|
var blocker = function blocker(e) {
|
e.stopImmediatePropagation();
|
el.removeEventListener('input', blocker);
|
};
|
|
el.addEventListener('input', blocker); // $flow-disable-line
|
|
el.__ieph = true;
|
/* IE placeholder patched */
|
}
|
|
el.setAttribute(key, value);
|
}
|
}
|
|
var attrs = {
|
create: updateAttrs,
|
update: updateAttrs
|
};
|
/* */
|
|
function updateClass(oldVnode, vnode) {
|
var el = vnode.elm;
|
var data = vnode.data;
|
var oldData = oldVnode.data;
|
|
if (isUndef(data.staticClass) && isUndef(data.class) && (isUndef(oldData) || isUndef(oldData.staticClass) && isUndef(oldData.class)) && isUndef(el.__wxsAddClass) && isUndef(el.__wxsRemoveClass) // fixed by xxxxxx __wxsClass
|
) {
|
return;
|
}
|
|
var cls = genClassForVnode(vnode); // handle transition classes
|
|
var transitionClass = el._transitionClasses;
|
|
if (isDef(transitionClass)) {
|
cls = concat(cls, stringifyClass(transitionClass));
|
} // fixed by xxxxxx __wxsClass
|
|
|
if (Array.isArray(el.__wxsRemoveClass) && el.__wxsRemoveClass.length) {
|
var clsArr = cls.split(/\s+/);
|
|
el.__wxsRemoveClass.forEach(function (removeCls) {
|
var clsIndex = clsArr.findIndex(function (cls) {
|
return cls === removeCls;
|
});
|
|
if (clsIndex !== -1) {
|
clsArr.splice(clsIndex, 1);
|
}
|
});
|
|
cls = clsArr.join(' ');
|
el.__wxsRemoveClass.length = 0;
|
}
|
|
if (el.__wxsAddClass) {
|
// 去重
|
var clsArr$1 = cls.split(/\s+/).concat(el.__wxsAddClass.split(/\s+/));
|
var clsObj = Object.create(null);
|
clsArr$1.forEach(function (cls) {
|
cls && (clsObj[cls] = 1);
|
});
|
cls = Object.keys(clsObj).join(' ');
|
} // fixed by xxxxxx (仅 h5 平台 extenalClasses)
|
|
|
var context = vnode.context;
|
var externalClasses = context.$options.mpOptions && context.$options.mpOptions.externalClasses;
|
|
if (Array.isArray(externalClasses)) {
|
externalClasses.forEach(function (externalClass) {
|
// 简单替换 externalClass
|
var externalClassValue = context[camelize(externalClass)];
|
externalClassValue && (cls = cls.replace(externalClass, externalClassValue));
|
});
|
} // set the class
|
|
|
if (cls !== el._prevClass) {
|
el.setAttribute('class', cls);
|
el._prevClass = cls;
|
}
|
}
|
|
var klass = {
|
create: updateClass,
|
update: updateClass
|
};
|
/* */
|
|
/* */
|
|
/* */
|
|
/* */
|
// in some cases, the event used has to be determined at runtime
|
// so we used some reserved tokens during compile.
|
|
var RANGE_TOKEN = '__r';
|
var CHECKBOX_RADIO_TOKEN = '__c';
|
/* */
|
// normalize v-model event tokens that can only be determined at runtime.
|
// it's important to place the event as the first in the array because
|
// the whole point is ensuring the v-model callback gets called before
|
// user-attached handlers.
|
|
function normalizeEvents(on) {
|
/* istanbul ignore if */
|
if (isDef(on[RANGE_TOKEN])) {
|
// IE input[type=range] only supports `change` event
|
var event = isIE ? 'change' : 'input';
|
on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
|
delete on[RANGE_TOKEN];
|
} // This was originally intended to fix #4521 but no longer necessary
|
// after 2.5. Keeping it for backwards compat with generated code from < 2.4
|
|
/* istanbul ignore if */
|
|
|
if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
|
on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
|
delete on[CHECKBOX_RADIO_TOKEN];
|
}
|
}
|
|
var target$1;
|
|
function createOnceHandler$1(event, handler, capture) {
|
var _target = target$1; // save current target element in closure
|
|
return function onceHandler() {
|
var res = handler.apply(null, arguments);
|
|
if (res !== null) {
|
remove$2(event, onceHandler, capture, _target);
|
}
|
};
|
} // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
|
// implementation and does not fire microtasks in between event propagation, so
|
// safe to exclude.
|
|
|
var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
|
|
function add$1(name, handler, capture, passive) {
|
// async edge case #6566: inner click event triggers patch, event handler
|
// attached to outer element during patch, and triggered again. This
|
// happens because browsers fire microtask ticks between event propagation.
|
// the solution is simple: we save the timestamp when a handler is attached,
|
// and the handler would only fire if the event passed to it was fired
|
// AFTER it was attached.
|
if (useMicrotaskFix) {
|
var attachedTimestamp = currentFlushTimestamp;
|
var original = handler;
|
|
handler = original._wrapper = function (e) {
|
if ( // no bubbling, should always fire.
|
// this is just a safety net in case event.timeStamp is unreliable in
|
// certain weird environments...
|
e.target === e.currentTarget || // event is fired after handler attachment
|
e.timeStamp >= attachedTimestamp || // bail for environments that have buggy event.timeStamp implementations
|
// #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
|
// #9681 QtWebEngine event.timeStamp is negative value
|
e.timeStamp <= 0 || // #9448 bail if event is fired in another document in a multi-page
|
// electron/nw.js app, since event.timeStamp will be using a different
|
// starting reference
|
e.target.ownerDocument !== document) {
|
return original.apply(this, arguments);
|
}
|
};
|
}
|
|
target$1.addEventListener(name, handler, supportsPassive ? {
|
capture: capture,
|
passive: passive
|
} : capture);
|
}
|
|
function remove$2(name, handler, capture, _target) {
|
(_target || target$1).removeEventListener(name, handler._wrapper || handler, capture);
|
}
|
|
function updateDOMListeners(oldVnode, vnode) {
|
if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
|
return;
|
}
|
|
var on = vnode.data.on || {};
|
var oldOn = oldVnode.data.on || {};
|
target$1 = vnode.elm;
|
normalizeEvents(on);
|
updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
|
target$1 = undefined;
|
}
|
|
var events = {
|
create: updateDOMListeners,
|
update: updateDOMListeners
|
};
|
/* */
|
|
var svgContainer;
|
|
function updateDOMProps(oldVnode, vnode) {
|
if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
|
return;
|
}
|
|
var key, cur;
|
var elm = vnode.elm;
|
var oldProps = oldVnode.data.domProps || {};
|
var props = vnode.data.domProps || {}; // clone observed objects, as the user probably wants to mutate it
|
|
if (isDef(props.__ob__)) {
|
props = vnode.data.domProps = extend({}, props);
|
}
|
|
for (key in oldProps) {
|
if (!(key in props)) {
|
elm[key] = '';
|
}
|
}
|
|
for (key in props) {
|
cur = props[key]; // ignore children if the node has textContent or innerHTML,
|
// as these will throw away existing DOM nodes and cause removal errors
|
// on subsequent patches (#3360)
|
|
if (key === 'textContent' || key === 'innerHTML') {
|
if (vnode.children) {
|
vnode.children.length = 0;
|
}
|
|
if (cur === oldProps[key]) {
|
continue;
|
} // #6601 work around Chrome version <= 55 bug where single textNode
|
// replaced by innerHTML/textContent retains its parentNode property
|
|
|
if (elm.childNodes.length === 1) {
|
elm.removeChild(elm.childNodes[0]);
|
}
|
}
|
|
if (key === 'value' && elm.tagName !== 'PROGRESS') {
|
// store value as _value as well since
|
// non-string values will be stringified
|
elm._value = cur; // avoid resetting cursor position when value is the same
|
|
var strCur = isUndef(cur) ? '' : String(cur);
|
|
if (shouldUpdateValue(elm, strCur)) {
|
elm.value = strCur;
|
}
|
} else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
|
// IE doesn't support innerHTML for SVG elements
|
svgContainer = svgContainer || document.createElement('div');
|
svgContainer.innerHTML = "<svg>" + cur + "</svg>";
|
var svg = svgContainer.firstChild;
|
|
while (elm.firstChild) {
|
elm.removeChild(elm.firstChild);
|
}
|
|
while (svg.firstChild) {
|
elm.appendChild(svg.firstChild);
|
}
|
} else if ( // skip the update if old and new VDOM state is the same.
|
// `value` is handled separately because the DOM value may be temporarily
|
// out of sync with VDOM state due to focus, composition and modifiers.
|
// This #4521 by skipping the unnecesarry `checked` update.
|
cur !== oldProps[key]) {
|
// some property updates can throw
|
// e.g. `value` on <progress> w/ non-finite value
|
try {
|
elm[key] = cur;
|
} catch (e) {}
|
}
|
}
|
} // check platforms/web/util/attrs.js acceptValue
|
|
|
function shouldUpdateValue(elm, checkVal) {
|
return !elm.composing && (elm.tagName === 'OPTION' || isNotInFocusAndDirty(elm, checkVal) || isDirtyWithModifiers(elm, checkVal));
|
}
|
|
function isNotInFocusAndDirty(elm, checkVal) {
|
// return true when textbox (.number and .trim) loses focus and its value is
|
// not equal to the updated value
|
var notInFocus = true; // #6157
|
// work around IE bug when accessing document.activeElement in an iframe
|
|
try {
|
notInFocus = document.activeElement !== elm;
|
} catch (e) {}
|
|
return notInFocus && elm.value !== checkVal;
|
}
|
|
function isDirtyWithModifiers(elm, newVal) {
|
var value = elm.value;
|
var modifiers = elm._vModifiers; // injected by v-model runtime
|
|
if (isDef(modifiers)) {
|
if (modifiers.number) {
|
return toNumber(value) !== toNumber(newVal);
|
}
|
|
if (modifiers.trim) {
|
return value.trim() !== newVal.trim();
|
}
|
}
|
|
return value !== newVal;
|
}
|
|
var domProps = {
|
create: updateDOMProps,
|
update: updateDOMProps
|
};
|
/* */
|
|
var parseStyleText = cached(function (cssText) {
|
var res = {};
|
var listDelimiter = /;(?![^(]*\))/g;
|
var propertyDelimiter = /:(.+)/;
|
cssText.split(listDelimiter).forEach(function (item) {
|
if (item) {
|
var tmp = item.split(propertyDelimiter);
|
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
|
}
|
});
|
return res;
|
}); // merge static and dynamic style data on the same vnode
|
|
function normalizeStyleData(data) {
|
var style = normalizeStyleBinding(data.style); // static style is pre-processed into an object during compilation
|
// and is always a fresh object, so it's safe to merge into it
|
|
return data.staticStyle ? extend(data.staticStyle, style) : style;
|
} // normalize possible array / string values into Object
|
|
|
function normalizeStyleBinding(bindingStyle) {
|
if (Array.isArray(bindingStyle)) {
|
return toObject(bindingStyle);
|
}
|
|
if (typeof bindingStyle === 'string') {
|
return parseStyleText(bindingStyle);
|
}
|
|
return bindingStyle;
|
}
|
/**
|
* parent component style should be after child's
|
* so that parent component's style could override it
|
*/
|
|
|
function getStyle(vnode, checkChild) {
|
var res = {};
|
var styleData;
|
|
if (checkChild) {
|
var childNode = vnode;
|
|
while (childNode.componentInstance) {
|
childNode = childNode.componentInstance._vnode;
|
|
if (childNode && childNode.data && (styleData = normalizeStyleData(childNode.data))) {
|
extend(res, styleData);
|
}
|
}
|
}
|
|
if (styleData = normalizeStyleData(vnode.data)) {
|
extend(res, styleData);
|
}
|
|
var parentNode = vnode;
|
|
while (parentNode = parentNode.parent) {
|
if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
|
extend(res, styleData);
|
}
|
}
|
|
return res;
|
}
|
/* */
|
|
|
var cssVarRE = /^--/;
|
var importantRE = /\s*!important$/; // upx,rpx 正则匹配
|
|
var unitRE = /\b([+-]?\d+(\.\d+)?)[r|u]px\b/g;
|
|
var transformUnit = function transformUnit(val) {
|
if (typeof val === 'string') {
|
return val.replace(unitRE, function (a, b) {
|
/* eslint-disable no-undef */
|
return uni.upx2px(b) + 'px';
|
});
|
}
|
|
return val;
|
};
|
|
var urlRE1 = /url\(\s*['"](.+?\.(jpg|gif|png))['"]\s*\)/;
|
var urlRE2 = /url\(\s*([a-zA-Z0-9\.\-\_\/]+?\.(jpg|gif|png))\s*\)/;
|
|
var transformUrl = function transformUrl(val, ctx) {
|
if (typeof val === 'string' && val.indexOf('url(') !== -1) {
|
var matches = val.match(urlRE1) || val.match(urlRE2);
|
|
if (matches && matches.length === 3) {
|
val = val.replace(matches[1], ctx._$getRealPath(matches[1]));
|
}
|
}
|
|
return val;
|
};
|
|
var setProp = function setProp(el, name, val, ctx) {
|
if (ctx && ctx._$getRealPath && val) {
|
val = transformUrl(val, ctx);
|
}
|
/* istanbul ignore if */
|
|
|
if (cssVarRE.test(name)) {
|
el.style.setProperty(name, val);
|
} else if (importantRE.test(val)) {
|
el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
|
} else {
|
var normalizedName = normalize(name);
|
|
if (Array.isArray(val)) {
|
// Support values array created by autoprefixer, e.g.
|
// {display: ["-webkit-box", "-ms-flexbox", "flex"]}
|
// Set them one by one, and the browser will only set those it can recognize
|
for (var i = 0, len = val.length; i < len; i++) {
|
el.style[normalizedName] = transformUnit(val[i]);
|
}
|
} else {
|
el.style[normalizedName] = transformUnit(val);
|
}
|
}
|
};
|
|
var vendorNames = ['Webkit', 'Moz', 'ms'];
|
var emptyStyle;
|
var normalize = cached(function (prop) {
|
emptyStyle = emptyStyle || document.createElement('div').style;
|
prop = camelize(prop);
|
|
if (prop !== 'filter' && prop in emptyStyle) {
|
return prop;
|
}
|
|
var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
|
|
for (var i = 0; i < vendorNames.length; i++) {
|
var name = vendorNames[i] + capName;
|
|
if (name in emptyStyle) {
|
return name;
|
}
|
}
|
});
|
|
function updateStyle(oldVnode, vnode) {
|
var data = vnode.data;
|
var oldData = oldVnode.data;
|
var el = vnode.elm;
|
|
if (isUndef(data.staticStyle) && isUndef(data.style) && isUndef(oldData.staticStyle) && isUndef(oldData.style) && isUndef(el.__wxsStyle) // fixed by xxxxxx __wxsStyle
|
) {
|
return;
|
}
|
|
var cur, name;
|
var oldStaticStyle = oldData.staticStyle;
|
var oldStyleBinding = oldData.normalizedStyle || oldData.style || {}; // if static style exists, stylebinding already merged into it when doing normalizeStyleData
|
|
var oldStyle = oldStaticStyle || oldStyleBinding;
|
var style = normalizeStyleBinding(vnode.data.style) || {}; // store normalized style under a different key for next diff
|
// make sure to clone it if it's reactive, since the user likely wants
|
// to mutate it.
|
|
vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
|
var newStyle = getStyle(vnode, true); // fixed by xxxxxx __wxsStyle
|
|
if (el.__wxsStyle) {
|
Object.assign(vnode.data.normalizedStyle, el.__wxsStyle);
|
Object.assign(newStyle, el.__wxsStyle);
|
}
|
|
for (name in oldStyle) {
|
if (isUndef(newStyle[name])) {
|
setProp(el, name, '');
|
}
|
}
|
|
for (name in newStyle) {
|
cur = newStyle[name];
|
|
if (cur !== oldStyle[name]) {
|
// ie9 setting to null has no effect, must use empty string
|
setProp(el, name, cur == null ? '' : cur, vnode.context);
|
}
|
}
|
}
|
|
var style = {
|
create: updateStyle,
|
update: updateStyle
|
};
|
/* */
|
|
var whitespaceRE = /\s+/;
|
/**
|
* Add class with compatibility for SVG since classList is not supported on
|
* SVG elements in IE
|
*/
|
|
function addClass(el, cls) {
|
/* istanbul ignore if */
|
if (!cls || !(cls = cls.trim())) {
|
return;
|
}
|
/* istanbul ignore else */
|
|
|
if (el.classList) {
|
if (cls.indexOf(' ') > -1) {
|
cls.split(whitespaceRE).forEach(function (c) {
|
return el.classList.add(c);
|
});
|
} else {
|
el.classList.add(cls);
|
}
|
} else {
|
var cur = " " + (el.getAttribute('class') || '') + " ";
|
|
if (cur.indexOf(' ' + cls + ' ') < 0) {
|
el.setAttribute('class', (cur + cls).trim());
|
}
|
}
|
}
|
/**
|
* Remove class with compatibility for SVG since classList is not supported on
|
* SVG elements in IE
|
*/
|
|
|
function removeClass(el, cls) {
|
/* istanbul ignore if */
|
if (!cls || !(cls = cls.trim())) {
|
return;
|
}
|
/* istanbul ignore else */
|
|
|
if (el.classList) {
|
if (cls.indexOf(' ') > -1) {
|
cls.split(whitespaceRE).forEach(function (c) {
|
return el.classList.remove(c);
|
});
|
} else {
|
el.classList.remove(cls);
|
}
|
|
if (!el.classList.length) {
|
el.removeAttribute('class');
|
}
|
} else {
|
var cur = " " + (el.getAttribute('class') || '') + " ";
|
var tar = ' ' + cls + ' ';
|
|
while (cur.indexOf(tar) >= 0) {
|
cur = cur.replace(tar, ' ');
|
}
|
|
cur = cur.trim();
|
|
if (cur) {
|
el.setAttribute('class', cur);
|
} else {
|
el.removeAttribute('class');
|
}
|
}
|
}
|
/* */
|
|
|
function resolveTransition(def$$1) {
|
if (!def$$1) {
|
return;
|
}
|
/* istanbul ignore else */
|
|
|
if (_typeof(def$$1) === 'object') {
|
var res = {};
|
|
if (def$$1.css !== false) {
|
extend(res, autoCssTransition(def$$1.name || 'v'));
|
}
|
|
extend(res, def$$1);
|
return res;
|
} else if (typeof def$$1 === 'string') {
|
return autoCssTransition(def$$1);
|
}
|
}
|
|
var autoCssTransition = cached(function (name) {
|
return {
|
enterClass: name + "-enter",
|
enterToClass: name + "-enter-to",
|
enterActiveClass: name + "-enter-active",
|
leaveClass: name + "-leave",
|
leaveToClass: name + "-leave-to",
|
leaveActiveClass: name + "-leave-active"
|
};
|
});
|
var hasTransition = inBrowser && !isIE9;
|
var TRANSITION = 'transition';
|
var ANIMATION = 'animation'; // Transition property/event sniffing
|
|
var transitionProp = 'transition';
|
var transitionEndEvent = 'transitionend';
|
var animationProp = 'animation';
|
var animationEndEvent = 'animationend';
|
|
if (hasTransition) {
|
/* istanbul ignore if */
|
if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {
|
transitionProp = 'WebkitTransition';
|
transitionEndEvent = 'webkitTransitionEnd';
|
}
|
|
if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {
|
animationProp = 'WebkitAnimation';
|
animationEndEvent = 'webkitAnimationEnd';
|
}
|
} // binding to window is necessary to make hot reload work in IE in strict mode
|
|
|
var raf = inBrowser ? window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout :
|
/* istanbul ignore next */
|
function (fn) {
|
return fn();
|
};
|
|
function nextFrame(fn) {
|
raf(function () {
|
raf(fn);
|
});
|
}
|
|
function addTransitionClass(el, cls) {
|
var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
|
|
if (transitionClasses.indexOf(cls) < 0) {
|
transitionClasses.push(cls);
|
addClass(el, cls);
|
}
|
}
|
|
function removeTransitionClass(el, cls) {
|
if (el._transitionClasses) {
|
remove(el._transitionClasses, cls);
|
}
|
|
removeClass(el, cls);
|
}
|
|
function whenTransitionEnds(el, expectedType, cb) {
|
var ref = getTransitionInfo(el, expectedType);
|
var type = ref.type;
|
var timeout = ref.timeout;
|
var propCount = ref.propCount;
|
|
if (!type) {
|
return cb();
|
}
|
|
var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
|
var ended = 0;
|
|
var end = function end() {
|
el.removeEventListener(event, onEnd);
|
cb();
|
};
|
|
var onEnd = function onEnd(e) {
|
if (e.target === el) {
|
if (++ended >= propCount) {
|
end();
|
}
|
}
|
};
|
|
setTimeout(function () {
|
if (ended < propCount) {
|
end();
|
}
|
}, timeout + 1);
|
el.addEventListener(event, onEnd);
|
}
|
|
var transformRE = /\b(transform|all)(,|$)/;
|
|
function getTransitionInfo(el, expectedType) {
|
var styles = window.getComputedStyle(el); // JSDOM may return undefined for transition properties
|
|
var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
|
var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
|
var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
|
var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
|
var animationTimeout = getTimeout(animationDelays, animationDurations);
|
var type;
|
var timeout = 0;
|
var propCount = 0;
|
/* istanbul ignore if */
|
|
if (expectedType === TRANSITION) {
|
if (transitionTimeout > 0) {
|
type = TRANSITION;
|
timeout = transitionTimeout;
|
propCount = transitionDurations.length;
|
}
|
} else if (expectedType === ANIMATION) {
|
if (animationTimeout > 0) {
|
type = ANIMATION;
|
timeout = animationTimeout;
|
propCount = animationDurations.length;
|
}
|
} else {
|
timeout = Math.max(transitionTimeout, animationTimeout);
|
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
}
|
|
var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
|
return {
|
type: type,
|
timeout: timeout,
|
propCount: propCount,
|
hasTransform: hasTransform
|
};
|
}
|
|
function getTimeout(delays, durations) {
|
/* istanbul ignore next */
|
while (delays.length < durations.length) {
|
delays = delays.concat(delays);
|
}
|
|
return Math.max.apply(null, durations.map(function (d, i) {
|
return toMs(d) + toMs(delays[i]);
|
}));
|
} // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
|
// in a locale-dependent way, using a comma instead of a dot.
|
// If comma is not replaced with a dot, the input will be rounded down (i.e. acting
|
// as a floor function) causing unexpected behaviors
|
|
|
function toMs(s) {
|
return Number(s.slice(0, -1).replace(',', '.')) * 1000;
|
}
|
/* */
|
|
|
function enter(vnode, toggleDisplay) {
|
var el = vnode.elm; // call leave callback now
|
|
if (isDef(el._leaveCb)) {
|
el._leaveCb.cancelled = true;
|
|
el._leaveCb();
|
}
|
|
var data = resolveTransition(vnode.data.transition);
|
|
if (isUndef(data)) {
|
return;
|
}
|
/* istanbul ignore if */
|
|
|
if (isDef(el._enterCb) || el.nodeType !== 1) {
|
return;
|
}
|
|
var css = data.css;
|
var type = data.type;
|
var enterClass = data.enterClass;
|
var enterToClass = data.enterToClass;
|
var enterActiveClass = data.enterActiveClass;
|
var appearClass = data.appearClass;
|
var appearToClass = data.appearToClass;
|
var appearActiveClass = data.appearActiveClass;
|
var beforeEnter = data.beforeEnter;
|
var enter = data.enter;
|
var afterEnter = data.afterEnter;
|
var enterCancelled = data.enterCancelled;
|
var beforeAppear = data.beforeAppear;
|
var appear = data.appear;
|
var afterAppear = data.afterAppear;
|
var appearCancelled = data.appearCancelled;
|
var duration = data.duration; // activeInstance will always be the <transition> component managing this
|
// transition. One edge case to check is when the <transition> is placed
|
// as the root node of a child component. In that case we need to check
|
// <transition>'s parent for appear check.
|
|
var context = activeInstance;
|
var transitionNode = activeInstance.$vnode;
|
|
while (transitionNode && transitionNode.parent) {
|
context = transitionNode.context;
|
transitionNode = transitionNode.parent;
|
}
|
|
var isAppear = !context._isMounted || !vnode.isRootInsert;
|
|
if (isAppear && !appear && appear !== '') {
|
return;
|
}
|
|
var startClass = isAppear && appearClass ? appearClass : enterClass;
|
var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
|
var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
|
var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
|
var enterHook = isAppear ? typeof appear === 'function' ? appear : enter : enter;
|
var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
|
var enterCancelledHook = isAppear ? appearCancelled || enterCancelled : enterCancelled;
|
var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
|
|
if ( true && explicitEnterDuration != null) {
|
checkDuration(explicitEnterDuration, 'enter', vnode);
|
}
|
|
var expectsCSS = css !== false && !isIE9;
|
var userWantsControl = getHookArgumentsLength(enterHook);
|
var cb = el._enterCb = once(function () {
|
if (expectsCSS) {
|
removeTransitionClass(el, toClass);
|
removeTransitionClass(el, activeClass);
|
}
|
|
if (cb.cancelled) {
|
if (expectsCSS) {
|
removeTransitionClass(el, startClass);
|
}
|
|
enterCancelledHook && enterCancelledHook(el);
|
} else {
|
afterEnterHook && afterEnterHook(el);
|
}
|
|
el._enterCb = null;
|
});
|
|
if (!vnode.data.show) {
|
// remove pending leave element on enter by injecting an insert hook
|
mergeVNodeHook(vnode, 'insert', function () {
|
var parent = el.parentNode;
|
var pendingNode = parent && parent._pending && parent._pending[vnode.key];
|
|
if (pendingNode && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb) {
|
pendingNode.elm._leaveCb();
|
}
|
|
enterHook && enterHook(el, cb);
|
});
|
} // start enter transition
|
|
|
beforeEnterHook && beforeEnterHook(el);
|
|
if (expectsCSS) {
|
addTransitionClass(el, startClass);
|
addTransitionClass(el, activeClass);
|
nextFrame(function () {
|
removeTransitionClass(el, startClass);
|
|
if (!cb.cancelled) {
|
addTransitionClass(el, toClass);
|
|
if (!userWantsControl) {
|
if (isValidDuration(explicitEnterDuration)) {
|
setTimeout(cb, explicitEnterDuration);
|
} else {
|
whenTransitionEnds(el, type, cb);
|
}
|
}
|
}
|
});
|
}
|
|
if (vnode.data.show) {
|
toggleDisplay && toggleDisplay();
|
enterHook && enterHook(el, cb);
|
}
|
|
if (!expectsCSS && !userWantsControl) {
|
cb();
|
}
|
}
|
|
function leave(vnode, rm) {
|
var el = vnode.elm; // call enter callback now
|
|
if (isDef(el._enterCb)) {
|
el._enterCb.cancelled = true;
|
|
el._enterCb();
|
}
|
|
var data = resolveTransition(vnode.data.transition);
|
|
if (isUndef(data) || el.nodeType !== 1) {
|
return rm();
|
}
|
/* istanbul ignore if */
|
|
|
if (isDef(el._leaveCb)) {
|
return;
|
}
|
|
var css = data.css;
|
var type = data.type;
|
var leaveClass = data.leaveClass;
|
var leaveToClass = data.leaveToClass;
|
var leaveActiveClass = data.leaveActiveClass;
|
var beforeLeave = data.beforeLeave;
|
var leave = data.leave;
|
var afterLeave = data.afterLeave;
|
var leaveCancelled = data.leaveCancelled;
|
var delayLeave = data.delayLeave;
|
var duration = data.duration;
|
var expectsCSS = css !== false && !isIE9;
|
var userWantsControl = getHookArgumentsLength(leave);
|
var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
|
|
if ( true && isDef(explicitLeaveDuration)) {
|
checkDuration(explicitLeaveDuration, 'leave', vnode);
|
}
|
|
var cb = el._leaveCb = once(function () {
|
if (el.parentNode && el.parentNode._pending) {
|
el.parentNode._pending[vnode.key] = null;
|
}
|
|
if (expectsCSS) {
|
removeTransitionClass(el, leaveToClass);
|
removeTransitionClass(el, leaveActiveClass);
|
}
|
|
if (cb.cancelled) {
|
if (expectsCSS) {
|
removeTransitionClass(el, leaveClass);
|
}
|
|
leaveCancelled && leaveCancelled(el);
|
} else {
|
rm();
|
afterLeave && afterLeave(el);
|
}
|
|
el._leaveCb = null;
|
});
|
|
if (delayLeave) {
|
delayLeave(performLeave);
|
} else {
|
performLeave();
|
}
|
|
function performLeave() {
|
// the delayed leave may have already been cancelled
|
if (cb.cancelled) {
|
return;
|
} // record leaving element
|
|
|
if (!vnode.data.show && el.parentNode) {
|
(el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
|
}
|
|
beforeLeave && beforeLeave(el);
|
|
if (expectsCSS) {
|
addTransitionClass(el, leaveClass);
|
addTransitionClass(el, leaveActiveClass);
|
nextFrame(function () {
|
removeTransitionClass(el, leaveClass);
|
|
if (!cb.cancelled) {
|
addTransitionClass(el, leaveToClass);
|
|
if (!userWantsControl) {
|
if (isValidDuration(explicitLeaveDuration)) {
|
setTimeout(cb, explicitLeaveDuration);
|
} else {
|
whenTransitionEnds(el, type, cb);
|
}
|
}
|
}
|
});
|
}
|
|
leave && leave(el, cb);
|
|
if (!expectsCSS && !userWantsControl) {
|
cb();
|
}
|
}
|
} // only used in dev mode
|
|
|
function checkDuration(val, name, vnode) {
|
if (typeof val !== 'number') {
|
warn("<transition> explicit " + name + " duration is not a valid number - " + "got " + JSON.stringify(val) + ".", vnode.context);
|
} else if (isNaN(val)) {
|
warn("<transition> explicit " + name + " duration is NaN - " + 'the duration expression might be incorrect.', vnode.context);
|
}
|
}
|
|
function isValidDuration(val) {
|
return typeof val === 'number' && !isNaN(val);
|
}
|
/**
|
* Normalize a transition hook's argument length. The hook may be:
|
* - a merged hook (invoker) with the original in .fns
|
* - a wrapped component method (check ._length)
|
* - a plain function (.length)
|
*/
|
|
|
function getHookArgumentsLength(fn) {
|
if (isUndef(fn)) {
|
return false;
|
}
|
|
var invokerFns = fn.fns;
|
|
if (isDef(invokerFns)) {
|
// invoker
|
return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
|
} else {
|
return (fn._length || fn.length) > 1;
|
}
|
}
|
|
function _enter(_, vnode) {
|
if (vnode.data.show !== true) {
|
enter(vnode);
|
}
|
}
|
|
var transition = inBrowser ? {
|
create: _enter,
|
activate: _enter,
|
remove: function remove$$1(vnode, rm) {
|
/* istanbul ignore else */
|
if (vnode.data.show !== true) {
|
leave(vnode, rm);
|
} else {
|
rm();
|
}
|
}
|
} : {};
|
var platformModules = [wxs, // fixed by xxxxxx wxs props
|
attrs, klass, events, domProps, style, transition];
|
/* */
|
// the directive module should be applied last, after all
|
// built-in modules have been applied.
|
|
var modules = platformModules.concat(baseModules);
|
var patch = createPatchFunction({
|
nodeOps: nodeOps,
|
modules: modules
|
});
|
/**
|
* Not type checking this file because flow doesn't like attaching
|
* properties to Elements.
|
*/
|
|
/* istanbul ignore if */
|
|
if (isIE9) {
|
// http://www.matts411.com/post/internet-explorer-9-oninput/
|
document.addEventListener('selectionchange', function () {
|
var el = document.activeElement;
|
|
if (el && el.vmodel) {
|
trigger(el, 'input');
|
}
|
});
|
}
|
|
var directive = {
|
inserted: function inserted(el, binding, vnode, oldVnode) {
|
if (vnode.tag === 'select') {
|
// #6903
|
if (oldVnode.elm && !oldVnode.elm._vOptions) {
|
mergeVNodeHook(vnode, 'postpatch', function () {
|
directive.componentUpdated(el, binding, vnode);
|
});
|
} else {
|
setSelected(el, binding, vnode.context);
|
}
|
|
el._vOptions = [].map.call(el.options, getValue);
|
} else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
|
el._vModifiers = binding.modifiers;
|
|
if (!binding.modifiers.lazy) {
|
el.addEventListener('compositionstart', onCompositionStart);
|
el.addEventListener('compositionend', onCompositionEnd); // Safari < 10.2 & UIWebView doesn't fire compositionend when
|
// switching focus before confirming composition choice
|
// this also fixes the issue where some browsers e.g. iOS Chrome
|
// fires "change" instead of "input" on autocomplete.
|
|
el.addEventListener('change', onCompositionEnd);
|
/* istanbul ignore if */
|
|
if (isIE9) {
|
el.vmodel = true;
|
}
|
}
|
}
|
},
|
componentUpdated: function componentUpdated(el, binding, vnode) {
|
if (vnode.tag === 'select') {
|
setSelected(el, binding, vnode.context); // in case the options rendered by v-for have changed,
|
// it's possible that the value is out-of-sync with the rendered options.
|
// detect such cases and filter out values that no longer has a matching
|
// option in the DOM.
|
|
var prevOptions = el._vOptions;
|
var curOptions = el._vOptions = [].map.call(el.options, getValue);
|
|
if (curOptions.some(function (o, i) {
|
return !looseEqual(o, prevOptions[i]);
|
})) {
|
// trigger change event if
|
// no matching option found for at least one value
|
var needReset = el.multiple ? binding.value.some(function (v) {
|
return hasNoMatchingOption(v, curOptions);
|
}) : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
|
|
if (needReset) {
|
trigger(el, 'change');
|
}
|
}
|
}
|
}
|
};
|
|
function setSelected(el, binding, vm) {
|
actuallySetSelected(el, binding, vm);
|
/* istanbul ignore if */
|
|
if (isIE || isEdge) {
|
setTimeout(function () {
|
actuallySetSelected(el, binding, vm);
|
}, 0);
|
}
|
}
|
|
function actuallySetSelected(el, binding, vm) {
|
var value = binding.value;
|
var isMultiple = el.multiple;
|
|
if (isMultiple && !Array.isArray(value)) {
|
true && warn("<select multiple v-model=\"" + binding.expression + "\"> " + "expects an Array value for its binding, but got " + Object.prototype.toString.call(value).slice(8, -1), vm);
|
return;
|
}
|
|
var selected, option;
|
|
for (var i = 0, l = el.options.length; i < l; i++) {
|
option = el.options[i];
|
|
if (isMultiple) {
|
selected = looseIndexOf(value, getValue(option)) > -1;
|
|
if (option.selected !== selected) {
|
option.selected = selected;
|
}
|
} else {
|
if (looseEqual(getValue(option), value)) {
|
if (el.selectedIndex !== i) {
|
el.selectedIndex = i;
|
}
|
|
return;
|
}
|
}
|
}
|
|
if (!isMultiple) {
|
el.selectedIndex = -1;
|
}
|
}
|
|
function hasNoMatchingOption(value, options) {
|
return options.every(function (o) {
|
return !looseEqual(o, value);
|
});
|
}
|
|
function getValue(option) {
|
return '_value' in option ? option._value : option.value;
|
}
|
|
function onCompositionStart(e) {
|
e.target.composing = true;
|
}
|
|
function onCompositionEnd(e) {
|
// prevent triggering an input event for no reason
|
if (!e.target.composing) {
|
return;
|
}
|
|
e.target.composing = false;
|
trigger(e.target, 'input');
|
}
|
|
function trigger(el, type) {
|
var e = document.createEvent('HTMLEvents');
|
e.initEvent(type, true, true);
|
el.dispatchEvent(e);
|
}
|
/* */
|
// recursively search for possible transition defined inside the component root
|
|
|
function locateNode(vnode) {
|
return vnode.componentInstance && (!vnode.data || !vnode.data.transition) ? locateNode(vnode.componentInstance._vnode) : vnode;
|
}
|
|
var show = {
|
bind: function bind(el, ref, vnode) {
|
var value = ref.value;
|
vnode = locateNode(vnode);
|
var transition$$1 = vnode.data && vnode.data.transition;
|
var originalDisplay = el.__vOriginalDisplay = el.style.display === 'none' ? '' : el.style.display;
|
|
if (value && transition$$1) {
|
vnode.data.show = true;
|
enter(vnode, function () {
|
el.style.display = originalDisplay;
|
});
|
} else {
|
el.style.display = value ? originalDisplay : 'none';
|
}
|
},
|
update: function update(el, ref, vnode) {
|
var value = ref.value;
|
var oldValue = ref.oldValue;
|
/* istanbul ignore if */
|
|
if (!value === !oldValue) {
|
return;
|
}
|
|
vnode = locateNode(vnode);
|
var transition$$1 = vnode.data && vnode.data.transition;
|
|
if (transition$$1) {
|
vnode.data.show = true;
|
|
if (value) {
|
enter(vnode, function () {
|
el.style.display = el.__vOriginalDisplay;
|
});
|
} else {
|
leave(vnode, function () {
|
el.style.display = 'none';
|
});
|
}
|
} else {
|
el.style.display = value ? el.__vOriginalDisplay : 'none';
|
}
|
},
|
unbind: function unbind(el, binding, vnode, oldVnode, isDestroy) {
|
if (!isDestroy) {
|
el.style.display = el.__vOriginalDisplay;
|
}
|
}
|
};
|
var platformDirectives = {
|
model: directive,
|
show: show
|
};
|
/* */
|
|
var transitionProps = {
|
name: String,
|
appear: Boolean,
|
css: Boolean,
|
mode: String,
|
type: String,
|
enterClass: String,
|
leaveClass: String,
|
enterToClass: String,
|
leaveToClass: String,
|
enterActiveClass: String,
|
leaveActiveClass: String,
|
appearClass: String,
|
appearActiveClass: String,
|
appearToClass: String,
|
duration: [Number, String, Object]
|
}; // in case the child is also an abstract component, e.g. <keep-alive>
|
// we want to recursively retrieve the real component to be rendered
|
|
function getRealChild(vnode) {
|
var compOptions = vnode && vnode.componentOptions;
|
|
if (compOptions && compOptions.Ctor.options.abstract) {
|
return getRealChild(getFirstComponentChild(compOptions.children));
|
} else {
|
return vnode;
|
}
|
}
|
|
function extractTransitionData(comp) {
|
var data = {};
|
var options = comp.$options; // props
|
|
for (var key in options.propsData) {
|
data[key] = comp[key];
|
} // events.
|
// extract listeners and pass them directly to the transition methods
|
|
|
var listeners = options._parentListeners;
|
|
for (var key$1 in listeners) {
|
data[camelize(key$1)] = listeners[key$1];
|
}
|
|
return data;
|
}
|
|
function placeholder(h, rawChild) {
|
if (/\d-keep-alive$/.test(rawChild.tag)) {
|
return h('keep-alive', {
|
props: rawChild.componentOptions.propsData
|
});
|
}
|
}
|
|
function hasParentTransition(vnode) {
|
while (vnode = vnode.parent) {
|
if (vnode.data.transition) {
|
return true;
|
}
|
}
|
}
|
|
function isSameChild(child, oldChild) {
|
return oldChild.key === child.key && oldChild.tag === child.tag;
|
}
|
|
var isNotTextNode = function isNotTextNode(c) {
|
return c.tag || isAsyncPlaceholder(c);
|
};
|
|
var isVShowDirective = function isVShowDirective(d) {
|
return d.name === 'show';
|
};
|
|
var Transition = {
|
name: 'transition',
|
props: transitionProps,
|
abstract: true,
|
render: function render(h) {
|
var this$1 = this;
|
var children = this.$slots.default;
|
|
if (!children) {
|
return;
|
} // filter out text nodes (possible whitespaces)
|
|
|
children = children.filter(isNotTextNode);
|
/* istanbul ignore if */
|
|
if (!children.length) {
|
return;
|
} // warn multiple elements
|
|
|
if ( true && children.length > 1) {
|
warn('<transition> can only be used on a single element. Use ' + '<transition-group> for lists.', this.$parent);
|
}
|
|
var mode = this.mode; // warn invalid mode
|
|
if ( true && mode && mode !== 'in-out' && mode !== 'out-in') {
|
warn('invalid <transition> mode: ' + mode, this.$parent);
|
}
|
|
var rawChild = children[0]; // if this is a component root node and the component's
|
// parent container node also has transition, skip.
|
|
if (hasParentTransition(this.$vnode)) {
|
return rawChild;
|
} // apply transition data to child
|
// use getRealChild() to ignore abstract components e.g. keep-alive
|
|
|
var child = getRealChild(rawChild);
|
/* istanbul ignore if */
|
|
if (!child) {
|
return rawChild;
|
}
|
|
if (this._leaving) {
|
return placeholder(h, rawChild);
|
} // ensure a key that is unique to the vnode type and to this transition
|
// component instance. This key will be used to remove pending leaving nodes
|
// during entering.
|
|
|
var id = "__transition-" + this._uid + "-";
|
child.key = child.key == null ? child.isComment ? id + 'comment' : id + child.tag : isPrimitive(child.key) ? String(child.key).indexOf(id) === 0 ? child.key : id + child.key : child.key;
|
var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
|
var oldRawChild = this._vnode;
|
var oldChild = getRealChild(oldRawChild); // mark v-show
|
// so that the transition module can hand over the control to the directive
|
|
if (child.data.directives && child.data.directives.some(isVShowDirective)) {
|
child.data.show = true;
|
}
|
|
if (oldChild && oldChild.data && !isSameChild(child, oldChild) && !isAsyncPlaceholder(oldChild) && // #6687 component root is a comment node
|
!(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)) {
|
// replace old child transition data with fresh one
|
// important for dynamic transitions!
|
var oldData = oldChild.data.transition = extend({}, data); // handle transition mode
|
|
if (mode === 'out-in') {
|
// return placeholder node and queue update when leave finishes
|
this._leaving = true;
|
mergeVNodeHook(oldData, 'afterLeave', function () {
|
this$1._leaving = false;
|
this$1.$forceUpdate();
|
});
|
return placeholder(h, rawChild);
|
} else if (mode === 'in-out') {
|
if (isAsyncPlaceholder(child)) {
|
return oldRawChild;
|
}
|
|
var delayedLeave;
|
|
var performLeave = function performLeave() {
|
delayedLeave();
|
};
|
|
mergeVNodeHook(data, 'afterEnter', performLeave);
|
mergeVNodeHook(data, 'enterCancelled', performLeave);
|
mergeVNodeHook(oldData, 'delayLeave', function (leave) {
|
delayedLeave = leave;
|
});
|
}
|
}
|
|
return rawChild;
|
}
|
};
|
/* */
|
|
var props = extend({
|
tag: String,
|
moveClass: String
|
}, transitionProps);
|
delete props.mode;
|
var TransitionGroup = {
|
props: props,
|
beforeMount: function beforeMount() {
|
var this$1 = this;
|
var update = this._update;
|
|
this._update = function (vnode, hydrating) {
|
var restoreActiveInstance = setActiveInstance(this$1); // force removing pass
|
|
this$1.__patch__(this$1._vnode, this$1.kept, false, // hydrating
|
true // removeOnly (!important, avoids unnecessary moves)
|
);
|
|
this$1._vnode = this$1.kept;
|
restoreActiveInstance();
|
update.call(this$1, vnode, hydrating);
|
};
|
},
|
render: function render(h) {
|
var tag = this.tag || this.$vnode.data.tag || 'span';
|
var map = Object.create(null);
|
var prevChildren = this.prevChildren = this.children;
|
var rawChildren = this.$slots.default || [];
|
var children = this.children = [];
|
var transitionData = extractTransitionData(this);
|
|
for (var i = 0; i < rawChildren.length; i++) {
|
var c = rawChildren[i];
|
|
if (c.tag) {
|
if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
|
children.push(c);
|
map[c.key] = c;
|
(c.data || (c.data = {})).transition = transitionData;
|
} else if (true) {
|
var opts = c.componentOptions;
|
var name = opts ? opts.Ctor.options.name || opts.tag || '' : c.tag;
|
warn("<transition-group> children must be keyed: <" + name + ">");
|
}
|
}
|
}
|
|
if (prevChildren) {
|
var kept = [];
|
var removed = [];
|
|
for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
|
var c$1 = prevChildren[i$1];
|
c$1.data.transition = transitionData;
|
c$1.data.pos = c$1.elm.getBoundingClientRect();
|
|
if (map[c$1.key]) {
|
kept.push(c$1);
|
} else {
|
removed.push(c$1);
|
}
|
}
|
|
this.kept = h(tag, null, kept);
|
this.removed = removed;
|
}
|
|
return h(tag, null, children);
|
},
|
updated: function updated() {
|
var children = this.prevChildren;
|
var moveClass = this.moveClass || (this.name || 'v') + '-move';
|
|
if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
|
return;
|
} // we divide the work into three loops to avoid mixing DOM reads and writes
|
// in each iteration - which helps prevent layout thrashing.
|
|
|
children.forEach(callPendingCbs);
|
children.forEach(recordPosition);
|
children.forEach(applyTranslation); // force reflow to put everything in position
|
// assign to this to avoid being removed in tree-shaking
|
// $flow-disable-line
|
|
this._reflow = document.body.offsetHeight;
|
children.forEach(function (c) {
|
if (c.data.moved) {
|
var el = c.elm;
|
var s = el.style;
|
addTransitionClass(el, moveClass);
|
s.transform = s.WebkitTransform = s.transitionDuration = '';
|
el.addEventListener(transitionEndEvent, el._moveCb = function cb(e) {
|
if (e && e.target !== el) {
|
return;
|
}
|
|
if (!e || /transform$/.test(e.propertyName)) {
|
el.removeEventListener(transitionEndEvent, cb);
|
el._moveCb = null;
|
removeTransitionClass(el, moveClass);
|
}
|
});
|
}
|
});
|
},
|
methods: {
|
hasMove: function hasMove(el, moveClass) {
|
/* istanbul ignore if */
|
if (!hasTransition) {
|
return false;
|
}
|
/* istanbul ignore if */
|
|
|
if (this._hasMove) {
|
return this._hasMove;
|
} // Detect whether an element with the move class applied has
|
// CSS transitions. Since the element may be inside an entering
|
// transition at this very moment, we make a clone of it and remove
|
// all other transition classes applied to ensure only the move class
|
// is applied.
|
|
|
var clone = el.cloneNode();
|
|
if (el._transitionClasses) {
|
el._transitionClasses.forEach(function (cls) {
|
removeClass(clone, cls);
|
});
|
}
|
|
addClass(clone, moveClass);
|
clone.style.display = 'none';
|
this.$el.appendChild(clone);
|
var info = getTransitionInfo(clone);
|
this.$el.removeChild(clone);
|
return this._hasMove = info.hasTransform;
|
}
|
}
|
};
|
|
function callPendingCbs(c) {
|
/* istanbul ignore if */
|
if (c.elm._moveCb) {
|
c.elm._moveCb();
|
}
|
/* istanbul ignore if */
|
|
|
if (c.elm._enterCb) {
|
c.elm._enterCb();
|
}
|
}
|
|
function recordPosition(c) {
|
c.data.newPos = c.elm.getBoundingClientRect();
|
}
|
|
function applyTranslation(c) {
|
var oldPos = c.data.pos;
|
var newPos = c.data.newPos;
|
var dx = oldPos.left - newPos.left;
|
var dy = oldPos.top - newPos.top;
|
|
if (dx || dy) {
|
c.data.moved = true;
|
var s = c.elm.style;
|
s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
|
s.transitionDuration = '0s';
|
}
|
}
|
|
var platformComponents = {
|
Transition: Transition,
|
TransitionGroup: TransitionGroup
|
};
|
/* */
|
// install platform specific utils
|
|
Vue.config.mustUseProp = mustUseProp;
|
Vue.config.isReservedTag = isReservedTag;
|
Vue.config.isReservedAttr = isReservedAttr;
|
Vue.config.getTagNamespace = getTagNamespace;
|
Vue.config.isUnknownElement = isUnknownElement; // install platform runtime directives & components
|
|
extend(Vue.options.directives, platformDirectives);
|
extend(Vue.options.components, platformComponents); // install platform patch function
|
|
Vue.prototype.__patch__ = inBrowser ? patch : noop;
|
|
Vue.prototype.__call_hook = function (hook, args) {
|
var vm = this; // #7573 disable dep collection when invoking lifecycle hooks
|
|
pushTarget();
|
var handlers = vm.$options[hook];
|
var info = hook + " hook";
|
var ret;
|
|
if (handlers) {
|
for (var i = 0, j = handlers.length; i < j; i++) {
|
ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
|
}
|
}
|
|
if (vm._hasHookEvent) {
|
vm.$emit('hook:' + hook, args);
|
}
|
|
popTarget();
|
return ret;
|
}; // public mount method
|
|
|
Vue.prototype.$mount = function (el, hydrating) {
|
el = el && inBrowser ? query(el) : undefined;
|
return mountComponent(this, el, hydrating);
|
}; // devtools global hook
|
|
/* istanbul ignore next */
|
|
|
if (inBrowser) {
|
setTimeout(function () {
|
if (config.devtools) {
|
if (devtools) {
|
devtools.emit('init', Vue);
|
} else if (true) {
|
console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' + 'https://github.com/vuejs/vue-devtools');
|
}
|
}
|
|
if ( true && config.productionTip !== false && typeof console !== 'undefined') {
|
console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" + "Make sure to turn on production mode when deploying for production.\n" + "See more tips at https://vuejs.org/guide/deployment.html");
|
}
|
}, 0);
|
}
|
/* */
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (Vue);
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19)))
|
|
/***/ }),
|
/* 10 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* unused harmony export i18n */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return t; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return i18nMixin; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setLocale; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getLocale; });
|
/* unused harmony export initAppLocale */
|
/* unused harmony export I18N_JSON_DELIMITERS */
|
/* unused harmony export formatI18n */
|
/* unused harmony export defineI18nProperties */
|
/* unused harmony export defineI18nProperty */
|
/* unused harmony export initNavigationBarI18n */
|
/* unused harmony export initPullToRefreshI18n */
|
/* unused harmony export initTabBarI18n */
|
/* unused harmony export initI18n */
|
/* harmony import */ var _dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76);
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17);
|
/* harmony import */ var _en_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99);
|
var _en_json__WEBPACK_IMPORTED_MODULE_3___namespace = /*#__PURE__*/__webpack_require__.t(99, 1);
|
/* harmony import */ var _es_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(100);
|
var _es_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(100, 1);
|
/* harmony import */ var _fr_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(101);
|
var _fr_json__WEBPACK_IMPORTED_MODULE_5___namespace = /*#__PURE__*/__webpack_require__.t(101, 1);
|
/* harmony import */ var _zh_Hans_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(102);
|
var _zh_Hans_json__WEBPACK_IMPORTED_MODULE_6___namespace = /*#__PURE__*/__webpack_require__.t(102, 1);
|
/* harmony import */ var _zh_Hant_json__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(103);
|
var _zh_Hant_json__WEBPACK_IMPORTED_MODULE_7___namespace = /*#__PURE__*/__webpack_require__.t(103, 1);
|
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); }
|
|
|
|
|
|
|
|
|
|
var messages = {
|
en: _en_json__WEBPACK_IMPORTED_MODULE_3__,
|
es: _es_json__WEBPACK_IMPORTED_MODULE_4__,
|
fr: _fr_json__WEBPACK_IMPORTED_MODULE_5__,
|
'zh-Hans': _zh_Hans_json__WEBPACK_IMPORTED_MODULE_6__,
|
'zh-Hant': _zh_Hant_json__WEBPACK_IMPORTED_MODULE_7__
|
};
|
var locale;
|
|
if (false) {} else if (true) {
|
if ((typeof weex === "undefined" ? "undefined" : _typeof(weex)) === 'object') {
|
locale = weex.requireModule('plus').getLanguage();
|
} else {
|
locale = '';
|
}
|
} else {}
|
|
var i18n = Object(_dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__[/* initVueI18n */ "a"])(locale, true ? messages : undefined);
|
var t = i18n.t;
|
var i18nMixin = i18n.mixin = {
|
beforeCreate: function beforeCreate() {
|
var _this = this;
|
|
var unwatch = i18n.i18n.watchLocale(function () {
|
_this.$forceUpdate();
|
});
|
this.$once('hook:beforeDestroy', function () {
|
unwatch();
|
});
|
},
|
methods: {
|
$$t: function $$t(key, values) {
|
return t(key, values);
|
}
|
}
|
};
|
var setLocale = i18n.setLocale;
|
var getLocale = i18n.getLocale;
|
function initAppLocale(Vue, appVm, locale) {
|
var state = Vue.observable({
|
locale: locale || i18n.getLocale()
|
});
|
var localeWatchers = [];
|
|
appVm.$watchLocale = function (fn) {
|
localeWatchers.push(fn);
|
};
|
|
Object.defineProperty(appVm, '$locale', {
|
get: function get() {
|
return state.locale;
|
},
|
set: function set(v) {
|
state.locale = v;
|
localeWatchers.forEach(function (watch) {
|
return watch(v);
|
});
|
}
|
});
|
}
|
var I18N_JSON_DELIMITERS = ['%', '%'];
|
|
function getLocaleMessage() {
|
var locale = uni.getLocale();
|
var locales = __uniConfig.locales;
|
return locales[locale] || locales[__uniConfig.fallbackLocale] || locales.en || {};
|
}
|
|
function formatI18n(message) {
|
if (Object(_dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__[/* isI18nStr */ "b"])(message, I18N_JSON_DELIMITERS)) {
|
return i18n.f(message, getLocaleMessage(), I18N_JSON_DELIMITERS);
|
}
|
|
return message;
|
}
|
|
function resolveJsonObj(jsonObj, names) {
|
if (names.length === 1) {
|
if (jsonObj) {
|
var value = jsonObj[names[0]];
|
|
if (Object(uni_shared__WEBPACK_IMPORTED_MODULE_1__[/* isStr */ "h"])(value) && Object(_dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__[/* isI18nStr */ "b"])(value, I18N_JSON_DELIMITERS)) {
|
return jsonObj;
|
}
|
}
|
|
return;
|
}
|
|
var name = names.shift();
|
return resolveJsonObj(jsonObj && jsonObj[name], names);
|
}
|
|
function defineI18nProperties(obj, names) {
|
return names.map(function (name) {
|
return defineI18nProperty(obj, name);
|
});
|
}
|
function defineI18nProperty(obj, names) {
|
var jsonObj = resolveJsonObj(obj, names);
|
|
if (!jsonObj) {
|
return false;
|
}
|
|
var prop = names[names.length - 1];
|
var value = jsonObj[prop];
|
Object.defineProperty(jsonObj, prop, {
|
get: function get() {
|
return formatI18n(value);
|
},
|
set: function set(v) {
|
value = v;
|
}
|
});
|
return true;
|
}
|
|
function isEnableLocale() {
|
return __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
|
}
|
|
function initNavigationBarI18n(navigationBar) {
|
if (isEnableLocale()) {
|
return defineI18nProperties(navigationBar, [['titleText'], ['searchInput', 'placeholder']]);
|
}
|
}
|
function initPullToRefreshI18n(pullToRefresh) {
|
if (isEnableLocale()) {
|
var CAPTION = 'caption';
|
return defineI18nProperties(pullToRefresh, [['contentdown', CAPTION], ['contentover', CAPTION], ['contentrefresh', CAPTION]]);
|
}
|
}
|
function initTabBarI18n(tabBar) {
|
if (isEnableLocale()) {
|
tabBar.list.forEach(function (item) {
|
defineI18nProperty(item, ['text']);
|
});
|
}
|
|
return tabBar;
|
}
|
function initI18n() {
|
var localeKeys = Object.keys(__uniConfig.locales || {});
|
|
if (localeKeys.length) {
|
localeKeys.forEach(function (locale) {
|
return i18n.add(locale, __uniConfig.locales[locale]);
|
});
|
}
|
}
|
|
/***/ }),
|
/* 11 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
|
var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
|
(typeof Uint16Array !== 'undefined') &&
|
(typeof Int32Array !== 'undefined');
|
|
function _has(obj, key) {
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
}
|
|
exports.assign = function (obj /*from1, from2, from3, ...*/) {
|
var sources = Array.prototype.slice.call(arguments, 1);
|
while (sources.length) {
|
var source = sources.shift();
|
if (!source) { continue; }
|
|
if (typeof source !== 'object') {
|
throw new TypeError(source + 'must be non-object');
|
}
|
|
for (var p in source) {
|
if (_has(source, p)) {
|
obj[p] = source[p];
|
}
|
}
|
}
|
|
return obj;
|
};
|
|
|
// reduce buffer size, avoiding mem copy
|
exports.shrinkBuf = function (buf, size) {
|
if (buf.length === size) { return buf; }
|
if (buf.subarray) { return buf.subarray(0, size); }
|
buf.length = size;
|
return buf;
|
};
|
|
|
var fnTyped = {
|
arraySet: function (dest, src, src_offs, len, dest_offs) {
|
if (src.subarray && dest.subarray) {
|
dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
|
return;
|
}
|
// Fallback to ordinary array
|
for (var i = 0; i < len; i++) {
|
dest[dest_offs + i] = src[src_offs + i];
|
}
|
},
|
// Join array of chunks to single array.
|
flattenChunks: function (chunks) {
|
var i, l, len, pos, chunk, result;
|
|
// calculate data length
|
len = 0;
|
for (i = 0, l = chunks.length; i < l; i++) {
|
len += chunks[i].length;
|
}
|
|
// join chunks
|
result = new Uint8Array(len);
|
pos = 0;
|
for (i = 0, l = chunks.length; i < l; i++) {
|
chunk = chunks[i];
|
result.set(chunk, pos);
|
pos += chunk.length;
|
}
|
|
return result;
|
}
|
};
|
|
var fnUntyped = {
|
arraySet: function (dest, src, src_offs, len, dest_offs) {
|
for (var i = 0; i < len; i++) {
|
dest[dest_offs + i] = src[src_offs + i];
|
}
|
},
|
// Join array of chunks to single array.
|
flattenChunks: function (chunks) {
|
return [].concat.apply([], chunks);
|
}
|
};
|
|
|
// Enable/Disable typed arrays use, for testing
|
//
|
exports.setTyped = function (on) {
|
if (on) {
|
exports.Buf8 = Uint8Array;
|
exports.Buf16 = Uint16Array;
|
exports.Buf32 = Int32Array;
|
exports.assign(exports, fnTyped);
|
} else {
|
exports.Buf8 = Array;
|
exports.Buf16 = Array;
|
exports.Buf32 = Array;
|
exports.assign(exports, fnUntyped);
|
}
|
};
|
|
exports.setTyped(TYPED_OK);
|
|
|
/***/ }),
|
/* 12 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
var addListenerToElement = function addListenerToElement(element, type, callback, capture) {
|
// 暂时忽略 capture
|
element.addEventListener(type, function ($event) {
|
if (typeof callback === 'function') {
|
if (callback($event) === false) {
|
$event.preventDefault();
|
$event.stopPropagation();
|
}
|
}
|
}, {
|
capture: capture,
|
passive: false
|
});
|
};
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
beforeDestroy: function beforeDestroy() {
|
document.removeEventListener('mousemove', this.__mouseMoveEventListener);
|
document.removeEventListener('mouseup', this.__mouseUpEventListener);
|
},
|
methods: {
|
touchtrack: function touchtrack(element, method, useCancel) {
|
var _this = this;
|
|
var self = this;
|
var x0 = 0;
|
var y0 = 0;
|
var x1 = 0;
|
var y1 = 0;
|
|
var fn = function fn($event, state, x, y) {
|
if (self[method]({
|
target: $event.target,
|
currentTarget: $event.currentTarget,
|
preventDefault: $event.preventDefault.bind($event),
|
stopPropagation: $event.stopPropagation.bind($event),
|
touches: $event.touches,
|
changedTouches: $event.changedTouches,
|
detail: {
|
state: state,
|
x: x,
|
y: y,
|
dx: x - x0,
|
dy: y - y0,
|
ddx: x - x1,
|
ddy: y - y1,
|
timeStamp: $event.timeStamp
|
}
|
}) === false) {
|
return false;
|
}
|
};
|
|
var $eventOld = null;
|
var hasClickListenerOld;
|
var hasTouchStart;
|
var hasMouseDown;
|
addListenerToElement(element, 'touchstart', function ($event) {
|
hasTouchStart = true;
|
|
if ($event.touches.length === 1 && !$eventOld) {
|
$eventOld = $event;
|
x0 = x1 = $event.touches[0].pageX;
|
y0 = y1 = $event.touches[0].pageY;
|
return fn($event, 'start', x0, y0);
|
}
|
});
|
addListenerToElement(element, 'mousedown', function ($event) {
|
hasMouseDown = true;
|
|
if (!hasTouchStart && !$eventOld) {
|
// TODO touches changedTouches
|
$eventOld = $event;
|
x0 = x1 = $event.pageX;
|
y0 = y1 = $event.pageY;
|
return fn($event, 'start', x0, y0);
|
}
|
});
|
addListenerToElement(element, 'touchmove', function ($event) {
|
if ($event.touches.length === 1 && $eventOld) {
|
var res = fn($event, 'move', $event.touches[0].pageX, $event.touches[0].pageY);
|
x1 = $event.touches[0].pageX;
|
y1 = $event.touches[0].pageY;
|
return res;
|
}
|
}); // 阻止点击事件传播,处理拖拽和点击冲突,鼠标移动则添加监听,停止移动则移除监听
|
|
var clickEventListener = this.__clickEventListener = function ($event) {
|
$event.preventDefault();
|
$event.stopPropagation();
|
};
|
|
var mouseMoveEventListener = this.__mouseMoveEventListener = function ($event) {
|
if (!hasTouchStart && hasMouseDown && $eventOld) {
|
// 存在鼠标移动,则在 document 上添加点击监听(好处是不用管具体使用拖拽的是什么元素)
|
if (!hasClickListenerOld && (Math.abs(x1 - x0) > 2 || Math.abs(y1 - y0) > 2)) {
|
document.addEventListener('click', clickEventListener, true);
|
hasClickListenerOld = true;
|
} // TODO target currentTarget touches changedTouches
|
|
|
var res = fn($event, 'move', $event.pageX, $event.pageY);
|
x1 = $event.pageX;
|
y1 = $event.pageY;
|
return res;
|
}
|
};
|
|
document.addEventListener('mousemove', mouseMoveEventListener);
|
addListenerToElement(element, 'touchend', function ($event) {
|
if ($event.touches.length === 0 && $eventOld) {
|
hasTouchStart = false;
|
$eventOld = null;
|
return fn($event, 'end', $event.changedTouches[0].pageX, $event.changedTouches[0].pageY);
|
}
|
});
|
|
var mouseUpEventListener = this.__mouseUpEventListener = function ($event) {
|
hasMouseDown = false;
|
|
if (!hasTouchStart && $eventOld) {
|
// 鼠标抬起,存在监听,则 mouseup 结束后移除就监听事件
|
if (hasClickListenerOld) {
|
setTimeout(function () {
|
document.removeEventListener('click', _this.__clickEventListener, true);
|
hasClickListenerOld = false;
|
}, 0);
|
} // TODO target currentTarget touches changedTouches
|
|
|
$eventOld = null;
|
return fn($event, 'end', $event.pageX, $event.pageY);
|
}
|
};
|
|
document.addEventListener('mouseup', mouseUpEventListener);
|
addListenerToElement(element, 'touchcancel', function ($event) {
|
if ($eventOld) {
|
hasTouchStart = false;
|
var $eventTemp = $eventOld;
|
$eventOld = null;
|
return fn($event, useCancel ? 'cancel' : 'end', $eventTemp.touches[0].pageX, $eventTemp.touches[0].pageY);
|
}
|
});
|
}
|
}
|
});
|
|
/***/ }),
|
/* 13 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getRealPath; });
|
|
// CONCATENATED MODULE: ./src/core/helpers/get-real-route.js
|
function getRealRoute(fromRoute, toRoute) {
|
if (!toRoute) {
|
toRoute = fromRoute;
|
|
if (toRoute.indexOf('/') === 0) {
|
return toRoute;
|
}
|
|
var pages = getCurrentPages();
|
|
if (pages.length) {
|
fromRoute = pages[pages.length - 1].$page.route;
|
} else {
|
fromRoute = '';
|
}
|
} else {
|
if (toRoute.indexOf('/') === 0) {
|
return toRoute;
|
}
|
}
|
|
if (toRoute.indexOf('./') === 0) {
|
return getRealRoute(fromRoute, toRoute.substr(2));
|
}
|
|
var toRouteArray = toRoute.split('/');
|
var toRouteLength = toRouteArray.length;
|
var i = 0;
|
|
for (; i < toRouteLength && toRouteArray[i] === '..'; i++) {// noop
|
}
|
|
toRouteArray.splice(0, i);
|
toRoute = toRouteArray.join('/');
|
var fromRouteArray = fromRoute.length > 0 ? fromRoute.split('/') : [];
|
fromRouteArray.splice(fromRouteArray.length - i - 1, i + 1);
|
return '/' + fromRouteArray.concat(toRouteArray).join('/');
|
}
|
// CONCATENATED MODULE: ./src/platforms/app-plus/helpers/get-real-path.js
|
|
var SCHEME_RE = /^([a-z-]+:)?\/\//i;
|
var DATA_RE = /^data:.*,.*/; // 处理 Android 平台解压与非解压模式下获取的路径不一致的情况
|
|
function handleLocalPath(filePath) {
|
return plus.io.convertLocalFileSystemURL(filePath).replace(/^\/?apps\//, '/android_asset/apps/').replace(/\/$/, '');
|
}
|
|
var wwwPath;
|
|
function addBase(filePath) {
|
if (!wwwPath) {
|
// 需要时,初始化一次,外部直接初始化,需要等 plusready
|
wwwPath = 'file://' + handleLocalPath('_www') + '/';
|
}
|
|
return wwwPath + filePath;
|
}
|
|
function getRealPath(filePath) {
|
if (filePath.indexOf('/') === 0) {
|
if (filePath.indexOf('//') === 0) {
|
return 'https:' + filePath;
|
} // 平台绝对路径 安卓、iOS
|
|
|
if (filePath.startsWith('/storage/') || filePath.startsWith('/sdcard/') || filePath.includes('/Containers/Data/Application/')) {
|
return 'file://' + filePath;
|
}
|
|
return addBase(filePath.substr(1));
|
} // 网络资源或base64
|
|
|
if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
|
return filePath;
|
} // _do=>_doc,_documents,_downloads
|
|
|
if (filePath.indexOf('_www') === 0 || filePath.indexOf('_do') === 0) {
|
return 'file://' + handleLocalPath(filePath);
|
}
|
|
var pages = getCurrentPages();
|
|
if (pages.length) {
|
return addBase(getRealRoute(pages[pages.length - 1].$page.route, filePath).substr(1));
|
}
|
|
return filePath;
|
}
|
|
/***/ }),
|
/* 14 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindowOffset; });
|
function getWindowOffset() {
|
return {
|
top: 0,
|
bottom: 0,
|
left: 0,
|
right: 0
|
};
|
}
|
|
/***/ }),
|
/* 15 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return pixelRatio; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return wrapper; });
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
var pixelRatio = function () {
|
var canvas = document.createElement('canvas');
|
canvas.height = canvas.width = 0;
|
var context = canvas.getContext('2d');
|
var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
|
return (window.devicePixelRatio || 1) / backingStore;
|
}();
|
|
var forEach = function forEach(obj, func) {
|
for (var key in obj) {
|
if (Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "e"])(obj, key)) {
|
func(obj[key], key);
|
}
|
}
|
};
|
|
var ratioArgs = {
|
fillRect: 'all',
|
clearRect: 'all',
|
strokeRect: 'all',
|
moveTo: 'all',
|
lineTo: 'all',
|
arc: [0, 1, 2],
|
arcTo: 'all',
|
bezierCurveTo: 'all',
|
isPointinPath: 'all',
|
isPointinStroke: 'all',
|
quadraticCurveTo: 'all',
|
rect: 'all',
|
translate: 'all',
|
createRadialGradient: 'all',
|
createLinearGradient: 'all',
|
setTransform: [4, 5]
|
};
|
var proto = CanvasRenderingContext2D.prototype;
|
|
proto.drawImageByCanvas = function (_super) {
|
return function (canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh, isScale) {
|
if (!this.__hidpi__) {
|
return _super.apply(this, arguments);
|
}
|
|
srcx *= pixelRatio;
|
srcy *= pixelRatio;
|
srcw *= pixelRatio;
|
srch *= pixelRatio;
|
desx *= pixelRatio;
|
desy *= pixelRatio;
|
desw = isScale ? desw * pixelRatio : desw;
|
desh = isScale ? desh * pixelRatio : desh;
|
|
_super.call(this, canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh);
|
};
|
}(proto.drawImage);
|
|
if (pixelRatio !== 1) {
|
forEach(ratioArgs, function (value, key) {
|
proto[key] = function (_super) {
|
return function () {
|
if (!this.__hidpi__) {
|
return _super.apply(this, arguments);
|
}
|
|
var args = Array.prototype.slice.call(arguments);
|
|
if (value === 'all') {
|
args = args.map(function (a) {
|
return a * pixelRatio;
|
});
|
} else if (Array.isArray(value)) {
|
for (var i = 0; i < value.length; i++) {
|
args[value[i]] *= pixelRatio;
|
}
|
}
|
|
return _super.apply(this, args);
|
};
|
}(proto[key]);
|
});
|
|
proto.stroke = function (_super) {
|
return function () {
|
if (!this.__hidpi__) {
|
return _super.apply(this, arguments);
|
}
|
|
this.lineWidth *= pixelRatio;
|
|
_super.apply(this, arguments);
|
|
this.lineWidth /= pixelRatio;
|
};
|
}(proto.stroke);
|
|
proto.fillText = function (_super) {
|
return function () {
|
if (!this.__hidpi__) {
|
return _super.apply(this, arguments);
|
}
|
|
var args = Array.prototype.slice.call(arguments);
|
args[1] *= pixelRatio;
|
args[2] *= pixelRatio; // Safari 重新设置部分属性会导致其他值恢复默认,需获取原始值
|
|
var font = this.__font__ || this.font;
|
this.font = font.replace(/(\d+\.?\d*)(px|em|rem|pt)/g, function (w, m, u) {
|
return m * pixelRatio + u;
|
});
|
|
_super.apply(this, args);
|
|
this.font = font;
|
};
|
}(proto.fillText);
|
|
proto.strokeText = function (_super) {
|
return function () {
|
if (!this.__hidpi__) {
|
return _super.apply(this, arguments);
|
}
|
|
var args = Array.prototype.slice.call(arguments);
|
args[1] *= pixelRatio; // x
|
|
args[2] *= pixelRatio; // y
|
// Safari 重新设置部分属性会导致其他值恢复默认,需获取原始值
|
|
var font = this.__font__ || this.font;
|
this.font = font.replace(/(\d+\.?\d*)(px|em|rem|pt)/g, function (w, m, u) {
|
return m * pixelRatio + u;
|
});
|
|
_super.apply(this, args);
|
|
this.font = font;
|
};
|
}(proto.strokeText);
|
|
proto.drawImage = function (_super) {
|
return function () {
|
if (!this.__hidpi__) {
|
return _super.apply(this, arguments);
|
}
|
|
this.scale(pixelRatio, pixelRatio);
|
|
_super.apply(this, arguments);
|
|
this.scale(1 / pixelRatio, 1 / pixelRatio);
|
};
|
}(proto.drawImage);
|
}
|
|
function wrapper(canvas) {
|
canvas.width = canvas.offsetWidth * pixelRatio;
|
canvas.height = canvas.offsetHeight * pixelRatio;
|
canvas.__hidpi__ = true; // 避免低版本安卓上 context 实例被回收
|
|
canvas.__context2d__ = canvas.getContext('2d');
|
canvas.__context2d__.__hidpi__ = true;
|
}
|
|
/***/ }),
|
/* 16 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// 暂不提供通知所有
|
// function broadcast (componentName, eventName, ...params) {
|
// this.$children.forEach(child => {
|
// const name = child.$options.name && child.$options.name.substr(1)
|
// if (~componentName.indexOf(name)) {
|
// child.$emit.apply(child, [eventName].concat(params))
|
// } else {
|
// broadcast.apply(child, [componentName, eventName].concat([params]))
|
// }
|
// })
|
// }
|
function broadcast(componentName, eventName) {
|
var children = this.$children;
|
var len = children.length;
|
|
for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
params[_key - 2] = arguments[_key];
|
}
|
|
for (var i = 0; i < len; i++) {
|
var child = children[i];
|
var name = child.$options.name && child.$options.name.substr(4);
|
|
if (~componentName.indexOf(name)) {
|
child.$emit.apply(child, [eventName].concat(params));
|
return false;
|
} else {
|
if (broadcast.apply(child, [componentName, eventName].concat([params])) === false) {
|
return false;
|
}
|
}
|
}
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
methods: {
|
$dispatch: function $dispatch(componentName, eventName) {
|
if (typeof componentName === 'string') {
|
componentName = [componentName];
|
}
|
|
var parent = this.$parent || this.$root;
|
var name = parent.$options.name && parent.$options.name.substr(4);
|
|
while (parent && (!name || !~componentName.indexOf(name))) {
|
parent = parent.$parent;
|
|
if (parent) {
|
name = parent.$options.name && parent.$options.name.substr(4);
|
}
|
}
|
|
if (parent) {
|
for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
params[_key2 - 2] = arguments[_key2];
|
}
|
|
parent.$emit.apply(parent, [eventName].concat(params));
|
}
|
},
|
$broadcast: function $broadcast(componentName, eventName) {
|
if (typeof componentName === 'string') {
|
componentName = [componentName];
|
}
|
|
for (var _len3 = arguments.length, params = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
params[_key3 - 2] = arguments[_key3];
|
}
|
|
broadcast.apply(this, [componentName, eventName].concat(params));
|
}
|
}
|
});
|
|
/***/ }),
|
/* 17 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NAVBAR_HEIGHT; });
|
/* unused harmony export TABBAR_HEIGHT */
|
/* unused harmony export RESPONSIVE_MIN_WIDTH */
|
/* unused harmony export DC_LOCALE */
|
var NAVBAR_HEIGHT = 44;
|
var TABBAR_HEIGHT = 50; // 576:landscape phones,768:tablets,992:desktops,1200:large desktops
|
|
var RESPONSIVE_MIN_WIDTH = 768;
|
var DC_LOCALE = '__DC_LOCALE';
|
|
/***/ }),
|
/* 18 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ processEvent; });
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ initEvents; });
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// EXTERNAL MODULE: ./src/core/helpers/index.js
|
var helpers = __webpack_require__(8);
|
|
// CONCATENATED MODULE: ./src/core/helpers/patch.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); }
|
|
|
/**
|
* mpvue event
|
*/
|
|
function wrapperMPEvent(event) {
|
event.mp = Object.assign({
|
'@warning': 'mp is deprecated'
|
}, event);
|
event._processed = true;
|
return event;
|
}
|
/**
|
* app-plus titleNView
|
*/
|
|
function mergeTitleNView(navigationBar, titleNView) {
|
if (Object(shared["g" /* isPlainObject */])(titleNView)) {
|
if (Object(shared["e" /* hasOwn */])(titleNView, 'backgroundColor')) {
|
navigationBar.backgroundColor = titleNView.backgroundColor;
|
}
|
|
if (Object(shared["e" /* hasOwn */])(titleNView, 'buttons')) {
|
navigationBar.buttons = titleNView.buttons;
|
}
|
|
if (Object(shared["e" /* hasOwn */])(titleNView, 'titleColor')) {
|
navigationBar.textColor = titleNView.titleColor;
|
}
|
|
if (Object(shared["e" /* hasOwn */])(titleNView, 'titleText')) {
|
navigationBar.titleText = titleNView.titleText;
|
}
|
|
if (Object(shared["e" /* hasOwn */])(titleNView, 'titleSize')) {
|
navigationBar.titleSize = titleNView.titleSize;
|
}
|
|
if (Object(shared["e" /* hasOwn */])(titleNView, 'type')) {
|
navigationBar.type = titleNView.type;
|
}
|
|
if (Object(shared["e" /* hasOwn */])(titleNView, 'searchInput') && _typeof(titleNView.searchInput) === 'object') {
|
navigationBar.searchInput = Object.assign({
|
autoFocus: false,
|
align: 'center',
|
color: '#000000',
|
backgroundColor: 'rgba(255,255,255,0.5)',
|
borderRadius: '0px',
|
placeholder: '',
|
placeholderColor: '#CCCCCC',
|
disabled: false
|
}, titleNView.searchInput);
|
}
|
}
|
|
return navigationBar;
|
}
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-window-offset.js
|
var get_window_offset = __webpack_require__(14);
|
|
// CONCATENATED MODULE: ./src/core/view/plugins/events.js
|
|
|
|
|
|
function processTarget(target, detail) {
|
var checkShadowRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
var res = {
|
id: target.id,
|
offsetLeft: target.offsetLeft,
|
offsetTop: target.offsetTop,
|
dataset: Object(helpers["a" /* getTargetDataset */])(target)
|
};
|
|
if (detail) {
|
Object.assign(res, detail);
|
}
|
|
return res;
|
}
|
|
function processTouches(touches) {
|
if (touches) {
|
var res = [];
|
|
var _getWindowOffset = Object(get_window_offset["a" /* default */])(),
|
top = _getWindowOffset.top;
|
|
for (var i = 0; i < touches.length; i++) {
|
var touch = touches[i];
|
res.push({
|
identifier: touch.identifier,
|
pageX: touch.pageX,
|
pageY: touch.pageY - top,
|
clientX: touch.clientX,
|
clientY: touch.clientY - top,
|
force: touch.force || 0
|
});
|
}
|
|
return res;
|
}
|
|
return [];
|
}
|
|
function processEvent(name) {
|
var $event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
var target = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
var currentTarget = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
if ($event._processed) {
|
$event.type = detail.type || name;
|
return $event;
|
} // fixed 针对小程序 click(tap)事件,补充事件详情
|
|
|
if (name === 'click') {
|
var _getWindowOffset2 = Object(get_window_offset["a" /* default */])(),
|
top = _getWindowOffset2.top;
|
|
detail = {
|
x: $event.x,
|
y: $event.y - top
|
};
|
$event.touches = $event.changedTouches = [{
|
force: 1,
|
identifier: 0,
|
clientX: $event.clientX,
|
clientY: $event.clientY,
|
pageX: $event.pageX,
|
pageY: $event.pageY
|
}];
|
} // fixed mp-vue
|
|
|
var ret = wrapperMPEvent({
|
type: detail.type || name,
|
timeStamp: $event.timeStamp || 0,
|
detail: detail,
|
target: processTarget(target, detail),
|
currentTarget: processTarget(currentTarget, false, true),
|
// 只处理系统事件
|
touches: $event instanceof Event || $event instanceof CustomEvent ? processTouches($event.touches) : $event.touches,
|
changedTouches: $event instanceof Event || $event instanceof CustomEvent ? processTouches($event.changedTouches) : $event.changedTouches,
|
preventDefault: function preventDefault() {},
|
stopPropagation: function stopPropagation() {}
|
});
|
|
if (name.startsWith('mouse')) {
|
var _getWindowOffset3 = Object(get_window_offset["a" /* default */])(),
|
_top = _getWindowOffset3.top;
|
|
ret.pageX = $event.pageX;
|
ret.pageY = $event.pageY - _top;
|
ret.clientX = $event.clientX;
|
ret.clientY = $event.clientY - _top;
|
}
|
|
if (true) {
|
var nid = currentTarget.getAttribute('_i');
|
ret.options = {
|
nid: nid
|
}; // 保留原始 currentTarget 方便后续对比
|
|
ret.$origCurrentTarget = currentTarget;
|
}
|
|
return ret;
|
}
|
var LONGPRESS_TIMEOUT = 350;
|
var LONGPRESS_THRESHOLD = 10;
|
var passiveOptions = shared["k" /* supportsPassive */] ? {
|
passive: true
|
} : false;
|
var longPressTimer = false;
|
|
function clearLongPressTimer() {
|
if (longPressTimer) {
|
clearTimeout(longPressTimer);
|
longPressTimer = false;
|
}
|
}
|
|
var startPageX = 0;
|
var startPageY = 0;
|
|
function touchstart(evt) {
|
clearLongPressTimer();
|
|
if (evt.touches.length !== 1) {
|
return;
|
}
|
|
var _evt$touches$ = evt.touches[0],
|
pageX = _evt$touches$.pageX,
|
pageY = _evt$touches$.pageY;
|
startPageX = pageX;
|
startPageY = pageY;
|
longPressTimer = setTimeout(function () {
|
var customEvent = new CustomEvent('longpress', {
|
bubbles: true,
|
cancelable: true,
|
target: evt.target,
|
currentTarget: evt.currentTarget
|
});
|
customEvent.touches = evt.touches;
|
customEvent.changedTouches = evt.changedTouches;
|
evt.target.dispatchEvent(customEvent);
|
}, LONGPRESS_TIMEOUT);
|
}
|
|
function touchmove(evt) {
|
if (!longPressTimer) {
|
return;
|
}
|
|
if (evt.touches.length !== 1) {
|
return clearLongPressTimer();
|
}
|
|
var _evt$touches$2 = evt.touches[0],
|
pageX = _evt$touches$2.pageX,
|
pageY = _evt$touches$2.pageY;
|
|
if (Math.abs(pageX - startPageX) > LONGPRESS_THRESHOLD || Math.abs(pageY - startPageY) > LONGPRESS_THRESHOLD) {
|
return clearLongPressTimer();
|
}
|
}
|
|
function initEvents() {
|
window.addEventListener('touchstart', touchstart, passiveOptions);
|
window.addEventListener('touchmove', touchmove, passiveOptions);
|
window.addEventListener('touchend', clearLongPressTimer, passiveOptions);
|
window.addEventListener('touchcancel', clearLongPressTimer, passiveOptions);
|
}
|
|
/***/ }),
|
/* 19 */
|
/***/ (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;
|
|
|
/***/ }),
|
/* 20 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return publishHandler; });
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
|
function publishHandler(event) {
|
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
Object(uni_shared__WEBPACK_IMPORTED_MODULE_1__[/* plusReady */ "j"])(function () {
|
var pageId = plus.webview.currentWebview().id;
|
|
if (true) {
|
console.log("[VIEW][".concat(Date.now(), "]:"), event, args, pageId);
|
}
|
|
plus.webview.postMessageToUniNView({
|
type: 'subscribeHandler',
|
args: {
|
type: event,
|
data: args,
|
pageId: pageId
|
}
|
}, _constants__WEBPACK_IMPORTED_MODULE_0__[/* APP_SERVICE_ID */ "a"]);
|
});
|
}
|
|
/***/ }),
|
/* 21 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return findElm; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return elementMatchesPolyfill; });
|
function findVmById(id, vm) {
|
if (id === vm._$id) {
|
return vm;
|
}
|
|
var childVms = vm.$children;
|
var len = childVms.length;
|
|
for (var i = 0; i < len; i++) {
|
var childVm = findVmById(id, childVms[i]);
|
|
if (childVm) {
|
return childVm;
|
}
|
}
|
}
|
|
function findElm(component, pageVm) {
|
if (!pageVm) {
|
return console.error('page is not ready');
|
}
|
|
if (!component) {
|
return pageVm.$el;
|
}
|
|
if (true) {
|
if (typeof component === 'string') {
|
var componentVm = findVmById(component, pageVm);
|
|
if (!componentVm) {
|
throw new Error("Not Found\uFF1APage[".concat(pageVm.$page.id, "][").concat(component, "]"));
|
}
|
|
return componentVm.$el;
|
}
|
}
|
|
return component.$el;
|
}
|
function elementMatchesPolyfill(Element) {
|
if (!Element.matches) {
|
Element.matches = Element.matchesSelector || Element.mozMatchesSelector || Element.msMatchesSelector || Element.oMatchesSelector || Element.webkitMatchesSelector || function (s) {
|
var matches = (this.document || this.ownerDocument).querySelectorAll(s);
|
var i = matches.length;
|
|
while (--i >= 0 && matches.item(i) !== this) {}
|
|
return i > -1;
|
};
|
}
|
|
return Element;
|
}
|
|
/***/ }),
|
/* 22 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return disableScroll; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return pageScrollTo; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createScrollListener; });
|
/* harmony import */ var uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
|
|
function disableScroll(evt) {
|
evt.preventDefault();
|
}
|
function pageScrollTo(_ref) {
|
var scrollTop = _ref.scrollTop,
|
duration = _ref.duration;
|
var documentElement = document.documentElement;
|
var clientHeight = documentElement.clientHeight,
|
scrollHeight = documentElement.scrollHeight;
|
scrollTop = Math.min(scrollTop, scrollHeight - clientHeight);
|
|
if (duration === 0) {
|
// 部分浏览器(比如微信)中 scrollTop 的值需要通过 document.body 来控制
|
documentElement.scrollTop = document.body.scrollTop = scrollTop;
|
return;
|
}
|
|
if (window.scrollY === scrollTop) {
|
return;
|
}
|
|
function scrollTo(duration) {
|
if (duration <= 0) {
|
window.scrollTo(0, scrollTop);
|
return;
|
}
|
|
var distaince = scrollTop - window.scrollY;
|
requestAnimationFrame(function () {
|
window.scrollTo(0, window.scrollY + distaince / duration * 10);
|
scrollTo(duration - 10);
|
});
|
}
|
|
scrollTo(duration); // TODO 暂不使用 transform 会导致 fixed 元素不可见
|
// const body = document.body
|
// const bodyStyle = body.style
|
//
|
// function webkitTransitionEnd() {
|
// bodyStyle.webkitTransition = ''
|
// bodyStyle.webkitTransform = ''
|
// documentElement.scrollTop = scrollTop
|
// body.removeEventListener('webkitTransitionEnd', webkitTransitionEnd)
|
// }
|
//
|
// body.addEventListener('webkitTransitionEnd', webkitTransitionEnd)
|
// bodyStyle.webkitTransition = `-webkit-transform ${duration}ms ease-out`
|
// bodyStyle.webkitTransform = `translateY(${documentElement.scrollTop}px) translateZ(0)`
|
}
|
var testReachBottomTimer;
|
var lastScrollHeight = 0;
|
function createScrollListener(pageId, _ref2) {
|
var enablePageScroll = _ref2.enablePageScroll,
|
enablePageReachBottom = _ref2.enablePageReachBottom,
|
onReachBottomDistance = _ref2.onReachBottomDistance,
|
enableTransparentTitleNView = _ref2.enableTransparentTitleNView;
|
var ticking = false;
|
var hasReachBottom = false;
|
var onReachBottom = true;
|
|
function isReachBottom() {
|
var scrollHeight = document.documentElement.scrollHeight; // 部分浏览器窗口高度变化后document.documentelement.clientheight不会变化,采用window.innerHeight
|
|
var windowHeight = window.innerHeight;
|
var scrollY = window.scrollY;
|
var isBottom = scrollY > 0 && scrollHeight > windowHeight && scrollY + windowHeight + onReachBottomDistance >= scrollHeight; // 兼容部分浏览器滚动时scroll事件不触发
|
|
var heightChanged = Math.abs(scrollHeight - lastScrollHeight) > onReachBottomDistance;
|
|
if (isBottom && (!hasReachBottom || heightChanged)) {
|
lastScrollHeight = scrollHeight;
|
hasReachBottom = true;
|
return true;
|
}
|
|
if (!isBottom && hasReachBottom) {
|
hasReachBottom = false;
|
}
|
|
return false;
|
}
|
|
function trigger() {
|
var pages = getCurrentPages();
|
|
if (!pages.length || pages[pages.length - 1].$page.id !== pageId) {
|
return;
|
} // publish
|
|
|
var scrollTop = window.pageYOffset;
|
|
if (enablePageScroll) {
|
// 向 Service 发送 onPageScroll 事件
|
Object(uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__[/* publishHandler */ "a"])('onPageScroll', {
|
scrollTop: scrollTop
|
}, pageId);
|
}
|
|
if (enableTransparentTitleNView) {
|
UniViewJSBridge.emit('onPageScroll', {
|
scrollTop: scrollTop
|
});
|
}
|
|
function testReachBottom() {
|
if (isReachBottom()) {
|
Object(uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__[/* publishHandler */ "a"])('onReachBottom', {}, pageId);
|
onReachBottom = false;
|
setTimeout(function () {
|
onReachBottom = true;
|
}, 350);
|
return true;
|
}
|
}
|
|
if (enablePageReachBottom && onReachBottom) {
|
if (testReachBottom()) {} else {
|
// 解决部分浏览器滚动中js获取窗口高度不准确导致的问题
|
testReachBottomTimer = setTimeout(testReachBottom, 300);
|
}
|
}
|
|
ticking = false;
|
}
|
|
return function onScroll() {
|
clearTimeout(testReachBottomTimer);
|
|
if (!ticking) {
|
requestAnimationFrame(trigger);
|
}
|
|
ticking = true;
|
};
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 23 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return vd; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initData; });
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67);
|
/* harmony import */ var _vdom_sync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(106);
|
/* harmony import */ var _page__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69);
|
/* harmony import */ var _page_factory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(68);
|
var _handleData;
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
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(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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; }
|
|
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; }
|
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
|
|
|
var vd;
|
var PageVueComponent;
|
var handleData = (_handleData = {}, _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATE */ "d"], function onPageCreate(data) {
|
var _data = _slicedToArray(data, 3),
|
pageId = _data[0],
|
pagePath = _data[1],
|
pageOptions = _data[2];
|
|
document.title = "".concat(pagePath, "[").concat(pageId, "]"); // 设置当前页面伪对象,方便其他地方使用 getCurrentPages 获取当前页面 id,route
|
|
Object(_page__WEBPACK_IMPORTED_MODULE_4__[/* setCurrentPage */ "b"])(pageId, pagePath); // 通知页面创建,根据当前页面配置信息,初始化部分事件
|
|
UniViewJSBridge.subscribeHandler(_constants__WEBPACK_IMPORTED_MODULE_2__[/* ON_PAGE_CREATE */ "a"], pageOptions, pageId); // 初始化当前页面 VueComponent(生成页面样式代码)
|
|
PageVueComponent = Object(_page_factory__WEBPACK_IMPORTED_MODULE_5__[/* getPageVueComponent */ "b"])(pagePath); // 生成当前页面 vd
|
|
vd = new _vdom_sync__WEBPACK_IMPORTED_MODULE_3__[/* VDomSync */ "a"](pageId, {
|
version: pageOptions.version
|
});
|
}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* MOUNTED_DATA */ "c"], function onMounted(data) {
|
vd.addVData.apply(vd, data);
|
}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* UPDATED_DATA */ "h"], function onUpdated(data) {
|
vd.updateVData.apply(vd, data);
|
}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATED */ "e"], function onPageCreated(data) {
|
var _data2 = _slicedToArray(data, 3),
|
pageId = _data2[0],
|
pagePath = _data2[1],
|
pageQuery = _data2[2];
|
|
var page = getCurrentPages()[0];
|
page.options = pageQuery || {};
|
page.$vm = new PageVueComponent({
|
mpType: 'page',
|
pageId: pageId,
|
pagePath: pagePath,
|
pageQuery: pageQuery
|
}).$mount('#app');
|
}), _handleData);
|
|
function broadcast(vm, componentName, eventName) {
|
for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
params[_key - 3] = arguments[_key];
|
}
|
|
vm.$children.forEach(function (child) {
|
var name = child.$options.name && child.$options.name.replace(/^VUni/, '');
|
|
if (~componentName.indexOf(name)) {
|
child.$emit.apply(child, [eventName].concat(params));
|
}
|
|
broadcast.apply(void 0, [child, componentName, eventName].concat(params));
|
});
|
}
|
|
var NATIVE_COMPONENTS = ['Camera', 'LivePlayer', 'LivePusher', 'Map', 'Video', 'CoverView', 'CoverImage', 'Ad'];
|
|
function updateView() {
|
var pages = getCurrentPages();
|
var pageVm = pages[0] && pages[0].$vm;
|
pageVm && broadcast(pageVm, NATIVE_COMPONENTS, 'uni-view-update');
|
}
|
|
window.addEventListener('resize', function () {
|
updateView();
|
});
|
window.addEventListener('updateview', updateView);
|
|
function vdSync(_ref) {
|
var data = _ref.data,
|
options = _ref.options;
|
var isVdCallback = true;
|
data.forEach(function (data) {
|
if (data[0] === _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATE */ "d"]) {
|
// 页面创建无需触发 callback
|
isVdCallback = false;
|
}
|
|
handleData[data[0]](data[1]);
|
});
|
vd.flush();
|
vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].nextTick(function () {
|
// 清空本次 addBatchData
|
vd.clearAddBatchVData();
|
updateView();
|
isVdCallback && UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_1__[/* VD_SYNC_CALLBACK */ "j"]);
|
});
|
}
|
|
function getData(id, name) {
|
try {
|
return this.$r[id][name];
|
} catch (e) {// console.error(this.$options.__file + `:[${this._$id}]$r[${id}][${name}] is undefined`)
|
}
|
}
|
/**
|
* wxs change:prop
|
* @param {Object} id
|
* @param {Object} name
|
*/
|
|
|
function getChangeData(id, name) {
|
try {
|
var value = this.$r[id][name];
|
var wxsPropName = name.replace('change:', '');
|
this[wxsPropName] = value;
|
this.$set(this.wxsProps, wxsPropName, value);
|
return value;
|
} catch (e) {// console.error(this.$options.__file + `:[${this._$id}]$r[${id}][${name}] is undefined`)
|
}
|
}
|
|
function initData(Vue) {
|
Vue.prototype._$g = getData;
|
Vue.prototype._$gc = getChangeData;
|
UniViewJSBridge.subscribe(_constants__WEBPACK_IMPORTED_MODULE_1__[/* VD_SYNC */ "i"], vdSync);
|
Object.defineProperty(Vue.prototype, '_$vd', {
|
get: function get() {
|
return !this.$options.isReserved && vd;
|
}
|
});
|
Vue.mixin({
|
beforeCreate: function beforeCreate() {
|
if (this.$options.mpType) {
|
this.mpType = this.$options.mpType;
|
}
|
|
if (this._$vd) {
|
this._$vd.initVm(this);
|
}
|
}
|
});
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 24 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
data: function data() {
|
return {
|
hovering: false
|
};
|
},
|
props: {
|
hoverClass: {
|
type: String,
|
default: 'none'
|
},
|
hoverStopPropagation: {
|
type: Boolean,
|
default: false
|
},
|
hoverStartTime: {
|
type: [Number, String],
|
default: 50
|
},
|
hoverStayTime: {
|
type: [Number, String],
|
default: 400
|
}
|
},
|
methods: {
|
_hoverTouchStart: function _hoverTouchStart(evt) {
|
var _this = this;
|
|
// TODO detect scrolling
|
if (evt._hoverPropagationStopped) {
|
return;
|
}
|
|
if (!this.hoverClass || this.hoverClass === 'none' || this.disabled) {
|
return;
|
}
|
|
if (evt.touches.length > 1) {
|
return;
|
}
|
|
if (this.hoverStopPropagation) {
|
evt._hoverPropagationStopped = true;
|
}
|
|
this._hoverTouch = true;
|
this._hoverStartTimer = setTimeout(function () {
|
_this.hovering = true;
|
|
if (!_this._hoverTouch) {
|
// 防止在hoverStartTime时间内触发了 touchend 或 touchcancel
|
_this._hoverReset();
|
}
|
}, this.hoverStartTime);
|
},
|
_hoverTouchEnd: function _hoverTouchEnd(evt) {
|
this._hoverTouch = false;
|
|
if (this.hovering) {
|
this._hoverReset();
|
}
|
},
|
_hoverReset: function _hoverReset() {
|
var _this2 = this;
|
|
requestAnimationFrame(function () {
|
clearTimeout(_this2._hoverStayTimer);
|
_this2._hoverStayTimer = setTimeout(function () {
|
_this2.hovering = false;
|
}, _this2.hoverStayTime);
|
});
|
},
|
_hoverTouchCancel: function _hoverTouchCancel(evt) {
|
this._hoverTouch = false;
|
this.hovering = false;
|
clearTimeout(this._hoverStartTimer);
|
}
|
}
|
});
|
|
/***/ }),
|
/* 25 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
|
|
|
var resetTimer;
|
var isAndroid;
|
var osVersion;
|
var keyboardHeight;
|
var keyboardChangeCallback;
|
var webviewStyle;
|
|
if (true) {
|
Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () {
|
isAndroid = plus.os.name.toLowerCase() === 'android';
|
osVersion = plus.os.version;
|
});
|
document.addEventListener('keyboardchange', function (event) {
|
keyboardHeight = event.height;
|
keyboardChangeCallback && keyboardChangeCallback();
|
}, false);
|
}
|
/**
|
* 保证iOS点击输入框外隐藏键盘
|
*/
|
|
|
function iosHideKeyboard() {}
|
|
function setSoftinputTemporary(vm, reset) {
|
Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () {
|
var MODE_ADJUSTRESIZE = 'adjustResize';
|
var MODE_ADJUSTPAN = 'adjustPan';
|
var MODE_NOTHING = 'nothing';
|
var currentWebview = plus.webview.currentWebview(); // iOS 14.6 调用同步方法导致键盘弹卡顿
|
|
var style = webviewStyle || currentWebview.getStyle() || {};
|
var options = {
|
mode: reset || style.softinputMode === MODE_ADJUSTRESIZE ? MODE_ADJUSTRESIZE : vm.adjustPosition ? MODE_ADJUSTPAN : MODE_NOTHING,
|
position: {
|
top: 0,
|
height: 0
|
}
|
};
|
|
if (options.mode === MODE_ADJUSTPAN) {
|
var rect = vm.$el.getBoundingClientRect();
|
options.position.top = rect.top;
|
options.position.height = rect.height + (Number(vm.cursorSpacing) || 0);
|
}
|
|
currentWebview.setSoftinputTemporary(options);
|
});
|
}
|
|
function setSoftinputNavBar(vm) {
|
if (vm.showConfirmBar === 'auto') {
|
delete vm.__softinputNavBar;
|
return;
|
}
|
|
Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () {
|
var currentWebview = plus.webview.currentWebview();
|
|
var _ref = currentWebview.getStyle() || {},
|
softinputNavBar = _ref.softinputNavBar;
|
|
var showConfirmBar = softinputNavBar !== 'none';
|
|
if (showConfirmBar !== vm.showConfirmBar) {
|
vm.__softinputNavBar = softinputNavBar || 'auto';
|
currentWebview.setStyle({
|
softinputNavBar: vm.showConfirmBar ? 'auto' : 'none'
|
});
|
} else {
|
delete vm.__softinputNavBar;
|
}
|
});
|
}
|
|
function resetSoftinputNavBar(vm) {
|
var softinputNavBar = vm.__softinputNavBar;
|
|
if (softinputNavBar) {
|
Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () {
|
var currentWebview = plus.webview.currentWebview();
|
currentWebview.setStyle({
|
softinputNavBar: softinputNavBar
|
});
|
});
|
}
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Keyboard',
|
mixins: [_emitter__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]],
|
props: {
|
cursorSpacing: {
|
type: [Number, String],
|
default: 0
|
},
|
showConfirmBar: {
|
type: [Boolean, String],
|
default: 'auto'
|
},
|
adjustPosition: {
|
type: [Boolean, String],
|
default: true
|
},
|
autoBlur: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
directives: {
|
keyboard: {
|
inserted: function inserted(el, binding, vnode) {
|
vnode.context.initKeyboard(el);
|
}
|
}
|
},
|
methods: {
|
initKeyboard: function initKeyboard(el) {
|
var _this = this;
|
|
var focus;
|
|
var keyboardChange = function keyboardChange() {
|
_this.$trigger('keyboardheightchange', {}, {
|
height: keyboardHeight,
|
duration: 0.25
|
}); // 安卓切换不同键盘类型时会导致键盘收回,需重新设置
|
|
|
if (focus && keyboardHeight === 0) {
|
setSoftinputTemporary(_this);
|
} // 安卓/iOS13收起键盘时主动失去焦点
|
|
|
if (_this.autoBlur && focus && keyboardHeight === 0 && (isAndroid || parseInt(osVersion) >= 13)) {
|
document.activeElement.blur();
|
}
|
};
|
|
el.addEventListener('focus', function () {
|
focus = true;
|
clearTimeout(resetTimer);
|
document.addEventListener('click', iosHideKeyboard, false);
|
|
if (true) {
|
keyboardChangeCallback = keyboardChange;
|
|
if (keyboardHeight) {
|
_this.$trigger('keyboardheightchange', {}, {
|
height: keyboardHeight,
|
duration: 0
|
});
|
}
|
|
setSoftinputNavBar(_this);
|
setSoftinputTemporary(_this);
|
}
|
});
|
|
if (true) {
|
// 安卓单独隐藏键盘后点击输入框不会触发 focus 事件
|
if (isAndroid) {
|
el.addEventListener('click', function () {
|
if (!_this.disabled && focus && keyboardHeight === 0) {
|
setSoftinputTemporary(_this);
|
}
|
});
|
}
|
|
if (!isAndroid) {
|
// iOS12 以下系统 focus 事件设置较迟,改在 touchstart 设置
|
if (parseInt(osVersion) < 12) {
|
el.addEventListener('touchstart', function () {
|
if (!_this.disabled && !focus) {
|
setSoftinputTemporary(_this);
|
}
|
});
|
} // iOS 14.6 调用同步方法导致键盘弹卡顿
|
|
|
if (parseFloat(osVersion) >= 14.6 && !webviewStyle) {
|
Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () {
|
var currentWebview = plus.webview.currentWebview();
|
webviewStyle = currentWebview.getStyle() || {};
|
});
|
}
|
}
|
}
|
|
var onKeyboardHide = function onKeyboardHide() {
|
document.removeEventListener('click', iosHideKeyboard, false);
|
|
if (true) {
|
keyboardChangeCallback = null;
|
|
if (keyboardHeight) {
|
_this.$trigger('keyboardheightchange', {}, {
|
height: 0,
|
duration: 0
|
});
|
}
|
|
resetSoftinputNavBar(_this);
|
|
if (isAndroid) {
|
// 还原安卓软键盘配置,避免影响 web-view 组件
|
resetTimer = setTimeout(function () {
|
setSoftinputTemporary(_this, true);
|
}, 300);
|
}
|
} // 修复ios端显示与点击位置错位的Bug by:wyq
|
|
|
if (String(navigator.vendor).indexOf('Apple') === 0) {
|
document.documentElement.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop);
|
}
|
};
|
|
el.addEventListener('blur', function () {
|
// 在iOS设备上,手动调用uni.hideKeyboard(),键盘收起并且触发blur,但实际并没有blur。
|
// 此时如果再点击页面其他地方会重新聚焦,此处做处理
|
el.blur();
|
focus = false;
|
onKeyboardHide();
|
});
|
}
|
}
|
});
|
|
/***/ }),
|
/* 26 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
var passiveOptions = uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* supportsPassive */ "k"] ? {
|
passive: true,
|
capture: true
|
} : true;
|
var vms = [];
|
var userInteract = 0;
|
var inited;
|
|
function setInteract(interact) {
|
vms.forEach(function (vm) {
|
return vm.userInteract = interact;
|
});
|
}
|
|
function addInteractListener() {
|
var vm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
if (!inited) {
|
var eventNames = ['touchstart', 'touchmove', 'touchend', 'mousedown', 'mouseup'];
|
eventNames.forEach(function (eventName) {
|
document.addEventListener(eventName, function () {
|
!userInteract && setInteract(true);
|
userInteract++;
|
setTimeout(function () {
|
! --userInteract && setInteract(false);
|
}, 0);
|
}, passiveOptions);
|
});
|
inited = true;
|
}
|
|
vms.push(vm);
|
}
|
|
function removeInteractListener(vm) {
|
var index = vms.indexOf(vm);
|
|
if (index >= 0) {
|
vms.splice(index, 1);
|
}
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
data: function data() {
|
return {
|
/**
|
* 是否用户交互行为
|
*/
|
userInteract: false
|
};
|
},
|
mounted: function mounted() {
|
addInteractListener(this);
|
},
|
beforeDestroy: function beforeDestroy() {
|
removeInteractListener(this);
|
},
|
addInteractListener: addInteractListener,
|
// true -> interact
|
getStatus: function getStatus() {
|
return !!userInteract;
|
}
|
});
|
|
/***/ }),
|
/* 27 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 28 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 29 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
/* harmony import */ var uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
|
/* harmony import */ var uni_platform_helpers_save_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(107);
|
/* harmony import */ var uni_platform_helpers_file__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(108);
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
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."); }
|
|
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(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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; }
|
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
|
|
|
function resolveColor(color) {
|
color = color.slice(0);
|
color[3] = color[3] / 255;
|
return 'rgba(' + color.join(',') + ')';
|
}
|
|
function processTouches(target, touches) {
|
return [].map.call(touches, function (touch) {
|
var boundingClientRect = target.getBoundingClientRect();
|
return {
|
identifier: touch.identifier,
|
x: touch.clientX - boundingClientRect.left,
|
y: touch.clientY - boundingClientRect.top
|
};
|
});
|
}
|
|
var tempCanvas;
|
|
function getTempCanvas() {
|
var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
if (!tempCanvas) {
|
tempCanvas = document.createElement('canvas');
|
}
|
|
tempCanvas.width = width;
|
tempCanvas.height = height;
|
return tempCanvas;
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Canvas',
|
mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"]],
|
props: {
|
canvasId: {
|
type: String,
|
default: ''
|
},
|
disableScroll: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
actionsWaiting: false
|
};
|
},
|
computed: {
|
id: function id() {
|
return this.canvasId;
|
},
|
_listeners: function _listeners() {
|
var _this = this;
|
|
var $listeners = Object.assign({}, this.$listeners);
|
var events = ['touchstart', 'touchmove', 'touchend'];
|
events.forEach(function (event) {
|
var existing = $listeners[event];
|
var eventHandler = [];
|
|
if (existing) {
|
eventHandler.push(function ($event) {
|
_this.$trigger(event, Object.assign({}, $event, {
|
touches: processTouches($event.currentTarget, $event.touches),
|
changedTouches: processTouches($event.currentTarget, $event.changedTouches)
|
}));
|
});
|
}
|
|
if (_this.disableScroll && event === 'touchmove') {
|
eventHandler.push(_this._touchmove);
|
}
|
|
$listeners[event] = eventHandler;
|
});
|
return $listeners;
|
}
|
},
|
created: function created() {
|
this._actionsDefer = [];
|
this._images = {};
|
},
|
mounted: function mounted() {
|
this._resize();
|
},
|
beforeDestroy: function beforeDestroy() {
|
var canvas = this.$refs.canvas;
|
canvas.height = canvas.width = 0;
|
},
|
methods: {
|
_handleSubscribe: function _handleSubscribe(_ref) {
|
var type = _ref.type,
|
_ref$data = _ref.data,
|
data = _ref$data === void 0 ? {} : _ref$data;
|
var method = this[type];
|
|
if (type.indexOf('_') !== 0 && typeof method === 'function') {
|
method(data);
|
}
|
},
|
_resize: function _resize(size) {
|
var canvas = this.$refs.canvas;
|
var hasChanged = !size || canvas.width !== Math.floor(size.width * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]) || canvas.height !== Math.floor(size.height * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]);
|
if (!hasChanged) return;
|
|
if (canvas.width > 0 && canvas.height > 0) {
|
var context = canvas.getContext('2d');
|
var imageData = context.getImageData(0, 0, canvas.width, canvas.height);
|
Object(uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* wrapper */ "b"])(canvas);
|
context.putImageData(imageData, 0, 0);
|
} else {
|
Object(uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* wrapper */ "b"])(canvas);
|
}
|
},
|
_touchmove: function _touchmove(event) {
|
event.preventDefault();
|
},
|
actionsChanged: function actionsChanged(_ref2) {
|
var _this2 = this;
|
|
var actions = _ref2.actions,
|
reserve = _ref2.reserve,
|
callbackId = _ref2.callbackId;
|
var self = this;
|
|
if (!actions) {
|
return;
|
}
|
|
if (this.actionsWaiting) {
|
this._actionsDefer.push([actions, reserve, callbackId]);
|
|
return;
|
}
|
|
var canvas = this.$refs.canvas;
|
var c2d = canvas.getContext('2d');
|
|
if (!reserve) {
|
c2d.fillStyle = '#000000';
|
c2d.strokeStyle = '#000000';
|
c2d.shadowColor = '#000000';
|
c2d.shadowBlur = 0;
|
c2d.shadowOffsetX = 0;
|
c2d.shadowOffsetY = 0;
|
c2d.setTransform(1, 0, 0, 1, 0, 0);
|
c2d.clearRect(0, 0, canvas.width, canvas.height);
|
}
|
|
this.preloadImage(actions);
|
|
var _loop2 = function _loop2(index) {
|
var action = actions[index];
|
var method = action.method;
|
var data = action.data;
|
|
if (/^set/.test(method) && method !== 'setTransform') {
|
var method1 = method[3].toLowerCase() + method.slice(4);
|
var color;
|
|
if (method1 === 'fillStyle' || method1 === 'strokeStyle') {
|
if (data[0] === 'normal') {
|
color = resolveColor(data[1]);
|
} else if (data[0] === 'linear') {
|
var LinearGradient = c2d.createLinearGradient.apply(c2d, _toConsumableArray(data[1]));
|
data[2].forEach(function (data2) {
|
var offset = data2[0];
|
var color = resolveColor(data2[1]);
|
LinearGradient.addColorStop(offset, color);
|
});
|
color = LinearGradient;
|
} else if (data[0] === 'radial') {
|
var x = data[1][0];
|
var y = data[1][1];
|
var r = data[1][2];
|
|
var _LinearGradient = c2d.createRadialGradient(x, y, 0, x, y, r);
|
|
data[2].forEach(function (data2) {
|
var offset = data2[0];
|
var color = resolveColor(data2[1]);
|
|
_LinearGradient.addColorStop(offset, color);
|
});
|
color = _LinearGradient;
|
} else if (data[0] === 'pattern') {
|
var loaded = _this2.checkImageLoaded(data[1], actions.slice(index + 1), callbackId, function (image) {
|
if (image) {
|
c2d[method1] = c2d.createPattern(image, data[2]);
|
}
|
});
|
|
if (!loaded) {
|
return "break";
|
}
|
|
return "continue";
|
}
|
|
c2d[method1] = color;
|
} else if (method1 === 'globalAlpha') {
|
c2d[method1] = data[0] / 255;
|
} else if (method1 === 'shadow') {
|
_ = ['shadowOffsetX', 'shadowOffsetY', 'shadowBlur', 'shadowColor'];
|
data.forEach(function (color_, method_) {
|
c2d[_[method_]] = _[method_] === 'shadowColor' ? resolveColor(color_) : color_;
|
});
|
} else if (method1 === 'fontSize') {
|
var font = c2d.__font__ || c2d.font;
|
c2d.__font__ = c2d.font = font.replace(/\d+\.?\d*px/, data[0] + 'px');
|
} else if (method1 === 'lineDash') {
|
c2d.setLineDash(data[0]);
|
c2d.lineDashOffset = data[1] || 0;
|
} else if (method1 === 'textBaseline') {
|
if (data[0] === 'normal') {
|
data[0] = 'alphabetic';
|
}
|
|
c2d[method1] = data[0];
|
} else if (method1 === 'font') {
|
c2d.__font__ = c2d.font = data[0];
|
} else {
|
c2d[method1] = data[0];
|
}
|
} else if (method === 'fillPath' || method === 'strokePath') {
|
method = method.replace(/Path/, '');
|
c2d.beginPath();
|
data.forEach(function (data_) {
|
c2d[data_.method].apply(c2d, data_.data);
|
});
|
c2d[method]();
|
} else if (method === 'fillText') {
|
c2d.fillText.apply(c2d, data);
|
} else if (method === 'drawImage') {
|
A = function () {
|
var dataArray = _toConsumableArray(data);
|
|
var url = dataArray[0];
|
var otherData = dataArray.slice(1);
|
self._images = self._images || {};
|
if (!self.checkImageLoaded(url, actions.slice(index + 1), callbackId, function (image) {
|
if (image) {
|
c2d.drawImage.apply(c2d, [image].concat(_toConsumableArray(otherData.slice(4, 8)), _toConsumableArray(otherData.slice(0, 4))));
|
}
|
})) return 'break';
|
}();
|
|
if (A === 'break') {
|
return "break";
|
}
|
} else {
|
if (method === 'clip') {
|
data.forEach(function (data_) {
|
c2d[data_.method].apply(c2d, data_.data);
|
});
|
c2d.clip();
|
} else {
|
c2d[method].apply(c2d, data);
|
}
|
}
|
};
|
|
_loop: for (var index = 0; index < actions.length; index++) {
|
var _;
|
|
var A;
|
|
var _ret = _loop2(index);
|
|
switch (_ret) {
|
case "break":
|
break _loop;
|
|
case "continue":
|
continue;
|
}
|
}
|
|
if (!this.actionsWaiting && callbackId) {
|
UniViewJSBridge.publishHandler('onCanvasMethodCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: 'drawCanvas:ok'
|
}
|
}, this.$page.id);
|
}
|
},
|
preloadImage: function preloadImage(actions) {
|
var self = this;
|
actions.forEach(function (action) {
|
var method = action.method;
|
var data = action.data;
|
var src = '';
|
|
if (method === 'drawImage') {
|
src = data[0];
|
src = self.$getRealPath(src);
|
data[0] = src;
|
} else if (method === 'setFillStyle' && data[0] === 'pattern') {
|
src = data[1];
|
src = self.$getRealPath(src);
|
data[1] = src;
|
}
|
|
if (src && !self._images[src]) {
|
loadImage();
|
}
|
/**
|
* 加载图像
|
*/
|
|
|
function loadImage() {
|
var image = self._images[src] = new Image();
|
|
image.onload = function () {
|
image.ready = true;
|
}; // 安卓 WebView 除本地路径无跨域问题
|
|
|
if ( true && navigator.vendor === 'Google Inc.') {
|
if (src.indexOf('file://') === 0) {
|
image.crossOrigin = 'anonymous';
|
}
|
|
image.src = src;
|
return;
|
}
|
|
Object(uni_platform_helpers_file__WEBPACK_IMPORTED_MODULE_3__[/* getSameOriginUrl */ "a"])(src).then(function (src) {
|
image.src = src;
|
}).catch(function () {
|
image.src = src;
|
});
|
}
|
});
|
},
|
checkImageLoaded: function checkImageLoaded(src, actions, callbackId, fn) {
|
var self = this;
|
var image = this._images[src];
|
|
if (image.ready) {
|
fn(image);
|
return true;
|
} else {
|
this._actionsDefer.unshift([actions, true]);
|
|
this.actionsWaiting = true;
|
|
image.onload = function () {
|
image.ready = true;
|
fn(image);
|
self.actionsWaiting = false;
|
|
var actions = self._actionsDefer.slice(0);
|
|
self._actionsDefer = [];
|
|
for (var action = actions.shift(); action;) {
|
self.actionsChanged({
|
actions: action[0],
|
reserve: action[1],
|
callbackId: callbackId
|
});
|
action = actions.shift();
|
}
|
};
|
|
return false;
|
}
|
},
|
getImageData: function getImageData(_ref3) {
|
var _ref3$x = _ref3.x,
|
x = _ref3$x === void 0 ? 0 : _ref3$x,
|
_ref3$y = _ref3.y,
|
y = _ref3$y === void 0 ? 0 : _ref3$y,
|
width = _ref3.width,
|
height = _ref3.height,
|
destWidth = _ref3.destWidth,
|
destHeight = _ref3.destHeight,
|
_ref3$hidpi = _ref3.hidpi,
|
hidpi = _ref3$hidpi === void 0 ? true : _ref3$hidpi,
|
dataType = _ref3.dataType,
|
_ref3$quality = _ref3.quality,
|
quality = _ref3$quality === void 0 ? 1 : _ref3$quality,
|
_ref3$type = _ref3.type,
|
type = _ref3$type === void 0 ? 'png' : _ref3$type,
|
callbackId = _ref3.callbackId;
|
var canvas = this.$refs.canvas;
|
var data;
|
var maxWidth = canvas.offsetWidth - x;
|
width = width ? Math.min(width, maxWidth) : maxWidth;
|
var maxHeight = canvas.offsetHeight - y;
|
height = height ? Math.min(height, maxHeight) : maxHeight;
|
|
if (!hidpi) {
|
if (!destWidth && !destHeight) {
|
destWidth = Math.round(width * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]);
|
destHeight = Math.round(height * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]);
|
} else if (!destWidth) {
|
destWidth = Math.round(width / height * destHeight);
|
} else if (!destHeight) {
|
destHeight = Math.round(height / width * destWidth);
|
}
|
} else {
|
destWidth = width;
|
destHeight = height;
|
}
|
|
var newCanvas = getTempCanvas(destWidth, destHeight);
|
var context = newCanvas.getContext('2d');
|
|
if (type === 'jpeg' || type === 'jpg') {
|
type = 'jpeg';
|
context.fillStyle = '#fff';
|
context.fillRect(0, 0, destWidth, destHeight);
|
}
|
|
context.__hidpi__ = true;
|
context.drawImageByCanvas(canvas, x, y, width, height, 0, 0, destWidth, destHeight, false);
|
var result;
|
|
try {
|
var compressed;
|
|
if (dataType === 'base64') {
|
data = newCanvas.toDataURL("image/".concat(type), quality);
|
} else {
|
var imgData = context.getImageData(0, 0, destWidth, destHeight);
|
|
if (true) {
|
var pako = __webpack_require__(87);
|
|
data = pako.deflateRaw(imgData.data, {
|
to: 'string'
|
});
|
compressed = true;
|
} else {}
|
}
|
|
result = {
|
errMsg: 'canvasGetImageData:ok',
|
data: data,
|
compressed: compressed,
|
width: destWidth,
|
height: destHeight
|
};
|
} catch (error) {
|
result = {
|
errMsg: "canvasGetImageData:fail ".concat(error)
|
};
|
}
|
|
newCanvas.height = newCanvas.width = 0;
|
context.__hidpi__ = false;
|
|
if (!callbackId) {
|
return result;
|
} else {
|
UniViewJSBridge.publishHandler('onCanvasMethodCallback', {
|
callbackId: callbackId,
|
data: result
|
}, this.$page.id);
|
}
|
},
|
putImageData: function putImageData(_ref4) {
|
var data = _ref4.data,
|
x = _ref4.x,
|
y = _ref4.y,
|
width = _ref4.width,
|
height = _ref4.height,
|
compressed = _ref4.compressed,
|
callbackId = _ref4.callbackId;
|
|
try {
|
if (!height) {
|
height = Math.round(data.length / 4 / width);
|
}
|
|
var canvas = getTempCanvas(width, height);
|
var context = canvas.getContext('2d');
|
|
if ( true && compressed) {
|
var pako = __webpack_require__(87);
|
|
data = pako.inflateRaw(data);
|
}
|
|
context.putImageData(new ImageData(new Uint8ClampedArray(data), width, height), 0, 0);
|
this.$refs.canvas.getContext('2d').drawImage(canvas, x, y, width, height);
|
canvas.height = canvas.width = 0;
|
} catch (error) {
|
UniViewJSBridge.publishHandler('onCanvasMethodCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: 'canvasPutImageData:fail'
|
}
|
}, this.$page.id);
|
return;
|
}
|
|
UniViewJSBridge.publishHandler('onCanvasMethodCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: 'canvasPutImageData:ok'
|
}
|
}, this.$page.id);
|
},
|
toTempFilePath: function toTempFilePath(_ref5) {
|
var _this3 = this;
|
|
var _ref5$x = _ref5.x,
|
x = _ref5$x === void 0 ? 0 : _ref5$x,
|
_ref5$y = _ref5.y,
|
y = _ref5$y === void 0 ? 0 : _ref5$y,
|
width = _ref5.width,
|
height = _ref5.height,
|
destWidth = _ref5.destWidth,
|
destHeight = _ref5.destHeight,
|
fileType = _ref5.fileType,
|
quality = _ref5.quality,
|
dirname = _ref5.dirname,
|
callbackId = _ref5.callbackId;
|
var res = this.getImageData({
|
x: x,
|
y: y,
|
width: width,
|
height: height,
|
destWidth: destWidth,
|
destHeight: destHeight,
|
hidpi: false,
|
dataType: 'base64',
|
type: fileType,
|
quality: quality
|
});
|
|
if (!res.data || !res.data.length) {
|
UniViewJSBridge.publishHandler('onCanvasMethodCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: res.errMsg.replace('canvasPutImageData', 'toTempFilePath')
|
}
|
}, this.$page.id);
|
return;
|
}
|
|
Object(uni_platform_helpers_save_image__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(res.data, dirname, function (error, tempFilePath) {
|
var errMsg = "toTempFilePath:".concat(error ? 'fail' : 'ok');
|
|
if (error) {
|
errMsg += " ".concat(error.message);
|
}
|
|
UniViewJSBridge.publishHandler('onCanvasMethodCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: errMsg,
|
tempFilePath: tempFilePath
|
}
|
}, _this3.$page.id);
|
});
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 30 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 31 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 32 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 33 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
/* harmony import */ var uni_helpers_html_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70);
|
/* harmony import */ var _formats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(110);
|
/* harmony import */ var _load_script__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82);
|
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); }
|
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
|
|
|
function isiOS() {
|
if (true) {
|
return plus.os.name.toLowerCase() === 'ios';
|
} else { var isIPadOS, isMac, isIOS, ua; }
|
|
return false;
|
}
|
|
var textChanging = false;
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Editor',
|
mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"], uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* emitter */ "a"], uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* keyboard */ "d"]],
|
props: {
|
id: {
|
type: String,
|
default: ''
|
},
|
readOnly: {
|
type: [Boolean, String],
|
default: false
|
},
|
placeholder: {
|
type: String,
|
default: ''
|
},
|
showImgSize: {
|
type: [Boolean, String],
|
default: false
|
},
|
showImgToolbar: {
|
type: [Boolean, String],
|
default: false
|
},
|
showImgResize: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
quillReady: false
|
};
|
},
|
computed: {},
|
watch: {
|
readOnly: function readOnly(value) {
|
if (this.quillReady) {
|
var quill = this.quill;
|
quill.enable(!value);
|
|
if (!value) {
|
quill.blur();
|
}
|
}
|
},
|
placeholder: function placeholder(value) {
|
if (this.quillReady) {
|
this.setPlaceHolder(value);
|
}
|
}
|
},
|
mounted: function mounted() {
|
var _this = this;
|
|
var imageResizeModules = [];
|
|
if (this.showImgSize) {
|
imageResizeModules.push('DisplaySize');
|
}
|
|
if (this.showImgToolbar) {
|
imageResizeModules.push('Toolbar');
|
}
|
|
if (this.showImgResize) {
|
imageResizeModules.push('Resize');
|
}
|
|
var quillSrc = true ? './__uniappquill.js' : undefined;
|
Object(_load_script__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(window.Quill, quillSrc, function () {
|
if (imageResizeModules.length) {
|
var imageResizeSrc = true ? './__uniappquillimageresize.js' : undefined;
|
Object(_load_script__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(window.ImageResize, imageResizeSrc, function () {
|
_this.initQuill(imageResizeModules);
|
});
|
} else {
|
_this.initQuill(imageResizeModules);
|
}
|
});
|
},
|
methods: {
|
_handleSubscribe: function _handleSubscribe(_ref) {
|
var type = _ref.type,
|
data = _ref.data;
|
var options = data.options,
|
callbackId = data.callbackId;
|
var quill = this.quill;
|
var Quill = window.Quill;
|
var res;
|
var range;
|
var errMsg;
|
|
if (this.quillReady) {
|
switch (type) {
|
case 'format':
|
{
|
var _options$name = options.name,
|
name = _options$name === void 0 ? '' : _options$name,
|
_options$value = options.value,
|
value = _options$value === void 0 ? false : _options$value;
|
range = quill.getSelection(true);
|
var format = quill.getFormat(range)[name] || false;
|
|
if (['bold', 'italic', 'underline', 'strike', 'ins'].includes(name)) {
|
value = !format;
|
} else if (name === 'direction') {
|
value = value === 'rtl' && format ? false : value;
|
var align = quill.getFormat(range).align;
|
|
if (value === 'rtl' && !align) {
|
quill.format('align', 'right', Quill.sources.USER);
|
} else if (!value && align === 'right') {
|
quill.format('align', false, Quill.sources.USER);
|
}
|
} else if (name === 'indent') {
|
var rtl = quill.getFormat(range).direction === 'rtl';
|
value = value === '+1';
|
|
if (rtl) {
|
value = !value;
|
}
|
|
value = value ? '+1' : '-1';
|
} else {
|
if (name === 'list') {
|
value = value === 'check' ? 'unchecked' : value;
|
format = format === 'checked' ? 'unchecked' : format;
|
}
|
|
value = format && format !== (value || false) || !format && value ? value : !format;
|
}
|
|
quill.format(name, value, Quill.sources.USER);
|
}
|
break;
|
|
case 'insertDivider':
|
range = quill.getSelection(true);
|
quill.insertText(range.index, '\n', Quill.sources.USER);
|
quill.insertEmbed(range.index + 1, 'divider', true, Quill.sources.USER);
|
quill.setSelection(range.index + 2, Quill.sources.SILENT);
|
break;
|
|
case 'insertImage':
|
{
|
range = quill.getSelection(true);
|
|
var _options$src = options.src,
|
src = _options$src === void 0 ? '' : _options$src,
|
_options$alt = options.alt,
|
alt = _options$alt === void 0 ? '' : _options$alt,
|
_options$width = options.width,
|
width = _options$width === void 0 ? '' : _options$width,
|
_options$height = options.height,
|
height = _options$height === void 0 ? '' : _options$height,
|
_options$extClass = options.extClass,
|
extClass = _options$extClass === void 0 ? '' : _options$extClass,
|
_options$data = options.data,
|
_data = _options$data === void 0 ? {} : _options$data;
|
|
var path = this.$getRealPath(src);
|
quill.insertEmbed(range.index, 'image', path, Quill.sources.USER);
|
var local = /^(file|blob):/.test(path) ? path : false; // 防止 formatText 多次触发 Quill.events.TEXT_CHANGE 事件
|
|
textChanging = true;
|
quill.formatText(range.index, 1, 'data-local', local);
|
quill.formatText(range.index, 1, 'alt', alt);
|
quill.formatText(range.index, 1, 'width', width);
|
quill.formatText(range.index, 1, 'height', height);
|
quill.formatText(range.index, 1, 'class', extClass);
|
textChanging = false;
|
quill.formatText(range.index, 1, 'data-custom', Object.keys(_data).map(function (key) {
|
return "".concat(key, "=").concat(_data[key]);
|
}).join('&'));
|
quill.setSelection(range.index + 1, Quill.sources.SILENT);
|
}
|
break;
|
|
case 'insertText':
|
{
|
range = quill.getSelection(true);
|
var _options$text = options.text,
|
text = _options$text === void 0 ? '' : _options$text;
|
quill.insertText(range.index, text, Quill.sources.USER);
|
quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT);
|
}
|
break;
|
|
case 'setContents':
|
{
|
var delta = options.delta,
|
html = options.html;
|
|
if (_typeof(delta) === 'object') {
|
quill.setContents(delta, Quill.sources.SILENT);
|
} else if (typeof html === 'string') {
|
quill.setContents(this.html2delta(html), Quill.sources.SILENT);
|
} else {
|
errMsg = 'contents is missing';
|
}
|
}
|
break;
|
|
case 'getContents':
|
res = this.getContents();
|
break;
|
|
case 'clear':
|
quill.setContents([]);
|
break;
|
|
case 'removeFormat':
|
{
|
range = quill.getSelection(true);
|
var parchment = Quill.import('parchment');
|
|
if (range.length) {
|
quill.removeFormat(range, Quill.sources.USER);
|
} else {
|
Object.keys(quill.getFormat(range)).forEach(function (key) {
|
if (parchment.query(key, parchment.Scope.INLINE)) {
|
quill.format(key, false);
|
}
|
});
|
}
|
}
|
break;
|
|
case 'undo':
|
quill.history.undo();
|
break;
|
|
case 'redo':
|
quill.history.redo();
|
break;
|
|
case 'blur':
|
quill.blur();
|
break;
|
|
case 'getSelectionText':
|
range = quill.selection.savedRange;
|
res = {
|
text: ''
|
};
|
|
if (range && range.length !== 0) {
|
res.text = quill.getText(range.index, range.length);
|
}
|
|
break;
|
|
case 'scrollIntoView':
|
quill.scrollIntoView();
|
break;
|
|
default:
|
break;
|
}
|
|
this.updateStatus(range);
|
} else {
|
errMsg = 'not ready';
|
}
|
|
if (callbackId) {
|
UniViewJSBridge.publishHandler('onEditorMethodCallback', {
|
callbackId: callbackId,
|
data: Object.assign({}, res, {
|
errMsg: "".concat(type, ":").concat(errMsg ? 'fail ' + errMsg : 'ok')
|
})
|
}, this.$page.id);
|
}
|
},
|
setPlaceHolder: function setPlaceHolder(value) {
|
var placeHolderAttrName = 'data-placeholder';
|
var QuillRoot = this.quill.root;
|
QuillRoot.getAttribute(placeHolderAttrName) !== value && QuillRoot.setAttribute(placeHolderAttrName, value);
|
},
|
initQuill: function initQuill(imageResizeModules) {
|
var _this2 = this;
|
|
var Quill = window.Quill;
|
_formats__WEBPACK_IMPORTED_MODULE_2__[/* register */ "a"](Quill);
|
var options = {
|
toolbar: false,
|
readOnly: this.readOnly,
|
placeholder: this.placeholder,
|
modules: {}
|
};
|
|
if (imageResizeModules.length) {
|
Quill.register('modules/ImageResize', window.ImageResize.default);
|
options.modules.ImageResize = {
|
modules: imageResizeModules
|
};
|
}
|
|
var quill = this.quill = new Quill(this.$el, options);
|
var $el = quill.root;
|
var events = ['focus', 'blur', 'input'];
|
events.forEach(function (name) {
|
$el.addEventListener(name, function ($event) {
|
var contents = _this2.getContents();
|
|
if (name === 'input') {
|
if (isiOS()) {
|
var regExpContent = (contents.html.match(/<span [\s\S]*>([\s\S]*)<\/span>/) || [])[1];
|
var placeholder = regExpContent && regExpContent.replace(/\s/g, '') ? '' : _this2.placeholder;
|
|
_this2.setPlaceHolder(placeholder);
|
}
|
|
$event.stopPropagation();
|
} else {
|
_this2.$trigger(name, $event, contents);
|
}
|
});
|
});
|
quill.on(Quill.events.TEXT_CHANGE, function () {
|
if (!textChanging) {
|
_this2.$trigger('input', {}, _this2.getContents());
|
}
|
});
|
quill.on(Quill.events.SELECTION_CHANGE, this.updateStatus.bind(this));
|
quill.on(Quill.events.SCROLL_OPTIMIZE, function () {
|
var range = quill.selection.getRange()[0];
|
|
_this2.updateStatus(range);
|
});
|
quill.clipboard.addMatcher(Node.ELEMENT_NODE, function (node, delta) {
|
if (_this2.skipMatcher) {
|
return delta;
|
}
|
|
delta.ops = delta.ops.filter(function (_ref2) {
|
var insert = _ref2.insert;
|
return typeof insert === 'string';
|
}).map(function (_ref3) {
|
var insert = _ref3.insert;
|
return {
|
insert: insert
|
};
|
});
|
return delta;
|
});
|
this.initKeyboard($el);
|
this.quillReady = true;
|
this.$trigger('ready', event, {});
|
},
|
getContents: function getContents() {
|
var quill = this.quill;
|
var html = quill.root.innerHTML;
|
var text = quill.getText();
|
var delta = quill.getContents();
|
return {
|
html: html,
|
text: text,
|
delta: delta
|
};
|
},
|
html2delta: function html2delta(html) {
|
var tags = ['span', 'strong', 'b', 'ins', 'em', 'i', 'u', 'a', 'del', 's', 'sub', 'sup', 'img', 'div', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'ol', 'ul', 'li', 'br'];
|
var content = '';
|
var disable;
|
Object(uni_helpers_html_parser__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(html, {
|
start: function start(tag, attrs, unary) {
|
if (!tags.includes(tag)) {
|
disable = !unary;
|
return;
|
}
|
|
disable = false;
|
var arrts = attrs.map(function (_ref4) {
|
var name = _ref4.name,
|
value = _ref4.value;
|
return "".concat(name, "=\"").concat(value, "\"");
|
}).join(' ');
|
var start = "<".concat(tag, " ").concat(arrts, " ").concat(unary ? '/' : '', ">");
|
content += start;
|
},
|
end: function end(tag) {
|
if (!disable) {
|
content += "</".concat(tag, ">");
|
}
|
},
|
chars: function chars(text) {
|
if (!disable) {
|
content += text;
|
}
|
}
|
});
|
this.skipMatcher = true;
|
var delta = this.quill.clipboard.convert(content);
|
this.skipMatcher = false;
|
return delta;
|
},
|
updateStatus: function updateStatus(range) {
|
var _this3 = this;
|
|
var status = range ? this.quill.getFormat(range) : {};
|
var keys = Object.keys(status);
|
|
if (keys.length !== Object.keys(this.__status || {}).length || keys.find(function (key) {
|
return status[key] !== _this3.__status[key];
|
})) {
|
this.__status = status;
|
this.$trigger('statuschange', {}, status);
|
}
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 34 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 35 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 36 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 37 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 38 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Label',
|
mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* emitter */ "a"]],
|
props: {
|
for: {
|
type: String,
|
default: ''
|
}
|
},
|
computed: {
|
pointer: function pointer() {
|
return this.for || this.$slots.default && this.$slots.default.length;
|
}
|
},
|
methods: {
|
_onClick: function _onClick($event) {
|
var stopPropagation = /^uni-(checkbox|radio|switch)-/.test($event.target.className);
|
|
if (!stopPropagation) {
|
stopPropagation = /^uni-(checkbox|radio|switch|button)$/i.test($event.target.tagName);
|
}
|
|
if (stopPropagation) {
|
return;
|
}
|
|
if (this.for) {
|
UniViewJSBridge.emit('uni-label-click-' + this.$page.id + '-' + this.for, $event, true);
|
} else {
|
this.$broadcast(['Checkbox', 'Radio', 'Switch', 'Button'], 'uni-label-click', $event, true);
|
}
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 39 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 40 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 41 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 42 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 43 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 44 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 45 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 46 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 47 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 48 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 49 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 50 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 51 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 52 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 53 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 54 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 55 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 56 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 57 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
/* harmony import */ var _mixins_native__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
var _attrs = ['adpid', 'data'];
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Ad',
|
mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"], _mixins_native__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]],
|
props: {
|
adpid: {
|
type: [Number, String],
|
default: ''
|
},
|
data: {
|
type: Object,
|
default: null
|
},
|
dataCount: {
|
type: Number,
|
default: 5
|
},
|
channel: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
hidden: false
|
};
|
},
|
computed: {
|
attrs: function attrs() {
|
var _this = this;
|
|
var obj = {};
|
|
_attrs.forEach(function (key) {
|
var val = _this.$props[key];
|
val = key === 'src' ? _this.$getRealPath(val) : val;
|
obj[key.replace(/[A-Z]/g, function (str) {
|
return '-' + str.toLowerCase();
|
})] = val;
|
});
|
|
return obj;
|
}
|
},
|
watch: {
|
hidden: function hidden(val) {
|
this.adView && this.adView[val ? 'hide' : 'show']();
|
},
|
adpid: function adpid(val) {
|
if (val) {
|
this._loadData(val);
|
}
|
},
|
data: function data(val) {
|
if (val) {
|
this._fillData(val);
|
}
|
}
|
},
|
mounted: function mounted() {
|
var _this2 = this;
|
|
this._onParentReady(function () {
|
_this2._adId = 'AdView-' + _this2._newGUID();
|
var adStyle = Object.assign({
|
id: _this2._adId
|
}, _this2.position);
|
var adView = _this2.adView = plus.ad.createAdView(adStyle);
|
adView.interceptTouchEvent(false);
|
plus.webview.currentWebview().append(adView);
|
|
if (_this2.hidden) {
|
adView.hide();
|
}
|
|
_this2.$watch('attrs', function () {
|
_this2._request();
|
}, {
|
deep: true
|
});
|
|
_this2.$watch('position', function () {
|
_this2.adView && _this2.adView.setStyle(_this2.position);
|
}, {
|
deep: true
|
}); // 模板渲染有效
|
|
|
adView.setDislikeListener && adView.setDislikeListener(function (data) {
|
_this2.adView && _this2.adView.close();
|
_this2.$refs.container.style.height = '0px';
|
|
_this2._updateView();
|
|
_this2.$trigger('close', {}, data);
|
});
|
adView.setRenderingListener && adView.setRenderingListener(function (data) {
|
if (data.result === 0) {
|
_this2.$refs.container.style.height = data.height + 'px';
|
|
_this2._updateView();
|
} else {
|
_this2.$trigger('error', {}, {
|
errCode: data.result
|
});
|
}
|
});
|
adView.setAdClickedListener(function (data) {
|
_this2.$trigger('adclicked', {}, data);
|
});
|
_this2._callbackId = _this2.$page.id + _this2._adId;
|
UniViewJSBridge.subscribe(_this2._callbackId, _this2._handleAdData.bind(_this2));
|
|
_this2._request();
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.adView && this.adView.close();
|
delete this.adView;
|
},
|
methods: {
|
_handleAdData: function _handleAdData(_ref) {
|
var type = _ref.type,
|
_ref$data = _ref.data,
|
data = _ref$data === void 0 ? {} : _ref$data;
|
|
switch (type) {
|
case 'success':
|
this._fillData(data);
|
|
break;
|
|
case 'fail':
|
this.$trigger('error', {}, data);
|
break;
|
}
|
},
|
_request: function _request() {
|
if (!this.adView) {
|
return;
|
}
|
|
if (this.data) {
|
this._fillData(this.data);
|
} else if (this.adpid) {
|
this._loadData();
|
}
|
},
|
_loadData: function _loadData(adpid) {
|
var data = {
|
adpid: adpid || this.adpid,
|
width: this.position.width,
|
count: this.dataCount,
|
ext: {
|
channel: this.channel
|
}
|
};
|
UniViewJSBridge.publishHandler('onAdMethodCallback', {
|
callbackId: this._callbackId,
|
data: data
|
}, this.$page.id);
|
},
|
_fillData: function _fillData(data) {
|
this.adView.renderingBind(data);
|
this.$trigger('load', {}, {});
|
},
|
_updateView: function _updateView() {
|
window.dispatchEvent(new CustomEvent('updateview'));
|
},
|
_newGUID: function _newGUID() {
|
var guid = '';
|
var format = 'xxxxxxxx-xxxx';
|
|
for (var i = 0; i < format.length; i++) {
|
if (format[i] === 'x') {
|
guid += (Math.random() * 16 | 0).toString(16);
|
} else {
|
guid += format[i];
|
}
|
}
|
|
return guid.toUpperCase();
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 58 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 59 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 60 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 61 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
/* harmony import */ var _mixins_native__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
var methods = ['getCenterLocation', 'moveToLocation', 'getRegion', 'getScale', '$getAppMap']; // const events = [
|
// 'markertap',
|
// 'callouttap',
|
// 'controltap',
|
// 'regionchange',
|
// 'tap',
|
// 'updated'
|
// ]
|
|
var _attrs = ['latitude', 'longitude', 'scale', 'markers', 'polyline', 'circles', 'controls', 'show-location'];
|
|
var convertCoordinates = function convertCoordinates(lng, lat, callback) {
|
// plus.maps.Map.convertCoordinates(new plus.maps.Point(lng, lat), {
|
// coordType: 'gcj02'
|
// }, callback)
|
callback({
|
coord: {
|
latitude: lat,
|
longitude: lng
|
}
|
});
|
};
|
|
function parseHex(color) {
|
if (color.indexOf('#') !== 0) {
|
return {
|
color: color,
|
opacity: 1
|
};
|
}
|
|
var opacity = color.substr(7, 2);
|
return {
|
color: color.substr(0, 7),
|
opacity: opacity ? Number('0x' + opacity) / 255 : 1
|
};
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Map',
|
mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"], _mixins_native__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]],
|
props: {
|
id: {
|
type: String,
|
default: ''
|
},
|
latitude: {
|
type: [Number, String],
|
default: ''
|
},
|
longitude: {
|
type: [Number, String],
|
default: ''
|
},
|
scale: {
|
type: [String, Number],
|
default: 16
|
},
|
markers: {
|
type: Array,
|
default: function _default() {
|
return [];
|
}
|
},
|
polyline: {
|
type: Array,
|
default: function _default() {
|
return [];
|
}
|
},
|
circles: {
|
type: Array,
|
default: function _default() {
|
return [];
|
}
|
},
|
controls: {
|
type: Array,
|
default: function _default() {
|
return [];
|
}
|
}
|
},
|
data: function data() {
|
return {
|
style: {
|
top: '0px',
|
left: '0px',
|
width: '0px',
|
height: '0px',
|
position: 'static'
|
},
|
hidden: false
|
};
|
},
|
computed: {
|
attrs: function attrs() {
|
var _this = this;
|
|
var obj = {};
|
|
_attrs.forEach(function (key) {
|
var val = _this.$props[key];
|
val = key === 'src' ? _this.$getRealPath(val) : val;
|
obj[key.replace(/[A-Z]/g, function (str) {
|
return '-' + str.toLowerCase();
|
})] = val;
|
});
|
|
return obj;
|
},
|
mapControls: function mapControls() {
|
var _this2 = this;
|
|
var list = this.controls.map(function (control) {
|
var position = {
|
position: 'absolute'
|
};
|
['top', 'left', 'width', 'height'].forEach(function (key) {
|
if (control.position[key]) {
|
position[key] = control.position[key] + 'px';
|
}
|
});
|
return {
|
id: control.id,
|
iconPath: _this2.$getRealPath(control.iconPath),
|
position: position
|
};
|
});
|
return list;
|
}
|
},
|
watch: {
|
hidden: function hidden(val) {
|
this.map && this.map[val ? 'hide' : 'show']();
|
},
|
scale: function scale(val) {
|
this.map && this.map.setZoom(parseInt(val));
|
},
|
latitude: function latitude(val) {
|
this.map && this.map.setStyles({
|
center: new plus.maps.Point(this.longitude, this.latitude)
|
});
|
},
|
longitude: function longitude(val) {
|
this.map && this.map.setStyles({
|
center: new plus.maps.Point(this.longitude, this.latitude)
|
});
|
},
|
markers: function markers(val) {
|
this.map && this._addMarkers(val, true);
|
},
|
polyline: function polyline(val) {
|
this.map && this._addMapLines(val);
|
},
|
circles: function circles(val) {
|
this.map && this._addMapCircles(val);
|
}
|
},
|
mounted: function mounted() {
|
var _this3 = this;
|
|
this._onParentReady(function () {
|
var mapStyle = Object.assign({}, _this3.attrs, _this3.position);
|
|
if (_this3.latitude && _this3.longitude) {
|
mapStyle.center = new plus.maps.Point(_this3.longitude, _this3.latitude);
|
}
|
|
var map = _this3.map = plus.maps.create(_this3.$page.id + '-map-' + (_this3.id || Date.now()), mapStyle);
|
map.__markers__ = [];
|
map.__markers_map__ = {};
|
map.__lines__ = [];
|
map.__circles__ = [];
|
map.setZoom(parseInt(_this3.scale));
|
plus.webview.currentWebview().append(map);
|
|
if (_this3.hidden) {
|
map.hide();
|
}
|
|
_this3.$watch('position', function () {
|
_this3.map && _this3.map.setStyles(_this3.position);
|
}, {
|
deep: true
|
});
|
|
map.onclick = function (e) {
|
_this3.$trigger('click', {}, e);
|
};
|
|
map.onstatuschanged = function (e) {
|
_this3.$trigger('regionchange', {}, {});
|
};
|
|
_this3._addMarkers(_this3.markers);
|
|
_this3._addMapLines(_this3.polyline);
|
|
_this3._addMapCircles(_this3.circles);
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.map && this.map.close();
|
delete this.map;
|
},
|
methods: {
|
_handleSubscribe: function _handleSubscribe(_ref) {
|
var type = _ref.type,
|
_ref$data = _ref.data,
|
data = _ref$data === void 0 ? {} : _ref$data;
|
|
if (!methods.includes(type)) {
|
return;
|
}
|
|
this.map && this[type](data);
|
},
|
moveToLocation: function moveToLocation(_ref2) {
|
var callbackId = _ref2.callbackId,
|
longitude = _ref2.longitude,
|
latitude = _ref2.latitude;
|
this.map.setCenter(new plus.maps.Point(longitude || this.longitude, latitude || this.latitude));
|
|
this._publishHandler(callbackId, {
|
errMsg: 'moveToLocation:ok'
|
});
|
},
|
getCenterLocation: function getCenterLocation(_ref3) {
|
var _this4 = this;
|
|
var callbackId = _ref3.callbackId;
|
this.map.getCurrentCenter(function (state, point) {
|
_this4._publishHandler(callbackId, {
|
longitude: point.longitude,
|
latitude: point.latitude,
|
errMsg: 'getCenterLocation:ok'
|
});
|
});
|
},
|
getRegion: function getRegion(_ref4) {
|
var callbackId = _ref4.callbackId;
|
var rect = this.map.getBounds();
|
|
this._publishHandler(callbackId, {
|
southwest: rect.southwest,
|
northeast: rect.northeast || rect.northease,
|
// 5plus API 名字写错了
|
errMsg: 'getRegion:ok'
|
});
|
},
|
getScale: function getScale(_ref5) {
|
var callbackId = _ref5.callbackId;
|
|
this._publishHandler(callbackId, {
|
scale: this.map.getZoom(),
|
errMsg: 'getScale:ok'
|
});
|
},
|
controlclick: function controlclick(e) {
|
this.$trigger('controltap', {}, {
|
controlId: e.id
|
});
|
},
|
_publishHandler: function _publishHandler(callbackId, data) {
|
UniViewJSBridge.publishHandler('onMapMethodCallback', {
|
callbackId: callbackId,
|
data: data
|
}, this.$page.id);
|
},
|
_addMarker: function _addMarker(nativeMap, marker) {
|
var _this5 = this;
|
|
var id = marker.id,
|
latitude = marker.latitude,
|
longitude = marker.longitude,
|
iconPath = marker.iconPath,
|
callout = marker.callout,
|
label = marker.label;
|
convertCoordinates(longitude, latitude, function (res) {
|
var _res$coord = res.coord,
|
latitude = _res$coord.latitude,
|
longitude = _res$coord.longitude;
|
var nativeMarker = new plus.maps.Marker(new plus.maps.Point(longitude, latitude));
|
|
if (iconPath) {
|
nativeMarker.setIcon(_this5.$getRealPath(iconPath));
|
}
|
|
if (label && label.content) {
|
nativeMarker.setLabel(label.content);
|
}
|
|
var nativeBubble = false;
|
|
if (callout && callout.content) {
|
nativeBubble = new plus.maps.Bubble(callout.content);
|
}
|
|
if (nativeBubble) {
|
nativeMarker.setBubble(nativeBubble);
|
}
|
|
if (id || id === 0) {
|
nativeMarker.onclick = function (e) {
|
_this5.$trigger('markertap', {}, {
|
markerId: id
|
});
|
};
|
|
if (nativeBubble) {
|
nativeBubble.onclick = function () {
|
_this5.$trigger('callouttap', {}, {
|
markerId: id
|
});
|
};
|
}
|
}
|
|
nativeMap.addOverlay(nativeMarker);
|
|
nativeMap.__markers__.push(nativeMarker);
|
|
nativeMap.__markers_map__[id + ''] = nativeMarker;
|
});
|
},
|
_clearMarkers: function _clearMarkers() {
|
var map = this.map;
|
var markers = map.__markers__;
|
markers.forEach(function (marker) {
|
map.removeOverlay(marker);
|
});
|
map.__markers__ = [];
|
map.__markers_map__ = {};
|
},
|
_addMarkers: function _addMarkers(markers, clear) {
|
var _this6 = this;
|
|
if (clear) {
|
this._clearMarkers();
|
}
|
|
markers.forEach(function (marker) {
|
_this6._addMarker(_this6.map, marker);
|
});
|
},
|
_translateMapMarker: function _translateMapMarker(_ref6) {
|
var autoRotate = _ref6.autoRotate,
|
callbackId = _ref6.callbackId,
|
destination = _ref6.destination,
|
duration = _ref6.duration,
|
markerId = _ref6.markerId;
|
var nativeMarker = this.map.__markers_map__[markerId + ''];
|
|
if (nativeMarker) {
|
nativeMarker.setPoint(new plus.maps.Point(destination.longitude, destination.latitude));
|
}
|
},
|
_addMapLines: function _addMapLines(lines) {
|
var nativeMap = this.map;
|
|
if (nativeMap.__lines__.length > 0) {
|
nativeMap.__lines__.forEach(function (circle) {
|
nativeMap.removeOverlay(circle);
|
});
|
|
nativeMap.__lines__ = [];
|
}
|
|
lines.forEach(function (line) {
|
var color = line.color,
|
width = line.width;
|
var points = line.points.map(function (point) {
|
return new plus.maps.Point(point.longitude, point.latitude);
|
});
|
var polyline = new plus.maps.Polyline(points);
|
|
if (color) {
|
var strokeStyle = parseHex(color);
|
polyline.setStrokeColor(strokeStyle.color);
|
polyline.setStrokeOpacity(strokeStyle.opacity);
|
}
|
|
if (width) {
|
polyline.setLineWidth(width);
|
}
|
|
nativeMap.addOverlay(polyline);
|
|
nativeMap.__lines__.push(polyline);
|
});
|
},
|
_addMapCircles: function _addMapCircles(circles) {
|
var nativeMap = this.map;
|
|
if (nativeMap.__circles__.length > 0) {
|
nativeMap.__circles__.forEach(function (circle) {
|
nativeMap.removeOverlay(circle);
|
});
|
|
nativeMap.__circles__ = [];
|
}
|
|
circles.forEach(function (circle) {
|
var latitude = circle.latitude,
|
longitude = circle.longitude,
|
color = circle.color,
|
fillColor = circle.fillColor,
|
radius = circle.radius,
|
strokeWidth = circle.strokeWidth;
|
var nativeCircle = new plus.maps.Circle(new plus.maps.Point(longitude, latitude), radius);
|
|
if (color) {
|
var strokeStyle = parseHex(color);
|
nativeCircle.setStrokeColor(strokeStyle.color);
|
nativeCircle.setStrokeOpacity(strokeStyle.opacity);
|
}
|
|
if (fillColor) {
|
var fillStyle = parseHex(fillColor);
|
nativeCircle.setFillColor(fillStyle.color);
|
nativeCircle.setFillOpacity(fillStyle.opacity);
|
}
|
|
if (strokeWidth) {
|
nativeCircle.setLineWidth(strokeWidth);
|
}
|
|
nativeMap.addOverlay(nativeCircle);
|
|
nativeMap.__circles__.push(nativeCircle);
|
});
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 62 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 63 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 64 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 65 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
/* harmony import */ var uni_helpers_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
|
//
|
//
|
//
|
|
|
var webview = false;
|
|
var insertHTMLWebView = function insertHTMLWebView(_ref) {
|
var htmlId = _ref.htmlId;
|
var parentWebview = plus.webview.currentWebview(); // fixed by hxy web-view 组件所在的 webview 不注入 uni-app 框架
|
|
var styles = {
|
'uni-app': 'none',
|
isUniH5: true
|
};
|
var parentTitleNView = parentWebview.getTitleNView();
|
|
if (parentTitleNView) {
|
if (plus.navigator.isImmersedStatusbar()) {
|
styles.top = uni_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* NAVBAR_HEIGHT */ "a"] + plus.navigator.getStatusbarHeight();
|
} else {
|
styles.top = uni_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* NAVBAR_HEIGHT */ "a"];
|
}
|
|
styles.bottom = 0;
|
}
|
|
webview = plus.webview.create('', htmlId, styles);
|
|
if (parentTitleNView) {
|
webview.addEventListener('titleUpdate', function () {
|
var title = webview.getTitle();
|
parentWebview.setStyle({
|
titleNView: {
|
// iOS titleText 为空字符串时 按钮会隐藏
|
titleText: !title || title === 'null' ? ' ' : title
|
}
|
});
|
});
|
}
|
|
plus.webview.currentWebview().append(webview);
|
};
|
|
var updateHTMLWebView = function updateHTMLWebView(_ref2) {
|
var htmlId = _ref2.htmlId,
|
src = _ref2.src,
|
webviewStyles = _ref2.webviewStyles;
|
// fixed by xxx 非空时才执行更新操作
|
var realPath = src || '';
|
|
if (!realPath) {
|
return;
|
}
|
|
if (/^(http|https):\/\//.test(realPath) && webviewStyles.progress) {
|
webview.setStyle({
|
progress: {
|
color: webviewStyles.progress.color
|
}
|
});
|
}
|
|
webview.loadURL(realPath);
|
};
|
|
var removeHTMLWebView = function removeHTMLWebView() {
|
plus.webview.currentWebview().remove(webview);
|
webview.close('none');
|
webview = false;
|
};
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'WebView',
|
props: {
|
src: {
|
type: String,
|
default: ''
|
},
|
webviewStyles: {
|
type: Object,
|
default: function _default() {
|
return {};
|
}
|
}
|
},
|
watch: {
|
src: function src(val, oldVal) {
|
webview && updateHTMLWebView({
|
src: this.$getRealPath(val),
|
webviewStyles: this.webviewStyles
|
});
|
}
|
},
|
mounted: function mounted() {
|
var _this = this;
|
|
this._onParentReady(function () {
|
_this.htmlId = _constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_ID_PREFIX */ "k"] + _this.$page.id;
|
insertHTMLWebView({
|
htmlId: _this.htmlId
|
});
|
updateHTMLWebView({
|
src: _this.$getRealPath(_this.src),
|
webviewStyles: _this.webviewStyles
|
});
|
UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_INSERTED */ "l"], {}, _this.$page.id);
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
removeHTMLWebView();
|
UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_REMOVED */ "n"], {}, this.$page.id);
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 66 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 67 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ON_PAGE_CREATE; });
|
var ON_PAGE_CREATE = 'onPageCreate';
|
|
/***/ }),
|
/* 68 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return definePage; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getPageVueComponent; });
|
/* unused harmony export createPage */
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
var pageFactory = Object.create(null);
|
function definePage(name, createPageVueComponent) {
|
pageFactory[name] = createPageVueComponent;
|
}
|
var getPageVueComponent = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* cached */ "a"])(function (pagePath) {
|
return pageFactory[pagePath]();
|
});
|
function createPage(pagePath, pageId, pageQuery, pageInstance) {
|
if (!pageFactory[pagePath]) {
|
console.error("".concat(pagePath, " not found"));
|
}
|
|
var startTime = Date.now();
|
var pageVm = new (getPageVueComponent(pagePath))({
|
mpType: 'page',
|
pageId: pageId,
|
pagePath: pagePath,
|
pageQuery: pageQuery,
|
pageInstance: pageInstance
|
});
|
|
if (true) {
|
console.log("new ".concat(pagePath, "[").concat(pageId, "]:time(").concat(Date.now() - startTime, ")"));
|
}
|
|
return pageVm;
|
}
|
|
/***/ }),
|
/* 69 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCurrentPages; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setCurrentPage; });
|
var pages = [];
|
function getCurrentPages() {
|
return pages;
|
}
|
function setCurrentPage(pageId, pagePath) {
|
pages.length = 0;
|
pages.push({
|
$page: {
|
id: pageId,
|
route: pagePath
|
}
|
});
|
}
|
|
/***/ }),
|
/* 70 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HTMLParser; });
|
/*
|
* HTML5 Parser By Sam Blowes
|
*
|
* Designed for HTML5 documents
|
*
|
* Original code by John Resig (ejohn.org)
|
* http://ejohn.org/blog/pure-javascript-html-parser/
|
* Original code by Erik Arvidsson, Mozilla Public License
|
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
|
*
|
* ----------------------------------------------------------------------------
|
* License
|
* ----------------------------------------------------------------------------
|
*
|
* This code is triple licensed using Apache Software License 2.0,
|
* Mozilla Public License or GNU Public License
|
*
|
* ////////////////////////////////////////////////////////////////////////////
|
*
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* use this file except in compliance with the License. You may obtain a copy
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
*
|
* ////////////////////////////////////////////////////////////////////////////
|
*
|
* The contents of this file are subject to the Mozilla Public License
|
* Version 1.1 (the "License"); you may not use this file except in
|
* compliance with the License. You may obtain a copy of the License at
|
* http://www.mozilla.org/MPL/
|
*
|
* Software distributed under the License is distributed on an "AS IS"
|
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* License for the specific language governing rights and limitations
|
* under the License.
|
*
|
* The Original Code is Simple HTML Parser.
|
*
|
* The Initial Developer of the Original Code is Erik Arvidsson.
|
* Portions created by Erik Arvidssson are Copyright (C) 2004. All Rights
|
* Reserved.
|
*
|
* ////////////////////////////////////////////////////////////////////////////
|
*
|
* This program is free software; you can redistribute it and/or
|
* modify it under the terms of the GNU General Public License
|
* as published by the Free Software Foundation; either version 2
|
* of the License, or (at your option) any later version.
|
*
|
* This program is distributed in the hope that it will be useful,
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* GNU General Public License for more details.
|
*
|
* You should have received a copy of the GNU General Public License
|
* along with this program; if not, write to the Free Software
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
*
|
* ----------------------------------------------------------------------------
|
* Usage
|
* ----------------------------------------------------------------------------
|
*
|
* // Use like so:
|
* HTMLParser(htmlString, {
|
* start: function(tag, attrs, unary) {},
|
* end: function(tag) {},
|
* chars: function(text) {},
|
* comment: function(text) {}
|
* });
|
*
|
* // or to get an XML string:
|
* HTMLtoXML(htmlString);
|
*
|
* // or to get an XML DOM Document
|
* HTMLtoDOM(htmlString);
|
*
|
* // or to inject into an existing document/DOM node
|
* HTMLtoDOM(htmlString, document);
|
* HTMLtoDOM(htmlString, document.body);
|
*
|
*/
|
// Regular Expressions for parsing tags and attributes
|
var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
|
var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
|
var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // Empty Elements - HTML 5
|
|
var empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr'); // Block Elements - HTML 5
|
// fixed by xxx 将 ins 标签从块级名单中移除
|
|
var block = makeMap('a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'); // Inline Elements - HTML 5
|
|
var inline = makeMap('abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'); // Elements that you can, intentionally, leave open
|
// (and which close themselves)
|
|
var closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); // Attributes that have their values filled in disabled="disabled"
|
|
var fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'); // Special Elements (can contain anything)
|
|
var special = makeMap('script,style');
|
function HTMLParser(html, handler) {
|
var index;
|
var chars;
|
var match;
|
var stack = [];
|
var last = html;
|
|
stack.last = function () {
|
return this[this.length - 1];
|
};
|
|
while (html) {
|
chars = true; // Make sure we're not in a script or style element
|
|
if (!stack.last() || !special[stack.last()]) {
|
// Comment
|
if (html.indexOf('<!--') == 0) {
|
index = html.indexOf('-->');
|
|
if (index >= 0) {
|
if (handler.comment) {
|
handler.comment(html.substring(4, index));
|
}
|
|
html = html.substring(index + 3);
|
chars = false;
|
} // end tag
|
|
} else if (html.indexOf('</') == 0) {
|
match = html.match(endTag);
|
|
if (match) {
|
html = html.substring(match[0].length);
|
match[0].replace(endTag, parseEndTag);
|
chars = false;
|
} // start tag
|
|
} else if (html.indexOf('<') == 0) {
|
match = html.match(startTag);
|
|
if (match) {
|
html = html.substring(match[0].length);
|
match[0].replace(startTag, parseStartTag);
|
chars = false;
|
}
|
}
|
|
if (chars) {
|
index = html.indexOf('<');
|
var text = index < 0 ? html : html.substring(0, index);
|
html = index < 0 ? '' : html.substring(index);
|
|
if (handler.chars) {
|
handler.chars(text);
|
}
|
}
|
} else {
|
html = html.replace(new RegExp('([\\s\\S]*?)<\/' + stack.last() + '[^>]*>'), function (all, text) {
|
text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, '$1$2');
|
|
if (handler.chars) {
|
handler.chars(text);
|
}
|
|
return '';
|
});
|
parseEndTag('', stack.last());
|
}
|
|
if (html == last) {
|
throw 'Parse Error: ' + html;
|
}
|
|
last = html;
|
} // Clean up any remaining tags
|
|
|
parseEndTag();
|
|
function parseStartTag(tag, tagName, rest, unary) {
|
tagName = tagName.toLowerCase();
|
|
if (block[tagName]) {
|
while (stack.last() && inline[stack.last()]) {
|
parseEndTag('', stack.last());
|
}
|
}
|
|
if (closeSelf[tagName] && stack.last() == tagName) {
|
parseEndTag('', tagName);
|
}
|
|
unary = empty[tagName] || !!unary;
|
|
if (!unary) {
|
stack.push(tagName);
|
}
|
|
if (handler.start) {
|
var attrs = [];
|
rest.replace(attr, function (match, name) {
|
var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : '';
|
attrs.push({
|
name: name,
|
value: value,
|
escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') // "
|
|
});
|
});
|
|
if (handler.start) {
|
handler.start(tagName, attrs, unary);
|
}
|
}
|
}
|
|
function parseEndTag(tag, tagName) {
|
// If no tag name is provided, clean shop
|
if (!tagName) {
|
var pos = 0;
|
} // Find the closest opened tag of the same type
|
else {
|
for (var pos = stack.length - 1; pos >= 0; pos--) {
|
if (stack[pos] == tagName) {
|
break;
|
}
|
}
|
}
|
|
if (pos >= 0) {
|
// Close all the open elements, up the stack
|
for (var i = stack.length - 1; i >= pos; i--) {
|
if (handler.end) {
|
handler.end(stack[i]);
|
}
|
} // Remove the open elements from the stack
|
|
|
stack.length = pos;
|
}
|
}
|
}
|
;
|
|
function makeMap(str) {
|
var obj = {};
|
var items = str.split(',');
|
|
for (var i = 0; i < items.length; i++) {
|
obj[items[i]] = true;
|
}
|
|
return obj;
|
}
|
|
/***/ }),
|
/* 71 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Friction; });
|
function Friction(e) {
|
this._drag = e;
|
this._dragLog = Math.log(e);
|
this._x = 0;
|
this._v = 0;
|
this._startTime = 0;
|
}
|
|
Friction.prototype.set = function (e, t) {
|
this._x = e;
|
this._v = t;
|
this._startTime = new Date().getTime();
|
};
|
|
Friction.prototype.setVelocityByEnd = function (e) {
|
this._v = (e - this._x) * this._dragLog / (Math.pow(this._drag, 100) - 1);
|
};
|
|
Friction.prototype.x = function (e) {
|
if (e === undefined) {
|
e = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
var t;
|
t = e === this._dt && this._powDragDt ? this._powDragDt : this._powDragDt = Math.pow(this._drag, e);
|
this._dt = e;
|
return this._x + this._v * t / this._dragLog - this._v / this._dragLog;
|
};
|
|
Friction.prototype.dx = function (e) {
|
if (e === undefined) {
|
e = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
var t;
|
t = e === this._dt && this._powDragDt ? this._powDragDt : this._powDragDt = Math.pow(this._drag, e);
|
this._dt = e;
|
return this._v * t;
|
};
|
|
Friction.prototype.done = function () {
|
return Math.abs(this.dx()) < 3;
|
};
|
|
Friction.prototype.reconfigure = function (e) {
|
var t = this.x();
|
var n = this.dx();
|
this._drag = e;
|
this._dragLog = Math.log(e);
|
this.set(t, n);
|
};
|
|
Friction.prototype.configuration = function () {
|
var e = this;
|
return [{
|
label: 'Friction',
|
read: function read() {
|
return e._drag;
|
},
|
write: function write(t) {
|
e.reconfigure(t);
|
},
|
min: 0.001,
|
max: 0.1,
|
step: 0.001
|
}];
|
};
|
|
/***/ }),
|
/* 72 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Spring; });
|
function o(e, t, n) {
|
return e > t - n && e < t + n;
|
}
|
|
function a(e, t) {
|
return o(e, 0, t);
|
}
|
|
function Spring(e, t, n) {
|
this._m = e;
|
this._k = t;
|
this._c = n;
|
this._solution = null;
|
this._endPosition = 0;
|
this._startTime = 0;
|
}
|
|
Spring.prototype._solve = function (e, t) {
|
var n = this._c;
|
var i = this._m;
|
var r = this._k;
|
var o = n * n - 4 * i * r;
|
|
if (o === 0) {
|
var _a = -n / (2 * i);
|
|
var _s = e;
|
|
var _l = t / (_a * e);
|
|
return {
|
x: function x(e) {
|
return (_s + _l * e) * Math.pow(Math.E, _a * e);
|
},
|
dx: function dx(e) {
|
var t = Math.pow(Math.E, _a * e);
|
return _a * (_s + _l * e) * t + _l * t;
|
}
|
};
|
}
|
|
if (o > 0) {
|
var c = (-n - Math.sqrt(o)) / (2 * i);
|
var u = (-n + Math.sqrt(o)) / (2 * i);
|
|
var _l2 = (t - c * e) / (u - c);
|
|
var _s2 = e - _l2;
|
|
return {
|
x: function x(e) {
|
var t;
|
var n;
|
|
if (e === this._t) {
|
t = this._powER1T;
|
n = this._powER2T;
|
}
|
|
this._t = e;
|
|
if (!t) {
|
t = this._powER1T = Math.pow(Math.E, c * e);
|
}
|
|
if (!n) {
|
n = this._powER2T = Math.pow(Math.E, u * e);
|
}
|
|
return _s2 * t + _l2 * n;
|
},
|
dx: function dx(e) {
|
var t;
|
var n;
|
|
if (e === this._t) {
|
t = this._powER1T;
|
n = this._powER2T;
|
}
|
|
this._t = e;
|
|
if (!t) {
|
t = this._powER1T = Math.pow(Math.E, c * e);
|
}
|
|
if (!n) {
|
n = this._powER2T = Math.pow(Math.E, u * e);
|
}
|
|
return _s2 * c * t + _l2 * u * n;
|
}
|
};
|
}
|
|
var d = Math.sqrt(4 * i * r - n * n) / (2 * i);
|
var a = -n / 2 * i;
|
var s = e;
|
var l = (t - a * e) / d;
|
return {
|
x: function x(e) {
|
return Math.pow(Math.E, a * e) * (s * Math.cos(d * e) + l * Math.sin(d * e));
|
},
|
dx: function dx(e) {
|
var t = Math.pow(Math.E, a * e);
|
var n = Math.cos(d * e);
|
var i = Math.sin(d * e);
|
return t * (l * d * n - s * d * i) + a * t * (l * i + s * n);
|
}
|
};
|
};
|
|
Spring.prototype.x = function (e) {
|
if (e === undefined) {
|
e = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
return this._solution ? this._endPosition + this._solution.x(e) : 0;
|
};
|
|
Spring.prototype.dx = function (e) {
|
if (e === undefined) {
|
e = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
return this._solution ? this._solution.dx(e) : 0;
|
};
|
|
Spring.prototype.setEnd = function (e, t, n) {
|
if (!n) {
|
n = new Date().getTime();
|
}
|
|
if (e !== this._endPosition || !a(t, 0.4)) {
|
t = t || 0;
|
var i = this._endPosition;
|
|
if (this._solution) {
|
if (a(t, 0.4)) {
|
t = this._solution.dx((n - this._startTime) / 1e3);
|
}
|
|
i = this._solution.x((n - this._startTime) / 1e3);
|
|
if (a(t, 0.4)) {
|
t = 0;
|
}
|
|
if (a(i, 0.4)) {
|
i = 0;
|
}
|
|
i += this._endPosition;
|
}
|
|
if (!(this._solution && a(i - e, 0.4) && a(t, 0.4))) {
|
this._endPosition = e;
|
this._solution = this._solve(i - this._endPosition, t);
|
this._startTime = n;
|
}
|
}
|
};
|
|
Spring.prototype.snap = function (e) {
|
this._startTime = new Date().getTime();
|
this._endPosition = e;
|
this._solution = {
|
x: function x() {
|
return 0;
|
},
|
dx: function dx() {
|
return 0;
|
}
|
};
|
};
|
|
Spring.prototype.done = function (e) {
|
if (!e) {
|
e = new Date().getTime();
|
}
|
|
return o(this.x(), this._endPosition, 0.4) && a(this.dx(), 0.4);
|
};
|
|
Spring.prototype.reconfigure = function (e, t, n) {
|
this._m = e;
|
this._k = t;
|
this._c = n;
|
|
if (!this.done()) {
|
this._solution = this._solve(this.x() - this._endPosition, this.dx());
|
this._startTime = new Date().getTime();
|
}
|
};
|
|
Spring.prototype.springConstant = function () {
|
return this._k;
|
};
|
|
Spring.prototype.damping = function () {
|
return this._c;
|
};
|
|
Spring.prototype.configuration = function () {
|
function e(e, t) {
|
e.reconfigure(1, t, e.damping());
|
}
|
|
function t(e, t) {
|
e.reconfigure(1, e.springConstant(), t);
|
}
|
|
return [{
|
label: 'Spring Constant',
|
read: this.springConstant.bind(this),
|
write: e.bind(this, this),
|
min: 100,
|
max: 1e3
|
}, {
|
label: 'Damping',
|
read: this.damping.bind(this),
|
write: t.bind(this, this),
|
min: 1,
|
max: 500
|
}];
|
};
|
|
/***/ }),
|
/* 73 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
var base = ['borderRadius', 'borderColor', 'borderWidth', 'backgroundColor'];
|
var text = ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'color', 'textAlign', 'lineHeight', 'fontSize', 'fontWeight', 'textOverflow', 'whiteSpace'];
|
var image = [];
|
var textAlign = {
|
start: 'left',
|
end: 'right'
|
};
|
var index = 0;
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Cover',
|
data: function data() {
|
return {
|
style: {},
|
parentPosition: {}
|
};
|
},
|
computed: {
|
viewPosition: function viewPosition() {
|
var position = {};
|
|
for (var key in this.position) {
|
var val = this.position[key];
|
var valNumber = parseFloat(val);
|
var parentValNumber = parseFloat(this.parentPosition[key]);
|
|
if (key === 'top' || key === 'left') {
|
val = Math.max(valNumber, parentValNumber) + 'px';
|
} else if (key === 'width' || key === 'height') {
|
var _base = key === 'width' ? 'left' : 'top';
|
|
var parentStart = parseFloat(this.parentPosition[_base]);
|
var viewStart = parseFloat(this.position[_base]);
|
var diff1 = Math.max(parentStart - viewStart, 0);
|
var diff2 = Math.max(viewStart + valNumber - (parentStart + parentValNumber), 0);
|
val = Math.max(valNumber - diff1 - diff2, 0) + 'px';
|
}
|
|
position[key] = val;
|
}
|
|
return position;
|
},
|
tags: function tags() {
|
var position = this._getTagPosition();
|
|
var style = this.style;
|
var tags = [{
|
tag: 'rect',
|
position: position,
|
rectStyles: {
|
color: style.backgroundColor,
|
radius: style.borderRadius,
|
borderColor: style.borderColor,
|
borderWidth: style.borderWidth
|
}
|
}];
|
|
if (this.coverType === 'image') {
|
tags.push({
|
tag: 'img',
|
position: position,
|
src: this.coverContent
|
});
|
} else {
|
var lineSpacing = parseFloat(style.lineHeight) - parseFloat(style.fontSize);
|
var width = parseFloat(position.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
|
width = width < 0 ? 0 : width;
|
var height = parseFloat(position.height) - parseFloat(style.paddingTop) - lineSpacing / 2 - parseFloat(style.paddingBottom);
|
height = height < 0 ? 0 : height;
|
tags.push({
|
tag: 'font',
|
position: {
|
top: "".concat(parseFloat(position.top) + parseFloat(style.paddingTop) + lineSpacing / 2, "px"),
|
left: "".concat(parseFloat(position.left) + parseFloat(style.paddingLeft), "px"),
|
width: "".concat(width, "px"),
|
height: "".concat(height, "px")
|
},
|
textStyles: {
|
align: textAlign[style.textAlign] || style.textAlign,
|
color: style.color,
|
decoration: 'none',
|
lineSpacing: "".concat(lineSpacing, "px"),
|
margin: '0px',
|
overflow: style.textOverflow,
|
size: style.fontSize,
|
verticalAlign: 'top',
|
weight: style.fontWeight,
|
whiteSpace: style.whiteSpace
|
},
|
text: this.coverContent
|
});
|
}
|
|
return tags;
|
}
|
},
|
created: function created() {
|
var $parent = this.$parent;
|
|
while (!$parent.isNative && $parent !== this.$root) {
|
$parent = $parent.$parent;
|
}
|
|
this._nativeParent = $parent;
|
},
|
mounted: function mounted() {
|
var _this = this;
|
|
this._onParentReady(function (parentPosition) {
|
_this.parentPosition = _this._nativeParent.position || parentPosition;
|
|
_this._updateStyle();
|
|
_this._onCanInsert();
|
|
_this.$watch('hidden', function (val) {
|
_this.cover && _this.cover[val ? 'hide' : 'show']();
|
});
|
|
_this.$watch('viewPosition', function (val) {
|
_this.cover && _this.cover.setStyle(val);
|
}, {
|
deep: true
|
});
|
|
_this.$watch('tags', function () {
|
var cover = _this.cover;
|
|
if (cover) {
|
cover.reset();
|
cover.draw(_this.tags);
|
}
|
}, {
|
deep: true
|
});
|
|
_this.$on('uni-view-update', _this._requestStyleUpdate);
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
if (this._nativeParent.isNative) {
|
this.cover && this.cover.close();
|
delete this.cover;
|
}
|
},
|
methods: {
|
_onCanInsert: function _onCanInsert() {
|
var _this2 = this;
|
|
var cover = this.cover = new plus.nativeObj.View("cover-".concat(Date.now(), "-").concat(index++), this.viewPosition, this.tags);
|
plus.webview.currentWebview().append(cover);
|
|
if (this.hidden) {
|
cover.hide();
|
}
|
|
cover.addEventListener('click', function () {
|
_this2.$trigger('click', {}, {});
|
});
|
},
|
_getTagPosition: function _getTagPosition() {
|
var position = {};
|
|
for (var key in this.position) {
|
var val = this.position[key];
|
|
if (key === 'top' || key === 'left') {
|
val = Math.min(parseFloat(val) - parseFloat(this.parentPosition[key]), 0) + 'px';
|
}
|
|
position[key] = val;
|
}
|
|
return position;
|
},
|
_updateStyle: function _updateStyle() {
|
var _this3 = this;
|
|
var style = getComputedStyle(this.$el);
|
base.concat(text, image).forEach(function (key) {
|
_this3.$set(_this3.style, key, style[key]);
|
});
|
},
|
_requestStyleUpdate: function _requestStyleUpdate() {
|
var _this4 = this;
|
|
if (this._styleUpdateRequest) {
|
cancelAnimationFrame(this._styleUpdateRequest);
|
}
|
|
this._styleUpdateRequest = requestAnimationFrame(function () {
|
delete _this4._styleUpdateRequest;
|
|
_this4._updateStyle();
|
});
|
}
|
}
|
});
|
|
/***/ }),
|
/* 74 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Friction.js
|
var Friction = __webpack_require__(71);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Spring.js
|
var Spring = __webpack_require__(72);
|
|
// CONCATENATED MODULE: ./src/core/view/mixins/scroller/Scroll.js
|
|
|
function Scroll(extent, friction, spring) {
|
this._extent = extent;
|
this._friction = friction || new Friction["a" /* Friction */](0.01);
|
this._spring = spring || new Spring["a" /* Spring */](1, 90, 20);
|
this._startTime = 0;
|
this._springing = false;
|
this._springOffset = 0;
|
}
|
|
Scroll.prototype.snap = function (e, t) {
|
this._springOffset = 0;
|
this._springing = true;
|
|
this._spring.snap(e);
|
|
this._spring.setEnd(t);
|
};
|
|
Scroll.prototype.set = function (e, t) {
|
this._friction.set(e, t);
|
|
if (e > 0 && t >= 0) {
|
this._springOffset = 0;
|
this._springing = true;
|
|
this._spring.snap(e);
|
|
this._spring.setEnd(0);
|
} else {
|
if (e < -this._extent && t <= 0) {
|
this._springOffset = 0;
|
this._springing = true;
|
|
this._spring.snap(e);
|
|
this._spring.setEnd(-this._extent);
|
} else {
|
this._springing = false;
|
}
|
}
|
|
this._startTime = new Date().getTime();
|
};
|
|
Scroll.prototype.x = function (e) {
|
if (!this._startTime) {
|
return 0;
|
}
|
|
if (!e) {
|
e = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
if (this._springing) {
|
return this._spring.x() + this._springOffset;
|
}
|
|
var t = this._friction.x(e);
|
|
var n = this.dx(e);
|
|
if (t > 0 && n >= 0 || t < -this._extent && n <= 0) {
|
this._springing = true;
|
|
this._spring.setEnd(0, n);
|
|
if (t < -this._extent) {
|
this._springOffset = -this._extent;
|
} else {
|
this._springOffset = 0;
|
}
|
|
t = this._spring.x() + this._springOffset;
|
}
|
|
return t;
|
};
|
|
Scroll.prototype.dx = function (e) {
|
var t = 0;
|
t = this._lastTime === e ? this._lastDx : this._springing ? this._spring.dx(e) : this._friction.dx(e);
|
this._lastTime = e;
|
this._lastDx = t;
|
return t;
|
};
|
|
Scroll.prototype.done = function () {
|
return this._springing ? this._spring.done() : this._friction.done();
|
};
|
|
Scroll.prototype.setVelocityByEnd = function (e) {
|
this._friction.setVelocityByEnd(e);
|
};
|
|
Scroll.prototype.configuration = function () {
|
var e = this._friction.configuration();
|
|
e.push.apply(e, this._spring.configuration());
|
return e;
|
};
|
// CONCATENATED MODULE: ./src/core/view/mixins/scroller/Scroller.js
|
|
|
function i(scroll, t, n) {
|
function i(t, scroll, r, o) {
|
if (!t || !t.cancelled) {
|
r(scroll);
|
var a = scroll.done();
|
|
if (!a) {
|
if (!t.cancelled) {
|
t.id = requestAnimationFrame(i.bind(null, t, scroll, r, o));
|
}
|
}
|
|
if (a && o) {
|
o(scroll);
|
}
|
}
|
}
|
|
function r(scroll) {
|
if (scroll && scroll.id) {
|
cancelAnimationFrame(scroll.id);
|
}
|
|
if (scroll) {
|
scroll.cancelled = true;
|
}
|
}
|
|
var o = {
|
id: 0,
|
cancelled: false
|
};
|
i(o, scroll, t, n);
|
return {
|
cancel: r.bind(null, o),
|
model: scroll
|
};
|
}
|
|
function Scroller(element, options) {
|
options = options || {};
|
this._element = element;
|
this._options = options;
|
this._enableSnap = options.enableSnap || false;
|
this._itemSize = options.itemSize || 0;
|
this._enableX = options.enableX || false;
|
this._enableY = options.enableY || false;
|
this._shouldDispatchScrollEvent = !!options.onScroll;
|
|
if (this._enableX) {
|
this._extent = (options.scrollWidth || this._element.offsetWidth) - this._element.parentElement.offsetWidth;
|
this._scrollWidth = options.scrollWidth;
|
} else {
|
this._extent = (options.scrollHeight || this._element.offsetHeight) - this._element.parentElement.offsetHeight;
|
this._scrollHeight = options.scrollHeight;
|
}
|
|
this._position = 0;
|
this._scroll = new Scroll(this._extent, options.friction, options.spring);
|
this._onTransitionEnd = this.onTransitionEnd.bind(this);
|
this.updatePosition();
|
}
|
|
Scroller.prototype.onTouchStart = function () {
|
this._startPosition = this._position;
|
this._lastChangePos = this._startPosition;
|
|
if (this._startPosition > 0) {
|
this._startPosition /= 0.5;
|
} else {
|
if (this._startPosition < -this._extent) {
|
this._startPosition = (this._startPosition + this._extent) / 0.5 - this._extent;
|
}
|
}
|
|
if (this._animation) {
|
this._animation.cancel();
|
|
this._scrolling = false;
|
}
|
|
this.updatePosition();
|
};
|
|
Scroller.prototype.onTouchMove = function (x, y) {
|
var startPosition = this._startPosition;
|
|
if (this._enableX) {
|
startPosition += x;
|
} else if (this._enableY) {
|
startPosition += y;
|
}
|
|
if (startPosition > 0) {
|
startPosition *= 0.5;
|
} else if (startPosition < -this._extent) {
|
startPosition = 0.5 * (startPosition + this._extent) - this._extent;
|
}
|
|
this._position = startPosition;
|
this.updatePosition();
|
this.dispatchScroll();
|
};
|
|
Scroller.prototype.onTouchEnd = function (e, r, o) {
|
var _this = this;
|
|
if (this._enableSnap && this._position > -this._extent && this._position < 0) {
|
if (this._enableY && (Math.abs(r) < this._itemSize && Math.abs(o.y) < 300 || Math.abs(o.y) < 150)) {
|
this.snap();
|
return;
|
}
|
|
if (this._enableX && (Math.abs(e) < this._itemSize && Math.abs(o.x) < 300 || Math.abs(o.x) < 150)) {
|
this.snap();
|
return;
|
}
|
}
|
|
if (this._enableX) {
|
this._scroll.set(this._position, o.x);
|
} else if (this._enableY) {
|
this._scroll.set(this._position, o.y);
|
}
|
|
if (this._enableSnap) {
|
var s = this._scroll._friction.x(100);
|
|
var l = s % this._itemSize;
|
var c = Math.abs(l) > this._itemSize / 2 ? s - (this._itemSize - Math.abs(l)) : s - l;
|
|
if (c <= 0 && c >= -this._extent) {
|
this._scroll.setVelocityByEnd(c);
|
}
|
}
|
|
this._lastTime = Date.now();
|
this._lastDelay = 0;
|
this._scrolling = true;
|
this._lastChangePos = this._position;
|
this._lastIdx = Math.floor(Math.abs(this._position / this._itemSize));
|
this._animation = i(this._scroll, function () {
|
var e = Date.now();
|
var i = (e - _this._scroll._startTime) / 1e3;
|
|
var r = _this._scroll.x(i);
|
|
_this._position = r;
|
|
_this.updatePosition();
|
|
var o = _this._scroll.dx(i);
|
|
if (_this._shouldDispatchScrollEvent && e - _this._lastTime > _this._lastDelay) {
|
_this.dispatchScroll();
|
|
_this._lastDelay = Math.abs(2e3 / o);
|
_this._lastTime = e;
|
}
|
}, function () {
|
if (_this._enableSnap) {
|
if (c <= 0 && c >= -_this._extent) {
|
_this._position = c;
|
|
_this.updatePosition();
|
}
|
|
if (typeof _this._options.onSnap === 'function') {
|
_this._options.onSnap(Math.floor(Math.abs(_this._position) / _this._itemSize));
|
}
|
}
|
|
if (_this._shouldDispatchScrollEvent) {
|
_this.dispatchScroll();
|
}
|
|
_this._scrolling = false;
|
});
|
};
|
|
Scroller.prototype.onTransitionEnd = function () {
|
this._element.style.transition = '';
|
this._element.style.webkitTransition = '';
|
|
this._element.removeEventListener('transitionend', this._onTransitionEnd);
|
|
this._element.removeEventListener('webkitTransitionEnd', this._onTransitionEnd);
|
|
if (this._snapping) {
|
this._snapping = false;
|
}
|
|
this.dispatchScroll();
|
};
|
|
Scroller.prototype.snap = function () {
|
var e = this._itemSize;
|
var t = this._position % e;
|
var i = Math.abs(t) > this._itemSize / 2 ? this._position - (e - Math.abs(t)) : this._position - t;
|
|
if (this._position !== i) {
|
this._snapping = true;
|
this.scrollTo(-i);
|
|
if (typeof this._options.onSnap === 'function') {
|
this._options.onSnap(Math.floor(Math.abs(this._position) / this._itemSize));
|
}
|
}
|
};
|
|
Scroller.prototype.scrollTo = function (e, t) {
|
if (this._animation) {
|
this._animation.cancel();
|
|
this._scrolling = false;
|
}
|
|
if (typeof e === 'number') {
|
this._position = -e;
|
}
|
|
if (this._position < -this._extent) {
|
this._position = -this._extent;
|
} else {
|
if (this._position > 0) {
|
this._position = 0;
|
}
|
}
|
|
this._element.style.transition = 'transform ' + (t || 0.2) + 's ease-out';
|
this._element.style.webkitTransition = '-webkit-transform ' + (t || 0.2) + 's ease-out';
|
this.updatePosition();
|
|
this._element.addEventListener('transitionend', this._onTransitionEnd);
|
|
this._element.addEventListener('webkitTransitionEnd', this._onTransitionEnd);
|
};
|
|
Scroller.prototype.dispatchScroll = function () {
|
if (typeof this._options.onScroll === 'function' && Math.round(this._lastPos) !== Math.round(this._position)) {
|
this._lastPos = this._position;
|
var e = {
|
target: {
|
scrollLeft: this._enableX ? -this._position : 0,
|
scrollTop: this._enableY ? -this._position : 0,
|
scrollHeight: this._scrollHeight || this._element.offsetHeight,
|
scrollWidth: this._scrollWidth || this._element.offsetWidth,
|
offsetHeight: this._element.parentElement.offsetHeight,
|
offsetWidth: this._element.parentElement.offsetWidth
|
}
|
};
|
|
this._options.onScroll(e);
|
}
|
};
|
|
Scroller.prototype.update = function (e, t, n) {
|
var i = 0;
|
var r = this._position;
|
|
if (this._enableX) {
|
i = this._element.childNodes.length ? (t || this._element.offsetWidth) - this._element.parentElement.offsetWidth : 0;
|
this._scrollWidth = t;
|
} else {
|
i = this._element.childNodes.length ? (t || this._element.offsetHeight) - this._element.parentElement.offsetHeight : 0;
|
this._scrollHeight = t;
|
}
|
|
if (typeof e === 'number') {
|
this._position = -e;
|
}
|
|
if (this._position < -i) {
|
this._position = -i;
|
} else {
|
if (this._position > 0) {
|
this._position = 0;
|
}
|
}
|
|
this._itemSize = n || this._itemSize;
|
this.updatePosition();
|
|
if (r !== this._position) {
|
this.dispatchScroll();
|
|
if (typeof this._options.onSnap === 'function') {
|
this._options.onSnap(Math.floor(Math.abs(this._position) / this._itemSize));
|
}
|
}
|
|
this._extent = i;
|
this._scroll._extent = i;
|
};
|
|
Scroller.prototype.updatePosition = function () {
|
var transform = '';
|
|
if (this._enableX) {
|
transform = 'translateX(' + this._position + 'px) translateZ(0)';
|
} else {
|
if (this._enableY) {
|
transform = 'translateY(' + this._position + 'px) translateZ(0)';
|
}
|
}
|
|
this._element.style.webkitTransform = transform;
|
this._element.style.transform = transform;
|
};
|
|
Scroller.prototype.isScrolling = function () {
|
return this._scrolling || this._snapping;
|
};
|
// CONCATENATED MODULE: ./src/core/view/mixins/scroller/index.js
|
|
/* harmony default export */ var scroller = __webpack_exports__["a"] = ({
|
methods: {
|
initScroller: function initScroller(element, options) {
|
this._touchInfo = {
|
trackingID: -1,
|
maxDy: 0,
|
maxDx: 0
|
};
|
this._scroller = new Scroller(element, options);
|
this.__handleTouchStart = this._handleTouchStart.bind(this);
|
this.__handleTouchMove = this._handleTouchMove.bind(this);
|
this.__handleTouchEnd = this._handleTouchEnd.bind(this);
|
this._initedScroller = true;
|
},
|
_findDelta: function _findDelta(event) {
|
var touchInfo = this._touchInfo;
|
return event.detail.state === 'move' || event.detail.state === 'end' ? {
|
x: event.detail.dx,
|
y: event.detail.dy
|
} : {
|
x: event.screenX - touchInfo.x,
|
y: event.screenY - touchInfo.y
|
};
|
},
|
_handleTouchStart: function _handleTouchStart(e) {
|
var t = this._touchInfo;
|
var n = this._scroller;
|
|
if (n) {
|
if (e.detail.state === 'start') {
|
t.trackingID = 'touch';
|
t.x = e.detail.x;
|
t.y = e.detail.y;
|
} else {
|
t.trackingID = 'mouse';
|
t.x = e.screenX;
|
t.y = e.screenY;
|
}
|
|
t.maxDx = 0;
|
t.maxDy = 0;
|
t.historyX = [0];
|
t.historyY = [0];
|
t.historyTime = [e.detail.timeStamp];
|
t.listener = n;
|
|
if (n.onTouchStart) {
|
n.onTouchStart();
|
}
|
|
e.preventDefault();
|
}
|
},
|
_handleTouchMove: function _handleTouchMove(event) {
|
var touchInfo = this._touchInfo;
|
|
if (touchInfo.trackingID !== -1) {
|
event.preventDefault();
|
|
var delta = this._findDelta(event);
|
|
if (delta) {
|
for (touchInfo.maxDy = Math.max(touchInfo.maxDy, Math.abs(delta.y)), touchInfo.maxDx = Math.max(touchInfo.maxDx, Math.abs(delta.x)), touchInfo.historyX.push(delta.x), touchInfo.historyY.push(delta.y), touchInfo.historyTime.push(event.detail.timeStamp); touchInfo.historyTime.length > 10;) {
|
touchInfo.historyTime.shift();
|
touchInfo.historyX.shift();
|
touchInfo.historyY.shift();
|
}
|
|
if (touchInfo.listener && touchInfo.listener.onTouchMove) {
|
touchInfo.listener.onTouchMove(delta.x, delta.y, event.detail.timeStamp);
|
}
|
}
|
}
|
},
|
_handleTouchEnd: function _handleTouchEnd(event) {
|
var touchInfo = this._touchInfo;
|
|
if (touchInfo.trackingID !== -1) {
|
event.preventDefault();
|
|
var delta = this._findDelta(event);
|
|
if (delta) {
|
var listener = touchInfo.listener;
|
touchInfo.trackingID = -1;
|
touchInfo.listener = null;
|
var r = touchInfo.historyTime.length;
|
var o = {
|
x: 0,
|
y: 0
|
};
|
|
if (r > 2) {
|
for (var a = touchInfo.historyTime.length - 1, s = touchInfo.historyTime[a], l = touchInfo.historyX[a], c = touchInfo.historyY[a]; a > 0;) {
|
a--;
|
var u = touchInfo.historyTime[a];
|
var d = s - u;
|
|
if (d > 30 && d < 50) {
|
o.x = (l - touchInfo.historyX[a]) / (d / 1e3);
|
o.y = (c - touchInfo.historyY[a]) / (d / 1e3);
|
break;
|
}
|
}
|
}
|
|
touchInfo.historyTime = [];
|
touchInfo.historyX = [];
|
touchInfo.historyY = [];
|
|
if (listener && listener.onTouchEnd) {
|
listener.onTouchEnd(delta.x, delta.y, o);
|
}
|
}
|
}
|
}
|
}
|
});
|
|
/***/ }),
|
/* 75 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getNavigationBarHeight; });
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/helpers/status-bar.js
|
function getStatusbarHeight() {
|
// 横屏时 iOS 获取的状态栏高度错误,进行纠正
|
return plus.navigator.isImmersedStatusbar() ? Math.round(plus.os.name === 'iOS' ? plus.navigator.getSafeAreaInsets().top : plus.navigator.getStatusbarHeight()) : 0;
|
}
|
// EXTERNAL MODULE: ./src/core/helpers/constants.js
|
var constants = __webpack_require__(17);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/utils.js
|
|
|
function getNavigationBarHeight() {
|
var webview = plus.webview.currentWebview();
|
var style = webview.getStyle();
|
style = style && style.titleNView;
|
|
if (style && style.type === 'default') {
|
return constants["a" /* NAVBAR_HEIGHT */] + getStatusbarHeight();
|
}
|
|
return 0;
|
}
|
|
/***/ }),
|
/* 76 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export Formatter */
|
/* unused harmony export I18n */
|
/* unused harmony export LOCALE_EN */
|
/* unused harmony export LOCALE_ES */
|
/* unused harmony export LOCALE_FR */
|
/* unused harmony export LOCALE_ZH_HANS */
|
/* unused harmony export LOCALE_ZH_HANT */
|
/* unused harmony export compileI18nJsonStr */
|
/* unused harmony export hasI18nJson */
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initVueI18n; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isI18nStr; });
|
/* unused harmony export isString */
|
/* unused harmony export normalizeLocale */
|
/* unused harmony export parseI18nJson */
|
/* unused harmony export resolveLocale */
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
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(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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; }
|
|
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; }
|
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
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); }
|
|
var isArray = Array.isArray;
|
|
var isObject = function isObject(val) {
|
return val !== null && _typeof(val) === 'object';
|
};
|
|
var defaultDelimiters = ['{', '}'];
|
|
var BaseFormatter = /*#__PURE__*/function () {
|
function BaseFormatter() {
|
_classCallCheck(this, BaseFormatter);
|
|
this._caches = Object.create(null);
|
}
|
|
_createClass(BaseFormatter, [{
|
key: "interpolate",
|
value: function interpolate(message, values) {
|
var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
|
|
if (!values) {
|
return [message];
|
}
|
|
var tokens = this._caches[message];
|
|
if (!tokens) {
|
tokens = parse(message, delimiters);
|
this._caches[message] = tokens;
|
}
|
|
return compile(tokens, values);
|
}
|
}]);
|
|
return BaseFormatter;
|
}();
|
|
var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
|
var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
|
|
function parse(format, _ref) {
|
var _ref2 = _slicedToArray(_ref, 2),
|
startDelimiter = _ref2[0],
|
endDelimiter = _ref2[1];
|
|
var tokens = [];
|
var position = 0;
|
var text = '';
|
|
while (position < format.length) {
|
var _char = format[position++];
|
|
if (_char === startDelimiter) {
|
if (text) {
|
tokens.push({
|
type: 'text',
|
value: text
|
});
|
}
|
|
text = '';
|
var sub = '';
|
_char = format[position++];
|
|
while (_char !== undefined && _char !== endDelimiter) {
|
sub += _char;
|
_char = format[position++];
|
}
|
|
var isClosed = _char === endDelimiter;
|
var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
|
tokens.push({
|
value: sub,
|
type: type
|
});
|
} // else if (char === '%') {
|
// // when found rails i18n syntax, skip text capture
|
// if (format[position] !== '{') {
|
// text += char
|
// }
|
// }
|
else {
|
text += _char;
|
}
|
}
|
|
text && tokens.push({
|
type: 'text',
|
value: text
|
});
|
return tokens;
|
}
|
|
function compile(tokens, values) {
|
var compiled = [];
|
var index = 0;
|
var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
|
|
if (mode === 'unknown') {
|
return compiled;
|
}
|
|
while (index < tokens.length) {
|
var token = tokens[index];
|
|
switch (token.type) {
|
case 'text':
|
compiled.push(token.value);
|
break;
|
|
case 'list':
|
compiled.push(values[parseInt(token.value, 10)]);
|
break;
|
|
case 'named':
|
if (mode === 'named') {
|
compiled.push(values[token.value]);
|
} else {
|
if (true) {
|
console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
|
}
|
}
|
|
break;
|
|
case 'unknown':
|
if (true) {
|
console.warn("Detect 'unknown' type of token!");
|
}
|
|
break;
|
}
|
|
index++;
|
}
|
|
return compiled;
|
}
|
|
var LOCALE_ZH_HANS = 'zh-Hans';
|
var LOCALE_ZH_HANT = 'zh-Hant';
|
var LOCALE_EN = 'en';
|
var LOCALE_FR = 'fr';
|
var LOCALE_ES = 'es';
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var hasOwn = function hasOwn(val, key) {
|
return hasOwnProperty.call(val, key);
|
};
|
|
var defaultFormatter = new BaseFormatter();
|
|
function include(str, parts) {
|
return !!parts.find(function (part) {
|
return str.indexOf(part) !== -1;
|
});
|
}
|
|
function startsWith(str, parts) {
|
return parts.find(function (part) {
|
return str.indexOf(part) === 0;
|
});
|
}
|
|
function normalizeLocale(locale, messages) {
|
if (!locale) {
|
return;
|
}
|
|
locale = locale.trim().replace(/_/g, '-');
|
|
if (messages && messages[locale]) {
|
return locale;
|
}
|
|
locale = locale.toLowerCase();
|
|
if (locale.indexOf('zh') === 0) {
|
if (locale.indexOf('-hans') > -1) {
|
return LOCALE_ZH_HANS;
|
}
|
|
if (locale.indexOf('-hant') > -1) {
|
return LOCALE_ZH_HANT;
|
}
|
|
if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
|
return LOCALE_ZH_HANT;
|
}
|
|
return LOCALE_ZH_HANS;
|
}
|
|
var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
|
|
if (lang) {
|
return lang;
|
}
|
}
|
|
var I18n = /*#__PURE__*/function () {
|
function I18n(_ref3) {
|
var locale = _ref3.locale,
|
fallbackLocale = _ref3.fallbackLocale,
|
messages = _ref3.messages,
|
watcher = _ref3.watcher,
|
formater = _ref3.formater;
|
|
_classCallCheck(this, I18n);
|
|
this.locale = LOCALE_EN;
|
this.fallbackLocale = LOCALE_EN;
|
this.message = {};
|
this.messages = {};
|
this.watchers = [];
|
|
if (fallbackLocale) {
|
this.fallbackLocale = fallbackLocale;
|
}
|
|
this.formater = formater || defaultFormatter;
|
this.messages = messages || {};
|
this.setLocale(locale || LOCALE_EN);
|
|
if (watcher) {
|
this.watchLocale(watcher);
|
}
|
}
|
|
_createClass(I18n, [{
|
key: "setLocale",
|
value: function setLocale(locale) {
|
var _this = this;
|
|
var oldLocale = this.locale;
|
this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
|
|
if (!this.messages[this.locale]) {
|
// 可能初始化时不存在
|
this.messages[this.locale] = {};
|
}
|
|
this.message = this.messages[this.locale]; // 仅发生变化时,通知
|
|
if (oldLocale !== this.locale) {
|
this.watchers.forEach(function (watcher) {
|
watcher(_this.locale, oldLocale);
|
});
|
}
|
}
|
}, {
|
key: "getLocale",
|
value: function getLocale() {
|
return this.locale;
|
}
|
}, {
|
key: "watchLocale",
|
value: function watchLocale(fn) {
|
var _this2 = this;
|
|
var index = this.watchers.push(fn) - 1;
|
return function () {
|
_this2.watchers.splice(index, 1);
|
};
|
}
|
}, {
|
key: "add",
|
value: function add(locale, message) {
|
var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
var curMessages = this.messages[locale];
|
|
if (curMessages) {
|
if (override) {
|
Object.assign(curMessages, message);
|
} else {
|
Object.keys(message).forEach(function (key) {
|
if (!hasOwn(curMessages, key)) {
|
curMessages[key] = message[key];
|
}
|
});
|
}
|
} else {
|
this.messages[locale] = message;
|
}
|
}
|
}, {
|
key: "f",
|
value: function f(message, values, delimiters) {
|
return this.formater.interpolate(message, values, delimiters).join('');
|
}
|
}, {
|
key: "t",
|
value: function t(key, locale, values) {
|
var message = this.message;
|
|
if (typeof locale === 'string') {
|
locale = normalizeLocale(locale, this.messages);
|
locale && (message = this.messages[locale]);
|
} else {
|
values = locale;
|
}
|
|
if (!hasOwn(message, key)) {
|
console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
|
return key;
|
}
|
|
return this.formater.interpolate(message[key], values).join('');
|
}
|
}]);
|
|
return I18n;
|
}();
|
|
function watchAppLocale(appVm, i18n) {
|
// 需要保证 watch 的触发在组件渲染之前
|
if (appVm.$watchLocale) {
|
// vue2
|
appVm.$watchLocale(function (newLocale) {
|
i18n.setLocale(newLocale);
|
});
|
} else {
|
appVm.$watch(function () {
|
return appVm.$locale;
|
}, function (newLocale) {
|
i18n.setLocale(newLocale);
|
});
|
}
|
}
|
|
function getDefaultLocale() {
|
if (typeof uni !== 'undefined' && uni.getLocale) {
|
return uni.getLocale();
|
} // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
|
|
|
if (typeof global !== 'undefined' && global.getLocale) {
|
return global.getLocale();
|
}
|
|
return LOCALE_EN;
|
}
|
|
function initVueI18n(locale) {
|
var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
|
var watcher = arguments.length > 3 ? arguments[3] : undefined;
|
|
// 兼容旧版本入参
|
if (typeof locale !== 'string') {
|
var _ref4 = [messages, locale];
|
locale = _ref4[0];
|
messages = _ref4[1];
|
}
|
|
if (typeof locale !== 'string') {
|
// 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
|
locale = getDefaultLocale();
|
}
|
|
if (typeof fallbackLocale !== 'string') {
|
fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
|
}
|
|
var i18n = new I18n({
|
locale: locale,
|
fallbackLocale: fallbackLocale,
|
messages: messages,
|
watcher: watcher
|
});
|
|
var _t = function t(key, values) {
|
if (typeof getApp !== 'function') {
|
// app view
|
|
/* eslint-disable no-func-assign */
|
_t = function t(key, values) {
|
return i18n.t(key, values);
|
};
|
} else {
|
var isWatchedAppLocale = false;
|
|
_t = function t(key, values) {
|
var appVm = getApp().$vm; // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
|
// options: {
|
// type: Array,
|
// default () {
|
// return [{
|
// icon: 'shop',
|
// text: t("uni-goods-nav.options.shop"),
|
// }, {
|
// icon: 'cart',
|
// text: t("uni-goods-nav.options.cart")
|
// }]
|
// }
|
// },
|
|
if (appVm) {
|
// 触发响应式
|
appVm.$locale;
|
|
if (!isWatchedAppLocale) {
|
isWatchedAppLocale = true;
|
watchAppLocale(appVm, i18n);
|
}
|
}
|
|
return i18n.t(key, values);
|
};
|
}
|
|
return _t(key, values);
|
};
|
|
return {
|
i18n: i18n,
|
f: function f(message, values, delimiters) {
|
return i18n.f(message, values, delimiters);
|
},
|
t: function t(key, values) {
|
return _t(key, values);
|
},
|
add: function add(locale, message) {
|
var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
return i18n.add(locale, message, override);
|
},
|
watch: function watch(fn) {
|
return i18n.watchLocale(fn);
|
},
|
getLocale: function getLocale() {
|
return i18n.getLocale();
|
},
|
setLocale: function setLocale(newLocale) {
|
return i18n.setLocale(newLocale);
|
}
|
};
|
}
|
|
var isString = function isString(val) {
|
return typeof val === 'string';
|
};
|
|
var formater;
|
|
function hasI18nJson(jsonObj, delimiters) {
|
if (!formater) {
|
formater = new BaseFormatter();
|
}
|
|
return walkJsonObj(jsonObj, function (jsonObj, key) {
|
var value = jsonObj[key];
|
|
if (isString(value)) {
|
if (isI18nStr(value, delimiters)) {
|
return true;
|
}
|
} else {
|
return hasI18nJson(value, delimiters);
|
}
|
});
|
}
|
|
function parseI18nJson(jsonObj, values, delimiters) {
|
if (!formater) {
|
formater = new BaseFormatter();
|
}
|
|
walkJsonObj(jsonObj, function (jsonObj, key) {
|
var value = jsonObj[key];
|
|
if (isString(value)) {
|
if (isI18nStr(value, delimiters)) {
|
jsonObj[key] = compileStr(value, values, delimiters);
|
}
|
} else {
|
parseI18nJson(value, values, delimiters);
|
}
|
});
|
return jsonObj;
|
}
|
|
function compileI18nJsonStr(jsonStr, _ref5) {
|
var locale = _ref5.locale,
|
locales = _ref5.locales,
|
delimiters = _ref5.delimiters;
|
|
if (!isI18nStr(jsonStr, delimiters)) {
|
return jsonStr;
|
}
|
|
if (!formater) {
|
formater = new BaseFormatter();
|
}
|
|
var localeValues = [];
|
Object.keys(locales).forEach(function (name) {
|
if (name !== locale) {
|
localeValues.push({
|
locale: name,
|
values: locales[name]
|
});
|
}
|
});
|
localeValues.unshift({
|
locale: locale,
|
values: locales[locale]
|
});
|
|
try {
|
return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
|
} catch (e) {}
|
|
return jsonStr;
|
}
|
|
function isI18nStr(value, delimiters) {
|
return value.indexOf(delimiters[0]) > -1;
|
}
|
|
function compileStr(value, values, delimiters) {
|
return formater.interpolate(value, values, delimiters).join('');
|
}
|
|
function compileValue(jsonObj, key, localeValues, delimiters) {
|
var value = jsonObj[key];
|
|
if (isString(value)) {
|
// 存在国际化
|
if (isI18nStr(value, delimiters)) {
|
jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
|
|
if (localeValues.length > 1) {
|
// 格式化国际化语言
|
var valueLocales = jsonObj[key + 'Locales'] = {};
|
localeValues.forEach(function (localValue) {
|
valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
|
});
|
}
|
}
|
} else {
|
compileJsonObj(value, localeValues, delimiters);
|
}
|
}
|
|
function compileJsonObj(jsonObj, localeValues, delimiters) {
|
walkJsonObj(jsonObj, function (jsonObj, key) {
|
compileValue(jsonObj, key, localeValues, delimiters);
|
});
|
return jsonObj;
|
}
|
|
function walkJsonObj(jsonObj, walk) {
|
if (isArray(jsonObj)) {
|
for (var i = 0; i < jsonObj.length; i++) {
|
if (walk(jsonObj, i)) {
|
return true;
|
}
|
}
|
} else if (isObject(jsonObj)) {
|
for (var key in jsonObj) {
|
if (walk(jsonObj, key)) {
|
return true;
|
}
|
}
|
}
|
|
return false;
|
}
|
|
function resolveLocale(locales) {
|
return function (locale) {
|
if (!locale) {
|
return locale;
|
}
|
|
locale = normalizeLocale(locale) || locale;
|
return resolveLocaleChain(locale).find(function (locale) {
|
return locales.indexOf(locale) > -1;
|
});
|
};
|
}
|
|
function resolveLocaleChain(locale) {
|
var chain = [];
|
var tokens = locale.split('-');
|
|
while (tokens.length) {
|
chain.push(tokens.join('-'));
|
tokens.pop();
|
}
|
|
return chain;
|
}
|
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19)))
|
|
/***/ }),
|
/* 77 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
module.exports = {
|
2: 'need dictionary', /* Z_NEED_DICT 2 */
|
1: 'stream end', /* Z_STREAM_END 1 */
|
0: '', /* Z_OK 0 */
|
'-1': 'file error', /* Z_ERRNO (-1) */
|
'-2': 'stream error', /* Z_STREAM_ERROR (-2) */
|
'-3': 'data error', /* Z_DATA_ERROR (-3) */
|
'-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
|
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
|
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
|
};
|
|
|
/***/ }),
|
/* 78 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return requestComponentObserver; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return destroyComponentObserver; });
|
/* harmony import */ var intersection_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(114);
|
/* harmony import */ var intersection_observer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(intersection_observer__WEBPACK_IMPORTED_MODULE_0__);
|
/* harmony import */ var uni_helpers_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21);
|
|
|
|
|
function getRect(rect) {
|
return {
|
bottom: rect.bottom,
|
height: rect.height,
|
left: rect.left,
|
right: rect.right,
|
top: rect.top,
|
width: rect.width
|
};
|
} // 在相交比很小的情况下,Chrome会返回相交为0
|
|
|
function rectifyIntersectionRatio(entrie) {
|
var intersectionRatio = entrie.intersectionRatio,
|
_entrie$boundingClien = entrie.boundingClientRect,
|
overAllHeight = _entrie$boundingClien.height,
|
overAllWidth = _entrie$boundingClien.width,
|
_entrie$intersectionR = entrie.intersectionRect,
|
intersectionHeight = _entrie$intersectionR.height,
|
intersectionWidth = _entrie$intersectionR.width;
|
if (intersectionRatio !== 0) return intersectionRatio;
|
return intersectionHeight === overAllHeight ? intersectionWidth / overAllWidth : intersectionHeight / overAllHeight;
|
}
|
|
var intersectionObservers = {};
|
function requestComponentObserver(_ref, pageId) {
|
var reqId = _ref.reqId,
|
component = _ref.component,
|
options = _ref.options;
|
var pageVm;
|
|
if (pageId._isVue) {
|
pageVm = pageId;
|
} else {
|
var pages = getCurrentPages(); // 跨平台时,View 层也应该实现该方法,举例 App 上,View 层的 getCurrentPages 返回长度为1的当前页面数组
|
|
var page = pages.find(function (page) {
|
return page.$page.id === pageId;
|
});
|
|
if (!page) {
|
throw new Error("Not Found\uFF1APage[".concat(pageId, "]"));
|
}
|
|
pageVm = page.$vm;
|
}
|
|
var $el = Object(_util__WEBPACK_IMPORTED_MODULE_2__[/* findElm */ "b"])(component, pageVm);
|
var root = options.relativeToSelector ? $el.querySelector(options.relativeToSelector) : null;
|
var intersectionObserver = intersectionObservers[reqId] = new IntersectionObserver(function (entries, observer) {
|
entries.forEach(function (entrie) {
|
UniViewJSBridge.publishHandler('onRequestComponentObserver', {
|
reqId: reqId,
|
res: {
|
intersectionRatio: rectifyIntersectionRatio(entrie),
|
intersectionRect: getRect(entrie.intersectionRect),
|
boundingClientRect: getRect(entrie.boundingClientRect),
|
relativeRect: getRect(entrie.rootBounds),
|
time: Date.now(),
|
dataset: Object(uni_helpers_index__WEBPACK_IMPORTED_MODULE_1__[/* getTargetDataset */ "a"])(entrie.target),
|
id: entrie.target.id
|
}
|
});
|
});
|
}, {
|
root: root,
|
rootMargin: options.rootMargin,
|
threshold: options.thresholds
|
});
|
|
if (options.observeAll) {
|
intersectionObserver.USE_MUTATION_OBSERVER = true;
|
Array.prototype.map.call($el.querySelectorAll(options.selector), function (el) {
|
if (!el) {
|
console.warn("Node ".concat(options.selector, " is not found. Intersection observer will not trigger."));
|
return;
|
}
|
|
intersectionObserver.observe(el);
|
});
|
} else {
|
intersectionObserver.USE_MUTATION_OBSERVER = false;
|
var el = $el.querySelector(options.selector);
|
|
if (!el) {
|
console.warn("Node ".concat(options.selector, " is not found. Intersection observer will not trigger."));
|
return;
|
}
|
|
intersectionObserver.observe(el);
|
}
|
}
|
function destroyComponentObserver(_ref2) {
|
var reqId = _ref2.reqId;
|
var intersectionObserver = intersectionObservers[reqId];
|
|
if (intersectionObserver) {
|
intersectionObserver.disconnect();
|
delete intersectionObservers[reqId];
|
UniViewJSBridge.publishHandler('onRequestComponentObserver', {
|
reqId: reqId,
|
reqEnd: true
|
});
|
}
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 79 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return requestMediaQueryObserver; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return destroyMediaQueryObserver; });
|
var mediaQueryObservers = {};
|
var listeners = {}; // 用公用对象存储监听器
|
// 拼接媒体查询条件
|
|
function handleMediaQueryStr($props) {
|
var mediaQueryStr = [];
|
var propsMenu = ['width', 'minWidth', 'maxWidth', 'height', 'minHeight', 'maxHeight', 'orientation'];
|
|
for (var _i = 0, _propsMenu = propsMenu; _i < _propsMenu.length; _i++) {
|
var item = _propsMenu[_i];
|
|
if (item !== 'orientation' && $props[item] !== '' && Number($props[item]) >= 0) {
|
mediaQueryStr.push("(".concat(humpToLine(item), ": ").concat(Number($props[item]), "px)"));
|
}
|
|
if (item === 'orientation' && $props[item]) {
|
mediaQueryStr.push("(".concat(humpToLine(item), ": ").concat($props[item], ")"));
|
}
|
}
|
|
mediaQueryStr = mediaQueryStr.join(' and ');
|
return mediaQueryStr;
|
}
|
|
function humpToLine(name) {
|
return name.replace(/([A-Z])/g, '-$1').toLowerCase();
|
} // 请求媒体查询对象
|
|
|
function requestMediaQueryObserver(_ref) {
|
var reqId = _ref.reqId,
|
options = _ref.options;
|
// 创建一个媒体查询对象
|
var mediaQueryObserver = mediaQueryObservers[reqId] = window.matchMedia(handleMediaQueryStr(options)); // 创建一个监听器
|
|
var listener = listeners[reqId] = function (e) {
|
UniViewJSBridge.publishHandler('onRequestMediaQueryObserver', {
|
reqId: reqId,
|
res: e.matches
|
});
|
};
|
|
listener(mediaQueryObserver); // 监听前执行一次媒体查询
|
|
mediaQueryObserver.addListener(listener);
|
} // 销毁媒体查询对象
|
|
function destroyMediaQueryObserver(_ref2) {
|
var reqId = _ref2.reqId;
|
var listener = listeners[reqId]; // 需要移除的某个监听
|
|
var mediaQueryObserver = mediaQueryObservers[reqId];
|
|
if (mediaQueryObserver) {
|
mediaQueryObserver.removeListener(listener); // 移除监听
|
|
delete mediaQueryObservers[reqId];
|
UniViewJSBridge.publishHandler('onRequestMediaQueryObserver', {
|
reqId: reqId,
|
reqEnd: true
|
});
|
}
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 80 */
|
/***/ (function(module, exports) {
|
|
module.exports = ['uni-app', 'uni-layout', 'uni-content', 'uni-main', 'uni-top-window', 'uni-left-window', 'uni-right-window', 'uni-tabbar', 'uni-page', 'uni-page-head', 'uni-page-wrapper', 'uni-page-body', 'uni-page-refresh', 'uni-actionsheet', 'uni-modal', 'uni-toast', 'uni-resize-sensor', 'uni-shadow-root', 'uni-ad', 'uni-audio', 'uni-button', 'uni-camera', 'uni-canvas', 'uni-checkbox', 'uni-checkbox-group', 'uni-cover-image', 'uni-cover-view', 'uni-editor', 'uni-form', 'uni-functional-page-navigator', 'uni-icon', 'uni-image', 'uni-input', 'uni-label', 'uni-live-player', 'uni-live-pusher', 'uni-map', 'uni-movable-area', 'uni-movable-view', 'uni-navigator', 'uni-official-account', 'uni-open-data', 'uni-picker', 'uni-picker-view', 'uni-picker-view-column', 'uni-progress', 'uni-radio', 'uni-radio-group', 'uni-rich-text', 'uni-scroll-view', 'uni-slider', 'uni-swiper', 'uni-swiper-item', 'uni-switch', 'uni-text', 'uni-textarea', 'uni-video', 'uni-view', 'uni-web-view'];
|
|
/***/ }),
|
/* 81 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return generateId; });
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
function generateId(vm, parent, version) {
|
if (!vm.$parent) {
|
return '-1';
|
}
|
|
var vnode = vm.$vnode;
|
var context = vnode.context;
|
var id = vnode.data.attrs._i;
|
|
if (version && Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "e"])(vnode.data, 'key')) {
|
// 补充 key 值
|
id = id + ';' + vnode.data.key;
|
} // slot 内的组件,需要补充 context 的 id,否则可能与内部组件索引值一致,导致 id 冲突
|
|
|
if (context && context !== parent && context._$id) {
|
if (true) {
|
console.log('generateId:' + context._$id + ';' + parent._$id + ',' + id);
|
}
|
|
return context._$id + ';' + parent._$id + ',' + id;
|
}
|
|
return parent._$id + ',' + id;
|
}
|
|
/***/ }),
|
/* 82 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return loadScript; });
|
var scripts = {};
|
function loadScript(globalName, src, callback) {
|
var globalObject = typeof globalName === 'string' ? window[globalName] : globalName;
|
|
if (globalObject) {
|
callback();
|
return;
|
}
|
|
var callbacks = scripts[src];
|
|
if (!callbacks) {
|
callbacks = scripts[src] = [];
|
var script = document.createElement('script');
|
script.src = src;
|
document.body.appendChild(script);
|
|
script.onload = function () {
|
callbacks.forEach(function (callback) {
|
return callback();
|
});
|
delete scripts[src];
|
};
|
}
|
|
callbacks.push(callback);
|
}
|
|
/***/ }),
|
/* 83 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge, global) {/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
/* harmony import */ var uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(115);
|
/* harmony import */ var uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1__);
|
/* harmony import */ var uni_platform_page_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68);
|
/* harmony import */ var uni_platform_view_framework_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69);
|
/* harmony import */ var uni_platform_view_framework_plugins_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(111);
|
/* harmony import */ var _view_api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95);
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["a"]; });
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["b"]; });
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["c"]; });
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["d"]; });
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["e"]; });
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["f"]; });
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["g"]; });
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "h", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["h"]; });
|
|
|
|
|
|
|
global.UniViewJSBridge = {
|
subscribe: UniViewJSBridge.subscribe,
|
publishHandler: UniViewJSBridge.publishHandler,
|
subscribeHandler: UniViewJSBridge.subscribeHandler
|
};
|
global.getCurrentPages = uni_platform_view_framework_page__WEBPACK_IMPORTED_MODULE_3__[/* getCurrentPages */ "a"];
|
global.__definePage = uni_platform_page_factory__WEBPACK_IMPORTED_MODULE_2__[/* definePage */ "a"];
|
global.Vue = vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"];
|
vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].use(uni_platform_view_framework_plugins_index__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]);
|
|
__webpack_require__(191);
|
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4), __webpack_require__(19)))
|
|
/***/ }),
|
/* 84 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
props: {
|
id: {
|
type: String,
|
default: ''
|
}
|
},
|
created: function created() {
|
var _this = this;
|
|
this._addListeners(this.id); // 初始化监听
|
|
|
this.$watch('id', function (newId, oldId) {
|
// watch id
|
_this._removeListeners(oldId, true);
|
|
_this._addListeners(newId, true);
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
// 销毁时移除
|
this._removeListeners(this.id);
|
},
|
methods: {
|
_addListeners: function _addListeners(id, watch) {
|
var _this2 = this;
|
|
if (watch && !id) {
|
// id被置空
|
return;
|
}
|
|
var listeners = this.$options.listeners;
|
|
if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "g"])(listeners)) {
|
return;
|
}
|
|
Object.keys(listeners).forEach(function (name) {
|
if (watch) {
|
// watch id
|
if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) {
|
/* eslint-disable standard/computed-property-even-spacing */
|
UniViewJSBridge.on("uni-".concat(name, "-").concat(_this2.$page.id, "-").concat(id), _this2[listeners[name]]);
|
}
|
} else {
|
if (name.indexOf('@') === 0) {
|
/* eslint-disable standard/computed-property-even-spacing */
|
_this2.$on("uni-".concat(name.substr(1)), _this2[listeners[name]]);
|
} else if (name.indexOf('uni-') === 0) {
|
// 完全限定
|
|
/* eslint-disable standard/computed-property-even-spacing */
|
UniViewJSBridge.on(name, _this2[listeners[name]]);
|
} else if (id) {
|
// scoped
|
|
/* eslint-disable standard/computed-property-even-spacing */
|
UniViewJSBridge.on("uni-".concat(name, "-").concat(_this2.$page.id, "-").concat(id), _this2[listeners[name]]);
|
}
|
}
|
});
|
},
|
_removeListeners: function _removeListeners(id, watch) {
|
var _this3 = this;
|
|
if (watch && !id) {
|
// id之前不存在
|
return;
|
}
|
|
var listeners = this.$options.listeners;
|
|
if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "g"])(listeners)) {
|
return;
|
}
|
|
Object.keys(listeners).forEach(function (name) {
|
if (watch) {
|
// watch id
|
if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) {
|
/* eslint-disable standard/computed-property-even-spacing */
|
UniViewJSBridge.off("uni-".concat(name, "-").concat(_this3.$page.id, "-").concat(id), _this3[listeners[name]]);
|
}
|
} else {
|
if (name.indexOf('@') === 0) {
|
/* eslint-disable standard/computed-property-even-spacing */
|
_this3.$off("uni-".concat(name.substr(1)), _this3[listeners[name]]);
|
} else if (name.indexOf('uni-') === 0) {
|
// 完全限定
|
|
/* eslint-disable standard/computed-property-even-spacing */
|
UniViewJSBridge.off(name, _this3[listeners[name]]);
|
} else if (id) {
|
// scoped
|
|
/* eslint-disable standard/computed-property-even-spacing */
|
UniViewJSBridge.off("uni-".concat(name, "-").concat(_this3.$page.id, "-").concat(id), _this3[listeners[name]]);
|
}
|
}
|
});
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 85 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
// 取消id的定义,某些组件(canvas)内不在props内定义id
|
// props: {
|
// id: {
|
// type: String,
|
// default: ''
|
// }
|
// },
|
mounted: function mounted() {
|
var _this = this;
|
|
this._toggleListeners('subscribe', this.id); // 初始化监听
|
|
|
this.$watch('id', function (newId, oldId) {
|
// watch id
|
_this._toggleListeners('unsubscribe', oldId, true);
|
|
_this._toggleListeners('subscribe', newId, true);
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
// 销毁时移除
|
this._toggleListeners('unsubscribe', this.id);
|
|
if (this._contextId) {
|
this._toggleListeners('unsubscribe', this._contextId);
|
}
|
},
|
methods: {
|
_toggleListeners: function _toggleListeners(type, id, watch) {
|
if (watch && !id) {
|
// id被置空
|
return;
|
}
|
|
if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isFn */ "f"])(this._handleSubscribe)) {
|
return;
|
} // 纠正VUniVideo等组件命名为Video
|
|
|
UniViewJSBridge[type](this.$page.id + '-' + this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase() + '-' + id, this._handleSubscribe);
|
},
|
_getContextInfo: function _getContextInfo() {
|
var id = "context-".concat(this._uid);
|
|
if (!this._contextId) {
|
this._toggleListeners('subscribe', id);
|
|
this._contextId = id;
|
}
|
|
return {
|
name: this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase(),
|
id: id,
|
page: this.$page.id
|
};
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 86 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
|
/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
|
/* harmony import */ var _interact__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26);
|
|
|
|
|
UniViewJSBridge.subscribe('getSelectedTextRange', function (_ref) {
|
var pageId = _ref.pageId,
|
callbackId = _ref.callbackId;
|
var activeElement = document.activeElement;
|
var tagName = activeElement.tagName.toLowerCase();
|
var tagNames = ['input', 'textarea'];
|
var data = {};
|
|
if (tagNames.includes(tagName)) {
|
data.errMsg = 'getSelectedTextRange:ok';
|
data.start = activeElement.selectionStart;
|
data.end = activeElement.selectionEnd;
|
} else {
|
data.errMsg = 'getSelectedTextRange:fail no focused';
|
}
|
|
UniViewJSBridge.publishHandler('onGetSelectedTextRange', {
|
callbackId: callbackId,
|
data: data
|
}, pageId);
|
}); // App 延迟获取焦点
|
|
var FOCUS_DELAY = 200;
|
var startTime;
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
name: 'Field',
|
mixins: [_emitter__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], _keyboard__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], _interact__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]],
|
model: {
|
prop: 'value',
|
event: 'update:value'
|
},
|
props: {
|
value: {
|
type: [String, Number],
|
default: ''
|
},
|
|
/**
|
* 已废弃属性,用于历史兼容
|
*/
|
autoFocus: {
|
type: [Boolean, String],
|
default: false
|
},
|
focus: {
|
type: [Boolean, String],
|
default: false
|
},
|
cursor: {
|
type: [Number, String],
|
default: -1
|
},
|
selectionStart: {
|
type: [Number, String],
|
default: -1
|
},
|
selectionEnd: {
|
type: [Number, String],
|
default: -1
|
}
|
},
|
data: function data() {
|
return {
|
composing: false,
|
valueSync: this._getValueString(this.value),
|
focusSync: this.focus,
|
// Safari 14 以上修正禁用状态颜色
|
fixColor: String(navigator.vendor).indexOf('Apple') === 0 && CSS.supports('image-orientation:from-image')
|
};
|
},
|
watch: {
|
focus: function focus(val) {
|
if (val) {
|
this._focus();
|
} else {
|
this._blur();
|
}
|
},
|
focusSync: function focusSync(val) {
|
this.$emit('update:focus', val);
|
},
|
cursorNumber: function cursorNumber() {
|
this._checkCursor();
|
},
|
selectionStartNumber: function selectionStartNumber() {
|
this._checkSelection();
|
},
|
selectionEndNumber: function selectionEndNumber() {
|
this._checkSelection();
|
}
|
},
|
computed: {
|
needFocus: function needFocus() {
|
return this.autoFocus || this.focus;
|
},
|
cursorNumber: function cursorNumber() {
|
var cursor = Number(this.cursor);
|
return isNaN(cursor) ? -1 : cursor;
|
},
|
selectionStartNumber: function selectionStartNumber() {
|
var selectionStart = Number(this.selectionStart);
|
return isNaN(selectionStart) ? -1 : selectionStart;
|
},
|
selectionEndNumber: function selectionEndNumber() {
|
var selectionEnd = Number(this.selectionEnd);
|
return isNaN(selectionEnd) ? -1 : selectionEnd;
|
}
|
},
|
created: function created() {
|
var _this = this;
|
|
var valueChange = this.__valueChange = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* debounce */ "c"])(function (val) {
|
_this.valueSync = _this._getValueString(val);
|
}, 100);
|
this.$watch('value', valueChange);
|
this.__triggerInput = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* throttle */ "l"])(function ($event, detail) {
|
_this.__valueChange.cancel();
|
|
_this.$emit('update:value', detail.value);
|
|
_this.$trigger('input', $event, detail);
|
}, 100);
|
|
this.$triggerInput = function ($event, detail, force) {
|
_this.__valueChange.cancel();
|
|
_this.__triggerInput($event, detail);
|
|
if (force) {
|
_this.__triggerInput.flush();
|
}
|
};
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.__valueChange.cancel();
|
|
this.__triggerInput.cancel();
|
},
|
directives: {
|
field: {
|
inserted: function inserted(el, binding, vnode) {
|
vnode.context._initField(el);
|
}
|
}
|
},
|
methods: {
|
_getValueString: function _getValueString(value) {
|
return value === null ? '' : String(value);
|
},
|
_initField: function _initField(el) {
|
var _this2 = this;
|
|
this._field = el;
|
startTime = startTime || Date.now();
|
|
if (this.needFocus) {
|
setTimeout(function () {
|
_this2._focus();
|
});
|
}
|
},
|
_focus: function _focus() {
|
if (!this.needFocus) {
|
return;
|
}
|
|
var field = this._field;
|
|
if (!field || true && !window.plus) {
|
setTimeout(this._focus.bind(this), 100);
|
return;
|
}
|
|
if (false) {} else {
|
var timeout = FOCUS_DELAY - (Date.now() - startTime);
|
|
if (timeout > 0) {
|
setTimeout(this._focus.bind(this), timeout);
|
return;
|
}
|
|
field.focus(); // 无用户交互的 webview 需主动显示键盘(安卓)
|
|
if (!this.userInteract) {
|
plus.key.showSoftKeybord();
|
}
|
}
|
},
|
_blur: function _blur() {
|
var field = this._field;
|
field && field.blur();
|
},
|
_onFocus: function _onFocus($event) {
|
this.focusSync = true;
|
this.$trigger('focus', $event, {
|
value: this.valueSync
|
}); // 从 watch:focusSync 中移出到这里。在watcher中如果focus初始值为ture,则不会执行以下逻辑
|
|
this._checkSelection();
|
|
this._checkCursor();
|
},
|
_onBlur: function _onBlur($event) {
|
// iOS 输入法 compositionend 事件可能晚于 blur
|
if (this.composing) {
|
this.composing = false;
|
|
this._onInput($event, true);
|
}
|
|
this.focusSync = false;
|
var field = $event.target;
|
var cursor;
|
|
if (field.type === 'number') {
|
field.type = 'text';
|
cursor = field.selectionEnd;
|
field.type = 'number';
|
} else {
|
cursor = field.selectionEnd;
|
}
|
|
this.$trigger('blur', $event, {
|
value: this.valueSync,
|
cursor: cursor
|
});
|
},
|
_checkSelection: function _checkSelection() {
|
var field = this._field;
|
|
if (this.focusSync && this.selectionStartNumber > -1 && this.selectionEndNumber > -1 && field.type !== 'number') {
|
field.selectionStart = this.selectionStartNumber;
|
field.selectionEnd = this.selectionEndNumber;
|
}
|
},
|
_checkCursor: function _checkCursor() {
|
var field = this._field;
|
|
if (this.focusSync && this.selectionStartNumber < 0 && this.selectionEndNumber < 0 && this.cursorNumber > -1 && field.type !== 'number') {
|
field.selectionEnd = field.selectionStart = this.cursorNumber;
|
}
|
}
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 87 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
// Top level file is just a mixin of submodules & constants
|
|
|
var assign = __webpack_require__(11).assign;
|
|
var deflate = __webpack_require__(120);
|
var inflate = __webpack_require__(123);
|
var constants = __webpack_require__(92);
|
|
var pako = {};
|
|
assign(pako, deflate, inflate, constants);
|
|
module.exports = pako;
|
|
|
/***/ }),
|
/* 88 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// Note: adler32 takes 12% for level 0 and 2% for level 6.
|
// It isn't worth it to make additional optimizations as in original.
|
// Small size is preferable.
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
function adler32(adler, buf, len, pos) {
|
var s1 = (adler & 0xffff) |0,
|
s2 = ((adler >>> 16) & 0xffff) |0,
|
n = 0;
|
|
while (len !== 0) {
|
// Set limit ~ twice less than 5552, to keep
|
// s2 in 31-bits, because we force signed ints.
|
// in other case %= will fail.
|
n = len > 2000 ? 2000 : len;
|
len -= n;
|
|
do {
|
s1 = (s1 + buf[pos++]) |0;
|
s2 = (s2 + s1) |0;
|
} while (--n);
|
|
s1 %= 65521;
|
s2 %= 65521;
|
}
|
|
return (s1 | (s2 << 16)) |0;
|
}
|
|
|
module.exports = adler32;
|
|
|
/***/ }),
|
/* 89 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// Note: we can't get significant speed boost here.
|
// So write code to minimize size - no pregenerated tables
|
// and array tools dependencies.
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
// Use ordinary array, since untyped makes no boost here
|
function makeTable() {
|
var c, table = [];
|
|
for (var n = 0; n < 256; n++) {
|
c = n;
|
for (var k = 0; k < 8; k++) {
|
c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
|
}
|
table[n] = c;
|
}
|
|
return table;
|
}
|
|
// Create table on load. Just 255 signed longs. Not a problem.
|
var crcTable = makeTable();
|
|
|
function crc32(crc, buf, len, pos) {
|
var t = crcTable,
|
end = pos + len;
|
|
crc ^= -1;
|
|
for (var i = pos; i < end; i++) {
|
crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
|
}
|
|
return (crc ^ (-1)); // >>> 0;
|
}
|
|
|
module.exports = crc32;
|
|
|
/***/ }),
|
/* 90 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
// String encode/decode helpers
|
|
|
|
var utils = __webpack_require__(11);
|
|
|
// Quick check if we can use fast array to bin string conversion
|
//
|
// - apply(Array) can fail on Android 2.2
|
// - apply(Uint8Array) can fail on iOS 5.1 Safari
|
//
|
var STR_APPLY_OK = true;
|
var STR_APPLY_UIA_OK = true;
|
|
try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
|
try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }
|
|
|
// Table with utf8 lengths (calculated by first byte of sequence)
|
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
|
// because max possible codepoint is 0x10ffff
|
var _utf8len = new utils.Buf8(256);
|
for (var q = 0; q < 256; q++) {
|
_utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
|
}
|
_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start
|
|
|
// convert string to array (typed, when possible)
|
exports.string2buf = function (str) {
|
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
|
|
// count binary size
|
for (m_pos = 0; m_pos < str_len; m_pos++) {
|
c = str.charCodeAt(m_pos);
|
if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
|
c2 = str.charCodeAt(m_pos + 1);
|
if ((c2 & 0xfc00) === 0xdc00) {
|
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
|
m_pos++;
|
}
|
}
|
buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
|
}
|
|
// allocate buffer
|
buf = new utils.Buf8(buf_len);
|
|
// convert
|
for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
|
c = str.charCodeAt(m_pos);
|
if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
|
c2 = str.charCodeAt(m_pos + 1);
|
if ((c2 & 0xfc00) === 0xdc00) {
|
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
|
m_pos++;
|
}
|
}
|
if (c < 0x80) {
|
/* one byte */
|
buf[i++] = c;
|
} else if (c < 0x800) {
|
/* two bytes */
|
buf[i++] = 0xC0 | (c >>> 6);
|
buf[i++] = 0x80 | (c & 0x3f);
|
} else if (c < 0x10000) {
|
/* three bytes */
|
buf[i++] = 0xE0 | (c >>> 12);
|
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
|
buf[i++] = 0x80 | (c & 0x3f);
|
} else {
|
/* four bytes */
|
buf[i++] = 0xf0 | (c >>> 18);
|
buf[i++] = 0x80 | (c >>> 12 & 0x3f);
|
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
|
buf[i++] = 0x80 | (c & 0x3f);
|
}
|
}
|
|
return buf;
|
};
|
|
// Helper (used in 2 places)
|
function buf2binstring(buf, len) {
|
// On Chrome, the arguments in a function call that are allowed is `65534`.
|
// If the length of the buffer is smaller than that, we can use this optimization,
|
// otherwise we will take a slower path.
|
if (len < 65534) {
|
if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
|
return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
|
}
|
}
|
|
var result = '';
|
for (var i = 0; i < len; i++) {
|
result += String.fromCharCode(buf[i]);
|
}
|
return result;
|
}
|
|
|
// Convert byte array to binary string
|
exports.buf2binstring = function (buf) {
|
return buf2binstring(buf, buf.length);
|
};
|
|
|
// Convert binary string (typed, when possible)
|
exports.binstring2buf = function (str) {
|
var buf = new utils.Buf8(str.length);
|
for (var i = 0, len = buf.length; i < len; i++) {
|
buf[i] = str.charCodeAt(i);
|
}
|
return buf;
|
};
|
|
|
// convert array to string
|
exports.buf2string = function (buf, max) {
|
var i, out, c, c_len;
|
var len = max || buf.length;
|
|
// Reserve max possible length (2 words per char)
|
// NB: by unknown reasons, Array is significantly faster for
|
// String.fromCharCode.apply than Uint16Array.
|
var utf16buf = new Array(len * 2);
|
|
for (out = 0, i = 0; i < len;) {
|
c = buf[i++];
|
// quick process ascii
|
if (c < 0x80) { utf16buf[out++] = c; continue; }
|
|
c_len = _utf8len[c];
|
// skip 5 & 6 byte codes
|
if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }
|
|
// apply mask on first byte
|
c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
|
// join the rest
|
while (c_len > 1 && i < len) {
|
c = (c << 6) | (buf[i++] & 0x3f);
|
c_len--;
|
}
|
|
// terminated by end of string?
|
if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
|
|
if (c < 0x10000) {
|
utf16buf[out++] = c;
|
} else {
|
c -= 0x10000;
|
utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
|
utf16buf[out++] = 0xdc00 | (c & 0x3ff);
|
}
|
}
|
|
return buf2binstring(utf16buf, out);
|
};
|
|
|
// Calculate max possible position in utf8 buffer,
|
// that will not break sequence. If that's not possible
|
// - (very small limits) return max size as is.
|
//
|
// buf[] - utf8 bytes array
|
// max - length limit (mandatory);
|
exports.utf8border = function (buf, max) {
|
var pos;
|
|
max = max || buf.length;
|
if (max > buf.length) { max = buf.length; }
|
|
// go back from last position, until start of sequence found
|
pos = max - 1;
|
while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
|
|
// Very small and broken sequence,
|
// return max, because we should return something anyway.
|
if (pos < 0) { return max; }
|
|
// If we came to start of buffer - that means buffer is too small,
|
// return max too.
|
if (pos === 0) { return max; }
|
|
return (pos + _utf8len[buf[pos]] > max) ? pos : max;
|
};
|
|
|
/***/ }),
|
/* 91 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
function ZStream() {
|
/* next input byte */
|
this.input = null; // JS specific, because we have no pointers
|
this.next_in = 0;
|
/* number of bytes available at input */
|
this.avail_in = 0;
|
/* total number of input bytes read so far */
|
this.total_in = 0;
|
/* next output byte should be put there */
|
this.output = null; // JS specific, because we have no pointers
|
this.next_out = 0;
|
/* remaining free space at output */
|
this.avail_out = 0;
|
/* total number of bytes output so far */
|
this.total_out = 0;
|
/* last error message, NULL if no error */
|
this.msg = ''/*Z_NULL*/;
|
/* not visible by applications */
|
this.state = null;
|
/* best guess about the data type: binary or text */
|
this.data_type = 2/*Z_UNKNOWN*/;
|
/* adler32 value of the uncompressed data */
|
this.adler = 0;
|
}
|
|
module.exports = ZStream;
|
|
|
/***/ }),
|
/* 92 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
module.exports = {
|
|
/* Allowed flush values; see deflate() and inflate() below for details */
|
Z_NO_FLUSH: 0,
|
Z_PARTIAL_FLUSH: 1,
|
Z_SYNC_FLUSH: 2,
|
Z_FULL_FLUSH: 3,
|
Z_FINISH: 4,
|
Z_BLOCK: 5,
|
Z_TREES: 6,
|
|
/* Return codes for the compression/decompression functions. Negative values
|
* are errors, positive values are used for special but normal events.
|
*/
|
Z_OK: 0,
|
Z_STREAM_END: 1,
|
Z_NEED_DICT: 2,
|
Z_ERRNO: -1,
|
Z_STREAM_ERROR: -2,
|
Z_DATA_ERROR: -3,
|
//Z_MEM_ERROR: -4,
|
Z_BUF_ERROR: -5,
|
//Z_VERSION_ERROR: -6,
|
|
/* compression levels */
|
Z_NO_COMPRESSION: 0,
|
Z_BEST_SPEED: 1,
|
Z_BEST_COMPRESSION: 9,
|
Z_DEFAULT_COMPRESSION: -1,
|
|
|
Z_FILTERED: 1,
|
Z_HUFFMAN_ONLY: 2,
|
Z_RLE: 3,
|
Z_FIXED: 4,
|
Z_DEFAULT_STRATEGY: 0,
|
|
/* Possible values of the data_type field (though see inflate()) */
|
Z_BINARY: 0,
|
Z_TEXT: 1,
|
//Z_ASCII: 1, // = Z_TEXT (deprecated)
|
Z_UNKNOWN: 2,
|
|
/* The deflate compression method */
|
Z_DEFLATED: 8
|
//Z_NULL: null // Use -1 or null inline, depending on var type
|
};
|
|
|
/***/ }),
|
/* 93 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
exports.nextTick = function nextTick(fn) {
|
var args = Array.prototype.slice.call(arguments);
|
args.shift();
|
setTimeout(function () {
|
fn.apply(null, args);
|
}, 0);
|
};
|
|
exports.platform = exports.arch =
|
exports.execPath = exports.title = 'browser';
|
exports.pid = 1;
|
exports.browser = true;
|
exports.env = {};
|
exports.argv = [];
|
|
exports.binding = function (name) {
|
throw new Error('No such module. (Possibly not yet loaded)')
|
};
|
|
(function () {
|
var cwd = '/';
|
var path;
|
exports.cwd = function () { return cwd };
|
exports.chdir = function (dir) {
|
if (!path) path = __webpack_require__(158);
|
cwd = path.resolve(dir, cwd);
|
};
|
})();
|
|
exports.exit = exports.kill =
|
exports.umask = exports.dlopen =
|
exports.uptime = exports.memoryUsage =
|
exports.uvCounters = function() {};
|
exports.features = {};
|
|
|
/***/ }),
|
/* 94 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return navigateTo; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return navigateBack; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return reLaunch; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return redirectTo; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return switchTab; });
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
|
function invokeApi(method) {
|
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* INVOKE_API */ "b"], {
|
data: {
|
method: method,
|
args: args
|
},
|
options: {
|
timestamp: Date.now()
|
}
|
});
|
}
|
|
function navigateTo(args) {
|
invokeApi('navigateTo', args);
|
}
|
function navigateBack(args) {
|
invokeApi('navigateBack', args);
|
}
|
function reLaunch(args) {
|
invokeApi('reLaunch', args);
|
}
|
function redirectTo(args) {
|
invokeApi('redirectTo', args);
|
}
|
function switchTab(args) {
|
invokeApi('switchTab', args);
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 95 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ upx2px; });
|
__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ api["b" /* navigateTo */]; });
|
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ api["a" /* navigateBack */]; });
|
__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ api["c" /* reLaunch */]; });
|
__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ api["d" /* redirectTo */]; });
|
__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ api["e" /* switchTab */]; });
|
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ getSystemInfoSync; });
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ canIUse; });
|
|
// CONCATENATED MODULE: ./src/core/service/api/base/upx2px.js
|
var EPS = 1e-4;
|
var BASE_DEVICE_WIDTH = 750;
|
var isIOS = false;
|
var deviceWidth = 0;
|
var deviceDPR = 0;
|
|
function checkDeviceWidth() {
|
var _uni$getSystemInfoSyn = uni.getSystemInfoSync(),
|
platform = _uni$getSystemInfoSyn.platform,
|
pixelRatio = _uni$getSystemInfoSyn.pixelRatio,
|
windowWidth = _uni$getSystemInfoSyn.windowWidth;
|
|
deviceWidth = windowWidth;
|
deviceDPR = pixelRatio;
|
isIOS = platform === 'ios';
|
}
|
|
function checkValue(value, defaultValue) {
|
value = Number(value);
|
return isNaN(value) ? defaultValue : value;
|
}
|
|
function upx2px(number, newDeviceWidth) {
|
if (deviceWidth === 0) {
|
checkDeviceWidth();
|
}
|
|
number = Number(number);
|
|
if (number === 0) {
|
return 0;
|
}
|
|
var config = __uniConfig.globalStyle || __uniConfig.window || {};
|
var maxWidth = checkValue(config.rpxCalcMaxDeviceWidth, 960);
|
var baseWidth = checkValue(config.rpxCalcBaseDeviceWidth, 375);
|
var includeWidth = checkValue(config.rpxCalcIncludeWidth, 750);
|
var width = newDeviceWidth || deviceWidth;
|
width = number === includeWidth || width <= maxWidth ? width : baseWidth;
|
var result = number / BASE_DEVICE_WIDTH * width;
|
|
if (result < 0) {
|
result = -result;
|
}
|
|
result = Math.floor(result + EPS);
|
|
if (result === 0) {
|
if (deviceDPR === 1 || !isIOS) {
|
result = 1;
|
} else {
|
result = 0.5;
|
}
|
}
|
|
return number < 0 ? -result : result;
|
}
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/api/index.js
|
var api = __webpack_require__(94);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-window-offset.js
|
var get_window_offset = __webpack_require__(14);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/helpers/uuid.js
|
var deviceId;
|
/* harmony default export */ var uuid = (function () {
|
deviceId = deviceId || plus.device.uuid;
|
return deviceId;
|
});
|
// EXTERNAL MODULE: ./node_modules/safe-area-insets/out/index.js
|
var out = __webpack_require__(6);
|
var out_default = /*#__PURE__*/__webpack_require__.n(out);
|
|
// CONCATENATED MODULE: ./src/platforms/h5/service/api/device/get-system-info.js
|
|
|
|
var ua = navigator.userAgent;
|
/**
|
* 是否安卓设备
|
*/
|
|
var isAndroid = /android/i.test(ua);
|
/**
|
* 是否iOS设备
|
*/
|
|
var get_system_info_isIOS = /iphone|ipad|ipod/i.test(ua);
|
/**
|
* 是否是Windows设备
|
*/
|
|
var isWindows = ua.match(/Windows NT ([\d|\d.\d]*)/i);
|
/**
|
* 是否是Mac设备
|
*/
|
|
var isMac = /Macintosh|Mac/i.test(ua);
|
/**
|
* 是否是Linux设备
|
*/
|
|
var isLinux = /Linux|X11/i.test(ua);
|
/**
|
* 是否是iPadOS
|
*/
|
|
var isIPadOS = isMac && navigator.maxTouchPoints > 0;
|
/**
|
* 获取系统信息-同步
|
*/
|
|
function getSystemInfoSync() {
|
var screen = window.screen;
|
var pixelRatio = window.devicePixelRatio; // 横屏时 iOS 获取的屏幕宽高颠倒,进行纠正
|
|
var screenFix = /^Apple/.test(navigator.vendor) && typeof window.orientation === 'number';
|
var landscape = screenFix && Math.abs(window.orientation) === 90;
|
var screenWidth = screenFix ? Math[landscape ? 'max' : 'min'](screen.width, screen.height) : screen.width;
|
var screenHeight = screenFix ? Math[landscape ? 'min' : 'max'](screen.height, screen.width) : screen.height;
|
var windowWidth = Math.min(window.innerWidth, document.documentElement.clientWidth, screenWidth) || screenWidth;
|
var windowHeight = window.innerHeight;
|
var language = navigator.language;
|
var statusBarHeight = out_default.a.top;
|
var osname;
|
var osversion;
|
var model;
|
|
if (get_system_info_isIOS) {
|
osname = 'iOS';
|
var osversionFind = ua.match(/OS\s([\w_]+)\slike/);
|
|
if (osversionFind) {
|
osversion = osversionFind[1].replace(/_/g, '.');
|
}
|
|
var modelFind = ua.match(/\(([a-zA-Z]+);/);
|
|
if (modelFind) {
|
model = modelFind[1];
|
}
|
} else if (isAndroid) {
|
osname = 'Android'; // eslint-disable-next-line no-useless-escape
|
|
var _osversionFind = ua.match(/Android[\s/]([\w\.]+)[;\s]/);
|
|
if (_osversionFind) {
|
osversion = _osversionFind[1];
|
}
|
|
var infoFind = ua.match(/\((.+?)\)/);
|
var infos = infoFind ? infoFind[1].split(';') : ua.split(' '); // eslint-disable-next-line no-useless-escape
|
|
var otherInfo = [/\bAndroid\b/i, /\bLinux\b/i, /\bU\b/i, /^\s?[a-z][a-z]$/i, /^\s?[a-z][a-z]-[a-z][a-z]$/i, /\bwv\b/i, /\/[\d\.,]+$/, /^\s?[\d\.,]+$/, /\bBrowser\b/i, /\bMobile\b/i];
|
|
for (var i = 0; i < infos.length; i++) {
|
var info = infos[i];
|
|
if (info.indexOf('Build') > 0) {
|
model = info.split('Build')[0].trim();
|
break;
|
}
|
|
var other = void 0;
|
|
for (var o = 0; o < otherInfo.length; o++) {
|
if (otherInfo[o].test(info)) {
|
other = true;
|
break;
|
}
|
}
|
|
if (!other) {
|
model = info.trim();
|
break;
|
}
|
}
|
} else if (isIPadOS) {
|
model = 'iPad';
|
osname = 'iOS';
|
osversion = typeof window.BigInt === 'function' ? '14.0' : '13.0';
|
} else if (isWindows || isMac || isLinux) {
|
model = 'PC';
|
var _osversionFind2 = ua.match(/\((.+?)\)/)[1];
|
|
if (isWindows) {
|
osname = 'Windows';
|
osversion = '';
|
|
switch (isWindows[1]) {
|
case '5.1':
|
osversion = 'XP';
|
break;
|
|
case '6.0':
|
osversion = 'Vista';
|
break;
|
|
case '6.1':
|
osversion = '7';
|
break;
|
|
case '6.2':
|
osversion = '8';
|
break;
|
|
case '6.3':
|
osversion = '8.1';
|
break;
|
|
case '10.0':
|
osversion = '10';
|
break;
|
}
|
|
var framework = _osversionFind2.match(/[Win|WOW]([\d]+)/);
|
|
if (framework) {
|
osversion += " x".concat(framework[1]);
|
}
|
} else if (isMac) {
|
osname = 'Mac';
|
osversion = _osversionFind2.match(/Mac OS X (.+)/) || '';
|
|
if (osversion) {
|
osversion = osversion[1].replace(/_/g, '.'); // '10_15_7' or '10.16; rv:86.0'
|
|
if (osversion.indexOf(';') !== -1) {
|
osversion = osversion.split(';')[0];
|
}
|
}
|
} else if (isLinux) {
|
osname = 'Linux';
|
osversion = _osversionFind2.match(/Linux (.*)/) || '';
|
|
if (osversion) {
|
osversion = osversion[1]; // 'x86_64' or 'x86_64; rv:79.0'
|
|
if (osversion.indexOf(';') !== -1) {
|
osversion = osversion.split(';')[0];
|
}
|
}
|
}
|
} else {
|
osname = 'Other';
|
osversion = '0';
|
}
|
|
var system = "".concat(osname, " ").concat(osversion);
|
var platform = osname.toLocaleLowerCase();
|
var safeArea = {
|
left: out_default.a.left,
|
right: windowWidth - out_default.a.right,
|
top: out_default.a.top,
|
bottom: windowHeight - out_default.a.bottom,
|
width: windowWidth - out_default.a.left - out_default.a.right,
|
height: windowHeight - out_default.a.top - out_default.a.bottom
|
};
|
|
var _getWindowOffset = Object(get_window_offset["a" /* default */])(),
|
windowTop = _getWindowOffset.top,
|
windowBottom = _getWindowOffset.bottom;
|
|
windowHeight -= windowTop;
|
windowHeight -= windowBottom;
|
return {
|
windowTop: windowTop,
|
windowBottom: windowBottom,
|
windowWidth: windowWidth,
|
windowHeight: windowHeight,
|
pixelRatio: pixelRatio,
|
screenWidth: screenWidth,
|
screenHeight: screenHeight,
|
language: language,
|
statusBarHeight: statusBarHeight,
|
system: system,
|
platform: platform,
|
model: model,
|
safeArea: safeArea,
|
safeAreaInsets: {
|
top: out_default.a.top,
|
right: out_default.a.right,
|
bottom: out_default.a.bottom,
|
left: out_default.a.left
|
},
|
deviceId: uuid()
|
};
|
}
|
/**
|
* 获取系统信息-异步
|
*/
|
|
function getSystemInfo() {
|
return getSystemInfoSync();
|
}
|
// CONCATENATED MODULE: ./lib/app-plus/view-api.js
|
|
|
|
function canIUse(schema) {
|
if (schema === 'css.var') {
|
return window.CSS && window.CSS.supports && window.CSS.supports('--a:0');
|
}
|
|
return true;
|
}
|
|
/***/ }),
|
/* 96 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return requestComponentInfo; });
|
/* harmony import */ var uni_helpers_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
/* harmony import */ var uni_platform_helpers_get_window_offset__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21);
|
|
|
|
|
function getRootInfo(fields) {
|
var info = {};
|
|
if (fields.id) {
|
info.id = '';
|
}
|
|
if (fields.dataset) {
|
info.dataset = {};
|
}
|
|
if (fields.rect) {
|
info.left = 0;
|
info.right = 0;
|
info.top = 0;
|
info.bottom = 0;
|
}
|
|
if (fields.size) {
|
info.width = document.documentElement.clientWidth;
|
info.height = document.documentElement.clientHeight;
|
}
|
|
if (fields.scrollOffset) {
|
var documentElement = document.documentElement;
|
var body = document.body;
|
info.scrollLeft = documentElement.scrollLeft || body.scrollLeft || 0;
|
info.scrollTop = documentElement.scrollTop || body.scrollTop || 0;
|
info.scrollHeight = documentElement.scrollHeight || body.scrollHeight || 0;
|
info.scrollWidth = documentElement.scrollWidth || body.scrollWidth || 0;
|
}
|
|
return info;
|
}
|
|
function getNodeInfo(el, fields) {
|
var info = {};
|
|
var _getWindowOffset = Object(uni_platform_helpers_get_window_offset__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(),
|
top = _getWindowOffset.top;
|
|
if (fields.id) {
|
info.id = el.id;
|
}
|
|
if (fields.dataset) {
|
info.dataset = Object(uni_helpers_index__WEBPACK_IMPORTED_MODULE_0__[/* getTargetDataset */ "a"])(el);
|
}
|
|
if (fields.rect || fields.size) {
|
var rect = el.getBoundingClientRect();
|
|
if (fields.rect) {
|
info.left = rect.left;
|
info.right = rect.right;
|
info.top = rect.top - top;
|
info.bottom = rect.bottom - top;
|
}
|
|
if (fields.size) {
|
info.width = rect.width;
|
info.height = rect.height;
|
}
|
} // TODO 组件 props
|
|
|
if (Array.isArray(fields.properties)) {
|
fields.properties.forEach(function (prop) {
|
prop = prop.replace(/-([a-z])/g, function (e, t) {
|
return t.toUpperCase();
|
}); // props
|
});
|
}
|
|
if (fields.scrollOffset) {
|
if (el.tagName === 'UNI-SCROLL-VIEW' && el.__vue__ && el.__vue__.getScrollPosition) {
|
Object.assign(info, el.__vue__.getScrollPosition());
|
} else {
|
info.scrollLeft = 0;
|
info.scrollTop = 0;
|
info.scrollHeight = 0;
|
info.scrollWidth = 0;
|
}
|
}
|
|
if (Array.isArray(fields.computedStyle)) {
|
var sytle = getComputedStyle(el);
|
fields.computedStyle.forEach(function (name) {
|
info[name] = sytle[name];
|
});
|
}
|
|
if (fields.context) {
|
if (el.__vue__ && el.__vue__._getContextInfo) {
|
info.context = el.__vue__._getContextInfo();
|
}
|
}
|
|
return info;
|
}
|
|
function getNodesInfo(pageVm, component, selector, single, fields) {
|
var $el = Object(_util__WEBPACK_IMPORTED_MODULE_2__[/* elementMatchesPolyfill */ "a"])(Object(_util__WEBPACK_IMPORTED_MODULE_2__[/* findElm */ "b"])(component, pageVm));
|
|
if (!$el || $el && $el.nodeType === 8) {
|
// Comment
|
return single ? null : [];
|
}
|
|
if (single) {
|
var node = $el.matches(selector) ? $el : $el.querySelector(selector);
|
|
if (node) {
|
return getNodeInfo(node, fields);
|
}
|
|
return null;
|
} else {
|
var infos = [];
|
var nodeList = $el.querySelectorAll(selector);
|
|
if (nodeList && nodeList.length) {
|
infos = [].map.call(nodeList, function (node) {
|
return getNodeInfo(node, fields);
|
});
|
}
|
|
if ($el.matches(selector)) {
|
infos.unshift(getNodeInfo($el, fields));
|
}
|
|
return infos;
|
}
|
}
|
|
function requestComponentInfo(_ref, pageId) {
|
var reqId = _ref.reqId,
|
reqs = _ref.reqs;
|
var pageVm;
|
|
if (pageId._isVue) {
|
pageVm = pageId;
|
} else {
|
var pages = getCurrentPages(); // 跨平台时,View 层也应该实现该方法,举例 App 上,View 层的 getCurrentPages 返回长度为1的当前页面数组
|
|
var page = pages.find(function (page) {
|
return page.$page.id === pageId;
|
});
|
|
if (!page) {
|
throw new Error("Not Found\uFF1APage[".concat(pageId, "]"));
|
}
|
|
pageVm = page.$vm;
|
}
|
|
var result = [];
|
reqs.forEach(function (_ref2) {
|
var component = _ref2.component,
|
selector = _ref2.selector,
|
single = _ref2.single,
|
fields = _ref2.fields;
|
|
if (component === 0) {
|
result.push(getRootInfo(fields));
|
} else {
|
result.push(getNodesInfo(pageVm, component, selector, single, fields));
|
}
|
});
|
UniViewJSBridge.publishHandler('onRequestComponentInfo', {
|
reqId: reqId,
|
res: result
|
});
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 97 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return loadFontFace; });
|
function loadFontFace(_ref) {
|
var options = _ref.options,
|
callbackId = _ref.callbackId;
|
var family = options.family,
|
source = options.source,
|
_options$desc = options.desc,
|
desc = _options$desc === void 0 ? {} : _options$desc;
|
var fonts = document.fonts;
|
|
if (fonts) {
|
var fontFace = new FontFace(family, source, desc);
|
fontFace.load().then(function () {
|
fonts.add(fontFace);
|
UniViewJSBridge.publishHandler('onLoadFontFaceCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: 'loadFontFace:ok'
|
}
|
});
|
}).catch(function (error) {
|
UniViewJSBridge.publishHandler('onLoadFontFaceCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: "loadFontFace:fail ".concat(error)
|
}
|
});
|
});
|
} else {
|
var style = document.createElement('style');
|
style.innerText = "@font-face{font-family:\"".concat(family, "\";src:").concat(source, ";font-style:").concat(desc.style, ";font-weight:").concat(desc.weight, ";font-stretch:").concat(desc.stretch, ";unicode-range:").concat(desc.unicodeRange, ";font-variant:").concat(desc.variant, ";font-feature-settings:").concat(desc.featureSettings, ";}");
|
document.head.appendChild(style);
|
UniViewJSBridge.publishHandler('onLoadFontFaceCallback', {
|
callbackId: callbackId,
|
data: {
|
errMsg: 'loadFontFace:ok'
|
}
|
});
|
}
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 98 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(global, UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initSubscribe; });
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
/* harmony import */ var uni_core_helpers_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
|
/* harmony import */ var uni_core_view_bridge_subscribe_scroll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22);
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67);
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
|
|
|
|
|
|
var passiveOptions = uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* supportsPassive */ "k"] ? {
|
passive: false
|
} : false;
|
|
function onCssVar(_ref) {
|
var statusbarHeight = _ref.statusbarHeight,
|
windowTop = _ref.windowTop,
|
windowBottom = _ref.windowBottom;
|
global.__WINDOW_TOP = windowTop;
|
global.__WINDOW_BOTTOM = windowBottom;
|
|
if (uni.canIUse('css.var')) {
|
var style = document.documentElement.style; // TODO
|
|
style.setProperty('--window-left', '0px');
|
style.setProperty('--window-right', '0px');
|
style.setProperty('--window-top', windowTop + 'px');
|
style.setProperty('--window-bottom', windowBottom + 'px');
|
style.setProperty('--status-bar-height', statusbarHeight + 'px');
|
|
if (true) {
|
console.log("--status-bar-height=".concat(statusbarHeight));
|
console.log("--window-top=".concat(windowTop));
|
console.log("--window-bottom=".concat(windowBottom));
|
}
|
}
|
}
|
|
function onPageCreate(_ref2, pageId) {
|
var locale = _ref2.locale,
|
statusbarHeight = _ref2.statusbarHeight,
|
windowTop = _ref2.windowTop,
|
windowBottom = _ref2.windowBottom,
|
disableScroll = _ref2.disableScroll,
|
onPageScroll = _ref2.onPageScroll,
|
onPageReachBottom = _ref2.onPageReachBottom,
|
onReachBottomDistance = _ref2.onReachBottomDistance;
|
Object(uni_core_helpers_i18n__WEBPACK_IMPORTED_MODULE_1__[/* setLocale */ "c"])(locale);
|
onCssVar({
|
statusbarHeight: statusbarHeight,
|
windowTop: windowTop,
|
windowBottom: windowBottom
|
});
|
|
if (disableScroll) {
|
document.addEventListener('touchmove', uni_core_view_bridge_subscribe_scroll__WEBPACK_IMPORTED_MODULE_2__[/* disableScroll */ "b"], passiveOptions);
|
} else if (onPageScroll || onPageReachBottom) {
|
requestAnimationFrame(function () {
|
// 避免监听太早,直接触发了 scroll
|
document.addEventListener('scroll', Object(uni_core_view_bridge_subscribe_scroll__WEBPACK_IMPORTED_MODULE_2__[/* createScrollListener */ "a"])(pageId, {
|
enablePageScroll: onPageScroll,
|
enablePageReachBottom: onPageReachBottom,
|
onReachBottomDistance: onReachBottomDistance
|
}));
|
});
|
}
|
}
|
|
function onWebviewReady() {
|
// service 主动发起检测
|
UniViewJSBridge.publishHandler('webviewReady');
|
}
|
|
function initSubscribe(subscribe) {
|
subscribe(_constants__WEBPACK_IMPORTED_MODULE_4__[/* WEBVIEW_READY */ "m"], onWebviewReady);
|
subscribe(_constants__WEBPACK_IMPORTED_MODULE_3__[/* ON_PAGE_CREATE */ "a"], onPageCreate);
|
subscribe(_constants__WEBPACK_IMPORTED_MODULE_4__[/* SET_LOCALE */ "f"], uni_core_helpers_i18n__WEBPACK_IMPORTED_MODULE_1__[/* setLocale */ "c"]);
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19), __webpack_require__(4)))
|
|
/***/ }),
|
/* 99 */
|
/***/ (function(module) {
|
|
module.exports = JSON.parse("{\"uni.app.quit\":\"Press back button again to exit\",\"uni.async.error\":\"The connection timed out, click the screen to try again.\",\"uni.showActionSheet.cancel\":\"Cancel\",\"uni.showToast.unpaired\":\"Please note showToast must be paired with hideToast\",\"uni.showLoading.unpaired\":\"Please note showLoading must be paired with hideLoading\",\"uni.showModal.cancel\":\"Cancel\",\"uni.showModal.confirm\":\"OK\",\"uni.chooseImage.cancel\":\"Cancel\",\"uni.chooseImage.sourceType.album\":\"Album\",\"uni.chooseImage.sourceType.camera\":\"Camera\",\"uni.chooseVideo.cancel\":\"Cancel\",\"uni.chooseVideo.sourceType.album\":\"Album\",\"uni.chooseVideo.sourceType.camera\":\"Camera\",\"uni.chooseFile.notUserActivation\":\"File chooser dialog can only be shown with a user activation\",\"uni.previewImage.button.save\":\"Save Image\",\"uni.previewImage.save.success\":\"Saved successfully\",\"uni.previewImage.save.fail\":\"Save failed\",\"uni.setClipboardData.success\":\"Content copied\",\"uni.scanCode.title\":\"Scan code\",\"uni.scanCode.album\":\"Album\",\"uni.scanCode.fail\":\"Recognition failure\",\"uni.scanCode.flash.on\":\"Tap to turn light on\",\"uni.scanCode.flash.off\":\"Tap to turn light off\",\"uni.startSoterAuthentication.authContent\":\"Fingerprint recognition\",\"uni.picker.done\":\"Done\",\"uni.picker.cancel\":\"Cancel\",\"uni.video.danmu\":\"Danmu\",\"uni.video.volume\":\"Volume\",\"uni.button.feedback.title\":\"feedback\",\"uni.button.feedback.send\":\"send\",\"uni.chooseLocation.search\":\"Find Place\",\"uni.chooseLocation.cancel\":\"Cancel\"}");
|
|
/***/ }),
|
/* 100 */
|
/***/ (function(module) {
|
|
module.exports = JSON.parse("{\"uni.app.quit\":\"Pulse otra vez para salir\",\"uni.async.error\":\"Se agotó el tiempo de conexión, haga clic en la pantalla para volver a intentarlo.\",\"uni.showActionSheet.cancel\":\"Cancelar\",\"uni.showToast.unpaired\":\"Tenga en cuenta que showToast debe estar emparejado con hideToast\",\"uni.showLoading.unpaired\":\"Tenga en cuenta que showLoading debe estar emparejado con hideLoading\",\"uni.showModal.cancel\":\"Cancelar\",\"uni.showModal.confirm\":\"OK\",\"uni.chooseImage.cancel\":\"Cancelar\",\"uni.chooseImage.sourceType.album\":\"Álbum\",\"uni.chooseImage.sourceType.camera\":\"Cámara\",\"uni.chooseVideo.cancel\":\"Cancelar\",\"uni.chooseVideo.sourceType.album\":\"Álbum\",\"uni.chooseVideo.sourceType.camera\":\"Cámara\",\"uni.chooseFile.notUserActivation\":\"El cuadro de diálogo del selector de archivos solo se puede mostrar con la activación del usuario\",\"uni.previewImage.cancel\":\"Cancelar\",\"uni.previewImage.button.save\":\"Guardar imagen\",\"uni.previewImage.save.success\":\"Guardado exitosamente\",\"uni.previewImage.save.fail\":\"Error al guardar\",\"uni.setClipboardData.success\":\"Contenido copiado\",\"uni.scanCode.title\":\"Código de escaneo\",\"uni.scanCode.album\":\"Álbum\",\"uni.scanCode.fail\":\"Échec de la reconnaissance\",\"uni.scanCode.flash.on\":\"Toque para encender la luz\",\"uni.scanCode.flash.off\":\"Toque para apagar la luz\",\"uni.startSoterAuthentication.authContent\":\"Reconocimiento de huellas dactilares\",\"uni.picker.done\":\"OK\",\"uni.picker.cancel\":\"Cancelar\",\"uni.video.danmu\":\"Danmu\",\"uni.video.volume\":\"Volumen\",\"uni.button.feedback.title\":\"realimentación\",\"uni.button.feedback.send\":\"enviar\",\"uni.chooseLocation.search\":\"Encontrar\",\"uni.chooseLocation.cancel\":\"Cancelar\"}");
|
|
/***/ }),
|
/* 101 */
|
/***/ (function(module) {
|
|
module.exports = JSON.parse("{\"uni.app.quit\":\"Appuyez à nouveau pour quitter l'application\",\"uni.async.error\":\"La connexion a expiré, cliquez sur l'écran pour réessayer.\",\"uni.showActionSheet.cancel\":\"Annuler\",\"uni.showToast.unpaired\":\"Veuillez noter que showToast doit être associé à hideToast\",\"uni.showLoading.unpaired\":\"Veuillez noter que showLoading doit être associé à hideLoading\",\"uni.showModal.cancel\":\"Annuler\",\"uni.showModal.confirm\":\"OK\",\"uni.chooseImage.cancel\":\"Annuler\",\"uni.chooseImage.sourceType.album\":\"Album\",\"uni.chooseImage.sourceType.camera\":\"Caméra\",\"uni.chooseVideo.cancel\":\"Annuler\",\"uni.chooseVideo.sourceType.album\":\"Album\",\"uni.chooseVideo.sourceType.camera\":\"Caméra\",\"uni.chooseFile.notUserActivation\":\"La boîte de dialogue du sélecteur de fichier ne peut être affichée qu'avec une activation par l'utilisateur\",\"uni.previewImage.cancel\":\"Annuler\",\"uni.previewImage.button.save\":\"Guardar imagen\",\"uni.previewImage.save.success\":\"Enregistré avec succès\",\"uni.previewImage.save.fail\":\"Échec de la sauvegarde\",\"uni.setClipboardData.success\":\"Contenu copié\",\"uni.scanCode.title\":\"Code d’analyse\",\"uni.scanCode.album\":\"Album\",\"uni.scanCode.fail\":\"Fallo de reconocimiento\",\"uni.scanCode.flash.on\":\"Appuyez pour activer l'éclairage\",\"uni.scanCode.flash.off\":\"Appuyez pour désactiver l'éclairage\",\"uni.startSoterAuthentication.authContent\":\"Reconnaissance de l'empreinte digitale\",\"uni.picker.done\":\"OK\",\"uni.picker.cancel\":\"Annuler\",\"uni.video.danmu\":\"Danmu\",\"uni.video.volume\":\"Le Volume\",\"uni.button.feedback.title\":\"retour d'information\",\"uni.button.feedback.send\":\"envoyer\",\"uni.chooseLocation.search\":\"Trouve\",\"uni.chooseLocation.cancel\":\"Annuler\"}");
|
|
/***/ }),
|
/* 102 */
|
/***/ (function(module) {
|
|
module.exports = JSON.parse("{\"uni.app.quit\":\"再按一次退出应用\",\"uni.async.error\":\"连接服务器超时,点击屏幕重试\",\"uni.showActionSheet.cancel\":\"取消\",\"uni.showToast.unpaired\":\"请注意 showToast 与 hideToast 必须配对使用\",\"uni.showLoading.unpaired\":\"请注意 showLoading 与 hideLoading 必须配对使用\",\"uni.showModal.cancel\":\"取消\",\"uni.showModal.confirm\":\"确定\",\"uni.chooseImage.cancel\":\"取消\",\"uni.chooseImage.sourceType.album\":\"从相册选择\",\"uni.chooseImage.sourceType.camera\":\"拍摄\",\"uni.chooseVideo.cancel\":\"取消\",\"uni.chooseVideo.sourceType.album\":\"从相册选择\",\"uni.chooseVideo.sourceType.camera\":\"拍摄\",\"uni.chooseFile.notUserActivation\":\"文件选择器对话框只能在用户激活时显示\",\"uni.previewImage.cancel\":\"取消\",\"uni.previewImage.button.save\":\"保存图像\",\"uni.previewImage.save.success\":\"保存图像到相册成功\",\"uni.previewImage.save.fail\":\"保存图像到相册失败\",\"uni.setClipboardData.success\":\"内容已复制\",\"uni.scanCode.title\":\"扫码\",\"uni.scanCode.album\":\"相册\",\"uni.scanCode.fail\":\"识别失败\",\"uni.scanCode.flash.on\":\"轻触照亮\",\"uni.scanCode.flash.off\":\"轻触关闭\",\"uni.startSoterAuthentication.authContent\":\"指纹识别中...\",\"uni.picker.done\":\"完成\",\"uni.picker.cancel\":\"取消\",\"uni.video.danmu\":\"弹幕\",\"uni.video.volume\":\"音量\",\"uni.button.feedback.title\":\"问题反馈\",\"uni.button.feedback.send\":\"发送\",\"uni.chooseLocation.search\":\"搜索地点\",\"uni.chooseLocation.cancel\":\"取消\"}");
|
|
/***/ }),
|
/* 103 */
|
/***/ (function(module) {
|
|
module.exports = JSON.parse("{\"uni.app.quit\":\"再按一次退出應用\",\"uni.async.error\":\"連接服務器超時,點擊屏幕重試\",\"uni.showActionSheet.cancel\":\"取消\",\"uni.showToast.unpaired\":\"請注意 showToast 與 hideToast 必須配對使用\",\"uni.showLoading.unpaired\":\"請注意 showLoading 與 hideLoading 必須配對使用\",\"uni.showModal.cancel\":\"取消\",\"uni.showModal.confirm\":\"確定\",\"uni.chooseImage.cancel\":\"取消\",\"uni.chooseImage.sourceType.album\":\"從相冊選擇\",\"uni.chooseImage.sourceType.camera\":\"拍攝\",\"uni.chooseVideo.cancel\":\"取消\",\"uni.chooseVideo.sourceType.album\":\"從相冊選擇\",\"uni.chooseVideo.sourceType.camera\":\"拍攝\",\"uni.chooseFile.notUserActivation\":\"文件選擇器對話框只能在用戶激活時顯示\",\"uni.previewImage.cancel\":\"取消\",\"uni.previewImage.button.save\":\"保存圖像\",\"uni.previewImage.save.success\":\"保存圖像到相冊成功\",\"uni.previewImage.save.fail\":\"保存圖像到相冊失敗\",\"uni.setClipboardData.success\":\"內容已復制\",\"uni.scanCode.title\":\"掃碼\",\"uni.scanCode.album\":\"相冊\",\"uni.scanCode.fail\":\"識別失敗\",\"uni.scanCode.flash.on\":\"輕觸照亮\",\"uni.scanCode.flash.off\":\"輕觸關閉\",\"uni.startSoterAuthentication.authContent\":\"指紋識別中...\",\"uni.picker.done\":\"完成\",\"uni.picker.cancel\":\"取消\",\"uni.video.danmu\":\"彈幕\",\"uni.video.volume\":\"音量\",\"uni.button.feedback.title\":\"問題反饋\",\"uni.button.feedback.send\":\"發送\",\"uni.chooseLocation.search\":\"搜索地點\",\"uni.chooseLocation.cancel\":\"取消\"}");
|
|
/***/ }),
|
/* 104 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_helpers_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
|
/* harmony import */ var _behaviors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(112);
|
/* harmony import */ var _wxs_component_descriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(105);
|
|
|
|
|
|
function pageMounted() {
|
// 通知 Service,View 层已 ready
|
UniViewJSBridge.publishHandler('onPageReady', {}, this.$page.id);
|
}
|
/**
|
* View 层 Vue 插件
|
* 1.init events
|
* 2.$trigger
|
* 3.$handleProxy
|
*/
|
|
|
/* harmony default export */ __webpack_exports__["a"] = ({
|
install: function install(Vue) {
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
routes = _ref.routes;
|
|
Object(_events__WEBPACK_IMPORTED_MODULE_1__[/* initEvents */ "a"])();
|
|
var findUniTarget = function findUniTarget($event, $el) {
|
var target = $event.target;
|
|
for (; target && target !== $el; target = target.parentNode) {
|
if (target.tagName && target.tagName.indexOf('UNI-') === 0) {
|
break;
|
}
|
}
|
|
return target;
|
};
|
|
Vue.prototype.$handleEvent = function ($event) {
|
if ($event instanceof Event) {
|
// 未处理的 event 对象 需要对 target 校正及包装
|
// 查找 uniTarget
|
var target = findUniTarget($event, this.$el);
|
$event = _events__WEBPACK_IMPORTED_MODULE_1__[/* processEvent */ "b"].call(this, $event.type, $event, {}, target || $event.target, $event.currentTarget);
|
}
|
|
return $event;
|
};
|
|
Vue.prototype.$getComponentDescriptor = function (vm, isOwnerInstance) {
|
return Object(_wxs_component_descriptor__WEBPACK_IMPORTED_MODULE_3__[/* createComponentDescriptor */ "a"])(vm || this, isOwnerInstance);
|
};
|
|
Object.defineProperty(Vue.prototype, '$ownerInstance', {
|
get: function get() {
|
return this.$getComponentDescriptor(this);
|
}
|
});
|
|
Vue.prototype.$handleWxsEvent = function ($event) {
|
if ($event instanceof Event) {
|
// 未处理的 event 对象 需要对 target 校正及包装
|
var currentTarget = $event.currentTarget;
|
|
var instance = currentTarget && currentTarget.__vue__ && currentTarget.__vue__.$getComponentDescriptor(currentTarget.__vue__, false);
|
|
var $origEvent = $event;
|
$event = _events__WEBPACK_IMPORTED_MODULE_1__[/* processEvent */ "b"].call(this, $origEvent.type, $origEvent, {}, findUniTarget($origEvent, this.$el) || $origEvent.target, $origEvent.currentTarget);
|
$event.instance = instance;
|
|
$event.preventDefault = function () {
|
return $origEvent.preventDefault();
|
};
|
|
$event.stopPropagation = function () {
|
return $origEvent.stopPropagation();
|
};
|
}
|
|
return $event;
|
};
|
|
Vue.mixin({
|
beforeCreate: function beforeCreate() {
|
var _this = this;
|
|
var options = this.$options;
|
var wxs = options.wxs;
|
|
if (wxs) {
|
Object.keys(wxs).forEach(function (module) {
|
_this[module] = wxs[module];
|
});
|
}
|
|
if (options.behaviors && options.behaviors.length) {
|
Object(_behaviors__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(options, this);
|
}
|
|
if (false) {}
|
}
|
});
|
}
|
});
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 105 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge, global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createComponentDescriptor; });
|
/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
var CLASS_RE = /^\s+|\s+$/g;
|
var WXS_CLASS_RE = /\s+/;
|
|
function getWxsClsArr(clsArr, classList, isAdd) {
|
var wxsClsArr = [];
|
|
var _checkClassList = function checkClassList(cls) {
|
if (isAdd) {
|
_checkClassList = function checkClassList(cls) {
|
return !classList.contains(cls);
|
};
|
} else {
|
_checkClassList = function checkClassList(cls) {
|
return classList.contains(cls);
|
};
|
}
|
|
return _checkClassList(cls);
|
};
|
|
clsArr.forEach(function (cls) {
|
cls = cls.replace(CLASS_RE, '');
|
_checkClassList(cls) && wxsClsArr.push(cls);
|
});
|
return wxsClsArr;
|
}
|
|
function parseStyleText(cssText) {
|
var res = {};
|
var listDelimiter = /;(?![^(]*\))/g;
|
var propertyDelimiter = /:(.+)/;
|
cssText.split(listDelimiter).forEach(function (item) {
|
if (item) {
|
var tmp = item.split(propertyDelimiter);
|
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
|
}
|
});
|
return res;
|
}
|
|
var ComponentDescriptor = /*#__PURE__*/function () {
|
function ComponentDescriptor(vm) {
|
_classCallCheck(this, ComponentDescriptor);
|
|
this.$vm = vm;
|
this.$el = vm.$el;
|
}
|
|
_createClass(ComponentDescriptor, [{
|
key: "selectComponent",
|
value: function selectComponent(selector) {
|
if (!this.$el || !selector) {
|
return;
|
}
|
|
var el = this.$el.querySelector(selector);
|
return el && el.__vue__ && createComponentDescriptor(el.__vue__, false);
|
}
|
}, {
|
key: "selectAllComponents",
|
value: function selectAllComponents(selector) {
|
if (!this.$el || !selector) {
|
return [];
|
}
|
|
var descriptors = [];
|
var els = this.$el.querySelectorAll(selector);
|
|
for (var i = 0; i < els.length; i++) {
|
var el = els[i];
|
el.__vue__ && descriptors.push(createComponentDescriptor(el.__vue__, false));
|
}
|
|
return descriptors;
|
}
|
}, {
|
key: "setStyle",
|
value: function setStyle(style) {
|
if (!this.$el || !style) {
|
return this;
|
}
|
|
if (typeof style === 'string') {
|
style = parseStyleText(style);
|
}
|
|
if (Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "g"])(style)) {
|
this.$el.__wxsStyle = style;
|
this.$vm.$forceUpdate();
|
}
|
|
return this;
|
}
|
}, {
|
key: "addClass",
|
value: function addClass() {
|
for (var _len = arguments.length, clsArr = new Array(_len), _key = 0; _key < _len; _key++) {
|
clsArr[_key] = arguments[_key];
|
}
|
|
if (!this.$el || !clsArr.length) {
|
return this;
|
}
|
|
var wxsClsArr = getWxsClsArr(clsArr, this.$el.classList, true);
|
|
if (wxsClsArr.length) {
|
var wxsClass = this.$el.__wxsAddClass || '';
|
this.$el.__wxsAddClass = wxsClass + (wxsClass ? ' ' : '') + wxsClsArr.join(' ');
|
this.$vm.$forceUpdate();
|
}
|
|
return this;
|
}
|
}, {
|
key: "removeClass",
|
value: function removeClass() {
|
for (var _len2 = arguments.length, clsArr = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
clsArr[_key2] = arguments[_key2];
|
}
|
|
if (!this.$el || !clsArr.length) {
|
return this;
|
}
|
|
var classList = this.$el.classList;
|
var addWxsClsArr = this.$el.__wxsAddClass ? this.$el.__wxsAddClass.split(WXS_CLASS_RE) : [];
|
var wxsClsArr = getWxsClsArr(clsArr, classList, false);
|
|
if (wxsClsArr.length) {
|
var removeWxsClsArr = [];
|
wxsClsArr.forEach(function (cls) {
|
var clsIndex = addWxsClsArr.findIndex(function (oldCls) {
|
return oldCls === cls;
|
});
|
|
if (clsIndex !== -1) {
|
// 在 addWxsClass 中
|
addWxsClsArr.splice(clsIndex, 1);
|
}
|
|
removeWxsClsArr.push(cls);
|
});
|
this.$el.__wxsRemoveClass = removeWxsClsArr;
|
this.$el.__wxsAddClass = addWxsClsArr.join(' ');
|
this.$vm.$forceUpdate();
|
}
|
|
return this;
|
}
|
}, {
|
key: "hasClass",
|
value: function hasClass(cls) {
|
return this.$el && this.$el.classList.contains(cls);
|
}
|
}, {
|
key: "getComputedStyle",
|
value: function getComputedStyle() {
|
if (this.$el) {
|
return window.getComputedStyle(this.$el);
|
}
|
|
return {};
|
}
|
}, {
|
key: "getDataset",
|
value: function getDataset() {
|
return this.$el && this.$el.dataset;
|
}
|
}, {
|
key: "callMethod",
|
value: function callMethod(funcName) {
|
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
if (funcName in this.$vm) {
|
this.$vm[funcName](JSON.parse(JSON.stringify(args)));
|
} else if (this.$vm._$id) {
|
UniViewJSBridge.publishHandler('onWxsInvokeCallMethod', {
|
cid: this.$vm._$id,
|
method: funcName,
|
args: args
|
});
|
}
|
}
|
}, {
|
key: "requestAnimationFrame",
|
value: function requestAnimationFrame(callback) {
|
return global.requestAnimationFrame(callback), this;
|
}
|
}, {
|
key: "getState",
|
value: function getState() {
|
return this.$el && (this.$el.__wxsState || (this.$el.__wxsState = {}));
|
}
|
}, {
|
key: "triggerEvent",
|
value: function triggerEvent(eventName) {
|
var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
// TODO options
|
return this.$vm.$emit(eventName, detail), this;
|
}
|
}]);
|
|
return ComponentDescriptor;
|
}();
|
|
function createComponentDescriptor(vm) {
|
var isOwnerInstance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
if (isOwnerInstance && vm && vm.$options.name && vm.$options.name.indexOf('VUni') === 0) {
|
// ownerInstance 内置组件需要使用父 vm
|
vm = vm.$parent;
|
} // 改为挂载到 vm 实例,不同 vm 实例的 $el 可能重复
|
|
|
if (vm) {
|
if (!('__wxsComponentDescriptor' in vm)) {
|
vm.__wxsComponentDescriptor = new ComponentDescriptor(vm);
|
}
|
|
return vm.__wxsComponentDescriptor;
|
}
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4), __webpack_require__(19)))
|
|
/***/ }),
|
/* 106 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VDomSync; });
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
/* harmony import */ var _helpers_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81);
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
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(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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; }
|
|
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; }
|
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
function findParent(vm) {
|
var parent = vm.$parent;
|
|
while (parent) {
|
if (parent._$id) {
|
return parent;
|
}
|
|
parent = parent.$parent;
|
}
|
}
|
|
var VDomSync = /*#__PURE__*/function () {
|
function VDomSync(pageId) {
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
_classCallCheck(this, VDomSync);
|
|
this.pageId = pageId;
|
this.addBatchVData = Object.create(null);
|
this.updateBatchVData = [];
|
this.vms = Object.create(null);
|
this.version = options.version;
|
}
|
|
_createClass(VDomSync, [{
|
key: "addVData",
|
value: function addVData(cid) {
|
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
this.addBatchVData[cid] = [data, options];
|
}
|
}, {
|
key: "updateVData",
|
value: function updateVData(cid) {
|
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
this.updateBatchVData.push([cid, data]);
|
}
|
}, {
|
key: "addVm",
|
value: function addVm(vm) {
|
var id = vm._$id;
|
var oldVm = this.vms[id];
|
|
if (oldVm) {
|
var newId = Object(_helpers_util__WEBPACK_IMPORTED_MODULE_1__[/* generateId */ "a"])(oldVm, findParent(oldVm), this.version);
|
oldVm._$id = newId;
|
this.vms[newId] = oldVm;
|
}
|
|
this.vms[id] = vm;
|
}
|
}, {
|
key: "initVm",
|
value: function initVm(vm) {
|
vm._$id = Object(_helpers_util__WEBPACK_IMPORTED_MODULE_1__[/* generateId */ "a"])(vm, findParent(vm), this.version);
|
var vData = this.addBatchVData[vm._$id];
|
|
if (!vData) {
|
console.error('cid unmatched', vm);
|
vData = {
|
data: {},
|
options: {}
|
};
|
} else {
|
delete this.addBatchVData[vm._$id];
|
}
|
|
var _vData = vData,
|
_vData2 = _slicedToArray(_vData, 2),
|
data = _vData2[0],
|
options = _vData2[1];
|
|
Object.assign(vm.$options, options);
|
vm.$r = data || Object.create(null);
|
this.addVm(vm);
|
}
|
}, {
|
key: "sendUIEvent",
|
value: function sendUIEvent(cid, nid, event) {
|
UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* VD_SYNC */ "i"], {
|
data: [[_constants__WEBPACK_IMPORTED_MODULE_0__[/* UI_EVENT */ "g"], [[cid, nid, event]]]],
|
options: {
|
timestamp: Date.now()
|
}
|
});
|
}
|
}, {
|
key: "clearAddBatchVData",
|
value: function clearAddBatchVData() {
|
if (true) {
|
if (Object.keys(this.addBatchVData).length) {
|
console.error('this.addBatchVData...=' + JSON.stringify(this.addBatchVData));
|
}
|
}
|
|
this.addBatchVData = Object.create(null);
|
}
|
}, {
|
key: "flush",
|
value: function flush() {
|
var _this = this;
|
|
this.updateBatchVData.forEach(function (_ref) {
|
var _ref2 = _slicedToArray(_ref, 2),
|
cid = _ref2[0],
|
data = _ref2[1];
|
|
var vm = _this.vms[cid];
|
|
if (!vm) {
|
return console.error("Not found ".concat(cid));
|
}
|
|
Object.keys(data).forEach(function (cid) {
|
Object.assign(vm.$r[cid] || (vm.$r[cid] = Object.create(null)), data[cid]);
|
});
|
vm.$forceUpdate();
|
});
|
this.updateBatchVData.length = 0;
|
}
|
}]);
|
|
return VDomSync;
|
}();
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
|
|
/***/ }),
|
/* 107 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return saveImage; });
|
var index = 0;
|
function saveImage(base64, dirname, callback) {
|
var id = "".concat(Date.now()).concat(index++);
|
var bitmap = new plus.nativeObj.Bitmap("bitmap".concat(id));
|
bitmap.loadBase64Data(base64, function () {
|
var format = (base64.match(/data:image\/(\S+?);/) || [null, 'png'])[1].replace('jpeg', 'jpg');
|
var tempFilePath = "".concat(dirname, "/").concat(id, ".").concat(format);
|
bitmap.save(tempFilePath, {
|
overwrite: true,
|
quality: 100,
|
format: format
|
}, function () {
|
clear();
|
callback(null, tempFilePath);
|
}, function (error) {
|
clear();
|
callback(error);
|
});
|
}, function (error) {
|
clear();
|
callback(error);
|
});
|
|
function clear() {
|
bitmap.clear();
|
}
|
}
|
|
/***/ }),
|
/* 108 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getSameOriginUrl; });
|
function getBase64(path) {
|
return new Promise(function (resolve, reject) {
|
// H5+ 沙箱外路径在iOS无法使用 plus.io 读取
|
function onError() {
|
var bitmap = new plus.nativeObj.Bitmap("bitmap_".concat(Date.now(), "_").concat(Math.random(), "}"));
|
bitmap.load(path, function () {
|
resolve(bitmap.toBase64Data());
|
bitmap.clear();
|
}, function (err) {
|
bitmap.clear();
|
reject(err);
|
});
|
}
|
|
plus.io.resolveLocalFileSystemURL(path, function (entry) {
|
entry.file(function (file) {
|
var fileReader = new plus.io.FileReader();
|
|
fileReader.onload = function (data) {
|
resolve(data.target.result);
|
};
|
|
fileReader.onerror = onError;
|
fileReader.readAsDataURL(file);
|
}, onError);
|
}, onError);
|
});
|
}
|
|
function download(url) {
|
return new Promise(function (resolve, reject) {
|
if (url.indexOf('http://') !== 0 && url.indexOf('https://') !== 0) {
|
resolve(url);
|
return;
|
}
|
|
plus.downloader.createDownload(url, {
|
filename: '_doc/uniapp_temp/download/'
|
}, function (d, status) {
|
if (status === 200) {
|
resolve(d.filename);
|
} else {
|
reject(new Error('network fail'));
|
}
|
}).start();
|
});
|
}
|
|
function getSameOriginUrl(url) {
|
return download(url).then(function (url) {
|
// WKWebView
|
if (window.webkit && window.webkit.messageHandlers) {
|
return getBase64(url);
|
}
|
|
return plus.io.convertLocalFileSystemURL(url);
|
});
|
}
|
|
/***/ }),
|
/* 109 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return showPage; });
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
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); }
|
|
var plus_;
|
var weex_;
|
var BroadcastChannel_;
|
|
function getRuntime() {
|
return (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && (typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object' && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' ? 'webview' : 'v8';
|
}
|
|
function getPageId() {
|
return plus_.webview.currentWebview().id;
|
}
|
|
var channel;
|
var globalEvent;
|
var callbacks = {};
|
|
function onPlusMessage(res) {
|
var message = res.data && res.data.__message;
|
|
if (!message || !message.__page) {
|
return;
|
}
|
|
var pageId = message.__page;
|
var callback = callbacks[pageId];
|
callback && callback(message);
|
|
if (!message.keep) {
|
delete callbacks[pageId];
|
}
|
}
|
|
function addEventListener(pageId, callback) {
|
if (getRuntime() === 'v8') {
|
if (BroadcastChannel_) {
|
channel && channel.close();
|
channel = new BroadcastChannel_(getPageId());
|
channel.onmessage = onPlusMessage;
|
} else if (!globalEvent) {
|
globalEvent = weex_.requireModule('globalEvent');
|
globalEvent.addEventListener('plusMessage', onPlusMessage);
|
}
|
} else {
|
window.__plusMessage = onPlusMessage;
|
}
|
|
callbacks[pageId] = callback;
|
}
|
|
var Page = /*#__PURE__*/function () {
|
function Page(webview) {
|
_classCallCheck(this, Page);
|
|
this.webview = webview;
|
}
|
|
_createClass(Page, [{
|
key: "sendMessage",
|
value: function sendMessage(data) {
|
var message = JSON.parse(JSON.stringify({
|
__message: {
|
data: data
|
}
|
}));
|
var id = this.webview.id;
|
|
if (BroadcastChannel_) {
|
var _channel = new BroadcastChannel_(id);
|
|
_channel.postMessage(message);
|
} else {
|
plus_.webview.postMessageToUniNView(message, id);
|
}
|
}
|
}, {
|
key: "close",
|
value: function close() {
|
this.webview.close();
|
}
|
}]);
|
|
return Page;
|
}();
|
|
function showPage(_ref) {
|
var _ref$context = _ref.context,
|
context = _ref$context === void 0 ? {} : _ref$context,
|
url = _ref.url,
|
_ref$data = _ref.data,
|
data = _ref$data === void 0 ? {} : _ref$data,
|
_ref$style = _ref.style,
|
style = _ref$style === void 0 ? {} : _ref$style,
|
onMessage = _ref.onMessage,
|
onClose = _ref.onClose;
|
// eslint-disable-next-line
|
plus_ = context.plus || plus; // eslint-disable-next-line
|
|
weex_ = context.weex || ((typeof weex === "undefined" ? "undefined" : _typeof(weex)) === 'object' ? weex : null); // eslint-disable-next-line
|
|
BroadcastChannel_ = context.BroadcastChannel || ((typeof BroadcastChannel === "undefined" ? "undefined" : _typeof(BroadcastChannel)) === 'object' ? BroadcastChannel : null);
|
var titleNView = {
|
autoBackButton: true,
|
titleSize: '17px'
|
};
|
var pageId = "page".concat(Date.now());
|
style = Object.assign({}, style);
|
|
if (style.titleNView !== false && style.titleNView !== 'none') {
|
style.titleNView = Object.assign(titleNView, style.titleNView);
|
}
|
|
var defaultStyle = {
|
top: 0,
|
bottom: 0,
|
usingComponents: {},
|
popGesture: 'close',
|
scrollIndicator: 'none',
|
animationType: 'pop-in',
|
animationDuration: 200,
|
uniNView: {
|
path: "".concat((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && Object({"NODE_ENV":"development","BASE_URL":"/"}) && Object({"NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_TEMPLATE_PATH || '', "/").concat(url, ".js"),
|
defaultFontSize: plus_.screen.resolutionWidth / 20,
|
viewport: plus_.screen.resolutionWidth
|
}
|
};
|
style = Object.assign(defaultStyle, style);
|
var page = plus_.webview.create('', pageId, style, {
|
extras: {
|
from: getPageId(),
|
runtime: getRuntime(),
|
data: data,
|
useGlobalEvent: !BroadcastChannel_
|
}
|
});
|
page.addEventListener('close', onClose);
|
addEventListener(pageId, function (message) {
|
if (typeof onMessage === 'function') {
|
onMessage(message.data);
|
}
|
|
if (!message.keep) {
|
page.close('auto');
|
}
|
});
|
page.show(style.animationType, style.animationDuration);
|
return new Page(page);
|
}
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(93)))
|
|
/***/ }),
|
/* 110 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ register; });
|
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/divider.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); }
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
/* harmony default export */ var divider = (function (Quill) {
|
var BlockEmbed = Quill.import('blots/block/embed');
|
|
var Divider = /*#__PURE__*/function (_BlockEmbed) {
|
_inherits(Divider, _BlockEmbed);
|
|
var _super = _createSuper(Divider);
|
|
function Divider() {
|
_classCallCheck(this, Divider);
|
|
return _super.apply(this, arguments);
|
}
|
|
return Divider;
|
}(BlockEmbed);
|
|
Divider.blotName = 'divider';
|
Divider.tagName = 'HR';
|
return {
|
'formats/divider': Divider
|
};
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/ins.js
|
function ins_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ins_typeof = function _typeof(obj) { return typeof obj; }; } else { ins_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ins_typeof(obj); }
|
|
function ins_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
function ins_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ins_setPrototypeOf(subClass, superClass); }
|
|
function ins_setPrototypeOf(o, p) { ins_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ins_setPrototypeOf(o, p); }
|
|
function ins_createSuper(Derived) { return function () { var Super = ins_getPrototypeOf(Derived), result; if (ins_isNativeReflectConstruct()) { var NewTarget = ins_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ins_possibleConstructorReturn(this, result); }; }
|
|
function ins_possibleConstructorReturn(self, call) { if (call && (ins_typeof(call) === "object" || typeof call === "function")) { return call; } return ins_assertThisInitialized(self); }
|
|
function ins_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
function ins_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
function ins_getPrototypeOf(o) { ins_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ins_getPrototypeOf(o); }
|
|
/* harmony default export */ var ins = (function (Quill) {
|
var Inline = Quill.import('blots/inline');
|
|
var Ins = /*#__PURE__*/function (_Inline) {
|
ins_inherits(Ins, _Inline);
|
|
var _super = ins_createSuper(Ins);
|
|
function Ins() {
|
ins_classCallCheck(this, Ins);
|
|
return _super.apply(this, arguments);
|
}
|
|
return Ins;
|
}(Inline);
|
|
Ins.blotName = 'ins';
|
Ins.tagName = 'INS';
|
return {
|
'formats/ins': Ins
|
};
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/align.js
|
/* harmony default export */ var align = (function (Quill) {
|
var _Quill$import = Quill.import('parchment'),
|
Scope = _Quill$import.Scope,
|
Attributor = _Quill$import.Attributor;
|
|
var config = {
|
scope: Scope.BLOCK,
|
whitelist: ['left', 'right', 'center', 'justify']
|
};
|
var AlignStyle = new Attributor.Style('align', 'text-align', config);
|
return {
|
'formats/align': AlignStyle
|
};
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/direction.js
|
/* harmony default export */ var direction = (function (Quill) {
|
var _Quill$import = Quill.import('parchment'),
|
Scope = _Quill$import.Scope,
|
Attributor = _Quill$import.Attributor;
|
|
var config = {
|
scope: Scope.BLOCK,
|
whitelist: ['rtl']
|
};
|
var DirectionStyle = new Attributor.Style('direction', 'direction', config);
|
return {
|
'formats/direction': DirectionStyle
|
};
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/list.js
|
function list_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { list_typeof = function _typeof(obj) { return typeof obj; }; } else { list_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return list_typeof(obj); }
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
function list_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
function list_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) list_setPrototypeOf(subClass, superClass); }
|
|
function list_setPrototypeOf(o, p) { list_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return list_setPrototypeOf(o, p); }
|
|
function list_createSuper(Derived) { return function () { var Super = list_getPrototypeOf(Derived), result; if (list_isNativeReflectConstruct()) { var NewTarget = list_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return list_possibleConstructorReturn(this, result); }; }
|
|
function list_possibleConstructorReturn(self, call) { if (call && (list_typeof(call) === "object" || typeof call === "function")) { return call; } return list_assertThisInitialized(self); }
|
|
function list_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
function list_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
|
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = list_getPrototypeOf(object); if (object === null) break; } return object; }
|
|
function list_getPrototypeOf(o) { list_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return list_getPrototypeOf(o); }
|
|
/* harmony default export */ var list = (function (Quill) {
|
var Parchment = Quill.import('parchment');
|
var Container = Quill.import('blots/container');
|
var ListItem = Quill.import('formats/list/item');
|
|
var List = /*#__PURE__*/function (_Container) {
|
list_inherits(List, _Container);
|
|
var _super = list_createSuper(List);
|
|
_createClass(List, null, [{
|
key: "create",
|
value: function create(value) {
|
var tagName = value === 'ordered' ? 'OL' : 'UL';
|
|
var node = _get(list_getPrototypeOf(List), "create", this).call(this, tagName);
|
|
if (value === 'checked' || value === 'unchecked') {
|
node.setAttribute('data-checked', value === 'checked');
|
}
|
|
return node;
|
}
|
}, {
|
key: "formats",
|
value: function formats(domNode) {
|
if (domNode.tagName === 'OL') return 'ordered';
|
|
if (domNode.tagName === 'UL') {
|
if (domNode.hasAttribute('data-checked')) {
|
return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';
|
} else {
|
return 'bullet';
|
}
|
}
|
|
return undefined;
|
}
|
}]);
|
|
function List(domNode) {
|
var _this;
|
|
list_classCallCheck(this, List);
|
|
_this = _super.call(this, domNode);
|
|
var listEventHandler = function listEventHandler(e) {
|
if (e.target.parentNode !== domNode) return;
|
|
var format = _this.statics.formats(domNode);
|
|
var blot = Parchment.find(e.target);
|
|
if (format === 'checked') {
|
blot.format('list', 'unchecked');
|
} else if (format === 'unchecked') {
|
blot.format('list', 'checked');
|
}
|
};
|
|
domNode.addEventListener('click', listEventHandler);
|
return _this;
|
}
|
|
_createClass(List, [{
|
key: "format",
|
value: function format(name, value) {
|
if (this.children.length > 0) {
|
this.children.tail.format(name, value);
|
}
|
}
|
}, {
|
key: "formats",
|
value: function formats() {
|
// We don't inherit from FormatBlot
|
return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));
|
}
|
}, {
|
key: "insertBefore",
|
value: function insertBefore(blot, ref) {
|
if (blot instanceof ListItem) {
|
_get(list_getPrototypeOf(List.prototype), "insertBefore", this).call(this, blot, ref);
|
} else {
|
var index = ref == null ? this.length() : ref.offset(this);
|
var after = this.split(index);
|
after.parent.insertBefore(blot, after);
|
}
|
}
|
}, {
|
key: "optimize",
|
value: function optimize(context) {
|
_get(list_getPrototypeOf(List.prototype), "optimize", this).call(this, context);
|
|
var next = this.next;
|
|
if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {
|
next.moveChildren(this);
|
next.remove();
|
}
|
}
|
}, {
|
key: "replace",
|
value: function replace(target) {
|
if (target.statics.blotName !== this.statics.blotName) {
|
var item = Parchment.create(this.statics.defaultChild);
|
target.moveChildren(item);
|
this.appendChild(item);
|
}
|
|
_get(list_getPrototypeOf(List.prototype), "replace", this).call(this, target);
|
}
|
}]);
|
|
return List;
|
}(Container);
|
|
List.blotName = 'list';
|
List.scope = Parchment.Scope.BLOCK_BLOT;
|
List.tagName = ['OL', 'UL'];
|
List.defaultChild = 'list-item';
|
List.allowedChildren = [ListItem];
|
return {
|
'formats/list': List
|
};
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/background.js
|
/* harmony default export */ var background = (function (Quill) {
|
var _Quill$import = Quill.import('parchment'),
|
Scope = _Quill$import.Scope;
|
|
var BackgroundStyle = Quill.import('formats/background');
|
var BackgroundColorStyle = new BackgroundStyle.constructor('backgroundColor', 'background-color', {
|
scope: Scope.INLINE
|
});
|
return {
|
'formats/backgroundColor': BackgroundColorStyle
|
};
|
});
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/box.js
|
|
/* harmony default export */ var box = (function (Quill) {
|
var _Quill$import = Quill.import('parchment'),
|
Scope = _Quill$import.Scope,
|
Attributor = _Quill$import.Attributor;
|
|
var config = {
|
scope: Scope.BLOCK
|
};
|
var margin = ['margin', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight'];
|
var padding = ['padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight'];
|
var result = {};
|
margin.concat(padding).forEach(function (name) {
|
result["formats/".concat(name)] = new Attributor.Style(name, Object(shared["i" /* kebabCase */])(name), config);
|
});
|
return result;
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/font.js
|
|
/* harmony default export */ var formats_font = (function (Quill) {
|
var _Quill$import = Quill.import('parchment'),
|
Scope = _Quill$import.Scope,
|
Attributor = _Quill$import.Attributor;
|
|
var config = {
|
scope: Scope.INLINE
|
};
|
var font = ['font', 'fontSize', 'fontStyle', 'fontVariant', 'fontWeight', 'fontFamily'];
|
var result = {};
|
font.forEach(function (name) {
|
result["formats/".concat(name)] = new Attributor.Style(name, Object(shared["i" /* kebabCase */])(name), config);
|
});
|
return result;
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/text.js
|
|
/* harmony default export */ var formats_text = (function (Quill) {
|
var _Quill$import = Quill.import('parchment'),
|
Scope = _Quill$import.Scope,
|
Attributor = _Quill$import.Attributor;
|
|
var text = [{
|
name: 'lineHeight',
|
scope: Scope.BLOCK
|
}, {
|
name: 'letterSpacing',
|
scope: Scope.INLINE
|
}, {
|
name: 'textDecoration',
|
scope: Scope.INLINE
|
}, {
|
name: 'textIndent',
|
scope: Scope.BLOCK
|
}];
|
var result = {};
|
text.forEach(function (_ref) {
|
var name = _ref.name,
|
scope = _ref.scope;
|
result["formats/".concat(name)] = new Attributor.Style(name, Object(shared["i" /* kebabCase */])(name), {
|
scope: scope
|
});
|
});
|
return result;
|
});
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-real-path.js + 1 modules
|
var get_real_path = __webpack_require__(13);
|
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/image.js
|
|
/* harmony default export */ var formats_image = (function (Quill) {
|
var Image = Quill.import('formats/image');
|
var ATTRIBUTES = ['alt', 'height', 'width', 'data-custom', 'class', 'data-local'];
|
|
Image.sanitize = function (url) {
|
return url ? Object(get_real_path["a" /* default */])(url) : url;
|
};
|
|
Image.formats = function formats(domNode) {
|
return ATTRIBUTES.reduce(function (formats, attribute) {
|
if (domNode.hasAttribute(attribute)) {
|
formats[attribute] = domNode.getAttribute(attribute);
|
}
|
|
return formats;
|
}, {});
|
};
|
|
var format = Image.prototype.format;
|
|
Image.prototype.format = function (name, value) {
|
if (ATTRIBUTES.indexOf(name) > -1) {
|
if (value) {
|
this.domNode.setAttribute(name, value);
|
} else {
|
this.domNode.removeAttribute(name);
|
}
|
} else {
|
format.call(this, name, value);
|
}
|
};
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/link.js
|
/* harmony default export */ var formats_link = (function (Quill) {
|
var Link = Quill.import('formats/link');
|
|
Link.sanitize = function (url) {
|
var anchor = document.createElement('a');
|
anchor.href = url;
|
var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));
|
return Link.PROTOCOL_WHITELIST.concat('file').indexOf(protocol) > -1 ? url : Link.SANITIZED_URL;
|
};
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/editor/formats/index.js
|
|
|
|
|
|
|
|
|
|
|
|
function register(Quill) {
|
var formats = {
|
divider: divider,
|
ins: ins,
|
align: align,
|
direction: direction,
|
list: list,
|
background: background,
|
box: box,
|
font: formats_font,
|
text: formats_text,
|
image: formats_image,
|
link: formats_link
|
};
|
var options = {};
|
Object.values(formats).forEach(function (value) {
|
return Object.assign(options, value(Quill));
|
});
|
Quill.register(options, true);
|
}
|
|
/***/ }),
|
/* 111 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXTERNAL MODULE: ./src/core/helpers/tags.js
|
var tags = __webpack_require__(80);
|
var tags_default = /*#__PURE__*/__webpack_require__.n(tags);
|
|
// EXTERNAL MODULE: ./src/core/helpers/index.js
|
var helpers = __webpack_require__(8);
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// CONCATENATED MODULE: ./src/core/vue.js
|
// 使用白名单过滤(前期有一批自定义组件使用了 uni-)
|
|
|
|
function initVue(Vue) {
|
Vue.config.errorHandler = function (err, vm, info) {
|
var errType = Object(shared["m" /* toRawType */])(err);
|
Vue.util.warn("Error in ".concat(info, ": \"").concat(errType === 'Error' ? err.toString() : err, "\""), vm);
|
var app = typeof getApp === 'function' && getApp();
|
|
if (app && Object(helpers["b" /* hasLifecycleHook */])(app.$options, 'onError')) {
|
app.__call_hook('onError', err);
|
} else {
|
if ( true && errType === 'Error') {
|
console.error("\n ".concat(err.message, "\n ").concat(err.stack, "\n "));
|
} else {
|
console.error(err);
|
}
|
}
|
};
|
|
var oldIsReservedTag = Vue.config.isReservedTag;
|
|
Vue.config.isReservedTag = function (tag) {
|
return tags_default.a.indexOf(tag) !== -1 || oldIsReservedTag(tag);
|
};
|
|
Vue.config.ignoredElements = tags_default.a;
|
var oldGetTagNamespace = Vue.config.getTagNamespace;
|
var conflictTags = ['switch', 'image', 'text', 'view'];
|
|
Vue.config.getTagNamespace = function (tag) {
|
if (~conflictTags.indexOf(tag)) {
|
// svg 部分标签名称与 uni 标签冲突
|
return false;
|
}
|
|
return oldGetTagNamespace(tag);
|
};
|
}
|
// EXTERNAL MODULE: ./src/core/view/plugins/index.js
|
var plugins = __webpack_require__(104);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-real-path.js + 1 modules
|
var get_real_path = __webpack_require__(13);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/framework/plugins/data.js
|
var data = __webpack_require__(23);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/framework/plugins/event.js
|
|
function initEvent(Vue) {
|
// 部分组件内部使用了$page
|
Object.defineProperty(Vue.prototype, '$page', {
|
get: function get() {
|
return getCurrentPages()[0].$page;
|
}
|
});
|
|
Vue.prototype.$handleVModelEvent = function (nid, value) {
|
data["b" /* vd */].sendUIEvent(this._$id, nid, {
|
type: 'input',
|
target: {
|
value: value
|
}
|
});
|
};
|
|
Vue.prototype.$handleViewEvent = function ($vueEvent) {
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
// const isCustomEvent = $vueEvent._processed // 自定义事件已提前处理过
|
if (options.stop) {
|
$vueEvent.stopPropagation();
|
}
|
|
if (options.prevent) {
|
$vueEvent.preventDefault();
|
}
|
|
var $event = this.$handleEvent($vueEvent);
|
var cid = this._$id;
|
var currentTarget = $vueEvent.$origCurrentTarget || $vueEvent.currentTarget; // 当自定义组件根节点触发事件时,nid 补充前缀,避免与组件内部 nid 冲突(根组件page不需要)
|
|
var nid = (currentTarget === this.$el && this.$options.mpType !== 'page' ? 'r-' : '') + $event.options.nid;
|
|
if (typeof nid === 'undefined') {
|
return console.error("[".concat(cid, "] nid not found"));
|
} // 移除无用属性
|
|
|
delete $event._processed;
|
delete $event.mp;
|
delete $event.preventDefault;
|
delete $event.stopPropagation;
|
delete $event.options;
|
delete $event.$origCurrentTarget; // 实时发送,延迟的话,会导致 touch 类事件被合并,影响实际业务逻辑,比如 touchstart 中修改变量为 true,touchend 修改为 false
|
|
data["b" /* vd */].sendUIEvent(cid, nid, $event);
|
};
|
}
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/framework/plugins/gesture.js
|
var gesture = __webpack_require__(116);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/framework/plugins/index.js
|
|
|
|
|
|
|
/* harmony default export */ var framework_plugins = __webpack_exports__["a"] = ({
|
install: function install(Vue, options) {
|
if (true) {
|
Vue.config.productionTip = false;
|
Vue.config.performance = true;
|
}
|
|
Vue.prototype._$getRealPath = get_real_path["a" /* default */];
|
initVue(Vue);
|
plugins["a" /* default */].install(Vue, options);
|
Object(data["a" /* initData */])(Vue);
|
initEvent(Vue);
|
}
|
});
|
|
/***/ }),
|
/* 112 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ initBehaviors; });
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./src/core/view/plugins/behaviors/form-field.js
|
/**
|
* uni://form-field
|
*/
|
|
|
|
function created() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
}
|
|
function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
}
|
|
/* harmony default export */ var form_field = ({
|
name: 'uni://form-field',
|
init: function init(options, vm) {
|
if (!vm.constructor.options.props || !vm.constructor.options.props.name || !vm.constructor.options.props.value) {
|
// 未初始化 props
|
if (!vm.constructor.options.props) {
|
vm.constructor.options.props = {};
|
}
|
|
if (!vm.constructor.options.props.name) {
|
vm.constructor.options.props.name = options.props.name = {
|
type: String
|
};
|
}
|
|
if (!vm.constructor.options.props.value) {
|
vm.constructor.options.props.value = options.props.value = {
|
type: null
|
};
|
}
|
}
|
|
if (!options.propsData) {
|
options.propsData = {};
|
}
|
|
var $vnode = vm.$vnode;
|
|
if ($vnode && $vnode.data && $vnode.data.attrs) {
|
if (Object(shared["e" /* hasOwn */])($vnode.data.attrs, 'name')) {
|
options.propsData.name = $vnode.data.attrs.name;
|
}
|
|
if (Object(shared["e" /* hasOwn */])($vnode.data.attrs, 'value')) {
|
options.propsData.value = $vnode.data.attrs.value;
|
}
|
}
|
|
if (!vm.constructor.options.methods || !vm.constructor.options.methods._getFormData) {
|
// 未初始化 methods
|
if (!vm.constructor.options.methods) {
|
vm.constructor.options.methods = {};
|
}
|
|
if (!options.methods) {
|
options.methods = {};
|
}
|
|
var formMethods = {
|
_getFormData: function _getFormData() {
|
return this.name ? {
|
key: this.name,
|
value: this.value
|
} : {};
|
},
|
_resetFormData: function _resetFormData() {
|
this.value = '';
|
}
|
};
|
Object.assign(vm.constructor.options.methods, formMethods);
|
Object.assign(options.methods, formMethods); // add $dispatch
|
|
Object.assign(vm.constructor.options.methods, mixins["a" /* emitter */].methods);
|
Object.assign(options.methods, mixins["a" /* emitter */].methods);
|
var createdHooks = options.created;
|
vm.constructor.options.created = options.created = createdHooks ? [].concat(created, createdHooks) : [created];
|
var beforeDestroyHooks = options.beforeDestroy;
|
vm.constructor.options.beforeDestroy = options.beforeDestroy = beforeDestroyHooks ? [].concat(beforeDestroy, beforeDestroyHooks) : [beforeDestroy];
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/plugins/behaviors/index.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; }
|
|
|
|
var behaviors = _defineProperty({}, form_field.name, form_field);
|
|
function initBehaviors(options, vm) {
|
options.behaviors.forEach(function (name) {
|
var behavior = behaviors[name];
|
behavior && behavior.init(options, vm);
|
});
|
}
|
|
/***/ }),
|
/* 113 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
|
// MIT license
|
// source: https://github.com/amiller-gh/currentScript-polyfill
|
|
// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
|
|
(function (root, factory) {
|
if (true) {
|
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
} else {}
|
}(typeof self !== 'undefined' ? self : this, function () {
|
function getCurrentScript () {
|
if (document.currentScript) {
|
return document.currentScript
|
}
|
|
// IE 8-10 support script readyState
|
// IE 11+ & Firefox support stack trace
|
try {
|
throw new Error();
|
}
|
catch (err) {
|
// Find the second match for the "at" string to get file src url from stack.
|
var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
scriptLocation = (stackDetails && stackDetails[1]) || false,
|
line = (stackDetails && stackDetails[2]) || false,
|
currentLocation = document.location.href.replace(document.location.hash, ''),
|
pageSource,
|
inlineScriptSourceRegExp,
|
inlineScriptSource,
|
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
|
if (scriptLocation === currentLocation) {
|
pageSource = document.documentElement.outerHTML;
|
inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
}
|
|
for (var i = 0; i < scripts.length; i++) {
|
// If ready state is interactive, return the script tag
|
if (scripts[i].readyState === 'interactive') {
|
return scripts[i];
|
}
|
|
// If src matches, return the script tag
|
if (scripts[i].src === scriptLocation) {
|
return scripts[i];
|
}
|
|
// If inline source matches, return the script tag
|
if (
|
scriptLocation === currentLocation &&
|
scripts[i].innerHTML &&
|
scripts[i].innerHTML.trim() === inlineScriptSource
|
) {
|
return scripts[i];
|
}
|
}
|
|
// If no match, return null
|
return null;
|
}
|
};
|
|
return getCurrentScript
|
}));
|
|
|
/***/ }),
|
/* 114 */
|
/***/ (function(module, exports) {
|
|
/**
|
* Copyright 2016 Google Inc. All Rights Reserved.
|
*
|
* Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.
|
*
|
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
*
|
*/
|
(function() {
|
'use strict';
|
|
// Exit early if we're not running in a browser.
|
if (typeof window !== 'object') {
|
return;
|
}
|
|
// Exit early if all IntersectionObserver and IntersectionObserverEntry
|
// features are natively supported.
|
if ('IntersectionObserver' in window &&
|
'IntersectionObserverEntry' in window &&
|
'intersectionRatio' in window.IntersectionObserverEntry.prototype) {
|
|
// Minimal polyfill for Edge 15's lack of `isIntersecting`
|
// See: https://github.com/w3c/IntersectionObserver/issues/211
|
if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {
|
Object.defineProperty(window.IntersectionObserverEntry.prototype,
|
'isIntersecting', {
|
get: function () {
|
return this.intersectionRatio > 0;
|
}
|
});
|
}
|
return;
|
}
|
|
|
/**
|
* A local reference to the document.
|
*/
|
var document = window.document;
|
|
|
/**
|
* An IntersectionObserver registry. This registry exists to hold a strong
|
* reference to IntersectionObserver instances currently observing a target
|
* element. Without this registry, instances without another reference may be
|
* garbage collected.
|
*/
|
var registry = [];
|
|
|
/**
|
* Creates the global IntersectionObserverEntry constructor.
|
* https://w3c.github.io/IntersectionObserver/#intersection-observer-entry
|
* @param {Object} entry A dictionary of instance properties.
|
* @constructor
|
*/
|
function IntersectionObserverEntry(entry) {
|
this.time = entry.time;
|
this.target = entry.target;
|
this.rootBounds = entry.rootBounds;
|
this.boundingClientRect = entry.boundingClientRect;
|
this.intersectionRect = entry.intersectionRect || getEmptyRect();
|
this.isIntersecting = !!entry.intersectionRect;
|
|
// Calculates the intersection ratio.
|
var targetRect = this.boundingClientRect;
|
var targetArea = targetRect.width * targetRect.height;
|
var intersectionRect = this.intersectionRect;
|
var intersectionArea = intersectionRect.width * intersectionRect.height;
|
|
// Sets intersection ratio.
|
if (targetArea) {
|
// Round the intersection ratio to avoid floating point math issues:
|
// https://github.com/w3c/IntersectionObserver/issues/324
|
this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));
|
} else {
|
// If area is zero and is intersecting, sets to 1, otherwise to 0
|
this.intersectionRatio = this.isIntersecting ? 1 : 0;
|
}
|
}
|
|
|
/**
|
* Creates the global IntersectionObserver constructor.
|
* https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
|
* @param {Function} callback The function to be invoked after intersection
|
* changes have queued. The function is not invoked if the queue has
|
* been emptied by calling the `takeRecords` method.
|
* @param {Object=} opt_options Optional configuration options.
|
* @constructor
|
*/
|
function IntersectionObserver(callback, opt_options) {
|
|
var options = opt_options || {};
|
|
if (typeof callback != 'function') {
|
throw new Error('callback must be a function');
|
}
|
|
if (options.root && options.root.nodeType != 1) {
|
throw new Error('root must be an Element');
|
}
|
|
// Binds and throttles `this._checkForIntersections`.
|
this._checkForIntersections = throttle(
|
this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);
|
|
// Private properties.
|
this._callback = callback;
|
this._observationTargets = [];
|
this._queuedEntries = [];
|
this._rootMarginValues = this._parseRootMargin(options.rootMargin);
|
|
// Public properties.
|
this.thresholds = this._initThresholds(options.threshold);
|
this.root = options.root || null;
|
this.rootMargin = this._rootMarginValues.map(function(margin) {
|
return margin.value + margin.unit;
|
}).join(' ');
|
}
|
|
|
/**
|
* The minimum interval within which the document will be checked for
|
* intersection changes.
|
*/
|
IntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;
|
|
|
/**
|
* The frequency in which the polyfill polls for intersection changes.
|
* this can be updated on a per instance basis and must be set prior to
|
* calling `observe` on the first target.
|
*/
|
IntersectionObserver.prototype.POLL_INTERVAL = null;
|
|
/**
|
* Use a mutation observer on the root element
|
* to detect intersection changes.
|
*/
|
IntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;
|
|
|
/**
|
* Starts observing a target element for intersection changes based on
|
* the thresholds values.
|
* @param {Element} target The DOM element to observe.
|
*/
|
IntersectionObserver.prototype.observe = function(target) {
|
var isTargetAlreadyObserved = this._observationTargets.some(function(item) {
|
return item.element == target;
|
});
|
|
if (isTargetAlreadyObserved) {
|
return;
|
}
|
|
if (!(target && target.nodeType == 1)) {
|
throw new Error('target must be an Element');
|
}
|
|
this._registerInstance();
|
this._observationTargets.push({element: target, entry: null});
|
this._monitorIntersections();
|
this._checkForIntersections();
|
};
|
|
|
/**
|
* Stops observing a target element for intersection changes.
|
* @param {Element} target The DOM element to observe.
|
*/
|
IntersectionObserver.prototype.unobserve = function(target) {
|
this._observationTargets =
|
this._observationTargets.filter(function(item) {
|
|
return item.element != target;
|
});
|
if (!this._observationTargets.length) {
|
this._unmonitorIntersections();
|
this._unregisterInstance();
|
}
|
};
|
|
|
/**
|
* Stops observing all target elements for intersection changes.
|
*/
|
IntersectionObserver.prototype.disconnect = function() {
|
this._observationTargets = [];
|
this._unmonitorIntersections();
|
this._unregisterInstance();
|
};
|
|
|
/**
|
* Returns any queue entries that have not yet been reported to the
|
* callback and clears the queue. This can be used in conjunction with the
|
* callback to obtain the absolute most up-to-date intersection information.
|
* @return {Array} The currently queued entries.
|
*/
|
IntersectionObserver.prototype.takeRecords = function() {
|
var records = this._queuedEntries.slice();
|
this._queuedEntries = [];
|
return records;
|
};
|
|
|
/**
|
* Accepts the threshold value from the user configuration object and
|
* returns a sorted array of unique threshold values. If a value is not
|
* between 0 and 1 and error is thrown.
|
* @private
|
* @param {Array|number=} opt_threshold An optional threshold value or
|
* a list of threshold values, defaulting to [0].
|
* @return {Array} A sorted list of unique and valid threshold values.
|
*/
|
IntersectionObserver.prototype._initThresholds = function(opt_threshold) {
|
var threshold = opt_threshold || [0];
|
if (!Array.isArray(threshold)) threshold = [threshold];
|
|
return threshold.sort().filter(function(t, i, a) {
|
if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {
|
throw new Error('threshold must be a number between 0 and 1 inclusively');
|
}
|
return t !== a[i - 1];
|
});
|
};
|
|
|
/**
|
* Accepts the rootMargin value from the user configuration object
|
* and returns an array of the four margin values as an object containing
|
* the value and unit properties. If any of the values are not properly
|
* formatted or use a unit other than px or %, and error is thrown.
|
* @private
|
* @param {string=} opt_rootMargin An optional rootMargin value,
|
* defaulting to '0px'.
|
* @return {Array<Object>} An array of margin objects with the keys
|
* value and unit.
|
*/
|
IntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) {
|
var marginString = opt_rootMargin || '0px';
|
var margins = marginString.split(/\s+/).map(function(margin) {
|
var parts = /^(-?\d*\.?\d+)(px|%)$/.exec(margin);
|
if (!parts) {
|
throw new Error('rootMargin must be specified in pixels or percent');
|
}
|
return {value: parseFloat(parts[1]), unit: parts[2]};
|
});
|
|
// Handles shorthand.
|
margins[1] = margins[1] || margins[0];
|
margins[2] = margins[2] || margins[0];
|
margins[3] = margins[3] || margins[1];
|
|
return margins;
|
};
|
|
|
/**
|
* Starts polling for intersection changes if the polling is not already
|
* happening, and if the page's visibility state is visible.
|
* @private
|
*/
|
IntersectionObserver.prototype._monitorIntersections = function() {
|
if (!this._monitoringIntersections) {
|
this._monitoringIntersections = true;
|
|
// If a poll interval is set, use polling instead of listening to
|
// resize and scroll events or DOM mutations.
|
if (this.POLL_INTERVAL) {
|
this._monitoringInterval = setInterval(
|
this._checkForIntersections, this.POLL_INTERVAL);
|
}
|
else {
|
addEvent(window, 'resize', this._checkForIntersections, true);
|
addEvent(document, 'scroll', this._checkForIntersections, true);
|
|
if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in window) {
|
this._domObserver = new MutationObserver(this._checkForIntersections);
|
this._domObserver.observe(document, {
|
attributes: true,
|
childList: true,
|
characterData: true,
|
subtree: true
|
});
|
}
|
}
|
}
|
};
|
|
|
/**
|
* Stops polling for intersection changes.
|
* @private
|
*/
|
IntersectionObserver.prototype._unmonitorIntersections = function() {
|
if (this._monitoringIntersections) {
|
this._monitoringIntersections = false;
|
|
clearInterval(this._monitoringInterval);
|
this._monitoringInterval = null;
|
|
removeEvent(window, 'resize', this._checkForIntersections, true);
|
removeEvent(document, 'scroll', this._checkForIntersections, true);
|
|
if (this._domObserver) {
|
this._domObserver.disconnect();
|
this._domObserver = null;
|
}
|
}
|
};
|
|
|
/**
|
* Scans each observation target for intersection changes and adds them
|
* to the internal entries queue. If new entries are found, it
|
* schedules the callback to be invoked.
|
* @private
|
*/
|
IntersectionObserver.prototype._checkForIntersections = function() {
|
var rootIsInDom = this._rootIsInDom();
|
var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();
|
|
this._observationTargets.forEach(function(item) {
|
var target = item.element;
|
var targetRect = getBoundingClientRect(target);
|
var rootContainsTarget = this._rootContainsTarget(target);
|
var oldEntry = item.entry;
|
var intersectionRect = rootIsInDom && rootContainsTarget &&
|
this._computeTargetAndRootIntersection(target, rootRect);
|
|
var newEntry = item.entry = new IntersectionObserverEntry({
|
time: now(),
|
target: target,
|
boundingClientRect: targetRect,
|
rootBounds: rootRect,
|
intersectionRect: intersectionRect
|
});
|
|
if (!oldEntry) {
|
this._queuedEntries.push(newEntry);
|
} else if (rootIsInDom && rootContainsTarget) {
|
// If the new entry intersection ratio has crossed any of the
|
// thresholds, add a new entry.
|
if (this._hasCrossedThreshold(oldEntry, newEntry)) {
|
this._queuedEntries.push(newEntry);
|
}
|
} else {
|
// If the root is not in the DOM or target is not contained within
|
// root but the previous entry for this target had an intersection,
|
// add a new record indicating removal.
|
if (oldEntry && oldEntry.isIntersecting) {
|
this._queuedEntries.push(newEntry);
|
}
|
}
|
}, this);
|
|
if (this._queuedEntries.length) {
|
this._callback(this.takeRecords(), this);
|
}
|
};
|
|
|
/**
|
* Accepts a target and root rect computes the intersection between then
|
* following the algorithm in the spec.
|
* TODO(philipwalton): at this time clip-path is not considered.
|
* https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo
|
* @param {Element} target The target DOM element
|
* @param {Object} rootRect The bounding rect of the root after being
|
* expanded by the rootMargin value.
|
* @return {?Object} The final intersection rect object or undefined if no
|
* intersection is found.
|
* @private
|
*/
|
IntersectionObserver.prototype._computeTargetAndRootIntersection =
|
function(target, rootRect) {
|
|
// If the element isn't displayed, an intersection can't happen.
|
if (window.getComputedStyle(target).display == 'none') return;
|
|
var targetRect = getBoundingClientRect(target);
|
var intersectionRect = targetRect;
|
var parent = getParentNode(target);
|
var atRoot = false;
|
|
while (!atRoot) {
|
var parentRect = null;
|
var parentComputedStyle = parent.nodeType == 1 ?
|
window.getComputedStyle(parent) : {};
|
|
// If the parent isn't displayed, an intersection can't happen.
|
if (parentComputedStyle.display == 'none') return;
|
|
if (parent == this.root || parent == document) {
|
atRoot = true;
|
parentRect = rootRect;
|
} else {
|
// If the element has a non-visible overflow, and it's not the <body>
|
// or <html> element, update the intersection rect.
|
// Note: <body> and <html> cannot be clipped to a rect that's not also
|
// the document rect, so no need to compute a new intersection.
|
if (parent != document.body &&
|
parent != document.documentElement &&
|
parentComputedStyle.overflow != 'visible') {
|
parentRect = getBoundingClientRect(parent);
|
}
|
}
|
|
// If either of the above conditionals set a new parentRect,
|
// calculate new intersection data.
|
if (parentRect) {
|
intersectionRect = computeRectIntersection(parentRect, intersectionRect);
|
|
if (!intersectionRect) break;
|
}
|
parent = getParentNode(parent);
|
}
|
return intersectionRect;
|
};
|
|
|
/**
|
* Returns the root rect after being expanded by the rootMargin value.
|
* @return {Object} The expanded root rect.
|
* @private
|
*/
|
IntersectionObserver.prototype._getRootRect = function() {
|
var rootRect;
|
if (this.root) {
|
rootRect = getBoundingClientRect(this.root);
|
} else {
|
// Use <html>/<body> instead of window since scroll bars affect size.
|
var html = document.documentElement;
|
var body = document.body;
|
rootRect = {
|
top: 0,
|
left: 0,
|
right: html.clientWidth || body.clientWidth,
|
width: html.clientWidth || body.clientWidth,
|
bottom: html.clientHeight || body.clientHeight,
|
height: html.clientHeight || body.clientHeight
|
};
|
}
|
return this._expandRectByRootMargin(rootRect);
|
};
|
|
|
/**
|
* Accepts a rect and expands it by the rootMargin value.
|
* @param {Object} rect The rect object to expand.
|
* @return {Object} The expanded rect.
|
* @private
|
*/
|
IntersectionObserver.prototype._expandRectByRootMargin = function(rect) {
|
var margins = this._rootMarginValues.map(function(margin, i) {
|
return margin.unit == 'px' ? margin.value :
|
margin.value * (i % 2 ? rect.width : rect.height) / 100;
|
});
|
var newRect = {
|
top: rect.top - margins[0],
|
right: rect.right + margins[1],
|
bottom: rect.bottom + margins[2],
|
left: rect.left - margins[3]
|
};
|
newRect.width = newRect.right - newRect.left;
|
newRect.height = newRect.bottom - newRect.top;
|
|
return newRect;
|
};
|
|
|
/**
|
* Accepts an old and new entry and returns true if at least one of the
|
* threshold values has been crossed.
|
* @param {?IntersectionObserverEntry} oldEntry The previous entry for a
|
* particular target element or null if no previous entry exists.
|
* @param {IntersectionObserverEntry} newEntry The current entry for a
|
* particular target element.
|
* @return {boolean} Returns true if a any threshold has been crossed.
|
* @private
|
*/
|
IntersectionObserver.prototype._hasCrossedThreshold =
|
function(oldEntry, newEntry) {
|
|
// To make comparing easier, an entry that has a ratio of 0
|
// but does not actually intersect is given a value of -1
|
var oldRatio = oldEntry && oldEntry.isIntersecting ?
|
oldEntry.intersectionRatio || 0 : -1;
|
var newRatio = newEntry.isIntersecting ?
|
newEntry.intersectionRatio || 0 : -1;
|
|
// Ignore unchanged ratios
|
if (oldRatio === newRatio) return;
|
|
for (var i = 0; i < this.thresholds.length; i++) {
|
var threshold = this.thresholds[i];
|
|
// Return true if an entry matches a threshold or if the new ratio
|
// and the old ratio are on the opposite sides of a threshold.
|
if (threshold == oldRatio || threshold == newRatio ||
|
threshold < oldRatio !== threshold < newRatio) {
|
return true;
|
}
|
}
|
};
|
|
|
/**
|
* Returns whether or not the root element is an element and is in the DOM.
|
* @return {boolean} True if the root element is an element and is in the DOM.
|
* @private
|
*/
|
IntersectionObserver.prototype._rootIsInDom = function() {
|
return !this.root || containsDeep(document, this.root);
|
};
|
|
|
/**
|
* Returns whether or not the target element is a child of root.
|
* @param {Element} target The target element to check.
|
* @return {boolean} True if the target element is a child of root.
|
* @private
|
*/
|
IntersectionObserver.prototype._rootContainsTarget = function(target) {
|
return containsDeep(this.root || document, target);
|
};
|
|
|
/**
|
* Adds the instance to the global IntersectionObserver registry if it isn't
|
* already present.
|
* @private
|
*/
|
IntersectionObserver.prototype._registerInstance = function() {
|
if (registry.indexOf(this) < 0) {
|
registry.push(this);
|
}
|
};
|
|
|
/**
|
* Removes the instance from the global IntersectionObserver registry.
|
* @private
|
*/
|
IntersectionObserver.prototype._unregisterInstance = function() {
|
var index = registry.indexOf(this);
|
if (index != -1) registry.splice(index, 1);
|
};
|
|
|
/**
|
* Returns the result of the performance.now() method or null in browsers
|
* that don't support the API.
|
* @return {number} The elapsed time since the page was requested.
|
*/
|
function now() {
|
return window.performance && performance.now && performance.now();
|
}
|
|
|
/**
|
* Throttles a function and delays its execution, so it's only called at most
|
* once within a given time period.
|
* @param {Function} fn The function to throttle.
|
* @param {number} timeout The amount of time that must pass before the
|
* function can be called again.
|
* @return {Function} The throttled function.
|
*/
|
function throttle(fn, timeout) {
|
var timer = null;
|
return function () {
|
if (!timer) {
|
timer = setTimeout(function() {
|
fn();
|
timer = null;
|
}, timeout);
|
}
|
};
|
}
|
|
|
/**
|
* Adds an event handler to a DOM node ensuring cross-browser compatibility.
|
* @param {Node} node The DOM node to add the event handler to.
|
* @param {string} event The event name.
|
* @param {Function} fn The event handler to add.
|
* @param {boolean} opt_useCapture Optionally adds the even to the capture
|
* phase. Note: this only works in modern browsers.
|
*/
|
function addEvent(node, event, fn, opt_useCapture) {
|
if (typeof node.addEventListener == 'function') {
|
node.addEventListener(event, fn, opt_useCapture || false);
|
}
|
else if (typeof node.attachEvent == 'function') {
|
node.attachEvent('on' + event, fn);
|
}
|
}
|
|
|
/**
|
* Removes a previously added event handler from a DOM node.
|
* @param {Node} node The DOM node to remove the event handler from.
|
* @param {string} event The event name.
|
* @param {Function} fn The event handler to remove.
|
* @param {boolean} opt_useCapture If the event handler was added with this
|
* flag set to true, it should be set to true here in order to remove it.
|
*/
|
function removeEvent(node, event, fn, opt_useCapture) {
|
if (typeof node.removeEventListener == 'function') {
|
node.removeEventListener(event, fn, opt_useCapture || false);
|
}
|
else if (typeof node.detatchEvent == 'function') {
|
node.detatchEvent('on' + event, fn);
|
}
|
}
|
|
|
/**
|
* Returns the intersection between two rect objects.
|
* @param {Object} rect1 The first rect.
|
* @param {Object} rect2 The second rect.
|
* @return {?Object} The intersection rect or undefined if no intersection
|
* is found.
|
*/
|
function computeRectIntersection(rect1, rect2) {
|
var top = Math.max(rect1.top, rect2.top);
|
var bottom = Math.min(rect1.bottom, rect2.bottom);
|
var left = Math.max(rect1.left, rect2.left);
|
var right = Math.min(rect1.right, rect2.right);
|
var width = right - left;
|
var height = bottom - top;
|
|
return (width >= 0 && height >= 0) && {
|
top: top,
|
bottom: bottom,
|
left: left,
|
right: right,
|
width: width,
|
height: height
|
};
|
}
|
|
|
/**
|
* Shims the native getBoundingClientRect for compatibility with older IE.
|
* @param {Element} el The element whose bounding rect to get.
|
* @return {Object} The (possibly shimmed) rect of the element.
|
*/
|
function getBoundingClientRect(el) {
|
var rect;
|
|
try {
|
rect = el.getBoundingClientRect();
|
} catch (err) {
|
// Ignore Windows 7 IE11 "Unspecified error"
|
// https://github.com/w3c/IntersectionObserver/pull/205
|
}
|
|
if (!rect) return getEmptyRect();
|
|
// Older IE
|
if (!(rect.width && rect.height)) {
|
rect = {
|
top: rect.top,
|
right: rect.right,
|
bottom: rect.bottom,
|
left: rect.left,
|
width: rect.right - rect.left,
|
height: rect.bottom - rect.top
|
};
|
}
|
return rect;
|
}
|
|
|
/**
|
* Returns an empty rect object. An empty rect is returned when an element
|
* is not in the DOM.
|
* @return {Object} The empty rect.
|
*/
|
function getEmptyRect() {
|
return {
|
top: 0,
|
bottom: 0,
|
left: 0,
|
right: 0,
|
width: 0,
|
height: 0
|
};
|
}
|
|
/**
|
* Checks to see if a parent element contains a child element (including inside
|
* shadow DOM).
|
* @param {Node} parent The parent element.
|
* @param {Node} child The child element.
|
* @return {boolean} True if the parent node contains the child node.
|
*/
|
function containsDeep(parent, child) {
|
var node = child;
|
while (node) {
|
if (node == parent) return true;
|
|
node = getParentNode(node);
|
}
|
return false;
|
}
|
|
|
/**
|
* Gets the parent node of an element or its host element if the parent node
|
* is a shadow root.
|
* @param {Node} node The node whose parent to get.
|
* @return {Node|null} The parent node or null if no parent exists.
|
*/
|
function getParentNode(node) {
|
var parent = node.parentNode;
|
|
if (parent && parent.nodeType == 11 && parent.host) {
|
// If the parent is a shadow root, return the host element.
|
return parent.host;
|
}
|
|
if (parent && parent.assignedSlot) {
|
// If the parent is distributed in a <slot>, return the parent of a slot.
|
return parent.assignedSlot.parentNode;
|
}
|
|
return parent;
|
}
|
|
|
// Exposes the constructors globally.
|
window.IntersectionObserver = IntersectionObserver;
|
window.IntersectionObserverEntry = IntersectionObserverEntry;
|
|
}());
|
|
|
/***/ }),
|
/* 115 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
// extracted by mini-css-extract-plugin
|
if(false) { var cssReload; }
|
|
|
/***/ }),
|
/* 116 */
|
/***/ (function(module, exports) {
|
|
if (String(navigator.vendor).indexOf('Apple') === 0) {
|
var firstEvent;
|
var timeout; // 用于全局禁用 iOS 双击包含手势
|
|
document.documentElement.addEventListener('click', function (event) {
|
var TIME_MAX = 450;
|
var PAGE_MAX = 44;
|
clearTimeout(timeout);
|
|
if (firstEvent && Math.abs(event.pageX - firstEvent.pageX) <= PAGE_MAX && Math.abs(event.pageY - firstEvent.pageY) <= PAGE_MAX && event.timeStamp - firstEvent.timeStamp <= TIME_MAX) {
|
event.preventDefault();
|
}
|
|
firstEvent = event;
|
timeout = setTimeout(function () {
|
firstEvent = null;
|
}, TIME_MAX);
|
});
|
}
|
|
/***/ }),
|
/* 117 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
var map = {
|
"./audio/index.vue": 166,
|
"./button/index.vue": 192,
|
"./canvas/index.vue": 185,
|
"./checkbox-group/index.vue": 167,
|
"./checkbox/index.vue": 168,
|
"./editor/index.vue": 186,
|
"./form/index.vue": 169,
|
"./icon/index.vue": 170,
|
"./image/index.vue": 171,
|
"./input/index.vue": 172,
|
"./label/index.vue": 187,
|
"./movable-area/index.vue": 193,
|
"./movable-view/index.vue": 163,
|
"./navigator/index.vue": 173,
|
"./picker-view-column/index.vue": 194,
|
"./picker-view/index.vue": 195,
|
"./progress/index.vue": 174,
|
"./radio-group/index.vue": 175,
|
"./radio/index.vue": 176,
|
"./resize-sensor/index.vue": 177,
|
"./rich-text/index.vue": 162,
|
"./scroll-view/index.vue": 178,
|
"./slider/index.vue": 179,
|
"./swiper-item/index.vue": 180,
|
"./swiper/index.vue": 196,
|
"./switch/index.vue": 181,
|
"./text/index.vue": 197,
|
"./textarea/index.vue": 182,
|
"./view/index.vue": 183
|
};
|
|
|
function webpackContext(req) {
|
var id = webpackContextResolve(req);
|
return __webpack_require__(id);
|
}
|
function webpackContextResolve(req) {
|
if(!__webpack_require__.o(map, req)) {
|
var e = new Error("Cannot find module '" + req + "'");
|
e.code = 'MODULE_NOT_FOUND';
|
throw e;
|
}
|
return map[req];
|
}
|
webpackContext.keys = function webpackContextKeys() {
|
return Object.keys(map);
|
};
|
webpackContext.resolve = webpackContextResolve;
|
module.exports = webpackContext;
|
webpackContext.id = 117;
|
|
/***/ }),
|
/* 118 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 119 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 120 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
|
var zlib_deflate = __webpack_require__(121);
|
var utils = __webpack_require__(11);
|
var strings = __webpack_require__(90);
|
var msg = __webpack_require__(77);
|
var ZStream = __webpack_require__(91);
|
|
var toString = Object.prototype.toString;
|
|
/* Public constants ==========================================================*/
|
/* ===========================================================================*/
|
|
var Z_NO_FLUSH = 0;
|
var Z_FINISH = 4;
|
|
var Z_OK = 0;
|
var Z_STREAM_END = 1;
|
var Z_SYNC_FLUSH = 2;
|
|
var Z_DEFAULT_COMPRESSION = -1;
|
|
var Z_DEFAULT_STRATEGY = 0;
|
|
var Z_DEFLATED = 8;
|
|
/* ===========================================================================*/
|
|
|
/**
|
* class Deflate
|
*
|
* Generic JS-style wrapper for zlib calls. If you don't need
|
* streaming behaviour - use more simple functions: [[deflate]],
|
* [[deflateRaw]] and [[gzip]].
|
**/
|
|
/* internal
|
* Deflate.chunks -> Array
|
*
|
* Chunks of output data, if [[Deflate#onData]] not overridden.
|
**/
|
|
/**
|
* Deflate.result -> Uint8Array|Array
|
*
|
* Compressed result, generated by default [[Deflate#onData]]
|
* and [[Deflate#onEnd]] handlers. Filled after you push last chunk
|
* (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you
|
* push a chunk with explicit flush (call [[Deflate#push]] with
|
* `Z_SYNC_FLUSH` param).
|
**/
|
|
/**
|
* Deflate.err -> Number
|
*
|
* Error code after deflate finished. 0 (Z_OK) on success.
|
* You will not need it in real life, because deflate errors
|
* are possible only on wrong options or bad `onData` / `onEnd`
|
* custom handlers.
|
**/
|
|
/**
|
* Deflate.msg -> String
|
*
|
* Error message, if [[Deflate.err]] != 0
|
**/
|
|
|
/**
|
* new Deflate(options)
|
* - options (Object): zlib deflate options.
|
*
|
* Creates new deflator instance with specified params. Throws exception
|
* on bad params. Supported options:
|
*
|
* - `level`
|
* - `windowBits`
|
* - `memLevel`
|
* - `strategy`
|
* - `dictionary`
|
*
|
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
|
* for more information on these.
|
*
|
* Additional options, for internal needs:
|
*
|
* - `chunkSize` - size of generated data chunks (16K by default)
|
* - `raw` (Boolean) - do raw deflate
|
* - `gzip` (Boolean) - create gzip wrapper
|
* - `to` (String) - if equal to 'string', then result will be "binary string"
|
* (each char code [0..255])
|
* - `header` (Object) - custom header for gzip
|
* - `text` (Boolean) - true if compressed data believed to be text
|
* - `time` (Number) - modification time, unix timestamp
|
* - `os` (Number) - operation system code
|
* - `extra` (Array) - array of bytes with extra data (max 65536)
|
* - `name` (String) - file name (binary string)
|
* - `comment` (String) - comment (binary string)
|
* - `hcrc` (Boolean) - true if header crc should be added
|
*
|
* ##### Example:
|
*
|
* ```javascript
|
* var pako = require('pako')
|
* , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
|
* , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
|
*
|
* var deflate = new pako.Deflate({ level: 3});
|
*
|
* deflate.push(chunk1, false);
|
* deflate.push(chunk2, true); // true -> last chunk
|
*
|
* if (deflate.err) { throw new Error(deflate.err); }
|
*
|
* console.log(deflate.result);
|
* ```
|
**/
|
function Deflate(options) {
|
if (!(this instanceof Deflate)) return new Deflate(options);
|
|
this.options = utils.assign({
|
level: Z_DEFAULT_COMPRESSION,
|
method: Z_DEFLATED,
|
chunkSize: 16384,
|
windowBits: 15,
|
memLevel: 8,
|
strategy: Z_DEFAULT_STRATEGY,
|
to: ''
|
}, options || {});
|
|
var opt = this.options;
|
|
if (opt.raw && (opt.windowBits > 0)) {
|
opt.windowBits = -opt.windowBits;
|
}
|
|
else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
|
opt.windowBits += 16;
|
}
|
|
this.err = 0; // error code, if happens (0 = Z_OK)
|
this.msg = ''; // error message
|
this.ended = false; // used to avoid multiple onEnd() calls
|
this.chunks = []; // chunks of compressed data
|
|
this.strm = new ZStream();
|
this.strm.avail_out = 0;
|
|
var status = zlib_deflate.deflateInit2(
|
this.strm,
|
opt.level,
|
opt.method,
|
opt.windowBits,
|
opt.memLevel,
|
opt.strategy
|
);
|
|
if (status !== Z_OK) {
|
throw new Error(msg[status]);
|
}
|
|
if (opt.header) {
|
zlib_deflate.deflateSetHeader(this.strm, opt.header);
|
}
|
|
if (opt.dictionary) {
|
var dict;
|
// Convert data if needed
|
if (typeof opt.dictionary === 'string') {
|
// If we need to compress text, change encoding to utf8.
|
dict = strings.string2buf(opt.dictionary);
|
} else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
|
dict = new Uint8Array(opt.dictionary);
|
} else {
|
dict = opt.dictionary;
|
}
|
|
status = zlib_deflate.deflateSetDictionary(this.strm, dict);
|
|
if (status !== Z_OK) {
|
throw new Error(msg[status]);
|
}
|
|
this._dict_set = true;
|
}
|
}
|
|
/**
|
* Deflate#push(data[, mode]) -> Boolean
|
* - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be
|
* converted to utf8 byte sequence.
|
* - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
|
* See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
|
*
|
* Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
|
* new compressed chunks. Returns `true` on success. The last data block must have
|
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
|
* [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
|
* can use mode Z_SYNC_FLUSH, keeping the compression context.
|
*
|
* On fail call [[Deflate#onEnd]] with error code and return false.
|
*
|
* We strongly recommend to use `Uint8Array` on input for best speed (output
|
* array format is detected automatically). Also, don't skip last param and always
|
* use the same type in your code (boolean or number). That will improve JS speed.
|
*
|
* For regular `Array`-s make sure all elements are [0..255].
|
*
|
* ##### Example
|
*
|
* ```javascript
|
* push(chunk, false); // push one of data chunks
|
* ...
|
* push(chunk, true); // push last chunk
|
* ```
|
**/
|
Deflate.prototype.push = function (data, mode) {
|
var strm = this.strm;
|
var chunkSize = this.options.chunkSize;
|
var status, _mode;
|
|
if (this.ended) { return false; }
|
|
_mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);
|
|
// Convert data if needed
|
if (typeof data === 'string') {
|
// If we need to compress text, change encoding to utf8.
|
strm.input = strings.string2buf(data);
|
} else if (toString.call(data) === '[object ArrayBuffer]') {
|
strm.input = new Uint8Array(data);
|
} else {
|
strm.input = data;
|
}
|
|
strm.next_in = 0;
|
strm.avail_in = strm.input.length;
|
|
do {
|
if (strm.avail_out === 0) {
|
strm.output = new utils.Buf8(chunkSize);
|
strm.next_out = 0;
|
strm.avail_out = chunkSize;
|
}
|
status = zlib_deflate.deflate(strm, _mode); /* no bad return value */
|
|
if (status !== Z_STREAM_END && status !== Z_OK) {
|
this.onEnd(status);
|
this.ended = true;
|
return false;
|
}
|
if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
|
if (this.options.to === 'string') {
|
this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
|
} else {
|
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
|
}
|
}
|
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
|
|
// Finalize on the last chunk.
|
if (_mode === Z_FINISH) {
|
status = zlib_deflate.deflateEnd(this.strm);
|
this.onEnd(status);
|
this.ended = true;
|
return status === Z_OK;
|
}
|
|
// callback interim results if Z_SYNC_FLUSH.
|
if (_mode === Z_SYNC_FLUSH) {
|
this.onEnd(Z_OK);
|
strm.avail_out = 0;
|
return true;
|
}
|
|
return true;
|
};
|
|
|
/**
|
* Deflate#onData(chunk) -> Void
|
* - chunk (Uint8Array|Array|String): output data. Type of array depends
|
* on js engine support. When string output requested, each chunk
|
* will be string.
|
*
|
* By default, stores data blocks in `chunks[]` property and glue
|
* those in `onEnd`. Override this handler, if you need another behaviour.
|
**/
|
Deflate.prototype.onData = function (chunk) {
|
this.chunks.push(chunk);
|
};
|
|
|
/**
|
* Deflate#onEnd(status) -> Void
|
* - status (Number): deflate status. 0 (Z_OK) on success,
|
* other if not.
|
*
|
* Called once after you tell deflate that the input stream is
|
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
|
* or if an error happened. By default - join collected chunks,
|
* free memory and fill `results` / `err` properties.
|
**/
|
Deflate.prototype.onEnd = function (status) {
|
// On success - join
|
if (status === Z_OK) {
|
if (this.options.to === 'string') {
|
this.result = this.chunks.join('');
|
} else {
|
this.result = utils.flattenChunks(this.chunks);
|
}
|
}
|
this.chunks = [];
|
this.err = status;
|
this.msg = this.strm.msg;
|
};
|
|
|
/**
|
* deflate(data[, options]) -> Uint8Array|Array|String
|
* - data (Uint8Array|Array|String): input data to compress.
|
* - options (Object): zlib deflate options.
|
*
|
* Compress `data` with deflate algorithm and `options`.
|
*
|
* Supported options are:
|
*
|
* - level
|
* - windowBits
|
* - memLevel
|
* - strategy
|
* - dictionary
|
*
|
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
|
* for more information on these.
|
*
|
* Sugar (options):
|
*
|
* - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
|
* negative windowBits implicitly.
|
* - `to` (String) - if equal to 'string', then result will be "binary string"
|
* (each char code [0..255])
|
*
|
* ##### Example:
|
*
|
* ```javascript
|
* var pako = require('pako')
|
* , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
|
*
|
* console.log(pako.deflate(data));
|
* ```
|
**/
|
function deflate(input, options) {
|
var deflator = new Deflate(options);
|
|
deflator.push(input, true);
|
|
// That will never happens, if you don't cheat with options :)
|
if (deflator.err) { throw deflator.msg || msg[deflator.err]; }
|
|
return deflator.result;
|
}
|
|
|
/**
|
* deflateRaw(data[, options]) -> Uint8Array|Array|String
|
* - data (Uint8Array|Array|String): input data to compress.
|
* - options (Object): zlib deflate options.
|
*
|
* The same as [[deflate]], but creates raw data, without wrapper
|
* (header and adler32 crc).
|
**/
|
function deflateRaw(input, options) {
|
options = options || {};
|
options.raw = true;
|
return deflate(input, options);
|
}
|
|
|
/**
|
* gzip(data[, options]) -> Uint8Array|Array|String
|
* - data (Uint8Array|Array|String): input data to compress.
|
* - options (Object): zlib deflate options.
|
*
|
* The same as [[deflate]], but create gzip wrapper instead of
|
* deflate one.
|
**/
|
function gzip(input, options) {
|
options = options || {};
|
options.gzip = true;
|
return deflate(input, options);
|
}
|
|
|
exports.Deflate = Deflate;
|
exports.deflate = deflate;
|
exports.deflateRaw = deflateRaw;
|
exports.gzip = gzip;
|
|
|
/***/ }),
|
/* 121 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
var utils = __webpack_require__(11);
|
var trees = __webpack_require__(122);
|
var adler32 = __webpack_require__(88);
|
var crc32 = __webpack_require__(89);
|
var msg = __webpack_require__(77);
|
|
/* Public constants ==========================================================*/
|
/* ===========================================================================*/
|
|
|
/* Allowed flush values; see deflate() and inflate() below for details */
|
var Z_NO_FLUSH = 0;
|
var Z_PARTIAL_FLUSH = 1;
|
//var Z_SYNC_FLUSH = 2;
|
var Z_FULL_FLUSH = 3;
|
var Z_FINISH = 4;
|
var Z_BLOCK = 5;
|
//var Z_TREES = 6;
|
|
|
/* Return codes for the compression/decompression functions. Negative values
|
* are errors, positive values are used for special but normal events.
|
*/
|
var Z_OK = 0;
|
var Z_STREAM_END = 1;
|
//var Z_NEED_DICT = 2;
|
//var Z_ERRNO = -1;
|
var Z_STREAM_ERROR = -2;
|
var Z_DATA_ERROR = -3;
|
//var Z_MEM_ERROR = -4;
|
var Z_BUF_ERROR = -5;
|
//var Z_VERSION_ERROR = -6;
|
|
|
/* compression levels */
|
//var Z_NO_COMPRESSION = 0;
|
//var Z_BEST_SPEED = 1;
|
//var Z_BEST_COMPRESSION = 9;
|
var Z_DEFAULT_COMPRESSION = -1;
|
|
|
var Z_FILTERED = 1;
|
var Z_HUFFMAN_ONLY = 2;
|
var Z_RLE = 3;
|
var Z_FIXED = 4;
|
var Z_DEFAULT_STRATEGY = 0;
|
|
/* Possible values of the data_type field (though see inflate()) */
|
//var Z_BINARY = 0;
|
//var Z_TEXT = 1;
|
//var Z_ASCII = 1; // = Z_TEXT
|
var Z_UNKNOWN = 2;
|
|
|
/* The deflate compression method */
|
var Z_DEFLATED = 8;
|
|
/*============================================================================*/
|
|
|
var MAX_MEM_LEVEL = 9;
|
/* Maximum value for memLevel in deflateInit2 */
|
var MAX_WBITS = 15;
|
/* 32K LZ77 window */
|
var DEF_MEM_LEVEL = 8;
|
|
|
var LENGTH_CODES = 29;
|
/* number of length codes, not counting the special END_BLOCK code */
|
var LITERALS = 256;
|
/* number of literal bytes 0..255 */
|
var L_CODES = LITERALS + 1 + LENGTH_CODES;
|
/* number of Literal or Length codes, including the END_BLOCK code */
|
var D_CODES = 30;
|
/* number of distance codes */
|
var BL_CODES = 19;
|
/* number of codes used to transfer the bit lengths */
|
var HEAP_SIZE = 2 * L_CODES + 1;
|
/* maximum heap size */
|
var MAX_BITS = 15;
|
/* All codes must not exceed MAX_BITS bits */
|
|
var MIN_MATCH = 3;
|
var MAX_MATCH = 258;
|
var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
|
|
var PRESET_DICT = 0x20;
|
|
var INIT_STATE = 42;
|
var EXTRA_STATE = 69;
|
var NAME_STATE = 73;
|
var COMMENT_STATE = 91;
|
var HCRC_STATE = 103;
|
var BUSY_STATE = 113;
|
var FINISH_STATE = 666;
|
|
var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
|
var BS_BLOCK_DONE = 2; /* block flush performed */
|
var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
|
var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
|
|
var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
|
|
function err(strm, errorCode) {
|
strm.msg = msg[errorCode];
|
return errorCode;
|
}
|
|
function rank(f) {
|
return ((f) << 1) - ((f) > 4 ? 9 : 0);
|
}
|
|
function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
|
|
|
/* =========================================================================
|
* Flush as much pending output as possible. All deflate() output goes
|
* through this function so some applications may wish to modify it
|
* to avoid allocating a large strm->output buffer and copying into it.
|
* (See also read_buf()).
|
*/
|
function flush_pending(strm) {
|
var s = strm.state;
|
|
//_tr_flush_bits(s);
|
var len = s.pending;
|
if (len > strm.avail_out) {
|
len = strm.avail_out;
|
}
|
if (len === 0) { return; }
|
|
utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
|
strm.next_out += len;
|
s.pending_out += len;
|
strm.total_out += len;
|
strm.avail_out -= len;
|
s.pending -= len;
|
if (s.pending === 0) {
|
s.pending_out = 0;
|
}
|
}
|
|
|
function flush_block_only(s, last) {
|
trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
|
s.block_start = s.strstart;
|
flush_pending(s.strm);
|
}
|
|
|
function put_byte(s, b) {
|
s.pending_buf[s.pending++] = b;
|
}
|
|
|
/* =========================================================================
|
* Put a short in the pending buffer. The 16-bit value is put in MSB order.
|
* IN assertion: the stream state is correct and there is enough room in
|
* pending_buf.
|
*/
|
function putShortMSB(s, b) {
|
// put_byte(s, (Byte)(b >> 8));
|
// put_byte(s, (Byte)(b & 0xff));
|
s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
|
s.pending_buf[s.pending++] = b & 0xff;
|
}
|
|
|
/* ===========================================================================
|
* Read a new buffer from the current input stream, update the adler32
|
* and total number of bytes read. All deflate() input goes through
|
* this function so some applications may wish to modify it to avoid
|
* allocating a large strm->input buffer and copying from it.
|
* (See also flush_pending()).
|
*/
|
function read_buf(strm, buf, start, size) {
|
var len = strm.avail_in;
|
|
if (len > size) { len = size; }
|
if (len === 0) { return 0; }
|
|
strm.avail_in -= len;
|
|
// zmemcpy(buf, strm->next_in, len);
|
utils.arraySet(buf, strm.input, strm.next_in, len, start);
|
if (strm.state.wrap === 1) {
|
strm.adler = adler32(strm.adler, buf, len, start);
|
}
|
|
else if (strm.state.wrap === 2) {
|
strm.adler = crc32(strm.adler, buf, len, start);
|
}
|
|
strm.next_in += len;
|
strm.total_in += len;
|
|
return len;
|
}
|
|
|
/* ===========================================================================
|
* Set match_start to the longest match starting at the given string and
|
* return its length. Matches shorter or equal to prev_length are discarded,
|
* in which case the result is equal to prev_length and match_start is
|
* garbage.
|
* IN assertions: cur_match is the head of the hash chain for the current
|
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
|
* OUT assertion: the match length is not greater than s->lookahead.
|
*/
|
function longest_match(s, cur_match) {
|
var chain_length = s.max_chain_length; /* max hash chain length */
|
var scan = s.strstart; /* current string */
|
var match; /* matched string */
|
var len; /* length of current match */
|
var best_len = s.prev_length; /* best match length so far */
|
var nice_match = s.nice_match; /* stop if match long enough */
|
var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
|
s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
|
|
var _win = s.window; // shortcut
|
|
var wmask = s.w_mask;
|
var prev = s.prev;
|
|
/* Stop when cur_match becomes <= limit. To simplify the code,
|
* we prevent matches with the string of window index 0.
|
*/
|
|
var strend = s.strstart + MAX_MATCH;
|
var scan_end1 = _win[scan + best_len - 1];
|
var scan_end = _win[scan + best_len];
|
|
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
|
* It is easy to get rid of this optimization if necessary.
|
*/
|
// Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
|
|
/* Do not waste too much time if we already have a good match: */
|
if (s.prev_length >= s.good_match) {
|
chain_length >>= 2;
|
}
|
/* Do not look for matches beyond the end of the input. This is necessary
|
* to make deflate deterministic.
|
*/
|
if (nice_match > s.lookahead) { nice_match = s.lookahead; }
|
|
// Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
|
|
do {
|
// Assert(cur_match < s->strstart, "no future");
|
match = cur_match;
|
|
/* Skip to next match if the match length cannot increase
|
* or if the match length is less than 2. Note that the checks below
|
* for insufficient lookahead only occur occasionally for performance
|
* reasons. Therefore uninitialized memory will be accessed, and
|
* conditional jumps will be made that depend on those values.
|
* However the length of the match is limited to the lookahead, so
|
* the output of deflate is not affected by the uninitialized values.
|
*/
|
|
if (_win[match + best_len] !== scan_end ||
|
_win[match + best_len - 1] !== scan_end1 ||
|
_win[match] !== _win[scan] ||
|
_win[++match] !== _win[scan + 1]) {
|
continue;
|
}
|
|
/* The check at best_len-1 can be removed because it will be made
|
* again later. (This heuristic is not always a win.)
|
* It is not necessary to compare scan[2] and match[2] since they
|
* are always equal when the other bytes match, given that
|
* the hash keys are equal and that HASH_BITS >= 8.
|
*/
|
scan += 2;
|
match++;
|
// Assert(*scan == *match, "match[2]?");
|
|
/* We check for insufficient lookahead only every 8th comparison;
|
* the 256th check will be made at strstart+258.
|
*/
|
do {
|
/*jshint noempty:false*/
|
} while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
|
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
|
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
|
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
|
scan < strend);
|
|
// Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
|
|
len = MAX_MATCH - (strend - scan);
|
scan = strend - MAX_MATCH;
|
|
if (len > best_len) {
|
s.match_start = cur_match;
|
best_len = len;
|
if (len >= nice_match) {
|
break;
|
}
|
scan_end1 = _win[scan + best_len - 1];
|
scan_end = _win[scan + best_len];
|
}
|
} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
|
|
if (best_len <= s.lookahead) {
|
return best_len;
|
}
|
return s.lookahead;
|
}
|
|
|
/* ===========================================================================
|
* Fill the window when the lookahead becomes insufficient.
|
* Updates strstart and lookahead.
|
*
|
* IN assertion: lookahead < MIN_LOOKAHEAD
|
* OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
|
* At least one byte has been read, or avail_in == 0; reads are
|
* performed for at least two bytes (required for the zip translate_eol
|
* option -- not supported here).
|
*/
|
function fill_window(s) {
|
var _w_size = s.w_size;
|
var p, n, m, more, str;
|
|
//Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
|
|
do {
|
more = s.window_size - s.lookahead - s.strstart;
|
|
// JS ints have 32 bit, block below not needed
|
/* Deal with !@#$% 64K limit: */
|
//if (sizeof(int) <= 2) {
|
// if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
|
// more = wsize;
|
//
|
// } else if (more == (unsigned)(-1)) {
|
// /* Very unlikely, but possible on 16 bit machine if
|
// * strstart == 0 && lookahead == 1 (input done a byte at time)
|
// */
|
// more--;
|
// }
|
//}
|
|
|
/* If the window is almost full and there is insufficient lookahead,
|
* move the upper half to the lower one to make room in the upper half.
|
*/
|
if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
|
|
utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
|
s.match_start -= _w_size;
|
s.strstart -= _w_size;
|
/* we now have strstart >= MAX_DIST */
|
s.block_start -= _w_size;
|
|
/* Slide the hash table (could be avoided with 32 bit values
|
at the expense of memory usage). We slide even when level == 0
|
to keep the hash table consistent if we switch back to level > 0
|
later. (Using level 0 permanently is not an optimal usage of
|
zlib, so we don't care about this pathological case.)
|
*/
|
|
n = s.hash_size;
|
p = n;
|
do {
|
m = s.head[--p];
|
s.head[p] = (m >= _w_size ? m - _w_size : 0);
|
} while (--n);
|
|
n = _w_size;
|
p = n;
|
do {
|
m = s.prev[--p];
|
s.prev[p] = (m >= _w_size ? m - _w_size : 0);
|
/* If n is not on any hash chain, prev[n] is garbage but
|
* its value will never be used.
|
*/
|
} while (--n);
|
|
more += _w_size;
|
}
|
if (s.strm.avail_in === 0) {
|
break;
|
}
|
|
/* If there was no sliding:
|
* strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
|
* more == window_size - lookahead - strstart
|
* => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
|
* => more >= window_size - 2*WSIZE + 2
|
* In the BIG_MEM or MMAP case (not yet supported),
|
* window_size == input_size + MIN_LOOKAHEAD &&
|
* strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
|
* Otherwise, window_size == 2*WSIZE so more >= 2.
|
* If there was sliding, more >= WSIZE. So in all cases, more >= 2.
|
*/
|
//Assert(more >= 2, "more < 2");
|
n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
|
s.lookahead += n;
|
|
/* Initialize the hash value now that we have some input: */
|
if (s.lookahead + s.insert >= MIN_MATCH) {
|
str = s.strstart - s.insert;
|
s.ins_h = s.window[str];
|
|
/* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
|
//#if MIN_MATCH != 3
|
// Call update_hash() MIN_MATCH-3 more times
|
//#endif
|
while (s.insert) {
|
/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
|
|
s.prev[str & s.w_mask] = s.head[s.ins_h];
|
s.head[s.ins_h] = str;
|
str++;
|
s.insert--;
|
if (s.lookahead + s.insert < MIN_MATCH) {
|
break;
|
}
|
}
|
}
|
/* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
|
* but this is not important since only literal bytes will be emitted.
|
*/
|
|
} while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
|
|
/* If the WIN_INIT bytes after the end of the current data have never been
|
* written, then zero those bytes in order to avoid memory check reports of
|
* the use of uninitialized (or uninitialised as Julian writes) bytes by
|
* the longest match routines. Update the high water mark for the next
|
* time through here. WIN_INIT is set to MAX_MATCH since the longest match
|
* routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
|
*/
|
// if (s.high_water < s.window_size) {
|
// var curr = s.strstart + s.lookahead;
|
// var init = 0;
|
//
|
// if (s.high_water < curr) {
|
// /* Previous high water mark below current data -- zero WIN_INIT
|
// * bytes or up to end of window, whichever is less.
|
// */
|
// init = s.window_size - curr;
|
// if (init > WIN_INIT)
|
// init = WIN_INIT;
|
// zmemzero(s->window + curr, (unsigned)init);
|
// s->high_water = curr + init;
|
// }
|
// else if (s->high_water < (ulg)curr + WIN_INIT) {
|
// /* High water mark at or above current data, but below current data
|
// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
|
// * to end of window, whichever is less.
|
// */
|
// init = (ulg)curr + WIN_INIT - s->high_water;
|
// if (init > s->window_size - s->high_water)
|
// init = s->window_size - s->high_water;
|
// zmemzero(s->window + s->high_water, (unsigned)init);
|
// s->high_water += init;
|
// }
|
// }
|
//
|
// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
|
// "not enough room for search");
|
}
|
|
/* ===========================================================================
|
* Copy without compression as much as possible from the input stream, return
|
* the current block state.
|
* This function does not insert new strings in the dictionary since
|
* uncompressible data is probably not useful. This function is used
|
* only for the level=0 compression option.
|
* NOTE: this function should be optimized to avoid extra copying from
|
* window to pending_buf.
|
*/
|
function deflate_stored(s, flush) {
|
/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
|
* to pending_buf_size, and each stored block has a 5 byte header:
|
*/
|
var max_block_size = 0xffff;
|
|
if (max_block_size > s.pending_buf_size - 5) {
|
max_block_size = s.pending_buf_size - 5;
|
}
|
|
/* Copy as much as possible from input to output: */
|
for (;;) {
|
/* Fill the window as much as possible: */
|
if (s.lookahead <= 1) {
|
|
//Assert(s->strstart < s->w_size+MAX_DIST(s) ||
|
// s->block_start >= (long)s->w_size, "slide too late");
|
// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
|
// s.block_start >= s.w_size)) {
|
// throw new Error("slide too late");
|
// }
|
|
fill_window(s);
|
if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
|
return BS_NEED_MORE;
|
}
|
|
if (s.lookahead === 0) {
|
break;
|
}
|
/* flush the current block */
|
}
|
//Assert(s->block_start >= 0L, "block gone");
|
// if (s.block_start < 0) throw new Error("block gone");
|
|
s.strstart += s.lookahead;
|
s.lookahead = 0;
|
|
/* Emit a stored block if pending_buf will be full: */
|
var max_start = s.block_start + max_block_size;
|
|
if (s.strstart === 0 || s.strstart >= max_start) {
|
/* strstart == 0 is possible when wraparound on 16-bit machine */
|
s.lookahead = s.strstart - max_start;
|
s.strstart = max_start;
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
|
|
}
|
/* Flush if we may have to slide, otherwise block_start may become
|
* negative and the data will be gone:
|
*/
|
if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
}
|
|
s.insert = 0;
|
|
if (flush === Z_FINISH) {
|
/*** FLUSH_BLOCK(s, 1); ***/
|
flush_block_only(s, true);
|
if (s.strm.avail_out === 0) {
|
return BS_FINISH_STARTED;
|
}
|
/***/
|
return BS_FINISH_DONE;
|
}
|
|
if (s.strstart > s.block_start) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
|
return BS_NEED_MORE;
|
}
|
|
/* ===========================================================================
|
* Compress as much as possible from the input stream, return the current
|
* block state.
|
* This function does not perform lazy evaluation of matches and inserts
|
* new strings in the dictionary only for unmatched strings or for short
|
* matches. It is used only for the fast compression options.
|
*/
|
function deflate_fast(s, flush) {
|
var hash_head; /* head of the hash chain */
|
var bflush; /* set if current block must be flushed */
|
|
for (;;) {
|
/* Make sure that we always have enough lookahead, except
|
* at the end of the input file. We need MAX_MATCH bytes
|
* for the next match, plus MIN_MATCH bytes to insert the
|
* string following the next match.
|
*/
|
if (s.lookahead < MIN_LOOKAHEAD) {
|
fill_window(s);
|
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
|
return BS_NEED_MORE;
|
}
|
if (s.lookahead === 0) {
|
break; /* flush the current block */
|
}
|
}
|
|
/* Insert the string window[strstart .. strstart+2] in the
|
* dictionary, and set hash_head to the head of the hash chain:
|
*/
|
hash_head = 0/*NIL*/;
|
if (s.lookahead >= MIN_MATCH) {
|
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
s.head[s.ins_h] = s.strstart;
|
/***/
|
}
|
|
/* Find the longest match, discarding those <= prev_length.
|
* At this point we have always match_length < MIN_MATCH
|
*/
|
if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
|
/* To simplify the code, we prevent matches with the string
|
* of window index 0 (in particular we have to avoid a match
|
* of the string with itself at the start of the input file).
|
*/
|
s.match_length = longest_match(s, hash_head);
|
/* longest_match() sets match_start */
|
}
|
if (s.match_length >= MIN_MATCH) {
|
// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
|
|
/*** _tr_tally_dist(s, s.strstart - s.match_start,
|
s.match_length - MIN_MATCH, bflush); ***/
|
bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
|
|
s.lookahead -= s.match_length;
|
|
/* Insert new strings in the hash table only if the match length
|
* is not too large. This saves time but degrades compression.
|
*/
|
if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
|
s.match_length--; /* string at strstart already in table */
|
do {
|
s.strstart++;
|
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
s.head[s.ins_h] = s.strstart;
|
/***/
|
/* strstart never exceeds WSIZE-MAX_MATCH, so there are
|
* always MIN_MATCH bytes ahead.
|
*/
|
} while (--s.match_length !== 0);
|
s.strstart++;
|
} else
|
{
|
s.strstart += s.match_length;
|
s.match_length = 0;
|
s.ins_h = s.window[s.strstart];
|
/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
|
|
//#if MIN_MATCH != 3
|
// Call UPDATE_HASH() MIN_MATCH-3 more times
|
//#endif
|
/* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
|
* matter since it will be recomputed at next deflate call.
|
*/
|
}
|
} else {
|
/* No match, output a literal byte */
|
//Tracevv((stderr,"%c", s.window[s.strstart]));
|
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
|
|
s.lookahead--;
|
s.strstart++;
|
}
|
if (bflush) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
}
|
s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
|
if (flush === Z_FINISH) {
|
/*** FLUSH_BLOCK(s, 1); ***/
|
flush_block_only(s, true);
|
if (s.strm.avail_out === 0) {
|
return BS_FINISH_STARTED;
|
}
|
/***/
|
return BS_FINISH_DONE;
|
}
|
if (s.last_lit) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
return BS_BLOCK_DONE;
|
}
|
|
/* ===========================================================================
|
* Same as above, but achieves better compression. We use a lazy
|
* evaluation for matches: a match is finally adopted only if there is
|
* no better match at the next window position.
|
*/
|
function deflate_slow(s, flush) {
|
var hash_head; /* head of hash chain */
|
var bflush; /* set if current block must be flushed */
|
|
var max_insert;
|
|
/* Process the input block. */
|
for (;;) {
|
/* Make sure that we always have enough lookahead, except
|
* at the end of the input file. We need MAX_MATCH bytes
|
* for the next match, plus MIN_MATCH bytes to insert the
|
* string following the next match.
|
*/
|
if (s.lookahead < MIN_LOOKAHEAD) {
|
fill_window(s);
|
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
|
return BS_NEED_MORE;
|
}
|
if (s.lookahead === 0) { break; } /* flush the current block */
|
}
|
|
/* Insert the string window[strstart .. strstart+2] in the
|
* dictionary, and set hash_head to the head of the hash chain:
|
*/
|
hash_head = 0/*NIL*/;
|
if (s.lookahead >= MIN_MATCH) {
|
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
s.head[s.ins_h] = s.strstart;
|
/***/
|
}
|
|
/* Find the longest match, discarding those <= prev_length.
|
*/
|
s.prev_length = s.match_length;
|
s.prev_match = s.match_start;
|
s.match_length = MIN_MATCH - 1;
|
|
if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
|
s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
|
/* To simplify the code, we prevent matches with the string
|
* of window index 0 (in particular we have to avoid a match
|
* of the string with itself at the start of the input file).
|
*/
|
s.match_length = longest_match(s, hash_head);
|
/* longest_match() sets match_start */
|
|
if (s.match_length <= 5 &&
|
(s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
|
|
/* If prev_match is also MIN_MATCH, match_start is garbage
|
* but we will ignore the current match anyway.
|
*/
|
s.match_length = MIN_MATCH - 1;
|
}
|
}
|
/* If there was a match at the previous step and the current
|
* match is not better, output the previous match:
|
*/
|
if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
|
max_insert = s.strstart + s.lookahead - MIN_MATCH;
|
/* Do not insert strings in hash table beyond this. */
|
|
//check_match(s, s.strstart-1, s.prev_match, s.prev_length);
|
|
/***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
|
s.prev_length - MIN_MATCH, bflush);***/
|
bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
|
/* Insert in hash table all strings up to the end of the match.
|
* strstart-1 and strstart are already inserted. If there is not
|
* enough lookahead, the last two strings are not inserted in
|
* the hash table.
|
*/
|
s.lookahead -= s.prev_length - 1;
|
s.prev_length -= 2;
|
do {
|
if (++s.strstart <= max_insert) {
|
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
|
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
|
s.head[s.ins_h] = s.strstart;
|
/***/
|
}
|
} while (--s.prev_length !== 0);
|
s.match_available = 0;
|
s.match_length = MIN_MATCH - 1;
|
s.strstart++;
|
|
if (bflush) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
|
} else if (s.match_available) {
|
/* If there was no match at the previous position, output a
|
* single literal. If there was a match but the current match
|
* is longer, truncate the previous match to a single literal.
|
*/
|
//Tracevv((stderr,"%c", s->window[s->strstart-1]));
|
/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
|
|
if (bflush) {
|
/*** FLUSH_BLOCK_ONLY(s, 0) ***/
|
flush_block_only(s, false);
|
/***/
|
}
|
s.strstart++;
|
s.lookahead--;
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
} else {
|
/* There is no previous match to compare with, wait for
|
* the next step to decide.
|
*/
|
s.match_available = 1;
|
s.strstart++;
|
s.lookahead--;
|
}
|
}
|
//Assert (flush != Z_NO_FLUSH, "no flush?");
|
if (s.match_available) {
|
//Tracevv((stderr,"%c", s->window[s->strstart-1]));
|
/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
|
|
s.match_available = 0;
|
}
|
s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
|
if (flush === Z_FINISH) {
|
/*** FLUSH_BLOCK(s, 1); ***/
|
flush_block_only(s, true);
|
if (s.strm.avail_out === 0) {
|
return BS_FINISH_STARTED;
|
}
|
/***/
|
return BS_FINISH_DONE;
|
}
|
if (s.last_lit) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
|
return BS_BLOCK_DONE;
|
}
|
|
|
/* ===========================================================================
|
* For Z_RLE, simply look for runs of bytes, generate matches only of distance
|
* one. Do not maintain a hash table. (It will be regenerated if this run of
|
* deflate switches away from Z_RLE.)
|
*/
|
function deflate_rle(s, flush) {
|
var bflush; /* set if current block must be flushed */
|
var prev; /* byte at distance one to match */
|
var scan, strend; /* scan goes up to strend for length of run */
|
|
var _win = s.window;
|
|
for (;;) {
|
/* Make sure that we always have enough lookahead, except
|
* at the end of the input file. We need MAX_MATCH bytes
|
* for the longest run, plus one for the unrolled loop.
|
*/
|
if (s.lookahead <= MAX_MATCH) {
|
fill_window(s);
|
if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
|
return BS_NEED_MORE;
|
}
|
if (s.lookahead === 0) { break; } /* flush the current block */
|
}
|
|
/* See how many times the previous byte repeats */
|
s.match_length = 0;
|
if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
|
scan = s.strstart - 1;
|
prev = _win[scan];
|
if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
|
strend = s.strstart + MAX_MATCH;
|
do {
|
/*jshint noempty:false*/
|
} while (prev === _win[++scan] && prev === _win[++scan] &&
|
prev === _win[++scan] && prev === _win[++scan] &&
|
prev === _win[++scan] && prev === _win[++scan] &&
|
prev === _win[++scan] && prev === _win[++scan] &&
|
scan < strend);
|
s.match_length = MAX_MATCH - (strend - scan);
|
if (s.match_length > s.lookahead) {
|
s.match_length = s.lookahead;
|
}
|
}
|
//Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
|
}
|
|
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
|
if (s.match_length >= MIN_MATCH) {
|
//check_match(s, s.strstart, s.strstart - 1, s.match_length);
|
|
/*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
|
bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
|
|
s.lookahead -= s.match_length;
|
s.strstart += s.match_length;
|
s.match_length = 0;
|
} else {
|
/* No match, output a literal byte */
|
//Tracevv((stderr,"%c", s->window[s->strstart]));
|
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
|
|
s.lookahead--;
|
s.strstart++;
|
}
|
if (bflush) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
}
|
s.insert = 0;
|
if (flush === Z_FINISH) {
|
/*** FLUSH_BLOCK(s, 1); ***/
|
flush_block_only(s, true);
|
if (s.strm.avail_out === 0) {
|
return BS_FINISH_STARTED;
|
}
|
/***/
|
return BS_FINISH_DONE;
|
}
|
if (s.last_lit) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
return BS_BLOCK_DONE;
|
}
|
|
/* ===========================================================================
|
* For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
|
* (It will be regenerated if this run of deflate switches away from Huffman.)
|
*/
|
function deflate_huff(s, flush) {
|
var bflush; /* set if current block must be flushed */
|
|
for (;;) {
|
/* Make sure that we have a literal to write. */
|
if (s.lookahead === 0) {
|
fill_window(s);
|
if (s.lookahead === 0) {
|
if (flush === Z_NO_FLUSH) {
|
return BS_NEED_MORE;
|
}
|
break; /* flush the current block */
|
}
|
}
|
|
/* Output a literal byte */
|
s.match_length = 0;
|
//Tracevv((stderr,"%c", s->window[s->strstart]));
|
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
|
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
|
s.lookahead--;
|
s.strstart++;
|
if (bflush) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
}
|
s.insert = 0;
|
if (flush === Z_FINISH) {
|
/*** FLUSH_BLOCK(s, 1); ***/
|
flush_block_only(s, true);
|
if (s.strm.avail_out === 0) {
|
return BS_FINISH_STARTED;
|
}
|
/***/
|
return BS_FINISH_DONE;
|
}
|
if (s.last_lit) {
|
/*** FLUSH_BLOCK(s, 0); ***/
|
flush_block_only(s, false);
|
if (s.strm.avail_out === 0) {
|
return BS_NEED_MORE;
|
}
|
/***/
|
}
|
return BS_BLOCK_DONE;
|
}
|
|
/* Values for max_lazy_match, good_match and max_chain_length, depending on
|
* the desired pack level (0..9). The values given below have been tuned to
|
* exclude worst case performance for pathological files. Better values may be
|
* found for specific files.
|
*/
|
function Config(good_length, max_lazy, nice_length, max_chain, func) {
|
this.good_length = good_length;
|
this.max_lazy = max_lazy;
|
this.nice_length = nice_length;
|
this.max_chain = max_chain;
|
this.func = func;
|
}
|
|
var configuration_table;
|
|
configuration_table = [
|
/* good lazy nice chain */
|
new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
|
new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
|
new Config(4, 5, 16, 8, deflate_fast), /* 2 */
|
new Config(4, 6, 32, 32, deflate_fast), /* 3 */
|
|
new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
|
new Config(8, 16, 32, 32, deflate_slow), /* 5 */
|
new Config(8, 16, 128, 128, deflate_slow), /* 6 */
|
new Config(8, 32, 128, 256, deflate_slow), /* 7 */
|
new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
|
new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
|
];
|
|
|
/* ===========================================================================
|
* Initialize the "longest match" routines for a new zlib stream
|
*/
|
function lm_init(s) {
|
s.window_size = 2 * s.w_size;
|
|
/*** CLEAR_HASH(s); ***/
|
zero(s.head); // Fill with NIL (= 0);
|
|
/* Set the default configuration parameters:
|
*/
|
s.max_lazy_match = configuration_table[s.level].max_lazy;
|
s.good_match = configuration_table[s.level].good_length;
|
s.nice_match = configuration_table[s.level].nice_length;
|
s.max_chain_length = configuration_table[s.level].max_chain;
|
|
s.strstart = 0;
|
s.block_start = 0;
|
s.lookahead = 0;
|
s.insert = 0;
|
s.match_length = s.prev_length = MIN_MATCH - 1;
|
s.match_available = 0;
|
s.ins_h = 0;
|
}
|
|
|
function DeflateState() {
|
this.strm = null; /* pointer back to this zlib stream */
|
this.status = 0; /* as the name implies */
|
this.pending_buf = null; /* output still pending */
|
this.pending_buf_size = 0; /* size of pending_buf */
|
this.pending_out = 0; /* next pending byte to output to the stream */
|
this.pending = 0; /* nb of bytes in the pending buffer */
|
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
|
this.gzhead = null; /* gzip header information to write */
|
this.gzindex = 0; /* where in extra, name, or comment */
|
this.method = Z_DEFLATED; /* can only be DEFLATED */
|
this.last_flush = -1; /* value of flush param for previous deflate call */
|
|
this.w_size = 0; /* LZ77 window size (32K by default) */
|
this.w_bits = 0; /* log2(w_size) (8..16) */
|
this.w_mask = 0; /* w_size - 1 */
|
|
this.window = null;
|
/* Sliding window. Input bytes are read into the second half of the window,
|
* and move to the first half later to keep a dictionary of at least wSize
|
* bytes. With this organization, matches are limited to a distance of
|
* wSize-MAX_MATCH bytes, but this ensures that IO is always
|
* performed with a length multiple of the block size.
|
*/
|
|
this.window_size = 0;
|
/* Actual size of window: 2*wSize, except when the user input buffer
|
* is directly used as sliding window.
|
*/
|
|
this.prev = null;
|
/* Link to older string with same hash index. To limit the size of this
|
* array to 64K, this link is maintained only for the last 32K strings.
|
* An index in this array is thus a window index modulo 32K.
|
*/
|
|
this.head = null; /* Heads of the hash chains or NIL. */
|
|
this.ins_h = 0; /* hash index of string to be inserted */
|
this.hash_size = 0; /* number of elements in hash table */
|
this.hash_bits = 0; /* log2(hash_size) */
|
this.hash_mask = 0; /* hash_size-1 */
|
|
this.hash_shift = 0;
|
/* Number of bits by which ins_h must be shifted at each input
|
* step. It must be such that after MIN_MATCH steps, the oldest
|
* byte no longer takes part in the hash key, that is:
|
* hash_shift * MIN_MATCH >= hash_bits
|
*/
|
|
this.block_start = 0;
|
/* Window position at the beginning of the current output block. Gets
|
* negative when the window is moved backwards.
|
*/
|
|
this.match_length = 0; /* length of best match */
|
this.prev_match = 0; /* previous match */
|
this.match_available = 0; /* set if previous match exists */
|
this.strstart = 0; /* start of string to insert */
|
this.match_start = 0; /* start of matching string */
|
this.lookahead = 0; /* number of valid bytes ahead in window */
|
|
this.prev_length = 0;
|
/* Length of the best match at previous step. Matches not greater than this
|
* are discarded. This is used in the lazy match evaluation.
|
*/
|
|
this.max_chain_length = 0;
|
/* To speed up deflation, hash chains are never searched beyond this
|
* length. A higher limit improves compression ratio but degrades the
|
* speed.
|
*/
|
|
this.max_lazy_match = 0;
|
/* Attempt to find a better match only when the current match is strictly
|
* smaller than this value. This mechanism is used only for compression
|
* levels >= 4.
|
*/
|
// That's alias to max_lazy_match, don't use directly
|
//this.max_insert_length = 0;
|
/* Insert new strings in the hash table only if the match length is not
|
* greater than this length. This saves time but degrades compression.
|
* max_insert_length is used only for compression levels <= 3.
|
*/
|
|
this.level = 0; /* compression level (1..9) */
|
this.strategy = 0; /* favor or force Huffman coding*/
|
|
this.good_match = 0;
|
/* Use a faster search when the previous match is longer than this */
|
|
this.nice_match = 0; /* Stop searching when current match exceeds this */
|
|
/* used by trees.c: */
|
|
/* Didn't use ct_data typedef below to suppress compiler warning */
|
|
// struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
|
// struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
|
// struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
|
|
// Use flat array of DOUBLE size, with interleaved fata,
|
// because JS does not support effective
|
this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
|
this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
|
this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
|
zero(this.dyn_ltree);
|
zero(this.dyn_dtree);
|
zero(this.bl_tree);
|
|
this.l_desc = null; /* desc. for literal tree */
|
this.d_desc = null; /* desc. for distance tree */
|
this.bl_desc = null; /* desc. for bit length tree */
|
|
//ush bl_count[MAX_BITS+1];
|
this.bl_count = new utils.Buf16(MAX_BITS + 1);
|
/* number of codes at each bit length for an optimal tree */
|
|
//int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
|
this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */
|
zero(this.heap);
|
|
this.heap_len = 0; /* number of elements in the heap */
|
this.heap_max = 0; /* element of largest frequency */
|
/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
|
* The same heap array is used to build all trees.
|
*/
|
|
this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
|
zero(this.depth);
|
/* Depth of each subtree used as tie breaker for trees of equal frequency
|
*/
|
|
this.l_buf = 0; /* buffer index for literals or lengths */
|
|
this.lit_bufsize = 0;
|
/* Size of match buffer for literals/lengths. There are 4 reasons for
|
* limiting lit_bufsize to 64K:
|
* - frequencies can be kept in 16 bit counters
|
* - if compression is not successful for the first block, all input
|
* data is still in the window so we can still emit a stored block even
|
* when input comes from standard input. (This can also be done for
|
* all blocks if lit_bufsize is not greater than 32K.)
|
* - if compression is not successful for a file smaller than 64K, we can
|
* even emit a stored file instead of a stored block (saving 5 bytes).
|
* This is applicable only for zip (not gzip or zlib).
|
* - creating new Huffman trees less frequently may not provide fast
|
* adaptation to changes in the input data statistics. (Take for
|
* example a binary file with poorly compressible code followed by
|
* a highly compressible string table.) Smaller buffer sizes give
|
* fast adaptation but have of course the overhead of transmitting
|
* trees more frequently.
|
* - I can't count above 4
|
*/
|
|
this.last_lit = 0; /* running index in l_buf */
|
|
this.d_buf = 0;
|
/* Buffer index for distances. To simplify the code, d_buf and l_buf have
|
* the same number of elements. To use different lengths, an extra flag
|
* array would be necessary.
|
*/
|
|
this.opt_len = 0; /* bit length of current block with optimal trees */
|
this.static_len = 0; /* bit length of current block with static trees */
|
this.matches = 0; /* number of string matches in current block */
|
this.insert = 0; /* bytes at end of window left to insert */
|
|
|
this.bi_buf = 0;
|
/* Output buffer. bits are inserted starting at the bottom (least
|
* significant bits).
|
*/
|
this.bi_valid = 0;
|
/* Number of valid bits in bi_buf. All bits above the last valid bit
|
* are always zero.
|
*/
|
|
// Used for window memory init. We safely ignore it for JS. That makes
|
// sense only for pointers and memory check tools.
|
//this.high_water = 0;
|
/* High water mark offset in window for initialized bytes -- bytes above
|
* this are set to zero in order to avoid memory check warnings when
|
* longest match routines access bytes past the input. This is then
|
* updated to the new high water mark.
|
*/
|
}
|
|
|
function deflateResetKeep(strm) {
|
var s;
|
|
if (!strm || !strm.state) {
|
return err(strm, Z_STREAM_ERROR);
|
}
|
|
strm.total_in = strm.total_out = 0;
|
strm.data_type = Z_UNKNOWN;
|
|
s = strm.state;
|
s.pending = 0;
|
s.pending_out = 0;
|
|
if (s.wrap < 0) {
|
s.wrap = -s.wrap;
|
/* was made negative by deflate(..., Z_FINISH); */
|
}
|
s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
|
strm.adler = (s.wrap === 2) ?
|
0 // crc32(0, Z_NULL, 0)
|
:
|
1; // adler32(0, Z_NULL, 0)
|
s.last_flush = Z_NO_FLUSH;
|
trees._tr_init(s);
|
return Z_OK;
|
}
|
|
|
function deflateReset(strm) {
|
var ret = deflateResetKeep(strm);
|
if (ret === Z_OK) {
|
lm_init(strm.state);
|
}
|
return ret;
|
}
|
|
|
function deflateSetHeader(strm, head) {
|
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
|
strm.state.gzhead = head;
|
return Z_OK;
|
}
|
|
|
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
|
if (!strm) { // === Z_NULL
|
return Z_STREAM_ERROR;
|
}
|
var wrap = 1;
|
|
if (level === Z_DEFAULT_COMPRESSION) {
|
level = 6;
|
}
|
|
if (windowBits < 0) { /* suppress zlib wrapper */
|
wrap = 0;
|
windowBits = -windowBits;
|
}
|
|
else if (windowBits > 15) {
|
wrap = 2; /* write gzip wrapper instead */
|
windowBits -= 16;
|
}
|
|
|
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
|
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
|
strategy < 0 || strategy > Z_FIXED) {
|
return err(strm, Z_STREAM_ERROR);
|
}
|
|
|
if (windowBits === 8) {
|
windowBits = 9;
|
}
|
/* until 256-byte window bug fixed */
|
|
var s = new DeflateState();
|
|
strm.state = s;
|
s.strm = strm;
|
|
s.wrap = wrap;
|
s.gzhead = null;
|
s.w_bits = windowBits;
|
s.w_size = 1 << s.w_bits;
|
s.w_mask = s.w_size - 1;
|
|
s.hash_bits = memLevel + 7;
|
s.hash_size = 1 << s.hash_bits;
|
s.hash_mask = s.hash_size - 1;
|
s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
|
|
s.window = new utils.Buf8(s.w_size * 2);
|
s.head = new utils.Buf16(s.hash_size);
|
s.prev = new utils.Buf16(s.w_size);
|
|
// Don't need mem init magic for JS.
|
//s.high_water = 0; /* nothing written to s->window yet */
|
|
s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
|
|
s.pending_buf_size = s.lit_bufsize * 4;
|
|
//overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
|
//s->pending_buf = (uchf *) overlay;
|
s.pending_buf = new utils.Buf8(s.pending_buf_size);
|
|
// It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
|
//s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
|
s.d_buf = 1 * s.lit_bufsize;
|
|
//s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
|
s.l_buf = (1 + 2) * s.lit_bufsize;
|
|
s.level = level;
|
s.strategy = strategy;
|
s.method = method;
|
|
return deflateReset(strm);
|
}
|
|
function deflateInit(strm, level) {
|
return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
|
}
|
|
|
function deflate(strm, flush) {
|
var old_flush, s;
|
var beg, val; // for gzip header write only
|
|
if (!strm || !strm.state ||
|
flush > Z_BLOCK || flush < 0) {
|
return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
|
}
|
|
s = strm.state;
|
|
if (!strm.output ||
|
(!strm.input && strm.avail_in !== 0) ||
|
(s.status === FINISH_STATE && flush !== Z_FINISH)) {
|
return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
|
}
|
|
s.strm = strm; /* just in case */
|
old_flush = s.last_flush;
|
s.last_flush = flush;
|
|
/* Write the header */
|
if (s.status === INIT_STATE) {
|
|
if (s.wrap === 2) { // GZIP header
|
strm.adler = 0; //crc32(0L, Z_NULL, 0);
|
put_byte(s, 31);
|
put_byte(s, 139);
|
put_byte(s, 8);
|
if (!s.gzhead) { // s->gzhead == Z_NULL
|
put_byte(s, 0);
|
put_byte(s, 0);
|
put_byte(s, 0);
|
put_byte(s, 0);
|
put_byte(s, 0);
|
put_byte(s, s.level === 9 ? 2 :
|
(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
|
4 : 0));
|
put_byte(s, OS_CODE);
|
s.status = BUSY_STATE;
|
}
|
else {
|
put_byte(s, (s.gzhead.text ? 1 : 0) +
|
(s.gzhead.hcrc ? 2 : 0) +
|
(!s.gzhead.extra ? 0 : 4) +
|
(!s.gzhead.name ? 0 : 8) +
|
(!s.gzhead.comment ? 0 : 16)
|
);
|
put_byte(s, s.gzhead.time & 0xff);
|
put_byte(s, (s.gzhead.time >> 8) & 0xff);
|
put_byte(s, (s.gzhead.time >> 16) & 0xff);
|
put_byte(s, (s.gzhead.time >> 24) & 0xff);
|
put_byte(s, s.level === 9 ? 2 :
|
(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
|
4 : 0));
|
put_byte(s, s.gzhead.os & 0xff);
|
if (s.gzhead.extra && s.gzhead.extra.length) {
|
put_byte(s, s.gzhead.extra.length & 0xff);
|
put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
|
}
|
if (s.gzhead.hcrc) {
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
|
}
|
s.gzindex = 0;
|
s.status = EXTRA_STATE;
|
}
|
}
|
else // DEFLATE header
|
{
|
var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
|
var level_flags = -1;
|
|
if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
|
level_flags = 0;
|
} else if (s.level < 6) {
|
level_flags = 1;
|
} else if (s.level === 6) {
|
level_flags = 2;
|
} else {
|
level_flags = 3;
|
}
|
header |= (level_flags << 6);
|
if (s.strstart !== 0) { header |= PRESET_DICT; }
|
header += 31 - (header % 31);
|
|
s.status = BUSY_STATE;
|
putShortMSB(s, header);
|
|
/* Save the adler32 of the preset dictionary: */
|
if (s.strstart !== 0) {
|
putShortMSB(s, strm.adler >>> 16);
|
putShortMSB(s, strm.adler & 0xffff);
|
}
|
strm.adler = 1; // adler32(0L, Z_NULL, 0);
|
}
|
}
|
|
//#ifdef GZIP
|
if (s.status === EXTRA_STATE) {
|
if (s.gzhead.extra/* != Z_NULL*/) {
|
beg = s.pending; /* start of bytes to update crc */
|
|
while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
|
if (s.pending === s.pending_buf_size) {
|
if (s.gzhead.hcrc && s.pending > beg) {
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
}
|
flush_pending(strm);
|
beg = s.pending;
|
if (s.pending === s.pending_buf_size) {
|
break;
|
}
|
}
|
put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
|
s.gzindex++;
|
}
|
if (s.gzhead.hcrc && s.pending > beg) {
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
}
|
if (s.gzindex === s.gzhead.extra.length) {
|
s.gzindex = 0;
|
s.status = NAME_STATE;
|
}
|
}
|
else {
|
s.status = NAME_STATE;
|
}
|
}
|
if (s.status === NAME_STATE) {
|
if (s.gzhead.name/* != Z_NULL*/) {
|
beg = s.pending; /* start of bytes to update crc */
|
//int val;
|
|
do {
|
if (s.pending === s.pending_buf_size) {
|
if (s.gzhead.hcrc && s.pending > beg) {
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
}
|
flush_pending(strm);
|
beg = s.pending;
|
if (s.pending === s.pending_buf_size) {
|
val = 1;
|
break;
|
}
|
}
|
// JS specific: little magic to add zero terminator to end of string
|
if (s.gzindex < s.gzhead.name.length) {
|
val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
|
} else {
|
val = 0;
|
}
|
put_byte(s, val);
|
} while (val !== 0);
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
}
|
if (val === 0) {
|
s.gzindex = 0;
|
s.status = COMMENT_STATE;
|
}
|
}
|
else {
|
s.status = COMMENT_STATE;
|
}
|
}
|
if (s.status === COMMENT_STATE) {
|
if (s.gzhead.comment/* != Z_NULL*/) {
|
beg = s.pending; /* start of bytes to update crc */
|
//int val;
|
|
do {
|
if (s.pending === s.pending_buf_size) {
|
if (s.gzhead.hcrc && s.pending > beg) {
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
}
|
flush_pending(strm);
|
beg = s.pending;
|
if (s.pending === s.pending_buf_size) {
|
val = 1;
|
break;
|
}
|
}
|
// JS specific: little magic to add zero terminator to end of string
|
if (s.gzindex < s.gzhead.comment.length) {
|
val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
|
} else {
|
val = 0;
|
}
|
put_byte(s, val);
|
} while (val !== 0);
|
|
if (s.gzhead.hcrc && s.pending > beg) {
|
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
|
}
|
if (val === 0) {
|
s.status = HCRC_STATE;
|
}
|
}
|
else {
|
s.status = HCRC_STATE;
|
}
|
}
|
if (s.status === HCRC_STATE) {
|
if (s.gzhead.hcrc) {
|
if (s.pending + 2 > s.pending_buf_size) {
|
flush_pending(strm);
|
}
|
if (s.pending + 2 <= s.pending_buf_size) {
|
put_byte(s, strm.adler & 0xff);
|
put_byte(s, (strm.adler >> 8) & 0xff);
|
strm.adler = 0; //crc32(0L, Z_NULL, 0);
|
s.status = BUSY_STATE;
|
}
|
}
|
else {
|
s.status = BUSY_STATE;
|
}
|
}
|
//#endif
|
|
/* Flush as much pending output as possible */
|
if (s.pending !== 0) {
|
flush_pending(strm);
|
if (strm.avail_out === 0) {
|
/* Since avail_out is 0, deflate will be called again with
|
* more output space, but possibly with both pending and
|
* avail_in equal to zero. There won't be anything to do,
|
* but this is not an error situation so make sure we
|
* return OK instead of BUF_ERROR at next call of deflate:
|
*/
|
s.last_flush = -1;
|
return Z_OK;
|
}
|
|
/* Make sure there is something to do and avoid duplicate consecutive
|
* flushes. For repeated and useless calls with Z_FINISH, we keep
|
* returning Z_STREAM_END instead of Z_BUF_ERROR.
|
*/
|
} else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
|
flush !== Z_FINISH) {
|
return err(strm, Z_BUF_ERROR);
|
}
|
|
/* User must not provide more input after the first FINISH: */
|
if (s.status === FINISH_STATE && strm.avail_in !== 0) {
|
return err(strm, Z_BUF_ERROR);
|
}
|
|
/* Start a new block or continue the current one.
|
*/
|
if (strm.avail_in !== 0 || s.lookahead !== 0 ||
|
(flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
|
var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
|
(s.strategy === Z_RLE ? deflate_rle(s, flush) :
|
configuration_table[s.level].func(s, flush));
|
|
if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
|
s.status = FINISH_STATE;
|
}
|
if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
|
if (strm.avail_out === 0) {
|
s.last_flush = -1;
|
/* avoid BUF_ERROR next call, see above */
|
}
|
return Z_OK;
|
/* If flush != Z_NO_FLUSH && avail_out == 0, the next call
|
* of deflate should use the same flush parameter to make sure
|
* that the flush is complete. So we don't have to output an
|
* empty block here, this will be done at next call. This also
|
* ensures that for a very small output buffer, we emit at most
|
* one empty block.
|
*/
|
}
|
if (bstate === BS_BLOCK_DONE) {
|
if (flush === Z_PARTIAL_FLUSH) {
|
trees._tr_align(s);
|
}
|
else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
|
|
trees._tr_stored_block(s, 0, 0, false);
|
/* For a full flush, this empty block will be recognized
|
* as a special marker by inflate_sync().
|
*/
|
if (flush === Z_FULL_FLUSH) {
|
/*** CLEAR_HASH(s); ***/ /* forget history */
|
zero(s.head); // Fill with NIL (= 0);
|
|
if (s.lookahead === 0) {
|
s.strstart = 0;
|
s.block_start = 0;
|
s.insert = 0;
|
}
|
}
|
}
|
flush_pending(strm);
|
if (strm.avail_out === 0) {
|
s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
|
return Z_OK;
|
}
|
}
|
}
|
//Assert(strm->avail_out > 0, "bug2");
|
//if (strm.avail_out <= 0) { throw new Error("bug2");}
|
|
if (flush !== Z_FINISH) { return Z_OK; }
|
if (s.wrap <= 0) { return Z_STREAM_END; }
|
|
/* Write the trailer */
|
if (s.wrap === 2) {
|
put_byte(s, strm.adler & 0xff);
|
put_byte(s, (strm.adler >> 8) & 0xff);
|
put_byte(s, (strm.adler >> 16) & 0xff);
|
put_byte(s, (strm.adler >> 24) & 0xff);
|
put_byte(s, strm.total_in & 0xff);
|
put_byte(s, (strm.total_in >> 8) & 0xff);
|
put_byte(s, (strm.total_in >> 16) & 0xff);
|
put_byte(s, (strm.total_in >> 24) & 0xff);
|
}
|
else
|
{
|
putShortMSB(s, strm.adler >>> 16);
|
putShortMSB(s, strm.adler & 0xffff);
|
}
|
|
flush_pending(strm);
|
/* If avail_out is zero, the application will call deflate again
|
* to flush the rest.
|
*/
|
if (s.wrap > 0) { s.wrap = -s.wrap; }
|
/* write the trailer only once! */
|
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
|
}
|
|
function deflateEnd(strm) {
|
var status;
|
|
if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
|
return Z_STREAM_ERROR;
|
}
|
|
status = strm.state.status;
|
if (status !== INIT_STATE &&
|
status !== EXTRA_STATE &&
|
status !== NAME_STATE &&
|
status !== COMMENT_STATE &&
|
status !== HCRC_STATE &&
|
status !== BUSY_STATE &&
|
status !== FINISH_STATE
|
) {
|
return err(strm, Z_STREAM_ERROR);
|
}
|
|
strm.state = null;
|
|
return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
|
}
|
|
|
/* =========================================================================
|
* Initializes the compression dictionary from the given byte
|
* sequence without producing any compressed output.
|
*/
|
function deflateSetDictionary(strm, dictionary) {
|
var dictLength = dictionary.length;
|
|
var s;
|
var str, n;
|
var wrap;
|
var avail;
|
var next;
|
var input;
|
var tmpDict;
|
|
if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
|
return Z_STREAM_ERROR;
|
}
|
|
s = strm.state;
|
wrap = s.wrap;
|
|
if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
|
return Z_STREAM_ERROR;
|
}
|
|
/* when using zlib wrappers, compute Adler-32 for provided dictionary */
|
if (wrap === 1) {
|
/* adler32(strm->adler, dictionary, dictLength); */
|
strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
|
}
|
|
s.wrap = 0; /* avoid computing Adler-32 in read_buf */
|
|
/* if dictionary would fill window, just replace the history */
|
if (dictLength >= s.w_size) {
|
if (wrap === 0) { /* already empty otherwise */
|
/*** CLEAR_HASH(s); ***/
|
zero(s.head); // Fill with NIL (= 0);
|
s.strstart = 0;
|
s.block_start = 0;
|
s.insert = 0;
|
}
|
/* use the tail */
|
// dictionary = dictionary.slice(dictLength - s.w_size);
|
tmpDict = new utils.Buf8(s.w_size);
|
utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
|
dictionary = tmpDict;
|
dictLength = s.w_size;
|
}
|
/* insert dictionary into window and hash */
|
avail = strm.avail_in;
|
next = strm.next_in;
|
input = strm.input;
|
strm.avail_in = dictLength;
|
strm.next_in = 0;
|
strm.input = dictionary;
|
fill_window(s);
|
while (s.lookahead >= MIN_MATCH) {
|
str = s.strstart;
|
n = s.lookahead - (MIN_MATCH - 1);
|
do {
|
/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
|
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
|
|
s.prev[str & s.w_mask] = s.head[s.ins_h];
|
|
s.head[s.ins_h] = str;
|
str++;
|
} while (--n);
|
s.strstart = str;
|
s.lookahead = MIN_MATCH - 1;
|
fill_window(s);
|
}
|
s.strstart += s.lookahead;
|
s.block_start = s.strstart;
|
s.insert = s.lookahead;
|
s.lookahead = 0;
|
s.match_length = s.prev_length = MIN_MATCH - 1;
|
s.match_available = 0;
|
strm.next_in = next;
|
strm.input = input;
|
strm.avail_in = avail;
|
s.wrap = wrap;
|
return Z_OK;
|
}
|
|
|
exports.deflateInit = deflateInit;
|
exports.deflateInit2 = deflateInit2;
|
exports.deflateReset = deflateReset;
|
exports.deflateResetKeep = deflateResetKeep;
|
exports.deflateSetHeader = deflateSetHeader;
|
exports.deflate = deflate;
|
exports.deflateEnd = deflateEnd;
|
exports.deflateSetDictionary = deflateSetDictionary;
|
exports.deflateInfo = 'pako deflate (from Nodeca project)';
|
|
/* Not implemented
|
exports.deflateBound = deflateBound;
|
exports.deflateCopy = deflateCopy;
|
exports.deflateParams = deflateParams;
|
exports.deflatePending = deflatePending;
|
exports.deflatePrime = deflatePrime;
|
exports.deflateTune = deflateTune;
|
*/
|
|
|
/***/ }),
|
/* 122 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
/* eslint-disable space-unary-ops */
|
|
var utils = __webpack_require__(11);
|
|
/* Public constants ==========================================================*/
|
/* ===========================================================================*/
|
|
|
//var Z_FILTERED = 1;
|
//var Z_HUFFMAN_ONLY = 2;
|
//var Z_RLE = 3;
|
var Z_FIXED = 4;
|
//var Z_DEFAULT_STRATEGY = 0;
|
|
/* Possible values of the data_type field (though see inflate()) */
|
var Z_BINARY = 0;
|
var Z_TEXT = 1;
|
//var Z_ASCII = 1; // = Z_TEXT
|
var Z_UNKNOWN = 2;
|
|
/*============================================================================*/
|
|
|
function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
|
|
// From zutil.h
|
|
var STORED_BLOCK = 0;
|
var STATIC_TREES = 1;
|
var DYN_TREES = 2;
|
/* The three kinds of block type */
|
|
var MIN_MATCH = 3;
|
var MAX_MATCH = 258;
|
/* The minimum and maximum match lengths */
|
|
// From deflate.h
|
/* ===========================================================================
|
* Internal compression state.
|
*/
|
|
var LENGTH_CODES = 29;
|
/* number of length codes, not counting the special END_BLOCK code */
|
|
var LITERALS = 256;
|
/* number of literal bytes 0..255 */
|
|
var L_CODES = LITERALS + 1 + LENGTH_CODES;
|
/* number of Literal or Length codes, including the END_BLOCK code */
|
|
var D_CODES = 30;
|
/* number of distance codes */
|
|
var BL_CODES = 19;
|
/* number of codes used to transfer the bit lengths */
|
|
var HEAP_SIZE = 2 * L_CODES + 1;
|
/* maximum heap size */
|
|
var MAX_BITS = 15;
|
/* All codes must not exceed MAX_BITS bits */
|
|
var Buf_size = 16;
|
/* size of bit buffer in bi_buf */
|
|
|
/* ===========================================================================
|
* Constants
|
*/
|
|
var MAX_BL_BITS = 7;
|
/* Bit length codes must not exceed MAX_BL_BITS bits */
|
|
var END_BLOCK = 256;
|
/* end of block literal code */
|
|
var REP_3_6 = 16;
|
/* repeat previous bit length 3-6 times (2 bits of repeat count) */
|
|
var REPZ_3_10 = 17;
|
/* repeat a zero length 3-10 times (3 bits of repeat count) */
|
|
var REPZ_11_138 = 18;
|
/* repeat a zero length 11-138 times (7 bits of repeat count) */
|
|
/* eslint-disable comma-spacing,array-bracket-spacing */
|
var extra_lbits = /* extra bits for each length code */
|
[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
|
|
var extra_dbits = /* extra bits for each distance code */
|
[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
|
|
var extra_blbits = /* extra bits for each bit length code */
|
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
|
|
var bl_order =
|
[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
|
/* eslint-enable comma-spacing,array-bracket-spacing */
|
|
/* The lengths of the bit length codes are sent in order of decreasing
|
* probability, to avoid transmitting the lengths for unused bit length codes.
|
*/
|
|
/* ===========================================================================
|
* Local data. These are initialized only once.
|
*/
|
|
// We pre-fill arrays with 0 to avoid uninitialized gaps
|
|
var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
|
|
// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1
|
var static_ltree = new Array((L_CODES + 2) * 2);
|
zero(static_ltree);
|
/* The static literal tree. Since the bit lengths are imposed, there is no
|
* need for the L_CODES extra codes used during heap construction. However
|
* The codes 286 and 287 are needed to build a canonical tree (see _tr_init
|
* below).
|
*/
|
|
var static_dtree = new Array(D_CODES * 2);
|
zero(static_dtree);
|
/* The static distance tree. (Actually a trivial tree since all codes use
|
* 5 bits.)
|
*/
|
|
var _dist_code = new Array(DIST_CODE_LEN);
|
zero(_dist_code);
|
/* Distance codes. The first 256 values correspond to the distances
|
* 3 .. 258, the last 256 values correspond to the top 8 bits of
|
* the 15 bit distances.
|
*/
|
|
var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
|
zero(_length_code);
|
/* length code for each normalized match length (0 == MIN_MATCH) */
|
|
var base_length = new Array(LENGTH_CODES);
|
zero(base_length);
|
/* First normalized length for each code (0 = MIN_MATCH) */
|
|
var base_dist = new Array(D_CODES);
|
zero(base_dist);
|
/* First normalized distance for each code (0 = distance of 1) */
|
|
|
function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
|
|
this.static_tree = static_tree; /* static tree or NULL */
|
this.extra_bits = extra_bits; /* extra bits for each code or NULL */
|
this.extra_base = extra_base; /* base index for extra_bits */
|
this.elems = elems; /* max number of elements in the tree */
|
this.max_length = max_length; /* max bit length for the codes */
|
|
// show if `static_tree` has data or dummy - needed for monomorphic objects
|
this.has_stree = static_tree && static_tree.length;
|
}
|
|
|
var static_l_desc;
|
var static_d_desc;
|
var static_bl_desc;
|
|
|
function TreeDesc(dyn_tree, stat_desc) {
|
this.dyn_tree = dyn_tree; /* the dynamic tree */
|
this.max_code = 0; /* largest code with non zero frequency */
|
this.stat_desc = stat_desc; /* the corresponding static tree */
|
}
|
|
|
|
function d_code(dist) {
|
return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
|
}
|
|
|
/* ===========================================================================
|
* Output a short LSB first on the stream.
|
* IN assertion: there is enough room in pendingBuf.
|
*/
|
function put_short(s, w) {
|
// put_byte(s, (uch)((w) & 0xff));
|
// put_byte(s, (uch)((ush)(w) >> 8));
|
s.pending_buf[s.pending++] = (w) & 0xff;
|
s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
|
}
|
|
|
/* ===========================================================================
|
* Send a value on a given number of bits.
|
* IN assertion: length <= 16 and value fits in length bits.
|
*/
|
function send_bits(s, value, length) {
|
if (s.bi_valid > (Buf_size - length)) {
|
s.bi_buf |= (value << s.bi_valid) & 0xffff;
|
put_short(s, s.bi_buf);
|
s.bi_buf = value >> (Buf_size - s.bi_valid);
|
s.bi_valid += length - Buf_size;
|
} else {
|
s.bi_buf |= (value << s.bi_valid) & 0xffff;
|
s.bi_valid += length;
|
}
|
}
|
|
|
function send_code(s, c, tree) {
|
send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
|
}
|
|
|
/* ===========================================================================
|
* Reverse the first len bits of a code, using straightforward code (a faster
|
* method would use a table)
|
* IN assertion: 1 <= len <= 15
|
*/
|
function bi_reverse(code, len) {
|
var res = 0;
|
do {
|
res |= code & 1;
|
code >>>= 1;
|
res <<= 1;
|
} while (--len > 0);
|
return res >>> 1;
|
}
|
|
|
/* ===========================================================================
|
* Flush the bit buffer, keeping at most 7 bits in it.
|
*/
|
function bi_flush(s) {
|
if (s.bi_valid === 16) {
|
put_short(s, s.bi_buf);
|
s.bi_buf = 0;
|
s.bi_valid = 0;
|
|
} else if (s.bi_valid >= 8) {
|
s.pending_buf[s.pending++] = s.bi_buf & 0xff;
|
s.bi_buf >>= 8;
|
s.bi_valid -= 8;
|
}
|
}
|
|
|
/* ===========================================================================
|
* Compute the optimal bit lengths for a tree and update the total bit length
|
* for the current block.
|
* IN assertion: the fields freq and dad are set, heap[heap_max] and
|
* above are the tree nodes sorted by increasing frequency.
|
* OUT assertions: the field len is set to the optimal bit length, the
|
* array bl_count contains the frequencies for each bit length.
|
* The length opt_len is updated; static_len is also updated if stree is
|
* not null.
|
*/
|
function gen_bitlen(s, desc)
|
// deflate_state *s;
|
// tree_desc *desc; /* the tree descriptor */
|
{
|
var tree = desc.dyn_tree;
|
var max_code = desc.max_code;
|
var stree = desc.stat_desc.static_tree;
|
var has_stree = desc.stat_desc.has_stree;
|
var extra = desc.stat_desc.extra_bits;
|
var base = desc.stat_desc.extra_base;
|
var max_length = desc.stat_desc.max_length;
|
var h; /* heap index */
|
var n, m; /* iterate over the tree elements */
|
var bits; /* bit length */
|
var xbits; /* extra bits */
|
var f; /* frequency */
|
var overflow = 0; /* number of elements with bit length too large */
|
|
for (bits = 0; bits <= MAX_BITS; bits++) {
|
s.bl_count[bits] = 0;
|
}
|
|
/* In a first pass, compute the optimal bit lengths (which may
|
* overflow in the case of the bit length tree).
|
*/
|
tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */
|
|
for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
|
n = s.heap[h];
|
bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
|
if (bits > max_length) {
|
bits = max_length;
|
overflow++;
|
}
|
tree[n * 2 + 1]/*.Len*/ = bits;
|
/* We overwrite tree[n].Dad which is no longer needed */
|
|
if (n > max_code) { continue; } /* not a leaf node */
|
|
s.bl_count[bits]++;
|
xbits = 0;
|
if (n >= base) {
|
xbits = extra[n - base];
|
}
|
f = tree[n * 2]/*.Freq*/;
|
s.opt_len += f * (bits + xbits);
|
if (has_stree) {
|
s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
|
}
|
}
|
if (overflow === 0) { return; }
|
|
// Trace((stderr,"\nbit length overflow\n"));
|
/* This happens for example on obj2 and pic of the Calgary corpus */
|
|
/* Find the first bit length which could increase: */
|
do {
|
bits = max_length - 1;
|
while (s.bl_count[bits] === 0) { bits--; }
|
s.bl_count[bits]--; /* move one leaf down the tree */
|
s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
|
s.bl_count[max_length]--;
|
/* The brother of the overflow item also moves one step up,
|
* but this does not affect bl_count[max_length]
|
*/
|
overflow -= 2;
|
} while (overflow > 0);
|
|
/* Now recompute all bit lengths, scanning in increasing frequency.
|
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
|
* lengths instead of fixing only the wrong ones. This idea is taken
|
* from 'ar' written by Haruhiko Okumura.)
|
*/
|
for (bits = max_length; bits !== 0; bits--) {
|
n = s.bl_count[bits];
|
while (n !== 0) {
|
m = s.heap[--h];
|
if (m > max_code) { continue; }
|
if (tree[m * 2 + 1]/*.Len*/ !== bits) {
|
// Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
|
s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
|
tree[m * 2 + 1]/*.Len*/ = bits;
|
}
|
n--;
|
}
|
}
|
}
|
|
|
/* ===========================================================================
|
* Generate the codes for a given tree and bit counts (which need not be
|
* optimal).
|
* IN assertion: the array bl_count contains the bit length statistics for
|
* the given tree and the field len is set for all tree elements.
|
* OUT assertion: the field code is set for all tree elements of non
|
* zero code length.
|
*/
|
function gen_codes(tree, max_code, bl_count)
|
// ct_data *tree; /* the tree to decorate */
|
// int max_code; /* largest code with non zero frequency */
|
// ushf *bl_count; /* number of codes at each bit length */
|
{
|
var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
|
var code = 0; /* running code value */
|
var bits; /* bit index */
|
var n; /* code index */
|
|
/* The distribution counts are first used to generate the code values
|
* without bit reversal.
|
*/
|
for (bits = 1; bits <= MAX_BITS; bits++) {
|
next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
|
}
|
/* Check that the bit counts in bl_count are consistent. The last code
|
* must be all ones.
|
*/
|
//Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
|
// "inconsistent bit counts");
|
//Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
|
|
for (n = 0; n <= max_code; n++) {
|
var len = tree[n * 2 + 1]/*.Len*/;
|
if (len === 0) { continue; }
|
/* Now reverse the bits */
|
tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);
|
|
//Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
|
// n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
|
}
|
}
|
|
|
/* ===========================================================================
|
* Initialize the various 'constant' tables.
|
*/
|
function tr_static_init() {
|
var n; /* iterates over tree elements */
|
var bits; /* bit counter */
|
var length; /* length value */
|
var code; /* code value */
|
var dist; /* distance index */
|
var bl_count = new Array(MAX_BITS + 1);
|
/* number of codes at each bit length for an optimal tree */
|
|
// do check in _tr_init()
|
//if (static_init_done) return;
|
|
/* For some embedded targets, global variables are not initialized: */
|
/*#ifdef NO_INIT_GLOBAL_POINTERS
|
static_l_desc.static_tree = static_ltree;
|
static_l_desc.extra_bits = extra_lbits;
|
static_d_desc.static_tree = static_dtree;
|
static_d_desc.extra_bits = extra_dbits;
|
static_bl_desc.extra_bits = extra_blbits;
|
#endif*/
|
|
/* Initialize the mapping length (0..255) -> length code (0..28) */
|
length = 0;
|
for (code = 0; code < LENGTH_CODES - 1; code++) {
|
base_length[code] = length;
|
for (n = 0; n < (1 << extra_lbits[code]); n++) {
|
_length_code[length++] = code;
|
}
|
}
|
//Assert (length == 256, "tr_static_init: length != 256");
|
/* Note that the length 255 (match length 258) can be represented
|
* in two different ways: code 284 + 5 bits or code 285, so we
|
* overwrite length_code[255] to use the best encoding:
|
*/
|
_length_code[length - 1] = code;
|
|
/* Initialize the mapping dist (0..32K) -> dist code (0..29) */
|
dist = 0;
|
for (code = 0; code < 16; code++) {
|
base_dist[code] = dist;
|
for (n = 0; n < (1 << extra_dbits[code]); n++) {
|
_dist_code[dist++] = code;
|
}
|
}
|
//Assert (dist == 256, "tr_static_init: dist != 256");
|
dist >>= 7; /* from now on, all distances are divided by 128 */
|
for (; code < D_CODES; code++) {
|
base_dist[code] = dist << 7;
|
for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
|
_dist_code[256 + dist++] = code;
|
}
|
}
|
//Assert (dist == 256, "tr_static_init: 256+dist != 512");
|
|
/* Construct the codes of the static literal tree */
|
for (bits = 0; bits <= MAX_BITS; bits++) {
|
bl_count[bits] = 0;
|
}
|
|
n = 0;
|
while (n <= 143) {
|
static_ltree[n * 2 + 1]/*.Len*/ = 8;
|
n++;
|
bl_count[8]++;
|
}
|
while (n <= 255) {
|
static_ltree[n * 2 + 1]/*.Len*/ = 9;
|
n++;
|
bl_count[9]++;
|
}
|
while (n <= 279) {
|
static_ltree[n * 2 + 1]/*.Len*/ = 7;
|
n++;
|
bl_count[7]++;
|
}
|
while (n <= 287) {
|
static_ltree[n * 2 + 1]/*.Len*/ = 8;
|
n++;
|
bl_count[8]++;
|
}
|
/* Codes 286 and 287 do not exist, but we must include them in the
|
* tree construction to get a canonical Huffman tree (longest code
|
* all ones)
|
*/
|
gen_codes(static_ltree, L_CODES + 1, bl_count);
|
|
/* The static distance tree is trivial: */
|
for (n = 0; n < D_CODES; n++) {
|
static_dtree[n * 2 + 1]/*.Len*/ = 5;
|
static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
|
}
|
|
// Now data ready and we can init static trees
|
static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
|
static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
|
static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
|
|
//static_init_done = true;
|
}
|
|
|
/* ===========================================================================
|
* Initialize a new block.
|
*/
|
function init_block(s) {
|
var n; /* iterates over tree elements */
|
|
/* Initialize the trees. */
|
for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
|
for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
|
for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }
|
|
s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
|
s.opt_len = s.static_len = 0;
|
s.last_lit = s.matches = 0;
|
}
|
|
|
/* ===========================================================================
|
* Flush the bit buffer and align the output on a byte boundary
|
*/
|
function bi_windup(s)
|
{
|
if (s.bi_valid > 8) {
|
put_short(s, s.bi_buf);
|
} else if (s.bi_valid > 0) {
|
//put_byte(s, (Byte)s->bi_buf);
|
s.pending_buf[s.pending++] = s.bi_buf;
|
}
|
s.bi_buf = 0;
|
s.bi_valid = 0;
|
}
|
|
/* ===========================================================================
|
* Copy a stored block, storing first the length and its
|
* one's complement if requested.
|
*/
|
function copy_block(s, buf, len, header)
|
//DeflateState *s;
|
//charf *buf; /* the input data */
|
//unsigned len; /* its length */
|
//int header; /* true if block header must be written */
|
{
|
bi_windup(s); /* align on byte boundary */
|
|
if (header) {
|
put_short(s, len);
|
put_short(s, ~len);
|
}
|
// while (len--) {
|
// put_byte(s, *buf++);
|
// }
|
utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
|
s.pending += len;
|
}
|
|
/* ===========================================================================
|
* Compares to subtrees, using the tree depth as tie breaker when
|
* the subtrees have equal frequency. This minimizes the worst case length.
|
*/
|
function smaller(tree, n, m, depth) {
|
var _n2 = n * 2;
|
var _m2 = m * 2;
|
return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
|
(tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
|
}
|
|
/* ===========================================================================
|
* Restore the heap property by moving down the tree starting at node k,
|
* exchanging a node with the smallest of its two sons if necessary, stopping
|
* when the heap property is re-established (each father smaller than its
|
* two sons).
|
*/
|
function pqdownheap(s, tree, k)
|
// deflate_state *s;
|
// ct_data *tree; /* the tree to restore */
|
// int k; /* node to move down */
|
{
|
var v = s.heap[k];
|
var j = k << 1; /* left son of k */
|
while (j <= s.heap_len) {
|
/* Set j to the smallest of the two sons: */
|
if (j < s.heap_len &&
|
smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
|
j++;
|
}
|
/* Exit if v is smaller than both sons */
|
if (smaller(tree, v, s.heap[j], s.depth)) { break; }
|
|
/* Exchange v with the smallest son */
|
s.heap[k] = s.heap[j];
|
k = j;
|
|
/* And continue down the tree, setting j to the left son of k */
|
j <<= 1;
|
}
|
s.heap[k] = v;
|
}
|
|
|
// inlined manually
|
// var SMALLEST = 1;
|
|
/* ===========================================================================
|
* Send the block data compressed using the given Huffman trees
|
*/
|
function compress_block(s, ltree, dtree)
|
// deflate_state *s;
|
// const ct_data *ltree; /* literal tree */
|
// const ct_data *dtree; /* distance tree */
|
{
|
var dist; /* distance of matched string */
|
var lc; /* match length or unmatched char (if dist == 0) */
|
var lx = 0; /* running index in l_buf */
|
var code; /* the code to send */
|
var extra; /* number of extra bits to send */
|
|
if (s.last_lit !== 0) {
|
do {
|
dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
|
lc = s.pending_buf[s.l_buf + lx];
|
lx++;
|
|
if (dist === 0) {
|
send_code(s, lc, ltree); /* send a literal byte */
|
//Tracecv(isgraph(lc), (stderr," '%c' ", lc));
|
} else {
|
/* Here, lc is the match length - MIN_MATCH */
|
code = _length_code[lc];
|
send_code(s, code + LITERALS + 1, ltree); /* send the length code */
|
extra = extra_lbits[code];
|
if (extra !== 0) {
|
lc -= base_length[code];
|
send_bits(s, lc, extra); /* send the extra length bits */
|
}
|
dist--; /* dist is now the match distance - 1 */
|
code = d_code(dist);
|
//Assert (code < D_CODES, "bad d_code");
|
|
send_code(s, code, dtree); /* send the distance code */
|
extra = extra_dbits[code];
|
if (extra !== 0) {
|
dist -= base_dist[code];
|
send_bits(s, dist, extra); /* send the extra distance bits */
|
}
|
} /* literal or match pair ? */
|
|
/* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
|
//Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
|
// "pendingBuf overflow");
|
|
} while (lx < s.last_lit);
|
}
|
|
send_code(s, END_BLOCK, ltree);
|
}
|
|
|
/* ===========================================================================
|
* Construct one Huffman tree and assigns the code bit strings and lengths.
|
* Update the total bit length for the current block.
|
* IN assertion: the field freq is set for all tree elements.
|
* OUT assertions: the fields len and code are set to the optimal bit length
|
* and corresponding code. The length opt_len is updated; static_len is
|
* also updated if stree is not null. The field max_code is set.
|
*/
|
function build_tree(s, desc)
|
// deflate_state *s;
|
// tree_desc *desc; /* the tree descriptor */
|
{
|
var tree = desc.dyn_tree;
|
var stree = desc.stat_desc.static_tree;
|
var has_stree = desc.stat_desc.has_stree;
|
var elems = desc.stat_desc.elems;
|
var n, m; /* iterate over heap elements */
|
var max_code = -1; /* largest code with non zero frequency */
|
var node; /* new node being created */
|
|
/* Construct the initial heap, with least frequent element in
|
* heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
|
* heap[0] is not used.
|
*/
|
s.heap_len = 0;
|
s.heap_max = HEAP_SIZE;
|
|
for (n = 0; n < elems; n++) {
|
if (tree[n * 2]/*.Freq*/ !== 0) {
|
s.heap[++s.heap_len] = max_code = n;
|
s.depth[n] = 0;
|
|
} else {
|
tree[n * 2 + 1]/*.Len*/ = 0;
|
}
|
}
|
|
/* The pkzip format requires that at least one distance code exists,
|
* and that at least one bit should be sent even if there is only one
|
* possible code. So to avoid special checks later on we force at least
|
* two codes of non zero frequency.
|
*/
|
while (s.heap_len < 2) {
|
node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
|
tree[node * 2]/*.Freq*/ = 1;
|
s.depth[node] = 0;
|
s.opt_len--;
|
|
if (has_stree) {
|
s.static_len -= stree[node * 2 + 1]/*.Len*/;
|
}
|
/* node is 0 or 1 so it does not have extra bits */
|
}
|
desc.max_code = max_code;
|
|
/* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
|
* establish sub-heaps of increasing lengths:
|
*/
|
for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
|
|
/* Construct the Huffman tree by repeatedly combining the least two
|
* frequent nodes.
|
*/
|
node = elems; /* next internal node of the tree */
|
do {
|
//pqremove(s, tree, n); /* n = node of least frequency */
|
/*** pqremove ***/
|
n = s.heap[1/*SMALLEST*/];
|
s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
|
pqdownheap(s, tree, 1/*SMALLEST*/);
|
/***/
|
|
m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
|
|
s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
|
s.heap[--s.heap_max] = m;
|
|
/* Create a new node father of n and m */
|
tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
|
s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
|
tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;
|
|
/* and insert the new node in the heap */
|
s.heap[1/*SMALLEST*/] = node++;
|
pqdownheap(s, tree, 1/*SMALLEST*/);
|
|
} while (s.heap_len >= 2);
|
|
s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
|
|
/* At this point, the fields freq and dad are set. We can now
|
* generate the bit lengths.
|
*/
|
gen_bitlen(s, desc);
|
|
/* The field len is now set, we can generate the bit codes */
|
gen_codes(tree, max_code, s.bl_count);
|
}
|
|
|
/* ===========================================================================
|
* Scan a literal or distance tree to determine the frequencies of the codes
|
* in the bit length tree.
|
*/
|
function scan_tree(s, tree, max_code)
|
// deflate_state *s;
|
// ct_data *tree; /* the tree to be scanned */
|
// int max_code; /* and its largest code of non zero frequency */
|
{
|
var n; /* iterates over all tree elements */
|
var prevlen = -1; /* last emitted length */
|
var curlen; /* length of current code */
|
|
var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
|
|
var count = 0; /* repeat count of the current code */
|
var max_count = 7; /* max repeat count */
|
var min_count = 4; /* min repeat count */
|
|
if (nextlen === 0) {
|
max_count = 138;
|
min_count = 3;
|
}
|
tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */
|
|
for (n = 0; n <= max_code; n++) {
|
curlen = nextlen;
|
nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
|
|
if (++count < max_count && curlen === nextlen) {
|
continue;
|
|
} else if (count < min_count) {
|
s.bl_tree[curlen * 2]/*.Freq*/ += count;
|
|
} else if (curlen !== 0) {
|
|
if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
|
s.bl_tree[REP_3_6 * 2]/*.Freq*/++;
|
|
} else if (count <= 10) {
|
s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;
|
|
} else {
|
s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
|
}
|
|
count = 0;
|
prevlen = curlen;
|
|
if (nextlen === 0) {
|
max_count = 138;
|
min_count = 3;
|
|
} else if (curlen === nextlen) {
|
max_count = 6;
|
min_count = 3;
|
|
} else {
|
max_count = 7;
|
min_count = 4;
|
}
|
}
|
}
|
|
|
/* ===========================================================================
|
* Send a literal or distance tree in compressed form, using the codes in
|
* bl_tree.
|
*/
|
function send_tree(s, tree, max_code)
|
// deflate_state *s;
|
// ct_data *tree; /* the tree to be scanned */
|
// int max_code; /* and its largest code of non zero frequency */
|
{
|
var n; /* iterates over all tree elements */
|
var prevlen = -1; /* last emitted length */
|
var curlen; /* length of current code */
|
|
var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
|
|
var count = 0; /* repeat count of the current code */
|
var max_count = 7; /* max repeat count */
|
var min_count = 4; /* min repeat count */
|
|
/* tree[max_code+1].Len = -1; */ /* guard already set */
|
if (nextlen === 0) {
|
max_count = 138;
|
min_count = 3;
|
}
|
|
for (n = 0; n <= max_code; n++) {
|
curlen = nextlen;
|
nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
|
|
if (++count < max_count && curlen === nextlen) {
|
continue;
|
|
} else if (count < min_count) {
|
do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
|
|
} else if (curlen !== 0) {
|
if (curlen !== prevlen) {
|
send_code(s, curlen, s.bl_tree);
|
count--;
|
}
|
//Assert(count >= 3 && count <= 6, " 3_6?");
|
send_code(s, REP_3_6, s.bl_tree);
|
send_bits(s, count - 3, 2);
|
|
} else if (count <= 10) {
|
send_code(s, REPZ_3_10, s.bl_tree);
|
send_bits(s, count - 3, 3);
|
|
} else {
|
send_code(s, REPZ_11_138, s.bl_tree);
|
send_bits(s, count - 11, 7);
|
}
|
|
count = 0;
|
prevlen = curlen;
|
if (nextlen === 0) {
|
max_count = 138;
|
min_count = 3;
|
|
} else if (curlen === nextlen) {
|
max_count = 6;
|
min_count = 3;
|
|
} else {
|
max_count = 7;
|
min_count = 4;
|
}
|
}
|
}
|
|
|
/* ===========================================================================
|
* Construct the Huffman tree for the bit lengths and return the index in
|
* bl_order of the last bit length code to send.
|
*/
|
function build_bl_tree(s) {
|
var max_blindex; /* index of last bit length code of non zero freq */
|
|
/* Determine the bit length frequencies for literal and distance trees */
|
scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
|
scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
|
|
/* Build the bit length tree: */
|
build_tree(s, s.bl_desc);
|
/* opt_len now includes the length of the tree representations, except
|
* the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
|
*/
|
|
/* Determine the number of bit length codes to send. The pkzip format
|
* requires that at least 4 bit length codes be sent. (appnote.txt says
|
* 3 but the actual value used is 4.)
|
*/
|
for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
|
if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
|
break;
|
}
|
}
|
/* Update opt_len to include the bit length tree and counts */
|
s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
|
//Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
|
// s->opt_len, s->static_len));
|
|
return max_blindex;
|
}
|
|
|
/* ===========================================================================
|
* Send the header for a block using dynamic Huffman trees: the counts, the
|
* lengths of the bit length codes, the literal tree and the distance tree.
|
* IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
|
*/
|
function send_all_trees(s, lcodes, dcodes, blcodes)
|
// deflate_state *s;
|
// int lcodes, dcodes, blcodes; /* number of codes for each tree */
|
{
|
var rank; /* index in bl_order */
|
|
//Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
|
//Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
|
// "too many codes");
|
//Tracev((stderr, "\nbl counts: "));
|
send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
|
send_bits(s, dcodes - 1, 5);
|
send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
|
for (rank = 0; rank < blcodes; rank++) {
|
//Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
|
send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
|
}
|
//Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
|
|
send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
|
//Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
|
|
send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
|
//Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
|
}
|
|
|
/* ===========================================================================
|
* Check if the data type is TEXT or BINARY, using the following algorithm:
|
* - TEXT if the two conditions below are satisfied:
|
* a) There are no non-portable control characters belonging to the
|
* "black list" (0..6, 14..25, 28..31).
|
* b) There is at least one printable character belonging to the
|
* "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
|
* - BINARY otherwise.
|
* - The following partially-portable control characters form a
|
* "gray list" that is ignored in this detection algorithm:
|
* (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
|
* IN assertion: the fields Freq of dyn_ltree are set.
|
*/
|
function detect_data_type(s) {
|
/* black_mask is the bit mask of black-listed bytes
|
* set bits 0..6, 14..25, and 28..31
|
* 0xf3ffc07f = binary 11110011111111111100000001111111
|
*/
|
var black_mask = 0xf3ffc07f;
|
var n;
|
|
/* Check for non-textual ("black-listed") bytes. */
|
for (n = 0; n <= 31; n++, black_mask >>>= 1) {
|
if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
|
return Z_BINARY;
|
}
|
}
|
|
/* Check for textual ("white-listed") bytes. */
|
if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
|
s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
|
return Z_TEXT;
|
}
|
for (n = 32; n < LITERALS; n++) {
|
if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
|
return Z_TEXT;
|
}
|
}
|
|
/* There are no "black-listed" or "white-listed" bytes:
|
* this stream either is empty or has tolerated ("gray-listed") bytes only.
|
*/
|
return Z_BINARY;
|
}
|
|
|
var static_init_done = false;
|
|
/* ===========================================================================
|
* Initialize the tree data structures for a new zlib stream.
|
*/
|
function _tr_init(s)
|
{
|
|
if (!static_init_done) {
|
tr_static_init();
|
static_init_done = true;
|
}
|
|
s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
|
s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
|
s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
|
|
s.bi_buf = 0;
|
s.bi_valid = 0;
|
|
/* Initialize the first block of the first file: */
|
init_block(s);
|
}
|
|
|
/* ===========================================================================
|
* Send a stored block
|
*/
|
function _tr_stored_block(s, buf, stored_len, last)
|
//DeflateState *s;
|
//charf *buf; /* input block */
|
//ulg stored_len; /* length of input block */
|
//int last; /* one if this is the last block for a file */
|
{
|
send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */
|
copy_block(s, buf, stored_len, true); /* with header */
|
}
|
|
|
/* ===========================================================================
|
* Send one empty static block to give enough lookahead for inflate.
|
* This takes 10 bits, of which 7 may remain in the bit buffer.
|
*/
|
function _tr_align(s) {
|
send_bits(s, STATIC_TREES << 1, 3);
|
send_code(s, END_BLOCK, static_ltree);
|
bi_flush(s);
|
}
|
|
|
/* ===========================================================================
|
* Determine the best encoding for the current block: dynamic trees, static
|
* trees or store, and output the encoded block to the zip file.
|
*/
|
function _tr_flush_block(s, buf, stored_len, last)
|
//DeflateState *s;
|
//charf *buf; /* input block, or NULL if too old */
|
//ulg stored_len; /* length of input block */
|
//int last; /* one if this is the last block for a file */
|
{
|
var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
|
var max_blindex = 0; /* index of last bit length code of non zero freq */
|
|
/* Build the Huffman trees unless a stored block is forced */
|
if (s.level > 0) {
|
|
/* Check if the file is binary or text */
|
if (s.strm.data_type === Z_UNKNOWN) {
|
s.strm.data_type = detect_data_type(s);
|
}
|
|
/* Construct the literal and distance trees */
|
build_tree(s, s.l_desc);
|
// Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
|
// s->static_len));
|
|
build_tree(s, s.d_desc);
|
// Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
|
// s->static_len));
|
/* At this point, opt_len and static_len are the total bit lengths of
|
* the compressed block data, excluding the tree representations.
|
*/
|
|
/* Build the bit length tree for the above two trees, and get the index
|
* in bl_order of the last bit length code to send.
|
*/
|
max_blindex = build_bl_tree(s);
|
|
/* Determine the best encoding. Compute the block lengths in bytes. */
|
opt_lenb = (s.opt_len + 3 + 7) >>> 3;
|
static_lenb = (s.static_len + 3 + 7) >>> 3;
|
|
// Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
|
// opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
|
// s->last_lit));
|
|
if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
|
|
} else {
|
// Assert(buf != (char*)0, "lost buf");
|
opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
|
}
|
|
if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
|
/* 4: two words for the lengths */
|
|
/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
|
* Otherwise we can't have processed more than WSIZE input bytes since
|
* the last block flush, because compression would have been
|
* successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
|
* transform a block into a stored block.
|
*/
|
_tr_stored_block(s, buf, stored_len, last);
|
|
} else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
|
|
send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
|
compress_block(s, static_ltree, static_dtree);
|
|
} else {
|
send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
|
send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
|
compress_block(s, s.dyn_ltree, s.dyn_dtree);
|
}
|
// Assert (s->compressed_len == s->bits_sent, "bad compressed size");
|
/* The above check is made mod 2^32, for files larger than 512 MB
|
* and uLong implemented on 32 bits.
|
*/
|
init_block(s);
|
|
if (last) {
|
bi_windup(s);
|
}
|
// Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
|
// s->compressed_len-7*last));
|
}
|
|
/* ===========================================================================
|
* Save the match info and tally the frequency counts. Return true if
|
* the current block must be flushed.
|
*/
|
function _tr_tally(s, dist, lc)
|
// deflate_state *s;
|
// unsigned dist; /* distance of matched string */
|
// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
|
{
|
//var out_length, in_length, dcode;
|
|
s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
|
s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
|
|
s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
|
s.last_lit++;
|
|
if (dist === 0) {
|
/* lc is the unmatched char */
|
s.dyn_ltree[lc * 2]/*.Freq*/++;
|
} else {
|
s.matches++;
|
/* Here, lc is the match length - MIN_MATCH */
|
dist--; /* dist = match distance - 1 */
|
//Assert((ush)dist < (ush)MAX_DIST(s) &&
|
// (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
|
// (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
|
|
s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
|
s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
|
}
|
|
// (!) This block is disabled in zlib defaults,
|
// don't enable it for binary compatibility
|
|
//#ifdef TRUNCATE_BLOCK
|
// /* Try to guess if it is profitable to stop the current block here */
|
// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
|
// /* Compute an upper bound for the compressed length */
|
// out_length = s.last_lit*8;
|
// in_length = s.strstart - s.block_start;
|
//
|
// for (dcode = 0; dcode < D_CODES; dcode++) {
|
// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
|
// }
|
// out_length >>>= 3;
|
// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
|
// // s->last_lit, in_length, out_length,
|
// // 100L - out_length*100L/in_length));
|
// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
|
// return true;
|
// }
|
// }
|
//#endif
|
|
return (s.last_lit === s.lit_bufsize - 1);
|
/* We avoid equality with lit_bufsize because of wraparound at 64K
|
* on 16 bit machines and because stored blocks are restricted to
|
* 64K-1 bytes.
|
*/
|
}
|
|
exports._tr_init = _tr_init;
|
exports._tr_stored_block = _tr_stored_block;
|
exports._tr_flush_block = _tr_flush_block;
|
exports._tr_tally = _tr_tally;
|
exports._tr_align = _tr_align;
|
|
|
/***/ }),
|
/* 123 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
|
var zlib_inflate = __webpack_require__(124);
|
var utils = __webpack_require__(11);
|
var strings = __webpack_require__(90);
|
var c = __webpack_require__(92);
|
var msg = __webpack_require__(77);
|
var ZStream = __webpack_require__(91);
|
var GZheader = __webpack_require__(127);
|
|
var toString = Object.prototype.toString;
|
|
/**
|
* class Inflate
|
*
|
* Generic JS-style wrapper for zlib calls. If you don't need
|
* streaming behaviour - use more simple functions: [[inflate]]
|
* and [[inflateRaw]].
|
**/
|
|
/* internal
|
* inflate.chunks -> Array
|
*
|
* Chunks of output data, if [[Inflate#onData]] not overridden.
|
**/
|
|
/**
|
* Inflate.result -> Uint8Array|Array|String
|
*
|
* Uncompressed result, generated by default [[Inflate#onData]]
|
* and [[Inflate#onEnd]] handlers. Filled after you push last chunk
|
* (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
|
* push a chunk with explicit flush (call [[Inflate#push]] with
|
* `Z_SYNC_FLUSH` param).
|
**/
|
|
/**
|
* Inflate.err -> Number
|
*
|
* Error code after inflate finished. 0 (Z_OK) on success.
|
* Should be checked if broken data possible.
|
**/
|
|
/**
|
* Inflate.msg -> String
|
*
|
* Error message, if [[Inflate.err]] != 0
|
**/
|
|
|
/**
|
* new Inflate(options)
|
* - options (Object): zlib inflate options.
|
*
|
* Creates new inflator instance with specified params. Throws exception
|
* on bad params. Supported options:
|
*
|
* - `windowBits`
|
* - `dictionary`
|
*
|
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
|
* for more information on these.
|
*
|
* Additional options, for internal needs:
|
*
|
* - `chunkSize` - size of generated data chunks (16K by default)
|
* - `raw` (Boolean) - do raw inflate
|
* - `to` (String) - if equal to 'string', then result will be converted
|
* from utf8 to utf16 (javascript) string. When string output requested,
|
* chunk length can differ from `chunkSize`, depending on content.
|
*
|
* By default, when no options set, autodetect deflate/gzip data format via
|
* wrapper header.
|
*
|
* ##### Example:
|
*
|
* ```javascript
|
* var pako = require('pako')
|
* , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
|
* , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
|
*
|
* var inflate = new pako.Inflate({ level: 3});
|
*
|
* inflate.push(chunk1, false);
|
* inflate.push(chunk2, true); // true -> last chunk
|
*
|
* if (inflate.err) { throw new Error(inflate.err); }
|
*
|
* console.log(inflate.result);
|
* ```
|
**/
|
function Inflate(options) {
|
if (!(this instanceof Inflate)) return new Inflate(options);
|
|
this.options = utils.assign({
|
chunkSize: 16384,
|
windowBits: 0,
|
to: ''
|
}, options || {});
|
|
var opt = this.options;
|
|
// Force window size for `raw` data, if not set directly,
|
// because we have no header for autodetect.
|
if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
|
opt.windowBits = -opt.windowBits;
|
if (opt.windowBits === 0) { opt.windowBits = -15; }
|
}
|
|
// If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
|
if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
|
!(options && options.windowBits)) {
|
opt.windowBits += 32;
|
}
|
|
// Gzip header has no info about windows size, we can do autodetect only
|
// for deflate. So, if window size not set, force it to max when gzip possible
|
if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
|
// bit 3 (16) -> gzipped data
|
// bit 4 (32) -> autodetect gzip/deflate
|
if ((opt.windowBits & 15) === 0) {
|
opt.windowBits |= 15;
|
}
|
}
|
|
this.err = 0; // error code, if happens (0 = Z_OK)
|
this.msg = ''; // error message
|
this.ended = false; // used to avoid multiple onEnd() calls
|
this.chunks = []; // chunks of compressed data
|
|
this.strm = new ZStream();
|
this.strm.avail_out = 0;
|
|
var status = zlib_inflate.inflateInit2(
|
this.strm,
|
opt.windowBits
|
);
|
|
if (status !== c.Z_OK) {
|
throw new Error(msg[status]);
|
}
|
|
this.header = new GZheader();
|
|
zlib_inflate.inflateGetHeader(this.strm, this.header);
|
|
// Setup dictionary
|
if (opt.dictionary) {
|
// Convert data if needed
|
if (typeof opt.dictionary === 'string') {
|
opt.dictionary = strings.string2buf(opt.dictionary);
|
} else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
|
opt.dictionary = new Uint8Array(opt.dictionary);
|
}
|
if (opt.raw) { //In raw mode we need to set the dictionary early
|
status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
|
if (status !== c.Z_OK) {
|
throw new Error(msg[status]);
|
}
|
}
|
}
|
}
|
|
/**
|
* Inflate#push(data[, mode]) -> Boolean
|
* - data (Uint8Array|Array|ArrayBuffer|String): input data
|
* - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
|
* See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
|
*
|
* Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
|
* new output chunks. Returns `true` on success. The last data block must have
|
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
|
* [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
|
* can use mode Z_SYNC_FLUSH, keeping the decompression context.
|
*
|
* On fail call [[Inflate#onEnd]] with error code and return false.
|
*
|
* We strongly recommend to use `Uint8Array` on input for best speed (output
|
* format is detected automatically). Also, don't skip last param and always
|
* use the same type in your code (boolean or number). That will improve JS speed.
|
*
|
* For regular `Array`-s make sure all elements are [0..255].
|
*
|
* ##### Example
|
*
|
* ```javascript
|
* push(chunk, false); // push one of data chunks
|
* ...
|
* push(chunk, true); // push last chunk
|
* ```
|
**/
|
Inflate.prototype.push = function (data, mode) {
|
var strm = this.strm;
|
var chunkSize = this.options.chunkSize;
|
var dictionary = this.options.dictionary;
|
var status, _mode;
|
var next_out_utf8, tail, utf8str;
|
|
// Flag to properly process Z_BUF_ERROR on testing inflate call
|
// when we check that all output data was flushed.
|
var allowBufError = false;
|
|
if (this.ended) { return false; }
|
_mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
|
|
// Convert data if needed
|
if (typeof data === 'string') {
|
// Only binary strings can be decompressed on practice
|
strm.input = strings.binstring2buf(data);
|
} else if (toString.call(data) === '[object ArrayBuffer]') {
|
strm.input = new Uint8Array(data);
|
} else {
|
strm.input = data;
|
}
|
|
strm.next_in = 0;
|
strm.avail_in = strm.input.length;
|
|
do {
|
if (strm.avail_out === 0) {
|
strm.output = new utils.Buf8(chunkSize);
|
strm.next_out = 0;
|
strm.avail_out = chunkSize;
|
}
|
|
status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
|
|
if (status === c.Z_NEED_DICT && dictionary) {
|
status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
|
}
|
|
if (status === c.Z_BUF_ERROR && allowBufError === true) {
|
status = c.Z_OK;
|
allowBufError = false;
|
}
|
|
if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
|
this.onEnd(status);
|
this.ended = true;
|
return false;
|
}
|
|
if (strm.next_out) {
|
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
|
|
if (this.options.to === 'string') {
|
|
next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
|
|
tail = strm.next_out - next_out_utf8;
|
utf8str = strings.buf2string(strm.output, next_out_utf8);
|
|
// move tail
|
strm.next_out = tail;
|
strm.avail_out = chunkSize - tail;
|
if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
|
|
this.onData(utf8str);
|
|
} else {
|
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
|
}
|
}
|
}
|
|
// When no more input data, we should check that internal inflate buffers
|
// are flushed. The only way to do it when avail_out = 0 - run one more
|
// inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
|
// Here we set flag to process this error properly.
|
//
|
// NOTE. Deflate does not return error in this case and does not needs such
|
// logic.
|
if (strm.avail_in === 0 && strm.avail_out === 0) {
|
allowBufError = true;
|
}
|
|
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
|
|
if (status === c.Z_STREAM_END) {
|
_mode = c.Z_FINISH;
|
}
|
|
// Finalize on the last chunk.
|
if (_mode === c.Z_FINISH) {
|
status = zlib_inflate.inflateEnd(this.strm);
|
this.onEnd(status);
|
this.ended = true;
|
return status === c.Z_OK;
|
}
|
|
// callback interim results if Z_SYNC_FLUSH.
|
if (_mode === c.Z_SYNC_FLUSH) {
|
this.onEnd(c.Z_OK);
|
strm.avail_out = 0;
|
return true;
|
}
|
|
return true;
|
};
|
|
|
/**
|
* Inflate#onData(chunk) -> Void
|
* - chunk (Uint8Array|Array|String): output data. Type of array depends
|
* on js engine support. When string output requested, each chunk
|
* will be string.
|
*
|
* By default, stores data blocks in `chunks[]` property and glue
|
* those in `onEnd`. Override this handler, if you need another behaviour.
|
**/
|
Inflate.prototype.onData = function (chunk) {
|
this.chunks.push(chunk);
|
};
|
|
|
/**
|
* Inflate#onEnd(status) -> Void
|
* - status (Number): inflate status. 0 (Z_OK) on success,
|
* other if not.
|
*
|
* Called either after you tell inflate that the input stream is
|
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
|
* or if an error happened. By default - join collected chunks,
|
* free memory and fill `results` / `err` properties.
|
**/
|
Inflate.prototype.onEnd = function (status) {
|
// On success - join
|
if (status === c.Z_OK) {
|
if (this.options.to === 'string') {
|
// Glue & convert here, until we teach pako to send
|
// utf8 aligned strings to onData
|
this.result = this.chunks.join('');
|
} else {
|
this.result = utils.flattenChunks(this.chunks);
|
}
|
}
|
this.chunks = [];
|
this.err = status;
|
this.msg = this.strm.msg;
|
};
|
|
|
/**
|
* inflate(data[, options]) -> Uint8Array|Array|String
|
* - data (Uint8Array|Array|String): input data to decompress.
|
* - options (Object): zlib inflate options.
|
*
|
* Decompress `data` with inflate/ungzip and `options`. Autodetect
|
* format via wrapper header by default. That's why we don't provide
|
* separate `ungzip` method.
|
*
|
* Supported options are:
|
*
|
* - windowBits
|
*
|
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
|
* for more information.
|
*
|
* Sugar (options):
|
*
|
* - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
|
* negative windowBits implicitly.
|
* - `to` (String) - if equal to 'string', then result will be converted
|
* from utf8 to utf16 (javascript) string. When string output requested,
|
* chunk length can differ from `chunkSize`, depending on content.
|
*
|
*
|
* ##### Example:
|
*
|
* ```javascript
|
* var pako = require('pako')
|
* , input = pako.deflate([1,2,3,4,5,6,7,8,9])
|
* , output;
|
*
|
* try {
|
* output = pako.inflate(input);
|
* } catch (err)
|
* console.log(err);
|
* }
|
* ```
|
**/
|
function inflate(input, options) {
|
var inflator = new Inflate(options);
|
|
inflator.push(input, true);
|
|
// That will never happens, if you don't cheat with options :)
|
if (inflator.err) { throw inflator.msg || msg[inflator.err]; }
|
|
return inflator.result;
|
}
|
|
|
/**
|
* inflateRaw(data[, options]) -> Uint8Array|Array|String
|
* - data (Uint8Array|Array|String): input data to decompress.
|
* - options (Object): zlib inflate options.
|
*
|
* The same as [[inflate]], but creates raw data, without wrapper
|
* (header and adler32 crc).
|
**/
|
function inflateRaw(input, options) {
|
options = options || {};
|
options.raw = true;
|
return inflate(input, options);
|
}
|
|
|
/**
|
* ungzip(data[, options]) -> Uint8Array|Array|String
|
* - data (Uint8Array|Array|String): input data to decompress.
|
* - options (Object): zlib inflate options.
|
*
|
* Just shortcut to [[inflate]], because it autodetects format
|
* by header.content. Done for convenience.
|
**/
|
|
|
exports.Inflate = Inflate;
|
exports.inflate = inflate;
|
exports.inflateRaw = inflateRaw;
|
exports.ungzip = inflate;
|
|
|
/***/ }),
|
/* 124 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
var utils = __webpack_require__(11);
|
var adler32 = __webpack_require__(88);
|
var crc32 = __webpack_require__(89);
|
var inflate_fast = __webpack_require__(125);
|
var inflate_table = __webpack_require__(126);
|
|
var CODES = 0;
|
var LENS = 1;
|
var DISTS = 2;
|
|
/* Public constants ==========================================================*/
|
/* ===========================================================================*/
|
|
|
/* Allowed flush values; see deflate() and inflate() below for details */
|
//var Z_NO_FLUSH = 0;
|
//var Z_PARTIAL_FLUSH = 1;
|
//var Z_SYNC_FLUSH = 2;
|
//var Z_FULL_FLUSH = 3;
|
var Z_FINISH = 4;
|
var Z_BLOCK = 5;
|
var Z_TREES = 6;
|
|
|
/* Return codes for the compression/decompression functions. Negative values
|
* are errors, positive values are used for special but normal events.
|
*/
|
var Z_OK = 0;
|
var Z_STREAM_END = 1;
|
var Z_NEED_DICT = 2;
|
//var Z_ERRNO = -1;
|
var Z_STREAM_ERROR = -2;
|
var Z_DATA_ERROR = -3;
|
var Z_MEM_ERROR = -4;
|
var Z_BUF_ERROR = -5;
|
//var Z_VERSION_ERROR = -6;
|
|
/* The deflate compression method */
|
var Z_DEFLATED = 8;
|
|
|
/* STATES ====================================================================*/
|
/* ===========================================================================*/
|
|
|
var HEAD = 1; /* i: waiting for magic header */
|
var FLAGS = 2; /* i: waiting for method and flags (gzip) */
|
var TIME = 3; /* i: waiting for modification time (gzip) */
|
var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
|
var EXLEN = 5; /* i: waiting for extra length (gzip) */
|
var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
|
var NAME = 7; /* i: waiting for end of file name (gzip) */
|
var COMMENT = 8; /* i: waiting for end of comment (gzip) */
|
var HCRC = 9; /* i: waiting for header crc (gzip) */
|
var DICTID = 10; /* i: waiting for dictionary check value */
|
var DICT = 11; /* waiting for inflateSetDictionary() call */
|
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
|
var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
|
var STORED = 14; /* i: waiting for stored size (length and complement) */
|
var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
|
var COPY = 16; /* i/o: waiting for input or output to copy stored block */
|
var TABLE = 17; /* i: waiting for dynamic block table lengths */
|
var LENLENS = 18; /* i: waiting for code length code lengths */
|
var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
|
var LEN_ = 20; /* i: same as LEN below, but only first time in */
|
var LEN = 21; /* i: waiting for length/lit/eob code */
|
var LENEXT = 22; /* i: waiting for length extra bits */
|
var DIST = 23; /* i: waiting for distance code */
|
var DISTEXT = 24; /* i: waiting for distance extra bits */
|
var MATCH = 25; /* o: waiting for output space to copy string */
|
var LIT = 26; /* o: waiting for output space to write literal */
|
var CHECK = 27; /* i: waiting for 32-bit check value */
|
var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
|
var DONE = 29; /* finished check, done -- remain here until reset */
|
var BAD = 30; /* got a data error -- remain here until reset */
|
var MEM = 31; /* got an inflate() memory error -- remain here until reset */
|
var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
|
|
/* ===========================================================================*/
|
|
|
|
var ENOUGH_LENS = 852;
|
var ENOUGH_DISTS = 592;
|
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
|
|
var MAX_WBITS = 15;
|
/* 32K LZ77 window */
|
var DEF_WBITS = MAX_WBITS;
|
|
|
function zswap32(q) {
|
return (((q >>> 24) & 0xff) +
|
((q >>> 8) & 0xff00) +
|
((q & 0xff00) << 8) +
|
((q & 0xff) << 24));
|
}
|
|
|
function InflateState() {
|
this.mode = 0; /* current inflate mode */
|
this.last = false; /* true if processing last block */
|
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
|
this.havedict = false; /* true if dictionary provided */
|
this.flags = 0; /* gzip header method and flags (0 if zlib) */
|
this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
|
this.check = 0; /* protected copy of check value */
|
this.total = 0; /* protected copy of output count */
|
// TODO: may be {}
|
this.head = null; /* where to save gzip header information */
|
|
/* sliding window */
|
this.wbits = 0; /* log base 2 of requested window size */
|
this.wsize = 0; /* window size or zero if not using window */
|
this.whave = 0; /* valid bytes in the window */
|
this.wnext = 0; /* window write index */
|
this.window = null; /* allocated sliding window, if needed */
|
|
/* bit accumulator */
|
this.hold = 0; /* input bit accumulator */
|
this.bits = 0; /* number of bits in "in" */
|
|
/* for string and stored block copying */
|
this.length = 0; /* literal or length of data to copy */
|
this.offset = 0; /* distance back to copy string from */
|
|
/* for table and code decoding */
|
this.extra = 0; /* extra bits needed */
|
|
/* fixed and dynamic code tables */
|
this.lencode = null; /* starting table for length/literal codes */
|
this.distcode = null; /* starting table for distance codes */
|
this.lenbits = 0; /* index bits for lencode */
|
this.distbits = 0; /* index bits for distcode */
|
|
/* dynamic table building */
|
this.ncode = 0; /* number of code length code lengths */
|
this.nlen = 0; /* number of length code lengths */
|
this.ndist = 0; /* number of distance code lengths */
|
this.have = 0; /* number of code lengths in lens[] */
|
this.next = null; /* next available space in codes[] */
|
|
this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
|
this.work = new utils.Buf16(288); /* work area for code table building */
|
|
/*
|
because we don't have pointers in js, we use lencode and distcode directly
|
as buffers so we don't need codes
|
*/
|
//this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
|
this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
|
this.distdyn = null; /* dynamic table for distance codes (JS specific) */
|
this.sane = 0; /* if false, allow invalid distance too far */
|
this.back = 0; /* bits back of last unprocessed length/lit */
|
this.was = 0; /* initial length of match */
|
}
|
|
function inflateResetKeep(strm) {
|
var state;
|
|
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
state = strm.state;
|
strm.total_in = strm.total_out = state.total = 0;
|
strm.msg = ''; /*Z_NULL*/
|
if (state.wrap) { /* to support ill-conceived Java test suite */
|
strm.adler = state.wrap & 1;
|
}
|
state.mode = HEAD;
|
state.last = 0;
|
state.havedict = 0;
|
state.dmax = 32768;
|
state.head = null/*Z_NULL*/;
|
state.hold = 0;
|
state.bits = 0;
|
//state.lencode = state.distcode = state.next = state.codes;
|
state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
|
state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
|
|
state.sane = 1;
|
state.back = -1;
|
//Tracev((stderr, "inflate: reset\n"));
|
return Z_OK;
|
}
|
|
function inflateReset(strm) {
|
var state;
|
|
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
state = strm.state;
|
state.wsize = 0;
|
state.whave = 0;
|
state.wnext = 0;
|
return inflateResetKeep(strm);
|
|
}
|
|
function inflateReset2(strm, windowBits) {
|
var wrap;
|
var state;
|
|
/* get the state */
|
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
state = strm.state;
|
|
/* extract wrap request from windowBits parameter */
|
if (windowBits < 0) {
|
wrap = 0;
|
windowBits = -windowBits;
|
}
|
else {
|
wrap = (windowBits >> 4) + 1;
|
if (windowBits < 48) {
|
windowBits &= 15;
|
}
|
}
|
|
/* set number of window bits, free window if different */
|
if (windowBits && (windowBits < 8 || windowBits > 15)) {
|
return Z_STREAM_ERROR;
|
}
|
if (state.window !== null && state.wbits !== windowBits) {
|
state.window = null;
|
}
|
|
/* update state and reset the rest of it */
|
state.wrap = wrap;
|
state.wbits = windowBits;
|
return inflateReset(strm);
|
}
|
|
function inflateInit2(strm, windowBits) {
|
var ret;
|
var state;
|
|
if (!strm) { return Z_STREAM_ERROR; }
|
//strm.msg = Z_NULL; /* in case we return an error */
|
|
state = new InflateState();
|
|
//if (state === Z_NULL) return Z_MEM_ERROR;
|
//Tracev((stderr, "inflate: allocated\n"));
|
strm.state = state;
|
state.window = null/*Z_NULL*/;
|
ret = inflateReset2(strm, windowBits);
|
if (ret !== Z_OK) {
|
strm.state = null/*Z_NULL*/;
|
}
|
return ret;
|
}
|
|
function inflateInit(strm) {
|
return inflateInit2(strm, DEF_WBITS);
|
}
|
|
|
/*
|
Return state with length and distance decoding tables and index sizes set to
|
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
If BUILDFIXED is defined, then instead this routine builds the tables the
|
first time it's called, and returns those tables the first time and
|
thereafter. This reduces the size of the code by about 2K bytes, in
|
exchange for a little execution time. However, BUILDFIXED should not be
|
used for threaded applications, since the rewriting of the tables and virgin
|
may not be thread-safe.
|
*/
|
var virgin = true;
|
|
var lenfix, distfix; // We have no pointers in JS, so keep tables separate
|
|
function fixedtables(state) {
|
/* build fixed huffman tables if first call (may not be thread safe) */
|
if (virgin) {
|
var sym;
|
|
lenfix = new utils.Buf32(512);
|
distfix = new utils.Buf32(32);
|
|
/* literal/length table */
|
sym = 0;
|
while (sym < 144) { state.lens[sym++] = 8; }
|
while (sym < 256) { state.lens[sym++] = 9; }
|
while (sym < 280) { state.lens[sym++] = 7; }
|
while (sym < 288) { state.lens[sym++] = 8; }
|
|
inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
|
|
/* distance table */
|
sym = 0;
|
while (sym < 32) { state.lens[sym++] = 5; }
|
|
inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
|
|
/* do this just once */
|
virgin = false;
|
}
|
|
state.lencode = lenfix;
|
state.lenbits = 9;
|
state.distcode = distfix;
|
state.distbits = 5;
|
}
|
|
|
/*
|
Update the window with the last wsize (normally 32K) bytes written before
|
returning. If window does not exist yet, create it. This is only called
|
when a window is already in use, or when output has been written during this
|
inflate call, but the end of the deflate stream has not been reached yet.
|
It is also called to create a window for dictionary data when a dictionary
|
is loaded.
|
|
Providing output buffers larger than 32K to inflate() should provide a speed
|
advantage, since only the last 32K of output is copied to the sliding window
|
upon return from inflate(), and since all distances after the first 32K of
|
output will fall in the output data, making match copies simpler and faster.
|
The advantage may be dependent on the size of the processor's data caches.
|
*/
|
function updatewindow(strm, src, end, copy) {
|
var dist;
|
var state = strm.state;
|
|
/* if it hasn't been done already, allocate space for the window */
|
if (state.window === null) {
|
state.wsize = 1 << state.wbits;
|
state.wnext = 0;
|
state.whave = 0;
|
|
state.window = new utils.Buf8(state.wsize);
|
}
|
|
/* copy state->wsize or less output bytes into the circular window */
|
if (copy >= state.wsize) {
|
utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
|
state.wnext = 0;
|
state.whave = state.wsize;
|
}
|
else {
|
dist = state.wsize - state.wnext;
|
if (dist > copy) {
|
dist = copy;
|
}
|
//zmemcpy(state->window + state->wnext, end - copy, dist);
|
utils.arraySet(state.window, src, end - copy, dist, state.wnext);
|
copy -= dist;
|
if (copy) {
|
//zmemcpy(state->window, end - copy, copy);
|
utils.arraySet(state.window, src, end - copy, copy, 0);
|
state.wnext = copy;
|
state.whave = state.wsize;
|
}
|
else {
|
state.wnext += dist;
|
if (state.wnext === state.wsize) { state.wnext = 0; }
|
if (state.whave < state.wsize) { state.whave += dist; }
|
}
|
}
|
return 0;
|
}
|
|
function inflate(strm, flush) {
|
var state;
|
var input, output; // input/output buffers
|
var next; /* next input INDEX */
|
var put; /* next output INDEX */
|
var have, left; /* available input and output */
|
var hold; /* bit buffer */
|
var bits; /* bits in bit buffer */
|
var _in, _out; /* save starting available input and output */
|
var copy; /* number of stored or match bytes to copy */
|
var from; /* where to copy match bytes from */
|
var from_source;
|
var here = 0; /* current decoding table entry */
|
var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
|
//var last; /* parent table entry */
|
var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
|
var len; /* length to copy for repeats, bits to drop */
|
var ret; /* return code */
|
var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
|
var opts;
|
|
var n; // temporary var for NEED_BITS
|
|
var order = /* permutation of code lengths */
|
[ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
|
|
|
if (!strm || !strm.state || !strm.output ||
|
(!strm.input && strm.avail_in !== 0)) {
|
return Z_STREAM_ERROR;
|
}
|
|
state = strm.state;
|
if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
|
|
|
//--- LOAD() ---
|
put = strm.next_out;
|
output = strm.output;
|
left = strm.avail_out;
|
next = strm.next_in;
|
input = strm.input;
|
have = strm.avail_in;
|
hold = state.hold;
|
bits = state.bits;
|
//---
|
|
_in = have;
|
_out = left;
|
ret = Z_OK;
|
|
inf_leave: // goto emulation
|
for (;;) {
|
switch (state.mode) {
|
case HEAD:
|
if (state.wrap === 0) {
|
state.mode = TYPEDO;
|
break;
|
}
|
//=== NEEDBITS(16);
|
while (bits < 16) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
|
state.check = 0/*crc32(0L, Z_NULL, 0)*/;
|
//=== CRC2(state.check, hold);
|
hbuf[0] = hold & 0xff;
|
hbuf[1] = (hold >>> 8) & 0xff;
|
state.check = crc32(state.check, hbuf, 2, 0);
|
//===//
|
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
state.mode = FLAGS;
|
break;
|
}
|
state.flags = 0; /* expect zlib header */
|
if (state.head) {
|
state.head.done = false;
|
}
|
if (!(state.wrap & 1) || /* check if zlib header allowed */
|
(((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
|
strm.msg = 'incorrect header check';
|
state.mode = BAD;
|
break;
|
}
|
if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
|
strm.msg = 'unknown compression method';
|
state.mode = BAD;
|
break;
|
}
|
//--- DROPBITS(4) ---//
|
hold >>>= 4;
|
bits -= 4;
|
//---//
|
len = (hold & 0x0f)/*BITS(4)*/ + 8;
|
if (state.wbits === 0) {
|
state.wbits = len;
|
}
|
else if (len > state.wbits) {
|
strm.msg = 'invalid window size';
|
state.mode = BAD;
|
break;
|
}
|
state.dmax = 1 << len;
|
//Tracev((stderr, "inflate: zlib header ok\n"));
|
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
|
state.mode = hold & 0x200 ? DICTID : TYPE;
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
break;
|
case FLAGS:
|
//=== NEEDBITS(16); */
|
while (bits < 16) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
state.flags = hold;
|
if ((state.flags & 0xff) !== Z_DEFLATED) {
|
strm.msg = 'unknown compression method';
|
state.mode = BAD;
|
break;
|
}
|
if (state.flags & 0xe000) {
|
strm.msg = 'unknown header flags set';
|
state.mode = BAD;
|
break;
|
}
|
if (state.head) {
|
state.head.text = ((hold >> 8) & 1);
|
}
|
if (state.flags & 0x0200) {
|
//=== CRC2(state.check, hold);
|
hbuf[0] = hold & 0xff;
|
hbuf[1] = (hold >>> 8) & 0xff;
|
state.check = crc32(state.check, hbuf, 2, 0);
|
//===//
|
}
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
state.mode = TIME;
|
/* falls through */
|
case TIME:
|
//=== NEEDBITS(32); */
|
while (bits < 32) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
if (state.head) {
|
state.head.time = hold;
|
}
|
if (state.flags & 0x0200) {
|
//=== CRC4(state.check, hold)
|
hbuf[0] = hold & 0xff;
|
hbuf[1] = (hold >>> 8) & 0xff;
|
hbuf[2] = (hold >>> 16) & 0xff;
|
hbuf[3] = (hold >>> 24) & 0xff;
|
state.check = crc32(state.check, hbuf, 4, 0);
|
//===
|
}
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
state.mode = OS;
|
/* falls through */
|
case OS:
|
//=== NEEDBITS(16); */
|
while (bits < 16) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
if (state.head) {
|
state.head.xflags = (hold & 0xff);
|
state.head.os = (hold >> 8);
|
}
|
if (state.flags & 0x0200) {
|
//=== CRC2(state.check, hold);
|
hbuf[0] = hold & 0xff;
|
hbuf[1] = (hold >>> 8) & 0xff;
|
state.check = crc32(state.check, hbuf, 2, 0);
|
//===//
|
}
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
state.mode = EXLEN;
|
/* falls through */
|
case EXLEN:
|
if (state.flags & 0x0400) {
|
//=== NEEDBITS(16); */
|
while (bits < 16) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
state.length = hold;
|
if (state.head) {
|
state.head.extra_len = hold;
|
}
|
if (state.flags & 0x0200) {
|
//=== CRC2(state.check, hold);
|
hbuf[0] = hold & 0xff;
|
hbuf[1] = (hold >>> 8) & 0xff;
|
state.check = crc32(state.check, hbuf, 2, 0);
|
//===//
|
}
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
}
|
else if (state.head) {
|
state.head.extra = null/*Z_NULL*/;
|
}
|
state.mode = EXTRA;
|
/* falls through */
|
case EXTRA:
|
if (state.flags & 0x0400) {
|
copy = state.length;
|
if (copy > have) { copy = have; }
|
if (copy) {
|
if (state.head) {
|
len = state.head.extra_len - state.length;
|
if (!state.head.extra) {
|
// Use untyped array for more convenient processing later
|
state.head.extra = new Array(state.head.extra_len);
|
}
|
utils.arraySet(
|
state.head.extra,
|
input,
|
next,
|
// extra field is limited to 65536 bytes
|
// - no need for additional size check
|
copy,
|
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
|
len
|
);
|
//zmemcpy(state.head.extra + len, next,
|
// len + copy > state.head.extra_max ?
|
// state.head.extra_max - len : copy);
|
}
|
if (state.flags & 0x0200) {
|
state.check = crc32(state.check, input, copy, next);
|
}
|
have -= copy;
|
next += copy;
|
state.length -= copy;
|
}
|
if (state.length) { break inf_leave; }
|
}
|
state.length = 0;
|
state.mode = NAME;
|
/* falls through */
|
case NAME:
|
if (state.flags & 0x0800) {
|
if (have === 0) { break inf_leave; }
|
copy = 0;
|
do {
|
// TODO: 2 or 1 bytes?
|
len = input[next + copy++];
|
/* use constant limit because in js we should not preallocate memory */
|
if (state.head && len &&
|
(state.length < 65536 /*state.head.name_max*/)) {
|
state.head.name += String.fromCharCode(len);
|
}
|
} while (len && copy < have);
|
|
if (state.flags & 0x0200) {
|
state.check = crc32(state.check, input, copy, next);
|
}
|
have -= copy;
|
next += copy;
|
if (len) { break inf_leave; }
|
}
|
else if (state.head) {
|
state.head.name = null;
|
}
|
state.length = 0;
|
state.mode = COMMENT;
|
/* falls through */
|
case COMMENT:
|
if (state.flags & 0x1000) {
|
if (have === 0) { break inf_leave; }
|
copy = 0;
|
do {
|
len = input[next + copy++];
|
/* use constant limit because in js we should not preallocate memory */
|
if (state.head && len &&
|
(state.length < 65536 /*state.head.comm_max*/)) {
|
state.head.comment += String.fromCharCode(len);
|
}
|
} while (len && copy < have);
|
if (state.flags & 0x0200) {
|
state.check = crc32(state.check, input, copy, next);
|
}
|
have -= copy;
|
next += copy;
|
if (len) { break inf_leave; }
|
}
|
else if (state.head) {
|
state.head.comment = null;
|
}
|
state.mode = HCRC;
|
/* falls through */
|
case HCRC:
|
if (state.flags & 0x0200) {
|
//=== NEEDBITS(16); */
|
while (bits < 16) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
if (hold !== (state.check & 0xffff)) {
|
strm.msg = 'header crc mismatch';
|
state.mode = BAD;
|
break;
|
}
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
}
|
if (state.head) {
|
state.head.hcrc = ((state.flags >> 9) & 1);
|
state.head.done = true;
|
}
|
strm.adler = state.check = 0;
|
state.mode = TYPE;
|
break;
|
case DICTID:
|
//=== NEEDBITS(32); */
|
while (bits < 32) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
strm.adler = state.check = zswap32(hold);
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
state.mode = DICT;
|
/* falls through */
|
case DICT:
|
if (state.havedict === 0) {
|
//--- RESTORE() ---
|
strm.next_out = put;
|
strm.avail_out = left;
|
strm.next_in = next;
|
strm.avail_in = have;
|
state.hold = hold;
|
state.bits = bits;
|
//---
|
return Z_NEED_DICT;
|
}
|
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
|
state.mode = TYPE;
|
/* falls through */
|
case TYPE:
|
if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
|
/* falls through */
|
case TYPEDO:
|
if (state.last) {
|
//--- BYTEBITS() ---//
|
hold >>>= bits & 7;
|
bits -= bits & 7;
|
//---//
|
state.mode = CHECK;
|
break;
|
}
|
//=== NEEDBITS(3); */
|
while (bits < 3) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
state.last = (hold & 0x01)/*BITS(1)*/;
|
//--- DROPBITS(1) ---//
|
hold >>>= 1;
|
bits -= 1;
|
//---//
|
|
switch ((hold & 0x03)/*BITS(2)*/) {
|
case 0: /* stored block */
|
//Tracev((stderr, "inflate: stored block%s\n",
|
// state.last ? " (last)" : ""));
|
state.mode = STORED;
|
break;
|
case 1: /* fixed block */
|
fixedtables(state);
|
//Tracev((stderr, "inflate: fixed codes block%s\n",
|
// state.last ? " (last)" : ""));
|
state.mode = LEN_; /* decode codes */
|
if (flush === Z_TREES) {
|
//--- DROPBITS(2) ---//
|
hold >>>= 2;
|
bits -= 2;
|
//---//
|
break inf_leave;
|
}
|
break;
|
case 2: /* dynamic block */
|
//Tracev((stderr, "inflate: dynamic codes block%s\n",
|
// state.last ? " (last)" : ""));
|
state.mode = TABLE;
|
break;
|
case 3:
|
strm.msg = 'invalid block type';
|
state.mode = BAD;
|
}
|
//--- DROPBITS(2) ---//
|
hold >>>= 2;
|
bits -= 2;
|
//---//
|
break;
|
case STORED:
|
//--- BYTEBITS() ---// /* go to byte boundary */
|
hold >>>= bits & 7;
|
bits -= bits & 7;
|
//---//
|
//=== NEEDBITS(32); */
|
while (bits < 32) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
|
strm.msg = 'invalid stored block lengths';
|
state.mode = BAD;
|
break;
|
}
|
state.length = hold & 0xffff;
|
//Tracev((stderr, "inflate: stored length %u\n",
|
// state.length));
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
state.mode = COPY_;
|
if (flush === Z_TREES) { break inf_leave; }
|
/* falls through */
|
case COPY_:
|
state.mode = COPY;
|
/* falls through */
|
case COPY:
|
copy = state.length;
|
if (copy) {
|
if (copy > have) { copy = have; }
|
if (copy > left) { copy = left; }
|
if (copy === 0) { break inf_leave; }
|
//--- zmemcpy(put, next, copy); ---
|
utils.arraySet(output, input, next, copy, put);
|
//---//
|
have -= copy;
|
next += copy;
|
left -= copy;
|
put += copy;
|
state.length -= copy;
|
break;
|
}
|
//Tracev((stderr, "inflate: stored end\n"));
|
state.mode = TYPE;
|
break;
|
case TABLE:
|
//=== NEEDBITS(14); */
|
while (bits < 14) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
|
//--- DROPBITS(5) ---//
|
hold >>>= 5;
|
bits -= 5;
|
//---//
|
state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
|
//--- DROPBITS(5) ---//
|
hold >>>= 5;
|
bits -= 5;
|
//---//
|
state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
|
//--- DROPBITS(4) ---//
|
hold >>>= 4;
|
bits -= 4;
|
//---//
|
//#ifndef PKZIP_BUG_WORKAROUND
|
if (state.nlen > 286 || state.ndist > 30) {
|
strm.msg = 'too many length or distance symbols';
|
state.mode = BAD;
|
break;
|
}
|
//#endif
|
//Tracev((stderr, "inflate: table sizes ok\n"));
|
state.have = 0;
|
state.mode = LENLENS;
|
/* falls through */
|
case LENLENS:
|
while (state.have < state.ncode) {
|
//=== NEEDBITS(3);
|
while (bits < 3) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
|
//--- DROPBITS(3) ---//
|
hold >>>= 3;
|
bits -= 3;
|
//---//
|
}
|
while (state.have < 19) {
|
state.lens[order[state.have++]] = 0;
|
}
|
// We have separate tables & no pointers. 2 commented lines below not needed.
|
//state.next = state.codes;
|
//state.lencode = state.next;
|
// Switch to use dynamic table
|
state.lencode = state.lendyn;
|
state.lenbits = 7;
|
|
opts = { bits: state.lenbits };
|
ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
|
state.lenbits = opts.bits;
|
|
if (ret) {
|
strm.msg = 'invalid code lengths set';
|
state.mode = BAD;
|
break;
|
}
|
//Tracev((stderr, "inflate: code lengths ok\n"));
|
state.have = 0;
|
state.mode = CODELENS;
|
/* falls through */
|
case CODELENS:
|
while (state.have < state.nlen + state.ndist) {
|
for (;;) {
|
here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
|
here_bits = here >>> 24;
|
here_op = (here >>> 16) & 0xff;
|
here_val = here & 0xffff;
|
|
if ((here_bits) <= bits) { break; }
|
//--- PULLBYTE() ---//
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
//---//
|
}
|
if (here_val < 16) {
|
//--- DROPBITS(here.bits) ---//
|
hold >>>= here_bits;
|
bits -= here_bits;
|
//---//
|
state.lens[state.have++] = here_val;
|
}
|
else {
|
if (here_val === 16) {
|
//=== NEEDBITS(here.bits + 2);
|
n = here_bits + 2;
|
while (bits < n) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
//--- DROPBITS(here.bits) ---//
|
hold >>>= here_bits;
|
bits -= here_bits;
|
//---//
|
if (state.have === 0) {
|
strm.msg = 'invalid bit length repeat';
|
state.mode = BAD;
|
break;
|
}
|
len = state.lens[state.have - 1];
|
copy = 3 + (hold & 0x03);//BITS(2);
|
//--- DROPBITS(2) ---//
|
hold >>>= 2;
|
bits -= 2;
|
//---//
|
}
|
else if (here_val === 17) {
|
//=== NEEDBITS(here.bits + 3);
|
n = here_bits + 3;
|
while (bits < n) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
//--- DROPBITS(here.bits) ---//
|
hold >>>= here_bits;
|
bits -= here_bits;
|
//---//
|
len = 0;
|
copy = 3 + (hold & 0x07);//BITS(3);
|
//--- DROPBITS(3) ---//
|
hold >>>= 3;
|
bits -= 3;
|
//---//
|
}
|
else {
|
//=== NEEDBITS(here.bits + 7);
|
n = here_bits + 7;
|
while (bits < n) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
//--- DROPBITS(here.bits) ---//
|
hold >>>= here_bits;
|
bits -= here_bits;
|
//---//
|
len = 0;
|
copy = 11 + (hold & 0x7f);//BITS(7);
|
//--- DROPBITS(7) ---//
|
hold >>>= 7;
|
bits -= 7;
|
//---//
|
}
|
if (state.have + copy > state.nlen + state.ndist) {
|
strm.msg = 'invalid bit length repeat';
|
state.mode = BAD;
|
break;
|
}
|
while (copy--) {
|
state.lens[state.have++] = len;
|
}
|
}
|
}
|
|
/* handle error breaks in while */
|
if (state.mode === BAD) { break; }
|
|
/* check for end-of-block code (better have one) */
|
if (state.lens[256] === 0) {
|
strm.msg = 'invalid code -- missing end-of-block';
|
state.mode = BAD;
|
break;
|
}
|
|
/* build code tables -- note: do not change the lenbits or distbits
|
values here (9 and 6) without reading the comments in inftrees.h
|
concerning the ENOUGH constants, which depend on those values */
|
state.lenbits = 9;
|
|
opts = { bits: state.lenbits };
|
ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
|
// We have separate tables & no pointers. 2 commented lines below not needed.
|
// state.next_index = opts.table_index;
|
state.lenbits = opts.bits;
|
// state.lencode = state.next;
|
|
if (ret) {
|
strm.msg = 'invalid literal/lengths set';
|
state.mode = BAD;
|
break;
|
}
|
|
state.distbits = 6;
|
//state.distcode.copy(state.codes);
|
// Switch to use dynamic table
|
state.distcode = state.distdyn;
|
opts = { bits: state.distbits };
|
ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
|
// We have separate tables & no pointers. 2 commented lines below not needed.
|
// state.next_index = opts.table_index;
|
state.distbits = opts.bits;
|
// state.distcode = state.next;
|
|
if (ret) {
|
strm.msg = 'invalid distances set';
|
state.mode = BAD;
|
break;
|
}
|
//Tracev((stderr, 'inflate: codes ok\n'));
|
state.mode = LEN_;
|
if (flush === Z_TREES) { break inf_leave; }
|
/* falls through */
|
case LEN_:
|
state.mode = LEN;
|
/* falls through */
|
case LEN:
|
if (have >= 6 && left >= 258) {
|
//--- RESTORE() ---
|
strm.next_out = put;
|
strm.avail_out = left;
|
strm.next_in = next;
|
strm.avail_in = have;
|
state.hold = hold;
|
state.bits = bits;
|
//---
|
inflate_fast(strm, _out);
|
//--- LOAD() ---
|
put = strm.next_out;
|
output = strm.output;
|
left = strm.avail_out;
|
next = strm.next_in;
|
input = strm.input;
|
have = strm.avail_in;
|
hold = state.hold;
|
bits = state.bits;
|
//---
|
|
if (state.mode === TYPE) {
|
state.back = -1;
|
}
|
break;
|
}
|
state.back = 0;
|
for (;;) {
|
here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
|
here_bits = here >>> 24;
|
here_op = (here >>> 16) & 0xff;
|
here_val = here & 0xffff;
|
|
if (here_bits <= bits) { break; }
|
//--- PULLBYTE() ---//
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
//---//
|
}
|
if (here_op && (here_op & 0xf0) === 0) {
|
last_bits = here_bits;
|
last_op = here_op;
|
last_val = here_val;
|
for (;;) {
|
here = state.lencode[last_val +
|
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
|
here_bits = here >>> 24;
|
here_op = (here >>> 16) & 0xff;
|
here_val = here & 0xffff;
|
|
if ((last_bits + here_bits) <= bits) { break; }
|
//--- PULLBYTE() ---//
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
//---//
|
}
|
//--- DROPBITS(last.bits) ---//
|
hold >>>= last_bits;
|
bits -= last_bits;
|
//---//
|
state.back += last_bits;
|
}
|
//--- DROPBITS(here.bits) ---//
|
hold >>>= here_bits;
|
bits -= here_bits;
|
//---//
|
state.back += here_bits;
|
state.length = here_val;
|
if (here_op === 0) {
|
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
|
// "inflate: literal '%c'\n" :
|
// "inflate: literal 0x%02x\n", here.val));
|
state.mode = LIT;
|
break;
|
}
|
if (here_op & 32) {
|
//Tracevv((stderr, "inflate: end of block\n"));
|
state.back = -1;
|
state.mode = TYPE;
|
break;
|
}
|
if (here_op & 64) {
|
strm.msg = 'invalid literal/length code';
|
state.mode = BAD;
|
break;
|
}
|
state.extra = here_op & 15;
|
state.mode = LENEXT;
|
/* falls through */
|
case LENEXT:
|
if (state.extra) {
|
//=== NEEDBITS(state.extra);
|
n = state.extra;
|
while (bits < n) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
|
//--- DROPBITS(state.extra) ---//
|
hold >>>= state.extra;
|
bits -= state.extra;
|
//---//
|
state.back += state.extra;
|
}
|
//Tracevv((stderr, "inflate: length %u\n", state.length));
|
state.was = state.length;
|
state.mode = DIST;
|
/* falls through */
|
case DIST:
|
for (;;) {
|
here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
|
here_bits = here >>> 24;
|
here_op = (here >>> 16) & 0xff;
|
here_val = here & 0xffff;
|
|
if ((here_bits) <= bits) { break; }
|
//--- PULLBYTE() ---//
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
//---//
|
}
|
if ((here_op & 0xf0) === 0) {
|
last_bits = here_bits;
|
last_op = here_op;
|
last_val = here_val;
|
for (;;) {
|
here = state.distcode[last_val +
|
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
|
here_bits = here >>> 24;
|
here_op = (here >>> 16) & 0xff;
|
here_val = here & 0xffff;
|
|
if ((last_bits + here_bits) <= bits) { break; }
|
//--- PULLBYTE() ---//
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
//---//
|
}
|
//--- DROPBITS(last.bits) ---//
|
hold >>>= last_bits;
|
bits -= last_bits;
|
//---//
|
state.back += last_bits;
|
}
|
//--- DROPBITS(here.bits) ---//
|
hold >>>= here_bits;
|
bits -= here_bits;
|
//---//
|
state.back += here_bits;
|
if (here_op & 64) {
|
strm.msg = 'invalid distance code';
|
state.mode = BAD;
|
break;
|
}
|
state.offset = here_val;
|
state.extra = (here_op) & 15;
|
state.mode = DISTEXT;
|
/* falls through */
|
case DISTEXT:
|
if (state.extra) {
|
//=== NEEDBITS(state.extra);
|
n = state.extra;
|
while (bits < n) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
|
//--- DROPBITS(state.extra) ---//
|
hold >>>= state.extra;
|
bits -= state.extra;
|
//---//
|
state.back += state.extra;
|
}
|
//#ifdef INFLATE_STRICT
|
if (state.offset > state.dmax) {
|
strm.msg = 'invalid distance too far back';
|
state.mode = BAD;
|
break;
|
}
|
//#endif
|
//Tracevv((stderr, "inflate: distance %u\n", state.offset));
|
state.mode = MATCH;
|
/* falls through */
|
case MATCH:
|
if (left === 0) { break inf_leave; }
|
copy = _out - left;
|
if (state.offset > copy) { /* copy from window */
|
copy = state.offset - copy;
|
if (copy > state.whave) {
|
if (state.sane) {
|
strm.msg = 'invalid distance too far back';
|
state.mode = BAD;
|
break;
|
}
|
// (!) This block is disabled in zlib defaults,
|
// don't enable it for binary compatibility
|
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
|
// Trace((stderr, "inflate.c too far\n"));
|
// copy -= state.whave;
|
// if (copy > state.length) { copy = state.length; }
|
// if (copy > left) { copy = left; }
|
// left -= copy;
|
// state.length -= copy;
|
// do {
|
// output[put++] = 0;
|
// } while (--copy);
|
// if (state.length === 0) { state.mode = LEN; }
|
// break;
|
//#endif
|
}
|
if (copy > state.wnext) {
|
copy -= state.wnext;
|
from = state.wsize - copy;
|
}
|
else {
|
from = state.wnext - copy;
|
}
|
if (copy > state.length) { copy = state.length; }
|
from_source = state.window;
|
}
|
else { /* copy from output */
|
from_source = output;
|
from = put - state.offset;
|
copy = state.length;
|
}
|
if (copy > left) { copy = left; }
|
left -= copy;
|
state.length -= copy;
|
do {
|
output[put++] = from_source[from++];
|
} while (--copy);
|
if (state.length === 0) { state.mode = LEN; }
|
break;
|
case LIT:
|
if (left === 0) { break inf_leave; }
|
output[put++] = state.length;
|
left--;
|
state.mode = LEN;
|
break;
|
case CHECK:
|
if (state.wrap) {
|
//=== NEEDBITS(32);
|
while (bits < 32) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
// Use '|' instead of '+' to make sure that result is signed
|
hold |= input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
_out -= left;
|
strm.total_out += _out;
|
state.total += _out;
|
if (_out) {
|
strm.adler = state.check =
|
/*UPDATE(state.check, put - _out, _out);*/
|
(state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
|
|
}
|
_out = left;
|
// NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
|
if ((state.flags ? hold : zswap32(hold)) !== state.check) {
|
strm.msg = 'incorrect data check';
|
state.mode = BAD;
|
break;
|
}
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
//Tracev((stderr, "inflate: check matches trailer\n"));
|
}
|
state.mode = LENGTH;
|
/* falls through */
|
case LENGTH:
|
if (state.wrap && state.flags) {
|
//=== NEEDBITS(32);
|
while (bits < 32) {
|
if (have === 0) { break inf_leave; }
|
have--;
|
hold += input[next++] << bits;
|
bits += 8;
|
}
|
//===//
|
if (hold !== (state.total & 0xffffffff)) {
|
strm.msg = 'incorrect length check';
|
state.mode = BAD;
|
break;
|
}
|
//=== INITBITS();
|
hold = 0;
|
bits = 0;
|
//===//
|
//Tracev((stderr, "inflate: length matches trailer\n"));
|
}
|
state.mode = DONE;
|
/* falls through */
|
case DONE:
|
ret = Z_STREAM_END;
|
break inf_leave;
|
case BAD:
|
ret = Z_DATA_ERROR;
|
break inf_leave;
|
case MEM:
|
return Z_MEM_ERROR;
|
case SYNC:
|
/* falls through */
|
default:
|
return Z_STREAM_ERROR;
|
}
|
}
|
|
// inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
|
|
/*
|
Return from inflate(), updating the total counts and the check value.
|
If there was no progress during the inflate() call, return a buffer
|
error. Call updatewindow() to create and/or update the window state.
|
Note: a memory error from inflate() is non-recoverable.
|
*/
|
|
//--- RESTORE() ---
|
strm.next_out = put;
|
strm.avail_out = left;
|
strm.next_in = next;
|
strm.avail_in = have;
|
state.hold = hold;
|
state.bits = bits;
|
//---
|
|
if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
|
(state.mode < CHECK || flush !== Z_FINISH))) {
|
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
|
state.mode = MEM;
|
return Z_MEM_ERROR;
|
}
|
}
|
_in -= strm.avail_in;
|
_out -= strm.avail_out;
|
strm.total_in += _in;
|
strm.total_out += _out;
|
state.total += _out;
|
if (state.wrap && _out) {
|
strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
|
(state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
|
}
|
strm.data_type = state.bits + (state.last ? 64 : 0) +
|
(state.mode === TYPE ? 128 : 0) +
|
(state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
|
if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
|
ret = Z_BUF_ERROR;
|
}
|
return ret;
|
}
|
|
function inflateEnd(strm) {
|
|
if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
|
return Z_STREAM_ERROR;
|
}
|
|
var state = strm.state;
|
if (state.window) {
|
state.window = null;
|
}
|
strm.state = null;
|
return Z_OK;
|
}
|
|
function inflateGetHeader(strm, head) {
|
var state;
|
|
/* check state */
|
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
|
state = strm.state;
|
if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
|
|
/* save header structure */
|
state.head = head;
|
head.done = false;
|
return Z_OK;
|
}
|
|
function inflateSetDictionary(strm, dictionary) {
|
var dictLength = dictionary.length;
|
|
var state;
|
var dictid;
|
var ret;
|
|
/* check state */
|
if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
|
state = strm.state;
|
|
if (state.wrap !== 0 && state.mode !== DICT) {
|
return Z_STREAM_ERROR;
|
}
|
|
/* check for correct dictionary identifier */
|
if (state.mode === DICT) {
|
dictid = 1; /* adler32(0, null, 0)*/
|
/* dictid = adler32(dictid, dictionary, dictLength); */
|
dictid = adler32(dictid, dictionary, dictLength, 0);
|
if (dictid !== state.check) {
|
return Z_DATA_ERROR;
|
}
|
}
|
/* copy dictionary to window using updatewindow(), which will amend the
|
existing dictionary if appropriate */
|
ret = updatewindow(strm, dictionary, dictLength, dictLength);
|
if (ret) {
|
state.mode = MEM;
|
return Z_MEM_ERROR;
|
}
|
state.havedict = 1;
|
// Tracev((stderr, "inflate: dictionary set\n"));
|
return Z_OK;
|
}
|
|
exports.inflateReset = inflateReset;
|
exports.inflateReset2 = inflateReset2;
|
exports.inflateResetKeep = inflateResetKeep;
|
exports.inflateInit = inflateInit;
|
exports.inflateInit2 = inflateInit2;
|
exports.inflate = inflate;
|
exports.inflateEnd = inflateEnd;
|
exports.inflateGetHeader = inflateGetHeader;
|
exports.inflateSetDictionary = inflateSetDictionary;
|
exports.inflateInfo = 'pako inflate (from Nodeca project)';
|
|
/* Not implemented
|
exports.inflateCopy = inflateCopy;
|
exports.inflateGetDictionary = inflateGetDictionary;
|
exports.inflateMark = inflateMark;
|
exports.inflatePrime = inflatePrime;
|
exports.inflateSync = inflateSync;
|
exports.inflateSyncPoint = inflateSyncPoint;
|
exports.inflateUndermine = inflateUndermine;
|
*/
|
|
|
/***/ }),
|
/* 125 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
// See state defs from inflate.js
|
var BAD = 30; /* got a data error -- remain here until reset */
|
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
|
|
/*
|
Decode literal, length, and distance codes and write out the resulting
|
literal and match bytes until either not enough input or output is
|
available, an end-of-block is encountered, or a data error is encountered.
|
When large enough input and output buffers are supplied to inflate(), for
|
example, a 16K input buffer and a 64K output buffer, more than 95% of the
|
inflate execution time is spent in this routine.
|
|
Entry assumptions:
|
|
state.mode === LEN
|
strm.avail_in >= 6
|
strm.avail_out >= 258
|
start >= strm.avail_out
|
state.bits < 8
|
|
On return, state.mode is one of:
|
|
LEN -- ran out of enough output space or enough available input
|
TYPE -- reached end of block code, inflate() to interpret next block
|
BAD -- error in block data
|
|
Notes:
|
|
- The maximum input bits used by a length/distance pair is 15 bits for the
|
length code, 5 bits for the length extra, 15 bits for the distance code,
|
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
|
Therefore if strm.avail_in >= 6, then there is enough input to avoid
|
checking for available input while decoding.
|
|
- The maximum bytes that a single length/distance pair can output is 258
|
bytes, which is the maximum length that can be coded. inflate_fast()
|
requires strm.avail_out >= 258 for each loop to avoid checking for
|
output space.
|
*/
|
module.exports = function inflate_fast(strm, start) {
|
var state;
|
var _in; /* local strm.input */
|
var last; /* have enough input while in < last */
|
var _out; /* local strm.output */
|
var beg; /* inflate()'s initial strm.output */
|
var end; /* while out < end, enough space available */
|
//#ifdef INFLATE_STRICT
|
var dmax; /* maximum distance from zlib header */
|
//#endif
|
var wsize; /* window size or zero if not using window */
|
var whave; /* valid bytes in the window */
|
var wnext; /* window write index */
|
// Use `s_window` instead `window`, avoid conflict with instrumentation tools
|
var s_window; /* allocated sliding window, if wsize != 0 */
|
var hold; /* local strm.hold */
|
var bits; /* local strm.bits */
|
var lcode; /* local strm.lencode */
|
var dcode; /* local strm.distcode */
|
var lmask; /* mask for first level of length codes */
|
var dmask; /* mask for first level of distance codes */
|
var here; /* retrieved table entry */
|
var op; /* code bits, operation, extra bits, or */
|
/* window position, window bytes to copy */
|
var len; /* match length, unused bytes */
|
var dist; /* match distance */
|
var from; /* where to copy match from */
|
var from_source;
|
|
|
var input, output; // JS specific, because we have no pointers
|
|
/* copy state to local variables */
|
state = strm.state;
|
//here = state.here;
|
_in = strm.next_in;
|
input = strm.input;
|
last = _in + (strm.avail_in - 5);
|
_out = strm.next_out;
|
output = strm.output;
|
beg = _out - (start - strm.avail_out);
|
end = _out + (strm.avail_out - 257);
|
//#ifdef INFLATE_STRICT
|
dmax = state.dmax;
|
//#endif
|
wsize = state.wsize;
|
whave = state.whave;
|
wnext = state.wnext;
|
s_window = state.window;
|
hold = state.hold;
|
bits = state.bits;
|
lcode = state.lencode;
|
dcode = state.distcode;
|
lmask = (1 << state.lenbits) - 1;
|
dmask = (1 << state.distbits) - 1;
|
|
|
/* decode literals and length/distances until end-of-block or not enough
|
input data or output space */
|
|
top:
|
do {
|
if (bits < 15) {
|
hold += input[_in++] << bits;
|
bits += 8;
|
hold += input[_in++] << bits;
|
bits += 8;
|
}
|
|
here = lcode[hold & lmask];
|
|
dolen:
|
for (;;) { // Goto emulation
|
op = here >>> 24/*here.bits*/;
|
hold >>>= op;
|
bits -= op;
|
op = (here >>> 16) & 0xff/*here.op*/;
|
if (op === 0) { /* literal */
|
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
|
// "inflate: literal '%c'\n" :
|
// "inflate: literal 0x%02x\n", here.val));
|
output[_out++] = here & 0xffff/*here.val*/;
|
}
|
else if (op & 16) { /* length base */
|
len = here & 0xffff/*here.val*/;
|
op &= 15; /* number of extra bits */
|
if (op) {
|
if (bits < op) {
|
hold += input[_in++] << bits;
|
bits += 8;
|
}
|
len += hold & ((1 << op) - 1);
|
hold >>>= op;
|
bits -= op;
|
}
|
//Tracevv((stderr, "inflate: length %u\n", len));
|
if (bits < 15) {
|
hold += input[_in++] << bits;
|
bits += 8;
|
hold += input[_in++] << bits;
|
bits += 8;
|
}
|
here = dcode[hold & dmask];
|
|
dodist:
|
for (;;) { // goto emulation
|
op = here >>> 24/*here.bits*/;
|
hold >>>= op;
|
bits -= op;
|
op = (here >>> 16) & 0xff/*here.op*/;
|
|
if (op & 16) { /* distance base */
|
dist = here & 0xffff/*here.val*/;
|
op &= 15; /* number of extra bits */
|
if (bits < op) {
|
hold += input[_in++] << bits;
|
bits += 8;
|
if (bits < op) {
|
hold += input[_in++] << bits;
|
bits += 8;
|
}
|
}
|
dist += hold & ((1 << op) - 1);
|
//#ifdef INFLATE_STRICT
|
if (dist > dmax) {
|
strm.msg = 'invalid distance too far back';
|
state.mode = BAD;
|
break top;
|
}
|
//#endif
|
hold >>>= op;
|
bits -= op;
|
//Tracevv((stderr, "inflate: distance %u\n", dist));
|
op = _out - beg; /* max distance in output */
|
if (dist > op) { /* see if copy from window */
|
op = dist - op; /* distance back in window */
|
if (op > whave) {
|
if (state.sane) {
|
strm.msg = 'invalid distance too far back';
|
state.mode = BAD;
|
break top;
|
}
|
|
// (!) This block is disabled in zlib defaults,
|
// don't enable it for binary compatibility
|
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
|
// if (len <= op - whave) {
|
// do {
|
// output[_out++] = 0;
|
// } while (--len);
|
// continue top;
|
// }
|
// len -= op - whave;
|
// do {
|
// output[_out++] = 0;
|
// } while (--op > whave);
|
// if (op === 0) {
|
// from = _out - dist;
|
// do {
|
// output[_out++] = output[from++];
|
// } while (--len);
|
// continue top;
|
// }
|
//#endif
|
}
|
from = 0; // window index
|
from_source = s_window;
|
if (wnext === 0) { /* very common case */
|
from += wsize - op;
|
if (op < len) { /* some from window */
|
len -= op;
|
do {
|
output[_out++] = s_window[from++];
|
} while (--op);
|
from = _out - dist; /* rest from output */
|
from_source = output;
|
}
|
}
|
else if (wnext < op) { /* wrap around window */
|
from += wsize + wnext - op;
|
op -= wnext;
|
if (op < len) { /* some from end of window */
|
len -= op;
|
do {
|
output[_out++] = s_window[from++];
|
} while (--op);
|
from = 0;
|
if (wnext < len) { /* some from start of window */
|
op = wnext;
|
len -= op;
|
do {
|
output[_out++] = s_window[from++];
|
} while (--op);
|
from = _out - dist; /* rest from output */
|
from_source = output;
|
}
|
}
|
}
|
else { /* contiguous in window */
|
from += wnext - op;
|
if (op < len) { /* some from window */
|
len -= op;
|
do {
|
output[_out++] = s_window[from++];
|
} while (--op);
|
from = _out - dist; /* rest from output */
|
from_source = output;
|
}
|
}
|
while (len > 2) {
|
output[_out++] = from_source[from++];
|
output[_out++] = from_source[from++];
|
output[_out++] = from_source[from++];
|
len -= 3;
|
}
|
if (len) {
|
output[_out++] = from_source[from++];
|
if (len > 1) {
|
output[_out++] = from_source[from++];
|
}
|
}
|
}
|
else {
|
from = _out - dist; /* copy direct from output */
|
do { /* minimum length is three */
|
output[_out++] = output[from++];
|
output[_out++] = output[from++];
|
output[_out++] = output[from++];
|
len -= 3;
|
} while (len > 2);
|
if (len) {
|
output[_out++] = output[from++];
|
if (len > 1) {
|
output[_out++] = output[from++];
|
}
|
}
|
}
|
}
|
else if ((op & 64) === 0) { /* 2nd level distance code */
|
here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
|
continue dodist;
|
}
|
else {
|
strm.msg = 'invalid distance code';
|
state.mode = BAD;
|
break top;
|
}
|
|
break; // need to emulate goto via "continue"
|
}
|
}
|
else if ((op & 64) === 0) { /* 2nd level length code */
|
here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
|
continue dolen;
|
}
|
else if (op & 32) { /* end-of-block */
|
//Tracevv((stderr, "inflate: end of block\n"));
|
state.mode = TYPE;
|
break top;
|
}
|
else {
|
strm.msg = 'invalid literal/length code';
|
state.mode = BAD;
|
break top;
|
}
|
|
break; // need to emulate goto via "continue"
|
}
|
} while (_in < last && _out < end);
|
|
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
|
len = bits >> 3;
|
_in -= len;
|
bits -= len << 3;
|
hold &= (1 << bits) - 1;
|
|
/* update state and return */
|
strm.next_in = _in;
|
strm.next_out = _out;
|
strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
|
strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
|
state.hold = hold;
|
state.bits = bits;
|
return;
|
};
|
|
|
/***/ }),
|
/* 126 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
var utils = __webpack_require__(11);
|
|
var MAXBITS = 15;
|
var ENOUGH_LENS = 852;
|
var ENOUGH_DISTS = 592;
|
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
|
|
var CODES = 0;
|
var LENS = 1;
|
var DISTS = 2;
|
|
var lbase = [ /* Length codes 257..285 base */
|
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
|
];
|
|
var lext = [ /* Length codes 257..285 extra */
|
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
|
];
|
|
var dbase = [ /* Distance codes 0..29 base */
|
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
8193, 12289, 16385, 24577, 0, 0
|
];
|
|
var dext = [ /* Distance codes 0..29 extra */
|
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
|
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
|
28, 28, 29, 29, 64, 64
|
];
|
|
module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
|
{
|
var bits = opts.bits;
|
//here = opts.here; /* table entry for duplication */
|
|
var len = 0; /* a code's length in bits */
|
var sym = 0; /* index of code symbols */
|
var min = 0, max = 0; /* minimum and maximum code lengths */
|
var root = 0; /* number of index bits for root table */
|
var curr = 0; /* number of index bits for current table */
|
var drop = 0; /* code bits to drop for sub-table */
|
var left = 0; /* number of prefix codes available */
|
var used = 0; /* code entries in table used */
|
var huff = 0; /* Huffman code */
|
var incr; /* for incrementing code, index */
|
var fill; /* index for replicating entries */
|
var low; /* low bits for current root entry */
|
var mask; /* mask for low root bits */
|
var next; /* next available space in table */
|
var base = null; /* base value table to use */
|
var base_index = 0;
|
// var shoextra; /* extra bits table to use */
|
var end; /* use base and extra for symbol > end */
|
var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
|
var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
|
var extra = null;
|
var extra_index = 0;
|
|
var here_bits, here_op, here_val;
|
|
/*
|
Process a set of code lengths to create a canonical Huffman code. The
|
code lengths are lens[0..codes-1]. Each length corresponds to the
|
symbols 0..codes-1. The Huffman code is generated by first sorting the
|
symbols by length from short to long, and retaining the symbol order
|
for codes with equal lengths. Then the code starts with all zero bits
|
for the first code of the shortest length, and the codes are integer
|
increments for the same length, and zeros are appended as the length
|
increases. For the deflate format, these bits are stored backwards
|
from their more natural integer increment ordering, and so when the
|
decoding tables are built in the large loop below, the integer codes
|
are incremented backwards.
|
|
This routine assumes, but does not check, that all of the entries in
|
lens[] are in the range 0..MAXBITS. The caller must assure this.
|
1..MAXBITS is interpreted as that code length. zero means that that
|
symbol does not occur in this code.
|
|
The codes are sorted by computing a count of codes for each length,
|
creating from that a table of starting indices for each length in the
|
sorted table, and then entering the symbols in order in the sorted
|
table. The sorted table is work[], with that space being provided by
|
the caller.
|
|
The length counts are used for other purposes as well, i.e. finding
|
the minimum and maximum length codes, determining if there are any
|
codes at all, checking for a valid set of lengths, and looking ahead
|
at length counts to determine sub-table sizes when building the
|
decoding tables.
|
*/
|
|
/* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
|
for (len = 0; len <= MAXBITS; len++) {
|
count[len] = 0;
|
}
|
for (sym = 0; sym < codes; sym++) {
|
count[lens[lens_index + sym]]++;
|
}
|
|
/* bound code lengths, force root to be within code lengths */
|
root = bits;
|
for (max = MAXBITS; max >= 1; max--) {
|
if (count[max] !== 0) { break; }
|
}
|
if (root > max) {
|
root = max;
|
}
|
if (max === 0) { /* no symbols to code at all */
|
//table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
|
//table.bits[opts.table_index] = 1; //here.bits = (var char)1;
|
//table.val[opts.table_index++] = 0; //here.val = (var short)0;
|
table[table_index++] = (1 << 24) | (64 << 16) | 0;
|
|
|
//table.op[opts.table_index] = 64;
|
//table.bits[opts.table_index] = 1;
|
//table.val[opts.table_index++] = 0;
|
table[table_index++] = (1 << 24) | (64 << 16) | 0;
|
|
opts.bits = 1;
|
return 0; /* no symbols, but wait for decoding to report error */
|
}
|
for (min = 1; min < max; min++) {
|
if (count[min] !== 0) { break; }
|
}
|
if (root < min) {
|
root = min;
|
}
|
|
/* check for an over-subscribed or incomplete set of lengths */
|
left = 1;
|
for (len = 1; len <= MAXBITS; len++) {
|
left <<= 1;
|
left -= count[len];
|
if (left < 0) {
|
return -1;
|
} /* over-subscribed */
|
}
|
if (left > 0 && (type === CODES || max !== 1)) {
|
return -1; /* incomplete set */
|
}
|
|
/* generate offsets into symbol table for each length for sorting */
|
offs[1] = 0;
|
for (len = 1; len < MAXBITS; len++) {
|
offs[len + 1] = offs[len] + count[len];
|
}
|
|
/* sort symbols by length, by symbol order within each length */
|
for (sym = 0; sym < codes; sym++) {
|
if (lens[lens_index + sym] !== 0) {
|
work[offs[lens[lens_index + sym]]++] = sym;
|
}
|
}
|
|
/*
|
Create and fill in decoding tables. In this loop, the table being
|
filled is at next and has curr index bits. The code being used is huff
|
with length len. That code is converted to an index by dropping drop
|
bits off of the bottom. For codes where len is less than drop + curr,
|
those top drop + curr - len bits are incremented through all values to
|
fill the table with replicated entries.
|
|
root is the number of index bits for the root table. When len exceeds
|
root, sub-tables are created pointed to by the root entry with an index
|
of the low root bits of huff. This is saved in low to check for when a
|
new sub-table should be started. drop is zero when the root table is
|
being filled, and drop is root when sub-tables are being filled.
|
|
When a new sub-table is needed, it is necessary to look ahead in the
|
code lengths to determine what size sub-table is needed. The length
|
counts are used for this, and so count[] is decremented as codes are
|
entered in the tables.
|
|
used keeps track of how many table entries have been allocated from the
|
provided *table space. It is checked for LENS and DIST tables against
|
the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
|
the initial root table size constants. See the comments in inftrees.h
|
for more information.
|
|
sym increments through all symbols, and the loop terminates when
|
all codes of length max, i.e. all codes, have been processed. This
|
routine permits incomplete codes, so another loop after this one fills
|
in the rest of the decoding tables with invalid code markers.
|
*/
|
|
/* set up for code type */
|
// poor man optimization - use if-else instead of switch,
|
// to avoid deopts in old v8
|
if (type === CODES) {
|
base = extra = work; /* dummy value--not used */
|
end = 19;
|
|
} else if (type === LENS) {
|
base = lbase;
|
base_index -= 257;
|
extra = lext;
|
extra_index -= 257;
|
end = 256;
|
|
} else { /* DISTS */
|
base = dbase;
|
extra = dext;
|
end = -1;
|
}
|
|
/* initialize opts for loop */
|
huff = 0; /* starting code */
|
sym = 0; /* starting code symbol */
|
len = min; /* starting code length */
|
next = table_index; /* current table to fill in */
|
curr = root; /* current table index bits */
|
drop = 0; /* current bits to drop from code for index */
|
low = -1; /* trigger new sub-table when len > root */
|
used = 1 << root; /* use root table entries */
|
mask = used - 1; /* mask for comparing low */
|
|
/* check available table space */
|
if ((type === LENS && used > ENOUGH_LENS) ||
|
(type === DISTS && used > ENOUGH_DISTS)) {
|
return 1;
|
}
|
|
/* process all codes and make table entries */
|
for (;;) {
|
/* create table entry */
|
here_bits = len - drop;
|
if (work[sym] < end) {
|
here_op = 0;
|
here_val = work[sym];
|
}
|
else if (work[sym] > end) {
|
here_op = extra[extra_index + work[sym]];
|
here_val = base[base_index + work[sym]];
|
}
|
else {
|
here_op = 32 + 64; /* end of block */
|
here_val = 0;
|
}
|
|
/* replicate for those indices with low len bits equal to huff */
|
incr = 1 << (len - drop);
|
fill = 1 << curr;
|
min = fill; /* save offset to next table */
|
do {
|
fill -= incr;
|
table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
|
} while (fill !== 0);
|
|
/* backwards increment the len-bit code huff */
|
incr = 1 << (len - 1);
|
while (huff & incr) {
|
incr >>= 1;
|
}
|
if (incr !== 0) {
|
huff &= incr - 1;
|
huff += incr;
|
} else {
|
huff = 0;
|
}
|
|
/* go to next symbol, update count, len */
|
sym++;
|
if (--count[len] === 0) {
|
if (len === max) { break; }
|
len = lens[lens_index + work[sym]];
|
}
|
|
/* create new sub-table if needed */
|
if (len > root && (huff & mask) !== low) {
|
/* if first time, transition to sub-tables */
|
if (drop === 0) {
|
drop = root;
|
}
|
|
/* increment past last table */
|
next += min; /* here min is 1 << curr */
|
|
/* determine length of next table */
|
curr = len - drop;
|
left = 1 << curr;
|
while (curr + drop < max) {
|
left -= count[curr + drop];
|
if (left <= 0) { break; }
|
curr++;
|
left <<= 1;
|
}
|
|
/* check for enough space */
|
used += 1 << curr;
|
if ((type === LENS && used > ENOUGH_LENS) ||
|
(type === DISTS && used > ENOUGH_DISTS)) {
|
return 1;
|
}
|
|
/* point entry in root table to sub-table */
|
low = huff & mask;
|
/*table.op[low] = curr;
|
table.bits[low] = root;
|
table.val[low] = next - opts.table_index;*/
|
table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
|
}
|
}
|
|
/* fill in remaining table entry if code is incomplete (guaranteed to have
|
at most one remaining entry, since if the code is incomplete, the
|
maximum code length that was allowed to get this far is one bit) */
|
if (huff !== 0) {
|
//table.op[next + huff] = 64; /* invalid code marker */
|
//table.bits[next + huff] = len - drop;
|
//table.val[next + huff] = 0;
|
table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
|
}
|
|
/* set return parameters */
|
//opts.table_index += used;
|
opts.bits = root;
|
return 0;
|
};
|
|
|
/***/ }),
|
/* 127 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
"use strict";
|
|
|
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
//
|
// This software is provided 'as-is', without any express or implied
|
// warranty. In no event will the authors be held liable for any damages
|
// arising from the use of this software.
|
//
|
// Permission is granted to anyone to use this software for any purpose,
|
// including commercial applications, and to alter it and redistribute it
|
// freely, subject to the following restrictions:
|
//
|
// 1. The origin of this software must not be misrepresented; you must not
|
// claim that you wrote the original software. If you use this software
|
// in a product, an acknowledgment in the product documentation would be
|
// appreciated but is not required.
|
// 2. Altered source versions must be plainly marked as such, and must not be
|
// misrepresented as being the original software.
|
// 3. This notice may not be removed or altered from any source distribution.
|
|
function GZheader() {
|
/* true if compressed data believed to be text */
|
this.text = 0;
|
/* modification time */
|
this.time = 0;
|
/* extra flags (not used when writing a gzip file) */
|
this.xflags = 0;
|
/* operating system */
|
this.os = 0;
|
/* pointer to extra field or Z_NULL if none */
|
this.extra = null;
|
/* extra field length (valid if extra != Z_NULL) */
|
this.extra_len = 0; // Actually, we don't need it in JS,
|
// but leave for few code modifications
|
|
//
|
// Setup limits is not necessary because in js we should not preallocate memory
|
// for inflate use constant limit in 65536 bytes
|
//
|
|
/* space at extra (only when reading header) */
|
// this.extra_max = 0;
|
/* pointer to zero-terminated file name or Z_NULL */
|
this.name = '';
|
/* space at name (only when reading header) */
|
// this.name_max = 0;
|
/* pointer to zero-terminated comment or Z_NULL */
|
this.comment = '';
|
/* space at comment (only when reading header) */
|
// this.comm_max = 0;
|
/* true if there was or will be a header crc */
|
this.hcrc = 0;
|
/* true when done reading gzip header (not used when writing a gzip file) */
|
this.done = false;
|
}
|
|
module.exports = GZheader;
|
|
|
/***/ }),
|
/* 128 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 129 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 130 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 131 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_editor_css_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_editor_css_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_editor_css_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_editor_css_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 132 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 133 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 134 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 135 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 136 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 137 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 138 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 139 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 140 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 141 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 142 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 143 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 144 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 145 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 146 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 147 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 148 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 149 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 150 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 151 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 152 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 153 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
var map = {
|
"./ad/index.vue": 188,
|
"./cover-image/index.vue": 164,
|
"./cover-view/index.vue": 198,
|
"./map/index.vue": 189,
|
"./picker/index.vue": 165,
|
"./video/index.vue": 184,
|
"./web-view/index.vue": 190
|
};
|
|
|
function webpackContext(req) {
|
var id = webpackContextResolve(req);
|
return __webpack_require__(id);
|
}
|
function webpackContextResolve(req) {
|
if(!__webpack_require__.o(map, req)) {
|
var e = new Error("Cannot find module '" + req + "'");
|
e.code = 'MODULE_NOT_FOUND';
|
throw e;
|
}
|
return map[req];
|
}
|
webpackContext.keys = function webpackContextKeys() {
|
return Object.keys(map);
|
};
|
webpackContext.resolve = webpackContextResolve;
|
module.exports = webpackContext;
|
webpackContext.id = 153;
|
|
/***/ }),
|
/* 154 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 155 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 156 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 157 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 158 */
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
|
// backported and transplited with Babel, with backwards-compat fixes
|
|
// Copyright Joyent, Inc. and other Node contributors.
|
//
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
// copy of this software and associated documentation files (the
|
// "Software"), to deal in the Software without restriction, including
|
// without limitation the rights to use, copy, modify, merge, publish,
|
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
// persons to whom the Software is furnished to do so, subject to the
|
// following conditions:
|
//
|
// The above copyright notice and this permission notice shall be included
|
// in all copies or substantial portions of the Software.
|
//
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
// resolves . and .. elements in a path array with directory names there
|
// must be no slashes, empty elements, or device names (c:\) in the array
|
// (so also no leading and trailing slashes - it does not distinguish
|
// relative and absolute paths)
|
function normalizeArray(parts, allowAboveRoot) {
|
// if the path tries to go above the root, `up` ends up > 0
|
var up = 0;
|
for (var i = parts.length - 1; i >= 0; i--) {
|
var last = parts[i];
|
if (last === '.') {
|
parts.splice(i, 1);
|
} else if (last === '..') {
|
parts.splice(i, 1);
|
up++;
|
} else if (up) {
|
parts.splice(i, 1);
|
up--;
|
}
|
}
|
|
// if the path is allowed to go above the root, restore leading ..s
|
if (allowAboveRoot) {
|
for (; up--; up) {
|
parts.unshift('..');
|
}
|
}
|
|
return parts;
|
}
|
|
// path.resolve([from ...], to)
|
// posix version
|
exports.resolve = function() {
|
var resolvedPath = '',
|
resolvedAbsolute = false;
|
|
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
var path = (i >= 0) ? arguments[i] : process.cwd();
|
|
// Skip empty and invalid entries
|
if (typeof path !== 'string') {
|
throw new TypeError('Arguments to path.resolve must be strings');
|
} else if (!path) {
|
continue;
|
}
|
|
resolvedPath = path + '/' + resolvedPath;
|
resolvedAbsolute = path.charAt(0) === '/';
|
}
|
|
// At this point the path should be resolved to a full absolute path, but
|
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
// Normalize the path
|
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
|
return !!p;
|
}), !resolvedAbsolute).join('/');
|
|
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
};
|
|
// path.normalize(path)
|
// posix version
|
exports.normalize = function(path) {
|
var isAbsolute = exports.isAbsolute(path),
|
trailingSlash = substr(path, -1) === '/';
|
|
// Normalize the path
|
path = normalizeArray(filter(path.split('/'), function(p) {
|
return !!p;
|
}), !isAbsolute).join('/');
|
|
if (!path && !isAbsolute) {
|
path = '.';
|
}
|
if (path && trailingSlash) {
|
path += '/';
|
}
|
|
return (isAbsolute ? '/' : '') + path;
|
};
|
|
// posix version
|
exports.isAbsolute = function(path) {
|
return path.charAt(0) === '/';
|
};
|
|
// posix version
|
exports.join = function() {
|
var paths = Array.prototype.slice.call(arguments, 0);
|
return exports.normalize(filter(paths, function(p, index) {
|
if (typeof p !== 'string') {
|
throw new TypeError('Arguments to path.join must be strings');
|
}
|
return p;
|
}).join('/'));
|
};
|
|
|
// path.relative(from, to)
|
// posix version
|
exports.relative = function(from, to) {
|
from = exports.resolve(from).substr(1);
|
to = exports.resolve(to).substr(1);
|
|
function trim(arr) {
|
var start = 0;
|
for (; start < arr.length; start++) {
|
if (arr[start] !== '') break;
|
}
|
|
var end = arr.length - 1;
|
for (; end >= 0; end--) {
|
if (arr[end] !== '') break;
|
}
|
|
if (start > end) return [];
|
return arr.slice(start, end - start + 1);
|
}
|
|
var fromParts = trim(from.split('/'));
|
var toParts = trim(to.split('/'));
|
|
var length = Math.min(fromParts.length, toParts.length);
|
var samePartsLength = length;
|
for (var i = 0; i < length; i++) {
|
if (fromParts[i] !== toParts[i]) {
|
samePartsLength = i;
|
break;
|
}
|
}
|
|
var outputParts = [];
|
for (var i = samePartsLength; i < fromParts.length; i++) {
|
outputParts.push('..');
|
}
|
|
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
|
return outputParts.join('/');
|
};
|
|
exports.sep = '/';
|
exports.delimiter = ':';
|
|
exports.dirname = function (path) {
|
if (typeof path !== 'string') path = path + '';
|
if (path.length === 0) return '.';
|
var code = path.charCodeAt(0);
|
var hasRoot = code === 47 /*/*/;
|
var end = -1;
|
var matchedSlash = true;
|
for (var i = path.length - 1; i >= 1; --i) {
|
code = path.charCodeAt(i);
|
if (code === 47 /*/*/) {
|
if (!matchedSlash) {
|
end = i;
|
break;
|
}
|
} else {
|
// We saw the first non-path separator
|
matchedSlash = false;
|
}
|
}
|
|
if (end === -1) return hasRoot ? '/' : '.';
|
if (hasRoot && end === 1) {
|
// return '//';
|
// Backwards-compat fix:
|
return '/';
|
}
|
return path.slice(0, end);
|
};
|
|
function basename(path) {
|
if (typeof path !== 'string') path = path + '';
|
|
var start = 0;
|
var end = -1;
|
var matchedSlash = true;
|
var i;
|
|
for (i = path.length - 1; i >= 0; --i) {
|
if (path.charCodeAt(i) === 47 /*/*/) {
|
// If we reached a path separator that was not part of a set of path
|
// separators at the end of the string, stop now
|
if (!matchedSlash) {
|
start = i + 1;
|
break;
|
}
|
} else if (end === -1) {
|
// We saw the first non-path separator, mark this as the end of our
|
// path component
|
matchedSlash = false;
|
end = i + 1;
|
}
|
}
|
|
if (end === -1) return '';
|
return path.slice(start, end);
|
}
|
|
// Uses a mixed approach for backwards-compatibility, as ext behavior changed
|
// in new Node.js versions, so only basename() above is backported here
|
exports.basename = function (path, ext) {
|
var f = basename(path);
|
if (ext && f.substr(-1 * ext.length) === ext) {
|
f = f.substr(0, f.length - ext.length);
|
}
|
return f;
|
};
|
|
exports.extname = function (path) {
|
if (typeof path !== 'string') path = path + '';
|
var startDot = -1;
|
var startPart = 0;
|
var end = -1;
|
var matchedSlash = true;
|
// Track the state of characters (if any) we see before our first dot and
|
// after any path separator we find
|
var preDotState = 0;
|
for (var i = path.length - 1; i >= 0; --i) {
|
var code = path.charCodeAt(i);
|
if (code === 47 /*/*/) {
|
// If we reached a path separator that was not part of a set of path
|
// separators at the end of the string, stop now
|
if (!matchedSlash) {
|
startPart = i + 1;
|
break;
|
}
|
continue;
|
}
|
if (end === -1) {
|
// We saw the first non-path separator, mark this as the end of our
|
// extension
|
matchedSlash = false;
|
end = i + 1;
|
}
|
if (code === 46 /*.*/) {
|
// If this is our first dot, mark it as the start of our extension
|
if (startDot === -1)
|
startDot = i;
|
else if (preDotState !== 1)
|
preDotState = 1;
|
} else if (startDot !== -1) {
|
// We saw a non-dot and non-path separator before our dot, so we should
|
// have a good chance at having a non-empty extension
|
preDotState = -1;
|
}
|
}
|
|
if (startDot === -1 || end === -1 ||
|
// We saw a non-dot character immediately before the dot
|
preDotState === 0 ||
|
// The (right-most) trimmed path component is exactly '..'
|
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
return '';
|
}
|
return path.slice(startDot, end);
|
};
|
|
function filter (xs, f) {
|
if (xs.filter) return xs.filter(f);
|
var res = [];
|
for (var i = 0; i < xs.length; i++) {
|
if (f(xs[i], i, xs)) res.push(xs[i]);
|
}
|
return res;
|
}
|
|
// String.prototype.substr - negative index don't work in IE8
|
var substr = 'ab'.substr(-1) === 'b'
|
? function (str, start, len) { return str.substr(start, len) }
|
: function (str, start, len) {
|
if (start < 0) start = str.length + start;
|
return str.substr(start, len);
|
}
|
;
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(93)))
|
|
/***/ }),
|
/* 159 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 160 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 161 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66);
|
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
/* unused harmony reexport * */
|
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
/***/ }),
|
/* 162 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/rich-text/index.vue?vue&type=template&id=1447b4ca&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-rich-text", _vm._g({}, _vm.$listeners), [
|
_c(
|
"div",
|
{ ref: "content" },
|
[
|
_c("v-uni-resize-sensor", {
|
ref: "sensor",
|
on: {
|
resize: function($event) {
|
return _vm._updateView()
|
}
|
}
|
})
|
],
|
1
|
)
|
])
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/rich-text/index.vue?vue&type=template&id=1447b4ca&
|
|
// EXTERNAL MODULE: ./src/core/helpers/html-parser.js
|
var html_parser = __webpack_require__(70);
|
|
// CONCATENATED MODULE: ./src/core/view/components/rich-text/html-parser.js
|
|
|
function removeDOCTYPE(html) {
|
return html.replace(/<\?xml.*\?>\n/, '').replace(/<!doctype.*>\n/, '').replace(/<!DOCTYPE.*>\n/, '');
|
}
|
|
function parseAttrs(attrs) {
|
return attrs.reduce(function (pre, attr) {
|
var value = attr.value;
|
var name = attr.name;
|
|
if (value.match(/ /) && name !== 'style') {
|
value = value.split(' ');
|
}
|
|
if (pre[name]) {
|
if (Array.isArray(pre[name])) {
|
pre[name].push(value);
|
} else {
|
pre[name] = [pre[name], value];
|
}
|
} else {
|
pre[name] = value;
|
}
|
|
return pre;
|
}, {});
|
}
|
|
function parseHtml(html) {
|
html = removeDOCTYPE(html);
|
var stacks = [];
|
var results = {
|
node: 'root',
|
children: []
|
};
|
Object(html_parser["a" /* default */])(html, {
|
start: function start(tag, attrs, unary) {
|
var node = {
|
name: tag
|
};
|
|
if (attrs.length !== 0) {
|
node.attrs = parseAttrs(attrs);
|
}
|
|
if (unary) {
|
var parent = stacks[0] || results;
|
|
if (!parent.children) {
|
parent.children = [];
|
}
|
|
parent.children.push(node);
|
} else {
|
stacks.unshift(node);
|
}
|
},
|
end: function end(tag) {
|
var node = stacks.shift();
|
if (node.name !== tag) console.error('invalid state: mismatch end tag');
|
|
if (stacks.length === 0) {
|
results.children.push(node);
|
} else {
|
var parent = stacks[0];
|
|
if (!parent.children) {
|
parent.children = [];
|
}
|
|
parent.children.push(node);
|
}
|
},
|
chars: function chars(text) {
|
var node = {
|
type: 'text',
|
text: text
|
};
|
|
if (stacks.length === 0) {
|
results.children.push(node);
|
} else {
|
var parent = stacks[0];
|
|
if (!parent.children) {
|
parent.children = [];
|
}
|
|
parent.children.push(node);
|
}
|
},
|
comment: function comment(text) {
|
var node = {
|
node: 'comment',
|
text: text
|
};
|
var parent = stacks[0];
|
|
if (!parent.children) {
|
parent.children = [];
|
}
|
|
parent.children.push(node);
|
}
|
});
|
return results.children;
|
}
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-real-path.js + 1 modules
|
var get_real_path = __webpack_require__(13);
|
|
// CONCATENATED MODULE: ./src/core/view/components/rich-text/nodes-parser.js
|
|
|
var TAGS = {
|
a: '',
|
abbr: '',
|
address: '',
|
article: '',
|
aside: '',
|
b: '',
|
bdi: '',
|
bdo: ['dir'],
|
big: '',
|
blockquote: '',
|
br: '',
|
caption: '',
|
center: '',
|
cite: '',
|
code: '',
|
col: ['span', 'width'],
|
colgroup: ['span', 'width'],
|
dd: '',
|
del: '',
|
div: '',
|
dl: '',
|
dt: '',
|
em: '',
|
fieldset: '',
|
font: '',
|
footer: '',
|
h1: '',
|
h2: '',
|
h3: '',
|
h4: '',
|
h5: '',
|
h6: '',
|
header: '',
|
hr: '',
|
i: '',
|
img: ['alt', 'src', 'height', 'width'],
|
ins: '',
|
label: '',
|
legend: '',
|
li: '',
|
mark: '',
|
nav: '',
|
ol: ['start', 'type'],
|
p: '',
|
pre: '',
|
q: '',
|
rt: '',
|
ruby: '',
|
s: '',
|
section: '',
|
small: '',
|
span: '',
|
strong: '',
|
sub: '',
|
sup: '',
|
table: ['width'],
|
tbody: '',
|
td: ['colspan', 'height', 'rowspan', 'width'],
|
tfoot: '',
|
th: ['colspan', 'height', 'rowspan', 'width'],
|
thead: '',
|
tr: ['colspan', 'height', 'rowspan', 'width'],
|
tt: '',
|
u: '',
|
ul: ''
|
};
|
var CHARS = {
|
amp: '&',
|
gt: '>',
|
lt: '<',
|
nbsp: ' ',
|
quot: '"',
|
apos: "'"
|
};
|
|
function decodeEntities(htmlString) {
|
return htmlString.replace(/&(([a-zA-Z]+)|(#x{0,1}[\da-zA-Z]+));/gi, function (match, stage) {
|
if (Object(shared["e" /* hasOwn */])(CHARS, stage) && CHARS[stage]) {
|
return CHARS[stage];
|
}
|
|
if (/^#[0-9]{1,4}$/.test(stage)) {
|
return String.fromCharCode(stage.slice(1));
|
}
|
|
if (/^#x[0-9a-f]{1,4}$/i.test(stage)) {
|
return String.fromCharCode('0' + stage.slice(1));
|
}
|
|
var wrap = document.createElement('div');
|
wrap.innerHTML = match;
|
return wrap.innerText || wrap.textContent;
|
});
|
}
|
|
function normlizeValue(tagName, name, value) {
|
if (tagName === 'img' && name === 'src') return Object(get_real_path["a" /* default */])(value);
|
return value;
|
}
|
|
function parseNodes(nodes, parentNode, scopeId, triggerItemClick) {
|
nodes.forEach(function (node) {
|
if (!Object(shared["g" /* isPlainObject */])(node)) {
|
return;
|
}
|
|
if (!Object(shared["e" /* hasOwn */])(node, 'type') || node.type === 'node') {
|
if (!(typeof node.name === 'string' && node.name)) {
|
return;
|
}
|
|
var tagName = node.name.toLowerCase();
|
|
if (!Object(shared["e" /* hasOwn */])(TAGS, tagName)) {
|
return;
|
}
|
|
var elem = document.createElement(tagName);
|
|
if (!elem) {
|
return;
|
}
|
|
var attrs = node.attrs;
|
|
if (Object(shared["g" /* isPlainObject */])(attrs)) {
|
var tagAttrs = TAGS[tagName] || [];
|
Object.keys(attrs).forEach(function (name) {
|
var value = attrs[name];
|
|
switch (name) {
|
case 'class':
|
/* eslint-disable no-fallthrough */
|
Array.isArray(value) && (value = value.join(' '));
|
|
case 'style':
|
elem.setAttribute(name, value);
|
scopeId && elem.setAttribute(scopeId, '');
|
break;
|
|
default:
|
if (tagAttrs.indexOf(name) !== -1) {
|
elem.setAttribute(name, normlizeValue(tagName, name, value));
|
}
|
|
}
|
});
|
}
|
|
processClickEvent(node, elem, triggerItemClick);
|
var children = node.children;
|
|
if (Array.isArray(children) && children.length) {
|
parseNodes(node.children, elem, scopeId, triggerItemClick);
|
}
|
|
parentNode.appendChild(elem);
|
} else {
|
if (node.type === 'text' && typeof node.text === 'string' && node.text !== '') {
|
parentNode.appendChild(document.createTextNode(decodeEntities(node.text)));
|
}
|
}
|
});
|
return parentNode;
|
}
|
|
function processClickEvent(node, elem, triggerItemClick) {
|
if (['a', 'img'].includes(node.name) && triggerItemClick) {
|
elem.setAttribute('onClick', 'return false;');
|
elem.addEventListener('click', function (e) {
|
triggerItemClick(e, {
|
node: node
|
});
|
e.stopPropagation();
|
}, true);
|
}
|
}
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/rich-text/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
/* harmony default export */ var rich_textvue_type_script_lang_js_ = ({
|
name: 'RichText',
|
props: {
|
nodes: {
|
type: [Array, String],
|
default: function _default() {
|
return [];
|
}
|
}
|
},
|
watch: {
|
nodes: function nodes(value) {
|
this._renderNodes(value);
|
}
|
},
|
mounted: function mounted() {
|
this._renderNodes(this.nodes);
|
},
|
methods: {
|
_renderNodes: function _renderNodes(nodes) {
|
var scopeId = '';
|
var $vm = this;
|
|
while ($vm) {
|
!scopeId && (scopeId = $vm.$options._scopeId);
|
$vm = $vm.$parent;
|
}
|
|
var hasItemClick = !!this.$listeners.itemclick;
|
|
if (!this._isMounted) {
|
return;
|
}
|
|
if (typeof nodes === 'string') {
|
nodes = parseHtml(nodes);
|
}
|
|
var nodeList = parseNodes(nodes, document.createDocumentFragment(), scopeId, hasItemClick && this.triggerItemClick);
|
nodeList.appendChild(this.$refs.sensor.$el);
|
var content = this.$refs.content;
|
content.innerHTML = '';
|
content.appendChild(nodeList);
|
},
|
_updateView: function _updateView() {
|
window.dispatchEvent(new CustomEvent('updateview'));
|
},
|
triggerItemClick: function triggerItemClick(e) {
|
var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
this.$trigger('itemclick', e, detail);
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/rich-text/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_rich_textvue_type_script_lang_js_ = (rich_textvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/rich-text/index.vue
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_rich_textvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/rich-text/index.vue"
|
/* harmony default export */ var rich_text = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 163 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/movable-view/index.vue?vue&type=template&id=8de47606&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-movable-view",
|
_vm._g({}, _vm.$listeners),
|
[
|
_c("v-uni-resize-sensor", { on: { resize: _vm.setParent } }),
|
_vm._t("default")
|
],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/movable-view/index.vue?vue&type=template&id=8de47606&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/touchtrack.js
|
var touchtrack = __webpack_require__(12);
|
|
// CONCATENATED MODULE: ./src/core/view/components/movable-view/utils.js
|
function e(e, t, n) {
|
return e > t - n && e < t + n;
|
}
|
|
function t(t, n) {
|
return e(t, 0, n);
|
}
|
|
function Decline() {}
|
|
Decline.prototype.x = function (e) {
|
return Math.sqrt(e);
|
};
|
|
function Friction(e, t) {
|
this._m = e;
|
this._f = 1e3 * t;
|
this._startTime = 0;
|
this._v = 0;
|
}
|
|
Friction.prototype.setV = function (x, y) {
|
var n = Math.pow(Math.pow(x, 2) + Math.pow(y, 2), 0.5);
|
this._x_v = x;
|
this._y_v = y;
|
this._x_a = -this._f * this._x_v / n;
|
this._y_a = -this._f * this._y_v / n;
|
this._t = Math.abs(x / this._x_a) || Math.abs(y / this._y_a);
|
this._lastDt = null;
|
this._startTime = new Date().getTime();
|
};
|
|
Friction.prototype.setS = function (x, y) {
|
this._x_s = x;
|
this._y_s = y;
|
};
|
|
Friction.prototype.s = function (t) {
|
if (undefined === t) {
|
t = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
if (t > this._t) {
|
t = this._t;
|
this._lastDt = t;
|
}
|
|
var x = this._x_v * t + 0.5 * this._x_a * Math.pow(t, 2) + this._x_s;
|
|
var y = this._y_v * t + 0.5 * this._y_a * Math.pow(t, 2) + this._y_s;
|
|
if (this._x_a > 0 && x < this._endPositionX || this._x_a < 0 && x > this._endPositionX) {
|
x = this._endPositionX;
|
}
|
|
if (this._y_a > 0 && y < this._endPositionY || this._y_a < 0 && y > this._endPositionY) {
|
y = this._endPositionY;
|
}
|
|
return {
|
x: x,
|
y: y
|
};
|
};
|
|
Friction.prototype.ds = function (t) {
|
if (undefined === t) {
|
t = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
if (t > this._t) {
|
t = this._t;
|
}
|
|
return {
|
dx: this._x_v + this._x_a * t,
|
dy: this._y_v + this._y_a * t
|
};
|
};
|
|
Friction.prototype.delta = function () {
|
return {
|
x: -1.5 * Math.pow(this._x_v, 2) / this._x_a || 0,
|
y: -1.5 * Math.pow(this._y_v, 2) / this._y_a || 0
|
};
|
};
|
|
Friction.prototype.dt = function () {
|
return -this._x_v / this._x_a;
|
};
|
|
Friction.prototype.done = function () {
|
var t = e(this.s().x, this._endPositionX) || e(this.s().y, this._endPositionY) || this._lastDt === this._t;
|
|
this._lastDt = null;
|
return t;
|
};
|
|
Friction.prototype.setEnd = function (x, y) {
|
this._endPositionX = x;
|
this._endPositionY = y;
|
};
|
|
Friction.prototype.reconfigure = function (m, f) {
|
this._m = m;
|
this._f = 1e3 * f;
|
};
|
|
function Spring(m, k, c) {
|
this._m = m;
|
this._k = k;
|
this._c = c;
|
this._solution = null;
|
this._endPosition = 0;
|
this._startTime = 0;
|
}
|
|
Spring.prototype._solve = function (e, t) {
|
var n = this._c;
|
var i = this._m;
|
var r = this._k;
|
var o = n * n - 4 * i * r;
|
|
if (o === 0) {
|
var a = -n / (2 * i);
|
var s = e;
|
var l = t / (a * e);
|
return {
|
x: function x(e) {
|
return (s + l * e) * Math.pow(Math.E, a * e);
|
},
|
dx: function dx(e) {
|
var t = Math.pow(Math.E, a * e);
|
return a * (s + l * e) * t + l * t;
|
}
|
};
|
}
|
|
if (o > 0) {
|
var c = (-n - Math.sqrt(o)) / (2 * i);
|
var u = (-n + Math.sqrt(o)) / (2 * i);
|
var d = (t - c * e) / (u - c);
|
var h = e - d;
|
return {
|
x: function x(e) {
|
var t;
|
var n;
|
|
if (e === this._t) {
|
t = this._powER1T;
|
n = this._powER2T;
|
}
|
|
this._t = e;
|
|
if (!t) {
|
t = this._powER1T = Math.pow(Math.E, c * e);
|
}
|
|
if (!n) {
|
n = this._powER2T = Math.pow(Math.E, u * e);
|
}
|
|
return h * t + d * n;
|
},
|
dx: function dx(e) {
|
var t;
|
var n;
|
|
if (e === this._t) {
|
t = this._powER1T;
|
n = this._powER2T;
|
}
|
|
this._t = e;
|
|
if (!t) {
|
t = this._powER1T = Math.pow(Math.E, c * e);
|
}
|
|
if (!n) {
|
n = this._powER2T = Math.pow(Math.E, u * e);
|
}
|
|
return h * c * t + d * u * n;
|
}
|
};
|
}
|
|
var p = Math.sqrt(4 * i * r - n * n) / (2 * i);
|
var f = -n / 2 * i;
|
var v = e;
|
var g = (t - f * e) / p;
|
return {
|
x: function x(e) {
|
return Math.pow(Math.E, f * e) * (v * Math.cos(p * e) + g * Math.sin(p * e));
|
},
|
dx: function dx(e) {
|
var t = Math.pow(Math.E, f * e);
|
var n = Math.cos(p * e);
|
var i = Math.sin(p * e);
|
return t * (g * p * n - v * p * i) + f * t * (g * i + v * n);
|
}
|
};
|
};
|
|
Spring.prototype.x = function (e) {
|
if (undefined === e) {
|
e = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
return this._solution ? this._endPosition + this._solution.x(e) : 0;
|
};
|
|
Spring.prototype.dx = function (e) {
|
if (undefined === e) {
|
e = (new Date().getTime() - this._startTime) / 1e3;
|
}
|
|
return this._solution ? this._solution.dx(e) : 0;
|
};
|
|
Spring.prototype.setEnd = function (e, n, i) {
|
if (!i) {
|
i = new Date().getTime();
|
}
|
|
if (e !== this._endPosition || !t(n, 0.1)) {
|
n = n || 0;
|
var r = this._endPosition;
|
|
if (this._solution) {
|
if (t(n, 0.1)) {
|
n = this._solution.dx((i - this._startTime) / 1e3);
|
}
|
|
r = this._solution.x((i - this._startTime) / 1e3);
|
|
if (t(n, 0.1)) {
|
n = 0;
|
}
|
|
if (t(r, 0.1)) {
|
r = 0;
|
}
|
|
r += this._endPosition;
|
}
|
|
if (!(this._solution && t(r - e, 0.1) && t(n, 0.1))) {
|
this._endPosition = e;
|
this._solution = this._solve(r - this._endPosition, n);
|
this._startTime = i;
|
}
|
}
|
};
|
|
Spring.prototype.snap = function (e) {
|
this._startTime = new Date().getTime();
|
this._endPosition = e;
|
this._solution = {
|
x: function x() {
|
return 0;
|
},
|
dx: function dx() {
|
return 0;
|
}
|
};
|
};
|
|
Spring.prototype.done = function (n) {
|
if (!n) {
|
n = new Date().getTime();
|
}
|
|
return e(this.x(), this._endPosition, 0.1) && t(this.dx(), 0.1);
|
};
|
|
Spring.prototype.reconfigure = function (m, t, c) {
|
this._m = m;
|
this._k = t;
|
this._c = c;
|
|
if (!this.done()) {
|
this._solution = this._solve(this.x() - this._endPosition, this.dx());
|
this._startTime = new Date().getTime();
|
}
|
};
|
|
Spring.prototype.springConstant = function () {
|
return this._k;
|
};
|
|
Spring.prototype.damping = function () {
|
return this._c;
|
};
|
|
Spring.prototype.configuration = function () {
|
function e(e, t) {
|
e.reconfigure(1, t, e.damping());
|
}
|
|
function t(e, t) {
|
e.reconfigure(1, e.springConstant(), t);
|
}
|
|
return [{
|
label: 'Spring Constant',
|
read: this.springConstant.bind(this),
|
write: e.bind(this, this),
|
min: 100,
|
max: 1e3
|
}, {
|
label: 'Damping',
|
read: this.damping.bind(this),
|
write: t.bind(this, this),
|
min: 1,
|
max: 500
|
}];
|
};
|
|
function STD(e, t, n) {
|
this._springX = new Spring(e, t, n);
|
this._springY = new Spring(e, t, n);
|
this._springScale = new Spring(e, t, n);
|
this._startTime = 0;
|
}
|
|
STD.prototype.setEnd = function (e, t, n, i) {
|
var r = new Date().getTime();
|
|
this._springX.setEnd(e, i, r);
|
|
this._springY.setEnd(t, i, r);
|
|
this._springScale.setEnd(n, i, r);
|
|
this._startTime = r;
|
};
|
|
STD.prototype.x = function () {
|
var e = (new Date().getTime() - this._startTime) / 1e3;
|
return {
|
x: this._springX.x(e),
|
y: this._springY.x(e),
|
scale: this._springScale.x(e)
|
};
|
};
|
|
STD.prototype.done = function () {
|
var e = new Date().getTime();
|
return this._springX.done(e) && this._springY.done(e) && this._springScale.done(e);
|
};
|
|
STD.prototype.reconfigure = function (e, t, n) {
|
this._springX.reconfigure(e, t, n);
|
|
this._springY.reconfigure(e, t, n);
|
|
this._springScale.reconfigure(e, t, n);
|
};
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/scroll.js
|
var helpers_scroll = __webpack_require__(5);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/movable-view/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
|
var requesting = false;
|
|
function _requestAnimationFrame(e) {
|
if (!requesting) {
|
requesting = true;
|
requestAnimationFrame(function () {
|
e();
|
requesting = false;
|
});
|
}
|
}
|
|
function p(t, n) {
|
if (t === n) {
|
return 0;
|
}
|
|
var i = t.offsetLeft;
|
return t.offsetParent ? i += p(t.offsetParent, n) : 0;
|
}
|
|
function f(t, n) {
|
if (t === n) {
|
return 0;
|
}
|
|
var i = t.offsetTop;
|
return t.offsetParent ? i += f(t.offsetParent, n) : 0;
|
}
|
|
function v(a, b) {
|
return +((1000 * a - 1000 * b) / 1000).toFixed(1);
|
}
|
|
function g(e, t, n) {
|
var i = function i(e) {
|
if (e && e.id) {
|
cancelAnimationFrame(e.id);
|
}
|
|
if (e) {
|
e.cancelled = true;
|
}
|
};
|
|
var r = {
|
id: 0,
|
cancelled: false
|
};
|
|
function fn(n, i, r, o) {
|
if (!n || !n.cancelled) {
|
r(i);
|
var a = e.done();
|
|
if (!a) {
|
if (!n.cancelled) {
|
n.id = requestAnimationFrame(fn.bind(null, n, i, r, o));
|
}
|
}
|
|
if (a && o) {
|
o(i);
|
}
|
}
|
}
|
|
fn(r, e, t, n);
|
return {
|
cancel: i.bind(null, r),
|
model: e
|
};
|
}
|
|
/* harmony default export */ var movable_viewvue_type_script_lang_js_ = ({
|
name: 'MovableView',
|
mixins: [touchtrack["a" /* default */]],
|
props: {
|
direction: {
|
type: String,
|
default: 'none'
|
},
|
inertia: {
|
type: [Boolean, String],
|
default: false
|
},
|
outOfBounds: {
|
type: [Boolean, String],
|
default: false
|
},
|
x: {
|
type: [Number, String],
|
default: 0
|
},
|
y: {
|
type: [Number, String],
|
default: 0
|
},
|
damping: {
|
type: [Number, String],
|
default: 20
|
},
|
friction: {
|
type: [Number, String],
|
default: 2
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
scale: {
|
type: [Boolean, String],
|
default: false
|
},
|
scaleMin: {
|
type: [Number, String],
|
default: 0.5
|
},
|
scaleMax: {
|
type: [Number, String],
|
default: 10
|
},
|
scaleValue: {
|
type: [Number, String],
|
default: 1
|
},
|
animation: {
|
type: [Boolean, String],
|
default: true
|
}
|
},
|
data: function data() {
|
return {
|
xSync: this._getPx(this.x),
|
ySync: this._getPx(this.y),
|
scaleValueSync: Number(this.scaleValue) || 1,
|
width: 0,
|
height: 0,
|
minX: 0,
|
minY: 0,
|
maxX: 0,
|
maxY: 0
|
};
|
},
|
computed: {
|
dampingNumber: function dampingNumber() {
|
var val = Number(this.damping);
|
return isNaN(val) ? 20 : val;
|
},
|
frictionNumber: function frictionNumber() {
|
var val = Number(this.friction);
|
return isNaN(val) || val <= 0 ? 2 : val;
|
},
|
scaleMinNumber: function scaleMinNumber() {
|
var val = Number(this.scaleMin);
|
return isNaN(val) ? 0.5 : val;
|
},
|
scaleMaxNumber: function scaleMaxNumber() {
|
var val = Number(this.scaleMax);
|
return isNaN(val) ? 10 : val;
|
},
|
xMove: function xMove() {
|
return this.direction === 'all' || this.direction === 'horizontal';
|
},
|
yMove: function yMove() {
|
return this.direction === 'all' || this.direction === 'vertical';
|
}
|
},
|
watch: {
|
x: function x(val) {
|
this.xSync = this._getPx(val);
|
},
|
xSync: function xSync(val) {
|
this._setX(val);
|
},
|
y: function y(val) {
|
this.ySync = this._getPx(val);
|
},
|
ySync: function ySync(val) {
|
this._setY(val);
|
},
|
scaleValue: function scaleValue(val) {
|
this.scaleValueSync = Number(val) || 0;
|
},
|
scaleValueSync: function scaleValueSync(val) {
|
this._setScaleValue(val);
|
},
|
scaleMinNumber: function scaleMinNumber() {
|
this._setScaleMinOrMax();
|
},
|
scaleMaxNumber: function scaleMaxNumber() {
|
this._setScaleMinOrMax();
|
}
|
},
|
created: function created() {
|
this._offset = {
|
x: 0,
|
y: 0
|
};
|
this._scaleOffset = {
|
x: 0,
|
y: 0
|
};
|
this._translateX = 0;
|
this._translateY = 0;
|
this._scale = 1;
|
this._oldScale = 1;
|
this._STD = new STD(1, 9 * Math.pow(this.dampingNumber, 2) / 40, this.dampingNumber);
|
this._friction = new Friction(1, this.frictionNumber);
|
this._declineX = new Decline();
|
this._declineY = new Decline();
|
this.__touchInfo = {
|
historyX: [0, 0],
|
historyY: [0, 0],
|
historyT: [0, 0]
|
};
|
},
|
mounted: function mounted() {
|
this.touchtrack(this.$el, '_onTrack');
|
this.setParent();
|
|
this._friction.reconfigure(1, this.frictionNumber);
|
|
this._STD.reconfigure(1, 9 * Math.pow(this.dampingNumber, 2) / 40, this.dampingNumber);
|
|
this.$el.style.transformOrigin = 'center';
|
Object(helpers_scroll["b" /* initScrollBounce */])();
|
},
|
methods: {
|
_getPx: function _getPx(val) {
|
if (/\d+[ur]px$/i.test(val)) {
|
return uni.upx2px(parseFloat(val));
|
}
|
|
return Number(val) || 0;
|
},
|
_setX: function _setX(val) {
|
if (this.xMove) {
|
if (val + this._scaleOffset.x === this._translateX) {
|
return this._translateX;
|
} else {
|
if (this._SFA) {
|
this._SFA.cancel();
|
}
|
|
this._animationTo(val + this._scaleOffset.x, this.ySync + this._scaleOffset.y, this._scale);
|
}
|
}
|
|
return val;
|
},
|
_setY: function _setY(val) {
|
if (this.yMove) {
|
if (val + this._scaleOffset.y === this._translateY) {
|
return this._translateY;
|
} else {
|
if (this._SFA) {
|
this._SFA.cancel();
|
}
|
|
this._animationTo(this.xSync + this._scaleOffset.x, val + this._scaleOffset.y, this._scale);
|
}
|
}
|
|
return val;
|
},
|
_setScaleMinOrMax: function _setScaleMinOrMax() {
|
if (!this.scale) {
|
return false;
|
}
|
|
this._updateScale(this._scale, true);
|
|
this._updateOldScale(this._scale);
|
},
|
_setScaleValue: function _setScaleValue(scale) {
|
if (!this.scale) {
|
return false;
|
}
|
|
scale = this._adjustScale(scale);
|
|
this._updateScale(scale, true);
|
|
this._updateOldScale(scale);
|
|
return scale;
|
},
|
__handleTouchStart: function __handleTouchStart() {
|
if (!this._isScaling) {
|
if (!this.disabled) {
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: true
|
});
|
|
if (this._FA) {
|
this._FA.cancel();
|
}
|
|
if (this._SFA) {
|
this._SFA.cancel();
|
}
|
|
this.__touchInfo.historyX = [0, 0];
|
this.__touchInfo.historyY = [0, 0];
|
this.__touchInfo.historyT = [0, 0];
|
|
if (this.xMove) {
|
this.__baseX = this._translateX;
|
}
|
|
if (this.yMove) {
|
this.__baseY = this._translateY;
|
}
|
|
this.$el.style.willChange = 'transform';
|
this._checkCanMove = null;
|
this._firstMoveDirection = null;
|
this._isTouching = true;
|
}
|
}
|
},
|
__handleTouchMove: function __handleTouchMove(event) {
|
var self = this;
|
|
if (!this._isScaling && !this.disabled && this._isTouching) {
|
var x = this._translateX;
|
var y = this._translateY;
|
|
if (this._firstMoveDirection === null) {
|
this._firstMoveDirection = Math.abs(event.detail.dx / event.detail.dy) > 1 ? 'htouchmove' : 'vtouchmove';
|
}
|
|
if (this.xMove) {
|
x = event.detail.dx + this.__baseX;
|
|
this.__touchInfo.historyX.shift();
|
|
this.__touchInfo.historyX.push(x);
|
|
if (!this.yMove && this._checkCanMove === null) {
|
this._checkCanMove = Math.abs(event.detail.dx / event.detail.dy) < 1;
|
}
|
}
|
|
if (this.yMove) {
|
y = event.detail.dy + this.__baseY;
|
|
this.__touchInfo.historyY.shift();
|
|
this.__touchInfo.historyY.push(y);
|
|
if (!this.xMove && this._checkCanMove === null) {
|
this._checkCanMove = Math.abs(event.detail.dy / event.detail.dx) < 1;
|
}
|
}
|
|
this.__touchInfo.historyT.shift();
|
|
this.__touchInfo.historyT.push(event.detail.timeStamp);
|
|
if (!this._checkCanMove) {
|
event.preventDefault();
|
var source = 'touch';
|
|
if (x < this.minX) {
|
if (this.outOfBounds) {
|
source = 'touch-out-of-bounds';
|
x = this.minX - this._declineX.x(this.minX - x);
|
} else {
|
x = this.minX;
|
}
|
} else if (x > this.maxX) {
|
if (this.outOfBounds) {
|
source = 'touch-out-of-bounds';
|
x = this.maxX + this._declineX.x(x - this.maxX);
|
} else {
|
x = this.maxX;
|
}
|
}
|
|
if (y < this.minY) {
|
if (this.outOfBounds) {
|
source = 'touch-out-of-bounds';
|
y = this.minY - this._declineY.x(this.minY - y);
|
} else {
|
y = this.minY;
|
}
|
} else {
|
if (y > this.maxY) {
|
if (this.outOfBounds) {
|
source = 'touch-out-of-bounds';
|
y = this.maxY + this._declineY.x(y - this.maxY);
|
} else {
|
y = this.maxY;
|
}
|
}
|
}
|
|
_requestAnimationFrame(function () {
|
self._setTransform(x, y, self._scale, source);
|
});
|
}
|
}
|
},
|
__handleTouchEnd: function __handleTouchEnd() {
|
var self = this;
|
|
if (!this._isScaling && !this.disabled && this._isTouching) {
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: false
|
});
|
this.$el.style.willChange = 'auto';
|
this._isTouching = false;
|
|
if (!this._checkCanMove && !this._revise('out-of-bounds') && this.inertia) {
|
var xv = 1000 * (this.__touchInfo.historyX[1] - this.__touchInfo.historyX[0]) / (this.__touchInfo.historyT[1] - this.__touchInfo.historyT[0]);
|
var yv = 1000 * (this.__touchInfo.historyY[1] - this.__touchInfo.historyY[0]) / (this.__touchInfo.historyT[1] - this.__touchInfo.historyT[0]);
|
|
this._friction.setV(xv, yv);
|
|
this._friction.setS(this._translateX, this._translateY);
|
|
var x0 = this._friction.delta().x;
|
|
var y0 = this._friction.delta().y;
|
|
var x = x0 + this._translateX;
|
var y = y0 + this._translateY;
|
|
if (x < this.minX) {
|
x = this.minX;
|
y = this._translateY + (this.minX - this._translateX) * y0 / x0;
|
} else {
|
if (x > this.maxX) {
|
x = this.maxX;
|
y = this._translateY + (this.maxX - this._translateX) * y0 / x0;
|
}
|
}
|
|
if (y < this.minY) {
|
y = this.minY;
|
x = this._translateX + (this.minY - this._translateY) * x0 / y0;
|
} else {
|
if (y > this.maxY) {
|
y = this.maxY;
|
x = this._translateX + (this.maxY - this._translateY) * x0 / y0;
|
}
|
}
|
|
this._friction.setEnd(x, y);
|
|
this._FA = g(this._friction, function () {
|
var t = self._friction.s();
|
|
var x = t.x;
|
var y = t.y;
|
|
self._setTransform(x, y, self._scale, 'friction');
|
}, function () {
|
self._FA.cancel();
|
});
|
}
|
}
|
},
|
_onTrack: function _onTrack(event) {
|
switch (event.detail.state) {
|
case 'start':
|
this.__handleTouchStart();
|
|
break;
|
|
case 'move':
|
this.__handleTouchMove(event);
|
|
break;
|
|
case 'end':
|
this.__handleTouchEnd();
|
|
}
|
},
|
_getLimitXY: function _getLimitXY(x, y) {
|
var outOfBounds = false;
|
|
if (x > this.maxX) {
|
x = this.maxX;
|
outOfBounds = true;
|
} else {
|
if (x < this.minX) {
|
x = this.minX;
|
outOfBounds = true;
|
}
|
}
|
|
if (y > this.maxY) {
|
y = this.maxY;
|
outOfBounds = true;
|
} else {
|
if (y < this.minY) {
|
y = this.minY;
|
outOfBounds = true;
|
}
|
}
|
|
return {
|
x: x,
|
y: y,
|
outOfBounds: outOfBounds
|
};
|
},
|
setParent: function setParent() {
|
if (!this.$parent._isMounted) {
|
return;
|
}
|
|
if (this._FA) {
|
this._FA.cancel();
|
}
|
|
if (this._SFA) {
|
this._SFA.cancel();
|
}
|
|
var scale = this.scale ? this.scaleValueSync : 1;
|
|
this._updateOffset();
|
|
this._updateWH(scale);
|
|
this._updateBoundary();
|
|
this._translateX = this.xSync + this._scaleOffset.x;
|
this._translateY = this.ySync + this._scaleOffset.y;
|
|
var limitXY = this._getLimitXY(this._translateX, this._translateY);
|
|
var x = limitXY.x;
|
var y = limitXY.y;
|
|
this._setTransform(x, y, scale, '', true);
|
|
this._updateOldScale(scale);
|
},
|
_updateOffset: function _updateOffset() {
|
this._offset.x = p(this.$el, this.$parent.$el);
|
this._offset.y = f(this.$el, this.$parent.$el);
|
},
|
_updateWH: function _updateWH(scale) {
|
scale = scale || this._scale;
|
scale = this._adjustScale(scale);
|
var rect = this.$el.getBoundingClientRect();
|
this.height = rect.height / this._scale;
|
this.width = rect.width / this._scale;
|
var height = this.height * scale;
|
var width = this.width * scale;
|
this._scaleOffset.x = (width - this.width) / 2;
|
this._scaleOffset.y = (height - this.height) / 2;
|
},
|
_updateBoundary: function _updateBoundary() {
|
var x = 0 - this._offset.x + this._scaleOffset.x;
|
var width = this.$parent.width - this.width - this._offset.x - this._scaleOffset.x;
|
this.minX = Math.min(x, width);
|
this.maxX = Math.max(x, width);
|
var y = 0 - this._offset.y + this._scaleOffset.y;
|
var height = this.$parent.height - this.height - this._offset.y - this._scaleOffset.y;
|
this.minY = Math.min(y, height);
|
this.maxY = Math.max(y, height);
|
},
|
_beginScale: function _beginScale() {
|
this._isScaling = true;
|
},
|
_endScale: function _endScale() {
|
this._isScaling = false;
|
|
this._updateOldScale(this._scale);
|
},
|
_setScale: function _setScale(scale) {
|
if (this.scale) {
|
scale = this._oldScale * scale;
|
|
this._beginScale();
|
|
this._updateScale(scale);
|
}
|
},
|
_updateScale: function _updateScale(scale, animat) {
|
var self = this;
|
|
if (this.scale) {
|
scale = this._adjustScale(scale);
|
|
this._updateWH(scale);
|
|
this._updateBoundary();
|
|
var limitXY = this._getLimitXY(this._translateX, this._translateY);
|
|
var x = limitXY.x;
|
var y = limitXY.y;
|
|
if (animat) {
|
this._animationTo(x, y, scale, '', true, true);
|
} else {
|
_requestAnimationFrame(function () {
|
self._setTransform(x, y, scale, '', true, true);
|
});
|
}
|
}
|
},
|
_updateOldScale: function _updateOldScale(scale) {
|
this._oldScale = scale;
|
},
|
_adjustScale: function _adjustScale(scale) {
|
scale = Math.max(0.5, this.scaleMinNumber, scale);
|
scale = Math.min(10, this.scaleMaxNumber, scale);
|
return scale;
|
},
|
_animationTo: function _animationTo(x, y, scale, source, r, o) {
|
var self = this;
|
|
if (this._FA) {
|
this._FA.cancel();
|
}
|
|
if (this._SFA) {
|
this._SFA.cancel();
|
}
|
|
if (!this.xMove) {
|
x = this._translateX;
|
}
|
|
if (!this.yMove) {
|
y = this._translateY;
|
}
|
|
if (!this.scale) {
|
scale = this._scale;
|
}
|
|
var limitXY = this._getLimitXY(x, y);
|
|
x = limitXY.x;
|
y = limitXY.y;
|
|
if (!this.animation) {
|
this._setTransform(x, y, scale, source, r, o);
|
|
return;
|
}
|
|
this._STD._springX._solution = null;
|
this._STD._springY._solution = null;
|
this._STD._springScale._solution = null;
|
this._STD._springX._endPosition = this._translateX;
|
this._STD._springY._endPosition = this._translateY;
|
this._STD._springScale._endPosition = this._scale;
|
|
this._STD.setEnd(x, y, scale, 1);
|
|
this._SFA = g(this._STD, function () {
|
var data = self._STD.x();
|
|
var x = data.x;
|
var y = data.y;
|
var scale = data.scale;
|
|
self._setTransform(x, y, scale, source, r, o);
|
}, function () {
|
self._SFA.cancel();
|
});
|
},
|
_revise: function _revise(source) {
|
var limitXY = this._getLimitXY(this._translateX, this._translateY);
|
|
var x = limitXY.x;
|
var y = limitXY.y;
|
var outOfBounds = limitXY.outOfBounds;
|
|
if (outOfBounds) {
|
this._animationTo(x, y, this._scale, source);
|
}
|
|
return outOfBounds;
|
},
|
_setTransform: function _setTransform(x, y, scale) {
|
var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
var r = arguments.length > 4 ? arguments[4] : undefined;
|
var o = arguments.length > 5 ? arguments[5] : undefined;
|
|
if (!(x !== null && x.toString() !== 'NaN' && typeof x === 'number')) {
|
x = this._translateX || 0;
|
}
|
|
if (!(y !== null && y.toString() !== 'NaN' && typeof y === 'number')) {
|
y = this._translateY || 0;
|
}
|
|
x = Number(x.toFixed(1));
|
y = Number(y.toFixed(1));
|
scale = Number(scale.toFixed(1));
|
|
if (!(this._translateX === x && this._translateY === y)) {
|
if (!r) {
|
this.$trigger('change', {}, {
|
x: v(x, this._scaleOffset.x),
|
y: v(y, this._scaleOffset.y),
|
source: source
|
});
|
}
|
}
|
|
if (!this.scale) {
|
scale = this._scale;
|
}
|
|
scale = this._adjustScale(scale);
|
scale = +scale.toFixed(3);
|
|
if (o && scale !== this._scale) {
|
this.$trigger('scale', {}, {
|
x: x,
|
y: y,
|
scale: scale
|
});
|
}
|
|
var transform = 'translateX(' + x + 'px) translateY(' + y + 'px) translateZ(0px) scale(' + scale + ')';
|
this.$el.style.transform = transform;
|
this.$el.style.webkitTransform = transform;
|
this._translateX = x;
|
this._translateY = y;
|
this._scale = scale;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/movable-view/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_movable_viewvue_type_script_lang_js_ = (movable_viewvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/movable-view/index.vue?vue&type=style&index=0&lang=css&
|
var movable_viewvue_type_style_index_0_lang_css_ = __webpack_require__(137);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/movable-view/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_movable_viewvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/movable-view/index.vue"
|
/* harmony default export */ var movable_view = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 164 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/cover-image/index.vue?vue&type=template&id=221fdf58&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-cover-image",
|
_vm._g({ style: _vm.imageInfo, attrs: { src: _vm.src } }, _vm.$listeners),
|
[_c("div", { ref: "container", staticClass: "uni-cover-image" })]
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/cover-image/index.vue?vue&type=template&id=221fdf58&
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/mixins/native.js
|
var mixins_native = __webpack_require__(7);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/mixins/cover.js
|
var cover = __webpack_require__(73);
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/service/api/constants.js
|
var DEVICE_FREQUENCY = 200;
|
var NETWORK_TYPES = ['unknown', 'none', 'ethernet', 'wifi', '2g', '3g', '4g', '5g'];
|
var MAP_ID = '__UNIAPP_MAP';
|
var TEMP_PATH_BASE = '_doc/uniapp_temp';
|
var TEMP_PATH = "".concat(TEMP_PATH_BASE, "_").concat(Date.now());
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/cover-image/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
|
|
/* harmony default export */ var cover_imagevue_type_script_lang_js_ = ({
|
name: 'CoverImage',
|
mixins: [mixins_native["a" /* default */], cover["a" /* default */]],
|
props: {
|
src: {
|
type: String,
|
default: ''
|
},
|
autoSize: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
coverType: 'image',
|
coverContent: '',
|
imageInfo: {}
|
};
|
},
|
watch: {
|
src: function src() {
|
this.loadImage();
|
}
|
},
|
created: function created() {
|
this.loadImage();
|
},
|
beforeDestroy: function beforeDestroy() {
|
var downloaTask = this.downloaTask;
|
|
if (downloaTask && downloaTask.state < 4) {
|
downloaTask.abort();
|
}
|
},
|
methods: {
|
loadImage: function loadImage() {
|
var _this = this;
|
|
this.coverContent = '';
|
this.imageInfo = this.autoSize ? {
|
width: 0,
|
height: 0
|
} : {};
|
var realPath = this.src ? this.$getRealPath(this.src) : '';
|
|
if (realPath.indexOf('http://') === 0 || realPath.indexOf('https://') === 0) {
|
Object(shared["j" /* plusReady */])(function () {
|
_this.downloaTask = plus.downloader.createDownload(realPath, {
|
filename: TEMP_PATH + '/download/'
|
}, function (task, status) {
|
if (status === 200) {
|
_this.getImageInfo(task.filename);
|
} else {
|
_this.$trigger('error', {}, {
|
errMsg: 'error'
|
});
|
}
|
}).start();
|
});
|
} else if (realPath) {
|
this.getImageInfo(realPath);
|
}
|
},
|
getImageInfo: function getImageInfo(src) {
|
var _this2 = this;
|
|
this.coverContent = src;
|
Object(shared["j" /* plusReady */])(function () {
|
plus.io.getImageInfo({
|
src: src,
|
success: function success(_ref) {
|
var width = _ref.width,
|
height = _ref.height;
|
|
if (_this2.autoSize) {
|
_this2.imageInfo = {
|
width: "".concat(width, "px"),
|
height: "".concat(height, "px")
|
};
|
|
if (_this2._isMounted) {
|
_this2._requestPositionUpdate();
|
}
|
}
|
|
_this2.$trigger('load', {}, {
|
width: width,
|
height: height
|
});
|
},
|
fail: function fail() {
|
_this2.$trigger('error', {}, {
|
errMsg: 'error'
|
});
|
}
|
});
|
});
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/cover-image/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_cover_imagevue_type_script_lang_js_ = (cover_imagevue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/cover-image/index.vue?vue&type=style&index=0&lang=css&
|
var cover_imagevue_type_style_index_0_lang_css_ = __webpack_require__(155);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/cover-image/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_cover_imagevue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/platforms/app-plus/view/components/cover-image/index.vue"
|
/* harmony default export */ var cover_image = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 165 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/picker/index.vue?vue&type=template&id=0268771e&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-picker",
|
_vm._g({ on: { click: _vm._show } }, _vm.$listeners),
|
[_vm._t("default")],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/picker/index.vue?vue&type=template&id=0268771e&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/picker/page.js
|
var page = __webpack_require__(109);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/picker/webview.js
|
var PICKER_ID = '__UNIAPP_PICKER';
|
var PICKER_PATH = '_www/__uniapppicker.html';
|
var pickerWebview = null;
|
var pickerWebviewCreated = false;
|
var _exists = null;
|
var callbacks = null;
|
function webview_exists(callback) {
|
if (_exists !== null) {
|
callback(_exists);
|
return;
|
}
|
|
if (callbacks) {
|
callbacks.push(callback);
|
return;
|
}
|
|
callbacks = [callback];
|
|
function success(exists) {
|
_exists = exists;
|
callbacks.forEach(function (callback) {
|
return callback(exists);
|
});
|
callbacks = null;
|
}
|
|
plus.io.resolveLocalFileSystemURL(PICKER_PATH, function () {
|
success(true);
|
}, function () {
|
success(false);
|
});
|
}
|
|
var _pickerHideCallback;
|
|
function initPicker() {
|
if (pickerWebview) {
|
return;
|
}
|
|
pickerWebview = plus.webview.getWebviewById(PICKER_ID);
|
|
if (pickerWebview) {
|
pickerWebviewCreated = true;
|
} else {
|
pickerWebview = plus.webview.create(PICKER_PATH, PICKER_ID, {
|
popGesture: 'none',
|
background: 'transparent',
|
backButtonAutoControl: 'hide',
|
render: 'always',
|
kernel: 'WKWebview',
|
bounce: 'none',
|
cachemode: 'noCache'
|
});
|
|
window.__pickerCallback = function () {
|
delete window.__pickerCallback;
|
pickerWebviewCreated = true;
|
};
|
}
|
|
pickerWebview.addEventListener('hide', function () {
|
_pickerHideCallback && _pickerHideCallback();
|
_pickerHideCallback = null;
|
});
|
}
|
function showPicker() {
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
data.id = plus.webview.currentWebview().id;
|
pickerWebview.show('fade-in');
|
var res;
|
|
_pickerHideCallback = function _pickerHideCallback() {
|
callback(res || {
|
event: 'cancel'
|
});
|
};
|
|
window.__pickerCallback = function (_ref) {
|
var _ref$event = _ref.event,
|
event = _ref$event === void 0 ? 'cancel' : _ref$event,
|
column = _ref.column,
|
_ref$value = _ref.value,
|
value = _ref$value === void 0 ? -1 : _ref$value;
|
|
if (event === 'created' && pickerWebview) {
|
pickerWebviewCreated = true;
|
pickerWebview.evalJS("showPicker(".concat(JSON.stringify(data), ")"));
|
return;
|
}
|
|
if (event === 'columnchange' && pickerWebview) {
|
callback({
|
event: event,
|
column: column,
|
value: value
|
});
|
}
|
|
if (event === 'change' || event === 'cancel') {
|
// 赋值为空函数避免 picker-webview 产生多余通讯报错
|
window.__pickerCallback = function () {};
|
|
res = {
|
event: event,
|
value: value
|
};
|
pickerWebview.hide('fade-out', 100);
|
}
|
};
|
|
if (pickerWebviewCreated) {
|
pickerWebview.evalJS("showPicker(".concat(JSON.stringify(data), ")"));
|
}
|
}
|
function updatePicker(data) {
|
if (pickerWebviewCreated) {
|
pickerWebview.evalJS("showPicker(".concat(JSON.stringify(data), ")"));
|
}
|
}
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/utils.js + 1 modules
|
var utils = __webpack_require__(75);
|
|
// EXTERNAL MODULE: ./src/core/helpers/i18n/index.js
|
var i18n = __webpack_require__(10);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/picker/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
|
|
|
var mode = {
|
SELECTOR: 'selector',
|
MULTISELECTOR: 'multiSelector',
|
TIME: 'time',
|
DATE: 'date' // 暂不支持城市选择
|
// REGION: 'region'
|
|
};
|
var fields = {
|
YEAR: 'year',
|
MONTH: 'month',
|
DAY: 'day'
|
};
|
|
function padLeft(num) {
|
return num > 9 ? num : "0".concat(num);
|
}
|
|
function getDate(str, mode_) {
|
str = String(str || '');
|
var date = new Date();
|
|
if (mode_ === mode.TIME) {
|
str = str.split(':');
|
|
if (str.length === 2) {
|
date.setHours(parseInt(str[0]), parseInt(str[1]));
|
}
|
} else {
|
str = str.split('-');
|
|
if (str.length === 3) {
|
date.setFullYear(parseInt(str[0]), parseInt(str[1] - 1), parseInt(str[2]));
|
}
|
}
|
|
return date;
|
}
|
|
function getDefaultStartValue() {
|
if (this.mode === mode.TIME) {
|
return '00:00';
|
}
|
|
if (this.mode === mode.DATE) {
|
var year = new Date().getFullYear() - 100;
|
|
switch (this.fields) {
|
case fields.YEAR:
|
return year;
|
|
case fields.MONTH:
|
return year + '-01';
|
|
default:
|
return year + '-01-01';
|
}
|
}
|
|
return '';
|
}
|
|
function getDefaultEndValue() {
|
if (this.mode === mode.TIME) {
|
return '23:59';
|
}
|
|
if (this.mode === mode.DATE) {
|
var year = new Date().getFullYear() + 100;
|
|
switch (this.fields) {
|
case fields.YEAR:
|
return year;
|
|
case fields.MONTH:
|
return year + '-12';
|
|
default:
|
return year + '-12-31';
|
}
|
}
|
|
return '';
|
}
|
|
/* harmony default export */ var pickervue_type_script_lang_js_ = ({
|
name: 'Picker',
|
mixins: [i18n["b" /* i18nMixin */], mixins["a" /* emitter */]],
|
props: {
|
name: {
|
type: String,
|
default: ''
|
},
|
range: {
|
type: Array,
|
default: function _default() {
|
return [];
|
}
|
},
|
rangeKey: {
|
type: String,
|
default: ''
|
},
|
value: {
|
type: [Number, String, Array],
|
default: 0
|
},
|
mode: {
|
type: String,
|
default: mode.SELECTOR,
|
validator: function validator(val) {
|
return Object.values(mode).indexOf(val) >= 0;
|
}
|
},
|
fields: {
|
type: String,
|
default: ''
|
},
|
start: {
|
type: String,
|
default: getDefaultStartValue
|
},
|
end: {
|
type: String,
|
default: getDefaultEndValue
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
valueSync: null
|
};
|
},
|
watch: {
|
value: function value() {
|
this._setValueSync();
|
}
|
},
|
created: function created() {
|
var _this = this;
|
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
Object.keys(this.$props).forEach(function (key) {
|
if (key !== 'name') {
|
_this.$watch(key, function (val) {
|
var data = {};
|
data[key] = val;
|
|
_this._updatePicker(data);
|
});
|
}
|
});
|
|
this._setValueSync();
|
},
|
mounted: function mounted() {
|
webview_exists(function (exists) {
|
if (exists) {
|
initPicker();
|
}
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_setValueSync: function _setValueSync() {
|
var val = this.value;
|
|
switch (this.mode) {
|
case mode.MULTISELECTOR:
|
{
|
if (!Array.isArray(val)) {
|
val = [];
|
}
|
|
if (!Array.isArray(this.valueSync)) {
|
this.valueSync = [];
|
}
|
|
var length = this.valueSync.length = Math.max(val.length, this.range.length);
|
|
for (var index = 0; index < length; index++) {
|
var val0 = Number(val[index]);
|
var val1 = Number(this.valueSync[index]);
|
var val2 = isNaN(val0) ? isNaN(val1) ? 0 : val1 : val0;
|
this.valueSync.splice(index, 1, val2 < 0 ? 0 : val2);
|
}
|
}
|
break;
|
|
case mode.TIME:
|
case mode.DATE:
|
this.valueSync = String(val);
|
break;
|
|
default:
|
{
|
var valueSync = Number(val);
|
this.valueSync = valueSync < 0 ? 0 : valueSync;
|
break;
|
}
|
}
|
},
|
_show: function _show(event) {
|
if (this.disabled) {
|
return;
|
}
|
|
var rect = event.currentTarget.getBoundingClientRect();
|
|
this._showPicker(Object.assign({}, this.$props, {
|
value: this.valueSync,
|
locale: Object(i18n["a" /* getLocale */])(),
|
messages: {
|
done: this.$$t('uni.picker.done'),
|
cancel: this.$$t('uni.picker.cancel')
|
}
|
}), {
|
top: rect.top + Object(utils["a" /* getNavigationBarHeight */])(),
|
left: rect.left,
|
width: rect.width,
|
height: rect.height
|
});
|
},
|
_showPicker: function _showPicker(data, popover) {
|
var _this2 = this;
|
|
if ((data.mode === mode.TIME || data.mode === mode.DATE) && !data.fields) {
|
this._showNativePicker(data, popover);
|
} else {
|
data.fields = Object.values(fields).includes(data.fields) ? data.fields : fields.DAY;
|
webview_exists(function (exists) {
|
_this2[exists ? '_showWebviewPicker' : '_showWeexPicker'](data);
|
});
|
}
|
},
|
_showNativePicker: function _showNativePicker(data, popover) {
|
var _this3 = this;
|
|
plus.nativeUI[this.mode === mode.TIME ? 'pickTime' : 'pickDate'](function (res) {
|
var date = res.date;
|
|
_this3.$trigger('change', {}, {
|
value: _this3.mode === mode.TIME ? "".concat(padLeft(date.getHours()), ":").concat(padLeft(date.getMinutes())) : "".concat(date.getFullYear(), "-").concat(padLeft(date.getMonth() + 1), "-").concat(padLeft(date.getDate()))
|
});
|
}, function () {
|
_this3.$trigger('cancel', {}, {});
|
}, this.mode === mode.TIME ? {
|
time: getDate(this.value, mode.TIME),
|
popover: popover
|
} : {
|
date: getDate(this.value, mode.DATE),
|
minDate: getDate(this.start, mode.DATE),
|
maxDate: getDate(this.end, mode.DATE),
|
popover: popover
|
});
|
},
|
_showWeexPicker: function _showWeexPicker(data) {
|
var _this4 = this;
|
|
var res = {
|
event: 'cancel'
|
};
|
this.page = Object(page["a" /* showPage */])({
|
url: '__uniapppicker',
|
data: data,
|
style: {
|
titleNView: false,
|
animationType: 'none',
|
animationDuration: 0,
|
background: 'rgba(0,0,0,0)',
|
popGesture: 'none'
|
},
|
onMessage: function onMessage(message) {
|
var event = message.event;
|
|
if (event === 'created') {
|
_this4._updatePicker(data);
|
|
return;
|
}
|
|
if (event === 'columnchange') {
|
delete message.event;
|
|
_this4.$trigger(event, {}, message);
|
|
return;
|
}
|
|
res = message;
|
},
|
onClose: function onClose() {
|
_this4.page = null;
|
var event = res.event;
|
delete res.event;
|
|
_this4.$trigger(event, {}, res);
|
}
|
});
|
},
|
_showWebviewPicker: function _showWebviewPicker(data) {
|
var _this5 = this;
|
|
showPicker(data, function (res) {
|
var event = res.event;
|
delete res.event;
|
|
_this5.$trigger(event, {}, res);
|
});
|
},
|
_getFormData: function _getFormData() {
|
return {
|
value: this.valueSync,
|
key: this.name
|
};
|
},
|
_resetFormData: function _resetFormData() {
|
switch (this.mode) {
|
case mode.SELECTOR:
|
this.valueSync = 0;
|
break;
|
|
case mode.MULTISELECTOR:
|
this.valueSync = this.value.map(function (val) {
|
return 0;
|
});
|
break;
|
|
case mode.DATE:
|
case mode.TIME:
|
this.valueSync = '';
|
break;
|
|
default:
|
break;
|
}
|
},
|
_updatePicker: function _updatePicker(data) {
|
var _this6 = this;
|
|
webview_exists(function (exists) {
|
if (exists) {
|
updatePicker(data);
|
} else {
|
_this6.page && _this6.page.sendMessage(data);
|
}
|
});
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/picker/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_pickervue_type_script_lang_js_ = (pickervue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/picker/index.vue?vue&type=style&index=0&lang=css&
|
var pickervue_type_style_index_0_lang_css_ = __webpack_require__(159);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/picker/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_pickervue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/platforms/app-plus/view/components/picker/index.vue"
|
/* harmony default export */ var picker = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 166 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/audio/index.vue?vue&type=template&id=efd2c61a&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-audio",
|
_vm._g({ attrs: { id: _vm.id, controls: !!_vm.controls } }, _vm.$listeners),
|
[
|
_c("audio", {
|
ref: "audio",
|
staticStyle: { display: "none" },
|
attrs: { loop: _vm.loop }
|
}),
|
_c("div", { staticClass: "uni-audio-default" }, [
|
_c(
|
"div",
|
{
|
staticClass: "uni-audio-left",
|
style:
|
"background-image: url(" + _vm.$getRealPath(_vm.poster) + ");"
|
},
|
[
|
_c("div", {
|
staticClass: "uni-audio-button",
|
class: { play: !_vm.playing, pause: _vm.playing },
|
on: { click: _vm.trigger }
|
})
|
]
|
),
|
_c("div", { staticClass: "uni-audio-right" }, [
|
_c("div", { staticClass: "uni-audio-time" }, [
|
_vm._v(" " + _vm._s(_vm.currentTime) + " ")
|
]),
|
_c("div", { staticClass: "uni-audio-info" }, [
|
_c("div", { staticClass: "uni-audio-name" }, [
|
_vm._v(" " + _vm._s(_vm.name) + " ")
|
]),
|
_c("div", { staticClass: "uni-audio-author" }, [
|
_vm._v(" " + _vm._s(_vm.author) + " ")
|
])
|
])
|
])
|
])
|
]
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/audio/index.vue?vue&type=template&id=efd2c61a&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/audio/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var audiovue_type_script_lang_js_ = ({
|
name: 'Audio',
|
mixins: [mixins["f" /* subscriber */]],
|
props: {
|
id: {
|
type: String,
|
default: ''
|
},
|
src: {
|
type: String,
|
default: ''
|
},
|
loop: {
|
type: [Boolean, String],
|
default: false
|
},
|
controls: {
|
type: [Boolean, String],
|
default: false
|
},
|
poster: {
|
type: String,
|
default: ''
|
},
|
name: {
|
type: String,
|
default: ''
|
},
|
author: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
playing: false,
|
currentTime: this.getTime(0)
|
};
|
},
|
watch: {
|
src: function src(val) {
|
if (this.$refs.audio) {
|
this.$refs.audio.src = this.$getRealPath(val);
|
}
|
}
|
},
|
mounted: function mounted() {
|
var _this = this;
|
|
var audio = this.$refs.audio;
|
audio.addEventListener('error', function ($event) {
|
_this.playing = false;
|
|
_this.$trigger('error', $event, {});
|
});
|
audio.addEventListener('play', function ($event) {
|
_this.playing = true;
|
|
_this.$trigger('play', $event, {});
|
});
|
audio.addEventListener('pause', function ($event) {
|
_this.playing = false;
|
|
_this.$trigger('pause', $event, {});
|
});
|
audio.addEventListener('ended', function ($event) {
|
_this.playing = false;
|
|
_this.$trigger('ended', $event, {});
|
});
|
audio.addEventListener('timeupdate', function ($event) {
|
var currentTime = audio.currentTime;
|
_this.currentTime = _this.getTime(currentTime);
|
var duration = audio.duration;
|
|
_this.$trigger('timeupdate', $event, {
|
currentTime: currentTime,
|
duration: duration
|
});
|
});
|
audio.src = this.$getRealPath(this.src);
|
},
|
methods: {
|
_handleSubscribe: function _handleSubscribe(_ref) {
|
var type = _ref.type,
|
_ref$data = _ref.data,
|
data = _ref$data === void 0 ? {} : _ref$data;
|
var audio = this.$refs.audio;
|
|
switch (type) {
|
case 'setSrc':
|
audio.src = this.$getRealPath(data.src);
|
this.$emit('update:src', data.src);
|
break;
|
|
case 'play':
|
audio.play();
|
break;
|
|
case 'pause':
|
audio.pause();
|
break;
|
|
case 'seek':
|
audio.currentTime = data.position;
|
break;
|
}
|
},
|
trigger: function trigger() {
|
if (this.playing) {
|
this.$refs.audio.pause();
|
} else {
|
this.$refs.audio.play();
|
}
|
},
|
getTime: function getTime(time) {
|
var h = Math.floor(time / 3600);
|
var m = Math.floor(time % 3600 / 60);
|
var s = Math.floor(time % 3600 % 60);
|
h = (h < 10 ? '0' : '') + h;
|
m = (m < 10 ? '0' : '') + m;
|
s = (s < 10 ? '0' : '') + s;
|
var str = m + ':' + s;
|
|
if (h !== '00') {
|
str = h + ':' + str;
|
}
|
|
return str;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/audio/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_audiovue_type_script_lang_js_ = (audiovue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/audio/index.vue?vue&type=style&index=0&lang=css&
|
var audiovue_type_style_index_0_lang_css_ = __webpack_require__(118);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/audio/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_audiovue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/audio/index.vue"
|
/* harmony default export */ var audio = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 167 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/checkbox-group/index.vue?vue&type=template&id=37cde58e&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-checkbox-group",
|
_vm._g({}, _vm.$listeners),
|
[_vm._t("default")],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/checkbox-group/index.vue?vue&type=template&id=37cde58e&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/checkbox-group/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var checkbox_groupvue_type_script_lang_js_ = ({
|
name: 'CheckboxGroup',
|
mixins: [mixins["a" /* emitter */], mixins["e" /* listeners */]],
|
props: {
|
name: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
checkboxList: []
|
};
|
},
|
listeners: {
|
'@checkbox-change': '_changeHandler',
|
'@checkbox-group-update': '_checkboxGroupUpdateHandler'
|
},
|
created: function created() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_changeHandler: function _changeHandler($event) {
|
var value = [];
|
this.checkboxList.forEach(function (vm) {
|
if (vm.checkboxChecked) {
|
value.push(vm.value);
|
}
|
});
|
this.$trigger('change', $event, {
|
value: value
|
});
|
},
|
_checkboxGroupUpdateHandler: function _checkboxGroupUpdateHandler($event) {
|
if ($event.type === 'add') {
|
this.checkboxList.push($event.vm);
|
} else {
|
var index = this.checkboxList.indexOf($event.vm);
|
this.checkboxList.splice(index, 1);
|
}
|
},
|
_getFormData: function _getFormData() {
|
var data = {};
|
|
if (this.name !== '') {
|
var value = [];
|
this.checkboxList.forEach(function (vm) {
|
if (vm.checkboxChecked) {
|
value.push(vm.value);
|
}
|
});
|
data.value = value;
|
data.key = this.name;
|
}
|
|
return data;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/checkbox-group/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_checkbox_groupvue_type_script_lang_js_ = (checkbox_groupvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/checkbox-group/index.vue?vue&type=style&index=0&lang=css&
|
var checkbox_groupvue_type_style_index_0_lang_css_ = __webpack_require__(129);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/checkbox-group/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_checkbox_groupvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/checkbox-group/index.vue"
|
/* harmony default export */ var checkbox_group = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 168 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/checkbox/index.vue?vue&type=template&id=a63c1348&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-checkbox",
|
_vm._g(
|
{ attrs: { disabled: _vm.disabled }, on: { click: _vm._onClick } },
|
_vm.$listeners
|
),
|
[
|
_c(
|
"div",
|
{ staticClass: "uni-checkbox-wrapper" },
|
[
|
_c("div", {
|
staticClass: "uni-checkbox-input",
|
class: {
|
"uni-checkbox-input-checked": _vm.checkboxChecked,
|
"uni-checkbox-input-disabled": _vm.disabled
|
},
|
style: { color: _vm.color }
|
}),
|
_vm._t("default")
|
],
|
2
|
)
|
]
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/checkbox/index.vue?vue&type=template&id=a63c1348&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/checkbox/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var checkboxvue_type_script_lang_js_ = ({
|
name: 'Checkbox',
|
mixins: [mixins["a" /* emitter */], mixins["e" /* listeners */]],
|
props: {
|
checked: {
|
type: [Boolean, String],
|
default: false
|
},
|
id: {
|
type: String,
|
default: ''
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
color: {
|
type: String,
|
default: '#007aff'
|
},
|
value: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
checkboxChecked: this.checked,
|
checkboxValue: this.value
|
};
|
},
|
watch: {
|
checked: function checked(val) {
|
this.checkboxChecked = val;
|
},
|
value: function value(val) {
|
this.checkboxValue = val;
|
}
|
},
|
listeners: {
|
'label-click': '_onClick',
|
'@label-click': '_onClick'
|
},
|
created: function created() {
|
this.$dispatch('CheckboxGroup', 'uni-checkbox-group-update', {
|
type: 'add',
|
vm: this
|
});
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('CheckboxGroup', 'uni-checkbox-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_onClick: function _onClick($event) {
|
if (this.disabled) {
|
return;
|
}
|
|
this.checkboxChecked = !this.checkboxChecked;
|
this.$dispatch('CheckboxGroup', 'uni-checkbox-change', $event);
|
},
|
_resetFormData: function _resetFormData() {
|
this.checkboxChecked = false;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/checkbox/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_checkboxvue_type_script_lang_js_ = (checkboxvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/checkbox/index.vue?vue&type=style&index=0&lang=css&
|
var checkboxvue_type_style_index_0_lang_css_ = __webpack_require__(130);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/checkbox/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_checkboxvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/checkbox/index.vue"
|
/* harmony default export */ var components_checkbox = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 169 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/form/index.vue?vue&type=template&id=7735a91d&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-form", _vm._g({}, _vm.$listeners), [
|
_c("span", [_vm._t("default")], 2)
|
])
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/form/index.vue?vue&type=template&id=7735a91d&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/form/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var formvue_type_script_lang_js_ = ({
|
name: 'Form',
|
mixins: [mixins["e" /* listeners */]],
|
data: function data() {
|
return {
|
childrenList: []
|
};
|
},
|
listeners: {
|
'@form-submit': '_onSubmit',
|
'@form-reset': '_onReset',
|
'@form-group-update': '_formGroupUpdateHandler'
|
},
|
methods: {
|
_onSubmit: function _onSubmit($event) {
|
var data = {};
|
this.childrenList.forEach(function (vm) {
|
if (vm._getFormData && vm._getFormData().key) {
|
data[vm._getFormData().key] = vm._getFormData().value;
|
}
|
});
|
this.$trigger('submit', $event, {
|
value: data
|
});
|
},
|
_onReset: function _onReset($event) {
|
this.$trigger('reset', $event, {});
|
this.childrenList.forEach(function (vm) {
|
vm._resetFormData && vm._resetFormData();
|
});
|
},
|
_formGroupUpdateHandler: function _formGroupUpdateHandler($event) {
|
if ($event.type === 'add') {
|
this.childrenList.push($event.vm);
|
} else {
|
var index = this.childrenList.indexOf($event.vm);
|
this.childrenList.splice(index, 1);
|
}
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/form/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_formvue_type_script_lang_js_ = (formvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/form/index.vue
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_formvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/form/index.vue"
|
/* harmony default export */ var components_form = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 170 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/icon/index.vue?vue&type=template&id=6c7a7a92&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-icon", _vm._g({}, _vm.$listeners), [
|
_c("i", {
|
class: "uni-icon-" + _vm.type,
|
style: { "font-size": _vm._converPx(_vm.size), color: _vm.color },
|
attrs: { role: "img" }
|
})
|
])
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/icon/index.vue?vue&type=template&id=6c7a7a92&
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/icon/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
/* harmony default export */ var iconvue_type_script_lang_js_ = ({
|
name: 'Icon',
|
props: {
|
type: {
|
type: String,
|
required: true,
|
default: ''
|
},
|
size: {
|
type: [String, Number],
|
default: 23
|
},
|
color: {
|
type: String,
|
default: ''
|
}
|
},
|
methods: {
|
_converPx: function _converPx(value) {
|
if (/^-?\d+[ur]px$/i.test(value)) {
|
return value.replace(/(^-?\d+)[ur]px$/i, function (text, num) {
|
return "".concat(uni.upx2px(parseFloat(num)), "px");
|
}); // eslint-disable-next-line no-useless-escape
|
} else if (/^-?[\d\.]+$/.test(value)) {
|
return "".concat(value, "px");
|
}
|
|
return value || '';
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/icon/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_iconvue_type_script_lang_js_ = (iconvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/icon/index.vue?vue&type=style&index=0&lang=css&
|
var iconvue_type_style_index_0_lang_css_ = __webpack_require__(132);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/icon/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_iconvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/icon/index.vue"
|
/* harmony default export */ var icon = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 171 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/image/index.vue?vue&type=template&id=c7af6f90&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-image",
|
_vm._g({}, _vm.$listeners),
|
[
|
_c("div", { ref: "content", style: _vm.style }),
|
_vm.contentPath
|
? _c("img", {
|
attrs: { src: _vm.contentPath, draggable: _vm.draggable }
|
})
|
: _vm._e(),
|
_vm.mode === "widthFix" || _vm.mode === "heightFix"
|
? _c("v-uni-resize-sensor", {
|
ref: "sensor",
|
on: {
|
resize: function($event) {
|
return _vm._fixSize()
|
}
|
}
|
})
|
: _vm._e()
|
],
|
1
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/image/index.vue?vue&type=template&id=c7af6f90&
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/image/index.vue?vue&type=script&lang=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); }
|
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
function fixNumber(number) {
|
// fix: 解决 Chrome 浏览器上某些情况下导致 1px 缝隙的问题
|
if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) && navigator.vendor === 'Google Inc.' && number > 10) {
|
number = Math.round(number / 2) * 2;
|
}
|
|
return number;
|
}
|
|
/* harmony default export */ var imagevue_type_script_lang_js_ = ({
|
name: 'Image',
|
props: {
|
src: {
|
type: String,
|
default: ''
|
},
|
mode: {
|
type: String,
|
default: 'scaleToFill'
|
},
|
// TODO 懒加载
|
lazyLoad: {
|
type: [Boolean, String],
|
default: false
|
},
|
draggable: {
|
type: Boolean,
|
default: true
|
}
|
},
|
data: function data() {
|
return {
|
originalWidth: 0,
|
originalHeight: 0,
|
originalStyle: {
|
width: '',
|
height: ''
|
},
|
contentPath: ''
|
};
|
},
|
computed: {
|
ratio: function ratio() {
|
return this.originalWidth && this.originalHeight ? this.originalWidth / this.originalHeight : 0;
|
},
|
style: function style() {
|
var size = 'auto';
|
var position = '';
|
var repeat = 'no-repeat';
|
|
switch (this.mode) {
|
case 'aspectFit':
|
size = 'contain';
|
position = 'center center';
|
break;
|
|
case 'aspectFill':
|
size = 'cover';
|
position = 'center center';
|
break;
|
|
case 'widthFix':
|
case 'heightFix':
|
size = '100% 100%';
|
break;
|
|
case 'top':
|
position = 'center top';
|
break;
|
|
case 'bottom':
|
position = 'center bottom';
|
break;
|
|
case 'center':
|
position = 'center center';
|
break;
|
|
case 'left':
|
position = 'left center';
|
break;
|
|
case 'right':
|
position = 'right center';
|
break;
|
|
case 'top left':
|
position = 'left top';
|
break;
|
|
case 'top right':
|
position = 'right top';
|
break;
|
|
case 'bottom left':
|
position = 'left bottom';
|
break;
|
|
case 'bottom right':
|
position = 'right bottom';
|
break;
|
|
default:
|
size = '100% 100%';
|
position = '0% 0%';
|
break;
|
}
|
|
return {
|
'background-image': this.contentPath ? "url(\"".concat(this.contentPath, "\")") : 'none',
|
'background-position': position,
|
'background-size': size,
|
'background-repeat': repeat
|
};
|
}
|
},
|
watch: {
|
src: function src(newValue, oldValue) {
|
this._loadImage();
|
},
|
mode: function mode(newValue, oldValue) {
|
if (oldValue === 'widthFix' || oldValue === 'heightFix') {
|
this._resetSize();
|
}
|
|
if (newValue === 'widthFix' || newValue === 'heightFix') {
|
this._fixSize();
|
}
|
}
|
},
|
mounted: function mounted() {
|
this.originalStyle.width = this.$el.style.width || '';
|
this.originalStyle.height = this.$el.style.height || '';
|
|
this._loadImage();
|
},
|
beforeDestroy: function beforeDestroy() {
|
this._clearImage();
|
},
|
methods: {
|
_fixSize: function _fixSize() {
|
if (this.ratio) {
|
var $el = this.$el;
|
|
if (this.mode === 'widthFix') {
|
var width = $el.offsetWidth;
|
|
if (width) {
|
$el.style.height = fixNumber(width / this.ratio) + 'px';
|
}
|
} else if (this.mode === 'heightFix') {
|
var height = $el.offsetHeight;
|
|
if (height) {
|
$el.style.width = fixNumber(height * this.ratio) + 'px';
|
}
|
}
|
}
|
|
window.dispatchEvent(new CustomEvent('updateview'));
|
},
|
_resetSize: function _resetSize() {
|
this.$el.style.width = this.originalStyle.width;
|
this.$el.style.height = this.originalStyle.height;
|
},
|
_resetData: function _resetData() {
|
this.originalWidth = 0;
|
this.originalHeight = 0;
|
this.contentPath = '';
|
},
|
_loadImage: function _loadImage() {
|
var _this = this;
|
|
var realImagePath = this.$getRealPath(this.src);
|
|
if (realImagePath) {
|
var img = this._img = this._img || new Image();
|
|
img.onload = function ($event) {
|
_this._img = null;
|
_this.originalWidth = img.width;
|
_this.originalHeight = img.height;
|
|
_this._fixSize();
|
|
_this.contentPath = realImagePath;
|
|
_this.$trigger('load', $event, {
|
width: img.width,
|
height: img.height
|
});
|
};
|
|
img.onerror = function ($event) {
|
_this._img = null;
|
|
_this._resetData(); // 与微信小程序保持一致,保留之前样式
|
// this._resetSize()
|
|
|
_this.$trigger('error', $event, {
|
errMsg: "GET ".concat(_this.src, " 404 (Not Found)")
|
});
|
};
|
|
img.src = realImagePath;
|
} else {
|
this._clearImage();
|
|
this._resetData(); // 与微信小程序保持一致,保留之前样式
|
// this._resetSize()
|
|
}
|
},
|
_clearImage: function _clearImage() {
|
var img = this._img;
|
|
if (img) {
|
img.onload = null;
|
img.onerror = null;
|
this._img = null;
|
}
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/image/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_imagevue_type_script_lang_js_ = (imagevue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/image/index.vue?vue&type=style&index=0&lang=css&
|
var imagevue_type_style_index_0_lang_css_ = __webpack_require__(133);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/image/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_imagevue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/image/index.vue"
|
/* harmony default export */ var components_image = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 172 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/input/index.vue?vue&type=template&id=c65e1032&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-input", _vm._g({}, _vm.$listeners), [
|
_c("div", { ref: "wrapper", staticClass: "uni-input-wrapper" }, [
|
_c("div", {
|
directives: [
|
{
|
name: "show",
|
rawName: "v-show",
|
value: !(
|
_vm.composing ||
|
_vm.valueSync.length ||
|
_vm.cachedValue === "-"
|
),
|
expression:
|
"!(composing || valueSync.length || cachedValue === '-')"
|
}
|
],
|
ref: "placeholder",
|
staticClass: "uni-input-placeholder",
|
class: _vm.placeholderClass,
|
style: _vm.placeholderStyle,
|
domProps: { textContent: _vm._s(_vm.placeholder) }
|
}),
|
_vm.inputType === "checkbox" && (!_vm.disabled || !_vm.fixColor)
|
? _c("input", {
|
directives: [
|
{
|
name: "model",
|
rawName: "v-model",
|
value: _vm.valueSync,
|
expression: "valueSync"
|
},
|
{ name: "keyboard", rawName: "v-keyboard" },
|
{ name: "field", rawName: "v-field" }
|
],
|
ref: "input",
|
staticClass: "uni-input-input",
|
attrs: {
|
disabled: _vm.disabled,
|
maxlength: _vm.maxlength,
|
step: _vm.step,
|
enterkeyhint: _vm.confirmType,
|
pattern: _vm.type === "number" ? "[0-9]*" : null,
|
autocomplete: _vm.autocomplete,
|
type: "checkbox"
|
},
|
domProps: {
|
checked: Array.isArray(_vm.valueSync)
|
? _vm._i(_vm.valueSync, null) > -1
|
: _vm.valueSync
|
},
|
on: {
|
change: [
|
function($event) {
|
var $$a = _vm.valueSync,
|
$$el = $event.target,
|
$$c = $$el.checked ? true : false
|
if (Array.isArray($$a)) {
|
var $$v = null,
|
$$i = _vm._i($$a, $$v)
|
if ($$el.checked) {
|
$$i < 0 && (_vm.valueSync = $$a.concat([$$v]))
|
} else {
|
$$i > -1 &&
|
(_vm.valueSync = $$a
|
.slice(0, $$i)
|
.concat($$a.slice($$i + 1)))
|
}
|
} else {
|
_vm.valueSync = $$c
|
}
|
},
|
function($event) {
|
$event.stopPropagation()
|
}
|
],
|
focus: _vm._onFocus,
|
blur: _vm._onBlur,
|
input: function($event) {
|
$event.stopPropagation()
|
return _vm._onInput($event)
|
},
|
compositionstart: function($event) {
|
$event.stopPropagation()
|
return _vm._onComposition($event)
|
},
|
compositionend: function($event) {
|
$event.stopPropagation()
|
return _vm._onComposition($event)
|
},
|
keyup: function($event) {
|
if (
|
!$event.type.indexOf("key") &&
|
_vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
|
) {
|
return null
|
}
|
$event.stopPropagation()
|
return _vm._onKeyup($event)
|
}
|
}
|
})
|
: _vm.inputType === "radio" && (!_vm.disabled || !_vm.fixColor)
|
? _c("input", {
|
directives: [
|
{
|
name: "model",
|
rawName: "v-model",
|
value: _vm.valueSync,
|
expression: "valueSync"
|
},
|
{ name: "keyboard", rawName: "v-keyboard" },
|
{ name: "field", rawName: "v-field" }
|
],
|
ref: "input",
|
staticClass: "uni-input-input",
|
attrs: {
|
disabled: _vm.disabled,
|
maxlength: _vm.maxlength,
|
step: _vm.step,
|
enterkeyhint: _vm.confirmType,
|
pattern: _vm.type === "number" ? "[0-9]*" : null,
|
autocomplete: _vm.autocomplete,
|
type: "radio"
|
},
|
domProps: { checked: _vm._q(_vm.valueSync, null) },
|
on: {
|
change: [
|
function($event) {
|
_vm.valueSync = null
|
},
|
function($event) {
|
$event.stopPropagation()
|
}
|
],
|
focus: _vm._onFocus,
|
blur: _vm._onBlur,
|
input: function($event) {
|
$event.stopPropagation()
|
return _vm._onInput($event)
|
},
|
compositionstart: function($event) {
|
$event.stopPropagation()
|
return _vm._onComposition($event)
|
},
|
compositionend: function($event) {
|
$event.stopPropagation()
|
return _vm._onComposition($event)
|
},
|
keyup: function($event) {
|
if (
|
!$event.type.indexOf("key") &&
|
_vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
|
) {
|
return null
|
}
|
$event.stopPropagation()
|
return _vm._onKeyup($event)
|
}
|
}
|
})
|
: !_vm.disabled || !_vm.fixColor
|
? _c("input", {
|
directives: [
|
{
|
name: "model",
|
rawName: "v-model",
|
value: _vm.valueSync,
|
expression: "valueSync"
|
},
|
{ name: "keyboard", rawName: "v-keyboard" },
|
{ name: "field", rawName: "v-field" }
|
],
|
ref: "input",
|
staticClass: "uni-input-input",
|
attrs: {
|
disabled: _vm.disabled,
|
maxlength: _vm.maxlength,
|
step: _vm.step,
|
enterkeyhint: _vm.confirmType,
|
pattern: _vm.type === "number" ? "[0-9]*" : null,
|
autocomplete: _vm.autocomplete,
|
type: _vm.inputType
|
},
|
domProps: { value: _vm.valueSync },
|
on: {
|
change: function($event) {
|
$event.stopPropagation()
|
},
|
focus: _vm._onFocus,
|
blur: _vm._onBlur,
|
input: [
|
function($event) {
|
if ($event.target.composing) {
|
return
|
}
|
_vm.valueSync = $event.target.value
|
},
|
function($event) {
|
$event.stopPropagation()
|
return _vm._onInput($event)
|
}
|
],
|
compositionstart: function($event) {
|
$event.stopPropagation()
|
return _vm._onComposition($event)
|
},
|
compositionend: function($event) {
|
$event.stopPropagation()
|
return _vm._onComposition($event)
|
},
|
keyup: function($event) {
|
if (
|
!$event.type.indexOf("key") &&
|
_vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
|
) {
|
return null
|
}
|
$event.stopPropagation()
|
return _vm._onKeyup($event)
|
}
|
}
|
})
|
: _vm._e(),
|
_vm.disabled && _vm.fixColor
|
? _c("input", {
|
ref: "input",
|
staticClass: "uni-input-input",
|
attrs: {
|
tabindex: "-1",
|
readonly: _vm.disabled,
|
type: _vm.inputType,
|
maxlength: _vm.maxlength,
|
step: _vm.step
|
},
|
domProps: { value: _vm.valueSync },
|
on: {
|
focus: function($event) {
|
return $event.target.blur()
|
}
|
}
|
})
|
: _vm._e()
|
])
|
])
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/input/index.vue?vue&type=template&id=c65e1032&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/input/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
var INPUT_TYPES = ['text', 'number', 'idcard', 'digit', 'password', 'tel'];
|
var NUMBER_TYPES = ['number', 'digit'];
|
var AUTOCOMPLETES = ['off', 'one-time-code'];
|
/* harmony default export */ var inputvue_type_script_lang_js_ = ({
|
name: 'Input',
|
mixins: [mixins["b" /* field */]],
|
props: {
|
name: {
|
type: String,
|
default: ''
|
},
|
type: {
|
type: String,
|
default: 'text'
|
},
|
password: {
|
type: [Boolean, String],
|
default: false
|
},
|
placeholder: {
|
type: String,
|
default: ''
|
},
|
placeholderStyle: {
|
type: String,
|
default: ''
|
},
|
placeholderClass: {
|
type: String,
|
default: 'input-placeholder'
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
maxlength: {
|
type: [Number, String],
|
default: 140
|
},
|
confirmType: {
|
type: String,
|
default: 'done'
|
},
|
textContentType: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
wrapperHeight: 0,
|
cachedValue: ''
|
};
|
},
|
computed: {
|
inputType: function inputType() {
|
var type = '';
|
|
switch (this.type) {
|
case 'text':
|
this.confirmType === 'search' && (type = 'search');
|
break;
|
|
case 'idcard':
|
// TODO 可能要根据不同平台进行区分处理
|
type = 'text';
|
break;
|
|
case 'digit':
|
type = 'number';
|
break;
|
|
default:
|
type = ~INPUT_TYPES.indexOf(this.type) ? this.type : 'text';
|
break;
|
}
|
|
return this.password ? 'password' : type;
|
},
|
step: function step() {
|
// 处理部分设备中无法输入小数点的问题
|
return ~NUMBER_TYPES.indexOf(this.type) ? '0.000000000000000001' : '';
|
},
|
autocomplete: function autocomplete() {
|
var camelizeIndex = AUTOCOMPLETES.indexOf(this.textContentType);
|
var kebabCaseIndex = AUTOCOMPLETES.indexOf(Object(shared["i" /* kebabCase */])(this.textContentType));
|
var index = camelizeIndex !== -1 ? camelizeIndex : kebabCaseIndex !== -1 ? kebabCaseIndex : 0;
|
return AUTOCOMPLETES[index];
|
}
|
},
|
watch: {
|
maxlength: function maxlength(value) {
|
var realValue = this.valueSync.slice(0, parseInt(value, 10));
|
realValue !== this.valueSync && (this.valueSync = realValue);
|
}
|
},
|
created: function created() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
mounted: function mounted() {
|
if (this.confirmType === 'search') {
|
var formElem = document.createElement('form');
|
formElem.action = '';
|
|
formElem.onsubmit = function () {
|
return false;
|
};
|
|
formElem.className = 'uni-input-form';
|
formElem.appendChild(this.$refs.input);
|
this.$refs.wrapper.appendChild(formElem);
|
}
|
|
var $vm = this;
|
|
while ($vm) {
|
var scopeId = $vm.$options._scopeId;
|
|
if (scopeId) {
|
this.$refs.placeholder.setAttribute(scopeId, '');
|
}
|
|
$vm = $vm.$parent;
|
}
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_onKeyup: function _onKeyup($event) {
|
this.$trigger('confirm', $event, {
|
value: $event.target.value
|
});
|
},
|
_onInput: function _onInput($event, force) {
|
var _this = this;
|
|
var outOfMaxlength = false;
|
|
if (this.composing) {
|
return;
|
}
|
|
if (this.inputType === 'number') {
|
// type="number" 不支持 maxlength 属性,因此需要主动限制长度。
|
var maxlength = parseInt(this.maxlength, 10);
|
|
if (maxlength > 0 && $event.target.value.length > maxlength) {
|
// 输入前字符长度超出范围,则不触发input,且将值还原
|
// 否则截取一定长度且触发input
|
if (this.cachedValue.length === maxlength) {
|
this.valueSync = this.cachedValue;
|
outOfMaxlength = true;
|
} else {
|
$event.target.value = $event.target.value.slice(0, maxlength);
|
this.valueSync = $event.target.value;
|
}
|
} // 数字类型输入错误时无法获取具体的值,自定义校验和纠正。
|
|
|
this.__clearCachedValue && $event.target.removeEventListener('blur', this.__clearCachedValue);
|
|
if ($event.target.validity && !$event.target.validity.valid) {
|
if (!this.cachedValue && $event.data === '-' || this.cachedValue[0] === '-' && $event.inputType === 'deleteContentBackward') {
|
this.cachedValue = '-';
|
|
var clearCachedValue = this.__clearCachedValue = function () {
|
_this.cachedValue = '';
|
};
|
|
$event.target.addEventListener('blur', clearCachedValue);
|
return;
|
}
|
|
this.cachedValue = this.valueSync = $event.target.value = this.cachedValue === '-' ? '' : this.cachedValue; // 输入非法字符不触发 input 事件
|
|
return;
|
} else {
|
this.cachedValue = this.valueSync;
|
}
|
}
|
|
if (outOfMaxlength) return;
|
this.$triggerInput($event, {
|
value: this.valueSync
|
}, force);
|
},
|
_onComposition: function _onComposition($event) {
|
if ($event.type === 'compositionstart') {
|
this.composing = true;
|
} else if (this.composing) {
|
this.composing = false; // 部分输入法 compositionend 事件可能晚于 input
|
|
this._onInput($event);
|
}
|
},
|
_resetFormData: function _resetFormData() {
|
this.valueSync = '';
|
},
|
_getFormData: function _getFormData() {
|
return this.name ? {
|
value: this.valueSync,
|
key: this.name
|
} : {};
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/input/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/input/index.vue?vue&type=style&index=0&lang=css&
|
var inputvue_type_style_index_0_lang_css_ = __webpack_require__(134);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/input/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_inputvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/input/index.vue"
|
/* harmony default export */ var input = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 173 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/navigator/index.vue?vue&type=template&id=c893a598&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _vm.hoverClass && _vm.hoverClass !== "none"
|
? _c(
|
"uni-navigator",
|
_vm._g(
|
{
|
class: [_vm.hovering ? _vm.hoverClass : ""],
|
on: {
|
touchstart: _vm._hoverTouchStart,
|
touchend: _vm._hoverTouchEnd,
|
touchcancel: _vm._hoverTouchCancel,
|
click: _vm._onClick
|
}
|
},
|
_vm.$listeners
|
),
|
[_vm._t("default")],
|
2
|
)
|
: _c(
|
"uni-navigator",
|
_vm._g({ on: { click: _vm._onClick } }, _vm.$listeners),
|
[_vm._t("default")],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/navigator/index.vue?vue&type=template&id=c893a598&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/navigator/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
var OPEN_TYPES = ['navigate', 'redirect', 'switchTab', 'reLaunch', 'navigateBack'];
|
/* harmony default export */ var navigatorvue_type_script_lang_js_ = ({
|
name: 'Navigator',
|
mixins: [mixins["c" /* hover */]],
|
props: {
|
hoverClass: {
|
type: String,
|
default: 'navigator-hover'
|
},
|
url: {
|
type: String,
|
default: ''
|
},
|
openType: {
|
type: String,
|
default: 'navigate',
|
validator: function validator(value) {
|
return ~OPEN_TYPES.indexOf(value);
|
}
|
},
|
delta: {
|
type: Number,
|
default: 1
|
},
|
hoverStartTime: {
|
type: [Number, String],
|
default: 20
|
},
|
hoverStayTime: {
|
type: [Number, String],
|
default: 600
|
},
|
exists: {
|
type: String,
|
default: ''
|
}
|
},
|
methods: {
|
_onClick: function _onClick($event) {
|
if (this.openType !== 'navigateBack' && !this.url) {
|
console.error('<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab');
|
return;
|
}
|
|
switch (this.openType) {
|
case 'navigate':
|
uni.navigateTo({
|
url: this.url
|
});
|
break;
|
|
case 'redirect':
|
uni.redirectTo({
|
url: this.url,
|
exists: this.exists
|
});
|
break;
|
|
case 'switchTab':
|
uni.switchTab({
|
url: this.url
|
});
|
break;
|
|
case 'reLaunch':
|
uni.reLaunch({
|
url: this.url
|
});
|
break;
|
|
case 'navigateBack':
|
uni.navigateBack({
|
delta: this.delta
|
});
|
break;
|
|
default:
|
break;
|
}
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/navigator/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_navigatorvue_type_script_lang_js_ = (navigatorvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/navigator/index.vue?vue&type=style&index=0&lang=css&
|
var navigatorvue_type_style_index_0_lang_css_ = __webpack_require__(138);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/navigator/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_navigatorvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/navigator/index.vue"
|
/* harmony default export */ var components_navigator = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 174 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/progress/index.vue?vue&type=template&id=34f62046&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-progress",
|
_vm._g({ staticClass: "uni-progress" }, _vm.$listeners),
|
[
|
_c("div", { staticClass: "uni-progress-bar", style: _vm.outerBarStyle }, [
|
_c("div", {
|
staticClass: "uni-progress-inner-bar",
|
style: _vm.innerBarStyle
|
})
|
]),
|
_vm.showInfo
|
? [
|
_c("p", { staticClass: "uni-progress-info" }, [
|
_vm._v(" " + _vm._s(_vm.currentPercent) + "% ")
|
])
|
]
|
: _vm._e()
|
],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/progress/index.vue?vue&type=template&id=34f62046&
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/progress/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
var VALUES = {
|
activeColor: '#007AFF',
|
backgroundColor: '#EBEBEB',
|
activeMode: 'backwards'
|
};
|
/* harmony default export */ var progressvue_type_script_lang_js_ = ({
|
name: 'Progress',
|
props: {
|
percent: {
|
type: [Number, String],
|
default: 0,
|
validator: function validator(value) {
|
return !isNaN(parseFloat(value, 10));
|
}
|
},
|
showInfo: {
|
type: [Boolean, String],
|
default: false
|
},
|
strokeWidth: {
|
type: [Number, String],
|
default: 6,
|
validator: function validator(value) {
|
return !isNaN(parseFloat(value, 10));
|
}
|
},
|
color: {
|
type: String,
|
default: VALUES.activeColor
|
},
|
activeColor: {
|
type: String,
|
default: VALUES.activeColor
|
},
|
backgroundColor: {
|
type: String,
|
default: VALUES.backgroundColor
|
},
|
active: {
|
type: [Boolean, String],
|
default: false
|
},
|
activeMode: {
|
type: String,
|
default: VALUES.activeMode
|
},
|
duration: {
|
type: [Number, String],
|
default: 30,
|
validator: function validator(value) {
|
return !isNaN(parseFloat(value, 10));
|
}
|
}
|
},
|
data: function data() {
|
return {
|
currentPercent: 0,
|
strokeTimer: 0,
|
lastPercent: 0
|
};
|
},
|
computed: {
|
outerBarStyle: function outerBarStyle() {
|
return "background-color: ".concat(this.backgroundColor, "; height: ").concat(this.strokeWidth, "px;");
|
},
|
innerBarStyle: function innerBarStyle() {
|
// 兼容下不推荐的属性,activeColor 优先级高于 color。
|
var backgroundColor = '';
|
|
if (this.color !== VALUES.activeColor && this.activeColor === VALUES.activeColor) {
|
backgroundColor = this.color;
|
} else {
|
backgroundColor = this.activeColor;
|
}
|
|
return "width: ".concat(this.currentPercent, "%;background-color: ").concat(backgroundColor);
|
},
|
realPercent: function realPercent() {
|
// 确保最终计算时使用的是 Number 类型的值,并且在有效范围内。
|
var realValue = parseFloat(this.percent, 10);
|
realValue < 0 && (realValue = 0);
|
realValue > 100 && (realValue = 100);
|
return realValue;
|
}
|
},
|
watch: {
|
realPercent: function realPercent(newValue, oldValue) {
|
this.strokeTimer && clearInterval(this.strokeTimer);
|
this.lastPercent = oldValue || 0;
|
|
this._activeAnimation();
|
}
|
},
|
created: function created() {
|
this._activeAnimation();
|
},
|
methods: {
|
_activeAnimation: function _activeAnimation() {
|
var _this = this;
|
|
if (this.active) {
|
this.currentPercent = this.activeMode === VALUES.activeMode ? 0 : this.lastPercent;
|
this.strokeTimer = setInterval(function () {
|
if (_this.currentPercent + 1 > _this.realPercent) {
|
_this.currentPercent = _this.realPercent;
|
_this.strokeTimer && clearInterval(_this.strokeTimer);
|
} else {
|
_this.currentPercent += 1;
|
}
|
}, parseFloat(this.duration));
|
} else {
|
this.currentPercent = this.realPercent;
|
}
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/progress/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_progressvue_type_script_lang_js_ = (progressvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/progress/index.vue?vue&type=style&index=0&lang=css&
|
var progressvue_type_style_index_0_lang_css_ = __webpack_require__(141);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/progress/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_progressvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/progress/index.vue"
|
/* harmony default export */ var progress = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 175 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/radio-group/index.vue?vue&type=template&id=17be8d0a&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-radio-group",
|
_vm._g({}, _vm.$listeners),
|
[_vm._t("default")],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/radio-group/index.vue?vue&type=template&id=17be8d0a&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/radio-group/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var radio_groupvue_type_script_lang_js_ = ({
|
name: 'RadioGroup',
|
mixins: [mixins["a" /* emitter */], mixins["e" /* listeners */]],
|
props: {
|
name: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
radioList: []
|
};
|
},
|
listeners: {
|
'@radio-change': '_changeHandler',
|
'@radio-group-update': '_radioGroupUpdateHandler'
|
},
|
mounted: function mounted() {
|
this._resetRadioGroupValue(this.radioList.length - 1);
|
},
|
created: function created() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_changeHandler: function _changeHandler($event, vm) {
|
var index = this.radioList.indexOf(vm);
|
|
this._resetRadioGroupValue(index, true);
|
|
this.$trigger('change', $event, {
|
value: vm.radioValue
|
});
|
},
|
_radioGroupUpdateHandler: function _radioGroupUpdateHandler($event) {
|
if ($event.type === 'add') {
|
this.radioList.push($event.vm);
|
} else {
|
var index = this.radioList.indexOf($event.vm);
|
this.radioList.splice(index, 1);
|
}
|
},
|
_resetRadioGroupValue: function _resetRadioGroupValue(key, change) {
|
var _this = this;
|
|
this.radioList.forEach(function (value, index) {
|
if (index === key) {
|
return;
|
}
|
|
if (change) {
|
_this.radioList[index].radioChecked = false;
|
} else {
|
_this.radioList.forEach(function (v, i) {
|
if (index >= i) {
|
return;
|
}
|
|
if (_this.radioList[i].radioChecked) {
|
_this.radioList[index].radioChecked = false;
|
}
|
});
|
}
|
});
|
},
|
_getFormData: function _getFormData() {
|
var data = {};
|
|
if (this.name !== '') {
|
var value = '';
|
this.radioList.forEach(function (vm) {
|
if (vm.radioChecked) {
|
value = vm.value;
|
}
|
});
|
data.value = value;
|
data.key = this.name;
|
}
|
|
return data;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/radio-group/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_radio_groupvue_type_script_lang_js_ = (radio_groupvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/radio-group/index.vue?vue&type=style&index=0&lang=css&
|
var radio_groupvue_type_style_index_0_lang_css_ = __webpack_require__(142);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/radio-group/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_radio_groupvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/radio-group/index.vue"
|
/* harmony default export */ var radio_group = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 176 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/radio/index.vue?vue&type=template&id=4b562a50&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-radio",
|
_vm._g(
|
{ attrs: { disabled: _vm.disabled }, on: { click: _vm._onClick } },
|
_vm.$listeners
|
),
|
[
|
_c(
|
"div",
|
{ staticClass: "uni-radio-wrapper" },
|
[
|
_c("div", {
|
staticClass: "uni-radio-input",
|
class: _vm.radioChecked ? "uni-radio-input-checked" : "",
|
style: _vm.radioChecked ? _vm.checkedStyle : ""
|
}),
|
_vm._t("default")
|
],
|
2
|
)
|
]
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/radio/index.vue?vue&type=template&id=4b562a50&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/radio/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var radiovue_type_script_lang_js_ = ({
|
name: 'Radio',
|
mixins: [mixins["a" /* emitter */], mixins["e" /* listeners */]],
|
props: {
|
checked: {
|
type: [Boolean, String],
|
default: false
|
},
|
id: {
|
type: String,
|
default: ''
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
color: {
|
type: String,
|
default: '#007AFF'
|
},
|
value: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
radioChecked: this.checked,
|
radioValue: this.value
|
};
|
},
|
computed: {
|
checkedStyle: function checkedStyle() {
|
return "background-color: ".concat(this.color, ";border-color: ").concat(this.color, ";");
|
}
|
},
|
watch: {
|
checked: function checked(val) {
|
this.radioChecked = val;
|
},
|
value: function value(val) {
|
this.radioValue = val;
|
}
|
},
|
listeners: {
|
'label-click': '_onClick',
|
'@label-click': '_onClick'
|
},
|
created: function created() {
|
this.$dispatch('RadioGroup', 'uni-radio-group-update', {
|
type: 'add',
|
vm: this
|
});
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('RadioGroup', 'uni-radio-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_onClick: function _onClick($event) {
|
if (this.disabled || this.radioChecked) {
|
return;
|
}
|
|
this.radioChecked = true;
|
this.$dispatch('RadioGroup', 'uni-radio-change', $event, this);
|
},
|
_resetFormData: function _resetFormData() {
|
this.radioChecked = this.min;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/radio/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_radiovue_type_script_lang_js_ = (radiovue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/radio/index.vue?vue&type=style&index=0&lang=css&
|
var radiovue_type_style_index_0_lang_css_ = __webpack_require__(143);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/radio/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_radiovue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/radio/index.vue"
|
/* harmony default export */ var components_radio = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 177 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/resize-sensor/index.vue?vue&type=template&id=59100dd0&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-resize-sensor",
|
{
|
on: {
|
"~animationstart": function($event) {
|
return _vm.update($event)
|
}
|
}
|
},
|
[
|
_c("div", { on: { scroll: _vm.update } }, [_c("div")]),
|
_c("div", { on: { scroll: _vm.update } }, [_c("div")])
|
]
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/resize-sensor/index.vue?vue&type=template&id=59100dd0&
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/resize-sensor/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
var MAX = 100000;
|
/* harmony default export */ var resize_sensorvue_type_script_lang_js_ = ({
|
name: 'ResizeSensor',
|
props: {
|
initial: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
size: {
|
width: -1,
|
height: -1
|
}
|
};
|
},
|
watch: {
|
size: {
|
deep: true,
|
handler: function handler(size) {
|
this.$emit('resize', Object.assign({}, size));
|
}
|
}
|
},
|
mounted: function mounted() {
|
if (this.initial === true) {
|
this.$nextTick(this.update);
|
}
|
|
if (this.$el.offsetParent !== this.$el.parentNode) {
|
this.$el.parentNode.style.position = 'relative';
|
}
|
|
if (!('AnimationEvent' in window)) {
|
this.reset();
|
}
|
},
|
activated: function activated() {
|
this.reset();
|
},
|
methods: {
|
reset: function reset() {
|
var expand = this.$el.firstChild;
|
expand.scrollLeft = MAX;
|
expand.scrollTop = MAX;
|
var shrink = this.$el.lastChild;
|
shrink.scrollLeft = MAX;
|
shrink.scrollTop = MAX;
|
},
|
update: function update() {
|
this.size.width = this.$el.offsetWidth;
|
this.size.height = this.$el.offsetHeight;
|
this.reset();
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/resize-sensor/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_resize_sensorvue_type_script_lang_js_ = (resize_sensorvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/resize-sensor/index.vue?vue&type=style&index=0&lang=css&
|
var resize_sensorvue_type_style_index_0_lang_css_ = __webpack_require__(144);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/resize-sensor/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_resize_sensorvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/resize-sensor/index.vue"
|
/* harmony default export */ var resize_sensor = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 178 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/scroll-view/index.vue?vue&type=template&id=e9d562fc&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-scroll-view", _vm._g({}, _vm.$listeners), [
|
_c("div", { ref: "wrap", staticClass: "uni-scroll-view" }, [
|
_c(
|
"div",
|
{
|
ref: "main",
|
staticClass: "uni-scroll-view",
|
style: {
|
"overflow-x": _vm.scrollX ? "auto" : "hidden",
|
"overflow-y": _vm.scrollY ? "auto" : "hidden"
|
}
|
},
|
[
|
_c(
|
"div",
|
{ ref: "content", staticClass: "uni-scroll-view-content" },
|
[
|
_vm.refresherEnabled
|
? _c(
|
"div",
|
{
|
ref: "refresherinner",
|
staticClass: "uni-scroll-view-refresher",
|
style: {
|
"background-color": _vm.refresherBackground,
|
height: _vm.refresherHeight + "px"
|
}
|
},
|
[
|
_vm.refresherDefaultStyle !== "none"
|
? _c(
|
"div",
|
{ staticClass: "uni-scroll-view-refresh" },
|
[
|
_c(
|
"div",
|
{
|
staticClass: "uni-scroll-view-refresh-inner"
|
},
|
[
|
_vm.refreshState == "pulling"
|
? _c(
|
"svg",
|
{
|
key: "refresh__icon",
|
staticClass:
|
"uni-scroll-view-refresh__icon",
|
style: {
|
transform:
|
"rotate(" +
|
_vm.refreshRotate +
|
"deg)"
|
},
|
attrs: {
|
fill: "#2BD009",
|
width: "24",
|
height: "24",
|
viewBox: "0 0 24 24"
|
}
|
},
|
[
|
_c("path", {
|
attrs: {
|
d:
|
"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
|
}
|
}),
|
_c("path", {
|
attrs: {
|
d: "M0 0h24v24H0z",
|
fill: "none"
|
}
|
})
|
]
|
)
|
: _vm._e(),
|
_vm.refreshState == "refreshing"
|
? _c(
|
"svg",
|
{
|
key: "refresh__spinner",
|
staticClass:
|
"uni-scroll-view-refresh__spinner",
|
attrs: {
|
width: "24",
|
height: "24",
|
viewBox: "25 25 50 50"
|
}
|
},
|
[
|
_c("circle", {
|
staticStyle: { color: "#2bd009" },
|
attrs: {
|
cx: "50",
|
cy: "50",
|
r: "20",
|
fill: "none",
|
"stroke-width": "3"
|
}
|
})
|
]
|
)
|
: _vm._e()
|
]
|
)
|
]
|
)
|
: _vm._e(),
|
_vm.refresherDefaultStyle == "none"
|
? _vm._t("refresher")
|
: _vm._e()
|
],
|
2
|
)
|
: _vm._e(),
|
_vm._t("default")
|
],
|
2
|
)
|
]
|
)
|
])
|
])
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/scroll-view/index.vue?vue&type=template&id=e9d562fc&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/index.js + 2 modules
|
var scroller = __webpack_require__(74);
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/scroll.js
|
var helpers_scroll = __webpack_require__(5);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/scroll-view/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
|
var passiveOptions = shared["k" /* supportsPassive */] ? {
|
passive: true
|
} : false; // const PULLING = 'pulling'
|
// const REFRESHING = 'refreshing'
|
|
/* harmony default export */ var scroll_viewvue_type_script_lang_js_ = ({
|
name: 'ScrollView',
|
mixins: [scroller["a" /* default */]],
|
props: {
|
scrollX: {
|
type: [Boolean, String],
|
default: false
|
},
|
scrollY: {
|
type: [Boolean, String],
|
default: false
|
},
|
upperThreshold: {
|
type: [Number, String],
|
default: 50
|
},
|
lowerThreshold: {
|
type: [Number, String],
|
default: 50
|
},
|
scrollTop: {
|
type: [Number, String],
|
default: 0
|
},
|
scrollLeft: {
|
type: [Number, String],
|
default: 0
|
},
|
scrollIntoView: {
|
type: String,
|
default: ''
|
},
|
scrollWithAnimation: {
|
type: [Boolean, String],
|
default: false
|
},
|
enableBackToTop: {
|
type: [Boolean, String],
|
default: false
|
},
|
refresherEnabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
refresherThreshold: {
|
type: Number,
|
default: 45
|
},
|
refresherDefaultStyle: {
|
type: String,
|
default: 'back'
|
},
|
refresherBackground: {
|
type: String,
|
default: '#fff'
|
},
|
refresherTriggered: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
lastScrollTop: this.scrollTopNumber,
|
lastScrollLeft: this.scrollLeftNumber,
|
lastScrollToUpperTime: 0,
|
lastScrollToLowerTime: 0,
|
refresherHeight: 0,
|
refreshRotate: 0,
|
refreshState: ''
|
};
|
},
|
computed: {
|
upperThresholdNumber: function upperThresholdNumber() {
|
var val = Number(this.upperThreshold);
|
return isNaN(val) ? 50 : val;
|
},
|
lowerThresholdNumber: function lowerThresholdNumber() {
|
var val = Number(this.lowerThreshold);
|
return isNaN(val) ? 50 : val;
|
},
|
scrollTopNumber: function scrollTopNumber() {
|
return Number(this.scrollTop) || 0;
|
},
|
scrollLeftNumber: function scrollLeftNumber() {
|
return Number(this.scrollLeft) || 0;
|
}
|
},
|
watch: {
|
scrollTopNumber: function scrollTopNumber(val) {
|
this._scrollTopChanged(val);
|
},
|
scrollLeftNumber: function scrollLeftNumber(val) {
|
this._scrollLeftChanged(val);
|
},
|
scrollIntoView: function scrollIntoView(val) {
|
this._scrollIntoViewChanged(val);
|
},
|
refresherTriggered: function refresherTriggered(val) {
|
// TODO
|
if (val === true) {
|
this._setRefreshState('refreshing');
|
} else if (val === false) {
|
this._setRefreshState('restore');
|
}
|
}
|
},
|
mounted: function mounted() {
|
var self = this;
|
var touchStart = null;
|
var needStop = null;
|
this._attached = true;
|
this.toUpperNumber = 0; // 容器触顶时,此时鼠标Y轴位置
|
|
this.triggerAbort = false;
|
this.beforeRefreshing = false;
|
|
this._scrollTopChanged(this.scrollTopNumber);
|
|
this._scrollLeftChanged(this.scrollLeftNumber);
|
|
this._scrollIntoViewChanged(this.scrollIntoView);
|
|
this.__handleScroll = function (event) {
|
event.preventDefault();
|
event.stopPropagation();
|
|
self._handleScroll.bind(self, event)();
|
};
|
|
this.__handleTouchMove = function (event) {
|
var x = event.touches[0].pageX;
|
var y = event.touches[0].pageY;
|
var main = self.$refs.main;
|
|
if (Math.abs(x - touchStart.x) > Math.abs(y - touchStart.y)) {
|
// 横向滑动
|
if (self.scrollX) {
|
if (main.scrollLeft === 0 && x > touchStart.x) {
|
needStop = false;
|
return;
|
} else if (main.scrollWidth === main.offsetWidth + main.scrollLeft && x < touchStart.x) {
|
needStop = false;
|
return;
|
}
|
|
needStop = true;
|
} else {
|
needStop = false;
|
}
|
} else {
|
// 纵向滑动
|
if (self.scrollY) {
|
if (main.scrollTop === 0 && y > touchStart.y) {
|
needStop = false; // 刷新时,阻止页面滚动
|
|
if (self.refresherEnabled && event.cancelable !== false) {
|
event.preventDefault();
|
}
|
} else if (main.scrollHeight === main.offsetHeight + main.scrollTop && y < touchStart.y) {
|
needStop = false;
|
return;
|
} else {
|
needStop = true;
|
}
|
} else {
|
needStop = false;
|
}
|
}
|
|
if (needStop) {
|
event.stopPropagation();
|
}
|
|
if (main.scrollTop === 0 && event.touches.length === 1) {
|
// 如果容器滑动到达顶端,则进入下拉状态
|
self.refreshState = 'pulling';
|
}
|
|
if (self.refresherEnabled && self.refreshState === 'pulling') {
|
var dy = y - touchStart.y;
|
|
if (self.toUpperNumber === 0) {
|
self.toUpperNumber = y;
|
}
|
|
if (!self.beforeRefreshing) {
|
self.refresherHeight = y - self.toUpperNumber; // 之前为刷新状态则不再触发pulling
|
|
if (self.refresherHeight > 0) {
|
self.triggerAbort = true;
|
self.$trigger('refresherpulling', event, {
|
deltaY: dy
|
});
|
}
|
} else {
|
self.refresherHeight = dy + self.refresherThreshold; // 如果之前在刷新状态,则不触发刷新中断
|
|
self.triggerAbort = false;
|
}
|
|
var route = self.refresherHeight / self.refresherThreshold;
|
self.refreshRotate = (route > 1 ? 1 : route) * 360;
|
}
|
};
|
|
this.__handleTouchStart = function (event) {
|
if (event.touches.length === 1) {
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: true
|
});
|
touchStart = {
|
x: event.touches[0].pageX,
|
y: event.touches[0].pageY
|
};
|
}
|
};
|
|
this.__handleTouchEnd = function (event) {
|
touchStart = null;
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: false
|
});
|
|
if (self.refresherHeight >= self.refresherThreshold) {
|
self._setRefreshState('refreshing');
|
} else {
|
self._setRefreshState('refresherabort');
|
}
|
};
|
|
this.$refs.main.addEventListener('touchstart', this.__handleTouchStart, passiveOptions);
|
this.$refs.main.addEventListener('touchmove', this.__handleTouchMove);
|
this.$refs.main.addEventListener('scroll', this.__handleScroll, shared["k" /* supportsPassive */] ? {
|
passive: false
|
} : false);
|
this.$refs.main.addEventListener('touchend', this.__handleTouchEnd, passiveOptions);
|
Object(helpers_scroll["b" /* initScrollBounce */])();
|
},
|
activated: function activated() {
|
// 还原 scroll-view 滚动位置
|
this.scrollY && (this.$refs.main.scrollTop = this.lastScrollTop);
|
this.scrollX && (this.$refs.main.scrollLeft = this.lastScrollLeft);
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$refs.main.removeEventListener('touchstart', this.__handleTouchStart, passiveOptions);
|
this.$refs.main.removeEventListener('touchmove', this.__handleTouchMove, passiveOptions);
|
this.$refs.main.removeEventListener('scroll', this.__handleScroll, shared["k" /* supportsPassive */] ? {
|
passive: false
|
} : false);
|
this.$refs.main.removeEventListener('touchend', this.__handleTouchEnd, passiveOptions);
|
},
|
methods: {
|
scrollTo: function scrollTo(t, n) {
|
var i = this.$refs.main;
|
t < 0 ? t = 0 : n === 'x' && t > i.scrollWidth - i.offsetWidth ? t = i.scrollWidth - i.offsetWidth : n === 'y' && t > i.scrollHeight - i.offsetHeight && (t = i.scrollHeight - i.offsetHeight);
|
var r = 0;
|
var o = '';
|
n === 'x' ? r = i.scrollLeft - t : n === 'y' && (r = i.scrollTop - t);
|
|
if (r !== 0) {
|
this.$refs.content.style.transition = 'transform .3s ease-out';
|
this.$refs.content.style.webkitTransition = '-webkit-transform .3s ease-out';
|
|
if (n === 'x') {
|
o = 'translateX(' + r + 'px) translateZ(0)';
|
} else {
|
n === 'y' && (o = 'translateY(' + r + 'px) translateZ(0)');
|
}
|
|
this.$refs.content.removeEventListener('transitionend', this.__transitionEnd);
|
this.$refs.content.removeEventListener('webkitTransitionEnd', this.__transitionEnd);
|
this.__transitionEnd = this._transitionEnd.bind(this, t, n);
|
this.$refs.content.addEventListener('transitionend', this.__transitionEnd);
|
this.$refs.content.addEventListener('webkitTransitionEnd', this.__transitionEnd);
|
|
if (n === 'x') {
|
// if (e !== 'ios') {
|
i.style.overflowX = 'hidden'; // }
|
} else if (n === 'y') {
|
i.style.overflowY = 'hidden';
|
}
|
|
this.$refs.content.style.transform = o;
|
this.$refs.content.style.webkitTransform = o;
|
}
|
},
|
_handleTrack: function _handleTrack($event) {
|
if ($event.detail.state === 'start') {
|
this._x = $event.detail.x;
|
this._y = $event.detail.y;
|
this._noBubble = null;
|
return;
|
}
|
|
if ($event.detail.state === 'end') {
|
this._noBubble = false;
|
}
|
|
if (this._noBubble === null && this.scrollY) {
|
if (Math.abs(this._y - $event.detail.y) / Math.abs(this._x - $event.detail.x) > 1) {
|
this._noBubble = true;
|
} else {
|
this._noBubble = false;
|
}
|
}
|
|
if (this._noBubble === null && this.scrollX) {
|
if (Math.abs(this._x - $event.detail.x) / Math.abs(this._y - $event.detail.y) > 1) {
|
this._noBubble = true;
|
} else {
|
this._noBubble = false;
|
}
|
}
|
|
this._x = $event.detail.x;
|
this._y = $event.detail.y;
|
|
if (this._noBubble) {
|
$event.stopPropagation();
|
}
|
},
|
_handleScroll: function _handleScroll($event) {
|
var target = $event.target;
|
this.$trigger('scroll', $event, {
|
scrollLeft: target.scrollLeft,
|
scrollTop: target.scrollTop,
|
scrollHeight: target.scrollHeight,
|
scrollWidth: target.scrollWidth,
|
deltaX: this.lastScrollLeft - target.scrollLeft,
|
deltaY: this.lastScrollTop - target.scrollTop
|
});
|
|
if (this.scrollY) {
|
if (target.scrollTop <= this.upperThresholdNumber && this.lastScrollTop - target.scrollTop > 0 && $event.timeStamp - this.lastScrollToUpperTime > 200) {
|
this.$trigger('scrolltoupper', $event, {
|
direction: 'top'
|
});
|
this.lastScrollToUpperTime = $event.timeStamp;
|
}
|
|
if (target.scrollTop + target.offsetHeight + this.lowerThresholdNumber >= target.scrollHeight && this.lastScrollTop - target.scrollTop < 0 && $event.timeStamp - this.lastScrollToLowerTime > 200) {
|
this.$trigger('scrolltolower', $event, {
|
direction: 'bottom'
|
});
|
this.lastScrollToLowerTime = $event.timeStamp;
|
}
|
}
|
|
if (this.scrollX) {
|
if (target.scrollLeft <= this.upperThresholdNumber && this.lastScrollLeft - target.scrollLeft > 0 && $event.timeStamp - this.lastScrollToUpperTime > 200) {
|
this.$trigger('scrolltoupper', $event, {
|
direction: 'left'
|
});
|
this.lastScrollToUpperTime = $event.timeStamp;
|
}
|
|
if (target.scrollLeft + target.offsetWidth + this.lowerThresholdNumber >= target.scrollWidth && this.lastScrollLeft - target.scrollLeft < 0 && $event.timeStamp - this.lastScrollToLowerTime > 200) {
|
this.$trigger('scrolltolower', $event, {
|
direction: 'right'
|
});
|
this.lastScrollToLowerTime = $event.timeStamp;
|
}
|
}
|
|
this.lastScrollTop = target.scrollTop;
|
this.lastScrollLeft = target.scrollLeft;
|
},
|
_scrollTopChanged: function _scrollTopChanged(val) {
|
if (this.scrollY) {
|
if (this._innerSetScrollTop) {
|
this._innerSetScrollTop = false;
|
} else {
|
if (this.scrollWithAnimation) {
|
this.scrollTo(val, 'y');
|
} else {
|
this.$refs.main.scrollTop = val;
|
}
|
}
|
}
|
},
|
_scrollLeftChanged: function _scrollLeftChanged(val) {
|
if (this.scrollX) {
|
if (this._innerSetScrollLeft) {
|
this._innerSetScrollLeft = false;
|
} else {
|
if (this.scrollWithAnimation) {
|
this.scrollTo(val, 'x');
|
} else {
|
this.$refs.main.scrollLeft = val;
|
}
|
}
|
}
|
},
|
_scrollIntoViewChanged: function _scrollIntoViewChanged(val) {
|
if (val) {
|
if (!/^[_a-zA-Z][-_a-zA-Z0-9:]*$/.test(val)) {
|
console.error("id error: scroll-into-view=".concat(val));
|
return;
|
}
|
|
var element = this.$el.querySelector('#' + val);
|
|
if (element) {
|
var mainRect = this.$refs.main.getBoundingClientRect();
|
var elRect = element.getBoundingClientRect();
|
|
if (this.scrollX) {
|
var left = elRect.left - mainRect.left;
|
var scrollLeft = this.$refs.main.scrollLeft;
|
var x = scrollLeft + left;
|
|
if (this.scrollWithAnimation) {
|
this.scrollTo(x, 'x');
|
} else {
|
this.$refs.main.scrollLeft = x;
|
}
|
}
|
|
if (this.scrollY) {
|
var top = elRect.top - mainRect.top;
|
var scrollTop = this.$refs.main.scrollTop;
|
var y = scrollTop + top;
|
|
if (this.scrollWithAnimation) {
|
this.scrollTo(y, 'y');
|
} else {
|
this.$refs.main.scrollTop = y;
|
}
|
}
|
}
|
}
|
},
|
_transitionEnd: function _transitionEnd(val, type) {
|
this.$refs.content.style.transition = '';
|
this.$refs.content.style.webkitTransition = '';
|
this.$refs.content.style.transform = '';
|
this.$refs.content.style.webkitTransform = '';
|
var main = this.$refs.main;
|
|
if (type === 'x') {
|
main.style.overflowX = this.scrollX ? 'auto' : 'hidden';
|
main.scrollLeft = val;
|
} else if (type === 'y') {
|
main.style.overflowY = this.scrollY ? 'auto' : 'hidden';
|
main.scrollTop = val;
|
}
|
|
this.$refs.content.removeEventListener('transitionend', this.__transitionEnd);
|
this.$refs.content.removeEventListener('webkitTransitionEnd', this.__transitionEnd);
|
},
|
_setRefreshState: function _setRefreshState(state) {
|
switch (state) {
|
case 'refreshing':
|
this.refresherHeight = this.refresherThreshold; // 之前是刷新状态则不再触发刷新
|
|
if (!this.beforeRefreshing) {
|
this.beforeRefreshing = true;
|
this.$trigger('refresherrefresh', {}, {}); // this.$emit('update:refresherTriggered', true)
|
}
|
|
break;
|
|
case 'restore':
|
case 'refresherabort':
|
this.beforeRefreshing = false;
|
this.refresherHeight = this.toUpperNumber = 0;
|
|
if (state === 'restore') {
|
this.triggerAbort = false;
|
this.$trigger('refresherrestore', {}, {});
|
}
|
|
if (state === 'refresherabort' && this.triggerAbort) {
|
this.triggerAbort = false;
|
this.$trigger('refresherabort', {}, {});
|
}
|
|
break;
|
}
|
|
this.refreshState = state;
|
},
|
getScrollPosition: function getScrollPosition() {
|
var main = this.$refs.main;
|
return {
|
scrollLeft: main.scrollLeft,
|
scrollTop: main.scrollTop,
|
scrollHeight: main.scrollHeight,
|
scrollWidth: main.scrollWidth
|
};
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/scroll-view/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_scroll_viewvue_type_script_lang_js_ = (scroll_viewvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/scroll-view/index.vue?vue&type=style&index=0&lang=css&
|
var scroll_viewvue_type_style_index_0_lang_css_ = __webpack_require__(145);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/scroll-view/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_scroll_viewvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/scroll-view/index.vue"
|
/* harmony default export */ var scroll_view = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 179 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/slider/index.vue?vue&type=template&id=1969bd7a&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-slider",
|
_vm._g({ ref: "uni-slider", on: { click: _vm._onClick } }, _vm.$listeners),
|
[
|
_c("div", { staticClass: "uni-slider-wrapper" }, [
|
_c("div", { staticClass: "uni-slider-tap-area" }, [
|
_c(
|
"div",
|
{ staticClass: "uni-slider-handle-wrapper", style: _vm.setBgColor },
|
[
|
_c("div", {
|
ref: "uni-slider-handle",
|
staticClass: "uni-slider-handle",
|
style: _vm.setBlockBg
|
}),
|
_c("div", {
|
staticClass: "uni-slider-thumb",
|
style: _vm.setBlockStyle
|
}),
|
_c("div", {
|
staticClass: "uni-slider-track",
|
style: _vm.setActiveColor
|
})
|
]
|
)
|
]),
|
_c(
|
"span",
|
{
|
directives: [
|
{
|
name: "show",
|
rawName: "v-show",
|
value: _vm.showValue,
|
expression: "showValue"
|
}
|
],
|
ref: "uni-slider-value",
|
staticClass: "uni-slider-value"
|
},
|
[_vm._v(_vm._s(_vm.sliderValue))]
|
)
|
]),
|
_vm._t("default")
|
],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/slider/index.vue?vue&type=template&id=1969bd7a&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/touchtrack.js
|
var touchtrack = __webpack_require__(12);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/slider/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
// 处理js计算小数时的精度问题
|
|
var computeController = {
|
add: function add(arg) {
|
var r1, r2, m;
|
|
try {
|
// 获得小数位数
|
r1 = this.toString().split('.')[1].length;
|
} catch (e) {
|
r1 = 0;
|
}
|
|
try {
|
// 获得小数位数
|
r2 = arg.toString().split('.')[1].length;
|
} catch (e) {
|
r2 = 0;
|
}
|
|
m = Math.pow(10, Math.max(r1, r2));
|
return (this * m + arg * m) / m;
|
},
|
sub: function sub(arg) {
|
return this.add(-arg);
|
},
|
mul: function mul(arg) {
|
var m = 0;
|
var s1 = this.toString();
|
var s2 = arg.toString();
|
|
try {
|
// 获得小数位数
|
m += s1.split('.')[1].length;
|
} catch (e) {}
|
|
try {
|
// 获得小数位数
|
m += s2.split('.')[1].length;
|
} catch (e) {} // 转为十进制计算后,要除以两个数的共同小数位数
|
|
|
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m);
|
},
|
div: function div(arg) {
|
var t1 = 0;
|
var t2 = 0;
|
var r1;
|
var r2;
|
|
try {
|
// 获得小数位数
|
t1 = this.toString().split('.')[1].length;
|
} catch (e) {}
|
|
try {
|
// 获得小数位数
|
t2 = arg.toString().split('.')[1].length;
|
} catch (e) {}
|
|
r1 = Number(this.toString().replace('.', ''));
|
r2 = Number(arg.toString().replace('.', '')); // 转为十进制计算后,要乘以除数与被除数小数位数的差
|
|
return r1 / r2 * Math.pow(10, t2 - t1);
|
},
|
mod: function mod(arg) {
|
var t1 = 0;
|
var t2 = 0;
|
var r1;
|
var r2;
|
|
try {
|
t1 = this.toString().split('.')[1].length;
|
} catch (e) {}
|
|
try {
|
t2 = arg.toString().split('.')[1].length;
|
} catch (e) {} // 小数位数
|
|
|
var digit = Math.pow(10, Math.abs(t1 - t2)); // eslint-disable-next-line eqeqeq
|
|
if (digit == 1) {
|
digit = Math.pow(10, t1);
|
} // 计算余数
|
|
|
r1 = (this * digit).toString().split('.')[0];
|
r2 = arg * digit; // 小数点后数字,直接拼接上即可
|
|
var decimals = (this * digit).toString().split('.')[1] ? (this * digit).toString().split('.')[1] : '';
|
return (r1 % r2 + decimals) / digit;
|
}
|
};
|
/* harmony default export */ var slidervue_type_script_lang_js_ = ({
|
name: 'Slider',
|
mixins: [mixins["a" /* emitter */], mixins["e" /* listeners */], touchtrack["a" /* default */]],
|
props: {
|
name: {
|
type: String,
|
default: ''
|
},
|
min: {
|
type: [Number, String],
|
default: 0
|
},
|
max: {
|
type: [Number, String],
|
default: 100
|
},
|
value: {
|
type: [Number, String],
|
default: 0
|
},
|
step: {
|
type: [Number, String],
|
default: 1
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
color: {
|
type: String,
|
default: '#e9e9e9'
|
},
|
backgroundColor: {
|
type: String,
|
default: '#e9e9e9'
|
},
|
activeColor: {
|
type: String,
|
default: '#007aff'
|
},
|
selectedColor: {
|
type: String,
|
default: '#007aff'
|
},
|
blockColor: {
|
type: String,
|
default: '#ffffff'
|
},
|
blockSize: {
|
type: [Number, String],
|
default: 28
|
},
|
showValue: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
sliderValue: Number(this.value)
|
};
|
},
|
computed: {
|
setBlockStyle: function setBlockStyle() {
|
return {
|
width: this.blockSize + 'px',
|
height: this.blockSize + 'px',
|
marginLeft: -this.blockSize / 2 + 'px',
|
marginTop: -this.blockSize / 2 + 'px',
|
left: this._getValueWidth(),
|
backgroundColor: this.blockColor
|
};
|
},
|
setBgColor: function setBgColor() {
|
return {
|
backgroundColor: this._getBgColor()
|
};
|
},
|
setBlockBg: function setBlockBg() {
|
return {
|
left: this._getValueWidth()
|
};
|
},
|
setActiveColor: function setActiveColor() {
|
// 有问题,设置最大值最小值是有问题
|
return {
|
backgroundColor: this._getActiveColor(),
|
width: this._getValueWidth()
|
};
|
}
|
},
|
watch: {
|
value: function value(val) {
|
this.sliderValue = Number(val);
|
}
|
},
|
mounted: function mounted() {
|
this.touchtrack(this.$refs['uni-slider-handle'], '_onTrack');
|
},
|
created: function created() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_onUserChangedValue: function _onUserChangedValue(e) {
|
var sliderRightBox = this.$refs['uni-slider-value'];
|
var sliderRightBoxLeft = getComputedStyle(sliderRightBox, null).marginLeft;
|
var sliderRightBoxWidth = sliderRightBox.offsetWidth;
|
sliderRightBoxWidth = sliderRightBoxWidth + parseInt(sliderRightBoxLeft);
|
var slider = this.$refs['uni-slider'];
|
var offsetWidth = slider.offsetWidth - (this.showValue ? sliderRightBoxWidth : 0);
|
var boxLeft = slider.getBoundingClientRect().left;
|
var value = (e.x - boxLeft) * (this.max - this.min) / offsetWidth + Number(this.min);
|
this.sliderValue = this._filterValue(value);
|
},
|
_filterValue: function _filterValue(e) {
|
var max = Number(this.max);
|
var min = Number(this.min);
|
return e < min ? min : e > max ? max : computeController.mul.call(Math.round((e - min) / this.step), this.step) + min;
|
},
|
_getValueWidth: function _getValueWidth() {
|
return 100 * (this.sliderValue - this.min) / (this.max - this.min) + '%';
|
},
|
_getBgColor: function _getBgColor() {
|
return this.backgroundColor !== '#e9e9e9' ? this.backgroundColor : this.color !== '#007aff' ? this.color : '#007aff';
|
},
|
_getActiveColor: function _getActiveColor() {
|
return this.activeColor !== '#007aff' ? this.activeColor : this.selectedColor !== '#e9e9e9' ? this.selectedColor : '#e9e9e9';
|
},
|
_onTrack: function _onTrack(e) {
|
if (!this.disabled) {
|
return e.detail.state === 'move' ? (this._onUserChangedValue({
|
x: e.detail.x
|
}), this.$trigger('changing', e, {
|
value: this.sliderValue
|
}), !1) : e.detail.state === 'end' && this.$trigger('change', e, {
|
value: this.sliderValue
|
});
|
}
|
},
|
_onClick: function _onClick($event) {
|
if (this.disabled) {
|
return;
|
}
|
|
this._onUserChangedValue($event);
|
|
this.$trigger('change', $event, {
|
value: this.sliderValue
|
});
|
},
|
_resetFormData: function _resetFormData() {
|
this.sliderValue = this.min;
|
},
|
_getFormData: function _getFormData() {
|
var data = {};
|
|
if (this.name !== '') {
|
data.value = this.sliderValue;
|
data.key = this.name;
|
}
|
|
return data;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/slider/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_slidervue_type_script_lang_js_ = (slidervue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/slider/index.vue?vue&type=style&index=0&lang=css&
|
var slidervue_type_style_index_0_lang_css_ = __webpack_require__(146);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/slider/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_slidervue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/slider/index.vue"
|
/* harmony default export */ var slider = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 180 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/swiper-item/index.vue?vue&type=template&id=3883b065&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-swiper-item",
|
_vm._g({}, _vm.$listeners),
|
[_vm._t("default")],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/swiper-item/index.vue?vue&type=template&id=3883b065&
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/swiper-item/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
/* harmony default export */ var swiper_itemvue_type_script_lang_js_ = ({
|
name: 'SwiperItem',
|
props: {
|
itemId: {
|
type: String,
|
default: ''
|
}
|
},
|
mounted: function mounted() {
|
var $el = this.$el;
|
$el.style.position = 'absolute';
|
$el.style.width = '100%';
|
$el.style.height = '100%';
|
var callbacks = this.$vnode._callbacks;
|
|
if (callbacks) {
|
callbacks.forEach(function (callback) {
|
callback();
|
});
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/swiper-item/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_swiper_itemvue_type_script_lang_js_ = (swiper_itemvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/swiper-item/index.vue?vue&type=style&index=0&lang=css&
|
var swiper_itemvue_type_style_index_0_lang_css_ = __webpack_require__(147);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/swiper-item/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_swiper_itemvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/swiper-item/index.vue"
|
/* harmony default export */ var swiper_item = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 181 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/switch/index.vue?vue&type=template&id=04951fe6&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-switch",
|
_vm._g(
|
{ attrs: { disabled: _vm.disabled }, on: { click: _vm._onClick } },
|
_vm.$listeners
|
),
|
[
|
_c("div", { staticClass: "uni-switch-wrapper" }, [
|
_c("div", {
|
directives: [
|
{
|
name: "show",
|
rawName: "v-show",
|
value: _vm.type === "switch",
|
expression: "type === 'switch'"
|
}
|
],
|
staticClass: "uni-switch-input",
|
class: [_vm.switchChecked ? "uni-switch-input-checked" : ""],
|
style: {
|
backgroundColor: _vm.switchChecked ? _vm.color : "#DFDFDF",
|
borderColor: _vm.switchChecked ? _vm.color : "#DFDFDF"
|
}
|
}),
|
_c("div", {
|
directives: [
|
{
|
name: "show",
|
rawName: "v-show",
|
value: _vm.type === "checkbox",
|
expression: "type === 'checkbox'"
|
}
|
],
|
staticClass: "uni-checkbox-input",
|
class: [_vm.switchChecked ? "uni-checkbox-input-checked" : ""],
|
style: { color: _vm.color }
|
})
|
])
|
]
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/switch/index.vue?vue&type=template&id=04951fe6&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/switch/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var switchvue_type_script_lang_js_ = ({
|
name: 'Switch',
|
mixins: [mixins["a" /* emitter */], mixins["e" /* listeners */]],
|
props: {
|
name: {
|
type: String,
|
default: ''
|
},
|
checked: {
|
type: [Boolean, String],
|
default: false
|
},
|
type: {
|
type: String,
|
default: 'switch'
|
},
|
id: {
|
type: String,
|
default: ''
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
color: {
|
type: String,
|
default: '#007aff'
|
}
|
},
|
data: function data() {
|
return {
|
switchChecked: this.checked
|
};
|
},
|
watch: {
|
checked: function checked(val) {
|
this.switchChecked = val;
|
}
|
},
|
created: function created() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
listeners: {
|
'label-click': '_onClick',
|
'@label-click': '_onClick'
|
},
|
methods: {
|
_onClick: function _onClick($event) {
|
if (this.disabled) {
|
return;
|
}
|
|
this.switchChecked = !this.switchChecked;
|
this.$trigger('change', $event, {
|
value: this.switchChecked
|
});
|
},
|
_resetFormData: function _resetFormData() {
|
this.switchChecked = false;
|
},
|
_getFormData: function _getFormData() {
|
var data = {};
|
|
if (this.name !== '') {
|
data.value = this.switchChecked;
|
data.key = this.name;
|
}
|
|
return data;
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/switch/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_switchvue_type_script_lang_js_ = (switchvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/switch/index.vue?vue&type=style&index=0&lang=css&
|
var switchvue_type_style_index_0_lang_css_ = __webpack_require__(149);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/switch/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_switchvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/switch/index.vue"
|
/* harmony default export */ var components_switch = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 182 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/textarea/index.vue?vue&type=template&id=33f82dda&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-textarea", _vm._g({}, _vm.$listeners), [
|
_c("div", { ref: "wrapper", staticClass: "uni-textarea-wrapper" }, [
|
_c("div", {
|
directives: [
|
{
|
name: "show",
|
rawName: "v-show",
|
value: !(_vm.composing || _vm.valueSync.length),
|
expression: "!(composing || valueSync.length)"
|
}
|
],
|
ref: "placeholder",
|
staticClass: "uni-textarea-placeholder",
|
class: _vm.placeholderClass,
|
style: _vm.placeholderStyle,
|
domProps: { textContent: _vm._s(_vm.placeholder) }
|
}),
|
_c("div", {
|
ref: "line",
|
staticClass: "uni-textarea-line",
|
domProps: { textContent: _vm._s(" ") }
|
}),
|
_c(
|
"div",
|
{ staticClass: "uni-textarea-compute" },
|
[
|
_vm._l(_vm.valueCompute, function(item, index) {
|
return _c("div", {
|
key: index,
|
domProps: { textContent: _vm._s(item.trim() ? item : ".") }
|
})
|
}),
|
_c("v-uni-resize-sensor", {
|
ref: "sensor",
|
on: { resize: _vm._resize }
|
})
|
],
|
2
|
),
|
!_vm.disabled || !_vm.fixColor
|
? _c("textarea", {
|
directives: [
|
{
|
name: "model",
|
rawName: "v-model",
|
value: _vm.valueSync,
|
expression: "valueSync"
|
},
|
{ name: "keyboard", rawName: "v-keyboard" },
|
{ name: "field", rawName: "v-field" }
|
],
|
ref: "textarea",
|
staticClass: "uni-textarea-textarea",
|
class: { "uni-textarea-textarea-fix-margin": _vm.fixMargin },
|
style: { "overflow-y": _vm.autoHeight ? "hidden" : "auto" },
|
attrs: {
|
disabled: _vm.disabled,
|
maxlength: _vm.maxlengthNumber,
|
enterkeyhint: _vm.confirmType
|
},
|
domProps: { value: _vm.valueSync },
|
on: {
|
change: function($event) {
|
$event.stopPropagation()
|
},
|
compositionstart: function($event) {
|
$event.stopPropagation()
|
return _vm._onCompositionstart($event)
|
},
|
compositionend: function($event) {
|
$event.stopPropagation()
|
return _vm._onCompositionend($event)
|
},
|
input: [
|
function($event) {
|
if ($event.target.composing) {
|
return
|
}
|
_vm.valueSync = $event.target.value
|
},
|
function($event) {
|
$event.stopPropagation()
|
return _vm._onInput($event)
|
}
|
],
|
focus: _vm._onFocus,
|
blur: _vm._onBlur,
|
"&touchstart": function($event) {
|
return _vm._onTouchstart($event)
|
},
|
keyup: function($event) {
|
if (
|
!$event.type.indexOf("key") &&
|
_vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
|
) {
|
return null
|
}
|
return _vm._onKeyUpEnter($event)
|
},
|
keydown: function($event) {
|
if (
|
!$event.type.indexOf("key") &&
|
_vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
|
) {
|
return null
|
}
|
return _vm._onKeyDownEnter($event)
|
}
|
}
|
})
|
: _vm._e(),
|
_vm._v(" "),
|
_vm.disabled && _vm.fixColor
|
? _c("textarea", {
|
ref: "textarea",
|
staticClass: "uni-textarea-textarea",
|
class: { "uni-textarea-textarea-fix-margin": _vm.fixMargin },
|
style: { "overflow-y": _vm.autoHeight ? "hidden" : "auto" },
|
attrs: {
|
tabindex: "-1",
|
readonly: _vm.disabled,
|
maxlength: _vm.maxlengthNumber
|
},
|
domProps: { value: _vm.valueSync },
|
on: {
|
focus: function($event) {
|
return $event.target.blur()
|
}
|
}
|
})
|
: _vm._e()
|
])
|
])
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/textarea/index.vue?vue&type=template&id=33f82dda&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/textarea/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
var DARK_TEST_STRING = '(prefers-color-scheme: dark)';
|
/* harmony default export */ var textareavue_type_script_lang_js_ = ({
|
name: 'Textarea',
|
mixins: [mixins["b" /* field */]],
|
props: {
|
name: {
|
type: String,
|
default: ''
|
},
|
maxlength: {
|
type: [Number, String],
|
default: 140
|
},
|
placeholder: {
|
type: String,
|
default: ''
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
placeholderClass: {
|
type: String,
|
default: 'textarea-placeholder'
|
},
|
placeholderStyle: {
|
type: String,
|
default: ''
|
},
|
autoHeight: {
|
type: [Boolean, String],
|
default: false
|
},
|
confirmType: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
valueComposition: '',
|
height: 0,
|
focusChangeSource: '',
|
// iOS 13 以下版本需要修正边距
|
fixMargin: String(navigator.platform).indexOf('iP') === 0 && String(navigator.vendor).indexOf('Apple') === 0 && window.matchMedia(DARK_TEST_STRING).media !== DARK_TEST_STRING
|
};
|
},
|
computed: {
|
maxlengthNumber: function maxlengthNumber() {
|
var maxlength = Number(this.maxlength);
|
return isNaN(maxlength) ? 140 : maxlength;
|
},
|
valueCompute: function valueCompute() {
|
return (this.composing ? this.valueComposition : this.valueSync).split('\n');
|
},
|
isDone: function isDone() {
|
return ['done', 'go', 'next', 'search', 'send'].includes(this.confirmType);
|
}
|
},
|
watch: {
|
focus: function focus(val) {
|
if (val) {
|
this.focusChangeSource = 'focus';
|
}
|
},
|
height: function height(_height) {
|
var lineHeight = parseFloat(getComputedStyle(this.$el).lineHeight);
|
|
if (isNaN(lineHeight)) {
|
lineHeight = this.$refs.line.offsetHeight;
|
}
|
|
var lineCount = Math.round(_height / lineHeight);
|
this.$trigger('linechange', {}, {
|
height: _height,
|
heightRpx: 750 / window.innerWidth * _height,
|
lineCount: lineCount
|
});
|
|
if (this.autoHeight) {
|
this.$el.style.height = 'auto';
|
this.$refs.wrapper.style.height = this.height + 'px';
|
}
|
}
|
},
|
created: function created() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'add',
|
vm: this
|
});
|
},
|
mounted: function mounted() {
|
this._resize({
|
height: this.$refs.sensor.$el.offsetHeight
|
});
|
|
var $vm = this;
|
|
while ($vm) {
|
var scopeId = $vm.$options._scopeId;
|
|
if (scopeId) {
|
this.$refs.placeholder.setAttribute(scopeId, '');
|
}
|
|
$vm = $vm.$parent;
|
}
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.$dispatch('Form', 'uni-form-group-update', {
|
type: 'remove',
|
vm: this
|
});
|
},
|
methods: {
|
_onKeyDownEnter: function _onKeyDownEnter($event) {
|
if (this.isDone) {
|
$event.preventDefault();
|
}
|
},
|
_onKeyUpEnter: function _onKeyUpEnter($event) {
|
if (this.isDone) {
|
this._confirm($event);
|
|
this.$refs.textarea.blur();
|
}
|
},
|
_onCompositionstart: function _onCompositionstart($event) {
|
this.composing = true;
|
},
|
_onCompositionend: function _onCompositionend($event) {
|
if (this.composing) {
|
this.composing = false; // 部分输入法 compositionend 事件可能晚于 input
|
|
this._onInput($event);
|
}
|
},
|
// 暂无完成按钮,此功能未实现
|
_confirm: function _confirm($event) {
|
this.$trigger('confirm', $event, {
|
value: this.valueSync
|
});
|
},
|
_linechange: function _linechange($event) {
|
this.$trigger('linechange', $event, {
|
value: this.valueSync
|
});
|
},
|
_onTouchstart: function _onTouchstart() {
|
this.focusChangeSource = 'touch';
|
},
|
_resize: function _resize(_ref) {
|
var height = _ref.height;
|
this.height = height;
|
},
|
_onInput: function _onInput($event, force) {
|
if (this.composing) {
|
this.valueComposition = $event.target.value;
|
return;
|
}
|
|
this.$triggerInput($event, {
|
value: this.valueSync,
|
cursor: this.$refs.textarea.selectionEnd
|
}, force);
|
},
|
_getFormData: function _getFormData() {
|
return {
|
value: this.valueSync,
|
key: this.name
|
};
|
},
|
_resetFormData: function _resetFormData() {
|
this.valueSync = '';
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/textarea/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_textareavue_type_script_lang_js_ = (textareavue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/textarea/index.vue?vue&type=style&index=0&lang=css&
|
var textareavue_type_style_index_0_lang_css_ = __webpack_require__(151);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/textarea/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_textareavue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/textarea/index.vue"
|
/* harmony default export */ var components_textarea = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 183 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/view/index.vue?vue&type=template&id=6ae9b1be&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _vm.hoverClass && _vm.hoverClass !== "none"
|
? _c(
|
"uni-view",
|
_vm._g(
|
{
|
class: [_vm.hovering ? _vm.hoverClass : ""],
|
on: {
|
touchstart: _vm._hoverTouchStart,
|
touchend: _vm._hoverTouchEnd,
|
touchcancel: _vm._hoverTouchCancel
|
}
|
},
|
_vm.$listeners
|
),
|
[_vm._t("default")],
|
2
|
)
|
: _c("uni-view", _vm._g({}, _vm.$listeners), [_vm._t("default")], 2)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/view/index.vue?vue&type=template&id=6ae9b1be&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/hover.js
|
var hover = __webpack_require__(24);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/view/index.vue?vue&type=script&lang=js&
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
/* harmony default export */ var viewvue_type_script_lang_js_ = ({
|
name: 'View',
|
mixins: [hover["a" /* default */]],
|
listeners: {
|
'label-click': 'clickHandler'
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/view/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_viewvue_type_script_lang_js_ = (viewvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/view/index.vue?vue&type=style&index=0&lang=css&
|
var viewvue_type_style_index_0_lang_css_ = __webpack_require__(152);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/view/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_viewvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/view/index.vue"
|
/* harmony default export */ var view = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 184 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/video/index.vue?vue&type=template&id=0ba2468e&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-video", _vm._g({}, _vm.$listeners), [
|
_c("div", { ref: "container", staticClass: "uni-video-container" }),
|
_c("div", { staticClass: "uni-video-slot" }, [_vm._t("default")], 2)
|
])
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/video/index.vue?vue&type=template&id=0ba2468e&
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/mixins/native.js
|
var mixins_native = __webpack_require__(7);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/video/index.vue?vue&type=script&lang=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); }
|
|
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 _objectSpread(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; }
|
|
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; }
|
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
//
|
|
|
var methods = ['play', 'pause', 'stop', 'seek', 'sendDanmu', 'playbackRate', 'requestFullScreen', 'exitFullScreen'];
|
var events = ['play', 'pause', 'ended', 'timeupdate', 'fullscreenchange', 'fullscreenclick', 'waiting', 'error'];
|
var _attrs = ['src', 'duration', 'controls', 'danmuList', 'danmuBtn', 'enableDanmu', 'autoplay', 'loop', 'muted', 'objectFit', 'poster', 'direction', 'showProgress', 'initialTime', 'showFullscreenBtn', 'pageGesture', 'enableProgressGesture', 'showPlayBtn', 'enablePlayGesture', 'showCenterPlayBtn', 'showLoading', 'codec', 'httpCache', 'playStrategy', 'header', 'advanced'];
|
/* harmony default export */ var videovue_type_script_lang_js_ = ({
|
name: 'Video',
|
mixins: [mixins["f" /* subscriber */], mixins_native["a" /* default */]],
|
props: {
|
id: {
|
type: String,
|
default: ''
|
},
|
src: {
|
type: String,
|
default: ''
|
},
|
duration: {
|
type: [Number, String],
|
default: ''
|
},
|
controls: {
|
type: [Boolean, String],
|
default: true
|
},
|
danmuList: {
|
type: Array,
|
default: function _default() {
|
return [];
|
}
|
},
|
danmuBtn: {
|
type: [Boolean, String],
|
default: false
|
},
|
enableDanmu: {
|
type: [Boolean, String],
|
default: false
|
},
|
autoplay: {
|
type: [Boolean, String],
|
default: false
|
},
|
loop: {
|
type: [Boolean, String],
|
default: false
|
},
|
muted: {
|
type: [Boolean, String],
|
default: false
|
},
|
objectFit: {
|
type: String,
|
default: 'contain'
|
},
|
poster: {
|
type: String,
|
default: ''
|
},
|
direction: {
|
type: [String, Number],
|
default: ''
|
},
|
showProgress: {
|
type: Boolean,
|
default: true
|
},
|
initialTime: {
|
type: [String, Number],
|
default: 0
|
},
|
showFullscreenBtn: {
|
type: [Boolean, String],
|
default: true
|
},
|
pageGesture: {
|
type: [Boolean, String],
|
default: false
|
},
|
enableProgressGesture: {
|
type: [Boolean, String],
|
default: true
|
},
|
showPlayBtn: {
|
type: [Boolean, String],
|
default: true
|
},
|
enablePlayGesture: {
|
type: [Boolean, String],
|
default: true
|
},
|
showCenterPlayBtn: {
|
type: [Boolean, String],
|
default: true
|
},
|
showLoading: {
|
type: [Boolean, String],
|
default: true
|
},
|
codec: {
|
type: String,
|
default: 'hardware'
|
},
|
httpCache: {
|
type: [Boolean, String],
|
default: false
|
},
|
playStrategy: {
|
type: [Number, String],
|
default: 0
|
},
|
header: {
|
type: Object,
|
default: function _default() {
|
return {};
|
}
|
},
|
advanced: {
|
type: Array,
|
default: function _default() {
|
return [];
|
}
|
}
|
},
|
computed: {
|
attrs: function attrs() {
|
var _this = this;
|
|
var obj = {};
|
|
_attrs.forEach(function (key) {
|
var val = _this.$props[key];
|
val = key === 'src' ? _this.$getRealPath(val) : val;
|
obj[key.replace(/[A-Z]/g, function (str) {
|
return '-' + str.toLowerCase();
|
})] = val;
|
});
|
|
return obj;
|
}
|
},
|
mounted: function mounted() {
|
var _this2 = this;
|
|
this._onParentReady(function () {
|
var video = _this2.video = plus.video.createVideoPlayer('video' + Date.now(), Object.assign({}, _this2.attrs, _this2.position));
|
plus.webview.currentWebview().append(video);
|
|
if (_this2.hidden) {
|
video.hide();
|
}
|
|
_this2.$watch('attrs', function () {
|
_this2.video && _this2.video.setStyles(_this2.attrs);
|
}, {
|
deep: true
|
});
|
|
_this2.$watch('position', function () {
|
_this2.video && _this2.video.setStyles(_this2.position);
|
}, {
|
deep: true
|
});
|
|
_this2.$watch('hidden', function (val) {
|
var video = _this2.video;
|
|
if (video) {
|
video[val ? 'hide' : 'show'](); // iOS 隐藏状态设置 setStyles 不生效
|
|
if (!val) {
|
video.setStyles(_this2.position);
|
}
|
}
|
});
|
|
events.forEach(function (key) {
|
video.addEventListener(key, function (e) {
|
_this2.$trigger(key, {}, _objectSpread({}, e.detail));
|
});
|
});
|
});
|
},
|
beforeDestroy: function beforeDestroy() {
|
this.video && this.video.close();
|
delete this.video;
|
},
|
methods: {
|
_handleSubscribe: function _handleSubscribe(_ref) {
|
var type = _ref.type,
|
_ref$data = _ref.data,
|
data = _ref$data === void 0 ? {} : _ref$data;
|
|
if (methods.includes(type)) {
|
if (_typeof(data) === 'object') {
|
switch (type) {
|
case 'seek':
|
data = data.position;
|
break;
|
|
case 'playbackRate':
|
data = data.rate;
|
break;
|
|
case 'requestFullScreen':
|
data = data.direction;
|
break;
|
}
|
}
|
|
this.video && this.video[type](data);
|
}
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/video/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_videovue_type_script_lang_js_ = (videovue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/video/index.vue?vue&type=style&index=0&lang=css&
|
var videovue_type_style_index_0_lang_css_ = __webpack_require__(160);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/video/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_videovue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/platforms/app-plus/view/components/video/index.vue"
|
/* harmony default export */ var video = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 185 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/canvas/index.vue?vue&type=template&id=6ef05d9e&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-canvas",
|
_vm._g(
|
{
|
attrs: {
|
"canvas-id": _vm.canvasId,
|
"disable-scroll": _vm.disableScroll
|
}
|
},
|
_vm._listeners
|
),
|
[
|
_c("canvas", { ref: "canvas", attrs: { width: "300", height: "150" } }),
|
_c(
|
"div",
|
{
|
staticStyle: {
|
position: "absolute",
|
top: "0",
|
left: "0",
|
width: "100%",
|
height: "100%",
|
overflow: "hidden"
|
}
|
},
|
[_vm._t("default")],
|
2
|
),
|
_c("v-uni-resize-sensor", { ref: "sensor", on: { resize: _vm._resize } })
|
],
|
1
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/canvas/index.vue?vue&type=template&id=6ef05d9e&
|
|
// EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/canvas/index.vue?vue&type=script&lang=js&
|
var canvasvue_type_script_lang_js_ = __webpack_require__(29);
|
|
// CONCATENATED MODULE: ./src/core/view/components/canvas/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_canvasvue_type_script_lang_js_ = (canvasvue_type_script_lang_js_["a" /* default */]);
|
// EXTERNAL MODULE: ./src/core/view/components/canvas/index.vue?vue&type=style&index=0&lang=css&
|
var canvasvue_type_style_index_0_lang_css_ = __webpack_require__(128);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/canvas/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_canvasvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/canvas/index.vue"
|
/* harmony default export */ var canvas = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 186 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/editor/index.vue?vue&type=template&id=29b52706&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-editor",
|
_vm._g(
|
{ staticClass: "ql-container", attrs: { id: _vm.id } },
|
_vm.$listeners
|
)
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/editor/index.vue?vue&type=template&id=29b52706&
|
|
// EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/editor/index.vue?vue&type=script&lang=js&
|
var editorvue_type_script_lang_js_ = __webpack_require__(33);
|
|
// CONCATENATED MODULE: ./src/core/view/components/editor/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_editorvue_type_script_lang_js_ = (editorvue_type_script_lang_js_["a" /* default */]);
|
// EXTERNAL MODULE: ./src/core/view/components/editor/editor.css?vue&type=style&index=0&lang=css&
|
var editorvue_type_style_index_0_lang_css_ = __webpack_require__(131);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/editor/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_editorvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/editor/index.vue"
|
/* harmony default export */ var editor = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 187 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/label/index.vue?vue&type=template&id=04b5b291&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-label",
|
_vm._g(
|
{
|
class: { "uni-label-pointer": _vm.pointer },
|
on: { click: _vm._onClick }
|
},
|
_vm.$listeners
|
),
|
[_vm._t("default")],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/core/view/components/label/index.vue?vue&type=template&id=04b5b291&
|
|
// EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/label/index.vue?vue&type=script&lang=js&
|
var labelvue_type_script_lang_js_ = __webpack_require__(38);
|
|
// CONCATENATED MODULE: ./src/core/view/components/label/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_labelvue_type_script_lang_js_ = (labelvue_type_script_lang_js_["a" /* default */]);
|
// EXTERNAL MODULE: ./src/core/view/components/label/index.vue?vue&type=style&index=0&lang=css&
|
var labelvue_type_style_index_0_lang_css_ = __webpack_require__(135);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/label/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_labelvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/label/index.vue"
|
/* harmony default export */ var label = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 188 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/ad/index.vue?vue&type=template&id=4d0d75c6&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-ad",
|
_vm._g(_vm._b({}, "uni-ad", _vm.attrs, false), _vm.$listeners),
|
[_c("div", { ref: "container", staticClass: "uni-ad-container" })]
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/ad/index.vue?vue&type=template&id=4d0d75c6&
|
|
// EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/ad/index.vue?vue&type=script&lang=js&
|
var advue_type_script_lang_js_ = __webpack_require__(57);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/ad/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_advue_type_script_lang_js_ = (advue_type_script_lang_js_["a" /* default */]);
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/ad/index.vue?vue&type=style&index=0&lang=css&
|
var advue_type_style_index_0_lang_css_ = __webpack_require__(154);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/ad/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_advue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/platforms/app-plus/view/components/ad/index.vue"
|
/* harmony default export */ var ad = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 189 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/map/index.vue?vue&type=template&id=8d987fa2&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c(
|
"uni-map",
|
_vm._g({}, _vm.$listeners),
|
[
|
_c("div", { ref: "container", staticClass: "uni-map-container" }),
|
_vm._l(_vm.mapControls, function(control, index) {
|
return _c("v-uni-cover-image", {
|
key: index,
|
style: control.position,
|
attrs: { src: control.iconPath, "auto-size": "" },
|
on: {
|
click: function($event) {
|
return _vm.controlclick(control)
|
}
|
}
|
})
|
}),
|
_c("div", { staticClass: "uni-map-slot" }, [_vm._t("default")], 2)
|
],
|
2
|
)
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/map/index.vue?vue&type=template&id=8d987fa2&
|
|
// EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/map/index.vue?vue&type=script&lang=js&
|
var mapvue_type_script_lang_js_ = __webpack_require__(61);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/map/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_mapvue_type_script_lang_js_ = (mapvue_type_script_lang_js_["a" /* default */]);
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/map/index.vue?vue&type=style&index=0&lang=css&
|
var mapvue_type_style_index_0_lang_css_ = __webpack_require__(157);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/map/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_mapvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/platforms/app-plus/view/components/map/index.vue"
|
/* harmony default export */ var map = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 190 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e3b674d4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/web-view/index.vue?vue&type=template&id=02a3393e&
|
var render = function() {
|
var _vm = this
|
var _h = _vm.$createElement
|
var _c = _vm._self._c || _h
|
return _c("uni-web-view", _vm._g({}, _vm.$listeners))
|
}
|
var staticRenderFns = []
|
render._withStripped = true
|
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/web-view/index.vue?vue&type=template&id=02a3393e&
|
|
// EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/web-view/index.vue?vue&type=script&lang=js&
|
var web_viewvue_type_script_lang_js_ = __webpack_require__(65);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/web-view/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_web_viewvue_type_script_lang_js_ = (web_viewvue_type_script_lang_js_["a" /* default */]);
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/web-view/index.vue?vue&type=style&index=0&lang=css&
|
var web_viewvue_type_style_index_0_lang_css_ = __webpack_require__(161);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/web-view/index.vue
|
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_web_viewvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/platforms/app-plus/view/components/web-view/index.vue"
|
/* harmony default export */ var web_view = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 191 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXTERNAL MODULE: ./packages/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js
|
var vue_runtime_esm = __webpack_require__(9);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-real-path.js + 1 modules
|
var get_real_path = __webpack_require__(13);
|
|
// EXTERNAL MODULE: ./src/core/view/plugins/events.js + 1 modules
|
var events = __webpack_require__(18);
|
|
// CONCATENATED MODULE: ./src/core/view/mixins/base.js
|
|
|
/* harmony default export */ var base = ({
|
methods: {
|
$getRealPath: function $getRealPath(src) {
|
return src ? Object(get_real_path["a" /* default */])(src) : src;
|
},
|
$trigger: function $trigger(name, $event, detail) {
|
this.$emit(name, events["b" /* processEvent */].call(this, name, $event, detail, this.$el, this.$el));
|
}
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/mixins/animation.js
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
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."); }
|
|
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(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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; }
|
|
function converPx(value) {
|
if (/^-?\d+[ur]px$/i.test(value)) {
|
return value.replace(/(^-?\d+)[ur]px$/i, function (text, num) {
|
return "".concat(uni.upx2px(parseFloat(num)), "px");
|
}); // eslint-disable-next-line no-useless-escape
|
} else if (/^-?[\d\.]+$/.test(value)) {
|
return "".concat(value, "px");
|
}
|
|
return value || '';
|
}
|
|
function converType(type) {
|
return type.replace(/[A-Z]/g, function (text) {
|
return "-".concat(text.toLowerCase());
|
}).replace('webkit', '-webkit');
|
}
|
|
function getStyle(action) {
|
var animateTypes1 = ['matrix', 'matrix3d', 'scale', 'scale3d', 'rotate3d', 'skew', 'translate', 'translate3d'];
|
var animateTypes2 = ['scaleX', 'scaleY', 'scaleZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'skewX', 'skewY', 'translateX', 'translateY', 'translateZ'];
|
var animateTypes3 = ['opacity', 'background-color'];
|
var animateTypes4 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
|
var animates = action.animates;
|
var option = action.option;
|
var transition = option.transition;
|
var style = {};
|
var transform = [];
|
animates.forEach(function (animate) {
|
var type = animate.type;
|
|
var args = _toConsumableArray(animate.args);
|
|
if (animateTypes1.concat(animateTypes2).includes(type)) {
|
if (type.startsWith('rotate') || type.startsWith('skew')) {
|
args = args.map(function (value) {
|
return parseFloat(value) + 'deg';
|
});
|
} else if (type.startsWith('translate')) {
|
args = args.map(converPx);
|
}
|
|
if (animateTypes2.indexOf(type) >= 0) {
|
args.length = 1;
|
}
|
|
transform.push("".concat(type, "(").concat(args.join(','), ")"));
|
} else if (animateTypes3.concat(animateTypes4).includes(args[0])) {
|
type = args[0];
|
var value = args[1];
|
style[type] = animateTypes4.includes(type) ? converPx(value) : value;
|
}
|
});
|
style.transform = style.webkitTransform = transform.join(' ');
|
style.transition = style.webkitTransition = Object.keys(style).map(function (type) {
|
return "".concat(converType(type), " ").concat(transition.duration, "ms ").concat(transition.timingFunction, " ").concat(transition.delay, "ms");
|
}).join(',');
|
style.transformOrigin = style.webkitTransformOrigin = option.transformOrigin;
|
return style;
|
}
|
|
function startAnimation(context) {
|
var animation = context.animation;
|
|
if (!animation || !animation.actions || !animation.actions.length) {
|
return;
|
}
|
|
var index = 0;
|
var actions = animation.actions;
|
var length = animation.actions.length;
|
|
function animate() {
|
var action = actions[index];
|
var transition = action.option.transition;
|
var style = getStyle(action);
|
Object.keys(style).forEach(function (key) {
|
context.$el.style[key] = style[key];
|
});
|
index += 1;
|
|
if (index < length) {
|
setTimeout(animate, transition.duration + transition.delay);
|
}
|
}
|
|
setTimeout(function () {
|
animate();
|
}, 0);
|
}
|
|
/* harmony default export */ var animation = ({
|
props: ['animation'],
|
watch: {
|
animation: function animation() {
|
startAnimation(this);
|
}
|
},
|
mounted: function mounted() {
|
startAnimation(this);
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/index.js
|
|
|
|
var requireComponents = [// baseComponents
|
__webpack_require__(117), __webpack_require__(153)];
|
requireComponents.forEach(function (components, index) {
|
components.keys().forEach(function (fileName) {
|
// 获取组件配置
|
var componentModule = components(fileName);
|
var componentConfig = componentModule.default || componentModule;
|
componentConfig.mixins = componentConfig.mixins ? [].concat(base, componentConfig.mixins) : [base];
|
componentConfig.mixins.push(animation);
|
componentConfig.name = 'VUni' + componentConfig.name;
|
componentConfig.isReserved = true; // 全局注册组件
|
|
vue_runtime_esm["a" /* default */].component(componentConfig.name, componentConfig);
|
});
|
});
|
|
/***/ }),
|
/* 192 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXTERNAL MODULE: ./src/core/helpers/i18n/index.js
|
var i18n = __webpack_require__(10);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/index.js
|
var mixins = __webpack_require__(2);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/button/index.vue?vue&type=script&lang=js&
|
|
|
/* harmony default export */ var buttonvue_type_script_lang_js_ = ({
|
name: 'Button',
|
mixins: [mixins["c" /* hover */], mixins["a" /* emitter */], mixins["e" /* listeners */]],
|
props: {
|
hoverClass: {
|
type: String,
|
default: 'button-hover'
|
},
|
disabled: {
|
type: [Boolean, String],
|
default: false
|
},
|
id: {
|
type: String,
|
default: ''
|
},
|
hoverStopPropagation: {
|
type: Boolean,
|
default: false
|
},
|
hoverStartTime: {
|
type: [Number, String],
|
default: 20
|
},
|
hoverStayTime: {
|
type: [Number, String],
|
default: 70
|
},
|
formType: {
|
type: String,
|
default: '',
|
validator: function validator(value) {
|
// 只有这几个可取值,其它都是非法的。
|
return ~['', 'submit', 'reset'].indexOf(value);
|
}
|
},
|
openType: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
clickFunction: null
|
};
|
},
|
methods: {
|
_onClick: function _onClick($event, isLabelClick) {
|
if (this.disabled) {
|
return;
|
}
|
|
if (isLabelClick) {
|
this.$el.click();
|
} // TODO 通知父表单执行相应的行为
|
|
|
if (this.formType) {
|
this.$dispatch('Form', this.formType === 'submit' ? 'uni-form-submit' : 'uni-form-reset', {
|
type: this.formType
|
});
|
return;
|
}
|
|
if (this.openType === 'feedback' && "app-plus" === 'app-plus') {
|
var feedback = plus.webview.create('https://service.dcloud.net.cn/uniapp/feedback.html', 'feedback', {
|
titleNView: {
|
titleText: Object(i18n["d" /* t */])('uni.button.feedback.title'),
|
autoBackButton: true,
|
backgroundColor: '#F7F7F7',
|
titleColor: '#007aff',
|
buttons: [{
|
text: Object(i18n["d" /* t */])('uni.button.feedback.send'),
|
color: '#007aff',
|
fontSize: '16px',
|
fontWeight: 'bold',
|
onclick: function onclick(e) {
|
feedback.evalJS('mui&&mui.trigger(document.getElementById("submit"),"tap")');
|
}
|
}]
|
}
|
});
|
feedback.show('slide-in-right');
|
}
|
},
|
_bindObjectListeners: function _bindObjectListeners(data, value) {
|
if (value) {
|
for (var key in value) {
|
var existing = data.on[key];
|
var ours = value[key];
|
data.on[key] = existing ? [].concat(existing, ours) : ours;
|
}
|
}
|
|
return data;
|
}
|
},
|
render: function render(createElement) {
|
var _this = this;
|
|
var $listeners = Object.create(null);
|
|
if (this.$listeners) {
|
Object.keys(this.$listeners).forEach(function (e) {
|
if (_this.disabled && (e === 'click' || e === 'tap')) {
|
return;
|
}
|
|
$listeners[e] = _this.$listeners[e];
|
});
|
}
|
|
if (this.hoverClass && this.hoverClass !== 'none') {
|
return createElement('uni-button', this._bindObjectListeners({
|
class: [this.hovering ? this.hoverClass : ''],
|
attrs: {
|
disabled: this.disabled
|
},
|
on: {
|
touchstart: this._hoverTouchStart,
|
touchend: this._hoverTouchEnd,
|
touchcancel: this._hoverTouchCancel,
|
click: this._onClick
|
}
|
}, $listeners), this.$slots.default);
|
} else {
|
return createElement('uni-button', this._bindObjectListeners({
|
class: [this.hovering ? this.hoverClass : ''],
|
attrs: {
|
disabled: this.disabled
|
},
|
on: {
|
click: this._onClick
|
}
|
}, $listeners), this.$slots.default);
|
}
|
},
|
listeners: {
|
'label-click': '_onClick',
|
'@label-click': '_onClick'
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/button/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_buttonvue_type_script_lang_js_ = (buttonvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/button/index.vue?vue&type=style&index=0&lang=css&
|
var buttonvue_type_style_index_0_lang_css_ = __webpack_require__(119);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/button/index.vue
|
var render, staticRenderFns
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_buttonvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/button/index.vue"
|
/* harmony default export */ var components_button = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 193 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/scroll.js
|
var helpers_scroll = __webpack_require__(5);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/movable-area/index.vue?vue&type=script&lang=js&
|
|
|
|
function calc(e) {
|
return Math.sqrt(e.x * e.x + e.y * e.y);
|
}
|
|
/* harmony default export */ var movable_areavue_type_script_lang_js_ = ({
|
name: 'MovableArea',
|
props: {
|
scaleArea: {
|
type: Boolean,
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
width: 0,
|
height: 0,
|
items: []
|
};
|
},
|
created: function created() {
|
this.gapV = {
|
x: null,
|
y: null
|
};
|
this.pinchStartLen = null;
|
},
|
mounted: function mounted() {
|
this._resize();
|
|
Object(helpers_scroll["b" /* initScrollBounce */])();
|
},
|
methods: {
|
_resize: function _resize() {
|
this._getWH();
|
|
this.items.forEach(function (item, index) {
|
item.componentInstance.setParent();
|
});
|
},
|
_find: function _find(target) {
|
var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.items;
|
var root = this.$el;
|
|
function get(node) {
|
for (var i = 0; i < items.length; i++) {
|
var item = items[i];
|
|
if (node === item.componentInstance.$el) {
|
return item;
|
}
|
}
|
|
if (node === root || node === document.body || node === document) {
|
return null;
|
}
|
|
return get(node.parentNode);
|
}
|
|
return get(target);
|
},
|
_touchstart: function _touchstart(t) {
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: true
|
});
|
var i = t.touches;
|
|
if (i) {
|
if (i.length > 1) {
|
var r = {
|
x: i[1].pageX - i[0].pageX,
|
y: i[1].pageY - i[0].pageY
|
};
|
this.pinchStartLen = calc(r);
|
this.gapV = r;
|
|
if (!this.scaleArea) {
|
var touch0 = this._find(i[0].target);
|
|
var touch1 = this._find(i[1].target);
|
|
this._scaleMovableView = touch0 && touch0 === touch1 ? touch0 : null;
|
}
|
}
|
}
|
},
|
_touchmove: function _touchmove(t) {
|
var n = t.touches;
|
|
if (n) {
|
if (n.length > 1) {
|
t.preventDefault();
|
var i = {
|
x: n[1].pageX - n[0].pageX,
|
y: n[1].pageY - n[0].pageY
|
};
|
|
if (this.gapV.x !== null && this.pinchStartLen > 0) {
|
var r = calc(i) / this.pinchStartLen;
|
|
this._updateScale(r);
|
}
|
|
this.gapV = i;
|
}
|
}
|
},
|
_touchend: function _touchend(e) {
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: false
|
});
|
var t = e.touches;
|
|
if (!(t && t.length)) {
|
if (e.changedTouches) {
|
this.gapV.x = 0;
|
this.gapV.y = 0;
|
this.pinchStartLen = null;
|
|
if (this.scaleArea) {
|
this.items.forEach(function (item) {
|
item.componentInstance._endScale();
|
});
|
} else {
|
if (this._scaleMovableView) {
|
this._scaleMovableView.componentInstance._endScale();
|
}
|
}
|
}
|
}
|
},
|
_updateScale: function _updateScale(e) {
|
if (e && e !== 1) {
|
if (this.scaleArea) {
|
this.items.forEach(function (item) {
|
item.componentInstance._setScale(e);
|
});
|
} else {
|
if (this._scaleMovableView) {
|
this._scaleMovableView.componentInstance._setScale(e);
|
}
|
}
|
}
|
},
|
_getWH: function _getWH() {
|
var style = window.getComputedStyle(this.$el);
|
var rect = this.$el.getBoundingClientRect();
|
this.width = rect.width - ['Left', 'Right'].reduce(function (all, item) {
|
return all + parseFloat(style['border' + item + 'Width']) + parseFloat(style['padding' + item]);
|
}, 0);
|
this.height = rect.height - ['Top', 'Bottom'].reduce(function (all, item) {
|
return all + parseFloat(style['border' + item + 'Width']) + parseFloat(style['padding' + item]);
|
}, 0);
|
}
|
},
|
render: function render(createElement) {
|
var _this = this;
|
|
var items = [];
|
var $slots = this.$slots.default && Object(shared["d" /* deepClone */])(this.$slots.default, createElement);
|
|
if ($slots) {
|
$slots.forEach(function (vnode) {
|
if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-movable-view') {
|
items.push(vnode);
|
}
|
});
|
}
|
|
this.items = items;
|
var $listeners = Object.assign({}, this.$listeners);
|
var events = ['touchstart', 'touchmove', 'touchend'];
|
events.forEach(function (event) {
|
var existing = $listeners[event];
|
|
var ours = _this["_".concat(event)];
|
|
$listeners[event] = existing ? [].concat(existing, ours) : ours;
|
});
|
return createElement('uni-movable-area', {
|
on: $listeners
|
}, [createElement('v-uni-resize-sensor', {
|
on: {
|
resize: this._resize
|
}
|
}), $slots]);
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/movable-area/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_movable_areavue_type_script_lang_js_ = (movable_areavue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/movable-area/index.vue?vue&type=style&index=0&lang=css&
|
var movable_areavue_type_style_index_0_lang_css_ = __webpack_require__(136);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/movable-area/index.vue
|
var movable_area_render, staticRenderFns
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_movable_areavue_type_script_lang_js_,
|
movable_area_render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/movable-area/index.vue"
|
/* harmony default export */ var movable_area = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 194 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/touchtrack.js
|
var touchtrack = __webpack_require__(12);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/index.js + 2 modules
|
var scroller = __webpack_require__(74);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Friction.js
|
var Friction = __webpack_require__(71);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Spring.js
|
var Spring = __webpack_require__(72);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/scroll.js
|
var helpers_scroll = __webpack_require__(5);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/picker-view-column/index.vue?vue&type=script&lang=js&
|
|
|
|
|
|
|
function initClick(dom) {
|
var MAX_MOVE = 20;
|
var x = 0;
|
var y = 0;
|
dom.addEventListener('touchstart', function (event) {
|
var info = event.changedTouches[0];
|
x = info.clientX;
|
y = info.clientY;
|
});
|
dom.addEventListener('touchend', function (event) {
|
var info = event.changedTouches[0];
|
|
if (Math.abs(info.clientX - x) < MAX_MOVE && Math.abs(info.clientY - y) < MAX_MOVE) {
|
var customEvent = new CustomEvent('click', {
|
bubbles: true,
|
cancelable: true,
|
target: event.target,
|
currentTarget: event.currentTarget
|
});
|
['screenX', 'screenY', 'clientX', 'clientY', 'pageX', 'pageY'].forEach(function (key) {
|
customEvent[key] = info[key];
|
});
|
event.target.dispatchEvent(customEvent);
|
}
|
});
|
}
|
|
/* harmony default export */ var picker_view_columnvue_type_script_lang_js_ = ({
|
name: 'PickerViewColumn',
|
mixins: [touchtrack["a" /* default */], scroller["a" /* default */]],
|
data: function data() {
|
return {
|
scope: "picker-view-column-".concat(Date.now()),
|
inited: false,
|
indicatorStyle: '',
|
indicatorClass: '',
|
indicatorHeight: 34,
|
maskStyle: '',
|
maskClass: '',
|
current: this.$parent.getItemValue(this),
|
length: 0
|
};
|
},
|
computed: {
|
height: function height() {
|
return this.$parent.height;
|
},
|
maskSize: function maskSize() {
|
return (this.height - this.indicatorHeight) / 2;
|
}
|
},
|
watch: {
|
indicatorHeight: function indicatorHeight(val) {
|
this._setItemHeight(val);
|
|
if (this.inited) {
|
this.update();
|
}
|
},
|
current: function current(val) {
|
this.$parent.setItemValue(this, val);
|
},
|
length: function length(val) {
|
if (this.inited) {
|
this.update(val);
|
}
|
}
|
},
|
created: function created() {
|
var $parent = this.$parent;
|
this.indicatorStyle = $parent.indicatorStyle;
|
this.indicatorClass = $parent.indicatorClass;
|
this.maskStyle = $parent.maskStyle;
|
this.maskClass = $parent.maskClass;
|
this.deltaY = 0;
|
},
|
mounted: function mounted() {
|
var _this = this;
|
|
this.touchtrack(this.$refs.main, '_handleTrack', true);
|
this.setCurrent(this.current);
|
this.$nextTick(function () {
|
_this.init();
|
|
_this.update();
|
});
|
initClick(this.$el);
|
Object(helpers_scroll["b" /* initScrollBounce */])();
|
var $vm = this;
|
|
while ($vm) {
|
var scopeId = $vm.$options._scopeId;
|
|
if (scopeId) {
|
this.$refs.indicator.setAttribute(scopeId, '');
|
}
|
|
$vm = $vm.$parent;
|
}
|
},
|
methods: {
|
_setItemHeight: function _setItemHeight(height) {
|
var style = document.createElement('style');
|
style.innerText = ".uni-picker-view-content.".concat(this.scope, ">*{height: ").concat(height, "px;overflow: hidden;}");
|
document.head.appendChild(style);
|
},
|
_handleTrack: function _handleTrack(e) {
|
if (this._scroller) {
|
switch (e.detail.state) {
|
case 'start':
|
this._handleTouchStart(e);
|
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: true
|
});
|
break;
|
|
case 'move':
|
this._handleTouchMove(e);
|
|
e.stopPropagation();
|
break;
|
|
case 'end':
|
case 'cancel':
|
this._handleTouchEnd(e);
|
|
Object(helpers_scroll["a" /* disableScrollBounce */])({
|
disable: false
|
});
|
}
|
}
|
},
|
_handleTap: function _handleTap(_ref) {
|
var clientY = _ref.clientY;
|
|
if (!this._scroller.isScrolling()) {
|
var rect = this.$el.getBoundingClientRect();
|
var r = clientY - rect.top - this.height / 2;
|
var o = this.indicatorHeight / 2;
|
|
if (!(Math.abs(r) <= o)) {
|
var a = Math.ceil((Math.abs(r) - o) / this.indicatorHeight);
|
var s = r < 0 ? -a : a;
|
var current = Math.min(this.current + s, this.length - 1);
|
this.current = current = Math.max(current, 0);
|
|
this._scroller.scrollTo(current * this.indicatorHeight);
|
}
|
}
|
},
|
_handleWheel: function _handleWheel($event) {
|
var deltaY = this.deltaY + $event.deltaY;
|
|
if (Math.abs(deltaY) > 10) {
|
this.deltaY = 0;
|
var current = Math.min(this.current + (deltaY < 0 ? -1 : 1), this.length - 1);
|
this.current = current = Math.max(current, 0);
|
|
this._scroller.scrollTo(current * this.indicatorHeight);
|
} else {
|
this.deltaY = deltaY;
|
}
|
|
$event.preventDefault();
|
},
|
setCurrent: function setCurrent(current) {
|
if (current !== this.current) {
|
this.current = current;
|
|
if (this.inited) {
|
this.update();
|
}
|
}
|
},
|
init: function init() {
|
var _this2 = this;
|
|
this.initScroller(this.$refs.content, {
|
enableY: true,
|
enableX: false,
|
enableSnap: true,
|
itemSize: this.indicatorHeight,
|
friction: new Friction["a" /* Friction */](0.0001),
|
spring: new Spring["a" /* Spring */](2, 90, 20),
|
onSnap: function onSnap(index) {
|
if (!isNaN(index) && index !== _this2.current) {
|
_this2.current = index;
|
}
|
}
|
});
|
this.inited = true;
|
},
|
update: function update() {
|
var _this3 = this;
|
|
this.$nextTick(function () {
|
var current = Math.min(_this3.current, _this3.length - 1);
|
current = Math.max(current, 0);
|
|
_this3._scroller.update(current * _this3.indicatorHeight, undefined, _this3.indicatorHeight);
|
});
|
},
|
_resize: function _resize(_ref2) {
|
var height = _ref2.height;
|
this.indicatorHeight = height;
|
}
|
},
|
render: function render(createElement) {
|
this.length = this.$slots.default && this.$slots.default.length || 0;
|
return createElement('uni-picker-view-column', {
|
on: {
|
on: this.$listeners
|
}
|
}, [createElement('div', {
|
ref: 'main',
|
staticClass: 'uni-picker-view-group',
|
on: {
|
wheel: this._handleWheel,
|
click: this._handleTap
|
}
|
}, [createElement('div', {
|
ref: 'mask',
|
staticClass: 'uni-picker-view-mask',
|
class: this.maskClass,
|
style: "background-size: 100% ".concat(this.maskSize, "px;").concat(this.maskStyle)
|
}), createElement('div', {
|
ref: 'indicator',
|
staticClass: 'uni-picker-view-indicator',
|
class: this.indicatorClass,
|
style: this.indicatorStyle
|
}, [createElement('v-uni-resize-sensor', {
|
attrs: {
|
initial: true
|
},
|
on: {
|
resize: this._resize
|
}
|
})]), createElement('div', {
|
ref: 'content',
|
staticClass: 'uni-picker-view-content',
|
class: this.scope,
|
style: "padding: ".concat(this.maskSize, "px 0;")
|
}, [this.$slots.default])])]);
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/picker-view-column/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_picker_view_columnvue_type_script_lang_js_ = (picker_view_columnvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/picker-view-column/index.vue?vue&type=style&index=0&lang=css&
|
var picker_view_columnvue_type_style_index_0_lang_css_ = __webpack_require__(139);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/picker-view-column/index.vue
|
var render, staticRenderFns
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_picker_view_columnvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/picker-view-column/index.vue"
|
/* harmony default export */ var picker_view_column = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 195 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/picker-view/index.vue?vue&type=script&lang=js&
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
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."); }
|
|
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(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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; }
|
|
|
/* harmony default export */ var picker_viewvue_type_script_lang_js_ = ({
|
name: 'PickerView',
|
props: {
|
value: {
|
type: Array,
|
default: function _default() {
|
return [];
|
},
|
validator: function validator(val) {
|
return Array.isArray(val) && val.filter(function (val) {
|
return typeof val === 'number';
|
}).length === val.length;
|
}
|
},
|
indicatorStyle: {
|
type: String,
|
default: ''
|
},
|
indicatorClass: {
|
type: String,
|
default: ''
|
},
|
maskStyle: {
|
type: String,
|
default: ''
|
},
|
maskClass: {
|
type: String,
|
default: ''
|
}
|
},
|
data: function data() {
|
return {
|
valueSync: _toConsumableArray(this.value),
|
height: 34,
|
items: [],
|
changeSource: ''
|
};
|
},
|
watch: {
|
value: function value(val, oldVal) {
|
var _this = this;
|
|
if ( false || val === oldVal || val.length !== oldVal.length || val.findIndex(function (item, index) {
|
return item !== oldVal[index];
|
}) >= 0) {
|
this.valueSync.length = val.length;
|
val.forEach(function (val, index) {
|
if (val !== _this.valueSync[index]) {
|
_this.$set(_this.valueSync, index, val);
|
}
|
});
|
}
|
},
|
valueSync: {
|
deep: true,
|
handler: function handler(val, oldVal) {
|
if (this.changeSource === '') {
|
this._valueChanged(val);
|
} else {
|
this.changeSource = ''; // 避免外部直接对此值进行修改
|
|
var value = val.map(function (val) {
|
return val;
|
});
|
this.$emit('update:value', value);
|
this.$trigger('change', {}, {
|
value: value
|
});
|
}
|
}
|
}
|
},
|
methods: {
|
getItemIndex: function getItemIndex(vnode) {
|
return this.items.indexOf(vnode);
|
},
|
getItemValue: function getItemValue(vm) {
|
return this.valueSync[this.getItemIndex(vm.$vnode)] || 0;
|
},
|
setItemValue: function setItemValue(vm, val) {
|
var index = this.getItemIndex(vm.$vnode);
|
var oldVal = this.valueSync[index];
|
|
if (oldVal !== val) {
|
this.changeSource = 'touch';
|
this.$set(this.valueSync, index, val);
|
}
|
},
|
_valueChanged: function _valueChanged(val) {
|
this.items.forEach(function (item, index) {
|
item.componentInstance.setCurrent(val[index] || 0);
|
});
|
},
|
_resize: function _resize(_ref) {
|
var height = _ref.height;
|
this.height = height;
|
}
|
},
|
render: function render(createElement) {
|
var items = [];
|
|
if (this.$slots.default) {
|
Object(shared["d" /* deepClone */])(this.$slots.default, createElement).forEach(function (vnode) {
|
if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-picker-view-column') {
|
items.push(vnode);
|
}
|
});
|
}
|
|
this.items = items;
|
return createElement('uni-picker-view', {
|
on: this.$listeners
|
}, [createElement('v-uni-resize-sensor', {
|
attrs: {
|
initial: true
|
},
|
on: {
|
resize: this._resize
|
}
|
}), createElement('div', {
|
ref: 'wrapper',
|
class: 'uni-picker-view-wrapper'
|
}, items)]);
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/picker-view/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_picker_viewvue_type_script_lang_js_ = (picker_viewvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/picker-view/index.vue?vue&type=style&index=0&lang=css&
|
var picker_viewvue_type_style_index_0_lang_css_ = __webpack_require__(140);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/picker-view/index.vue
|
var picker_view_render, staticRenderFns
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_picker_viewvue_type_script_lang_js_,
|
picker_view_render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/picker-view/index.vue"
|
/* harmony default export */ var picker_view = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 196 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXTERNAL MODULE: ./src/core/view/mixins/touchtrack.js
|
var touchtrack = __webpack_require__(12);
|
|
// EXTERNAL MODULE: ./src/shared/index.js + 7 modules
|
var shared = __webpack_require__(0);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/swiper/index.vue?vue&type=script&lang=js&
|
//
|
|
|
/* harmony default export */ var swipervue_type_script_lang_js_ = ({
|
name: 'Swiper',
|
mixins: [touchtrack["a" /* default */]],
|
props: {
|
indicatorDots: {
|
type: [Boolean, String],
|
default: false
|
},
|
vertical: {
|
type: [Boolean, String],
|
default: false
|
},
|
autoplay: {
|
type: [Boolean, String],
|
default: false
|
},
|
circular: {
|
type: [Boolean, String],
|
default: false
|
},
|
interval: {
|
type: [Number, String],
|
default: 5e3
|
},
|
duration: {
|
type: [Number, String],
|
default: 500
|
},
|
current: {
|
type: [Number, String],
|
default: 0
|
},
|
indicatorColor: {
|
type: String,
|
default: ''
|
},
|
indicatorActiveColor: {
|
type: String,
|
default: ''
|
},
|
previousMargin: {
|
type: String,
|
default: ''
|
},
|
nextMargin: {
|
type: String,
|
default: ''
|
},
|
currentItemId: {
|
type: String,
|
default: ''
|
},
|
skipHiddenItemLayout: {
|
type: [Boolean, String],
|
default: false
|
},
|
displayMultipleItems: {
|
type: [Number, String],
|
default: 1
|
},
|
disableTouch: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
data: function data() {
|
return {
|
currentSync: Math.round(this.current) || 0,
|
currentItemIdSync: this.currentItemId || '',
|
userTracking: false,
|
currentChangeSource: '',
|
items: []
|
};
|
},
|
computed: {
|
intervalNumber: function intervalNumber() {
|
var interval = Number(this.interval);
|
return isNaN(interval) ? 5e3 : interval;
|
},
|
durationNumber: function durationNumber() {
|
var duration = Number(this.duration);
|
return isNaN(duration) ? 500 : duration;
|
},
|
displayMultipleItemsNumber: function displayMultipleItemsNumber() {
|
var displayMultipleItems = Math.round(this.displayMultipleItems);
|
return isNaN(displayMultipleItems) ? 1 : displayMultipleItems;
|
},
|
slidesStyle: function slidesStyle() {
|
var style = {};
|
|
if (this.nextMargin || this.previousMargin) {
|
style = this.vertical ? {
|
left: 0,
|
right: 0,
|
top: this._upx2px(this.previousMargin),
|
bottom: this._upx2px(this.nextMargin)
|
} : {
|
top: 0,
|
bottom: 0,
|
left: this._upx2px(this.previousMargin),
|
right: this._upx2px(this.nextMargin)
|
};
|
}
|
|
return style;
|
},
|
slideFrameStyle: function slideFrameStyle() {
|
var value = Math.abs(100 / this.displayMultipleItemsNumber) + '%';
|
return {
|
width: this.vertical ? '100%' : value,
|
height: !this.vertical ? '100%' : value
|
};
|
},
|
circularEnabled: function circularEnabled() {
|
return this.circular && this.items.length > this.displayMultipleItemsNumber;
|
}
|
},
|
watch: {
|
vertical: function vertical() {
|
this._resetLayout();
|
},
|
circular: function circular() {
|
this._resetLayout();
|
},
|
intervalNumber: function intervalNumber(val) {
|
if (this._timer) {
|
this._cancelSchedule();
|
|
this._scheduleAutoplay();
|
}
|
},
|
current: function current(val) {
|
this._currentCheck();
|
},
|
currentSync: function currentSync(val, oldVal) {
|
this._currentChanged(val, oldVal);
|
|
this.$emit('update:current', val);
|
},
|
currentItemId: function currentItemId(val) {
|
this._currentCheck();
|
},
|
currentItemIdSync: function currentItemIdSync(val) {
|
this.$emit('update:currentItemId', val);
|
},
|
displayMultipleItemsNumber: function displayMultipleItemsNumber() {
|
this._resetLayout();
|
}
|
},
|
created: function created() {
|
this._invalid = true;
|
this._viewportPosition = 0;
|
this._viewportMoveRatio = 1;
|
this._animating = null;
|
this._requestedAnimation = false;
|
this._userDirectionChecked = false;
|
this._contentTrackViewport = 0;
|
this._contentTrackSpeed = 0;
|
this._contentTrackT = 0;
|
},
|
mounted: function mounted() {
|
var _this = this;
|
|
this._currentCheck();
|
|
this.touchtrack(this.$refs.slidesWrapper, '_handleContentTrack', true);
|
this.$watch(function () {
|
return _this.autoplay && !_this.userTracking;
|
}, this._inintAutoplay);
|
|
this._inintAutoplay(this.autoplay && !this.userTracking);
|
|
this.$watch('items.length', this._resetLayout);
|
},
|
beforeDestroy: function beforeDestroy() {
|
this._cancelSchedule();
|
|
cancelAnimationFrame(this._animationFrame);
|
},
|
methods: {
|
_inintAutoplay: function _inintAutoplay(enable) {
|
if (enable) {
|
this._scheduleAutoplay();
|
} else {
|
this._cancelSchedule();
|
}
|
},
|
|
/**
|
* 页面变更检查和同步
|
*/
|
_currentCheck: function _currentCheck() {
|
var current = -1;
|
|
if (this.currentItemId) {
|
for (var i = 0, items = this.items; i < items.length; i++) {
|
var componentInstance = items[i].componentInstance;
|
|
if (componentInstance && componentInstance.itemId === this.currentItemId) {
|
current = i;
|
break;
|
}
|
}
|
}
|
|
if (current < 0) {
|
current = Math.round(this.current) || 0;
|
}
|
|
current = current < 0 ? 0 : current;
|
|
if (this.currentSync !== current) {
|
this.currentChangeSource = '';
|
this.currentSync = current;
|
}
|
},
|
_itemReady: function _itemReady(vnode, callback) {
|
if (vnode.componentInstance && vnode.componentInstance._isMounted) {
|
callback();
|
} else {
|
vnode._callbacks = vnode._callbacks || [];
|
|
vnode._callbacks.push(callback);
|
}
|
},
|
|
/**
|
* 当前页面变更
|
*/
|
_currentChanged: function _currentChanged(current, history) {
|
var _this2 = this;
|
|
var source = this.currentChangeSource;
|
this.currentChangeSource = '';
|
|
if (!source) {
|
var length = this.items.length;
|
|
this._animateViewport(current, '', this.circularEnabled && history + (length - current) % length > length / 2 ? 1 : 0);
|
}
|
|
var item = this.items[current];
|
|
if (item) {
|
this._itemReady(item, function () {
|
var currentItemId = _this2.currentItemIdSync = item.componentInstance.itemId || '';
|
|
_this2.$trigger('change', {}, {
|
current: _this2.currentSync,
|
currentItemId: currentItemId,
|
source: source
|
});
|
});
|
}
|
},
|
|
/**
|
* 自动播放
|
*/
|
_scheduleAutoplay: function _scheduleAutoplay() {
|
var self = this;
|
|
this._cancelSchedule();
|
|
function timer() {
|
self._timer = null;
|
self.currentChangeSource = 'autoplay';
|
|
if (self.circularEnabled) {
|
self.currentSync = self._normalizeCurrentValue(self.currentSync + 1);
|
} else {
|
self.currentSync = self.currentSync + self.displayMultipleItemsNumber < self.items.length ? self.currentSync + 1 : 0;
|
}
|
|
self._animateViewport(self.currentSync, 'autoplay', self.circularEnabled ? 1 : 0);
|
|
self._timer = setTimeout(timer, self.intervalNumber);
|
}
|
|
if (!(!this._isMounted || this._invalid || this.items.length <= this.displayMultipleItemsNumber)) {
|
this._timer = setTimeout(timer, this.intervalNumber);
|
}
|
},
|
|
/**
|
* 清除定时器
|
*/
|
_cancelSchedule: function _cancelSchedule() {
|
if (this._timer) {
|
clearTimeout(this._timer);
|
this._timer = null;
|
}
|
},
|
|
/**
|
* 检查当前页值
|
*/
|
_normalizeCurrentValue: function _normalizeCurrentValue(current) {
|
var length = this.items.length;
|
|
if (!length) {
|
return -1;
|
}
|
|
var index = (Math.round(current) % length + length) % length;
|
|
if (this.circularEnabled) {
|
if (length <= this.displayMultipleItemsNumber) {
|
return 0;
|
}
|
} else if (index > length - this.displayMultipleItemsNumber) {
|
return length - this.displayMultipleItemsNumber;
|
}
|
|
return index;
|
},
|
_upx2px: function _upx2px(val) {
|
if (/\d+[ur]px$/i.test(val)) {
|
val.replace(/\d+[ur]px$/i, function (text) {
|
return "".concat(uni.upx2px(parseFloat(text)), "px");
|
});
|
}
|
|
return val || '';
|
},
|
|
/**
|
* 重新布局
|
*/
|
_resetLayout: function _resetLayout() {
|
if (this._isMounted) {
|
this._cancelSchedule();
|
|
this._endViewportAnimation();
|
|
var items = this.items;
|
|
for (var i = 0; i < items.length; i++) {
|
this._updateItemPos(i, i);
|
}
|
|
this._viewportMoveRatio = 1;
|
|
if (this.displayMultipleItemsNumber === 1 && items.length) {
|
var itemRect = items[0].componentInstance.$el.getBoundingClientRect();
|
var slideFrameRect = this.$refs.slideFrame.getBoundingClientRect();
|
this._viewportMoveRatio = itemRect.width / slideFrameRect.width;
|
|
if (!(this._viewportMoveRatio > 0 && this._viewportMoveRatio < 1)) {
|
this._viewportMoveRatio = 1;
|
}
|
}
|
|
var position = this._viewportPosition;
|
this._viewportPosition = -2;
|
var current = this.currentSync;
|
|
if (current >= 0) {
|
this._invalid = false;
|
|
if (this.userTracking) {
|
this._updateViewport(position + current - this._contentTrackViewport);
|
|
this._contentTrackViewport = current;
|
} else {
|
this._updateViewport(current);
|
|
if (this.autoplay) {
|
this._scheduleAutoplay();
|
}
|
}
|
} else {
|
this._invalid = true;
|
|
this._updateViewport(-this.displayMultipleItemsNumber - 1);
|
}
|
}
|
},
|
_checkCircularLayout: function _checkCircularLayout(e) {
|
if (!this._invalid) {
|
for (var items = this.items, n = items.length, i = e + this.displayMultipleItemsNumber, r = 0; r < n; r++) {
|
var item = items[r];
|
var _position = item._position;
|
var s = Math.floor(e / n) * n + r;
|
var l = s + n;
|
var c = s - n;
|
var u = Math.max(e - (s + 1), s - i, 0);
|
var d = Math.max(e - (l + 1), l - i, 0);
|
var h = Math.max(e - (c + 1), c - i, 0);
|
var p = Math.min(u, d, h);
|
var f = [s, l, c][[u, d, h].indexOf(p)];
|
|
if (_position !== f) {
|
this._updateItemPos(r, f);
|
}
|
}
|
}
|
},
|
_updateItemPos: function _updateItemPos(current, position) {
|
var x = this.vertical ? '0' : 100 * position + '%';
|
var y = this.vertical ? 100 * position + '%' : '0';
|
var transform = 'translate(' + x + ', ' + y + ') translateZ(0)';
|
var item = this.items[current];
|
|
this._itemReady(item, function () {
|
var el = item.componentInstance.$el;
|
el.style['-webkit-transform'] = transform;
|
el.style.transform = transform;
|
el._position = position;
|
});
|
},
|
_updateViewport: function _updateViewport(index) {
|
if (!(Math.floor(2 * this._viewportPosition) === Math.floor(2 * index) && Math.ceil(2 * this._viewportPosition) === Math.ceil(2 * index))) {
|
if (this.circularEnabled) {
|
this._checkCircularLayout(index);
|
}
|
}
|
|
var x = this.vertical ? '0' : 100 * -index * this._viewportMoveRatio + '%';
|
var y = this.vertical ? 100 * -index * this._viewportMoveRatio + '%' : '0';
|
var transform = 'translate(' + x + ', ' + y + ') translateZ(0)';
|
var slideFrame = this.$refs.slideFrame;
|
|
if (slideFrame) {
|
slideFrame.style['-webkit-transform'] = transform;
|
slideFrame.style.transform = transform;
|
}
|
|
this._viewportPosition = index;
|
|
if (!this._transitionStart) {
|
if (index % 1 === 0) {
|
return;
|
}
|
|
this._transitionStart = index;
|
}
|
|
index -= Math.floor(this._transitionStart);
|
|
if (index <= -(this.items.length - 1)) {
|
index += this.items.length;
|
} else if (index >= this.items.length) {
|
index -= this.items.length;
|
}
|
|
index = this._transitionStart % 1 > 0.5 || this._transitionStart < 0 ? index - 1 : index;
|
this.$trigger('transition', {}, {
|
dx: this.vertical ? 0 : index * slideFrame.offsetWidth,
|
dy: this.vertical ? index * slideFrame.offsetHeight : 0
|
});
|
},
|
_animateFrameFuncProto: function _animateFrameFuncProto() {
|
var _this3 = this;
|
|
if (!this._animating) {
|
this._requestedAnimation = false;
|
return;
|
}
|
|
var _animating = this._animating;
|
var toPos = _animating.toPos;
|
var acc = _animating.acc;
|
var endTime = _animating.endTime;
|
var source = _animating.source;
|
var time = endTime - Date.now();
|
|
if (time <= 0) {
|
this._updateViewport(toPos);
|
|
this._animating = null;
|
this._requestedAnimation = false;
|
this._transitionStart = null;
|
var item = this.items[this.currentSync];
|
|
if (item) {
|
this._itemReady(item, function () {
|
var currentItemId = item.componentInstance.itemId || '';
|
|
_this3.$trigger('animationfinish', {}, {
|
current: _this3.currentSync,
|
currentItemId: currentItemId,
|
source: source
|
});
|
});
|
}
|
|
return;
|
}
|
|
var s = acc * time * time / 2;
|
var l = toPos + s;
|
|
this._updateViewport(l);
|
|
this._animationFrame = requestAnimationFrame(this._animateFrameFuncProto.bind(this));
|
},
|
_animateViewport: function _animateViewport(current, source, n) {
|
this._cancelViewportAnimation();
|
|
var duration = this.durationNumber;
|
var length = this.items.length;
|
var position = this._viewportPosition;
|
|
if (this.circularEnabled) {
|
if (n < 0) {
|
for (; position < current;) {
|
position += length;
|
}
|
|
for (; position - length > current;) {
|
position -= length;
|
}
|
} else if (n > 0) {
|
for (; position > current;) {
|
position -= length;
|
}
|
|
for (; position + length < current;) {
|
position += length;
|
}
|
} else {
|
for (; position + length < current;) {
|
position += length;
|
}
|
|
for (; position - length > current;) {
|
position -= length;
|
}
|
|
if (position + length - current < current - position) {
|
position += length;
|
}
|
}
|
}
|
|
this._animating = {
|
toPos: current,
|
acc: 2 * (position - current) / (duration * duration),
|
endTime: Date.now() + duration,
|
source: source
|
};
|
|
if (!this._requestedAnimation) {
|
this._requestedAnimation = true;
|
this._animationFrame = requestAnimationFrame(this._animateFrameFuncProto.bind(this));
|
}
|
},
|
_cancelViewportAnimation: function _cancelViewportAnimation() {
|
this._animating = null;
|
},
|
|
/**
|
* 结束动画
|
*/
|
_endViewportAnimation: function _endViewportAnimation() {
|
if (this._animating) {
|
this._updateViewport(this._animating.toPos);
|
|
this._animating = null;
|
}
|
},
|
_handleTrackStart: function _handleTrackStart() {
|
this._cancelSchedule();
|
|
this._contentTrackViewport = this._viewportPosition;
|
this._contentTrackSpeed = 0;
|
this._contentTrackT = Date.now();
|
|
this._cancelViewportAnimation();
|
},
|
_handleTrackMove: function _handleTrackMove(data) {
|
var self = this;
|
var contentTrackT = this._contentTrackT;
|
this._contentTrackT = Date.now();
|
var length = this.items.length;
|
var other = length - this.displayMultipleItemsNumber;
|
|
function calc(val) {
|
return 0.5 - 0.25 / (val + 0.5);
|
}
|
|
function move(oldVal, newVal) {
|
var val = self._contentTrackViewport + oldVal;
|
self._contentTrackSpeed = 0.6 * self._contentTrackSpeed + 0.4 * newVal;
|
|
if (!self.circularEnabled) {
|
if (val < 0 || val > other) {
|
if (val < 0) {
|
val = -calc(-val);
|
} else {
|
if (val > other) {
|
val = other + calc(val - other);
|
}
|
}
|
|
self._contentTrackSpeed = 0;
|
}
|
}
|
|
self._updateViewport(val);
|
}
|
|
var time = this._contentTrackT - contentTrackT || 1;
|
|
if (this.vertical) {
|
move(-data.dy / this.$refs.slideFrame.offsetHeight, -data.ddy / time);
|
} else {
|
move(-data.dx / this.$refs.slideFrame.offsetWidth, -data.ddx / time);
|
}
|
},
|
_handleTrackEnd: function _handleTrackEnd(isCancel) {
|
this.userTracking = false;
|
var t = this._contentTrackSpeed / Math.abs(this._contentTrackSpeed);
|
var n = 0;
|
|
if (!isCancel && Math.abs(this._contentTrackSpeed) > 0.2) {
|
n = 0.5 * t;
|
}
|
|
var current = this._normalizeCurrentValue(this._viewportPosition + n);
|
|
if (isCancel) {
|
this._updateViewport(this._contentTrackViewport);
|
} else {
|
this.currentChangeSource = 'touch';
|
this.currentSync = current;
|
|
this._animateViewport(current, 'touch', n !== 0 ? n : current === 0 && this.circularEnabled && this._viewportPosition >= 1 ? 1 : 0);
|
}
|
},
|
_handleContentTrack: function _handleContentTrack(e) {
|
if (this.disableTouch) {
|
return;
|
}
|
|
if (!this._invalid) {
|
if (e.detail.state === 'start') {
|
this.userTracking = true;
|
this._userDirectionChecked = false;
|
return this._handleTrackStart();
|
} // fixed by xxxxxx
|
|
|
if (e.detail.state === 'end') {
|
return this._handleTrackEnd(false);
|
}
|
|
if (e.detail.state === 'cancel') {
|
return this._handleTrackEnd(true);
|
}
|
|
if (this.userTracking) {
|
if (!this._userDirectionChecked) {
|
this._userDirectionChecked = true;
|
var t = Math.abs(e.detail.dx);
|
var n = Math.abs(e.detail.dy);
|
|
if (t >= n && this.vertical) {
|
this.userTracking = false;
|
} else {
|
if (t <= n && !this.vertical) {
|
this.userTracking = false;
|
}
|
}
|
|
if (!this.userTracking) {
|
if (this.autoplay) {
|
this._scheduleAutoplay();
|
}
|
|
return;
|
}
|
}
|
|
this._handleTrackMove(e.detail);
|
|
return false;
|
}
|
}
|
}
|
},
|
render: function render(createElement) {
|
var _this4 = this;
|
|
var slidesDots = [];
|
var swiperItems = [];
|
|
if (this.$slots.default) {
|
Object(shared["d" /* deepClone */])(this.$slots.default, createElement).forEach(function (vnode) {
|
if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-swiper-item') {
|
swiperItems.push(vnode);
|
}
|
});
|
}
|
|
var _loop = function _loop(index, length) {
|
var currentSync = _this4.currentSync;
|
slidesDots.push(createElement('div', {
|
on: {
|
click: function click() {
|
_this4._animateViewport(_this4.currentSync = index, _this4.currentChangeSource = 'click', _this4.circularEnabled ? 1 : 0);
|
}
|
},
|
class: {
|
'uni-swiper-dot': true,
|
'uni-swiper-dot-active': index < currentSync + _this4.displayMultipleItemsNumber && index >= currentSync || index < currentSync + _this4.displayMultipleItemsNumber - length
|
},
|
style: {
|
background: index === currentSync ? _this4.indicatorActiveColor : _this4.indicatorColor
|
}
|
}));
|
};
|
|
for (var index = 0, length = swiperItems.length; index < length; index++) {
|
_loop(index, length);
|
}
|
|
this.items = swiperItems;
|
var slidesWrapperChild = [createElement('div', {
|
ref: 'slides',
|
style: this.slidesStyle,
|
class: 'uni-swiper-slides'
|
}, [createElement('div', {
|
ref: 'slideFrame',
|
class: 'uni-swiper-slide-frame',
|
style: this.slideFrameStyle
|
}, swiperItems)])];
|
|
if (this.indicatorDots) {
|
slidesWrapperChild.push(createElement('div', {
|
ref: 'slidesDots',
|
class: ['uni-swiper-dots', this.vertical ? 'uni-swiper-dots-vertical' : 'uni-swiper-dots-horizontal']
|
}, slidesDots));
|
}
|
|
return createElement('uni-swiper', {
|
on: this.$listeners
|
}, [createElement('div', {
|
ref: 'slidesWrapper',
|
class: 'uni-swiper-wrapper'
|
}, slidesWrapperChild)]);
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/swiper/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_swipervue_type_script_lang_js_ = (swipervue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/swiper/index.vue?vue&type=style&index=0&lang=css&
|
var swipervue_type_style_index_0_lang_css_ = __webpack_require__(148);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/swiper/index.vue
|
var swiper_render, staticRenderFns
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_swipervue_type_script_lang_js_,
|
swiper_render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/swiper/index.vue"
|
/* harmony default export */ var swiper = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 197 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/text/index.vue?vue&type=script&lang=js&
|
var SPACE_UNICODE = {
|
ensp: "\u2002",
|
emsp: "\u2003",
|
nbsp: "\xA0"
|
};
|
/* harmony default export */ var textvue_type_script_lang_js_ = ({
|
name: 'Text',
|
props: {
|
selectable: {
|
type: [Boolean, String],
|
default: false
|
},
|
space: {
|
type: String,
|
default: ''
|
},
|
decode: {
|
type: [Boolean, String],
|
default: false
|
}
|
},
|
methods: {
|
_decodeHtml: function _decodeHtml(htmlString) {
|
if (this.space && SPACE_UNICODE[this.space]) {
|
htmlString = htmlString.replace(/ /g, SPACE_UNICODE[this.space]);
|
}
|
|
if (this.decode) {
|
htmlString = htmlString.replace(/ /g, SPACE_UNICODE.nbsp).replace(/ /g, SPACE_UNICODE.ensp).replace(/ /g, SPACE_UNICODE.emsp).replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, "'");
|
}
|
|
return htmlString;
|
}
|
},
|
render: function render(createElement) {
|
var _this = this;
|
|
var nodeList = [];
|
this.$slots.default && this.$slots.default.forEach(function (vnode) {
|
if (vnode.text) {
|
// 处理可能出现的多余的转义字符
|
var nodeText = vnode.text.replace(/\\n/g, '\n');
|
var texts = nodeText.split('\n');
|
texts.forEach(function (text, index) {
|
nodeList.push(_this._decodeHtml(text));
|
|
if (index !== texts.length - 1) {
|
nodeList.push(createElement('br'));
|
}
|
});
|
} else {
|
if (vnode.componentOptions && vnode.componentOptions.tag !== 'v-uni-text') {
|
console.warn('Do not nest other components in the text component, as there may be display differences on different platforms.');
|
}
|
|
nodeList.push(vnode);
|
}
|
});
|
return createElement('uni-text', {
|
on: this.$listeners,
|
attrs: {
|
selectable: !!this.selectable
|
}
|
}, [createElement('span', {}, nodeList)]);
|
}
|
});
|
// CONCATENATED MODULE: ./src/core/view/components/text/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_textvue_type_script_lang_js_ = (textvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/core/view/components/text/index.vue?vue&type=style&index=0&lang=css&
|
var textvue_type_style_index_0_lang_css_ = __webpack_require__(150);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/core/view/components/text/index.vue
|
var render, staticRenderFns
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_textvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/core/view/components/text/index.vue"
|
/* harmony default export */ var components_text = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 198 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/mixins/native.js
|
var mixins_native = __webpack_require__(7);
|
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/mixins/cover.js
|
var cover = __webpack_require__(73);
|
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/platforms/app-plus/view/components/cover-view/index.vue?vue&type=script&lang=js&
|
|
|
/* harmony default export */ var cover_viewvue_type_script_lang_js_ = ({
|
name: 'CoverView',
|
mixins: [mixins_native["a" /* default */], cover["a" /* default */]],
|
props: {},
|
data: function data() {
|
return {
|
coverType: 'text',
|
coverContent: ''
|
};
|
},
|
render: function render(createElement) {
|
var coverContent = '';
|
var $slots = this.$slots.default || [];
|
|
var _slots = $slots.filter(function (node) {
|
return node.tag;
|
});
|
|
if (!_slots.length) {
|
$slots.forEach(function (node) {
|
if (!node.tag) {
|
coverContent += node.text || '';
|
}
|
});
|
this.coverContent = coverContent;
|
} else {
|
coverContent = _slots;
|
}
|
|
return createElement('uni-cover-view', {
|
on: {
|
on: this.$listeners
|
}
|
}, [createElement('div', {
|
ref: 'container',
|
staticClass: 'uni-cover-view'
|
}, [].concat(coverContent))]);
|
}
|
});
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/cover-view/index.vue?vue&type=script&lang=js&
|
/* harmony default export */ var components_cover_viewvue_type_script_lang_js_ = (cover_viewvue_type_script_lang_js_);
|
// EXTERNAL MODULE: ./src/platforms/app-plus/view/components/cover-view/index.vue?vue&type=style&index=0&lang=css&
|
var cover_viewvue_type_style_index_0_lang_css_ = __webpack_require__(156);
|
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
var componentNormalizer = __webpack_require__(1);
|
|
// CONCATENATED MODULE: ./src/platforms/app-plus/view/components/cover-view/index.vue
|
var render, staticRenderFns
|
|
|
|
|
|
/* normalize component */
|
|
var component = Object(componentNormalizer["a" /* default */])(
|
components_cover_viewvue_type_script_lang_js_,
|
render,
|
staticRenderFns,
|
false,
|
null,
|
null,
|
null
|
|
)
|
|
/* hot reload */
|
if (false) { var api; }
|
component.options.__file = "src/platforms/app-plus/view/components/cover-view/index.vue"
|
/* harmony default export */ var cover_view = __webpack_exports__["default"] = (component.exports);
|
|
/***/ }),
|
/* 199 */
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
"use strict";
|
// ESM COMPAT FLAG
|
__webpack_require__.r(__webpack_exports__);
|
|
// EXPORTS
|
__webpack_require__.d(__webpack_exports__, "upx2px", function() { return /* reexport */ view["h" /* upx2px */]; });
|
__webpack_require__.d(__webpack_exports__, "navigateTo", function() { return /* reexport */ view["d" /* navigateTo */]; });
|
__webpack_require__.d(__webpack_exports__, "navigateBack", function() { return /* reexport */ view["c" /* navigateBack */]; });
|
__webpack_require__.d(__webpack_exports__, "reLaunch", function() { return /* reexport */ view["e" /* reLaunch */]; });
|
__webpack_require__.d(__webpack_exports__, "redirectTo", function() { return /* reexport */ view["f" /* redirectTo */]; });
|
__webpack_require__.d(__webpack_exports__, "switchTab", function() { return /* reexport */ view["g" /* switchTab */]; });
|
__webpack_require__.d(__webpack_exports__, "getSystemInfoSync", function() { return /* reexport */ view["b" /* getSystemInfoSync */]; });
|
__webpack_require__.d(__webpack_exports__, "canIUse", function() { return /* reexport */ view["a" /* canIUse */]; });
|
|
// 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 (true) {
|
var getCurrentScript = __webpack_require__(113)
|
currentScript = getCurrentScript()
|
|
// for backward compatibility, because previously we directly included the polyfill
|
if (!('currentScript' in document)) {
|
Object.defineProperty(document, 'currentScript', { get: 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: ./lib/app-plus/view.js
|
var view = __webpack_require__(83);
|
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
|
|
|
|
|
/***/ })
|
/******/ ]);
|
});
|