@syncfusion/ej2-dropdowns 32.2.8 → 32.2.9

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 32.2.8
3
+ * version : 32.2.9
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-dropdowns",
3
- "version": "32.2.8",
3
+ "version": "32.2.9",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,11 +8,11 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-dropdowns.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~32.2.6",
11
+ "@syncfusion/ej2-base": "~32.2.9",
12
12
  "@syncfusion/ej2-data": "~32.2.3",
13
13
  "@syncfusion/ej2-inputs": "~32.2.8",
14
14
  "@syncfusion/ej2-lists": "~32.2.7",
15
- "@syncfusion/ej2-navigations": "~32.2.8",
15
+ "@syncfusion/ej2-navigations": "~32.2.9",
16
16
  "@syncfusion/ej2-notifications": "~32.2.3",
17
17
  "@syncfusion/ej2-popups": "~32.2.8"
18
18
  },
@@ -593,6 +593,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
593
593
  private isValueInList;
594
594
  private checkFieldValue;
595
595
  private checkAndFetchItemData;
596
+ private searchOfflineData;
596
597
  private updateActionCompleteDataValues;
597
598
  private addNewItem;
598
599
  protected updateActionCompleteData(li: HTMLElement, item: {
@@ -2497,8 +2497,9 @@ var DropDownList = /** @class */ (function (_super) {
2497
2497
  });
2498
2498
  return checkField;
2499
2499
  };
2500
- DropDownList.prototype.checkAndFetchItemData = function (list, value, checkField) {
2500
+ DropDownList.prototype.checkAndFetchItemData = function (list, value, checkField, isOffline) {
2501
2501
  var _this = this;
2502
+ if (isOffline === void 0) { isOffline = false; }
2502
2503
  var fieldValue = this.fields.value.split('.');
2503
2504
  var checkVal = list.some(function (x) {
2504
2505
  return isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
@@ -2511,27 +2512,67 @@ var DropDownList = /** @class */ (function (_super) {
2511
2512
  });
2512
2513
  }
2513
2514
  if (!checkVal && this.dataSource instanceof DataManager) {
2514
- (this.dataSource).executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
2515
- .then(function (e) {
2516
- if (e.result.length > 0) {
2517
- if (!_this.enableVirtualization) {
2518
- _this.addItem(e.result, list.length);
2515
+ if (isOffline) {
2516
+ this.searchOfflineData(value, checkField);
2517
+ }
2518
+ else {
2519
+ (this.dataSource).executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
2520
+ .then(function (e) {
2521
+ if (e.result.length > 0) {
2522
+ if (!_this.enableVirtualization) {
2523
+ _this.addItem(e.result, list.length);
2524
+ }
2525
+ else {
2526
+ _this.itemData = e.result[0];
2527
+ var dataItem = _this.getItemData();
2528
+ if ((_this.value === dataItem.value && _this.text !== dataItem.text) ||
2529
+ (_this.value !== dataItem.value && _this.text === dataItem.text)) {
2530
+ _this.setProperties({ text: dataItem.text.toString() });
2531
+ Input.setValue(_this.text, _this.inputElement, _this.floatLabelType, _this.showClearButton);
2532
+ }
2533
+ }
2534
+ _this.updateValues();
2519
2535
  }
2520
2536
  else {
2521
- _this.itemData = e.result[0];
2522
- var dataItem = _this.getItemData();
2523
- if ((_this.value === dataItem.value && _this.text !== dataItem.text) ||
2524
- (_this.value !== dataItem.value && _this.text === dataItem.text)) {
2525
- _this.setProperties({ text: dataItem.text.toString() });
2526
- Input.setValue(_this.text, _this.inputElement, _this.floatLabelType, _this.showClearButton);
2527
- }
2537
+ _this.updateValues();
2528
2538
  }
2529
- _this.updateValues();
2530
- }
2531
- else {
2532
- _this.updateValues();
2539
+ });
2540
+ }
2541
+ }
2542
+ else {
2543
+ this.updateValues();
2544
+ }
2545
+ };
2546
+ DropDownList.prototype.searchOfflineData = function (value, checkField) {
2547
+ var _this = this;
2548
+ if (!(this.dataSource instanceof DataManager)) {
2549
+ this.updateValues();
2550
+ return;
2551
+ }
2552
+ var dataManager = this.dataSource;
2553
+ var fullData = dataManager.dataSource.json || [];
2554
+ if (fullData && fullData.length > 0) {
2555
+ var foundItem = fullData.find(function (item) {
2556
+ if (_this.fields.value && _this.fields.value.includes('.')) {
2557
+ var fieldValueArray = _this.fields.value.split('.');
2558
+ var fieldVal = _this.checkFieldValue(item, fieldValueArray);
2559
+ return fieldVal === value;
2533
2560
  }
2561
+ return item[checkField] === value;
2534
2562
  });
2563
+ if (foundItem) {
2564
+ this.itemData = foundItem;
2565
+ var dataItem = this.getItemData();
2566
+ if ((this.value === dataItem.value && this.text !== dataItem.text) ||
2567
+ (this.value !== dataItem.value && this.text === dataItem.text)) {
2568
+ this.setProperties({ text: dataItem.text.toString() });
2569
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
2570
+ }
2571
+ this.updateValues();
2572
+ }
2573
+ else {
2574
+ this.updateValues();
2575
+ }
2535
2576
  }
2536
2577
  else {
2537
2578
  this.updateValues();
@@ -3977,10 +4018,12 @@ var DropDownList = /** @class */ (function (_super) {
3977
4018
  }
3978
4019
  if (this_1.enableVirtualization) {
3979
4020
  if (newProp.value && this_1.dataSource instanceof DataManager) {
4021
+ var isOfflineMode = this_1.dataSource instanceof DataManager &&
4022
+ this_1.dataSource.dataSource.offline === true;
3980
4023
  var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
3981
4024
  var value = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3982
4025
  getValue(checkField, newProp.value) : newProp.value;
3983
- this_1.checkAndFetchItemData(this_1.listData, value, checkField);
4026
+ this_1.checkAndFetchItemData(this_1.listData, value, checkField, isOfflineMode);
3984
4027
  }
3985
4028
  this_1.updateValues();
3986
4029
  this_1.updateInputFields();
@@ -2289,7 +2289,10 @@ var MultiSelect = /** @class */ (function (_super) {
2289
2289
  }
2290
2290
  }
2291
2291
  else {
2292
- this.onActionComplete(list, this.mainData);
2292
+ var listUl = this.list && this.list.querySelector('ul');
2293
+ var isFullList = this.isReact && this.itemTemplate && listUl != null &&
2294
+ listUl.querySelectorAll('.e-list-item').length === this.mainData.length;
2295
+ this.onActionComplete(isFullList ? listUl : list, this.mainData);
2293
2296
  }
2294
2297
  this.focusAtLastListItem(data);
2295
2298
  if (this.value && this.value.length) {
@@ -2521,9 +2524,13 @@ var MultiSelect = /** @class */ (function (_super) {
2521
2524
  addClass([element], CHIP_SELECTED);
2522
2525
  if (element) {
2523
2526
  element.setAttribute('id', this.element.id + '_chip_item');
2524
- if (!isNullOrUndefined(this.inputElement) && element.id && !this.inputElement.hasAttribute('aria-activedescendant')) {
2527
+ if (!isNullOrUndefined(this.inputElement) && element.id) {
2525
2528
  this.inputElement.setAttribute('aria-activedescendant', element.id);
2526
2529
  }
2530
+ var chipClose = element.querySelector('span.' + CHIP_CLOSE.split(' ')[0]);
2531
+ if (chipClose) {
2532
+ chipClose.removeAttribute('aria-hidden');
2533
+ }
2527
2534
  }
2528
2535
  this.trigger('chipSelection', e);
2529
2536
  };
@@ -2927,6 +2934,7 @@ var MultiSelect = /** @class */ (function (_super) {
2927
2934
  var _this = this;
2928
2935
  var list = this.listData;
2929
2936
  if (this.initStatus && !isNotTrigger && (!this.allowObjectBinding || (this.allowObjectBinding && value))) {
2937
+ var selectAllArgsLocal_1 = null;
2930
2938
  value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
2931
2939
  var val_2 = dataValue ? dataValue : this.getDataByValue(value);
2932
2940
  var eventArgs = {
@@ -2943,15 +2951,13 @@ var MultiSelect = /** @class */ (function (_super) {
2943
2951
  _this.selectAllEventEle.push(element);
2944
2952
  }
2945
2953
  if (length === 1) {
2946
- var args = {
2954
+ selectAllArgsLocal_1 = {
2947
2955
  event: eve,
2948
2956
  items: _this.selectAllEventEle,
2949
2957
  itemData: _this.selectAllEventData,
2950
2958
  isInteracted: eve ? true : false,
2951
2959
  isChecked: true
2952
2960
  };
2953
- _this.trigger('selectedAll', args);
2954
- _this.selectAllEventData = [];
2955
2961
  }
2956
2962
  if (_this.allowCustomValue && _this.isServerRendered && _this.listData !== list) {
2957
2963
  _this.listData = list;
@@ -2988,6 +2994,10 @@ var MultiSelect = /** @class */ (function (_super) {
2988
2994
  if (_this.hideSelectedItem && _this.fixedHeaderElement && _this.fields.groupBy && _this.mode !== 'CheckBox') {
2989
2995
  _super.prototype.scrollStop.call(_this);
2990
2996
  }
2997
+ if (selectAllArgsLocal_1) {
2998
+ _this.trigger('selectedAll', selectAllArgsLocal_1);
2999
+ _this.selectAllEventData = [];
3000
+ }
2991
3001
  }
2992
3002
  });
2993
3003
  }
@@ -3000,12 +3010,18 @@ var MultiSelect = /** @class */ (function (_super) {
3000
3010
  MultiSelect.prototype.removeChipFocus = function () {
3001
3011
  var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP + '.' + CHIP_SELECTED);
3002
3012
  removeClass(elements, CHIP_SELECTED);
3013
+ var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE.split(' ')[0]);
3003
3014
  if (Browser.isDevice) {
3004
- var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE.split(' ')[0]);
3005
3015
  for (var index = 0; index < closeElements.length; index++) {
3016
+ closeElements[index].setAttribute('aria-hidden', 'true');
3006
3017
  closeElements[index].style.display = 'none';
3007
3018
  }
3008
3019
  }
3020
+ else {
3021
+ for (var index = 0; index < closeElements.length; index++) {
3022
+ closeElements[index].setAttribute('aria-hidden', 'true');
3023
+ }
3024
+ }
3009
3025
  };
3010
3026
  MultiSelect.prototype.onMobileChipInteraction = function (e) {
3011
3027
  var chipElem = closest(e.target, '.' + CHIP);
@@ -3046,7 +3062,7 @@ var MultiSelect = /** @class */ (function (_super) {
3046
3062
  });
3047
3063
  var compiledString;
3048
3064
  var chipContent = this.createElement('span', { className: CHIP_CONTENT });
3049
- var chipClose = this.createElement('span', { className: CHIP_CLOSE });
3065
+ var chipClose = this.createElement('span', { className: CHIP_CLOSE, attrs: { 'aria-label': 'delete', 'aria-hidden': 'true', 'tabindex': '-1' } });
3050
3066
  if (this.mainData) {
3051
3067
  itemData = this.getDataByValue(value);
3052
3068
  }
@@ -4403,6 +4419,9 @@ var MultiSelect = /** @class */ (function (_super) {
4403
4419
  }
4404
4420
  else {
4405
4421
  e.preventDefault();
4422
+ if (this.value.length === this.listData.length && this.isPopupOpen()) {
4423
+ this.hidePopup(e);
4424
+ }
4406
4425
  }
4407
4426
  var isFilterData = this.targetElement().trim() !== '' ? true : false;
4408
4427
  this.makeTextBoxEmpty();
@@ -6048,7 +6067,7 @@ var MultiSelect = /** @class */ (function (_super) {
6048
6067
  }
6049
6068
  else {
6050
6069
  this.chipCollectionWrapper = this.createElement('span', {
6051
- className: CHIP_WRAPPER
6070
+ className: CHIP_WRAPPER, attrs: { role: 'listbox' }
6052
6071
  });
6053
6072
  this.chipCollectionWrapper.style.display = 'none';
6054
6073
  if (this.mode === 'Default') {