@syncfusion/ej2-dropdowns 29.1.33 → 29.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.
@@ -1890,12 +1890,9 @@ let DropDownBase = class DropDownBase extends Component {
1890
1890
  if (this.sortOrder !== 'None') {
1891
1891
  dataSource = this.getSortedDataSource(dataSource);
1892
1892
  }
1893
- if (this.element.querySelector('optgroup') && this.isGroupChecking && this.getModuleName() === 'multiselect') {
1894
- dataSource = ListBase.groupDataSource(dataSource, fields, this.sortOrder);
1895
- }
1896
- else {
1897
- dataSource = ListBase.groupDataSource(dataSource, fields.properties, this.sortOrder);
1898
- }
1893
+ const fieldSet = fields.properties ||
1894
+ fields;
1895
+ dataSource = ListBase.groupDataSource(dataSource, fieldSet, this.sortOrder);
1899
1896
  }
1900
1897
  addClass([this.list], dropDownBaseClasses.grouping);
1901
1898
  }
@@ -4388,6 +4385,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4388
4385
  if ((this.value === dataItem.value && this.text !== dataItem.text) ||
4389
4386
  (this.value !== dataItem.value && this.text === dataItem.text)) {
4390
4387
  this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
4388
+ if (isNullOrUndefined(li)) {
4389
+ this.previousValue = this.value;
4390
+ }
4391
4391
  }
4392
4392
  }
4393
4393
  }
@@ -8816,6 +8816,9 @@ let DropDownTree = class DropDownTree extends Component {
8816
8816
  this.trigger('beforeOpen', args, (args) => {
8817
8817
  if (!args.cancel) {
8818
8818
  addClass([this.inputWrapper], [ICONANIMATION]);
8819
+ if (this.isReact && this.isFilterRestore) {
8820
+ this.treeObj.refresh();
8821
+ }
8819
8822
  if (this.isFirstRender) {
8820
8823
  this.popupEle = this.createElement('div', {
8821
8824
  id: this.element.id + '_options', className: POPUP_CLASS + ' ' + (this.cssClass != null ? this.cssClass : '')
@@ -8828,7 +8831,6 @@ let DropDownTree = class DropDownTree extends Component {
8828
8831
  else {
8829
8832
  this.popupEle = this.popupObj.element;
8830
8833
  if (this.isReact && this.isFilterRestore) {
8831
- this.treeObj.refresh();
8832
8834
  this.isFilteredData = true;
8833
8835
  this.popupEle.removeChild(this.filterContainer);
8834
8836
  }
@@ -10813,7 +10815,8 @@ let ComboBox = class ComboBox extends DropDownList {
10813
10815
  onBlurHandler(e) {
10814
10816
  const inputValue = this.inputElement && this.inputElement.value === '' ?
10815
10817
  null : this.inputElement && this.inputElement.value;
10816
- if (!isNullOrUndefined(this.listData) && !isNullOrUndefined(inputValue) && inputValue !== this.text) {
10818
+ const text = !isNullOrUndefined(this.text) ? this.text.replace(/\r\n|\n|\r/g, '') : this.text;
10819
+ if (!isNullOrUndefined(this.listData) && !isNullOrUndefined(inputValue) && inputValue !== text) {
10817
10820
  this.customValue(e);
10818
10821
  }
10819
10822
  super.onBlurHandler(e);
@@ -10938,6 +10941,9 @@ let ComboBox = class ComboBox extends DropDownList {
10938
10941
  if ((this.value === dataItem.value && this.text !== dataItem.text)
10939
10942
  || (this.value !== dataItem.value && this.text === dataItem.text)) {
10940
10943
  this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
10944
+ if (isNullOrUndefined(li)) {
10945
+ this.previousValue = this.value;
10946
+ }
10941
10947
  }
10942
10948
  }
10943
10949
  }
@@ -11614,8 +11620,9 @@ let ComboBox = class ComboBox extends DropDownList {
11614
11620
  this.removeFillSelection();
11615
11621
  }
11616
11622
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
11623
+ const text = !isNullOrUndefined(dataItem.text) ? dataItem.text.replace(/\r\n|\n|\r/g, '') : dataItem.text;
11617
11624
  const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
11618
- if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
11625
+ if (this.inputElement && text === this.inputElement.value && !isNullOrUndefined(selected)) {
11619
11626
  if (this.isSelected) {
11620
11627
  this.onChangeEvent(e);
11621
11628
  this.isSelectCustom = false;
@@ -13140,7 +13147,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13140
13147
  if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
13141
13148
  this.initialValueUpdate();
13142
13149
  }
13143
- else {
13150
+ else if (!this.isRemoveSelection) {
13144
13151
  this.initialValueUpdate(this.listData, true);
13145
13152
  }
13146
13153
  this.initialUpdate();
@@ -13270,11 +13277,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13270
13277
  }
13271
13278
  if ((!this.enableVirtualization && ((searchCount === searchActiveCount || searchActiveCount === this.maximumSelectionLength)
13272
13279
  && (this.mode === 'CheckBox' && this.showSelectAll))) || (this.enableVirtualization && this.mode === 'CheckBox' &&
13273
- this.showSelectAll && this.virtualSelectAll && this.value && this.value.length === this.totalItemCount)) {
13280
+ this.showSelectAll && this.value && this.value.length === this.totalItemCount)) {
13274
13281
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'check' });
13275
13282
  }
13276
- else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll) &&
13277
- ((!this.enableVirtualization) || (this.enableVirtualization && !this.virtualSelectAll))) {
13283
+ else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll)) {
13278
13284
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
13279
13285
  }
13280
13286
  if (this.enableGroupCheckBox && this.fields.groupBy && !this.enableSelectionOrder) {
@@ -13688,6 +13694,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13688
13694
  if (!(this.targetElement() && this.targetElement() !== '')) {
13689
13695
  e.preventDefault();
13690
13696
  }
13697
+ this.checkAndScrollParent();
13698
+ }
13699
+ checkAndScrollParent() {
13700
+ const parentElement = this.overAllWrapper ? this.overAllWrapper.parentElement : null;
13701
+ if (parentElement) {
13702
+ const wrapperHeight = parseFloat(getComputedStyle(this.overAllWrapper).height);
13703
+ const parentMaxHeight = parseFloat(getComputedStyle(parentElement).maxHeight);
13704
+ if (!isNaN(parentMaxHeight) && wrapperHeight > parentMaxHeight) {
13705
+ parentElement.scrollTop = parentElement.scrollHeight;
13706
+ }
13707
+ }
13691
13708
  }
13692
13709
  enable(state) {
13693
13710
  if (state) {
@@ -16421,6 +16438,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16421
16438
  else {
16422
16439
  this.removeValue(value, e, length);
16423
16440
  }
16441
+ this.checkAndScrollParent();
16424
16442
  }
16425
16443
  updateListSelectEventCallback(value, li, e, currentText) {
16426
16444
  value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
@@ -17000,7 +17018,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17000
17018
  this.updateWrapperText(this.viewWrapper, data);
17001
17019
  }
17002
17020
  wrapperleng = this.viewWrapper.offsetWidth +
17003
- parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
17021
+ parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10) +
17022
+ parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft, 10);
17004
17023
  overAllContainer = this.componentWrapper.offsetWidth -
17005
17024
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
17006
17025
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
@@ -17012,14 +17031,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17012
17031
  this.updateWrapperText(this.viewWrapper, temp);
17013
17032
  remaining = this.value.length - index;
17014
17033
  wrapperleng = this.viewWrapper.offsetWidth +
17015
- parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
17034
+ parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10) +
17035
+ parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft, 10);
17016
17036
  while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
17017
17037
  && this.viewWrapper.innerHTML !== '') {
17018
17038
  const textArr = [];
17019
17039
  this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
17020
17040
  remaining = this.value.length;
17021
17041
  wrapperleng = this.viewWrapper.offsetWidth +
17022
- parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
17042
+ parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10) +
17043
+ parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft, 10);
17023
17044
  }
17024
17045
  break;
17025
17046
  }
@@ -17049,13 +17070,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17049
17070
  }
17050
17071
  checkClearIconWidth() {
17051
17072
  if (this.showClearButton) {
17052
- this.clearIconWidth = this.overAllClear.offsetWidth;
17073
+ this.clearIconWidth = parseInt(window.getComputedStyle(this.overAllClear).width, 10);
17053
17074
  }
17054
17075
  }
17055
17076
  updateRemainWidth(viewWrapper, totalWidth) {
17056
17077
  if (viewWrapper.classList.contains(TOTAL_COUNT_WRAPPER$1) && totalWidth < (viewWrapper.offsetWidth +
17057
17078
  parseInt(window.getComputedStyle(viewWrapper).paddingLeft, 10)
17058
- + parseInt(window.getComputedStyle(viewWrapper).paddingLeft, 10))) {
17079
+ + parseInt(window.getComputedStyle(viewWrapper).paddingRight, 10))) {
17059
17080
  viewWrapper.style.width = totalWidth + 'px';
17060
17081
  }
17061
17082
  }
@@ -17314,6 +17335,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17314
17335
  li[index - 1].classList.remove('e-item-focus');
17315
17336
  }
17316
17337
  }
17338
+ this.checkSelectAll();
17317
17339
  }, 0);
17318
17340
  }
17319
17341
  }
@@ -17340,6 +17362,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17340
17362
  });
17341
17363
  }
17342
17364
  }
17365
+ this.checkSelectAll();
17343
17366
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17344
17367
  const virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
17345
17368
  if (virtualTrackElement) {
@@ -21666,8 +21689,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
21666
21689
  text = value;
21667
21690
  }
21668
21691
  if (typeof (text) === 'string') {
21669
- text = text.split('\\').join('\\\\');
21670
- li = this.list.querySelector('[data-value="' + text.replace(/"/g, '\\"') + '"]');
21692
+ if (text.indexOf('\n') !== -1) {
21693
+ const txt = CSS.escape(text);
21694
+ li = this.list.querySelector('[data-value="' + txt + '"]');
21695
+ }
21696
+ else {
21697
+ text = text.split('\\').join('\\\\');
21698
+ li = this.list.querySelector('[data-value="' + text.replace(/"/g, '\\"') + '"]');
21699
+ }
21671
21700
  }
21672
21701
  else {
21673
21702
  li = this.list.querySelector('[data-value="' + text + '"]');