@syncfusion/ej2-dropdowns 19.3.45 → 19.3.53

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 (34) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/ej2-dropdowns.umd.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-dropdowns.es2015.js +50 -29
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +50 -29
  7. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  8. package/dist/global/ej2-dropdowns.min.js +2 -2
  9. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +11 -11
  12. package/src/drop-down-tree/drop-down-tree.d.ts +1 -0
  13. package/src/drop-down-tree/drop-down-tree.js +18 -10
  14. package/src/multi-select/checkbox-selection.js +1 -1
  15. package/src/multi-select/multi-select-model.d.ts +9 -0
  16. package/src/multi-select/multi-select.d.ts +8 -0
  17. package/src/multi-select/multi-select.js +31 -18
  18. package/styles/auto-complete/bootstrap5-dark.css +1 -0
  19. package/styles/auto-complete/bootstrap5.css +1 -0
  20. package/styles/bootstrap5-dark.css +1 -0
  21. package/styles/bootstrap5.css +1 -0
  22. package/styles/combo-box/bootstrap5-dark.css +1 -0
  23. package/styles/combo-box/bootstrap5.css +1 -0
  24. package/styles/drop-down-list/_bootstrap5-definition.scss +1 -0
  25. package/styles/drop-down-list/bootstrap5-dark.css +1 -0
  26. package/styles/drop-down-list/bootstrap5.css +1 -0
  27. package/styles/drop-down-tree/_layout.scss +461 -1
  28. package/styles/drop-down-tree/_material-dark-definition.scss +6 -1
  29. package/styles/drop-down-tree/_material-definition.scss +6 -1
  30. package/styles/drop-down-tree/_theme.scss +8 -0
  31. package/styles/drop-down-tree/material-dark.css +402 -1
  32. package/styles/drop-down-tree/material.css +402 -1
  33. package/styles/material-dark.css +402 -1
  34. package/styles/material.css +402 -1
@@ -4235,6 +4235,7 @@ let DropDownTree = class DropDownTree extends Component {
4235
4235
  // eslint-disable-next-line
4236
4236
  this.selectedData = [];
4237
4237
  this.filterDelayTime = 300;
4238
+ this.isClicked = false;
4238
4239
  }
4239
4240
  /**
4240
4241
  * Get the properties to be maintained in the persisted state.
@@ -4359,9 +4360,9 @@ let DropDownTree = class DropDownTree extends Component {
4359
4360
  this.createClearIcon();
4360
4361
  this.inputWrapper.classList.add(DROPDOWNTREE);
4361
4362
  this.setElementWidth(this.width);
4362
- this.setAttributes();
4363
4363
  this.updateDataAttribute();
4364
4364
  this.setHTMLAttributes();
4365
+ this.setAttributes();
4365
4366
  this.popupDiv = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
4366
4367
  this.popupDiv.classList.add(DROPDOWN);
4367
4368
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
@@ -4647,9 +4648,6 @@ let DropDownTree = class DropDownTree extends Component {
4647
4648
  this.isClearButtonClick = false;
4648
4649
  return;
4649
4650
  }
4650
- if (!this.wrapText && e.target.classList.contains(CHIP_CLOSE)) {
4651
- this.removeChip(e);
4652
- }
4653
4651
  if (this.isPopupOpen) {
4654
4652
  this.hidePopup();
4655
4653
  }
@@ -4720,7 +4718,7 @@ let DropDownTree = class DropDownTree extends Component {
4720
4718
  this.trigger('blur');
4721
4719
  }
4722
4720
  updateView() {
4723
- if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom') {
4721
+ if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom' || this.inputFocus) {
4724
4722
  return;
4725
4723
  }
4726
4724
  if (this.mode !== 'Box') {
@@ -4879,11 +4877,18 @@ let DropDownTree = class DropDownTree extends Component {
4879
4877
  switch (e.action) {
4880
4878
  case 'escape':
4881
4879
  case 'altUp':
4880
+ if (this.isPopupOpen) {
4881
+ this.hidePopup();
4882
+ }
4883
+ break;
4882
4884
  case 'shiftTab':
4883
4885
  case 'tab':
4884
4886
  if (this.isPopupOpen) {
4885
4887
  this.hidePopup();
4886
4888
  }
4889
+ if (this.inputFocus) {
4890
+ this.onFocusOut();
4891
+ }
4887
4892
  break;
4888
4893
  case 'altDown':
4889
4894
  if (!this.isPopupOpen) {
@@ -5152,10 +5157,10 @@ let DropDownTree = class DropDownTree extends Component {
5152
5157
  this.inputWrapper.insertBefore(this.chipWrapper, this.hiddenElement);
5153
5158
  addClass([this.inputWrapper], SHOW_CHIP);
5154
5159
  const isValid = this.getValidMode();
5155
- if (isValid && this.value !== null) {
5160
+ if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
5156
5161
  addClass([this.inputEle], CHIP_INPUT);
5157
5162
  }
5158
- else if (this.value === null) {
5163
+ else if (this.value === null || (this.value && this.value.length === 0)) {
5159
5164
  addClass([this.chipWrapper], HIDEICON);
5160
5165
  }
5161
5166
  }
@@ -5196,8 +5201,10 @@ let DropDownTree = class DropDownTree extends Component {
5196
5201
  }
5197
5202
  this.checkWrapper = closest(target, '.' + CHECKBOXWRAP);
5198
5203
  if (!isNullOrUndefined(this.checkWrapper)) {
5204
+ this.isClicked = true;
5199
5205
  const checkElement = select('.' + CHECKBOXFRAME, this.checkWrapper);
5200
5206
  this.changeState(this.checkWrapper, checkElement.classList.contains(CHECK) ? 'uncheck' : 'check', e);
5207
+ this.isClicked = false;
5201
5208
  }
5202
5209
  e.preventDefault();
5203
5210
  }
@@ -5252,7 +5259,7 @@ let DropDownTree = class DropDownTree extends Component {
5252
5259
  }
5253
5260
  }
5254
5261
  setAttributes() {
5255
- this.element.removeAttribute('tabindex');
5262
+ this.inputEle.setAttribute('tabindex', '-1');
5256
5263
  const id = this.element.getAttribute('id');
5257
5264
  this.hiddenElement.id = id + '_hidden';
5258
5265
  this.inputWrapper.setAttribute('tabindex', '0');
@@ -5427,7 +5434,6 @@ let DropDownTree = class DropDownTree extends Component {
5427
5434
  else {
5428
5435
  if (this.showCheckBox) {
5429
5436
  this.treeObj.checkedNodes = this.value.slice();
5430
- setValue('selectedNodes', [], this.treeObj);
5431
5437
  this.treeObj.dataBind();
5432
5438
  this.setMultiSelect();
5433
5439
  }
@@ -5893,7 +5899,7 @@ let DropDownTree = class DropDownTree extends Component {
5893
5899
  }
5894
5900
  const eventArgs = {
5895
5901
  action: this.showCheckBox ? state : args.action,
5896
- isInteracted: args.isInteracted,
5902
+ isInteracted: this.isClicked ? true : args.isInteracted,
5897
5903
  item: args.node,
5898
5904
  itemData: this.showCheckBox ? checkData[0] : selectData
5899
5905
  };
@@ -5964,6 +5970,7 @@ let DropDownTree = class DropDownTree extends Component {
5964
5970
  }
5965
5971
  const target = args.event.target;
5966
5972
  if ((target.classList.contains('e-fullrow') || target.classList.contains('e-list-text')) && this.showCheckBox) {
5973
+ this.isClicked = true;
5967
5974
  // eslint-disable-next-line
5968
5975
  const getNodeDetails = this.treeObj.getNode(args.node);
5969
5976
  if (getNodeDetails.isChecked === 'true') {
@@ -5972,6 +5979,7 @@ let DropDownTree = class DropDownTree extends Component {
5972
5979
  else {
5973
5980
  this.treeObj.checkAll([args.node]);
5974
5981
  }
5982
+ this.isClicked = false;
5975
5983
  this.setMultiSelect();
5976
5984
  this.ensurePlaceHolder();
5977
5985
  }
@@ -9359,6 +9367,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9359
9367
  }
9360
9368
  this.inputFocus = false;
9361
9369
  this.overAllWrapper.classList.remove(FOCUS);
9370
+ if (this.addTagOnBlur) {
9371
+ const dataChecks = this.getValueByText(this.inputElement.value, this.ignoreCase, this.ignoreAccent);
9372
+ const listLiElement = this.findListElement(this.list, 'li', 'data-value', dataChecks);
9373
+ const className = this.hideSelectedItem ? HIDE_LIST : dropDownBaseClasses.selected;
9374
+ const allowChipAddition = (listLiElement && !listLiElement.classList.contains(className)) ? true : false;
9375
+ if (allowChipAddition) {
9376
+ this.updateListSelection(listLiElement, eve);
9377
+ if (this.mode === 'Delimiter') {
9378
+ this.updateDelimeter(this.delimiterChar);
9379
+ }
9380
+ }
9381
+ }
9362
9382
  this.refreshListItems(null);
9363
9383
  if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
9364
9384
  this.updateDelimView();
@@ -10926,6 +10946,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10926
10946
  setValue(this.fields.value, value, newValue);
10927
10947
  const noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
10928
10948
  this.addItem(newValue, indexItem);
10949
+ element = element ? element : this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);
10929
10950
  if (this.popupWrapper.contains(noDataEle)) {
10930
10951
  this.list.setAttribute('style', noDataEle.getAttribute('style'));
10931
10952
  this.popupWrapper.replaceChild(this.list, noDataEle);
@@ -10974,6 +10995,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10974
10995
  this.popupObj = null;
10975
10996
  this.renderPopup();
10976
10997
  }
10998
+ else if (this.allowCustomValue) {
10999
+ this.list = list;
11000
+ this.mainList = this.ulElement = list.querySelector('ul');
11001
+ }
10977
11002
  }
10978
11003
  updateDataList() {
10979
11004
  if (this.mainList && this.ulElement && this.mainList.childElementCount < this.ulElement.childElementCount) {
@@ -11452,16 +11477,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11452
11477
  l10n = new L10n('dropdowns', l10nLocale, this.locale);
11453
11478
  }
11454
11479
  const remainContent = l10n.getConstant('overflowCountTemplate');
11480
+ const totalContent = l10n.getConstant('totalCountTemplate');
11455
11481
  const raminElement = this.createElement('span', {
11456
11482
  className: REMAIN_WRAPPER$1
11457
11483
  });
11458
- const compiledString = compile(remainContent);
11459
- const totalCompiledString = compile(l10n.getConstant('totalCountTemplate'));
11460
- // eslint-disable-next-line
11461
- let remainCompildTemp = compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
11462
- if (remainCompildTemp && remainCompildTemp.length > 0) {
11463
- raminElement.appendChild(remainCompildTemp[0]);
11464
- }
11484
+ let remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
11485
+ raminElement.innerText = remainCompildTemp;
11465
11486
  this.viewWrapper.appendChild(raminElement);
11466
11487
  this.renderReactTemplates();
11467
11488
  const remainSize = raminElement.offsetWidth;
@@ -11513,9 +11534,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11513
11534
  }
11514
11535
  if (remaining > 0) {
11515
11536
  const totalWidth = overAllContainer - downIconWidth - this.clearIconWidth;
11516
- this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth));
11537
+ this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth));
11517
11538
  this.updateRemainWidth(this.viewWrapper, totalWidth);
11518
- this.updateRemainingText(raminElement, downIconWidth, remaining, compiledString, totalCompiledString);
11539
+ this.updateRemainingText(raminElement, downIconWidth, remaining, remainContent, totalContent);
11519
11540
  }
11520
11541
  }
11521
11542
  else {
@@ -11535,17 +11556,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11535
11556
  viewWrapper.style.width = totalWidth + 'px';
11536
11557
  }
11537
11558
  }
11538
- updateRemainTemplate(raminElement, viewWrapper, remaining, compiledString, totalCompiledString, totalWidth) {
11559
+ updateRemainTemplate(raminElement, viewWrapper, remaining, remainContent, totalContent, totalWidth) {
11539
11560
  if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3 && viewWrapper.firstChild.nodeValue === '') {
11540
11561
  viewWrapper.removeChild(viewWrapper.firstChild);
11541
11562
  }
11542
11563
  raminElement.innerHTML = '';
11543
- // eslint-disable-next-line
11544
- let remainTemp = compiledString({ 'count': remaining }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
11545
- // eslint-disable-next-line
11546
- let totalTemp = totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate, null, raminElement);
11547
- raminElement.appendChild((viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ?
11548
- remainTemp && remainTemp[0] : totalTemp && totalTemp[0]);
11564
+ let remainTemp = remainContent.replace('${count}', remaining.toString());
11565
+ let totalTemp = totalContent.replace('${count}', remaining.toString());
11566
+ raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;
11549
11567
  if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
11550
11568
  viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11551
11569
  }
@@ -11555,7 +11573,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11555
11573
  }
11556
11574
  return raminElement;
11557
11575
  }
11558
- updateRemainingText(raminElement, downIconWidth, remaining, compiledString, totalCompiledString) {
11576
+ updateRemainingText(raminElement, downIconWidth, remaining, remainContent, totalContent) {
11559
11577
  const overAllContainer = this.componentWrapper.offsetWidth -
11560
11578
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
11561
11579
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
@@ -11574,7 +11592,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11574
11592
  wrapperleng = this.viewWrapper.offsetWidth;
11575
11593
  }
11576
11594
  const totalWidth = overAllContainer - downIconWidth;
11577
- this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth);
11595
+ this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth);
11578
11596
  }
11579
11597
  }
11580
11598
  getOverflowVal(index) {
@@ -12573,6 +12591,9 @@ __decorate$5([
12573
12591
  __decorate$5([
12574
12592
  Property(true)
12575
12593
  ], MultiSelect.prototype, "openOnClick", void 0);
12594
+ __decorate$5([
12595
+ Property(false)
12596
+ ], MultiSelect.prototype, "addTagOnBlur", void 0);
12576
12597
  __decorate$5([
12577
12598
  Event()
12578
12599
  ], MultiSelect.prototype, "change", void 0);
@@ -12763,7 +12784,7 @@ class CheckBoxSelection {
12763
12784
  }
12764
12785
  if (this.parent.list.classList.contains('e-nodata') || (this.parent.listData && this.parent.listData.length <= 1 &&
12765
12786
  !(this.parent.isDynamicDataChange)) || (this.parent.isDynamicDataChange &&
12766
- !isNullOrUndefined(this.parent.value) && this.parent.value.length <= 1)) {
12787
+ this.parent.listData && this.parent.listData.length <= 1)) {
12767
12788
  this.checkAllParent.style.display = 'none';
12768
12789
  }
12769
12790
  else {