(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 = "fae3");
/******/ })
/************************************************************************/
/******/ ({
/***/ "0741":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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__("9a72");
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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);
/***/ }),
/***/ "08c9":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "0950":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "0998":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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__("4509");
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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);
/***/ }),
/***/ "0c7c":
/***/ (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 functioal 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
}
}
/***/ }),
/***/ "0dba":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "0f55":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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__("eaa4");
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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);
/***/ }),
/***/ "1047":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "1082":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7050de7c-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/image/index.vue?vue&type=template&id=5c570748&
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.modeStyle)}),_c('img',{attrs:{"src":_vm.realImagePath}}),(_vm.mode === 'widthFix')?_c('v-uni-resize-sensor',{ref:"sensor",on:{"resize":_vm._resize}}):_vm._e()],1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/core/view/components/image/index.vue?vue&type=template&id=5c570748&
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/image/index.vue?vue&type=script&lang=js&
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
//
//
//
//
//
//
//
//
//
//
//
//
/* 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
}
},
data: function data() {
return {
originalWidth: 0,
originalHeight: 0,
availHeight: '',
sizeFixed: false
};
},
computed: {
ratio: function ratio() {
return this.originalWidth && this.originalHeight ? this.originalWidth / this.originalHeight : 0;
},
realImagePath: function realImagePath() {
return this.src && this.$getRealPath(this.src);
},
modeStyle: function modeStyle() {
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':
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-position:".concat(position, ";background-size:").concat(size, ";background-repeat:").concat(repeat, ";");
}
},
watch: {
src: function src(newValue, oldValue) {
this._loadImage();
},
mode: function mode(newValue, oldValue) {
if (oldValue === 'widthFix') {
this.$el.style.height = this.availHeight;
this.sizeFixed = false;
}
if (newValue === 'widthFix' && this.ratio) {
this._fixSize();
}
}
},
mounted: function mounted() {
this.availHeight = this.$el.style.height || '';
this._loadImage();
},
methods: {
_resize: function _resize() {
if (this.mode === 'widthFix' && !this.sizeFixed) {
this._fixSize();
}
},
_fixSize: function _fixSize() {
var elWidth = this._getWidth();
if (elWidth) {
var height = elWidth / this.ratio; // fix: 解决 Chrome 浏览器上某些情况下导致 1px 缝隙的问题
if ((typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) && navigator.vendor === 'Google Inc.' && height > 10) {
height = Math.round(height / 2) * 2;
}
this.$el.style.height = height + 'px';
this.sizeFixed = true;
}
},
_loadImage: function _loadImage() {
this.$refs.content.style.backgroundImage = this.src ? "url(".concat(this.realImagePath, ")") : 'none';
var _self = this;
var img = new Image();
img.onload = function ($event) {
_self.originalWidth = this.width;
_self.originalHeight = this.height;
if (_self.mode === 'widthFix') {
_self._fixSize();
}
_self.$trigger('load', $event, {
width: this.width,
height: this.height
});
};
img.onerror = function ($event) {
_self.$trigger('error', $event, {
errMsg: "GET ".concat(_self.src, " 404 (Not Found)")
});
};
img.src = this.realImagePath;
},
_getWidth: function _getWidth() {
var computedStyle = window.getComputedStyle(this.$el);
var borderWidth = (parseFloat(computedStyle.borderLeftWidth, 10) || 0) + (parseFloat(computedStyle.borderRightWidth, 10) || 0);
var paddingWidth = (parseFloat(computedStyle.paddingLeft, 10) || 0) + (parseFloat(computedStyle.paddingRight, 10) || 0);
return this.$el.offsetWidth - borderWidth - paddingWidth;
}
}
});
// 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__("db18");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var components_image = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "1360":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "1442":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initEvent; });
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a20d");
function initEvent(Vue) {
Vue.prototype.$handleViewEvent = function ($vueEvent, options) {
var cid = this._$id;
var nid = $vueEvent.currentTarget.getAttribute('_i');
if (!nid) {
return console.error("[".concat(cid, "] nid not found"));
}
var $event = this.$handleEvent($vueEvent); // 移除无效属性
delete $event._processed;
delete $event.mp;
delete $event.preventDefault;
delete $event.stopPropagation;
UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_UI_EVENT */ "f"], {
data: $event,
options: {
cid: cid,
nid: nid
}
});
};
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("501c")))
/***/ }),
/***/ "17fd":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7050de7c-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/navigator/index.vue?vue&type=template&id=d8d61df6&
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 = []
// CONCATENATED MODULE: ./src/core/view/components/navigator/index.vue?vue&type=template&id=d8d61df6&
// EXTERNAL MODULE: ./src/core/view/mixins/index.js + 1 modules
var mixins = __webpack_require__("8af1");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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["b" /* 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,
default: 20
},
hoverStayTime: {
type: Number,
default: 600
}
},
methods: {
_onClick: function _onClick($event) {
if (this.openType !== 'navigateBack' && !this.url) {
console.error(" 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
});
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__("f7fd");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var components_navigator = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "1922":
/***/ (function(module, exports) {
function webpackEmptyContext(req) {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
webpackEmptyContext.keys = function() { return []; };
webpackEmptyContext.resolve = webpackEmptyContext;
module.exports = webpackEmptyContext;
webpackEmptyContext.id = "1922";
/***/ }),
/***/ "1955":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./src/core/view/mixins/touchtrack.js
var touchtrack = __webpack_require__("ba15");
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/index.js + 2 modules
var scroller = __webpack_require__("8aec");
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Friction.js
var Friction = __webpack_require__("5363");
// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Spring.js
var Spring = __webpack_require__("72b3");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/picker-view-column/index.vue?vue&type=script&lang=js&
/* 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.__pageRerender = this._pageRerender.bind(this)
},
mounted: function mounted() {
var _this = this;
this.touchtrack(this.$refs.main, '_handleTrack', true);
this.setCurrent(this.current);
this.$nextTick(function () {
_this.init();
_this.update();
});
},
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);
break;
case 'move':
this._handleTouchMove(e);
break;
case 'end':
case 'cancel':
this._handleTouchEnd(e);
}
}
},
_handleTap: function _handleTap(e) {
if (e.target !== e.currentTarget && !this._scroller.isScrolling()) {
var t = e.touches && e.touches[0] && e.touches[0].clientY;
var n = typeof t === 'number' ? t : e.detail.y - document.body.scrollTop;
var i = this.$el.getBoundingClientRect();
var r = n - i.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;
this.current += s;
this._scroller.scrollTo(this.current * this.indicatorHeight);
}
}
},
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 index = Math.max(_this3.length - 1, 0);
var current = Math.min(_this3.current, index);
_this3._scroller.update(current * _this3.indicatorHeight, undefined, _this3.indicatorHeight);
});
},
_resize: function _resize(_ref) {
var height = _ref.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: {
tap: this._handleTap
}
}, [createElement('div', {
ref: 'main',
staticClass: 'uni-picker-view-group'
}, [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__("edfa");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var picker_view_column = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "1b6f":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f2b3");
/* 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);
},
methods: {
_toggleListeners: function _toggleListeners(type, id, watch) {
if (watch && !id) {
// id被置空
return;
}
if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isFn */ "c"])(this._handleSubscribe)) {
return;
} // 纠正VUniVideo等组件命名为Video
UniViewJSBridge[type](this.$page.id + '-' + this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase() + '-' + id, this._handleSubscribe);
}
}
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("501c")))
/***/ }),
/***/ "1c64":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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__("9613");
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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);
/***/ }),
/***/ "1e88":
/***/ (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
};
}
/***/ }),
/***/ "1efd":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./packages/uni-app-plus/dist/view.runtime.esm.js
var view_runtime_esm = __webpack_require__("675f");
// 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:.*,.*/;
function addBase(filePath) {
return filePath;
}
function getRealPath(filePath) {
if (filePath.indexOf('/') === 0) {
if (filePath.indexOf('//') === 0) {
filePath = 'https:' + filePath;
} else {
return addBase(filePath.substr(1));
}
} // 网络资源或base64
if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath) || filePath.indexOf('blob:') === 0) {
return filePath;
}
var pages = getCurrentPages();
if (pages.length) {
return addBase(getRealRoute(pages[pages.length - 1].$page.route, filePath).substr(1));
}
return filePath;
}
// EXTERNAL MODULE: ./src/core/view/plugins/events.js + 1 modules
var events = __webpack_require__("d4b6");
// CONCATENATED MODULE: ./src/core/view/mixins/base.js
/* harmony default export */ var base = ({
methods: {
$getRealPath: function $getRealPath(src) {
return getRealPath(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) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
function converPx(value) {
if (/\d+[ur]px$/i.test(value)) {
value.replace(/\d+[ur]px$/i, function (text) {
return "".concat(uni.upx2px(parseFloat(text)), "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', 'backgroundColor'];
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)) {
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);
}
}
animate();
}
/* 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__("5408"), __webpack_require__("1922")];
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; // 全局注册组件
view_runtime_esm["a" /* default */].component(componentConfig.name, componentConfig);
});
});
/***/ }),
/***/ "24aa":
/***/ (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;
/***/ }),
/***/ "250d":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7050de7c-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/input/index.vue?vue&type=template&id=21a5c886&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('uni-input',_vm._g({on:{"change":function($event){$event.stopPropagation();}}},_vm.$listeners),[_c('div',{ref:"wrapper",staticClass:"uni-input-wrapper"},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(!(_vm.composing || _vm.inputValue.length)),expression:"!(composing || inputValue.length)"}],ref:"placeholder",staticClass:"uni-input-placeholder",class:_vm.placeholderClass,style:(_vm.placeholderStyle)},[_vm._v(_vm._s(_vm.placeholder))]),((_vm.inputType)==='checkbox')?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{"disabled":_vm.disabled,"maxlength":_vm.maxlength,"step":_vm.step,"autocomplete":"off","type":"checkbox"},domProps:{"checked":Array.isArray(_vm.inputValue)?_vm._i(_vm.inputValue,null)>-1:(_vm.inputValue)},on:{"focus":_vm._onFocus,"blur":_vm._onBlur,"input":function($event){$event.stopPropagation();return _vm._onInput($event)},"compositionstart":_vm._onComposition,"compositionend":_vm._onComposition,"keyup":function($event){$event.stopPropagation();return _vm._onKeyup($event)},"change":function($event){var $$a=_vm.inputValue,$$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.inputValue=$$a.concat([$$v]))}else{$$i>-1&&(_vm.inputValue=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.inputValue=$$c}}}}):((_vm.inputType)==='radio')?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{"disabled":_vm.disabled,"maxlength":_vm.maxlength,"step":_vm.step,"autocomplete":"off","type":"radio"},domProps:{"checked":_vm._q(_vm.inputValue,null)},on:{"focus":_vm._onFocus,"blur":_vm._onBlur,"input":function($event){$event.stopPropagation();return _vm._onInput($event)},"compositionstart":_vm._onComposition,"compositionend":_vm._onComposition,"keyup":function($event){$event.stopPropagation();return _vm._onKeyup($event)},"change":function($event){_vm.inputValue=null}}}):_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{"disabled":_vm.disabled,"maxlength":_vm.maxlength,"step":_vm.step,"autocomplete":"off","type":_vm.inputType},domProps:{"value":(_vm.inputValue)},on:{"focus":_vm._onFocus,"blur":_vm._onBlur,"input":[function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value},function($event){$event.stopPropagation();return _vm._onInput($event)}],"compositionstart":_vm._onComposition,"compositionend":_vm._onComposition,"keyup":function($event){$event.stopPropagation();return _vm._onKeyup($event)}}})])])}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/core/view/components/input/index.vue?vue&type=template&id=21a5c886&
// EXTERNAL MODULE: ./src/core/view/mixins/index.js + 1 modules
var mixins = __webpack_require__("8af1");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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'];
var NUMBER_TYPES = ['number', 'digit'];
/* harmony default export */ var inputvue_type_script_lang_js_ = ({
name: 'Input',
mixins: [mixins["a" /* emitter */]],
model: {
prop: 'value',
event: 'update:value'
},
props: {
name: {
type: String,
default: ''
},
value: {
type: [String, Number],
default: ''
},
type: {
type: String,
default: 'text'
},
password: {
type: [Boolean, String],
default: false
},
placeholder: {
type: String,
default: ''
},
placeholderStyle: {
type: String,
default: ''
},
placeholderClass: {
type: String,
default: ''
},
disabled: {
type: [Boolean, String],
default: false
},
maxlength: {
type: [Number, String],
default: 140
},
focus: {
type: [Boolean, String],
default: false
},
confirmType: {
type: String,
default: 'done'
}
},
data: function data() {
return {
inputValue: this.value + '',
composing: false,
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' : '';
}
},
watch: {
focus: function focus(value) {
value && this._focusInput();
},
value: function value(_value) {
this.inputValue = _value + '';
},
inputValue: function inputValue(value) {
this.$emit('update:value', value);
},
maxlength: function maxlength(value) {
var realValue = this.inputValue.slice(0, parseInt(value, 10));
realValue !== this.inputValue && (this.inputValue = 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;
}
this.focus && this._focusInput();
},
beforeDestroy: function beforeDestroy() {
this.$dispatch('Form', 'uni-form-group-update', {
type: 'remove',
vm: this
});
},
methods: {
_onKeyup: function _onKeyup($event) {
if ($event.keyCode === 13) {
this.$trigger('confirm', $event, {
value: $event.target.value
});
}
},
_onInput: function _onInput($event) {
if (this.composing) {
return;
} // 处理部分输入法可以输入其它字符的情况
if (~NUMBER_TYPES.indexOf(this.type)) {
if (this.$refs.input.validity && !this.$refs.input.validity.valid) {
$event.target.value = this.cachedValue;
this.inputValue = $event.target.value; // 输入非法字符不触发 input 事件
return;
} else {
this.cachedValue = this.inputValue;
}
} // type="number" 不支持 maxlength 属性,因此需要主动限制长度。
if (this.inputType === 'number') {
var maxlength = parseInt(this.maxlength, 10);
if (maxlength > 0 && $event.target.value.length > maxlength) {
$event.target.value = $event.target.value.slice(0, maxlength);
this.inputValue = $event.target.value; // 字符长度超出范围不触发 input 事件
return;
}
}
this.$trigger('input', $event, {
value: this.inputValue
});
},
_onFocus: function _onFocus($event) {
this.$trigger('focus', $event, {
value: $event.target.value
});
},
_onBlur: function _onBlur($event) {
this.$trigger('blur', $event, {
value: $event.target.value
});
},
_focusInput: function _focusInput() {
var _this = this;
setTimeout(function () {
_this.$refs.input.focus();
}, 350);
},
_blurInput: function _blurInput() {
var _this2 = this;
setTimeout(function () {
_this2.$refs.input.blur();
}, 350);
},
_onComposition: function _onComposition($event) {
if ($event.type === 'compositionstart') {
this.composing = true;
} else {
this.composing = false;
}
},
_resetFormData: function _resetFormData() {
this.inputValue = '';
},
_getFormData: function _getFormData() {
return this.name ? {
value: this.inputValue,
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__("0f55");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var input = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "25ce":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7050de7c-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/checkbox-group/index.vue?vue&type=template&id=6fa043c2&
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 = []
// CONCATENATED MODULE: ./src/core/view/components/checkbox-group/index.vue?vue&type=template&id=6fa043c2&
// EXTERNAL MODULE: ./src/core/view/mixins/index.js + 1 modules
var mixins = __webpack_require__("8af1");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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["c" /* 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__("0998");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var checkbox_group = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "27ab":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
/* 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) {
var _this = this;
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) {
this.$slots.default.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__("6062");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// CONCATENATED MODULE: ./src/core/view/components/picker-view/index.vue
var render, staticRenderFns
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
components_picker_viewvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var picker_view = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "2bbe":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7050de7c-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/view/index.vue?vue&type=template&id=164058a7&
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 = []
// CONCATENATED MODULE: ./src/core/view/components/view/index.vue?vue&type=template&id=164058a7&
// EXTERNAL MODULE: ./src/core/view/mixins/hover.js
var hover = __webpack_require__("83a6");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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__("e865");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var view = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "33ed":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* unused harmony export disableScroll */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return pageScrollTo; });
/* unused harmony export createScrollListener */
/* harmony import */ var uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5bb5");
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)`
}
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 _document$documentEle = document.documentElement,
clientHeight = _document$documentEle.clientHeight,
scrollHeight = _document$documentEle.scrollHeight;
var scrollY = window.scrollY;
var isBottom = scrollY > 0 && scrollHeight > clientHeight && scrollY + clientHeight + onReachBottomDistance >= scrollHeight;
if (isBottom && !hasReachBottom) {
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
});
}
if (enablePageReachBottom && onReachBottom && isReachBottom()) {
Object(uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__[/* publishHandler */ "a"])('onReachBottom', {}, pageId);
onReachBottom = false;
setTimeout(function () {
onReachBottom = true;
}, 350);
}
ticking = false;
}
return function onScroll() {
if (!ticking) {
requestAnimationFrame(trigger);
}
ticking = true;
};
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("501c")))
/***/ }),
/***/ "3e5d":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initData; });
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a20d");
/* harmony import */ var _vdom_sync__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9d20");
/* harmony import */ var _page__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("9856");
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) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArrayLimit(arr, i) { 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 handleData = (_handleData = {}, _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_0__[/* PAGE_CREATE */ "c"], function onPageCreate(data) {
var _data = _slicedToArray(data, 1),
pageId = _data[0];
__uniConfig.id = pageId;
vd = new _vdom_sync__WEBPACK_IMPORTED_MODULE_1__[/* VDomSync */ "a"](pageId);
}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_0__[/* MOUNTED_DATA */ "b"], function onMounted(data) {
vd.addVData.apply(vd, data);
}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_0__[/* UPDATED_DATA */ "e"], function onUpdated(data) {
vd.updateVData.apply(vd, data);
}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_0__[/* PAGE_CREATED */ "d"], function onPageCreated(data) {
var _data2 = _slicedToArray(data, 1),
pagePath = _data2[0];
Object(_page__WEBPACK_IMPORTED_MODULE_2__[/* createPage */ "a"])(pagePath, {
mpType: 'page',
pageId: vd.pageId,
pagePath: pagePath
}).$mount('#app');
}), _handleData);
function vdSync(_ref) {
var data = _ref.data,
options = _ref.options;
data.forEach(function (data) {
handleData[data[0]](data[1]);
});
vd.flush();
}
function initData(Vue) {
UniViewJSBridge.subscribe('vdSync', 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);
console.log("[".concat(this._$id, "] beforeCreate ") + Date.now());
} else {
console.log("[null] beforeCreate " + Date.now());
}
}
});
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("501c")))
/***/ }),
/***/ "3e8c":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/resize-sensor/index.vue?vue&type=script&lang=js&
/* 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();
}
},
methods: {
reset: function reset() {
var expand = this.$el.firstChild;
var shrink = this.$el.lastChild;
expand.scrollLeft = 100000;
expand.scrollTop = 100000;
shrink.scrollLeft = 100000;
shrink.scrollTop = 100000;
},
update: function update() {
this.size.width = this.$el.offsetWidth;
this.size.height = this.$el.offsetHeight;
this.reset();
}
},
render: function render(create) {
return create('uni-resize-sensor', {
on: {
'~animationstart': this.update
}
}, [create('div', {
on: {
scroll: this.update
}
}, [create('div')]), create('div', {
on: {
scroll: this.update
}
}, [create('div')])]);
}
});
// 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__("64d0");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// CONCATENATED MODULE: ./src/core/view/components/resize-sensor/index.vue
var render, staticRenderFns
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
components_resize_sensorvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var resize_sensor = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "4509":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "4656":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "4871":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "488c":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "4da7":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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(' 组件内只支持嵌套 ,不支持其它组件或自定义组件,否则会引发在不同平台的渲染差异。');
}
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__("c8ed");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var components_text = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "4f1c":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7050de7c-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/switch/index.vue?vue&type=template&id=4b47fc1e&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('uni-switch',_vm._g({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 = []
// CONCATENATED MODULE: ./src/core/view/components/switch/index.vue?vue&type=template&id=4b47fc1e&
// EXTERNAL MODULE: ./src/core/view/mixins/index.js + 1 modules
var mixins = __webpack_require__("8af1");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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["c" /* 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__("a5ec");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var components_switch = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "501c":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./packages/uni-app-plus/dist/view.runtime.esm.js
var view_runtime_esm = __webpack_require__("675f");
// EXTERNAL MODULE: ./src/shared/index.js + 4 modules
var shared = __webpack_require__("f2b3");
// EXTERNAL MODULE: ./src/core/helpers/index.js
var helpers = __webpack_require__("85b6");
// CONCATENATED MODULE: ./src/core/helpers/constants.js
var NAVBAR_HEIGHT = 44;
var TABBAR_HEIGHT = 50;
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/scroll.js
var subscribe_scroll = __webpack_require__("33ed");
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-component-info.js
var request_component_info = __webpack_require__("6bdf");
// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-component-observer.js
var request_component_observer = __webpack_require__("5dc1");
// CONCATENATED MODULE: ./src/core/view/bridge/subscribe/api/index.js
/* harmony default export */ var api = ({
requestComponentInfo: request_component_info["a" /* requestComponentInfo */],
requestComponentObserver: request_component_observer["b" /* requestComponentObserver */],
destroyComponentObserver: request_component_observer["a" /* destroyComponentObserver */]
});
// CONCATENATED MODULE: ./src/core/view/bridge/subscribe/index.js
var passiveOptions = shared["e" /* supportsPassive */] ? {
passive: false
} : false;
function updateCssVar(vm) {
if (uni.canIUse('css.var')) {
var pageVm = vm.$parent.$parent;
var windowTop = pageVm.showNavigationBar && pageVm.navigationBar.type !== 'transparent' && pageVm.navigationBar.type !== 'float' ? NAVBAR_HEIGHT + 'px' : '0px';
var windowBottom = getApp().$children[0].showTabBar ? TABBAR_HEIGHT + 'px' : '0px';
var style = document.documentElement.style;
style.setProperty('--window-top', windowTop);
style.setProperty('--window-bottom', windowBottom);
console.debug("".concat(vm.$page.route, "[").concat(vm.$page.id, "]\uFF1A--window-top=").concat(windowTop));
console.debug("".concat(vm.$page.route, "[").concat(vm.$page.id, "]\uFF1A--window-bottom=").concat(windowBottom));
}
}
function initSubscribe(subscribe) {
Object.keys(api).forEach(function (name) {
subscribe(name, api[name]);
});
subscribe('pageScrollTo', subscribe_scroll["a" /* pageScrollTo */]);
if (false) { var disableScrollListener, scrollListener; }
}
// EXTERNAL MODULE: ./src/platforms/app-plus/view/bridge.js
var bridge = __webpack_require__("5bb5");
// CONCATENATED MODULE: ./src/core/view/bridge/index.js
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "on", function() { return on; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "off", function() { return off; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "emit", function() { return emit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribe", function() { return bridge_subscribe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unsubscribe", function() { return unsubscribe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeHandler", function() { return subscribeHandler; });
/* concated harmony reexport publishHandler */__webpack_require__.d(__webpack_exports__, "publishHandler", function() { return bridge["a" /* publishHandler */]; });
var Emitter = new view_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 bridge_subscribe(event, callback) {
return on('service.' + event, callback);
}
function unsubscribe(event, callback) {
return off('service.' + event, callback);
}
function subscribeHandler(event, args, pageId) {
emit('service.' + event, args, pageId);
}
initSubscribe(bridge_subscribe);
/***/ }),
/***/ "5129":
/***/ (function(module, exports) {
module.exports = ['uni-app', 'uni-tabbar', 'uni-page', 'uni-page-head', 'uni-page-wrapper', 'uni-page-body', 'uni-page-refresh', 'uni-actionsheet', 'uni-modal', 'uni-picker', 'uni-toast', 'uni-resize-sensor', 'uni-ad', 'uni-audio', 'uni-button', 'uni-camera', 'uni-canvas', 'uni-checkbox', 'uni-checkbox-group', 'uni-cover-image', 'uni-cover-view', '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'];
/***/ }),
/***/ "5363":
/***/ (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
}];
};
/***/ }),
/***/ "5408":
/***/ (function(module, exports, __webpack_require__) {
var map = {
"./button/index.vue": "d3bd",
"./canvas/index.vue": "bacd",
"./checkbox-group/index.vue": "25ce",
"./checkbox/index.vue": "7bb3",
"./form/index.vue": "b34d",
"./icon/index.vue": "9a8b",
"./image/index.vue": "1082",
"./input/index.vue": "250d",
"./label/index.vue": "70f4",
"./movable-area/index.vue": "c61c",
"./movable-view/index.vue": "8842",
"./navigator/index.vue": "17fd",
"./picker-view-column/index.vue": "1955",
"./picker-view/index.vue": "27ab",
"./picker/index.vue": "c35d",
"./progress/index.vue": "9b1f",
"./radio-group/index.vue": "d5ec",
"./radio/index.vue": "6491",
"./resize-sensor/index.vue": "3e8c",
"./rich-text/index.vue": "b705",
"./scroll-view/index.vue": "f1ef",
"./slider/index.vue": "9f96",
"./swiper-item/index.vue": "9213",
"./swiper/index.vue": "5513",
"./switch/index.vue": "4f1c",
"./text/index.vue": "4da7",
"./textarea/index.vue": "5768",
"./view/index.vue": "2bbe"
};
function webpackContext(req) {
var id = webpackContextResolve(req);
return __webpack_require__(id);
}
function webpackContextResolve(req) {
var id = map[req];
if(!(id + 1)) { // check for number or string
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
return id;
}
webpackContext.keys = function webpackContextKeys() {
return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = "5408";
/***/ }),
/***/ "5513":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./src/core/view/mixins/touchtrack.js
var touchtrack = __webpack_require__("ba15");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/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
}
},
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) {
this._currentChanged(val);
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._resetLayout();
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();
},
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) {
var _this2 = this;
var source = this.currentChangeSource;
this.currentChangeSource = '';
if (!source) {
this._animateViewport(current, '', 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);
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;
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._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 slidesDots = [];
var swiperItems = [];
if (this.$slots.default) {
this.$slots.default.forEach(function (vnode) {
if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-swiper-item') {
swiperItems.push(vnode);
}
});
}
for (var index = 0, length = swiperItems.length; index < length; index++) {
var currentSync = this.currentSync;
slidesDots.push(createElement('div', {
class: {
'uni-swiper-dot': true,
'uni-swiper-dot-active': index < currentSync + this.displayMultipleItemsNumber && index >= currentSync || index < currentSync + this.displayMultipleItemsNumber - length
},
style: {
'background': index === currentSync ? this.indicatorActiveColor : this.indicatorColor
}
}));
}
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', [createElement('div', {
ref: 'slidesWrapper',
'class': 'uni-swiper-wrapper',
on: this.$listeners
}, 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__("1c64");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// CONCATENATED MODULE: ./src/core/view/components/swiper/index.vue
var render, staticRenderFns
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
components_swipervue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var swiper = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "5676":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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__("0950");
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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);
/***/ }),
/***/ "5768":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7050de7c-vue-loader-template"}!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/textarea/index.vue?vue&type=template&id=2edd7458&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('uni-textarea',_vm._g({attrs:{"value":_vm._checkEmpty(_vm.value),"maxlength":_vm.maxlengthNumber,"placeholder":_vm._checkEmpty(_vm.placeholder),"disabled":_vm.disabled,"focus":_vm.focus,"auto-focus":_vm.autoFocus,"placeholder-class":_vm._checkEmpty(_vm.placeholderClass),"placeholder-style":_vm._checkEmpty(_vm.placeholderStyle),"auto-height":_vm.autoHeight,"cursor":_vm.cursorNumber,"selection-start":_vm.selectionStartNumber,"selection-end":_vm.selectionEndNumber},on:{"change":function($event){$event.stopPropagation();}}},_vm.$listeners),[_c('div',{staticClass:"uni-textarea-wrapper"},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(!(_vm.composition||_vm.valueSync.length)),expression:"!(composition||valueSync.length)"}],ref:"placeholder",staticClass:"uni-textarea-placeholder",class:_vm.placeholderClass,style:(_vm.placeholderStyle)},[_vm._v(_vm._s(_vm.placeholder))]),_c('div',{staticClass:"uni-textarea-compute"},[_vm._l((_vm.valueCompute),function(item,index){return _c('div',{key:index},[_vm._v(_vm._s(item.trim() ? item : '.'))])}),_c('v-uni-resize-sensor',{ref:"sensor",on:{"resize":_vm._resize}})],2),_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.valueSync),expression:"valueSync"}],ref:"textarea",staticClass:"uni-textarea-textarea",class:{'uni-textarea-textarea-ios': _vm.isIOS},attrs:{"disabled":_vm.disabled,"maxlength":_vm.maxlengthNumber,"autofocus":_vm.autoFocus},domProps:{"value":(_vm.valueSync)},on:{"compositionstart":_vm._compositionstart,"compositionend":_vm._compositionend,"input":[function($event){if($event.target.composing){ return; }_vm.valueSync=$event.target.value},function($event){$event.stopPropagation();return _vm._input($event)}],"focus":_vm._focus,"blur":_vm._blur,"&touchstart":function($event){return _vm._touchstart($event)}}})])])}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/core/view/components/textarea/index.vue?vue&type=template&id=2edd7458&
// EXTERNAL MODULE: ./src/core/view/mixins/index.js + 1 modules
var mixins = __webpack_require__("8af1");
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-service/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/core/view/components/textarea/index.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var textareavue_type_script_lang_js_ = ({
name: 'Textarea',
mixins: [mixins["a" /* emitter */]],
model: {
prop: 'value',
event: 'update:value'
},
props: {
name: {
type: String,
default: ''
},
value: {
type: [String, Number],
default: ''
},
maxlength: {
type: [Number, String],
default: 140
},
placeholder: {
type: String,
default: ''
},
disabled: {
type: [Boolean, String],
default: false
},
focus: {
type: [Boolean, String],
default: false
},
autoFocus: {
type: [Boolean, String],
default: false
},
placeholderClass: {
type: String,
default: ''
},
placeholderStyle: {
type: String,
default: ''
},
autoHeight: {
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 {
valueSync: String(this.value),
valueComposition: '',
composition: false,
focusSync: this.focus,
height: 0,
focusChangeSource: '',
isIOS: String(navigator.platform).indexOf('iP') === 0 && String(navigator.vendor).indexOf('Apple') === 0
};
},
computed: {
maxlengthNumber: function maxlengthNumber() {
var maxlength = Number(this.maxlength);
return isNaN(maxlength) ? 140 : maxlength;
},
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;
},
valueCompute: function valueCompute() {
return (this.composition ? this.valueComposition : this.valueSync).split('\n');
}
},
watch: {
value: function value(val) {
this.valueSync = String(val);
},
valueSync: function valueSync(val) {
if (val !== this._oldValue) {
this._oldValue = val;
this.$trigger('input', {}, {
value: val,
cursor: this.$refs.textarea.selectionEnd
});
this.$emit('update:value', val);
}
},
focus: function focus(val) {
if (val) {
this.focusChangeSource = 'focus';
if (this.$refs.textarea) {
this.$refs.textarea.focus();
}
} else {
if (this.$refs.textarea) {
this.$refs.textarea.blur();
}
}
},
focusSync: function focusSync(val) {
this.$emit('update:focus', val);
this._checkSelection();
this._checkCursor();
},
cursorNumber: function cursorNumber() {
this._checkCursor();
},
selectionStartNumber: function selectionStartNumber() {
this._checkSelection();
},
selectionEndNumber: function selectionEndNumber() {
this._checkSelection();
},
height: function height(_height) {
var lineHeight = getComputedStyle(this.$el).lineHeight.replace('px', '');
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 = this.height + 'px';
}
}
},
created: function created() {
this.$dispatch('Form', 'uni-form-group-update', {
type: 'add',
vm: this
});
},
mounted: function mounted() {
this._oldValue = this.$refs.textarea.value = this.valueSync;
this._resize({
height: this.$refs.sensor.$el.offsetHeight
});
},
beforeDestroy: function beforeDestroy() {
this.$dispatch('Form', 'uni-form-group-update', {
type: 'remove',
vm: this
});
},
methods: {
_focus: function _focus($event) {
this.focusSync = true;
this.$trigger('focus', $event, {
value: this.valueSync
});
},
_checkSelection: function _checkSelection() {
if (this.focusSync && !this.focusChangeSource && this.selectionStartNumber > -1 && this.selectionEndNumber > -1) {
this.$refs.textarea.selectionStart = this.selectionStartNumber;
this.$refs.textarea.selectionEnd = this.selectionEndNumber;
}
},
_checkCursor: function _checkCursor() {
if (this.focusSync && (this.focusChangeSource === 'focus' || !this.focusChangeSource && this.selectionStartNumber < 0 && this.selectionEndNumber < 0) && this.cursorNumber > -1) {
this.$refs.textarea.selectionEnd = this.$refs.textarea.selectionStart = this.cursorNumber;
}
},
_blur: function _blur($event) {
this.focusSync = false;
this.$trigger('blur', $event, {
value: this.valueSync,
cursor: this.$refs.textarea.selectionEnd
});
},
_compositionstart: function _compositionstart($event) {
this.composition = true;
},
_compositionend: function _compositionend($event) {
this.composition = false;
},
// 暂无完成按钮,此功能未实现
_confirm: function _confirm($event) {
this.$trigger('confirm', $event, {
value: this.valueSync
});
},
_linechange: function _linechange($event) {
this.$trigger('linechange', $event, {
value: this.valueSync
});
},
_touchstart: function _touchstart() {
this.focusChangeSource = 'touch';
},
_resize: function _resize(_ref) {
var height = _ref.height;
this.height = height;
},
_input: function _input($event) {
if (this.composition) {
this.valueComposition = $event.target.value;
}
},
_getFormData: function _getFormData() {
return {
value: this.valueSync,
key: this.name
};
},
_resetFormData: function _resetFormData() {
this.valueSync = '';
},
_checkEmpty: function _checkEmpty(str) {
return str || false;
}
}
});
// 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__("9400");
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("0c7c");
// 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
)
/* harmony default export */ var components_textarea = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "599d":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// 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 upx2px(number, newDeviceWidth) {
if (deviceWidth === 0) {
checkDeviceWidth();
}
number = Number(number);
if (number === 0) {
return 0;
}
var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
if (result < 0) {
result = -result;
}
result = Math.floor(result + EPS);
if (result === 0) {
if (deviceDPR === 1 || !isIOS) {
return 1;
} else {
return 0.5;
}
}
return number < 0 ? -result : result;
}
// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-window-offset.js
var get_window_offset = __webpack_require__("1e88");
// EXTERNAL MODULE: ./node_modules/safe-area-insets/out/index.js
var out = __webpack_require__("d8c8");
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);
/**
* 获取系统信息-同步
*/
function getSystemInfoSync() {
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
var screen = window.screen;
var pixelRatio = window.devicePixelRatio;
var screenWidth = screen.width;
var screenHeight = screen.height;
var language = navigator.language;
var statusBarHeight = 0;
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 {
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
};
}
/**
* 获取系统信息-异步
*/
function getSystemInfo() {
return getSystemInfoSync();
}
// CONCATENATED MODULE: ./lib/app-plus/view-api.js
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return canIUse; });
/* concated harmony reexport upx2px */__webpack_require__.d(__webpack_exports__, "c", function() { return upx2px; });
/* concated harmony reexport getSystemInfoSync */__webpack_require__.d(__webpack_exports__, "b", function() { return getSystemInfoSync; });
function canIUse(schema) {
if (schema === 'css.var') {
return window.CSS && window.CSS.supports && window.CSS.supports('--a', 0);
}
return true;
}
/***/ }),
/***/ "5ab3":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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__("fcd8");
/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_cli_service_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);
/***/ }),
/***/ "5abe":
/***/ (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