@syncfusion/ej2-dropdowns 20.2.40 → 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.
@@ -150,8 +150,8 @@ var DropDownList = /** @class */ (function (_super) {
150
150
  this.popupObj.setProperties({ 'zIndex': this.zIndex });
151
151
  }
152
152
  };
153
- DropDownList.prototype.renderList = function (isEmptyData) {
154
- _super.prototype.render.call(this, isEmptyData);
153
+ DropDownList.prototype.renderList = function (e, isEmptyData) {
154
+ _super.prototype.render.call(this, e, isEmptyData);
155
155
  this.unWireListEvents();
156
156
  this.wireListEvents();
157
157
  };
@@ -636,7 +636,7 @@ var DropDownList = /** @class */ (function (_super) {
636
636
  var isTabAction = e.action === 'tab' || e.action === 'close';
637
637
  if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
638
638
  this.searchKeyEvent = e;
639
- this.renderList();
639
+ this.renderList(e);
640
640
  }
641
641
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
642
642
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -675,7 +675,7 @@ var DropDownList = /** @class */ (function (_super) {
675
675
  }
676
676
  break;
677
677
  case 'open':
678
- this.showPopup();
678
+ this.showPopup(e);
679
679
  break;
680
680
  case 'hide':
681
681
  this.preventAltUp = this.isPopupOpen;
@@ -867,7 +867,7 @@ var DropDownList = /** @class */ (function (_super) {
867
867
  }
868
868
  if (!this.readonly) {
869
869
  if (this.isPopupOpen) {
870
- this.hidePopup();
870
+ this.hidePopup(e);
871
871
  if (this.isFilterLayout()) {
872
872
  this.focusDropDown(e);
873
873
  }
@@ -877,7 +877,7 @@ var DropDownList = /** @class */ (function (_super) {
877
877
  this.floatLabelChange();
878
878
  this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
879
879
  this.isDropDownClick = true;
880
- this.showPopup();
880
+ this.showPopup(e);
881
881
  }
882
882
  // eslint-disable-next-line @typescript-eslint/no-this-alias
883
883
  var proxy_1 = this;
@@ -1522,26 +1522,8 @@ var DropDownList = /** @class */ (function (_super) {
1522
1522
  }
1523
1523
  this.initial = false;
1524
1524
  }
1525
- else if (this.getModuleName() === 'autocomplete' && this.value && this.typedString === '' && !(this.dataSource instanceof DataManager)) {
1526
- var checkFields_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
1527
- var checkValue = list.some(function (x) { return x[checkFields_1] === _this.value; });
1528
- var query = new Query();
1529
- if (!checkValue) {
1530
- new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', this.value)))
1531
- .then(function (e) {
1532
- if (e.result.length > 0) {
1533
- _this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
1534
- _this.addItem(e.result, list.length);
1535
- _this.updateValues();
1536
- }
1537
- else {
1538
- _this.updateValues();
1539
- }
1540
- });
1541
- }
1542
- else {
1543
- this.updateValues();
1544
- }
1525
+ else if (this.getModuleName() === 'autocomplete' && this.value) {
1526
+ this.setInputValue();
1545
1527
  }
1546
1528
  if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
1547
1529
  if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
@@ -1564,7 +1546,7 @@ var DropDownList = /** @class */ (function (_super) {
1564
1546
  }
1565
1547
  }
1566
1548
  if (this.beforePopupOpen) {
1567
- this.renderPopup();
1549
+ this.renderPopup(e);
1568
1550
  }
1569
1551
  }
1570
1552
  };
@@ -1636,7 +1618,7 @@ var DropDownList = /** @class */ (function (_super) {
1636
1618
  removeClass(highlightedItem, dropDownListClasses.focus);
1637
1619
  }
1638
1620
  };
1639
- DropDownList.prototype.renderPopup = function () {
1621
+ DropDownList.prototype.renderPopup = function (e) {
1640
1622
  var _this = this;
1641
1623
  if (this.popupObj && document.body.contains(this.popupObj.element)) {
1642
1624
  this.refreshPopup();
@@ -1739,7 +1721,7 @@ var DropDownList = /** @class */ (function (_super) {
1739
1721
  var animModel = { name: 'FadeIn', duration: 100 };
1740
1722
  _this.beforePopupOpen = true;
1741
1723
  var popupInstance = _this.popupObj;
1742
- var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
1724
+ var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
1743
1725
  _this.trigger('open', eventArgs, function (eventArgs) {
1744
1726
  if (!eventArgs.cancel) {
1745
1727
  addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
@@ -2061,14 +2043,14 @@ var DropDownList = /** @class */ (function (_super) {
2061
2043
  if (this.element.tagName === 'INPUT') {
2062
2044
  this.inputElement = this.element;
2063
2045
  if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
2064
- this.inputElement.setAttribute('role', 'textbox');
2046
+ this.inputElement.setAttribute('role', 'combobox');
2065
2047
  }
2066
2048
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
2067
2049
  this.inputElement.setAttribute('type', 'text');
2068
2050
  }
2069
2051
  }
2070
2052
  else {
2071
- this.inputElement = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });
2053
+ this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
2072
2054
  if (this.element.tagName !== this.getNgDirective()) {
2073
2055
  this.element.style.display = 'none';
2074
2056
  }
@@ -2117,6 +2099,9 @@ var DropDownList = /** @class */ (function (_super) {
2117
2099
  attributes(this.targetElement(), this.getAriaAttributes());
2118
2100
  this.updateDataAttribute(this.htmlAttributes);
2119
2101
  this.setHTMLAttributes();
2102
+ if (this.targetElement() === this.inputElement) {
2103
+ this.element.removeAttribute('aria-labelledby');
2104
+ }
2120
2105
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
2121
2106
  this.initValue();
2122
2107
  }
@@ -2152,7 +2137,12 @@ var DropDownList = /** @class */ (function (_super) {
2152
2137
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
2153
2138
  var compiledString;
2154
2139
  if (this.footer) {
2155
- this.footer.innerHTML = '';
2140
+ if (this.isReact) {
2141
+ this.clearTemplate(['footerTemplate']);
2142
+ }
2143
+ else {
2144
+ this.footer.innerHTML = '';
2145
+ }
2156
2146
  }
2157
2147
  else {
2158
2148
  this.footer = this.createElement('div');
@@ -2344,6 +2334,9 @@ var DropDownList = /** @class */ (function (_super) {
2344
2334
  }
2345
2335
  });
2346
2336
  }
2337
+ else if (this_1.getModuleName() === 'autocomplete') {
2338
+ this_1.setInputValue(newProp, oldProp);
2339
+ }
2347
2340
  else {
2348
2341
  this_1.setOldText(oldProp.text);
2349
2342
  }
@@ -2385,6 +2378,9 @@ var DropDownList = /** @class */ (function (_super) {
2385
2378
  }
2386
2379
  });
2387
2380
  }
2381
+ else if (this_1.getModuleName() === 'autocomplete') {
2382
+ this_1.setInputValue(newProp, oldProp);
2383
+ }
2388
2384
  else {
2389
2385
  this_1.setOldValue(oldProp.value);
2390
2386
  }
@@ -2503,6 +2499,8 @@ var DropDownList = /** @class */ (function (_super) {
2503
2499
  removeClass([this.inputWrapper.container], ['e-readonly']);
2504
2500
  }
2505
2501
  };
2502
+ DropDownList.prototype.setInputValue = function (newProp, oldProp) {
2503
+ };
2506
2504
  DropDownList.prototype.setCssClass = function (newClass, oldClass) {
2507
2505
  if (!isNullOrUndefined(oldClass)) {
2508
2506
  oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
@@ -2529,7 +2527,7 @@ var DropDownList = /** @class */ (function (_super) {
2529
2527
  *
2530
2528
  * @returns {void}
2531
2529
  */
2532
- DropDownList.prototype.showPopup = function () {
2530
+ DropDownList.prototype.showPopup = function (e) {
2533
2531
  if (!this.enabled) {
2534
2532
  return;
2535
2533
  }
@@ -2549,11 +2547,11 @@ var DropDownList = /** @class */ (function (_super) {
2549
2547
  }
2550
2548
  else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
2551
2549
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
2552
- this.renderList();
2550
+ this.renderList(e);
2553
2551
  }
2554
- this.invokeRenderPopup();
2552
+ this.invokeRenderPopup(e);
2555
2553
  };
2556
- DropDownList.prototype.invokeRenderPopup = function () {
2554
+ DropDownList.prototype.invokeRenderPopup = function (e) {
2557
2555
  if (Browser.isDevice && this.isFilterLayout()) {
2558
2556
  // eslint-disable-next-line @typescript-eslint/no-this-alias
2559
2557
  var proxy_2 = this;
@@ -2563,7 +2561,7 @@ var DropDownList = /** @class */ (function (_super) {
2563
2561
  history.pushState({}, '');
2564
2562
  }
2565
2563
  if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
2566
- this.renderPopup();
2564
+ this.renderPopup(e);
2567
2565
  }
2568
2566
  attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2569
2567
  };
@@ -320,7 +320,7 @@ export declare class ListBox extends DropDownBase {
320
320
  private initDraggable;
321
321
  protected updateActionCompleteData(li: HTMLElement, item: {
322
322
  [key: string]: Object;
323
- }): void;
323
+ }, index: number): void;
324
324
  private initToolbar;
325
325
  private createButtons;
326
326
  protected validationAttribute(input: HTMLInputElement, hiddenSelect: HTMLSelectElement): void;
@@ -210,8 +210,8 @@ var ListBox = /** @class */ (function (_super) {
210
210
  });
211
211
  }
212
212
  };
213
- ListBox.prototype.updateActionCompleteData = function (li, item) {
214
- this.jsonData.push(item);
213
+ ListBox.prototype.updateActionCompleteData = function (li, item, index) {
214
+ this.jsonData.splice(index, 0, item);
215
215
  };
216
216
  ListBox.prototype.initToolbar = function () {
217
217
  var pos = this.toolbarSettings.position;
@@ -756,7 +756,7 @@ var ListBox = /** @class */ (function (_super) {
756
756
  var objValue = void 0;
757
757
  var dupData = [];
758
758
  var itemIdx = void 0;
759
- extend(dupData, [], this.listData);
759
+ extend(dupData, [], this.jsonData);
760
760
  var removeIdxes = [];
761
761
  var removeLiIdxes = [];
762
762
  for (var j = 0; j < items.length; j++) {
@@ -1543,9 +1543,8 @@ var ListBox = /** @class */ (function (_super) {
1543
1543
  fListBox.value = [];
1544
1544
  listData = listData
1545
1545
  .filter(function (data) { return data.isHeader !== true; });
1546
- tListBox.listData = listData;
1547
- tListBox.jsonData = jsonData;
1548
- if (this.listData.length == this.jsonData.length) {
1546
+ tListBox.listData = tListBox.jsonData = listData;
1547
+ if (fListBox.listData.length == fListBox.jsonData.length) {
1549
1548
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
1550
1549
  }
1551
1550
  else if (this.allowFiltering) {
@@ -823,7 +823,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
823
823
  *
824
824
  * @returns {void}
825
825
  */
826
- showPopup(): void;
826
+ showPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
827
827
  /**
828
828
  * Based on the state parameter, entire list item will be selected/deselected.
829
829
  * parameter
@@ -224,7 +224,7 @@ var MultiSelect = /** @class */ (function (_super) {
224
224
  }
225
225
  }
226
226
  };
227
- MultiSelect.prototype.onPopupShown = function () {
227
+ MultiSelect.prototype.onPopupShown = function (e) {
228
228
  var _this = this;
229
229
  if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
230
230
  // eslint-disable-next-line @typescript-eslint/no-this-alias
@@ -236,7 +236,7 @@ var MultiSelect = /** @class */ (function (_super) {
236
236
  history.pushState({}, '');
237
237
  }
238
238
  var animModel = { name: 'FadeIn', duration: 100 };
239
- var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
239
+ var eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
240
240
  this.trigger('open', eventArgs, function (eventArgs) {
241
241
  if (!eventArgs.cancel) {
242
242
  _this.focusAtFirstListItem();
@@ -460,7 +460,7 @@ var MultiSelect = /** @class */ (function (_super) {
460
460
  this.renderPopup();
461
461
  if (this.beforePopupOpen) {
462
462
  this.beforePopupOpen = false;
463
- this.onPopupShown();
463
+ this.onPopupShown(e);
464
464
  }
465
465
  };
466
466
  MultiSelect.prototype.refreshSelection = function () {
@@ -752,7 +752,7 @@ var MultiSelect = /** @class */ (function (_super) {
752
752
  }
753
753
  if (!this.isPopupOpen() &&
754
754
  (this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
755
- this.showPopup();
755
+ this.showPopup(e);
756
756
  }
757
757
  else {
758
758
  this.hidePopup(e);
@@ -1046,7 +1046,7 @@ var MultiSelect = /** @class */ (function (_super) {
1046
1046
  break;
1047
1047
  case 40:
1048
1048
  if (!this.isPopupOpen()) {
1049
- this.showPopup();
1049
+ this.showPopup(e);
1050
1050
  e.preventDefault();
1051
1051
  }
1052
1052
  break;
@@ -2237,7 +2237,7 @@ var MultiSelect = /** @class */ (function (_super) {
2237
2237
  this.keyCode = e.keyCode;
2238
2238
  }
2239
2239
  if (!this.isPopupOpen() && this.openOnClick) {
2240
- this.showPopup();
2240
+ this.showPopup(e);
2241
2241
  }
2242
2242
  this.openClick(e);
2243
2243
  if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
@@ -2384,7 +2384,7 @@ var MultiSelect = /** @class */ (function (_super) {
2384
2384
  || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
2385
2385
  isEmptyData = true;
2386
2386
  }
2387
- _super.prototype.render.call(this, isEmptyData);
2387
+ _super.prototype.render.call(this, null, isEmptyData);
2388
2388
  this.unwireListEvents();
2389
2389
  this.wireListEvents();
2390
2390
  };
@@ -3657,7 +3657,7 @@ var MultiSelect = /** @class */ (function (_super) {
3657
3657
  *
3658
3658
  * @returns {void}
3659
3659
  */
3660
- MultiSelect.prototype.showPopup = function () {
3660
+ MultiSelect.prototype.showPopup = function (e) {
3661
3661
  var _this = this;
3662
3662
  if (!this.enabled) {
3663
3663
  return;
@@ -3667,7 +3667,7 @@ var MultiSelect = /** @class */ (function (_super) {
3667
3667
  if (!args.cancel) {
3668
3668
  if (!_this.ulElement) {
3669
3669
  _this.beforePopupOpen = true;
3670
- _super.prototype.render.call(_this);
3670
+ _super.prototype.render.call(_this, e);
3671
3671
  if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {
3672
3672
  _this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
3673
3673
  }
@@ -3683,7 +3683,7 @@ var MultiSelect = /** @class */ (function (_super) {
3683
3683
  _this.beforePopupOpen = false;
3684
3684
  return;
3685
3685
  }
3686
- _this.onPopupShown();
3686
+ _this.onPopupShown(e);
3687
3687
  }
3688
3688
  });
3689
3689
  };
@@ -3790,7 +3790,6 @@ var MultiSelect = /** @class */ (function (_super) {
3790
3790
  });
3791
3791
  if (this.mode === 'Default' || this.mode === 'Box') {
3792
3792
  this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
3793
- this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
3794
3793
  }
3795
3794
  if (this.element.tagName !== this.getNgDirective()) {
3796
3795
  this.element.style.display = 'none';
@@ -104,6 +104,9 @@
104
104
  display: none;
105
105
  flex-direction: row;
106
106
  margin-top: $ddl-clear-margin-top;
107
+ @if $ddl-multiselect-skin-name == 'tailwind' {
108
+ margin-top: -1.45em;
109
+ }
107
110
  outline: 0;
108
111
  padding: 0;
109
112
  position: absolute;
@@ -389,6 +392,7 @@
389
392
  }
390
393
  @if $ddl-multiselect-skin-name == 'tailwind' {
391
394
  height: $ddl-bigger-clear-icon-height;
395
+ margin-top: $ddl-clear-margin-top;
392
396
  width: $ddl-bigger-clear-icon-width;
393
397
  }
394
398
  }
@@ -221,6 +221,7 @@
221
221
  -ms-flex-direction: row;
222
222
  flex-direction: row;
223
223
  margin-top: -2em;
224
+ margin-top: -1.45em;
224
225
  outline: 0;
225
226
  padding: 0;
226
227
  position: absolute;
@@ -401,6 +402,7 @@
401
402
  .e-bigger .e-multiselect.e-control-container .e-multi-select-wrapper .e-clear-icon {
402
403
  margin-top: -1.62em;
403
404
  height: 36px;
405
+ margin-top: -2em;
404
406
  width: 40px;
405
407
  }
406
408
 
@@ -221,6 +221,7 @@
221
221
  -ms-flex-direction: row;
222
222
  flex-direction: row;
223
223
  margin-top: -2em;
224
+ margin-top: -1.45em;
224
225
  outline: 0;
225
226
  padding: 0;
226
227
  position: absolute;
@@ -401,6 +402,7 @@
401
402
  .e-bigger .e-multiselect.e-control-container .e-multi-select-wrapper .e-clear-icon {
402
403
  margin-top: -1.62em;
403
404
  height: 36px;
405
+ margin-top: -2em;
404
406
  width: 40px;
405
407
  }
406
408
 
@@ -1426,6 +1426,7 @@ ejs-dropdownlist {
1426
1426
  -ms-flex-direction: row;
1427
1427
  flex-direction: row;
1428
1428
  margin-top: -2em;
1429
+ margin-top: -1.45em;
1429
1430
  outline: 0;
1430
1431
  padding: 0;
1431
1432
  position: absolute;
@@ -1606,6 +1607,7 @@ ejs-dropdownlist {
1606
1607
  .e-bigger .e-multiselect.e-control-container .e-multi-select-wrapper .e-clear-icon {
1607
1608
  margin-top: -1.62em;
1608
1609
  height: 36px;
1610
+ margin-top: -2em;
1609
1611
  width: 40px;
1610
1612
  }
1611
1613
 
@@ -1426,6 +1426,7 @@ ejs-dropdownlist {
1426
1426
  -ms-flex-direction: row;
1427
1427
  flex-direction: row;
1428
1428
  margin-top: -2em;
1429
+ margin-top: -1.45em;
1429
1430
  outline: 0;
1430
1431
  padding: 0;
1431
1432
  position: absolute;
@@ -1606,6 +1607,7 @@ ejs-dropdownlist {
1606
1607
  .e-bigger .e-multiselect.e-control-container .e-multi-select-wrapper .e-clear-icon {
1607
1608
  margin-top: -1.62em;
1608
1609
  height: 36px;
1610
+ margin-top: -2em;
1609
1611
  width: 40px;
1610
1612
  }
1611
1613