@syncfusion/ej2-dropdowns 35.1.43 → 35.2.12

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 : 35.1.43
3
+ * version : 35.2.12
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": "35.1.43",
3
+ "version": "35.2.12",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,13 +8,13 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-dropdowns.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~35.1.37",
12
- "@syncfusion/ej2-data": "~35.1.37",
13
- "@syncfusion/ej2-inputs": "~35.1.43",
14
- "@syncfusion/ej2-lists": "~35.1.43",
15
- "@syncfusion/ej2-navigations": "~35.1.43",
16
- "@syncfusion/ej2-notifications": "~35.1.37",
17
- "@syncfusion/ej2-popups": "~35.1.42"
11
+ "@syncfusion/ej2-base": "~35.2.12",
12
+ "@syncfusion/ej2-data": "~35.2.12",
13
+ "@syncfusion/ej2-inputs": "~35.2.12",
14
+ "@syncfusion/ej2-lists": "~35.2.12",
15
+ "@syncfusion/ej2-navigations": "~35.2.12",
16
+ "@syncfusion/ej2-notifications": "~35.2.12",
17
+ "@syncfusion/ej2-popups": "~35.2.12"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "keywords": [
@@ -558,6 +558,9 @@ var DropDownBase = /** @class */ (function (_super) {
558
558
  return 'drop-down-base';
559
559
  };
560
560
  DropDownBase.prototype.getTextByValue = function (value) {
561
+ if (this.getModuleName() === 'multiselect' && (value === null || value === undefined)) {
562
+ return 'null';
563
+ }
561
564
  var text = this.checkValueCase(value, false, false, true);
562
565
  return text;
563
566
  };
@@ -2257,7 +2260,8 @@ var DropDownBase = /** @class */ (function (_super) {
2257
2260
  if (type === 'string' || type === 'number' || type === 'boolean') {
2258
2261
  for (var _i = 0, _a = this.listData; _i < _a.length; _i++) {
2259
2262
  var item = _a[_i];
2260
- if (!isNullOrUndefined(item) && item === value) {
2263
+ if (((this.getModuleName() === 'multiselect') && item === value) ||
2264
+ ((this.getModuleName() !== 'multiselect') && !isNullOrUndefined(item) && item === value)) {
2261
2265
  return item;
2262
2266
  }
2263
2267
  }
@@ -136,6 +136,8 @@ export declare class DropDownList extends DropDownBase implements IInput {
136
136
  private isUpdateFooterHeight;
137
137
  private filterArgs;
138
138
  private isReactTemplateUpdate;
139
+ private popupPositionObserver;
140
+ private popupPositionRefreshTimer;
139
141
  private iOSscrollPosition;
140
142
  private resizeHandler;
141
143
  /**
@@ -632,6 +634,8 @@ export declare class DropDownList extends DropDownBase implements IInput {
632
634
  private setEleWidth;
633
635
  private closePopup;
634
636
  private updateInitialData;
637
+ private setupPopupPositionObserver;
638
+ private destroyPopupPositionObserver;
635
639
  private destroyPopup;
636
640
  private clickOnBackIcon;
637
641
  /**
@@ -97,6 +97,8 @@ var DropDownList = /** @class */ (function (_super) {
97
97
  _this.isUpdateHeaderHeight = false;
98
98
  _this.isUpdateFooterHeight = false;
99
99
  _this.isReactTemplateUpdate = false;
100
+ _this.popupPositionObserver = null;
101
+ _this.popupPositionRefreshTimer = null;
100
102
  return _this;
101
103
  }
102
104
  /**
@@ -362,8 +364,7 @@ var DropDownList = /** @class */ (function (_super) {
362
364
  'aria-disabled': 'false',
363
365
  'role': 'combobox',
364
366
  'aria-expanded': 'false',
365
- 'aria-live': 'polite',
366
- 'aria-labelledby': this.hiddenElement.id
367
+ 'aria-live': 'polite'
367
368
  };
368
369
  };
369
370
  DropDownList.prototype.setEnableRtl = function () {
@@ -2984,6 +2985,7 @@ var DropDownList = /** @class */ (function (_super) {
2984
2985
  if (!isNullOrUndefined(_this.popupObj)) {
2985
2986
  _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
2986
2987
  _this.isPopupRender = true;
2988
+ _this.setupPopupPositionObserver();
2987
2989
  }
2988
2990
  if (_this.isReact) {
2989
2991
  setTimeout(function () {
@@ -3654,10 +3656,51 @@ var DropDownList = /** @class */ (function (_super) {
3654
3656
  }
3655
3657
  ulElement = null;
3656
3658
  };
3659
+ DropDownList.prototype.setupPopupPositionObserver = function () {
3660
+ var _this = this;
3661
+ if (!this.isAngular) {
3662
+ return;
3663
+ }
3664
+ if (!isNullOrUndefined(this.popupPositionObserver)) {
3665
+ this.popupPositionObserver.disconnect();
3666
+ }
3667
+ var observerTarget = this.inputWrapper && this.inputWrapper.container
3668
+ ? this.inputWrapper.container.parentElement
3669
+ : this.element.parentElement;
3670
+ if (isNullOrUndefined(observerTarget)) {
3671
+ return;
3672
+ }
3673
+ this.popupPositionObserver = new MutationObserver(function () {
3674
+ clearTimeout(_this.popupPositionRefreshTimer);
3675
+ _this.popupPositionRefreshTimer = setTimeout(function () {
3676
+ if (!isNullOrUndefined(_this.popupObj) &&
3677
+ !isNullOrUndefined(_this.inputWrapper)) {
3678
+ _this.popupObj.refreshPosition(_this.inputWrapper.container);
3679
+ }
3680
+ }, 0);
3681
+ });
3682
+ this.popupPositionObserver.observe(observerTarget, {
3683
+ childList: true,
3684
+ subtree: true,
3685
+ attributes: true,
3686
+ attributeFilter: ['style', 'class']
3687
+ });
3688
+ };
3689
+ DropDownList.prototype.destroyPopupPositionObserver = function () {
3690
+ if (this.popupPositionRefreshTimer) {
3691
+ clearTimeout(this.popupPositionRefreshTimer);
3692
+ this.popupPositionRefreshTimer = null;
3693
+ }
3694
+ if (this.popupPositionObserver) {
3695
+ this.popupPositionObserver.disconnect();
3696
+ this.popupPositionObserver = null;
3697
+ }
3698
+ };
3657
3699
  DropDownList.prototype.destroyPopup = function () {
3658
3700
  this.isPopupOpen = false;
3659
3701
  this.isFilterFocus = false;
3660
3702
  this.inputElement.removeAttribute('aria-controls');
3703
+ this.destroyPopupPositionObserver();
3661
3704
  if (this.popupObj) {
3662
3705
  if (this.resizer) {
3663
3706
  EventHandler.remove(this.resizer, 'mousedown', this.startResizing);
@@ -3687,6 +3730,9 @@ var DropDownList = /** @class */ (function (_super) {
3687
3730
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
3688
3731
  this.inputElement.setAttribute('type', 'text');
3689
3732
  }
3733
+ if (this.getModuleName() === 'dropdownlist') {
3734
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
3735
+ }
3690
3736
  this.inputElement.setAttribute('aria-expanded', 'false');
3691
3737
  }
3692
3738
  else {
@@ -3773,7 +3819,7 @@ var DropDownList = /** @class */ (function (_super) {
3773
3819
  if (!this.targetElement().hasAttribute('aria-label')) {
3774
3820
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
3775
3821
  }
3776
- if (!this.inputElement.hasAttribute('aria-labelledby')) {
3822
+ if (this.getModuleName() !== 'dropdownlist' && !this.inputElement.hasAttribute('aria-labelledby')) {
3777
3823
  this.inputElement.setAttribute('aria-labelledby', this.hiddenElement.id);
3778
3824
  }
3779
3825
  this.inputElement.setAttribute('aria-expanded', 'false');
@@ -3781,9 +3827,19 @@ var DropDownList = /** @class */ (function (_super) {
3781
3827
  attributes(this.targetElement(), this.getAriaAttributes());
3782
3828
  this.updateDataAttribute(this.htmlAttributes);
3783
3829
  this.setHTMLAttributes();
3784
- if (this.targetElement() === this.inputElement) {
3830
+ if (this.getModuleName() !== 'dropdownlist' && this.targetElement() === this.inputElement) {
3785
3831
  this.inputElement.removeAttribute('aria-labelledby');
3786
3832
  }
3833
+ if (this.getModuleName() === 'dropdownlist' && this.targetElement() === this.inputWrapper.container) {
3834
+ var floatLabel = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
3835
+ if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabel)) {
3836
+ floatLabel.id = 'label_' + this.element.id.replace(/ /g, '_');
3837
+ attributes(this.inputWrapper.container, { 'aria-labelledby': floatLabel.id });
3838
+ }
3839
+ else {
3840
+ this.inputWrapper.container.removeAttribute('aria-labelledby');
3841
+ }
3842
+ }
3787
3843
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
3788
3844
  if (this.enableVirtualization) {
3789
3845
  this.listItemHeight = this.getListHeight();
@@ -3842,7 +3898,12 @@ var DropDownList = /** @class */ (function (_super) {
3842
3898
  var floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
3843
3899
  if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
3844
3900
  floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
3845
- attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
3901
+ attributes(this.getModuleName() === 'dropdownlist'
3902
+ ? this.inputWrapper.container
3903
+ : this.inputElement, { 'aria-labelledby': floatLabelElement.id });
3904
+ if (this.getModuleName() === 'dropdownlist' && this.inputElement) {
3905
+ this.inputElement.removeAttribute('aria-labelledby');
3906
+ }
3846
3907
  }
3847
3908
  this.renderComplete();
3848
3909
  this.listItemHeight = this.getListHeight();
@@ -4059,7 +4120,7 @@ var DropDownList = /** @class */ (function (_super) {
4059
4120
  if (label) {
4060
4121
  label.remove();
4061
4122
  }
4062
- this_1.inputElement.removeAttribute('aria-labelledby');
4123
+ this_1.inputWrapper.container.removeAttribute('aria-labelledby');
4063
4124
  }
4064
4125
  else if (this_1.floatLabelType !== 'Never' && !this_1.value) {
4065
4126
  var floatLabel = this_1.inputWrapper.container
@@ -4091,7 +4152,7 @@ var DropDownList = /** @class */ (function (_super) {
4091
4152
  }
4092
4153
  floatLabel.style.width = this_1.inputElement.offsetWidth + 'px';
4093
4154
  floatLabel.textContent = newProp.placeholder;
4094
- this_1.inputElement.setAttribute('aria-labelledby', floatLabel.id);
4155
+ this_1.inputWrapper.container.setAttribute('aria-labelledby', floatLabel.id);
4095
4156
  }
4096
4157
  }
4097
4158
  break;
@@ -4304,14 +4365,28 @@ var DropDownList = /** @class */ (function (_super) {
4304
4365
  this_1.updateSelectElementData(this_1.allowFiltering);
4305
4366
  }
4306
4367
  break;
4307
- case 'floatLabelType':
4368
+ case 'floatLabelType': {
4308
4369
  Input.removeFloating(this_1.inputWrapper);
4309
4370
  Input.addFloating(this_1.inputElement, newProp.floatLabelType, this_1.placeholder, this_1.createElement);
4310
4371
  if (!isNullOrUndefined(this_1.inputWrapper.buttons[0]) &&
4311
4372
  this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this_1.floatLabelType !== 'Never') {
4312
4373
  this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
4313
4374
  }
4375
+ if (this_1.getModuleName() === 'dropdownlist') {
4376
+ var floatLabelElement = this_1.inputWrapper.container.getElementsByClassName('e-float-text')[0];
4377
+ if (!isNullOrUndefined(this_1.element.id) &&
4378
+ this_1.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
4379
+ floatLabelElement.id = 'label_' + this_1.element.id.replace(/ /g, '_');
4380
+ attributes(this_1.inputWrapper.container, {
4381
+ 'aria-labelledby': floatLabelElement.id
4382
+ });
4383
+ }
4384
+ else {
4385
+ this_1.inputWrapper.container.removeAttribute('aria-labelledby');
4386
+ }
4387
+ }
4314
4388
  break;
4389
+ }
4315
4390
  case 'showClearButton':
4316
4391
  if (!this_1.inputWrapper.clearButton) {
4317
4392
  Input.setClearButton(newProp.showClearButton, this_1.inputElement, this_1.inputWrapper, null, this_1.createElement);
@@ -4420,7 +4495,7 @@ var DropDownList = /** @class */ (function (_super) {
4420
4495
  }
4421
4496
  if (label && this.getModuleName() === 'dropdownlist' && (!this.placeholder || this.placeholder.trim() === '')) {
4422
4497
  label.remove();
4423
- this.inputElement.removeAttribute('aria-labelledby');
4498
+ this.inputWrapper.container.removeAttribute('aria-labelledby');
4424
4499
  }
4425
4500
  };
4426
4501
  /**
@@ -4532,6 +4607,7 @@ var DropDownList = /** @class */ (function (_super) {
4532
4607
  */
4533
4608
  DropDownList.prototype.hidePopup = function (e) {
4534
4609
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
4610
+ this.destroyPopupPositionObserver();
4535
4611
  if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
4536
4612
  if (!isNullOrUndefined(this.inputElement)) {
4537
4613
  Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
@@ -4685,6 +4761,7 @@ var DropDownList = /** @class */ (function (_super) {
4685
4761
  * @returns {void}
4686
4762
  */
4687
4763
  DropDownList.prototype.destroy = function () {
4764
+ this.destroyPopupPositionObserver();
4688
4765
  this.isActive = false;
4689
4766
  this.isStaleFilter = false;
4690
4767
  this.filterGeneration = null;
@@ -855,6 +855,8 @@ export declare class MultiSelect extends DropDownBase implements IInput {
855
855
  private initialTextUpdate;
856
856
  protected renderList(isEmptyData?: boolean): void;
857
857
  private getTextByValueFromDataSource;
858
+ private isValueOnlyNull;
859
+ protected getTextByValue(value: string | number | boolean): string;
858
860
  private initialValueUpdate;
859
861
  protected updateActionCompleteData(li: HTMLElement, item: {
860
862
  [key: string]: Object;