@syncfusion/ej2-schedule 24.2.4 → 25.1.35

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/ej2-schedule.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +131 -59
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +131 -58
  8. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  9. package/dist/global/ej2-schedule.min.js +2 -2
  10. package/dist/global/ej2-schedule.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +16 -16
  13. package/src/schedule/actions/crud.js +6 -0
  14. package/src/schedule/actions/drag.js +3 -3
  15. package/src/schedule/actions/keyboard.d.ts +1 -0
  16. package/src/schedule/actions/keyboard.js +11 -4
  17. package/src/schedule/actions/resize.js +22 -21
  18. package/src/schedule/actions/virtual-scroll.js +4 -0
  19. package/src/schedule/base/interface.d.ts +1 -0
  20. package/src/schedule/base/schedule.d.ts +4 -1
  21. package/src/schedule/base/schedule.js +16 -1
  22. package/src/schedule/base/util.d.ts +21 -0
  23. package/src/schedule/base/util.js +29 -2
  24. package/src/schedule/event-renderer/event-base.d.ts +0 -1
  25. package/src/schedule/event-renderer/event-base.js +0 -3
  26. package/src/schedule/event-renderer/inline-edit.js +1 -1
  27. package/src/schedule/event-renderer/month.js +2 -2
  28. package/src/schedule/event-renderer/timeline-view.js +5 -5
  29. package/src/schedule/event-renderer/vertical-view.js +1 -1
  30. package/src/schedule/event-renderer/year.js +3 -3
  31. package/src/schedule/popups/quick-popups.js +11 -0
  32. package/src/schedule/renderer/renderer.js +11 -3
  33. package/src/schedule/renderer/timeline-view.d.ts +0 -1
  34. package/src/schedule/renderer/timeline-view.js +3 -6
  35. package/src/schedule/renderer/vertical-view.js +1 -1
  36. package/src/schedule/renderer/view-base.js +1 -1
  37. package/styles/bootstrap-dark.css +51 -2
  38. package/styles/bootstrap.css +51 -2
  39. package/styles/bootstrap4.css +48 -3
  40. package/styles/bootstrap5-dark.css +48 -3
  41. package/styles/bootstrap5.css +48 -3
  42. package/styles/fabric-dark.css +47 -2
  43. package/styles/fabric.css +47 -2
  44. package/styles/fluent-dark.css +52 -2
  45. package/styles/fluent.css +52 -2
  46. package/styles/highcontrast-light.css +47 -2
  47. package/styles/highcontrast.css +47 -2
  48. package/styles/material-dark.css +47 -2
  49. package/styles/material.css +47 -2
  50. package/styles/material3-dark.css +48 -3
  51. package/styles/material3.css +48 -3
  52. package/styles/recurrence-editor/_bds-definition.scss +15 -0
  53. package/styles/schedule/_bds-definition.scss +287 -0
  54. package/styles/schedule/_bootstrap-dark-definition.scss +1 -0
  55. package/styles/schedule/_bootstrap-definition.scss +1 -0
  56. package/styles/schedule/_bootstrap4-definition.scss +2 -1
  57. package/styles/schedule/_bootstrap5-definition.scss +2 -1
  58. package/styles/schedule/_fabric-dark-definition.scss +1 -0
  59. package/styles/schedule/_fabric-definition.scss +1 -0
  60. package/styles/schedule/_fluent-definition.scss +1 -0
  61. package/styles/schedule/_fusionnew-definition.scss +2 -1
  62. package/styles/schedule/_highcontrast-definition.scss +1 -0
  63. package/styles/schedule/_highcontrast-light-definition.scss +1 -0
  64. package/styles/schedule/_layout.scss +60 -1
  65. package/styles/schedule/_material-dark-definition.scss +1 -0
  66. package/styles/schedule/_material-definition.scss +1 -0
  67. package/styles/schedule/_material3-definition.scss +2 -1
  68. package/styles/schedule/_tailwind-definition.scss +2 -1
  69. package/styles/schedule/bootstrap-dark.css +51 -2
  70. package/styles/schedule/bootstrap.css +51 -2
  71. package/styles/schedule/bootstrap4.css +48 -3
  72. package/styles/schedule/bootstrap5-dark.css +48 -3
  73. package/styles/schedule/bootstrap5.css +48 -3
  74. package/styles/schedule/fabric-dark.css +47 -2
  75. package/styles/schedule/fabric.css +47 -2
  76. package/styles/schedule/fluent-dark.css +52 -2
  77. package/styles/schedule/fluent.css +52 -2
  78. package/styles/schedule/highcontrast-light.css +47 -2
  79. package/styles/schedule/highcontrast.css +47 -2
  80. package/styles/schedule/icons/_bds.scss +235 -0
  81. package/styles/schedule/material-dark.css +47 -2
  82. package/styles/schedule/material.css +47 -2
  83. package/styles/schedule/material3-dark.css +48 -3
  84. package/styles/schedule/material3.css +48 -3
  85. package/styles/schedule/tailwind-dark.css +48 -3
  86. package/styles/schedule/tailwind.css +48 -3
  87. package/styles/tailwind-dark.css +48 -3
  88. package/styles/tailwind.css +48 -3
  89. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -63
  90. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -39
@@ -115,7 +115,7 @@ function getElementHeightFromClass(container, elementClass) {
115
115
  el.style.visibility = 'hidden';
116
116
  el.style.position = 'absolute';
117
117
  container.appendChild(el);
118
- height = el.getBoundingClientRect().height;
118
+ height = getElementHeight(el);
119
119
  remove(el);
120
120
  return height;
121
121
  }
@@ -132,7 +132,7 @@ function getElementWidthFromClass(container, elementClass) {
132
132
  el.style.visibility = 'hidden';
133
133
  el.style.position = 'absolute';
134
134
  container.appendChild(el);
135
- width = el.getBoundingClientRect().width;
135
+ width = getElementWidth(el);
136
136
  remove(el);
137
137
  return width;
138
138
  }
@@ -519,6 +519,33 @@ function capitalizeFirstWord(inputString, type) {
519
519
  }
520
520
  return inputString;
521
521
  }
522
+ /**
523
+ * Method to get element cell width
524
+ *
525
+ * @param {HTMLElement} element Accepts the DOM element
526
+ * @returns {number} Returns the width of the given element
527
+ */
528
+ function getElementWidth(element) {
529
+ return document.body.style.transform.includes('scale') ? element.offsetWidth : element.getBoundingClientRect().width;
530
+ }
531
+ /**
532
+ * Method to get element cell Height
533
+ *
534
+ * @param {HTMLElement} element Accepts the DOM element
535
+ * @returns {number} Returns the Height of the given element
536
+ */
537
+ function getElementHeight(element) {
538
+ return document.body.style.transform.includes('scale') ? element.offsetHeight : element.getBoundingClientRect().height;
539
+ }
540
+ /**
541
+ * Method to get element cell Top
542
+ *
543
+ * @param {HTMLElement} element Accepts the DOM element
544
+ * @returns {number} Returns the top value of the given element
545
+ */
546
+ function getElementTop(element) {
547
+ return document.body.style.transform.includes('scale') ? element.offsetTop : element.getBoundingClientRect().top;
548
+ }
522
549
 
523
550
  /**
524
551
  * CSS Constants
@@ -2539,6 +2566,13 @@ class KeyboardInteraction {
2539
2566
  }
2540
2567
  }
2541
2568
  }
2569
+ isCalendarTarget(e) {
2570
+ const keyTarget = e.currentTarget || e.target;
2571
+ if (keyTarget && !isNullOrUndefined(keyTarget.querySelector('.e-header-popup.e-popup-open'))) {
2572
+ return true;
2573
+ }
2574
+ return false;
2575
+ }
2542
2576
  cancelUpDownAction(isTimelineYear) {
2543
2577
  const isVerticalYear = isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical';
2544
2578
  const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
@@ -2552,7 +2586,7 @@ class KeyboardInteraction {
2552
2586
  }
2553
2587
  processUp(e, isMultiple) {
2554
2588
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2555
- if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2589
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear) || (this.isCalendarTarget(e))) {
2556
2590
  return;
2557
2591
  }
2558
2592
  let target = (e.target);
@@ -2600,7 +2634,7 @@ class KeyboardInteraction {
2600
2634
  }
2601
2635
  processDown(e, isMultiple) {
2602
2636
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2603
- if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2637
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear) || (this.isCalendarTarget(e))) {
2604
2638
  return;
2605
2639
  }
2606
2640
  let target = (e.target);
@@ -2710,7 +2744,7 @@ class KeyboardInteraction {
2710
2744
  }
2711
2745
  processRight(e, isMultiple) {
2712
2746
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2713
- if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2747
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear) || (this.isCalendarTarget(e))) {
2714
2748
  return;
2715
2749
  }
2716
2750
  const selectedCells = this.parent.getSelectedCells();
@@ -2781,7 +2815,7 @@ class KeyboardInteraction {
2781
2815
  }
2782
2816
  processLeft(e, isMultiple) {
2783
2817
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2784
- if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2818
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear) || (this.isCalendarTarget(e))) {
2785
2819
  return;
2786
2820
  }
2787
2821
  let target = (e.target);
@@ -6666,9 +6700,6 @@ class EventBase {
6666
6700
  }
6667
6701
  }
6668
6702
  }
6669
- getCellWidth(element) {
6670
- return document.body.style.transform.includes('scale') ? parseFloat(window.getComputedStyle(element).width) : element.getBoundingClientRect().width;
6671
- }
6672
6703
  unWireEvents() {
6673
6704
  const appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
6674
6705
  for (const element of appElements) {
@@ -6772,7 +6803,7 @@ class VerticalEvent extends EventBase {
6772
6803
  this.resources = this.parent.resourceBase.renderedResources;
6773
6804
  }
6774
6805
  this.cellHeight =
6775
- parseFloat(this.parent.element.querySelector('.e-content-wrap tbody tr').getBoundingClientRect().height.toFixed(2));
6806
+ parseFloat(getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
6776
6807
  this.dateRender[0] = this.parent.activeView.renderDates;
6777
6808
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6778
6809
  for (let i = 0, len = this.resources.length; i < len; i++) {
@@ -7645,8 +7676,8 @@ class MonthEvent extends EventBase {
7645
7676
  });
7646
7677
  }
7647
7678
  const cellDetail = this.workCells[this.parent.activeView.isTimelineView() ? 0 : this.workCells.length - 1];
7648
- this.cellWidth = this.parent.eventBase.getCellWidth(cellDetail);
7649
- this.cellHeight = cellDetail.getBoundingClientRect().height;
7679
+ this.cellWidth = getElementWidth(cellDetail);
7680
+ this.cellHeight = getElementHeight(cellDetail);
7650
7681
  this.dateRender = dateRender;
7651
7682
  const filteredDates = this.getRenderedDates(dateRender);
7652
7683
  this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
@@ -8191,7 +8222,7 @@ class TimelineEvent extends MonthEvent {
8191
8222
  this.eventContainers = [].slice.call(this.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
8192
8223
  const tr = [].slice.call(this.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr'));
8193
8224
  this.dayLength = tr.length === 0 ? 0 : tr[0].children.length;
8194
- this.content = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS);
8225
+ this.content = this.parent.element.querySelector('.' + SCHEDULE_TABLE_CLASS + '.' + CONTENT_TABLE_CLASS);
8195
8226
  }
8196
8227
  getSlotDates() {
8197
8228
  this.slots = [];
@@ -8200,7 +8231,7 @@ class TimelineEvent extends MonthEvent {
8200
8231
  this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
8201
8232
  this.renderType = 'day';
8202
8233
  const workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
8203
- this.cellWidth = workCell.getBoundingClientRect().width / +(workCell.getAttribute('colspan') || 1);
8234
+ this.cellWidth = getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
8204
8235
  this.slotsPerDay = 1;
8205
8236
  }
8206
8237
  else {
@@ -8353,14 +8384,14 @@ class TimelineEvent extends MonthEvent {
8353
8384
  this.wireAppointmentEvents(appointmentElement, event);
8354
8385
  if (this.parent.rowAutoHeight) {
8355
8386
  const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
8356
- const conWidth = conWrap.getBoundingClientRect().width;
8387
+ const conWidth = getElementWidth(conWrap);
8357
8388
  const isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
8358
8389
  conWrap.offsetWidth === conWrap.clientWidth;
8359
8390
  this.renderEventElement(event, appointmentElement, cellTd);
8360
8391
  const firstChild = this.getFirstChild(resIndex);
8361
8392
  this.updateCellHeight(firstChild, height);
8362
8393
  if (isWithoutScroll &&
8363
- (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== conWrap.getBoundingClientRect().width)) {
8394
+ (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== getElementWidth(conWrap))) {
8364
8395
  this.adjustAppointments(conWidth);
8365
8396
  }
8366
8397
  }
@@ -8478,7 +8509,7 @@ class TimelineEvent extends MonthEvent {
8478
8509
  }
8479
8510
  adjustAppointments(conWidth) {
8480
8511
  const tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
8481
- const actualCellWidth = this.workCells[0].getBoundingClientRect().width;
8512
+ const actualCellWidth = getElementWidth(this.workCells[0]);
8482
8513
  this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
8483
8514
  const currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
8484
8515
  const apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
@@ -8833,7 +8864,7 @@ class InlineEdit {
8833
8864
  const allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_APPOINTMENT_CLASS));
8834
8865
  let allDayLevel = 0;
8835
8866
  if (allDayElements.length > 0) {
8836
- allDayLevel = Math.floor(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS).getBoundingClientRect().height /
8867
+ allDayLevel = Math.floor(getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
8837
8868
  allDayElements[0].offsetHeight) - 1;
8838
8869
  }
8839
8870
  verticalEvent.allDayLevel = allDayLevel;
@@ -10402,6 +10433,17 @@ class QuickPopups {
10402
10433
  instance.destroy();
10403
10434
  }
10404
10435
  }
10436
+ if (popupName === 'quickPopup') {
10437
+ const input = popup.element.querySelector('input.' + SUBJECT_CLASS);
10438
+ if (input) {
10439
+ input.remove();
10440
+ }
10441
+ const form = this.quickPopup.element.querySelector('form.' + FORM_CLASS);
10442
+ if (form) {
10443
+ removeChildren(form);
10444
+ form.remove();
10445
+ }
10446
+ }
10405
10447
  }
10406
10448
  refreshQuickDialog() {
10407
10449
  this.destroyQuickDialog();
@@ -13711,6 +13753,10 @@ class VirtualScroll {
13711
13753
  this.renderedLength = conTable.querySelector('tbody').children.length;
13712
13754
  virtual.style.height = (conTable.offsetHeight + (this.parent.resourceBase.expandedResources.length - (this.renderedLength)) *
13713
13755
  conTable.offsetHeight / this.renderedLength) + 'px';
13756
+ const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
13757
+ if ((conWrap.scrollHeight - conWrap.scrollTop) < conWrap.offsetHeight * this.bufferCount) {
13758
+ virtual.style.height = parseInt(virtual.style.height) + (conWrap.offsetHeight * this.bufferCount) + 'px';
13759
+ }
13714
13760
  }
13715
13761
  else {
13716
13762
  virtual.style.height = '';
@@ -14135,15 +14181,21 @@ class Render {
14135
14181
  break;
14136
14182
  case 'TimelineDay':
14137
14183
  this.parent.activeView = this.parent.timelineViewsModule;
14138
- this.parent.activeView.viewClass = 'e-timeline-day-view';
14184
+ if (!isNullOrUndefined(this.parent.activeView)) {
14185
+ this.parent.activeView.viewClass = 'e-timeline-day-view';
14186
+ }
14139
14187
  break;
14140
14188
  case 'TimelineWorkWeek':
14141
14189
  this.parent.activeView = this.parent.timelineViewsModule;
14142
- this.parent.activeView.viewClass = 'e-timeline-work-week-view';
14190
+ if (!isNullOrUndefined(this.parent.activeView)) {
14191
+ this.parent.activeView.viewClass = 'e-timeline-work-week-view';
14192
+ }
14143
14193
  break;
14144
14194
  case 'TimelineWeek':
14145
14195
  this.parent.activeView = this.parent.timelineViewsModule;
14146
- this.parent.activeView.viewClass = 'e-timeline-week-view';
14196
+ if (!isNullOrUndefined(this.parent.activeView)) {
14197
+ this.parent.activeView.viewClass = 'e-timeline-week-view';
14198
+ }
14147
14199
  break;
14148
14200
  case 'TimelineMonth':
14149
14201
  this.parent.activeView = this.parent.timelineMonthModule;
@@ -14160,6 +14212,8 @@ class Render {
14160
14212
  this.parent.headerModule.updateActiveView();
14161
14213
  this.parent.headerModule.setCalendarView();
14162
14214
  }
14215
+ console.warn('[WARNING] :: Module "' + viewName + '" is not available in Schedule component!' +
14216
+ ' You either misspelled the module name or forgot to load it.');
14163
14217
  return this.initializeLayout(firstView);
14164
14218
  }
14165
14219
  throw Error('Inject required modules');
@@ -14337,6 +14391,12 @@ class Crud {
14337
14391
  if (!this.parent.activeView) {
14338
14392
  return;
14339
14393
  }
14394
+ if (this.parent.uiStateValues && this.parent.uiStateValues.isPreventEventRefresh) {
14395
+ this.parent.uiStateValues.isPreventEventRefresh = false;
14396
+ this.parent.refreshEvents(false);
14397
+ this.parent.hideSpinner();
14398
+ return;
14399
+ }
14340
14400
  const start = this.parent.activeView.startDate();
14341
14401
  const end = this.parent.activeView.endDate();
14342
14402
  const dataManager = this.parent.dataModule.getData(this.parent.dataModule.generateQuery(start, end));
@@ -18400,9 +18460,13 @@ let Schedule = class Schedule extends Component {
18400
18460
  *
18401
18461
  * @function setResourceCollections
18402
18462
  * @param {ResourcesModel[]} resourceCol Accepts the resource collections in ResourcesModel type
18463
+ * @param {boolean} isEventDataRefresh Accepts the boolean to refresh the appointment data source from remote or local
18403
18464
  * @returns {void}
18404
18465
  */
18405
- setResourceCollections(resourceCol) {
18466
+ setResourceCollections(resourceCol, isEventDataRefresh = true) {
18467
+ if (!isEventDataRefresh && this.uiStateValues) {
18468
+ this.uiStateValues.isPreventEventRefresh = true;
18469
+ }
18406
18470
  this.setProperties({ resources: resourceCol }, false);
18407
18471
  }
18408
18472
  /**
@@ -18522,6 +18586,8 @@ let Schedule = class Schedule extends Component {
18522
18586
  this.iCalendarExportModule.initializeCalendarExport(fileName, customData);
18523
18587
  }
18524
18588
  else {
18589
+ console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component!' +
18590
+ ' You either misspelled the module name or forgot to load it.');
18525
18591
  throw Error('Inject ICalendarExport module');
18526
18592
  }
18527
18593
  }
@@ -18538,6 +18604,8 @@ let Schedule = class Schedule extends Component {
18538
18604
  this.iCalendarImportModule.initializeCalendarImport(fileContent);
18539
18605
  }
18540
18606
  else {
18607
+ console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component!' +
18608
+ ' You either misspelled the module name or forgot to load it.');
18541
18609
  throw Error('Inject ICalendarImport module');
18542
18610
  }
18543
18611
  }
@@ -18583,6 +18651,8 @@ let Schedule = class Schedule extends Component {
18583
18651
  this.excelExportModule.initializeExcelExport(excelExportOptions);
18584
18652
  }
18585
18653
  else {
18654
+ console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component!' +
18655
+ ' You either misspelled the module name or forgot to load it.');
18586
18656
  throw Error('Inject ExcelExport module');
18587
18657
  }
18588
18658
  }
@@ -18599,6 +18669,8 @@ let Schedule = class Schedule extends Component {
18599
18669
  this.printModule.print(printOptions);
18600
18670
  }
18601
18671
  else {
18672
+ console.warn('[WARNING] :: Module "Print" is not available in Schedule component!' +
18673
+ ' You either misspelled the module name or forgot to load it.');
18602
18674
  throw Error('Inject Print module');
18603
18675
  }
18604
18676
  }
@@ -18881,6 +18953,8 @@ let Schedule = class Schedule extends Component {
18881
18953
  }
18882
18954
  /**
18883
18955
  * To check whether the given time range slots are available for event creation or already occupied by other events.
18956
+ * This method currently focuses on validating appointments within the current view date range.
18957
+ * However, it does not extend this availability check to recurrence occurrences outside of the current date range.
18884
18958
  *
18885
18959
  * @function isSlotAvailable
18886
18960
  * @param {Date | Object} startTime Denotes the start time of the slot.
@@ -19947,9 +20021,9 @@ class Resize extends ActionBase {
19947
20021
  bottom: resizeTarget.classList.contains(BOTTOM_RESIZE_HANDLER)
19948
20022
  };
19949
20023
  this.actionObj.groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : 0;
19950
- const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect();
19951
- this.actionObj.cellWidth = workCell.width;
19952
- this.actionObj.cellHeight = workCell.height;
20024
+ const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
20025
+ this.actionObj.cellWidth = getElementWidth(workCell);
20026
+ this.actionObj.cellHeight = getElementHeight(workCell);
19953
20027
  const hRows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
19954
20028
  if (this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
19955
20029
  const tr = this.parent.getContentTable().querySelector('tr');
@@ -20243,9 +20317,9 @@ class Resize extends ActionBase {
20243
20317
  parseInt(this.actionObj.clone.style.left, 10);
20244
20318
  offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
20245
20319
  if (!isLeft) {
20246
- offsetValue += (this.actionObj.clone.getBoundingClientRect().width - this.actionObj.cellWidth);
20320
+ offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
20247
20321
  }
20248
- cellIndex = Math.floor(offsetValue / Math.floor(tr.getBoundingClientRect().width / noOfDays));
20322
+ cellIndex = Math.floor(offsetValue / Math.floor(getElementWidth(tr) / noOfDays));
20249
20323
  isDateHeader = isTimeViews && headerName === 'Date';
20250
20324
  cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
20251
20325
  isLastCell = cellIndex === tdCollections.length;
@@ -20254,7 +20328,7 @@ class Resize extends ActionBase {
20254
20328
  else {
20255
20329
  const cellWidth = this.actionObj.cellWidth;
20256
20330
  cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
20257
- Math.ceil((offset + (this.actionObj.clone.getBoundingClientRect().width - cellWidth)) / this.actionObj.cellWidth);
20331
+ Math.ceil((offset + (getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
20258
20332
  if (this.parent.enableRtl) {
20259
20333
  let cellOffsetWidth = 0;
20260
20334
  if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
@@ -20262,7 +20336,7 @@ class Resize extends ActionBase {
20262
20336
  cellOffsetWidth = this.actionObj.cellWidth;
20263
20337
  }
20264
20338
  const offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
20265
- this.actionObj.cellWidth) + (isLeft ? 0 : this.actionObj.clone.getBoundingClientRect().width - cellOffsetWidth);
20339
+ this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
20266
20340
  cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
20267
20341
  }
20268
20342
  isLastCell = cellIndex === tdCollections.length;
@@ -20281,7 +20355,7 @@ class Resize extends ActionBase {
20281
20355
  }
20282
20356
  else {
20283
20357
  if (!isLeft) {
20284
- offset += this.actionObj.clone.getBoundingClientRect().width;
20358
+ offset += getElementWidth(this.actionObj.clone);
20285
20359
  }
20286
20360
  let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
20287
20361
  (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
@@ -20293,9 +20367,9 @@ class Resize extends ActionBase {
20293
20367
  }
20294
20368
  else {
20295
20369
  const cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
20296
- const originalWidth = Math.ceil((isLeft ? this.actionObj.element.getBoundingClientRect().width : 0) /
20370
+ const originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
20297
20371
  this.actionObj.cellWidth) * this.actionObj.cellWidth;
20298
- const noOfDays = Math.ceil((this.actionObj.clone.getBoundingClientRect().width - originalWidth) /
20372
+ const noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
20299
20373
  this.actionObj.cellWidth);
20300
20374
  const tr = closest(this.actionObj.clone, 'tr');
20301
20375
  let dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
@@ -20358,23 +20432,24 @@ class Resize extends ActionBase {
20358
20432
  const slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
20359
20433
  const pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
20360
20434
  const targetWidth = isTimelineView ?
20361
- (this.actionObj.element.getBoundingClientRect().width / this.actionObj.cellWidth) * this.actionObj.cellWidth :
20362
- this.parent.currentView === 'Month' ? this.actionObj.element.getBoundingClientRect().width :
20363
- Math.ceil(this.actionObj.element.getBoundingClientRect().width / this.actionObj.cellWidth) * this.actionObj.cellWidth;
20435
+ (getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
20436
+ this.parent.currentView === 'Month' ? getElementWidth(this.actionObj.element) :
20437
+ Math.ceil(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
20364
20438
  let offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
20365
20439
  const left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
20366
20440
  if (isTimeViews) {
20367
20441
  offsetWidth = targetWidth + (Math.ceil(pageWidth / slotInterval) * slotInterval);
20368
20442
  if (!isLeft) {
20369
20443
  const roundedLeft = (+parseFloat(this.actionObj.element.style[this.parent.enableRtl ? 'right' : 'left'])).toFixed(1);
20370
- if (roundedLeft !== left.toFixed(1)) {
20444
+ const roundedWidth = Math.round(targetWidth / slotInterval) * slotInterval;
20445
+ if (roundedLeft !== left.toFixed(1) || roundedWidth !== targetWidth) {
20371
20446
  offsetWidth = (Math.round((left + offsetWidth) / slotInterval) * slotInterval) - left;
20372
20447
  }
20373
20448
  }
20374
20449
  this.actionObj.event[this.parent.eventFields.isAllDay] = false;
20375
20450
  }
20376
20451
  let width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
20377
- this.actionObj.clone.getBoundingClientRect().width : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
20452
+ getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
20378
20453
  if (this.parent.enableRtl) {
20379
20454
  let rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
20380
20455
  -(offsetWidth - this.actionObj.cellWidth);
@@ -20388,7 +20463,7 @@ class Resize extends ActionBase {
20388
20463
  }
20389
20464
  rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
20390
20465
  styles.right = formatUnit(rightValue);
20391
- width = width + rightValue > this.scrollArgs.width ? this.actionObj.clone.getBoundingClientRect().width : width;
20466
+ width = width + rightValue > this.scrollArgs.width ? getElementWidth(this.actionObj.clone) : width;
20392
20467
  }
20393
20468
  else {
20394
20469
  let offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
@@ -20396,12 +20471,12 @@ class Resize extends ActionBase {
20396
20471
  if (isTimelineView) {
20397
20472
  offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
20398
20473
  if (this.parent.enableRtl) {
20399
- offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.actionObj.clone.getBoundingClientRect().width)
20474
+ offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - getElementWidth(this.actionObj.clone))
20400
20475
  ? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
20401
20476
  }
20402
20477
  else {
20403
- offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.actionObj.clone.getBoundingClientRect().width &&
20404
- this.actionObj.clone.getBoundingClientRect().width === this.actionObj.cellWidth) ?
20478
+ offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
20479
+ getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
20405
20480
  parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
20406
20481
  }
20407
20482
  }
@@ -20417,10 +20492,10 @@ class Resize extends ActionBase {
20417
20492
  }
20418
20493
  else {
20419
20494
  offsetLeft = 0;
20420
- width = this.actionObj.clone.getBoundingClientRect().width;
20495
+ width = getElementWidth(this.actionObj.clone);
20421
20496
  }
20422
20497
  }
20423
- const cloneWidth = Math.ceil(this.actionObj.clone.getBoundingClientRect().width / this.actionObj.cellWidth) *
20498
+ const cloneWidth = Math.ceil(getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
20424
20499
  this.actionObj.cellWidth;
20425
20500
  if (isLeft) {
20426
20501
  styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
@@ -20533,7 +20608,7 @@ class YearEvent extends TimelineEvent {
20533
20608
  }
20534
20609
  timelineYearViewEvents() {
20535
20610
  const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
20536
- this.cellWidth = this.parent.eventBase.getCellWidth(workCell);
20611
+ this.cellWidth = getElementWidth(workCell);
20537
20612
  this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
20538
20613
  const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
20539
20614
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
@@ -20682,7 +20757,7 @@ class YearEvent extends TimelineEvent {
20682
20757
  const contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
20683
20758
  const isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
20684
20759
  const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
20685
- this.cellWidth = workCell.getBoundingClientRect().width;
20760
+ this.cellWidth = getElementWidth(workCell);
20686
20761
  this.cellHeader = 0;
20687
20762
  const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
20688
20763
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
@@ -20727,7 +20802,7 @@ class YearEvent extends TimelineEvent {
20727
20802
  appWrapper.forEach((appWrap, cellIndex) => {
20728
20803
  const td = row.querySelector(`td:nth-child(${cellIndex + 1})`);
20729
20804
  const app = [].slice.call(appWrap.children);
20730
- const width = td.getBoundingClientRect().width;
20805
+ const width = getElementWidth(td);
20731
20806
  const left = td.offsetLeft;
20732
20807
  if (this.parent.enableRtl) {
20733
20808
  const right = conTable.offsetWidth - left - td.offsetWidth;
@@ -21451,7 +21526,7 @@ class DragAndDrop extends ActionBase {
21451
21526
  this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
21452
21527
  this.timelineEventModule.getSlotDates();
21453
21528
  this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
21454
- this.parent.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect().width;
21529
+ getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
21455
21530
  this.calculateTimelineTime(e);
21456
21531
  }
21457
21532
  else {
@@ -22263,7 +22338,7 @@ class DragAndDrop extends ActionBase {
22263
22338
  ~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
22264
22339
  let rowIndex = Math.floor(Math.floor((this.actionObj.Y +
22265
22340
  (dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
22266
- dragArea.getBoundingClientRect().top) / rowHeight);
22341
+ getElementTop(dragArea)) / rowHeight);
22267
22342
  rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
22268
22343
  this.actionObj.index = rowIndex;
22269
22344
  const eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
@@ -22279,7 +22354,7 @@ class DragAndDrop extends ActionBase {
22279
22354
  if (!isNullOrUndefined(this.parent.eventDragArea)) {
22280
22355
  return;
22281
22356
  }
22282
- let top = trCollection[parseInt(rowIndex.toString(), 10)].getBoundingClientRect().height * rowIndex;
22357
+ let top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
22283
22358
  if (this.parent.rowAutoHeight) {
22284
22359
  const cursorElement = this.getCursorElement(e);
22285
22360
  if (cursorElement) {
@@ -22792,7 +22867,7 @@ class ViewBase {
22792
22867
  if (this.isTimelineView()) {
22793
22868
  const colElements = this.getColElements();
22794
22869
  const contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
22795
- const colWidth = (contentBody.getBoundingClientRect().width / (colElements.length / 2));
22870
+ const colWidth = (getElementWidth(contentBody) / (colElements.length / 2));
22796
22871
  if (content.offsetHeight !== content.clientHeight) {
22797
22872
  const resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
22798
22873
  if (!isNullOrUndefined(resourceColumn)) {
@@ -23273,7 +23348,7 @@ class VerticalView extends ViewBase {
23273
23348
  this.parent.activeViewOptions.timeScale.interval;
23274
23349
  }
23275
23350
  getWorkCellHeight() {
23276
- return parseFloat(this.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect().height.toFixed(2));
23351
+ return parseFloat(getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
23277
23352
  }
23278
23353
  getTdContent(date, type, groupIndex) {
23279
23354
  let cntEle;
@@ -23660,7 +23735,7 @@ class VerticalView extends ViewBase {
23660
23735
  const msStartHour = startHour.getTime();
23661
23736
  const msEndHour = endHour.getTime();
23662
23737
  if (msStartHour !== msEndHour) {
23663
- let milliSeconds = (startHour.getTimezoneOffset() !== endHour.getTimezoneOffset()) ?
23738
+ const milliSeconds = (startHour.getTimezoneOffset() !== endHour.getTimezoneOffset()) ?
23664
23739
  (msEndHour - msStartHour) - 3600000 : (msEndHour - msStartHour);
23665
23740
  length = Math.round(milliSeconds / msInterval);
23666
23741
  }
@@ -26059,7 +26134,7 @@ class TimelineViews extends VerticalView {
26059
26134
  }
26060
26135
  let scrollLeft;
26061
26136
  if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
26062
- scrollLeft = index * this.getWorkCellWidth();
26137
+ scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
26063
26138
  }
26064
26139
  else {
26065
26140
  scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
@@ -26143,7 +26218,7 @@ class TimelineViews extends VerticalView {
26143
26218
  if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
26144
26219
  this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
26145
26220
  diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
26146
- this.getWorkCellWidth();
26221
+ getElementWidth(this.element.querySelector('.e-work-cells'));
26147
26222
  }
26148
26223
  else {
26149
26224
  const endHour = this.getEndHour();
@@ -26153,12 +26228,9 @@ class TimelineViews extends VerticalView {
26153
26228
  }
26154
26229
  }
26155
26230
  }
26156
- return diffInDates + ((diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
26231
+ return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells')) * this.parent.activeViewOptions.timeScale.slotCount) /
26157
26232
  this.parent.activeViewOptions.timeScale.interval);
26158
26233
  }
26159
- getWorkCellWidth() {
26160
- return this.element.querySelector('.e-work-cells').getBoundingClientRect().width;
26161
- }
26162
26234
  renderHeader() {
26163
26235
  const tr = createElement('tr');
26164
26236
  if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
@@ -27533,5 +27605,5 @@ class Print {
27533
27605
  * Export Schedule components
27534
27606
  */
27535
27607
 
27536
- export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventDoubleClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, cellSelect, virtualScrollStart, virtualScrollStop, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getElementWidthFromClass, getTranslateY, getTranslateX, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, resetScrollbarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
27608
+ export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventDoubleClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, cellSelect, virtualScrollStart, virtualScrollStop, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getElementWidthFromClass, getTranslateY, getTranslateX, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, resetScrollbarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, getElementWidth, getElementHeight, getElementTop, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
27537
27609
  //# sourceMappingURL=ej2-schedule.es2015.js.map