@insaic/neon
Version:
A Mobile UI Components built on Vue
458 lines (406 loc) • 14.3 kB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // 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 = 243);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file.
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
module.exports = function normalizeComponent (
rawScriptExports,
compiledTemplate,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier /* server only */
) {
var esModule
var scriptExports = rawScriptExports = rawScriptExports || {}
// ES6 modules interop
var type = typeof rawScriptExports.default
if (type === 'object' || type === 'function') {
esModule = rawScriptExports
scriptExports = rawScriptExports.default
}
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// render functions
if (compiledTemplate) {
options.render = compiledTemplate.render
options.staticRenderFns = compiledTemplate.staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 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 = injectStyles
}
if (hook) {
var functional = options.functional
var existing = functional
? options.render
: options.beforeCreate
if (!functional) {
// inject component registration as beforeCreate hook
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
} else {
// 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
options.render = function renderWithStyleInjection (h, context) {
hook.call(context)
return existing(h, context)
}
}
}
return {
esModule: esModule,
exports: scriptExports,
options: options
}
}
/***/ }),
/***/ 129:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["a"] = ({
name: 'sq-loadmore',
props: {
bottomPullText: {
type: String,
default: '↑'
},
bottomDropText: {
type: String,
default: '↓'
},
bottomLoadingText: {
type: String,
default: '加载中...'
},
bottomFinishedText: {
type: String,
default: '没有更多内容了'
},
bottomFun: {
type: Function
},
threshold: {
type: Number,
default: 70
},
loading: {
type: Boolean,
default: false
},
showLoadingIcon: {
type: Boolean,
default: true
},
isFinishedLoad: {
type: Boolean,
default: false
}
},
mounted: function mounted() {
var _this = this;
this.$nextTick(function () {
_this.init();
});
},
data: function data() {
return {
bottomStatus: '',
bottomText: '',
startLength: 0,
moveLength: 0,
isTransition: false
};
},
computed: {
marginBottom: function marginBottom() {
return this.isFinishedLoad ? '0' : '-50px';
},
transform: function transform() {
return +this.moveLength > 0 || this.isFinishedLoad ? null : 'translate(0, ' + this.moveLength + 'px)';
},
flagWrap: function flagWrap() {
return 'flagWrap' + String(Math.random()).slice(2);
}
},
watch: {
bottomStatus: function bottomStatus(val) {
switch (val) {
case 'pull':
this.bottomText = this.bottomPullText;
break;
case 'drop':
this.bottomText = this.bottomDropText;
break;
case 'loading':
this.bottomText = this.bottomLoadingText;
break;
case 'finished':
this.bottomText = this.bottomFinishedText;
break;
}
},
isFinishedLoad: function isFinishedLoad(val) {
if (val) {
this.bottomStatus = 'finished';
}
}
},
methods: {
$_touchStart: function $_touchStart(event) {
if (this.bottomStatus === 'finished' || this.loading) return;
this.startLength = event.touches[0].pageY;
if (this.bottomStatus !== 'loading') {
this.bottomStatus = 'pull';
}
this.isTransition = false;
},
$_touchmove: function $_touchmove(event) {
if (this.bottomStatus === 'finished' || this.loading) return;
var len = (event.touches[0].pageY - this.startLength) / 2;
if (len < 0) {
var flagWrapHeight = this.$refs[this.flagWrap].getBoundingClientRect().bottom;
var pullWrapHeight = this.$el.parentElement.getBoundingClientRect().bottom;
if (pullWrapHeight + 1 > flagWrapHeight && !this.isFinishedLoad && !this.loading) {
this.moveLength = len;
if (Math.abs(len) > this.threshold) {
this.bottomStatus = 'drop';
} else {
this.bottomStatus = 'pull';
}
}
} else {}
},
$_touchend: function $_touchend(event) {
if (this.bottomStatus === 'finished' || this.loading) return;
if (this.moveLength < 0) {
this.isTransition = true;
if (Math.abs(this.moveLength) > this.threshold) {
this.bottomStatus = 'loading';
this.moveLength = '-50';
this.onPull();
} else {
this.moveLength = '0';
this.bottomStatus = 'pull';
}
}
},
onPull: function onPull() {
this.bottomFun();
},
init: function init() {
this.bottomStatus = 'pull';
this.$el.addEventListener('touchstart', this.$_touchStart);
this.$el.addEventListener('touchmove', this.$_touchmove);
this.$el.addEventListener('touchend', this.$_touchend);
},
inView: function inView(element, ref) {
if (ref === void 0) ref = {};
var offset = ref.offset;
if (offset === void 0) offset = 0;
var threshold = ref.threshold;
if (threshold === void 0) threshold = 0;
var ref$1 = element.getBoundingClientRect();
var top = ref$1.top;
var right = ref$1.right;
var bottom = ref$1.bottom;
var left = ref$1.left;
var width = ref$1.width;
var height = ref$1.height;
var intersection = {
t: bottom,
r: window.innerWidth - left,
b: window.innerHeight - top,
l: right
};
var elementThreshold = {
x: threshold * width,
y: threshold * height
};
return intersection.t >= (offset.top || offset + elementThreshold.y) && intersection.r >= (offset.right || offset + elementThreshold.x) && intersection.b >= (offset.bottom || offset + elementThreshold.y) && intersection.l >= (offset.left || offset + elementThreshold.x);
}
},
beforeDestroy: function beforeDestroy() {
this.$el.removeEventListener('touchstart', this.$_touchStart);
this.$el.removeEventListener('touchmove', this.$_touchmove);
this.$el.removeEventListener('touchend', this.$_touchend);
}
});
/***/ }),
/***/ 243:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_index_vue__ = __webpack_require__(244);
__WEBPACK_IMPORTED_MODULE_0__src_index_vue__["a" /* default */].install = function (Vue) {
Vue.component(__WEBPACK_IMPORTED_MODULE_0__src_index_vue__["a" /* default */].name, __WEBPACK_IMPORTED_MODULE_0__src_index_vue__["a" /* default */]);
};
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__src_index_vue__["a" /* default */]);
/***/ }),
/***/ 244:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__ = __webpack_require__(129);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_62be06c0_hasScoped_false_transformToRequire_video_src_poster_source_src_img_src_image_xlink_href_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__ = __webpack_require__(246);
function injectStyle (ssrContext) {
__webpack_require__(245)
}
var normalizeComponent = __webpack_require__(0)
/* script */
/* template */
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__["a" /* default */],
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_62be06c0_hasScoped_false_transformToRequire_video_src_poster_source_src_img_src_image_xlink_href_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__["a" /* default */],
__vue_template_functional__,
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
/***/ }),
/***/ 245:
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/***/ 246:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"sq-loadmore"},[_c('div',{staticClass:"sq-loadmore-main",class:{'sq-loadmore-is-transition': _vm.isTransition},style:({ 'transform': _vm.transform })},[_vm._t("default"),_vm._v(" "),_c('div',{ref:_vm.flagWrap,staticClass:"sq-loadmore-flag"}),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(!((_vm.bottomStatus === 'loading' && !_vm.loading) || (!_vm.bottomText && _vm.bottomStatus === 'finished'))),expression:"!((bottomStatus === 'loading' && !loading) || (!bottomText && bottomStatus === 'finished'))"}],staticClass:"sq-loadmore-bottom",style:({'marginBottom': _vm.marginBottom})},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.showLoadingIcon && _vm.loading),expression:"showLoadingIcon && loading"}],staticClass:"sq-loadmore-spinner-wrap"},[_c('div',{staticClass:"sq-loadmore-loading-icon"})]),_vm._v(" "),_c('span',{staticClass:"sq-loadmore-bottom-text"},[_vm._v(_vm._s(_vm.bottomText))])])],2)])}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ __webpack_exports__["a"] = (esExports);
/***/ })
/******/ });