| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502 |
- 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;
- /******/ // identity function for calling harmony imports with the correct context
- /******/ __webpack_require__.i = function(value) { return value; };
- /******/ // 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 = 232);
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ 0:
- /***/ function(module, exports) {
- /* globals __VUE_SSR_CONTEXT__ */
- // 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,
- 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
- }
- // 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 {
- // 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
- }
- }
- /***/ },
- /***/ 1:
- /***/ function(module, exports) {
- module.exports = require("vue");
- /***/ },
- /***/ 125:
- /***/ function(module, exports) {
- // removed by extract-text-webpack-plugin
- /***/ },
- /***/ 151:
- /***/ function(module, exports, __webpack_require__) {
- function injectStyle (ssrContext) {
- __webpack_require__(125)
- }
- var Component = __webpack_require__(0)(
- /* script */
- __webpack_require__(73),
- /* template */
- __webpack_require__(195),
- /* styles */
- injectStyle,
- /* scopeId */
- null,
- /* moduleIdentifier (server only) */
- null
- )
- module.exports = Component.exports
- /***/ },
- /***/ 195:
- /***/ function(module, exports) {
- module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
- return _c('div', {
- staticClass: "mt-range",
- class: {
- 'mt-range--disabled': _vm.disabled
- }
- }, [_vm._t("start"), _vm._v(" "), _c('div', {
- ref: "content",
- staticClass: "mt-range-content"
- }, [_c('div', {
- staticClass: "mt-range-runway",
- style: ({
- 'border-top-width': _vm.barHeight + 'px'
- })
- }), _vm._v(" "), _c('div', {
- staticClass: "mt-range-progress",
- style: ({
- width: _vm.progress + '%',
- height: _vm.barHeight + 'px'
- })
- }), _vm._v(" "), _c('div', {
- ref: "thumb",
- staticClass: "mt-range-thumb",
- style: ({
- left: _vm.progress + '%'
- })
- })]), _vm._v(" "), _vm._t("end")], 2)
- },staticRenderFns: []}
- /***/ },
- /***/ 232:
- /***/ function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(40);
- /***/ },
- /***/ 40:
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_index_vue__ = __webpack_require__(151);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_index_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__src_index_vue__);
- Object.defineProperty(exports, "__esModule", { value: true });
- /* harmony reexport (default from non-hamory) */ __webpack_require__.d(exports, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__src_index_vue___default.a; });
- /***/ },
- /***/ 73:
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__draggable__ = __webpack_require__(93);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ exports["default"] = {
- name: 'mt-range',
- props: {
- min: {
- type: Number,
- default: 0
- },
- max: {
- type: Number,
- default: 100
- },
- step: {
- type: Number,
- default: 1
- },
- disabled: {
- type: Boolean,
- default: false
- },
- value: {
- type: Number
- },
- barHeight: {
- type: Number,
- default: 1
- }
- },
- computed: {
- progress: function progress() {
- var value = this.value;
- if (typeof value === 'undefined' || value === null) return 0;
- return Math.floor((value - this.min) / (this.max - this.min) * 100);
- }
- },
- mounted: function mounted() {
- var this$1 = this;
- var thumb = this.$refs.thumb;
- var content = this.$refs.content;
- var getThumbPosition = function () {
- var contentBox = content.getBoundingClientRect();
- var thumbBox = thumb.getBoundingClientRect();
- return {
- left: thumbBox.left - contentBox.left,
- top: thumbBox.top - contentBox.top,
- thumbBoxLeft: thumbBox.left
- };
- };
- var dragState = {};
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__draggable__["a" /* default */])(thumb, {
- start: function (event) {
- if (this$1.disabled) return;
- var position = getThumbPosition();
- var thumbClickDetalX = event.clientX - position.thumbBoxLeft;
- dragState = {
- thumbStartLeft: position.left,
- thumbStartTop: position.top,
- thumbClickDetalX: thumbClickDetalX
- };
- },
- drag: function (event) {
- if (this$1.disabled) return;
- var contentBox = content.getBoundingClientRect();
- var deltaX = event.pageX - contentBox.left - dragState.thumbStartLeft - dragState.thumbClickDetalX;
- var stepCount = Math.ceil((this$1.max - this$1.min) / this$1.step);
- var newPosition = (dragState.thumbStartLeft + deltaX) - (dragState.thumbStartLeft + deltaX) % (contentBox.width / stepCount);
- var newProgress = newPosition / contentBox.width;
- if (newProgress < 0) {
- newProgress = 0;
- } else if (newProgress > 1) {
- newProgress = 1;
- }
- this$1.$emit('input', Math.round(this$1.min + newProgress * (this$1.max - this$1.min)));
- },
- end: function () {
- if (this$1.disabled) return;
- this$1.$emit('change', this$1.value);
- dragState = {};
- }
- });
- }
- };
- /***/ },
- /***/ 93:
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(1);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- var isDragging = false;
- var supportTouch = !__WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer && 'ontouchstart' in window;
- /* harmony default export */ exports["a"] = function(element, options) {
- var moveFn = function(event) {
- if (options.drag) {
- options.drag(supportTouch ? event.changedTouches[0] || event.touches[0] : event);
- }
- };
- var endFn = function(event) {
- if (!supportTouch) {
- document.removeEventListener('mousemove', moveFn);
- document.removeEventListener('mouseup', endFn);
- }
- document.onselectstart = null;
- document.ondragstart = null;
- isDragging = false;
- if (options.end) {
- options.end(supportTouch ? event.changedTouches[0] || event.touches[0] : event);
- }
- };
- element.addEventListener(supportTouch ? 'touchstart' : 'mousedown', function(event) {
- if (isDragging) return;
- event.preventDefault();
- document.onselectstart = function() { return false; };
- document.ondragstart = function() { return false; };
- if (!supportTouch) {
- document.addEventListener('mousemove', moveFn);
- document.addEventListener('mouseup', endFn);
- }
- isDragging = true;
- if (options.start) {
- options.start(supportTouch ? event.changedTouches[0] || event.touches[0] : event);
- }
- });
- if (supportTouch) {
- element.addEventListener('touchmove', moveFn);
- element.addEventListener('touchend', endFn);
- element.addEventListener('touchcancel', endFn);
- }
- };;
- /***/ }
- /******/ });
|