@openui5/sap.ui.unified 1.149.0 → 1.150.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 (59) hide show
  1. package/REUSE.toml +24 -0
  2. package/THIRDPARTY.txt +24 -5
  3. package/package.json +2 -2
  4. package/src/sap/ui/unified/.library +1 -1
  5. package/src/sap/ui/unified/Calendar.js +1 -1
  6. package/src/sap/ui/unified/CalendarAppointment.js +23 -4
  7. package/src/sap/ui/unified/CalendarDateInterval.js +1 -1
  8. package/src/sap/ui/unified/CalendarLegend.js +1 -1
  9. package/src/sap/ui/unified/CalendarLegendItem.js +1 -1
  10. package/src/sap/ui/unified/CalendarMonthInterval.js +5 -1
  11. package/src/sap/ui/unified/CalendarOneMonthInterval.js +1 -1
  12. package/src/sap/ui/unified/CalendarRow.js +1 -1
  13. package/src/sap/ui/unified/CalendarRowRenderer.js +39 -24
  14. package/src/sap/ui/unified/CalendarTimeInterval.js +1 -1
  15. package/src/sap/ui/unified/CalendarWeekInterval.js +1 -1
  16. package/src/sap/ui/unified/ColorPicker.js +1 -1
  17. package/src/sap/ui/unified/ColorPickerPopover.js +1 -1
  18. package/src/sap/ui/unified/ContentSwitcher.js +1 -1
  19. package/src/sap/ui/unified/Currency.js +1 -1
  20. package/src/sap/ui/unified/CurrencyRenderer.js +1 -1
  21. package/src/sap/ui/unified/DateRange.js +1 -1
  22. package/src/sap/ui/unified/DateTypeRange.js +1 -1
  23. package/src/sap/ui/unified/FileUploader.js +1 -1
  24. package/src/sap/ui/unified/FileUploaderParameter.js +1 -1
  25. package/src/sap/ui/unified/FileUploaderXHRSettings.js +1 -1
  26. package/src/sap/ui/unified/Menu.js +1 -1
  27. package/src/sap/ui/unified/MenuItem.js +1 -1
  28. package/src/sap/ui/unified/MenuItemBase.js +1 -1
  29. package/src/sap/ui/unified/MenuItemGroup.js +1 -1
  30. package/src/sap/ui/unified/MenuRenderer.js +1 -1
  31. package/src/sap/ui/unified/MenuTextFieldItem.js +2 -2
  32. package/src/sap/ui/unified/MonthlyRecurrenceRule.js +1 -1
  33. package/src/sap/ui/unified/NonWorkingPeriod.js +1 -1
  34. package/src/sap/ui/unified/RecurrenceRule.js +1 -1
  35. package/src/sap/ui/unified/RecurringCalendarAppointment.js +7 -2
  36. package/src/sap/ui/unified/RecurringNonWorkingPeriod.js +15 -1
  37. package/src/sap/ui/unified/Shell.js +1 -1
  38. package/src/sap/ui/unified/ShellHeadItem.js +1 -1
  39. package/src/sap/ui/unified/ShellHeadUserItem.js +1 -1
  40. package/src/sap/ui/unified/ShellLayout.js +1 -1
  41. package/src/sap/ui/unified/ShellOverlay.js +1 -1
  42. package/src/sap/ui/unified/SplitContainer.js +1 -1
  43. package/src/sap/ui/unified/TimeRange.js +1 -1
  44. package/src/sap/ui/unified/WeeklyRecurrenceRule.js +1 -1
  45. package/src/sap/ui/unified/YearlyRecurrenceRule.js +1 -1
  46. package/src/sap/ui/unified/calendar/DatesRow.js +1 -1
  47. package/src/sap/ui/unified/calendar/Header.js +1 -1
  48. package/src/sap/ui/unified/calendar/IndexPicker.js +1 -1
  49. package/src/sap/ui/unified/calendar/Month.js +2 -1
  50. package/src/sap/ui/unified/calendar/MonthPicker.js +1 -1
  51. package/src/sap/ui/unified/calendar/MonthsRow.js +196 -40
  52. package/src/sap/ui/unified/calendar/OneMonthDatesRow.js +1 -1
  53. package/src/sap/ui/unified/calendar/TimesRow.js +1 -1
  54. package/src/sap/ui/unified/calendar/WeeksRow.js +1 -1
  55. package/src/sap/ui/unified/calendar/YearPicker.js +1 -1
  56. package/src/sap/ui/unified/calendar/YearRangePicker.js +1 -1
  57. package/src/sap/ui/unified/library.js +2 -2
  58. package/src/sap/ui/unified/messagebundle_en_US_sappsd.properties +73 -9
  59. package/src/sap/ui/unified/messagebundle_en_US_saptrc.properties +70 -8
@@ -34,7 +34,7 @@ sap.ui.define([
34
34
  *
35
35
  * Applications can inherit from this element to add own fields.
36
36
  * @extends sap.ui.unified.NonWorkingPeriod
37
- * @version 1.149.0
37
+ * @version 1.150.0
38
38
  *
39
39
  * @constructor
40
40
  * @public
@@ -112,6 +112,20 @@ sap.ui.define([
112
112
  return !!this.getRecurrenceType();
113
113
  };
114
114
 
115
+ /**
116
+ * Returns the recurrence start date. Falls back to the calendar date (midnight) when
117
+ * no timeRange is set, which is the normal case for RecurringNonWorkingPeriod.
118
+ * RecurrenceUtils.hasOccurrenceOnDate normalises to midnight itself, so this is safe.
119
+ * @returns {Date|module:sap/ui/core/date/UI5Date} The start date
120
+ * @private
121
+ */
122
+ RecurringNonWorkingPeriod.prototype.getStartDate = function() {
123
+ if (this.getTimeRange()) {
124
+ return NonWorkingPeriod.prototype.getStartDate.call(this);
125
+ }
126
+ return this.getDate();
127
+ };
128
+
115
129
  /**
116
130
  * Checks if a given date (without time) is a non-working day.
117
131
  * @param {Date|module:sap/ui/core/date/UI5Date} oDate - Date to check
@@ -25,7 +25,7 @@ sap.ui.define(['./ShellHeader', './ShellLayout', './library', './ShellRenderer']
25
25
  * @extends sap.ui.unified.ShellLayout
26
26
  *
27
27
  * @author SAP SE
28
- * @version 1.149.0
28
+ * @version 1.150.0
29
29
  *
30
30
  * @constructor
31
31
  * @public
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @extends sap.ui.core.Element
29
29
  *
30
30
  * @author SAP SE
31
- * @version 1.149.0
31
+ * @version 1.150.0
32
32
  *
33
33
  * @constructor
34
34
  * @public
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @extends sap.ui.core.Element
28
28
  *
29
29
  * @author SAP SE
30
- * @version 1.149.0
30
+ * @version 1.150.0
31
31
  *
32
32
  * @constructor
33
33
  * @public
@@ -56,7 +56,7 @@ sap.ui.define([
56
56
  * @extends sap.ui.core.Control
57
57
  *
58
58
  * @author SAP SE
59
- * @version 1.149.0
59
+ * @version 1.150.0
60
60
  *
61
61
  * @constructor
62
62
  * @public
@@ -46,7 +46,7 @@ sap.ui.define([
46
46
  * @extends sap.ui.core.Control
47
47
  *
48
48
  * @author SAP SE
49
- * @version 1.149.0
49
+ * @version 1.150.0
50
50
  *
51
51
  * @constructor
52
52
  * @public
@@ -34,7 +34,7 @@ sap.ui.define([
34
34
  * @extends sap.ui.core.Control
35
35
  *
36
36
  * @author SAP SE
37
- * @version 1.149.0
37
+ * @version 1.150.0
38
38
  *
39
39
  * @constructor
40
40
  * @public
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @class
24
24
  * Time range for use in <code>NonWorkingPeriod</code>
25
25
  * @extends sap.ui.core.Element
26
- * @version 1.149.0
26
+ * @version 1.150.0
27
27
  *
28
28
  * @constructor
29
29
  * @public
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * with <code>recurrenceType</code> set to <code>Weekly</code> is provided.
23
23
  *
24
24
  * @extends sap.ui.unified.RecurrenceRule
25
- * @version 1.149.0
25
+ * @version 1.150.0
26
26
  *
27
27
  * @constructor
28
28
  * @private
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * with <code>recurrenceType</code> set to <code>Yearly</code> is provided.
24
24
  *
25
25
  * @extends sap.ui.unified.MonthlyRecurrenceRule
26
- * @version 1.149.0
26
+ * @version 1.150.0
27
27
  *
28
28
  * @constructor
29
29
  * @private
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * If used inside the calendar the properties and aggregation are directly taken from the parent
40
40
  * (To not duplicate and sync DateRanges and so on...)
41
41
  * @extends sap.ui.unified.calendar.Month
42
- * @version 1.149.0
42
+ * @version 1.150.0
43
43
  *
44
44
  * @constructor
45
45
  * @public
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  *
28
28
  * <b>Note:</b> This is used inside the calendar. Not for standalone usage
29
29
  * @extends sap.ui.core.Control
30
- * @version 1.149.0
30
+ * @version 1.150.0
31
31
  *
32
32
  * @constructor
33
33
  * @public
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * This control serves for picking an item from a grid with items which are relative periods in Plannig Calendar.
33
33
  * This is used inside the sap.m.PlanningCalendar relative views. Not for stand alone usage.
34
34
  * @extends sap.ui.core.Control
35
- * @version 1.149.0
35
+ * @version 1.150.0
36
36
  *
37
37
  * @constructor
38
38
  * @private
@@ -78,7 +78,7 @@ sap.ui.define([
78
78
  * If used inside the calendar the properties and aggregation are directly taken from the parent
79
79
  * (To not duplicate and sync DateRanges and so on...)
80
80
  * @extends sap.ui.core.Control
81
- * @version 1.149.0
81
+ * @version 1.150.0
82
82
  *
83
83
  * @constructor
84
84
  * @public
@@ -1798,6 +1798,7 @@ sap.ui.define([
1798
1798
  // when again clicked on a same week number - then remove the selections
1799
1799
  oAggOwner.removeAllSelectedDates();
1800
1800
  oAggOwner.addSelectedDate(oDateRange);
1801
+ _fireSelect.call(this);
1801
1802
  }
1802
1803
 
1803
1804
  return this;
@@ -57,7 +57,7 @@ sap.ui.define([
57
57
  * renders a MonthPicker with ItemNavigation
58
58
  * This is used inside the calendar. Not for stand alone usage
59
59
  * @extends sap.ui.core.Control
60
- * @version 1.149.0
60
+ * @version 1.150.0
61
61
  *
62
62
  * @constructor
63
63
  * @public
@@ -23,7 +23,8 @@ sap.ui.define([
23
23
  "sap/ui/thirdparty/jquery",
24
24
  "sap/ui/unified/DateRange",
25
25
  "sap/ui/core/date/UI5Date",
26
- 'sap/ui/core/InvisibleText'
26
+ 'sap/ui/core/InvisibleText',
27
+ 'sap/ui/Device'
27
28
  ], function(
28
29
  Formatting,
29
30
  _CalendarType, // type of `primaryCalendarType` and `secondaryCalendarType`
@@ -42,7 +43,8 @@ sap.ui.define([
42
43
  jQuery,
43
44
  DateRange,
44
45
  UI5Date,
45
- InvisibleText
46
+ InvisibleText,
47
+ Device
46
48
  ) {
47
49
  "use strict";
48
50
 
@@ -68,7 +70,7 @@ sap.ui.define([
68
70
  * The MontsRow works with UI5Date or JavaScript Date objects, but only the month and the year are used to display and interact.
69
71
  * As representation for a month, the 1st of the month will always be returned in the API.
70
72
  * @extends sap.ui.core.Control
71
- * @version 1.149.0
73
+ * @version 1.150.0
72
74
  *
73
75
  * @constructor
74
76
  * @public
@@ -145,7 +147,13 @@ sap.ui.define([
145
147
  *
146
148
  * @since 1.145.0
147
149
  */
148
- showWeekNumbers : {type : "boolean", group : "Appearance", defaultValue : false}
150
+ showWeekNumbers : {type : "boolean", group : "Appearance", defaultValue : false},
151
+
152
+ /**
153
+ * The focused date for keyboard interval selection preview.
154
+ * @private
155
+ */
156
+ _focusedDate : {type : "object", group : "Data", visibility: "hidden", defaultValue: null}
149
157
  },
150
158
  aggregations : {
151
159
 
@@ -212,7 +220,7 @@ sap.ui.define([
212
220
  this._oFormatYyyymm = DateFormat.getInstance({pattern: "yyyyMMdd", calendarType: sCalendarType});
213
221
  this._oFormatOnlyYearLong = DateFormat.getInstance({pattern: "yyyy", calendarType: sCalendarType});
214
222
  this._oFormatLong = DateFormat.getInstance({pattern: "MMMM y", calendarType: sCalendarType});
215
- this._mouseMoveProxy = jQuery.proxy(this._handleMouseMove, this);
223
+ this._mouseMoveProxy = this._handleMouseMove.bind(this);
216
224
  this._rb = Library.getResourceBundleFor("sap.ui.unified");
217
225
  };
218
226
 
@@ -278,11 +286,15 @@ sap.ui.define([
278
286
 
279
287
  if (!oEvent.relatedControlId || !containsOrEquals(this.getDomRef(), Element.getElementById(oEvent.relatedControlId).getFocusDomRef())) {
280
288
  if (this._bMouseMove) {
281
- _unbindMousemove.call(this, true);
289
+ this._unbindMousemove(true);
282
290
 
283
- _selectMonth.call(this, this._getDate());
291
+ var bSelected = _selectMonth.call(this, this._getDate());
292
+ if (!bSelected && this._oMoveSelectedDate) {
293
+ _selectMonth.call(this, this._oMoveSelectedDate);
294
+ }
284
295
  this._bMoveChange = false;
285
296
  this._bMousedownChange = false;
297
+ this._oMoveSelectedDate = undefined;
286
298
  _fireSelect.call(this);
287
299
  }
288
300
 
@@ -671,7 +683,9 @@ sap.ui.define([
671
683
  sCalendarType = this.getProperty("primaryCalendarType"),
672
684
  i,
673
685
  aSelectedDates,
674
- oMyDate;
686
+ oMyDate,
687
+ oFocusedDate = this.getProperty("_focusedDate"),
688
+ bSelectionBetween = false;
675
689
 
676
690
  CalendarUtils._checkCalendarDate(oDate);
677
691
 
@@ -698,6 +712,14 @@ sap.ui.define([
698
712
  oEndTimeStamp = oEndDate.toUTCJSDate().getTime();
699
713
  }
700
714
 
715
+ if (oFocusedDate) {
716
+ oFocusedDate = CalendarDate.fromLocalJSDate(oFocusedDate, sCalendarType);
717
+ oFocusedDate.setDate(1);
718
+ }
719
+
720
+ bSelectionBetween = this._isMarkingUnfinishedRangeAllowed() && oFocusedDate && !this._selectedWithMouse &&
721
+ (CalendarUtils._isBetween(oMyDate, oStartDate, oFocusedDate, true) || CalendarUtils._isBetween(oMyDate, oFocusedDate, oStartDate, true));
722
+
701
723
  if (oTimeStamp == oStartTimeStamp && !oEndDate ) {
702
724
  iSelected = 1; // single day selected
703
725
  break;
@@ -711,7 +733,7 @@ sap.ui.define([
711
733
  } else if (oEndDate && oTimeStamp == oEndTimeStamp) {
712
734
  iSelected = 3; // interval end
713
735
  break;
714
- } else if (oEndDate && oTimeStamp > oStartTimeStamp && oTimeStamp < oEndTimeStamp) {
736
+ } else if ((oEndDate && oTimeStamp > oStartTimeStamp && oTimeStamp < oEndTimeStamp) || bSelectionBetween) {
715
737
  iSelected = 4; // interval between
716
738
  break;
717
739
  }
@@ -798,11 +820,44 @@ sap.ui.define([
798
820
 
799
821
  };
800
822
 
823
+ MonthsRow.prototype.onmousedown = function(oEvent) {
824
+ this._oMousedownPosition = {
825
+ clientX: oEvent.clientX,
826
+ clientY: oEvent.clientY
827
+ };
828
+ };
829
+
830
+ MonthsRow.prototype._isValueInThreshold = function(iReference, iValue, iThreshold) {
831
+ var iLowerThreshold = iReference - iThreshold,
832
+ iUpperThreshold = iReference + iThreshold;
833
+
834
+ return iValue >= iLowerThreshold && iValue <= iUpperThreshold;
835
+ };
836
+
837
+ MonthsRow.prototype._areMouseEventCoordinatesInThreshold = function(clientX, clientY, iThreshold) {
838
+ return this._oMousedownPosition
839
+ && this._isValueInThreshold(this._oMousedownPosition.clientX, clientX, iThreshold)
840
+ && this._isValueInThreshold(this._oMousedownPosition.clientY, clientY, iThreshold)
841
+ ? true : false;
842
+ };
843
+
844
+ MonthsRow.prototype._getSelectedDateFromEvent = function(oEvent) {
845
+ var oTarget = oEvent.target,
846
+ sExtractedMonth, oParsedDate;
847
+
848
+ sExtractedMonth = oTarget.getAttribute("data-sap-month") || oTarget.parentNode.getAttribute("data-sap-month");
849
+
850
+ oParsedDate = sExtractedMonth ? this._oFormatYyyymm.parse(sExtractedMonth, this.getProperty("primaryCalendarType")) : null;
851
+
852
+ return oParsedDate ? CalendarDate.fromLocalJSDate(oParsedDate, this.getProperty("primaryCalendarType")) : null;
853
+ };
854
+
801
855
  MonthsRow.prototype._handleMouseMove = function(oEvent){
802
856
 
803
857
  if (!this.$().is(":visible")) {
804
858
  // calendar was closed -> remove mousemove handler
805
- _unbindMousemove.call(this, true);
859
+ this._unbindMousemove(true);
860
+ return;
806
861
  }
807
862
 
808
863
  var $Target = jQuery(oEvent.target);
@@ -811,26 +866,104 @@ sap.ui.define([
811
866
  $Target = $Target.parent();
812
867
  }
813
868
 
814
- if ($Target.hasClass("sapUiCalItem")) {
815
- var oOldFocusedDate = this._getDate();
816
- var oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($Target.attr("data-sap-month"), this.getProperty("primaryCalendarType")));
817
- oFocusedDate.setDate(1);
869
+ if (this._sLastTargetId && this._sLastTargetId === $Target.attr("id")) {
870
+ // mouse move at same month -> do nothing
871
+ return;
872
+ }
873
+ this._sLastTargetId = $Target.attr("id");
874
+
875
+ if (!$Target.hasClass("sapUiCalItem") || !containsOrEquals(this.getDomRef(), oEvent.target)) {
876
+ return;
877
+ }
818
878
 
819
- if (!oFocusedDate.isSame(oOldFocusedDate)) {
820
- this.setDate(oFocusedDate.toLocalJSDate());
821
- _selectMonth.call(this, oFocusedDate, true);
822
- this._bMoveChange = true;
879
+ var oOldFocusedDate = this._getDate();
880
+ var oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($Target.attr("data-sap-month"), this.getProperty("primaryCalendarType")));
881
+ oFocusedDate.setDate(1);
882
+
883
+ if (!oFocusedDate.isSame(oOldFocusedDate)) {
884
+ this.setDate(oFocusedDate.toLocalJSDate());
885
+ var bSelected = _selectMonth.call(this, oFocusedDate, true);
886
+ if (bSelected) {
887
+ this._oMoveSelectedDate = new CalendarDate(oFocusedDate, this.getProperty("primaryCalendarType"));
823
888
  }
889
+ this._bMoveChange = true;
890
+ }
891
+ };
892
+
893
+ MonthsRow.prototype.onmouseover = function(oEvent) {
894
+ var $Target = jQuery(oEvent.target),
895
+ oSelectedDateRange = this.getSelectedDates()[0],
896
+ iMonth1,
897
+ iMonth2;
898
+
899
+ if (!this._isMarkingUnfinishedRangeAllowed()) {
900
+ return;
901
+ }
902
+
903
+ if (!$Target.hasClass("sapUiCalItemText") && !$Target.hasClass("sapUiCalItem")) {
904
+ return;
905
+ }
906
+
907
+ if ($Target.hasClass("sapUiCalItemText")) {
908
+ $Target = $Target.parent();
909
+ }
910
+
911
+ iMonth1 = parseInt(this._oFormatYyyymm.format(CalendarDate.fromLocalJSDate(oSelectedDateRange.getStartDate(), this.getProperty("primaryCalendarType")).toUTCJSDate(), true));
912
+ iMonth2 = parseInt($Target.attr("data-sap-month"));
913
+
914
+ if (this.hasListeners("datehovered")) {
915
+ this.fireEvent("datehovered", { date1: iMonth1, date2: iMonth2 });
916
+ } else {
917
+ this._markMonthsBetweenStartAndHoveredMonth(iMonth1, iMonth2);
918
+ }
919
+ };
920
+
921
+ MonthsRow.prototype._markMonthsBetweenStartAndHoveredMonth = function(iMonth1, iMonth2) {
922
+ const aDomRefs = this.$().find(".sapUiCalItem");
923
+
924
+ // swap if necessary
925
+ if (iMonth1 > iMonth2) {
926
+ [iMonth1, iMonth2] = [iMonth2, iMonth1];
824
927
  }
825
928
 
929
+ [...aDomRefs].forEach((elem) => {
930
+ const $CheckRef = jQuery(elem);
931
+ const iCheckMonth = parseInt($CheckRef.attr("data-sap-month"));
932
+
933
+ if (iCheckMonth > iMonth1 && iCheckMonth < iMonth2 && this._isMonthInAllowedRange(iCheckMonth)) {
934
+ $CheckRef.addClass("sapUiCalItemSelBetween");
935
+ } else {
936
+ $CheckRef.removeClass("sapUiCalItemSelBetween");
937
+ if (iCheckMonth !== iMonth1 && iCheckMonth !== iMonth2) {
938
+ $CheckRef.removeClass("sapUiCalItemSel");
939
+ }
940
+ }
941
+ });
942
+ };
943
+
944
+ MonthsRow.prototype._isMonthInAllowedRange = function(iCheckMonth) {
945
+ const oCheckDate = this._oFormatYyyymm.parse(String(iCheckMonth));
946
+ const oCalDate = CalendarDate.fromLocalJSDate(oCheckDate, this.getProperty("primaryCalendarType"));
947
+
948
+ return this._checkMonthEnabled(oCalDate);
949
+ };
950
+
951
+ MonthsRow.prototype._isMarkingUnfinishedRangeAllowed = function() {
952
+ var oSelectedRange = this.getSelectedDates()[0],
953
+ bValidRangeForMarking = !!(oSelectedRange && oSelectedRange.getStartDate() && !oSelectedRange.getEndDate());
954
+
955
+ return this.getIntervalSelection() && bValidRangeForMarking;
826
956
  };
827
957
 
828
958
  MonthsRow.prototype.onmouseup = function(oEvent){
959
+ // BCP: 1980116734
960
+ // on a combi device right mouse button resulted in a selection
961
+ var bNotRightMouseButton = oEvent.button !== 2;
829
962
 
830
963
  if (this._bMouseMove) {
831
- _unbindMousemove.call(this, true);
964
+ this._unbindMousemove(true);
832
965
 
833
- // focus now selected day
966
+ // focus now selected month
834
967
  var oFocusedDate = this._getDate();
835
968
  var aDomRefs = this._oItemNavigation.getItemDomRefs();
836
969
 
@@ -844,20 +977,13 @@ sap.ui.define([
844
977
 
845
978
  if (this._bMoveChange) {
846
979
  // selection was changed -> make it final
847
- var $Target = jQuery(oEvent.target);
848
-
849
- if ($Target.hasClass("sapUiCalItemText")) {
850
- $Target = $Target.parent();
980
+ var bSelected = _selectMonth.call(this, oFocusedDate);
981
+ if (!bSelected && this._oMoveSelectedDate) {
982
+ _selectMonth.call(this, this._oMoveSelectedDate);
851
983
  }
852
-
853
- if ($Target.hasClass("sapUiCalItem")) {
854
- oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymm.parse($Target.attr("data-sap-month")));
855
- oFocusedDate.setDate(1);
856
- }
857
-
858
- _selectMonth.call(this, oFocusedDate);
859
984
  this._bMoveChange = false;
860
985
  this._bMousedownChange = false;
986
+ this._oMoveSelectedDate = undefined;
861
987
  _fireSelect.call(this);
862
988
  }
863
989
  }
@@ -865,10 +991,25 @@ sap.ui.define([
865
991
  if (this._bMousedownChange) {
866
992
  this._bMousedownChange = false;
867
993
  _fireSelect.call(this);
994
+ } else if (Device.support.touch && bNotRightMouseButton && this._areMouseEventCoordinatesInThreshold(oEvent.clientX, oEvent.clientY, 10)) {
995
+ var classList = oEvent.target.classList,
996
+ bIsMonthSelected = classList.contains("sapUiCalItemText") || classList.contains("sapUiCalItem"),
997
+ oSelectedDate = this._getSelectedDateFromEvent(oEvent);
998
+
999
+ if (bIsMonthSelected && oSelectedDate) {
1000
+ _selectMonth.call(this, oSelectedDate, false);
1001
+ _fireSelect.call(this);
1002
+ }
868
1003
  }
869
1004
 
870
1005
  };
871
1006
 
1007
+ MonthsRow.prototype.onkeydown = function(oEvent){
1008
+ if (this.getIntervalSelection()) {
1009
+ this._selectedWithMouse = false;
1010
+ }
1011
+ };
1012
+
872
1013
  MonthsRow.prototype.onsapselect = function(oEvent){
873
1014
 
874
1015
  // focused item must be selected
@@ -1065,7 +1206,14 @@ sap.ui.define([
1065
1206
 
1066
1207
  if (oEvent.type == "mousedown") {
1067
1208
  // as no click event is fired in some cases, e.g. if DOM changed select the month on mousedown
1209
+ if (this.getIntervalSelection()) {
1210
+ this._sLastTargetId = aDomRefs[iIndex].id;
1211
+ this._selectedWithMouse = true;
1212
+ }
1068
1213
  _handleMousedown.call(this, oEvent, oFocusedDate, iIndex);
1214
+ } else if (this.getIntervalSelection()) {
1215
+ this.setProperty("_focusedDate", oFocusedDate.toLocalJSDate(), true);
1216
+ this.invalidate();
1069
1217
  }
1070
1218
 
1071
1219
  }
@@ -1082,6 +1230,11 @@ sap.ui.define([
1082
1230
  if (oEvent.type == "mousedown") {
1083
1231
  // as no click event is fired in some cases, e.g. if DOM has changed select the day on mousedown
1084
1232
  var oFocusedDate = this._getDate();
1233
+ if (this.getIntervalSelection()) {
1234
+ var aDomRefs = this._oItemNavigation.getItemDomRefs();
1235
+ this._sLastTargetId = aDomRefs[iIndex].id;
1236
+ this._selectedWithMouse = true;
1237
+ }
1085
1238
  _handleMousedown.call(this, oEvent, oFocusedDate, iIndex);
1086
1239
  }
1087
1240
 
@@ -1137,8 +1290,8 @@ sap.ui.define([
1137
1290
  */
1138
1291
  function _handleMousedown(oEvent, oFocusedDate, iIndex){
1139
1292
 
1140
- if (oEvent.button) {
1141
- // only use left mouse button
1293
+ if (oEvent.button || Device.support.touch) {
1294
+ // only use left mouse button; on touch devices avoid selection during scrolling
1142
1295
  return;
1143
1296
  }
1144
1297
 
@@ -1149,11 +1302,13 @@ sap.ui.define([
1149
1302
 
1150
1303
  if (this._bMouseMove) {
1151
1304
  // a mouseup must be happened outside of control -> just end move
1152
- _unbindMousemove.call(this, true);
1305
+ this._unbindMousemove(true);
1153
1306
  this._bMoveChange = false;
1307
+ this._oMoveSelectedDate = undefined;
1154
1308
  } else if (bSelected && this.getIntervalSelection() && this.$().is(":visible")) {
1155
1309
  // if closed in select event, do not add mousemove handler
1156
- _bindMousemove.call(this, true);
1310
+ this._bindMousemove(true);
1311
+ this._oMoveSelectedDate = new CalendarDate(oFocusedDate, this.getProperty("primaryCalendarType"));
1157
1312
  }
1158
1313
 
1159
1314
  oEvent.preventDefault();
@@ -1319,7 +1474,7 @@ sap.ui.define([
1319
1474
 
1320
1475
  if (this._bMouseMove) {
1321
1476
  // detach mouse move handler because calendar might be losed in select event handler
1322
- _unbindMousemove.call(this, true);
1477
+ this._unbindMousemove(true);
1323
1478
  }
1324
1479
 
1325
1480
  this.fireSelect();
@@ -1391,19 +1546,20 @@ sap.ui.define([
1391
1546
  }
1392
1547
  }
1393
1548
 
1394
- function _bindMousemove(){
1549
+ MonthsRow.prototype._bindMousemove = function(){
1395
1550
 
1396
1551
  jQuery(window.document).on('mousemove', this._mouseMoveProxy);
1397
1552
  this._bMouseMove = true;
1398
1553
 
1399
- }
1554
+ };
1400
1555
 
1401
- function _unbindMousemove(){
1556
+ MonthsRow.prototype._unbindMousemove = function(){
1402
1557
 
1403
1558
  jQuery(window.document).off('mousemove', this._mouseMoveProxy);
1404
1559
  this._bMouseMove = undefined;
1560
+ this._sLastTargetId = undefined;
1405
1561
 
1406
- }
1562
+ };
1407
1563
 
1408
1564
  return MonthsRow;
1409
1565
 
@@ -34,7 +34,7 @@ sap.ui.define([
34
34
  * Other usages are not supported.
35
35
  *
36
36
  * @extends sap.ui.unified.calendar.DatesRow
37
- * @version 1.149.0
37
+ * @version 1.150.0
38
38
  *
39
39
  * @constructor
40
40
  * @private
@@ -69,7 +69,7 @@ sap.ui.define([
69
69
  *
70
70
  * The TimesRow works with UI5Date or JavaScript Date objects.
71
71
  * @extends sap.ui.core.Control
72
- * @version 1.149.0
72
+ * @version 1.150.0
73
73
  *
74
74
  * @constructor
75
75
  * @public
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  * The WeeksRow works with UI5Date or JavaScript Date objects for its API, but internally uses CalendarDate objects for calculations.
42
42
  *
43
43
  * @extends sap.ui.core.Control
44
- * @version 1.149.0
44
+ * @version 1.150.0
45
45
  *
46
46
  * @constructor
47
47
  * @private
@@ -61,7 +61,7 @@ sap.ui.define([
61
61
  * As in all date-time controls, all pubic JS Date objects that are given (e.g. <code>setDate()</code>) or read
62
62
  * (e.g. <code>getFirstRenderedDate</code>) with values which are considered as date objects in browser(local) timezone.
63
63
  * @extends sap.ui.core.Control
64
- * @version 1.149.0
64
+ * @version 1.150.0
65
65
  *
66
66
  * @constructor
67
67
  * @public
@@ -45,7 +45,7 @@ sap.ui.define([
45
45
  * @extends sap.ui.unified.calendar.YearPicker
46
46
  *
47
47
  * @author SAP SE
48
- * @version 1.149.0
48
+ * @version 1.150.0
49
49
  *
50
50
  * @constructor
51
51
  * @private
@@ -32,14 +32,14 @@ sap.ui.define([
32
32
  * @namespace
33
33
  * @alias sap.ui.unified
34
34
  * @author SAP SE
35
- * @version 1.149.0
35
+ * @version 1.150.0
36
36
  * @since 1.28
37
37
  * @public
38
38
  */
39
39
  var thisLib = Library.init({
40
40
  name : "sap.ui.unified",
41
41
  apiVersion: 2,
42
- version: "1.149.0",
42
+ version: "1.150.0",
43
43
  dependencies : ["sap.ui.core"],
44
44
  designtime: "sap/ui/unified/designtime/library.designtime",
45
45
  types: [