@syncfusion/ej2-dropdowns 19.3.44 → 19.3.48

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.
Files changed (47) hide show
  1. package/.eslintrc.json +244 -0
  2. package/CHANGELOG.md +36 -0
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +44 -27
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +44 -27
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +11 -11
  13. package/src/combo-box/combo-box.js +1 -0
  14. package/src/drop-down-list/drop-down-list.d.ts +1 -0
  15. package/src/drop-down-list/drop-down-list.js +12 -0
  16. package/src/drop-down-tree/drop-down-tree.js +12 -9
  17. package/src/list-box/list-box.d.ts +4 -0
  18. package/src/list-box/list-box.js +3 -0
  19. package/src/multi-select/multi-select.js +16 -18
  20. package/styles/auto-complete/bootstrap4.css +5 -0
  21. package/styles/auto-complete/bootstrap5-dark.css +5 -0
  22. package/styles/auto-complete/bootstrap5.css +5 -0
  23. package/styles/bootstrap4.css +5 -0
  24. package/styles/bootstrap5-dark.css +5 -0
  25. package/styles/bootstrap5.css +5 -0
  26. package/styles/combo-box/bootstrap4.css +5 -0
  27. package/styles/combo-box/bootstrap5-dark.css +5 -0
  28. package/styles/combo-box/bootstrap5.css +5 -0
  29. package/styles/drop-down-list/_bootstrap4-definition.scss +6 -0
  30. package/styles/drop-down-list/_bootstrap5-definition.scss +6 -0
  31. package/styles/drop-down-list/bootstrap4.css +5 -0
  32. package/styles/drop-down-list/bootstrap5-dark.css +5 -0
  33. package/styles/drop-down-list/bootstrap5.css +5 -0
  34. package/styles/drop-down-tree/_layout.scss +461 -1
  35. package/styles/drop-down-tree/_material-dark-definition.scss +6 -1
  36. package/styles/drop-down-tree/_material-definition.scss +6 -1
  37. package/styles/drop-down-tree/_theme.scss +8 -0
  38. package/styles/drop-down-tree/material-dark.css +402 -1
  39. package/styles/drop-down-tree/material.css +402 -1
  40. package/styles/material-dark.css +496 -1
  41. package/styles/material.css +496 -1
  42. package/styles/multi-select/_layout.scss +116 -0
  43. package/styles/multi-select/_material-dark-definition.scss +22 -0
  44. package/styles/multi-select/_material-definition.scss +22 -0
  45. package/styles/multi-select/material-dark.css +94 -0
  46. package/styles/multi-select/material.css +94 -0
  47. package/tslint.json +111 -0
@@ -3494,6 +3494,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3494
3494
  });
3495
3495
  prepend([this.hiddenElement], this.inputWrapper.container);
3496
3496
  this.validationAttribute(this.element, this.hiddenElement);
3497
+ this.setReadOnly();
3497
3498
  this.setFields();
3498
3499
  this.inputWrapper.container.style.width = formatUnit(this.width);
3499
3500
  this.inputWrapper.container.classList.add('e-ddl');
@@ -3621,6 +3622,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3621
3622
  this.actionData = this.actionCompleteData;
3622
3623
  }
3623
3624
  else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
3625
+ this.actionCompleteData = this.getModuleName() === 'combobox' ?
3626
+ { ulElement: null, list: null, isUpdated: false } : this.actionCompleteData;
3624
3627
  this.actionData = this.actionCompleteData;
3625
3628
  }
3626
3629
  };
@@ -3688,6 +3691,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3688
3691
  if (this.getModuleName() !== 'dropdownlist') {
3689
3692
  Input.setReadonly(newProp.readonly, this.inputElement);
3690
3693
  }
3694
+ this.setReadOnly();
3691
3695
  break;
3692
3696
  case 'cssClass':
3693
3697
  this.setCssClass(newProp.cssClass, oldProp.cssClass);
@@ -3847,6 +3851,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3847
3851
  }
3848
3852
  };
3849
3853
  };
3854
+ DropDownList.prototype.setReadOnly = function () {
3855
+ if (this.readonly) {
3856
+ addClass([this.inputWrapper.container], ['e-readonly']);
3857
+ }
3858
+ else {
3859
+ removeClass([this.inputWrapper.container], ['e-readonly']);
3860
+ }
3861
+ };
3850
3862
  DropDownList.prototype.setCssClass = function (newClass, oldClass) {
3851
3863
  if (!isNullOrUndefined(oldClass)) {
3852
3864
  oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
@@ -4432,9 +4444,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4432
4444
  this.createClearIcon();
4433
4445
  this.inputWrapper.classList.add(DROPDOWNTREE);
4434
4446
  this.setElementWidth(this.width);
4435
- this.setAttributes();
4436
4447
  this.updateDataAttribute();
4437
4448
  this.setHTMLAttributes();
4449
+ this.setAttributes();
4438
4450
  this.popupDiv = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
4439
4451
  this.popupDiv.classList.add(DROPDOWN);
4440
4452
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
@@ -4722,9 +4734,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4722
4734
  this.isClearButtonClick = false;
4723
4735
  return;
4724
4736
  }
4725
- if (!this.wrapText && e.target.classList.contains(CHIP_CLOSE)) {
4726
- this.removeChip(e);
4727
- }
4728
4737
  if (this.isPopupOpen) {
4729
4738
  this.hidePopup();
4730
4739
  }
@@ -4795,7 +4804,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4795
4804
  this.trigger('blur');
4796
4805
  };
4797
4806
  DropDownTree.prototype.updateView = function () {
4798
- if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom') {
4807
+ if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom' || this.inputFocus) {
4799
4808
  return;
4800
4809
  }
4801
4810
  if (this.mode !== 'Box') {
@@ -4956,11 +4965,18 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4956
4965
  switch (e.action) {
4957
4966
  case 'escape':
4958
4967
  case 'altUp':
4968
+ if (_this.isPopupOpen) {
4969
+ _this.hidePopup();
4970
+ }
4971
+ break;
4959
4972
  case 'shiftTab':
4960
4973
  case 'tab':
4961
4974
  if (_this.isPopupOpen) {
4962
4975
  _this.hidePopup();
4963
4976
  }
4977
+ if (_this.inputFocus) {
4978
+ _this.onFocusOut();
4979
+ }
4964
4980
  break;
4965
4981
  case 'altDown':
4966
4982
  if (!_this.isPopupOpen) {
@@ -5230,10 +5246,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5230
5246
  this.inputWrapper.insertBefore(this.chipWrapper, this.hiddenElement);
5231
5247
  addClass([this.inputWrapper], SHOW_CHIP);
5232
5248
  var isValid = this.getValidMode();
5233
- if (isValid && this.value !== null) {
5249
+ if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
5234
5250
  addClass([this.inputEle], CHIP_INPUT);
5235
5251
  }
5236
- else if (this.value === null) {
5252
+ else if (this.value === null || (this.value && this.value.length === 0)) {
5237
5253
  addClass([this.chipWrapper], HIDEICON);
5238
5254
  }
5239
5255
  }
@@ -5331,7 +5347,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5331
5347
  }
5332
5348
  };
5333
5349
  DropDownTree.prototype.setAttributes = function () {
5334
- this.element.removeAttribute('tabindex');
5350
+ this.inputEle.setAttribute('tabindex', '-1');
5335
5351
  var id = this.element.getAttribute('id');
5336
5352
  this.hiddenElement.id = id + '_hidden';
5337
5353
  this.inputWrapper.setAttribute('tabindex', '0');
@@ -5507,7 +5523,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5507
5523
  else {
5508
5524
  if (this.showCheckBox) {
5509
5525
  this.treeObj.checkedNodes = this.value.slice();
5510
- setValue('selectedNodes', [], this.treeObj);
5511
5526
  this.treeObj.dataBind();
5512
5527
  this.setMultiSelect();
5513
5528
  }
@@ -7866,6 +7881,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7866
7881
  EventHandler.add(this.inputElement, 'keyup', this.onFilterUp, this);
7867
7882
  EventHandler.add(this.inputElement, 'keydown', this.onFilterDown, this);
7868
7883
  }
7884
+ this.setReadOnly();
7869
7885
  break;
7870
7886
  case 'allowFiltering':
7871
7887
  this.setSearchBox();
@@ -11068,6 +11084,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11068
11084
  setValue(this.fields.value, value, newValue);
11069
11085
  var noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
11070
11086
  this.addItem(newValue, indexItem);
11087
+ element = element ? element : this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);
11071
11088
  if (this.popupWrapper.contains(noDataEle)) {
11072
11089
  this.list.setAttribute('style', noDataEle.getAttribute('style'));
11073
11090
  this.popupWrapper.replaceChild(this.list, noDataEle);
@@ -11116,6 +11133,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11116
11133
  this.popupObj = null;
11117
11134
  this.renderPopup();
11118
11135
  }
11136
+ else if (this.allowCustomValue) {
11137
+ this.list = list;
11138
+ this.mainList = this.ulElement = list.querySelector('ul');
11139
+ }
11119
11140
  };
11120
11141
  MultiSelect.prototype.updateDataList = function () {
11121
11142
  if (this.mainList && this.ulElement && this.mainList.childElementCount < this.ulElement.childElementCount) {
@@ -11596,16 +11617,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11596
11617
  l10n = new L10n('dropdowns', l10nLocale, this.locale);
11597
11618
  }
11598
11619
  var remainContent = l10n.getConstant('overflowCountTemplate');
11620
+ var totalContent = l10n.getConstant('totalCountTemplate');
11599
11621
  var raminElement = this.createElement('span', {
11600
11622
  className: REMAIN_WRAPPER$1
11601
11623
  });
11602
- var compiledString = compile(remainContent);
11603
- var totalCompiledString = compile(l10n.getConstant('totalCountTemplate'));
11604
- // eslint-disable-next-line
11605
- var remainCompildTemp = compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
11606
- if (remainCompildTemp && remainCompildTemp.length > 0) {
11607
- raminElement.appendChild(remainCompildTemp[0]);
11608
- }
11624
+ var remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
11625
+ raminElement.innerText = remainCompildTemp;
11609
11626
  this.viewWrapper.appendChild(raminElement);
11610
11627
  this.renderReactTemplates();
11611
11628
  var remainSize = raminElement.offsetWidth;
@@ -11657,9 +11674,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11657
11674
  }
11658
11675
  if (remaining > 0) {
11659
11676
  var totalWidth = overAllContainer - downIconWidth - this.clearIconWidth;
11660
- this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth));
11677
+ this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth));
11661
11678
  this.updateRemainWidth(this.viewWrapper, totalWidth);
11662
- this.updateRemainingText(raminElement, downIconWidth, remaining, compiledString, totalCompiledString);
11679
+ this.updateRemainingText(raminElement, downIconWidth, remaining, remainContent, totalContent);
11663
11680
  }
11664
11681
  }
11665
11682
  else {
@@ -11679,17 +11696,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11679
11696
  viewWrapper.style.width = totalWidth + 'px';
11680
11697
  }
11681
11698
  };
11682
- MultiSelect.prototype.updateRemainTemplate = function (raminElement, viewWrapper, remaining, compiledString, totalCompiledString, totalWidth) {
11699
+ MultiSelect.prototype.updateRemainTemplate = function (raminElement, viewWrapper, remaining, remainContent, totalContent, totalWidth) {
11683
11700
  if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3 && viewWrapper.firstChild.nodeValue === '') {
11684
11701
  viewWrapper.removeChild(viewWrapper.firstChild);
11685
11702
  }
11686
11703
  raminElement.innerHTML = '';
11687
- // eslint-disable-next-line
11688
- var remainTemp = compiledString({ 'count': remaining }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
11689
- // eslint-disable-next-line
11690
- var totalTemp = totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate, null, raminElement);
11691
- raminElement.appendChild((viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ?
11692
- remainTemp && remainTemp[0] : totalTemp && totalTemp[0]);
11704
+ var remainTemp = remainContent.replace('${count}', remaining.toString());
11705
+ var totalTemp = totalContent.replace('${count}', remaining.toString());
11706
+ raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;
11693
11707
  if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
11694
11708
  viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11695
11709
  }
@@ -11699,7 +11713,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11699
11713
  }
11700
11714
  return raminElement;
11701
11715
  };
11702
- MultiSelect.prototype.updateRemainingText = function (raminElement, downIconWidth, remaining, compiledString, totalCompiledString) {
11716
+ MultiSelect.prototype.updateRemainingText = function (raminElement, downIconWidth, remaining, remainContent, totalContent) {
11703
11717
  var overAllContainer = this.componentWrapper.offsetWidth -
11704
11718
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
11705
11719
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
@@ -11718,7 +11732,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11718
11732
  wrapperleng = this.viewWrapper.offsetWidth;
11719
11733
  }
11720
11734
  var totalWidth = overAllContainer - downIconWidth;
11721
- this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth);
11735
+ this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth);
11722
11736
  }
11723
11737
  };
11724
11738
  MultiSelect.prototype.getOverflowVal = function (index) {
@@ -13713,6 +13727,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13713
13727
  args.items = this.getDataByValues([dragValue]);
13714
13728
  }
13715
13729
  this.trigger('beforeDrop', args);
13730
+ if (args.isDragAll !== null) {
13731
+ this.allowDragAll = args.isDragAll;
13732
+ }
13716
13733
  };
13717
13734
  ListBox.prototype.dragEnd = function (args) {
13718
13735
  var _this = this;