@syncfusion/ej2-dropdowns 31.2.15 → 31.2.18

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.
@@ -5902,6 +5902,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5902
5902
  EventHandler.add(_this.clearIconElement, 'click', _this.clearText, _this);
5903
5903
  }
5904
5904
  }
5905
+ if (_this.selectedLI && _this.fields.groupBy) {
5906
+ _this.setScrollPosition();
5907
+ }
5905
5908
  popupEle_1.style.visibility = 'visible';
5906
5909
  addClass([popupEle_1], 'e-popup-close');
5907
5910
  var scrollParentElements = _this.popupObj.getScrollableParent(_this.inputWrapper.container);
@@ -7278,7 +7281,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7278
7281
  var container = this.inputWrapper.container;
7279
7282
  var label = container.querySelector('.e-float-text');
7280
7283
  var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
7281
- if (label && calculateWidth) {
7284
+ if (label && calculateWidth && !(this.cssClass && this.cssClass.split(' ').indexOf('e-outline') !== -1)) {
7282
7285
  label.style.width = calculateWidth + 'px';
7283
7286
  }
7284
7287
  };
@@ -18980,7 +18983,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18980
18983
  _this.renderItems(_this.mainData, _this.fields);
18981
18984
  }
18982
18985
  _this.virtualCustomData = null;
18983
- _this.isVirtualTrackHeight = false;
18986
+ _this.isVirtualTrackHeight = _this.totalItemCount > (_this.itemCount * 2) ? false : true;
18984
18987
  }
18985
18988
  });
18986
18989
  }
@@ -19029,7 +19032,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19029
19032
  if (_this.hideSelectedItem && _this.value && Array.isArray(_this.value) && _this.value.length > 0) {
19030
19033
  _this.totalItemsCount();
19031
19034
  }
19032
- if (!_this.preventSetCurrentData && !isNullOrUndefined(_this.viewPortInfo.startIndex) &&
19035
+ if (!_this.preventSetCurrentData && _this.totalItemCount > (_this.itemCount * 2) &&
19036
+ !isNullOrUndefined(_this.viewPortInfo.startIndex) &&
19033
19037
  !isNullOrUndefined(_this.viewPortInfo.endIndex)) {
19034
19038
  _this.notify('setCurrentViewDataAsync', {
19035
19039
  component: _this.getModuleName(),
@@ -19098,7 +19102,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19098
19102
  var container = this.overAllWrapper;
19099
19103
  var label = container.querySelector('.e-float-text');
19100
19104
  var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
19101
- if (label && calculateWidth) {
19105
+ if (label && calculateWidth && !(this.cssClass && this.cssClass.split(' ').indexOf('e-outline') !== -1)) {
19102
19106
  label.style.width = calculateWidth + 'px';
19103
19107
  }
19104
19108
  };
@@ -21120,12 +21124,38 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
21120
21124
  this.stopTimer();
21121
21125
  var items = [];
21122
21126
  this.dragValue = this.getFormattedValue(args.droppedElement.getAttribute('data-value'));
21123
- if (this.value.indexOf(this.dragValue) > -1) {
21124
- args.items = this.getDataByValues(this.value);
21127
+ if (this.allowDragAll) {
21128
+ var selectedValues = [];
21129
+ if (this.selectionSettings.showCheckbox && this.allowFiltering) {
21130
+ var visibleSelected = [];
21131
+ var selectedList = this.getSelectedItems();
21132
+ for (var index = 0; index < selectedList.length; index++) {
21133
+ var formattedValue = this.getFormattedValue(selectedList[index].getAttribute('data-value'));
21134
+ visibleSelected.push(formattedValue);
21135
+ }
21136
+ selectedValues = visibleSelected.length ? visibleSelected
21137
+ : ((this.value ? this.value.slice() : []));
21138
+ }
21139
+ else {
21140
+ var selectedList = this.getSelectedItems();
21141
+ for (var index = 0; index < selectedList.length; index++) {
21142
+ var formattedValue = this.getFormattedValue(selectedList[index].getAttribute('data-value'));
21143
+ selectedValues.push(formattedValue);
21144
+ }
21145
+ }
21146
+ if (selectedValues.indexOf(this.dragValue) > -1) {
21147
+ args.items = this.getDataByValues(selectedValues);
21148
+ }
21149
+ else {
21150
+ args.items = this.getDataByValues([this.dragValue]);
21151
+ }
21125
21152
  }
21126
21153
  else {
21127
21154
  args.items = this.getDataByValues([this.dragValue]);
21128
21155
  }
21156
+ if (this.allowDragAll) {
21157
+ this.customDraggedItem = args.items;
21158
+ }
21129
21159
  extend(items, args.items);
21130
21160
  this.trigger('beforeDrop', args);
21131
21161
  if (JSON.stringify(args.items) !== JSON.stringify(items)) {
@@ -21154,6 +21184,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
21154
21184
  if (Browser.isIos) {
21155
21185
  this.list.style.overflow = '';
21156
21186
  }
21187
+ if (listObj && listObj !== this && !listObj.allowDragAndDrop) {
21188
+ return;
21189
+ }
21157
21190
  var targetListObj = this.getComponent(args.target);
21158
21191
  if (targetListObj && targetListObj.listData.length === 0) {
21159
21192
  var noRecElem = targetListObj.ulElement.childNodes[0];
@@ -23614,6 +23647,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23614
23647
  this.isUpDownKey = false;
23615
23648
  return;
23616
23649
  }
23650
+ if (!this.allowSpaces && e.code === 'Space' && this.beforePopupOpen && this.isPopupOpen) {
23651
+ this.hidePopup();
23652
+ return;
23653
+ }
23617
23654
  this.isTyped = e.code !== 'Enter' && e.code !== 'Space' && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' ? true : false;
23618
23655
  var isRteImage = document.activeElement.parentElement && document.activeElement.parentElement.querySelector('.e-rte-image') ? true : false;
23619
23656
  if (document.activeElement !== this.inputElement && !isRteImage) {
@@ -23641,6 +23678,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23641
23678
  if (!this.requireLeadingSpace && lastWordRange && lastWordRange.includes(this.mentionChar)) {
23642
23679
  lastWordRange = this.mentionChar + lastWordRange.split(this.mentionChar).pop();
23643
23680
  }
23681
+ if (lastWordRange.includes(' ')) {
23682
+ return;
23683
+ }
23644
23684
  }
23645
23685
  var lastTwoLetters = this.mentionChar.toString() + this.mentionChar.toString();
23646
23686
  // eslint-disable-next-line security/detect-non-literal-regexp
@@ -23661,8 +23701,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23661
23701
  (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
23662
23702
  this.range.startContainer.nodeType === 1))) {
23663
23703
  if (isValid && this.isPopupOpen && this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
23664
- && !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
23665
- (this.list && this.list.querySelectorAll('ul').length > 0) && e.code !== 'Enter') {
23704
+ && !this.isMatchedText() && this.list && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' && e.code !== 'Enter') {
23666
23705
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
23667
23706
  this.searchLists(e);
23668
23707
  }
@@ -23938,7 +23977,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23938
23977
  return '';
23939
23978
  }
23940
23979
  var textValue = text.indexOf('\u200B') > -1 ? text.replace(/\u200B/g, '').replace(/\u00A0/g, ' ') : text.replace(/\u00A0/g, ' ');
23941
- var words = textValue.split(/\s+/);
23980
+ var words = this.allowSpaces && this.isPopupOpen ? [textValue] : textValue.split(/\s+/);
23942
23981
  var wordCnt = words.length - 1;
23943
23982
  return words[wordCnt].trim();
23944
23983
  };
@@ -24630,15 +24669,18 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
24630
24669
  if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
24631
24670
  value = this.displayTempElement.innerHTML;
24632
24671
  }
24672
+ var rteRoot = this.inputElement.parentElement ? this.inputElement.parentElement.closest('.e-richtexteditor') : null;
24633
24673
  if (this.isContentEditable(this.inputElement)) {
24674
+ var suffix = typeof this.suffixText === 'string' ? this.suffixText : (rteRoot ? '&#8203;' : ' ');
24675
+ var chipContent = showChar + value;
24634
24676
  if (Browser.isAndroid) {
24635
- return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24677
+ return "<span contenteditable=\"true\" class=\"e-mention-chip\">" + chipContent + "</span>" + suffix;
24636
24678
  }
24637
24679
  else if (Browser.info.name === 'mozilla') {
24638
- return '<span>&#65279;<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>&#65279;</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24680
+ return "<span>&#65279;<span contenteditable=\"false\" class=\"e-mention-chip\">" + chipContent + "</span>&#65279;</span>" + suffix;
24639
24681
  }
24640
24682
  else {
24641
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24683
+ return "<span contenteditable=\"false\" class=\"e-mention-chip\">" + chipContent + "</span>" + suffix;
24642
24684
  }
24643
24685
  }
24644
24686
  else {