@syncfusion/ej2-base 21.1.35 → 21.1.38
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/CHANGELOG.md +16 -0
- package/bin/syncfusion-license.js +1 -1
- package/dist/ej2-base.min.js +2 -2
- package/dist/ej2-base.umd.min.js +2 -2
- package/dist/ej2-base.umd.min.js.map +1 -1
- package/dist/es6/ej2-base.es2015.js +39 -22
- package/dist/es6/ej2-base.es2015.js.map +1 -1
- package/dist/es6/ej2-base.es5.js +40 -23
- package/dist/es6/ej2-base.es5.js.map +1 -1
- package/dist/global/ej2-base.min.js +2 -2
- package/dist/global/ej2-base.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +7 -67
- package/src/browser.d.ts +6 -0
- package/src/browser.js +10 -0
- package/src/dom.js +10 -3
- package/src/draggable.js +18 -18
- package/src/droppable.js +2 -2
package/dist/es6/ej2-base.es5.js
CHANGED
|
@@ -4277,6 +4277,16 @@ var Browser = /** @__PURE__ @class */ (function () {
|
|
|
4277
4277
|
Browser.getTouchCancelEvent = function () {
|
|
4278
4278
|
return Browser.getEvent('cancel');
|
|
4279
4279
|
};
|
|
4280
|
+
/**
|
|
4281
|
+
* Check whether the browser on the iPad device is Safari or not
|
|
4282
|
+
*
|
|
4283
|
+
* @returns {boolean}
|
|
4284
|
+
*/
|
|
4285
|
+
Browser.isSafari = function () {
|
|
4286
|
+
return (Browser.isDevice && Browser.isIos && Browser.isTouch && typeof window !== 'undefined'
|
|
4287
|
+
&& window.navigator.userAgent.toLowerCase().indexOf('iphone') === -1
|
|
4288
|
+
&& window.navigator.userAgent.toLowerCase().indexOf('safari') > -1);
|
|
4289
|
+
};
|
|
4280
4290
|
/**
|
|
4281
4291
|
* To get the value based on provided key and regX
|
|
4282
4292
|
*
|
|
@@ -4838,9 +4848,16 @@ function prepend(fromElements, toElement, isEval) {
|
|
|
4838
4848
|
*/
|
|
4839
4849
|
function append(fromElements, toElement, isEval) {
|
|
4840
4850
|
var docFrag = document.createDocumentFragment();
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4851
|
+
if (fromElements instanceof NodeList) {
|
|
4852
|
+
while (fromElements.length > 0) {
|
|
4853
|
+
docFrag.appendChild(fromElements[0]);
|
|
4854
|
+
}
|
|
4855
|
+
}
|
|
4856
|
+
else {
|
|
4857
|
+
for (var _i = 0, _a = fromElements; _i < _a.length; _i++) {
|
|
4858
|
+
var ele = _a[_i];
|
|
4859
|
+
docFrag.appendChild(ele);
|
|
4860
|
+
}
|
|
4844
4861
|
}
|
|
4845
4862
|
toElement.appendChild(docFrag);
|
|
4846
4863
|
if (isEval) {
|
|
@@ -7610,10 +7627,10 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
|
|
|
7610
7627
|
}
|
|
7611
7628
|
var handler = (this.enableTapHold && Browser.isDevice && Browser.isTouch) ? this.mobileInitialize : this.initialize;
|
|
7612
7629
|
if (isUnWire) {
|
|
7613
|
-
EventHandler.remove(ele || this.element, Browser.touchStartEvent, handler);
|
|
7630
|
+
EventHandler.remove(ele || this.element, Browser.isSafari() ? 'touchstart' : Browser.touchStartEvent, handler);
|
|
7614
7631
|
}
|
|
7615
7632
|
else {
|
|
7616
|
-
EventHandler.add(ele || this.element, Browser.touchStartEvent, handler, this);
|
|
7633
|
+
EventHandler.add(ele || this.element, Browser.isSafari() ? 'touchstart' : Browser.touchStartEvent, handler, this);
|
|
7617
7634
|
}
|
|
7618
7635
|
};
|
|
7619
7636
|
/* istanbul ignore next */
|
|
@@ -7625,14 +7642,14 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
|
|
|
7625
7642
|
_this.removeTapholdTimer();
|
|
7626
7643
|
_this.initialize(evt, target);
|
|
7627
7644
|
}, this.tapHoldThreshold);
|
|
7628
|
-
EventHandler.add(document, Browser.touchMoveEvent, this.removeTapholdTimer, this);
|
|
7629
|
-
EventHandler.add(document, Browser.touchEndEvent, this.removeTapholdTimer, this);
|
|
7645
|
+
EventHandler.add(document, Browser.isSafari() ? 'touchmove' : Browser.touchMoveEvent, this.removeTapholdTimer, this);
|
|
7646
|
+
EventHandler.add(document, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.removeTapholdTimer, this);
|
|
7630
7647
|
};
|
|
7631
7648
|
/* istanbul ignore next */
|
|
7632
7649
|
Draggable.prototype.removeTapholdTimer = function () {
|
|
7633
7650
|
clearTimeout(this.tapHoldTimer);
|
|
7634
|
-
EventHandler.remove(document, Browser.touchMoveEvent, this.removeTapholdTimer);
|
|
7635
|
-
EventHandler.remove(document, Browser.touchEndEvent, this.removeTapholdTimer);
|
|
7651
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchmove' : Browser.touchMoveEvent, this.removeTapholdTimer);
|
|
7652
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.removeTapholdTimer);
|
|
7636
7653
|
};
|
|
7637
7654
|
/* istanbul ignore next */
|
|
7638
7655
|
Draggable.prototype.getScrollableParent = function (element, axis) {
|
|
@@ -7724,15 +7741,15 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
|
|
|
7724
7741
|
this.intDragStart(evt);
|
|
7725
7742
|
}
|
|
7726
7743
|
else {
|
|
7727
|
-
EventHandler.add(document, Browser.touchMoveEvent, this.intDragStart, this);
|
|
7728
|
-
EventHandler.add(document, Browser.touchEndEvent, this.intDestroy, this);
|
|
7744
|
+
EventHandler.add(document, Browser.isSafari() ? 'touchmove' : Browser.touchMoveEvent, this.intDragStart, this);
|
|
7745
|
+
EventHandler.add(document, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.intDestroy, this);
|
|
7729
7746
|
}
|
|
7730
7747
|
this.toggleEvents(true);
|
|
7731
7748
|
if (evt.type !== 'touchstart' && this.isPreventSelect) {
|
|
7732
7749
|
document.body.classList.add('e-prevent-select');
|
|
7733
7750
|
}
|
|
7734
7751
|
this.externalInitialize = false;
|
|
7735
|
-
EventHandler.trigger(document.documentElement, Browser.touchStartEvent, evt);
|
|
7752
|
+
EventHandler.trigger(document.documentElement, Browser.isSafari() ? 'touchstart' : Browser.touchStartEvent, evt);
|
|
7736
7753
|
};
|
|
7737
7754
|
Draggable.prototype.intDragStart = function (evt) {
|
|
7738
7755
|
this.removeTapholdTimer();
|
|
@@ -7824,8 +7841,8 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
|
|
|
7824
7841
|
}
|
|
7825
7842
|
this.dragElePosition = { top: pos.top, left: pos.left };
|
|
7826
7843
|
setStyleAttribute(dragTargetElement, this.getDragPosition({ position: 'absolute', left: posValue.left, top: posValue.top }));
|
|
7827
|
-
EventHandler.remove(document, Browser.touchMoveEvent, this.intDragStart);
|
|
7828
|
-
EventHandler.remove(document, Browser.touchEndEvent, this.intDestroy);
|
|
7844
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchmove' : Browser.touchMoveEvent, this.intDragStart);
|
|
7845
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.intDestroy);
|
|
7829
7846
|
if (!isBlazor()) {
|
|
7830
7847
|
this.bindDragEvents(dragTargetElement);
|
|
7831
7848
|
}
|
|
@@ -7833,8 +7850,8 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
|
|
|
7833
7850
|
};
|
|
7834
7851
|
Draggable.prototype.bindDragEvents = function (dragTargetElement) {
|
|
7835
7852
|
if (isVisible(dragTargetElement)) {
|
|
7836
|
-
EventHandler.add(document, Browser.touchMoveEvent, this.intDrag, this);
|
|
7837
|
-
EventHandler.add(document, Browser.touchEndEvent, this.intDragStop, this);
|
|
7853
|
+
EventHandler.add(document, Browser.isSafari() ? 'touchmove' : Browser.touchMoveEvent, this.intDrag, this);
|
|
7854
|
+
EventHandler.add(document, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.intDragStop, this);
|
|
7838
7855
|
this.setGlobalDroppables(false, this.element, dragTargetElement);
|
|
7839
7856
|
}
|
|
7840
7857
|
else {
|
|
@@ -8171,10 +8188,10 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
|
|
|
8171
8188
|
this.toggleEvents();
|
|
8172
8189
|
document.body.classList.remove('e-prevent-select');
|
|
8173
8190
|
this.element.setAttribute('aria-grabbed', 'false');
|
|
8174
|
-
EventHandler.remove(document, Browser.touchMoveEvent, this.intDragStart);
|
|
8175
|
-
EventHandler.remove(document, Browser.touchEndEvent, this.intDragStop);
|
|
8176
|
-
EventHandler.remove(document, Browser.touchEndEvent, this.intDestroy);
|
|
8177
|
-
EventHandler.remove(document, Browser.touchMoveEvent, this.intDrag);
|
|
8191
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchmove' : Browser.touchMoveEvent, this.intDragStart);
|
|
8192
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.intDragStop);
|
|
8193
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.intDestroy);
|
|
8194
|
+
EventHandler.remove(document, Browser.isSafari() ? 'touchmove' : Browser.touchMoveEvent, this.intDrag);
|
|
8178
8195
|
if (this.isDragStarted()) {
|
|
8179
8196
|
this.isDragStarted(true);
|
|
8180
8197
|
}
|
|
@@ -8276,7 +8293,7 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
|
|
|
8276
8293
|
pageX = this.clone ? intCoord.pageX : (intCoord.pageX + window.pageXOffset) - this.relativeXPosition;
|
|
8277
8294
|
pageY = this.clone ? intCoord.pageY : (intCoord.pageY + window.pageYOffset) - this.relativeYPosition;
|
|
8278
8295
|
}
|
|
8279
|
-
if (this.element
|
|
8296
|
+
if (!this.element.classList.contains("e-dialog") && !this.element.classList.contains("e-card") && document.scrollingElement) {
|
|
8280
8297
|
var isVerticalScroll = document.scrollingElement.scrollHeight > 0 && document.scrollingElement.scrollHeight > document.scrollingElement.clientHeight && document.scrollingElement.scrollTop > 0;
|
|
8281
8298
|
var isHorrizontalScroll = document.scrollingElement.scrollWidth > 0 && document.scrollingElement.scrollWidth > document.scrollingElement.clientWidth && document.scrollingElement.scrollLeft > 0;
|
|
8282
8299
|
pageX = isHorrizontalScroll ? pageX - document.scrollingElement.scrollLeft : pageX;
|
|
@@ -8473,7 +8490,7 @@ var Droppable = /** @__PURE__ @class */ (function (_super) {
|
|
|
8473
8490
|
this.wireEvents();
|
|
8474
8491
|
};
|
|
8475
8492
|
Droppable.prototype.wireEvents = function () {
|
|
8476
|
-
EventHandler.add(this.element, Browser.touchEndEvent, this.intDrop, this);
|
|
8493
|
+
EventHandler.add(this.element, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.intDrop, this);
|
|
8477
8494
|
};
|
|
8478
8495
|
// triggers when property changed
|
|
8479
8496
|
// eslint-disable-next-line
|
|
@@ -8535,7 +8552,7 @@ var Droppable = /** @__PURE__ @class */ (function (_super) {
|
|
|
8535
8552
|
return area;
|
|
8536
8553
|
};
|
|
8537
8554
|
Droppable.prototype.destroy = function () {
|
|
8538
|
-
EventHandler.remove(this.element, Browser.touchEndEvent, this.intDrop);
|
|
8555
|
+
EventHandler.remove(this.element, Browser.isSafari() ? 'touchend' : Browser.touchEndEvent, this.intDrop);
|
|
8539
8556
|
_super.prototype.destroy.call(this);
|
|
8540
8557
|
};
|
|
8541
8558
|
__decorate$3([
|