@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,712 @@
1
+ import {
2
+ Class,
3
+ grep
4
+ } from '../../common';
5
+
6
+ import {
7
+ proxy,
8
+ noop,
9
+ applyEventMap,
10
+ getEventMap,
11
+ on,
12
+ off,
13
+ now,
14
+ getSupportedFeatures
15
+ } from '../utils';
16
+
17
+ import {
18
+ Observable
19
+ } from './observable';
20
+
21
+ var extend = Object.assign;
22
+
23
+ var preventDefault = function (e) {
24
+ e.preventDefault();
25
+ };
26
+
27
+ var
28
+ DEFAULT_MIN_HOLD = 800,
29
+ CLICK_DELAY = 300,
30
+ // DEFAULT_THRESHOLD = support.browser.msie ? 5 : 0,
31
+ DEFAULT_THRESHOLD = 0,
32
+ PRESS = 'press',
33
+ HOLD = 'hold',
34
+ SELECT = 'select',
35
+ START = 'start',
36
+ MOVE = 'move',
37
+ END = 'end',
38
+ CANCEL = 'cancel',
39
+ TAP = 'tap',
40
+ DOUBLETAP = 'doubleTap',
41
+ RELEASE = 'release',
42
+ GESTURESTART = 'gesturestart',
43
+ GESTURECHANGE = 'gesturechange',
44
+ GESTUREEND = 'gestureend',
45
+ GESTURETAP = 'gesturetap';
46
+
47
+ var THRESHOLD = {
48
+ 'api': 0,
49
+ 'touch': 0,
50
+ 'mouse': 9,
51
+ 'pointer': 9
52
+ };
53
+
54
+ function touchDelta(touch1, touch2) {
55
+ var x1 = touch1.x.location,
56
+ y1 = touch1.y.location,
57
+ x2 = touch2.x.location,
58
+ y2 = touch2.y.location,
59
+ dx = x1 - x2,
60
+ dy = y1 - y2;
61
+
62
+ return {
63
+ center: {
64
+ x: (x1 + x2) / 2,
65
+ y: (y1 + y2) / 2
66
+ },
67
+ distance: Math.sqrt(dx * dx + dy * dy)
68
+ };
69
+ }
70
+
71
+ function getTouches(e) {
72
+ var support = getSupportedFeatures();
73
+ var touches = [],
74
+ originalEvent = e.originalEvent || e,
75
+ currentTarget = e.currentTarget,
76
+ idx = 0,
77
+ length, changedTouches, touch;
78
+
79
+ if (e.api) {
80
+ touches.push({
81
+ id: 2,
82
+ event: e,
83
+ target: e.target,
84
+ currentTarget: e.target,
85
+ location: e,
86
+ type: 'api'
87
+ });
88
+ } else if (e.type.match(/touch/)) {
89
+ changedTouches = originalEvent ? originalEvent.changedTouches : [];
90
+
91
+ for (length = changedTouches.length; idx < length; idx++) {
92
+ touch = changedTouches[idx];
93
+ touches.push({
94
+ location: touch,
95
+ event: e,
96
+ target: touch.target,
97
+ currentTarget: currentTarget,
98
+ id: touch.identifier,
99
+ type: 'touch'
100
+ });
101
+ }
102
+ } else if (support.pointers || support.msPointers) {
103
+ touches.push({
104
+ location: originalEvent,
105
+ event: e,
106
+ target: e.target,
107
+ currentTarget: currentTarget,
108
+ id: originalEvent.pointerId,
109
+ type: 'pointer'
110
+ });
111
+ } else {
112
+ touches.push({
113
+ id: 1,
114
+ event: e,
115
+ target: e.target,
116
+ currentTarget: currentTarget,
117
+ location: e,
118
+ type: 'mouse'
119
+ });
120
+ }
121
+
122
+ return touches;
123
+ }
124
+ export var TouchAxis = (function (Class) {
125
+ function TouchAxis(axis, location) {
126
+ Class.call(this);
127
+ var that = this;
128
+
129
+ that.support = getSupportedFeatures();
130
+ that.invalidZeroEvents = this.support.mobileOS && this.support.mobileOS.android;
131
+ that.axis = axis;
132
+ that._updateLocationData(location);
133
+ that.startLocation = that.location;
134
+ that.velocity = that.delta = 0;
135
+ that.timeStamp = now();
136
+ }
137
+
138
+ if ( Class ) TouchAxis.__proto__ = Class;
139
+ TouchAxis.prototype = Object.create( Class && Class.prototype );
140
+ TouchAxis.prototype.constructor = TouchAxis;
141
+
142
+ TouchAxis.prototype.move = function move (location) {
143
+ var that = this,
144
+ offset = location['page' + that.axis],
145
+ timeStamp = now(),
146
+ timeDelta = timeStamp - that.timeStamp || 1;
147
+
148
+ if (!offset && this.invalidZeroEvents) {
149
+ return;
150
+ }
151
+
152
+ that.delta = offset - that.location;
153
+ that._updateLocationData(location);
154
+ that.initialDelta = offset - that.startLocation;
155
+ that.velocity = that.delta / timeDelta;
156
+ that.timeStamp = timeStamp;
157
+ };
158
+
159
+ TouchAxis.prototype._updateLocationData = function _updateLocationData (location) {
160
+ var that = this,
161
+ axis = that.axis;
162
+
163
+ that.location = location['page' + axis];
164
+ that.client = location['client' + axis];
165
+ that.screen = location['screen' + axis];
166
+ };
167
+
168
+ return TouchAxis;
169
+ }(Class));
170
+
171
+ export var Touch = (function (Class) {
172
+ function Touch(userEvents, target, touchInfo) {
173
+ Class.call(this);
174
+
175
+ extend(this, {
176
+ x: new TouchAxis('X', touchInfo.location),
177
+ y: new TouchAxis('Y', touchInfo.location),
178
+ type: touchInfo.type,
179
+ useClickAsTap: userEvents.useClickAsTap,
180
+ threshold: userEvents.threshold || THRESHOLD[touchInfo.type],
181
+ userEvents: userEvents,
182
+ target: target,
183
+ currentTarget: touchInfo.currentTarget,
184
+ initialTouch: touchInfo.target,
185
+ id: touchInfo.id,
186
+ pressEvent: touchInfo,
187
+ _clicks: userEvents._clicks,
188
+ supportDoubleTap: userEvents.supportDoubleTap,
189
+ _moved: false,
190
+ _finished: false
191
+ });
192
+ }
193
+
194
+ if ( Class ) Touch.__proto__ = Class;
195
+ Touch.prototype = Object.create( Class && Class.prototype );
196
+ Touch.prototype.constructor = Touch;
197
+
198
+ Touch.prototype.press = function press () {
199
+ // this._holdTimeout = setTimeout($.proxy(this, '_hold'), this.userEvents.minHold);
200
+ this._holdTimeout = setTimeout(proxy(this._hold, this), this.userEvents.minHold);
201
+ this._trigger(PRESS, this.pressEvent);
202
+ };
203
+
204
+ Touch.prototype._tap = function _tap (touchInfo) {
205
+ var that = this;
206
+
207
+ that.userEvents._clicks++;
208
+
209
+ if (that.userEvents._clicks === 1) {
210
+ that._clickTimeout = setTimeout(function() {
211
+ if (that.userEvents._clicks === 1) {
212
+ that._trigger(TAP, touchInfo);
213
+ } else {
214
+ that._trigger(DOUBLETAP, touchInfo);
215
+ }
216
+
217
+ that.userEvents._clicks = 0;
218
+ }, CLICK_DELAY);
219
+ }
220
+ };
221
+
222
+ Touch.prototype._hold = function _hold () {
223
+ this._trigger(HOLD, this.pressEvent);
224
+ };
225
+
226
+ /* eslint-disable consistent-return */
227
+ Touch.prototype.move = function move (touchInfo) {
228
+ var that = this;
229
+ var preventMove = touchInfo.type !== 'api' && that.userEvents._shouldNotMove;
230
+
231
+ if (that._finished || preventMove) {
232
+ return;
233
+ }
234
+
235
+ that.x.move(touchInfo.location);
236
+ that.y.move(touchInfo.location);
237
+
238
+ if (!that._moved) {
239
+ if (that._withinIgnoreThreshold()) {
240
+ return;
241
+ }
242
+
243
+ if (!UserEvents.current || UserEvents.current === that.userEvents) {
244
+ that._start(touchInfo);
245
+ } else {
246
+ return that.dispose();
247
+ }
248
+ }
249
+
250
+ if (!that._finished) {
251
+ that._trigger(MOVE, touchInfo);
252
+ }
253
+ };
254
+ /* eslint-enable consistent-return */
255
+
256
+ Touch.prototype.end = function end (touchInfo) {
257
+ this.endTime = now();
258
+
259
+ if (this._finished) {
260
+ return;
261
+ }
262
+
263
+ this._finished = true;
264
+ this._trigger(RELEASE, touchInfo);
265
+
266
+ if (this._moved) {
267
+ this._trigger(END, touchInfo);
268
+ } else {
269
+ if (!this.useClickAsTap) {
270
+ if (this.supportDoubleTap) {
271
+ this._tap(touchInfo);
272
+ } else {
273
+ this._trigger(TAP, touchInfo);
274
+ }
275
+ }
276
+ }
277
+
278
+ clearTimeout(this._holdTimeout);
279
+ this.dispose();
280
+ };
281
+
282
+ Touch.prototype.dispose = function dispose () {
283
+ var userEvents = this.userEvents,
284
+ activeTouches = userEvents.touches || [];
285
+
286
+ this._finished = true;
287
+ this.pressEvent = null;
288
+
289
+ clearTimeout(this._holdTimeout);
290
+ // activeTouches.splice($.inArray(this, activeTouches), 1);
291
+ var activeTouchIndex = activeTouches.indexOf(this);
292
+ activeTouches.splice(activeTouchIndex, 1);
293
+ };
294
+
295
+ Touch.prototype.skip = function skip () {
296
+ this.dispose();
297
+ };
298
+
299
+ Touch.prototype.cancel = function cancel () {
300
+ this.dispose();
301
+ };
302
+
303
+ Touch.prototype.isMoved = function isMoved () {
304
+ return this._moved;
305
+ };
306
+
307
+ Touch.prototype._start = function _start (touchInfo) {
308
+ clearTimeout(this._holdTimeout);
309
+ this.startTime = now();
310
+ this._moved = true;
311
+ this._trigger(START, touchInfo);
312
+ };
313
+
314
+ Touch.prototype._trigger = function _trigger (name, touchInfo) {
315
+ var that = this,
316
+ jQueryEvent = touchInfo.event,
317
+ data = {
318
+ touch: that,
319
+ x: that.x,
320
+ y: that.y,
321
+ target: that.target,
322
+ event: jQueryEvent
323
+ };
324
+ if (that.userEvents.notify(name, data)) {
325
+ jQueryEvent.preventDefault();
326
+ }
327
+ };
328
+
329
+ Touch.prototype._withinIgnoreThreshold = function _withinIgnoreThreshold () {
330
+ var xDelta = this.x.initialDelta,
331
+ yDelta = this.y.initialDelta;
332
+ return Math.sqrt(xDelta * xDelta + yDelta * yDelta) <= this.threshold;
333
+ };
334
+
335
+ return Touch;
336
+ }(Class));
337
+
338
+ function withEachUpEvent(callback) {
339
+ var eventMap = getEventMap(navigator.userAgent);
340
+ var downEvents = eventMap.up.split(' '),
341
+ idx = 0,
342
+ length = downEvents.length;
343
+
344
+ for (; idx < length; idx++) {
345
+ callback(downEvents[idx]);
346
+ }
347
+ }
348
+
349
+ export var UserEvents = (function (Observable) {
350
+ function UserEvents(element, options) {
351
+ Observable.call(this);
352
+ var that = this;
353
+ var filter;
354
+
355
+ var support = getSupportedFeatures();
356
+ this.support = support;
357
+
358
+ /* eslint-disable no-param-reassign */
359
+ options = options || {};
360
+ /* eslint-enable no-param-reassign */
361
+
362
+ filter = that.filter = options.filter;
363
+ that.threshold = options.threshold || DEFAULT_THRESHOLD;
364
+ that.minHold = options.minHold || DEFAULT_MIN_HOLD;
365
+ that.touches = [];
366
+ that._maxTouches = options.multiTouch ? 2 : 1;
367
+ that.allowSelection = options.allowSelection;
368
+ that.captureUpIfMoved = options.captureUpIfMoved;
369
+ that.useClickAsTap = !options.fastTap && !support.delayedClick();
370
+ that._clicks = 0;
371
+ that.supportDoubleTap = options.supportDoubleTap;
372
+
373
+ var enableGlobalSurface = !support.touch || support.mouseAndTouchPresent;
374
+
375
+ extend(that, {
376
+ element: element,
377
+ surface: options.global && enableGlobalSurface ?
378
+ element.ownerDocument.documentElement :
379
+ options.surface || element,
380
+ stopPropagation: options.stopPropagation,
381
+ pressed: false
382
+ });
383
+
384
+ this._surfaceMoveHandler = proxy(this._move, this);
385
+ on(that.surface, applyEventMap('move'), this._surfaceMoveHandler);
386
+
387
+ this._surfaceEndHandler = proxy(this._end, this);
388
+ on(that.surface, applyEventMap('up cancel'), this._surfaceEndHandler);
389
+
390
+ this._elementStartHandler = proxy(this._start, this);
391
+ on(element, applyEventMap('down'), filter, this._elementStartHandler);
392
+
393
+ if (that.useClickAsTap) {
394
+ this._elementClickHandler = proxy(this._click, this);
395
+ on(element, applyEventMap('click'), filter, this._elementClickHandler);
396
+ }
397
+
398
+ if (support.pointers || support.msPointers) {
399
+ if (support.browser.version < 11) {
400
+ var defaultAction = 'pinch-zoom double-tap-zoom';
401
+
402
+ element.style['-ms-touch-action'] =
403
+ options.touchAction && options.touchAction !== 'none' ?
404
+ defaultAction + ' ' + options.touchAction :
405
+ defaultAction;
406
+
407
+ } else {
408
+ element.style['touch-action'] = options.touchAction || 'none';
409
+ }
410
+ }
411
+ if (options.preventDragEvent) {
412
+ this._elementDragStartHandler = preventDefault;
413
+ on(element, applyEventMap('dragstart'), this._elementDragStartHandler);
414
+ }
415
+
416
+ // element.on(kendo.applyEventMap('mousedown'), filter, {
417
+ // root: element
418
+ // } '_select');
419
+
420
+ // todo: use root
421
+ this._elementSelectHandler = proxy(this._select, this);
422
+ on(element, applyEventMap('mousedown'), filter, this._elementSelectHandler);
423
+
424
+ if (that.captureUpIfMoved && support.eventCapture) {
425
+ var surfaceElement = that.surface,
426
+ preventIfMovingProxy = proxy(that.preventIfMoving, that);
427
+
428
+ withEachUpEvent(function(eventName) {
429
+ surfaceElement.addEventListener(eventName, preventIfMovingProxy, true);
430
+ });
431
+ }
432
+
433
+ that.bind([
434
+ PRESS,
435
+ HOLD,
436
+ TAP,
437
+ DOUBLETAP,
438
+ START,
439
+ MOVE,
440
+ END,
441
+ RELEASE,
442
+ CANCEL,
443
+ GESTURESTART,
444
+ GESTURECHANGE,
445
+ GESTUREEND,
446
+ GESTURETAP,
447
+ SELECT
448
+ ], options);
449
+ }
450
+
451
+ if ( Observable ) UserEvents.__proto__ = Observable;
452
+ UserEvents.prototype = Object.create( Observable && Observable.prototype );
453
+ UserEvents.prototype.constructor = UserEvents;
454
+
455
+ UserEvents.prototype.preventIfMoving = function preventIfMoving (e) {
456
+ if (this._isMoved()) {
457
+ e.preventDefault();
458
+ }
459
+ };
460
+
461
+ UserEvents.prototype.destroy = function destroy () {
462
+ var that = this;
463
+ var options = this.options;
464
+ var element = this.element;
465
+
466
+ if (that._destroyed) {
467
+ return;
468
+ }
469
+
470
+ that._destroyed = true;
471
+
472
+ if (that.captureUpIfMoved && this.support.eventCapture) {
473
+ var surfaceElement = that.surface;
474
+ withEachUpEvent(function(eventName) {
475
+ surfaceElement.removeEventListener(eventName, that.preventIfMoving);
476
+ });
477
+ }
478
+
479
+ off(that.surface, applyEventMap('move'), this._surfaceMoveHandler);
480
+ off(that.surface, applyEventMap('up cancel'), this._surfaceEndHandler);
481
+
482
+ off(element, applyEventMap('down'), this._elementStartHandler);
483
+
484
+ if (that.useClickAsTap) {
485
+ off(element, applyEventMap('click'), this._elementClickHandler);
486
+ }
487
+
488
+ if (options.preventDragEvent) {
489
+ off(element, applyEventMap('dragstart'), this._elementDragStartHandler);
490
+ }
491
+
492
+ off(element, applyEventMap('mousedown'), this._elementSelectHandler);
493
+
494
+ that._disposeAll();
495
+ that.unbind();
496
+
497
+ delete that.surface;
498
+ delete that.element;
499
+ delete that.currentTarget;
500
+ };
501
+
502
+ UserEvents.prototype.capture = function capture () {
503
+ UserEvents.current = this;
504
+ };
505
+
506
+ UserEvents.prototype.cancel = function cancel () {
507
+ this._disposeAll();
508
+ this.trigger(CANCEL);
509
+ };
510
+
511
+ /* eslint-disable indent */
512
+ UserEvents.prototype.notify = function notify (event, data) {
513
+ var that = this,
514
+ touches = that.touches;
515
+ var eventName = event;
516
+
517
+ if (this._isMultiTouch()) {
518
+ switch (eventName) {
519
+ case MOVE:
520
+ eventName = GESTURECHANGE;
521
+ break;
522
+ case END:
523
+ eventName = GESTUREEND;
524
+ break;
525
+ case TAP:
526
+ eventName = GESTURETAP;
527
+ break;
528
+ default:
529
+ break;
530
+ }
531
+
532
+ extend(data, {
533
+ touches: touches
534
+ }, touchDelta(touches[0], touches[1]));
535
+ }
536
+
537
+ return this.trigger(eventName, extend(data, {
538
+ type: eventName
539
+ }));
540
+ };
541
+ /* eslint-enable indent */
542
+
543
+ UserEvents.prototype.press = function press (x, y, target) {
544
+ this._apiCall('_start', x, y, target);
545
+ };
546
+
547
+ UserEvents.prototype.move = function move (x, y) {
548
+ this._apiCall('_move', x, y);
549
+ };
550
+
551
+ UserEvents.prototype.end = function end (x, y) {
552
+ this._apiCall('_end', x, y);
553
+ };
554
+
555
+ UserEvents.prototype._isMultiTouch = function _isMultiTouch () {
556
+ return this.touches.length > 1;
557
+ };
558
+
559
+ UserEvents.prototype._maxTouchesReached = function _maxTouchesReached () {
560
+ return this.touches.length >= this._maxTouches;
561
+ };
562
+
563
+ UserEvents.prototype._disposeAll = function _disposeAll () {
564
+ var touches = this.touches;
565
+ while (touches.length > 0) {
566
+ touches.pop().dispose();
567
+ }
568
+ };
569
+
570
+ UserEvents.prototype._isMoved = function _isMoved () {
571
+ return grep(this.touches, function(touch) {
572
+ return touch.isMoved();
573
+ }).length;
574
+ };
575
+
576
+ UserEvents.prototype._select = function _select (e) {
577
+ if (!this.allowSelection || this.trigger(SELECT, { event: e })) {
578
+ e.preventDefault();
579
+ }
580
+ };
581
+
582
+ UserEvents.prototype._start = function _start (e) {
583
+ var that = this,
584
+ idx = 0,
585
+ filter = that.filter,
586
+ target,
587
+ touches = getTouches(e),
588
+ length = touches.length,
589
+ touch,
590
+ which = e.which;
591
+
592
+ if (which && which > 1 || that._maxTouchesReached()) {
593
+ return;
594
+ }
595
+
596
+ UserEvents.current = null;
597
+ that.currentTarget = e.currentTarget;
598
+
599
+ if (that.stopPropagation) {
600
+ e.stopPropagation();
601
+ }
602
+
603
+ for (; idx < length; idx++) {
604
+ if (that._maxTouchesReached()) {
605
+ break;
606
+ }
607
+
608
+ touch = touches[idx];
609
+
610
+ if (filter) {
611
+ target = touch.currentTarget;
612
+ } else {
613
+ target = that.element;
614
+ }
615
+
616
+ if (target && target.length === 0) {
617
+ continue;
618
+ }
619
+
620
+ touch = new Touch(that, target, touch);
621
+ that.touches.push(touch);
622
+ touch.press();
623
+
624
+ if (that._isMultiTouch()) {
625
+ that.notify('gesturestart', {});
626
+ }
627
+ }
628
+ };
629
+
630
+ UserEvents.prototype._move = function _move (e) {
631
+ this._eachTouch('move', e);
632
+ };
633
+
634
+ UserEvents.prototype._end = function _end (e) {
635
+ this._eachTouch('end', e);
636
+ };
637
+
638
+ UserEvents.prototype._click = function _click (e) {
639
+ var data = {
640
+ touch: {
641
+ initialTouch: e.target,
642
+ target: e.currentTarget,
643
+ endTime: now(),
644
+ x: {
645
+ location: e.pageX,
646
+ client: e.clientX
647
+ },
648
+ y: {
649
+ location: e.pageY,
650
+ client: e.clientY
651
+ }
652
+ },
653
+ x: e.pageX,
654
+ y: e.pageY,
655
+ target: e.currentTarget,
656
+ event: e,
657
+ type: 'tap'
658
+ };
659
+
660
+ if (this.trigger('tap', data)) {
661
+ e.preventDefault();
662
+ }
663
+ };
664
+
665
+ UserEvents.prototype._eachTouch = function _eachTouch (methodName, e) {
666
+ var that = this,
667
+ dict = {},
668
+ touches = getTouches(e),
669
+ activeTouches = that.touches,
670
+ idx,
671
+ touch,
672
+ touchInfo,
673
+ matchingTouch;
674
+
675
+ for (idx = 0; idx < activeTouches.length; idx++) {
676
+ touch = activeTouches[idx];
677
+ dict[touch.id] = touch;
678
+ }
679
+
680
+ for (idx = 0; idx < touches.length; idx++) {
681
+ touchInfo = touches[idx];
682
+ matchingTouch = dict[touchInfo.id];
683
+
684
+ if (matchingTouch) {
685
+ matchingTouch[methodName](touchInfo);
686
+ }
687
+ }
688
+ };
689
+
690
+ UserEvents.prototype._apiCall = function _apiCall (type, x, y, target) {
691
+ this[type]({
692
+ api: true,
693
+ pageX: x,
694
+ pageY: y,
695
+ clientX: x,
696
+ clientY: y,
697
+ target: target || this.element,
698
+ stopPropagation: noop,
699
+ preventDefault: noop
700
+ });
701
+ };
702
+
703
+ UserEvents.defaultThreshold = function defaultThreshold (value) {
704
+ DEFAULT_THRESHOLD = value;
705
+ };
706
+
707
+ UserEvents.minHold = function minHold (value) {
708
+ DEFAULT_MIN_HOLD = value;
709
+ };
710
+
711
+ return UserEvents;
712
+ }(Observable));