@progress/kendo-charts 1.22.0 → 1.23.0-dev.202201111041

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.
Files changed (57) hide show
  1. package/dist/cdn/js/kendo-charts.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/common/keys.js +25 -0
  4. package/dist/es/common.js +1 -0
  5. package/dist/es/drawing-utils.js +27 -3
  6. package/dist/es/main.js +1 -0
  7. package/dist/es/map/attribution.js +157 -0
  8. package/dist/es/map/crs.js +277 -0
  9. package/dist/es/map/datums.js +16 -0
  10. package/dist/es/map/extent.js +129 -0
  11. package/dist/es/map/layers/bubble.js +185 -0
  12. package/dist/es/map/layers/layer.js +140 -0
  13. package/dist/es/map/layers/marker.js +348 -0
  14. package/dist/es/map/layers/shape.js +390 -0
  15. package/dist/es/map/layers/tile.js +481 -0
  16. package/dist/es/map/location.js +201 -0
  17. package/dist/es/map/map.js +930 -0
  18. package/dist/es/map/navigator.js +174 -0
  19. package/dist/es/map/scroller/draggable.js +454 -0
  20. package/dist/es/map/scroller/fx.js +119 -0
  21. package/dist/es/map/scroller/observable.js +151 -0
  22. package/dist/es/map/scroller/scroller.js +746 -0
  23. package/dist/es/map/scroller/user-events.js +712 -0
  24. package/dist/es/map/utils.js +459 -0
  25. package/dist/es/map/zoom.js +139 -0
  26. package/dist/es/map.js +1 -0
  27. package/dist/es/services/map-service.js +15 -0
  28. package/dist/es2015/common/keys.js +25 -0
  29. package/dist/es2015/common.js +1 -0
  30. package/dist/es2015/drawing-utils.js +43 -3
  31. package/dist/es2015/main.js +1 -0
  32. package/dist/es2015/map/attribution.js +147 -0
  33. package/dist/es2015/map/crs.js +233 -0
  34. package/dist/es2015/map/datums.js +16 -0
  35. package/dist/es2015/map/extent.js +115 -0
  36. package/dist/es2015/map/layers/bubble.js +167 -0
  37. package/dist/es2015/map/layers/layer.js +134 -0
  38. package/dist/es2015/map/layers/marker.js +328 -0
  39. package/dist/es2015/map/layers/shape.js +370 -0
  40. package/dist/es2015/map/layers/tile.js +455 -0
  41. package/dist/es2015/map/location.js +193 -0
  42. package/dist/es2015/map/map.js +906 -0
  43. package/dist/es2015/map/navigator.js +169 -0
  44. package/dist/es2015/map/scroller/draggable.js +418 -0
  45. package/dist/es2015/map/scroller/fx.js +112 -0
  46. package/dist/es2015/map/scroller/observable.js +143 -0
  47. package/dist/es2015/map/scroller/scroller.js +716 -0
  48. package/dist/es2015/map/scroller/user-events.js +694 -0
  49. package/dist/es2015/map/utils.js +459 -0
  50. package/dist/es2015/map/zoom.js +134 -0
  51. package/dist/es2015/map.js +1 -0
  52. package/dist/es2015/services/map-service.js +15 -0
  53. package/dist/npm/main.d.ts +1 -0
  54. package/dist/npm/main.js +6180 -342
  55. package/dist/npm/map.d.ts +4 -0
  56. package/dist/systemjs/kendo-charts.js +1 -1
  57. package/package.json +1 -1
@@ -0,0 +1,716 @@
1
+ // todo: extract to a separate place
2
+
3
+ import {
4
+ Class,
5
+ deepExtend,
6
+ addClass,
7
+ isFunction,
8
+ setDefaultOptions
9
+ } from '../../common';
10
+
11
+ import {
12
+ convertToHtml,
13
+ prepend,
14
+ wrapInner,
15
+ contains,
16
+ hasNativeScrolling,
17
+ on,
18
+ off,
19
+ proxy,
20
+ wheelDeltaY,
21
+ setDefaultEvents
22
+ } from '../utils';
23
+
24
+ import {
25
+ Transition,
26
+ Animation
27
+ } from './fx';
28
+
29
+ import {
30
+ Pane,
31
+ PaneDimensions,
32
+ Movable,
33
+ TapCapture
34
+ } from './draggable';
35
+
36
+ import {
37
+ UserEvents
38
+ } from './user-events';
39
+
40
+ import {
41
+ Observable
42
+ } from './observable';
43
+
44
+ let
45
+ extend = Object.assign,
46
+ abs = Math.abs,
47
+ SNAPBACK_DURATION = 500,
48
+ SCROLLBAR_OPACITY = 0.7,
49
+ FRICTION = 0.96,
50
+ VELOCITY_MULTIPLIER = 10,
51
+ MAX_VELOCITY = 55,
52
+ OUT_OF_BOUNDS_FRICTION = 0.5,
53
+ ANIMATED_SCROLLER_PRECISION = 5,
54
+ // SCROLLER_RELEASE_CLASS = 'km-scroller-release',
55
+ // SCROLLER_REFRESH_CLASS = 'km-scroller-refresh',
56
+ PULL = 'pull',
57
+ CHANGE = 'change',
58
+ RESIZE = 'resize',
59
+ SCROLL = 'scroll',
60
+ MOUSE_WHEEL_ID = 2;
61
+
62
+ class ZoomSnapBack extends Animation {
63
+ constructor(options) {
64
+ super(options);
65
+ let that = this;
66
+ extend(that, options);
67
+ that.userEvents.bind('gestureend', that.start.bind(this));
68
+ that.tapCapture.bind('press', that.cancel.bind(this));
69
+ }
70
+
71
+ enabled() {
72
+ return this.movable.scale < this.dimensions.minScale;
73
+ }
74
+
75
+ done() {
76
+ return this.dimensions.minScale - this.movable.scale < 0.01;
77
+ }
78
+
79
+ tick() {
80
+ let movable = this.movable;
81
+ movable.scaleWith(1.1);
82
+ this.dimensions.rescale(movable.scale);
83
+ }
84
+
85
+ onEnd() {
86
+ let movable = this.movable;
87
+ movable.scaleTo(this.dimensions.minScale);
88
+ this.dimensions.rescale(movable.scale);
89
+ }
90
+ }
91
+
92
+ class DragInertia extends Animation {
93
+ constructor(options) {
94
+ super();
95
+ let that = this;
96
+
97
+ extend(that, options, {
98
+ transition: new Transition({
99
+ axis: options.axis,
100
+ movable: options.movable,
101
+ onEnd() {
102
+ that._end();
103
+ }
104
+ })
105
+ });
106
+
107
+ that.tapCapture.bind('press', function() {
108
+ that.cancel();
109
+ });
110
+
111
+ that.userEvents.bind('end', proxy(that.start, that));
112
+ that.userEvents.bind('gestureend', proxy(that.start, that));
113
+ that.userEvents.bind('tap', proxy(that.onEnd, that));
114
+ }
115
+
116
+ onCancel() {
117
+ this.transition.cancel();
118
+ }
119
+
120
+ freeze(location) {
121
+ let that = this;
122
+ that.cancel();
123
+ that._moveTo(location);
124
+ }
125
+
126
+ onEnd() {
127
+ let that = this;
128
+ if (that.paneAxis.outOfBounds()) {
129
+ that._snapBack();
130
+ } else {
131
+ that._end();
132
+ }
133
+ }
134
+
135
+ done() {
136
+ return abs(this.velocity) < 1;
137
+ }
138
+
139
+ start(e) {
140
+ let that = this,
141
+ velocity;
142
+ if (!that.dimension.enabled) {
143
+ return;
144
+ }
145
+ if (that.paneAxis.outOfBounds()) {
146
+ if (that.transition._started) {
147
+ that.transition.cancel();
148
+ that.velocity = Math.min(e.touch[that.axis].velocity * that.velocityMultiplier, MAX_VELOCITY);
149
+ super.start();
150
+ } else {
151
+ that._snapBack();
152
+ }
153
+ } else {
154
+ velocity = e.touch.id === MOUSE_WHEEL_ID ? 0 : e.touch[that.axis].velocity;
155
+ that.velocity = Math.max(Math.min(velocity * that.velocityMultiplier, MAX_VELOCITY), -MAX_VELOCITY);
156
+ that.tapCapture.captureNext();
157
+ super.start();
158
+ }
159
+ }
160
+
161
+ tick() {
162
+ let that = this,
163
+ dimension = that.dimension,
164
+ friction = that.paneAxis.outOfBounds() ? OUT_OF_BOUNDS_FRICTION : that.friction,
165
+ delta = that.velocity *= friction,
166
+ location = that.movable[that.axis] + delta;
167
+
168
+ if (!that.elastic && dimension.outOfBounds(location)) {
169
+ location = Math.max(Math.min(location, dimension.max), dimension.min);
170
+ that.velocity = 0;
171
+ }
172
+
173
+ that.movable.moveAxis(that.axis, location);
174
+ }
175
+
176
+ _end() {
177
+ this.tapCapture.cancelCapture();
178
+ this.end();
179
+ }
180
+
181
+ _snapBack() {
182
+ let that = this,
183
+ dimension = that.dimension,
184
+ snapBack = that.movable[that.axis] > dimension.max ? dimension.max : dimension.min;
185
+
186
+ that._moveTo(snapBack);
187
+ }
188
+
189
+ _moveTo(location) {
190
+ this.transition.moveTo({
191
+ location: location,
192
+ duration: SNAPBACK_DURATION,
193
+ ease: Transition.easeOutExpo
194
+ });
195
+ }
196
+ }
197
+
198
+ class AnimatedScroller extends Animation {
199
+ constructor(options) {
200
+ super(options);
201
+ let that = this;
202
+
203
+ extend(that, options, {
204
+ origin: {},
205
+ destination: {},
206
+ offset: {}
207
+ });
208
+ }
209
+
210
+ tick() {
211
+ this._updateCoordinates();
212
+ this.moveTo(this.origin);
213
+ }
214
+
215
+ done() {
216
+ return abs(this.offset.y) < ANIMATED_SCROLLER_PRECISION && abs(this.offset.x) < ANIMATED_SCROLLER_PRECISION;
217
+ }
218
+
219
+ onEnd() {
220
+ this.moveTo(this.destination);
221
+ if (this.callback) {
222
+ this.callback.call();
223
+ }
224
+ }
225
+
226
+ setCoordinates(from, to) {
227
+ this.offset = {};
228
+ this.origin = from;
229
+ this.destination = to;
230
+ }
231
+
232
+ /* eslint-disable no-param-reassign */
233
+ setCallback(callback) {
234
+ if (callback && isFunction(callback)) {
235
+ this.callback = callback;
236
+ } else {
237
+ callback = undefined;
238
+ }
239
+ }
240
+ /* eslint-enable no-param-reassign */
241
+
242
+ _updateCoordinates() {
243
+ this.offset = {
244
+ x: (this.destination.x - this.origin.x) / 4,
245
+ y: (this.destination.y - this.origin.y) / 4
246
+ };
247
+ this.origin = {
248
+ y: this.origin.y + this.offset.y,
249
+ x: this.origin.x + this.offset.x
250
+ };
251
+ }
252
+ }
253
+
254
+ class ScrollBar extends Class {
255
+ constructor(options) {
256
+ super();
257
+ let that = this,
258
+ horizontal = options.axis === 'x';
259
+
260
+ const orientation = (horizontal ? 'horizontal' : 'vertical');
261
+ const element = convertToHtml('<div class="km-touch-scrollbar km-' + orientation + '-scrollbar" />');
262
+
263
+ extend(that, options, {
264
+ element: element,
265
+ elementSize: 0,
266
+ movable: new Movable(element),
267
+ scrollMovable: options.movable,
268
+ alwaysVisible: options.alwaysVisible,
269
+ size: horizontal ? 'width' : 'height'
270
+ });
271
+
272
+ that.scrollMovable.bind(CHANGE, that.refresh.bind(that));
273
+
274
+ that.container.appendChild(element);
275
+
276
+ if (options.alwaysVisible) {
277
+ that.show();
278
+ }
279
+ }
280
+
281
+ refresh() {
282
+ let that = this,
283
+ axis = that.axis,
284
+ dimension = that.dimension,
285
+ paneSize = dimension.size,
286
+ scrollMovable = that.scrollMovable,
287
+ sizeRatio = paneSize / dimension.total,
288
+ position = Math.round(-scrollMovable[axis] * sizeRatio),
289
+ size = Math.round(paneSize * sizeRatio);
290
+ if (sizeRatio >= 1) {
291
+ this.element.style.display = "none";
292
+ } else {
293
+ this.element.style.display = "";
294
+ }
295
+ if (position + size > paneSize) {
296
+ size = paneSize - position;
297
+ } else if (position < 0) {
298
+ size += position;
299
+ position = 0;
300
+ }
301
+ if (that.elementSize !== size) {
302
+ that.element.style[that.size] = size + 'px';
303
+ that.elementSize = size;
304
+ }
305
+ that.movable.moveAxis(axis, position);
306
+ }
307
+
308
+ show() {
309
+ this.element.style.opacity = SCROLLBAR_OPACITY;
310
+ this.element.style.visibility = "visible";
311
+ }
312
+
313
+ hide() {
314
+ if (!this.alwaysVisible) {
315
+ this.element.style.opacity = 0;
316
+ }
317
+ }
318
+ }
319
+
320
+ // export class Scroller extends Class {
321
+ export class Scroller extends Observable {
322
+ constructor(element, options) {
323
+ super();
324
+ let that = this;
325
+ this.element = element;
326
+
327
+ this._initOptions(options);
328
+
329
+ const hasScrolling = hasNativeScrolling(navigator.userAgent);
330
+ that._native = that.options.useNative && hasScrolling;
331
+ const scrollHeader = convertToHtml('<div class="km-scroll-header"/>');
332
+
333
+ if (that._native) {
334
+ addClass(element, 'km-native-scroller');
335
+ prepend(scrollHeader, element);
336
+
337
+ extend(that, {
338
+ scrollElement: element,
339
+ fixedContainer: element.children[0]
340
+ });
341
+
342
+ return;
343
+ }
344
+
345
+ element.style.overflow = "hidden";
346
+ addClass(element, 'km-scroll-wrapper');
347
+
348
+ const scrollContainer = convertToHtml('<div class="km-scroll-container"/>');
349
+ wrapInner(element, scrollContainer);
350
+ prepend(scrollHeader, element);
351
+
352
+ let inner = element.children[1],
353
+ tapCapture = new TapCapture(element),
354
+ movable = new Movable(inner),
355
+
356
+ dimensions = new PaneDimensions({
357
+ element: inner,
358
+ container: element,
359
+ forcedEnabled: that.options.zoom
360
+ }),
361
+ avoidScrolling = this.options.avoidScrolling,
362
+
363
+ userEvents = new UserEvents(element, {
364
+ touchAction: 'pan-y',
365
+ fastTap: true,
366
+ allowSelection: true,
367
+ preventDragEvent: true,
368
+ captureUpIfMoved: true,
369
+ multiTouch: that.options.zoom,
370
+ supportDoubleTap: that.options.supportDoubleTap,
371
+ start(e) {
372
+ dimensions.refresh();
373
+ let velocityX = abs(e.x.velocity),
374
+ velocityY = abs(e.y.velocity),
375
+ horizontalSwipe = velocityX * 2 >= velocityY,
376
+ originatedFromFixedContainer = contains(that.fixedContainer, e.event.target),
377
+ verticalSwipe = velocityY * 2 >= velocityX;
378
+ if (!originatedFromFixedContainer && !avoidScrolling(e) && that.enabled && (dimensions.x.enabled && horizontalSwipe || dimensions.y.enabled && verticalSwipe)) {
379
+ userEvents.capture();
380
+ } else {
381
+ userEvents.cancel();
382
+ }
383
+ }
384
+ }),
385
+
386
+ pane = new Pane({
387
+ movable: movable,
388
+ dimensions: dimensions,
389
+ userEvents: userEvents,
390
+ elastic: that.options.elastic
391
+ }),
392
+
393
+ zoomSnapBack = new ZoomSnapBack({
394
+ movable: movable,
395
+ dimensions: dimensions,
396
+ userEvents: userEvents,
397
+ tapCapture: tapCapture
398
+ }),
399
+
400
+ animatedScroller = new AnimatedScroller({
401
+ moveTo(coordinates) {
402
+ that.scrollTo(coordinates.x, coordinates.y);
403
+ }
404
+ });
405
+
406
+ movable.bind(CHANGE, function() {
407
+ that.scrollTop = -movable.y;
408
+ that.scrollLeft = -movable.x;
409
+ that.trigger(SCROLL, {
410
+ scrollTop: that.scrollTop,
411
+ scrollLeft: that.scrollLeft
412
+ });
413
+ });
414
+
415
+ if (that.options.mousewheelScrolling) {
416
+ this._wheelScrollHandler = this._wheelScroll.bind(this);
417
+ on(element, 'DOMMouseScroll mousewheel', this._wheelScrollHandler);
418
+ }
419
+
420
+ extend(that, {
421
+ movable: movable,
422
+ dimensions: dimensions,
423
+ zoomSnapBack: zoomSnapBack,
424
+ animatedScroller: animatedScroller,
425
+ userEvents: userEvents,
426
+ pane: pane,
427
+ tapCapture: tapCapture,
428
+ pulled: false,
429
+ enabled: true,
430
+ scrollElement: inner,
431
+ scrollTop: 0,
432
+ scrollLeft: 0,
433
+ fixedContainer: element.children[0]
434
+ });
435
+
436
+ that._initAxis('x');
437
+ that._initAxis('y');
438
+
439
+ that._wheelEnd = function() {
440
+ that._wheel = false;
441
+ that.userEvents.end(0, that._wheelY);
442
+ };
443
+
444
+ dimensions.refresh();
445
+
446
+ if (that.options.pullToRefresh) {
447
+ that._initPullToRefresh();
448
+ }
449
+ }
450
+
451
+ _initOptions(options) {
452
+ this.options = deepExtend({}, this.options, options);
453
+ }
454
+
455
+ _wheelScroll(e) {
456
+ if (e.ctrlKey) {
457
+ return;
458
+ }
459
+ if (!this._wheel) {
460
+ this._wheel = true;
461
+ this._wheelY = 0;
462
+ this.userEvents.press(0, this._wheelY);
463
+ }
464
+
465
+ clearTimeout(this._wheelTimeout);
466
+ this._wheelTimeout = setTimeout(this._wheelEnd, 50);
467
+ let delta = wheelDeltaY(e);
468
+
469
+ if (delta) {
470
+ this._wheelY += delta;
471
+ this.userEvents.move(0, this._wheelY);
472
+ }
473
+
474
+ e.preventDefault();
475
+ }
476
+
477
+ makeVirtual() {
478
+ this.dimensions.y.makeVirtual();
479
+ }
480
+
481
+ virtualSize(min, max) {
482
+ this.dimensions.y.virtualSize(min, max);
483
+ }
484
+
485
+ height() {
486
+ return this.dimensions.y.size;
487
+ }
488
+
489
+ scrollHeight() {
490
+ return this.scrollElement.scrollHeight;
491
+ }
492
+
493
+ scrollWidth() {
494
+ return this.scrollElement.scrollWidth;
495
+ }
496
+
497
+ _resize() {
498
+ if (!this._native) {
499
+ this.contentResized();
500
+ }
501
+ }
502
+
503
+ setOptions(options) {
504
+ let that = this;
505
+
506
+ this._initOptions(options);
507
+
508
+ if (options.pullToRefresh) {
509
+ that._initPullToRefresh();
510
+ }
511
+ }
512
+
513
+ reset() {
514
+ if (this._native) {
515
+ this.scrollElement.scrollTop(0);
516
+ } else {
517
+ this.movable.moveTo({
518
+ x: 0,
519
+ y: 0
520
+ });
521
+ this._scale(1);
522
+ }
523
+ }
524
+
525
+ contentResized() {
526
+ this.dimensions.refresh();
527
+ if (this.pane.x.outOfBounds()) {
528
+ this.movable.moveAxis('x', this.dimensions.x.min);
529
+ }
530
+ if (this.pane.y.outOfBounds()) {
531
+ this.movable.moveAxis('y', this.dimensions.y.min);
532
+ }
533
+ }
534
+
535
+ zoomOut() {
536
+ let dimensions = this.dimensions;
537
+ dimensions.refresh();
538
+ this._scale(dimensions.fitScale);
539
+ this.movable.moveTo(dimensions.centerCoordinates());
540
+ }
541
+
542
+ enable() {
543
+ this.enabled = true;
544
+ }
545
+
546
+ disable() {
547
+ this.enabled = false;
548
+ }
549
+
550
+ scrollTo(x, y) {
551
+ if (this._native) {
552
+ this.scrollElement.scrollLeft(abs(x));
553
+ this.scrollElement.scrollTop(abs(y));
554
+ } else {
555
+ this.dimensions.refresh();
556
+ this.movable.moveTo({
557
+ x: x,
558
+ y: y
559
+ });
560
+ }
561
+ }
562
+
563
+ animatedScrollTo(x, y, callback) {
564
+ let from, to;
565
+ if (this._native) {
566
+ this.scrollTo(x, y);
567
+ } else {
568
+ from = {
569
+ x: this.movable.x,
570
+ y: this.movable.y
571
+ };
572
+ to = {
573
+ x: x,
574
+ y: y
575
+ };
576
+ this.animatedScroller.setCoordinates(from, to);
577
+ this.animatedScroller.setCallback(callback);
578
+ this.animatedScroller.start();
579
+ }
580
+ }
581
+
582
+ // kept for API compatibility, not used
583
+ pullHandled() {
584
+ // let that = this;
585
+
586
+ // removeClass(that.refreshHint, SCROLLER_REFRESH_CLASS);
587
+ // that.hintContainer.innerHTML = that.pullTemplate({}));
588
+
589
+ // that.yinertia.onEnd();
590
+ // that.xinertia.onEnd();
591
+ // that.userEvents.cancel();
592
+ }
593
+
594
+ destroy() {
595
+ const element = this.element;
596
+
597
+ off(element, 'DOMMouseScroll mousewheel', this._wheelScrollHandler);
598
+
599
+ if (this.userEvents) {
600
+ this.userEvents.destroy();
601
+ }
602
+ }
603
+
604
+ _scale(scale) {
605
+ this.dimensions.rescale(scale);
606
+ this.movable.scaleTo(scale);
607
+ }
608
+
609
+ _initPullToRefresh() {
610
+ }
611
+
612
+ // kept for API compatibility, not used
613
+ _dragEnd() {
614
+ // let that = this;
615
+
616
+ // if (!that.pulled) {
617
+ // return;
618
+ // }
619
+
620
+ // that.pulled = false;
621
+
622
+ // removeClass(that.refreshHint, SCROLLER_RELEASE_CLASS);
623
+ // addClass(that.refreshHint, SCROLLER_REFRESH_CLASS);
624
+
625
+ // that.hintContainer.innerHTML = that.refreshTemplate({});
626
+
627
+ // that.yinertia.freeze(that.options.pullOffset / 2);
628
+ // that.trigger('pull');
629
+ }
630
+
631
+ // kept for API compatibility, not used
632
+ _paneChange() {
633
+ // let that = this;
634
+ // if (that.movable.y / OUT_OF_BOUNDS_FRICTION > that.options.pullOffset) {
635
+ // if (!that.pulled) {
636
+ // that.pulled = true;
637
+ // that.refreshHint.removeClass(SCROLLER_REFRESH_CLASS).addClass(SCROLLER_RELEASE_CLASS);
638
+ // that.hintContainer.html(that.releaseTemplate({}));
639
+ // that.hintContainer.html(that.releaseTemplate({}));
640
+ // }
641
+ // } else if (that.pulled) {
642
+ // that.pulled = false;
643
+ // that.refreshHint.removeClass(SCROLLER_RELEASE_CLASS);
644
+ // that.hintContainer.html(that.pullTemplate({}));
645
+ // }
646
+ }
647
+
648
+ _initAxis(axis) {
649
+ let that = this,
650
+ movable = that.movable,
651
+ dimension = that.dimensions[axis],
652
+ tapCapture = that.tapCapture,
653
+ paneAxis = that.pane[axis],
654
+ scrollBar = new ScrollBar({
655
+ axis: axis,
656
+ movable: movable,
657
+ dimension: dimension,
658
+ container: that.element,
659
+ alwaysVisible: that.options.visibleScrollHints
660
+ });
661
+
662
+ dimension.bind(CHANGE, function() {
663
+ scrollBar.refresh();
664
+ });
665
+
666
+ paneAxis.bind(CHANGE, function() {
667
+ scrollBar.show();
668
+ });
669
+
670
+ that[axis + 'inertia'] = new DragInertia({
671
+ axis: axis,
672
+ paneAxis: paneAxis,
673
+ movable: movable,
674
+ tapCapture: tapCapture,
675
+ userEvents: that.userEvents,
676
+ dimension: dimension,
677
+ elastic: that.options.elastic,
678
+ friction: that.options.friction || FRICTION,
679
+ velocityMultiplier: that.options.velocityMultiplier || VELOCITY_MULTIPLIER,
680
+ end() {
681
+ scrollBar.hide();
682
+ that.trigger('scrollEnd', {
683
+ axis: axis,
684
+ scrollTop: that.scrollTop,
685
+ scrollLeft: that.scrollLeft
686
+ });
687
+ }
688
+ });
689
+ }
690
+ }
691
+
692
+ setDefaultOptions(Scroller, {
693
+ name: 'Scroller',
694
+ zoom: false,
695
+ pullOffset: 140,
696
+ visibleScrollHints: false,
697
+ elastic: true,
698
+ useNative: false,
699
+ mousewheelScrolling: true,
700
+ avoidScrolling() {
701
+ return false;
702
+ },
703
+ pullToRefresh: false,
704
+ messages: {
705
+ pullTemplate: 'Pull to refresh',
706
+ releaseTemplate: 'Release to refresh',
707
+ refreshTemplate: 'Refreshing'
708
+ }
709
+ });
710
+
711
+ setDefaultEvents(Scroller, [
712
+ PULL,
713
+ SCROLL,
714
+ RESIZE
715
+ ]);
716
+