@syncfusion/ej2-schedule 32.1.19 → 32.1.20
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.
- package/dist/ej2-schedule.min.js +10 -1
- package/dist/ej2-schedule.umd.min.js +10 -1
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +43 -12
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +55 -22
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +10 -1
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +9 -0
- package/package.json +4 -4
- package/src/schedule/actions/action-base.js +1 -1
- package/src/schedule/actions/resize.js +19 -3
- package/src/schedule/base/interface.d.ts +2 -0
- package/src/schedule/base/resource.js +24 -12
- package/src/schedule/event-renderer/agenda-base.js +3 -2
- package/src/schedule/renderer/view-base.js +7 -3
|
@@ -16844,14 +16844,16 @@ class ResourceBase {
|
|
|
16844
16844
|
resourceId: levelId,
|
|
16845
16845
|
resourceName: treeLevel.resourceData[resource.textField],
|
|
16846
16846
|
resource: treeLevel.resource,
|
|
16847
|
-
resourceData: treeLevel.resourceData
|
|
16847
|
+
resourceData: treeLevel.resourceData,
|
|
16848
|
+
date: this.parent.selectedDate
|
|
16848
16849
|
};
|
|
16849
16850
|
}
|
|
16850
16851
|
else {
|
|
16851
16852
|
resObj = {
|
|
16852
16853
|
type: 'resourceHeader', resource: treeLevel.resource,
|
|
16853
16854
|
resourceData: treeLevel.resourceData, groupIndex: groupIndex,
|
|
16854
|
-
groupOrder: treeLevel.groupOrder
|
|
16855
|
+
groupOrder: treeLevel.groupOrder,
|
|
16856
|
+
date: this.parent.selectedDate
|
|
16855
16857
|
};
|
|
16856
16858
|
resTreeColl.push(resObj);
|
|
16857
16859
|
groupIndex++;
|
|
@@ -17155,6 +17157,11 @@ class ResourceBase {
|
|
|
17155
17157
|
}
|
|
17156
17158
|
this.lastResourceLevel = headerLevels.slice(-1)[0] || [];
|
|
17157
17159
|
if (!this.parent.activeViewOptions.group.byDate) {
|
|
17160
|
+
for (let levelIndex = 0; levelIndex < headerLevels.length; levelIndex++) {
|
|
17161
|
+
for (const levelItem of headerLevels[parseInt(levelIndex.toString(), 10)]) {
|
|
17162
|
+
levelItem.date = this.parent.selectedDate;
|
|
17163
|
+
}
|
|
17164
|
+
}
|
|
17158
17165
|
let index = 0;
|
|
17159
17166
|
for (const lastLevelResource of this.lastResourceLevel) {
|
|
17160
17167
|
for (let i = 0; i < lastLevelResource.colSpan; i++) {
|
|
@@ -17247,6 +17254,9 @@ class ResourceBase {
|
|
|
17247
17254
|
datesColumn.push(headerDate);
|
|
17248
17255
|
const resGroup = extend([], levels, null, true);
|
|
17249
17256
|
for (let k = 0, length = resGroup.length; k < length; k++) {
|
|
17257
|
+
for (const resTd of resGroup[parseInt(k.toString(), 10)]) {
|
|
17258
|
+
resTd.date = headerDate.date;
|
|
17259
|
+
}
|
|
17250
17260
|
if (k === resGroup.length - 1) {
|
|
17251
17261
|
for (const resTd of resGroup[parseInt(k.toString(), 10)]) {
|
|
17252
17262
|
resTd.date = headerDate.date;
|
|
@@ -20932,7 +20942,7 @@ class ActionBase {
|
|
|
20932
20942
|
const startHour = this.parent.activeView.getStartHour();
|
|
20933
20943
|
const intervalInMS = MS_PER_MINUTE * this.actionObj.interval;
|
|
20934
20944
|
dateInMS += (startHour.getHours() * 60 + startHour.getMinutes()) * MS_PER_MINUTE + startHour.getSeconds() * 1000;
|
|
20935
|
-
dateInMS = dateInMS +
|
|
20945
|
+
dateInMS = dateInMS + ((date.getTime() - dateInMS) / intervalInMS) * intervalInMS;
|
|
20936
20946
|
return new Date(dateInMS);
|
|
20937
20947
|
}
|
|
20938
20948
|
getContentAreaDimension() {
|
|
@@ -21687,7 +21697,7 @@ class Resize extends ActionBase {
|
|
|
21687
21697
|
const offsetWidth = (Math.round(offset / this.actionObj.cellWidth) *
|
|
21688
21698
|
this.actionObj.cellWidth) + (isLeft ? 0 : (this.parent.getElementWidth(this.actionObj.clone) -
|
|
21689
21699
|
this.actionObj.cellWidth));
|
|
21690
|
-
cellIndex = Math.
|
|
21700
|
+
cellIndex = Math.ceil(offsetWidth / this.actionObj.cellWidth);
|
|
21691
21701
|
}
|
|
21692
21702
|
isLastCell = cellIndex === tdCollections.length;
|
|
21693
21703
|
cellIndex = this.getIndex(cellIndex);
|
|
@@ -21705,13 +21715,29 @@ class Resize extends ActionBase {
|
|
|
21705
21715
|
}
|
|
21706
21716
|
else {
|
|
21707
21717
|
if (!isLeft) {
|
|
21708
|
-
|
|
21709
|
-
|
|
21710
|
-
|
|
21718
|
+
let cloneWidth = this.parent.getElementWidth(this.actionObj.clone);
|
|
21719
|
+
const pixelsPerInterval = this.actionObj.cellWidth /
|
|
21720
|
+
(this.actionObj.slotInterval / this.actionObj.interval);
|
|
21721
|
+
const numIntervals = Math.round(cloneWidth / pixelsPerInterval);
|
|
21722
|
+
cloneWidth = numIntervals * pixelsPerInterval;
|
|
21723
|
+
offset = offset + cloneWidth;
|
|
21724
|
+
}
|
|
21725
|
+
let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
21711
21726
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
21712
21727
|
spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
|
|
21713
21728
|
resizeTime = new Date(resizeDate.getTime());
|
|
21714
21729
|
resizeTime = new Date(resizeDate.getTime() + (spanMinutes * MS_PER_MINUTE));
|
|
21730
|
+
const isCustomResizeInterval = this.actionObj.interval !== this.actionObj.slotInterval;
|
|
21731
|
+
const initialCellTime = new Date(resizeTime.getTime());
|
|
21732
|
+
const intervalInMS = this.actionObj.interval * 60000;
|
|
21733
|
+
if (intervalInMS > 0 && isCustomResizeInterval) {
|
|
21734
|
+
if (this.resizeEdges.right || this.resizeEdges.left) {
|
|
21735
|
+
const eventTime = this.resizeEdges.right ? eventEnd : eventStart;
|
|
21736
|
+
const timeDifferenceMs = initialCellTime.getTime() - eventTime.getTime();
|
|
21737
|
+
const intervalCount = Math.round(timeDifferenceMs / intervalInMS);
|
|
21738
|
+
resizeTime = new Date(eventTime.getTime() + intervalCount * intervalInMS);
|
|
21739
|
+
}
|
|
21740
|
+
}
|
|
21715
21741
|
this.updateTimePosition(resizeTime);
|
|
21716
21742
|
}
|
|
21717
21743
|
}
|
|
@@ -24042,14 +24068,18 @@ class ViewBase {
|
|
|
24042
24068
|
}
|
|
24043
24069
|
}
|
|
24044
24070
|
getHeaderBarHeight() {
|
|
24045
|
-
|
|
24071
|
+
const computedStyle = getComputedStyle(this.parent.element);
|
|
24072
|
+
const borderTop = parseFloat(computedStyle.borderTopWidth) || 1;
|
|
24073
|
+
const borderBottom = parseFloat(computedStyle.borderBottomWidth) || 1;
|
|
24074
|
+
const border = Math.round(borderTop + borderBottom);
|
|
24075
|
+
let headerBarHeight = border;
|
|
24046
24076
|
if (this.parent.headerModule) {
|
|
24047
24077
|
headerBarHeight += getOuterHeight(this.parent.headerModule.getHeaderElement());
|
|
24048
24078
|
}
|
|
24049
24079
|
if (this.parent.uiStateValues.isGroupAdaptive) {
|
|
24050
24080
|
const resHeader = this.parent.element.querySelector('.' + RESOURCE_HEADER_TOOLBAR);
|
|
24051
24081
|
if (resHeader) {
|
|
24052
|
-
headerBarHeight += resHeader
|
|
24082
|
+
headerBarHeight += getOuterHeight(resHeader);
|
|
24053
24083
|
}
|
|
24054
24084
|
}
|
|
24055
24085
|
return headerBarHeight;
|
|
@@ -24332,7 +24362,7 @@ class ViewBase {
|
|
|
24332
24362
|
}
|
|
24333
24363
|
setResourceHeaderContent(tdElement, tdData, className = TEXT_ELLIPSIS) {
|
|
24334
24364
|
if (this.parent.activeViewOptions.resourceHeaderTemplate) {
|
|
24335
|
-
const data = { resource: tdData.resource, resourceData: tdData.resourceData };
|
|
24365
|
+
const data = { resource: tdData.resource, resourceData: tdData.resourceData, date: tdData.date };
|
|
24336
24366
|
const scheduleId = this.parent.element.id + '_';
|
|
24337
24367
|
const viewName = this.parent.activeViewOptions.resourceHeaderTemplateName;
|
|
24338
24368
|
const templateId = scheduleId + viewName + 'resourceHeaderTemplate';
|
|
@@ -26829,7 +26859,7 @@ class AgendaBase extends ViewBase {
|
|
|
26829
26859
|
groupOrder: resData[parseInt(res.toString(), 10)].groupOrder.slice(0, -1),
|
|
26830
26860
|
resourceData: resData[parseInt(res.toString(), 10)].resourceData,
|
|
26831
26861
|
groupIndex: (lastLevelInfo.length - data.length), className: [RESOURCE_NAME],
|
|
26832
|
-
date: agendaDate
|
|
26862
|
+
date: this.parent.activeViewOptions.group.byDate ? firstDate : agendaDate
|
|
26833
26863
|
};
|
|
26834
26864
|
lastLevelInfo[parseInt((lastLevelInfo.length - data.length).toString(), 10)].push(tempObj);
|
|
26835
26865
|
tempLastLevelInfo.push(extend({}, tempObj, null, true));
|
|
@@ -26857,7 +26887,8 @@ class AgendaBase extends ViewBase {
|
|
|
26857
26887
|
tempGroupedData[0].type = 'parentColumnLevel_' + (y + 1);
|
|
26858
26888
|
tempGroupedData[0].resource = topResources[topResources.length - (y + 1)];
|
|
26859
26889
|
tempGroupedData[0].resourceData = data[parseInt(x.toString(), 10)];
|
|
26860
|
-
tempGroupedData[0].date =
|
|
26890
|
+
tempGroupedData[0].date = this.parent.activeViewOptions.group.byDate ?
|
|
26891
|
+
tempLastLevelInfo[parseInt(u.toString(), 10)].date : agendaDate;
|
|
26861
26892
|
lastLevelInfo[tempGroupedData[0].groupIndex].push(tempGroupedData[0]);
|
|
26862
26893
|
tempGroupedData = [];
|
|
26863
26894
|
totalRowSpan = 0;
|