@sapui5/sap.gantt 1.125.0 → 1.126.0

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.
Files changed (191) hide show
  1. package/package.json +1 -1
  2. package/src/sap/gantt/.library +6 -1
  3. package/src/sap/gantt/AdhocLine.js +1 -1
  4. package/src/sap/gantt/GanttChart.js +1 -1
  5. package/src/sap/gantt/GanttChartBase.js +1 -1
  6. package/src/sap/gantt/GanttChartContainer.js +1 -1
  7. package/src/sap/gantt/GanttChartWithTable.js +1 -1
  8. package/src/sap/gantt/axistime/AxisTimeStrategyBase.js +58 -8
  9. package/src/sap/gantt/axistime/FullScreenStrategy.js +1 -1
  10. package/src/sap/gantt/axistime/ProportionZoomStrategy.js +1 -1
  11. package/src/sap/gantt/axistime/StepwiseZoomStrategy.js +10 -4
  12. package/src/sap/gantt/changeHandlers/simple/AdhocLine.js +1 -1
  13. package/src/sap/gantt/changeHandlers/simple/DeltaLine.js +1 -1
  14. package/src/sap/gantt/changeHandlers/simple/GanttChartContainer.js +1 -1
  15. package/src/sap/gantt/changeHandlers/simple/GanttChartWithTable.js +1 -1
  16. package/src/sap/gantt/config/BirdEyeGroup.js +1 -1
  17. package/src/sap/gantt/config/ChartScheme.js +1 -1
  18. package/src/sap/gantt/config/ColumnAttribute.js +1 -1
  19. package/src/sap/gantt/config/ContainerLayout.js +1 -1
  20. package/src/sap/gantt/config/ExpandChart.js +1 -1
  21. package/src/sap/gantt/config/ExpandChartGroup.js +1 -1
  22. package/src/sap/gantt/config/GanttChartLayout.js +1 -1
  23. package/src/sap/gantt/config/Hierarchy.js +1 -1
  24. package/src/sap/gantt/config/HierarchyColumn.js +1 -1
  25. package/src/sap/gantt/config/LayoutGroup.js +1 -1
  26. package/src/sap/gantt/config/Locale.js +1 -1
  27. package/src/sap/gantt/config/Mode.js +1 -1
  28. package/src/sap/gantt/config/ModeGroup.js +1 -1
  29. package/src/sap/gantt/config/ObjectType.js +1 -1
  30. package/src/sap/gantt/config/SettingGroup.js +1 -1
  31. package/src/sap/gantt/config/SettingItem.js +1 -1
  32. package/src/sap/gantt/config/Shape.js +1 -1
  33. package/src/sap/gantt/config/TimeAxis.js +1 -1
  34. package/src/sap/gantt/config/TimeHorizon.js +1 -1
  35. package/src/sap/gantt/config/TimeZoomGroup.js +1 -1
  36. package/src/sap/gantt/config/ToolbarGroup.js +1 -1
  37. package/src/sap/gantt/config/ToolbarScheme.js +1 -1
  38. package/src/sap/gantt/control/Cell.js +1 -1
  39. package/src/sap/gantt/def/DefBase.js +1 -1
  40. package/src/sap/gantt/def/SvgDefs.js +1 -1
  41. package/src/sap/gantt/def/cal/Calendar.js +1 -1
  42. package/src/sap/gantt/def/cal/CalendarDefs.js +1 -1
  43. package/src/sap/gantt/def/cal/TimeInterval.js +1 -1
  44. package/src/sap/gantt/def/filter/MorphologyFilter.js +1 -1
  45. package/src/sap/gantt/def/gradient/LinearGradient.js +1 -1
  46. package/src/sap/gantt/def/gradient/RadialGradient.js +1 -1
  47. package/src/sap/gantt/def/gradient/Stop.js +1 -1
  48. package/src/sap/gantt/def/pattern/BackSlashPattern.js +1 -1
  49. package/src/sap/gantt/def/pattern/PatternBase.js +1 -1
  50. package/src/sap/gantt/def/pattern/SlashPattern.js +1 -1
  51. package/src/sap/gantt/drawer/Drawer.js +1 -1
  52. package/src/sap/gantt/eventHandler/AutoScrollHandler.js +1 -1
  53. package/src/sap/gantt/eventHandler/BirdEyeHandler.js +1 -1
  54. package/src/sap/gantt/eventHandler/MouseWheelHandler.js +1 -1
  55. package/src/sap/gantt/eventHandler/ShapeHoverHandler.js +1 -1
  56. package/src/sap/gantt/eventHandler/ShapeResizeHandler.js +1 -1
  57. package/src/sap/gantt/eventHandler/TimePeriodZoomHandler.js +1 -1
  58. package/src/sap/gantt/eventHandler/TimePopoverHandler.js +1 -1
  59. package/src/sap/gantt/layouts/SidePanel.js +1 -1
  60. package/src/sap/gantt/legend/DimensionLegend.js +1 -1
  61. package/src/sap/gantt/legend/LegendBase.js +1 -1
  62. package/src/sap/gantt/legend/LegendContainer.js +1 -1
  63. package/src/sap/gantt/legend/ListLegend.js +1 -1
  64. package/src/sap/gantt/library.js +13 -3
  65. package/src/sap/gantt/messagebundle_sh.properties +30 -30
  66. package/src/sap/gantt/misc/AxisTime.js +80 -22
  67. package/src/sap/gantt/misc/Memoizer.js +1 -1
  68. package/src/sap/gantt/misc/RelativeTimeFormatter.js +1 -1
  69. package/src/sap/gantt/misc/ShapeManager.js +1 -1
  70. package/src/sap/gantt/overlays/GanttRowOverlay.js +80 -16
  71. package/src/sap/gantt/overlays/Overlay.js +1 -1
  72. package/src/sap/gantt/polyfills/lib.js +1 -1
  73. package/src/sap/gantt/polyfills/time.js +7 -7
  74. package/src/sap/gantt/polyfills/{time-utils → timeUtils}/dayCount.js +1 -1
  75. package/src/sap/gantt/shape/Circle.js +1 -1
  76. package/src/sap/gantt/shape/ClipPath.js +1 -1
  77. package/src/sap/gantt/shape/Definitions.js +1 -1
  78. package/src/sap/gantt/shape/Group.js +1 -1
  79. package/src/sap/gantt/shape/Image.js +1 -1
  80. package/src/sap/gantt/shape/Line.js +1 -1
  81. package/src/sap/gantt/shape/Path.js +1 -1
  82. package/src/sap/gantt/shape/Polygon.js +1 -1
  83. package/src/sap/gantt/shape/Polyline.js +1 -1
  84. package/src/sap/gantt/shape/Rectangle.js +1 -1
  85. package/src/sap/gantt/shape/ResizeShadowShape.js +1 -1
  86. package/src/sap/gantt/shape/SelectedShape.js +1 -1
  87. package/src/sap/gantt/shape/Shape.js +1 -1
  88. package/src/sap/gantt/shape/Text.js +1 -1
  89. package/src/sap/gantt/shape/cal/Calendar.js +1 -1
  90. package/src/sap/gantt/shape/ext/Chevron.js +1 -1
  91. package/src/sap/gantt/shape/ext/Cursor.js +1 -1
  92. package/src/sap/gantt/shape/ext/Diamond.js +1 -1
  93. package/src/sap/gantt/shape/ext/Iconfont.js +1 -1
  94. package/src/sap/gantt/shape/ext/Pentangle.js +1 -1
  95. package/src/sap/gantt/shape/ext/TextRepeat.js +1 -1
  96. package/src/sap/gantt/shape/ext/Triangle.js +1 -1
  97. package/src/sap/gantt/shape/ext/rls/Relationship.js +1 -1
  98. package/src/sap/gantt/shape/ext/rls/SelectedRelationship.js +2 -2
  99. package/src/sap/gantt/shape/ext/ubc/UbcBorderPath.js +1 -1
  100. package/src/sap/gantt/shape/ext/ubc/UbcOverCapacityZonePolygon.js +1 -1
  101. package/src/sap/gantt/shape/ext/ubc/UbcPolygon.js +1 -1
  102. package/src/sap/gantt/shape/ext/ubc/UbcShortageCapacityPolygon.js +1 -1
  103. package/src/sap/gantt/shape/ext/ubc/UbcTooltipRectangle.js +1 -1
  104. package/src/sap/gantt/shape/ext/ubc/UbcUnderCapacityZonePolygon.js +1 -1
  105. package/src/sap/gantt/shape/ext/ubc/UbcUsedPolygon.js +1 -1
  106. package/src/sap/gantt/shape/ext/ubc/UtilizationBarChart.js +1 -1
  107. package/src/sap/gantt/shape/ext/ulc/UlcBorderPath.js +1 -1
  108. package/src/sap/gantt/shape/ext/ulc/UlcClipPath.js +1 -1
  109. package/src/sap/gantt/shape/ext/ulc/UlcClipingPath.js +1 -1
  110. package/src/sap/gantt/shape/ext/ulc/UlcDimension.js +1 -1
  111. package/src/sap/gantt/shape/ext/ulc/UlcMiddleLine.js +1 -1
  112. package/src/sap/gantt/shape/ext/ulc/UlcOverCapacityZoneRectangle.js +1 -1
  113. package/src/sap/gantt/shape/ext/ulc/UlcOverClipRectangle.js +1 -1
  114. package/src/sap/gantt/shape/ext/ulc/UlcRectangle.js +1 -1
  115. package/src/sap/gantt/shape/ext/ulc/UlcTooltipRectangle.js +1 -1
  116. package/src/sap/gantt/shape/ext/ulc/UlcUnderClipRectangle.js +1 -1
  117. package/src/sap/gantt/shape/ext/ulc/UtilizationLineChart.js +1 -1
  118. package/src/sap/gantt/simple/AdhocDiamond.js +1 -1
  119. package/src/sap/gantt/simple/AdhocLine.js +1 -1
  120. package/src/sap/gantt/simple/AggregationUtils.js +11 -58
  121. package/src/sap/gantt/simple/BaseCalendar.js +1 -1
  122. package/src/sap/gantt/simple/BaseChevron.js +1 -1
  123. package/src/sap/gantt/simple/BaseConditionalShape.js +1 -1
  124. package/src/sap/gantt/simple/BaseCursor.js +1 -1
  125. package/src/sap/gantt/simple/BaseDeltaRectangle.js +4 -1
  126. package/src/sap/gantt/simple/BaseDiamond.js +1 -1
  127. package/src/sap/gantt/simple/BaseGroup.js +1 -1
  128. package/src/sap/gantt/simple/BaseImage.js +1 -1
  129. package/src/sap/gantt/simple/BaseLine.js +1 -1
  130. package/src/sap/gantt/simple/BasePath.js +1 -1
  131. package/src/sap/gantt/simple/BasePseudoShape.js +1 -1
  132. package/src/sap/gantt/simple/BaseRectangle.js +4 -1
  133. package/src/sap/gantt/simple/BaseShape.js +1 -1
  134. package/src/sap/gantt/simple/BaseText.js +1 -1
  135. package/src/sap/gantt/simple/BaseTriangle.js +1 -1
  136. package/src/sap/gantt/simple/ContainerToolbar.js +13 -4
  137. package/src/sap/gantt/simple/ContainerToolbarPlaceholder.js +1 -1
  138. package/src/sap/gantt/simple/CoordinateUtils.js +1 -1
  139. package/src/sap/gantt/simple/CustomVariantHandler.js +1 -1
  140. package/src/sap/gantt/simple/DeltaLine.js +1 -1
  141. package/src/sap/gantt/simple/ExpandModel.js +1 -3
  142. package/src/sap/gantt/simple/GanttAdaptationData.js +1 -1
  143. package/src/sap/gantt/simple/GanttChartContainer.js +8 -2
  144. package/src/sap/gantt/simple/GanttChartWithTable.js +36 -2
  145. package/src/sap/gantt/simple/GanttDragDropExtension.js +8 -1
  146. package/src/sap/gantt/simple/GanttExtension.js +1 -1
  147. package/src/sap/gantt/simple/GanttHeader.js +1 -1
  148. package/src/sap/gantt/simple/GanttPointerExtension.js +1 -1
  149. package/src/sap/gantt/simple/GanttPopoverExtension.js +1 -1
  150. package/src/sap/gantt/simple/GanttPrinting.js +3 -2
  151. package/src/sap/gantt/simple/GanttRowAction.js +1 -1
  152. package/src/sap/gantt/simple/GanttRowSettings.js +30 -1
  153. package/src/sap/gantt/simple/GanttScrollExtension.js +19 -4
  154. package/src/sap/gantt/simple/GanttUtils.js +85 -0
  155. package/src/sap/gantt/simple/InnerGanttChart.js +1 -1
  156. package/src/sap/gantt/simple/LegendContainer.js +1 -1
  157. package/src/sap/gantt/simple/LegendShapeGroup.js +1 -1
  158. package/src/sap/gantt/simple/MultiActivityGroup.js +1 -1
  159. package/src/sap/gantt/simple/MultiActivityRowSettings.js +1 -1
  160. package/src/sap/gantt/simple/Relationship.js +1 -1
  161. package/src/sap/gantt/simple/ShapeScheme.js +1 -1
  162. package/src/sap/gantt/simple/StockChart.js +1 -1
  163. package/src/sap/gantt/simple/StockChartDimension.js +1 -1
  164. package/src/sap/gantt/simple/StockChartPeriod.js +1 -1
  165. package/src/sap/gantt/simple/UtilizationBarChart.js +1 -1
  166. package/src/sap/gantt/simple/UtilizationChart.js +4 -1
  167. package/src/sap/gantt/simple/UtilizationDimension.js +1 -1
  168. package/src/sap/gantt/simple/UtilizationLineChart.js +1 -1
  169. package/src/sap/gantt/simple/UtilizationPeriod.js +1 -1
  170. package/src/sap/gantt/simple/shapes/Shape.js +1 -1
  171. package/src/sap/gantt/simple/shapes/Task.js +1 -1
  172. package/src/sap/gantt/skipTime/DayInterval.js +63 -0
  173. package/src/sap/gantt/skipTime/DiscontinuousProvider.js +48 -0
  174. package/src/sap/gantt/skipTime/SkipInterval.js +76 -0
  175. package/src/sap/gantt/skipTime/SkipPattern.js +64 -0
  176. package/src/sap/gantt/skipTime/WeekPattern.js +118 -0
  177. package/src/sap/gantt/skipTime/WeeklyDiscontinuousProvider.js +78 -0
  178. package/src/sap/gantt/themes/sap_hcb/base_Gantt.less +899 -0
  179. package/src/sap/gantt/themes/sap_hcb/base_GanttPrinting.less +101 -0
  180. package/src/sap/gantt/themes/sap_hcb/base_GanttSyncedControl.less +96 -0
  181. package/src/sap/gantt/themes/sap_hcb/library.source.less +15 -1
  182. package/src/sap/gantt/thirdparty/d3fc-discontinuous-scale.js +1129 -0
  183. package/src/sap/gantt/thirdparty/d3fc-rebind.js +103 -0
  184. package/src/sap/gantt/thirdparty/licenses/d3fc-MIT-LICENSE.txt +21 -0
  185. /package/src/sap/gantt/polyfills/{time-utils → timeUtils}/day.js +0 -0
  186. /package/src/sap/gantt/polyfills/{time-utils → timeUtils}/days.js +0 -0
  187. /package/src/sap/gantt/polyfills/{time-utils → timeUtils}/interval.js +0 -0
  188. /package/src/sap/gantt/polyfills/{time-utils → timeUtils}/millisecond.js +0 -0
  189. /package/src/sap/gantt/polyfills/{time-utils → timeUtils}/monday.js +0 -0
  190. /package/src/sap/gantt/polyfills/{time-utils → timeUtils}/saturday.js +0 -0
  191. /package/src/sap/gantt/polyfills/{time-utils → timeUtils}/weeks.js +0 -0
@@ -19,7 +19,7 @@ sap.ui.define(['sap/ui/core/Element'], function (Element) {
19
19
  * @extends sap.ui.core.Element
20
20
  *
21
21
  * @author SAP SE
22
- * @version 1.125.0
22
+ * @version 1.126.0
23
23
  *
24
24
  * @constructor
25
25
  * @public
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @extends sap.gantt.simple.UtilizationChart
29
29
  *
30
30
  * @author SAP SE
31
- * @version 1.125.0
31
+ * @version 1.126.0
32
32
  * @since 1.95
33
33
  *
34
34
  * @constructor
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @extends sap.ui.core.Element
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.125.0
26
+ * @version 1.126.0
27
27
  * @since 1.95
28
28
  *
29
29
  * @constructor
@@ -24,7 +24,7 @@ sap.ui.define(["sap/ui/core/Element"], function(Element){
24
24
  * @extends sap.ui.core.Element
25
25
  *
26
26
  * @author SAP SE
27
- * @version 1.125.0
27
+ * @version 1.126.0
28
28
  *
29
29
  * @constructor
30
30
  * @public
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @extends sap.gantt.simple.UtilizationChart
26
26
  *
27
27
  * @author SAP SE
28
- * @version 1.125.0
28
+ * @version 1.126.0
29
29
  *
30
30
  * @constructor
31
31
  * @public
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @extends sap.gantt.simple.BaseShape
27
27
  *
28
28
  * @author SAP SE
29
- * @version 1.125.0
29
+ * @version 1.126.0
30
30
  *
31
31
  * @constructor
32
32
  * @abstract
@@ -93,6 +93,9 @@ sap.ui.define([
93
93
  iStartTime = this.getTime().valueOf();
94
94
  iEndTime = this.getEndTime().valueOf();
95
95
  iTimeDiff = iEndTime - iStartTime;
96
+ if (oAxisTime.discontinuityProvider) { // when skip time pattern is applied, use distance method to calculate time difference
97
+ iTimeDiff = oAxisTime._discontinuityProviderInstance.distance(this.getTime(), this.getEndTime());
98
+ }
96
99
  iZoomRate = oAxisTime.getZoomRate();
97
100
  viewOffset = oAxisTime.getViewOffset();
98
101
  viewRange = oAxisTime.getViewRange()[1];
@@ -20,7 +20,7 @@ sap.ui.define(["sap/ui/core/Element"], function(Element){
20
20
  * @extends sap.ui.core.Element
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.125.0
23
+ * @version 1.126.0
24
24
  *
25
25
  * @constructor
26
26
  * @public
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @extends sap.gantt.simple.UtilizationChart
31
31
  *
32
32
  * @author SAP SE
33
- * @version 1.125.0
33
+ * @version 1.126.0
34
34
  *
35
35
  * @constructor
36
36
  * @public
@@ -24,7 +24,7 @@ sap.ui.define(["sap/ui/core/Element"], function(Element){
24
24
  * @extends sap.ui.core.Element
25
25
  *
26
26
  * @author SAP SE
27
- * @version 1.125.0
27
+ * @version 1.126.0
28
28
  *
29
29
  * @constructor
30
30
  * @public
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @extends sap.gantt.simple.BaseShape
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.125.0
35
+ * @version 1.126.0
36
36
  *
37
37
  * @abstract
38
38
  * @constructor
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @extends sap.gantt.simple.shapes.Shape
39
39
  *
40
40
  * @author SAP SE
41
- * @version 1.125.0
41
+ * @version 1.126.0
42
42
  *
43
43
  * @constructor
44
44
  * @public
@@ -0,0 +1,63 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+
4
+ (c) Copyright 2009-2015 SAP SE. All rights reserved
5
+
6
+ */
7
+ sap.ui.define([
8
+ "sap/ui/core/Element"
9
+ ], function (Element) {
10
+ "use strict";
11
+ /**
12
+ * Creates and initializes a new class for day interval.
13
+ *
14
+ * @param {string} [sId] ID of the new control. The ID is generated automatically if it is not provided.
15
+ * @param {object} [mSetting] Initial settings for the new control
16
+ *
17
+ * @class
18
+ * Enables the user to define skip time pattern within a day.
19
+ *
20
+ * @extends sap.ui.core.Element
21
+ *
22
+ * @author SAP SE
23
+ * @version 1.126.0
24
+ * @since 1.126
25
+ *
26
+ * @constructor
27
+ * @public
28
+ * @alias sap.gantt.skipTime.DayInterval
29
+ */
30
+ var DayInterval = Element.extend("sap.gantt.skipTime.DayInterval", /** @lends sap.gantt.skipTime.DayInterval.prototype */ {
31
+ metadata: {
32
+ library: "sap.gantt",
33
+ defaultAggregation: "skipIntervals",
34
+ properties: {
35
+ /**
36
+ * Non-working day, supported values: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
37
+ * @since 1.126
38
+ */
39
+ day: {type: "string"}
40
+ },
41
+ aggregations: {
42
+ /**
43
+ * Time intervals to be skipped for the day.
44
+ * @since 1.126
45
+ */
46
+ skipIntervals: {type: "sap.gantt.skipTime.SkipInterval", multiple: true, singularName: "skipInterval"}
47
+ }
48
+ }
49
+ });
50
+
51
+ /**
52
+ * Utility method to format skip intervals
53
+ * @returns {Array} returns array of formatted skip intervals
54
+ * @private
55
+ */
56
+ DayInterval.prototype._getFormattedSkipIntervals = function () {
57
+ return this.getSkipIntervals().map(function (oInterval) {
58
+ return oInterval._getFormattedTime();
59
+ });
60
+ };
61
+
62
+ return DayInterval;
63
+ });
@@ -0,0 +1,48 @@
1
+ sap.ui.define([
2
+ ], function () {
3
+ 'use strict';
4
+ /**
5
+ * Creates and initializes a new class for DiscontinuousProvider.
6
+ * Enables the user to define custom discontinuous provider.
7
+ *
8
+ * @author SAP SE
9
+ * @version 1.126.0
10
+ * @since 1.126
11
+ *
12
+ * @constructor
13
+ * @public
14
+ * @alias sap.gantt.skipTime.DiscontinuousProvider
15
+ */
16
+ function DiscontinuousProvider () {}
17
+
18
+ // Returns whether the discontinuous provider is to be used or not. This method can be overriden to define custom conditions.
19
+ DiscontinuousProvider.prototype.useDiscontinuousScale = function(){
20
+ return true;
21
+ };
22
+
23
+ // If the given date falls within a discontinuity (i.e. an excluded domain range), it must be moved forward to the discontinuity boundary. Otherwise, it should be returned unchanged.
24
+ DiscontinuousProvider.prototype.clampUp = function (oDate) {
25
+ return oDate;
26
+ };
27
+
28
+ // If the given date falls within a discontinuity, it must be shifted backwards to the discontinuity boundary. Otherwise, it should be returned unchanged.
29
+ DiscontinuousProvider.prototype.clampDown = function (oDate) {
30
+ return oDate;
31
+ };
32
+
33
+ // returns the number of milliseconds between the start and end dates after removing the discontinuities in between.
34
+ DiscontinuousProvider.prototype.distance = function (start, end) {
35
+ return end - start;
36
+ };
37
+
38
+ // When given a date and an offset in milliseconds, the date should be advanced by the offset value, skipping any discontinuities, to return the final value.
39
+ DiscontinuousProvider.prototype.offset = function (oDate, offset) {
40
+ return new Date(oDate.getTime() + offset);
41
+ };
42
+
43
+ DiscontinuousProvider.prototype.tickFilter = function (aTicks) {
44
+ return aTicks;
45
+ };
46
+
47
+ return DiscontinuousProvider;
48
+ });
@@ -0,0 +1,76 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+
4
+ (c) Copyright 2009-2015 SAP SE. All rights reserved
5
+
6
+ */
7
+ sap.ui.define([
8
+ "sap/ui/core/Element"
9
+ ], function (Element) {
10
+ "use strict";
11
+
12
+ /**
13
+ * Creates and initializes a new class for skip interval.
14
+ *
15
+ * @param {string} [sId] ID of the new control. The ID is generated automatically if it is not provided.
16
+ * @param {object} [mSetting] Initial settings for the new control
17
+ *
18
+ * @class
19
+ * Enables the user to define skip time interval.
20
+ *
21
+ * @extends sap.ui.core.Element
22
+ *
23
+ * @author SAP SE
24
+ * @version 1.126.0
25
+ * @since 1.126
26
+ *
27
+ * @constructor
28
+ * @public
29
+ * @alias sap.gantt.skipTime.SkipInterval
30
+ */
31
+
32
+ var SkipInterval = Element.extend("sap.gantt.skipTime.SkipInterval", /** @lends sap.gantt.skipTime.SkipInterval.prototype */ {
33
+ metadata: {
34
+ library: "sap.gantt",
35
+ properties: {
36
+ /**
37
+ * Start time with in a day from which time is to be skipped. Format: HHMMSS.
38
+ * @since 1.126
39
+ */
40
+ startTime: { type: "string", group: "Misc", defaultValue: "000000" },
41
+
42
+ /**
43
+ * End time with in a day till which time is to be skipped. Format: HHMMSS.
44
+ * @since 1.126
45
+ */
46
+ endTime: { type: "string", group: "Misc", defaultValue: "235959" }
47
+ }
48
+ }
49
+ });
50
+
51
+ /**
52
+ * Utility method to format the time slices to d3fc supported value
53
+ * @returns {Array} returns the formatted start and end pair
54
+ * @private
55
+ */
56
+ SkipInterval.prototype._getFormattedTime = function () {
57
+ var sStartTime = this.getStartTime();
58
+ var sEndTime = this.getEndTime();
59
+
60
+ if (sStartTime.slice(0, 4) === "0000") {
61
+ sStartTime = "SOD";
62
+ } else {
63
+ sStartTime = sStartTime.slice(0, 2) + ":" + sStartTime.slice(2, 4);
64
+ }
65
+
66
+ if (sEndTime.slice(0, 4) === "2359") {
67
+ sEndTime = "EOD";
68
+ } else {
69
+ sEndTime = sEndTime.slice(0, 2) + ":" + sEndTime.slice(2, 4);
70
+ }
71
+
72
+ return [sStartTime, sEndTime];
73
+ };
74
+
75
+ return SkipInterval;
76
+ });
@@ -0,0 +1,64 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+
4
+ (c) Copyright 2009-2015 SAP SE. All rights reserved
5
+
6
+ */
7
+ sap.ui.define([
8
+ "sap/ui/core/Element",
9
+ "sap/gantt/thirdparty/d3fc-discontinuous-scale"
10
+ ], function (Element) {
11
+ "use strict";
12
+
13
+ /**
14
+ * Creates and initializes a new class for skip time pattern.
15
+ *
16
+ * @param {string} [sId] ID of the new control. The ID is generated automatically if it is not provided.
17
+ * @param {object} [mSetting] Initial settings for the new control
18
+ *
19
+ * @class
20
+ * Enables the user to define skip time pattern.
21
+ *
22
+ * @extends sap.ui.core.Element
23
+ *
24
+ * @author SAP SE
25
+ * @version 1.126.0
26
+ * @since 1.126
27
+ *
28
+ * @constructor
29
+ * @public
30
+ * @alias sap.gantt.skipTime.SkipPattern
31
+ */
32
+
33
+ var SkipPattern = Element.extend("sap.gantt.skipTime.SkipPattern", /** @lends sap.gantt.skipTime.SkipPattern.prototype */ {
34
+ metadata: {
35
+ library: "sap.gantt",
36
+ "abstract": true
37
+ }
38
+ });
39
+
40
+ /**
41
+ * Returns the discontinuity provider of the skip pattern. Default value is null
42
+ * @return {sap.gantt.skipTime.DiscontinuousProvider} Discontinuity provider of the skip pattern
43
+ * @public
44
+ */
45
+ SkipPattern.prototype.getDiscontinuityProvider = function () {
46
+ return null;
47
+ };
48
+
49
+ /**
50
+ * Updates the discontinuity provider for the gantt chart timeline.
51
+ * @param {sap.gantt.skipTime.DiscontinuousProvider} oDiscontinuousProvider Discontinuous provider to be set
52
+ * @param {Boolean} bSuppressInvalidate Flag to suppress re-rendering of the control.
53
+ * @public
54
+ */
55
+ SkipPattern.prototype.updateDiscontinuousProvider = function (oDiscontinuousProvider, bSuppressInvalidate) {
56
+ var oAxisTimeStrategy = this.getParent();
57
+ if (oAxisTimeStrategy && oAxisTimeStrategy.isA("sap.gantt.axistime.StepwiseZoomStrategy")) {
58
+ delete oAxisTimeStrategy._nGanttVisibleWidth;
59
+ oAxisTimeStrategy.setProperty("_discontinuousProvider", oDiscontinuousProvider, bSuppressInvalidate);
60
+ }
61
+ };
62
+
63
+ return SkipPattern;
64
+ });
@@ -0,0 +1,118 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+
4
+ (c) Copyright 2009-2015 SAP SE. All rights reserved
5
+
6
+ */
7
+ sap.ui.define([
8
+ "sap/gantt/skipTime/SkipPattern",
9
+ "./WeeklyDiscontinuousProvider"
10
+ ], function (SkipPattern, WeeklyDiscontinuousProvider) {
11
+ "use strict";
12
+
13
+ /**
14
+ * Creates and initializes a new class for weekly time pattern.
15
+ *
16
+ * @param {string} [sId] ID of the new control. The ID is generated automatically if it is not provided.
17
+ * @param {object} [mSetting] Initial settings for the new control
18
+ *
19
+ * @class
20
+ * Enables the user to define weekly skip pattern.
21
+ * Non working hours are to be removed for timeLineOptions with innerInterval unit as <code>sap.gantt.config.TimeUnit.day<code>, <code>sap.gantt.config.TimeUnit.hour<code> and <code>sap.gantt.config.TimeUnit.minute<code>
22
+ *
23
+ * @extends sap.gantt.skipTime.SkipPattern
24
+ *
25
+ * @author SAP SE
26
+ * @version 1.126.0
27
+ * @since 1.126
28
+ *
29
+ * @constructor
30
+ * @public
31
+ * @alias sap.gantt.skipTime.WeekPattern
32
+ */
33
+
34
+ var WeekPattern = SkipPattern.extend("sap.gantt.skipTime.WeekPattern", /** @lends sap.gantt.skipTime.WeekPattern.prototype */ {
35
+ metadata: {
36
+ library: "sap.gantt",
37
+ defaultAggregation: "dailyIntervals",
38
+ properties: {
39
+ /**
40
+ * If this property is set to true, week pattern is applied to the gantt chart.
41
+ * @since 1.126
42
+ */
43
+ enabled: {type: "boolean", defaultValue: true}
44
+ },
45
+ aggregations: {
46
+ /**
47
+ * Day-wise non working time. These intervals are going to be skipped for the specified day.
48
+ * @since 1.126
49
+ */
50
+ dailyIntervals: {type: "sap.gantt.skipTime.DayInterval", multiple: true, singularName: "dailyInterval"},
51
+ /**
52
+ * Weekly non working time. This time is going to be skipped for all the days unless dailyIntervals are defined for that day.
53
+ * @since 1.126
54
+ */
55
+ weeklyIntervals: {type: "sap.gantt.skipTime.SkipInterval", multiple: true, singularName: "weeklyInterval"}
56
+ }
57
+ }
58
+ });
59
+
60
+ /**
61
+ * Utility method to format the time slices to d3fc supported value
62
+ * @returns {object} returns the formatted start and end pair
63
+ * @private
64
+ */
65
+ WeekPattern.prototype._getWeekPattern = function () {
66
+ var oWeeklyPattern = {};
67
+ var aDailyInterval = this.getDailyIntervals();
68
+ var aWeeklyInterval = this.getWeeklyIntervals();
69
+
70
+ var aAllDays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
71
+
72
+ if (aWeeklyInterval && aWeeklyInterval.length > 0) {
73
+ var aSkipWeekly = [];
74
+
75
+ aWeeklyInterval.forEach(function (oWeeklyInterval) {
76
+ aSkipWeekly.push(oWeeklyInterval._getFormattedTime());
77
+ });
78
+
79
+ aAllDays.forEach(function (sDay) {
80
+ oWeeklyPattern[sDay] = aSkipWeekly;
81
+ });
82
+ }
83
+
84
+ aDailyInterval.forEach(function (oDayInterval) {
85
+ var oDailyInterval = oDayInterval._getFormattedSkipIntervals();
86
+ if (oDailyInterval.length) {
87
+ oWeeklyPattern[oDayInterval.getDay()] = oDayInterval._getFormattedSkipIntervals();
88
+ }
89
+ });
90
+
91
+ return oWeeklyPattern;
92
+ };
93
+
94
+ /**
95
+ * Utility method to calculate the discontinuity provider for the week pattern
96
+ * @returns {object} returns the discontinuity provider of the week pattern
97
+ * @public
98
+ */
99
+ WeekPattern.prototype.getDiscontinuityProvider = function () {
100
+ if (this.getEnabled()) {
101
+ var oWeeklyPattern = this._getWeekPattern();
102
+ return Object.keys(oWeeklyPattern).length === 0 ? null : WeeklyDiscontinuousProvider.providers.weeklyPattern(oWeeklyPattern);
103
+ }
104
+ return null;
105
+ };
106
+ /**
107
+
108
+ * Method to enable or disable the week pattern
109
+ * @param {boolean} bEnable flag to enable or disable the week pattern
110
+ * @public
111
+ */
112
+ WeekPattern.prototype.setEnabled = function (bEnable) {
113
+ this.setProperty("enabled", bEnable, true);
114
+ this.updateDiscontinuousProvider(this.getDiscontinuityProvider());
115
+ };
116
+
117
+ return WeekPattern;
118
+ });
@@ -0,0 +1,78 @@
1
+ sap.ui.define([], function () {
2
+ 'use strict';
3
+
4
+ var skipWeeklyPattern = function (oSkipWeeklyPattern) {
5
+ var oInstance = window.fc.discontinuitySkipWeeklyPattern(oSkipWeeklyPattern);
6
+
7
+ oInstance.tradingWeekdays = oInstance.tradingDays.reduce(function (aTradingWeekdays, _, index) {
8
+ if (oInstance.tradingDays[index].totalTradingTimeInMiliseconds > 0) {
9
+ aTradingWeekdays.push({
10
+ index: index,
11
+ tradingDay: oInstance.tradingDays[index]
12
+ });
13
+ }
14
+
15
+ return aTradingWeekdays;
16
+ }, []);
17
+
18
+ oInstance.tradingWeekdaysIndex = oInstance.tradingWeekdays.map(function (tradingDay) { return tradingDay.index; });
19
+
20
+ oInstance.tickFilter = function (adoptedTicks) {
21
+ var filteredSet = adoptedTicks.reduce(function (ticks, tick) {
22
+ var up = this.clampUp(tick).getTime();
23
+ var down = this.clampDown(tick).getTime();
24
+
25
+ if (up !== down) {
26
+ ticks.add(up);
27
+ } else {
28
+ ticks.add(tick.getTime());
29
+ }
30
+
31
+ return ticks;
32
+ }.bind(this), new Set());
33
+
34
+ var aFilteredTicks = Array.from(filteredSet).map(function (value) {
35
+ return new Date(value);
36
+ });
37
+
38
+ return aFilteredTicks;
39
+ };
40
+
41
+ oInstance.firstTradingDayOfWeek = function (firstDayOfWeek) {
42
+ var aTradingWeekdays = oInstance.tradingWeekdays;
43
+
44
+ if (aTradingWeekdays.length === 0) {
45
+ return firstDayOfWeek;
46
+ }
47
+
48
+ var firstTradingDay = aTradingWeekdays[0].index;
49
+
50
+ if (aTradingWeekdays.length > 1 && firstTradingDay !== firstDayOfWeek) {
51
+ for (var i = 0; i < aTradingWeekdays.length; i++) {
52
+ var tradingDayIndex = aTradingWeekdays[i].index;
53
+
54
+ if (tradingDayIndex === firstDayOfWeek) {
55
+ firstTradingDay = firstDayOfWeek;
56
+ break;
57
+ } else if (tradingDayIndex > firstDayOfWeek && tradingDayIndex < firstTradingDay) {
58
+ firstTradingDay = tradingDayIndex;
59
+ }
60
+ }
61
+ }
62
+
63
+ return firstTradingDay;
64
+ };
65
+
66
+ oInstance.useDiscontinuousScale = function (unit) {
67
+ return unit === "d3.time.minute" || unit === "d3.time.hour" || unit === "d3.time.day";
68
+ };
69
+
70
+ return oInstance;
71
+ };
72
+
73
+ return {
74
+ providers: {
75
+ weeklyPattern: skipWeeklyPattern
76
+ }
77
+ };
78
+ });