@syncfusion/ej2-schedule 31.1.20 → 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.
@@ -6832,8 +6832,11 @@ var EventBase = /** @__PURE__ @class */ (function () {
6832
6832
  })[0];
6833
6833
  };
6834
6834
  EventBase.prototype.generateGuid = function () {
6835
+ var randomNumbers = new Uint8Array(32);
6836
+ window.crypto.getRandomValues(randomNumbers);
6837
+ var index = 0;
6835
6838
  return 'xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx'.replace(/[xy]/g, function (c) {
6836
- var r = Math.random() * 16 | 0;
6839
+ var r = randomNumbers[index++] & 0xf;
6837
6840
  var v = (c === 'x') ? r : (r & 0x3 | 0x8);
6838
6841
  return v.toString(16);
6839
6842
  });
@@ -11527,6 +11530,7 @@ var EventTooltip = /** @__PURE__ @class */ (function () {
11527
11530
  }
11528
11531
  var record = this.parent.eventBase.getEventByGuid(args.target.getAttribute('data-guid'));
11529
11532
  if (isNullOrUndefined(record)) {
11533
+ this.setContent('No Title');
11530
11534
  return;
11531
11535
  }
11532
11536
  if (!isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)) {
@@ -14902,7 +14906,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
14902
14906
  virtual.style.height = (conTable.offsetHeight + (this.parent.resourceBase.expandedResources.length - (this.renderedLength)) *
14903
14907
  conTable.offsetHeight / this.renderedLength) + 'px';
14904
14908
  var conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
14905
- if ((conWrap.scrollHeight - conWrap.scrollTop) < conWrap.offsetHeight * this.bufferCount) {
14909
+ if (this.bufferCount === 3 && (conWrap.scrollHeight - conWrap.scrollTop) < conWrap.offsetHeight * this.bufferCount) {
14906
14910
  virtual.style.height = parseInt(virtual.style.height, 10) + (conWrap.offsetHeight * this.bufferCount) + 'px';
14907
14911
  }
14908
14912
  }
@@ -14932,7 +14936,13 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
14932
14936
  };
14933
14937
  VirtualScroll.prototype.setItemSize = function () {
14934
14938
  if (this.isHorizontalScroll) {
14935
- this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
14939
+ if (this.parent.group.byDate) {
14940
+ var colElement = this.parent.element.querySelector('.' + DATE_HEADER_WRAP_CLASS + ' table col');
14941
+ this.itemSize = colElement ? getElementWidth(colElement, this.parent.uiStateValues.isTransformed) : this.itemSize;
14942
+ }
14943
+ else {
14944
+ this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
14945
+ }
14936
14946
  }
14937
14947
  else {
14938
14948
  this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
@@ -15099,6 +15109,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
15099
15109
  height = (height > 0) ? height : this.itemSize;
15100
15110
  this.translateY = (conWrap.scrollTop - (this.bufferCount * height) > 0) ?
15101
15111
  conWrap.scrollTop - (this.bufferCount * height) : 0;
15112
+ if (this.parent.rowAutoHeight && this.translateY === 0 && index !== 0) {
15113
+ prevSetCollection = this.getBufferCollection(0, this.renderedLength);
15114
+ this.parent.resourceBase.renderedResources = prevSetCollection;
15115
+ }
15102
15116
  }
15103
15117
  return prevSetCollection;
15104
15118
  };
@@ -15288,17 +15302,19 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
15288
15302
  append(contentRows, conWrap.querySelector('tbody'));
15289
15303
  };
15290
15304
  VirtualScroll.prototype.updateOtherViewContent = function (conWrap, resCollection, renderedRows) {
15305
+ var _this = this;
15291
15306
  var tbody = conWrap.querySelector('tbody');
15292
15307
  var colGroup = conWrap.querySelector('colgroup');
15293
15308
  var thead = conWrap.querySelector('thead');
15294
15309
  var table = conWrap.querySelector('table');
15295
15310
  this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
15296
- var newGroupIndices = new Set(resCollection.map(function (data) { return data.groupIndex; }));
15311
+ var newIndices = this.parent.activeViewOptions.group.byDate
15312
+ ? new Set(resCollection.map(function (data) { return data.date.getTime(); }))
15313
+ : new Set(resCollection.map(function (data) { return data.groupIndex; }));
15297
15314
  renderedRows.forEach(function (row) {
15298
- var tdElements = row.querySelectorAll('td');
15315
+ var tdElements = Array.from(row.querySelectorAll('td'));
15299
15316
  tdElements.forEach(function (td) {
15300
- var groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
15301
- if (!newGroupIndices.has(groupIndex)) {
15317
+ if (!newIndices.has(_this.getIdentifier(td))) {
15302
15318
  td.remove();
15303
15319
  }
15304
15320
  });
@@ -15320,7 +15336,15 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
15320
15336
  var contentRows = this.parent.activeView.getContentRows();
15321
15337
  this.mergeNewTdData(tbody, contentRows);
15322
15338
  };
15339
+ VirtualScroll.prototype.getIdentifier = function (td) {
15340
+ if (this.parent.activeViewOptions.group.byDate) {
15341
+ var date = new Date(parseInt(td.getAttribute('data-date'), 10));
15342
+ return resetTime(date).getTime();
15343
+ }
15344
+ return parseInt(td.getAttribute('data-group-index'), 10);
15345
+ };
15323
15346
  VirtualScroll.prototype.mergeNewTdData = function (tbody, contentRows) {
15347
+ var _this = this;
15324
15348
  var existingRows = Array.from(tbody.querySelectorAll('tr'));
15325
15349
  existingRows.forEach(function (existingRow, rowIndex) {
15326
15350
  if (rowIndex < contentRows.length) {
@@ -15328,12 +15352,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
15328
15352
  var existingTds_1 = Array.from(existingRow.querySelectorAll('td'));
15329
15353
  var newTds = Array.from(newRow.querySelectorAll('td'));
15330
15354
  newTds.forEach(function (newTd) {
15331
- var newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
15332
15355
  var inserted = false;
15333
15356
  for (var _i = 0, existingTds_2 = existingTds_1; _i < existingTds_2.length; _i++) {
15334
15357
  var existingTd = existingTds_2[_i];
15335
- var existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
15336
- if (newGroupIndex < existingGroupIndex) {
15358
+ if (_this.getIdentifier(newTd) < _this.getIdentifier(existingTd)) {
15337
15359
  existingRow.insertBefore(newTd, existingTd);
15338
15360
  inserted = true;
15339
15361
  break;
@@ -23236,7 +23258,8 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
23236
23258
  var app = appointments_1[_i];
23237
23259
  var appStart = new Date(app[this.fields.startTime].getTime());
23238
23260
  var appEnd = new Date(app[this.fields.endTime].getTime());
23239
- var timeCondition = app[this.fields.isAllDay] ? resetTime(appEnd).getTime() > dateStart :
23261
+ var timeCondition = app[this.fields.isAllDay] ? (resetTime(appEnd).getTime() > dateStart ||
23262
+ (resetTime(appEnd).getTime() === dateStart && appEnd.getTime() !== resetTime(appEnd).getTime())) :
23240
23263
  resetTime(appEnd).getTime() >= dateStart;
23241
23264
  if (((resetTime(appStart).getTime() <= dateStart) && (timeCondition)) ||
23242
23265
  (resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
@@ -25320,14 +25343,26 @@ var ViewBase = /** @__PURE__ @class */ (function () {
25320
25343
  this.parent.resourceBase.expandedResources = this.colLevels[this.colLevels.length - 1];
25321
25344
  }
25322
25345
  };
25323
- ViewBase.prototype.getGroupIndices = function (dataCollection) {
25324
- var groupIndices = [];
25325
- if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 && (dataCollection ||
25326
- this.parent.virtualScrollModule.existingDataCollection.length > 0) && !this.parent.uiStateValues.isGroupAdaptive) {
25327
- dataCollection = isNullOrUndefined(dataCollection) ? this.parent.virtualScrollModule.existingDataCollection : dataCollection;
25328
- groupIndices = dataCollection.map(function (data) { return data.groupIndex; });
25346
+ ViewBase.prototype.getCollection = function (dataCollection) {
25347
+ if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 &&
25348
+ !this.parent.uiStateValues.isGroupAdaptive && (dataCollection ||
25349
+ this.parent.virtualScrollModule.existingDataCollection.length > 0)) {
25350
+ return isNullOrUndefined(dataCollection) ? this.parent.virtualScrollModule.existingDataCollection : dataCollection;
25329
25351
  }
25330
- return groupIndices;
25352
+ return [];
25353
+ };
25354
+ ViewBase.prototype.getGroupIndices = function (dataCollection) {
25355
+ return this.getCollection(dataCollection).map(function (data) { return data.groupIndex; });
25356
+ };
25357
+ ViewBase.prototype.getRenderedDate = function (dataCollection) {
25358
+ var processedDates = [];
25359
+ this.getCollection(dataCollection).forEach(function (tdData) {
25360
+ var date = tdData.date.getTime();
25361
+ if (processedDates.indexOf(date) === -1) {
25362
+ processedDates.push(date);
25363
+ }
25364
+ });
25365
+ return processedDates;
25331
25366
  };
25332
25367
  ViewBase.prototype.destroy = function () {
25333
25368
  if (this.element && this.element.parentNode) {
@@ -26024,16 +26059,18 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
26024
26059
  var rows = [];
26025
26060
  var tr = createElement('tr');
26026
26061
  var td = createElement('td');
26027
- var existingGroupIndices = this.getGroupIndices();
26062
+ var existingIndices = [];
26063
+ if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0) {
26064
+ existingIndices = this.parent.activeViewOptions.group.byDate ? this.getRenderedDate() : this.getGroupIndices();
26065
+ }
26028
26066
  var handler = function (r) {
26029
26067
  var ntr = tr.cloneNode();
26030
26068
  for (var _i = 0, _a = _this.colLevels[_this.colLevels.length - 1]; _i < _a.length; _i++) {
26031
26069
  var tdData = _a[_i];
26032
26070
  var isAllowTdCreation = true;
26033
26071
  if (_this.parent.virtualScrollModule && _this.parent.activeViewOptions.group.resources.length > 0) {
26034
- if (existingGroupIndices.indexOf(tdData.groupIndex) > -1) {
26035
- isAllowTdCreation = false;
26036
- }
26072
+ var index = _this.parent.activeViewOptions.group.byDate ? tdData.date.getTime() : tdData.groupIndex;
26073
+ isAllowTdCreation = existingIndices.indexOf(index) < 0;
26037
26074
  }
26038
26075
  if (isAllowTdCreation) {
26039
26076
  var ntd = _this.createContentTd(tdData, r, td);