@syncfusion/ej2-schedule 31.1.21 → 31.2.2

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,7 +1,7 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 31.1.21
4
- * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
3
+ * version : 31.2.2
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
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-schedule",
3
- "version": "31.1.21",
3
+ "version": "31.2.2",
4
4
  "author": "Syncfusion Inc.",
5
5
  "license": "SEE LICENSE IN license",
6
6
  "main": "./dist/ej2-schedule.umd.min.js",
7
7
  "module": "./index.js",
8
8
  "es2015": "./dist/es6/ej2-schedule.es5.js",
9
9
  "dependencies": {
10
- "@syncfusion/ej2-base": "~31.1.20",
11
- "@syncfusion/ej2-buttons": "~31.1.21",
12
- "@syncfusion/ej2-calendars": "~31.1.21",
13
- "@syncfusion/ej2-data": "~31.1.17",
14
- "@syncfusion/ej2-dropdowns": "~31.1.20",
15
- "@syncfusion/ej2-excel-export": "~31.1.17",
16
- "@syncfusion/ej2-inputs": "~31.1.21",
17
- "@syncfusion/ej2-lists": "~31.1.17",
18
- "@syncfusion/ej2-navigations": "~31.1.20",
19
- "@syncfusion/ej2-popups": "~31.1.20"
10
+ "@syncfusion/ej2-base": "~31.2.2",
11
+ "@syncfusion/ej2-buttons": "~31.2.2",
12
+ "@syncfusion/ej2-calendars": "~31.2.2",
13
+ "@syncfusion/ej2-data": "~31.2.2",
14
+ "@syncfusion/ej2-dropdowns": "~31.2.2",
15
+ "@syncfusion/ej2-excel-export": "~31.2.2",
16
+ "@syncfusion/ej2-inputs": "~31.2.2",
17
+ "@syncfusion/ej2-lists": "~31.2.2",
18
+ "@syncfusion/ej2-navigations": "~31.2.2",
19
+ "@syncfusion/ej2-popups": "~31.2.2"
20
20
  },
21
21
  "devDependencies": {},
22
22
  "description": "Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support.",
@@ -45,6 +45,7 @@ export declare class VirtualScroll {
45
45
  private updateHorizontalContent;
46
46
  private updateMonthViewContent;
47
47
  private updateOtherViewContent;
48
+ private getIdentifier;
48
49
  private mergeNewTdData;
49
50
  private getBufferCollection;
50
51
  private setTranslate;
@@ -88,7 +88,13 @@ var VirtualScroll = /** @class */ (function () {
88
88
  };
89
89
  VirtualScroll.prototype.setItemSize = function () {
90
90
  if (this.isHorizontalScroll) {
91
- this.itemSize = util.getElementWidthFromClass(this.parent.activeView.element, cls.WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
91
+ if (this.parent.group.byDate) {
92
+ var colElement = this.parent.element.querySelector('.' + cls.DATE_HEADER_WRAP_CLASS + ' table col');
93
+ this.itemSize = colElement ? util.getElementWidth(colElement, this.parent.uiStateValues.isTransformed) : this.itemSize;
94
+ }
95
+ else {
96
+ this.itemSize = util.getElementWidthFromClass(this.parent.activeView.element, cls.WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
97
+ }
92
98
  }
93
99
  else {
94
100
  this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, cls.WORK_CELLS_CLASS) || this.itemSize;
@@ -448,17 +454,19 @@ var VirtualScroll = /** @class */ (function () {
448
454
  append(contentRows, conWrap.querySelector('tbody'));
449
455
  };
450
456
  VirtualScroll.prototype.updateOtherViewContent = function (conWrap, resCollection, renderedRows) {
457
+ var _this = this;
451
458
  var tbody = conWrap.querySelector('tbody');
452
459
  var colGroup = conWrap.querySelector('colgroup');
453
460
  var thead = conWrap.querySelector('thead');
454
461
  var table = conWrap.querySelector('table');
455
462
  this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
456
- var newGroupIndices = new Set(resCollection.map(function (data) { return data.groupIndex; }));
463
+ var newIndices = this.parent.activeViewOptions.group.byDate
464
+ ? new Set(resCollection.map(function (data) { return data.date.getTime(); }))
465
+ : new Set(resCollection.map(function (data) { return data.groupIndex; }));
457
466
  renderedRows.forEach(function (row) {
458
- var tdElements = row.querySelectorAll('td');
467
+ var tdElements = Array.from(row.querySelectorAll('td'));
459
468
  tdElements.forEach(function (td) {
460
- var groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
461
- if (!newGroupIndices.has(groupIndex)) {
469
+ if (!newIndices.has(_this.getIdentifier(td))) {
462
470
  td.remove();
463
471
  }
464
472
  });
@@ -480,7 +488,15 @@ var VirtualScroll = /** @class */ (function () {
480
488
  var contentRows = this.parent.activeView.getContentRows();
481
489
  this.mergeNewTdData(tbody, contentRows);
482
490
  };
491
+ VirtualScroll.prototype.getIdentifier = function (td) {
492
+ if (this.parent.activeViewOptions.group.byDate) {
493
+ var date = new Date(parseInt(td.getAttribute('data-date'), 10));
494
+ return util.resetTime(date).getTime();
495
+ }
496
+ return parseInt(td.getAttribute('data-group-index'), 10);
497
+ };
483
498
  VirtualScroll.prototype.mergeNewTdData = function (tbody, contentRows) {
499
+ var _this = this;
484
500
  var existingRows = Array.from(tbody.querySelectorAll('tr'));
485
501
  existingRows.forEach(function (existingRow, rowIndex) {
486
502
  if (rowIndex < contentRows.length) {
@@ -488,12 +504,10 @@ var VirtualScroll = /** @class */ (function () {
488
504
  var existingTds_1 = Array.from(existingRow.querySelectorAll('td'));
489
505
  var newTds = Array.from(newRow.querySelectorAll('td'));
490
506
  newTds.forEach(function (newTd) {
491
- var newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
492
507
  var inserted = false;
493
508
  for (var _i = 0, existingTds_2 = existingTds_1; _i < existingTds_2.length; _i++) {
494
509
  var existingTd = existingTds_2[_i];
495
- var existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
496
- if (newGroupIndex < existingGroupIndex) {
510
+ if (_this.getIdentifier(newTd) < _this.getIdentifier(existingTd)) {
497
511
  existingRow.insertBefore(newTd, existingTd);
498
512
  inserted = true;
499
513
  break;
@@ -965,8 +965,11 @@ var EventBase = /** @class */ (function () {
965
965
  })[0];
966
966
  };
967
967
  EventBase.prototype.generateGuid = function () {
968
+ var randomNumbers = new Uint8Array(32);
969
+ window.crypto.getRandomValues(randomNumbers);
970
+ var index = 0;
968
971
  return 'xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx'.replace(/[xy]/g, function (c) {
969
- var r = Math.random() * 16 | 0;
972
+ var r = randomNumbers[index++] & 0xf;
970
973
  var v = (c === 'x') ? r : (r & 0x3 | 0x8);
971
974
  return v.toString(16);
972
975
  });
@@ -616,7 +616,8 @@ var YearEvent = /** @class */ (function (_super) {
616
616
  var app = appointments_1[_i];
617
617
  var appStart = new Date(app[this.fields.startTime].getTime());
618
618
  var appEnd = new Date(app[this.fields.endTime].getTime());
619
- var timeCondition = app[this.fields.isAllDay] ? util.resetTime(appEnd).getTime() > dateStart :
619
+ var timeCondition = app[this.fields.isAllDay] ? (util.resetTime(appEnd).getTime() > dateStart ||
620
+ (util.resetTime(appEnd).getTime() === dateStart && appEnd.getTime() !== util.resetTime(appEnd).getTime())) :
620
621
  util.resetTime(appEnd).getTime() >= dateStart;
621
622
  if (((util.resetTime(appStart).getTime() <= dateStart) && (timeCondition)) ||
622
623
  (util.resetTime(appStart).getTime() >= dateStart) && (util.resetTime(appEnd).getTime() <= dateEnd)) {
@@ -76,6 +76,7 @@ var EventTooltip = /** @class */ (function () {
76
76
  }
77
77
  var record = this.parent.eventBase.getEventByGuid(args.target.getAttribute('data-guid'));
78
78
  if (isNullOrUndefined(record)) {
79
+ this.setContent('No Title');
79
80
  return;
80
81
  }
81
82
  if (!isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)) {
@@ -690,16 +690,18 @@ var VerticalView = /** @class */ (function (_super) {
690
690
  var rows = [];
691
691
  var tr = createElement('tr');
692
692
  var td = createElement('td');
693
- var existingGroupIndices = this.getGroupIndices();
693
+ var existingIndices = [];
694
+ if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0) {
695
+ existingIndices = this.parent.activeViewOptions.group.byDate ? this.getRenderedDate() : this.getGroupIndices();
696
+ }
694
697
  var handler = function (r) {
695
698
  var ntr = tr.cloneNode();
696
699
  for (var _i = 0, _a = _this.colLevels[_this.colLevels.length - 1]; _i < _a.length; _i++) {
697
700
  var tdData = _a[_i];
698
701
  var isAllowTdCreation = true;
699
702
  if (_this.parent.virtualScrollModule && _this.parent.activeViewOptions.group.resources.length > 0) {
700
- if (existingGroupIndices.indexOf(tdData.groupIndex) > -1) {
701
- isAllowTdCreation = false;
702
- }
703
+ var index = _this.parent.activeViewOptions.group.byDate ? tdData.date.getTime() : tdData.groupIndex;
704
+ isAllowTdCreation = existingIndices.indexOf(index) < 0;
703
705
  }
704
706
  if (isAllowTdCreation) {
705
707
  var ntd = _this.createContentTd(tdData, r, td);
@@ -78,6 +78,8 @@ export declare class ViewBase {
78
78
  getViewEndDate(): Date;
79
79
  getAdjustedDate(startTime: Date): Date;
80
80
  resetColLevels(): void;
81
+ private getCollection;
81
82
  getGroupIndices(dataCollection?: TdData[]): number[];
83
+ getRenderedDate(dataCollection?: TdData[]): number[];
82
84
  destroy(): void;
83
85
  }
@@ -643,14 +643,26 @@ var ViewBase = /** @class */ (function () {
643
643
  this.parent.resourceBase.expandedResources = this.colLevels[this.colLevels.length - 1];
644
644
  }
645
645
  };
646
- ViewBase.prototype.getGroupIndices = function (dataCollection) {
647
- var groupIndices = [];
648
- if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 && (dataCollection ||
649
- this.parent.virtualScrollModule.existingDataCollection.length > 0) && !this.parent.uiStateValues.isGroupAdaptive) {
650
- dataCollection = isNullOrUndefined(dataCollection) ? this.parent.virtualScrollModule.existingDataCollection : dataCollection;
651
- groupIndices = dataCollection.map(function (data) { return data.groupIndex; });
646
+ ViewBase.prototype.getCollection = function (dataCollection) {
647
+ if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 &&
648
+ !this.parent.uiStateValues.isGroupAdaptive && (dataCollection ||
649
+ this.parent.virtualScrollModule.existingDataCollection.length > 0)) {
650
+ return isNullOrUndefined(dataCollection) ? this.parent.virtualScrollModule.existingDataCollection : dataCollection;
652
651
  }
653
- return groupIndices;
652
+ return [];
653
+ };
654
+ ViewBase.prototype.getGroupIndices = function (dataCollection) {
655
+ return this.getCollection(dataCollection).map(function (data) { return data.groupIndex; });
656
+ };
657
+ ViewBase.prototype.getRenderedDate = function (dataCollection) {
658
+ var processedDates = [];
659
+ this.getCollection(dataCollection).forEach(function (tdData) {
660
+ var date = tdData.date.getTime();
661
+ if (processedDates.indexOf(date) === -1) {
662
+ processedDates.push(date);
663
+ }
664
+ });
665
+ return processedDates;
654
666
  };
655
667
  ViewBase.prototype.destroy = function () {
656
668
  if (this.element && this.element.parentNode) {