@syncfusion/ej2-dropdowns 21.2.8 → 22.1.34

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 (162) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +35 -6
  3. package/README.md +201 -103
  4. package/dist/ej2-dropdowns.min.js +2 -2
  5. package/dist/ej2-dropdowns.umd.min.js +2 -2
  6. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es2015.js +158 -41
  8. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  9. package/dist/es6/ej2-dropdowns.es5.js +158 -41
  10. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  11. package/dist/global/ej2-dropdowns.min.js +2 -2
  12. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +11 -11
  15. package/src/auto-complete/auto-complete-model.d.ts +2 -1
  16. package/src/auto-complete/auto-complete.d.ts +2 -1
  17. package/src/auto-complete/auto-complete.js +1 -1
  18. package/src/combo-box/combo-box-model.d.ts +6 -3
  19. package/src/combo-box/combo-box.d.ts +6 -3
  20. package/src/drop-down-base/drop-down-base-model.d.ts +8 -4
  21. package/src/drop-down-base/drop-down-base.d.ts +8 -4
  22. package/src/drop-down-base/drop-down-base.js +21 -7
  23. package/src/drop-down-list/drop-down-list-model.d.ts +6 -3
  24. package/src/drop-down-list/drop-down-list.d.ts +6 -3
  25. package/src/drop-down-list/drop-down-list.js +23 -14
  26. package/src/drop-down-tree/drop-down-tree-model.d.ts +21 -6
  27. package/src/drop-down-tree/drop-down-tree.d.ts +55 -62
  28. package/src/drop-down-tree/drop-down-tree.js +1 -1
  29. package/src/list-box/list-box.d.ts +15 -0
  30. package/src/list-box/list-box.js +53 -3
  31. package/src/mention/mention-model.d.ts +4 -2
  32. package/src/mention/mention.d.ts +4 -2
  33. package/src/multi-select/multi-select-model.d.ts +15 -8
  34. package/src/multi-select/multi-select.d.ts +15 -7
  35. package/src/multi-select/multi-select.js +59 -15
  36. package/styles/auto-complete/_material3-dark-definition.scss +1 -0
  37. package/styles/auto-complete/_material3-definition.scss +2 -0
  38. package/styles/auto-complete/material3-dark.css +198 -0
  39. package/styles/auto-complete/material3-dark.scss +5 -0
  40. package/styles/auto-complete/material3.css +254 -0
  41. package/styles/auto-complete/material3.scss +5 -0
  42. package/styles/bootstrap-dark.css +212 -100
  43. package/styles/bootstrap.css +214 -101
  44. package/styles/bootstrap4.css +214 -101
  45. package/styles/bootstrap5-dark.css +212 -100
  46. package/styles/bootstrap5.css +212 -100
  47. package/styles/combo-box/_material3-dark-definition.scss +1 -0
  48. package/styles/combo-box/_material3-definition.scss +2 -0
  49. package/styles/combo-box/material3-dark.css +198 -0
  50. package/styles/combo-box/material3-dark.scss +5 -0
  51. package/styles/combo-box/material3.css +254 -0
  52. package/styles/combo-box/material3.scss +5 -0
  53. package/styles/drop-down-base/_layout.scss +3 -1
  54. package/styles/drop-down-base/_material3-dark-definition.scss +1 -0
  55. package/styles/drop-down-base/_material3-definition.scss +87 -0
  56. package/styles/drop-down-base/_theme.scss +10 -0
  57. package/styles/drop-down-base/bootstrap-dark.css +4 -0
  58. package/styles/drop-down-base/bootstrap.css +4 -0
  59. package/styles/drop-down-base/bootstrap4.css +4 -0
  60. package/styles/drop-down-base/bootstrap5-dark.css +4 -0
  61. package/styles/drop-down-base/bootstrap5.css +4 -0
  62. package/styles/drop-down-base/fabric-dark.css +4 -0
  63. package/styles/drop-down-base/fabric.css +4 -0
  64. package/styles/drop-down-base/fluent-dark.css +4 -0
  65. package/styles/drop-down-base/fluent.css +4 -0
  66. package/styles/drop-down-base/highcontrast-light.css +4 -0
  67. package/styles/drop-down-base/highcontrast.css +4 -0
  68. package/styles/drop-down-base/material-dark.css +4 -0
  69. package/styles/drop-down-base/material.css +4 -0
  70. package/styles/drop-down-base/material3-dark.css +439 -0
  71. package/styles/drop-down-base/material3-dark.scss +4 -0
  72. package/styles/drop-down-base/material3.css +495 -0
  73. package/styles/drop-down-base/material3.scss +4 -0
  74. package/styles/drop-down-base/tailwind-dark.css +4 -0
  75. package/styles/drop-down-base/tailwind.css +4 -0
  76. package/styles/drop-down-list/_layout.scss +15 -1
  77. package/styles/drop-down-list/_material3-dark-definition.scss +1 -0
  78. package/styles/drop-down-list/_material3-definition.scss +180 -0
  79. package/styles/drop-down-list/icons/_material3-dark.scss +1 -0
  80. package/styles/drop-down-list/material3-dark.css +503 -0
  81. package/styles/drop-down-list/material3-dark.scss +9 -0
  82. package/styles/drop-down-list/material3.css +559 -0
  83. package/styles/drop-down-list/material3.scss +9 -0
  84. package/styles/drop-down-tree/_layout.scss +13 -7
  85. package/styles/drop-down-tree/_material3-dark-definition.scss +1 -0
  86. package/styles/drop-down-tree/_material3-definition.scss +76 -0
  87. package/styles/drop-down-tree/_theme.scss +14 -2
  88. package/styles/drop-down-tree/icons/_material3-dark.scss +1 -0
  89. package/styles/drop-down-tree/icons/_material3.scss +1 -1
  90. package/styles/drop-down-tree/material3-dark.css +466 -0
  91. package/styles/drop-down-tree/material3-dark.scss +10 -0
  92. package/styles/drop-down-tree/material3.css +522 -0
  93. package/styles/drop-down-tree/material3.scss +10 -0
  94. package/styles/fabric-dark.css +212 -100
  95. package/styles/fabric.css +214 -101
  96. package/styles/fluent-dark.css +214 -101
  97. package/styles/fluent.css +214 -101
  98. package/styles/highcontrast-light.css +212 -100
  99. package/styles/highcontrast.css +214 -101
  100. package/styles/list-box/_layout.scss +17 -3
  101. package/styles/list-box/_material3-dark-definition.scss +1 -0
  102. package/styles/list-box/_material3-definition.scss +117 -0
  103. package/styles/list-box/_theme.scss +2 -1
  104. package/styles/list-box/bootstrap-dark.css +207 -99
  105. package/styles/list-box/bootstrap.css +209 -100
  106. package/styles/list-box/bootstrap4.css +209 -100
  107. package/styles/list-box/bootstrap5-dark.css +207 -99
  108. package/styles/list-box/bootstrap5.css +207 -99
  109. package/styles/list-box/fabric-dark.css +207 -99
  110. package/styles/list-box/fabric.css +209 -100
  111. package/styles/list-box/fluent-dark.css +209 -100
  112. package/styles/list-box/fluent.css +209 -100
  113. package/styles/list-box/highcontrast-light.css +207 -99
  114. package/styles/list-box/highcontrast.css +209 -100
  115. package/styles/list-box/icons/_material3-dark.scss +1 -0
  116. package/styles/list-box/material-dark.css +207 -99
  117. package/styles/list-box/material.css +209 -100
  118. package/styles/list-box/material3-dark.css +956 -0
  119. package/styles/list-box/material3-dark.scss +6 -0
  120. package/styles/list-box/material3.css +1012 -0
  121. package/styles/list-box/material3.scss +6 -0
  122. package/styles/list-box/tailwind-dark.css +209 -100
  123. package/styles/list-box/tailwind.css +209 -100
  124. package/styles/material-dark.css +212 -100
  125. package/styles/material.css +214 -101
  126. package/styles/material3-dark.css +4664 -0
  127. package/styles/material3-dark.scss +10 -0
  128. package/styles/material3.css +4720 -0
  129. package/styles/material3.scss +10 -0
  130. package/styles/mention/_material3-dark-definition.scss +1 -0
  131. package/styles/mention/_material3-definition.scss +1 -0
  132. package/styles/mention/material3-dark.css +87 -0
  133. package/styles/mention/material3-dark.scss +7 -0
  134. package/styles/mention/material3.css +143 -0
  135. package/styles/mention/material3.scss +7 -0
  136. package/styles/multi-select/_layout.scss +160 -7
  137. package/styles/multi-select/_material3-dark-definition.scss +1 -0
  138. package/styles/multi-select/_material3-definition.scss +246 -0
  139. package/styles/multi-select/_theme.scss +6 -0
  140. package/styles/multi-select/bootstrap-dark.css +1 -1
  141. package/styles/multi-select/bootstrap.css +1 -1
  142. package/styles/multi-select/bootstrap4.css +1 -1
  143. package/styles/multi-select/bootstrap5-dark.css +1 -1
  144. package/styles/multi-select/bootstrap5.css +1 -1
  145. package/styles/multi-select/fabric-dark.css +1 -1
  146. package/styles/multi-select/fabric.css +1 -1
  147. package/styles/multi-select/fluent-dark.css +1 -1
  148. package/styles/multi-select/fluent.css +1 -1
  149. package/styles/multi-select/highcontrast-light.css +1 -1
  150. package/styles/multi-select/highcontrast.css +1 -1
  151. package/styles/multi-select/icons/_material3-dark.scss +1 -0
  152. package/styles/multi-select/icons/_material3.scss +3 -4
  153. package/styles/multi-select/material-dark.css +1 -1
  154. package/styles/multi-select/material.css +1 -1
  155. package/styles/multi-select/material3-dark.css +2547 -0
  156. package/styles/multi-select/material3-dark.scss +10 -0
  157. package/styles/multi-select/material3.css +2603 -0
  158. package/styles/multi-select/material3.scss +10 -0
  159. package/styles/multi-select/tailwind-dark.css +1 -1
  160. package/styles/multi-select/tailwind.css +1 -1
  161. package/styles/tailwind-dark.css +214 -101
  162. package/styles/tailwind.css +214 -101
@@ -1,5 +1,5 @@
1
1
  import { Animation, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isNullOrUndefined, isUndefined, matches, prepend, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
- import { DataManager, DataUtil, Predicate, Query } from '@syncfusion/ej2-data';
2
+ import { DataManager, DataUtil, JsonAdaptor, Predicate, Query } from '@syncfusion/ej2-data';
3
3
  import { ListBase, Sortable, cssClass, moveTo } from '@syncfusion/ej2-lists';
4
4
  import { Popup, createSpinner, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
5
5
  import { Input, TextBox } from '@syncfusion/ej2-inputs';
@@ -385,7 +385,7 @@ let DropDownBase = class DropDownBase extends Component {
385
385
  }
386
386
  templateCompiler(baseTemplate) {
387
387
  let checkTemplate = false;
388
- if (baseTemplate) {
388
+ if (typeof baseTemplate !== 'function' && baseTemplate) {
389
389
  try {
390
390
  checkTemplate = (selectAll(baseTemplate, document).length) ? true : false;
391
391
  }
@@ -403,7 +403,7 @@ let DropDownBase = class DropDownBase extends Component {
403
403
  const templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;
404
404
  ele.innerHTML = '';
405
405
  const tempaltecheck = this.templateCompiler(template);
406
- if (tempaltecheck) {
406
+ if (typeof template !== 'function' && tempaltecheck) {
407
407
  compiledString = compile(select(template, document).innerHTML.trim());
408
408
  }
409
409
  else {
@@ -766,6 +766,9 @@ let DropDownBase = class DropDownBase extends Component {
766
766
  onActionComplete(ulElement, list, e) {
767
767
  /* eslint-enable @typescript-eslint/no-unused-vars */
768
768
  this.listData = list;
769
+ if (this.getModuleName() !== 'listbox') {
770
+ ulElement.setAttribute('tabindex', '0');
771
+ }
769
772
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
770
773
  if (this.isReact) {
771
774
  this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
@@ -825,7 +828,7 @@ let DropDownBase = class DropDownBase extends Component {
825
828
  const option = { groupTemplateID: this.groupTemplateId, isStringTemplate: this.isStringTemplate };
826
829
  const headerItems = listEle.querySelectorAll('.' + dropDownBaseClasses.group);
827
830
  const groupcheck = this.templateCompiler(this.groupTemplate);
828
- if (groupcheck) {
831
+ if (typeof this.groupTemplate !== 'function' && groupcheck) {
829
832
  const groupValue = select(this.groupTemplate, document).innerHTML.trim();
830
833
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
831
834
  const tempHeaders = ListBase.renderGroupTemplate(groupValue, dataSource, this.fields.properties, headerItems, option, this);
@@ -962,7 +965,7 @@ let DropDownBase = class DropDownBase extends Component {
962
965
  option.templateID = this.itemTemplateId;
963
966
  option.isStringTemplate = this.isStringTemplate;
964
967
  const itemcheck = this.templateCompiler(this.itemTemplate);
965
- if (itemcheck) {
968
+ if (typeof this.itemTemplate !== 'function' && itemcheck) {
966
969
  const itemValue = select(this.itemTemplate, document).innerHTML.trim();
967
970
  return ListBase.renderContentTemplate(this.createElement, itemValue, dataSource, fields.properties, option, this);
968
971
  }
@@ -1049,7 +1052,9 @@ let DropDownBase = class DropDownBase extends Component {
1049
1052
  dispatchEvent(element, type) {
1050
1053
  const evt = document.createEvent('HTMLEvents');
1051
1054
  evt.initEvent(type, false, true);
1052
- element.dispatchEvent(evt);
1055
+ if (element) {
1056
+ element.dispatchEvent(evt);
1057
+ }
1053
1058
  }
1054
1059
  /**
1055
1060
  * To set the current fields
@@ -1176,7 +1181,12 @@ let DropDownBase = class DropDownBase extends Component {
1176
1181
  * @returns {void}
1177
1182
  */
1178
1183
  render(e, isEmptyData) {
1179
- this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
1184
+ if (this.getModuleName() === 'listbox') {
1185
+ this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
1186
+ }
1187
+ else {
1188
+ this.list = this.createElement('div', { className: dropDownBaseClasses.content });
1189
+ }
1180
1190
  this.list.classList.add(dropDownBaseClasses.root);
1181
1191
  this.setFields();
1182
1192
  const rippleModel = { duration: 300, selector: '.' + dropDownBaseClasses.li };
@@ -1265,7 +1275,8 @@ let DropDownBase = class DropDownBase extends Component {
1265
1275
  }
1266
1276
  if (this.itemTemplate && !isHeader) {
1267
1277
  const itemCheck = this.templateCompiler(this.itemTemplate);
1268
- const compiledString = itemCheck ? compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
1278
+ const compiledString = typeof this.itemTemplate !== 'function' &&
1279
+ itemCheck ? compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
1269
1280
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1270
1281
  const addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
1271
1282
  if (addItemTemplate) {
@@ -1342,6 +1353,9 @@ let DropDownBase = class DropDownBase extends Component {
1342
1353
  }
1343
1354
  }
1344
1355
  }
1356
+ if (this.getModuleName() === 'listbox' && this.isReact) {
1357
+ this.renderReactTemplates();
1358
+ }
1345
1359
  if (selectedItemValue || itemIndex === 0) {
1346
1360
  this.updateSelection();
1347
1361
  }
@@ -2191,8 +2205,11 @@ let DropDownList = class DropDownList extends DropDownBase {
2191
2205
  startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
2192
2206
  index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
2193
2207
  }
2194
- const nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
2195
- : this.liCollections[index];
2208
+ let nextItem;
2209
+ if (this.getModuleName() !== 'autocomplete' || this.getModuleName() === 'autocomplete' && this.isPopupOpen) {
2210
+ nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
2211
+ : this.liCollections[index];
2212
+ }
2196
2213
  if (!isNullOrUndefined(nextItem)) {
2197
2214
  this.setSelection(nextItem, e);
2198
2215
  }
@@ -2393,7 +2410,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2393
2410
  this.removeSelection();
2394
2411
  li.classList.add(dropDownBaseClasses.selected);
2395
2412
  this.removeHover();
2396
- const value = this.getFormattedValue(li.getAttribute('data-value'));
2413
+ const value = li.getAttribute('data-value') !== "null" ? this.getFormattedValue(li.getAttribute('data-value')) : null;
2397
2414
  const selectedData = this.getDataByValue(value);
2398
2415
  if (!this.initial && !preventSelect && !isNullOrUndefined(e)) {
2399
2416
  const items = this.detachChanges(selectedData);
@@ -2522,7 +2539,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2522
2539
  }
2523
2540
  dropdownCompiler(dropdownTemplate) {
2524
2541
  let checkTemplate = false;
2525
- if (dropdownTemplate) {
2542
+ if (typeof dropdownTemplate !== 'function' && dropdownTemplate) {
2526
2543
  try {
2527
2544
  checkTemplate = (document.querySelectorAll(dropdownTemplate).length) ? true : false;
2528
2545
  }
@@ -2553,7 +2570,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2553
2570
  this.valueTempElement.innerHTML = '';
2554
2571
  }
2555
2572
  const valuecheck = this.dropdownCompiler(this.valueTemplate);
2556
- if (valuecheck) {
2573
+ if (typeof this.valueTemplate !== 'function' && valuecheck) {
2557
2574
  compiledString = compile(document.querySelector(this.valueTemplate).innerHTML.trim());
2558
2575
  }
2559
2576
  else {
@@ -2562,9 +2579,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2562
2579
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2563
2580
  const valueCompTemp = compiledString(this.itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, this.valueTempElement);
2564
2581
  if (valueCompTemp && valueCompTemp.length > 0) {
2565
- for (let i = 0; i < valueCompTemp.length; i++) {
2566
- this.valueTempElement.appendChild(valueCompTemp[i]);
2567
- }
2582
+ append(valueCompTemp, this.valueTempElement);
2568
2583
  }
2569
2584
  this.renderReactTemplates();
2570
2585
  }
@@ -2604,7 +2619,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2604
2619
  const index = this.isSelectCustom ? null : this.activeIndex;
2605
2620
  this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
2606
2621
  this.detachChangeEvent(eve);
2607
- this.dispatchEvent(this.hiddenElement, 'change');
2608
2622
  }
2609
2623
  detachChanges(value) {
2610
2624
  let items;
@@ -2943,6 +2957,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2943
2957
  }
2944
2958
  onInput(e) {
2945
2959
  this.isValidKey = true;
2960
+ if (this.getModuleName() === 'combobox') {
2961
+ this.updateIconState();
2962
+ }
2946
2963
  // For filtering works in mobile firefox.
2947
2964
  if (Browser.isDevice && Browser.info.name === 'mozilla') {
2948
2965
  this.typedString = this.filterInput.value;
@@ -3602,7 +3619,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3602
3619
  this.setFields();
3603
3620
  this.inputWrapper.container.style.width = formatUnit(this.width);
3604
3621
  this.inputWrapper.container.classList.add('e-ddl');
3605
- Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3622
+ if (this.floatLabelType === 'Auto') {
3623
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3624
+ }
3606
3625
  if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
3607
3626
  this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
3608
3627
  }
@@ -3678,7 +3697,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3678
3697
  addClass([this.footer], dropDownListClasses.footer);
3679
3698
  }
3680
3699
  const footercheck = this.dropdownCompiler(this.footerTemplate);
3681
- if (footercheck) {
3700
+ if (typeof this.footerTemplate !== 'function' && footercheck) {
3682
3701
  compiledString = compile(select(this.footerTemplate, document).innerHTML.trim());
3683
3702
  }
3684
3703
  else {
@@ -3701,7 +3720,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3701
3720
  addClass([this.header], dropDownListClasses.header);
3702
3721
  }
3703
3722
  const headercheck = this.dropdownCompiler(this.headerTemplate);
3704
- if (headercheck) {
3723
+ if (typeof this.headerTemplate !== 'function' && headercheck) {
3705
3724
  compiledString = compile(select(this.headerTemplate, document).innerHTML.trim());
3706
3725
  }
3707
3726
  else {
@@ -4165,7 +4184,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4165
4184
  }
4166
4185
  addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4167
4186
  this.onFocus(e);
4168
- Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4187
+ if (this.floatLabelType === 'Auto') {
4188
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4189
+ }
4169
4190
  }
4170
4191
  /**
4171
4192
  * Moves the focus from the component if the component is already focused.
@@ -4183,7 +4204,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4183
4204
  this.targetElement().blur();
4184
4205
  }
4185
4206
  removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4186
- Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4207
+ if (this.floatLabelType === 'Auto' && this.inputElement.value === '') {
4208
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4209
+ }
4187
4210
  }
4188
4211
  /**
4189
4212
  * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
@@ -6693,7 +6716,7 @@ let DropDownTree = class DropDownTree extends Component {
6693
6716
  if (template) {
6694
6717
  // eslint-disable-next-line
6695
6718
  try {
6696
- if (document.querySelectorAll(template).length) {
6719
+ if (typeof template !== 'function' && document.querySelectorAll(template).length) {
6697
6720
  return compile(document.querySelector(template).innerHTML.trim());
6698
6721
  }
6699
6722
  else {
@@ -8650,7 +8673,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
8650
8673
  */
8651
8674
  hidePopup(e) {
8652
8675
  super.hidePopup(e);
8653
- this.activeIndex = -1;
8676
+ this.activeIndex = null;
8654
8677
  }
8655
8678
  /**
8656
8679
  * Dynamically change the value of properties.
@@ -9302,7 +9325,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9302
9325
  predicate = predicate.or(field, 'equal', valuecheck[i]);
9303
9326
  }
9304
9327
  }
9305
- return this.getQuery(this.query).where(predicate);
9328
+ if (this.dataSource instanceof DataManager && this.dataSource.adaptor instanceof JsonAdaptor) {
9329
+ return new Query().where(predicate);
9330
+ }
9331
+ else {
9332
+ return this.getQuery(this.query).clone().where(predicate);
9333
+ }
9306
9334
  }
9307
9335
  /* eslint-disable @typescript-eslint/no-unused-vars */
9308
9336
  onActionComplete(ulElement, list, e, isUpdated) {
@@ -9321,7 +9349,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9321
9349
  }
9322
9350
  }
9323
9351
  let valuecheck = [];
9324
- if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9352
+ if (!isNullOrUndefined(this.value)) {
9325
9353
  valuecheck = this.presentItemValue(this.ulElement);
9326
9354
  }
9327
9355
  if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
@@ -9806,7 +9834,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9806
9834
  parseInt(getComputedStyle(this.dropIcon).marginRight);
9807
9835
  elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
9808
9836
  }
9809
- Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
9837
+ if (this.floatLabelType === 'Auto') {
9838
+ Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
9839
+ }
9810
9840
  }
9811
9841
  }
9812
9842
  checkPlaceholderSize() {
@@ -10155,6 +10185,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10155
10185
  + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
10156
10186
  }
10157
10187
  const focuseElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);
10188
+ this.focusFirstListItem = !isNullOrUndefined(this.liCollections[0]) ? this.liCollections[0].classList.contains('e-item-focus') : false;
10158
10189
  const index = Array.prototype.slice.call(list).indexOf(focuseElem);
10159
10190
  if (index <= 0 && (this.mode === 'CheckBox' && this.allowFiltering)) {
10160
10191
  this.keyAction = false;
@@ -10278,6 +10309,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10278
10309
  let limit = this.value && this.value.length ? this.value.length : 0;
10279
10310
  let target;
10280
10311
  if (li !== null) {
10312
+ e.preventDefault();
10281
10313
  if (li.classList.contains('e-active')) {
10282
10314
  limit = limit - 1;
10283
10315
  }
@@ -10323,6 +10355,35 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10323
10355
  this.hidePopup(e);
10324
10356
  }
10325
10357
  }
10358
+ const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
10359
+ if (selectAllParent && !selectAllParent.classList.contains('e-item-focus')) {
10360
+ e.preventDefault();
10361
+ }
10362
+ if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
10363
+ const selectAllCheckBox = selectAllParent.childNodes[0];
10364
+ if (!selectAllCheckBox.classList.contains('e-check')) {
10365
+ selectAllCheckBox.classList.add('e-check');
10366
+ const args = {
10367
+ module: 'CheckBoxSelection',
10368
+ enable: this.mode === 'CheckBox',
10369
+ value: 'check',
10370
+ name: 'checkSelectAll'
10371
+ };
10372
+ this.notify('checkSelectAll', args);
10373
+ this.selectAllItem(true, e, li);
10374
+ }
10375
+ else {
10376
+ selectAllCheckBox.classList.remove('e-check');
10377
+ const args = {
10378
+ module: 'CheckBoxSelection',
10379
+ enable: this.mode === 'CheckBox',
10380
+ value: 'check',
10381
+ name: 'checkSelectAll'
10382
+ };
10383
+ this.notify('checkSelectAll', args);
10384
+ this.selectAllItem(false, e, li);
10385
+ }
10386
+ }
10326
10387
  this.refreshPlaceHolder();
10327
10388
  }
10328
10389
  refreshListItems(data) {
@@ -10382,7 +10443,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10382
10443
  }
10383
10444
  const selectedElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);
10384
10445
  let temp = -1;
10385
- if (elements.length) {
10446
+ const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
10447
+ if (this.mode === 'CheckBox' && this.showSelectAll && position == 1 && !isNullOrUndefined(selectAllParent) && !selectAllParent.classList.contains('e-item-focus') && this.list.getElementsByClassName('e-item-focus').length == 0 && this.liCollections.length > 1) {
10448
+ selectAllParent.classList.add('e-item-focus');
10449
+ }
10450
+ else if (elements.length) {
10451
+ if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent)) {
10452
+ selectAllParent.classList.remove('e-item-focus');
10453
+ if (this.showSelectAll && position == -1 && !isNullOrUndefined(selectAllParent) && this.liCollections.length > 1 && (this.focusFirstListItem || this.list.getElementsByClassName('e-item-focus').length == 0)) {
10454
+ selectAllParent.classList.add('e-item-focus');
10455
+ }
10456
+ }
10386
10457
  for (let index = 0; index < elements.length; index++) {
10387
10458
  if (elements[index] === selectedElem) {
10388
10459
  temp = index;
@@ -10799,7 +10870,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10799
10870
  }
10800
10871
  multiCompiler(multiselectTemplate) {
10801
10872
  let checkTemplate = false;
10802
- if (multiselectTemplate) {
10873
+ if (typeof multiselectTemplate !== 'function' && multiselectTemplate) {
10803
10874
  try {
10804
10875
  checkTemplate = (selectAll(multiselectTemplate, document).length) ? true : false;
10805
10876
  }
@@ -10823,7 +10894,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10823
10894
  }
10824
10895
  if (this.valueTemplate && !isNullOrUndefined(itemData)) {
10825
10896
  const valuecheck = this.multiCompiler(this.valueTemplate);
10826
- if (valuecheck) {
10897
+ if (typeof this.valueTemplate !== 'function' && valuecheck) {
10827
10898
  compiledString = compile(select(this.valueTemplate, document).innerHTML.trim());
10828
10899
  }
10829
10900
  else {
@@ -10832,9 +10903,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10832
10903
  // eslint-disable-next-line
10833
10904
  let valueCompTemp = compiledString(itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, chipContent);
10834
10905
  if (valueCompTemp && valueCompTemp.length > 0) {
10835
- for (let i = 0; i < valueCompTemp.length; i++) {
10836
- chipContent.appendChild(valueCompTemp[i]);
10837
- }
10906
+ append(valueCompTemp, chipContent);
10838
10907
  }
10839
10908
  this.renderReactTemplates();
10840
10909
  }
@@ -11028,7 +11097,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11028
11097
  this.header = this.createElement('div');
11029
11098
  addClass([this.header], HEADER$1);
11030
11099
  const headercheck = this.multiCompiler(this.headerTemplate);
11031
- if (headercheck) {
11100
+ if (typeof this.headerTemplate !== 'function' && headercheck) {
11032
11101
  compiledString = compile(select(this.headerTemplate, document).innerHTML.trim());
11033
11102
  }
11034
11103
  else {
@@ -11055,7 +11124,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11055
11124
  this.footer = this.createElement('div');
11056
11125
  addClass([this.footer], FOOTER$1);
11057
11126
  const footercheck = this.multiCompiler(this.footerTemplate);
11058
- if (footercheck) {
11127
+ if (typeof this.footerTemplate !== 'function' && footercheck) {
11059
11128
  compiledString = compile(select(this.footerTemplate, document).innerHTML.trim());
11060
11129
  }
11061
11130
  else {
@@ -11309,7 +11378,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11309
11378
  if (delim) {
11310
11379
  this.updateWrapperText(this.delimiterWrapper, data);
11311
11380
  this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));
11312
- this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);
11313
11381
  this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);
11314
11382
  }
11315
11383
  const targetEle = e && e.target;
@@ -12280,7 +12348,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12280
12348
  this.hiddenElement.innerHTML = hiddenValue;
12281
12349
  this.updateWrapperText(this.delimiterWrapper, wrapperText);
12282
12350
  this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));
12283
- this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);
12284
12351
  this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);
12285
12352
  this.setProperties({ text: text.toString() }, true);
12286
12353
  this.refreshInputHight();
@@ -12777,7 +12844,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12777
12844
  }
12778
12845
  });
12779
12846
  if (this.mode === 'Default' || this.mode === 'Box') {
12780
- this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
12847
+ this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
12781
12848
  }
12782
12849
  if (this.element.tagName !== this.getNgDirective()) {
12783
12850
  this.element.style.display = 'none';
@@ -14133,6 +14200,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14133
14200
  this.trigger('drag', this.getDragArgs(args));
14134
14201
  }
14135
14202
  beforeDragEnd(args) {
14203
+ let items = [];
14136
14204
  this.dragValue = this.getFormattedValue(args.droppedElement.getAttribute('data-value'));
14137
14205
  if (this.value.indexOf(this.dragValue) > -1) {
14138
14206
  args.items = this.getDataByValues(this.value);
@@ -14140,7 +14208,11 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14140
14208
  else {
14141
14209
  args.items = this.getDataByValues([this.dragValue]);
14142
14210
  }
14211
+ extend(items, args.items);
14143
14212
  this.trigger('beforeDrop', args);
14213
+ if (args.items !== items) {
14214
+ this.customDraggedItem = args.items;
14215
+ }
14144
14216
  }
14145
14217
  dragEnd(args) {
14146
14218
  let listData;
@@ -14187,6 +14259,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14187
14259
  liColl.splice(toIdx, 0, liColl.splice(rIdx, 1)[0]);
14188
14260
  if (this.allowDragAll) {
14189
14261
  selectedOptions = this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 ? this.value : [dropValue];
14262
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14263
+ selectedOptions = [];
14264
+ this.customDraggedItem.forEach((item) => {
14265
+ selectedOptions.push(getValue(this.fields.value, item));
14266
+ });
14267
+ }
14190
14268
  selectedOptions.forEach((value) => {
14191
14269
  if (value !== dropValue) {
14192
14270
  const idx = listData.indexOf(this.getDataByValue(value));
@@ -14219,6 +14297,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14219
14297
  sortedData = [].slice.call(listObj.sortedData);
14220
14298
  selectedOptions = (this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 && this.allowDragAll)
14221
14299
  ? this.value : [dropValue];
14300
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14301
+ selectedOptions = [];
14302
+ this.customDraggedItem.forEach((item) => {
14303
+ selectedOptions.push(getValue(this.fields.value, item));
14304
+ });
14305
+ }
14222
14306
  const fListData = [].slice.call(this.listData);
14223
14307
  const fSortData = [].slice.call(this.sortedData);
14224
14308
  selectedOptions.forEach((value, index) => {
@@ -14289,6 +14373,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14289
14373
  const dragArgs1 = extend(destArgs, { currentData: listData });
14290
14374
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
14291
14375
  }
14376
+ if (!isNullOrUndefined(this.customDraggedItem)) {
14377
+ dragArgs.items = this.customDraggedItem;
14378
+ }
14292
14379
  this.trigger('drop', dragArgs);
14293
14380
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14294
14381
  const liCollElem = dragArgs.elements;
@@ -14546,6 +14633,26 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14546
14633
  const elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
14547
14634
  this.moveUpDown(false, false, elem);
14548
14635
  }
14636
+ /**
14637
+ * Moves the given value(s) / selected value(s) in Top of the list.
14638
+ *
14639
+ * @param { string[] | number[] | boolean[] } value - Specifies the value(s).
14640
+ * @returns {void}
14641
+ */
14642
+ moveTop(value) {
14643
+ const elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
14644
+ this.moveUpDown(null, false, elem, true);
14645
+ }
14646
+ /**
14647
+ * Moves the given value(s) / selected value(s) in bottom of the list.
14648
+ *
14649
+ * @param { string[] | number[] | boolean[] } value - Specifies the value(s).
14650
+ * @returns {void}
14651
+ */
14652
+ moveBottom(value) {
14653
+ const elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
14654
+ this.moveUpDown(true, false, elem, false, true);
14655
+ }
14549
14656
  /**
14550
14657
  * Moves the given value(s) / selected value(s) to the given / default scoped ListBox.
14551
14658
  *
@@ -14991,7 +15098,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14991
15098
  }
14992
15099
  }
14993
15100
  }
14994
- moveUpDown(isUp, isKey, value) {
15101
+ moveUpDown(isUp, isKey, value, isTop, isBottom) {
14995
15102
  let elems = this.getSelectedItems();
14996
15103
  if (value) {
14997
15104
  elems = value;
@@ -15009,8 +15116,18 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15009
15116
  (isUp ? elems : elems.reverse()).forEach((ele) => {
15010
15117
  const jsonToIdx = Array.prototype.indexOf.call(this.ulElement.querySelectorAll('.e-list-item'), ele);
15011
15118
  const idx = Array.prototype.indexOf.call(this.ulElement.children, ele);
15012
- moveTo(this.ulElement, this.ulElement, [idx], isUp ? idx - 1 : idx + 2);
15013
- this.changeData(idx, isUp ? idx - 1 : idx + 1, isUp ? jsonToIdx - 1 : jsonToIdx + 1, ele);
15119
+ if (isTop) {
15120
+ moveTo(this.ulElement, this.ulElement, [idx], 0);
15121
+ this.changeData(idx, 0, jsonToIdx, ele);
15122
+ }
15123
+ else if (isBottom) {
15124
+ moveTo(this.ulElement, this.ulElement, [idx], this.ulElement.querySelectorAll('.e-list-item').length);
15125
+ this.changeData(idx, this.ulElement.querySelectorAll('.e-list-item').length, jsonToIdx, ele);
15126
+ }
15127
+ else {
15128
+ moveTo(this.ulElement, this.ulElement, [idx], isUp ? idx - 1 : idx + 2);
15129
+ this.changeData(idx, isUp ? idx - 1 : idx + 1, isUp ? jsonToIdx - 1 : jsonToIdx + 1, ele);
15130
+ }
15014
15131
  });
15015
15132
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
15016
15133
  elems[0].focus();