@syncfusion/ej2-calendars 32.2.3 → 32.2.5

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.
@@ -4332,13 +4332,14 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4332
4332
  if (!isNullOrUndefined(this.cssClass)) {
4333
4333
  this.popupWrapper.className += ' ' + this.cssClass;
4334
4334
  }
4335
+ var appendToElement = this.getAppendToElement();
4335
4336
  if (Browser.isDevice) {
4336
4337
  this.modelHeader();
4337
4338
  this.modal = this.createElement('div');
4338
4339
  this.modal.className = '' + ROOT$1 + ' e-date-modal';
4339
- document.body.className += ' ' + OVERFLOW;
4340
+ appendToElement.className += ' ' + OVERFLOW;
4340
4341
  this.modal.style.display = 'block';
4341
- document.body.appendChild(this.modal);
4342
+ appendToElement.appendChild(this.modal);
4342
4343
  }
4343
4344
  //this.calendarElement represent the Calendar object from the Calendar class.
4344
4345
  this.calendarElement.querySelector('table tbody').className = '';
@@ -4673,9 +4674,10 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4673
4674
  this.previousDate = outOfRange;
4674
4675
  this.createCalendar();
4675
4676
  }
4677
+ var appendToElement = this.getAppendToElement();
4676
4678
  if (Browser.isDevice) {
4677
4679
  this.mobilePopupWrapper = this.createElement('div', { className: 'e-datepick-mob-popup-wrap' });
4678
- document.body.appendChild(this.mobilePopupWrapper);
4680
+ appendToElement.appendChild(this.mobilePopupWrapper);
4679
4681
  }
4680
4682
  this.preventArgs = {
4681
4683
  preventDefault: function () {
@@ -4684,7 +4686,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4684
4686
  popup: this.popupObj,
4685
4687
  event: e || null,
4686
4688
  cancel: false,
4687
- appendTo: Browser.isDevice ? this.mobilePopupWrapper : document.body
4689
+ appendTo: Browser.isDevice ? this.mobilePopupWrapper : appendToElement
4688
4690
  };
4689
4691
  var eventArgs = this.preventArgs;
4690
4692
  this.trigger('open', eventArgs, function (eventArgs) {
@@ -4745,7 +4747,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4745
4747
  cancel: false
4746
4748
  };
4747
4749
  removeClass(this.inputWrapper.buttons, ACTIVE);
4748
- removeClass([document.body], OVERFLOW);
4750
+ var appendToElement = this.getAppendToElement();
4751
+ removeClass([appendToElement], OVERFLOW);
4749
4752
  var eventArgs = this.preventArgs;
4750
4753
  if (this.isCalendar()) {
4751
4754
  this.trigger('close', eventArgs, function (eventArgs) {
@@ -5189,6 +5192,16 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
5189
5192
  DatePicker.prototype.getModuleName = function () {
5190
5193
  return 'datepicker';
5191
5194
  };
5195
+ DatePicker.prototype.getAppendToElement = function () {
5196
+ if (this.isAngular) {
5197
+ var cdkPane = this.element.closest('.cdk-overlay-pane');
5198
+ var popoverEl = this.element.closest('[popover]');
5199
+ if (cdkPane && popoverEl) {
5200
+ return cdkPane;
5201
+ }
5202
+ }
5203
+ return document.body;
5204
+ };
5192
5205
  DatePicker.prototype.updateFloatLabelOverflowWidth = function () {
5193
5206
  var container = this.inputWrapper.container;
5194
5207
  var label = container.querySelector('.e-float-text.e-label-bottom');
@@ -8610,13 +8623,14 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8610
8623
  this.popupObj.hide();
8611
8624
  this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: ROOT$2 + ' ' + POPUP$1 });
8612
8625
  this.renderControl();
8626
+ var appendToElement = this.getAppendToElement();
8613
8627
  this.openEventArgs = {
8614
8628
  popup: this.popupObj || null,
8615
8629
  cancel: false,
8616
8630
  date: this.inputElement.value,
8617
8631
  model: this,
8618
8632
  event: event ? event : null,
8619
- appendTo: this.isMobile || Browser.isDevice ? this.mobileRangePopupWrap : document.body
8633
+ appendTo: this.isMobile || Browser.isDevice ? this.mobileRangePopupWrap : appendToElement
8620
8634
  };
8621
8635
  var eventArgs = this.openEventArgs;
8622
8636
  this.trigger('open', eventArgs, function (eventArgs) {
@@ -8700,9 +8714,10 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8700
8714
  if (!isNullOrUndefined(this.cssClass) && this.cssClass.trim() !== '') {
8701
8715
  this.popupWrapper.className += ' ' + this.cssClass;
8702
8716
  }
8717
+ var appendToElement = this.getAppendToElement();
8703
8718
  if (this.isMobile && this.isCustomWindow) {
8704
8719
  this.modal = this.createElement('div');
8705
- document.body.appendChild(this.modal);
8720
+ appendToElement.appendChild(this.modal);
8706
8721
  }
8707
8722
  this.popupObj = new Popup(this.popupWrapper, {
8708
8723
  relateTo: this.isMobile && this.isCustomWindow ? document.body :
@@ -8827,7 +8842,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8827
8842
  }
8828
8843
  if (this.isMobile && this.isCustomWindow) {
8829
8844
  addClass([this.modal], [DEVICE$1, ROOT$2, 'e-range-modal']);
8830
- document.body.className += ' ' + OVERFLOW$1;
8845
+ appendToElement.className += ' ' + OVERFLOW$1;
8831
8846
  this.modal.style.display = 'block';
8832
8847
  }
8833
8848
  EventHandler.add(document, 'mousedown touchstart', this.documentHandler, this);
@@ -9683,6 +9698,16 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
9683
9698
  DateRangePicker.prototype.getModuleName = function () {
9684
9699
  return 'daterangepicker';
9685
9700
  };
9701
+ DateRangePicker.prototype.getAppendToElement = function () {
9702
+ if (this.isAngular) {
9703
+ var cdkPane = this.element.closest('.cdk-overlay-pane');
9704
+ var popoverEl = this.element.closest('[popover]');
9705
+ if (cdkPane && popoverEl) {
9706
+ return cdkPane;
9707
+ }
9708
+ }
9709
+ return document.body;
9710
+ };
9686
9711
  DateRangePicker.prototype.updateFloatLabelOverflowWidth = function () {
9687
9712
  var container = this.inputWrapper.container;
9688
9713
  var label = container.querySelector('.e-float-text.e-label-bottom');
@@ -9761,9 +9786,10 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
9761
9786
  this.targetElement = element;
9762
9787
  }
9763
9788
  this.createPopup();
9789
+ var appendToElement = this.getAppendToElement();
9764
9790
  if (this.isMobile || Browser.isDevice) {
9765
9791
  this.mobileRangePopupWrap = this.createElement('div', { className: 'e-daterangepick-mob-popup-wrap' });
9766
- document.body.appendChild(this.mobileRangePopupWrap);
9792
+ appendToElement.appendChild(this.mobileRangePopupWrap);
9767
9793
  }
9768
9794
  this.openEventArgs = {
9769
9795
  popup: this.popupObj || null,
@@ -9771,7 +9797,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
9771
9797
  date: this.inputElement.value,
9772
9798
  model: this,
9773
9799
  event: event ? event : null,
9774
- appendTo: this.isMobile || Browser.isDevice ? this.mobileRangePopupWrap : document.body
9800
+ appendTo: this.isMobile || Browser.isDevice ? this.mobileRangePopupWrap : appendToElement
9775
9801
  };
9776
9802
  var eventArgs = this.openEventArgs;
9777
9803
  this.trigger('open', eventArgs, function (eventArgs) {
@@ -9877,7 +9903,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
9877
9903
  }
9878
9904
  }
9879
9905
  _this.targetElement = null;
9880
- removeClass([document.body], OVERFLOW$1);
9906
+ var appendToElement = _this.getAppendToElement();
9907
+ removeClass([appendToElement], OVERFLOW$1);
9881
9908
  EventHandler.remove(document, 'mousedown touchstart', _this.documentHandler);
9882
9909
  if (_this.isMobile && _this.modal) {
9883
9910
  _this.modal.style.display = 'none';
@@ -11495,7 +11522,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
11495
11522
  cancel: false,
11496
11523
  name: 'open'
11497
11524
  };
11498
- removeClass([document.body], OVERFLOW$2);
11525
+ var appendToElement = this.getAppendToElement();
11526
+ removeClass([appendToElement], OVERFLOW$2);
11499
11527
  this.trigger('close', args, function (args) {
11500
11528
  if (!args.cancel) {
11501
11529
  var animModel = {
@@ -12596,22 +12624,23 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
12596
12624
  }
12597
12625
  else {
12598
12626
  this.popupCreation();
12627
+ var appendToElement = this.getAppendToElement();
12599
12628
  if (Browser.isDevice && this.listWrapper) {
12600
12629
  this.modal = this.createElement('div');
12601
12630
  this.modal.className = '' + ROOT$3 + ' e-time-modal';
12602
- document.body.className += ' ' + OVERFLOW$2;
12603
- document.body.appendChild(this.modal);
12631
+ appendToElement.className += ' ' + OVERFLOW$2;
12632
+ appendToElement.appendChild(this.modal);
12604
12633
  }
12605
12634
  if (Browser.isDevice) {
12606
12635
  this.mobileTimePopupWrap = this.createElement('div', { className: 'e-timepicker-mob-popup-wrap' });
12607
- document.body.appendChild(this.mobileTimePopupWrap);
12636
+ appendToElement.appendChild(this.mobileTimePopupWrap);
12608
12637
  }
12609
12638
  this.openPopupEventArgs = {
12610
12639
  popup: this.popupObj || null,
12611
12640
  cancel: false,
12612
12641
  event: event || null,
12613
12642
  name: 'open',
12614
- appendTo: Browser.isDevice ? this.mobileTimePopupWrap : document.body
12643
+ appendTo: Browser.isDevice ? this.mobileTimePopupWrap : appendToElement
12615
12644
  };
12616
12645
  var eventArgs = this.openPopupEventArgs;
12617
12646
  this.trigger('open', eventArgs, function (eventArgs) {
@@ -12742,6 +12771,16 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
12742
12771
  TimePicker.prototype.getModuleName = function () {
12743
12772
  return 'timepicker';
12744
12773
  };
12774
+ TimePicker.prototype.getAppendToElement = function () {
12775
+ if (this.isAngular) {
12776
+ var cdkPane = this.element.closest('.cdk-overlay-pane');
12777
+ var popoverEl = this.element.closest('[popover]');
12778
+ if (cdkPane && popoverEl) {
12779
+ return cdkPane;
12780
+ }
12781
+ }
12782
+ return document.body;
12783
+ };
12745
12784
  TimePicker.prototype.updateFloatLabelOverflowWidth = function () {
12746
12785
  var container = this.inputWrapper.container;
12747
12786
  var label = container.querySelector('.e-float-text.e-label-bottom');
@@ -13665,7 +13704,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
13665
13704
  this.listCreation();
13666
13705
  append([this.listWrapper], this.dateTimeWrapper);
13667
13706
  }
13668
- document.body.appendChild(this.dateTimeWrapper);
13707
+ var appendToElement = this.getAppendToElement();
13708
+ appendToElement.appendChild(this.dateTimeWrapper);
13669
13709
  this.addTimeSelection();
13670
13710
  this.renderPopup();
13671
13711
  this.setTimeScrollPosition();
@@ -13745,12 +13785,13 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
13745
13785
  DateTimePicker.prototype.renderPopup = function () {
13746
13786
  var _this = this;
13747
13787
  this.containerStyle = this.inputWrapper.container.getBoundingClientRect();
13788
+ var appendToElement = this.getAppendToElement();
13748
13789
  if (Browser.isDevice) {
13749
13790
  this.timeModal = createElement('div');
13750
13791
  this.timeModal.className = '' + ROOT$4 + ' e-time-modal';
13751
- document.body.className += ' ' + OVERFLOW$3;
13792
+ appendToElement.className += ' ' + OVERFLOW$3;
13752
13793
  this.timeModal.style.display = 'block';
13753
- document.body.appendChild(this.timeModal);
13794
+ appendToElement.appendChild(this.timeModal);
13754
13795
  }
13755
13796
  if (Browser.isDevice) {
13756
13797
  this.modelWrapper = createElement('div', { className: 'e-datetime-mob-popup-wrap' });
@@ -13758,7 +13799,7 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
13758
13799
  var dlgOverlay = createElement('div', { className: 'e-dlg-overlay' });
13759
13800
  dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
13760
13801
  this.modelWrapper.appendChild(dlgOverlay);
13761
- document.body.appendChild(this.modelWrapper);
13802
+ appendToElement.appendChild(this.modelWrapper);
13762
13803
  }
13763
13804
  var offset = 4;
13764
13805
  this.popupObject = new Popup(this.dateTimeWrapper, {
@@ -14240,7 +14281,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
14240
14281
  }
14241
14282
  else if (this.isTimePopupOpen()) {
14242
14283
  this.closePopup(e);
14243
- removeClass([document.body], OVERFLOW$3);
14284
+ var appendToElement = this.getAppendToElement();
14285
+ removeClass([appendToElement], OVERFLOW$3);
14244
14286
  if (Browser.isDevice && this.timeModal) {
14245
14287
  this.timeModal.style.display = 'none';
14246
14288
  this.timeModal.outerHTML = '';
@@ -14765,6 +14807,16 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
14765
14807
  DateTimePicker.prototype.getModuleName = function () {
14766
14808
  return 'datetimepicker';
14767
14809
  };
14810
+ DateTimePicker.prototype.getAppendToElement = function () {
14811
+ if (this.isAngular) {
14812
+ var cdkPane = this.element.closest('.cdk-overlay-pane');
14813
+ var popoverEl = this.element.closest('[popover]');
14814
+ if (cdkPane && popoverEl) {
14815
+ return cdkPane;
14816
+ }
14817
+ }
14818
+ return document.body;
14819
+ };
14768
14820
  DateTimePicker.prototype.restoreValue = function () {
14769
14821
  this.previousDateTime = this.previousDate;
14770
14822
  this.currentDate = this.value ? this.value : new Date();