@syncfusion/ej2-dropdowns 21.2.5 → 21.2.8

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.2.5
3
+ * version : 21.2.8
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-dropdowns@*",
3
- "_id": "@syncfusion/ej2-dropdowns@21.2.4",
3
+ "_id": "@syncfusion/ej2-dropdowns@21.2.6",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-zvVbPhcsqg1dJj+SPkpRK+CJen+KhxeHZzrxzjUrB+uM6pYBfSPNMktkhHCpA1UPzzKMBuqfbs8J0fPUa8zOmQ==",
5
+ "_integrity": "sha512-wSYI3K3YsYxJKmZOBv9bRpRLH76tyVSOJrgdXvuCJIU15b2imLkegMeUGwSJ4IdPUXi+LqNUWWu7uAH6ZzM2ZA==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -34,8 +34,8 @@
34
34
  "/@syncfusion/ej2-spreadsheet",
35
35
  "/@syncfusion/ej2-vue-dropdowns"
36
36
  ],
37
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-21.2.4.tgz",
38
- "_shasum": "138e0592eaa32d7c95676b807b6e028c7dbab321",
37
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-21.2.6.tgz",
38
+ "_shasum": "56982d04447e3b476ffab41971af04671940f76a",
39
39
  "_spec": "@syncfusion/ej2-dropdowns@*",
40
40
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
41
41
  "author": {
@@ -44,10 +44,10 @@
44
44
  "bundleDependencies": false,
45
45
  "dependencies": {
46
46
  "@syncfusion/ej2-base": "~21.2.3",
47
- "@syncfusion/ej2-data": "~21.2.4",
48
- "@syncfusion/ej2-inputs": "~21.2.4",
49
- "@syncfusion/ej2-lists": "~21.2.3",
50
- "@syncfusion/ej2-navigations": "~21.2.5",
47
+ "@syncfusion/ej2-data": "~21.2.8",
48
+ "@syncfusion/ej2-inputs": "~21.2.8",
49
+ "@syncfusion/ej2-lists": "~21.2.6",
50
+ "@syncfusion/ej2-navigations": "~21.2.8",
51
51
  "@syncfusion/ej2-popups": "~21.2.4"
52
52
  },
53
53
  "deprecated": false,
@@ -73,7 +73,7 @@
73
73
  "module": "./index.js",
74
74
  "name": "@syncfusion/ej2-dropdowns",
75
75
  "typings": "index.d.ts",
76
- "version": "21.2.5",
76
+ "version": "21.2.8",
77
77
  "sideEffects": false,
78
78
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
79
79
  }
@@ -91,7 +91,7 @@ export function Search(inputVal, items, searchType, ignoreCase, dataSource, fiel
91
91
  dataSource.filter(function (data) {
92
92
  Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
93
93
  /* eslint-disable security/detect-object-injection */
94
- 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) {
94
+ if (type === 'object' && (!data.isHeader && 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) {
95
95
  filterValue = type === 'object' ? data[value] : data;
96
96
  }
97
97
  });
@@ -105,7 +105,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
105
105
  protected preventChange: boolean;
106
106
  protected isAngular: boolean;
107
107
  protected selectedElementID: string;
108
- private isEventCancel;
109
108
  /**
110
109
  * Sets CSS classes to the root element of the component that allows customization of appearance.
111
110
  *
@@ -1136,6 +1136,7 @@ var DropDownList = /** @class */ (function (_super) {
1136
1136
  var index = this.isSelectCustom ? null : this.activeIndex;
1137
1137
  this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
1138
1138
  this.detachChangeEvent(eve);
1139
+ this.dispatchEvent(this.hiddenElement, 'change');
1139
1140
  };
1140
1141
  DropDownList.prototype.detachChanges = function (value) {
1141
1142
  var items;
@@ -1816,14 +1817,12 @@ var DropDownList = /** @class */ (function (_super) {
1816
1817
  _this.isNotSearchList = false;
1817
1818
  _this.isDocumentClick = false;
1818
1819
  _this.destroyPopup();
1819
- EventHandler.remove(document, 'mousedown', _this.onDocumentClick);
1820
1820
  if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
1821
1821
  _this.isActive = true;
1822
1822
  _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
1823
1823
  }
1824
1824
  },
1825
1825
  open: function () {
1826
- EventHandler.remove(document, 'mousedown', _this.onDocumentClick);
1827
1826
  EventHandler.add(document, 'mousedown', _this.onDocumentClick, _this);
1828
1827
  _this.isPopupOpen = true;
1829
1828
  var actionList = _this.actionCompleteData && _this.actionCompleteData.ulElement &&
@@ -2003,9 +2002,10 @@ var DropDownList = /** @class */ (function (_super) {
2003
2002
  DropDownList.prototype.closePopup = function (delay, e) {
2004
2003
  var _this = this;
2005
2004
  this.isTyped = false;
2006
- if (!(this.popupObj && document.body.contains(this.popupObj.element) && (this.beforePopupOpen || this.isEventCancel))) {
2005
+ if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
2007
2006
  return;
2008
2007
  }
2008
+ EventHandler.remove(document, 'mousedown', this.onDocumentClick);
2009
2009
  this.isActive = false;
2010
2010
  this.filterInputObj = null;
2011
2011
  this.isDropDownClick = false;
@@ -2055,7 +2055,6 @@ var DropDownList = /** @class */ (function (_super) {
2055
2055
  var popupInstance = this.popupObj;
2056
2056
  var eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
2057
2057
  this.trigger('close', eventArgs, function (eventArgs) {
2058
- _this.isEventCancel = eventArgs.cancel;
2059
2058
  if (!isNullOrUndefined(_this.popupObj) &&
2060
2059
  !isNullOrUndefined(_this.popupObj.element.querySelector('.e-fixed-head'))) {
2061
2060
  var fixedHeader = _this.popupObj.element.querySelector('.e-fixed-head');
@@ -2232,9 +2231,7 @@ var DropDownList = /** @class */ (function (_super) {
2232
2231
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2233
2232
  var footerCompTemp = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, null, this.footer);
2234
2233
  if (footerCompTemp && footerCompTemp.length > 0) {
2235
- for (var i = 0; i < footerCompTemp.length; i++) {
2236
- this.footer.appendChild(footerCompTemp[i]);
2237
- }
2234
+ append(footerCompTemp, this.footer);
2238
2235
  }
2239
2236
  append([this.footer], popupEle);
2240
2237
  };
@@ -2257,9 +2254,7 @@ var DropDownList = /** @class */ (function (_super) {
2257
2254
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2258
2255
  var headerCompTemp = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, null, this.header);
2259
2256
  if (headerCompTemp && headerCompTemp.length) {
2260
- for (var i = 0; i < headerCompTemp.length; i++) {
2261
- this.header.appendChild(headerCompTemp[i]);
2262
- }
2257
+ append(headerCompTemp, this.header);
2263
2258
  }
2264
2259
  var contentEle = popupEle.querySelector('div.e-content');
2265
2260
  popupEle.insertBefore(this.header, contentEle);
@@ -744,6 +744,16 @@ var ListBox = /** @class */ (function (_super) {
744
744
  }
745
745
  this.setSelection(items, state, !isValue);
746
746
  this.updateSelectedOptions();
747
+ var selElems = [];
748
+ for (var i = 0; i < items.length; i++) {
749
+ var liColl = this.list.querySelectorAll('[aria-selected="true"]');
750
+ for (var j = 0; j < liColl.length; j++) {
751
+ if (items[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
752
+ selElems.push(liColl[j]);
753
+ }
754
+ }
755
+ }
756
+ this.triggerChange(selElems, null);
747
757
  };
748
758
  /**
749
759
  * Based on the state parameter, entire list item will be selected/deselected.
@@ -1962,8 +1972,11 @@ var ListBox = /** @class */ (function (_super) {
1962
1972
  }
1963
1973
  if (typeof (text) === 'string') {
1964
1974
  text = text.split('\\').join('\\\\');
1975
+ li = _this.list.querySelector('[data-value="' + text.replace(/"/g, '\\"') + '"]');
1976
+ }
1977
+ else {
1978
+ li = _this.list.querySelector('[data-value="' + text + '"]');
1965
1979
  }
1966
- li = _this.list.querySelector('[data-value="' + text + '"]');
1967
1980
  if (li) {
1968
1981
  if (_this.selectionSettings.showCheckbox) {
1969
1982
  liselect = li.getElementsByClassName('e-frame')[0].classList.contains('e-check');
@@ -1999,9 +2012,12 @@ var ListBox = /** @class */ (function (_super) {
1999
2012
  ele.innerHTML = '';
2000
2013
  if (this.value) {
2001
2014
  for (var i = 0, len = this.value.length; i < len; i++) {
2002
- innerHTML += '<option selected value="' + this.value[i] + '"></option>';
2015
+ innerHTML += '<option selected>' + this.value[i] + '</option>';
2003
2016
  }
2004
2017
  ele.innerHTML += innerHTML;
2018
+ for (var i = 0, len = ele.childNodes.length; i < len; i++) {
2019
+ ele.childNodes[i].setAttribute('value', this.value[i].toString());
2020
+ }
2005
2021
  }
2006
2022
  this.checkSelectAll();
2007
2023
  };
@@ -841,7 +841,7 @@ var Mention = /** @class */ (function (_super) {
841
841
  var selectedNodePosition = this.getTriggerCharPosition();
842
842
  globalRange = this.range;
843
843
  range = document.createRange();
844
- if (this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1 && this.isTyped) {
844
+ if (this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1) {
845
845
  range.setStart(globalRange.startContainer, selectedNodePosition);
846
846
  range.setEnd(globalRange.startContainer, selectedNodePosition);
847
847
  }
@@ -1874,10 +1874,10 @@ var MultiSelect = /** @class */ (function (_super) {
1874
1874
  }
1875
1875
  };
1876
1876
  MultiSelect.prototype.removeChipFocus = function () {
1877
- var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);
1878
- var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE.split(' ')[0]);
1877
+ var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP + '.' + CHIP_SELECTED);
1879
1878
  removeClass(elements, CHIP_SELECTED);
1880
1879
  if (Browser.isDevice) {
1880
+ var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE.split(' ')[0]);
1881
1881
  for (var index = 0; index < closeElements.length; index++) {
1882
1882
  closeElements[index].style.display = 'none';
1883
1883
  }
@@ -2138,9 +2138,7 @@ var MultiSelect = /** @class */ (function (_super) {
2138
2138
  // eslint-disable-next-line
2139
2139
  var elements = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, null, this.header);
2140
2140
  if (elements && elements.length > 0) {
2141
- for (var temp = 0; temp < elements.length; temp++) {
2142
- this.header.appendChild(elements[temp]);
2143
- }
2141
+ append(elements, this.header);
2144
2142
  }
2145
2143
  if (this.mode === 'CheckBox' && this.showSelectAll) {
2146
2144
  prepend([this.header], this.popupWrapper);
@@ -2167,9 +2165,7 @@ var MultiSelect = /** @class */ (function (_super) {
2167
2165
  // eslint-disable-next-line
2168
2166
  var elements = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, null, this.footer);
2169
2167
  if (elements && elements.length > 0) {
2170
- for (var temp = 0; temp < elements.length; temp++) {
2171
- this.footer.appendChild(elements[temp]);
2172
- }
2168
+ append(elements, this.footer);
2173
2169
  }
2174
2170
  append([this.footer], this.popupWrapper);
2175
2171
  EventHandler.add(this.footer, 'mousedown', this.onListMouseDown, this);
@@ -2386,25 +2382,30 @@ var MultiSelect = /** @class */ (function (_super) {
2386
2382
  this.hiddenElement.innerHTML = '';
2387
2383
  }
2388
2384
  if (!isNullOrUndefined(this.value)) {
2389
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
2390
- var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
2385
+ var valueLength = this.value.length;
2386
+ var hiddenElementContent = '';
2387
+ for (var index = 0; index < valueLength; index++) {
2388
+ var valueItem = this.value[index];
2389
+ var listValue = this.findListElement((!isNullOrUndefined(this.mainList) ? this.mainList : this.ulElement), 'li', 'data-value', valueItem);
2391
2390
  if (isNullOrUndefined(listValue) && !this.allowCustomValue) {
2392
2391
  this.value.splice(index, 1);
2393
2392
  index -= 1;
2393
+ valueLength -= 1;
2394
2394
  }
2395
2395
  else {
2396
2396
  if (this.listData) {
2397
- temp = this.getTextByValue(this.value[index]);
2397
+ temp = this.getTextByValue(valueItem);
2398
2398
  }
2399
2399
  else {
2400
- temp = this.value[index];
2400
+ temp = valueItem;
2401
2401
  }
2402
2402
  data += temp + delimiterChar + ' ';
2403
2403
  text.push(temp);
2404
2404
  }
2405
- if (!isNullOrUndefined(this.hiddenElement)) {
2406
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
2407
- }
2405
+ hiddenElementContent += "<option selected value=\"" + valueItem + "\">" + index + "</option>";
2406
+ }
2407
+ if (!isNullOrUndefined(this.hiddenElement)) {
2408
+ this.hiddenElement.innerHTML = hiddenElementContent;
2408
2409
  }
2409
2410
  }
2410
2411
  this.setProperties({ text: text.toString() }, true);