@ui5/webcomponents-base 0.0.0-1d11e4833 → 0.0.0-1f45608ac
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/.eslintignore +1 -0
- package/CHANGELOG.md +140 -0
- package/bundle.esm.js +3 -1
- package/dist/Boot.d.ts +4 -3
- package/dist/Boot.js +17 -4
- package/dist/Boot.js.map +1 -1
- package/dist/Device.js +109 -34
- package/dist/Device.js.map +1 -1
- package/dist/InitialConfiguration.js +1 -1
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/UI5Element.d.ts +20 -15
- package/dist/UI5Element.js +11 -23
- package/dist/UI5Element.js.map +1 -1
- package/dist/api.json +1 -1
- package/dist/asset-registries/Icons.d.ts +1 -1
- package/dist/asset-registries/Icons.js +21 -21
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +1 -1
- package/dist/asset-registries/Themes.d.ts +1 -0
- package/dist/assets/Boot.6335ce08.css +1 -0
- package/dist/assets/bundle.esm.9718f067.js +24 -0
- package/dist/assets/i18nBundle.7fb08e25.js +37 -0
- package/dist/assets-meta/IconCollectionsAlias.d.ts +24 -10
- package/dist/assets-meta/IconCollectionsAlias.js +29 -9
- package/dist/assets-meta/IconCollectionsAlias.js.map +1 -1
- package/dist/config/FormatSettings.d.ts +5 -1
- package/dist/config/FormatSettings.js +5 -1
- package/dist/config/FormatSettings.js.map +1 -1
- package/dist/config/Icons.d.ts +43 -18
- package/dist/config/Icons.js +80 -25
- package/dist/config/Icons.js.map +1 -1
- package/dist/config/RTL.js +3 -0
- package/dist/config/RTL.js.map +1 -1
- package/dist/decorators/customElement.d.ts +17 -2
- package/dist/decorators/customElement.js +20 -5
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event.js +6 -6
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators/property.js +6 -6
- package/dist/decorators/property.js.map +1 -1
- package/dist/decorators/slot.js +7 -7
- package/dist/decorators/slot.js.map +1 -1
- package/dist/delegate/ResizeHandler.d.ts +2 -1
- package/dist/delegate/ResizeHandler.js +3 -1
- package/dist/delegate/ResizeHandler.js.map +1 -1
- package/dist/delegate/ScrollEnablement.d.ts +4 -3
- package/dist/delegate/ScrollEnablement.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +3 -0
- package/dist/features/F6Navigation.js +77 -38
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/LegacyDateFormats.d.ts +18 -0
- package/dist/features/LegacyDateFormats.js +20 -0
- package/dist/features/LegacyDateFormats.js.map +1 -0
- package/dist/features/OpenUI5Support.d.ts +2 -0
- package/dist/features/OpenUI5Support.js +1 -0
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/css/BusyIndicator.css.d.ts +3 -0
- package/dist/generated/css/BusyIndicator.css.js +7 -5
- package/dist/generated/css/BusyIndicator.css.js.map +1 -0
- package/dist/generated/css/FontFace.css.d.ts +3 -0
- package/dist/generated/css/FontFace.css.js +7 -5
- package/dist/generated/css/FontFace.css.js.map +1 -0
- package/dist/generated/css/OverrideFontFace.css.d.ts +3 -0
- package/dist/generated/css/OverrideFontFace.css.js +7 -5
- package/dist/generated/css/OverrideFontFace.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +3 -0
- package/dist/generated/css/SystemCSSVars.css.js +7 -5
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -0
- package/dist/getSharedResource.js +9 -1
- package/dist/getSharedResource.js.map +1 -1
- package/{global.d.ts → dist/global.d.ts} +0 -6
- package/dist/renderer/LitRenderer.d.ts +3 -3
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/theming/CustomStyle.js +7 -5
- package/dist/theming/CustomStyle.js.map +1 -1
- package/dist/theming/getStylesString.d.ts +1 -1
- package/dist/types/AnimationMode.d.ts +1 -1
- package/dist/types/AnimationMode.js +1 -1
- package/dist/types/CSSColor.d.ts +0 -1
- package/dist/types/CSSColor.js +0 -1
- package/dist/types/CSSColor.js.map +1 -1
- package/dist/types/CalendarType.d.ts +1 -1
- package/dist/types/CalendarType.js +1 -1
- package/dist/types/Float.d.ts +0 -1
- package/dist/types/Float.js +0 -1
- package/dist/types/Float.js.map +1 -1
- package/dist/types/Integer.d.ts +0 -1
- package/dist/types/Integer.js +0 -1
- package/dist/types/Integer.js.map +1 -1
- package/dist/types/InvisibleMessageMode.d.ts +1 -1
- package/dist/types/InvisibleMessageMode.js +1 -1
- package/dist/types/ItemNavigationBehavior.d.ts +1 -1
- package/dist/types/ItemNavigationBehavior.js +1 -1
- package/dist/types/NavigationMode.d.ts +1 -1
- package/dist/types/NavigationMode.js +1 -1
- package/dist/types/ValueState.d.ts +1 -1
- package/dist/types/ValueState.js +1 -1
- package/dist/updateShadowRoot.js +4 -0
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/AriaLabelHelper.d.ts +10 -1
- package/dist/util/AriaLabelHelper.js +135 -8
- package/dist/util/AriaLabelHelper.js.map +1 -1
- package/dist/util/FocusableElements.js +11 -2
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/PopupUtils.d.ts +1 -1
- package/dist/util/PopupUtils.js +6 -6
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +8 -10
- package/lib/generate-styles/index.js +10 -5
- package/package-scripts.js +9 -5
- package/package.json +3 -3
- package/src/Boot.ts +20 -5
- package/src/Device.ts +113 -34
- package/src/InitialConfiguration.ts +1 -1
- package/src/UI5Element.ts +32 -28
- package/src/asset-registries/Icons.ts +26 -27
- package/src/asset-registries/Illustrations.ts +1 -1
- package/src/asset-registries/Themes.ts +5 -0
- package/src/assets-meta/IconCollectionsAlias.ts +32 -9
- package/src/config/FormatSettings.ts +16 -2
- package/src/config/Icons.ts +92 -25
- package/src/config/RTL.ts +4 -0
- package/src/decorators/customElement.ts +45 -5
- package/src/decorators/event.ts +6 -6
- package/src/decorators/property.ts +6 -6
- package/src/decorators/slot.ts +7 -7
- package/src/delegate/ResizeHandler.ts +7 -2
- package/src/delegate/ScrollEnablement.ts +6 -3
- package/src/features/F6Navigation.ts +98 -44
- package/src/features/LegacyDateFormats.ts +40 -0
- package/src/features/OpenUI5Support.ts +5 -0
- package/src/generated/css/BusyIndicator.css.ts +9 -0
- package/src/generated/css/FontFace.css.ts +9 -0
- package/src/generated/css/OverrideFontFace.css.ts +9 -0
- package/src/generated/css/SystemCSSVars.css.ts +9 -0
- package/src/getSharedResource.ts +10 -1
- package/src/global.d.ts +38 -0
- package/src/renderer/LitRenderer.ts +2 -2
- package/src/theming/CustomStyle.ts +7 -5
- package/src/theming/getEffectiveLinksHrefs.ts +1 -1
- package/src/theming/getStylesString.ts +1 -1
- package/src/types/AnimationMode.ts +1 -1
- package/src/types/CSSColor.ts +0 -1
- package/src/types/CalendarType.ts +1 -1
- package/src/types/Float.ts +0 -1
- package/src/types/Integer.ts +0 -1
- package/src/types/InvisibleMessageMode.ts +1 -1
- package/src/types/ItemNavigationBehavior.ts +1 -1
- package/src/types/NavigationMode.ts +1 -1
- package/src/types/ValueState.ts +1 -1
- package/src/updateShadowRoot.ts +5 -0
- package/src/util/AriaLabelHelper.ts +167 -12
- package/src/util/FocusableElements.ts +12 -2
- package/src/util/PopupUtils.ts +7 -9
- package/tsconfig.json +1 -1
- package/dist/assets/bundle.esm.c2213b33.js +0 -56
- package/dist/decorators/fastNavigation.d.ts +0 -7
- package/dist/decorators/fastNavigation.js +0 -13
- package/dist/decorators/fastNavigation.js.map +0 -1
- package/dist/decorators/languageAware.d.ts +0 -7
- package/dist/decorators/languageAware.js +0 -13
- package/dist/decorators/languageAware.js.map +0 -1
- package/dist/decorators/themeAware.d.ts +0 -7
- package/dist/decorators/themeAware.js +0 -13
- package/dist/decorators/themeAware.js.map +0 -1
- package/src/decorators/fastNavigation.ts +0 -14
- package/src/decorators/languageAware.ts +0 -14
- package/src/decorators/themeAware.ts +0 -14
|
@@ -3,6 +3,7 @@ import { isF6Next, isF6Previous } from "../Keys.js";
|
|
|
3
3
|
import { instanceOfUI5Element } from "../UI5Element.js";
|
|
4
4
|
import { getFirstFocusableElement } from "../util/FocusableElements.js";
|
|
5
5
|
import getFastNavigationGroups from "../util/getFastNavigationGroups.js";
|
|
6
|
+
import isElementClickable from "../util/isElementClickable.js";
|
|
6
7
|
|
|
7
8
|
class F6Navigation {
|
|
8
9
|
static _instance: F6Navigation;
|
|
@@ -19,56 +20,61 @@ class F6Navigation {
|
|
|
19
20
|
document.addEventListener("keydown", this.keydownHandler);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
async
|
|
23
|
-
|
|
24
|
-
this.updateGroups();
|
|
23
|
+
async groupElementToFocus(nextElement: HTMLElement) {
|
|
24
|
+
const nextElementDomRef = instanceOfUI5Element(nextElement) ? nextElement.getDomRef() : nextElement;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
if (nextElementDomRef) {
|
|
27
|
+
if (isElementClickable(nextElementDomRef)) {
|
|
28
|
+
return nextElementDomRef;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
const elementToFocus = await getFirstFocusableElement(nextElementDomRef);
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (this.selectedGroup) {
|
|
35
|
-
nextIndex = this.groups.indexOf(this.selectedGroup);
|
|
33
|
+
if (elementToFocus) {
|
|
34
|
+
return elementToFocus;
|
|
36
35
|
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async findNextFocusableGroupElement(currentIndex: number) {
|
|
40
|
+
let elementToFocus;
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
/* eslint-disable no-await-in-loop */
|
|
43
|
+
for (let index = 0; index < this.groups.length; index++) {
|
|
44
|
+
let nextElement;
|
|
45
|
+
|
|
46
|
+
if (currentIndex > -1) {
|
|
47
|
+
if (currentIndex + 1 >= this.groups.length) {
|
|
48
|
+
currentIndex = 0;
|
|
49
|
+
nextElement = this.groups[currentIndex];
|
|
41
50
|
} else {
|
|
42
|
-
|
|
51
|
+
currentIndex += 1;
|
|
52
|
+
nextElement = this.groups[currentIndex];
|
|
43
53
|
}
|
|
44
54
|
} else {
|
|
45
|
-
|
|
55
|
+
currentIndex = 0;
|
|
56
|
+
nextElement = this.groups[currentIndex];
|
|
46
57
|
}
|
|
47
58
|
|
|
48
|
-
|
|
59
|
+
elementToFocus = await this.groupElementToFocus(nextElement);
|
|
49
60
|
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
elementToFocus?.focus();
|
|
61
|
+
if (elementToFocus) {
|
|
62
|
+
break;
|
|
53
63
|
}
|
|
54
64
|
}
|
|
65
|
+
/* eslint-enable no-await-in-loop */
|
|
55
66
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (this.groups.length < 1) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
67
|
+
return elementToFocus;
|
|
68
|
+
}
|
|
62
69
|
|
|
63
|
-
|
|
70
|
+
async findPreviousFocusableGroupElement(currentIndex: number) {
|
|
71
|
+
let elementToFocus;
|
|
64
72
|
|
|
65
|
-
|
|
73
|
+
/* eslint-disable no-await-in-loop */
|
|
74
|
+
for (let index = 0; index < this.groups.length; index++) {
|
|
66
75
|
let nextElement;
|
|
67
|
-
if (this.selectedGroup) {
|
|
68
|
-
nextIndex = this.groups.indexOf(this.selectedGroup);
|
|
69
|
-
}
|
|
70
76
|
|
|
71
|
-
if (
|
|
77
|
+
if (currentIndex > 0) {
|
|
72
78
|
// Handle the situation where the first focusable element of two neighbor groups is the same
|
|
73
79
|
// For example:
|
|
74
80
|
// <ui5-flexible-column-layout>
|
|
@@ -77,22 +83,70 @@ class F6Navigation {
|
|
|
77
83
|
// </ui5-list>
|
|
78
84
|
// </ui5-flexible-column-layout>
|
|
79
85
|
// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)
|
|
86
|
+
const firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);
|
|
87
|
+
const shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
const shouldSkipParent = firstFocusable === await getFirstFocusableElement(this.groups[nextIndex], true);
|
|
89
|
+
currentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;
|
|
83
90
|
|
|
84
|
-
|
|
91
|
+
if (currentIndex < 0) {
|
|
92
|
+
currentIndex = this.groups.length - 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
nextElement = this.groups[currentIndex];
|
|
85
96
|
} else {
|
|
86
|
-
|
|
97
|
+
currentIndex = this.groups.length - 1;
|
|
98
|
+
nextElement = this.groups[currentIndex];
|
|
87
99
|
}
|
|
88
100
|
|
|
89
|
-
|
|
101
|
+
elementToFocus = await this.groupElementToFocus(nextElement);
|
|
90
102
|
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
elementToFocus?.focus();
|
|
103
|
+
if (elementToFocus) {
|
|
104
|
+
break;
|
|
94
105
|
}
|
|
95
106
|
}
|
|
107
|
+
/* eslint-enable no-await-in-loop */
|
|
108
|
+
|
|
109
|
+
return elementToFocus;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async _keydownHandler(event: KeyboardEvent) {
|
|
113
|
+
const forward = isF6Next(event);
|
|
114
|
+
const backward = isF6Previous(event);
|
|
115
|
+
if (!(forward || backward)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
this.updateGroups();
|
|
120
|
+
|
|
121
|
+
if (this.groups.length < 1) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
|
|
127
|
+
let elementToFocus;
|
|
128
|
+
|
|
129
|
+
if (this.groups.length === 0) {
|
|
130
|
+
elementToFocus = await this.groupElementToFocus(this.groups[0]);
|
|
131
|
+
|
|
132
|
+
return elementToFocus?.focus();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let currentIndex = -1;
|
|
136
|
+
|
|
137
|
+
if (this.selectedGroup) {
|
|
138
|
+
currentIndex = this.groups.indexOf(this.selectedGroup);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (forward) {
|
|
142
|
+
elementToFocus = await this.findNextFocusableGroupElement(currentIndex);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (backward) {
|
|
146
|
+
elementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
elementToFocus?.focus();
|
|
96
150
|
}
|
|
97
151
|
|
|
98
152
|
removeEventListeners() {
|
|
@@ -109,19 +163,19 @@ class F6Navigation {
|
|
|
109
163
|
let element: Element | null | ParentNode = this.deepActive(root);
|
|
110
164
|
|
|
111
165
|
while (element && (element as Element).getAttribute("data-sap-ui-fastnavgroup") !== "true" && element !== htmlElement) {
|
|
112
|
-
|
|
166
|
+
element = element.parentElement ? element.parentNode : (element.parentNode as ShadowRoot).host;
|
|
113
167
|
}
|
|
114
168
|
|
|
115
169
|
this.selectedGroup = element as HTMLElement;
|
|
116
|
-
|
|
170
|
+
}
|
|
117
171
|
|
|
118
|
-
|
|
172
|
+
deepActive(root: DocumentOrShadowRoot): Element | null {
|
|
119
173
|
if (root.activeElement && root.activeElement.shadowRoot) {
|
|
120
|
-
|
|
174
|
+
return this.deepActive(root.activeElement.shadowRoot);
|
|
121
175
|
}
|
|
122
176
|
|
|
123
177
|
return root.activeElement;
|
|
124
|
-
|
|
178
|
+
}
|
|
125
179
|
|
|
126
180
|
destroy() {
|
|
127
181
|
this.removeEventListeners();
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getFormatSettings } from "../InitialConfiguration.js";
|
|
2
|
+
import type { FormatSettings } from "../config/FormatSettings.js";
|
|
3
|
+
import { registerFeature } from "../FeaturesRegistry.js";
|
|
4
|
+
|
|
5
|
+
// Allows specifying the customizing data for Islamic calendar support
|
|
6
|
+
// dateFormat - The date format
|
|
7
|
+
// islamicMonthStart - The Islamic date in string format // 14360101
|
|
8
|
+
// gregDate - Corresponding Gregorian date to the Islamic one in string format // 20141024
|
|
9
|
+
type IslamicToGregorianMapping = {
|
|
10
|
+
dateFormat: string,
|
|
11
|
+
islamicMonthStart: string,
|
|
12
|
+
gregDate: string,
|
|
13
|
+
};
|
|
14
|
+
type LegacyDateCalendarCustomizing = Array<IslamicToGregorianMapping>;
|
|
15
|
+
|
|
16
|
+
let formatSettings: FormatSettings;
|
|
17
|
+
|
|
18
|
+
class LegacyDateFormats {
|
|
19
|
+
/**
|
|
20
|
+
* Returns the currently set customizing data for Islamic calendar support
|
|
21
|
+
*
|
|
22
|
+
* @return {object[]} Returns an array that contains the customizing data.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
static getLegacyDateCalendarCustomizing(this: void): LegacyDateCalendarCustomizing {
|
|
26
|
+
if (formatSettings === undefined) {
|
|
27
|
+
formatSettings = getFormatSettings();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return formatSettings.legacyDateCalendarCustomizing || [];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
registerFeature("LegacyDateFormats", LegacyDateFormats);
|
|
35
|
+
|
|
36
|
+
export default LegacyDateFormats;
|
|
37
|
+
export type {
|
|
38
|
+
FormatSettings,
|
|
39
|
+
LegacyDateCalendarCustomizing,
|
|
40
|
+
};
|
|
@@ -2,6 +2,7 @@ import { registerFeature } from "../FeaturesRegistry.js";
|
|
|
2
2
|
import { setTheme } from "../config/Theme.js";
|
|
3
3
|
import { getCurrentZIndex } from "../util/PopupUtils.js";
|
|
4
4
|
import { CLDRData } from "../asset-registries/LocaleData.js";
|
|
5
|
+
import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
|
|
5
6
|
|
|
6
7
|
type OpenUI5Popup = {
|
|
7
8
|
setInitialZIndex: (zIndex: number) => void,
|
|
@@ -22,6 +23,9 @@ type OpenUI5CoreConfiguration = {
|
|
|
22
23
|
getRTL: () => string,
|
|
23
24
|
getCalendarType: () => string,
|
|
24
25
|
getLocale: () => string,
|
|
26
|
+
getFormatSettings: () => {
|
|
27
|
+
getLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;
|
|
28
|
+
}
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
type LocaleData = {
|
|
@@ -76,6 +80,7 @@ class OpenUI5Support {
|
|
|
76
80
|
calendarType: config.getCalendarType(),
|
|
77
81
|
formatSettings: {
|
|
78
82
|
firstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,
|
|
83
|
+
legacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),
|
|
79
84
|
},
|
|
80
85
|
};
|
|
81
86
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StyleData } from "../../types.js";
|
|
2
|
+
|
|
3
|
+
const styleData: StyleData = {
|
|
4
|
+
packageName: "@ui5/webcomponents-base",
|
|
5
|
+
fileName: "BusyIndicator.css",
|
|
6
|
+
content: `.busy-indicator-wrapper{position:relative;height:100%;width:100%}.busy-indicator-overlay{display:var(--ui5_web_components_busy_indicator_display);position:absolute;inset:0;background:var(--ui5_web_components_busy_indicator_background-color);z-index:99}.busy-indicator-busy-area{display:var(--ui5_web_components_busy_indicator_display);position:absolute;z-index:99;inset:0;justify-content:center;align-items:center;background-color:inherit;flex-direction:column;color:var(--_ui5_busy_indicator_color)}:host([__is-busy]) .busy-indicator-wrapper>:not(.busy-indicator-busy-area):not(.busy-indicator-overlay):not([busy-indicator-before-span]){--ui5_web_components_busy_indicator_display:none}.busy-indicator-busy-area:focus{outline:var(--_ui5_busy_indicator_focus_outline);outline-offset:-.125rem}.busy-indicator-circle{width:1rem;height:1rem;display:inline-block;background-color:currentColor;border-radius:50%}.circle-animation-0{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11)}.circle-animation-1{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.2s}.circle-animation-2{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.4s}.sapUiLocalBusy{--ui5_web_components_busy_indicator_display:none}.busy-indicator-wrapper [ui5-busy-indicator]{display:none}@keyframes grow{0%,100%,50%{-webkit-transform:scale(.5);-moz-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}25%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}`,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default styleData;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StyleData } from "../../types.js";
|
|
2
|
+
|
|
3
|
+
const styleData: StyleData = {
|
|
4
|
+
packageName: "@ui5/webcomponents-base",
|
|
5
|
+
fileName: "FontFace.css",
|
|
6
|
+
content: `@font-face{font-family:"72";font-style:normal;font-weight:400;src:local("72"),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72full";font-style:normal;font-weight:400;src:local('72-full'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72";font-style:normal;font-weight:700;src:local('72-Bold'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72full";font-style:normal;font-weight:700;src:local('72-Bold-full'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Bold';font-style:normal;src:local('72-Bold'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Boldfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Light';font-style:normal;src:local('72-Light'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Lightfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72Black";font-style:bold;font-weight:900;src:local('72Black'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Black.woff2?ui5-webcomponents) format("woff2")}`,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default styleData;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StyleData } from "../../types.js";
|
|
2
|
+
|
|
3
|
+
const styleData: StyleData = {
|
|
4
|
+
packageName: "@ui5/webcomponents-base",
|
|
5
|
+
fileName: "OverrideFontFace.css",
|
|
6
|
+
content: `@font-face{font-family:'72override';unicode-range:U+0102-0103,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EB7,U+1EB8-1EC7,U+1EC8-1ECB,U+1ECC-1EE3,U+1EE4-1EF1,U+1EF4-1EF7;src:local('Arial'),local('Helvetica'),local('sans-serif')}`,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default styleData;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StyleData } from "../../types.js";
|
|
2
|
+
|
|
3
|
+
const styleData: StyleData = {
|
|
4
|
+
packageName: "@ui5/webcomponents-base",
|
|
5
|
+
fileName: "SystemCSSVars.css",
|
|
6
|
+
content: `:root{--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5_content_density:compact}[dir=rtl]{--_ui5_dir:rtl}[dir=ltr]{--_ui5_dir:ltr}`,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default styleData;
|
package/src/getSharedResource.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import getSingletonElementInstance from "./util/getSingletonElementInstance.js";
|
|
2
2
|
|
|
3
|
-
const getSharedResourcesInstance = () =>
|
|
3
|
+
const getSharedResourcesInstance = (): Record<string, unknown> | null => {
|
|
4
|
+
if (typeof document === "undefined") {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
return getSingletonElementInstance("ui5-shared-resources", document.head) as unknown as Record<string, unknown>;
|
|
8
|
+
};
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
* Use this method to initialize/get resources that you would like to be shared among UI5 Web Components runtime instances.
|
|
@@ -15,6 +20,10 @@ const getSharedResource = <T>(namespace: string, initialValue: T): T => {
|
|
|
15
20
|
const parts = namespace.split(".");
|
|
16
21
|
let current = getSharedResourcesInstance() as Record<string, any>;
|
|
17
22
|
|
|
23
|
+
if (!current) {
|
|
24
|
+
return initialValue;
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
for (let i = 0; i < parts.length; i++) {
|
|
19
28
|
const part = parts[i];
|
|
20
29
|
const lastPart = i === parts.length - 1;
|
package/src/global.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
|
|
5
|
+
type VersionInfo = {
|
|
6
|
+
version: string,
|
|
7
|
+
major: number,
|
|
8
|
+
minor: number,
|
|
9
|
+
patch: number,
|
|
10
|
+
suffix: string,
|
|
11
|
+
isNext: boolean,
|
|
12
|
+
buildTime: number,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface Window {
|
|
16
|
+
sap: any;
|
|
17
|
+
chrome: any;
|
|
18
|
+
v8: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module "*generated/AssetParameters.js" {
|
|
22
|
+
const DEFAULT_THEME: string;
|
|
23
|
+
const DEFAULT_LANGUAGE: string;
|
|
24
|
+
const DEFAULT_LOCALE: string;
|
|
25
|
+
const SUPPORTED_LOCALES: Array<string>;
|
|
26
|
+
export {
|
|
27
|
+
DEFAULT_THEME,
|
|
28
|
+
DEFAULT_LANGUAGE,
|
|
29
|
+
DEFAULT_LOCALE,
|
|
30
|
+
SUPPORTED_LOCALES,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module "*generated/VersionInfo.js" {
|
|
35
|
+
const content: VersionInfo;
|
|
36
|
+
export default content;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
html,
|
|
4
4
|
svg,
|
|
5
5
|
TemplateResult,
|
|
6
|
-
RenderOptions,
|
|
7
6
|
} from "lit-html";
|
|
8
7
|
|
|
9
8
|
import { getFeature } from "../FeaturesRegistry.js";
|
|
10
9
|
import type { LitStatic } from "../CustomElementsScope.js";
|
|
11
10
|
import type OpenUI5Enablement from "../features/OpenUI5Enablement.js";
|
|
12
11
|
import type UI5Element from "../UI5Element.js";
|
|
12
|
+
import type { Renderer, RendererOptions } from "../UI5Element.js";
|
|
13
13
|
import { TemplateFunctionResult } from "./executeTemplate.js";
|
|
14
14
|
|
|
15
15
|
const effectiveHtml = (strings: TemplateStringsArray, ...values: Array<unknown>) => {
|
|
@@ -24,7 +24,7 @@ const effectiveSvg = (strings: TemplateStringsArray, ...values: Array<unknown>)
|
|
|
24
24
|
return fn(strings, ...values);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const litRender = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, styleStrOrHrefsArr: string | Array<string> | undefined, forStaticArea: boolean, options:
|
|
27
|
+
const litRender: Renderer = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, styleStrOrHrefsArr: string | Array<string> | undefined, forStaticArea: boolean, options: RendererOptions) => {
|
|
28
28
|
const openUI5Enablement = getFeature<typeof OpenUI5Enablement>("OpenUI5Enablement");
|
|
29
29
|
if (openUI5Enablement && !forStaticArea) {
|
|
30
30
|
templateResult = openUI5Enablement.wrapTemplateResultInBusyMarkup(effectiveHtml, options.host as UI5Element, templateResult as TemplateResult);
|
|
@@ -4,22 +4,22 @@ import EventProvider from "../EventProvider.js";
|
|
|
4
4
|
|
|
5
5
|
type CustomCSSChangeCallback = (tag: string) => void;
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const getEventProvider = () => getSharedResource("CustomStyle.eventProvider", new EventProvider<string, void>());
|
|
8
8
|
const CUSTOM_CSS_CHANGE = "CustomCSSChange";
|
|
9
9
|
|
|
10
10
|
const attachCustomCSSChange = (listener: CustomCSSChangeCallback) => {
|
|
11
|
-
|
|
11
|
+
getEventProvider().attachEvent(CUSTOM_CSS_CHANGE, listener);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const detachCustomCSSChange = (listener: CustomCSSChangeCallback) => {
|
|
15
|
-
|
|
15
|
+
getEventProvider().detachEvent(CUSTOM_CSS_CHANGE, listener);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const fireCustomCSSChange = (tag: string) => {
|
|
19
|
-
return
|
|
19
|
+
return getEventProvider().fireEvent(CUSTOM_CSS_CHANGE, tag);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const getCustomCSSFor = () => getSharedResource<Record<string, Array<string>>>("CustomStyle.customCSSFor", {});
|
|
23
23
|
|
|
24
24
|
// Listen to the eventProvider, in case other copies of this CustomStyle module fire this
|
|
25
25
|
// event, and this copy would therefore need to reRender the ui5 webcomponents; but
|
|
@@ -32,6 +32,7 @@ attachCustomCSSChange((tag: string) => {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
const addCustomCSS = (tag: string, css: string) => {
|
|
35
|
+
const customCSSFor = getCustomCSSFor();
|
|
35
36
|
if (!customCSSFor[tag]) {
|
|
36
37
|
customCSSFor[tag] = [];
|
|
37
38
|
}
|
|
@@ -51,6 +52,7 @@ const addCustomCSS = (tag: string, css: string) => {
|
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
const getCustomCSS = (tag: string) => {
|
|
55
|
+
const customCSSFor = getCustomCSSFor();
|
|
54
56
|
return customCSSFor[tag] ? customCSSFor[tag].join("") : "";
|
|
55
57
|
};
|
|
56
58
|
|
|
@@ -2,7 +2,7 @@ import { getUrl } from "../CSP.js";
|
|
|
2
2
|
import { getFeature } from "../FeaturesRegistry.js";
|
|
3
3
|
import type UI5Element from "../UI5Element.js";
|
|
4
4
|
import type OpenUI5Enablement from "../features/OpenUI5Enablement.js";
|
|
5
|
-
import { ComponentStylesData, StyleDataCSP } from "../types.js";
|
|
5
|
+
import type { ComponentStylesData, StyleDataCSP } from "../types.js";
|
|
6
6
|
|
|
7
7
|
const MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers
|
|
8
8
|
|
package/src/types/CSSColor.ts
CHANGED
package/src/types/Float.ts
CHANGED
package/src/types/Integer.ts
CHANGED
package/src/types/ValueState.ts
CHANGED
package/src/updateShadowRoot.ts
CHANGED
|
@@ -31,6 +31,11 @@ const updateShadowRoot = (element: UI5Element, forStaticArea = false) => {
|
|
|
31
31
|
styleStrOrHrefsArr = getEffectiveStyle(ctor, forStaticArea);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
if (ctor.renderer) {
|
|
35
|
+
ctor.renderer(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, { host: element });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
ctor.render(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, { host: element });
|
|
35
40
|
};
|
|
36
41
|
|