@openui5/sap.ui.unified 1.147.1 → 1.149.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.
- package/THIRDPARTY.txt +3 -3
- package/package.json +2 -2
- package/src/sap/ui/unified/.library +1 -1
- package/src/sap/ui/unified/Calendar.js +9 -4
- package/src/sap/ui/unified/CalendarAppointment.js +1 -1
- package/src/sap/ui/unified/CalendarDateInterval.js +1 -1
- package/src/sap/ui/unified/CalendarLegend.js +1 -1
- package/src/sap/ui/unified/CalendarLegendItem.js +1 -1
- package/src/sap/ui/unified/CalendarMonthInterval.js +1 -1
- package/src/sap/ui/unified/CalendarOneMonthInterval.js +1 -1
- package/src/sap/ui/unified/CalendarRow.js +1 -1
- package/src/sap/ui/unified/CalendarRowRenderer.js +23 -18
- package/src/sap/ui/unified/CalendarTimeInterval.js +10 -13
- package/src/sap/ui/unified/CalendarWeekInterval.js +1 -1
- package/src/sap/ui/unified/ColorPicker.js +1 -1
- package/src/sap/ui/unified/ColorPickerPopover.js +1 -1
- package/src/sap/ui/unified/ContentSwitcher.js +1 -1
- package/src/sap/ui/unified/Currency.js +1 -1
- package/src/sap/ui/unified/CurrencyRenderer.js +1 -1
- package/src/sap/ui/unified/DateRange.js +1 -1
- package/src/sap/ui/unified/DateTypeRange.js +1 -1
- package/src/sap/ui/unified/FileUploader.js +19 -6
- package/src/sap/ui/unified/FileUploaderParameter.js +1 -1
- package/src/sap/ui/unified/FileUploaderXHRSettings.js +1 -1
- package/src/sap/ui/unified/Menu.js +1 -1
- package/src/sap/ui/unified/MenuItem.js +1 -1
- package/src/sap/ui/unified/MenuItemBase.js +1 -1
- package/src/sap/ui/unified/MenuItemGroup.js +1 -1
- package/src/sap/ui/unified/MenuRenderer.js +1 -1
- package/src/sap/ui/unified/MenuTextFieldItem.js +1 -1
- package/src/sap/ui/unified/MonthlyRecurrenceRule.js +58 -0
- package/src/sap/ui/unified/NonWorkingPeriod.js +1 -1
- package/src/sap/ui/unified/RecurrenceRule.js +112 -0
- package/src/sap/ui/unified/RecurringCalendarAppointment.js +222 -0
- package/src/sap/ui/unified/RecurringNonWorkingPeriod.js +112 -6
- package/src/sap/ui/unified/Shell.js +1 -1
- package/src/sap/ui/unified/ShellHeadItem.js +1 -1
- package/src/sap/ui/unified/ShellHeadUserItem.js +1 -1
- package/src/sap/ui/unified/ShellLayout.js +1 -1
- package/src/sap/ui/unified/ShellOverlay.js +1 -1
- package/src/sap/ui/unified/SplitContainer.js +1 -1
- package/src/sap/ui/unified/TimeRange.js +1 -1
- package/src/sap/ui/unified/WeeklyRecurrenceRule.js +39 -0
- package/src/sap/ui/unified/YearlyRecurrenceRule.js +53 -0
- package/src/sap/ui/unified/calendar/DatesRow.js +1 -1
- package/src/sap/ui/unified/calendar/Header.js +14 -2
- package/src/sap/ui/unified/calendar/HeaderRenderer.js +124 -50
- package/src/sap/ui/unified/calendar/IndexPicker.js +1 -1
- package/src/sap/ui/unified/calendar/Month.js +6 -7
- package/src/sap/ui/unified/calendar/MonthPicker.js +1 -1
- package/src/sap/ui/unified/calendar/MonthsRow.js +1 -1
- package/src/sap/ui/unified/calendar/OneMonthDatesRow.js +1 -1
- package/src/sap/ui/unified/calendar/RecurrenceUtils.js +653 -113
- package/src/sap/ui/unified/calendar/TimesRow.js +1 -1
- package/src/sap/ui/unified/calendar/WeeksRow.js +1 -1
- package/src/sap/ui/unified/calendar/YearPicker.js +1 -1
- package/src/sap/ui/unified/calendar/YearRangePicker.js +1 -1
- package/src/sap/ui/unified/library.js +73 -2
- package/src/sap/ui/unified/messagebundle_ko.properties +2 -2
- package/src/sap/ui/unified/messagebundle_zh_CN.properties +4 -4
- package/src/sap/ui/unified/messagebundle_zh_TW.properties +6 -6
- package/src/sap/ui/unified/themes/base/Calendar.less +76 -205
- package/src/sap/ui/unified/themes/base/FileUploader.less +2 -2
- package/src/sap/ui/unified/themes/sap_hcb/Calendar.less +3 -10
- package/src/sap/ui/unified/themes/sap_hcb/base_Calendar.less +54 -112
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Provides control sap.ui.unified.RecurrenceRule.
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"sap/ui/core/Element",
|
|
10
|
+
"./library",
|
|
11
|
+
"./calendar/RecurrenceUtils"
|
|
12
|
+
], function(Element, library, RecurrenceUtils) {
|
|
13
|
+
"use strict";
|
|
14
|
+
|
|
15
|
+
const RecurrenceRuleType = library.RecurrenceRuleType;
|
|
16
|
+
const WeekOfMonth = library.WeekOfMonth;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Constructor for a new <code>RecurrenceRule</code>.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} [sId] ID for the new element, generated automatically if no ID is given
|
|
22
|
+
* @param {object} [mSettings] Initial settings for the new element
|
|
23
|
+
*
|
|
24
|
+
* @class
|
|
25
|
+
* Binding DTO for recurrence rule configuration. Carries all possible recurrence properties
|
|
26
|
+
* along with the <code>recurrenceType</code> that determines which properties are relevant.
|
|
27
|
+
*
|
|
28
|
+
* When set on a parent aggregation, the parent internally creates the correct concrete
|
|
29
|
+
* subclass ({@link sap.ui.unified.WeeklyRecurrenceRule}, {@link sap.ui.unified.MonthlyRecurrenceRule},
|
|
30
|
+
* or {@link sap.ui.unified.YearlyRecurrenceRule}) via {@link sap.ui.unified.RecurrenceRule._factory}.
|
|
31
|
+
*
|
|
32
|
+
* <h3>Usage in XML binding</h3>
|
|
33
|
+
* <pre>
|
|
34
|
+
* <unified:recurrenceRule>
|
|
35
|
+
* <unified:RecurrenceRule
|
|
36
|
+
* recurrenceType="{/RecurrenceType}"
|
|
37
|
+
* days="{/Days}"
|
|
38
|
+
* weekOfMonth="{/WeekOfMonth}"
|
|
39
|
+
* dayOfMonth="{/DayOfMonth}"
|
|
40
|
+
* month="{/Month}" />
|
|
41
|
+
* </unified:recurrenceRule>
|
|
42
|
+
* </pre>
|
|
43
|
+
*
|
|
44
|
+
* @extends sap.ui.core.Element
|
|
45
|
+
* @version 1.149.0
|
|
46
|
+
*
|
|
47
|
+
* @constructor
|
|
48
|
+
* @public
|
|
49
|
+
* @ui5-experimental-since 1.149
|
|
50
|
+
* @alias sap.ui.unified.RecurrenceRule
|
|
51
|
+
*/
|
|
52
|
+
const RecurrenceRule = Element.extend("sap.ui.unified.RecurrenceRule", {
|
|
53
|
+
metadata: {
|
|
54
|
+
library: "sap.ui.unified",
|
|
55
|
+
properties: {
|
|
56
|
+
/**
|
|
57
|
+
* The recurrence type. Determines which properties are relevant and
|
|
58
|
+
* which concrete subclass is created internally by the parent.
|
|
59
|
+
*/
|
|
60
|
+
recurrenceType: {type: "sap.ui.unified.RecurrenceType", group: "Behavior"},
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Days of week for weekly recurrence (0–6, 0 = Sunday).
|
|
64
|
+
* Relevant when <code>recurrenceType</code> is <code>Weekly</code>.
|
|
65
|
+
*/
|
|
66
|
+
days: {type: "int[]", defaultValue: []},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Type of the advanced recurrence pattern.
|
|
70
|
+
* Relevant when <code>recurrenceType</code> is <code>Monthly</code> or <code>Yearly</code>.
|
|
71
|
+
*/
|
|
72
|
+
type: {type: "sap.ui.unified.RecurrenceRuleType", group: "Behavior", defaultValue: RecurrenceRuleType.DayOfMonth},
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Day of month (1–31). A value of <code>0</code> means "inherit from parent start date".
|
|
76
|
+
* Relevant when <code>type</code> is <code>DayOfMonth</code>.
|
|
77
|
+
*/
|
|
78
|
+
dayOfMonth: {type: "int", group: "Behavior", defaultValue: 0},
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Week of month (First, Second, Third, Fourth, Last).
|
|
82
|
+
* Relevant when <code>type</code> is <code>DayOfWeek</code>.
|
|
83
|
+
*/
|
|
84
|
+
weekOfMonth: {type: "sap.ui.unified.WeekOfMonth", group: "Behavior", defaultValue: WeekOfMonth.First},
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Day of week (0–6, 0 = Sunday).
|
|
88
|
+
* Relevant when <code>type</code> is <code>DayOfWeek</code>.
|
|
89
|
+
*/
|
|
90
|
+
dayOfWeek: {type: "int", group: "Behavior", defaultValue: 0},
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Month of year (0–11, 0 = January).
|
|
94
|
+
* Relevant when <code>recurrenceType</code> is <code>Yearly</code>.
|
|
95
|
+
*/
|
|
96
|
+
month: {type: "int", group: "Behavior", defaultValue: -1}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Sets the days of week (0–6, 0 = Sunday).
|
|
103
|
+
* @param {number|number[]} vDays
|
|
104
|
+
* @returns {this}
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
RecurrenceRule.prototype.setDays = function(vDays) {
|
|
108
|
+
return this.setProperty("days", RecurrenceUtils._normalizeRecurrenceDays(vDays));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return RecurrenceRule;
|
|
112
|
+
});
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
// Provides control sap.ui.unified.RecurringCalendarAppointment.
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
'./CalendarAppointment',
|
|
9
|
+
'./calendar/RecurrenceUtils',
|
|
10
|
+
'./library',
|
|
11
|
+
"sap/ui/core/date/UI5Date",
|
|
12
|
+
"./WeeklyRecurrenceRule",
|
|
13
|
+
"./MonthlyRecurrenceRule",
|
|
14
|
+
"./YearlyRecurrenceRule"
|
|
15
|
+
],
|
|
16
|
+
function(
|
|
17
|
+
CalendarAppointment,
|
|
18
|
+
RecurrenceUtils,
|
|
19
|
+
library,
|
|
20
|
+
UI5Date,
|
|
21
|
+
WeeklyRecurrenceRule,
|
|
22
|
+
MonthlyRecurrenceRule,
|
|
23
|
+
YearlyRecurrenceRule
|
|
24
|
+
) {
|
|
25
|
+
"use strict";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Constructor for a new <code>RecurringCalendarAppointment</code>.
|
|
29
|
+
*
|
|
30
|
+
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
31
|
+
* @param {object} [mSettings] Initial settings for the new control
|
|
32
|
+
*
|
|
33
|
+
* @class
|
|
34
|
+
* An appointment for use in a <code>PlanningCalendar</code> or similar. The rendering must be done in the Row collecting the appointments.
|
|
35
|
+
* (Because there are different visualizations possible.)
|
|
36
|
+
*
|
|
37
|
+
* Applications could inherit from this element to add own fields.
|
|
38
|
+
* @extends sap.ui.unified.CalendarAppointment
|
|
39
|
+
* @version 1.149.0
|
|
40
|
+
*
|
|
41
|
+
* @constructor
|
|
42
|
+
* @public
|
|
43
|
+
* @ui5-experimental-since 1.149
|
|
44
|
+
* @alias sap.ui.unified.RecurringCalendarAppointment
|
|
45
|
+
*/
|
|
46
|
+
const RecurringCalendarAppointment = CalendarAppointment.extend("sap.ui.unified.RecurringCalendarAppointment", /** @lends sap.ui.unified.RecurringCalendarAppointment.prototype */ { metadata : {
|
|
47
|
+
library : "sap.ui.unified",
|
|
48
|
+
properties : {
|
|
49
|
+
/**
|
|
50
|
+
* The recurrence type (Daily, Weekly, Monthly, Yearly).
|
|
51
|
+
*/
|
|
52
|
+
recurrenceType: {type: "sap.ui.unified.RecurrenceType", group: "Misc"},
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* End date of the recurrence. Must be a UI5Date or JavaScript Date object.
|
|
56
|
+
*/
|
|
57
|
+
recurrenceEndDate: {type: "object", group: "Data"},
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Recurrence interval. E.g. 1 = every day/week/month/year, 2 = every second, etc.
|
|
61
|
+
*/
|
|
62
|
+
recurrencePattern: {type: "int", group: "Behavior", defaultValue: 1}
|
|
63
|
+
},
|
|
64
|
+
defaultAggregation: "recurrenceRule",
|
|
65
|
+
aggregations: {
|
|
66
|
+
/**
|
|
67
|
+
* Advanced recurrence rule configuration.
|
|
68
|
+
* @see sap.ui.unified.RecurrenceRule
|
|
69
|
+
*/
|
|
70
|
+
recurrenceRule: {type: "sap.ui.unified.RecurrenceRule", multiple: false}
|
|
71
|
+
}
|
|
72
|
+
}});
|
|
73
|
+
|
|
74
|
+
RecurringCalendarAppointment.prototype.setRecurrenceRule = function(oRule) {
|
|
75
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
76
|
+
if (oRule && oRule.getMetadata().getName() === "sap.ui.unified.RecurrenceRule") {
|
|
77
|
+
const RecurrenceType = library.RecurrenceType;
|
|
78
|
+
switch (oRule.getRecurrenceType()) {
|
|
79
|
+
case RecurrenceType.Weekly:
|
|
80
|
+
oRule = new WeeklyRecurrenceRule({days: oRule.getDays()});
|
|
81
|
+
break;
|
|
82
|
+
case RecurrenceType.Monthly:
|
|
83
|
+
oRule = new MonthlyRecurrenceRule({
|
|
84
|
+
type: oRule.getType(), dayOfMonth: oRule.getDayOfMonth(),
|
|
85
|
+
weekOfMonth: oRule.getWeekOfMonth(), dayOfWeek: oRule.getDayOfWeek()
|
|
86
|
+
});
|
|
87
|
+
break;
|
|
88
|
+
case RecurrenceType.Yearly: {
|
|
89
|
+
const mSettings = {
|
|
90
|
+
type: oRule.getType(), dayOfMonth: oRule.getDayOfMonth(),
|
|
91
|
+
weekOfMonth: oRule.getWeekOfMonth(), dayOfWeek: oRule.getDayOfWeek()
|
|
92
|
+
};
|
|
93
|
+
if (oRule.getMonth() >= 0) {
|
|
94
|
+
mSettings.month = oRule.getMonth();
|
|
95
|
+
}
|
|
96
|
+
oRule = new YearlyRecurrenceRule(mSettings);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
default:
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return this.setAggregation("recurrenceRule", oRule);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
RecurringCalendarAppointment.prototype.getDuration = function () {
|
|
107
|
+
return Math.abs(this.getStartDate().getTime() - this.getEndDate().getTime());
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
RecurringCalendarAppointment.prototype.getStartAndEndDate = function(oDate) {
|
|
111
|
+
const oStartDate = UI5Date.getInstance(oDate.getFullYear(), oDate.getMonth(), oDate.getDate(),
|
|
112
|
+
this.getStartDate().getHours(), this.getStartDate().getMinutes());
|
|
113
|
+
const oEndDate = UI5Date.getInstance(oStartDate.getTime() + this.getDuration());
|
|
114
|
+
return {startDate: oStartDate, endDate: oEndDate};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Creates <code>CalendarAppointment</code> clones for each occurrence of this recurring appointment within the given date range.
|
|
119
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oRangeStart Start of the visible range (inclusive)
|
|
120
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oRangeEnd End of the visible range (inclusive)
|
|
121
|
+
* @returns {sap.ui.unified.CalendarAppointment[]} Array of cloned appointments, one per occurrence
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
124
|
+
RecurringCalendarAppointment.prototype.createOccurrenceClones = function(oRangeStart, oRangeEnd) {
|
|
125
|
+
const oAppStartDate = this.getStartDate();
|
|
126
|
+
const iDuration = this.getDuration();
|
|
127
|
+
const aOccurrences = RecurrenceUtils.getOccurrencesInRange.call(this, oRangeStart, oRangeEnd);
|
|
128
|
+
|
|
129
|
+
return aOccurrences.map((oOccurrenceDate) => {
|
|
130
|
+
const oOccurrenceStart = UI5Date.getInstance(oOccurrenceDate);
|
|
131
|
+
oOccurrenceStart.setHours(oAppStartDate.getHours(), oAppStartDate.getMinutes(), oAppStartDate.getSeconds());
|
|
132
|
+
const oOccurrenceEnd = UI5Date.getInstance(oOccurrenceStart.getTime() + iDuration);
|
|
133
|
+
|
|
134
|
+
return new CalendarAppointment({
|
|
135
|
+
startDate: oOccurrenceStart,
|
|
136
|
+
endDate: oOccurrenceEnd,
|
|
137
|
+
title: this.getTitle(),
|
|
138
|
+
text: this.getText(),
|
|
139
|
+
type: this.getType(),
|
|
140
|
+
selected: this.getSelected(),
|
|
141
|
+
tentative: this.getTentative(),
|
|
142
|
+
icon: this.getIcon()
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
RecurringCalendarAppointment.prototype.hasAppointmentAtDate = function(oDate) {
|
|
148
|
+
return RecurrenceUtils.hasOccurrenceOnDate.call(this, oDate);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
RecurringCalendarAppointment.prototype.isRecurring = function() {
|
|
152
|
+
return !!this.getRecurrenceType();
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
RecurringCalendarAppointment.prototype.setRecurrenceType = function(sValue) {
|
|
156
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
157
|
+
return this.setProperty("recurrenceType", sValue);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
RecurringCalendarAppointment.prototype.setRecurrencePattern = function(iValue) {
|
|
161
|
+
if (iValue < 1) {
|
|
162
|
+
throw new Error("recurrencePattern must be >= 1");
|
|
163
|
+
}
|
|
164
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
165
|
+
return this.setProperty("recurrencePattern", iValue);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
RecurringCalendarAppointment.prototype.setStartDate = function(oDate) {
|
|
169
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
170
|
+
return this.setProperty("startDate", oDate);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
RecurringCalendarAppointment.prototype.setEndDate = function(oDate) {
|
|
174
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
175
|
+
return this.setProperty("endDate", oDate);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
RecurringCalendarAppointment.prototype.setRecurrenceEndDate = function(oDate) {
|
|
179
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
180
|
+
return this.setProperty("recurrenceEndDate", oDate);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
RecurringCalendarAppointment.prototype.hasOccurrenceOnDateCached = function(oDate) {
|
|
184
|
+
return RecurrenceUtils.hasOccurrenceOnDateCached.call(this, oDate);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Returns all occurrence dates within the given date range.
|
|
189
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oStartDate - Start date of range (inclusive)
|
|
190
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oEndDate - End date of range (inclusive)
|
|
191
|
+
* @returns {Date[]} Array of occurrence dates (UI5Date instances)
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
RecurringCalendarAppointment.prototype.getOccurrencesInRange = function(oStartDate, oEndDate) {
|
|
195
|
+
return RecurrenceUtils.getOccurrencesInRange.call(this, oStartDate, oEndDate);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Gets cached occurrences for a date range.
|
|
200
|
+
* Returns cached result if available, or null if not cached.
|
|
201
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oStartDate - Start date of range
|
|
202
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oEndDate - End date of range
|
|
203
|
+
* @returns {Date[]|null} Cached occurrence dates or null
|
|
204
|
+
* @private
|
|
205
|
+
*/
|
|
206
|
+
RecurringCalendarAppointment.prototype.getCachedOccurrences = function(oStartDate, oEndDate) {
|
|
207
|
+
return RecurrenceUtils.getCachedOccurrences.call(this, oStartDate, oEndDate);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Sets cached occurrences for a date range.
|
|
212
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oStartDate - Start date of range
|
|
213
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oEndDate - End date of range
|
|
214
|
+
* @param {Date[]} aOccurrences - Array of occurrence dates to cache
|
|
215
|
+
* @private
|
|
216
|
+
*/
|
|
217
|
+
RecurringCalendarAppointment.prototype.setCachedOccurrences = function(oStartDate, oEndDate, aOccurrences) {
|
|
218
|
+
RecurrenceUtils.setCachedOccurrences.call(this, oStartDate, oEndDate, aOccurrences);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
return RecurringCalendarAppointment;
|
|
222
|
+
});
|
|
@@ -6,10 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
// Provides control sap.ui.unified.RecurringNonWorkingPeriod.
|
|
8
8
|
sap.ui.define([
|
|
9
|
-
"./NonWorkingPeriod"
|
|
9
|
+
"./NonWorkingPeriod",
|
|
10
|
+
"./calendar/RecurrenceUtils",
|
|
11
|
+
"./library",
|
|
12
|
+
"./WeeklyRecurrenceRule",
|
|
13
|
+
"./MonthlyRecurrenceRule",
|
|
14
|
+
"./YearlyRecurrenceRule"
|
|
10
15
|
],
|
|
11
16
|
function(
|
|
12
|
-
NonWorkingPeriod
|
|
17
|
+
NonWorkingPeriod,
|
|
18
|
+
RecurrenceUtils,
|
|
19
|
+
library,
|
|
20
|
+
WeeklyRecurrenceRule,
|
|
21
|
+
MonthlyRecurrenceRule,
|
|
22
|
+
YearlyRecurrenceRule
|
|
13
23
|
) {
|
|
14
24
|
"use strict";
|
|
15
25
|
|
|
@@ -24,14 +34,14 @@ sap.ui.define([
|
|
|
24
34
|
*
|
|
25
35
|
* Applications can inherit from this element to add own fields.
|
|
26
36
|
* @extends sap.ui.unified.NonWorkingPeriod
|
|
27
|
-
* @version 1.
|
|
37
|
+
* @version 1.149.0
|
|
28
38
|
*
|
|
29
39
|
* @constructor
|
|
30
40
|
* @public
|
|
31
41
|
* @ui5-experimental-since 1.127.0
|
|
32
42
|
* @alias sap.ui.unified.RecurringNonWorkingPeriod
|
|
33
43
|
*/
|
|
34
|
-
|
|
44
|
+
const RecurringNonWorkingPeriod = NonWorkingPeriod.extend("sap.ui.unified.RecurringNonWorkingPeriod", /** @lends sap.ui.unified.RecurringNonWorkingPeriod.prototype */ { metadata : {
|
|
35
45
|
|
|
36
46
|
library : "sap.ui.unified",
|
|
37
47
|
properties : {
|
|
@@ -51,17 +61,113 @@ sap.ui.define([
|
|
|
51
61
|
* If the recurrencePattern is set to 3, this would imply the calendar item is recurring once for every three days.
|
|
52
62
|
*/
|
|
53
63
|
recurrencePattern: {type : "int", group : "Behavior", defaultValue : 1}
|
|
64
|
+
},
|
|
65
|
+
aggregations: {
|
|
66
|
+
/**
|
|
67
|
+
* Advanced recurrence rule configuration.
|
|
68
|
+
* @see sap.ui.unified.RecurrenceRule
|
|
69
|
+
*/
|
|
70
|
+
recurrenceRule: {type: "sap.ui.unified.RecurrenceRule", multiple: false}
|
|
54
71
|
}
|
|
55
72
|
}});
|
|
56
73
|
|
|
74
|
+
RecurringNonWorkingPeriod.prototype.setRecurrenceRule = function(oRule) {
|
|
75
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
76
|
+
if (oRule && oRule.getMetadata().getName() === "sap.ui.unified.RecurrenceRule") {
|
|
77
|
+
const RecurrenceType = library.RecurrenceType;
|
|
78
|
+
switch (oRule.getRecurrenceType()) {
|
|
79
|
+
case RecurrenceType.Weekly:
|
|
80
|
+
oRule = new WeeklyRecurrenceRule({days: oRule.getDays()});
|
|
81
|
+
break;
|
|
82
|
+
case RecurrenceType.Monthly:
|
|
83
|
+
oRule = new MonthlyRecurrenceRule({
|
|
84
|
+
type: oRule.getType(), dayOfMonth: oRule.getDayOfMonth(),
|
|
85
|
+
weekOfMonth: oRule.getWeekOfMonth(), dayOfWeek: oRule.getDayOfWeek()
|
|
86
|
+
});
|
|
87
|
+
break;
|
|
88
|
+
case RecurrenceType.Yearly: {
|
|
89
|
+
const mSettings = {
|
|
90
|
+
type: oRule.getType(), dayOfMonth: oRule.getDayOfMonth(),
|
|
91
|
+
weekOfMonth: oRule.getWeekOfMonth(), dayOfWeek: oRule.getDayOfWeek()
|
|
92
|
+
};
|
|
93
|
+
if (oRule.getMonth() >= 0) {
|
|
94
|
+
mSettings.month = oRule.getMonth();
|
|
95
|
+
}
|
|
96
|
+
oRule = new YearlyRecurrenceRule(mSettings);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
default:
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return this.setAggregation("recurrenceRule", oRule);
|
|
104
|
+
};
|
|
105
|
+
|
|
57
106
|
/**
|
|
58
107
|
* Determines whether the current instance has recurrence or not.
|
|
59
108
|
* @return {boolean} The result is <code>true</code> when the instance has recurrence.
|
|
60
109
|
* @private
|
|
61
110
|
*/
|
|
62
111
|
RecurringNonWorkingPeriod.prototype.isRecurring = function () {
|
|
63
|
-
return
|
|
112
|
+
return !!this.getRecurrenceType();
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Checks if a given date (without time) is a non-working day.
|
|
117
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oDate - Date to check
|
|
118
|
+
* @returns {boolean} True if the date is non-working
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
RecurringNonWorkingPeriod.prototype.hasNonWorkingAtDate = function(oDate) {
|
|
122
|
+
// Delegate to RecurrenceUtils
|
|
123
|
+
const hasOccurrenceOnDate = RecurrenceUtils.hasOccurrenceOnDate.bind(this);
|
|
124
|
+
return hasOccurrenceOnDate(oDate);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
RecurringNonWorkingPeriod.prototype.setRecurrenceType = function(sValue) {
|
|
128
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
129
|
+
return this.setProperty("recurrenceType", sValue);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
RecurringNonWorkingPeriod.prototype.setRecurrencePattern = function(iValue) {
|
|
133
|
+
if (iValue < 1) {
|
|
134
|
+
throw new Error("recurrencePattern must be >= 1");
|
|
135
|
+
}
|
|
136
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
137
|
+
return this.setProperty("recurrencePattern", iValue);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
RecurringNonWorkingPeriod.prototype.setRecurrenceEndDate = function(oDate) {
|
|
141
|
+
RecurrenceUtils.invalidateCache.call(this);
|
|
142
|
+
return this.setProperty("recurrenceEndDate", oDate);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
RecurringNonWorkingPeriod.prototype.hasOccurrenceOnDateCached = function(oDate) {
|
|
146
|
+
return RecurrenceUtils.hasOccurrenceOnDateCached.call(this, oDate);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Gets cached non-working periods for a date range.
|
|
151
|
+
* Returns cached result if available, or null if not cached.
|
|
152
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oStartDate - Start date of range
|
|
153
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oEndDate - End date of range
|
|
154
|
+
* @returns {sap.ui.unified.NonWorkingPeriod[]|null} Cached non-working periods or null
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
RecurringNonWorkingPeriod.prototype.getCachedOccurrences = function(oStartDate, oEndDate) {
|
|
158
|
+
return RecurrenceUtils.getCachedOccurrences.call(this, oStartDate, oEndDate);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Sets cached non-working periods for a date range.
|
|
163
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oStartDate - Start date of range
|
|
164
|
+
* @param {Date|module:sap/ui/core/date/UI5Date} oEndDate - End date of range
|
|
165
|
+
* @param {sap.ui.unified.NonWorkingPeriod[]} aPeriods - Array of non-working periods to cache
|
|
166
|
+
* @public
|
|
167
|
+
*/
|
|
168
|
+
RecurringNonWorkingPeriod.prototype.setCachedOccurrences = function(oStartDate, oEndDate, aPeriods) {
|
|
169
|
+
RecurrenceUtils.setCachedOccurrences.call(this, oStartDate, oEndDate, aPeriods);
|
|
64
170
|
};
|
|
65
171
|
|
|
66
172
|
return RecurringNonWorkingPeriod;
|
|
67
|
-
});
|
|
173
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Provides control sap.ui.unified.WeeklyRecurrenceRule.
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"./RecurrenceRule"
|
|
10
|
+
], function(RecurrenceRule) {
|
|
11
|
+
"use strict";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for a new <code>WeeklyRecurrenceRule</code>.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} [sId] ID for the new element, generated automatically if no ID is given
|
|
17
|
+
* @param {object} [mSettings] Initial settings for the new element
|
|
18
|
+
*
|
|
19
|
+
* @class
|
|
20
|
+
* Concrete recurrence rule for <code>Weekly</code> recurrence.
|
|
21
|
+
* Created internally by the parent when a {@link sap.ui.unified.RecurrenceRule} DTO
|
|
22
|
+
* with <code>recurrenceType</code> set to <code>Weekly</code> is provided.
|
|
23
|
+
*
|
|
24
|
+
* @extends sap.ui.unified.RecurrenceRule
|
|
25
|
+
* @version 1.149.0
|
|
26
|
+
*
|
|
27
|
+
* @constructor
|
|
28
|
+
* @private
|
|
29
|
+
* @ui5-experimental-since 1.149
|
|
30
|
+
* @alias sap.ui.unified.WeeklyRecurrenceRule
|
|
31
|
+
*/
|
|
32
|
+
const WeeklyRecurrenceRule = RecurrenceRule.extend("sap.ui.unified.WeeklyRecurrenceRule", {
|
|
33
|
+
metadata: {
|
|
34
|
+
library: "sap.ui.unified"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return WeeklyRecurrenceRule;
|
|
39
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Provides control sap.ui.unified.YearlyRecurrenceRule.
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"./MonthlyRecurrenceRule"
|
|
10
|
+
], function(MonthlyRecurrenceRule) {
|
|
11
|
+
"use strict";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for a new <code>YearlyRecurrenceRule</code>.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} [sId] ID for the new element, generated automatically if no ID is given
|
|
17
|
+
* @param {object} [mSettings] Initial settings for the new element
|
|
18
|
+
*
|
|
19
|
+
* @class
|
|
20
|
+
* Concrete recurrence rule for <code>Yearly</code> recurrence.
|
|
21
|
+
* Extends {@link sap.ui.unified.MonthlyRecurrenceRule} with a <code>month</code> property.
|
|
22
|
+
* Created internally by the parent when a {@link sap.ui.unified.RecurrenceRule} DTO
|
|
23
|
+
* with <code>recurrenceType</code> set to <code>Yearly</code> is provided.
|
|
24
|
+
*
|
|
25
|
+
* @extends sap.ui.unified.MonthlyRecurrenceRule
|
|
26
|
+
* @version 1.149.0
|
|
27
|
+
*
|
|
28
|
+
* @constructor
|
|
29
|
+
* @private
|
|
30
|
+
* @ui5-experimental-since 1.149
|
|
31
|
+
* @alias sap.ui.unified.YearlyRecurrenceRule
|
|
32
|
+
*/
|
|
33
|
+
const YearlyRecurrenceRule = MonthlyRecurrenceRule.extend("sap.ui.unified.YearlyRecurrenceRule", {
|
|
34
|
+
metadata: {
|
|
35
|
+
library: "sap.ui.unified"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Sets the month with validation.
|
|
41
|
+
* @param {int} iMonth - Month (0-11)
|
|
42
|
+
* @returns {this}
|
|
43
|
+
* @private
|
|
44
|
+
*/
|
|
45
|
+
YearlyRecurrenceRule.prototype.setMonth = function(iMonth) {
|
|
46
|
+
if (iMonth < -1 || iMonth > 11) {
|
|
47
|
+
throw new Error("month must be between 0 and 11");
|
|
48
|
+
}
|
|
49
|
+
return this.setProperty("month", iMonth);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return YearlyRecurrenceRule;
|
|
53
|
+
});
|
|
@@ -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.
|
|
42
|
+
* @version 1.149.0
|
|
43
43
|
*
|
|
44
44
|
* @constructor
|
|
45
45
|
* @public
|