@syncfusion/ej2-dropdowns 20.4.51 → 20.4.53

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.
@@ -95,7 +95,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
95
95
  var fieldValue_1 = fields.text.split('.');
96
96
  dataSource.filter(function (data) {
97
97
  Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
98
- if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
98
+ if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value].toString() || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
99
99
  filterValue = type === 'object' ? data[value] : data;
100
100
  }
101
101
  });
@@ -3301,6 +3301,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3301
3301
  }
3302
3302
  },
3303
3303
  open: function () {
3304
+ EventHandler.remove(document, 'mousedown', _this.onDocumentClick);
3304
3305
  EventHandler.add(document, 'mousedown', _this.onDocumentClick, _this);
3305
3306
  _this.isPopupOpen = true;
3306
3307
  var actionList = _this.actionCompleteData && _this.actionCompleteData.ulElement &&
@@ -3480,10 +3481,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3480
3481
  DropDownList.prototype.closePopup = function (delay, e) {
3481
3482
  var _this = this;
3482
3483
  this.isTyped = false;
3483
- if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
3484
+ if (!(this.popupObj && document.body.contains(this.popupObj.element) && (this.beforePopupOpen || this.isEventCancel))) {
3484
3485
  return;
3485
3486
  }
3486
- EventHandler.remove(document, 'mousedown', this.onDocumentClick);
3487
3487
  this.isActive = false;
3488
3488
  this.filterInputObj = null;
3489
3489
  this.isDropDownClick = false;
@@ -3533,6 +3533,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3533
3533
  var popupInstance = this.popupObj;
3534
3534
  var eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
3535
3535
  this.trigger('close', eventArgs, function (eventArgs) {
3536
+ _this.isEventCancel = eventArgs.cancel;
3536
3537
  if (!isNullOrUndefined(_this.popupObj) &&
3537
3538
  !isNullOrUndefined(_this.popupObj.element.querySelector('.e-fixed-head'))) {
3538
3539
  var fixedHeader = _this.popupObj.element.querySelector('.e-fixed-head');
@@ -5234,7 +5235,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5234
5235
  _this.clickHandler(e);
5235
5236
  break;
5236
5237
  case 'moveDown':
5237
- _this.treeObj.element.focus();
5238
+ var focusedElement = _this.treeObj.element.querySelector('li');
5239
+ focusedElement.focus();
5240
+ addClass([focusedElement], ['e-hover', 'e-node-focus']);
5238
5241
  }
5239
5242
  }
5240
5243
  });
@@ -5911,7 +5914,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5911
5914
  _this.popupObj.refreshPosition();
5912
5915
  if (!(_this.showCheckBox && _this.showSelectAll) && (!_this.popupDiv.classList.contains(NODATA)
5913
5916
  && _this.treeItems.length > 0)) {
5914
- _this.treeObj.element.focus();
5917
+ var focusedElement = _this.treeObj.element.querySelector('li');
5918
+ focusedElement.focus();
5919
+ addClass([focusedElement], ['e-hover', 'e-node-focus']);
5915
5920
  }
5916
5921
  if (_this.checkSelectAll && _this.checkBoxElement) {
5917
5922
  var wrap = closest(_this.checkBoxElement, '.' + CHECKBOXWRAP);
@@ -6834,8 +6839,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6834
6839
  setValue('selectedNodes', [], this.treeObj);
6835
6840
  this.hiddenElement.innerHTML = '';
6836
6841
  if (this.showCheckBox) {
6837
- this.treeObj.checkedNodes = [];
6838
- this.treeObj.dataBind();
6842
+ this.treeObj.uncheckAll();
6839
6843
  this.setMultiSelect();
6840
6844
  this.clearCheckAll();
6841
6845
  }
@@ -12833,6 +12837,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12833
12837
  MultiSelect.prototype.render = function () {
12834
12838
  this.setDynValue = this.initStatus = false;
12835
12839
  this.isSelectAll = false;
12840
+ this.selectAllEventEle = [];
12836
12841
  this.searchWrapper = this.createElement('span', { className: SEARCHBOX_WRAPPER + ' ' + ((this.mode === 'Box') ? BOX_ELEMENT : '') });
12837
12842
  this.viewWrapper = this.createElement('span', { className: DELIMITER_VIEW + ' ' + DELIMITER_WRAPPER, styles: 'display:none;' });
12838
12843
  this.overAllClear = this.createElement('span', {
@@ -16833,6 +16838,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16833
16838
  }
16834
16839
  else {
16835
16840
  popupEle_1.style.left = formatUnit(coordinates_1.left);
16841
+ popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(_this.popupHeight.toString()));
16836
16842
  _this.isCollided = false;
16837
16843
  }
16838
16844
  popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
@@ -16861,7 +16867,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16861
16867
  };
16862
16868
  Mention.prototype.checkCollision = function (popupEle) {
16863
16869
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16864
- var collision = isCollide(popupEle);
16870
+ var coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
16871
+ var collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
16865
16872
  if (collision.length > 0) {
16866
16873
  popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
16867
16874
  this.isCollided = true;
@@ -16886,7 +16893,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16886
16893
  this.popupObj = new Popup(element, {
16887
16894
  width: this.setWidth(), targetType: 'relative',
16888
16895
  relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
16889
- enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
16896
+ enableRtl: this.enableRtl, offsetX: left, position: { X: 'left', Y: 'bottom' }, actionOnScroll: 'hide',
16890
16897
  zIndex: this.zIndex,
16891
16898
  close: function () {
16892
16899
  _this.destroyPopup();
@@ -16968,14 +16975,14 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16968
16975
  if (!this.isContentEditable(this.inputElement)) {
16969
16976
  coordinates = {
16970
16977
  top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
16971
- parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
16978
+ parseInt(computed.fontSize, 10) + 3 - element.scrollTop - (this.isCollided ? 10 : 0),
16972
16979
  left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
16973
16980
  };
16974
16981
  document.body.removeChild(div);
16975
16982
  }
16976
16983
  else {
16977
16984
  coordinates = {
16978
- top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
16985
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
16979
16986
  left: rect.left + windowLeft
16980
16987
  };
16981
16988
  }