@openui5/sap.ui.unified 1.110.0 → 1.111.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/package.json +2 -2
- package/src/sap/ui/unified/.library +1 -1
- package/src/sap/ui/unified/Calendar.js +47 -10
- package/src/sap/ui/unified/CalendarAppointment.js +2 -2
- package/src/sap/ui/unified/CalendarDateInterval.js +1 -1
- package/src/sap/ui/unified/CalendarLegend.js +137 -5
- package/src/sap/ui/unified/CalendarLegendItem.js +1 -1
- package/src/sap/ui/unified/CalendarLegendRenderer.js +12 -4
- package/src/sap/ui/unified/CalendarMonthInterval.js +1 -1
- package/src/sap/ui/unified/CalendarMonthIntervalRenderer.js +3 -3
- package/src/sap/ui/unified/CalendarOneMonthInterval.js +1 -1
- package/src/sap/ui/unified/CalendarRenderer.js +3 -3
- package/src/sap/ui/unified/CalendarRow.js +1 -1
- package/src/sap/ui/unified/CalendarTimeInterval.js +1 -1
- package/src/sap/ui/unified/CalendarTimeIntervalRenderer.js +3 -3
- 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 +5 -1
- package/src/sap/ui/unified/MenuItem.js +1 -1
- package/src/sap/ui/unified/MenuItemBase.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/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/calendar/CalendarDate.js +9 -8
- package/src/sap/ui/unified/calendar/CalendarUtils.js +1 -18
- package/src/sap/ui/unified/calendar/DatesRow.js +1 -1
- package/src/sap/ui/unified/calendar/Header.js +1 -1
- package/src/sap/ui/unified/calendar/HeaderRenderer.js +0 -3
- package/src/sap/ui/unified/calendar/IndexPicker.js +1 -1
- package/src/sap/ui/unified/calendar/Month.js +34 -19
- package/src/sap/ui/unified/calendar/MonthPicker.js +1 -1
- package/src/sap/ui/unified/calendar/MonthRenderer.js +33 -9
- 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/TimesRow.js +1 -1
- package/src/sap/ui/unified/calendar/YearPicker.js +16 -19
- package/src/sap/ui/unified/calendar/YearRangePicker.js +4 -4
- package/src/sap/ui/unified/library.js +5 -12
- package/src/sap/ui/unified/messagebundle.properties +4 -0
- package/src/sap/ui/unified/messagebundle_ar.properties +3 -0
- package/src/sap/ui/unified/messagebundle_bg.properties +3 -0
- package/src/sap/ui/unified/messagebundle_ca.properties +3 -0
- package/src/sap/ui/unified/messagebundle_cs.properties +3 -0
- package/src/sap/ui/unified/messagebundle_cy.properties +3 -0
- package/src/sap/ui/unified/messagebundle_da.properties +3 -0
- package/src/sap/ui/unified/messagebundle_de.properties +3 -0
- package/src/sap/ui/unified/messagebundle_el.properties +3 -0
- package/src/sap/ui/unified/messagebundle_en.properties +3 -0
- package/src/sap/ui/unified/messagebundle_en_GB.properties +3 -0
- package/src/sap/ui/unified/messagebundle_en_US_sappsd.properties +3 -0
- package/src/sap/ui/unified/messagebundle_en_US_saprigi.properties +5 -0
- package/src/sap/ui/unified/messagebundle_en_US_saptrc.properties +3 -0
- package/src/sap/ui/unified/messagebundle_es.properties +3 -0
- package/src/sap/ui/unified/messagebundle_es_MX.properties +3 -0
- package/src/sap/ui/unified/messagebundle_et.properties +3 -0
- package/src/sap/ui/unified/messagebundle_fi.properties +3 -0
- package/src/sap/ui/unified/messagebundle_fr.properties +3 -0
- package/src/sap/ui/unified/messagebundle_fr_CA.properties +3 -0
- package/src/sap/ui/unified/messagebundle_hi.properties +3 -0
- package/src/sap/ui/unified/messagebundle_hr.properties +3 -0
- package/src/sap/ui/unified/messagebundle_hu.properties +3 -0
- package/src/sap/ui/unified/messagebundle_id.properties +3 -0
- package/src/sap/ui/unified/messagebundle_it.properties +3 -0
- package/src/sap/ui/unified/messagebundle_iw.properties +3 -0
- package/src/sap/ui/unified/messagebundle_ja.properties +3 -0
- package/src/sap/ui/unified/messagebundle_kk.properties +3 -0
- package/src/sap/ui/unified/messagebundle_ko.properties +3 -0
- package/src/sap/ui/unified/messagebundle_lt.properties +3 -0
- package/src/sap/ui/unified/messagebundle_lv.properties +3 -0
- package/src/sap/ui/unified/messagebundle_ms.properties +3 -0
- package/src/sap/ui/unified/messagebundle_nl.properties +3 -0
- package/src/sap/ui/unified/messagebundle_no.properties +3 -0
- package/src/sap/ui/unified/messagebundle_pl.properties +3 -0
- package/src/sap/ui/unified/messagebundle_pt.properties +3 -0
- package/src/sap/ui/unified/messagebundle_pt_PT.properties +3 -0
- package/src/sap/ui/unified/messagebundle_ro.properties +3 -0
- package/src/sap/ui/unified/messagebundle_ru.properties +3 -0
- package/src/sap/ui/unified/messagebundle_sh.properties +3 -0
- package/src/sap/ui/unified/messagebundle_sk.properties +3 -0
- package/src/sap/ui/unified/messagebundle_sl.properties +3 -0
- package/src/sap/ui/unified/messagebundle_sv.properties +3 -0
- package/src/sap/ui/unified/messagebundle_th.properties +3 -0
- package/src/sap/ui/unified/messagebundle_tr.properties +3 -0
- package/src/sap/ui/unified/messagebundle_uk.properties +3 -0
- package/src/sap/ui/unified/messagebundle_vi.properties +3 -0
- package/src/sap/ui/unified/messagebundle_zh_CN.properties +3 -0
- package/src/sap/ui/unified/messagebundle_zh_TW.properties +3 -0
- package/src/sap/ui/unified/themes/base/Calendar.less +1 -3
- package/src/sap/ui/unified/themes/base/CalendarLegend.less +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.unified",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.111.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/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.ui.core": "1.
|
|
17
|
+
"@openui5/sap.ui.core": "1.111.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2023 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.111.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>Unified controls intended for both, mobile and desktop scenarios</documentation>
|
|
12
12
|
|
|
@@ -17,7 +17,8 @@ sap.ui.define([
|
|
|
17
17
|
'./calendar/YearPicker',
|
|
18
18
|
'./calendar/YearRangePicker',
|
|
19
19
|
'./calendar/CalendarDate',
|
|
20
|
-
|
|
20
|
+
'sap/ui/core/date/UniversalDate',
|
|
21
|
+
'sap/ui/core/date/UI5Date',
|
|
21
22
|
'./library',
|
|
22
23
|
'sap/ui/Device',
|
|
23
24
|
'sap/ui/core/format/DateFormat',
|
|
@@ -44,6 +45,7 @@ sap.ui.define([
|
|
|
44
45
|
YearRangePicker,
|
|
45
46
|
CalendarDate,
|
|
46
47
|
UniversalDate,
|
|
48
|
+
UI5Date,
|
|
47
49
|
library,
|
|
48
50
|
Device,
|
|
49
51
|
DateFormat,
|
|
@@ -74,7 +76,7 @@ sap.ui.define([
|
|
|
74
76
|
* Basic Calendar.
|
|
75
77
|
* This calendar is used for DatePickers
|
|
76
78
|
* @extends sap.ui.core.Control
|
|
77
|
-
* @version 1.
|
|
79
|
+
* @version 1.111.0
|
|
78
80
|
*
|
|
79
81
|
* @constructor
|
|
80
82
|
* @public
|
|
@@ -207,7 +209,14 @@ sap.ui.define([
|
|
|
207
209
|
* Note: This property should not be used with firstDayOfWeek property.
|
|
208
210
|
* @since 1.108.0
|
|
209
211
|
*/
|
|
210
|
-
calendarWeekNumbering : { type : "sap.ui.core.date.CalendarWeekNumbering", group : "Appearance", defaultValue: null}
|
|
212
|
+
calendarWeekNumbering : { type : "sap.ui.core.date.CalendarWeekNumbering", group : "Appearance", defaultValue: null},
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Holds a reference to a JavaScript Date Object to define the initially navigated date in the calendar.
|
|
216
|
+
*
|
|
217
|
+
* @since 1.111
|
|
218
|
+
*/
|
|
219
|
+
initialFocusedDate: {type: "object", group: "Data", defaultValue: null}
|
|
211
220
|
|
|
212
221
|
},
|
|
213
222
|
aggregations : {
|
|
@@ -561,6 +570,10 @@ sap.ui.define([
|
|
|
561
570
|
|
|
562
571
|
this._updateHeadersButtons();
|
|
563
572
|
|
|
573
|
+
this._updateLegendParent();
|
|
574
|
+
if (this.getInitialFocusedDate()) {
|
|
575
|
+
this.focusDate(this.getInitialFocusedDate());
|
|
576
|
+
}
|
|
564
577
|
};
|
|
565
578
|
|
|
566
579
|
Calendar.prototype.onAfterRendering = function(oEvent){
|
|
@@ -795,6 +808,7 @@ sap.ui.define([
|
|
|
795
808
|
|
|
796
809
|
return this;
|
|
797
810
|
};
|
|
811
|
+
|
|
798
812
|
Calendar.prototype.setMonths = function(iMonths){
|
|
799
813
|
|
|
800
814
|
this._bDateRangeChanged = undefined; // to force rerendering
|
|
@@ -814,10 +828,9 @@ sap.ui.define([
|
|
|
814
828
|
oMonth.attachEvent("_bindMousemove", _handleBindMousemove, this);
|
|
815
829
|
oMonth.attachEvent("_unbindMousemove", _handleUnbindMousemove, this);
|
|
816
830
|
oMonth._bNoThemeChange = true;
|
|
817
|
-
oMonth._bNotInTabChain = true;
|
|
818
831
|
oMonth.setCalendarWeekNumbering(this.getCalendarWeekNumbering());
|
|
819
832
|
oMonth.setSecondaryCalendarType(this._getSecondaryCalendarType());
|
|
820
|
-
this.addAggregation("month",oMonth);
|
|
833
|
+
this.addAggregation("month", oMonth);
|
|
821
834
|
}
|
|
822
835
|
this._toggleTwoMonthsInTwoColumnsCSS();
|
|
823
836
|
} else if (aMonths.length > iMonths){
|
|
@@ -1291,6 +1304,13 @@ sap.ui.define([
|
|
|
1291
1304
|
this._toggleTwoMonthsInTwoColumnsCSS();
|
|
1292
1305
|
};
|
|
1293
1306
|
|
|
1307
|
+
Calendar.prototype._updateLegendParent = function(){
|
|
1308
|
+
var sLegend = this.getLegend(),
|
|
1309
|
+
oLegend = oCore.byId(sLegend);
|
|
1310
|
+
|
|
1311
|
+
oLegend && oLegend._setParent(this);
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1294
1314
|
/**
|
|
1295
1315
|
* @param {sap.ui.unified.calendar.CalendarDate} oDate A date to be used for the header buttons
|
|
1296
1316
|
* @private
|
|
@@ -1403,7 +1423,7 @@ sap.ui.define([
|
|
|
1403
1423
|
oHighDate.setYear(oHighDate.getYear() + (iRangeSize * iYears) / 2 - 1);
|
|
1404
1424
|
} else {
|
|
1405
1425
|
iYears = oYearPicker.getYears();
|
|
1406
|
-
oDate = oYearPicker.getProperty("_middleDate") ? oYearPicker.getProperty("_middleDate") : CalendarDate.fromLocalJSDate(
|
|
1426
|
+
oDate = oYearPicker.getProperty("_middleDate") ? oYearPicker.getProperty("_middleDate") : CalendarDate.fromLocalJSDate(UI5Date.getInstance());
|
|
1407
1427
|
oLowDate = new CalendarDate(oDate);
|
|
1408
1428
|
oHighDate = new CalendarDate(oDate);
|
|
1409
1429
|
|
|
@@ -1557,7 +1577,7 @@ sap.ui.define([
|
|
|
1557
1577
|
* @private
|
|
1558
1578
|
*/
|
|
1559
1579
|
Calendar.prototype._handleCurrentDate = function() {
|
|
1560
|
-
var oNow =
|
|
1580
|
+
var oNow = UI5Date.getInstance(),
|
|
1561
1581
|
oMaxDate = this.getMaxDate(),
|
|
1562
1582
|
oMinDate = this.getMinDate();
|
|
1563
1583
|
|
|
@@ -1690,6 +1710,12 @@ sap.ui.define([
|
|
|
1690
1710
|
this.setProperty("_currentPicker", CURRENT_PICKERS.MONTH);
|
|
1691
1711
|
// show again hidden month button
|
|
1692
1712
|
this._togglePrevNext(this._getFocusedDate(), true);
|
|
1713
|
+
|
|
1714
|
+
if (this.getAggregation("month").length > 1) {
|
|
1715
|
+
this.getAggregation("month").forEach(function(oMonth) {
|
|
1716
|
+
oMonth._oItemNavigation.iActiveTabIndex = 0;
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1693
1719
|
};
|
|
1694
1720
|
|
|
1695
1721
|
Calendar.prototype._setDisabledMonths = function(iYear, oMonthPicker) {
|
|
@@ -1843,6 +1869,12 @@ sap.ui.define([
|
|
|
1843
1869
|
this._setDisabledMonths(oDate.getYear(), oMonthPicker);
|
|
1844
1870
|
}
|
|
1845
1871
|
|
|
1872
|
+
if (this.getAggregation("month").length > 1 && this.getProperty("_currentPicker") == CURRENT_PICKERS.MONTH_PICKER) {
|
|
1873
|
+
this.getAggregation("month").forEach(function(oMonth) {
|
|
1874
|
+
oMonth._oItemNavigation.iActiveTabIndex = -1;
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1846
1878
|
this._togglePrevNext(oDate, true);
|
|
1847
1879
|
this._setHeaderText(this._getFocusedDate());
|
|
1848
1880
|
};
|
|
@@ -1880,6 +1912,12 @@ sap.ui.define([
|
|
|
1880
1912
|
oYearPicker.setDate(oDate.toLocalJSDate());
|
|
1881
1913
|
this._updateHeadersYearPrimaryText(this._getYearString());
|
|
1882
1914
|
}
|
|
1915
|
+
|
|
1916
|
+
if (this.getAggregation("month").length > 1 && this.getProperty("_currentPicker") == CURRENT_PICKERS.YEAR_PICKER) {
|
|
1917
|
+
this.getAggregation("month").forEach(function(oMonth) {
|
|
1918
|
+
oMonth._oItemNavigation.iActiveTabIndex = -1;
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1883
1921
|
};
|
|
1884
1922
|
|
|
1885
1923
|
/**
|
|
@@ -2161,8 +2199,7 @@ sap.ui.define([
|
|
|
2161
2199
|
oFocusedDate = oDate;
|
|
2162
2200
|
|
|
2163
2201
|
this._focusDate(oFocusedDate, true, false, false);
|
|
2164
|
-
this.
|
|
2165
|
-
this.setProperty("_currentPicker", CURRENT_PICKERS.MONTH);
|
|
2202
|
+
this._closePickers();
|
|
2166
2203
|
this._addMonthFocusDelegate();
|
|
2167
2204
|
this._setHeaderText(this._getFocusedDate());
|
|
2168
2205
|
};
|
|
@@ -2508,7 +2545,7 @@ sap.ui.define([
|
|
|
2508
2545
|
this._oFocusedDate = CalendarDate.fromLocalJSDate(aSelectedDates[0].getStartDate(), sCalendarType);
|
|
2509
2546
|
} else {
|
|
2510
2547
|
// use current date
|
|
2511
|
-
this._oFocusedDate = CalendarDate.fromLocalJSDate(
|
|
2548
|
+
this._oFocusedDate = CalendarDate.fromLocalJSDate(UI5Date.getInstance(), sCalendarType);
|
|
2512
2549
|
}
|
|
2513
2550
|
|
|
2514
2551
|
if (this._oFocusedDate.isBefore(this._oMinDate)) {
|
|
@@ -21,7 +21,7 @@ sap.ui.define(['./DateTypeRange', 'sap/ui/core/format/DateFormat', 'sap/ui/core/
|
|
|
21
21
|
*
|
|
22
22
|
* Applications could inherit from this element to add own fields.
|
|
23
23
|
* @extends sap.ui.unified.DateTypeRange
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.111.0
|
|
25
25
|
*
|
|
26
26
|
* @constructor
|
|
27
27
|
* @public
|
|
@@ -141,7 +141,7 @@ sap.ui.define(['./DateTypeRange', 'sap/ui/core/format/DateFormat', 'sap/ui/core/
|
|
|
141
141
|
iHour, iMinute, sHour, sMinute;
|
|
142
142
|
|
|
143
143
|
//have no intersection with the given day
|
|
144
|
-
if (oStartDate.getTime()
|
|
144
|
+
if (oStartDate.getTime() > oNextDayStart.getTime() || oEndDate.getTime() < oCurrentDayStart.getTime()) {
|
|
145
145
|
sFirstLineText = "";
|
|
146
146
|
} else if (oStartDate.getTime() <= oCurrentDayStart.getTime() && oEndDate.getTime() >= oNextDayStart.getTime()) {
|
|
147
147
|
sFirstLineText = oResourceBundle.getText("PLANNINGCALENDAR_ALLDAY");
|
|
@@ -56,7 +56,7 @@ sap.ui.define([
|
|
|
56
56
|
* @class
|
|
57
57
|
* <code>CalendarDateInterval</code> only visualizes the dates in a one-line interval and allows the selection of a single day.
|
|
58
58
|
* @extends sap.ui.unified.Calendar
|
|
59
|
-
* @version 1.
|
|
59
|
+
* @version 1.111.0
|
|
60
60
|
*
|
|
61
61
|
* @constructor
|
|
62
62
|
* @public
|
|
@@ -11,11 +11,17 @@ sap.ui.define([
|
|
|
11
11
|
'./CalendarLegendRenderer',
|
|
12
12
|
"sap/base/Log",
|
|
13
13
|
"sap/ui/thirdparty/jquery",
|
|
14
|
-
"sap/ui/unified/CalendarLegendItem"
|
|
14
|
+
"sap/ui/unified/CalendarLegendItem",
|
|
15
|
+
"sap/ui/core/Core",
|
|
16
|
+
"sap/ui/Device",
|
|
17
|
+
"sap/ui/core/delegate/ItemNavigation"
|
|
15
18
|
],
|
|
16
|
-
function(Control, library, CalendarLegendRenderer, Log, jQuery, CalendarLegendItem) {
|
|
19
|
+
function(Control, library, CalendarLegendRenderer, Log, jQuery, CalendarLegendItem, Core, Device, ItemNavigation) {
|
|
17
20
|
"use strict";
|
|
18
21
|
|
|
22
|
+
// Resource Bundle
|
|
23
|
+
var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.unified");
|
|
24
|
+
|
|
19
25
|
// shortcut for sap.ui.unified.CalendarDayType
|
|
20
26
|
var CalendarDayType = library.CalendarDayType;
|
|
21
27
|
|
|
@@ -30,10 +36,27 @@ sap.ui.define([
|
|
|
30
36
|
*
|
|
31
37
|
* @class
|
|
32
38
|
* A legend for the Calendar Control. Displays special dates colors with their corresponding description. The aggregation specialDates can be set herefor.
|
|
39
|
+
*
|
|
40
|
+
* <h3>Calendar Legend Navigation</h3>
|
|
41
|
+
*
|
|
42
|
+
* If the Calendar Legend is associated with a <code>sap.ui.unified.Calendar</code> control, the users can navigate through the Calendar Legend items.
|
|
43
|
+
* Only special dates related to the navigated legend's item type are displayed in the calendar grid.
|
|
44
|
+
* <b>Note: </b> Standard calendar legend items (Today, Selected, Working Day and Non-Working Day) are also navigatable, but focusing them does
|
|
45
|
+
* not affect the special dates display (all calendar special dates are displayed).
|
|
46
|
+
*
|
|
47
|
+
* <h3>Keyboard shortcuts (when the legend is navigatable)</h3>
|
|
48
|
+
*
|
|
49
|
+
* <ul>
|
|
50
|
+
* <li>[Arrow Up], [Arrow Left] - Move to the previous calendar legend item</li>
|
|
51
|
+
* <li>[Arrow Down], [Arrow Right] - Move to the next calendar legend item</li>
|
|
52
|
+
* <li>[Home], [Page Up] - Move to the first calendar legend item</li>
|
|
53
|
+
* <li>[End], [Page Down] - Move to the last calendar legend item</li>
|
|
54
|
+
* </ul>
|
|
55
|
+
*
|
|
33
56
|
* @extends sap.ui.core.Control
|
|
34
57
|
*
|
|
35
58
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
59
|
+
* @version 1.111.0
|
|
37
60
|
*
|
|
38
61
|
* @constructor
|
|
39
62
|
* @public
|
|
@@ -84,10 +107,18 @@ sap.ui.define([
|
|
|
84
107
|
|
|
85
108
|
//don't render standardItems unless it's a PC legend
|
|
86
109
|
this._bShouldRenderStandardItems = true;
|
|
110
|
+
|
|
111
|
+
this._oItemNavigation = null;
|
|
87
112
|
},
|
|
88
113
|
renderer: CalendarLegendRenderer
|
|
89
114
|
});
|
|
90
115
|
|
|
116
|
+
CalendarLegend.prototype.onAfterRendering = function () {
|
|
117
|
+
if (!Device.system.phone && this._oParentControl) {
|
|
118
|
+
this._initItemNavigation();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
91
122
|
CalendarLegend.prototype.setStandardItems = function (aValues) {
|
|
92
123
|
var i;
|
|
93
124
|
|
|
@@ -110,6 +141,108 @@ sap.ui.define([
|
|
|
110
141
|
return this;
|
|
111
142
|
};
|
|
112
143
|
|
|
144
|
+
CalendarLegend.prototype._initItemNavigation = function() {
|
|
145
|
+
var aStandardItems = this.getAggregation("_standardItems") || [],
|
|
146
|
+
aLegendItems = this.getItems() || [],
|
|
147
|
+
aItems,
|
|
148
|
+
aItemsDomRef = [],
|
|
149
|
+
oItemDomRef,
|
|
150
|
+
oRootDomRef;
|
|
151
|
+
|
|
152
|
+
aItems = aStandardItems.concat(aLegendItems);
|
|
153
|
+
|
|
154
|
+
if (!aItems.length) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
oRootDomRef = aItems[0].getDomRef().parentElement;
|
|
159
|
+
|
|
160
|
+
// find a collection of all legend items
|
|
161
|
+
aItems.forEach(function(oItem, iIndex) {
|
|
162
|
+
oItemDomRef = oItem.getFocusDomRef();
|
|
163
|
+
oItemDomRef.setAttribute("tabindex", "-1");
|
|
164
|
+
aItemsDomRef.push(oItemDomRef);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
if (!this._oItemNavigation) {
|
|
168
|
+
this._oItemNavigation = new ItemNavigation()
|
|
169
|
+
.setCycling(false)
|
|
170
|
+
.attachEvent(ItemNavigation.Events.AfterFocus, this._onItemNavigationAfterFocus, this)
|
|
171
|
+
.attachEvent(ItemNavigation.Events.FocusLeave, this._onItemNavigationFocusLeave, this)
|
|
172
|
+
.setDisabledModifiers({
|
|
173
|
+
sapnext : ["alt", "meta", "ctrl"],
|
|
174
|
+
sapprevious : ["alt", "meta", "ctrl"],
|
|
175
|
+
saphome: ["alt", "meta", "ctrl"],
|
|
176
|
+
sapend: ["meta", "ctrl"]
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
this.addDelegate(this._oItemNavigation);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// reinitialize the ItemNavigation after rendering
|
|
183
|
+
this._oItemNavigation.setRootDomRef(oRootDomRef)
|
|
184
|
+
.setItemDomRefs(aItemsDomRef)
|
|
185
|
+
.setPageSize(aItems.length) // set the page size equal to the items number so when we press pageUp/pageDown to focus first/last tab
|
|
186
|
+
.setFocusedIndex(0);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
CalendarLegend.prototype._onItemNavigationAfterFocus = function(oEvent) {
|
|
190
|
+
var oSource = oEvent.getSource(),
|
|
191
|
+
oLegendItemDomRef = oSource.getItemDomRefs()[oSource.getFocusedIndex()],
|
|
192
|
+
sType = Core.byId(oLegendItemDomRef.id).getType(),
|
|
193
|
+
oParent = this._getParent();
|
|
194
|
+
|
|
195
|
+
this._setSpecialDateTypeFilter(sType);
|
|
196
|
+
oParent && oParent.invalidate();
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
CalendarLegend.prototype._onItemNavigationFocusLeave = function(oEvent) {
|
|
200
|
+
var oParent = this._getParent();
|
|
201
|
+
|
|
202
|
+
this._setSpecialDateTypeFilter();
|
|
203
|
+
oParent && oParent.invalidate();
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Sets a special date type that should be filtered. Only dates with this type should be displayed as special.
|
|
208
|
+
* @param {string} sType special date type that should be displayed only
|
|
209
|
+
*/
|
|
210
|
+
CalendarLegend.prototype._setSpecialDateTypeFilter = function(sType) {
|
|
211
|
+
this._sSpecialDateTypeFilter = sType || "";
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Returns a special date type that should be filtered.
|
|
216
|
+
* @returns {string} special date type that should be displayed only.
|
|
217
|
+
*/
|
|
218
|
+
CalendarLegend.prototype._getSpecialDateTypeFilter = function() {
|
|
219
|
+
return this._sSpecialDateTypeFilter || "";
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Sets parent control of the Calendar Legend.
|
|
224
|
+
* @param {sap.ui.core.Control} oControl parent control
|
|
225
|
+
*/
|
|
226
|
+
CalendarLegend.prototype._setParent = function(oControl) {
|
|
227
|
+
this._oParentControl = oControl;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Returns parent control of the Calendar Legend.
|
|
232
|
+
* @returns {sap.ui.core.Control} parent control
|
|
233
|
+
*/
|
|
234
|
+
CalendarLegend.prototype._getParent = function() {
|
|
235
|
+
return this._oParentControl;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Returns aria-label text of the Calendar Legend.
|
|
240
|
+
* @returns {string} aria-label text
|
|
241
|
+
*/
|
|
242
|
+
CalendarLegend.prototype._getLegendAriaLabel = function () {
|
|
243
|
+
return oResourceBundle.getText("LEGEND_ARIA_LABEL");
|
|
244
|
+
};
|
|
245
|
+
|
|
113
246
|
/**
|
|
114
247
|
* Populates the standard items.
|
|
115
248
|
* @param {string[]|sap.ui.unified.StandardCalendarLegendItem[]} aStandardItems array of items specified by their key
|
|
@@ -119,7 +252,6 @@ sap.ui.define([
|
|
|
119
252
|
*/
|
|
120
253
|
CalendarLegend.prototype._addStandardItems = function(aStandardItems, replace) {
|
|
121
254
|
var i,
|
|
122
|
-
rb = sap.ui.getCore().getLibraryResourceBundle("sap.ui.unified"),
|
|
123
255
|
sId = this.getId();
|
|
124
256
|
|
|
125
257
|
if (replace) {
|
|
@@ -128,7 +260,7 @@ sap.ui.define([
|
|
|
128
260
|
|
|
129
261
|
for (i = 0; i < aStandardItems.length; i++) {
|
|
130
262
|
var oItem = new CalendarLegendItem(sId + "-" + aStandardItems[i], {
|
|
131
|
-
text:
|
|
263
|
+
text: oResourceBundle.getText(CalendarLegend._Standard_Items_TextKeys[aStandardItems[i]])
|
|
132
264
|
});
|
|
133
265
|
this.addAggregation("_standardItems", oItem);
|
|
134
266
|
}
|
|
@@ -27,12 +27,16 @@ sap.ui.define(['sap/ui/core/InvisibleText'],
|
|
|
27
27
|
var aStandardItems = oLeg.getAggregation("_standardItems"),
|
|
28
28
|
aCustomItems = oLeg.getItems(),
|
|
29
29
|
iCustomItemsLength = this.defineItemsLength(oLeg, aCustomItems.length),
|
|
30
|
+
iCount = (aStandardItems ? aStandardItems.length : 0) + (aCustomItems ? aCustomItems.length : 0),
|
|
30
31
|
i,
|
|
31
32
|
iIdLength,
|
|
32
|
-
sColumnWidth
|
|
33
|
+
sColumnWidth,
|
|
34
|
+
iIndex = 1;
|
|
33
35
|
|
|
34
36
|
oRm.openStart("div", oLeg);
|
|
35
37
|
oRm.class("sapUiUnifiedLegend");
|
|
38
|
+
oRm.attr("aria-label", oLeg._getLegendAriaLabel());
|
|
39
|
+
oRm.attr("role", "list");
|
|
36
40
|
oRm.openEnd();
|
|
37
41
|
|
|
38
42
|
this.renderItemsHeader(oRm, oLeg);
|
|
@@ -51,14 +55,14 @@ sap.ui.define(['sap/ui/core/InvisibleText'],
|
|
|
51
55
|
iIdLength = oLeg.getId().length + 1; //+1, because of the dash in "CalLeg1-Today"?
|
|
52
56
|
for (i = 0; i < aStandardItems.length; ++i) {
|
|
53
57
|
var sClass = "sapUiUnifiedLegend" + aStandardItems[i].getId().slice(iIdLength);
|
|
54
|
-
this.renderLegendItem(oRm, sClass, aStandardItems[i], ["sapUiUnifiedLegendSquareColor"]);
|
|
58
|
+
this.renderLegendItem(oRm, sClass, aStandardItems[i], ["sapUiUnifiedLegendSquareColor"], iIndex++, iCount);
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
if (aCustomItems) {
|
|
59
63
|
// rendering special day and colors
|
|
60
64
|
for (i = 0; i < iCustomItemsLength; i++) {
|
|
61
|
-
this.renderLegendItem(oRm, "sapUiCalLegDayType" + oLeg._getItemType(aCustomItems[i], aCustomItems).slice(4), aCustomItems[i], ["sapUiUnifiedLegendSquareColor"]);
|
|
65
|
+
this.renderLegendItem(oRm, "sapUiCalLegDayType" + oLeg._getItemType(aCustomItems[i], aCustomItems).slice(4), aCustomItems[i], ["sapUiUnifiedLegendSquareColor"], iIndex++, iCount);
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
this.renderAdditionalItems(oRm, oLeg); //like more sections with items
|
|
@@ -78,7 +82,7 @@ sap.ui.define(['sap/ui/core/InvisibleText'],
|
|
|
78
82
|
* @param {sap.ui.unified.CalenderLegendItem} oItem item element
|
|
79
83
|
* @param {string[]} aColorClasses Css classes to be added to the color bullet item in front of the legend item
|
|
80
84
|
*/
|
|
81
|
-
CalendarLegendRenderer.renderLegendItem = function(oRm, sClass, oItem, aColorClasses) {
|
|
85
|
+
CalendarLegendRenderer.renderLegendItem = function(oRm, sClass, oItem, aColorClasses, iIndex, iCount) {
|
|
82
86
|
|
|
83
87
|
var sText = oItem.getText();
|
|
84
88
|
var sTooltip = oItem.getTooltip_AsString();
|
|
@@ -90,6 +94,10 @@ sap.ui.define(['sap/ui/core/InvisibleText'],
|
|
|
90
94
|
oRm.attr('title', sTooltip);
|
|
91
95
|
}
|
|
92
96
|
|
|
97
|
+
oRm.attr("role", "listitem");
|
|
98
|
+
oRm.attr("aria-posinset", iIndex);
|
|
99
|
+
oRm.attr("aria-setsize", iCount);
|
|
100
|
+
|
|
93
101
|
oRm.class("sapUiUnifiedLegendItem");
|
|
94
102
|
oRm.class(sClass);
|
|
95
103
|
oRm.openEnd();
|
|
@@ -65,7 +65,7 @@ sap.ui.define([
|
|
|
65
65
|
* <b>Note:</b> 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.111.0
|
|
69
69
|
*
|
|
70
70
|
* @constructor
|
|
71
71
|
* @public
|
|
@@ -54,6 +54,9 @@ sap.ui.define([],
|
|
|
54
54
|
|
|
55
55
|
oRm.openEnd(); // div element
|
|
56
56
|
|
|
57
|
+
var oHeader = oCal.getAggregation("header");
|
|
58
|
+
oRm.renderControl(oHeader);
|
|
59
|
+
|
|
57
60
|
oRm.openStart("div", sId + "-content");
|
|
58
61
|
oRm.class("sapUiCalContent");
|
|
59
62
|
oRm.openEnd();
|
|
@@ -66,9 +69,6 @@ sap.ui.define([],
|
|
|
66
69
|
oRm.text(rb.getText("CALENDAR_CANCEL"));
|
|
67
70
|
oRm.close("button");
|
|
68
71
|
|
|
69
|
-
var oHeader = oCal.getAggregation("header");
|
|
70
|
-
oRm.renderControl(oHeader);
|
|
71
|
-
|
|
72
72
|
if (oCal.getPickerPopup()) {
|
|
73
73
|
oRm.openStart("div", sId + "-contentOver");
|
|
74
74
|
oRm.class("sapUiCalContentOver");
|
|
@@ -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.111.0
|
|
61
61
|
*
|
|
62
62
|
* @constructor
|
|
63
63
|
* @private
|
|
@@ -68,6 +68,9 @@ sap.ui.define([],
|
|
|
68
68
|
}
|
|
69
69
|
oRm.openEnd(); // div element
|
|
70
70
|
|
|
71
|
+
var oHeader = oCal.getAggregation("header");
|
|
72
|
+
oRm.renderControl(oHeader);
|
|
73
|
+
|
|
71
74
|
oRm.openStart("div", sId + "-content");
|
|
72
75
|
oRm.class("sapUiCalContent");
|
|
73
76
|
oRm.openEnd();
|
|
@@ -101,9 +104,6 @@ sap.ui.define([],
|
|
|
101
104
|
|
|
102
105
|
oRm.close("div");
|
|
103
106
|
|
|
104
|
-
var oHeader = oCal.getAggregation("header");
|
|
105
|
-
oRm.renderControl(oHeader);
|
|
106
|
-
|
|
107
107
|
//when used in a DatePicker, in mobile there is no cancel button
|
|
108
108
|
if (!oCal._bSkipCancelButtonRendering) {
|
|
109
109
|
oRm.openStart("button", sId + "-cancel");
|
|
@@ -59,6 +59,9 @@ sap.ui.define([],
|
|
|
59
59
|
|
|
60
60
|
oRm.openEnd(); // div element
|
|
61
61
|
|
|
62
|
+
var oHeader = oCal.getAggregation("header");
|
|
63
|
+
oRm.renderControl(oHeader);
|
|
64
|
+
|
|
62
65
|
oRm.openStart("div", sId + "-content");
|
|
63
66
|
oRm.class("sapUiCalContent");
|
|
64
67
|
oRm.openEnd();
|
|
@@ -66,9 +69,6 @@ sap.ui.define([],
|
|
|
66
69
|
|
|
67
70
|
oRm.close("div");
|
|
68
71
|
|
|
69
|
-
var oHeader = oCal.getAggregation("header");
|
|
70
|
-
oRm.renderControl(oHeader);
|
|
71
|
-
|
|
72
72
|
oRm.openStart("button", sId + "-cancel");
|
|
73
73
|
oRm.class("sapUiCalCancel");
|
|
74
74
|
oRm.attr("tabindex", "-1");
|
|
@@ -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.111.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.111.0
|
|
29
29
|
*
|
|
30
30
|
* @constructor
|
|
31
31
|
* @public
|