1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory(require("vue"));
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define(["vue"], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["vue-slider-component"] = factory(require("vue"));
|
8 | else
|
9 | root["vue-slider-component"] = factory(root["Vue"]);
|
10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50 | }
|
51 | };
|
52 |
|
53 |
|
54 | __webpack_require__.r = function(exports) {
|
55 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57 | }
|
58 | Object.defineProperty(exports, '__esModule', { value: true });
|
59 | };
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | __webpack_require__.t = function(value, mode) {
|
67 | if(mode & 1) value = __webpack_require__(value);
|
68 | if(mode & 8) return value;
|
69 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70 | var ns = Object.create(null);
|
71 | __webpack_require__.r(ns);
|
72 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74 | return ns;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.n = function(module) {
|
79 | var getter = module && module.__esModule ?
|
80 | function getDefault() { return module['default']; } :
|
81 | function getModuleExports() { return module; };
|
82 | __webpack_require__.d(getter, 'a', getter);
|
83 | return getter;
|
84 | };
|
85 |
|
86 |
|
87 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88 |
|
89 |
|
90 | __webpack_require__.p = "";
|
91 |
|
92 |
|
93 |
|
94 | return __webpack_require__(__webpack_require__.s = "fb15");
|
95 | })
|
96 |
|
97 | ({
|
98 |
|
99 | "2638":
|
100 | (function(module, exports, __webpack_require__) {
|
101 |
|
102 | "use strict";
|
103 | function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(a){return a.reduce(function(c,a){for(var b in a)if(!c[b])c[b]=a[b];else if(-1!==normalMerge.indexOf(b))c[b]=_extends({},c[b],a[b]);else if(-1!==toArrayMerge.indexOf(b)){var d=c[b]instanceof Array?c[b]:[c[b]],e=a[b]instanceof Array?a[b]:[a[b]];c[b]=d.concat(e)}else if(-1!==functionalMerge.indexOf(b)){for(var f in a[b])if(c[b][f]){var g=c[b][f]instanceof Array?c[b][f]:[c[b][f]],h=a[b][f]instanceof Array?a[b][f]:[a[b][f]];c[b][f]=g.concat(h)}else c[b][f]=a[b][f];}else if("hook"==b)for(var i in a[b])c[b][i]=c[b][i]?mergeFn(c[b][i],a[b][i]):a[b][i];else c[b]=a[b];return c},{})},mergeFn=function(a,b){return function(){a&&a.apply(this,arguments),b&&b.apply(this,arguments)}};module.exports=mergeJsxProps;
|
104 |
|
105 |
|
106 | }),
|
107 |
|
108 | "4abb":
|
109 | (function(module, exports, __webpack_require__) {
|
110 |
|
111 |
|
112 |
|
113 | }),
|
114 |
|
115 | "4ed8":
|
116 | (function(module, exports, __webpack_require__) {
|
117 |
|
118 |
|
119 |
|
120 | }),
|
121 |
|
122 | "556c":
|
123 | (function(module, exports, __webpack_require__) {
|
124 |
|
125 |
|
126 |
|
127 | }),
|
128 |
|
129 | "65d9":
|
130 | (function(module, exports, __webpack_require__) {
|
131 |
|
132 | "use strict";
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 | Object.defineProperty(exports, '__esModule', { value: true });
|
141 |
|
142 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
143 |
|
144 | var Vue = _interopDefault(__webpack_require__("8bbf"));
|
145 |
|
146 |
|
147 |
|
148 |
|
149 | var reflectionIsSupported = typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys;
|
150 | function copyReflectionMetadata(to, from) {
|
151 | forwardMetadata(to, from);
|
152 | Object.getOwnPropertyNames(from.prototype).forEach(function (key) {
|
153 | forwardMetadata(to.prototype, from.prototype, key);
|
154 | });
|
155 | Object.getOwnPropertyNames(from).forEach(function (key) {
|
156 | forwardMetadata(to, from, key);
|
157 | });
|
158 | }
|
159 | function forwardMetadata(to, from, propertyKey) {
|
160 | var metaKeys = propertyKey
|
161 | ? Reflect.getOwnMetadataKeys(from, propertyKey)
|
162 | : Reflect.getOwnMetadataKeys(from);
|
163 | metaKeys.forEach(function (metaKey) {
|
164 | var metadata = propertyKey
|
165 | ? Reflect.getOwnMetadata(metaKey, from, propertyKey)
|
166 | : Reflect.getOwnMetadata(metaKey, from);
|
167 | if (propertyKey) {
|
168 | Reflect.defineMetadata(metaKey, metadata, to, propertyKey);
|
169 | }
|
170 | else {
|
171 | Reflect.defineMetadata(metaKey, metadata, to);
|
172 | }
|
173 | });
|
174 | }
|
175 |
|
176 | var fakeArray = { __proto__: [] };
|
177 | var hasProto = fakeArray instanceof Array;
|
178 | function createDecorator(factory) {
|
179 | return function (target, key, index) {
|
180 | var Ctor = typeof target === 'function'
|
181 | ? target
|
182 | : target.constructor;
|
183 | if (!Ctor.__decorators__) {
|
184 | Ctor.__decorators__ = [];
|
185 | }
|
186 | if (typeof index !== 'number') {
|
187 | index = undefined;
|
188 | }
|
189 | Ctor.__decorators__.push(function (options) { return factory(options, key, index); });
|
190 | };
|
191 | }
|
192 | function mixins() {
|
193 | var Ctors = [];
|
194 | for (var _i = 0; _i < arguments.length; _i++) {
|
195 | Ctors[_i] = arguments[_i];
|
196 | }
|
197 | return Vue.extend({ mixins: Ctors });
|
198 | }
|
199 | function isPrimitive(value) {
|
200 | var type = typeof value;
|
201 | return value == null || (type !== 'object' && type !== 'function');
|
202 | }
|
203 | function warn(message) {
|
204 | if (typeof console !== 'undefined') {
|
205 | console.warn('[vue-class-component] ' + message);
|
206 | }
|
207 | }
|
208 |
|
209 | function collectDataFromConstructor(vm, Component) {
|
210 |
|
211 | var originalInit = Component.prototype._init;
|
212 | Component.prototype._init = function () {
|
213 | var _this = this;
|
214 |
|
215 | var keys = Object.getOwnPropertyNames(vm);
|
216 |
|
217 | if (vm.$options.props) {
|
218 | for (var key in vm.$options.props) {
|
219 | if (!vm.hasOwnProperty(key)) {
|
220 | keys.push(key);
|
221 | }
|
222 | }
|
223 | }
|
224 | keys.forEach(function (key) {
|
225 | if (key.charAt(0) !== '_') {
|
226 | Object.defineProperty(_this, key, {
|
227 | get: function () { return vm[key]; },
|
228 | set: function (value) { vm[key] = value; },
|
229 | configurable: true
|
230 | });
|
231 | }
|
232 | });
|
233 | };
|
234 |
|
235 | var data = new Component();
|
236 |
|
237 | Component.prototype._init = originalInit;
|
238 |
|
239 | var plainData = {};
|
240 | Object.keys(data).forEach(function (key) {
|
241 | if (data[key] !== undefined) {
|
242 | plainData[key] = data[key];
|
243 | }
|
244 | });
|
245 | if (false) {}
|
246 | return plainData;
|
247 | }
|
248 |
|
249 | var $internalHooks = [
|
250 | 'data',
|
251 | 'beforeCreate',
|
252 | 'created',
|
253 | 'beforeMount',
|
254 | 'mounted',
|
255 | 'beforeDestroy',
|
256 | 'destroyed',
|
257 | 'beforeUpdate',
|
258 | 'updated',
|
259 | 'activated',
|
260 | 'deactivated',
|
261 | 'render',
|
262 | 'errorCaptured',
|
263 | 'serverPrefetch'
|
264 | ];
|
265 | function componentFactory(Component, options) {
|
266 | if (options === void 0) { options = {}; }
|
267 | options.name = options.name || Component._componentTag || Component.name;
|
268 |
|
269 | var proto = Component.prototype;
|
270 | Object.getOwnPropertyNames(proto).forEach(function (key) {
|
271 | if (key === 'constructor') {
|
272 | return;
|
273 | }
|
274 |
|
275 | if ($internalHooks.indexOf(key) > -1) {
|
276 | options[key] = proto[key];
|
277 | return;
|
278 | }
|
279 | var descriptor = Object.getOwnPropertyDescriptor(proto, key);
|
280 | if (descriptor.value !== void 0) {
|
281 |
|
282 | if (typeof descriptor.value === 'function') {
|
283 | (options.methods || (options.methods = {}))[key] = descriptor.value;
|
284 | }
|
285 | else {
|
286 |
|
287 | (options.mixins || (options.mixins = [])).push({
|
288 | data: function () {
|
289 | var _a;
|
290 | return _a = {}, _a[key] = descriptor.value, _a;
|
291 | }
|
292 | });
|
293 | }
|
294 | }
|
295 | else if (descriptor.get || descriptor.set) {
|
296 |
|
297 | (options.computed || (options.computed = {}))[key] = {
|
298 | get: descriptor.get,
|
299 | set: descriptor.set
|
300 | };
|
301 | }
|
302 | });
|
303 | (options.mixins || (options.mixins = [])).push({
|
304 | data: function () {
|
305 | return collectDataFromConstructor(this, Component);
|
306 | }
|
307 | });
|
308 |
|
309 | var decorators = Component.__decorators__;
|
310 | if (decorators) {
|
311 | decorators.forEach(function (fn) { return fn(options); });
|
312 | delete Component.__decorators__;
|
313 | }
|
314 |
|
315 | var superProto = Object.getPrototypeOf(Component.prototype);
|
316 | var Super = superProto instanceof Vue
|
317 | ? superProto.constructor
|
318 | : Vue;
|
319 | var Extended = Super.extend(options);
|
320 | forwardStaticMembers(Extended, Component, Super);
|
321 | if (reflectionIsSupported) {
|
322 | copyReflectionMetadata(Extended, Component);
|
323 | }
|
324 | return Extended;
|
325 | }
|
326 | var reservedPropertyNames = [
|
327 |
|
328 | 'cid',
|
329 |
|
330 | 'super',
|
331 |
|
332 | 'options',
|
333 | 'superOptions',
|
334 | 'extendOptions',
|
335 | 'sealedOptions',
|
336 |
|
337 | 'component',
|
338 | 'directive',
|
339 | 'filter'
|
340 | ];
|
341 | function forwardStaticMembers(Extended, Original, Super) {
|
342 |
|
343 | Object.getOwnPropertyNames(Original).forEach(function (key) {
|
344 |
|
345 | if (key === 'prototype') {
|
346 | return;
|
347 | }
|
348 |
|
349 | var extendedDescriptor = Object.getOwnPropertyDescriptor(Extended, key);
|
350 | if (extendedDescriptor && !extendedDescriptor.configurable) {
|
351 | return;
|
352 | }
|
353 | var descriptor = Object.getOwnPropertyDescriptor(Original, key);
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 | if (!hasProto) {
|
362 |
|
363 |
|
364 |
|
365 | if (key === 'cid') {
|
366 | return;
|
367 | }
|
368 | var superDescriptor = Object.getOwnPropertyDescriptor(Super, key);
|
369 | if (!isPrimitive(descriptor.value) &&
|
370 | superDescriptor &&
|
371 | superDescriptor.value === descriptor.value) {
|
372 | return;
|
373 | }
|
374 | }
|
375 |
|
376 | if (false) {}
|
377 | Object.defineProperty(Extended, key, descriptor);
|
378 | });
|
379 | }
|
380 |
|
381 | function Component(options) {
|
382 | if (typeof options === 'function') {
|
383 | return componentFactory(options);
|
384 | }
|
385 | return function (Component) {
|
386 | return componentFactory(Component, options);
|
387 | };
|
388 | }
|
389 | Component.registerHooks = function registerHooks(keys) {
|
390 | $internalHooks.push.apply($internalHooks, keys);
|
391 | };
|
392 |
|
393 | exports.default = Component;
|
394 | exports.createDecorator = createDecorator;
|
395 | exports.mixins = mixins;
|
396 |
|
397 |
|
398 | }),
|
399 |
|
400 | "8875":
|
401 | (function(module, exports, __webpack_require__) {
|
402 |
|
403 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 | (function (root, factory) {
|
410 | if (true) {
|
411 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
412 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
413 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
414 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
415 | } else {}
|
416 | }(typeof self !== 'undefined' ? self : this, function () {
|
417 | function getCurrentScript () {
|
418 | var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
|
419 |
|
420 | if (!descriptor && 'currentScript' in document && document.currentScript) {
|
421 | return document.currentScript
|
422 | }
|
423 |
|
424 |
|
425 | if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
|
426 | return document.currentScript
|
427 | }
|
428 |
|
429 |
|
430 |
|
431 | try {
|
432 | throw new Error();
|
433 | }
|
434 | catch (err) {
|
435 |
|
436 | var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
|
437 | ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
|
438 | stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
|
439 | scriptLocation = (stackDetails && stackDetails[1]) || false,
|
440 | line = (stackDetails && stackDetails[2]) || false,
|
441 | currentLocation = document.location.href.replace(document.location.hash, ''),
|
442 | pageSource,
|
443 | inlineScriptSourceRegExp,
|
444 | inlineScriptSource,
|
445 | scripts = document.getElementsByTagName('script');
|
446 |
|
447 | if (scriptLocation === currentLocation) {
|
448 | pageSource = document.documentElement.outerHTML;
|
449 | inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
|
450 | inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
|
451 | }
|
452 |
|
453 | for (var i = 0; i < scripts.length; i++) {
|
454 |
|
455 | if (scripts[i].readyState === 'interactive') {
|
456 | return scripts[i];
|
457 | }
|
458 |
|
459 |
|
460 | if (scripts[i].src === scriptLocation) {
|
461 | return scripts[i];
|
462 | }
|
463 |
|
464 |
|
465 | if (
|
466 | scriptLocation === currentLocation &&
|
467 | scripts[i].innerHTML &&
|
468 | scripts[i].innerHTML.trim() === inlineScriptSource
|
469 | ) {
|
470 | return scripts[i];
|
471 | }
|
472 | }
|
473 |
|
474 |
|
475 | return null;
|
476 | }
|
477 | };
|
478 |
|
479 | return getCurrentScript
|
480 | }));
|
481 |
|
482 |
|
483 | }),
|
484 |
|
485 | "8bbf":
|
486 | (function(module, exports) {
|
487 |
|
488 | module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;
|
489 |
|
490 | }),
|
491 |
|
492 | "fb15":
|
493 | (function(module, __webpack_exports__, __webpack_require__) {
|
494 |
|
495 | "use strict";
|
496 |
|
497 | __webpack_require__.r(__webpack_exports__);
|
498 |
|
499 |
|
500 | __webpack_require__.d(__webpack_exports__, "ERROR_TYPE", function() { return ERROR_TYPE; });
|
501 | __webpack_require__.d(__webpack_exports__, "VueSliderMark", function() { return vue_slider_mark; });
|
502 | __webpack_require__.d(__webpack_exports__, "VueSliderDot", function() { return vue_slider_dot; });
|
503 |
|
504 |
|
505 |
|
506 |
|
507 | if (typeof window !== 'undefined') {
|
508 | var currentScript = window.document.currentScript
|
509 | if (true) {
|
510 | var getCurrentScript = __webpack_require__("8875")
|
511 | currentScript = getCurrentScript()
|
512 |
|
513 |
|
514 | if (!('currentScript' in document)) {
|
515 | Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
516 | }
|
517 | }
|
518 |
|
519 | var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
520 | if (src) {
|
521 | __webpack_require__.p = src[1]
|
522 | }
|
523 | }
|
524 |
|
525 |
|
526 | var setPublicPath = (null);
|
527 |
|
528 |
|
529 | var helper = __webpack_require__("2638");
|
530 | var helper_default = __webpack_require__.n(helper);
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 | var extendStatics = function(d, b) {
|
550 | extendStatics = Object.setPrototypeOf ||
|
551 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
552 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
553 | return extendStatics(d, b);
|
554 | };
|
555 |
|
556 | function __extends(d, b) {
|
557 | extendStatics(d, b);
|
558 | function __() { this.constructor = d; }
|
559 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
560 | }
|
561 |
|
562 | var __assign = function() {
|
563 | __assign = Object.assign || function __assign(t) {
|
564 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
565 | s = arguments[i];
|
566 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
567 | }
|
568 | return t;
|
569 | }
|
570 | return __assign.apply(this, arguments);
|
571 | }
|
572 |
|
573 | function __rest(s, e) {
|
574 | var t = {};
|
575 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
576 | t[p] = s[p];
|
577 | if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
578 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
579 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
580 | t[p[i]] = s[p[i]];
|
581 | }
|
582 | return t;
|
583 | }
|
584 |
|
585 | function __decorate(decorators, target, key, desc) {
|
586 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
587 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
588 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
589 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
590 | }
|
591 |
|
592 | function __param(paramIndex, decorator) {
|
593 | return function (target, key) { decorator(target, key, paramIndex); }
|
594 | }
|
595 |
|
596 | function __metadata(metadataKey, metadataValue) {
|
597 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
598 | }
|
599 |
|
600 | function __awaiter(thisArg, _arguments, P, generator) {
|
601 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
602 | return new (P || (P = Promise))(function (resolve, reject) {
|
603 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
604 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
605 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
606 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
607 | });
|
608 | }
|
609 |
|
610 | function __generator(thisArg, body) {
|
611 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
612 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
613 | function verb(n) { return function (v) { return step([n, v]); }; }
|
614 | function step(op) {
|
615 | if (f) throw new TypeError("Generator is already executing.");
|
616 | while (_) try {
|
617 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
618 | if (y = 0, t) op = [op[0] & 2, t.value];
|
619 | switch (op[0]) {
|
620 | case 0: case 1: t = op; break;
|
621 | case 4: _.label++; return { value: op[1], done: false };
|
622 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
623 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
624 | default:
|
625 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
626 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
627 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
628 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
629 | if (t[2]) _.ops.pop();
|
630 | _.trys.pop(); continue;
|
631 | }
|
632 | op = body.call(thisArg, _);
|
633 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
634 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
635 | }
|
636 | }
|
637 |
|
638 | function __createBinding(o, m, k, k2) {
|
639 | if (k2 === undefined) k2 = k;
|
640 | o[k2] = m[k];
|
641 | }
|
642 |
|
643 | function __exportStar(m, exports) {
|
644 | for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
|
645 | }
|
646 |
|
647 | function __values(o) {
|
648 | var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
649 | if (m) return m.call(o);
|
650 | if (o && typeof o.length === "number") return {
|
651 | next: function () {
|
652 | if (o && i >= o.length) o = void 0;
|
653 | return { value: o && o[i++], done: !o };
|
654 | }
|
655 | };
|
656 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
657 | }
|
658 |
|
659 | function __read(o, n) {
|
660 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
661 | if (!m) return o;
|
662 | var i = m.call(o), r, ar = [], e;
|
663 | try {
|
664 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
665 | }
|
666 | catch (error) { e = { error: error }; }
|
667 | finally {
|
668 | try {
|
669 | if (r && !r.done && (m = i["return"])) m.call(i);
|
670 | }
|
671 | finally { if (e) throw e.error; }
|
672 | }
|
673 | return ar;
|
674 | }
|
675 |
|
676 | function __spread() {
|
677 | for (var ar = [], i = 0; i < arguments.length; i++)
|
678 | ar = ar.concat(__read(arguments[i]));
|
679 | return ar;
|
680 | }
|
681 |
|
682 | function __spreadArrays() {
|
683 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
684 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
685 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
686 | r[k] = a[j];
|
687 | return r;
|
688 | };
|
689 |
|
690 | function __await(v) {
|
691 | return this instanceof __await ? (this.v = v, this) : new __await(v);
|
692 | }
|
693 |
|
694 | function __asyncGenerator(thisArg, _arguments, generator) {
|
695 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
696 | var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
697 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
698 | function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
699 | function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
700 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
701 | function fulfill(value) { resume("next", value); }
|
702 | function reject(value) { resume("throw", value); }
|
703 | function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
704 | }
|
705 |
|
706 | function __asyncDelegator(o) {
|
707 | var i, p;
|
708 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
709 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
710 | }
|
711 |
|
712 | function __asyncValues(o) {
|
713 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
714 | var m = o[Symbol.asyncIterator], i;
|
715 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
716 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
717 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
718 | }
|
719 |
|
720 | function __makeTemplateObject(cooked, raw) {
|
721 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
722 | return cooked;
|
723 | };
|
724 |
|
725 | function __importStar(mod) {
|
726 | if (mod && mod.__esModule) return mod;
|
727 | var result = {};
|
728 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
729 | result.default = mod;
|
730 | return result;
|
731 | }
|
732 |
|
733 | function __importDefault(mod) {
|
734 | return (mod && mod.__esModule) ? mod : { default: mod };
|
735 | }
|
736 |
|
737 | function __classPrivateFieldGet(receiver, privateMap) {
|
738 | if (!privateMap.has(receiver)) {
|
739 | throw new TypeError("attempted to get private field on non-instance");
|
740 | }
|
741 | return privateMap.get(receiver);
|
742 | }
|
743 |
|
744 | function __classPrivateFieldSet(receiver, privateMap, value) {
|
745 | if (!privateMap.has(receiver)) {
|
746 | throw new TypeError("attempted to set private field on non-instance");
|
747 | }
|
748 | privateMap.set(receiver, value);
|
749 | return value;
|
750 | }
|
751 |
|
752 |
|
753 | var external_commonjs_vue_commonjs2_vue_root_Vue_amd_vue_ = __webpack_require__("8bbf");
|
754 | var external_commonjs_vue_commonjs2_vue_root_Vue_amd_vue_default = __webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_amd_vue_);
|
755 |
|
756 |
|
757 | var vue_class_component_common = __webpack_require__("65d9");
|
758 | var vue_class_component_common_default = __webpack_require__.n(vue_class_component_common);
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 | function Inject(options) {
|
772 | return Object(vue_class_component_common["createDecorator"])(function (componentOptions, key) {
|
773 | if (typeof componentOptions.inject === 'undefined') {
|
774 | componentOptions.inject = {};
|
775 | }
|
776 | if (!Array.isArray(componentOptions.inject)) {
|
777 | componentOptions.inject[key] = options || key;
|
778 | }
|
779 | });
|
780 | }
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 | function Provide(key) {
|
787 | return Object(vue_class_component_common["createDecorator"])(function (componentOptions, k) {
|
788 | var provide = componentOptions.provide;
|
789 | if (typeof provide !== 'function' || !provide.managed) {
|
790 | var original_1 = componentOptions.provide;
|
791 | provide = componentOptions.provide = function () {
|
792 | var rv = Object.create((typeof original_1 === 'function' ? original_1.call(this) : original_1) || null);
|
793 | for (var i in provide.managed)
|
794 | rv[provide.managed[i]] = this[i];
|
795 | return rv;
|
796 | };
|
797 | provide.managed = {};
|
798 | }
|
799 | provide.managed[k] = key || k;
|
800 | });
|
801 | }
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 | function Model(event, options) {
|
809 | if (options === void 0) { options = {}; }
|
810 | return Object(vue_class_component_common["createDecorator"])(function (componentOptions, k) {
|
811 | (componentOptions.props || (componentOptions.props = {}))[k] = options;
|
812 | componentOptions.model = { prop: k, event: event || k };
|
813 | });
|
814 | }
|
815 |
|
816 |
|
817 |
|
818 |
|
819 |
|
820 | function Prop(options) {
|
821 | if (options === void 0) { options = {}; }
|
822 | return Object(vue_class_component_common["createDecorator"])(function (componentOptions, k) {
|
823 | (componentOptions.props || (componentOptions.props = {}))[k] = options;
|
824 | });
|
825 | }
|
826 |
|
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 | function Watch(path, options) {
|
833 | if (options === void 0) { options = {}; }
|
834 | var _a = options.deep, deep = _a === void 0 ? false : _a, _b = options.immediate, immediate = _b === void 0 ? false : _b;
|
835 | return Object(vue_class_component_common["createDecorator"])(function (componentOptions, handler) {
|
836 | if (typeof componentOptions.watch !== 'object') {
|
837 | componentOptions.watch = Object.create(null);
|
838 | }
|
839 | var watch = componentOptions.watch;
|
840 | if (typeof watch[path] === 'object' && !Array.isArray(watch[path])) {
|
841 | watch[path] = [watch[path]];
|
842 | }
|
843 | else if (typeof watch[path] === 'undefined') {
|
844 | watch[path] = [];
|
845 | }
|
846 | watch[path].push({ handler: handler, deep: deep, immediate: immediate });
|
847 | });
|
848 | }
|
849 |
|
850 | var hyphenateRE = /\B([A-Z])/g;
|
851 | var hyphenate = function (str) { return str.replace(hyphenateRE, '-$1').toLowerCase(); };
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 | function Emit(event) {
|
858 | return function (_target, key, descriptor) {
|
859 | key = hyphenate(key);
|
860 | var original = descriptor.value;
|
861 | descriptor.value = function emitter() {
|
862 | var _this = this;
|
863 | var args = [];
|
864 | for (var _i = 0; _i < arguments.length; _i++) {
|
865 | args[_i] = arguments[_i];
|
866 | }
|
867 | var emit = function (returnValue) {
|
868 | if (returnValue !== undefined)
|
869 | args.unshift(returnValue);
|
870 | _this.$emit.apply(_this, [event || key].concat(args));
|
871 | };
|
872 | var returnValue = original.apply(this, args);
|
873 | if (isPromise(returnValue)) {
|
874 | returnValue.then(function (returnValue) {
|
875 | emit(returnValue);
|
876 | });
|
877 | }
|
878 | else {
|
879 | emit(returnValue);
|
880 | }
|
881 | };
|
882 | };
|
883 | }
|
884 | function isPromise(obj) {
|
885 | return obj instanceof Promise || (obj && typeof obj.then === 'function');
|
886 | }
|
887 |
|
888 |
|
889 | var dot = __webpack_require__("4ed8");
|
890 |
|
891 |
|
892 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
893 |
|
894 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
895 |
|
896 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
897 |
|
898 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
899 |
|
900 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
901 |
|
902 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
903 |
|
904 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
905 |
|
906 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
907 |
|
908 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
909 |
|
910 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
911 |
|
912 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 | var vue_slider_dot_VueSliderDot =
|
919 |
|
920 | function () {
|
921 | var VueSliderDot = function (_Vue) {
|
922 | _inherits(VueSliderDot, _Vue);
|
923 |
|
924 | var _super = _createSuper(VueSliderDot);
|
925 |
|
926 | function VueSliderDot() {
|
927 | _classCallCheck(this, VueSliderDot);
|
928 |
|
929 | return _super.apply(this, arguments);
|
930 | }
|
931 |
|
932 | _createClass(VueSliderDot, [{
|
933 | key: "dragStart",
|
934 | value: function dragStart(e) {
|
935 | if (this.disabled) {
|
936 | return false;
|
937 | }
|
938 |
|
939 | this.$emit('drag-start');
|
940 | }
|
941 | }, {
|
942 | key: "render",
|
943 | value: function render() {
|
944 | var h = arguments[0];
|
945 | return h("div", {
|
946 | "ref": "dot",
|
947 | "class": this.dotClasses,
|
948 | "attrs": {
|
949 | "aria-valuetext": typeof this.tooltipValue === 'number' ? this.tooltipValue.toString() : this.tooltipValue
|
950 | },
|
951 | "on": {
|
952 | "mousedown": this.dragStart,
|
953 | "touchstart": this.dragStart
|
954 | }
|
955 | }, [this.$slots.dot || h("div", {
|
956 | "class": this.handleClasses,
|
957 | "style": this.dotStyle
|
958 | }), this.tooltip !== 'none' ? h("div", {
|
959 | "class": this.tooltipClasses
|
960 | }, [this.$slots.tooltip || h("div", {
|
961 | "class": this.tooltipInnerClasses,
|
962 | "style": this.tooltipStyle
|
963 | }, [h("span", {
|
964 | "class": 'vue-slider-dot-tooltip-text'
|
965 | }, [this.tooltipValue])])]) : null]);
|
966 | }
|
967 | }, {
|
968 | key: "dotClasses",
|
969 | get: function get() {
|
970 | return ['vue-slider-dot', {
|
971 | 'vue-slider-dot-hover': this.tooltip === 'hover' || this.tooltip === 'active',
|
972 | 'vue-slider-dot-disabled': this.disabled,
|
973 | 'vue-slider-dot-focus': this.focus
|
974 | }];
|
975 | }
|
976 | }, {
|
977 | key: "handleClasses",
|
978 | get: function get() {
|
979 | return ['vue-slider-dot-handle', {
|
980 | 'vue-slider-dot-handle-disabled': this.disabled,
|
981 | 'vue-slider-dot-handle-focus': this.focus
|
982 | }];
|
983 | }
|
984 | }, {
|
985 | key: "tooltipClasses",
|
986 | get: function get() {
|
987 | return ['vue-slider-dot-tooltip', ["vue-slider-dot-tooltip-".concat(this.tooltipPlacement)], {
|
988 | 'vue-slider-dot-tooltip-show': this.showTooltip
|
989 | }];
|
990 | }
|
991 | }, {
|
992 | key: "tooltipInnerClasses",
|
993 | get: function get() {
|
994 | return ['vue-slider-dot-tooltip-inner', ["vue-slider-dot-tooltip-inner-".concat(this.tooltipPlacement)], {
|
995 | 'vue-slider-dot-tooltip-inner-disabled': this.disabled,
|
996 | 'vue-slider-dot-tooltip-inner-focus': this.focus
|
997 | }];
|
998 | }
|
999 | }, {
|
1000 | key: "showTooltip",
|
1001 | get: function get() {
|
1002 | switch (this.tooltip) {
|
1003 | case 'always':
|
1004 | return true;
|
1005 |
|
1006 | case 'none':
|
1007 | return false;
|
1008 |
|
1009 | case 'focus':
|
1010 | case 'active':
|
1011 | return !!this.focus;
|
1012 |
|
1013 | default:
|
1014 | return false;
|
1015 | }
|
1016 | }
|
1017 | }, {
|
1018 | key: "tooltipValue",
|
1019 | get: function get() {
|
1020 | if (this.tooltipFormatter) {
|
1021 | return typeof this.tooltipFormatter === 'string' ? this.tooltipFormatter.replace(/\{value\}/, String(this.value)) : this.tooltipFormatter(this.value);
|
1022 | } else {
|
1023 | return this.value;
|
1024 | }
|
1025 | }
|
1026 | }]);
|
1027 |
|
1028 | return VueSliderDot;
|
1029 | }(external_commonjs_vue_commonjs2_vue_root_Vue_amd_vue_default.a);
|
1030 |
|
1031 | __decorate([Prop({
|
1032 | default: 0
|
1033 | })], VueSliderDot.prototype, "value", void 0);
|
1034 |
|
1035 | __decorate([Prop()], VueSliderDot.prototype, "tooltip", void 0);
|
1036 |
|
1037 | __decorate([Prop()], VueSliderDot.prototype, "dotStyle", void 0);
|
1038 |
|
1039 | __decorate([Prop()], VueSliderDot.prototype, "tooltipStyle", void 0);
|
1040 |
|
1041 | __decorate([Prop({
|
1042 | type: String,
|
1043 | validator: function validator(val) {
|
1044 | return ['top', 'right', 'bottom', 'left'].indexOf(val) > -1;
|
1045 | },
|
1046 | required: true
|
1047 | })], VueSliderDot.prototype, "tooltipPlacement", void 0);
|
1048 |
|
1049 | __decorate([Prop({
|
1050 | type: [String, Function]
|
1051 | })], VueSliderDot.prototype, "tooltipFormatter", void 0);
|
1052 |
|
1053 | __decorate([Prop({
|
1054 | type: Boolean,
|
1055 | default: false
|
1056 | })], VueSliderDot.prototype, "focus", void 0);
|
1057 |
|
1058 | __decorate([Prop({
|
1059 | default: false
|
1060 | })], VueSliderDot.prototype, "disabled", void 0);
|
1061 |
|
1062 | VueSliderDot = __decorate([vue_class_component_common_default()({
|
1063 | name: 'VueSliderDot'
|
1064 | })], VueSliderDot);
|
1065 | return VueSliderDot;
|
1066 | }();
|
1067 |
|
1068 | var vue_slider_dot = (vue_slider_dot_VueSliderDot);
|
1069 |
|
1070 | var mark = __webpack_require__("556c");
|
1071 |
|
1072 |
|
1073 | function vue_slider_mark_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { vue_slider_mark_typeof = function _typeof(obj) { return typeof obj; }; } else { vue_slider_mark_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return vue_slider_mark_typeof(obj); }
|
1074 |
|
1075 | function vue_slider_mark_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1076 |
|
1077 | function vue_slider_mark_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
1078 |
|
1079 | function vue_slider_mark_createClass(Constructor, protoProps, staticProps) { if (protoProps) vue_slider_mark_defineProperties(Constructor.prototype, protoProps); if (staticProps) vue_slider_mark_defineProperties(Constructor, staticProps); return Constructor; }
|
1080 |
|
1081 | function vue_slider_mark_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) vue_slider_mark_setPrototypeOf(subClass, superClass); }
|
1082 |
|
1083 | function vue_slider_mark_setPrototypeOf(o, p) { vue_slider_mark_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return vue_slider_mark_setPrototypeOf(o, p); }
|
1084 |
|
1085 | function vue_slider_mark_createSuper(Derived) { var hasNativeReflectConstruct = vue_slider_mark_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = vue_slider_mark_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = vue_slider_mark_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return vue_slider_mark_possibleConstructorReturn(this, result); }; }
|
1086 |
|
1087 | function vue_slider_mark_possibleConstructorReturn(self, call) { if (call && (vue_slider_mark_typeof(call) === "object" || typeof call === "function")) { return call; } return vue_slider_mark_assertThisInitialized(self); }
|
1088 |
|
1089 | function vue_slider_mark_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
1090 |
|
1091 | function vue_slider_mark_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
1092 |
|
1093 | function vue_slider_mark_getPrototypeOf(o) { vue_slider_mark_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return vue_slider_mark_getPrototypeOf(o); }
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 | var vue_slider_mark_VueSlideMark =
|
1100 |
|
1101 | function () {
|
1102 | var VueSlideMark = function (_Vue) {
|
1103 | vue_slider_mark_inherits(VueSlideMark, _Vue);
|
1104 |
|
1105 | var _super = vue_slider_mark_createSuper(VueSlideMark);
|
1106 |
|
1107 | function VueSlideMark() {
|
1108 | vue_slider_mark_classCallCheck(this, VueSlideMark);
|
1109 |
|
1110 | return _super.apply(this, arguments);
|
1111 | }
|
1112 |
|
1113 | vue_slider_mark_createClass(VueSlideMark, [{
|
1114 | key: "labelClickHandle",
|
1115 | value: function labelClickHandle(e) {
|
1116 | e.stopPropagation();
|
1117 | this.$emit('pressLabel', this.mark.pos);
|
1118 | }
|
1119 | }, {
|
1120 | key: "render",
|
1121 | value: function render() {
|
1122 | var h = arguments[0];
|
1123 | var mark = this.mark;
|
1124 | return h("div", {
|
1125 | "class": this.marksClasses
|
1126 | }, [this.$slots.step || h("div", {
|
1127 | "class": this.stepClasses,
|
1128 | "style": [this.stepStyle || {}, mark.style || {}, mark.active ? this.stepActiveStyle || {} : {}, mark.active ? mark.activeStyle || {} : {}]
|
1129 | }), !this.hideLabel ? this.$slots.label || h("div", {
|
1130 | "class": this.labelClasses,
|
1131 | "style": [this.labelStyle || {}, mark.labelStyle || {}, mark.active ? this.labelActiveStyle || {} : {}, mark.active ? mark.labelActiveStyle || {} : {}],
|
1132 | "on": {
|
1133 | "click": this.labelClickHandle
|
1134 | }
|
1135 | }, [mark.label]) : null]);
|
1136 | }
|
1137 | }, {
|
1138 | key: "marksClasses",
|
1139 | get: function get() {
|
1140 | return ['vue-slider-mark', {
|
1141 | 'vue-slider-mark-active': this.mark.active
|
1142 | }];
|
1143 | }
|
1144 | }, {
|
1145 | key: "stepClasses",
|
1146 | get: function get() {
|
1147 | return ['vue-slider-mark-step', {
|
1148 | 'vue-slider-mark-step-active': this.mark.active
|
1149 | }];
|
1150 | }
|
1151 | }, {
|
1152 | key: "labelClasses",
|
1153 | get: function get() {
|
1154 | return ['vue-slider-mark-label', {
|
1155 | 'vue-slider-mark-label-active': this.mark.active
|
1156 | }];
|
1157 | }
|
1158 | }]);
|
1159 |
|
1160 | return VueSlideMark;
|
1161 | }(external_commonjs_vue_commonjs2_vue_root_Vue_amd_vue_default.a);
|
1162 |
|
1163 | __decorate([Prop({
|
1164 | required: true
|
1165 | })], VueSlideMark.prototype, "mark", void 0);
|
1166 |
|
1167 | __decorate([Prop(Boolean)], VueSlideMark.prototype, "hideLabel", void 0);
|
1168 |
|
1169 | __decorate([Prop()], VueSlideMark.prototype, "stepStyle", void 0);
|
1170 |
|
1171 | __decorate([Prop()], VueSlideMark.prototype, "stepActiveStyle", void 0);
|
1172 |
|
1173 | __decorate([Prop()], VueSlideMark.prototype, "labelStyle", void 0);
|
1174 |
|
1175 | __decorate([Prop()], VueSlideMark.prototype, "labelActiveStyle", void 0);
|
1176 |
|
1177 | VueSlideMark = __decorate([vue_class_component_common_default()({
|
1178 | name: 'VueSlideMark'
|
1179 | })], VueSlideMark);
|
1180 | return VueSlideMark;
|
1181 | }();
|
1182 |
|
1183 | var vue_slider_mark = (vue_slider_mark_VueSlideMark);
|
1184 |
|
1185 | var getSize = function getSize(value) {
|
1186 | return typeof value === 'number' ? "".concat(value, "px") : value;
|
1187 | };
|
1188 |
|
1189 |
|
1190 | var getOffset = function getOffset(elem) {
|
1191 | var doc = document.documentElement;
|
1192 | var body = document.body;
|
1193 | var rect = elem.getBoundingClientRect();
|
1194 | var offset = {
|
1195 | y: rect.top + (window.pageYOffset || doc.scrollTop) - (doc.clientTop || body.clientTop || 0),
|
1196 | x: rect.left + (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || body.clientLeft || 0)
|
1197 | };
|
1198 | return offset;
|
1199 | };
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 | var getPos = function getPos(e, elem, isReverse) {
|
1208 | var zoom = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
1209 | var event = 'targetTouches' in e ? e.targetTouches[0] : e;
|
1210 | var offset = getOffset(elem);
|
1211 | var posObj = {
|
1212 | x: event.pageX - offset.x,
|
1213 | y: event.pageY - offset.y
|
1214 | };
|
1215 | return {
|
1216 | x: isReverse ? elem.offsetWidth * zoom - posObj.x : posObj.x,
|
1217 | y: isReverse ? elem.offsetHeight * zoom - posObj.y : posObj.y
|
1218 | };
|
1219 | };
|
1220 | var KEY_CODE;
|
1221 |
|
1222 | (function (KEY_CODE) {
|
1223 | KEY_CODE[KEY_CODE["PAGE_UP"] = 33] = "PAGE_UP";
|
1224 | KEY_CODE[KEY_CODE["PAGE_DOWN"] = 34] = "PAGE_DOWN";
|
1225 | KEY_CODE[KEY_CODE["END"] = 35] = "END";
|
1226 | KEY_CODE[KEY_CODE["HOME"] = 36] = "HOME";
|
1227 | KEY_CODE[KEY_CODE["LEFT"] = 37] = "LEFT";
|
1228 | KEY_CODE[KEY_CODE["UP"] = 38] = "UP";
|
1229 | KEY_CODE[KEY_CODE["RIGHT"] = 39] = "RIGHT";
|
1230 | KEY_CODE[KEY_CODE["DOWN"] = 40] = "DOWN";
|
1231 | })(KEY_CODE || (KEY_CODE = {}));
|
1232 |
|
1233 | var getKeyboardHandleFunc = function getKeyboardHandleFunc(e, params) {
|
1234 | if (params.hook) {
|
1235 | var result = params.hook(e);
|
1236 | if (typeof result === 'function') return result;
|
1237 | if (!result) return null;
|
1238 | }
|
1239 |
|
1240 | switch (e.keyCode) {
|
1241 | case KEY_CODE.UP:
|
1242 | return function (i) {
|
1243 | return params.direction === 'ttb' ? i - 1 : i + 1;
|
1244 | };
|
1245 |
|
1246 | case KEY_CODE.RIGHT:
|
1247 | return function (i) {
|
1248 | return params.direction === 'rtl' ? i - 1 : i + 1;
|
1249 | };
|
1250 |
|
1251 | case KEY_CODE.DOWN:
|
1252 | return function (i) {
|
1253 | return params.direction === 'ttb' ? i + 1 : i - 1;
|
1254 | };
|
1255 |
|
1256 | case KEY_CODE.LEFT:
|
1257 | return function (i) {
|
1258 | return params.direction === 'rtl' ? i + 1 : i - 1;
|
1259 | };
|
1260 |
|
1261 | case KEY_CODE.END:
|
1262 | return function () {
|
1263 | return params.max;
|
1264 | };
|
1265 |
|
1266 | case KEY_CODE.HOME:
|
1267 | return function () {
|
1268 | return params.min;
|
1269 | };
|
1270 |
|
1271 | case KEY_CODE.PAGE_UP:
|
1272 | return function (i) {
|
1273 | return i + 10;
|
1274 | };
|
1275 |
|
1276 | case KEY_CODE.PAGE_DOWN:
|
1277 | return function (i) {
|
1278 | return i - 10;
|
1279 | };
|
1280 |
|
1281 | default:
|
1282 | return null;
|
1283 | }
|
1284 | };
|
1285 |
|
1286 | function decimal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1287 |
|
1288 | function decimal_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
1289 |
|
1290 | function decimal_createClass(Constructor, protoProps, staticProps) { if (protoProps) decimal_defineProperties(Constructor.prototype, protoProps); if (staticProps) decimal_defineProperties(Constructor, staticProps); return Constructor; }
|
1291 |
|
1292 |
|
1293 |
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 | var Decimal = function () {
|
1299 | function Decimal(num) {
|
1300 | decimal_classCallCheck(this, Decimal);
|
1301 |
|
1302 | this.num = num;
|
1303 | }
|
1304 |
|
1305 | decimal_createClass(Decimal, [{
|
1306 | key: "decimal",
|
1307 | value: function decimal(num2, operator) {
|
1308 | var num1 = this.num;
|
1309 | var len1 = this.getDecimalLen(num1);
|
1310 | var len2 = this.getDecimalLen(num2);
|
1311 | var base = 0;
|
1312 |
|
1313 | switch (operator) {
|
1314 | case '+':
|
1315 | base = this.getExponent(len1, len2);
|
1316 | this.num = (this.safeRoundUp(num1, base) + this.safeRoundUp(num2, base)) / base;
|
1317 | break;
|
1318 |
|
1319 | case '-':
|
1320 | base = this.getExponent(len1, len2);
|
1321 | this.num = (this.safeRoundUp(num1, base) - this.safeRoundUp(num2, base)) / base;
|
1322 | break;
|
1323 |
|
1324 | case '*':
|
1325 | this.num = this.safeRoundUp(this.safeRoundUp(num1, this.getExponent(len1)), this.safeRoundUp(num2, this.getExponent(len2))) / this.getExponent(len1 + len2);
|
1326 | break;
|
1327 |
|
1328 | case '/':
|
1329 | base = this.getExponent(len1, len2);
|
1330 | this.num = this.safeRoundUp(num1, base) / this.safeRoundUp(num2, base);
|
1331 | break;
|
1332 |
|
1333 | case '%':
|
1334 | base = this.getExponent(len1, len2);
|
1335 | this.num = this.safeRoundUp(num1, base) % this.safeRoundUp(num2, base) / base;
|
1336 | break;
|
1337 | }
|
1338 |
|
1339 | return this;
|
1340 | }
|
1341 | }, {
|
1342 | key: "plus",
|
1343 | value: function plus(num2) {
|
1344 | return this.decimal(num2, '+');
|
1345 | }
|
1346 | }, {
|
1347 | key: "minus",
|
1348 | value: function minus(num2) {
|
1349 | return this.decimal(num2, '-');
|
1350 | }
|
1351 | }, {
|
1352 | key: "multiply",
|
1353 | value: function multiply(num2) {
|
1354 | return this.decimal(num2, '*');
|
1355 | }
|
1356 | }, {
|
1357 | key: "divide",
|
1358 | value: function divide(num2) {
|
1359 | return this.decimal(num2, '/');
|
1360 | }
|
1361 | }, {
|
1362 | key: "remainder",
|
1363 | value: function remainder(num2) {
|
1364 | return this.decimal(num2, '%');
|
1365 | }
|
1366 | }, {
|
1367 | key: "toNumber",
|
1368 | value: function toNumber() {
|
1369 | return this.num;
|
1370 | }
|
1371 | }, {
|
1372 | key: "getDecimalLen",
|
1373 | value: function getDecimalLen(num) {
|
1374 | var strArr = "".concat(num).split('e');
|
1375 | return ("".concat(strArr[0]).split('.')[1] || '').length - (strArr[1] ? +strArr[1] : 0);
|
1376 | }
|
1377 | }, {
|
1378 | key: "getExponent",
|
1379 | value: function getExponent(num1, num2) {
|
1380 | return Math.pow(10, num2 !== void 0 ? Math.max(num1, num2) : num1);
|
1381 | }
|
1382 |
|
1383 | }, {
|
1384 | key: "safeRoundUp",
|
1385 | value: function safeRoundUp(num, exponent) {
|
1386 | return Math.round(num * exponent);
|
1387 | }
|
1388 | }]);
|
1389 |
|
1390 | return Decimal;
|
1391 | }();
|
1392 |
|
1393 |
|
1394 |
|
1395 | var _ERROR_MSG;
|
1396 |
|
1397 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
1398 |
|
1399 | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
1400 |
|
1401 | function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
1402 |
|
1403 | function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
1404 |
|
1405 | function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
1406 |
|
1407 | function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
1408 |
|
1409 | function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
1410 |
|
1411 | function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
1412 |
|
1413 | function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
1414 |
|
1415 | function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
1416 |
|
1417 | function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
1418 |
|
1419 | function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
1420 |
|
1421 | function control_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1422 |
|
1423 | function control_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
1424 |
|
1425 | function control_createClass(Constructor, protoProps, staticProps) { if (protoProps) control_defineProperties(Constructor.prototype, protoProps); if (staticProps) control_defineProperties(Constructor, staticProps); return Constructor; }
|
1426 |
|
1427 | 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; }
|
1428 |
|
1429 |
|
1430 | var ERROR_TYPE;
|
1431 |
|
1432 | (function (ERROR_TYPE) {
|
1433 | ERROR_TYPE[ERROR_TYPE["VALUE"] = 1] = "VALUE";
|
1434 | ERROR_TYPE[ERROR_TYPE["INTERVAL"] = 2] = "INTERVAL";
|
1435 | ERROR_TYPE[ERROR_TYPE["MIN"] = 3] = "MIN";
|
1436 | ERROR_TYPE[ERROR_TYPE["MAX"] = 4] = "MAX";
|
1437 | ERROR_TYPE[ERROR_TYPE["ORDER"] = 5] = "ORDER";
|
1438 | })(ERROR_TYPE || (ERROR_TYPE = {}));
|
1439 |
|
1440 | var ERROR_MSG = (_ERROR_MSG = {}, _defineProperty(_ERROR_MSG, ERROR_TYPE.VALUE, 'The type of the "value" is illegal'), _defineProperty(_ERROR_MSG, ERROR_TYPE.INTERVAL, 'The prop "interval" is invalid, "(max - min)" must be divisible by "interval"'), _defineProperty(_ERROR_MSG, ERROR_TYPE.MIN, 'The "value" must be greater than or equal to the "min".'), _defineProperty(_ERROR_MSG, ERROR_TYPE.MAX, 'The "value" must be less than or equal to the "max".'), _defineProperty(_ERROR_MSG, ERROR_TYPE.ORDER, 'When "order" is false, the parameters "minRange", "maxRange", "fixed", "enabled" are invalid.'), _ERROR_MSG);
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 |
|
1448 | var control_Control = function () {
|
1449 | function Control(options) {
|
1450 | control_classCallCheck(this, Control);
|
1451 |
|
1452 | this.dotsPos = [];
|
1453 |
|
1454 | this.dotsValue = [];
|
1455 |
|
1456 | this.cacheRangeDir = {};
|
1457 | this.data = options.data;
|
1458 | this.max = options.max;
|
1459 | this.min = options.min;
|
1460 | this.interval = options.interval;
|
1461 | this.order = options.order;
|
1462 | this.marks = options.marks;
|
1463 | this.included = options.included;
|
1464 | this.process = options.process;
|
1465 | this.adsorb = options.adsorb;
|
1466 | this.dotOptions = options.dotOptions;
|
1467 | this.onError = options.onError;
|
1468 |
|
1469 | if (this.order) {
|
1470 | this.minRange = options.minRange || 0;
|
1471 | this.maxRange = options.maxRange || 0;
|
1472 | this.enableCross = options.enableCross;
|
1473 | this.fixed = options.fixed;
|
1474 | } else {
|
1475 | if (options.minRange || options.maxRange || !options.enableCross || options.fixed) {
|
1476 | this.emitError(ERROR_TYPE.ORDER);
|
1477 | }
|
1478 |
|
1479 | this.minRange = 0;
|
1480 | this.maxRange = 0;
|
1481 | this.enableCross = true;
|
1482 | this.fixed = false;
|
1483 | }
|
1484 |
|
1485 | this.setValue(options.value);
|
1486 | }
|
1487 |
|
1488 | control_createClass(Control, [{
|
1489 | key: "setValue",
|
1490 | value: function setValue(value) {
|
1491 | var _this = this;
|
1492 |
|
1493 | this.setDotsValue(Array.isArray(value) ? this.order ? _toConsumableArray(value).sort(function (a, b) {
|
1494 | return _this.getIndexByValue(a) - _this.getIndexByValue(b);
|
1495 | }) : _toConsumableArray(value) : [value], true);
|
1496 | }
|
1497 | }, {
|
1498 | key: "setDotsValue",
|
1499 | value: function setDotsValue(value, syncPos) {
|
1500 | this.dotsValue = value;
|
1501 |
|
1502 | if (syncPos) {
|
1503 | this.syncDotsPos();
|
1504 | }
|
1505 | }
|
1506 |
|
1507 | }, {
|
1508 | key: "setDotsPos",
|
1509 | value: function setDotsPos(dotsPos) {
|
1510 | var _this2 = this;
|
1511 |
|
1512 | var list = this.order ? _toConsumableArray(dotsPos).sort(function (a, b) {
|
1513 | return a - b;
|
1514 | }) : dotsPos;
|
1515 | this.dotsPos = list;
|
1516 | this.setDotsValue(list.map(function (dotPos) {
|
1517 | return _this2.getValueByPos(dotPos);
|
1518 | }), this.adsorb);
|
1519 | }
|
1520 |
|
1521 | }, {
|
1522 | key: "getValueByPos",
|
1523 | value: function getValueByPos(pos) {
|
1524 | var value = this.parsePos(pos);
|
1525 |
|
1526 | if (this.included) {
|
1527 | var dir = 100;
|
1528 | this.markList.forEach(function (mark) {
|
1529 | var curDir = Math.abs(mark.pos - pos);
|
1530 |
|
1531 | if (curDir < dir) {
|
1532 | dir = curDir;
|
1533 | value = mark.value;
|
1534 | }
|
1535 | });
|
1536 | }
|
1537 |
|
1538 | return value;
|
1539 | }
|
1540 |
|
1541 | }, {
|
1542 | key: "syncDotsPos",
|
1543 | value: function syncDotsPos() {
|
1544 | var _this3 = this;
|
1545 |
|
1546 | this.dotsPos = this.dotsValue.map(function (v) {
|
1547 | return _this3.parseValue(v);
|
1548 | });
|
1549 | }
|
1550 | |
1551 |
|
1552 |
|
1553 |
|
1554 |
|
1555 |
|
1556 |
|
1557 |
|
1558 | }, {
|
1559 | key: "getRecentDot",
|
1560 |
|
1561 | |
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 | value: function getRecentDot(pos) {
|
1569 | var _this4 = this;
|
1570 |
|
1571 | var arr = this.dotsPos.filter(function (dotPos, index) {
|
1572 | return !(_this4.getDotOption(index) && _this4.getDotOption(index).disabled);
|
1573 | }).map(function (dotPos) {
|
1574 | return Math.abs(dotPos - pos);
|
1575 | });
|
1576 | return arr.indexOf(Math.min.apply(Math, _toConsumableArray(arr)));
|
1577 | }
|
1578 | |
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 | }, {
|
1587 | key: "getIndexByValue",
|
1588 | value: function getIndexByValue(value) {
|
1589 | if (this.data) {
|
1590 | return this.data.indexOf(value);
|
1591 | }
|
1592 |
|
1593 | return new Decimal(+value).minus(this.min).divide(this.interval).toNumber();
|
1594 | }
|
1595 | |
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 | }, {
|
1604 | key: "getValueByIndex",
|
1605 | value: function getValueByIndex(index) {
|
1606 | if (index < 0) {
|
1607 | index = 0;
|
1608 | } else if (index > this.total) {
|
1609 | index = this.total;
|
1610 | }
|
1611 |
|
1612 | return this.data ? this.data[index] : new Decimal(index).multiply(this.interval).plus(this.min).toNumber();
|
1613 | }
|
1614 | |
1615 |
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 | }, {
|
1622 | key: "setDotPos",
|
1623 | value: function setDotPos(pos, index) {
|
1624 | pos = this.getValidPos(pos, index).pos;
|
1625 | var changePos = pos - this.dotsPos[index];
|
1626 |
|
1627 | if (!changePos) {
|
1628 | return;
|
1629 | }
|
1630 |
|
1631 | var changePosArr = new Array(this.dotsPos.length);
|
1632 |
|
1633 | if (this.fixed) {
|
1634 | changePosArr = this.getFixedChangePosArr(changePos, index);
|
1635 | } else if (this.minRange || this.maxRange) {
|
1636 | changePosArr = this.getLimitRangeChangePosArr(pos, changePos, index);
|
1637 | } else {
|
1638 | changePosArr[index] = changePos;
|
1639 | }
|
1640 |
|
1641 | this.setDotsPos(this.dotsPos.map(function (curPos, i) {
|
1642 | return curPos + (changePosArr[i] || 0);
|
1643 | }));
|
1644 | }
|
1645 | |
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 | }, {
|
1655 | key: "getFixedChangePosArr",
|
1656 | value: function getFixedChangePosArr(changePos, index) {
|
1657 | var _this5 = this;
|
1658 |
|
1659 | this.dotsPos.forEach(function (originPos, i) {
|
1660 | if (i !== index) {
|
1661 | var _this5$getValidPos = _this5.getValidPos(originPos + changePos, i),
|
1662 | lastPos = _this5$getValidPos.pos,
|
1663 | inRange = _this5$getValidPos.inRange;
|
1664 |
|
1665 | if (!inRange) {
|
1666 | changePos = Math.min(Math.abs(lastPos - originPos), Math.abs(changePos)) * (changePos < 0 ? -1 : 1);
|
1667 | }
|
1668 | }
|
1669 | });
|
1670 | return this.dotsPos.map(function (_) {
|
1671 | return changePos;
|
1672 | });
|
1673 | }
|
1674 | |
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 | }, {
|
1685 | key: "getLimitRangeChangePosArr",
|
1686 | value: function getLimitRangeChangePosArr(pos, changePos, index) {
|
1687 | var _this6 = this;
|
1688 |
|
1689 | var changeDots = [{
|
1690 | index: index,
|
1691 | changePos: changePos
|
1692 | }];
|
1693 | var newChangePos = changePos;
|
1694 | [this.minRange, this.maxRange].forEach(function (isLimitRange, rangeIndex) {
|
1695 | if (!isLimitRange) {
|
1696 | return false;
|
1697 | }
|
1698 |
|
1699 | var isMinRange = rangeIndex === 0;
|
1700 | var isForward = changePos > 0;
|
1701 | var next = 0;
|
1702 |
|
1703 | if (isMinRange) {
|
1704 | next = isForward ? 1 : -1;
|
1705 | } else {
|
1706 | next = isForward ? -1 : 1;
|
1707 | }
|
1708 |
|
1709 |
|
1710 | var inLimitRange = function inLimitRange(pos2, pos1) {
|
1711 | var diff = Math.abs(pos2 - pos1);
|
1712 | return isMinRange ? diff < _this6.minRangeDir : diff > _this6.maxRangeDir;
|
1713 | };
|
1714 |
|
1715 | var i = index + next;
|
1716 | var nextPos = _this6.dotsPos[i];
|
1717 | var curPos = pos;
|
1718 |
|
1719 | while (_this6.isPos(nextPos) && inLimitRange(nextPos, curPos)) {
|
1720 | var _this6$getValidPos = _this6.getValidPos(nextPos + newChangePos, i),
|
1721 | lastPos = _this6$getValidPos.pos;
|
1722 |
|
1723 | changeDots.push({
|
1724 | index: i,
|
1725 | changePos: lastPos - nextPos
|
1726 | });
|
1727 | i = i + next;
|
1728 | curPos = lastPos;
|
1729 | nextPos = _this6.dotsPos[i];
|
1730 | }
|
1731 | });
|
1732 | return this.dotsPos.map(function (_, i) {
|
1733 | var changeDot = changeDots.filter(function (dot) {
|
1734 | return dot.index === i;
|
1735 | });
|
1736 | return changeDot.length ? changeDot[0].changePos : 0;
|
1737 | });
|
1738 | }
|
1739 | }, {
|
1740 | key: "isPos",
|
1741 | value: function isPos(pos) {
|
1742 | return typeof pos === 'number';
|
1743 | }
|
1744 | |
1745 |
|
1746 |
|
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 |
|
1752 | }, {
|
1753 | key: "getValidPos",
|
1754 | value: function getValidPos(pos, index) {
|
1755 | var range = this.valuePosRange[index];
|
1756 | var inRange = true;
|
1757 |
|
1758 | if (pos < range[0]) {
|
1759 | pos = range[0];
|
1760 | inRange = false;
|
1761 | } else if (pos > range[1]) {
|
1762 | pos = range[1];
|
1763 | inRange = false;
|
1764 | }
|
1765 |
|
1766 | return {
|
1767 | pos: pos,
|
1768 | inRange: inRange
|
1769 | };
|
1770 | }
|
1771 | |
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 |
|
1777 |
|
1778 | }, {
|
1779 | key: "parseValue",
|
1780 | value: function parseValue(val) {
|
1781 | if (this.data) {
|
1782 | val = this.data.indexOf(val);
|
1783 | } else if (typeof val === 'number' || typeof val === 'string') {
|
1784 | val = +val;
|
1785 |
|
1786 | if (val < this.min) {
|
1787 | this.emitError(ERROR_TYPE.MIN);
|
1788 | return 0;
|
1789 | }
|
1790 |
|
1791 | if (val > this.max) {
|
1792 | this.emitError(ERROR_TYPE.MAX);
|
1793 | return 0;
|
1794 | }
|
1795 |
|
1796 | if (typeof val !== 'number' || val !== val) {
|
1797 | this.emitError(ERROR_TYPE.VALUE);
|
1798 | return 0;
|
1799 | }
|
1800 |
|
1801 | val = new Decimal(val).minus(this.min).divide(this.interval).toNumber();
|
1802 | }
|
1803 |
|
1804 | var pos = new Decimal(val).multiply(this.gap).toNumber();
|
1805 | return pos < 0 ? 0 : pos > 100 ? 100 : pos;
|
1806 | }
|
1807 | |
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 | }, {
|
1816 | key: "parsePos",
|
1817 | value: function parsePos(pos) {
|
1818 | var index = Math.round(pos / this.gap);
|
1819 | return this.getValueByIndex(index);
|
1820 | }
|
1821 | |
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 | }, {
|
1830 | key: "isActiveByPos",
|
1831 | value: function isActiveByPos(pos) {
|
1832 | return this.processArray.some(function (_ref) {
|
1833 | var _ref2 = _slicedToArray(_ref, 2),
|
1834 | start = _ref2[0],
|
1835 | end = _ref2[1];
|
1836 |
|
1837 | return pos >= start && pos <= end;
|
1838 | });
|
1839 | }
|
1840 | |
1841 |
|
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 | }, {
|
1848 | key: "getValues",
|
1849 | value: function getValues() {
|
1850 | if (this.data) {
|
1851 | return this.data;
|
1852 | } else {
|
1853 | var values = [];
|
1854 |
|
1855 | for (var i = 0; i <= this.total; i++) {
|
1856 | values.push(new Decimal(i).multiply(this.interval).plus(this.min).toNumber());
|
1857 | }
|
1858 |
|
1859 | return values;
|
1860 | }
|
1861 | }
|
1862 | |
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 | }, {
|
1868 | key: "getRangeDir",
|
1869 | value: function getRangeDir(range) {
|
1870 | return range ? new Decimal(range).divide(new Decimal(this.data ? this.data.length - 1 : this.max).minus(this.data ? 0 : this.min).toNumber()).multiply(100).toNumber() : 100;
|
1871 | }
|
1872 | }, {
|
1873 | key: "emitError",
|
1874 | value: function emitError(type) {
|
1875 | if (this.onError) {
|
1876 | this.onError(type, ERROR_MSG[type]);
|
1877 | }
|
1878 | }
|
1879 | }, {
|
1880 | key: "getDotOption",
|
1881 | value: function getDotOption(index) {
|
1882 | return Array.isArray(this.dotOptions) ? this.dotOptions[index] : this.dotOptions;
|
1883 | }
|
1884 | }, {
|
1885 | key: "getDotRange",
|
1886 | value: function getDotRange(index, key, defaultValue) {
|
1887 | if (!this.dotOptions) {
|
1888 | return defaultValue;
|
1889 | }
|
1890 |
|
1891 | var option = this.getDotOption(index);
|
1892 | return option && option[key] !== void 0 ? this.parseValue(option[key]) : defaultValue;
|
1893 | }
|
1894 | |
1895 |
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 | }, {
|
1902 | key: "markList",
|
1903 | get: function get() {
|
1904 | var _this7 = this;
|
1905 |
|
1906 | if (!this.marks) {
|
1907 | return [];
|
1908 | }
|
1909 |
|
1910 | var getMarkByValue = function getMarkByValue(value, mark) {
|
1911 | var pos = _this7.parseValue(value);
|
1912 |
|
1913 | return _objectSpread({
|
1914 | pos: pos,
|
1915 | value: value,
|
1916 | label: value,
|
1917 | active: _this7.isActiveByPos(pos)
|
1918 | }, mark);
|
1919 | };
|
1920 |
|
1921 | if (this.marks === true) {
|
1922 | return this.getValues().map(function (value) {
|
1923 | return getMarkByValue(value);
|
1924 | });
|
1925 | } else if (Object.prototype.toString.call(this.marks) === '[object Object]') {
|
1926 | return Object.keys(this.marks).sort(function (a, b) {
|
1927 | return +a - +b;
|
1928 | }).map(function (value) {
|
1929 | var item = _this7.marks[value];
|
1930 | return getMarkByValue(value, typeof item !== 'string' ? item : {
|
1931 | label: item
|
1932 | });
|
1933 | });
|
1934 | } else if (Array.isArray(this.marks)) {
|
1935 | return this.marks.map(function (value) {
|
1936 | return getMarkByValue(value);
|
1937 | });
|
1938 | } else if (typeof this.marks === 'function') {
|
1939 | return this.getValues().map(function (value) {
|
1940 | return {
|
1941 | value: value,
|
1942 | result: _this7.marks(value)
|
1943 | };
|
1944 | }).filter(function (_ref3) {
|
1945 | var result = _ref3.result;
|
1946 | return !!result;
|
1947 | }).map(function (_ref4) {
|
1948 | var value = _ref4.value,
|
1949 | result = _ref4.result;
|
1950 | return getMarkByValue(value, result);
|
1951 | });
|
1952 | } else {
|
1953 | return [];
|
1954 | }
|
1955 | }
|
1956 | }, {
|
1957 | key: "processArray",
|
1958 | get: function get() {
|
1959 | if (this.process) {
|
1960 | if (typeof this.process === 'function') {
|
1961 | return this.process(this.dotsPos);
|
1962 | } else if (this.dotsPos.length === 1) {
|
1963 | return [[0, this.dotsPos[0]]];
|
1964 | } else if (this.dotsPos.length > 1) {
|
1965 | return [[Math.min.apply(Math, _toConsumableArray(this.dotsPos)), Math.max.apply(Math, _toConsumableArray(this.dotsPos))]];
|
1966 | }
|
1967 | }
|
1968 |
|
1969 | return [];
|
1970 | }
|
1971 | |
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 | }, {
|
1979 | key: "total",
|
1980 | get: function get() {
|
1981 | var total = 0;
|
1982 |
|
1983 | if (this.data) {
|
1984 | total = this.data.length - 1;
|
1985 | } else {
|
1986 | total = new Decimal(this.max).minus(this.min).divide(this.interval).toNumber();
|
1987 | }
|
1988 |
|
1989 | if (total - Math.floor(total) !== 0) {
|
1990 | this.emitError(ERROR_TYPE.INTERVAL);
|
1991 | return 0;
|
1992 | }
|
1993 |
|
1994 | return total;
|
1995 | }
|
1996 |
|
1997 | }, {
|
1998 | key: "gap",
|
1999 | get: function get() {
|
2000 | return 100 / this.total;
|
2001 | }
|
2002 |
|
2003 | }, {
|
2004 | key: "minRangeDir",
|
2005 | get: function get() {
|
2006 | if (this.cacheRangeDir[this.minRange]) {
|
2007 | return this.cacheRangeDir[this.minRange];
|
2008 | }
|
2009 |
|
2010 | return this.cacheRangeDir[this.minRange] = this.getRangeDir(this.minRange);
|
2011 | }
|
2012 |
|
2013 | }, {
|
2014 | key: "maxRangeDir",
|
2015 | get: function get() {
|
2016 | if (this.cacheRangeDir[this.maxRange]) return this.cacheRangeDir[this.maxRange];
|
2017 | return this.cacheRangeDir[this.maxRange] = this.getRangeDir(this.maxRange);
|
2018 | }
|
2019 | }, {
|
2020 | key: "valuePosRange",
|
2021 | get: function get() {
|
2022 | var _this8 = this;
|
2023 |
|
2024 | var dotsPos = this.dotsPos;
|
2025 | var valuePosRange = [];
|
2026 | dotsPos.forEach(function (pos, i) {
|
2027 | valuePosRange.push([Math.max(_this8.minRange ? _this8.minRangeDir * i : 0, !_this8.enableCross ? dotsPos[i - 1] || 0 : 0, _this8.getDotRange(i, 'min', 0)), Math.min(_this8.minRange ? 100 - _this8.minRangeDir * (dotsPos.length - 1 - i) : 100, !_this8.enableCross ? dotsPos[i + 1] || 100 : 100, _this8.getDotRange(i, 'max', 100))]);
|
2028 | });
|
2029 | return valuePosRange;
|
2030 | }
|
2031 | }, {
|
2032 | key: "dotsIndex",
|
2033 | get: function get() {
|
2034 | var _this9 = this;
|
2035 |
|
2036 | return this.dotsValue.map(function (val) {
|
2037 | return _this9.getIndexByValue(val);
|
2038 | });
|
2039 | }
|
2040 | }]);
|
2041 |
|
2042 | return Control;
|
2043 | }();
|
2044 |
|
2045 |
|
2046 |
|
2047 | function state_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2048 |
|
2049 | function state_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
2050 |
|
2051 | function state_createClass(Constructor, protoProps, staticProps) { if (protoProps) state_defineProperties(Constructor.prototype, protoProps); if (staticProps) state_defineProperties(Constructor, staticProps); return Constructor; }
|
2052 |
|
2053 | var State = function () {
|
2054 | function State(map) {
|
2055 | state_classCallCheck(this, State);
|
2056 |
|
2057 | this.states = 0;
|
2058 | this.map = map;
|
2059 | }
|
2060 |
|
2061 | state_createClass(State, [{
|
2062 | key: "add",
|
2063 | value: function add(state) {
|
2064 | this.states |= state;
|
2065 | }
|
2066 | }, {
|
2067 | key: "delete",
|
2068 | value: function _delete(state) {
|
2069 | this.states &= ~state;
|
2070 | }
|
2071 | }, {
|
2072 | key: "toggle",
|
2073 | value: function toggle(state) {
|
2074 | if (this.has(state)) {
|
2075 | this.delete(state);
|
2076 | } else {
|
2077 | this.add(state);
|
2078 | }
|
2079 | }
|
2080 | }, {
|
2081 | key: "has",
|
2082 | value: function has(state) {
|
2083 | return !!(this.states & state);
|
2084 | }
|
2085 | }]);
|
2086 |
|
2087 | return State;
|
2088 | }();
|
2089 |
|
2090 |
|
2091 |
|
2092 | var slider = __webpack_require__("4abb");
|
2093 |
|
2094 |
|
2095 |
|
2096 |
|
2097 | function vue_slider_slicedToArray(arr, i) { return vue_slider_arrayWithHoles(arr) || vue_slider_iterableToArrayLimit(arr, i) || vue_slider_unsupportedIterableToArray(arr, i) || vue_slider_nonIterableRest(); }
|
2098 |
|
2099 | function vue_slider_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
2100 |
|
2101 | function vue_slider_iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
2102 |
|
2103 | function vue_slider_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
2104 |
|
2105 | function vue_slider_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
2106 |
|
2107 | function vue_slider_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { vue_slider_ownKeys(Object(source), true).forEach(function (key) { vue_slider_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { vue_slider_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
2108 |
|
2109 | function vue_slider_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; }
|
2110 |
|
2111 | function vue_slider_toConsumableArray(arr) { return vue_slider_arrayWithoutHoles(arr) || vue_slider_iterableToArray(arr) || vue_slider_unsupportedIterableToArray(arr) || vue_slider_nonIterableSpread(); }
|
2112 |
|
2113 | function vue_slider_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
2114 |
|
2115 | function vue_slider_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return vue_slider_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return vue_slider_arrayLikeToArray(o, minLen); }
|
2116 |
|
2117 | function vue_slider_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
2118 |
|
2119 | function vue_slider_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return vue_slider_arrayLikeToArray(arr); }
|
2120 |
|
2121 | function vue_slider_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
2122 |
|
2123 | function vue_slider_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { vue_slider_typeof = function _typeof(obj) { return typeof obj; }; } else { vue_slider_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return vue_slider_typeof(obj); }
|
2124 |
|
2125 | function vue_slider_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2126 |
|
2127 | function vue_slider_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
2128 |
|
2129 | function vue_slider_createClass(Constructor, protoProps, staticProps) { if (protoProps) vue_slider_defineProperties(Constructor.prototype, protoProps); if (staticProps) vue_slider_defineProperties(Constructor, staticProps); return Constructor; }
|
2130 |
|
2131 | function vue_slider_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) vue_slider_setPrototypeOf(subClass, superClass); }
|
2132 |
|
2133 | function vue_slider_setPrototypeOf(o, p) { vue_slider_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return vue_slider_setPrototypeOf(o, p); }
|
2134 |
|
2135 | function vue_slider_createSuper(Derived) { var hasNativeReflectConstruct = vue_slider_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = vue_slider_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = vue_slider_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return vue_slider_possibleConstructorReturn(this, result); }; }
|
2136 |
|
2137 | function vue_slider_possibleConstructorReturn(self, call) { if (call && (vue_slider_typeof(call) === "object" || typeof call === "function")) { return call; } return vue_slider_assertThisInitialized(self); }
|
2138 |
|
2139 | function vue_slider_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
2140 |
|
2141 | function vue_slider_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
2142 |
|
2143 | function vue_slider_getPrototypeOf(o) { vue_slider_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return vue_slider_getPrototypeOf(o); }
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 | var SliderState = {
|
2155 | None: 0,
|
2156 | Drag: 1 << 1,
|
2157 | Focus: 1 << 2
|
2158 | };
|
2159 | var DEFAULT_SLIDER_SIZE = 4;
|
2160 |
|
2161 | var vue_slider_VueSlider =
|
2162 |
|
2163 | function () {
|
2164 | var VueSlider = function (_Vue) {
|
2165 | vue_slider_inherits(VueSlider, _Vue);
|
2166 |
|
2167 | var _super = vue_slider_createSuper(VueSlider);
|
2168 |
|
2169 | function VueSlider() {
|
2170 | var _this;
|
2171 |
|
2172 | vue_slider_classCallCheck(this, VueSlider);
|
2173 |
|
2174 | _this = _super.apply(this, arguments);
|
2175 | _this.states = new State(SliderState);
|
2176 |
|
2177 | _this.scale = 1;
|
2178 |
|
2179 | _this.focusDotIndex = 0;
|
2180 | return _this;
|
2181 | }
|
2182 |
|
2183 | vue_slider_createClass(VueSlider, [{
|
2184 | key: "isObjectData",
|
2185 | value: function isObjectData(data) {
|
2186 | return !!data && Object.prototype.toString.call(data) === '[object Object]';
|
2187 | }
|
2188 | }, {
|
2189 | key: "isObjectArrayData",
|
2190 | value: function isObjectArrayData(data) {
|
2191 | return !!data && Array.isArray(data) && data.length > 0 && vue_slider_typeof(data[0]) === 'object';
|
2192 | }
|
2193 | }, {
|
2194 | key: "onValueChanged",
|
2195 | value: function onValueChanged() {
|
2196 | if (this.control && !this.states.has(SliderState.Drag) && this.isNotSync) {
|
2197 | this.control.setValue(this.value);
|
2198 | this.syncValueByPos();
|
2199 | }
|
2200 | }
|
2201 | }, {
|
2202 | key: "created",
|
2203 | value: function created() {
|
2204 | this.initControl();
|
2205 | }
|
2206 | }, {
|
2207 | key: "mounted",
|
2208 | value: function mounted() {
|
2209 | this.bindEvent();
|
2210 | }
|
2211 | }, {
|
2212 | key: "beforeDestroy",
|
2213 | value: function beforeDestroy() {
|
2214 | this.unbindEvent();
|
2215 | }
|
2216 | }, {
|
2217 | key: "bindEvent",
|
2218 | value: function bindEvent() {
|
2219 | document.addEventListener('touchmove', this.dragMove, {
|
2220 | passive: false
|
2221 | });
|
2222 | document.addEventListener('touchend', this.dragEnd, {
|
2223 | passive: false
|
2224 | });
|
2225 | document.addEventListener('mousedown', this.blurHandle);
|
2226 | document.addEventListener('mousemove', this.dragMove, {
|
2227 | passive: false
|
2228 | });
|
2229 | document.addEventListener('mouseup', this.dragEnd);
|
2230 | document.addEventListener('mouseleave', this.dragEnd);
|
2231 | document.addEventListener('keydown', this.keydownHandle);
|
2232 | }
|
2233 | }, {
|
2234 | key: "unbindEvent",
|
2235 | value: function unbindEvent() {
|
2236 | document.removeEventListener('touchmove', this.dragMove);
|
2237 | document.removeEventListener('touchend', this.dragEnd);
|
2238 | document.removeEventListener('mousedown', this.blurHandle);
|
2239 | document.removeEventListener('mousemove', this.dragMove);
|
2240 | document.removeEventListener('mouseup', this.dragEnd);
|
2241 | document.removeEventListener('mouseleave', this.dragEnd);
|
2242 | document.removeEventListener('keydown', this.keydownHandle);
|
2243 | }
|
2244 | }, {
|
2245 | key: "setScale",
|
2246 | value: function setScale() {
|
2247 | var decimal = new Decimal(Math.floor(this.isHorizontal ? this.$refs.rail.offsetWidth : this.$refs.rail.offsetHeight));
|
2248 |
|
2249 | if (this.zoom !== void 0) {
|
2250 | decimal.multiply(this.zoom);
|
2251 | }
|
2252 |
|
2253 | decimal.divide(100);
|
2254 | this.scale = decimal.toNumber();
|
2255 | }
|
2256 | }, {
|
2257 | key: "initControl",
|
2258 | value: function initControl() {
|
2259 | var _this2 = this;
|
2260 |
|
2261 | this.control = new control_Control({
|
2262 | value: this.value,
|
2263 | data: this.sliderData,
|
2264 | enableCross: this.enableCross,
|
2265 | fixed: this.fixed,
|
2266 | max: this.max,
|
2267 | min: this.min,
|
2268 | interval: this.interval,
|
2269 | minRange: this.minRange,
|
2270 | maxRange: this.maxRange,
|
2271 | order: this.order,
|
2272 | marks: this.sliderMarks,
|
2273 | included: this.included,
|
2274 | process: this.process,
|
2275 | adsorb: this.adsorb,
|
2276 | dotOptions: this.dotOptions,
|
2277 | onError: this.emitError
|
2278 | });
|
2279 | this.syncValueByPos();
|
2280 | ['data', 'enableCross', 'fixed', 'max', 'min', 'interval', 'minRange', 'maxRange', 'order', 'marks', 'process', 'adsorb', 'included', 'dotOptions'].forEach(function (name) {
|
2281 | _this2.$watch(name, function (val) {
|
2282 | if (name === 'data' && Array.isArray(_this2.control.data) && Array.isArray(val) && _this2.control.data.length === val.length && val.every(function (item, index) {
|
2283 | return item === _this2.control.data[index];
|
2284 | })) {
|
2285 | return false;
|
2286 | }
|
2287 |
|
2288 | switch (name) {
|
2289 | case 'data':
|
2290 | case 'dataLabel':
|
2291 | case 'dataValue':
|
2292 | _this2.control.data = _this2.sliderData;
|
2293 | break;
|
2294 |
|
2295 | case 'mark':
|
2296 | _this2.control.marks = _this2.sliderMarks;
|
2297 | break;
|
2298 |
|
2299 | default:
|
2300 | ;
|
2301 | _this2.control[name] = val;
|
2302 | }
|
2303 |
|
2304 | if (['data', 'max', 'min', 'interval'].indexOf(name) > -1) {
|
2305 | _this2.control.syncDotsPos();
|
2306 | }
|
2307 | });
|
2308 | });
|
2309 | }
|
2310 | }, {
|
2311 | key: "syncValueByPos",
|
2312 | value: function syncValueByPos() {
|
2313 | var values = this.control.dotsValue;
|
2314 |
|
2315 | if (this.isDiff(values, Array.isArray(this.value) ? this.value : [this.value])) {
|
2316 | this.$emit('change', values.length === 1 ? values[0] : vue_slider_toConsumableArray(values), this.focusDotIndex);
|
2317 | }
|
2318 | }
|
2319 |
|
2320 | }, {
|
2321 | key: "isDiff",
|
2322 | value: function isDiff(value1, value2) {
|
2323 | return value1.length !== value2.length || value1.some(function (val, index) {
|
2324 | return val !== value2[index];
|
2325 | });
|
2326 | }
|
2327 | }, {
|
2328 | key: "emitError",
|
2329 | value: function emitError(type, message) {
|
2330 | if (!this.silent) {
|
2331 | console.error("[VueSlider error]: ".concat(message));
|
2332 | }
|
2333 |
|
2334 | this.$emit('error', type, message);
|
2335 | }
|
2336 | |
2337 |
|
2338 |
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 | }, {
|
2346 | key: "dragStartOnProcess",
|
2347 | value: function dragStartOnProcess(e) {
|
2348 | if (this.dragOnClick) {
|
2349 | this.setScale();
|
2350 | var pos = this.getPosByEvent(e);
|
2351 | var index = this.control.getRecentDot(pos);
|
2352 |
|
2353 | if (this.dots[index].disabled) {
|
2354 | return;
|
2355 | }
|
2356 |
|
2357 | this.dragStart(index);
|
2358 | this.control.setDotPos(pos, this.focusDotIndex);
|
2359 |
|
2360 | if (!this.lazy) {
|
2361 | this.syncValueByPos();
|
2362 | }
|
2363 | }
|
2364 | }
|
2365 | }, {
|
2366 | key: "dragStart",
|
2367 | value: function dragStart(index) {
|
2368 | this.focusDotIndex = index;
|
2369 | this.setScale();
|
2370 | this.states.add(SliderState.Drag);
|
2371 | this.states.add(SliderState.Focus);
|
2372 | this.$emit('drag-start', this.focusDotIndex);
|
2373 | }
|
2374 | }, {
|
2375 | key: "dragMove",
|
2376 | value: function dragMove(e) {
|
2377 | if (!this.states.has(SliderState.Drag)) {
|
2378 | return false;
|
2379 | }
|
2380 |
|
2381 | e.preventDefault();
|
2382 | var pos = this.getPosByEvent(e);
|
2383 | this.isCrossDot(pos);
|
2384 | this.control.setDotPos(pos, this.focusDotIndex);
|
2385 |
|
2386 | if (!this.lazy) {
|
2387 | this.syncValueByPos();
|
2388 | }
|
2389 |
|
2390 | var value = this.control.dotsValue;
|
2391 | this.$emit('dragging', value.length === 1 ? value[0] : vue_slider_toConsumableArray(value), this.focusDotIndex);
|
2392 | }
|
2393 |
|
2394 | }, {
|
2395 | key: "isCrossDot",
|
2396 | value: function isCrossDot(pos) {
|
2397 | if (this.canSort) {
|
2398 | var curIndex = this.focusDotIndex;
|
2399 | var curPos = pos;
|
2400 |
|
2401 | if (curPos > this.dragRange[1]) {
|
2402 | curPos = this.dragRange[1];
|
2403 | this.focusDotIndex++;
|
2404 | } else if (curPos < this.dragRange[0]) {
|
2405 | curPos = this.dragRange[0];
|
2406 | this.focusDotIndex--;
|
2407 | }
|
2408 |
|
2409 | if (curIndex !== this.focusDotIndex) {
|
2410 | var dotVm = this.$refs["dot-".concat(this.focusDotIndex)];
|
2411 |
|
2412 | if (dotVm && dotVm.$el) {
|
2413 | dotVm.$el.focus();
|
2414 | }
|
2415 |
|
2416 | this.control.setDotPos(curPos, curIndex);
|
2417 | }
|
2418 | }
|
2419 | }
|
2420 | }, {
|
2421 | key: "dragEnd",
|
2422 | value: function dragEnd(e) {
|
2423 | var _this3 = this;
|
2424 |
|
2425 | if (!this.states.has(SliderState.Drag)) {
|
2426 | return false;
|
2427 | }
|
2428 |
|
2429 | setTimeout(function () {
|
2430 | if (_this3.lazy) {
|
2431 | _this3.syncValueByPos();
|
2432 | }
|
2433 |
|
2434 | if (_this3.included && _this3.isNotSync) {
|
2435 | _this3.control.setValue(_this3.value);
|
2436 | } else {
|
2437 |
|
2438 | _this3.control.syncDotsPos();
|
2439 | }
|
2440 |
|
2441 | _this3.states.delete(SliderState.Drag);
|
2442 |
|
2443 |
|
2444 | if (!_this3.useKeyboard || 'targetTouches' in e) {
|
2445 | _this3.states.delete(SliderState.Focus);
|
2446 | }
|
2447 |
|
2448 | _this3.$emit('drag-end', _this3.focusDotIndex);
|
2449 | });
|
2450 | }
|
2451 | }, {
|
2452 | key: "blurHandle",
|
2453 | value: function blurHandle(e) {
|
2454 | if (!this.states.has(SliderState.Focus) || !this.$refs.container || this.$refs.container.contains(e.target)) {
|
2455 | return false;
|
2456 | }
|
2457 |
|
2458 | this.states.delete(SliderState.Focus);
|
2459 | }
|
2460 | }, {
|
2461 | key: "clickHandle",
|
2462 | value: function clickHandle(e) {
|
2463 | if (!this.clickable || this.disabled) {
|
2464 | return false;
|
2465 | }
|
2466 |
|
2467 | if (this.states.has(SliderState.Drag)) {
|
2468 | return;
|
2469 | }
|
2470 |
|
2471 | this.setScale();
|
2472 | var pos = this.getPosByEvent(e);
|
2473 | this.setValueByPos(pos);
|
2474 | }
|
2475 | }, {
|
2476 | key: "focus",
|
2477 | value: function focus() {
|
2478 | var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
2479 | this.states.add(SliderState.Focus);
|
2480 | this.focusDotIndex = index;
|
2481 | }
|
2482 | }, {
|
2483 | key: "blur",
|
2484 | value: function blur() {
|
2485 | this.states.delete(SliderState.Focus);
|
2486 | }
|
2487 | }, {
|
2488 | key: "getValue",
|
2489 | value: function getValue() {
|
2490 | var values = this.control.dotsValue;
|
2491 | return values.length === 1 ? values[0] : values;
|
2492 | }
|
2493 | }, {
|
2494 | key: "getIndex",
|
2495 | value: function getIndex() {
|
2496 | var indexes = this.control.dotsIndex;
|
2497 | return indexes.length === 1 ? indexes[0] : indexes;
|
2498 | }
|
2499 | }, {
|
2500 | key: "setValue",
|
2501 | value: function setValue(value) {
|
2502 | this.control.setValue(Array.isArray(value) ? vue_slider_toConsumableArray(value) : [value]);
|
2503 | this.syncValueByPos();
|
2504 | }
|
2505 | }, {
|
2506 | key: "setIndex",
|
2507 | value: function setIndex(index) {
|
2508 | var _this4 = this;
|
2509 |
|
2510 | var value = Array.isArray(index) ? index.map(function (n) {
|
2511 | return _this4.control.getValueByIndex(n);
|
2512 | }) : this.control.getValueByIndex(index);
|
2513 | this.setValue(value);
|
2514 | }
|
2515 | }, {
|
2516 | key: "setValueByPos",
|
2517 | value: function setValueByPos(pos) {
|
2518 | var _this5 = this;
|
2519 |
|
2520 | var index = this.control.getRecentDot(pos);
|
2521 |
|
2522 | if (this.disabled || this.dots[index].disabled) {
|
2523 | return false;
|
2524 | }
|
2525 |
|
2526 | this.focusDotIndex = index;
|
2527 | this.control.setDotPos(pos, index);
|
2528 | this.syncValueByPos();
|
2529 |
|
2530 | if (this.useKeyboard) {
|
2531 | this.states.add(SliderState.Focus);
|
2532 | }
|
2533 |
|
2534 | setTimeout(function () {
|
2535 | if (_this5.included && _this5.isNotSync) {
|
2536 | _this5.control.setValue(_this5.value);
|
2537 | } else {
|
2538 | _this5.control.syncDotsPos();
|
2539 | }
|
2540 | });
|
2541 | }
|
2542 | }, {
|
2543 | key: "keydownHandle",
|
2544 | value: function keydownHandle(e) {
|
2545 | var _this6 = this;
|
2546 |
|
2547 | if (!this.useKeyboard || !this.states.has(SliderState.Focus)) {
|
2548 | return false;
|
2549 | }
|
2550 |
|
2551 | var isInclude = this.included && this.marks;
|
2552 | var handleFunc = getKeyboardHandleFunc(e, {
|
2553 | direction: this.direction,
|
2554 | max: isInclude ? this.control.markList.length - 1 : this.control.total,
|
2555 | min: 0,
|
2556 | hook: this.keydownHook
|
2557 | });
|
2558 |
|
2559 | if (handleFunc) {
|
2560 | e.preventDefault();
|
2561 | var newIndex = -1;
|
2562 | var pos = 0;
|
2563 |
|
2564 | if (isInclude) {
|
2565 | this.control.markList.some(function (mark, index) {
|
2566 | if (mark.value === _this6.control.dotsValue[_this6.focusDotIndex]) {
|
2567 | newIndex = handleFunc(index);
|
2568 | return true;
|
2569 | }
|
2570 |
|
2571 | return false;
|
2572 | });
|
2573 |
|
2574 | if (newIndex < 0) {
|
2575 | newIndex = 0;
|
2576 | } else if (newIndex > this.control.markList.length - 1) {
|
2577 | newIndex = this.control.markList.length - 1;
|
2578 | }
|
2579 |
|
2580 | pos = this.control.markList[newIndex].pos;
|
2581 | } else {
|
2582 | newIndex = handleFunc(this.control.getIndexByValue(this.control.dotsValue[this.focusDotIndex]));
|
2583 | pos = this.control.parseValue(this.control.getValueByIndex(newIndex));
|
2584 | }
|
2585 |
|
2586 | this.isCrossDot(pos);
|
2587 | this.control.setDotPos(pos, this.focusDotIndex);
|
2588 | this.syncValueByPos();
|
2589 | }
|
2590 | }
|
2591 | }, {
|
2592 | key: "getPosByEvent",
|
2593 | value: function getPosByEvent(e) {
|
2594 | return getPos(e, this.$refs.rail, this.isReverse, this.zoom)[this.isHorizontal ? 'x' : 'y'] / this.scale;
|
2595 | }
|
2596 | }, {
|
2597 | key: "renderSlot",
|
2598 | value: function renderSlot(name, data, defaultSlot, isDefault) {
|
2599 | var h = this.$createElement;
|
2600 | var scopedSlot = this.$scopedSlots[name];
|
2601 | return scopedSlot ? isDefault ? scopedSlot(data) : h("template", {
|
2602 | "slot": name
|
2603 | }, [scopedSlot(data)]) : defaultSlot;
|
2604 | }
|
2605 | }, {
|
2606 | key: "render",
|
2607 | value: function render() {
|
2608 | var _this7 = this;
|
2609 |
|
2610 | var h = arguments[0];
|
2611 | return h("div", helper_default()([{
|
2612 | "ref": "container",
|
2613 | "class": this.containerClasses,
|
2614 | "style": this.containerStyles,
|
2615 | "on": {
|
2616 | "click": this.clickHandle,
|
2617 | "touchstart": this.dragStartOnProcess,
|
2618 | "mousedown": this.dragStartOnProcess
|
2619 | }
|
2620 | }, this.$attrs]), [h("div", {
|
2621 | "ref": "rail",
|
2622 | "class": "vue-slider-rail",
|
2623 | "style": this.railStyle
|
2624 | }, [this.processArray.map(function (item, index) {
|
2625 | return _this7.renderSlot('process', item, h("div", {
|
2626 | "class": "vue-slider-process",
|
2627 | "key": "process-".concat(index),
|
2628 | "style": item.style
|
2629 | }), true);
|
2630 | }), this.sliderMarks ? h("div", {
|
2631 | "class": "vue-slider-marks"
|
2632 | }, [this.control.markList.map(function (mark, index) {
|
2633 | var _style;
|
2634 |
|
2635 | return _this7.renderSlot('mark', mark, h("vue-slider-mark", {
|
2636 | "key": "mark-".concat(index),
|
2637 | "attrs": {
|
2638 | "mark": mark,
|
2639 | "hideLabel": _this7.hideLabel,
|
2640 | "stepStyle": _this7.stepStyle,
|
2641 | "stepActiveStyle": _this7.stepActiveStyle,
|
2642 | "labelStyle": _this7.labelStyle,
|
2643 | "labelActiveStyle": _this7.labelActiveStyle
|
2644 | },
|
2645 | "style": (_style = {}, vue_slider_defineProperty(_style, _this7.isHorizontal ? 'height' : 'width', '100%'), vue_slider_defineProperty(_style, _this7.isHorizontal ? 'width' : 'height', _this7.tailSize), vue_slider_defineProperty(_style, _this7.mainDirection, "".concat(mark.pos, "%")), _style),
|
2646 | "on": {
|
2647 | "pressLabel": function pressLabel(pos) {
|
2648 | return _this7.clickable && _this7.setValueByPos(pos);
|
2649 | }
|
2650 | }
|
2651 | }, [_this7.renderSlot('step', mark, null), _this7.renderSlot('label', mark, null)]), true);
|
2652 | })]) : null, this.dots.map(function (dot, index) {
|
2653 | var _ref;
|
2654 |
|
2655 | return h("vue-slider-dot", {
|
2656 | "ref": "dot-".concat(index),
|
2657 | "key": "dot-".concat(index),
|
2658 | "attrs": vue_slider_objectSpread({
|
2659 | "value": dot.value,
|
2660 | "disabled": dot.disabled,
|
2661 | "focus": dot.focus,
|
2662 | "dot-style": [dot.style, dot.disabled ? dot.disabledStyle : null, dot.focus ? dot.focusStyle : null],
|
2663 | "tooltip": dot.tooltip || _this7.tooltip,
|
2664 | "tooltip-style": [_this7.tooltipStyle, dot.tooltipStyle, dot.disabled ? dot.tooltipDisabledStyle : null, dot.focus ? dot.tooltipFocusStyle : null],
|
2665 | "tooltip-formatter": Array.isArray(_this7.sliderTooltipFormatter) ? _this7.sliderTooltipFormatter[index] : _this7.sliderTooltipFormatter,
|
2666 | "tooltip-placement": _this7.tooltipDirections[index],
|
2667 | "role": "slider",
|
2668 | "aria-valuenow": dot.value,
|
2669 | "aria-valuemin": _this7.min,
|
2670 | "aria-valuemax": _this7.max,
|
2671 | "aria-orientation": _this7.isHorizontal ? 'horizontal' : 'vertical',
|
2672 | "tabindex": "0"
|
2673 | }, _this7.dotAttrs),
|
2674 | "style": [_this7.dotBaseStyle, (_ref = {}, vue_slider_defineProperty(_ref, _this7.mainDirection, "".concat(dot.pos, "%")), vue_slider_defineProperty(_ref, "transition", "".concat(_this7.mainDirection, " ").concat(_this7.animateTime, "s")), _ref)],
|
2675 | "on": {
|
2676 | "drag-start": function dragStart() {
|
2677 | return _this7.dragStart(index);
|
2678 | }
|
2679 | },
|
2680 | "nativeOn": {
|
2681 | "focus": function focus() {
|
2682 | return !dot.disabled && _this7.focus(index);
|
2683 | },
|
2684 | "blur": function blur() {
|
2685 | return _this7.blur();
|
2686 | }
|
2687 | }
|
2688 | }, [_this7.renderSlot('dot', dot, null), _this7.renderSlot('tooltip', dot, null)]);
|
2689 | }), this.renderSlot('default', {
|
2690 | value: this.getValue()
|
2691 | }, null, true)])]);
|
2692 | }
|
2693 | }, {
|
2694 | key: "tailSize",
|
2695 | get: function get() {
|
2696 | return getSize((this.isHorizontal ? this.height : this.width) || DEFAULT_SLIDER_SIZE);
|
2697 | }
|
2698 | }, {
|
2699 | key: "containerClasses",
|
2700 | get: function get() {
|
2701 | return ['vue-slider', ["vue-slider-".concat(this.direction)], {
|
2702 | 'vue-slider-disabled': this.disabled
|
2703 | }];
|
2704 | }
|
2705 | }, {
|
2706 | key: "containerStyles",
|
2707 | get: function get() {
|
2708 | var _ref2 = Array.isArray(this.dotSize) ? this.dotSize : [this.dotSize, this.dotSize],
|
2709 | _ref3 = vue_slider_slicedToArray(_ref2, 2),
|
2710 | dotWidth = _ref3[0],
|
2711 | dotHeight = _ref3[1];
|
2712 |
|
2713 | var containerWidth = this.width ? getSize(this.width) : this.isHorizontal ? 'auto' : getSize(DEFAULT_SLIDER_SIZE);
|
2714 | var containerHeight = this.height ? getSize(this.height) : this.isHorizontal ? getSize(DEFAULT_SLIDER_SIZE) : 'auto';
|
2715 | return {
|
2716 | padding: this.contained ? "".concat(dotHeight / 2, "px ").concat(dotWidth / 2, "px") : this.isHorizontal ? "".concat(dotHeight / 2, "px 0") : "0 ".concat(dotWidth / 2, "px"),
|
2717 | width: containerWidth,
|
2718 | height: containerHeight
|
2719 | };
|
2720 | }
|
2721 | }, {
|
2722 | key: "processArray",
|
2723 | get: function get() {
|
2724 | var _this8 = this;
|
2725 |
|
2726 | return this.control.processArray.map(function (_ref4, index) {
|
2727 | var _objectSpread2;
|
2728 |
|
2729 | var _ref5 = vue_slider_slicedToArray(_ref4, 3),
|
2730 | start = _ref5[0],
|
2731 | end = _ref5[1],
|
2732 | style = _ref5[2];
|
2733 |
|
2734 | if (start > end) {
|
2735 |
|
2736 | ;
|
2737 | var _ref6 = [end, start];
|
2738 | start = _ref6[0];
|
2739 | end = _ref6[1];
|
2740 | }
|
2741 |
|
2742 | var sizeStyleKey = _this8.isHorizontal ? 'width' : 'height';
|
2743 | return {
|
2744 | start: start,
|
2745 | end: end,
|
2746 | index: index,
|
2747 | style: vue_slider_objectSpread(vue_slider_objectSpread((_objectSpread2 = {}, vue_slider_defineProperty(_objectSpread2, _this8.isHorizontal ? 'height' : 'width', '100%'), vue_slider_defineProperty(_objectSpread2, _this8.isHorizontal ? 'top' : 'left', 0), vue_slider_defineProperty(_objectSpread2, _this8.mainDirection, "".concat(start, "%")), vue_slider_defineProperty(_objectSpread2, sizeStyleKey, "".concat(end - start, "%")), vue_slider_defineProperty(_objectSpread2, "transitionProperty", "".concat(sizeStyleKey, ",").concat(_this8.mainDirection)), vue_slider_defineProperty(_objectSpread2, "transitionDuration", "".concat(_this8.animateTime, "s")), _objectSpread2), _this8.processStyle), style)
|
2748 | };
|
2749 | });
|
2750 | }
|
2751 | }, {
|
2752 | key: "dotBaseStyle",
|
2753 | get: function get() {
|
2754 | var _ref7 = Array.isArray(this.dotSize) ? this.dotSize : [this.dotSize, this.dotSize],
|
2755 | _ref8 = vue_slider_slicedToArray(_ref7, 2),
|
2756 | dotWidth = _ref8[0],
|
2757 | dotHeight = _ref8[1];
|
2758 |
|
2759 | var dotPos;
|
2760 |
|
2761 | if (this.isHorizontal) {
|
2762 | dotPos = vue_slider_defineProperty({
|
2763 | transform: "translate(".concat(this.isReverse ? '50%' : '-50%', ", -50%)"),
|
2764 | '-WebkitTransform': "translate(".concat(this.isReverse ? '50%' : '-50%', ", -50%)"),
|
2765 | top: '50%'
|
2766 | }, this.direction === 'ltr' ? 'left' : 'right', '0');
|
2767 | } else {
|
2768 | dotPos = vue_slider_defineProperty({
|
2769 | transform: "translate(-50%, ".concat(this.isReverse ? '50%' : '-50%', ")"),
|
2770 | '-WebkitTransform': "translate(-50%, ".concat(this.isReverse ? '50%' : '-50%', ")"),
|
2771 | left: '50%'
|
2772 | }, this.direction === 'btt' ? 'bottom' : 'top', '0');
|
2773 | }
|
2774 |
|
2775 | return vue_slider_objectSpread({
|
2776 | width: "".concat(dotWidth, "px"),
|
2777 | height: "".concat(dotHeight, "px")
|
2778 | }, dotPos);
|
2779 | }
|
2780 | }, {
|
2781 | key: "mainDirection",
|
2782 | get: function get() {
|
2783 | switch (this.direction) {
|
2784 | case 'ltr':
|
2785 | return 'left';
|
2786 |
|
2787 | case 'rtl':
|
2788 | return 'right';
|
2789 |
|
2790 | case 'btt':
|
2791 | return 'bottom';
|
2792 |
|
2793 | case 'ttb':
|
2794 | return 'top';
|
2795 | }
|
2796 | }
|
2797 | }, {
|
2798 | key: "isHorizontal",
|
2799 | get: function get() {
|
2800 | return this.direction === 'ltr' || this.direction === 'rtl';
|
2801 | }
|
2802 | }, {
|
2803 | key: "isReverse",
|
2804 | get: function get() {
|
2805 | return this.direction === 'rtl' || this.direction === 'btt';
|
2806 | }
|
2807 | }, {
|
2808 | key: "tooltipDirections",
|
2809 | get: function get() {
|
2810 | var dir = this.tooltipPlacement || (this.isHorizontal ? 'top' : 'left');
|
2811 |
|
2812 | if (Array.isArray(dir)) {
|
2813 | return dir;
|
2814 | } else {
|
2815 | return this.dots.map(function () {
|
2816 | return dir;
|
2817 | });
|
2818 | }
|
2819 | }
|
2820 | }, {
|
2821 | key: "dots",
|
2822 | get: function get() {
|
2823 | var _this9 = this;
|
2824 |
|
2825 | return this.control.dotsPos.map(function (pos, index) {
|
2826 | return vue_slider_objectSpread({
|
2827 | pos: pos,
|
2828 | index: index,
|
2829 | value: _this9.control.dotsValue[index],
|
2830 | focus: _this9.states.has(SliderState.Focus) && _this9.focusDotIndex === index,
|
2831 | disabled: _this9.disabled,
|
2832 | style: _this9.dotStyle
|
2833 | }, (Array.isArray(_this9.dotOptions) ? _this9.dotOptions[index] : _this9.dotOptions) || {});
|
2834 | });
|
2835 | }
|
2836 | }, {
|
2837 | key: "animateTime",
|
2838 | get: function get() {
|
2839 | if (this.states.has(SliderState.Drag)) {
|
2840 | return 0;
|
2841 | }
|
2842 |
|
2843 | return this.duration;
|
2844 | }
|
2845 | }, {
|
2846 | key: "canSort",
|
2847 | get: function get() {
|
2848 | return this.order && !this.minRange && !this.maxRange && !this.fixed && this.enableCross;
|
2849 | }
|
2850 | }, {
|
2851 | key: "sliderData",
|
2852 | get: function get() {
|
2853 | var _this10 = this;
|
2854 |
|
2855 | if (this.isObjectArrayData(this.data)) {
|
2856 | return this.data.map(function (obj) {
|
2857 | return obj[_this10.dataValue];
|
2858 | });
|
2859 | } else if (this.isObjectData(this.data)) {
|
2860 | return Object.keys(this.data);
|
2861 | } else {
|
2862 | return this.data;
|
2863 | }
|
2864 | }
|
2865 | }, {
|
2866 | key: "sliderMarks",
|
2867 | get: function get() {
|
2868 | var _this11 = this;
|
2869 |
|
2870 | if (this.marks) {
|
2871 | return this.marks;
|
2872 | } else if (this.isObjectArrayData(this.data)) {
|
2873 | return function (val) {
|
2874 | var mark = {
|
2875 | label: val
|
2876 | };
|
2877 |
|
2878 | _this11.data.some(function (obj) {
|
2879 | if (obj[_this11.dataValue] === val) {
|
2880 | mark.label = obj[_this11.dataLabel];
|
2881 | return true;
|
2882 | }
|
2883 |
|
2884 | return false;
|
2885 | });
|
2886 |
|
2887 | return mark;
|
2888 | };
|
2889 | } else if (this.isObjectData(this.data)) {
|
2890 | return this.data;
|
2891 | }
|
2892 | }
|
2893 | }, {
|
2894 | key: "sliderTooltipFormatter",
|
2895 | get: function get() {
|
2896 | var _this12 = this;
|
2897 |
|
2898 | if (this.tooltipFormatter) {
|
2899 | return this.tooltipFormatter;
|
2900 | } else if (this.isObjectArrayData(this.data)) {
|
2901 | return function (val) {
|
2902 | var tooltipText = '' + val;
|
2903 |
|
2904 | _this12.data.some(function (obj) {
|
2905 | if (obj[_this12.dataValue] === val) {
|
2906 | tooltipText = obj[_this12.dataLabel];
|
2907 | return true;
|
2908 | }
|
2909 |
|
2910 | return false;
|
2911 | });
|
2912 |
|
2913 | return tooltipText;
|
2914 | };
|
2915 | } else if (this.isObjectData(this.data)) {
|
2916 | var data = this.data;
|
2917 | return function (val) {
|
2918 | return data[val];
|
2919 | };
|
2920 | }
|
2921 | }
|
2922 | }, {
|
2923 | key: "isNotSync",
|
2924 | get: function get() {
|
2925 | var values = this.control.dotsValue;
|
2926 | return Array.isArray(this.value) ? this.value.length !== values.length || this.value.some(function (val, index) {
|
2927 | return val !== values[index];
|
2928 | }) : this.value !== values[0];
|
2929 | }
|
2930 | }, {
|
2931 | key: "dragRange",
|
2932 | get: function get() {
|
2933 | var prevDot = this.dots[this.focusDotIndex - 1];
|
2934 | var nextDot = this.dots[this.focusDotIndex + 1];
|
2935 | return [prevDot ? prevDot.pos : -Infinity, nextDot ? nextDot.pos : Infinity];
|
2936 | }
|
2937 | }]);
|
2938 |
|
2939 | return VueSlider;
|
2940 | }(external_commonjs_vue_commonjs2_vue_root_Vue_amd_vue_default.a);
|
2941 |
|
2942 | __decorate([Model('change', {
|
2943 | default: 0
|
2944 | })], VueSlider.prototype, "value", void 0);
|
2945 |
|
2946 | __decorate([Prop({
|
2947 | type: Boolean,
|
2948 | default: false
|
2949 | })], VueSlider.prototype, "silent", void 0);
|
2950 |
|
2951 | __decorate([Prop({
|
2952 | default: 'ltr',
|
2953 | validator: function validator(dir) {
|
2954 | return ['ltr', 'rtl', 'ttb', 'btt'].indexOf(dir) > -1;
|
2955 | }
|
2956 | })], VueSlider.prototype, "direction", void 0);
|
2957 |
|
2958 | __decorate([Prop({
|
2959 | type: [Number, String]
|
2960 | })], VueSlider.prototype, "width", void 0);
|
2961 |
|
2962 | __decorate([Prop({
|
2963 | type: [Number, String]
|
2964 | })], VueSlider.prototype, "height", void 0);
|
2965 |
|
2966 | __decorate([Prop({
|
2967 | default: 14
|
2968 | })], VueSlider.prototype, "dotSize", void 0);
|
2969 |
|
2970 | __decorate([Prop({
|
2971 | default: false
|
2972 | })], VueSlider.prototype, "contained", void 0);
|
2973 |
|
2974 | __decorate([Prop({
|
2975 | type: Number,
|
2976 | default: 0
|
2977 | })], VueSlider.prototype, "min", void 0);
|
2978 |
|
2979 | __decorate([Prop({
|
2980 | type: Number,
|
2981 | default: 100
|
2982 | })], VueSlider.prototype, "max", void 0);
|
2983 |
|
2984 | __decorate([Prop({
|
2985 | type: Number,
|
2986 | default: 1
|
2987 | })], VueSlider.prototype, "interval", void 0);
|
2988 |
|
2989 | __decorate([Prop({
|
2990 | type: Boolean,
|
2991 | default: false
|
2992 | })], VueSlider.prototype, "disabled", void 0);
|
2993 |
|
2994 | __decorate([Prop({
|
2995 | type: Boolean,
|
2996 | default: true
|
2997 | })], VueSlider.prototype, "clickable", void 0);
|
2998 |
|
2999 | __decorate([Prop({
|
3000 | type: Boolean,
|
3001 | default: false
|
3002 | })], VueSlider.prototype, "dragOnClick", void 0);
|
3003 |
|
3004 | __decorate([Prop({
|
3005 | type: Number,
|
3006 | default: 0.5
|
3007 | })], VueSlider.prototype, "duration", void 0);
|
3008 |
|
3009 | __decorate([Prop({
|
3010 | type: [Object, Array]
|
3011 | })], VueSlider.prototype, "data", void 0);
|
3012 |
|
3013 | __decorate([Prop({
|
3014 | type: String,
|
3015 | default: 'value'
|
3016 | })], VueSlider.prototype, "dataValue", void 0);
|
3017 |
|
3018 | __decorate([Prop({
|
3019 | type: String,
|
3020 | default: 'label'
|
3021 | })], VueSlider.prototype, "dataLabel", void 0);
|
3022 |
|
3023 | __decorate([Prop({
|
3024 | type: Boolean,
|
3025 | default: false
|
3026 | })], VueSlider.prototype, "lazy", void 0);
|
3027 |
|
3028 | __decorate([Prop({
|
3029 | type: String,
|
3030 | validator: function validator(val) {
|
3031 | return ['none', 'always', 'focus', 'hover', 'active'].indexOf(val) > -1;
|
3032 | },
|
3033 | default: 'active'
|
3034 | })], VueSlider.prototype, "tooltip", void 0);
|
3035 |
|
3036 | __decorate([Prop({
|
3037 | type: [String, Array],
|
3038 | validator: function validator(data) {
|
3039 | return (Array.isArray(data) ? data : [data]).every(function (val) {
|
3040 | return ['top', 'right', 'bottom', 'left'].indexOf(val) > -1;
|
3041 | });
|
3042 | }
|
3043 | })], VueSlider.prototype, "tooltipPlacement", void 0);
|
3044 |
|
3045 | __decorate([Prop({
|
3046 | type: [String, Array, Function]
|
3047 | })], VueSlider.prototype, "tooltipFormatter", void 0);
|
3048 |
|
3049 | __decorate([Prop({
|
3050 | type: Boolean,
|
3051 | default: true
|
3052 | })], VueSlider.prototype, "useKeyboard", void 0);
|
3053 |
|
3054 | __decorate([Prop(Function)], VueSlider.prototype, "keydownHook", void 0);
|
3055 |
|
3056 | __decorate([Prop({
|
3057 | type: Boolean,
|
3058 | default: true
|
3059 | })], VueSlider.prototype, "enableCross", void 0);
|
3060 |
|
3061 | __decorate([Prop({
|
3062 | type: Boolean,
|
3063 | default: false
|
3064 | })], VueSlider.prototype, "fixed", void 0);
|
3065 |
|
3066 | __decorate([Prop({
|
3067 | type: Boolean,
|
3068 | default: true
|
3069 | })], VueSlider.prototype, "order", void 0);
|
3070 |
|
3071 | __decorate([Prop(Number)], VueSlider.prototype, "minRange", void 0);
|
3072 |
|
3073 | __decorate([Prop(Number)], VueSlider.prototype, "maxRange", void 0);
|
3074 |
|
3075 | __decorate([Prop({
|
3076 | type: [Boolean, Object, Array, Function],
|
3077 | default: false
|
3078 | })], VueSlider.prototype, "marks", void 0);
|
3079 |
|
3080 | __decorate([Prop({
|
3081 | type: [Boolean, Function],
|
3082 | default: true
|
3083 | })], VueSlider.prototype, "process", void 0);
|
3084 |
|
3085 | __decorate([Prop({
|
3086 | type: [Number]
|
3087 | })], VueSlider.prototype, "zoom", void 0);
|
3088 |
|
3089 | __decorate([Prop(Boolean)], VueSlider.prototype, "included", void 0);
|
3090 |
|
3091 | __decorate([Prop(Boolean)], VueSlider.prototype, "adsorb", void 0);
|
3092 |
|
3093 | __decorate([Prop(Boolean)], VueSlider.prototype, "hideLabel", void 0);
|
3094 |
|
3095 | __decorate([Prop()], VueSlider.prototype, "dotOptions", void 0);
|
3096 |
|
3097 | __decorate([Prop()], VueSlider.prototype, "dotAttrs", void 0);
|
3098 |
|
3099 | __decorate([Prop()], VueSlider.prototype, "railStyle", void 0);
|
3100 |
|
3101 | __decorate([Prop()], VueSlider.prototype, "processStyle", void 0);
|
3102 |
|
3103 | __decorate([Prop()], VueSlider.prototype, "dotStyle", void 0);
|
3104 |
|
3105 | __decorate([Prop()], VueSlider.prototype, "tooltipStyle", void 0);
|
3106 |
|
3107 | __decorate([Prop()], VueSlider.prototype, "stepStyle", void 0);
|
3108 |
|
3109 | __decorate([Prop()], VueSlider.prototype, "stepActiveStyle", void 0);
|
3110 |
|
3111 | __decorate([Prop()], VueSlider.prototype, "labelStyle", void 0);
|
3112 |
|
3113 | __decorate([Prop()], VueSlider.prototype, "labelActiveStyle", void 0);
|
3114 |
|
3115 | __decorate([Watch('value')], VueSlider.prototype, "onValueChanged", null);
|
3116 |
|
3117 | VueSlider = __decorate([vue_class_component_common_default()({
|
3118 | name: 'VueSlider',
|
3119 | data: function data() {
|
3120 | return {
|
3121 | control: null
|
3122 | };
|
3123 | },
|
3124 | components: {
|
3125 | VueSliderDot: vue_slider_dot,
|
3126 | VueSliderMark: vue_slider_mark
|
3127 | }
|
3128 | })], VueSlider);
|
3129 | return VueSlider;
|
3130 | }();
|
3131 |
|
3132 | var vue_slider = (vue_slider_VueSlider);
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 | vue_slider.VueSliderMark = vue_slider_mark;
|
3140 | vue_slider.VueSliderDot = vue_slider_dot;
|
3141 | var lib = (vue_slider);
|
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 | var entry_lib = __webpack_exports__["default"] = (lib);
|
3147 |
|
3148 |
|
3149 |
|
3150 | })
|
3151 |
|
3152 | })["default"];
|
3153 | });
|
3154 |
|
\ | No newline at end of file |