@syncfusion/ej2-dropdowns 25.1.37 → 25.1.40

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.
@@ -185,6 +185,10 @@ function resetIncrementalSearchValues(elementId) {
185
185
  * @returns {void}
186
186
  */
187
187
  function highlightSearch(element, query, ignoreCase, type) {
188
+ const isHtmlElement = /<[^>]*>/g.test(element.innerText);
189
+ if (isHtmlElement) {
190
+ element.innerText = element.innerText.replace(/[\u00A0-\u9999<>&]/g, (match) => `&#${match.charCodeAt(0)};`);
191
+ }
188
192
  if (query === '') {
189
193
  return;
190
194
  }
@@ -423,10 +427,8 @@ class VirtualScroll {
423
427
  this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(reOrderList);
424
428
  }
425
429
  var query = this.parent.getForQuery(this.parent.value).clone();
426
- if (!this.parent.allowFiltering) { //need to check with allowFiltering false
427
- var skipvalue = this.parent.viewPortInfo.startIndex - this.parent.value.length >= 0 ? this.parent.viewPortInfo.startIndex - this.parent.value.length : 0;
428
- query = query.skip(skipvalue);
429
- }
430
+ var skipvalue = this.parent.viewPortInfo.startIndex - this.parent.value.length >= 0 ? this.parent.viewPortInfo.startIndex - this.parent.value.length : 0;
431
+ query = query.skip(skipvalue);
430
432
  this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
431
433
  isListUpdated = false;
432
434
  }
@@ -587,7 +589,9 @@ class VirtualScroll {
587
589
  if (this.parent.keyboardEvent != null) {
588
590
  this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
589
591
  }
590
- this.parent.isCustomFilter = false;
592
+ if (!this.parent.customFilterQuery) {
593
+ this.parent.isCustomFilter = false;
594
+ }
591
595
  });
592
596
  }
593
597
  scrollListener(scrollArgs) {
@@ -824,6 +828,9 @@ let DropDownBase = class DropDownBase extends Component {
824
828
  this.incrementalPreQueryString = '';
825
829
  this.isObjectCustomValue = false;
826
830
  this.appendUncheckList = false;
831
+ this.getInitialData = false;
832
+ this.preventPopupOpen = true;
833
+ this.customFilterQuery = new Query();
827
834
  this.virtualListInfo = {
828
835
  currentPageNumber: null,
829
836
  direction: null,
@@ -1135,6 +1142,7 @@ let DropDownBase = class DropDownBase extends Component {
1135
1142
  const actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
1136
1143
  this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
1137
1144
  this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
1145
+ this.virtualItemCount = this.itemCount;
1138
1146
  this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
1139
1147
  }
1140
1148
  GetVirtualTrackHeight() {
@@ -1228,6 +1236,7 @@ let DropDownBase = class DropDownBase extends Component {
1228
1236
  */
1229
1237
  initialize(e) {
1230
1238
  this.bindEvent = true;
1239
+ this.preventPopupOpen = true;
1231
1240
  this.actionFailureTemplateId = `${this.element.id}${ACTIONFAILURETEMPLATE_PROPERTY}`;
1232
1241
  if (this.element.tagName === 'UL') {
1233
1242
  const jsonElement = ListBase.createJsonFromElement(this.element);
@@ -1411,6 +1420,12 @@ let DropDownBase = class DropDownBase extends Component {
1411
1420
  }
1412
1421
  this.isRequested = false;
1413
1422
  this.bindChildItems(listItems, ulElement, fields, e);
1423
+ if (this.getInitialData) {
1424
+ this.setListData(dataSource, fields, query, event);
1425
+ this.getInitialData = false;
1426
+ this.preventPopupOpen = false;
1427
+ return;
1428
+ }
1414
1429
  }
1415
1430
  });
1416
1431
  }).catch((e) => {
@@ -1482,6 +1497,11 @@ let DropDownBase = class DropDownBase extends Component {
1482
1497
  this.renderGroupTemplate(ulElement);
1483
1498
  }
1484
1499
  this.bindChildItems(localDataArgs.result, ulElement, fields);
1500
+ if (this.getInitialData) {
1501
+ this.getInitialData = false;
1502
+ this.preventPopupOpen = false;
1503
+ return;
1504
+ }
1485
1505
  setTimeout(() => {
1486
1506
  if (this.getModuleName() === 'multiselect' && this.itemTemplate != null && (ulElement.childElementCount > 0 && (ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && ulElement.children[1] && ulElement.children[1].childElementCount > 0)))) {
1487
1507
  this.updateDataList();
@@ -1582,7 +1602,7 @@ let DropDownBase = class DropDownBase extends Component {
1582
1602
  onActionComplete(ulElement, list, e) {
1583
1603
  /* eslint-enable @typescript-eslint/no-unused-vars */
1584
1604
  this.listData = list;
1585
- if (this.isVirtualizationEnabled && !this.isCustomDataUpdated) {
1605
+ if (this.isVirtualizationEnabled && !this.isCustomDataUpdated && !this.virtualSelectAll) {
1586
1606
  this.notify("setGeneratedData", {
1587
1607
  module: "VirtualScroll",
1588
1608
  });
@@ -1804,6 +1824,9 @@ let DropDownBase = class DropDownBase extends Component {
1804
1824
  this.fixedHeaderElement.style.display = 'block';
1805
1825
  }
1806
1826
  getValidLi() {
1827
+ if (this.isVirtualizationEnabled) {
1828
+ return this.liCollections[0].classList.contains('e-virtual-list') ? this.liCollections[this.skeletonCount] : this.liCollections[0];
1829
+ }
1807
1830
  return this.liCollections[0];
1808
1831
  }
1809
1832
  /**
@@ -1878,7 +1901,7 @@ let DropDownBase = class DropDownBase extends Component {
1878
1901
  }
1879
1902
  this.updateListElements(listData);
1880
1903
  }
1881
- else if ((!virtualUlElement)) {
1904
+ else if ((!virtualUlElement) || (!virtualUlElement.firstChild)) {
1882
1905
  this.list.innerHTML = '';
1883
1906
  this.createVirtualContent();
1884
1907
  this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
@@ -2222,6 +2245,7 @@ let DropDownBase = class DropDownBase extends Component {
2222
2245
  }
2223
2246
  }
2224
2247
  const itemsCount = this.getItems().length;
2248
+ const isListboxEmpty = itemsCount === 0;
2225
2249
  const selectedItemValue = this.list.querySelector('.' + dropDownBaseClasses.selected);
2226
2250
  items = (items instanceof Array ? items : [items]);
2227
2251
  let index;
@@ -2256,11 +2280,24 @@ let DropDownBase = class DropDownBase extends Component {
2256
2280
  li.setAttribute('role', 'option');
2257
2281
  this.notify('addItem', { module: 'CheckBoxSelection', item: li });
2258
2282
  liCollections.push(li);
2259
- this.listData.push(item);
2283
+ if (this.getModuleName() === 'listbox') {
2284
+ this.listData.splice(isListboxEmpty ? this.listData.length : index, 0, item);
2285
+ if (this.listData.length !== this.sortedData.length) {
2286
+ this.sortedData = this.listData;
2287
+ }
2288
+ }
2289
+ else {
2290
+ this.listData.push(item);
2291
+ }
2260
2292
  if (this.sortOrder === 'None' && isNullOrUndefined(itemIndex) && index === 0) {
2261
2293
  index = null;
2262
2294
  }
2263
- this.updateActionCompleteData(li, item, index);
2295
+ if (this.getModuleName() === 'listbox') {
2296
+ this.updateActionCompleteData(li, item, isListboxEmpty ? null : index);
2297
+ }
2298
+ else {
2299
+ this.updateActionCompleteData(li, item, index);
2300
+ }
2264
2301
  //Listbox event
2265
2302
  this.trigger('beforeItemRender', { element: li, item: item });
2266
2303
  }
@@ -4123,6 +4160,10 @@ let DropDownList = class DropDownList extends DropDownBase {
4123
4160
  e.preventDefault();
4124
4161
  break;
4125
4162
  default:
4163
+ if (this.isFiltering() && this.getModuleName() === 'combobox' && isNullOrUndefined(this.list)) {
4164
+ this.getInitialData = true;
4165
+ this.renderList();
4166
+ }
4126
4167
  this.typedString = this.filterInput.value;
4127
4168
  this.preventAutoFill = false;
4128
4169
  this.searchLists(e);
@@ -4171,13 +4212,13 @@ let DropDownList = class DropDownList extends DropDownBase {
4171
4212
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
4172
4213
  filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
4173
4214
  }
4174
- else {
4215
+ else if (((this.getModuleName() !== 'combobox') || this.enableVirtualization) || (this.isFiltering() && this.getModuleName() === 'combobox' && this.typedString !== '')) {
4175
4216
  const fields = (this.fields.text) ? this.fields.text : '';
4176
4217
  filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
4177
4218
  }
4178
4219
  }
4179
4220
  else {
4180
- filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
4221
+ filterQuery = (this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery)) ? this.customFilterQuery.clone() : query ? query.clone() : this.query ? this.query.clone() : new Query();
4181
4222
  }
4182
4223
  if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
4183
4224
  var takeValue = this.getTakeValue();
@@ -4192,26 +4233,36 @@ let DropDownList = class DropDownList extends DropDownBase {
4192
4233
  }
4193
4234
  let queryTakeValue = 0;
4194
4235
  let querySkipValue = 0;
4195
- if (this.query && this.query.queries.length > 0) {
4196
- for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
4197
- if (this.query.queries[queryElements].fn === 'onSkip') {
4198
- querySkipValue = this.query.queries[queryElements].e.nos;
4236
+ if (filterQuery && filterQuery.queries.length > 0) {
4237
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
4238
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
4239
+ querySkipValue = filterQuery.queries[queryElements].e.nos;
4240
+ }
4241
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
4242
+ queryTakeValue = takeValue <= filterQuery.queries[queryElements].e.nos ? filterQuery.queries[queryElements].e.nos : takeValue;
4199
4243
  }
4244
+ }
4245
+ }
4246
+ if (queryTakeValue <= 0 && this.query && this.query.queries.length > 0) {
4247
+ for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
4200
4248
  if (this.query.queries[queryElements].fn === 'onTake') {
4201
4249
  queryTakeValue = takeValue <= this.query.queries[queryElements].e.nos ? this.query.queries[queryElements].e.nos : takeValue;
4202
4250
  }
4203
4251
  }
4204
4252
  }
4205
4253
  let skipExists = false;
4206
- let takeExists = false;
4207
4254
  if (filterQuery && filterQuery.queries.length > 0) {
4208
4255
  for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
4209
4256
  if (filterQuery.queries[queryElements].fn === 'onSkip') {
4210
- skipExists = true;
4257
+ querySkipValue = filterQuery.queries[queryElements].e.nos;
4258
+ filterQuery.queries.splice(queryElements, 1);
4259
+ --queryElements;
4260
+ continue;
4211
4261
  }
4212
4262
  if (filterQuery.queries[queryElements].fn === 'onTake') {
4213
- takeExists = true;
4214
- filterQuery.queries[queryElements].e.nos = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
4263
+ queryTakeValue = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
4264
+ filterQuery.queries.splice(queryElements, 1);
4265
+ --queryElements;
4215
4266
  }
4216
4267
  }
4217
4268
  }
@@ -4227,17 +4278,23 @@ let DropDownList = class DropDownList extends DropDownBase {
4227
4278
  filterQuery.take(this.incrementalEndIndex);
4228
4279
  }
4229
4280
  else {
4230
- if (!takeExists) {
4231
- if (queryTakeValue > 0) {
4232
- filterQuery.take(queryTakeValue);
4233
- }
4234
- else {
4235
- filterQuery.take(takeValue);
4236
- }
4281
+ if (queryTakeValue > 0) {
4282
+ filterQuery.take(queryTakeValue);
4283
+ }
4284
+ else {
4285
+ filterQuery.take(takeValue);
4237
4286
  }
4238
4287
  }
4239
4288
  filterQuery.requiresCount();
4240
4289
  }
4290
+ else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
4291
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
4292
+ if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
4293
+ filterQuery.queries.splice(queryElements, 1);
4294
+ --queryElements;
4295
+ }
4296
+ }
4297
+ }
4241
4298
  return filterQuery;
4242
4299
  }
4243
4300
  getSelectionPoints() {
@@ -4263,6 +4320,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4263
4320
  return;
4264
4321
  }
4265
4322
  this.isCustomFilter = true;
4323
+ this.customFilterQuery = query;
4266
4324
  this.filteringAction(dataSource, query, fields);
4267
4325
  },
4268
4326
  baseEventArgs: e,
@@ -4290,7 +4348,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4290
4348
  }
4291
4349
  filteringAction(dataSource, query, fields) {
4292
4350
  if (!isNullOrUndefined(this.filterInput)) {
4293
- this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?
4351
+ this.beforePopupOpen = ((!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') || this.getInitialData) ?
4294
4352
  false : true;
4295
4353
  let isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
4296
4354
  if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
@@ -4298,6 +4356,12 @@ let DropDownList = class DropDownList extends DropDownBase {
4298
4356
  this.isTyped = false;
4299
4357
  if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
4300
4358
  if (this.enableVirtualization) {
4359
+ if (this.isFiltering()) {
4360
+ this.isPreventScrollAction = true;
4361
+ this.list.scrollTop = 0;
4362
+ this.previousStartIndex = 0;
4363
+ this.virtualListInfo = null;
4364
+ }
4301
4365
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4302
4366
  this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4303
4367
  this.resetList(dataSource, fields, query);
@@ -4466,6 +4530,13 @@ let DropDownList = class DropDownList extends DropDownBase {
4466
4530
  this.isNotSearchList = false;
4467
4531
  return;
4468
4532
  }
4533
+ if (this.getInitialData) {
4534
+ this.updateActionCompleteDataValues(ulElement, list);
4535
+ }
4536
+ if (!this.preventPopupOpen && this.getModuleName() === 'combobox') {
4537
+ this.beforePopupOpen = true;
4538
+ this.preventPopupOpen = true;
4539
+ }
4469
4540
  let tempItemCount = this.itemCount;
4470
4541
  if (this.isActive || !isNullOrUndefined(ulElement)) {
4471
4542
  const selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
@@ -4643,7 +4714,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4643
4714
  else {
4644
4715
  this.actionCompleteData.ulElement.appendChild(li.cloneNode(true));
4645
4716
  }
4646
- if (this.isFiltering() && this.actionCompleteData.list.indexOf(item) < 0) {
4717
+ if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list.indexOf(item) < 0) {
4647
4718
  this.actionCompleteData.list.push(item);
4648
4719
  }
4649
4720
  }
@@ -4698,7 +4769,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4698
4769
  popupEle.setAttribute('aria-label', this.element.id);
4699
4770
  popupEle.setAttribute('role', 'dialog');
4700
4771
  const searchBox = this.setSearchBox(popupEle);
4701
- this.listContainerHeight = formatUnit(this.popupHeight);
4772
+ this.listContainerHeight = this.allowFiltering && this.getModuleName() === 'dropdownlist' && Browser.isDevice ? formatUnit(Math.round(window.outerHeight).toString() + 'px') : formatUnit(this.popupHeight);
4702
4773
  if (this.headerTemplate) {
4703
4774
  this.setHeaderTemplate(popupEle);
4704
4775
  }
@@ -4713,6 +4784,8 @@ let DropDownList = class DropDownList extends DropDownBase {
4713
4784
  this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) : 0;
4714
4785
  }
4715
4786
  if (this.enableVirtualization && !this.list.classList.contains(dropDownBaseClasses.noData)) {
4787
+ this.getSkeletonCount();
4788
+ this.skeletonCount = this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
4716
4789
  if (!this.list.querySelector('.e-virtual-ddl-content')) {
4717
4790
  this.list.appendChild(this.createElement('div', {
4718
4791
  className: 'e-virtual-ddl-content',
@@ -5017,7 +5090,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5017
5090
  const inputWidth = this.inputWrapper.container.offsetWidth * parseFloat(width) / 100;
5018
5091
  width = inputWidth.toString() + 'px';
5019
5092
  }
5020
- if (Browser.isDevice && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
5093
+ if (Browser.isDevice && (width.indexOf('px') > -1) && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
5021
5094
  (this.isDropDownClick && this.getModuleName() === 'combobox')))) {
5022
5095
  const firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
5023
5096
  width = (parseInt(width, 10) + (parseInt(getComputedStyle(firstItem).textIndent, 10) -
@@ -5315,7 +5388,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5315
5388
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5316
5389
  dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5317
5390
  }
5318
- if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
5391
+ if (this.enableVirtualization && this.isFiltering() && isFilterValue && this.totalItemCount !== dataSourceCount) {
5319
5392
  this.updateInitialData();
5320
5393
  this.checkAndResetCache();
5321
5394
  }
@@ -5436,7 +5509,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5436
5509
  this.setFields();
5437
5510
  this.inputWrapper.container.style.width = formatUnit(this.width);
5438
5511
  this.inputWrapper.container.classList.add('e-ddl');
5439
- if (this.floatLabelType === 'Auto') {
5512
+ if (this.floatLabelType !== 'Never') {
5440
5513
  Input.calculateWidth(this.inputElement, this.inputWrapper.container);
5441
5514
  }
5442
5515
  if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
@@ -6077,6 +6150,7 @@ let DropDownList = class DropDownList extends DropDownBase {
6077
6150
  }
6078
6151
  }
6079
6152
  this.isVirtualTrackHeight = false;
6153
+ this.customFilterQuery = null;
6080
6154
  this.closePopup(0, e);
6081
6155
  const dataItem = this.getItemData();
6082
6156
  let isSelectVal = !isNullOrUndefined(this.selectedLI);
@@ -6114,7 +6188,7 @@ let DropDownList = class DropDownList extends DropDownBase {
6114
6188
  }
6115
6189
  addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
6116
6190
  this.onFocus(e);
6117
- if (this.floatLabelType === 'Auto') {
6191
+ if (this.floatLabelType !== 'Never') {
6118
6192
  Input.calculateWidth(this.inputElement, this.inputWrapper.container);
6119
6193
  }
6120
6194
  }
@@ -6136,7 +6210,7 @@ let DropDownList = class DropDownList extends DropDownBase {
6136
6210
  this.targetElement().blur();
6137
6211
  }
6138
6212
  removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
6139
- if (this.floatLabelType === 'Auto' && this.inputElement.value === '') {
6213
+ if (this.floatLabelType !== 'Never') {
6140
6214
  Input.calculateWidth(this.inputElement, this.inputWrapper.container);
6141
6215
  }
6142
6216
  }
@@ -6187,17 +6261,18 @@ let DropDownList = class DropDownList extends DropDownBase {
6187
6261
  detach(this.inputWrapper.container);
6188
6262
  }
6189
6263
  this.hiddenElement = null;
6264
+ this.filterInput = null;
6190
6265
  this.inputWrapper = null;
6191
6266
  this.keyboardModule = null;
6192
6267
  this.ulElement = null;
6193
6268
  this.list = null;
6269
+ this.clearIconElement = null;
6194
6270
  this.popupObj = null;
6195
6271
  this.popupContentElement = null;
6196
6272
  this.rippleFun = null;
6197
6273
  this.selectedLI = null;
6198
6274
  this.liCollections = null;
6199
6275
  this.item = null;
6200
- this.inputWrapper = null;
6201
6276
  this.footer = null;
6202
6277
  this.header = null;
6203
6278
  this.previousSelectedLI = null;
@@ -6214,9 +6289,8 @@ let DropDownList = class DropDownList extends DropDownBase {
6214
6289
  floatLabelType: this.floatLabelType,
6215
6290
  properties: this.properties
6216
6291
  }, this.clearButton);
6217
- if (this.isAngular) {
6218
- this.inputElement = null;
6219
- }
6292
+ this.clearButton = null;
6293
+ this.inputElement = null;
6220
6294
  super.destroy();
6221
6295
  }
6222
6296
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -6714,7 +6788,7 @@ let DropDownTree = class DropDownTree extends Component {
6714
6788
  cancel: false,
6715
6789
  preventDefaultAction: false,
6716
6790
  event: event,
6717
- text: value,
6791
+ text: value.trim(),
6718
6792
  fields: filterFields
6719
6793
  };
6720
6794
  this.trigger('filtering', args, (args) => {
@@ -6722,7 +6796,7 @@ let DropDownTree = class DropDownTree extends Component {
6722
6796
  let flag = false;
6723
6797
  let fields;
6724
6798
  this.isFilteredData = true;
6725
- if (value === '') {
6799
+ if (args.text === '') {
6726
6800
  this.isFilteredData = false;
6727
6801
  this.isFilterRestore = true;
6728
6802
  this.isFromFilterChange = false;
@@ -6733,18 +6807,18 @@ let DropDownTree = class DropDownTree extends Component {
6733
6807
  }
6734
6808
  else {
6735
6809
  if (this.treeDataType === 1) {
6736
- fields = this.selfReferencefilter(value, args.fields);
6810
+ fields = this.selfReferencefilter(args.text, args.fields);
6737
6811
  }
6738
6812
  else {
6739
6813
  if (this.fields.dataSource instanceof DataManager) {
6740
- fields = this.remoteDataFilter(value, args.fields);
6814
+ fields = this.remoteDataFilter(args.text, args.fields);
6741
6815
  fields.child = this.fields.child;
6742
6816
  this.treeObj.fields = this.getTreeFields(args.fields);
6743
6817
  this.treeObj.dataBind();
6744
6818
  flag = true;
6745
6819
  }
6746
6820
  else {
6747
- fields = this.nestedFilter(value, args.fields);
6821
+ fields = this.nestedFilter(args.text, args.fields);
6748
6822
  }
6749
6823
  }
6750
6824
  }
@@ -7412,12 +7486,12 @@ let DropDownTree = class DropDownTree extends Component {
7412
7486
  createHiddenElement() {
7413
7487
  if (this.allowMultiSelection || this.showCheckBox) {
7414
7488
  this.hiddenElement = this.createElement('select', {
7415
- attrs: { 'aria-hidden': 'true', 'class': HIDDENELEMENT, 'tabindex': '-1', 'multiple': '' }
7489
+ attrs: { 'aria-hidden': 'true', 'class': HIDDENELEMENT, 'tabindex': '-1', 'multiple': '', 'aria-label': this.getModuleName() }
7416
7490
  });
7417
7491
  }
7418
7492
  else {
7419
7493
  this.hiddenElement = this.createElement('select', {
7420
- attrs: { 'aria-hidden': 'true', 'tabindex': '-1', 'class': HIDDENELEMENT }
7494
+ attrs: { 'aria-hidden': 'true', 'tabindex': '-1', 'class': HIDDENELEMENT, 'aria-label': this.getModuleName() }
7421
7495
  });
7422
7496
  }
7423
7497
  prepend([this.hiddenElement], this.inputWrapper);
@@ -7561,9 +7635,11 @@ let DropDownTree = class DropDownTree extends Component {
7561
7635
  }
7562
7636
  setAttributes() {
7563
7637
  this.inputEle.setAttribute('tabindex', '-1');
7638
+ this.inputEle.setAttribute('aria-label', this.getModuleName());
7564
7639
  const id = this.element.getAttribute('id');
7565
7640
  this.hiddenElement.id = id + '_hidden';
7566
7641
  this.inputWrapper.setAttribute('tabindex', '0');
7642
+ this.inputWrapper.setAttribute('aria-label', this.getModuleName());
7567
7643
  attributes(this.inputWrapper, this.getAriaAttributes());
7568
7644
  }
7569
7645
  setHTMLAttributes() {
@@ -7905,7 +7981,12 @@ let DropDownTree = class DropDownTree extends Component {
7905
7981
  focusedElement.setAttribute('tabindex', '0');
7906
7982
  }
7907
7983
  else {
7908
- focusedElement = this.treeObj.element.querySelector('li');
7984
+ let oldFocussedNode = this.treeObj.element.querySelector('.e-node-focus');
7985
+ focusedElement = this.treeObj.element.querySelector('li:not(.e-disable):not(.e-prevent)');
7986
+ if (oldFocussedNode && oldFocussedNode != focusedElement) {
7987
+ oldFocussedNode.setAttribute('tabindex', '-1');
7988
+ removeClass([oldFocussedNode], 'e-node-focus');
7989
+ }
7909
7990
  }
7910
7991
  focusedElement.focus();
7911
7992
  addClass([focusedElement], ['e-node-focus']);
@@ -8752,7 +8833,12 @@ let DropDownTree = class DropDownTree extends Component {
8752
8833
  }
8753
8834
  setFooterTemplate() {
8754
8835
  if (this.footer) {
8755
- this.footer.innerHTML = '';
8836
+ if (this.isReact && typeof this.footerTemplate === 'function') {
8837
+ this.clearTemplate(['footerTemplate']);
8838
+ }
8839
+ else {
8840
+ this.footer.innerHTML = '';
8841
+ }
8756
8842
  }
8757
8843
  else {
8758
8844
  this.footer = this.createElement('div');
@@ -9954,7 +10040,7 @@ let ComboBox = class ComboBox extends DropDownList {
9954
10040
  }
9955
10041
  }
9956
10042
  setValue(e) {
9957
- if (e && e.type === 'keydown' && e.action === 'enter') {
10043
+ if ((e && e.type === 'keydown' && e.action === 'enter') || (e && e.type === 'click')) {
9958
10044
  this.removeFillSelection();
9959
10045
  }
9960
10046
  if (this.autofill && this.getModuleName() === 'combobox' && e && e.type === 'keydown' && e.action !== 'enter') {
@@ -10079,7 +10165,7 @@ let ComboBox = class ComboBox extends DropDownList {
10079
10165
  this.preventAutoFill = this.inputElement.value === '' ? false : this.preventAutoFill;
10080
10166
  this.setAutoFill(activeElement, isKeyNavigate);
10081
10167
  }
10082
- else if (this.inputElement.value === '') {
10168
+ else if (!isNullOrUndefined(this.inputElement) && this.inputElement.value === '') {
10083
10169
  this.activeIndex = null;
10084
10170
  if (!isNullOrUndefined(this.list)) {
10085
10171
  if (!this.enableVirtualization) {
@@ -10332,9 +10418,6 @@ let ComboBox = class ComboBox extends DropDownList {
10332
10418
  render() {
10333
10419
  super.render();
10334
10420
  this.setSearchBox();
10335
- if (this.isFiltering() && this.getModuleName() === 'combobox' && isNullOrUndefined(this.list)) {
10336
- super.renderList();
10337
- }
10338
10421
  this.renderComplete();
10339
10422
  }
10340
10423
  /**
@@ -10627,12 +10710,17 @@ let AutoComplete = class AutoComplete extends ComboBox {
10627
10710
  return 'EJS-AUTOCOMPLETE';
10628
10711
  }
10629
10712
  getQuery(query) {
10630
- const filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
10713
+ let filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
10631
10714
  let value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
10632
10715
  const filterType = (this.queryString === '' && !isNullOrUndefined(value)) ? 'equal' : this.filterType;
10633
10716
  const queryString = (this.queryString === '' && !isNullOrUndefined(value)) ? value : this.queryString;
10634
10717
  if (this.isFiltered) {
10635
- return filterQuery;
10718
+ if ((this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery))) {
10719
+ filterQuery = this.customFilterQuery.clone();
10720
+ }
10721
+ else if (!this.enableVirtualization) {
10722
+ return filterQuery;
10723
+ }
10636
10724
  }
10637
10725
  if (this.queryString !== null && this.queryString !== '') {
10638
10726
  const dataType = this.typeOfData(this.dataSource).typeof;
@@ -10658,48 +10746,61 @@ let AutoComplete = class AutoComplete extends ComboBox {
10658
10746
  if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
10659
10747
  let queryTakeValue = 0;
10660
10748
  let querySkipValue = 0;
10661
- if (this.query && this.query.queries.length > 0) {
10662
- for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
10663
- if (this.query.queries[queryElements].fn === 'onSkip') {
10664
- querySkipValue = this.query.queries[queryElements].e.nos;
10749
+ var takeValue = this.getTakeValue();
10750
+ if (filterQuery && filterQuery.queries.length > 0) {
10751
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
10752
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
10753
+ querySkipValue = filterQuery.queries[queryElements].e.nos;
10665
10754
  }
10755
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
10756
+ queryTakeValue = takeValue <= filterQuery.queries[queryElements].e.nos ? filterQuery.queries[queryElements].e.nos : takeValue;
10757
+ }
10758
+ }
10759
+ }
10760
+ if (queryTakeValue <= 0 && this.query && this.query.queries.length > 0) {
10761
+ for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
10666
10762
  if (this.query.queries[queryElements].fn === 'onTake') {
10667
10763
  queryTakeValue = takeValue <= this.query.queries[queryElements].e.nos ? this.query.queries[queryElements].e.nos : takeValue;
10668
10764
  }
10669
10765
  }
10670
10766
  }
10671
- let skipExists = false;
10672
- let takeExists = false;
10673
10767
  if (filterQuery && filterQuery.queries.length > 0) {
10674
10768
  for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
10675
10769
  if (filterQuery.queries[queryElements].fn === 'onSkip') {
10676
- skipExists = true;
10770
+ querySkipValue = filterQuery.queries[queryElements].e.nos;
10771
+ filterQuery.queries.splice(queryElements, 1);
10772
+ --queryElements;
10773
+ continue;
10677
10774
  }
10678
10775
  if (filterQuery.queries[queryElements].fn === 'onTake') {
10679
- takeExists = true;
10680
- filterQuery.queries[queryElements].e.nos = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
10776
+ queryTakeValue = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
10777
+ filterQuery.queries.splice(queryElements, 1);
10778
+ --queryElements;
10681
10779
  }
10682
10780
  }
10683
10781
  }
10684
- var takeValue = this.getTakeValue();
10685
- if (!skipExists) {
10686
- if (querySkipValue > 0 && this.virtualItemStartIndex <= querySkipValue) {
10687
- filterQuery.skip(querySkipValue);
10688
- }
10689
- else {
10690
- filterQuery.skip(this.virtualItemStartIndex);
10691
- }
10782
+ if (querySkipValue > 0 && this.virtualItemStartIndex <= querySkipValue) {
10783
+ filterQuery.skip(querySkipValue);
10692
10784
  }
10693
- if (!takeExists) {
10694
- if (queryTakeValue > 0 && takeValue <= queryTakeValue) {
10695
- filterQuery.take(queryTakeValue);
10696
- }
10697
- else {
10698
- filterQuery.take(takeValue);
10699
- }
10785
+ else {
10786
+ filterQuery.skip(this.virtualItemStartIndex);
10787
+ }
10788
+ if (queryTakeValue > 0 && takeValue <= queryTakeValue) {
10789
+ filterQuery.take(queryTakeValue);
10790
+ }
10791
+ else {
10792
+ filterQuery.take(takeValue);
10700
10793
  }
10701
10794
  filterQuery.requiresCount();
10702
10795
  }
10796
+ else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
10797
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
10798
+ if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
10799
+ filterQuery.queries.splice(queryElements, 1);
10800
+ --queryElements;
10801
+ }
10802
+ }
10803
+ }
10703
10804
  return filterQuery;
10704
10805
  }
10705
10806
  searchLists(e) {
@@ -10727,6 +10828,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
10727
10828
  return;
10728
10829
  }
10729
10830
  this.isFiltered = true;
10831
+ this.customFilterQuery = query;
10730
10832
  this.filterAction(dataSource, query, fields);
10731
10833
  },
10732
10834
  cancel: false
@@ -10856,10 +10958,6 @@ let AutoComplete = class AutoComplete extends ComboBox {
10856
10958
  }, 0);
10857
10959
  }
10858
10960
  else {
10859
- const isHtmlElement = /<[^>]*>/g.test(e.item.innerText);
10860
- if (isHtmlElement) {
10861
- e.item.innerText = e.item.innerText.replace(/[\u00A0-\u9999<>&]/g, (match) => `&#${match.charCodeAt(0)};`);
10862
- }
10863
10961
  highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
10864
10962
  }
10865
10963
  }
@@ -11002,11 +11100,12 @@ let AutoComplete = class AutoComplete extends ComboBox {
11002
11100
  renderHightSearch() {
11003
11101
  if (this.highlight) {
11004
11102
  for (let i = 0; i < this.liCollections.length; i++) {
11005
- const isHighlight = this.ulElement.querySelector('.e-active');
11103
+ let isHighlight = this.ulElement.querySelector('.e-active');
11006
11104
  if (!isHighlight) {
11007
11105
  revertHighlightSearch(this.liCollections[i]);
11008
11106
  highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
11009
11107
  }
11108
+ isHighlight = null;
11010
11109
  }
11011
11110
  }
11012
11111
  }
@@ -11480,7 +11579,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11480
11579
  attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
11481
11580
  this.updateAriaActiveDescendant();
11482
11581
  if (this.isFirstClick) {
11483
- if (this.enableVirtualization && this.mode === 'CheckBox' && this.value) {
11582
+ if (this.enableVirtualization && this.mode === 'CheckBox' && this.value && this.enableSelectionOrder) {
11484
11583
  this.updateVirtualReOrderList();
11485
11584
  }
11486
11585
  this.loadTemplate();
@@ -11550,9 +11649,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11550
11649
  }
11551
11650
  if (this.enableVirtualization) {
11552
11651
  const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
11553
- if (focusedItem) {
11554
- this.scrollBottom(focusedItem);
11555
- }
11652
+ this.scrollBottom(focusedItem);
11556
11653
  }
11557
11654
  }
11558
11655
  focusAtFirstListItem() {
@@ -11923,7 +12020,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11923
12020
  && (this.mode === 'CheckBox' && this.showSelectAll))) || (this.enableVirtualization && this.mode === 'CheckBox' && this.showSelectAll && this.virtualSelectAll && this.value && this.value.length === this.totalItemCount)) {
11924
12021
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'check' });
11925
12022
  }
11926
- else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll)) {
12023
+ else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll) && ((!this.enableVirtualization) || (this.enableVirtualization && !this.virtualSelectAll))) {
11927
12024
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
11928
12025
  }
11929
12026
  if (this.enableGroupCheckBox && this.fields.groupBy && !this.enableSelectionOrder) {
@@ -11982,9 +12079,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11982
12079
  this.dataUpdater(dataSource, query, fields);
11983
12080
  }
11984
12081
  getQuery(query) {
11985
- const filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
12082
+ let filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
11986
12083
  if (this.isFiltered) {
11987
- return filterQuery;
12084
+ if ((this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery))) {
12085
+ filterQuery = this.customFilterQuery.clone();
12086
+ }
12087
+ else if (!this.enableVirtualization) {
12088
+ return filterQuery;
12089
+ }
11988
12090
  }
11989
12091
  if (this.filterAction) {
11990
12092
  if ((this.targetElement() !== null && !this.enableVirtualization) || (this.enableVirtualization && this.targetElement() !== null && this.targetElement().trim() !== '')) {
@@ -12006,6 +12108,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12006
12108
  if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
12007
12109
  return this.virtualFilterQuery(filterQuery);
12008
12110
  }
12111
+ else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
12112
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
12113
+ if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
12114
+ filterQuery.queries.splice(queryElements, 1);
12115
+ --queryElements;
12116
+ }
12117
+ }
12118
+ return filterQuery;
12119
+ }
12009
12120
  return query ? query : this.query ? this.query : new Query();
12010
12121
  }
12011
12122
  }
@@ -12013,7 +12124,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12013
12124
  var takeValue = this.getTakeValue();
12014
12125
  var isReOrder = true;
12015
12126
  var isSkip = true;
12016
- var isTake = true;
12017
12127
  for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
12018
12128
  if (this.getModuleName() === 'multiselect' && ((filterQuery.queries[queryElements].e && filterQuery.queries[queryElements].e.condition == 'or') || (filterQuery.queries[queryElements].e && filterQuery.queries[queryElements].e.operator == 'equal'))) {
12019
12129
  isReOrder = false;
@@ -12022,7 +12132,31 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12022
12132
  isSkip = false;
12023
12133
  }
12024
12134
  if (filterQuery.queries[queryElements].fn === 'onTake') {
12025
- isTake = false;
12135
+
12136
+ }
12137
+ }
12138
+ let queryTakeValue = 0;
12139
+ if (filterQuery && filterQuery.queries.length > 0) {
12140
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
12141
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
12142
+ queryTakeValue = takeValue <= filterQuery.queries[queryElements].e.nos ? filterQuery.queries[queryElements].e.nos : takeValue;
12143
+ }
12144
+ }
12145
+ }
12146
+ if (queryTakeValue <= 0 && this.query && this.query.queries.length > 0) {
12147
+ for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
12148
+ if (this.query.queries[queryElements].fn === 'onTake') {
12149
+ queryTakeValue = takeValue <= this.query.queries[queryElements].e.nos ? this.query.queries[queryElements].e.nos : takeValue;
12150
+ }
12151
+ }
12152
+ }
12153
+ if (filterQuery && filterQuery.queries.length > 0) {
12154
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
12155
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
12156
+ queryTakeValue = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
12157
+ filterQuery.queries.splice(queryElements, 1);
12158
+ --queryElements;
12159
+ }
12026
12160
  }
12027
12161
  }
12028
12162
  if ((this.allowFiltering && isSkip) || !isReOrder || (!this.allowFiltering && isSkip)) {
@@ -12033,13 +12167,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12033
12167
  filterQuery.skip(this.virtualItemStartIndex);
12034
12168
  }
12035
12169
  }
12036
- if (isTake) {
12037
- if (this.isIncrementalRequest) {
12038
- filterQuery.take(this.incrementalEndIndex);
12039
- }
12040
- else {
12041
- filterQuery.take(takeValue);
12042
- }
12170
+ if (this.isIncrementalRequest) {
12171
+ filterQuery.take(this.incrementalEndIndex);
12172
+ }
12173
+ else if (queryTakeValue > 0) {
12174
+ filterQuery.take(queryTakeValue);
12175
+ }
12176
+ else {
12177
+ filterQuery.take(takeValue);
12043
12178
  }
12044
12179
  filterQuery.requiresCount();
12045
12180
  return filterQuery;
@@ -12362,7 +12497,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12362
12497
  parseInt(getComputedStyle(this.dropIcon).marginRight);
12363
12498
  elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
12364
12499
  }
12365
- if (this.floatLabelType === 'Auto') {
12500
+ if (this.floatLabelType !== 'Never') {
12366
12501
  Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
12367
12502
  }
12368
12503
  }
@@ -13603,7 +13738,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13603
13738
  let currentText = [];
13604
13739
  const value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) : this.value[this.value.length - 1];
13605
13740
  temp = this.getTextByValue(value);
13606
- var textValues = this.text != null ? this.text + ',' + temp : temp;
13741
+ var textValues = this.text != null && this.text != "" ? this.text + ',' + temp : temp;
13607
13742
  currentText.push(textValues);
13608
13743
  this.setProperties({ text: currentText.toString() }, true);
13609
13744
  }
@@ -14252,6 +14387,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14252
14387
  return;
14253
14388
  }
14254
14389
  this.isFiltered = true;
14390
+ this.customFilterQuery = query;
14255
14391
  this.remoteFilterAction = true;
14256
14392
  this.dataUpdater(dataSource, query, fields);
14257
14393
  },
@@ -14540,7 +14676,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14540
14676
  (element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&
14541
14677
  (this.mode === 'Box' || this.mode === 'Default'))) || (this.enableVirtualization && value != null && text != null && !isCustomData)) {
14542
14678
  let currentText = [];
14543
- var textValues = this.text != null ? this.text + ',' + text : text;
14679
+ var textValues = this.text != null && this.text != "" ? this.text + ',' + text : text;
14544
14680
  currentText.push(textValues);
14545
14681
  this.setProperties({ text: currentText.toString() }, true);
14546
14682
  this.addChip(text, value);
@@ -14568,7 +14704,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14568
14704
  this.wireListEvents();
14569
14705
  }
14570
14706
  let currentText = [];
14571
- var textValues = this.text != null ? this.text + ',' + text : text;
14707
+ var textValues = this.text != null && this.text != "" ? this.text + ',' + text : text;
14572
14708
  currentText.push(textValues);
14573
14709
  this.setProperties({ text: currentText.toString() }, true);
14574
14710
  this.addChip(text, value);
@@ -15435,7 +15571,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15435
15571
  if (this.enableVirtualization) {
15436
15572
  if (state) {
15437
15573
  this.virtualSelectAll = true;
15438
- this.resetList(this.dataSource, this.fields, new Query().skip(this.viewPortInfo.startIndex));
15574
+ this.resetList(this.dataSource, this.fields, new Query());
15439
15575
  if (this.virtualSelectAllData instanceof Array) {
15440
15576
  for (var i = 0; i < this.virtualSelectAllData.length; i++) {
15441
15577
  if (li[this.skeletonCount + i]) {
@@ -15505,8 +15641,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15505
15641
  }
15506
15642
  this.value = [];
15507
15643
  this.virtualSelectAll = false;
15508
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15509
- let ulElement = this.renderItems(this.listData, this.fields);
15644
+ if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
15645
+ this.notify("setCurrentViewDataAsync", {
15646
+ component: this.getModuleName(),
15647
+ module: "VirtualScroll",
15648
+ });
15649
+ }
15510
15650
  }
15511
15651
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15512
15652
  const virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
@@ -15990,6 +16130,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15990
16130
  duration: 100,
15991
16131
  delay: delay ? delay : 0
15992
16132
  };
16133
+ this.customFilterQuery = null;
15993
16134
  const eventArgs = { popup: this.popupObj, cancel: false, animation: animModel, event: e || null };
15994
16135
  this.trigger('close', eventArgs, (eventArgs) => {
15995
16136
  if (!eventArgs.cancel) {
@@ -16012,7 +16153,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16012
16153
  if (this.mode === 'CheckBox' && this.showSelectAll) {
16013
16154
  EventHandler.remove(this.popupObj.element, 'click', this.clickHandler);
16014
16155
  }
16015
- if (this.enableVirtualization && this.mode === 'CheckBox') {
16156
+ if (this.enableVirtualization && this.mode === 'CheckBox' && this.enableSelectionOrder) {
16016
16157
  this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
16017
16158
  this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
16018
16159
  this.previousStartIndex = 0;
@@ -17440,7 +17581,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
17440
17581
  }
17441
17582
  }
17442
17583
  updateActionCompleteData(li, item, index) {
17443
- this.jsonData.splice(index, 0, item);
17584
+ this.jsonData.splice(index === null ? this.jsonData.length : index, 0, item);
17444
17585
  }
17445
17586
  initToolbar() {
17446
17587
  const pos = this.toolbarSettings.position;
@@ -17708,12 +17849,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
17708
17849
  else {
17709
17850
  scrollParent = wrapper;
17710
17851
  }
17711
- boundRect = scrollParent.getBoundingClientRect();
17712
- if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
17713
- this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
17714
- }
17715
- else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
17716
- this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
17852
+ if (scrollParent) {
17853
+ boundRect = scrollParent.getBoundingClientRect();
17854
+ if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
17855
+ this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
17856
+ }
17857
+ else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
17858
+ this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
17859
+ }
17717
17860
  }
17718
17861
  }
17719
17862
  if (args.target === null) {
@@ -18131,6 +18274,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18131
18274
  if (this.listData.length === 0) {
18132
18275
  this.l10nUpdate();
18133
18276
  }
18277
+ if (this.listData.length !== this.sortedData.length) {
18278
+ this.sortedData = this.listData;
18279
+ }
18134
18280
  this.value = [];
18135
18281
  this.updateToolBarState();
18136
18282
  }
@@ -18839,6 +18985,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18839
18985
  const jsonData = [].slice.call(tListBox.jsonData);
18840
18986
  const isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
18841
18987
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
18988
+ const tempLiColl = [];
18989
+ const tempData = [];
18990
+ let flistboxarray = [];
18842
18991
  this.removeSelected(fListBox, fListBox.getSelectedItems());
18843
18992
  const tempItems = [].slice.call(fListBox.listData);
18844
18993
  const localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
@@ -18858,23 +19007,40 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18858
19007
  fListBox.ulElement.removeChild(noRecElem);
18859
19008
  }
18860
19009
  }
18861
- moveTo(fListBox.ulElement, tListBox.ulElement,
18862
- // eslint-disable-next-line prefer-spread
18863
- Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number), index);
19010
+ if (fListBox.listData.length > 0) {
19011
+ // eslint-disable-next-line prefer-spread
19012
+ flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
19013
+ }
19014
+ for (let i = 0; i < fListBox.ulElement.childElementCount; i++) {
19015
+ if (fListBox.ulElement.childNodes[i].classList.contains('e-disabled')) {
19016
+ flistboxarray = flistboxarray.filter(function (item) { return item !== i; });
19017
+ tempLiColl.push(fListBox.ulElement.childNodes[i]);
19018
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19019
+ tempData.push(fListBox.listData[i]);
19020
+ }
19021
+ }
19022
+ moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
18864
19023
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
18865
19024
  if (isKey) {
18866
19025
  this.list.focus();
18867
19026
  }
18868
19027
  index = (index) ? index : listData.length;
18869
- for (let i = 0; i < fListBox.listData.length; i++) {
18870
- listData.splice(index + i, 0, fListBox.listData[i]);
19028
+ for (let i = 0; i < flistboxarray.length; i++) {
19029
+ listData.splice(index + i, 0, fListBox.listData[flistboxarray[i]]);
18871
19030
  }
18872
- for (let i = 0; i < fListBox.jsonData.length; i++) {
18873
- jsonData.splice(index + i, 0, fListBox.jsonData[i]);
19031
+ for (let i = 0; i < flistboxarray.length; i++) {
19032
+ jsonData.splice(index + i, 0, fListBox.jsonData[flistboxarray[i]]);
19033
+ }
19034
+ let fliCollections = [];
19035
+ if (tempLiColl.length > 0) {
19036
+ fListBox.liCollections = tempLiColl;
19037
+ fliCollections = [].slice.call(fListBox.liCollections);
19038
+ }
19039
+ else {
19040
+ fliCollections = [].slice.call(fListBox.liCollections);
19041
+ fListBox.liCollections = [];
18874
19042
  }
18875
- const fliCollections = [].slice.call(fListBox.liCollections);
18876
19043
  const tliCollections = [].slice.call(tListBox.liCollections);
18877
- fListBox.liCollections = [];
18878
19044
  if (index) {
18879
19045
  const toColl = tliCollections.splice(0, index);
18880
19046
  tListBox.liCollections = toColl.concat(fliCollections).concat(tliCollections);
@@ -18894,7 +19060,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18894
19060
  }
18895
19061
  tListBox.listData = listData;
18896
19062
  if (fListBox.listData.length === fListBox.jsonData.length) {
18897
- fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
19063
+ fListBox.listData = fListBox.sortedData = fListBox.jsonData = tempData;
18898
19064
  }
18899
19065
  else if (fListBox.allowFiltering) {
18900
19066
  for (let i = 0; i < fListBox.listData.length; i++) {
@@ -18915,6 +19081,11 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18915
19081
  tListBox.sortedData = listData;
18916
19082
  }
18917
19083
  fListBox.updateSelectedOptions();
19084
+ if (tempLiColl.length > 0) {
19085
+ const wrap = this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
19086
+ const btn = wrap.querySelector('[data-value="' + this.toolbarAction + '"]');
19087
+ btn.disabled = true;
19088
+ }
18918
19089
  if (fListBox.listData.length === 0) {
18919
19090
  fListBox.l10nUpdate();
18920
19091
  }
@@ -19133,6 +19304,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19133
19304
  if (!args.cancel && !this.isCustomFiltering && !args.preventDefaultAction) {
19134
19305
  this.inputString = this.filterInput.value;
19135
19306
  this.filteringAction(this.jsonData, new Query(), this.fields);
19307
+ if (this.toolbarSettings.items.length > 0) {
19308
+ this.updateToolBarState();
19309
+ }
19136
19310
  }
19137
19311
  if (!this.isFiltered && !this.isCustomFiltering && !args.preventDefaultAction) {
19138
19312
  this.dataUpdater(this.jsonData, new Query(), this.fields);
@@ -19629,6 +19803,9 @@ __decorate$6([
19629
19803
  __decorate$6([
19630
19804
  Property(null)
19631
19805
  ], ListBox.prototype, "filterBarPlaceholder", void 0);
19806
+ __decorate$6([
19807
+ Property('None')
19808
+ ], ListBox.prototype, "sortOrder", void 0);
19632
19809
  __decorate$6([
19633
19810
  Event()
19634
19811
  ], ListBox.prototype, "beforeItemRender", void 0);
@@ -20078,7 +20255,7 @@ let Mention = class Mention extends DropDownBase {
20078
20255
  }
20079
20256
  }
20080
20257
  else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
20081
- e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
20258
+ e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) || (this.liCollections && this.liCollections.length > 0))) {
20082
20259
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
20083
20260
  this.searchLists(e);
20084
20261
  }