jsl-ui 9.8.3 → 9.10.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.
@@ -504,17 +504,22 @@ export function SlickGrid(container, data, columns, options) {
504
504
  // handleDragInit(e, dd);
505
505
  // // TODO
506
506
  // });
507
- $canvas.on("mousedown", function (e, dd) {
507
+ var _down = function (e, dd) {
508
508
  var res = handleDragInit(e, dd); // TODO -> do something with result?
509
- dragStartX_1 = e.pageX;
510
- dragStartY_1 = e.pageY;
509
+ dragStartX_1 = e.pageX != null ? e.pageX : e.touches[0].pageX;
510
+ dragStartY_1 = e.pageY != null ? e.pageY : e.touches[0].pageY;
511
511
  isDown_1 = true;
512
- document.addEventListener("mouseup", handleMouseUp_1);
513
- });
514
- $canvas.on("mousemove", function (e, _dd) {
512
+ document.addEventListener("mouseup", handleUp_1);
513
+ document.addEventListener("touchend", handleUp_1);
514
+ };
515
+ $canvas.on("mousedown", _down);
516
+ $canvas.on("touchstart", _down);
517
+ var _move = function (e, _dd) {
515
518
  if (isDown_1) {
516
- if (Math.abs(dragStartX_1 - e.pageX) < delta_1
517
- && Math.abs(dragStartY_1 - e.pageY) < delta_1) {
519
+ var pageX_1 = e.pageX != null ? e.pageX : e.touches[0].pageX;
520
+ var pageY = e.pageY != null ? e.pageY : e.touches[0].pageY;
521
+ if (Math.abs(dragStartX_1 - pageX_1) < delta_1
522
+ && Math.abs(dragStartY_1 - pageY) < delta_1) {
518
523
  return;
519
524
  }
520
525
  if (dragStartedDD_1 == null) {
@@ -522,26 +527,34 @@ export function SlickGrid(container, data, columns, options) {
522
527
  dragStartedDD_1.dragging = null;
523
528
  dragStartedDD_1.propagates = 1;
524
529
  dragStartedDD_1.target = e.target;
525
- dragStartedDD_1.pageX = e.pageX;
526
- dragStartedDD_1.pageY = e.pageY;
530
+ dragStartedDD_1.pageX = pageX_1;
531
+ dragStartedDD_1.pageY = pageY;
527
532
  dragStartedDD_1.startX = dragStartedDD_1.pageX;
528
533
  dragStartedDD_1.startY = dragStartedDD_1.pageY;
529
534
  var res = handleDragStart(e, dragStartedDD_1); // TODO -> do something with result?
530
535
  }
531
- dragStartedDD_1.pageX = e.pageX;
532
- dragStartedDD_1.pageY = e.pageY;
536
+ dragStartedDD_1.pageX = pageX_1;
537
+ dragStartedDD_1.pageY = pageY;
533
538
  dragStartedDD_1.startX = dragStartedDD_1.pageX;
534
539
  dragStartedDD_1.startY = dragStartedDD_1.pageY;
535
540
  handleDrag(e, dragStartedDD_1);
541
+ // e.stopImmediatePropagation();
542
+ // e.stopPropagation();
543
+ if (e.isImmediatePropagationStopped && e.isImmediatePropagationStopped()) {
544
+ e.preventDefault();
545
+ }
536
546
  }
537
- });
538
- var handleMouseUp_1 = function (e) {
547
+ };
548
+ $canvas.on("mousemove", _move);
549
+ $canvas.on("touchmove", _move);
550
+ var handleUp_1 = function (e) {
539
551
  if (isDown_1 && dragStartedDD_1 != null) {
540
552
  handleDragEnd(e, dragStartedDD_1);
541
553
  }
542
554
  isDown_1 = false;
543
555
  dragStartedDD_1 = null;
544
- document.removeEventListener("mouseup", handleMouseUp_1);
556
+ document.removeEventListener("mouseup", handleUp_1);
557
+ document.removeEventListener("touchend", handleUp_1);
545
558
  };
546
559
  // .on("draginit", handleDragInit) //TODO TODOFIX
547
560
  // .on("dragstart", {distance: 3}, handleDragStart) //TODO TODOFIX