@openui5/sap.ui.unified 1.148.0 → 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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/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
package/THIRDPARTY.txt
CHANGED
|
@@ -39,7 +39,7 @@ Contained in: src/sap.f/src/sap/f/thirdparty/**
|
|
|
39
39
|
|
|
40
40
|
Library: sap.m:
|
|
41
41
|
|
|
42
|
-
Component: purify.js, version: 3.
|
|
42
|
+
Component: purify.js, version: 3.4.1
|
|
43
43
|
Copyright: Mario Heiderich
|
|
44
44
|
License: Apache-2.0
|
|
45
45
|
License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
@@ -309,7 +309,7 @@ License: MIT
|
|
|
309
309
|
License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt
|
|
310
310
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/bignumber.js
|
|
311
311
|
|
|
312
|
-
Component: lodash, version: 4.
|
|
312
|
+
Component: lodash, version: 4.18.1
|
|
313
313
|
Copyright: OpenJS Foundation and other contributors
|
|
314
314
|
License: MIT
|
|
315
315
|
License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.unified",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.149.0",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.ui.unified",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
"url": "https://github.com/UI5/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.ui.core": "1.
|
|
17
|
+
"@openui5/sap.ui.core": "1.149.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.149.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>Unified controls intended for both, mobile and desktop scenarios</documentation>
|
|
12
12
|
|
|
@@ -80,7 +80,7 @@ sap.ui.define([
|
|
|
80
80
|
* Basic Calendar.
|
|
81
81
|
* This calendar is used for DatePickers
|
|
82
82
|
* @extends sap.ui.core.Control
|
|
83
|
-
* @version 1.
|
|
83
|
+
* @version 1.149.0
|
|
84
84
|
*
|
|
85
85
|
* @constructor
|
|
86
86
|
* @public
|
|
@@ -2534,13 +2534,15 @@ sap.ui.define([
|
|
|
2534
2534
|
* @private
|
|
2535
2535
|
*/
|
|
2536
2536
|
Calendar.prototype._updateHeadersButtons = function () {
|
|
2537
|
-
var oSecondMonthHeader = this.getAggregation("secondMonthHeader")
|
|
2537
|
+
var oSecondMonthHeader = this.getAggregation("secondMonthHeader"),
|
|
2538
|
+
oHeader = this.getAggregation("header");
|
|
2538
2539
|
|
|
2539
2540
|
if (this._isTwoMonthsInOneColumn()) {
|
|
2540
2541
|
// Two months displayed in one column
|
|
2541
2542
|
// Than we need the second header
|
|
2542
2543
|
// and hide the third and fourth buttons of the first header
|
|
2543
2544
|
oSecondMonthHeader.setVisible(true);
|
|
2545
|
+
oHeader.setProperty("_alignRight", "Center");
|
|
2544
2546
|
|
|
2545
2547
|
if (this._iMode === 2) {
|
|
2546
2548
|
this._updateHeadersButtonsHelper(false, true, false, false);
|
|
@@ -2554,6 +2556,8 @@ sap.ui.define([
|
|
|
2554
2556
|
// Than we need to hide the second header
|
|
2555
2557
|
// and show third and fourth buttons of the first
|
|
2556
2558
|
oSecondMonthHeader.setVisible(false);
|
|
2559
|
+
oHeader.setProperty("_alignRight", "End");
|
|
2560
|
+
|
|
2557
2561
|
if (this._iMode === 2) {
|
|
2558
2562
|
this._bActionTriggeredFromSecondHeader ?
|
|
2559
2563
|
this._updateHeadersButtonsHelper(true, true, false, true) :
|
|
@@ -2572,6 +2576,7 @@ sap.ui.define([
|
|
|
2572
2576
|
// No second header
|
|
2573
2577
|
// No third and fourth button
|
|
2574
2578
|
oSecondMonthHeader.setVisible(false);
|
|
2579
|
+
oHeader.setProperty("_alignRight", "Center");
|
|
2575
2580
|
if (this._iMode === 1) {
|
|
2576
2581
|
this._updateHeadersButtonsHelper(false, true, false, false);
|
|
2577
2582
|
} else if (this._iMode === 2) {
|
|
@@ -2629,7 +2634,7 @@ sap.ui.define([
|
|
|
2629
2634
|
|
|
2630
2635
|
/**
|
|
2631
2636
|
*
|
|
2632
|
-
* @returns {boolean} if there are two months in one column
|
|
2637
|
+
* @returns {boolean} if there are two (or more) months in one column
|
|
2633
2638
|
* @private
|
|
2634
2639
|
*/
|
|
2635
2640
|
Calendar.prototype._isTwoMonthsInOneColumn = function () {
|
|
@@ -2640,7 +2645,7 @@ sap.ui.define([
|
|
|
2640
2645
|
|
|
2641
2646
|
/**
|
|
2642
2647
|
*
|
|
2643
|
-
* @returns {boolean} if there are two months in two columns
|
|
2648
|
+
* @returns {boolean} if there are two (or more) months in two columns
|
|
2644
2649
|
* @private
|
|
2645
2650
|
*/
|
|
2646
2651
|
Calendar.prototype._isTwoMonthsInTwoColumns = function () {
|
|
@@ -64,7 +64,7 @@ sap.ui.define([
|
|
|
64
64
|
* @class
|
|
65
65
|
* <code>CalendarDateInterval</code> only visualizes the dates in a one-line interval and allows the selection of a single day.
|
|
66
66
|
* @extends sap.ui.unified.Calendar
|
|
67
|
-
* @version 1.
|
|
67
|
+
* @version 1.149.0
|
|
68
68
|
*
|
|
69
69
|
* @constructor
|
|
70
70
|
* @public
|
|
@@ -65,7 +65,7 @@ sap.ui.define([
|
|
|
65
65
|
* <b>Note:</b> UI5Date or JavaScript Date objects are used to set and return the months, mark them as selected or as a special type.
|
|
66
66
|
* But the date part of the Date object is not used. If a Date object is returned the date will be set to the 1st of the corresponding month.
|
|
67
67
|
* @extends sap.ui.core.Control
|
|
68
|
-
* @version 1.
|
|
68
|
+
* @version 1.149.0
|
|
69
69
|
*
|
|
70
70
|
* @constructor
|
|
71
71
|
* @public
|
|
@@ -57,7 +57,7 @@ sap.ui.define([
|
|
|
57
57
|
* Navigation via year picker switches to the corresponding year and the same month as before the navigation.
|
|
58
58
|
*
|
|
59
59
|
* @extends sap.ui.unified.CalendarDateInterval
|
|
60
|
-
* @version 1.
|
|
60
|
+
* @version 1.149.0
|
|
61
61
|
*
|
|
62
62
|
* @constructor
|
|
63
63
|
* @private
|
|
@@ -547,30 +547,34 @@ sap.ui.define([
|
|
|
547
547
|
var sId = oAppointment.getId();
|
|
548
548
|
var bReducedHeight = oRow._getAppointmentReducedHeight(oAppointmentInfo);
|
|
549
549
|
var bAppointmentSelected = oAppointment.getSelected();
|
|
550
|
-
var
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
};
|
|
550
|
+
var bHasCustomContent = !!oAppointment.getCustomContent().length;
|
|
551
|
+
|
|
552
|
+
var aLabelledByIds = [InvisibleText.getStaticId("sap.m", "ACC_CTR_TYPE_LISTITEM"), InvisibleText.getStaticId("sap.ui.unified", "APPOINTMENT")];
|
|
553
|
+
|
|
554
|
+
if (sTitle && !bHasCustomContent) {
|
|
555
|
+
aLabelledByIds.push(`${sId}-Title`);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
aLabelledByIds.push(`${sId}-Descr`);
|
|
559
|
+
|
|
560
|
+
if (sText && !bHasCustomContent) {
|
|
561
|
+
aLabelledByIds.push(`${sId}-Text`);
|
|
562
|
+
}
|
|
563
|
+
|
|
559
564
|
var iRowCount = oRow._getAppointmentRowCount(oAppointmentInfo, bReducedHeight);
|
|
560
565
|
var aAriaLabels = oRow.getAriaLabelledBy();
|
|
561
566
|
|
|
562
567
|
var oArrowValues = oRow._calculateAppoitnmentVisualCue(oAppointment);
|
|
563
568
|
if (aAriaLabels.length > 0) {
|
|
564
|
-
|
|
569
|
+
aLabelledByIds = aLabelledByIds.concat(aAriaLabels);
|
|
565
570
|
}
|
|
566
571
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
572
|
+
var mAccProps = {
|
|
573
|
+
role: "listitem",
|
|
574
|
+
labelledby: { value: aLabelledByIds.join(" "), append: true },
|
|
575
|
+
describedby: { value: bAppointmentSelected ? InvisibleText.getStaticId("sap.ui.unified", "APPOINTMENT_SELECTED") : "", append: true },
|
|
576
|
+
selected: null
|
|
577
|
+
};
|
|
574
578
|
|
|
575
579
|
oRm.openStart("div", oAppointment);
|
|
576
580
|
oRm.class("sapUiCalendarApp");
|
|
@@ -582,7 +586,8 @@ sap.ui.define([
|
|
|
582
586
|
|
|
583
587
|
if (oAppointment.getTentative()) {
|
|
584
588
|
oRm.class("sapUiCalendarAppTent");
|
|
585
|
-
|
|
589
|
+
aLabelledByIds.push(InvisibleText.getStaticId("sap.ui.unified", "APPOINTMENT_TENTATIVE"));
|
|
590
|
+
mAccProps["labelledby"].value = aLabelledByIds.join(" ");
|
|
586
591
|
}
|
|
587
592
|
|
|
588
593
|
if (iRowCount === 1) {
|
|
@@ -78,7 +78,7 @@ sap.ui.define([
|
|
|
78
78
|
* @class
|
|
79
79
|
* Calendar with granularity of time items displayed in one line.
|
|
80
80
|
* @extends sap.ui.core.Control
|
|
81
|
-
* @version 1.
|
|
81
|
+
* @version 1.149.0
|
|
82
82
|
*
|
|
83
83
|
* @constructor
|
|
84
84
|
* @public
|
|
@@ -269,17 +269,10 @@ sap.ui.define([
|
|
|
269
269
|
};
|
|
270
270
|
|
|
271
271
|
CalendarTimeInterval.prototype._initializeHeader = function() {
|
|
272
|
-
var oHeader = new Header(this.getId() + "--Head")
|
|
273
|
-
oResourceBundle = Library.getResourceBundleFor("sap.m");
|
|
272
|
+
var oHeader = new Header(this.getId() + "--Head");
|
|
274
273
|
oHeader.attachEvent("pressPrevious", this._handlePrevious, this);
|
|
275
274
|
oHeader.attachEvent("pressNext", this._handleNext, this);
|
|
276
275
|
this.setAggregation("header", oHeader);
|
|
277
|
-
|
|
278
|
-
if (oHeader) {
|
|
279
|
-
oHeader.setAriaLabelButton0(oResourceBundle.getText("DATETIMEPICKER_DATE"));
|
|
280
|
-
oHeader.setAriaLabelButton1(oResourceBundle.getText("MOBISCROLL_MONTH"));
|
|
281
|
-
oHeader.setAriaLabelButton2(oResourceBundle.getText("MOBISCROLL_YEAR"));
|
|
282
|
-
}
|
|
283
276
|
};
|
|
284
277
|
|
|
285
278
|
CalendarTimeInterval.prototype._initializeTimesRow = function() {
|
|
@@ -1575,21 +1568,25 @@ sap.ui.define([
|
|
|
1575
1568
|
|
|
1576
1569
|
var iMonth = oStartDate.getUTCMonth();
|
|
1577
1570
|
sText = aMonthNames[iMonth];
|
|
1578
|
-
if (bShort) {
|
|
1579
|
-
sAriaLabel = aMonthNamesWide[aMonthNames[iMonth]];
|
|
1580
|
-
}
|
|
1581
1571
|
|
|
1572
|
+
var oResourceBundle = Library.getResourceBundleFor("sap.m");
|
|
1582
1573
|
if (!this.getPickerPopup()) {
|
|
1574
|
+
var iYear = this._oYearFormat.format(oStartDate, true);
|
|
1583
1575
|
oHeader.setTextButton0(aDay);
|
|
1584
1576
|
oHeader.setTextButton1(sText);
|
|
1585
|
-
oHeader.setTextButton2(
|
|
1577
|
+
oHeader.setTextButton2(iYear);
|
|
1578
|
+
oHeader.setAriaLabelButton0(`${oResourceBundle.getText("DATETIMEPICKER_DATE")} ${aDay}`);
|
|
1579
|
+
oHeader.setAriaLabelButton1(`${oResourceBundle.getText("MOBISCROLL_MONTH")} ${sText}`);
|
|
1580
|
+
oHeader.setAriaLabelButton2(`${oResourceBundle.getText("MOBISCROLL_YEAR")} ${iYear}`);
|
|
1586
1581
|
} else {
|
|
1587
1582
|
oDateFormat = DateFormat.getInstance({style: "long", strictParsing: true, relative: bRelative}, oLocaleData.oLocale);
|
|
1588
1583
|
sAriaLabel = aDay = oDateFormat.format(CalendarUtils._createLocalDate(oStartDate, true));
|
|
1589
1584
|
oHeader.setTextButton1(aDay);
|
|
1585
|
+
oHeader.setAriaLabelButton1(sAriaLabel);
|
|
1590
1586
|
}
|
|
1591
1587
|
|
|
1592
1588
|
if (bShort) {
|
|
1589
|
+
sAriaLabel = aMonthNamesWide[aMonthNames[iMonth]];
|
|
1593
1590
|
oHeader.setAriaLabelButton1(sAriaLabel);
|
|
1594
1591
|
}
|
|
1595
1592
|
}
|
|
@@ -39,7 +39,7 @@ sap.ui.define(['sap/ui/unified/calendar/CalendarUtils', 'sap/ui/unified/calendar
|
|
|
39
39
|
* its start date to the first date of the same week as the date the user chose.
|
|
40
40
|
*
|
|
41
41
|
* @extends sap.ui.unified.CalendarDateInterval
|
|
42
|
-
* @version 1.
|
|
42
|
+
* @version 1.149.0
|
|
43
43
|
*
|
|
44
44
|
* @constructor
|
|
45
45
|
* @private
|
|
@@ -25,7 +25,7 @@ sap.ui.define(['./DateRange', './library'],
|
|
|
25
25
|
* @class
|
|
26
26
|
* Date range with calendar day type information. Used to visualize special days in the Calendar.
|
|
27
27
|
* @extends sap.ui.unified.DateRange
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.149.0
|
|
29
29
|
*
|
|
30
30
|
* @constructor
|
|
31
31
|
* @public
|
|
@@ -0,0 +1,58 @@
|
|
|
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.MonthlyRecurrenceRule.
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"./RecurrenceRule"
|
|
10
|
+
], function(RecurrenceRule) {
|
|
11
|
+
"use strict";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for a new <code>MonthlyRecurrenceRule</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>Monthly</code> recurrence.
|
|
21
|
+
* Created internally by the parent when a {@link sap.ui.unified.RecurrenceRule} DTO
|
|
22
|
+
* with <code>recurrenceType</code> set to <code>Monthly</code> is provided.
|
|
23
|
+
*
|
|
24
|
+
* Supports two patterns:
|
|
25
|
+
* <ul>
|
|
26
|
+
* <li><code>DayOfMonth</code> — e.g. "the 15th of each month"</li>
|
|
27
|
+
* <li><code>DayOfWeek</code> — e.g. "second Tuesday of each month"</li>
|
|
28
|
+
* </ul>
|
|
29
|
+
*
|
|
30
|
+
* @extends sap.ui.unified.RecurrenceRule
|
|
31
|
+
* @version 1.149.0
|
|
32
|
+
*
|
|
33
|
+
* @constructor
|
|
34
|
+
* @private
|
|
35
|
+
* @ui5-experimental-since 1.149
|
|
36
|
+
* @alias sap.ui.unified.MonthlyRecurrenceRule
|
|
37
|
+
*/
|
|
38
|
+
const MonthlyRecurrenceRule = RecurrenceRule.extend("sap.ui.unified.MonthlyRecurrenceRule", {
|
|
39
|
+
metadata: {
|
|
40
|
+
library: "sap.ui.unified"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Sets the day of week with validation.
|
|
46
|
+
* @param {int} iDay - Day of week (0-6, 0=Sunday)
|
|
47
|
+
* @returns {this}
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
MonthlyRecurrenceRule.prototype.setDayOfWeek = function(iDay) {
|
|
51
|
+
if (iDay < 0 || iDay > 6) {
|
|
52
|
+
throw new Error("dayOfWeek must be between 0 (Sunday) and 6 (Saturday)");
|
|
53
|
+
}
|
|
54
|
+
return this.setProperty("dayOfWeek", iDay);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return MonthlyRecurrenceRule;
|
|
58
|
+
});
|
|
@@ -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
|
+
});
|