@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
package/dist/global/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* filename: index.d.ts
|
|
3
|
+
* version : 32.1.20
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
+
* Use of this code is subject to the terms of our license.
|
|
6
|
+
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
+
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
+
* applicable laws.
|
|
9
|
+
*/
|
|
1
10
|
import * as _schedule from '@syncfusion/ej2-schedule';
|
|
2
11
|
|
|
3
12
|
export declare namespace ej {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-schedule",
|
|
3
|
-
"version": "32.1.
|
|
3
|
+
"version": "32.1.20",
|
|
4
4
|
"author": "Syncfusion Inc.",
|
|
5
5
|
"license": "SEE LICENSE IN license",
|
|
6
6
|
"main": "./dist/ej2-schedule.umd.min.js",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@syncfusion/ej2-base": "~32.1.19",
|
|
11
11
|
"@syncfusion/ej2-buttons": "~32.1.19",
|
|
12
|
-
"@syncfusion/ej2-calendars": "~32.1.
|
|
12
|
+
"@syncfusion/ej2-calendars": "~32.1.20",
|
|
13
13
|
"@syncfusion/ej2-data": "~32.1.19",
|
|
14
|
-
"@syncfusion/ej2-dropdowns": "~32.1.
|
|
14
|
+
"@syncfusion/ej2-dropdowns": "~32.1.20",
|
|
15
15
|
"@syncfusion/ej2-excel-export": "~32.1.19",
|
|
16
|
-
"@syncfusion/ej2-inputs": "~32.1.
|
|
16
|
+
"@syncfusion/ej2-inputs": "~32.1.20",
|
|
17
17
|
"@syncfusion/ej2-lists": "~32.1.19",
|
|
18
18
|
"@syncfusion/ej2-navigations": "~32.1.19",
|
|
19
19
|
"@syncfusion/ej2-popups": "~32.1.19"
|
|
@@ -91,7 +91,7 @@ var ActionBase = /** @class */ (function () {
|
|
|
91
91
|
var startHour = this.parent.activeView.getStartHour();
|
|
92
92
|
var intervalInMS = util.MS_PER_MINUTE * this.actionObj.interval;
|
|
93
93
|
dateInMS += (startHour.getHours() * 60 + startHour.getMinutes()) * util.MS_PER_MINUTE + startHour.getSeconds() * 1000;
|
|
94
|
-
dateInMS = dateInMS +
|
|
94
|
+
dateInMS = dateInMS + ((date.getTime() - dateInMS) / intervalInMS) * intervalInMS;
|
|
95
95
|
return new Date(dateInMS);
|
|
96
96
|
};
|
|
97
97
|
ActionBase.prototype.getContentAreaDimension = function () {
|
|
@@ -415,7 +415,7 @@ var Resize = /** @class */ (function (_super) {
|
|
|
415
415
|
var offsetWidth = (Math.round(offset / this.actionObj.cellWidth) *
|
|
416
416
|
this.actionObj.cellWidth) + (isLeft ? 0 : (this.parent.getElementWidth(this.actionObj.clone) -
|
|
417
417
|
this.actionObj.cellWidth));
|
|
418
|
-
cellIndex = Math.
|
|
418
|
+
cellIndex = Math.ceil(offsetWidth / this.actionObj.cellWidth);
|
|
419
419
|
}
|
|
420
420
|
isLastCell = cellIndex === tdCollections.length;
|
|
421
421
|
cellIndex = this.getIndex(cellIndex);
|
|
@@ -433,13 +433,29 @@ var Resize = /** @class */ (function (_super) {
|
|
|
433
433
|
}
|
|
434
434
|
else {
|
|
435
435
|
if (!isLeft) {
|
|
436
|
-
|
|
436
|
+
var cloneWidth = this.parent.getElementWidth(this.actionObj.clone);
|
|
437
|
+
var pixelsPerInterval = this.actionObj.cellWidth /
|
|
438
|
+
(this.actionObj.slotInterval / this.actionObj.interval);
|
|
439
|
+
var numIntervals = Math.round(cloneWidth / pixelsPerInterval);
|
|
440
|
+
cloneWidth = numIntervals * pixelsPerInterval;
|
|
441
|
+
offset = offset + cloneWidth;
|
|
437
442
|
}
|
|
438
|
-
var spanMinutes = Math.
|
|
443
|
+
var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
439
444
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
440
445
|
spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
|
|
441
446
|
resizeTime = new Date(resizeDate.getTime());
|
|
442
447
|
resizeTime = new Date(resizeDate.getTime() + (spanMinutes * util.MS_PER_MINUTE));
|
|
448
|
+
var isCustomResizeInterval = this.actionObj.interval !== this.actionObj.slotInterval;
|
|
449
|
+
var initialCellTime = new Date(resizeTime.getTime());
|
|
450
|
+
var intervalInMS = this.actionObj.interval * 60000;
|
|
451
|
+
if (intervalInMS > 0 && isCustomResizeInterval) {
|
|
452
|
+
if (this.resizeEdges.right || this.resizeEdges.left) {
|
|
453
|
+
var eventTime = this.resizeEdges.right ? eventEnd : eventStart;
|
|
454
|
+
var timeDifferenceMs = initialCellTime.getTime() - eventTime.getTime();
|
|
455
|
+
var intervalCount = Math.round(timeDifferenceMs / intervalInMS);
|
|
456
|
+
resizeTime = new Date(eventTime.getTime() + intervalCount * intervalInMS);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
443
459
|
this.updateTimePosition(resizeTime);
|
|
444
460
|
}
|
|
445
461
|
}
|
|
@@ -372,6 +372,8 @@ export interface ResourceDetails {
|
|
|
372
372
|
resourceData: Record<string, any>;
|
|
373
373
|
/** Returns the respective resource fields data. */
|
|
374
374
|
groupData?: Record<string, any>;
|
|
375
|
+
/** Returns the respective resource date. */
|
|
376
|
+
date?: Date;
|
|
375
377
|
/** It returns the child level resources in compact mode. */
|
|
376
378
|
resourceChild?: ResourceDetails[];
|
|
377
379
|
/** It returns the Id of current resource in compact mode. */
|
|
@@ -379,14 +379,16 @@ var ResourceBase = /** @class */ (function () {
|
|
|
379
379
|
resourceId: levelId,
|
|
380
380
|
resourceName: treeLevel.resourceData[resource.textField],
|
|
381
381
|
resource: treeLevel.resource,
|
|
382
|
-
resourceData: treeLevel.resourceData
|
|
382
|
+
resourceData: treeLevel.resourceData,
|
|
383
|
+
date: _this.parent.selectedDate
|
|
383
384
|
};
|
|
384
385
|
}
|
|
385
386
|
else {
|
|
386
387
|
resObj = {
|
|
387
388
|
type: 'resourceHeader', resource: treeLevel.resource,
|
|
388
389
|
resourceData: treeLevel.resourceData, groupIndex: groupIndex,
|
|
389
|
-
groupOrder: treeLevel.groupOrder
|
|
390
|
+
groupOrder: treeLevel.groupOrder,
|
|
391
|
+
date: _this.parent.selectedDate
|
|
390
392
|
};
|
|
391
393
|
resTreeColl.push(resObj);
|
|
392
394
|
groupIndex++;
|
|
@@ -714,9 +716,15 @@ var ResourceBase = /** @class */ (function () {
|
|
|
714
716
|
}
|
|
715
717
|
this.lastResourceLevel = headerLevels.slice(-1)[0] || [];
|
|
716
718
|
if (!this.parent.activeViewOptions.group.byDate) {
|
|
719
|
+
for (var levelIndex = 0; levelIndex < headerLevels.length; levelIndex++) {
|
|
720
|
+
for (var _d = 0, _e = headerLevels[parseInt(levelIndex.toString(), 10)]; _d < _e.length; _d++) {
|
|
721
|
+
var levelItem = _e[_d];
|
|
722
|
+
levelItem.date = this.parent.selectedDate;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
717
725
|
var index = 0;
|
|
718
|
-
for (var
|
|
719
|
-
var lastLevelResource =
|
|
726
|
+
for (var _f = 0, _g = this.lastResourceLevel; _f < _g.length; _f++) {
|
|
727
|
+
var lastLevelResource = _g[_f];
|
|
720
728
|
for (var i = 0; i < lastLevelResource.colSpan; i++) {
|
|
721
729
|
lastColumnDates[parseInt(index.toString(), 10)].groupIndex = lastLevelResource.groupIndex;
|
|
722
730
|
index++;
|
|
@@ -800,8 +808,8 @@ var ResourceBase = /** @class */ (function () {
|
|
|
800
808
|
dateIndex++;
|
|
801
809
|
};
|
|
802
810
|
var this_3 = this;
|
|
803
|
-
for (var
|
|
804
|
-
var headerDate = headerDates_1[
|
|
811
|
+
for (var _h = 0, headerDates_1 = headerDates; _h < headerDates_1.length; _h++) {
|
|
812
|
+
var headerDate = headerDates_1[_h];
|
|
805
813
|
_loop_3(headerDate);
|
|
806
814
|
}
|
|
807
815
|
this.resourceDateTree = this.resourceDateTree.filter(function (data) { return data.length > 0; });
|
|
@@ -814,19 +822,23 @@ var ResourceBase = /** @class */ (function () {
|
|
|
814
822
|
return dateHeaderLevels;
|
|
815
823
|
}
|
|
816
824
|
var dateColSpan = 0;
|
|
817
|
-
for (var
|
|
818
|
-
var firstRowTd =
|
|
825
|
+
for (var _j = 0, _k = levels[0]; _j < _k.length; _j++) {
|
|
826
|
+
var firstRowTd = _k[_j];
|
|
819
827
|
dateColSpan += firstRowTd.colSpan;
|
|
820
828
|
}
|
|
821
|
-
for (var
|
|
822
|
-
var headerDate = headerDates_2[
|
|
829
|
+
for (var _l = 0, headerDates_2 = headerDates; _l < headerDates_2.length; _l++) {
|
|
830
|
+
var headerDate = headerDates_2[_l];
|
|
823
831
|
headerDate.colSpan = dateColSpan;
|
|
824
832
|
datesColumn.push(headerDate);
|
|
825
833
|
var resGroup = extend([], levels, null, true);
|
|
826
834
|
for (var k = 0, length_2 = resGroup.length; k < length_2; k++) {
|
|
835
|
+
for (var _m = 0, _o = resGroup[parseInt(k.toString(), 10)]; _m < _o.length; _m++) {
|
|
836
|
+
var resTd = _o[_m];
|
|
837
|
+
resTd.date = headerDate.date;
|
|
838
|
+
}
|
|
827
839
|
if (k === resGroup.length - 1) {
|
|
828
|
-
for (var
|
|
829
|
-
var resTd =
|
|
840
|
+
for (var _p = 0, _q = resGroup[parseInt(k.toString(), 10)]; _p < _q.length; _p++) {
|
|
841
|
+
var resTd = _q[_p];
|
|
830
842
|
resTd.date = headerDate.date;
|
|
831
843
|
resTd.workDays = headerDate.workDays;
|
|
832
844
|
resTd.startHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.startHourField]) ||
|
|
@@ -249,7 +249,7 @@ var AgendaBase = /** @class */ (function (_super) {
|
|
|
249
249
|
groupOrder: resData[parseInt(res.toString(), 10)].groupOrder.slice(0, -1),
|
|
250
250
|
resourceData: resData[parseInt(res.toString(), 10)].resourceData,
|
|
251
251
|
groupIndex: (lastLevelInfo.length - data.length), className: [cls.RESOURCE_NAME],
|
|
252
|
-
date: agendaDate
|
|
252
|
+
date: this.parent.activeViewOptions.group.byDate ? firstDate : agendaDate
|
|
253
253
|
};
|
|
254
254
|
lastLevelInfo[parseInt((lastLevelInfo.length - data.length).toString(), 10)].push(tempObj);
|
|
255
255
|
tempLastLevelInfo.push(extend({}, tempObj, null, true));
|
|
@@ -277,7 +277,8 @@ var AgendaBase = /** @class */ (function (_super) {
|
|
|
277
277
|
tempGroupedData[0].type = 'parentColumnLevel_' + (y + 1);
|
|
278
278
|
tempGroupedData[0].resource = topResources[topResources.length - (y + 1)];
|
|
279
279
|
tempGroupedData[0].resourceData = data[parseInt(x.toString(), 10)];
|
|
280
|
-
tempGroupedData[0].date =
|
|
280
|
+
tempGroupedData[0].date = this.parent.activeViewOptions.group.byDate ?
|
|
281
|
+
tempLastLevelInfo[parseInt(u.toString(), 10)].date : agendaDate;
|
|
281
282
|
lastLevelInfo[tempGroupedData[0].groupIndex].push(tempGroupedData[0]);
|
|
282
283
|
tempGroupedData = [];
|
|
283
284
|
totalRowSpan = 0;
|
|
@@ -176,14 +176,18 @@ var ViewBase = /** @class */ (function () {
|
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
ViewBase.prototype.getHeaderBarHeight = function () {
|
|
179
|
-
var
|
|
179
|
+
var computedStyle = getComputedStyle(this.parent.element);
|
|
180
|
+
var borderTop = parseFloat(computedStyle.borderTopWidth) || 1;
|
|
181
|
+
var borderBottom = parseFloat(computedStyle.borderBottomWidth) || 1;
|
|
182
|
+
var border = Math.round(borderTop + borderBottom);
|
|
183
|
+
var headerBarHeight = border;
|
|
180
184
|
if (this.parent.headerModule) {
|
|
181
185
|
headerBarHeight += util.getOuterHeight(this.parent.headerModule.getHeaderElement());
|
|
182
186
|
}
|
|
183
187
|
if (this.parent.uiStateValues.isGroupAdaptive) {
|
|
184
188
|
var resHeader = this.parent.element.querySelector('.' + cls.RESOURCE_HEADER_TOOLBAR);
|
|
185
189
|
if (resHeader) {
|
|
186
|
-
headerBarHeight += resHeader
|
|
190
|
+
headerBarHeight += util.getOuterHeight(resHeader);
|
|
187
191
|
}
|
|
188
192
|
}
|
|
189
193
|
return headerBarHeight;
|
|
@@ -471,7 +475,7 @@ var ViewBase = /** @class */ (function () {
|
|
|
471
475
|
ViewBase.prototype.setResourceHeaderContent = function (tdElement, tdData, className) {
|
|
472
476
|
if (className === void 0) { className = cls.TEXT_ELLIPSIS; }
|
|
473
477
|
if (this.parent.activeViewOptions.resourceHeaderTemplate) {
|
|
474
|
-
var data = { resource: tdData.resource, resourceData: tdData.resourceData };
|
|
478
|
+
var data = { resource: tdData.resource, resourceData: tdData.resourceData, date: tdData.date };
|
|
475
479
|
var scheduleId = this.parent.element.id + '_';
|
|
476
480
|
var viewName = this.parent.activeViewOptions.resourceHeaderTemplateName;
|
|
477
481
|
var templateId = scheduleId + viewName + 'resourceHeaderTemplate';
|