@syncfusion/ej2-dropdowns 22.1.37 → 22.1.38

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.
@@ -3213,20 +3213,20 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3213
3213
  var args = { cancel: false };
3214
3214
  this.trigger('beforeOpen', args, function (args) {
3215
3215
  if (!args.cancel) {
3216
- var popupEle = _this.createElement('div', {
3216
+ var popupEle_1 = _this.createElement('div', {
3217
3217
  id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass !== null ? _this.cssClass : '')
3218
3218
  });
3219
- var searchBox = _this.setSearchBox(popupEle);
3219
+ var searchBox = _this.setSearchBox(popupEle_1);
3220
3220
  _this.listHeight = formatUnit(_this.popupHeight);
3221
3221
  if (_this.headerTemplate) {
3222
- _this.setHeaderTemplate(popupEle);
3222
+ _this.setHeaderTemplate(popupEle_1);
3223
3223
  }
3224
- append([_this.list], popupEle);
3224
+ append([_this.list], popupEle_1);
3225
3225
  if (_this.footerTemplate) {
3226
- _this.setFooterTemplate(popupEle);
3226
+ _this.setFooterTemplate(popupEle_1);
3227
3227
  }
3228
- document.body.appendChild(popupEle);
3229
- popupEle.style.visibility = 'hidden';
3228
+ document.body.appendChild(popupEle_1);
3229
+ popupEle_1.style.visibility = 'hidden';
3230
3230
  if (_this.popupHeight !== 'auto') {
3231
3231
  _this.searchBoxHeight = 0;
3232
3232
  if (!isNullOrUndefined(searchBox.container)) {
@@ -3234,20 +3234,20 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3234
3234
  _this.listHeight = (parseInt(_this.listHeight, 10) - (_this.searchBoxHeight)).toString() + 'px';
3235
3235
  }
3236
3236
  if (_this.headerTemplate) {
3237
- _this.header = _this.header ? _this.header : popupEle.querySelector('.e-ddl-header');
3237
+ _this.header = _this.header ? _this.header : popupEle_1.querySelector('.e-ddl-header');
3238
3238
  var height = Math.round(_this.header.getBoundingClientRect().height);
3239
3239
  _this.listHeight = (parseInt(_this.listHeight, 10) - (height + _this.searchBoxHeight)).toString() + 'px';
3240
3240
  }
3241
3241
  if (_this.footerTemplate) {
3242
- _this.footer = _this.footer ? _this.footer : popupEle.querySelector('.e-ddl-footer');
3242
+ _this.footer = _this.footer ? _this.footer : popupEle_1.querySelector('.e-ddl-footer');
3243
3243
  var height = Math.round(_this.footer.getBoundingClientRect().height);
3244
3244
  _this.listHeight = (parseInt(_this.listHeight, 10) - (height + _this.searchBoxHeight)).toString() + 'px';
3245
3245
  }
3246
3246
  _this.list.style.maxHeight = (parseInt(_this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
3247
- popupEle.style.maxHeight = formatUnit(_this.popupHeight);
3247
+ popupEle_1.style.maxHeight = formatUnit(_this.popupHeight);
3248
3248
  }
3249
3249
  else {
3250
- popupEle.style.height = 'auto';
3250
+ popupEle_1.style.height = 'auto';
3251
3251
  }
3252
3252
  var offsetValue = 0;
3253
3253
  var left = void 0;
@@ -3259,7 +3259,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3259
3259
  }
3260
3260
  if (Browser.isDevice && (!_this.allowFiltering && (_this.getModuleName() === 'dropdownlist' ||
3261
3261
  (_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {
3262
- offsetValue = _this.getOffsetValue(popupEle);
3262
+ offsetValue = _this.getOffsetValue(popupEle_1);
3263
3263
  var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];
3264
3264
  if (!isNullOrUndefined(_this.inputElement)) {
3265
3265
  left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
@@ -3268,8 +3268,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3268
3268
  }
3269
3269
  }
3270
3270
  _this.getFocusElement();
3271
- _this.createPopup(popupEle, offsetValue, left);
3272
- _this.checkCollision(popupEle);
3271
+ _this.createPopup(popupEle_1, offsetValue, left);
3272
+ _this.checkCollision(popupEle_1);
3273
+ var popupLeft_1 = _this.enableRtl ? parseFloat(popupEle_1.style.left) - (_this.ulElement.parentElement.offsetWidth - _this.inputWrapper.container.offsetWidth) : 0;
3273
3274
  if (Browser.isDevice) {
3274
3275
  _this.popupObj.element.classList.add(dropDownListClasses.device);
3275
3276
  if (_this.getModuleName() === 'dropdownlist' || (_this.getModuleName() === 'combobox'
@@ -3289,8 +3290,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3289
3290
  EventHandler.add(_this.clearIconElement, 'click', _this.clearText, _this);
3290
3291
  }
3291
3292
  }
3292
- popupEle.style.visibility = 'visible';
3293
- addClass([popupEle], 'e-popup-close');
3293
+ popupEle_1.style.visibility = 'visible';
3294
+ addClass([popupEle_1], 'e-popup-close');
3294
3295
  var scrollParentElements = _this.popupObj.getScrollableParent(_this.inputWrapper.container);
3295
3296
  for (var _i = 0, scrollParentElements_1 = scrollParentElements; _i < scrollParentElements_1.length; _i++) {
3296
3297
  var element = scrollParentElements_1[_i];
@@ -3323,6 +3324,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3323
3324
  _this.beforePopupOpen = false;
3324
3325
  _this.destroyPopup();
3325
3326
  }
3327
+ if (_this.enableRtl && popupLeft_1 > 0) {
3328
+ popupEle_1.style.left = popupLeft_1 + "px";
3329
+ }
3326
3330
  });
3327
3331
  }
3328
3332
  else {
@@ -4896,6 +4900,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4896
4900
  }
4897
4901
  _this.treeObj.fields = _this.getTreeFields(fields);
4898
4902
  _this.treeObj.dataBind();
4903
+ if (_this.hasTemplate && _this.portals) {
4904
+ _this.portals = [].concat(_this.treeObj.portals);
4905
+ if (_this.isReact) {
4906
+ _this.renderReactTemplates();
4907
+ }
4908
+ }
4899
4909
  }
4900
4910
  });
4901
4911
  };
@@ -9373,6 +9383,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9373
9383
  if (_this.isFirstClick) {
9374
9384
  _this.loadTemplate();
9375
9385
  }
9386
+ if (_this.enableRtl) {
9387
+ _this.popupWrapper.style.visibility = 'hidden';
9388
+ }
9376
9389
  }
9377
9390
  });
9378
9391
  };
@@ -11241,6 +11254,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11241
11254
  },
11242
11255
  open: function () {
11243
11256
  _this.popupObj.resolveCollision();
11257
+ if (_this.enableRtl) {
11258
+ var popupLeft = parseFloat(_this.popupWrapper.style.left) - (_this.popupWrapper.offsetWidth - _this.overAllWrapper.offsetWidth);
11259
+ _this.popupWrapper.style.left = popupLeft > 0 ? popupLeft + "px" : _this.popupWrapper.style.left;
11260
+ _this.popupWrapper.style.visibility = 'hidden';
11261
+ }
11244
11262
  if (!_this.isFirstClick) {
11245
11263
  var ulElement = _this.list.querySelector('ul');
11246
11264
  if (ulElement) {