devexpress-gantt 4.0.7 → 4.0.11

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/dx-gantt.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt)
3
- * Version: 4.0.7
4
- * Build date: Fri Feb 04 2022
3
+ * Version: 4.0.11
4
+ * Build date: Tue Feb 22 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
package/dist/dx-gantt.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt)
3
- * Version: 4.0.7
4
- * Build date: Fri Feb 04 2022
3
+ * Version: 4.0.11
4
+ * Build date: Tue Feb 22 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -740,7 +740,7 @@ var DomUtils = (function () {
740
740
  return getAbsolutePositionX_IE(element);
741
741
  else if (browser_1.Browser.Firefox && browser_1.Browser.Version >= 3)
742
742
  return getAbsolutePositionX_FF3(element);
743
- else if (browser_1.Browser.Opera)
743
+ else if (browser_1.Browser.Opera && browser_1.Browser.Version <= 12)
744
744
  return getAbsolutePositionX_Opera(element);
745
745
  else if (browser_1.Browser.NetscapeFamily && (!browser_1.Browser.Firefox || browser_1.Browser.Version < 3))
746
746
  return getAbsolutePositionX_NS(element);
@@ -802,10 +802,11 @@ var DomUtils = (function () {
802
802
  DomUtils.getChildNodesByClassName = function (parent, className) {
803
803
  function nodeListToArray(nodeList, filter) {
804
804
  var result = [];
805
- nodeList.forEach(function (element) {
805
+ for (var i = 0; i < nodeList.length; i++) {
806
+ var element = nodeList[i];
806
807
  if (filter(element))
807
808
  result.push(element);
808
- });
809
+ }
809
810
  return result;
810
811
  }
811
812
  if (parent.querySelectorAll) {
@@ -1382,21 +1383,28 @@ var EvtUtils = (function () {
1382
1383
  function EvtUtils() {
1383
1384
  }
1384
1385
  EvtUtils.preventEvent = function (evt) {
1386
+ if (!evt.cancelable)
1387
+ return;
1385
1388
  if (evt.preventDefault)
1386
1389
  evt.preventDefault();
1387
1390
  else
1388
1391
  evt.returnValue = false;
1389
1392
  };
1390
1393
  EvtUtils.getEventSource = function (evt) {
1391
- if (!common_1.isDefined(evt))
1392
- return null;
1393
- return evt.srcElement ? evt.srcElement : evt.target;
1394
+ return common_1.isDefined(evt) ? EvtUtils.getEventSourceCore(evt) : null;
1394
1395
  };
1395
1396
  EvtUtils.getEventSourceByPosition = function (evt) {
1396
1397
  if (!common_1.isDefined(evt))
1397
1398
  return null;
1398
- if (document.elementFromPoint && EvtUtils.getEventX(evt) !== undefined && EvtUtils.getEventY(evt) !== undefined)
1399
- return document.elementFromPoint(EvtUtils.getEventX(evt), EvtUtils.getEventY(evt));
1399
+ if (!document.elementFromPoint)
1400
+ return EvtUtils.getEventSourceCore(evt);
1401
+ var eventX = EvtUtils.getEventX(evt);
1402
+ var eventY = EvtUtils.getEventY(evt);
1403
+ if (eventX === undefined || eventY === undefined)
1404
+ return EvtUtils.getEventSourceCore(evt);
1405
+ return document.elementFromPoint(eventX, eventY);
1406
+ };
1407
+ EvtUtils.getEventSourceCore = function (evt) {
1400
1408
  return evt.srcElement ? evt.srcElement : evt.target;
1401
1409
  };
1402
1410
  EvtUtils.getMouseWheelEventName = function () {
@@ -1412,24 +1420,19 @@ var EvtUtils = (function () {
1412
1420
  evt = (browser_1.Browser.IE && common_1.isDefined(event)) ? event : evt;
1413
1421
  if (!evt)
1414
1422
  return false;
1415
- if (browser_1.Browser.IE && browser_1.Browser.Version < 11) {
1416
- if (browser_1.Browser.MSTouchUI)
1417
- return true;
1418
- return evt.button % 2 === 1;
1419
- }
1420
- else if (browser_1.Browser.WebKitFamily) {
1421
- if (evt.type === 'pointermove')
1422
- return evt.buttons === 1;
1423
- return evt.which === 1;
1424
- }
1425
- else if (browser_1.Browser.NetscapeFamily || browser_1.Browser.Edge || (browser_1.Browser.IE && browser_1.Browser.Version >= 11)) {
1426
- if (evt.type === touch_1.TouchUtils.touchMouseMoveEventName)
1427
- return evt.buttons === 1;
1428
- return evt.which === 1;
1429
- }
1430
- else if (browser_1.Browser.Opera)
1431
- return evt.button === 0;
1432
- return true;
1423
+ if (browser_1.Browser.IE && browser_1.Browser.Version < 11)
1424
+ return browser_1.Browser.MSTouchUI ? true : evt.button % 2 === 1;
1425
+ if (browser_1.Browser.WebKitFamily)
1426
+ return evt.type === 'pointermove' ? evt.buttons === 1 : evt.which === 1;
1427
+ if (browser_1.Browser.NetscapeFamily || browser_1.Browser.Edge || (browser_1.Browser.IE && browser_1.Browser.Version >= 11))
1428
+ return EvtUtils.isMoveEventName(evt.type) ? evt.buttons === 1 : evt.which === 1;
1429
+ return browser_1.Browser.Opera ? evt.button === 0 : true;
1430
+ };
1431
+ EvtUtils.isMoveEventName = function (type) {
1432
+ return type === touch_1.TouchUtils.touchMouseMoveEventName || type === EvtUtils.getMoveEventName();
1433
+ };
1434
+ EvtUtils.getMoveEventName = function () {
1435
+ return window.PointerEvent ? 'pointermove' : (browser_1.Browser.TouchUI ? 'touchmove' : 'mousemove');
1433
1436
  };
1434
1437
  EvtUtils.preventEventAndBubble = function (evt) {
1435
1438
  EvtUtils.preventEvent(evt);
@@ -1594,9 +1597,19 @@ var Browser = (function () {
1594
1597
  return '';
1595
1598
  };
1596
1599
  Browser.isTouchEnabled = function () {
1597
- return ('ontouchstart' in window) ||
1598
- (navigator['maxTouchPoints'] > 0) ||
1599
- (navigator['msMaxTouchPoints'] > 0);
1600
+ return Browser.hasTouchStart() || Browser.hasMaxTouchPoints() || Browser.hasMsMaxTouchPoints();
1601
+ };
1602
+ Browser.hasTouchStart = function () {
1603
+ return ('ontouchstart' in window);
1604
+ };
1605
+ Browser.hasMaxTouchPoints = function () {
1606
+ return navigator['maxTouchPoints'] > 0;
1607
+ };
1608
+ Browser.hasMsMaxTouchPoints = function () {
1609
+ return navigator['msMaxTouchPoints'] > 0;
1610
+ };
1611
+ Browser.hasNavigator = function () {
1612
+ return typeof navigator !== 'undefined';
1600
1613
  };
1601
1614
  Browser.fillUserAgentInfo = function (browserTypesOrderedList, browserType, version, platform, isSamsungAndroidDevice) {
1602
1615
  if (isSamsungAndroidDevice === void 0) { isSamsungAndroidDevice = false; }
@@ -1613,9 +1626,6 @@ var Browser = (function () {
1613
1626
  Browser.WindowsPhonePlatform = platform === 'WinPhone';
1614
1627
  Browser.WebKitFamily = Browser.Safari || Browser.Chrome || Browser.Opera && Browser.MajorVersion >= 15;
1615
1628
  Browser.NetscapeFamily = Browser.Netscape || Browser.Mozilla || Browser.Firefox;
1616
- Browser.HardwareAcceleration = (Browser.IE && Browser.MajorVersion >= 9) || (Browser.Firefox && Browser.MajorVersion >= 4) ||
1617
- (Browser.AndroidMobilePlatform && Browser.Chrome) || (Browser.Chrome && Browser.MajorVersion >= 37) ||
1618
- (Browser.Safari && !Browser.WindowsPlatform) || Browser.Edge || (Browser.Opera && Browser.MajorVersion >= 46);
1619
1629
  Browser.WebKitTouchUI = Browser.MacOSMobilePlatform || Browser.AndroidMobilePlatform;
1620
1630
  var isIETouchUI = Browser.IE && Browser.MajorVersion > 9 && Browser.WindowsPlatform && Browser.UserAgent.toLowerCase().indexOf('touch') >= 0;
1621
1631
  Browser.MSTouchUI = isIETouchUI || (Browser.Edge && !!window.navigator.maxTouchPoints);
@@ -1679,7 +1689,7 @@ var Browser = (function () {
1679
1689
  }
1680
1690
  };
1681
1691
  Browser.getUserAgent = function () {
1682
- return typeof navigator !== 'undefined' && navigator.userAgent ? navigator.userAgent.toLowerCase() : '';
1692
+ return Browser.hasNavigator() && navigator.userAgent ? navigator.userAgent.toLowerCase() : '';
1683
1693
  };
1684
1694
  Browser.UserAgent = Browser.getUserAgent();
1685
1695
  Browser._foo = Browser.IdentUserAgent(Browser.UserAgent);
@@ -2898,8 +2908,7 @@ var GridLayoutCalculator = (function () {
2898
2908
  return new size_1.Size(width, 0);
2899
2909
  };
2900
2910
  GridLayoutCalculator.prototype.getTaskProgressWidth = function (index) {
2901
- var progress = Math.max(Math.min(this.getTask(index).progress, 100), 0);
2902
- return this.getTaskWidth(index) * progress / 100;
2911
+ return this.getTaskWidth(index) * this.getTask(index).normalizedProgress / 100;
2903
2912
  };
2904
2913
  GridLayoutCalculator.prototype.getTaskTextElementInfo = function (index, isInsideText) {
2905
2914
  var result = new GridElementInfo_1.GridElementInfo();
@@ -3078,9 +3087,6 @@ var GridLayoutCalculator = (function () {
3078
3087
  return this.getWidthByDateRange(this.range.start, date);
3079
3088
  };
3080
3089
  GridLayoutCalculator.prototype.getWidthByDateRange = function (start, end) {
3081
- return Math.max(this.getDistanceBetweenDates(start, end), 0);
3082
- };
3083
- GridLayoutCalculator.prototype.getDistanceBetweenDates = function (start, end) {
3084
3090
  return DateUtils_1.DateUtils.getRangeTickCount(start, end, this.viewType) * this.tickSize.width;
3085
3091
  };
3086
3092
  GridLayoutCalculator.prototype.getDateByPos = function (position) {
@@ -5281,7 +5287,7 @@ var TaskEditController = (function () {
5281
5287
  TaskEditController.prototype.displayProgressEdit = function () {
5282
5288
  if (!this.viewItem.isCustom && this.canUpdateTask() && this.isTaskUpdateAllowed() && this.wrapInfo.size.width > this.wrapInfo.size.height) {
5283
5289
  this.progressEdit.style.display = "block";
5284
- this.progressEdit.style.left = ((this.task.progress / 100) * this.wrapInfo.size.width - (this.progressEdit.offsetWidth / 2)) + "px";
5290
+ this.progressEdit.style.left = ((this.task.normalizedProgress / 100) * this.wrapInfo.size.width - (this.progressEdit.offsetWidth / 2)) + "px";
5285
5291
  }
5286
5292
  else
5287
5293
  this.progressEdit.style.display = "none";
@@ -6407,6 +6413,10 @@ var GanttView = (function () {
6407
6413
  GanttView.prototype.destroyTemplate = function (container) {
6408
6414
  this.ganttOwner.destroyTemplate ? this.ganttOwner.destroyTemplate(container) : container.innerHTML = "";
6409
6415
  };
6416
+ GanttView.prototype.onTaskAreaSizeChanged = function (info) {
6417
+ if (this.ganttOwner.onTaskAreaSizeChanged)
6418
+ this.ganttOwner.onTaskAreaSizeChanged(info);
6419
+ };
6410
6420
  GanttView.prototype.showTaskEditDialog = function () {
6411
6421
  this.commandManager.showTaskEditDialog.execute();
6412
6422
  };
@@ -7473,12 +7483,11 @@ var EllipsisHelper = (function () {
7473
7483
  return text;
7474
7484
  var pdfTextWidth = pdfDoc.getTextWidth(text.toString());
7475
7485
  if (pdfTextWidth > size) {
7476
- var outputText = EllipsisHelper.ellipsis;
7477
- var pos = 0;
7478
- while (pdfDoc.getTextWidth(outputText) < size) {
7479
- var char = text[pos];
7480
- outputText = outputText.substr(0, pos) + char + outputText.substr(pos);
7481
- pos++;
7486
+ var outputText = text;
7487
+ var pos = text.length - 1;
7488
+ while (pdfDoc.getTextWidth(outputText) > size && pos > 0) {
7489
+ outputText = outputText.substring(0, pos) + EllipsisHelper.ellipsis;
7490
+ pos--;
7482
7491
  }
7483
7492
  return outputText;
7484
7493
  }
@@ -7546,6 +7555,8 @@ var KeyUtils = (function () {
7546
7555
  result |= ModifierKey.Ctrl;
7547
7556
  if (evt.shiftKey)
7548
7557
  result |= ModifierKey.Shift;
7558
+ if (evt.metaKey)
7559
+ result |= ModifierKey.Meta;
7549
7560
  return result;
7550
7561
  };
7551
7562
  KeyUtils.getShortcutCode = function (keyCode, isCtrlKey, isShiftKey, isAltKey, isMetaKey) {
@@ -12445,7 +12456,7 @@ var TaskAreaExportHelper = (function () {
12445
12456
  Object.defineProperty(TaskAreaExportHelper.prototype, "customRangeLeftOffset", {
12446
12457
  get: function () {
12447
12458
  var _a;
12448
- (_a = this._customRangeLeftOffset) !== null && _a !== void 0 ? _a : (this._customRangeLeftOffset = this.layoutCalculator.getDistanceBetweenDates(this.startDate, this.ownerStartDate));
12459
+ (_a = this._customRangeLeftOffset) !== null && _a !== void 0 ? _a : (this._customRangeLeftOffset = this.layoutCalculator.getWidthByDateRange(this.startDate, this.ownerStartDate));
12449
12460
  return this._customRangeLeftOffset;
12450
12461
  },
12451
12462
  enumerable: false,
@@ -15331,8 +15342,11 @@ var PdfGanttTableDrawer = (function () {
15331
15342
  this._pdfDoc = pdfDoc;
15332
15343
  }
15333
15344
  PdfGanttTableDrawer.prototype.drawTable = function (info) {
15345
+ var _a, _b;
15334
15346
  if (info) {
15335
15347
  var options = this.createTableOptions(info);
15348
+ if ((_a = info.style) === null || _a === void 0 ? void 0 : _a.fontSize)
15349
+ this._pdfDoc.setFontSize((_b = info.style) === null || _b === void 0 ? void 0 : _b.fontSize);
15336
15350
  this._pdfDoc.autoTable(options.getValue());
15337
15351
  }
15338
15352
  };
@@ -16037,7 +16051,16 @@ var RenderHelper = (function () {
16037
16051
  parent.appendChild(this._taskArea);
16038
16052
  };
16039
16053
  RenderHelper.prototype.setSizeForTaskArea = function () {
16040
- this._taskAreaRender.setSizeForTaskArea();
16054
+ var width = this.getTaskAreaWidth();
16055
+ var height = this.getTaskAreaHeight();
16056
+ this._taskAreaRender.setSizeForTaskArea(width, height);
16057
+ this._ganttView.onTaskAreaSizeChanged({ width: width, height: height });
16058
+ };
16059
+ RenderHelper.prototype.getTaskAreaWidth = function () {
16060
+ return this.gridLayoutCalculator.getTotalWidth();
16061
+ };
16062
+ RenderHelper.prototype.getTaskAreaHeight = function () {
16063
+ return this.gridLayoutCalculator.getVerticalGridLineHeight();
16041
16064
  };
16042
16065
  RenderHelper.prototype.getTaskAreaContainerScrollLeft = function () {
16043
16066
  return this._taskAreaRender.taskAreaContainer.scrollLeft;
@@ -16063,9 +16086,6 @@ var RenderHelper = (function () {
16063
16086
  RenderHelper.prototype.getSmallTaskWidth = function (etalonPaddingLeft) {
16064
16087
  return this._taskRender.getSmallTaskWidth(etalonPaddingLeft);
16065
16088
  };
16066
- RenderHelper.prototype.getTaskAreaWidth = function () {
16067
- return this._taskAreaRender.getTaskAreaWidth();
16068
- };
16069
16089
  RenderHelper.prototype.createTaskElement = function (index) {
16070
16090
  this._taskRender.createTaskElement(index, this._ganttView.settings.taskContentTemplate);
16071
16091
  };
@@ -18345,15 +18365,9 @@ var TaskAreaRender = (function () {
18345
18365
  TaskAreaRender.prototype.getTaskAreaBordersDictionary = function (isVertical) {
18346
18366
  return isVertical ? this.vertTaskAreaBorders : this.horTaskAreaBorders;
18347
18367
  };
18348
- TaskAreaRender.prototype.setSizeForTaskArea = function () {
18349
- this.taskArea.style.width = this.getTaskAreaWidth() + "px";
18350
- this.taskArea.style.height = this.getTaskAreaHeight() + "px";
18351
- };
18352
- TaskAreaRender.prototype.getTaskAreaWidth = function () {
18353
- return this.gridLayoutCalculator.getTotalWidth();
18354
- };
18355
- TaskAreaRender.prototype.getTaskAreaHeight = function () {
18356
- return this.gridLayoutCalculator.getVerticalGridLineHeight();
18368
+ TaskAreaRender.prototype.setSizeForTaskArea = function (width, height) {
18369
+ this.taskArea.style.width = width + "px";
18370
+ this.taskArea.style.height = height + "px";
18357
18371
  };
18358
18372
  TaskAreaRender.prototype.createHighlightRowElement = function (index) {
18359
18373
  var hlRowInfo = this.gridLayoutCalculator.getHighlightRowInfo(index);
@@ -20341,6 +20355,13 @@ var Task = (function (_super) {
20341
20355
  _this.color = "";
20342
20356
  return _this;
20343
20357
  }
20358
+ Object.defineProperty(Task.prototype, "normalizedProgress", {
20359
+ get: function () {
20360
+ return Math.max(Math.min(this.progress, 100), 0);
20361
+ },
20362
+ enumerable: false,
20363
+ configurable: true
20364
+ });
20344
20365
  Task.prototype.assignFromObject = function (sourceObj) {
20345
20366
  if ((0, common_1.isDefined)(sourceObj)) {
20346
20367
  _super.prototype.assignFromObject.call(this, sourceObj);
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt.min)
3
- * Version: 4.0.7
4
- * Build date: Fri Feb 04 2022
3
+ * Version: 4.0.11
4
+ * Build date: Tue Feb 22 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs