@syncfusion/ej2-dropdowns 34.1.32 → 34.2.2

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 (91) hide show
  1. package/.eslintrc.json +263 -0
  2. package/aceconfig.js +17 -0
  3. package/dist/ej2-dropdowns.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js +2 -2
  5. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es2015.js +183 -6
  7. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  8. package/dist/es6/ej2-dropdowns.es5.js +191 -6
  9. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  10. package/dist/global/ej2-dropdowns.min.js +2 -2
  11. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +8 -8
  14. package/src/drop-down-tree/drop-down-tree.d.ts +5 -0
  15. package/src/drop-down-tree/drop-down-tree.js +142 -0
  16. package/src/list-box/list-box.js +5 -5
  17. package/src/multi-select/multi-select.d.ts +2 -0
  18. package/src/multi-select/multi-select.js +44 -1
  19. package/styles/auto-complete/_variables.scss +1 -1
  20. package/styles/bds-lite.css +4 -1
  21. package/styles/bds.css +4 -1
  22. package/styles/bootstrap-dark-lite.css +4 -0
  23. package/styles/bootstrap-dark.css +4 -0
  24. package/styles/bootstrap-lite.css +4 -0
  25. package/styles/bootstrap.css +4 -0
  26. package/styles/bootstrap4-lite.css +4 -0
  27. package/styles/bootstrap4.css +4 -0
  28. package/styles/bootstrap5-dark-lite.css +4 -0
  29. package/styles/bootstrap5-dark.css +4 -0
  30. package/styles/bootstrap5-lite.css +4 -1
  31. package/styles/bootstrap5.3-lite.css +4 -1
  32. package/styles/bootstrap5.3.css +4 -1
  33. package/styles/bootstrap5.css +4 -1
  34. package/styles/combo-box/_variables.scss +1 -1
  35. package/styles/drop-down-base/_variables.scss +1 -1
  36. package/styles/drop-down-list/_variables.scss +1 -1
  37. package/styles/drop-down-tree/_variables.scss +1 -1
  38. package/styles/fabric-dark-lite.css +4 -0
  39. package/styles/fabric-dark.css +4 -0
  40. package/styles/fabric-lite.css +4 -0
  41. package/styles/fabric.css +4 -0
  42. package/styles/fluent-dark-lite.css +4 -0
  43. package/styles/fluent-dark.css +4 -0
  44. package/styles/fluent-lite.css +4 -1
  45. package/styles/fluent.css +4 -1
  46. package/styles/fluent2-lite.css +4 -1
  47. package/styles/fluent2.css +4 -1
  48. package/styles/highcontrast-light-lite.css +4 -0
  49. package/styles/highcontrast-light.css +4 -0
  50. package/styles/highcontrast-lite.css +4 -0
  51. package/styles/highcontrast.css +4 -0
  52. package/styles/list-box/_variables.scss +1 -1
  53. package/styles/material-dark-lite.css +4 -0
  54. package/styles/material-dark.css +4 -0
  55. package/styles/material-lite.css +4 -0
  56. package/styles/material.css +4 -0
  57. package/styles/material3-dark-lite.css +4 -0
  58. package/styles/material3-dark.css +4 -0
  59. package/styles/material3-lite.css +4 -1
  60. package/styles/material3.css +4 -1
  61. package/styles/mention/_layout.scss +3 -4
  62. package/styles/mention/_variables.scss +1 -1
  63. package/styles/mention/bds.css +5 -0
  64. package/styles/mention/bootstrap-dark.css +3 -0
  65. package/styles/mention/bootstrap.css +3 -0
  66. package/styles/mention/bootstrap4.css +3 -0
  67. package/styles/mention/bootstrap5-dark.css +3 -0
  68. package/styles/mention/bootstrap5.3.css +4 -1
  69. package/styles/mention/bootstrap5.css +4 -1
  70. package/styles/mention/fabric-dark.css +3 -0
  71. package/styles/mention/fabric.css +3 -0
  72. package/styles/mention/fluent-dark.css +3 -0
  73. package/styles/mention/fluent.css +4 -1
  74. package/styles/mention/fluent2.css +5 -0
  75. package/styles/mention/highcontrast-light.css +3 -0
  76. package/styles/mention/highcontrast.css +3 -0
  77. package/styles/mention/material-dark.css +3 -0
  78. package/styles/mention/material.css +3 -0
  79. package/styles/mention/material3-dark.css +4 -1
  80. package/styles/mention/material3.css +5 -0
  81. package/styles/mention/tailwind-dark.css +3 -0
  82. package/styles/mention/tailwind.css +4 -1
  83. package/styles/mention/tailwind3.css +5 -0
  84. package/styles/multi-select/_variables.scss +1 -1
  85. package/styles/tailwind-dark-lite.css +4 -0
  86. package/styles/tailwind-dark.css +4 -0
  87. package/styles/tailwind-lite.css +4 -1
  88. package/styles/tailwind.css +4 -1
  89. package/styles/tailwind3-lite.css +4 -1
  90. package/styles/tailwind3.css +4 -1
  91. package/tslint.json +111 -0
@@ -8313,6 +8313,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8313
8313
  _this.windowResizeContext = _this.windowResize.bind(_this);
8314
8314
  // Specifies if the checkAll method has been called
8315
8315
  _this.isCheckAllCalled = false;
8316
+ _this.isNodeChecked = false;
8316
8317
  _this.isFromFilterChange = false;
8317
8318
  _this.fallbackValue = [];
8318
8319
  return _this;
@@ -10350,6 +10351,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10350
10351
  DropDownTree.prototype.onNodeChecked = function (args) {
10351
10352
  var eventArgs = this.getEventArgs(args);
10352
10353
  this.trigger('select', eventArgs);
10354
+ this.isNodeChecked = args.action === 'check';
10353
10355
  if (this.isFilteredData && args.action === 'uncheck') {
10354
10356
  var id = getValue('id', args.data[0]).toString();
10355
10357
  this.removeSelectedData(id, true);
@@ -10675,6 +10677,143 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10675
10677
  }
10676
10678
  }
10677
10679
  };
10680
+ DropDownTree.prototype.getFilteredTreeData = function () {
10681
+ return this.treeData;
10682
+ };
10683
+ DropDownTree.prototype.getChildren = function (parentId, result) {
10684
+ var _this = this;
10685
+ var treeData = this.getFilteredTreeData();
10686
+ treeData.forEach(function (item) {
10687
+ if (!isNullOrUndefined(item) && !isNullOrUndefined(item.pid) && !isNullOrUndefined(item.id) && item.pid.toString() === parentId.toString()) {
10688
+ var childId = item.id.toString();
10689
+ if (result.indexOf(childId) === -1) {
10690
+ result.push(childId);
10691
+ _this.getChildren(childId, result);
10692
+ }
10693
+ }
10694
+ });
10695
+ };
10696
+ DropDownTree.prototype.getDirectChildren = function (parentId) {
10697
+ return this.getFilteredTreeData()
10698
+ .filter(function (childNode) {
10699
+ return !isNullOrUndefined(childNode) && !isNullOrUndefined(childNode.pid) && !isNullOrUndefined(childNode.id) && childNode.pid.toString() === parentId;
10700
+ })
10701
+ .map(function (childNode) { return childNode.id.toString(); });
10702
+ };
10703
+ DropDownTree.prototype.updateFilteredAutoCheckValues = function () {
10704
+ var _this = this;
10705
+ var treeData = this.getFilteredTreeData();
10706
+ var currentValues = Array.isArray(this.value) ? this.value.map(function (item) { return item.toString(); }) : [];
10707
+ var removeParent = function (parentId) {
10708
+ _this.value = _this.value.filter(function (value) { return value.toString() !== parentId; });
10709
+ };
10710
+ if (this.isNodeChecked) {
10711
+ this.treeObj.checkedNodes.map(function (item) { return item.toString(); }).forEach(function (value) {
10712
+ if (_this.value.indexOf(value) === -1) {
10713
+ _this.value.push(value);
10714
+ }
10715
+ });
10716
+ treeData.forEach(function (node) {
10717
+ if (isNullOrUndefined(node) || isNullOrUndefined(node.id)) {
10718
+ return;
10719
+ }
10720
+ var parentId = node.id.toString();
10721
+ if (node.haschild && _this.value.indexOf(parentId) !== -1) {
10722
+ var childValues = [];
10723
+ _this.getChildren(parentId, childValues);
10724
+ if (_this.value.indexOf(parentId) === -1) {
10725
+ _this.value.push(parentId);
10726
+ }
10727
+ childValues.forEach(function (value) {
10728
+ if (_this.value.indexOf(value) === -1) {
10729
+ _this.value.push(value);
10730
+ }
10731
+ });
10732
+ }
10733
+ currentValues = _this.value.map(function (item) { return item.toString(); });
10734
+ });
10735
+ treeData.forEach(function (node) {
10736
+ if (isNullOrUndefined(node) || isNullOrUndefined(node.id)) {
10737
+ return;
10738
+ }
10739
+ if (!node.haschild) {
10740
+ return;
10741
+ }
10742
+ var parentId = node.id.toString();
10743
+ var directChildren = _this.getDirectChildren(parentId);
10744
+ if (!directChildren.length) {
10745
+ return;
10746
+ }
10747
+ var allChildrenSelected = directChildren.every(function (childId) { return _this.value.indexOf(childId) !== -1; });
10748
+ if (allChildrenSelected) {
10749
+ var childValues = [];
10750
+ _this.getChildren(parentId, childValues);
10751
+ if (_this.value.indexOf(parentId) === -1) {
10752
+ _this.value.push(parentId);
10753
+ }
10754
+ childValues.forEach(function (value) {
10755
+ if (_this.value.indexOf(value) === -1) {
10756
+ _this.value.push(value);
10757
+ }
10758
+ });
10759
+ }
10760
+ else {
10761
+ removeParent(parentId);
10762
+ }
10763
+ currentValues = _this.value.map(function (item) { return item.toString(); });
10764
+ });
10765
+ this.selectedData.forEach(function (item) {
10766
+ var value = getValue(_this.treeSettings.loadOnDemand ? _this.fields.value : 'id', item).toString();
10767
+ if (_this.value.indexOf(value) === -1) {
10768
+ _this.selectedData = _this.selectedData.filter(function (data) {
10769
+ return getValue(_this.treeSettings.loadOnDemand ? _this.fields.value : 'id', data).toString() !== value;
10770
+ });
10771
+ }
10772
+ });
10773
+ return;
10774
+ }
10775
+ var removeValues = [];
10776
+ treeData.forEach(function (node) {
10777
+ if (isNullOrUndefined(node.id)) {
10778
+ return;
10779
+ }
10780
+ if (!node.haschild) {
10781
+ return;
10782
+ }
10783
+ var parentId = node.id.toString();
10784
+ if (currentValues.indexOf(parentId) === -1) {
10785
+ var childValues = [];
10786
+ _this.getChildren(parentId, childValues);
10787
+ if (childValues.some(function (child) { return currentValues.indexOf(child) !== -1; })) {
10788
+ removeValues.push.apply(removeValues, childValues);
10789
+ }
10790
+ }
10791
+ });
10792
+ if (removeValues.length) {
10793
+ this.value = this.value.filter(function (value) { return removeValues.indexOf(value.toString()) === -1; });
10794
+ currentValues = this.value.map(function (item) { return item.toString(); });
10795
+ }
10796
+ treeData.forEach(function (node) {
10797
+ if (isNullOrUndefined(node) || isNullOrUndefined(node.id)) {
10798
+ return;
10799
+ }
10800
+ if (!node.haschild) {
10801
+ return;
10802
+ }
10803
+ var parentId = node.id.toString();
10804
+ if (currentValues.indexOf(parentId) === -1) {
10805
+ return;
10806
+ }
10807
+ var hasDirectChild = treeData.some(function (childNode) {
10808
+ return !isNullOrUndefined(childNode) && !isNullOrUndefined(childNode.pid) && !isNullOrUndefined(childNode.id) && childNode.pid.toString() === parentId &&
10809
+ currentValues.indexOf(childNode.id.toString()) !== -1;
10810
+ });
10811
+ if (!hasDirectChild) {
10812
+ removeParent(parentId);
10813
+ currentValues = _this.value.map(function (item) { return item.toString(); });
10814
+ }
10815
+ });
10816
+ };
10678
10817
  DropDownTree.prototype.updateSelectedValues = function () {
10679
10818
  var _this = this;
10680
10819
  this.dataValue = '';
@@ -10690,6 +10829,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10690
10829
  if (!this.isFilteredData) {
10691
10830
  this.selectedData = [];
10692
10831
  }
10832
+ if (this.treeSettings.autoCheck && this.isFilteredData && !isNullOrUndefined(this.value)) {
10833
+ this.updateFilteredAutoCheckValues();
10834
+ }
10693
10835
  if (!isNullOrUndefined(this.value)) {
10694
10836
  var compiledString = this.initializeValueTemplate();
10695
10837
  for (var i = 0, len = this.value.length; i < len; i++) {
@@ -13723,6 +13865,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13723
13865
  _this.isBlurDispatching = false;
13724
13866
  _this.isFilterPrevented = false;
13725
13867
  _this.isFilteringAction = false;
13868
+ _this.isPropertyChanged = false;
13726
13869
  _this.isValidKey = false;
13727
13870
  _this.selectAllEventData = [];
13728
13871
  _this.selectAllEventEle = [];
@@ -14433,7 +14576,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14433
14576
  }
14434
14577
  }
14435
14578
  else if (!(this.dataSource instanceof DataManager)) {
14436
- this.initialValueUpdate();
14579
+ if (!this.isRemoveSelection) {
14580
+ this.initialValueUpdate(this.listData, true);
14581
+ }
14582
+ else {
14583
+ this.initialValueUpdate();
14584
+ }
14437
14585
  }
14438
14586
  this.initialUpdate();
14439
14587
  this.refreshPlaceHolder();
@@ -17775,6 +17923,33 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17775
17923
  this.unwireListEvents();
17776
17924
  this.wireListEvents();
17777
17925
  };
17926
+ MultiSelect.prototype.getTextByValueFromDataSource = function (value) {
17927
+ var dataSource = this.dataSource;
17928
+ if (isNullOrUndefined(dataSource) || !dataSource.length) {
17929
+ return null;
17930
+ }
17931
+ if (this.isPrimitiveData) {
17932
+ for (var i = 0; i < dataSource.length; i++) {
17933
+ if (dataSource[i] === value) {
17934
+ return dataSource[i];
17935
+ }
17936
+ }
17937
+ return null;
17938
+ }
17939
+ var fields = this.fields;
17940
+ var valueField = fields.value ? fields.value : 'value';
17941
+ var textField = fields.text ? fields.text : 'text';
17942
+ for (var i = 0; i < dataSource.length; i++) {
17943
+ var item = dataSource[i];
17944
+ if (!isNullOrUndefined(item) && getValue(valueField, item) === value) {
17945
+ var resolvedText = getValue(textField, item);
17946
+ if (!isNullOrUndefined(resolvedText)) {
17947
+ return resolvedText;
17948
+ }
17949
+ }
17950
+ }
17951
+ return null;
17952
+ };
17778
17953
  MultiSelect.prototype.initialValueUpdate = function (listItems, isInitialVirtualData, isInitialRender) {
17779
17954
  var _this = this;
17780
17955
  if (this.list) {
@@ -17825,6 +18000,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17825
18000
  }
17826
18001
  }
17827
18002
  }
18003
+ if (this.isPropertyChanged && isNullOrUndefined(text) && !this.allowCustomValue &&
18004
+ !(this.dataSource instanceof DataManager)) {
18005
+ text = this.getTextByValueFromDataSource(value_2);
18006
+ }
17828
18007
  if ((isNullOrUndefined(text) && this.allowCustomValue) &&
17829
18008
  ((!(this.dataSource instanceof DataManager)) ||
17830
18009
  (this.dataSource instanceof DataManager && isInitialVirtualData))) {
@@ -19459,6 +19638,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19459
19638
  * @returns {void}
19460
19639
  */
19461
19640
  MultiSelect.prototype.onPropertyChanged = function (newProp, oldProp) {
19641
+ this.isPropertyChanged = true;
19462
19642
  if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))
19463
19643
  || newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
19464
19644
  this.mainList = null;
@@ -19504,6 +19684,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19504
19684
  && !this.validateValues(newProp.value, oldProp.value)) {
19505
19685
  return;
19506
19686
  }
19687
+ if (this.isVue && this.mode === 'CheckBox' && !this.changeOnBlur && !isNullOrUndefined(oldProp.value) && !isNullOrUndefined(newProp.value)
19688
+ && !this.validateValues(newProp.value, oldProp.value)) {
19689
+ return;
19690
+ }
19507
19691
  this.updateVal(this.value, oldProp.value, 'value', this.enableVirtualization);
19508
19692
  this.addValidInputClass();
19509
19693
  if (!this.closePopupOnSelect && this.isPopupOpen()) {
@@ -19627,6 +19811,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19627
19811
  break;
19628
19812
  }
19629
19813
  }
19814
+ this.isPropertyChanged = false;
19630
19815
  };
19631
19816
  MultiSelect.prototype.reInitializePoup = function () {
19632
19817
  if (this.popupObj) {
@@ -23704,11 +23889,11 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
23704
23889
  e.preventDefault();
23705
23890
  return;
23706
23891
  }
23707
- var char = e.code && e.keyCode >= 96 && e.keyCode <= 105 ?
23708
- String.fromCharCode(e.keyCode - 48) : String.fromCharCode(e.keyCode);
23709
- var isWordCharacter = char.match(/\w/);
23710
- var isWordAccentCharacter = char.match(/[A-Za-z0-9\u00C0-\u024F ]/);
23711
- if (!isNullOrUndefined(isWordCharacter) || !isNullOrUndefined(isWordAccentCharacter)) {
23892
+ var isSpecialKey = e.keyCode >= 186 && e.keyCode <= 192;
23893
+ var isNumericKeyPadSpecialKey = e.keyCode === 107 || e.keyCode === 109 || e.keyCode === 111;
23894
+ var isWordCharacter = e.key && e.key.match(/\w/);
23895
+ var isWordAccentCharacter = e.key && e.key.match(/[A-Za-z0-9\u00C0-\u024F ,>/:;\-+=]/);
23896
+ if (!isNullOrUndefined(isWordCharacter) || !isNullOrUndefined(isWordAccentCharacter) || isSpecialKey || isNumericKeyPadSpecialKey) {
23712
23897
  this.isValidKey = true;
23713
23898
  }
23714
23899
  this.isBackSpace = e.keyCode === 8;