@syncfusion/ej2-base 20.2.38 → 20.2.45

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.
@@ -6759,19 +6759,19 @@ var LicenseValidator = /** @__PURE__ @class */ (function () {
6759
6759
  noLicense: 'This application was built using a trial version of Syncfusion Essential Studio.' +
6760
6760
  ' Please include a valid license to permanently remove this license validation message.' +
6761
6761
  ' You can also obtain a free 30 day evaluation license to temporarily remove this message ' +
6762
- 'during the evaluation period. Please refer to this <a style="color:yellow;text-decoration:none;"' +
6762
+ 'during the evaluation period. Please refer to this <a class="e-license"' +
6763
6763
  'href="https://help.syncfusion.com/common/essential-studio/licensing">help topic</a> for more information.',
6764
6764
  trailExpired: 'Your Syncfusion trial license has expired. Please refer to this ' +
6765
- '<a style="color:yellow;text-decoration:none;"' +
6765
+ '<a class="e-license"' +
6766
6766
  'href="https://help.syncfusion.com/common/essential-studio/licensing/licensing-errors#trial-expired">help topic</a> for more information.',
6767
6767
  versionMismatched: 'The included Syncfusion license (v##LicenseVersion) is invalid for version ' +
6768
- '##Requireversion. Please refer to this <a style="color:yellow;text-decoration:none;" ' +
6768
+ '##Requireversion. Please refer to this <a class="e-license" ' +
6769
6769
  'href="https://help.syncfusion.com/es/licensing/version-mismatch/">help topic</a> for more information.',
6770
6770
  platformMismatched: 'The included Syncfusion license is invalid (Platform mismatch). Please refer' +
6771
- ' to this <a style="color:yellow;text-decoration:none;" ' +
6771
+ ' to this <a class="e-license" ' +
6772
6772
  'href="https://help.syncfusion.com/common/essential-studio/licensing/licensing-errors#platform-mismatch">help topic</a> for more information.',
6773
6773
  invalidKey: 'The included Syncfusion license is invalid. Please refer to this ' +
6774
- '<a style="color:yellow;text-decoration:none;" ' +
6774
+ '<a class="e-license" ' +
6775
6775
  'href="https://help.syncfusion.com/common/essential-studio/licensing/licensing-errors#invalid-key">help topic</a> for more information.'
6776
6776
  };
6777
6777
  /**
@@ -6790,7 +6790,7 @@ var LicenseValidator = /** @__PURE__ @class */ (function () {
6790
6790
  * To manage npx licensing operation.
6791
6791
  */
6792
6792
  this.npxManager = (function () {
6793
- var npxLicKey = "npxKeyReplace";
6793
+ var npxLicKey = 'npxKeyReplace';
6794
6794
  function get() { return npxLicKey; }
6795
6795
  return {
6796
6796
  getKey: get
@@ -6800,11 +6800,11 @@ var LicenseValidator = /** @__PURE__ @class */ (function () {
6800
6800
  }
6801
6801
  /**
6802
6802
  * To validate the provided license key.
6803
- */
6803
+ */
6804
6804
  LicenseValidator.prototype.validate = function () {
6805
6805
  if (!this.isValidated && (containerObject && !getValue(convertToChar(bypassKey), containerObject) && !getValue('Blazor', containerObject))) {
6806
6806
  var validateMsg = void 0;
6807
- if ((this.manager && this.manager.getKey()) || (this.npxManager && this.npxManager.getKey() != 'npxKeyReplace')) {
6807
+ if ((this.manager && this.manager.getKey()) || (this.npxManager && this.npxManager.getKey() !== 'npxKeyReplace')) {
6808
6808
  var result = this.getInfoFromKey();
6809
6809
  if (result && result.length) {
6810
6810
  for (var _i = 0, result_1 = result; _i < result_1.length; _i++) {
@@ -6836,11 +6836,10 @@ var LicenseValidator = /** @__PURE__ @class */ (function () {
6836
6836
  else {
6837
6837
  validateMsg = this.errors.noLicense;
6838
6838
  }
6839
- if (validateMsg && typeof document !== "undefined" && !isNullOrUndefined(document)) {
6839
+ if (validateMsg && typeof document !== 'undefined' && !isNullOrUndefined(document)) {
6840
6840
  var errorDiv = createElement('div', {
6841
6841
  innerHTML: validateMsg +
6842
- '<span style="position:absolute;right: 10px;top:27%;cursor:pointer;"' +
6843
- 'onClick=this.parentElement.remove();>' +
6842
+ '<span id="license-banner-error" class=".e-license-banner">' +
6844
6843
  '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20">' +
6845
6844
  '<line x1="5" y1="5" x2="15" y2="15" stroke="yellow" stroke-width="2.5" ' +
6846
6845
  'stroke-miterlimit="10" stroke-linecap="round"></line><line x1="15" y1="5" ' +
@@ -6852,6 +6851,9 @@ var LicenseValidator = /** @__PURE__ @class */ (function () {
6852
6851
  });
6853
6852
  errorDiv.setAttribute('id', 'js-licensing');
6854
6853
  document.body.appendChild(errorDiv);
6854
+ document.getElementById('license-banner-error').addEventListener('click', function () {
6855
+ document.getElementById('js-licensing').remove();
6856
+ });
6855
6857
  }
6856
6858
  this.isValidated = true;
6857
6859
  setValue(convertToChar(bypassKey), this.isValidated, containerObject);
@@ -6951,6 +6953,7 @@ function convertToChar(cArr) {
6951
6953
  }
6952
6954
  /**
6953
6955
  * To set license key.
6956
+ *
6954
6957
  * @param {string} key - license key
6955
6958
  */
6956
6959
  function registerLicense(key) {
@@ -7928,23 +7931,30 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
7928
7931
  draEleTop -= this.parentScrollY;
7929
7932
  draEleLeft -= this.parentScrollX;
7930
7933
  }
7931
- if (this.helperElement.classList.contains('e-treeview')) {
7932
- var body = document.body;
7933
- var html = document.documentElement;
7934
- var tempHeight = Math.max(body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
7935
- var tempWidth = Math.max(body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
7936
- if (draEleTop > tempHeight) {
7937
- draEleTop = tempHeight;
7938
- }
7939
- if (draEleLeft > tempWidth) {
7940
- draEleLeft = tempWidth;
7941
- }
7942
- }
7943
7934
  var dragValue = this.getProcessedPositionValue({ top: draEleTop + 'px', left: draEleLeft + 'px' });
7944
7935
  setStyleAttribute(helperElement, this.getDragPosition(dragValue));
7945
- if (!this.elementInViewport(helperElement) && this.enableAutoScroll) {
7936
+ if (!this.elementInViewport(helperElement) && this.enableAutoScroll && !this.helperElement.classList.contains('e-treeview')) {
7946
7937
  this.helperElement.scrollIntoView();
7947
7938
  }
7939
+ var elements = document.querySelectorAll(':hover');
7940
+ if (this.enableAutoScroll && this.helperElement.classList.contains('e-treeview')) {
7941
+ if (elements.length === 0) {
7942
+ elements = this.getPathElements(evt);
7943
+ }
7944
+ /* tslint:disable no-any */
7945
+ var scrollParent = this.getScrollParent(elements, false);
7946
+ if (this.elementInViewport(this.helperElement)) {
7947
+ this.getScrollPosition(scrollParent, draEleTop);
7948
+ }
7949
+ else if (!this.elementInViewport(this.helperElement)) {
7950
+ elements = [].slice.call(document.querySelectorAll(':hover'));
7951
+ if (elements.length === 0) {
7952
+ elements = this.getPathElements(evt);
7953
+ }
7954
+ scrollParent = this.getScrollParent(elements, true);
7955
+ this.getScrollPosition(scrollParent, draEleTop);
7956
+ }
7957
+ }
7948
7958
  this.dragProcessStarted = true;
7949
7959
  this.prevLeft = left;
7950
7960
  this.prevTop = top;
@@ -7953,6 +7963,48 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
7953
7963
  this.pageX = pagex;
7954
7964
  this.pageY = pagey;
7955
7965
  };
7966
+ /* tslint:disable no-any */
7967
+ Draggable.prototype.getScrollParent = function (node, reverse) {
7968
+ /* tslint:disable no-any */
7969
+ var nodeEl = reverse ? node.reverse() : node;
7970
+ var hasScroll;
7971
+ for (var i = nodeEl.length - 1; i >= 0; i--) {
7972
+ hasScroll = window.getComputedStyle(nodeEl[i])['overflow-y'];
7973
+ if ((hasScroll === 'auto' || hasScroll === 'scroll')
7974
+ && nodeEl[i].scrollHeight > nodeEl[i].clientHeight) {
7975
+ return nodeEl[i];
7976
+ }
7977
+ }
7978
+ hasScroll = window.getComputedStyle(document.scrollingElement)['overflow-y'];
7979
+ if (hasScroll === 'visible') {
7980
+ document.scrollingElement.style.overflow = 'auto';
7981
+ return document.scrollingElement;
7982
+ }
7983
+ };
7984
+ Draggable.prototype.getScrollPosition = function (nodeEle, draEleTop) {
7985
+ if (nodeEle && nodeEle === document.scrollingElement) {
7986
+ if ((nodeEle.clientHeight - nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight) < draEleTop
7987
+ && nodeEle.getBoundingClientRect().height > draEleTop) {
7988
+ nodeEle.scrollTop += this.helperElement.clientHeight;
7989
+ }
7990
+ else if (nodeEle.scrollHeight - nodeEle.clientHeight > draEleTop) {
7991
+ nodeEle.scrollTop -= this.helperElement.clientHeight;
7992
+ }
7993
+ }
7994
+ else if (nodeEle && nodeEle !== document.scrollingElement) {
7995
+ if ((nodeEle.clientHeight + nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight) < draEleTop) {
7996
+ nodeEle.scrollTop += this.helperElement.clientHeight;
7997
+ }
7998
+ else if (nodeEle.getBoundingClientRect().top > (draEleTop - this.helperElement.clientHeight)) {
7999
+ nodeEle.scrollTop -= this.helperElement.clientHeight;
8000
+ }
8001
+ }
8002
+ };
8003
+ Draggable.prototype.getPathElements = function (evt) {
8004
+ var elementTop = evt.clientX > 0 ? evt.clientX : 0;
8005
+ var elementLeft = evt.clientY > 0 ? evt.clientY : 0;
8006
+ return document.elementsFromPoint(elementTop, elementLeft);
8007
+ };
7956
8008
  Draggable.prototype.triggerOutFunction = function (evt, eleObj) {
7957
8009
  this.hoverObject.instance.intOut(evt, eleObj.target);
7958
8010
  this.hoverObject.instance.dragData[this.scope] = null;