@syncfusion/ej2-calendars 33.1.44 → 33.2.4

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.
@@ -6095,10 +6095,13 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
6095
6095
  Input.setCssClass(cssNewClass, [this.popupWrapper], cssOldClass);
6096
6096
  }
6097
6097
  };
6098
+ DateRangePicker.prototype.isValidPreset = function () {
6099
+ return !isNullOrUndefined(this.presets[0]) && !isUndefined(this.presets[0].start && this.presets[0].end && this.presets[0].label);
6100
+ };
6098
6101
  DateRangePicker.prototype.processPresets = function () {
6099
6102
  this.presetsItem = [];
6100
6103
  var i = 0;
6101
- if (!isNullOrUndefined(this.presets[0]) && !isUndefined(this.presets[0].start && this.presets[0].end && this.presets[0].label)) {
6104
+ if (this.isValidPreset()) {
6102
6105
  for (var _i = 0, _a = this.presets; _i < _a.length; _i++) {
6103
6106
  var range = _a[_i];
6104
6107
  var id = range.label.replace(/\s+/g, '') + '_' + (++i);
@@ -6418,7 +6421,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
6418
6421
  this.popupWrapper.setAttribute('role', 'dialog');
6419
6422
  this.adjustLongHeaderWidth();
6420
6423
  var isPreset = (!this.isCustomRange || this.isMobile);
6421
- if (!isUndefined(this.presets[0].start && this.presets[0].end && this.presets[0].label) && isPreset) {
6424
+ if (this.isValidPreset()
6425
+ && isPreset) {
6422
6426
  this.isCustomWindow = false;
6423
6427
  this.createPresets();
6424
6428
  this.listRippleEffect();
@@ -8414,7 +8418,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8414
8418
  EventHandler.add(cancelBtn, 'click', this.cancelFunction, this);
8415
8419
  this.popupWrapper.appendChild(controlContainer);
8416
8420
  if (!this.isMobile) {
8417
- if (!isUndefined(this.presets[0].start && this.presets[0].end && this.presets[0].label)) {
8421
+ if (this.isValidPreset()) {
8418
8422
  this.createPresets();
8419
8423
  this.listRippleEffect();
8420
8424
  addClass([controlContainer], RANGEBORDER);
@@ -8656,7 +8660,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8656
8660
  }
8657
8661
  };
8658
8662
  DateRangePicker.prototype.createPresets = function () {
8659
- if (!isUndefined(this.presets[0].start && this.presets[0].end && this.presets[0].label)) {
8663
+ if (this.isValidPreset()) {
8660
8664
  this.presetElement = this.createElement('div', { className: PRESETS, attrs: { 'tabindex': '0' } });
8661
8665
  var listTag = ListBase.createList(this.createElement, this.presetsItem, null, true);
8662
8666
  attributes(listTag, { 'role': 'listbox', 'aria-hidden': 'false', 'id': this.element.id + '_options', 'tabindex': '0', 'aria-label': 'daterangepicker-preset' });
@@ -8726,14 +8730,12 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8726
8730
  relateTo: this.isMobile && this.isCustomWindow ? document.body :
8727
8731
  (!isNullOrUndefined(this.targetElement) ? this.targetElement : this.inputWrapper.container),
8728
8732
  position: (this.isMobile ?
8729
- (!isUndefined(this.presets[0].start && this.presets[0].end && this.presets[0].label) && !this.isCustomWindow ?
8730
- { X: 'left', Y: 'bottom' } : { X: 'center', Y: 'center' }) :
8733
+ (this.isValidPreset() && !this.isCustomWindow ? { X: 'left', Y: 'bottom' } : { X: 'center', Y: 'center' }) :
8731
8734
  this.enableRtl ? { X: 'left', Y: 'bottom' } : { X: 'right', Y: 'bottom' }),
8732
8735
  offsetX: this.isMobile || this.enableRtl ? 0 : -popupWidth,
8733
8736
  offsetY: OFFSETVALUE$1,
8734
8737
  collision: this.isMobile ?
8735
- (!isUndefined(this.presets[0].start && this.presets[0].end && this.presets[0].label) && !this.isCustomWindow ?
8736
- { X: 'fit' } : { X: 'fit', Y: 'fit' }) : { X: 'fit', Y: 'flip' },
8738
+ (this.isValidPreset() && !this.isCustomWindow ? { X: 'fit' } : { X: 'fit', Y: 'fit' }) : { X: 'fit', Y: 'flip' },
8737
8739
  targetType: this.isMobile && this.isCustomWindow ? 'container' : 'relative',
8738
8740
  enableRtl: this.enableRtl,
8739
8741
  zIndex: this.zIndex,
@@ -8808,7 +8810,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8808
8810
  if (_this.isRangeIconClicked) {
8809
8811
  _this.inputWrapper.container.children[1].focus();
8810
8812
  }
8811
- if (!isUndefined(_this.presets[0].start && _this.presets[0].end && _this.presets[0].label)) {
8813
+ if (_this.isValidPreset()) {
8812
8814
  _this.unWireListEvents();
8813
8815
  }
8814
8816
  if (_this.applyButton) {
@@ -9812,7 +9814,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
9812
9814
  _this.openEventArgs.appendTo.appendChild(_this.popupWrapper);
9813
9815
  _this.showPopup(element, event);
9814
9816
  var isPreset = (!_this.isCustomRange || (_this.isMobile && _this.isCustomRange));
9815
- if (!isUndefined(_this.presets[0].start && _this.presets[0].end && _this.presets[0].label) && isPreset) {
9817
+ if (_this.isValidPreset() && isPreset) {
9816
9818
  _this.setScrollPosition();
9817
9819
  }
9818
9820
  _this.checkMinMaxDays();
@@ -9825,8 +9827,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
9825
9827
  _super.prototype.setOverlayIndex.call(_this, _this.mobileRangePopupWrap, _this.popupObj.element, _this.modal, _this.isMobile || Browser.isDevice);
9826
9828
  if (!isNullOrUndefined(_this.mobileRangePopupWrap) && !isNullOrUndefined(_this.popupObj)
9827
9829
  && !isNullOrUndefined(_this.popupObj.element) && isNullOrUndefined(_this.modal) &&
9828
- !isUndefined(_this.presets[0].start && _this.presets[0].end && _this.presets[0].label) && isPreset
9829
- && (_this.isMobile || Browser.isDevice) && !_this.isCustomWindow) {
9830
+ _this.isValidPreset() && isPreset && (_this.isMobile || Browser.isDevice) && !_this.isCustomWindow) {
9830
9831
  var index = parseInt(_this.popupObj.element.style.zIndex, 10) ?
9831
9832
  parseInt(_this.popupObj.element.style.zIndex, 10) : 1000;
9832
9833
  _this.mobileRangePopupWrap.style.zIndex = index.toString();