@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
@@ -3437,6 +3437,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3437
3437
  });
3438
3438
  prepend([this.hiddenElement], this.inputWrapper.container);
3439
3439
  this.validationAttribute(this.element, this.hiddenElement);
3440
+ this.setReadOnly();
3440
3441
  this.setFields();
3441
3442
  this.inputWrapper.container.style.width = formatUnit(this.width);
3442
3443
  this.inputWrapper.container.classList.add('e-ddl');
@@ -3564,6 +3565,8 @@ let DropDownList = class DropDownList extends DropDownBase {
3564
3565
  this.actionData = this.actionCompleteData;
3565
3566
  }
3566
3567
  else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
3568
+ this.actionCompleteData = this.getModuleName() === 'combobox' ?
3569
+ { ulElement: null, list: null, isUpdated: false } : this.actionCompleteData;
3567
3570
  this.actionData = this.actionCompleteData;
3568
3571
  }
3569
3572
  }
@@ -3630,6 +3633,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3630
3633
  if (this.getModuleName() !== 'dropdownlist') {
3631
3634
  Input.setReadonly(newProp.readonly, this.inputElement);
3632
3635
  }
3636
+ this.setReadOnly();
3633
3637
  break;
3634
3638
  case 'cssClass':
3635
3639
  this.setCssClass(newProp.cssClass, oldProp.cssClass);
@@ -3788,6 +3792,14 @@ let DropDownList = class DropDownList extends DropDownBase {
3788
3792
  }
3789
3793
  };
3790
3794
  }
3795
+ setReadOnly() {
3796
+ if (this.readonly) {
3797
+ addClass([this.inputWrapper.container], ['e-readonly']);
3798
+ }
3799
+ else {
3800
+ removeClass([this.inputWrapper.container], ['e-readonly']);
3801
+ }
3802
+ }
3791
3803
  setCssClass(newClass, oldClass) {
3792
3804
  if (!isNullOrUndefined(oldClass)) {
3793
3805
  oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
@@ -4347,9 +4359,9 @@ let DropDownTree = class DropDownTree extends Component {
4347
4359
  this.createClearIcon();
4348
4360
  this.inputWrapper.classList.add(DROPDOWNTREE);
4349
4361
  this.setElementWidth(this.width);
4350
- this.setAttributes();
4351
4362
  this.updateDataAttribute();
4352
4363
  this.setHTMLAttributes();
4364
+ this.setAttributes();
4353
4365
  this.popupDiv = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
4354
4366
  this.popupDiv.classList.add(DROPDOWN);
4355
4367
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
@@ -4635,9 +4647,6 @@ let DropDownTree = class DropDownTree extends Component {
4635
4647
  this.isClearButtonClick = false;
4636
4648
  return;
4637
4649
  }
4638
- if (!this.wrapText && e.target.classList.contains(CHIP_CLOSE)) {
4639
- this.removeChip(e);
4640
- }
4641
4650
  if (this.isPopupOpen) {
4642
4651
  this.hidePopup();
4643
4652
  }
@@ -4708,7 +4717,7 @@ let DropDownTree = class DropDownTree extends Component {
4708
4717
  this.trigger('blur');
4709
4718
  }
4710
4719
  updateView() {
4711
- if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom') {
4720
+ if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom' || this.inputFocus) {
4712
4721
  return;
4713
4722
  }
4714
4723
  if (this.mode !== 'Box') {
@@ -4867,11 +4876,18 @@ let DropDownTree = class DropDownTree extends Component {
4867
4876
  switch (e.action) {
4868
4877
  case 'escape':
4869
4878
  case 'altUp':
4879
+ if (this.isPopupOpen) {
4880
+ this.hidePopup();
4881
+ }
4882
+ break;
4870
4883
  case 'shiftTab':
4871
4884
  case 'tab':
4872
4885
  if (this.isPopupOpen) {
4873
4886
  this.hidePopup();
4874
4887
  }
4888
+ if (this.inputFocus) {
4889
+ this.onFocusOut();
4890
+ }
4875
4891
  break;
4876
4892
  case 'altDown':
4877
4893
  if (!this.isPopupOpen) {
@@ -5140,10 +5156,10 @@ let DropDownTree = class DropDownTree extends Component {
5140
5156
  this.inputWrapper.insertBefore(this.chipWrapper, this.hiddenElement);
5141
5157
  addClass([this.inputWrapper], SHOW_CHIP);
5142
5158
  const isValid = this.getValidMode();
5143
- if (isValid && this.value !== null) {
5159
+ if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
5144
5160
  addClass([this.inputEle], CHIP_INPUT);
5145
5161
  }
5146
- else if (this.value === null) {
5162
+ else if (this.value === null || (this.value && this.value.length === 0)) {
5147
5163
  addClass([this.chipWrapper], HIDEICON);
5148
5164
  }
5149
5165
  }
@@ -5240,7 +5256,7 @@ let DropDownTree = class DropDownTree extends Component {
5240
5256
  }
5241
5257
  }
5242
5258
  setAttributes() {
5243
- this.element.removeAttribute('tabindex');
5259
+ this.inputEle.setAttribute('tabindex', '-1');
5244
5260
  const id = this.element.getAttribute('id');
5245
5261
  this.hiddenElement.id = id + '_hidden';
5246
5262
  this.inputWrapper.setAttribute('tabindex', '0');
@@ -5415,7 +5431,6 @@ let DropDownTree = class DropDownTree extends Component {
5415
5431
  else {
5416
5432
  if (this.showCheckBox) {
5417
5433
  this.treeObj.checkedNodes = this.value.slice();
5418
- setValue('selectedNodes', [], this.treeObj);
5419
5434
  this.treeObj.dataBind();
5420
5435
  this.setMultiSelect();
5421
5436
  }
@@ -7754,6 +7769,7 @@ let ComboBox = class ComboBox extends DropDownList {
7754
7769
  EventHandler.add(this.inputElement, 'keyup', this.onFilterUp, this);
7755
7770
  EventHandler.add(this.inputElement, 'keydown', this.onFilterDown, this);
7756
7771
  }
7772
+ this.setReadOnly();
7757
7773
  break;
7758
7774
  case 'allowFiltering':
7759
7775
  this.setSearchBox();
@@ -10913,6 +10929,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10913
10929
  setValue(this.fields.value, value, newValue);
10914
10930
  const noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
10915
10931
  this.addItem(newValue, indexItem);
10932
+ element = element ? element : this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);
10916
10933
  if (this.popupWrapper.contains(noDataEle)) {
10917
10934
  this.list.setAttribute('style', noDataEle.getAttribute('style'));
10918
10935
  this.popupWrapper.replaceChild(this.list, noDataEle);
@@ -10961,6 +10978,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10961
10978
  this.popupObj = null;
10962
10979
  this.renderPopup();
10963
10980
  }
10981
+ else if (this.allowCustomValue) {
10982
+ this.list = list;
10983
+ this.mainList = this.ulElement = list.querySelector('ul');
10984
+ }
10964
10985
  }
10965
10986
  updateDataList() {
10966
10987
  if (this.mainList && this.ulElement && this.mainList.childElementCount < this.ulElement.childElementCount) {
@@ -11439,16 +11460,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11439
11460
  l10n = new L10n('dropdowns', l10nLocale, this.locale);
11440
11461
  }
11441
11462
  const remainContent = l10n.getConstant('overflowCountTemplate');
11463
+ const totalContent = l10n.getConstant('totalCountTemplate');
11442
11464
  const raminElement = this.createElement('span', {
11443
11465
  className: REMAIN_WRAPPER$1
11444
11466
  });
11445
- const compiledString = compile(remainContent);
11446
- const totalCompiledString = compile(l10n.getConstant('totalCountTemplate'));
11447
- // eslint-disable-next-line
11448
- let remainCompildTemp = compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
11449
- if (remainCompildTemp && remainCompildTemp.length > 0) {
11450
- raminElement.appendChild(remainCompildTemp[0]);
11451
- }
11467
+ let remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
11468
+ raminElement.innerText = remainCompildTemp;
11452
11469
  this.viewWrapper.appendChild(raminElement);
11453
11470
  this.renderReactTemplates();
11454
11471
  const remainSize = raminElement.offsetWidth;
@@ -11500,9 +11517,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11500
11517
  }
11501
11518
  if (remaining > 0) {
11502
11519
  const totalWidth = overAllContainer - downIconWidth - this.clearIconWidth;
11503
- this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth));
11520
+ this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth));
11504
11521
  this.updateRemainWidth(this.viewWrapper, totalWidth);
11505
- this.updateRemainingText(raminElement, downIconWidth, remaining, compiledString, totalCompiledString);
11522
+ this.updateRemainingText(raminElement, downIconWidth, remaining, remainContent, totalContent);
11506
11523
  }
11507
11524
  }
11508
11525
  else {
@@ -11522,17 +11539,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11522
11539
  viewWrapper.style.width = totalWidth + 'px';
11523
11540
  }
11524
11541
  }
11525
- updateRemainTemplate(raminElement, viewWrapper, remaining, compiledString, totalCompiledString, totalWidth) {
11542
+ updateRemainTemplate(raminElement, viewWrapper, remaining, remainContent, totalContent, totalWidth) {
11526
11543
  if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3 && viewWrapper.firstChild.nodeValue === '') {
11527
11544
  viewWrapper.removeChild(viewWrapper.firstChild);
11528
11545
  }
11529
11546
  raminElement.innerHTML = '';
11530
- // eslint-disable-next-line
11531
- let remainTemp = compiledString({ 'count': remaining }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
11532
- // eslint-disable-next-line
11533
- let totalTemp = totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate, null, raminElement);
11534
- raminElement.appendChild((viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ?
11535
- remainTemp && remainTemp[0] : totalTemp && totalTemp[0]);
11547
+ let remainTemp = remainContent.replace('${count}', remaining.toString());
11548
+ let totalTemp = totalContent.replace('${count}', remaining.toString());
11549
+ raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;
11536
11550
  if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
11537
11551
  viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11538
11552
  }
@@ -11542,7 +11556,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11542
11556
  }
11543
11557
  return raminElement;
11544
11558
  }
11545
- updateRemainingText(raminElement, downIconWidth, remaining, compiledString, totalCompiledString) {
11559
+ updateRemainingText(raminElement, downIconWidth, remaining, remainContent, totalContent) {
11546
11560
  const overAllContainer = this.componentWrapper.offsetWidth -
11547
11561
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
11548
11562
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
@@ -11561,7 +11575,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11561
11575
  wrapperleng = this.viewWrapper.offsetWidth;
11562
11576
  }
11563
11577
  const totalWidth = overAllContainer - downIconWidth;
11564
- this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth);
11578
+ this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth);
11565
11579
  }
11566
11580
  }
11567
11581
  getOverflowVal(index) {
@@ -13516,6 +13530,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13516
13530
  args.items = this.getDataByValues([dragValue]);
13517
13531
  }
13518
13532
  this.trigger('beforeDrop', args);
13533
+ if (args.isDragAll !== null) {
13534
+ this.allowDragAll = args.isDragAll;
13535
+ }
13519
13536
  }
13520
13537
  dragEnd(args) {
13521
13538
  let listData;