ai.touchui-vue 1.33.3 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/affix.js +2 -2
- package/lib/ai.touchui-vue.common.js +896 -909
- package/lib/align.js +2 -2
- package/lib/animation.js +2 -2
- package/lib/article.js +2 -2
- package/lib/box.js +2 -2
- package/lib/button.js +2 -2
- package/lib/calendar.js +2 -2
- package/lib/card-item.js +19 -19
- package/lib/card.js +178 -178
- package/lib/cascader.js +2 -2
- package/lib/center-scroll.js +2 -2
- package/lib/chat.js +4 -4
- package/lib/checkbox.js +11 -5
- package/lib/checkboxes.js +27 -5
- package/lib/collapse.js +768 -768
- package/lib/color.js +2 -2
- package/lib/countdown.js +2 -2
- package/lib/date-picker.js +1486 -1486
- package/lib/date-range.js +2 -2
- package/lib/dialog.js +27 -23
- package/lib/dis.js +2 -2
- package/lib/ellipsis.js +2 -2
- package/lib/emote.js +2 -2
- package/lib/export.js +10 -10
- package/lib/filter.js +2 -2
- package/lib/fix.js +2 -2
- package/lib/float.js +2 -2
- package/lib/flow.js +4 -4
- package/lib/form.js +2 -2
- package/lib/grid.js +2 -2
- package/lib/guider.js +2 -2
- package/lib/header.js +2 -2
- package/lib/hide.js +2 -2
- package/lib/icon.js +2 -2
- package/lib/import.js +12 -12
- package/lib/index.js +1 -1
- package/lib/input.js +2 -2
- package/lib/ip.js +2 -2
- package/lib/line.js +2 -2
- package/lib/loading.js +11 -11
- package/lib/longtap.js +2 -2
- package/lib/menu-icon.js +670 -673
- package/lib/message.js +2 -2
- package/lib/msg.js +19 -19
- package/lib/org.js +706 -706
- package/lib/padding.js +2 -2
- package/lib/page.js +4 -438
- package/lib/param.js +2 -2
- package/lib/pic.js +4 -4
- package/lib/popup.js +2 -2
- package/lib/progress.js +2 -2
- package/lib/range.js +1074 -1074
- package/lib/rate.js +2 -2
- package/lib/reverser.js +2 -2
- package/lib/scroll.js +2 -2
- package/lib/segment.js +2 -2
- package/lib/select.js +2 -2
- package/lib/size.js +2 -2
- package/lib/skeleton.js +2 -2
- package/lib/slide.js +2 -2
- package/lib/space.js +2 -2
- package/lib/step.js +2 -2
- package/lib/submit.js +2 -2
- package/lib/switch.js +2 -2
- package/lib/tab.js +2 -2
- package/lib/table.js +2 -2
- package/lib/tag.js +2 -2
- package/lib/theme/css/theme/workbench-gz.css +1 -0
- package/lib/timeline.js +2 -2
- package/lib/tip.js +2 -2
- package/lib/tooltip.js +2 -2
- package/lib/transfer.js +2 -2
- package/lib/tree.js +2 -2
- package/lib/upload.js +14 -14
- package/package.json +1 -1
- package/packages/checkbox/src/checkbox.vue +8 -2
- package/packages/checkboxes/src/checkboxes.vue +17 -1
- package/packages/dialog/src/dialog.vue +21 -18
- package/packages/page/src/page.vue +0 -22
- package/packages/tab/.DS_Store +0 -0
- package/packages/theme/lib/css/theme/workbench-gz.css +1 -0
- package/packages/theme/src/less/theme/workbench-gz.less +159 -0
- package/src/index.js +1 -1
package/lib/range.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 359);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -192,941 +192,64 @@ function normalizeComponent(
|
|
|
192
192
|
|
|
193
193
|
/***/ }),
|
|
194
194
|
|
|
195
|
-
/***/
|
|
195
|
+
/***/ 11:
|
|
196
196
|
/***/ (function(module, exports, __webpack_require__) {
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
"use strict";
|
|
199
199
|
|
|
200
|
-
if (typeof content === 'string') {
|
|
201
|
-
content = [[module.i, content, '']];
|
|
202
|
-
}
|
|
203
200
|
|
|
204
|
-
|
|
201
|
+
/*
|
|
202
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
203
|
+
Author Tobias Koppers @sokra
|
|
204
|
+
*/
|
|
205
|
+
// css base code, injected by the css-loader
|
|
206
|
+
// eslint-disable-next-line func-names
|
|
207
|
+
module.exports = function (useSourceMap) {
|
|
208
|
+
var list = []; // return the list of modules as css string
|
|
205
209
|
|
|
206
|
-
|
|
207
|
-
|
|
210
|
+
list.toString = function toString() {
|
|
211
|
+
return this.map(function (item) {
|
|
212
|
+
var content = cssWithMappingToString(item, useSourceMap);
|
|
208
213
|
|
|
209
|
-
|
|
214
|
+
if (item[2]) {
|
|
215
|
+
return "@media ".concat(item[2], "{").concat(content, "}");
|
|
216
|
+
}
|
|
210
217
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
218
|
+
return content;
|
|
219
|
+
}).join('');
|
|
220
|
+
}; // import a list of modules into the list
|
|
221
|
+
// eslint-disable-next-line func-names
|
|
214
222
|
|
|
215
223
|
|
|
216
|
-
|
|
224
|
+
list.i = function (modules, mediaQuery) {
|
|
225
|
+
if (typeof modules === 'string') {
|
|
226
|
+
// eslint-disable-next-line no-param-reassign
|
|
227
|
+
modules = [[null, modules, '']];
|
|
228
|
+
}
|
|
217
229
|
|
|
218
|
-
|
|
219
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
230
|
+
var alreadyImportedModules = {};
|
|
220
231
|
|
|
221
|
-
|
|
222
|
-
//
|
|
223
|
-
|
|
232
|
+
for (var i = 0; i < this.length; i++) {
|
|
233
|
+
// eslint-disable-next-line prefer-destructuring
|
|
234
|
+
var id = this[i][0];
|
|
224
235
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
var _c = _vm._self._c || _h
|
|
230
|
-
return _c(
|
|
231
|
-
"span",
|
|
232
|
-
{
|
|
233
|
-
staticClass: "to-range to-form-readonly",
|
|
234
|
-
style: _vm.setStyle,
|
|
235
|
-
on: {
|
|
236
|
-
touchmove: function ($event) {
|
|
237
|
-
return _vm.moveHandle($event)
|
|
238
|
-
},
|
|
239
|
-
touchend: function ($event) {
|
|
240
|
-
return _vm.endHandle($event)
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
[
|
|
245
|
-
_c("span", { staticClass: "to-rangeMain" }, [
|
|
246
|
-
_c(
|
|
247
|
-
"span",
|
|
248
|
-
{
|
|
249
|
-
staticClass: "to-rangeBar",
|
|
250
|
-
on: {
|
|
251
|
-
click: function ($event) {
|
|
252
|
-
$event.stopPropagation()
|
|
253
|
-
return _vm.rangeBarClick($event)
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
[
|
|
258
|
-
_c(
|
|
259
|
-
"span",
|
|
260
|
-
{
|
|
261
|
-
staticClass: "to-rangeProgress",
|
|
262
|
-
style: {
|
|
263
|
-
width: _vm.rangeProgress - _vm.startProgress + "%",
|
|
264
|
-
left: _vm.startProgress + "%",
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
[
|
|
268
|
-
_vm.start
|
|
269
|
-
? _c("span", {
|
|
270
|
-
ref: "touchStartBar",
|
|
271
|
-
staticClass: "to-rangeStart",
|
|
272
|
-
style: {
|
|
273
|
-
zIndex:
|
|
274
|
-
String(_vm.startProgress) === "100" ? "100" : "99",
|
|
275
|
-
},
|
|
276
|
-
on: {
|
|
277
|
-
mousedown: _vm.onStartButtonDown,
|
|
278
|
-
touchstart: function ($event) {
|
|
279
|
-
return _vm.startHandle($event)
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
})
|
|
283
|
-
: _vm._e(),
|
|
284
|
-
_c("span", {
|
|
285
|
-
ref: "touchBar",
|
|
286
|
-
staticClass: "to-rangeEnd",
|
|
287
|
-
on: {
|
|
288
|
-
mousedown: _vm.onButtonDown,
|
|
289
|
-
touchstart: function ($event) {
|
|
290
|
-
return _vm.endStartHandle($event)
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
}),
|
|
294
|
-
]
|
|
295
|
-
),
|
|
296
|
-
]
|
|
297
|
-
),
|
|
298
|
-
_vm.showInput
|
|
299
|
-
? _c(
|
|
300
|
-
"span",
|
|
301
|
-
{ staticClass: "to-rangeValue" },
|
|
302
|
-
[
|
|
303
|
-
_vm.start
|
|
304
|
-
? _c(
|
|
305
|
-
"span",
|
|
306
|
-
{ staticClass: "to-input", class: _vm.setClass },
|
|
307
|
-
[
|
|
308
|
-
_c(
|
|
309
|
-
"to-input",
|
|
310
|
-
_vm._b(
|
|
311
|
-
{
|
|
312
|
-
ref: "rangeStartInput",
|
|
313
|
-
attrs: {
|
|
314
|
-
type: "number",
|
|
315
|
-
mode: "none",
|
|
316
|
-
min: _vm.min,
|
|
317
|
-
max: _vm.max,
|
|
318
|
-
clearable: false,
|
|
319
|
-
width: 6,
|
|
320
|
-
readonly: _vm.disabled || !_vm.inputable,
|
|
321
|
-
},
|
|
322
|
-
on: { blur: _vm.inputStartHandle },
|
|
323
|
-
model: {
|
|
324
|
-
value: _vm.refStartVal,
|
|
325
|
-
callback: function ($$v) {
|
|
326
|
-
_vm.refStartVal = $$v
|
|
327
|
-
},
|
|
328
|
-
expression: "refStartVal",
|
|
329
|
-
},
|
|
330
|
-
},
|
|
331
|
-
"to-input",
|
|
332
|
-
_vm.inputProps,
|
|
333
|
-
false
|
|
334
|
-
)
|
|
335
|
-
),
|
|
336
|
-
_c(
|
|
337
|
-
"span",
|
|
338
|
-
{ staticClass: "to-inputText to-inputText-narrow" },
|
|
339
|
-
[_vm._v("~")]
|
|
340
|
-
),
|
|
341
|
-
_c(
|
|
342
|
-
"to-input",
|
|
343
|
-
_vm._b(
|
|
344
|
-
{
|
|
345
|
-
ref: "rangeEndInput",
|
|
346
|
-
attrs: {
|
|
347
|
-
type: "number",
|
|
348
|
-
mode: "none",
|
|
349
|
-
min: _vm.min,
|
|
350
|
-
max: _vm.max,
|
|
351
|
-
clearable: false,
|
|
352
|
-
width: 6,
|
|
353
|
-
readonly: _vm.disabled || !_vm.inputable,
|
|
354
|
-
},
|
|
355
|
-
on: { blur: _vm.inputEndHandle },
|
|
356
|
-
model: {
|
|
357
|
-
value: _vm.refEndVal,
|
|
358
|
-
callback: function ($$v) {
|
|
359
|
-
_vm.refEndVal = $$v
|
|
360
|
-
},
|
|
361
|
-
expression: "refEndVal",
|
|
362
|
-
},
|
|
363
|
-
},
|
|
364
|
-
"to-input",
|
|
365
|
-
_vm.inputProps,
|
|
366
|
-
false
|
|
367
|
-
)
|
|
368
|
-
),
|
|
369
|
-
],
|
|
370
|
-
1
|
|
371
|
-
)
|
|
372
|
-
: _c(
|
|
373
|
-
"to-input",
|
|
374
|
-
_vm._b(
|
|
375
|
-
{
|
|
376
|
-
ref: "rangeInput",
|
|
377
|
-
attrs: {
|
|
378
|
-
type: "number",
|
|
379
|
-
min: _vm.min,
|
|
380
|
-
max: _vm.max,
|
|
381
|
-
clearable: false,
|
|
382
|
-
width: 6,
|
|
383
|
-
readonly: _vm.disabled || !_vm.inputable,
|
|
384
|
-
},
|
|
385
|
-
on: { blur: _vm.inputHandle },
|
|
386
|
-
model: {
|
|
387
|
-
value: _vm.refVal,
|
|
388
|
-
callback: function ($$v) {
|
|
389
|
-
_vm.refVal = $$v
|
|
390
|
-
},
|
|
391
|
-
expression: "refVal",
|
|
392
|
-
},
|
|
393
|
-
},
|
|
394
|
-
"to-input",
|
|
395
|
-
_vm.inputProps,
|
|
396
|
-
false
|
|
397
|
-
)
|
|
398
|
-
),
|
|
399
|
-
],
|
|
400
|
-
1
|
|
401
|
-
)
|
|
402
|
-
: _vm._e(),
|
|
403
|
-
]),
|
|
404
|
-
]
|
|
405
|
-
)
|
|
406
|
-
}
|
|
407
|
-
var staticRenderFns = []
|
|
408
|
-
render._withStripped = true
|
|
236
|
+
if (id != null) {
|
|
237
|
+
alreadyImportedModules[id] = true;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
409
240
|
|
|
241
|
+
for (var _i = 0; _i < modules.length; _i++) {
|
|
242
|
+
var item = modules[_i]; // skip already imported module
|
|
243
|
+
// this implementation is not 100% perfect for weird media query combinations
|
|
244
|
+
// when a module is imported multiple times with different media queries.
|
|
245
|
+
// I hope this will never occur (Hey this way we have smaller bundles)
|
|
410
246
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
//
|
|
420
|
-
//
|
|
421
|
-
//
|
|
422
|
-
//
|
|
423
|
-
//
|
|
424
|
-
//
|
|
425
|
-
//
|
|
426
|
-
//
|
|
427
|
-
//
|
|
428
|
-
//
|
|
429
|
-
//
|
|
430
|
-
//
|
|
431
|
-
//
|
|
432
|
-
//
|
|
433
|
-
//
|
|
434
|
-
//
|
|
435
|
-
|
|
436
|
-
/* harmony default export */ var rangevue_type_script_lang_js = ({
|
|
437
|
-
name: 'ToRange',
|
|
438
|
-
componentName: 'ToRange',
|
|
439
|
-
model: {
|
|
440
|
-
event: 'change'
|
|
441
|
-
},
|
|
442
|
-
props: {
|
|
443
|
-
value: {
|
|
444
|
-
type: [Number, String],
|
|
445
|
-
default: 0
|
|
446
|
-
},
|
|
447
|
-
readonly: {
|
|
448
|
-
type: Boolean,
|
|
449
|
-
default: false
|
|
450
|
-
},
|
|
451
|
-
inputable: {
|
|
452
|
-
type: Boolean,
|
|
453
|
-
default: true
|
|
454
|
-
},
|
|
455
|
-
max: {
|
|
456
|
-
type: [Number, String],
|
|
457
|
-
default: 100
|
|
458
|
-
},
|
|
459
|
-
min: {
|
|
460
|
-
type: [Number, String],
|
|
461
|
-
default: 0
|
|
462
|
-
},
|
|
463
|
-
ruler: {
|
|
464
|
-
type: Boolean,
|
|
465
|
-
default: false
|
|
466
|
-
},
|
|
467
|
-
start: {
|
|
468
|
-
type: Boolean,
|
|
469
|
-
default: false
|
|
470
|
-
},
|
|
471
|
-
step: {
|
|
472
|
-
type: [String, Number],
|
|
473
|
-
default: 1
|
|
474
|
-
},
|
|
475
|
-
width: {
|
|
476
|
-
type: [Number, String],
|
|
477
|
-
default: ''
|
|
478
|
-
},
|
|
479
|
-
valueWidth: {
|
|
480
|
-
type: [Number, String],
|
|
481
|
-
default: 0
|
|
482
|
-
},
|
|
483
|
-
showInput: Boolean,
|
|
484
|
-
inputProps: {
|
|
485
|
-
type: Object,
|
|
486
|
-
default: function _default() {
|
|
487
|
-
return {};
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
data: function data() {
|
|
492
|
-
return {
|
|
493
|
-
disabled: this.readonly,
|
|
494
|
-
length: 0,
|
|
495
|
-
isStart: false,
|
|
496
|
-
progress: 0,
|
|
497
|
-
sProgress: 0,
|
|
498
|
-
dragging: true,
|
|
499
|
-
startX: 0,
|
|
500
|
-
endStartX: 0,
|
|
501
|
-
startMoveX: 0,
|
|
502
|
-
startPosition: 0,
|
|
503
|
-
currentX: 0,
|
|
504
|
-
moveX: 0,
|
|
505
|
-
endX: 0,
|
|
506
|
-
x: 0,
|
|
507
|
-
sx: 0,
|
|
508
|
-
isStartMove: 'start',
|
|
509
|
-
rangeProgress: 0,
|
|
510
|
-
sStartMoveX: 0,
|
|
511
|
-
sStartPosition: 0,
|
|
512
|
-
startProgress: 0,
|
|
513
|
-
startValue: 0
|
|
514
|
-
};
|
|
515
|
-
},
|
|
516
|
-
|
|
517
|
-
computed: {
|
|
518
|
-
val: {
|
|
519
|
-
get: function get() {
|
|
520
|
-
return Math.round(this.progress / this.range * this.range) || 0;
|
|
521
|
-
},
|
|
522
|
-
set: function set(newVal) {
|
|
523
|
-
this.progress = newVal;
|
|
524
|
-
this.x = this.length.offsetWidth * this.progress / this.range;
|
|
525
|
-
}
|
|
526
|
-
},
|
|
527
|
-
startVal: {
|
|
528
|
-
get: function get() {
|
|
529
|
-
return Math.round(this.sProgress / this.range * this.range) || 0;
|
|
530
|
-
},
|
|
531
|
-
set: function set(newVal) {
|
|
532
|
-
this.sProgress = newVal;
|
|
533
|
-
this.sx = this.length.offsetWidth * this.sProgress / this.range;
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
refVal: {
|
|
537
|
-
get: function get() {
|
|
538
|
-
if (this.start) {
|
|
539
|
-
return this.startVal + this.min + ',' + (this.val + this.min);
|
|
540
|
-
} else {
|
|
541
|
-
return this.val + this.min;
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
set: function set(newVal) {}
|
|
545
|
-
},
|
|
546
|
-
refStartVal: {
|
|
547
|
-
get: function get() {
|
|
548
|
-
if (this.start) {
|
|
549
|
-
return this.startVal + this.min;
|
|
550
|
-
} else {
|
|
551
|
-
return this.val + this.min;
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
set: function set(newVal) {}
|
|
555
|
-
},
|
|
556
|
-
refEndVal: {
|
|
557
|
-
get: function get() {
|
|
558
|
-
if (this.start) {
|
|
559
|
-
return this.val + this.min;
|
|
560
|
-
} else {
|
|
561
|
-
return this.val + this.min;
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
set: function set(newVal) {}
|
|
565
|
-
},
|
|
566
|
-
rangeValue: {
|
|
567
|
-
get: function get() {
|
|
568
|
-
if (this.start) {
|
|
569
|
-
return (this.sProgress || 0).toFixed(0) + ',' + (this.progress || 0).toFixed(0);
|
|
570
|
-
} else {
|
|
571
|
-
return (this.progress || 0).toFixed(0);
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
set: function set(newVal) {}
|
|
575
|
-
},
|
|
576
|
-
range: function range() {
|
|
577
|
-
return Number(this.max) - Number(this.min);
|
|
578
|
-
},
|
|
579
|
-
part: function part() {
|
|
580
|
-
return 100 / this.range;
|
|
581
|
-
},
|
|
582
|
-
setStyle: function setStyle() {
|
|
583
|
-
var obj = {};
|
|
584
|
-
if (this.width) {
|
|
585
|
-
if (!isNaN(this.width)) {
|
|
586
|
-
obj.width = this.width + 'em';
|
|
587
|
-
} else if (this.width === 'full') {
|
|
588
|
-
obj.width = '100%';
|
|
589
|
-
} else {
|
|
590
|
-
obj.width = this.width;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
return obj;
|
|
594
|
-
},
|
|
595
|
-
setClass: function setClass() {
|
|
596
|
-
var arr = [];
|
|
597
|
-
if (this.inputProps.color) {
|
|
598
|
-
if (this.inputProps.color !== 'radam') {
|
|
599
|
-
arr.push('to-input-color-' + this.inputProps.color);
|
|
600
|
-
} else {
|
|
601
|
-
var colors = this.inputProps.$TouchUI.colors;
|
|
602
|
-
var number = Math.round(Math.random() * 6);
|
|
603
|
-
arr.push('to-input-color-' + colors[number]);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
if (this.inputProps.placeholderColor) {
|
|
607
|
-
arr.push('to-input-placeholder-color-' + this.inputProps.placeholderColor);
|
|
608
|
-
}
|
|
609
|
-
if (this.inputProps.fillet !== 'none') {
|
|
610
|
-
arr.push('to-input-fillet-' + this.inputProps.fillet);
|
|
611
|
-
}
|
|
612
|
-
if (this.inputProps.filletPosition) {
|
|
613
|
-
arr.push('to-input-fillet-position-' + this.filletPosition);
|
|
614
|
-
}
|
|
615
|
-
if (this.inputProps.mode) {
|
|
616
|
-
arr.push('to-input-mode-' + this.inputProps.mode);
|
|
617
|
-
} else if (this.ToForm && this.ToForm.type === 'list') {
|
|
618
|
-
arr.push('to-input-mode-none');
|
|
619
|
-
} else {
|
|
620
|
-
arr.push('to-input-mode-default');
|
|
621
|
-
}
|
|
622
|
-
if (this.inputProps.stepIconMode === 'arrow') {
|
|
623
|
-
arr.push('to-input-step-icon-mode-' + this.inputProps.stepIconMode);
|
|
624
|
-
}
|
|
625
|
-
if (this.inputProps.readonly) {
|
|
626
|
-
arr.push('to-input-state-readonly');
|
|
627
|
-
}
|
|
628
|
-
if (this.inputProps.focused && !this.inputProps.preventFocus) {
|
|
629
|
-
arr.push('to-input-state-focus');
|
|
630
|
-
}
|
|
631
|
-
if (this.inputProps.changed) {
|
|
632
|
-
arr.push('to-input-changed');
|
|
633
|
-
}
|
|
634
|
-
if (this.ToForm && this.ToForm.comparable || this.inputProps.comparable) {
|
|
635
|
-
arr.push('to-compare');
|
|
636
|
-
}
|
|
637
|
-
return arr;
|
|
638
|
-
}
|
|
639
|
-
},
|
|
640
|
-
watch: {
|
|
641
|
-
readonly: function readonly(val) {
|
|
642
|
-
this.disabled = val;
|
|
643
|
-
},
|
|
644
|
-
value: function value(val) {
|
|
645
|
-
if (this.start) {
|
|
646
|
-
if (val && String(val).split(',').length > 1) {
|
|
647
|
-
var value = val.split(',');
|
|
648
|
-
if (Number(value[0]) >= this.range) {
|
|
649
|
-
this.startVal = this.range;
|
|
650
|
-
} else {
|
|
651
|
-
this.startVal = Number(value[0]);
|
|
652
|
-
}
|
|
653
|
-
if (Number(value[1]) >= this.range) {
|
|
654
|
-
this.val = this.range;
|
|
655
|
-
} else {
|
|
656
|
-
this.val = Number(value[1]);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
} else {
|
|
660
|
-
if (Number(val) >= this.range) {
|
|
661
|
-
this.val = this.range;
|
|
662
|
-
} else {
|
|
663
|
-
this.val = Number(val);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
this.initRangeVal();
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
mounted: function mounted() {
|
|
670
|
-
var _this = this;
|
|
671
|
-
|
|
672
|
-
// 这里注意range的value改变不会触发视图刷新
|
|
673
|
-
this.$nextTick(function () {
|
|
674
|
-
_this.length = _this.$el.querySelector('.to-rangeBar');
|
|
675
|
-
_this.initRangeVal();
|
|
676
|
-
});
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
methods: {
|
|
680
|
-
initRangeVal: function initRangeVal() {
|
|
681
|
-
if (this.start) {
|
|
682
|
-
if (this.value) {
|
|
683
|
-
var value = this.value.split(',');
|
|
684
|
-
this.startVal = Number(value[0]) < 0 ? 0 : Number(value[0]) / this.range * this.range - this.min || 0;
|
|
685
|
-
this.val = Number(value[1]) < 0 ? 0 : Number(value[1]) / this.range * this.range - this.min || 0;
|
|
686
|
-
} else {
|
|
687
|
-
this.startVal = 0;
|
|
688
|
-
this.val = 0;
|
|
689
|
-
}
|
|
690
|
-
this.startProgress = this.startVal / this.range * 100;
|
|
691
|
-
this.rangeProgress = this.val / this.range * 100;
|
|
692
|
-
} else {
|
|
693
|
-
this.val = Number(this.value) < 0 ? 0 : Number(this.value) / this.range * this.range - this.min || 0;
|
|
694
|
-
this.rangeProgress = this.val / this.range * 100;
|
|
695
|
-
}
|
|
696
|
-
},
|
|
697
|
-
rangeBarClick: function rangeBarClick(e) {
|
|
698
|
-
if (this.disabled) return;
|
|
699
|
-
if (this.dragging) {
|
|
700
|
-
var leftX = e.offsetX;
|
|
701
|
-
this.x = e.clientX - leftX;
|
|
702
|
-
if (this.start) {
|
|
703
|
-
var startLeft = this.startProgress / this.range * this.length.offsetWidth;
|
|
704
|
-
var endLeft = this.rangeProgress / this.range * this.length.offsetWidth;
|
|
705
|
-
var startLeftAbs = Math.abs(startLeft - leftX);
|
|
706
|
-
var endLeftAbs = Math.abs(endLeft - leftX);
|
|
707
|
-
if (startLeftAbs >= endLeftAbs) {
|
|
708
|
-
this.progress = leftX / this.length.offsetWidth * this.range;
|
|
709
|
-
this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress;
|
|
710
|
-
if (this.progress <= 0) {
|
|
711
|
-
this.progress = 0;
|
|
712
|
-
} else if (this.progress >= this.max) {
|
|
713
|
-
this.progress = this.max;
|
|
714
|
-
}
|
|
715
|
-
var progress = this.val / this.range * 100;
|
|
716
|
-
if (progress < 0) {
|
|
717
|
-
progress = 0;
|
|
718
|
-
} else if (progress > 100) {
|
|
719
|
-
progress = 100;
|
|
720
|
-
}
|
|
721
|
-
this.rangeProgress = progress;
|
|
722
|
-
} else {
|
|
723
|
-
this.sProgress = leftX / this.length.offsetWidth * this.range;
|
|
724
|
-
this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress;
|
|
725
|
-
if (this.sProgress <= 0) {
|
|
726
|
-
this.sProgress = 0;
|
|
727
|
-
} else if (this.sProgress >= this.max) {
|
|
728
|
-
this.sProgress = this.max;
|
|
729
|
-
}
|
|
730
|
-
var _progress = this.startVal / this.range * 100;
|
|
731
|
-
if (_progress < 0) {
|
|
732
|
-
_progress = 0;
|
|
733
|
-
} else if (_progress > 100) {
|
|
734
|
-
_progress = 100;
|
|
735
|
-
}
|
|
736
|
-
this.startProgress = _progress;
|
|
737
|
-
}
|
|
738
|
-
} else {
|
|
739
|
-
this.progress = leftX / this.length.offsetWidth * this.range;
|
|
740
|
-
this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress;
|
|
741
|
-
if (this.progress <= 0) {
|
|
742
|
-
this.progress = 0;
|
|
743
|
-
} else if (this.progress >= this.max) {
|
|
744
|
-
this.progress = this.max;
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
this.$emit('change', this.rangeValue);
|
|
748
|
-
}
|
|
749
|
-
},
|
|
750
|
-
|
|
751
|
-
startHandle: function startHandle(e) {
|
|
752
|
-
if (this.disabled) return;
|
|
753
|
-
this.isStart = true;
|
|
754
|
-
this.isStartMove = 'start';
|
|
755
|
-
if (this.isStart) {
|
|
756
|
-
this.startX = e.touches[0].clientX;
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
|
-
endStartHandle: function endStartHandle(e) {
|
|
760
|
-
if (this.disabled) return;
|
|
761
|
-
this.isStart = true;
|
|
762
|
-
this.isStartMove = 'end';
|
|
763
|
-
if (this.isStart) {
|
|
764
|
-
this.endStartX = e.touches[0].clientX;
|
|
765
|
-
}
|
|
766
|
-
},
|
|
767
|
-
moveHandle: function moveHandle(e) {
|
|
768
|
-
if (this.disabled) return;
|
|
769
|
-
if (this.isStart) {
|
|
770
|
-
this.moveX = e.touches[0].clientX;
|
|
771
|
-
if (this.isStartMove === 'end') {
|
|
772
|
-
this.progress = (this.x + this.moveX - this.endStartX) / this.length.offsetWidth * this.range;
|
|
773
|
-
if (this.progress <= 0) {
|
|
774
|
-
this.progress = 0;
|
|
775
|
-
} else if (this.progress >= this.range) {
|
|
776
|
-
this.progress = this.range;
|
|
777
|
-
}
|
|
778
|
-
var progress = this.progress / this.range * 100;
|
|
779
|
-
if (progress < 0) {
|
|
780
|
-
progress = 0;
|
|
781
|
-
} else if (progress > 100) {
|
|
782
|
-
progress = 100;
|
|
783
|
-
}
|
|
784
|
-
this.rangeProgress = progress;
|
|
785
|
-
} else if (this.isStartMove === 'start') {
|
|
786
|
-
this.sProgress = (this.sx + this.moveX - this.startX) / this.length.offsetWidth * this.range;
|
|
787
|
-
if (this.sProgress <= 0) {
|
|
788
|
-
this.sProgress = 0;
|
|
789
|
-
} else if (this.sProgress >= this.range) {
|
|
790
|
-
this.sProgress = this.range;
|
|
791
|
-
}
|
|
792
|
-
var _progress2 = this.sProgress / this.range * 100;
|
|
793
|
-
if (_progress2 < 0) {
|
|
794
|
-
_progress2 = 0;
|
|
795
|
-
} else if (_progress2 > 100) {
|
|
796
|
-
_progress2 = 100;
|
|
797
|
-
}
|
|
798
|
-
this.startProgress = _progress2;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
},
|
|
802
|
-
endHandle: function endHandle(e) {
|
|
803
|
-
if (this.disabled) return;
|
|
804
|
-
if (this.isStart) {
|
|
805
|
-
if (this.isStartMove === 'end') {
|
|
806
|
-
this.x += this.moveX - this.startX;
|
|
807
|
-
if (this.progress <= 0) {
|
|
808
|
-
this.x = 0;
|
|
809
|
-
} else if (this.progress >= this.range) {
|
|
810
|
-
this.x = this.length.offsetWidth;
|
|
811
|
-
}
|
|
812
|
-
} else if (this.isStartMove === 'start') {
|
|
813
|
-
this.sx += this.moveX - this.endStartX;
|
|
814
|
-
if (this.sProgress <= 0) {
|
|
815
|
-
this.sx = 0;
|
|
816
|
-
} else if (this.sProgress >= this.range) {
|
|
817
|
-
this.sx = this.length.offsetWidth;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
this.isStart = false;
|
|
821
|
-
}
|
|
822
|
-
this.$emit('change', this.rangeValue);
|
|
823
|
-
},
|
|
824
|
-
inputStartHandle: function inputStartHandle(e) {
|
|
825
|
-
var startVal = e.target.value;
|
|
826
|
-
this.sProgress = startVal;
|
|
827
|
-
this.startVal = Number(startVal) / this.range * this.range - this.min || 0;
|
|
828
|
-
var that = this;
|
|
829
|
-
var timer = null;
|
|
830
|
-
timer = setTimeout(function () {
|
|
831
|
-
if (startVal < 0) {
|
|
832
|
-
that.sProgress = 0;
|
|
833
|
-
that.startVal = 0;
|
|
834
|
-
}
|
|
835
|
-
if (startVal > that.range) {
|
|
836
|
-
that.sProgress = that.range;
|
|
837
|
-
that.startVal = that.range;
|
|
838
|
-
}
|
|
839
|
-
that.startProgress = that.startVal / that.range * 100;
|
|
840
|
-
that.$emit('change', that.rangeValue);
|
|
841
|
-
clearTimeout(timer);
|
|
842
|
-
timer = null;
|
|
843
|
-
}, 0);
|
|
844
|
-
},
|
|
845
|
-
inputEndHandle: function inputEndHandle(e) {
|
|
846
|
-
var endVal = e.target.value;
|
|
847
|
-
this.progress = endVal;
|
|
848
|
-
this.val = Number(endVal) / this.range * this.range - this.min || 0;
|
|
849
|
-
this.startProgress = this.startVal / this.range * 100;
|
|
850
|
-
this.rangeProgress = this.val / this.range * 100;
|
|
851
|
-
var that = this;
|
|
852
|
-
var timer = null;
|
|
853
|
-
timer = setTimeout(function () {
|
|
854
|
-
if (endVal < 0) {
|
|
855
|
-
that.progress = 0;
|
|
856
|
-
that.val = 0;
|
|
857
|
-
}
|
|
858
|
-
if (endVal > that.range) {
|
|
859
|
-
that.progress = that.range;
|
|
860
|
-
that.val = that.range;
|
|
861
|
-
}
|
|
862
|
-
that.rangeProgress = that.val / that.range * 100;
|
|
863
|
-
that.$emit('change', that.rangeValue);
|
|
864
|
-
clearTimeout(timer);
|
|
865
|
-
timer = null;
|
|
866
|
-
}, 0);
|
|
867
|
-
},
|
|
868
|
-
inputHandle: function inputHandle(e) {
|
|
869
|
-
if (!this.start) {
|
|
870
|
-
this.progress = e.target.value;
|
|
871
|
-
if (Number(e.target.value) < 0) {
|
|
872
|
-
this.progress = 0;
|
|
873
|
-
} else if (Number(e.target.value) > 100) {
|
|
874
|
-
this.progress = 100;
|
|
875
|
-
}
|
|
876
|
-
this.val = Number(e.target.value) < 0 ? 0 : Number(e.target.value) / this.range * this.range - this.min || 0;
|
|
877
|
-
this.rangeProgress = this.val / this.range * 100;
|
|
878
|
-
var that = this;
|
|
879
|
-
var timer = null;
|
|
880
|
-
timer = setTimeout(function () {
|
|
881
|
-
if (e.target.value < 0) {
|
|
882
|
-
that.progress = 0;
|
|
883
|
-
that.val = 0;
|
|
884
|
-
}
|
|
885
|
-
if (e.target.value > that.range) {
|
|
886
|
-
that.progress = that.range;
|
|
887
|
-
that.val = that.range;
|
|
888
|
-
}
|
|
889
|
-
that.rangeProgress = that.val / that.range * 100;
|
|
890
|
-
// that.value = that.rangeProgress
|
|
891
|
-
that.$emit('change', that.rangeValue);
|
|
892
|
-
clearTimeout(timer);
|
|
893
|
-
timer = null;
|
|
894
|
-
}, 0);
|
|
895
|
-
}
|
|
896
|
-
},
|
|
897
|
-
onButtonDown: function onButtonDown(event) {
|
|
898
|
-
if (this.disabled) return;
|
|
899
|
-
event.preventDefault();
|
|
900
|
-
this.isStartMove = 'end';
|
|
901
|
-
this.onDragStart(event);
|
|
902
|
-
window.addEventListener('mousemove', this.onDragging);
|
|
903
|
-
window.addEventListener('touchmove', this.onDragging);
|
|
904
|
-
window.addEventListener('mouseup', this.onDragEnd);
|
|
905
|
-
window.addEventListener('touchend', this.onDragEnd);
|
|
906
|
-
window.addEventListener('contextmenu', this.onDragEnd);
|
|
907
|
-
},
|
|
908
|
-
onStartButtonDown: function onStartButtonDown(event) {
|
|
909
|
-
if (this.disabled) return;
|
|
910
|
-
event.preventDefault();
|
|
911
|
-
this.isStartMove = 'start';
|
|
912
|
-
this.onDragStart(event);
|
|
913
|
-
window.addEventListener('mousemove', this.onDragging);
|
|
914
|
-
window.addEventListener('touchmove', this.onDragging);
|
|
915
|
-
window.addEventListener('mouseup', this.onDragEnd);
|
|
916
|
-
window.addEventListener('touchend', this.onDragEnd);
|
|
917
|
-
window.addEventListener('contextmenu', this.onDragEnd);
|
|
918
|
-
},
|
|
919
|
-
onDragging: function onDragging(event) {
|
|
920
|
-
if (this.dragging) {
|
|
921
|
-
if (event.type === 'touchmove') {
|
|
922
|
-
event.clientY = event.touches[0].clientY;
|
|
923
|
-
event.clientX = event.touches[0].clientX;
|
|
924
|
-
}
|
|
925
|
-
var currentX = event.clientX;
|
|
926
|
-
if (this.isStartMove === 'end') {
|
|
927
|
-
var diff = (currentX - this.startMoveX) / this.length.offsetWidth * this.range;
|
|
928
|
-
this.progress = this.startPosition + diff;
|
|
929
|
-
if (this.progress <= 0) {
|
|
930
|
-
this.progress = 0;
|
|
931
|
-
} else if (this.progress >= this.range) {
|
|
932
|
-
this.progress = this.range;
|
|
933
|
-
}
|
|
934
|
-
if (this.startProgress >= this.progress) {
|
|
935
|
-
this.progress = this.startProgress;
|
|
936
|
-
}
|
|
937
|
-
var progress = this.progress / this.range * 100;
|
|
938
|
-
if (progress < 0) {
|
|
939
|
-
progress = 0;
|
|
940
|
-
} else if (progress > 100) {
|
|
941
|
-
progress = 100;
|
|
942
|
-
}
|
|
943
|
-
this.rangeProgress = progress;
|
|
944
|
-
} else if (this.isStartMove === 'start') {
|
|
945
|
-
var _diff = (currentX - this.sStartMoveX) / this.length.offsetWidth * this.range;
|
|
946
|
-
this.sProgress = this.sStartPosition + _diff;
|
|
947
|
-
if (this.sProgress <= 0) {
|
|
948
|
-
this.sProgress = 0;
|
|
949
|
-
} else if (this.sProgress >= this.rangeProgress) {
|
|
950
|
-
this.sProgress = this.rangeProgress;
|
|
951
|
-
} else if (this.sProgress >= this.range) {
|
|
952
|
-
this.sProgress = this.range;
|
|
953
|
-
}
|
|
954
|
-
var _progress3 = this.sProgress / this.range * 100;
|
|
955
|
-
if (_progress3 < 0) {
|
|
956
|
-
_progress3 = 0;
|
|
957
|
-
} else if (_progress3 > 100) {
|
|
958
|
-
_progress3 = 100;
|
|
959
|
-
}
|
|
960
|
-
this.startProgress = _progress3;
|
|
961
|
-
}
|
|
962
|
-
this.$emit('change', this.rangeValue);
|
|
963
|
-
}
|
|
964
|
-
},
|
|
965
|
-
onDragStart: function onDragStart(event) {
|
|
966
|
-
this.dragging = true;
|
|
967
|
-
if (event.type === 'touchstart') {
|
|
968
|
-
event.clientY = event.touches[0].clientY;
|
|
969
|
-
event.clientX = event.touches[0].clientX;
|
|
970
|
-
}
|
|
971
|
-
if (this.isStartMove === 'end') {
|
|
972
|
-
this.startMoveX = event.clientX;
|
|
973
|
-
this.startPosition = parseFloat(this.progress);
|
|
974
|
-
} else if (this.isStartMove === 'start') {
|
|
975
|
-
this.sStartMoveX = event.clientX;
|
|
976
|
-
this.sStartPosition = parseFloat(this.sProgress);
|
|
977
|
-
}
|
|
978
|
-
},
|
|
979
|
-
onDragEnd: function onDragEnd() {
|
|
980
|
-
var _this2 = this;
|
|
981
|
-
|
|
982
|
-
if (this.dragging) {
|
|
983
|
-
if (this.isStartMove === 'end') {
|
|
984
|
-
this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress;
|
|
985
|
-
var progress = this.val / this.range * 100;
|
|
986
|
-
if (progress < 0) {
|
|
987
|
-
progress = 0;
|
|
988
|
-
} else if (progress > 100) {
|
|
989
|
-
progress = 100;
|
|
990
|
-
}
|
|
991
|
-
if (this.startProgress >= progress) {
|
|
992
|
-
progress = this.startProgress;
|
|
993
|
-
}
|
|
994
|
-
this.rangeProgress = progress;
|
|
995
|
-
} else if (this.isStartMove === 'start') {
|
|
996
|
-
this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress;
|
|
997
|
-
var _progress4 = this.startVal / this.range * 100;
|
|
998
|
-
if (_progress4 < 0) {
|
|
999
|
-
_progress4 = 0;
|
|
1000
|
-
} else if (_progress4 >= this.rangeProgress) {
|
|
1001
|
-
_progress4 = this.rangeProgress;
|
|
1002
|
-
} else if (_progress4 > 100) {
|
|
1003
|
-
_progress4 = 100;
|
|
1004
|
-
}
|
|
1005
|
-
this.startProgress = _progress4;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
/*
|
|
1009
|
-
* 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
|
|
1010
|
-
* 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
|
|
1011
|
-
*/
|
|
1012
|
-
this.dragging = false;
|
|
1013
|
-
var timer = null;
|
|
1014
|
-
timer = setTimeout(function () {
|
|
1015
|
-
_this2.dragging = true;
|
|
1016
|
-
clearTimeout(timer);
|
|
1017
|
-
timer = null;
|
|
1018
|
-
}, 200);
|
|
1019
|
-
window.removeEventListener('mousemove', this.onDragging);
|
|
1020
|
-
window.removeEventListener('touchmove', this.onDragging);
|
|
1021
|
-
window.removeEventListener('mouseup', this.onDragEnd);
|
|
1022
|
-
window.removeEventListener('touchend', this.onDragEnd);
|
|
1023
|
-
window.removeEventListener('contextmenu', this.onDragEnd);
|
|
1024
|
-
}
|
|
1025
|
-
},
|
|
1026
|
-
setDisabled: function setDisabled(f) {
|
|
1027
|
-
this.disabled = f;
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
});
|
|
1031
|
-
// CONCATENATED MODULE: ./packages/range/src/range.vue?vue&type=script&lang=js
|
|
1032
|
-
/* harmony default export */ var src_rangevue_type_script_lang_js = (rangevue_type_script_lang_js);
|
|
1033
|
-
// EXTERNAL MODULE: ./packages/range/src/range.vue?vue&type=style&index=0&id=19fdc744&prod&lang=css
|
|
1034
|
-
var rangevue_type_style_index_0_id_19fdc744_prod_lang_css = __webpack_require__(94);
|
|
1035
|
-
|
|
1036
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
1037
|
-
var componentNormalizer = __webpack_require__(0);
|
|
1038
|
-
|
|
1039
|
-
// CONCATENATED MODULE: ./packages/range/src/range.vue
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
/* normalize component */
|
|
1047
|
-
|
|
1048
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
1049
|
-
src_rangevue_type_script_lang_js,
|
|
1050
|
-
render,
|
|
1051
|
-
staticRenderFns,
|
|
1052
|
-
false,
|
|
1053
|
-
null,
|
|
1054
|
-
null,
|
|
1055
|
-
null
|
|
1056
|
-
|
|
1057
|
-
)
|
|
1058
|
-
|
|
1059
|
-
/* harmony default export */ var range = (component.exports);
|
|
1060
|
-
// CONCATENATED MODULE: ./packages/range/index.js
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
/* istanbul ignore next */
|
|
1064
|
-
range.install = function (Vue) {
|
|
1065
|
-
Vue.component(range.name, range);
|
|
1066
|
-
};
|
|
1067
|
-
|
|
1068
|
-
/* harmony default export */ var packages_range = __webpack_exports__["default"] = (range);
|
|
1069
|
-
|
|
1070
|
-
/***/ }),
|
|
1071
|
-
|
|
1072
|
-
/***/ 7:
|
|
1073
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1074
|
-
|
|
1075
|
-
"use strict";
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
/*
|
|
1079
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
1080
|
-
Author Tobias Koppers @sokra
|
|
1081
|
-
*/
|
|
1082
|
-
// css base code, injected by the css-loader
|
|
1083
|
-
// eslint-disable-next-line func-names
|
|
1084
|
-
module.exports = function (useSourceMap) {
|
|
1085
|
-
var list = []; // return the list of modules as css string
|
|
1086
|
-
|
|
1087
|
-
list.toString = function toString() {
|
|
1088
|
-
return this.map(function (item) {
|
|
1089
|
-
var content = cssWithMappingToString(item, useSourceMap);
|
|
1090
|
-
|
|
1091
|
-
if (item[2]) {
|
|
1092
|
-
return "@media ".concat(item[2], "{").concat(content, "}");
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
return content;
|
|
1096
|
-
}).join('');
|
|
1097
|
-
}; // import a list of modules into the list
|
|
1098
|
-
// eslint-disable-next-line func-names
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
list.i = function (modules, mediaQuery) {
|
|
1102
|
-
if (typeof modules === 'string') {
|
|
1103
|
-
// eslint-disable-next-line no-param-reassign
|
|
1104
|
-
modules = [[null, modules, '']];
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
var alreadyImportedModules = {};
|
|
1108
|
-
|
|
1109
|
-
for (var i = 0; i < this.length; i++) {
|
|
1110
|
-
// eslint-disable-next-line prefer-destructuring
|
|
1111
|
-
var id = this[i][0];
|
|
1112
|
-
|
|
1113
|
-
if (id != null) {
|
|
1114
|
-
alreadyImportedModules[id] = true;
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
for (var _i = 0; _i < modules.length; _i++) {
|
|
1119
|
-
var item = modules[_i]; // skip already imported module
|
|
1120
|
-
// this implementation is not 100% perfect for weird media query combinations
|
|
1121
|
-
// when a module is imported multiple times with different media queries.
|
|
1122
|
-
// I hope this will never occur (Hey this way we have smaller bundles)
|
|
1123
|
-
|
|
1124
|
-
if (item[0] == null || !alreadyImportedModules[item[0]]) {
|
|
1125
|
-
if (mediaQuery && !item[2]) {
|
|
1126
|
-
item[2] = mediaQuery;
|
|
1127
|
-
} else if (mediaQuery) {
|
|
1128
|
-
item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
|
|
1129
|
-
}
|
|
247
|
+
if (item[0] == null || !alreadyImportedModules[item[0]]) {
|
|
248
|
+
if (mediaQuery && !item[2]) {
|
|
249
|
+
item[2] = mediaQuery;
|
|
250
|
+
} else if (mediaQuery) {
|
|
251
|
+
item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
|
|
252
|
+
}
|
|
1130
253
|
|
|
1131
254
|
list.push(item);
|
|
1132
255
|
}
|
|
@@ -1166,7 +289,7 @@ function toComment(sourceMap) {
|
|
|
1166
289
|
|
|
1167
290
|
/***/ }),
|
|
1168
291
|
|
|
1169
|
-
/***/
|
|
292
|
+
/***/ 12:
|
|
1170
293
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1171
294
|
|
|
1172
295
|
"use strict";
|
|
@@ -1256,206 +379,1083 @@ function addStylesToDom(styles, options) {
|
|
|
1256
379
|
domStyle.parts[j](item.parts[j]);
|
|
1257
380
|
}
|
|
1258
381
|
|
|
1259
|
-
for (; j < item.parts.length; j++) {
|
|
1260
|
-
domStyle.parts.push(addStyle(item.parts[j], options));
|
|
1261
|
-
}
|
|
382
|
+
for (; j < item.parts.length; j++) {
|
|
383
|
+
domStyle.parts.push(addStyle(item.parts[j], options));
|
|
384
|
+
}
|
|
385
|
+
} else {
|
|
386
|
+
var parts = [];
|
|
387
|
+
|
|
388
|
+
for (; j < item.parts.length; j++) {
|
|
389
|
+
parts.push(addStyle(item.parts[j], options));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
stylesInDom[item.id] = {
|
|
393
|
+
id: item.id,
|
|
394
|
+
refs: 1,
|
|
395
|
+
parts: parts
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function insertStyleElement(options) {
|
|
402
|
+
var style = document.createElement('style');
|
|
403
|
+
|
|
404
|
+
if (typeof options.attributes.nonce === 'undefined') {
|
|
405
|
+
var nonce = true ? __webpack_require__.nc : undefined;
|
|
406
|
+
|
|
407
|
+
if (nonce) {
|
|
408
|
+
options.attributes.nonce = nonce;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
Object.keys(options.attributes).forEach(function (key) {
|
|
413
|
+
style.setAttribute(key, options.attributes[key]);
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
if (typeof options.insert === 'function') {
|
|
417
|
+
options.insert(style);
|
|
418
|
+
} else {
|
|
419
|
+
var target = getTarget(options.insert || 'head');
|
|
420
|
+
|
|
421
|
+
if (!target) {
|
|
422
|
+
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
target.appendChild(style);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return style;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
function removeStyleElement(style) {
|
|
432
|
+
// istanbul ignore if
|
|
433
|
+
if (style.parentNode === null) {
|
|
434
|
+
return false;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
style.parentNode.removeChild(style);
|
|
438
|
+
}
|
|
439
|
+
/* istanbul ignore next */
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
var replaceText = function replaceText() {
|
|
443
|
+
var textStore = [];
|
|
444
|
+
return function replace(index, replacement) {
|
|
445
|
+
textStore[index] = replacement;
|
|
446
|
+
return textStore.filter(Boolean).join('\n');
|
|
447
|
+
};
|
|
448
|
+
}();
|
|
449
|
+
|
|
450
|
+
function applyToSingletonTag(style, index, remove, obj) {
|
|
451
|
+
var css = remove ? '' : obj.css; // For old IE
|
|
452
|
+
|
|
453
|
+
/* istanbul ignore if */
|
|
454
|
+
|
|
455
|
+
if (style.styleSheet) {
|
|
456
|
+
style.styleSheet.cssText = replaceText(index, css);
|
|
457
|
+
} else {
|
|
458
|
+
var cssNode = document.createTextNode(css);
|
|
459
|
+
var childNodes = style.childNodes;
|
|
460
|
+
|
|
461
|
+
if (childNodes[index]) {
|
|
462
|
+
style.removeChild(childNodes[index]);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (childNodes.length) {
|
|
466
|
+
style.insertBefore(cssNode, childNodes[index]);
|
|
467
|
+
} else {
|
|
468
|
+
style.appendChild(cssNode);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function applyToTag(style, options, obj) {
|
|
474
|
+
var css = obj.css;
|
|
475
|
+
var media = obj.media;
|
|
476
|
+
var sourceMap = obj.sourceMap;
|
|
477
|
+
|
|
478
|
+
if (media) {
|
|
479
|
+
style.setAttribute('media', media);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (sourceMap && btoa) {
|
|
483
|
+
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
|
|
484
|
+
} // For old IE
|
|
485
|
+
|
|
486
|
+
/* istanbul ignore if */
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
if (style.styleSheet) {
|
|
490
|
+
style.styleSheet.cssText = css;
|
|
491
|
+
} else {
|
|
492
|
+
while (style.firstChild) {
|
|
493
|
+
style.removeChild(style.firstChild);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
style.appendChild(document.createTextNode(css));
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
var singleton = null;
|
|
501
|
+
var singletonCounter = 0;
|
|
502
|
+
|
|
503
|
+
function addStyle(obj, options) {
|
|
504
|
+
var style;
|
|
505
|
+
var update;
|
|
506
|
+
var remove;
|
|
507
|
+
|
|
508
|
+
if (options.singleton) {
|
|
509
|
+
var styleIndex = singletonCounter++;
|
|
510
|
+
style = singleton || (singleton = insertStyleElement(options));
|
|
511
|
+
update = applyToSingletonTag.bind(null, style, styleIndex, false);
|
|
512
|
+
remove = applyToSingletonTag.bind(null, style, styleIndex, true);
|
|
513
|
+
} else {
|
|
514
|
+
style = insertStyleElement(options);
|
|
515
|
+
update = applyToTag.bind(null, style, options);
|
|
516
|
+
|
|
517
|
+
remove = function remove() {
|
|
518
|
+
removeStyleElement(style);
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
update(obj);
|
|
523
|
+
return function updateStyle(newObj) {
|
|
524
|
+
if (newObj) {
|
|
525
|
+
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
update(obj = newObj);
|
|
1262
530
|
} else {
|
|
1263
|
-
|
|
531
|
+
remove();
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
}
|
|
1264
535
|
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
536
|
+
module.exports = function (list, options) {
|
|
537
|
+
options = options || {};
|
|
538
|
+
options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
|
539
|
+
// tags it will allow on a page
|
|
1268
540
|
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
refs: 1,
|
|
1272
|
-
parts: parts
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
541
|
+
if (!options.singleton && typeof options.singleton !== 'boolean') {
|
|
542
|
+
options.singleton = isOldIE();
|
|
1275
543
|
}
|
|
1276
|
-
}
|
|
1277
544
|
|
|
1278
|
-
|
|
1279
|
-
|
|
545
|
+
var styles = listToStyles(list, options);
|
|
546
|
+
addStylesToDom(styles, options);
|
|
547
|
+
return function update(newList) {
|
|
548
|
+
var mayRemove = [];
|
|
1280
549
|
|
|
1281
|
-
|
|
1282
|
-
|
|
550
|
+
for (var i = 0; i < styles.length; i++) {
|
|
551
|
+
var item = styles[i];
|
|
552
|
+
var domStyle = stylesInDom[item.id];
|
|
1283
553
|
|
|
1284
|
-
|
|
1285
|
-
|
|
554
|
+
if (domStyle) {
|
|
555
|
+
domStyle.refs--;
|
|
556
|
+
mayRemove.push(domStyle);
|
|
557
|
+
}
|
|
1286
558
|
}
|
|
1287
|
-
}
|
|
1288
559
|
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
560
|
+
if (newList) {
|
|
561
|
+
var newStyles = listToStyles(newList, options);
|
|
562
|
+
addStylesToDom(newStyles, options);
|
|
563
|
+
}
|
|
1292
564
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
} else {
|
|
1296
|
-
var target = getTarget(options.insert || 'head');
|
|
565
|
+
for (var _i = 0; _i < mayRemove.length; _i++) {
|
|
566
|
+
var _domStyle = mayRemove[_i];
|
|
1297
567
|
|
|
1298
|
-
|
|
1299
|
-
|
|
568
|
+
if (_domStyle.refs === 0) {
|
|
569
|
+
for (var j = 0; j < _domStyle.parts.length; j++) {
|
|
570
|
+
_domStyle.parts[j]();
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
delete stylesInDom[_domStyle.id];
|
|
574
|
+
}
|
|
1300
575
|
}
|
|
576
|
+
};
|
|
577
|
+
};
|
|
1301
578
|
|
|
1302
|
-
|
|
1303
|
-
}
|
|
579
|
+
/***/ }),
|
|
1304
580
|
|
|
1305
|
-
|
|
1306
|
-
|
|
581
|
+
/***/ 18:
|
|
582
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1307
583
|
|
|
1308
|
-
|
|
1309
|
-
// istanbul ignore if
|
|
1310
|
-
if (style.parentNode === null) {
|
|
1311
|
-
return false;
|
|
1312
|
-
}
|
|
584
|
+
var content = __webpack_require__(94);
|
|
1313
585
|
|
|
1314
|
-
|
|
586
|
+
if (typeof content === 'string') {
|
|
587
|
+
content = [[module.i, content, '']];
|
|
1315
588
|
}
|
|
1316
|
-
/* istanbul ignore next */
|
|
1317
589
|
|
|
590
|
+
var options = {}
|
|
1318
591
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
return function replace(index, replacement) {
|
|
1322
|
-
textStore[index] = replacement;
|
|
1323
|
-
return textStore.filter(Boolean).join('\n');
|
|
1324
|
-
};
|
|
1325
|
-
}();
|
|
592
|
+
options.insert = "head";
|
|
593
|
+
options.singleton = false;
|
|
1326
594
|
|
|
1327
|
-
|
|
1328
|
-
var css = remove ? '' : obj.css; // For old IE
|
|
595
|
+
var update = __webpack_require__(12)(content, options);
|
|
1329
596
|
|
|
1330
|
-
|
|
597
|
+
if (content.locals) {
|
|
598
|
+
module.exports = content.locals;
|
|
599
|
+
}
|
|
1331
600
|
|
|
1332
|
-
if (style.styleSheet) {
|
|
1333
|
-
style.styleSheet.cssText = replaceText(index, css);
|
|
1334
|
-
} else {
|
|
1335
|
-
var cssNode = document.createTextNode(css);
|
|
1336
|
-
var childNodes = style.childNodes;
|
|
1337
601
|
|
|
1338
|
-
|
|
1339
|
-
style.removeChild(childNodes[index]);
|
|
1340
|
-
}
|
|
602
|
+
/***/ }),
|
|
1341
603
|
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
604
|
+
/***/ 359:
|
|
605
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
606
|
+
|
|
607
|
+
"use strict";
|
|
608
|
+
// ESM COMPAT FLAG
|
|
609
|
+
__webpack_require__.r(__webpack_exports__);
|
|
610
|
+
|
|
611
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/range/src/range.vue?vue&type=template&id=19fdc744
|
|
612
|
+
var render = function () {
|
|
613
|
+
var _vm = this
|
|
614
|
+
var _h = _vm.$createElement
|
|
615
|
+
var _c = _vm._self._c || _h
|
|
616
|
+
return _c(
|
|
617
|
+
"span",
|
|
618
|
+
{
|
|
619
|
+
staticClass: "to-range to-form-readonly",
|
|
620
|
+
style: _vm.setStyle,
|
|
621
|
+
on: {
|
|
622
|
+
touchmove: function ($event) {
|
|
623
|
+
return _vm.moveHandle($event)
|
|
624
|
+
},
|
|
625
|
+
touchend: function ($event) {
|
|
626
|
+
return _vm.endHandle($event)
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
},
|
|
630
|
+
[
|
|
631
|
+
_c("span", { staticClass: "to-rangeMain" }, [
|
|
632
|
+
_c(
|
|
633
|
+
"span",
|
|
634
|
+
{
|
|
635
|
+
staticClass: "to-rangeBar",
|
|
636
|
+
on: {
|
|
637
|
+
click: function ($event) {
|
|
638
|
+
$event.stopPropagation()
|
|
639
|
+
return _vm.rangeBarClick($event)
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
[
|
|
644
|
+
_c(
|
|
645
|
+
"span",
|
|
646
|
+
{
|
|
647
|
+
staticClass: "to-rangeProgress",
|
|
648
|
+
style: {
|
|
649
|
+
width: _vm.rangeProgress - _vm.startProgress + "%",
|
|
650
|
+
left: _vm.startProgress + "%",
|
|
651
|
+
},
|
|
652
|
+
},
|
|
653
|
+
[
|
|
654
|
+
_vm.start
|
|
655
|
+
? _c("span", {
|
|
656
|
+
ref: "touchStartBar",
|
|
657
|
+
staticClass: "to-rangeStart",
|
|
658
|
+
style: {
|
|
659
|
+
zIndex:
|
|
660
|
+
String(_vm.startProgress) === "100" ? "100" : "99",
|
|
661
|
+
},
|
|
662
|
+
on: {
|
|
663
|
+
mousedown: _vm.onStartButtonDown,
|
|
664
|
+
touchstart: function ($event) {
|
|
665
|
+
return _vm.startHandle($event)
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
})
|
|
669
|
+
: _vm._e(),
|
|
670
|
+
_c("span", {
|
|
671
|
+
ref: "touchBar",
|
|
672
|
+
staticClass: "to-rangeEnd",
|
|
673
|
+
on: {
|
|
674
|
+
mousedown: _vm.onButtonDown,
|
|
675
|
+
touchstart: function ($event) {
|
|
676
|
+
return _vm.endStartHandle($event)
|
|
677
|
+
},
|
|
678
|
+
},
|
|
679
|
+
}),
|
|
680
|
+
]
|
|
681
|
+
),
|
|
682
|
+
]
|
|
683
|
+
),
|
|
684
|
+
_vm.showInput
|
|
685
|
+
? _c(
|
|
686
|
+
"span",
|
|
687
|
+
{ staticClass: "to-rangeValue" },
|
|
688
|
+
[
|
|
689
|
+
_vm.start
|
|
690
|
+
? _c(
|
|
691
|
+
"span",
|
|
692
|
+
{ staticClass: "to-input", class: _vm.setClass },
|
|
693
|
+
[
|
|
694
|
+
_c(
|
|
695
|
+
"to-input",
|
|
696
|
+
_vm._b(
|
|
697
|
+
{
|
|
698
|
+
ref: "rangeStartInput",
|
|
699
|
+
attrs: {
|
|
700
|
+
type: "number",
|
|
701
|
+
mode: "none",
|
|
702
|
+
min: _vm.min,
|
|
703
|
+
max: _vm.max,
|
|
704
|
+
clearable: false,
|
|
705
|
+
width: 6,
|
|
706
|
+
readonly: _vm.disabled || !_vm.inputable,
|
|
707
|
+
},
|
|
708
|
+
on: { blur: _vm.inputStartHandle },
|
|
709
|
+
model: {
|
|
710
|
+
value: _vm.refStartVal,
|
|
711
|
+
callback: function ($$v) {
|
|
712
|
+
_vm.refStartVal = $$v
|
|
713
|
+
},
|
|
714
|
+
expression: "refStartVal",
|
|
715
|
+
},
|
|
716
|
+
},
|
|
717
|
+
"to-input",
|
|
718
|
+
_vm.inputProps,
|
|
719
|
+
false
|
|
720
|
+
)
|
|
721
|
+
),
|
|
722
|
+
_c(
|
|
723
|
+
"span",
|
|
724
|
+
{ staticClass: "to-inputText to-inputText-narrow" },
|
|
725
|
+
[_vm._v("~")]
|
|
726
|
+
),
|
|
727
|
+
_c(
|
|
728
|
+
"to-input",
|
|
729
|
+
_vm._b(
|
|
730
|
+
{
|
|
731
|
+
ref: "rangeEndInput",
|
|
732
|
+
attrs: {
|
|
733
|
+
type: "number",
|
|
734
|
+
mode: "none",
|
|
735
|
+
min: _vm.min,
|
|
736
|
+
max: _vm.max,
|
|
737
|
+
clearable: false,
|
|
738
|
+
width: 6,
|
|
739
|
+
readonly: _vm.disabled || !_vm.inputable,
|
|
740
|
+
},
|
|
741
|
+
on: { blur: _vm.inputEndHandle },
|
|
742
|
+
model: {
|
|
743
|
+
value: _vm.refEndVal,
|
|
744
|
+
callback: function ($$v) {
|
|
745
|
+
_vm.refEndVal = $$v
|
|
746
|
+
},
|
|
747
|
+
expression: "refEndVal",
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
"to-input",
|
|
751
|
+
_vm.inputProps,
|
|
752
|
+
false
|
|
753
|
+
)
|
|
754
|
+
),
|
|
755
|
+
],
|
|
756
|
+
1
|
|
757
|
+
)
|
|
758
|
+
: _c(
|
|
759
|
+
"to-input",
|
|
760
|
+
_vm._b(
|
|
761
|
+
{
|
|
762
|
+
ref: "rangeInput",
|
|
763
|
+
attrs: {
|
|
764
|
+
type: "number",
|
|
765
|
+
min: _vm.min,
|
|
766
|
+
max: _vm.max,
|
|
767
|
+
clearable: false,
|
|
768
|
+
width: 6,
|
|
769
|
+
readonly: _vm.disabled || !_vm.inputable,
|
|
770
|
+
},
|
|
771
|
+
on: { blur: _vm.inputHandle },
|
|
772
|
+
model: {
|
|
773
|
+
value: _vm.refVal,
|
|
774
|
+
callback: function ($$v) {
|
|
775
|
+
_vm.refVal = $$v
|
|
776
|
+
},
|
|
777
|
+
expression: "refVal",
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
"to-input",
|
|
781
|
+
_vm.inputProps,
|
|
782
|
+
false
|
|
783
|
+
)
|
|
784
|
+
),
|
|
785
|
+
],
|
|
786
|
+
1
|
|
787
|
+
)
|
|
788
|
+
: _vm._e(),
|
|
789
|
+
]),
|
|
790
|
+
]
|
|
791
|
+
)
|
|
1348
792
|
}
|
|
793
|
+
var staticRenderFns = []
|
|
794
|
+
render._withStripped = true
|
|
1349
795
|
|
|
1350
|
-
function applyToTag(style, options, obj) {
|
|
1351
|
-
var css = obj.css;
|
|
1352
|
-
var media = obj.media;
|
|
1353
|
-
var sourceMap = obj.sourceMap;
|
|
1354
796
|
|
|
1355
|
-
|
|
1356
|
-
style.setAttribute('media', media);
|
|
1357
|
-
}
|
|
797
|
+
// CONCATENATED MODULE: ./packages/range/src/range.vue?vue&type=template&id=19fdc744
|
|
1358
798
|
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
799
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/range/src/range.vue?vue&type=script&lang=js
|
|
800
|
+
//
|
|
801
|
+
//
|
|
802
|
+
//
|
|
803
|
+
//
|
|
804
|
+
//
|
|
805
|
+
//
|
|
806
|
+
//
|
|
807
|
+
//
|
|
808
|
+
//
|
|
809
|
+
//
|
|
810
|
+
//
|
|
811
|
+
//
|
|
812
|
+
//
|
|
813
|
+
//
|
|
814
|
+
//
|
|
815
|
+
//
|
|
816
|
+
//
|
|
817
|
+
//
|
|
818
|
+
//
|
|
819
|
+
//
|
|
820
|
+
//
|
|
1362
821
|
|
|
1363
|
-
|
|
822
|
+
/* harmony default export */ var rangevue_type_script_lang_js = ({
|
|
823
|
+
name: 'ToRange',
|
|
824
|
+
componentName: 'ToRange',
|
|
825
|
+
model: {
|
|
826
|
+
event: 'change'
|
|
827
|
+
},
|
|
828
|
+
props: {
|
|
829
|
+
value: {
|
|
830
|
+
type: [Number, String],
|
|
831
|
+
default: 0
|
|
832
|
+
},
|
|
833
|
+
readonly: {
|
|
834
|
+
type: Boolean,
|
|
835
|
+
default: false
|
|
836
|
+
},
|
|
837
|
+
inputable: {
|
|
838
|
+
type: Boolean,
|
|
839
|
+
default: true
|
|
840
|
+
},
|
|
841
|
+
max: {
|
|
842
|
+
type: [Number, String],
|
|
843
|
+
default: 100
|
|
844
|
+
},
|
|
845
|
+
min: {
|
|
846
|
+
type: [Number, String],
|
|
847
|
+
default: 0
|
|
848
|
+
},
|
|
849
|
+
ruler: {
|
|
850
|
+
type: Boolean,
|
|
851
|
+
default: false
|
|
852
|
+
},
|
|
853
|
+
start: {
|
|
854
|
+
type: Boolean,
|
|
855
|
+
default: false
|
|
856
|
+
},
|
|
857
|
+
step: {
|
|
858
|
+
type: [String, Number],
|
|
859
|
+
default: 1
|
|
860
|
+
},
|
|
861
|
+
width: {
|
|
862
|
+
type: [Number, String],
|
|
863
|
+
default: ''
|
|
864
|
+
},
|
|
865
|
+
valueWidth: {
|
|
866
|
+
type: [Number, String],
|
|
867
|
+
default: 0
|
|
868
|
+
},
|
|
869
|
+
showInput: Boolean,
|
|
870
|
+
inputProps: {
|
|
871
|
+
type: Object,
|
|
872
|
+
default: function _default() {
|
|
873
|
+
return {};
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
data: function data() {
|
|
878
|
+
return {
|
|
879
|
+
disabled: this.readonly,
|
|
880
|
+
length: 0,
|
|
881
|
+
isStart: false,
|
|
882
|
+
progress: 0,
|
|
883
|
+
sProgress: 0,
|
|
884
|
+
dragging: true,
|
|
885
|
+
startX: 0,
|
|
886
|
+
endStartX: 0,
|
|
887
|
+
startMoveX: 0,
|
|
888
|
+
startPosition: 0,
|
|
889
|
+
currentX: 0,
|
|
890
|
+
moveX: 0,
|
|
891
|
+
endX: 0,
|
|
892
|
+
x: 0,
|
|
893
|
+
sx: 0,
|
|
894
|
+
isStartMove: 'start',
|
|
895
|
+
rangeProgress: 0,
|
|
896
|
+
sStartMoveX: 0,
|
|
897
|
+
sStartPosition: 0,
|
|
898
|
+
startProgress: 0,
|
|
899
|
+
startValue: 0
|
|
900
|
+
};
|
|
901
|
+
},
|
|
1364
902
|
|
|
903
|
+
computed: {
|
|
904
|
+
val: {
|
|
905
|
+
get: function get() {
|
|
906
|
+
return Math.round(this.progress / this.range * this.range) || 0;
|
|
907
|
+
},
|
|
908
|
+
set: function set(newVal) {
|
|
909
|
+
this.progress = newVal;
|
|
910
|
+
this.x = this.length.offsetWidth * this.progress / this.range;
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
startVal: {
|
|
914
|
+
get: function get() {
|
|
915
|
+
return Math.round(this.sProgress / this.range * this.range) || 0;
|
|
916
|
+
},
|
|
917
|
+
set: function set(newVal) {
|
|
918
|
+
this.sProgress = newVal;
|
|
919
|
+
this.sx = this.length.offsetWidth * this.sProgress / this.range;
|
|
920
|
+
}
|
|
921
|
+
},
|
|
922
|
+
refVal: {
|
|
923
|
+
get: function get() {
|
|
924
|
+
if (this.start) {
|
|
925
|
+
return this.startVal + this.min + ',' + (this.val + this.min);
|
|
926
|
+
} else {
|
|
927
|
+
return this.val + this.min;
|
|
928
|
+
}
|
|
929
|
+
},
|
|
930
|
+
set: function set(newVal) {}
|
|
931
|
+
},
|
|
932
|
+
refStartVal: {
|
|
933
|
+
get: function get() {
|
|
934
|
+
if (this.start) {
|
|
935
|
+
return this.startVal + this.min;
|
|
936
|
+
} else {
|
|
937
|
+
return this.val + this.min;
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
set: function set(newVal) {}
|
|
941
|
+
},
|
|
942
|
+
refEndVal: {
|
|
943
|
+
get: function get() {
|
|
944
|
+
if (this.start) {
|
|
945
|
+
return this.val + this.min;
|
|
946
|
+
} else {
|
|
947
|
+
return this.val + this.min;
|
|
948
|
+
}
|
|
949
|
+
},
|
|
950
|
+
set: function set(newVal) {}
|
|
951
|
+
},
|
|
952
|
+
rangeValue: {
|
|
953
|
+
get: function get() {
|
|
954
|
+
if (this.start) {
|
|
955
|
+
return (this.sProgress || 0).toFixed(0) + ',' + (this.progress || 0).toFixed(0);
|
|
956
|
+
} else {
|
|
957
|
+
return (this.progress || 0).toFixed(0);
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
set: function set(newVal) {}
|
|
961
|
+
},
|
|
962
|
+
range: function range() {
|
|
963
|
+
return Number(this.max) - Number(this.min);
|
|
964
|
+
},
|
|
965
|
+
part: function part() {
|
|
966
|
+
return 100 / this.range;
|
|
967
|
+
},
|
|
968
|
+
setStyle: function setStyle() {
|
|
969
|
+
var obj = {};
|
|
970
|
+
if (this.width) {
|
|
971
|
+
if (!isNaN(this.width)) {
|
|
972
|
+
obj.width = this.width + 'em';
|
|
973
|
+
} else if (this.width === 'full') {
|
|
974
|
+
obj.width = '100%';
|
|
975
|
+
} else {
|
|
976
|
+
obj.width = this.width;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return obj;
|
|
980
|
+
},
|
|
981
|
+
setClass: function setClass() {
|
|
982
|
+
var arr = [];
|
|
983
|
+
if (this.inputProps.color) {
|
|
984
|
+
if (this.inputProps.color !== 'radam') {
|
|
985
|
+
arr.push('to-input-color-' + this.inputProps.color);
|
|
986
|
+
} else {
|
|
987
|
+
var colors = this.inputProps.$TouchUI.colors;
|
|
988
|
+
var number = Math.round(Math.random() * 6);
|
|
989
|
+
arr.push('to-input-color-' + colors[number]);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
if (this.inputProps.placeholderColor) {
|
|
993
|
+
arr.push('to-input-placeholder-color-' + this.inputProps.placeholderColor);
|
|
994
|
+
}
|
|
995
|
+
if (this.inputProps.fillet !== 'none') {
|
|
996
|
+
arr.push('to-input-fillet-' + this.inputProps.fillet);
|
|
997
|
+
}
|
|
998
|
+
if (this.inputProps.filletPosition) {
|
|
999
|
+
arr.push('to-input-fillet-position-' + this.filletPosition);
|
|
1000
|
+
}
|
|
1001
|
+
if (this.inputProps.mode) {
|
|
1002
|
+
arr.push('to-input-mode-' + this.inputProps.mode);
|
|
1003
|
+
} else if (this.ToForm && this.ToForm.type === 'list') {
|
|
1004
|
+
arr.push('to-input-mode-none');
|
|
1005
|
+
} else {
|
|
1006
|
+
arr.push('to-input-mode-default');
|
|
1007
|
+
}
|
|
1008
|
+
if (this.inputProps.stepIconMode === 'arrow') {
|
|
1009
|
+
arr.push('to-input-step-icon-mode-' + this.inputProps.stepIconMode);
|
|
1010
|
+
}
|
|
1011
|
+
if (this.inputProps.readonly) {
|
|
1012
|
+
arr.push('to-input-state-readonly');
|
|
1013
|
+
}
|
|
1014
|
+
if (this.inputProps.focused && !this.inputProps.preventFocus) {
|
|
1015
|
+
arr.push('to-input-state-focus');
|
|
1016
|
+
}
|
|
1017
|
+
if (this.inputProps.changed) {
|
|
1018
|
+
arr.push('to-input-changed');
|
|
1019
|
+
}
|
|
1020
|
+
if (this.ToForm && this.ToForm.comparable || this.inputProps.comparable) {
|
|
1021
|
+
arr.push('to-compare');
|
|
1022
|
+
}
|
|
1023
|
+
return arr;
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
watch: {
|
|
1027
|
+
readonly: function readonly(val) {
|
|
1028
|
+
this.disabled = val;
|
|
1029
|
+
},
|
|
1030
|
+
value: function value(val) {
|
|
1031
|
+
if (this.start) {
|
|
1032
|
+
if (val && String(val).split(',').length > 1) {
|
|
1033
|
+
var value = val.split(',');
|
|
1034
|
+
if (Number(value[0]) >= this.range) {
|
|
1035
|
+
this.startVal = this.range;
|
|
1036
|
+
} else {
|
|
1037
|
+
this.startVal = Number(value[0]);
|
|
1038
|
+
}
|
|
1039
|
+
if (Number(value[1]) >= this.range) {
|
|
1040
|
+
this.val = this.range;
|
|
1041
|
+
} else {
|
|
1042
|
+
this.val = Number(value[1]);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
} else {
|
|
1046
|
+
if (Number(val) >= this.range) {
|
|
1047
|
+
this.val = this.range;
|
|
1048
|
+
} else {
|
|
1049
|
+
this.val = Number(val);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
this.initRangeVal();
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
mounted: function mounted() {
|
|
1056
|
+
var _this = this;
|
|
1365
1057
|
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1058
|
+
// 这里注意range的value改变不会触发视图刷新
|
|
1059
|
+
this.$nextTick(function () {
|
|
1060
|
+
_this.length = _this.$el.querySelector('.to-rangeBar');
|
|
1061
|
+
_this.initRangeVal();
|
|
1062
|
+
});
|
|
1063
|
+
},
|
|
1372
1064
|
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1065
|
+
methods: {
|
|
1066
|
+
initRangeVal: function initRangeVal() {
|
|
1067
|
+
if (this.start) {
|
|
1068
|
+
if (this.value) {
|
|
1069
|
+
var value = this.value.split(',');
|
|
1070
|
+
this.startVal = Number(value[0]) < 0 ? 0 : Number(value[0]) / this.range * this.range - this.min || 0;
|
|
1071
|
+
this.val = Number(value[1]) < 0 ? 0 : Number(value[1]) / this.range * this.range - this.min || 0;
|
|
1072
|
+
} else {
|
|
1073
|
+
this.startVal = 0;
|
|
1074
|
+
this.val = 0;
|
|
1075
|
+
}
|
|
1076
|
+
this.startProgress = this.startVal / this.range * 100;
|
|
1077
|
+
this.rangeProgress = this.val / this.range * 100;
|
|
1078
|
+
} else {
|
|
1079
|
+
this.val = Number(this.value) < 0 ? 0 : Number(this.value) / this.range * this.range - this.min || 0;
|
|
1080
|
+
this.rangeProgress = this.val / this.range * 100;
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
rangeBarClick: function rangeBarClick(e) {
|
|
1084
|
+
if (this.disabled) return;
|
|
1085
|
+
if (this.dragging) {
|
|
1086
|
+
var leftX = e.offsetX;
|
|
1087
|
+
this.x = e.clientX - leftX;
|
|
1088
|
+
if (this.start) {
|
|
1089
|
+
var startLeft = this.startProgress / this.range * this.length.offsetWidth;
|
|
1090
|
+
var endLeft = this.rangeProgress / this.range * this.length.offsetWidth;
|
|
1091
|
+
var startLeftAbs = Math.abs(startLeft - leftX);
|
|
1092
|
+
var endLeftAbs = Math.abs(endLeft - leftX);
|
|
1093
|
+
if (startLeftAbs >= endLeftAbs) {
|
|
1094
|
+
this.progress = leftX / this.length.offsetWidth * this.range;
|
|
1095
|
+
this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress;
|
|
1096
|
+
if (this.progress <= 0) {
|
|
1097
|
+
this.progress = 0;
|
|
1098
|
+
} else if (this.progress >= this.max) {
|
|
1099
|
+
this.progress = this.max;
|
|
1100
|
+
}
|
|
1101
|
+
var progress = this.val / this.range * 100;
|
|
1102
|
+
if (progress < 0) {
|
|
1103
|
+
progress = 0;
|
|
1104
|
+
} else if (progress > 100) {
|
|
1105
|
+
progress = 100;
|
|
1106
|
+
}
|
|
1107
|
+
this.rangeProgress = progress;
|
|
1108
|
+
} else {
|
|
1109
|
+
this.sProgress = leftX / this.length.offsetWidth * this.range;
|
|
1110
|
+
this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress;
|
|
1111
|
+
if (this.sProgress <= 0) {
|
|
1112
|
+
this.sProgress = 0;
|
|
1113
|
+
} else if (this.sProgress >= this.max) {
|
|
1114
|
+
this.sProgress = this.max;
|
|
1115
|
+
}
|
|
1116
|
+
var _progress = this.startVal / this.range * 100;
|
|
1117
|
+
if (_progress < 0) {
|
|
1118
|
+
_progress = 0;
|
|
1119
|
+
} else if (_progress > 100) {
|
|
1120
|
+
_progress = 100;
|
|
1121
|
+
}
|
|
1122
|
+
this.startProgress = _progress;
|
|
1123
|
+
}
|
|
1124
|
+
} else {
|
|
1125
|
+
this.progress = leftX / this.length.offsetWidth * this.range;
|
|
1126
|
+
this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress;
|
|
1127
|
+
if (this.progress <= 0) {
|
|
1128
|
+
this.progress = 0;
|
|
1129
|
+
} else if (this.progress >= this.max) {
|
|
1130
|
+
this.progress = this.max;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
this.$emit('change', this.rangeValue);
|
|
1134
|
+
}
|
|
1135
|
+
},
|
|
1376
1136
|
|
|
1377
|
-
|
|
1378
|
-
|
|
1137
|
+
startHandle: function startHandle(e) {
|
|
1138
|
+
if (this.disabled) return;
|
|
1139
|
+
this.isStart = true;
|
|
1140
|
+
this.isStartMove = 'start';
|
|
1141
|
+
if (this.isStart) {
|
|
1142
|
+
this.startX = e.touches[0].clientX;
|
|
1143
|
+
}
|
|
1144
|
+
},
|
|
1145
|
+
endStartHandle: function endStartHandle(e) {
|
|
1146
|
+
if (this.disabled) return;
|
|
1147
|
+
this.isStart = true;
|
|
1148
|
+
this.isStartMove = 'end';
|
|
1149
|
+
if (this.isStart) {
|
|
1150
|
+
this.endStartX = e.touches[0].clientX;
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
moveHandle: function moveHandle(e) {
|
|
1154
|
+
if (this.disabled) return;
|
|
1155
|
+
if (this.isStart) {
|
|
1156
|
+
this.moveX = e.touches[0].clientX;
|
|
1157
|
+
if (this.isStartMove === 'end') {
|
|
1158
|
+
this.progress = (this.x + this.moveX - this.endStartX) / this.length.offsetWidth * this.range;
|
|
1159
|
+
if (this.progress <= 0) {
|
|
1160
|
+
this.progress = 0;
|
|
1161
|
+
} else if (this.progress >= this.range) {
|
|
1162
|
+
this.progress = this.range;
|
|
1163
|
+
}
|
|
1164
|
+
var progress = this.progress / this.range * 100;
|
|
1165
|
+
if (progress < 0) {
|
|
1166
|
+
progress = 0;
|
|
1167
|
+
} else if (progress > 100) {
|
|
1168
|
+
progress = 100;
|
|
1169
|
+
}
|
|
1170
|
+
this.rangeProgress = progress;
|
|
1171
|
+
} else if (this.isStartMove === 'start') {
|
|
1172
|
+
this.sProgress = (this.sx + this.moveX - this.startX) / this.length.offsetWidth * this.range;
|
|
1173
|
+
if (this.sProgress <= 0) {
|
|
1174
|
+
this.sProgress = 0;
|
|
1175
|
+
} else if (this.sProgress >= this.range) {
|
|
1176
|
+
this.sProgress = this.range;
|
|
1177
|
+
}
|
|
1178
|
+
var _progress2 = this.sProgress / this.range * 100;
|
|
1179
|
+
if (_progress2 < 0) {
|
|
1180
|
+
_progress2 = 0;
|
|
1181
|
+
} else if (_progress2 > 100) {
|
|
1182
|
+
_progress2 = 100;
|
|
1183
|
+
}
|
|
1184
|
+
this.startProgress = _progress2;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1188
|
+
endHandle: function endHandle(e) {
|
|
1189
|
+
if (this.disabled) return;
|
|
1190
|
+
if (this.isStart) {
|
|
1191
|
+
if (this.isStartMove === 'end') {
|
|
1192
|
+
this.x += this.moveX - this.startX;
|
|
1193
|
+
if (this.progress <= 0) {
|
|
1194
|
+
this.x = 0;
|
|
1195
|
+
} else if (this.progress >= this.range) {
|
|
1196
|
+
this.x = this.length.offsetWidth;
|
|
1197
|
+
}
|
|
1198
|
+
} else if (this.isStartMove === 'start') {
|
|
1199
|
+
this.sx += this.moveX - this.endStartX;
|
|
1200
|
+
if (this.sProgress <= 0) {
|
|
1201
|
+
this.sx = 0;
|
|
1202
|
+
} else if (this.sProgress >= this.range) {
|
|
1203
|
+
this.sx = this.length.offsetWidth;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
this.isStart = false;
|
|
1207
|
+
}
|
|
1208
|
+
this.$emit('change', this.rangeValue);
|
|
1209
|
+
},
|
|
1210
|
+
inputStartHandle: function inputStartHandle(e) {
|
|
1211
|
+
var startVal = e.target.value;
|
|
1212
|
+
this.sProgress = startVal;
|
|
1213
|
+
this.startVal = Number(startVal) / this.range * this.range - this.min || 0;
|
|
1214
|
+
var that = this;
|
|
1215
|
+
var timer = null;
|
|
1216
|
+
timer = setTimeout(function () {
|
|
1217
|
+
if (startVal < 0) {
|
|
1218
|
+
that.sProgress = 0;
|
|
1219
|
+
that.startVal = 0;
|
|
1220
|
+
}
|
|
1221
|
+
if (startVal > that.range) {
|
|
1222
|
+
that.sProgress = that.range;
|
|
1223
|
+
that.startVal = that.range;
|
|
1224
|
+
}
|
|
1225
|
+
that.startProgress = that.startVal / that.range * 100;
|
|
1226
|
+
that.$emit('change', that.rangeValue);
|
|
1227
|
+
clearTimeout(timer);
|
|
1228
|
+
timer = null;
|
|
1229
|
+
}, 0);
|
|
1230
|
+
},
|
|
1231
|
+
inputEndHandle: function inputEndHandle(e) {
|
|
1232
|
+
var endVal = e.target.value;
|
|
1233
|
+
this.progress = endVal;
|
|
1234
|
+
this.val = Number(endVal) / this.range * this.range - this.min || 0;
|
|
1235
|
+
this.startProgress = this.startVal / this.range * 100;
|
|
1236
|
+
this.rangeProgress = this.val / this.range * 100;
|
|
1237
|
+
var that = this;
|
|
1238
|
+
var timer = null;
|
|
1239
|
+
timer = setTimeout(function () {
|
|
1240
|
+
if (endVal < 0) {
|
|
1241
|
+
that.progress = 0;
|
|
1242
|
+
that.val = 0;
|
|
1243
|
+
}
|
|
1244
|
+
if (endVal > that.range) {
|
|
1245
|
+
that.progress = that.range;
|
|
1246
|
+
that.val = that.range;
|
|
1247
|
+
}
|
|
1248
|
+
that.rangeProgress = that.val / that.range * 100;
|
|
1249
|
+
that.$emit('change', that.rangeValue);
|
|
1250
|
+
clearTimeout(timer);
|
|
1251
|
+
timer = null;
|
|
1252
|
+
}, 0);
|
|
1253
|
+
},
|
|
1254
|
+
inputHandle: function inputHandle(e) {
|
|
1255
|
+
if (!this.start) {
|
|
1256
|
+
this.progress = e.target.value;
|
|
1257
|
+
if (Number(e.target.value) < 0) {
|
|
1258
|
+
this.progress = 0;
|
|
1259
|
+
} else if (Number(e.target.value) > 100) {
|
|
1260
|
+
this.progress = 100;
|
|
1261
|
+
}
|
|
1262
|
+
this.val = Number(e.target.value) < 0 ? 0 : Number(e.target.value) / this.range * this.range - this.min || 0;
|
|
1263
|
+
this.rangeProgress = this.val / this.range * 100;
|
|
1264
|
+
var that = this;
|
|
1265
|
+
var timer = null;
|
|
1266
|
+
timer = setTimeout(function () {
|
|
1267
|
+
if (e.target.value < 0) {
|
|
1268
|
+
that.progress = 0;
|
|
1269
|
+
that.val = 0;
|
|
1270
|
+
}
|
|
1271
|
+
if (e.target.value > that.range) {
|
|
1272
|
+
that.progress = that.range;
|
|
1273
|
+
that.val = that.range;
|
|
1274
|
+
}
|
|
1275
|
+
that.rangeProgress = that.val / that.range * 100;
|
|
1276
|
+
// that.value = that.rangeProgress
|
|
1277
|
+
that.$emit('change', that.rangeValue);
|
|
1278
|
+
clearTimeout(timer);
|
|
1279
|
+
timer = null;
|
|
1280
|
+
}, 0);
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
onButtonDown: function onButtonDown(event) {
|
|
1284
|
+
if (this.disabled) return;
|
|
1285
|
+
event.preventDefault();
|
|
1286
|
+
this.isStartMove = 'end';
|
|
1287
|
+
this.onDragStart(event);
|
|
1288
|
+
window.addEventListener('mousemove', this.onDragging);
|
|
1289
|
+
window.addEventListener('touchmove', this.onDragging);
|
|
1290
|
+
window.addEventListener('mouseup', this.onDragEnd);
|
|
1291
|
+
window.addEventListener('touchend', this.onDragEnd);
|
|
1292
|
+
window.addEventListener('contextmenu', this.onDragEnd);
|
|
1293
|
+
},
|
|
1294
|
+
onStartButtonDown: function onStartButtonDown(event) {
|
|
1295
|
+
if (this.disabled) return;
|
|
1296
|
+
event.preventDefault();
|
|
1297
|
+
this.isStartMove = 'start';
|
|
1298
|
+
this.onDragStart(event);
|
|
1299
|
+
window.addEventListener('mousemove', this.onDragging);
|
|
1300
|
+
window.addEventListener('touchmove', this.onDragging);
|
|
1301
|
+
window.addEventListener('mouseup', this.onDragEnd);
|
|
1302
|
+
window.addEventListener('touchend', this.onDragEnd);
|
|
1303
|
+
window.addEventListener('contextmenu', this.onDragEnd);
|
|
1304
|
+
},
|
|
1305
|
+
onDragging: function onDragging(event) {
|
|
1306
|
+
if (this.dragging) {
|
|
1307
|
+
if (event.type === 'touchmove') {
|
|
1308
|
+
event.clientY = event.touches[0].clientY;
|
|
1309
|
+
event.clientX = event.touches[0].clientX;
|
|
1310
|
+
}
|
|
1311
|
+
var currentX = event.clientX;
|
|
1312
|
+
if (this.isStartMove === 'end') {
|
|
1313
|
+
var diff = (currentX - this.startMoveX) / this.length.offsetWidth * this.range;
|
|
1314
|
+
this.progress = this.startPosition + diff;
|
|
1315
|
+
if (this.progress <= 0) {
|
|
1316
|
+
this.progress = 0;
|
|
1317
|
+
} else if (this.progress >= this.range) {
|
|
1318
|
+
this.progress = this.range;
|
|
1319
|
+
}
|
|
1320
|
+
if (this.startProgress >= this.progress) {
|
|
1321
|
+
this.progress = this.startProgress;
|
|
1322
|
+
}
|
|
1323
|
+
var progress = this.progress / this.range * 100;
|
|
1324
|
+
if (progress < 0) {
|
|
1325
|
+
progress = 0;
|
|
1326
|
+
} else if (progress > 100) {
|
|
1327
|
+
progress = 100;
|
|
1328
|
+
}
|
|
1329
|
+
this.rangeProgress = progress;
|
|
1330
|
+
} else if (this.isStartMove === 'start') {
|
|
1331
|
+
var _diff = (currentX - this.sStartMoveX) / this.length.offsetWidth * this.range;
|
|
1332
|
+
this.sProgress = this.sStartPosition + _diff;
|
|
1333
|
+
if (this.sProgress <= 0) {
|
|
1334
|
+
this.sProgress = 0;
|
|
1335
|
+
} else if (this.sProgress >= this.rangeProgress) {
|
|
1336
|
+
this.sProgress = this.rangeProgress;
|
|
1337
|
+
} else if (this.sProgress >= this.range) {
|
|
1338
|
+
this.sProgress = this.range;
|
|
1339
|
+
}
|
|
1340
|
+
var _progress3 = this.sProgress / this.range * 100;
|
|
1341
|
+
if (_progress3 < 0) {
|
|
1342
|
+
_progress3 = 0;
|
|
1343
|
+
} else if (_progress3 > 100) {
|
|
1344
|
+
_progress3 = 100;
|
|
1345
|
+
}
|
|
1346
|
+
this.startProgress = _progress3;
|
|
1347
|
+
}
|
|
1348
|
+
this.$emit('change', this.rangeValue);
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
onDragStart: function onDragStart(event) {
|
|
1352
|
+
this.dragging = true;
|
|
1353
|
+
if (event.type === 'touchstart') {
|
|
1354
|
+
event.clientY = event.touches[0].clientY;
|
|
1355
|
+
event.clientX = event.touches[0].clientX;
|
|
1356
|
+
}
|
|
1357
|
+
if (this.isStartMove === 'end') {
|
|
1358
|
+
this.startMoveX = event.clientX;
|
|
1359
|
+
this.startPosition = parseFloat(this.progress);
|
|
1360
|
+
} else if (this.isStartMove === 'start') {
|
|
1361
|
+
this.sStartMoveX = event.clientX;
|
|
1362
|
+
this.sStartPosition = parseFloat(this.sProgress);
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
onDragEnd: function onDragEnd() {
|
|
1366
|
+
var _this2 = this;
|
|
1379
1367
|
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1368
|
+
if (this.dragging) {
|
|
1369
|
+
if (this.isStartMove === 'end') {
|
|
1370
|
+
this.progress = this.step ? this.step * Math.round(this.progress / this.step) : this.progress;
|
|
1371
|
+
var progress = this.val / this.range * 100;
|
|
1372
|
+
if (progress < 0) {
|
|
1373
|
+
progress = 0;
|
|
1374
|
+
} else if (progress > 100) {
|
|
1375
|
+
progress = 100;
|
|
1376
|
+
}
|
|
1377
|
+
if (this.startProgress >= progress) {
|
|
1378
|
+
progress = this.startProgress;
|
|
1379
|
+
}
|
|
1380
|
+
this.rangeProgress = progress;
|
|
1381
|
+
} else if (this.isStartMove === 'start') {
|
|
1382
|
+
this.sProgress = this.step ? this.step * Math.round(this.sProgress / this.step) : this.sProgress;
|
|
1383
|
+
var _progress4 = this.startVal / this.range * 100;
|
|
1384
|
+
if (_progress4 < 0) {
|
|
1385
|
+
_progress4 = 0;
|
|
1386
|
+
} else if (_progress4 >= this.rangeProgress) {
|
|
1387
|
+
_progress4 = this.rangeProgress;
|
|
1388
|
+
} else if (_progress4 > 100) {
|
|
1389
|
+
_progress4 = 100;
|
|
1390
|
+
}
|
|
1391
|
+
this.startProgress = _progress4;
|
|
1392
|
+
}
|
|
1384
1393
|
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1394
|
+
/*
|
|
1395
|
+
* 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
|
|
1396
|
+
* 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
|
|
1397
|
+
*/
|
|
1398
|
+
this.dragging = false;
|
|
1399
|
+
var timer = null;
|
|
1400
|
+
timer = setTimeout(function () {
|
|
1401
|
+
_this2.dragging = true;
|
|
1402
|
+
clearTimeout(timer);
|
|
1403
|
+
timer = null;
|
|
1404
|
+
}, 200);
|
|
1405
|
+
window.removeEventListener('mousemove', this.onDragging);
|
|
1406
|
+
window.removeEventListener('touchmove', this.onDragging);
|
|
1407
|
+
window.removeEventListener('mouseup', this.onDragEnd);
|
|
1408
|
+
window.removeEventListener('touchend', this.onDragEnd);
|
|
1409
|
+
window.removeEventListener('contextmenu', this.onDragEnd);
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
setDisabled: function setDisabled(f) {
|
|
1413
|
+
this.disabled = f;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
// CONCATENATED MODULE: ./packages/range/src/range.vue?vue&type=script&lang=js
|
|
1418
|
+
/* harmony default export */ var src_rangevue_type_script_lang_js = (rangevue_type_script_lang_js);
|
|
1419
|
+
// EXTERNAL MODULE: ./packages/range/src/range.vue?vue&type=style&index=0&id=19fdc744&prod&lang=css
|
|
1420
|
+
var rangevue_type_style_index_0_id_19fdc744_prod_lang_css = __webpack_require__(93);
|
|
1393
1421
|
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
};
|
|
1397
|
-
}
|
|
1422
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
1423
|
+
var componentNormalizer = __webpack_require__(0);
|
|
1398
1424
|
|
|
1399
|
-
|
|
1400
|
-
return function updateStyle(newObj) {
|
|
1401
|
-
if (newObj) {
|
|
1402
|
-
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
|
|
1403
|
-
return;
|
|
1404
|
-
}
|
|
1425
|
+
// CONCATENATED MODULE: ./packages/range/src/range.vue
|
|
1405
1426
|
|
|
1406
|
-
update(obj = newObj);
|
|
1407
|
-
} else {
|
|
1408
|
-
remove();
|
|
1409
|
-
}
|
|
1410
|
-
};
|
|
1411
|
-
}
|
|
1412
1427
|
|
|
1413
|
-
module.exports = function (list, options) {
|
|
1414
|
-
options = options || {};
|
|
1415
|
-
options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
|
1416
|
-
// tags it will allow on a page
|
|
1417
1428
|
|
|
1418
|
-
if (!options.singleton && typeof options.singleton !== 'boolean') {
|
|
1419
|
-
options.singleton = isOldIE();
|
|
1420
|
-
}
|
|
1421
1429
|
|
|
1422
|
-
var styles = listToStyles(list, options);
|
|
1423
|
-
addStylesToDom(styles, options);
|
|
1424
|
-
return function update(newList) {
|
|
1425
|
-
var mayRemove = [];
|
|
1426
1430
|
|
|
1427
|
-
for (var i = 0; i < styles.length; i++) {
|
|
1428
|
-
var item = styles[i];
|
|
1429
|
-
var domStyle = stylesInDom[item.id];
|
|
1430
1431
|
|
|
1431
|
-
|
|
1432
|
-
domStyle.refs--;
|
|
1433
|
-
mayRemove.push(domStyle);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1432
|
+
/* normalize component */
|
|
1436
1433
|
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1434
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
1435
|
+
src_rangevue_type_script_lang_js,
|
|
1436
|
+
render,
|
|
1437
|
+
staticRenderFns,
|
|
1438
|
+
false,
|
|
1439
|
+
null,
|
|
1440
|
+
null,
|
|
1441
|
+
null
|
|
1442
|
+
|
|
1443
|
+
)
|
|
1441
1444
|
|
|
1442
|
-
|
|
1443
|
-
|
|
1445
|
+
/* harmony default export */ var range = (component.exports);
|
|
1446
|
+
// CONCATENATED MODULE: ./packages/range/index.js
|
|
1444
1447
|
|
|
1445
|
-
if (_domStyle.refs === 0) {
|
|
1446
|
-
for (var j = 0; j < _domStyle.parts.length; j++) {
|
|
1447
|
-
_domStyle.parts[j]();
|
|
1448
|
-
}
|
|
1449
1448
|
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
};
|
|
1449
|
+
/* istanbul ignore next */
|
|
1450
|
+
range.install = function (Vue) {
|
|
1451
|
+
Vue.component(range.name, range);
|
|
1454
1452
|
};
|
|
1455
1453
|
|
|
1454
|
+
/* harmony default export */ var packages_range = __webpack_exports__["default"] = (range);
|
|
1455
|
+
|
|
1456
1456
|
/***/ }),
|
|
1457
1457
|
|
|
1458
|
-
/***/
|
|
1458
|
+
/***/ 93:
|
|
1459
1459
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1460
1460
|
|
|
1461
1461
|
"use strict";
|
|
@@ -1466,10 +1466,10 @@ module.exports = function (list, options) {
|
|
|
1466
1466
|
|
|
1467
1467
|
/***/ }),
|
|
1468
1468
|
|
|
1469
|
-
/***/
|
|
1469
|
+
/***/ 94:
|
|
1470
1470
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1471
1471
|
|
|
1472
|
-
exports = module.exports = __webpack_require__(
|
|
1472
|
+
exports = module.exports = __webpack_require__(11)(false);
|
|
1473
1473
|
// Module
|
|
1474
1474
|
exports.push([module.i, "\n//.to-rangeProgress{ transition: width 0.01s ease;\n}\n", ""]);
|
|
1475
1475
|
|