@ui5/webcomponents-base 2.14.0-rc.6 → 2.14.0-rc.7
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/CHANGELOG.md +13 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/Boot.js +2 -0
- package/dist/Boot.js.map +1 -1
- package/dist/ScrollbarStyles.d.ts +2 -0
- package/dist/ScrollbarStyles.js +9 -0
- package/dist/ScrollbarStyles.js.map +1 -0
- package/dist/css/ScrollbarStyles.css +3 -0
- package/dist/custom-elements-internal.json +15 -15
- package/dist/custom-elements.json +15 -15
- package/dist/features/OpenUI5Support.d.ts +2 -1
- package/dist/features/OpenUI5Support.js +2 -2
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/patchPopup.d.ts +6 -2
- package/dist/features/patchPopup.js +28 -8
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/ScrollbarStyles.css.d.ts +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js.map +1 -0
- package/dist/prod/Boot.js +1 -1
- package/dist/prod/Boot.js.map +3 -3
- package/dist/prod/ScrollbarStyles.js +2 -0
- package/dist/prod/ScrollbarStyles.js.map +7 -0
- package/dist/prod/features/OpenUI5Support.js.map +3 -3
- package/dist/prod/features/patchPopup.js +1 -1
- package/dist/prod/features/patchPopup.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/prod/generated/css/ScrollbarStyles.css.js.map +7 -0
- package/dist/prod/util/SelectionAssistant.js +1 -1
- package/dist/prod/util/SelectionAssistant.js.map +3 -3
- package/dist/util/SelectionAssistant.js +0 -8
- package/dist/util/SelectionAssistant.js.map +1 -1
- package/package.json +3 -3
- package/src/css/ScrollbarStyles.css +3 -0
- package/dist/prod/util/getEffectiveScrollbarStyle.js +0 -28
- package/dist/prod/util/getEffectiveScrollbarStyle.js.map +0 -7
- package/dist/util/getEffectiveScrollbarStyle.d.ts +0 -2
- package/dist/util/getEffectiveScrollbarStyle.js +0 -36
- package/dist/util/getEffectiveScrollbarStyle.js.map +0 -1
package/dist/Boot.js
CHANGED
|
@@ -2,6 +2,7 @@ import whenDOMReady from "./util/whenDOMReady.js";
|
|
|
2
2
|
import EventProvider from "./EventProvider.js";
|
|
3
3
|
import insertFontFace from "./FontFace.js";
|
|
4
4
|
import insertSystemCSSVars from "./SystemCSSVars.js";
|
|
5
|
+
import insertScrollbarStyles from "./ScrollbarStyles.js";
|
|
5
6
|
import { getTheme } from "./config/Theme.js";
|
|
6
7
|
import applyTheme from "./theming/applyTheme.js";
|
|
7
8
|
import { registerCurrentRuntime } from "./Runtimes.js";
|
|
@@ -52,6 +53,7 @@ const boot = async () => {
|
|
|
52
53
|
openUI5Support && openUI5Support.attachListeners();
|
|
53
54
|
insertFontFace();
|
|
54
55
|
insertSystemCSSVars();
|
|
56
|
+
insertScrollbarStyles();
|
|
55
57
|
fixSafariActiveState();
|
|
56
58
|
resolve();
|
|
57
59
|
booted = true;
|
package/dist/Boot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Boot.js","sourceRoot":"","sources":["../src/Boot.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,cAAc,MAAM,eAAe,CAAC;AAC3C,OAAO,mBAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAA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Y,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;QAED,MAAM,YAAY,EAAE,CAAC;QACrB,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC7B,cAAc,IAAI,cAAc,CAAC,eAAe,EAAE,CAAC;QACnD,cAAc,EAAE,CAAC;QACjB,mBAAmB,EAAE,CAAC;QACtB,oBAAoB,EAAE,CAAC;QAEvB,OAAO,EAAE,CAAC;QAEV,MAAM,GAAG,IAAI,CAAC;QACd,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,WAAW,GAAG,IAAI,OAAO,CAAC,YAAiD,CAAC,CAAC;IAC7E,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC3C,IAAI,MAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,EAAE,CAAC,CAAC,qDAAqD;QAC1F,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxB,CAAC;AACF,CAAC,CAAC;AAEF,OAAO,EACN,IAAI,EACJ,UAAU,EACV,QAAQ,GACR,CAAC","sourcesContent":["import whenDOMReady from \"./util/whenDOMReady.js\";\nimport EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport type { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\nimport fixSafariActiveState from \"./util/fixSafariActiveState.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\t\tfixSafariActiveState();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\teventProvider.fireEvent(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachBoot,\n\tisBooted,\n};\n"]}
|
|
1
|
+
{"version":3,"file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EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport insertScrollbarStyles from \"./ScrollbarStyles.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport type { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\nimport fixSafariActiveState from \"./util/fixSafariActiveState.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\t\tinsertScrollbarStyles();\n\t\tfixSafariActiveState();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\teventProvider.fireEvent(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachBoot,\n\tisBooted,\n};\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { hasStyle, createStyle } from "./ManagedStyles.js";
|
|
2
|
+
import scrollbarStyles from "./generated/css/ScrollbarStyles.css.js";
|
|
3
|
+
const insertScrollbarStyles = () => {
|
|
4
|
+
if (!hasStyle("data-ui5-scrollbar-styles")) {
|
|
5
|
+
createStyle(scrollbarStyles, "data-ui5-scrollbar-styles");
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export default insertScrollbarStyles;
|
|
9
|
+
//# sourceMappingURL=ScrollbarStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollbarStyles.js","sourceRoot":"","sources":["../src/ScrollbarStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,eAAe,MAAM,wCAAwC,CAAC;AAErE,MAAM,qBAAqB,GAAG,GAAG,EAAE;IAClC,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC;QAC5C,WAAW,CAAC,eAAe,EAAE,2BAA2B,CAAC,CAAC;IAC3D,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import { hasStyle, createStyle } from \"./ManagedStyles.js\";\nimport scrollbarStyles from \"./generated/css/ScrollbarStyles.css.js\";\n\nconst insertScrollbarStyles = () => {\n\tif (!hasStyle(\"data-ui5-scrollbar-styles\")) {\n\t\tcreateStyle(scrollbarStyles, \"data-ui5-scrollbar-styles\");\n\t}\n};\n\nexport default insertScrollbarStyles;\n"]}
|
|
@@ -1602,21 +1602,6 @@
|
|
|
1602
1602
|
}
|
|
1603
1603
|
]
|
|
1604
1604
|
},
|
|
1605
|
-
{
|
|
1606
|
-
"kind": "javascript-module",
|
|
1607
|
-
"path": "dist/util/getEffectiveScrollbarStyle.js",
|
|
1608
|
-
"declarations": [],
|
|
1609
|
-
"exports": [
|
|
1610
|
-
{
|
|
1611
|
-
"kind": "js",
|
|
1612
|
-
"name": "default",
|
|
1613
|
-
"declaration": {
|
|
1614
|
-
"name": "getEffectiveScrollbarStyle",
|
|
1615
|
-
"module": "dist/util/getEffectiveScrollbarStyle.js"
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1618
|
-
]
|
|
1619
|
-
},
|
|
1620
1605
|
{
|
|
1621
1606
|
"kind": "javascript-module",
|
|
1622
1607
|
"path": "dist/util/getFastNavigationGroups.js",
|
|
@@ -2037,6 +2022,21 @@
|
|
|
2037
2022
|
"declarations": [],
|
|
2038
2023
|
"exports": []
|
|
2039
2024
|
},
|
|
2025
|
+
{
|
|
2026
|
+
"kind": "javascript-module",
|
|
2027
|
+
"path": "dist/ScrollbarStyles.js",
|
|
2028
|
+
"declarations": [],
|
|
2029
|
+
"exports": [
|
|
2030
|
+
{
|
|
2031
|
+
"kind": "js",
|
|
2032
|
+
"name": "default",
|
|
2033
|
+
"declaration": {
|
|
2034
|
+
"name": "insertScrollbarStyles",
|
|
2035
|
+
"module": "dist/ScrollbarStyles.js"
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
]
|
|
2039
|
+
},
|
|
2040
2040
|
{
|
|
2041
2041
|
"kind": "javascript-module",
|
|
2042
2042
|
"path": "dist/SystemCSSVars.js",
|
|
@@ -1317,21 +1317,6 @@
|
|
|
1317
1317
|
}
|
|
1318
1318
|
]
|
|
1319
1319
|
},
|
|
1320
|
-
{
|
|
1321
|
-
"kind": "javascript-module",
|
|
1322
|
-
"path": "dist/util/getEffectiveScrollbarStyle.js",
|
|
1323
|
-
"declarations": [],
|
|
1324
|
-
"exports": [
|
|
1325
|
-
{
|
|
1326
|
-
"kind": "js",
|
|
1327
|
-
"name": "default",
|
|
1328
|
-
"declaration": {
|
|
1329
|
-
"name": "getEffectiveScrollbarStyle",
|
|
1330
|
-
"module": "dist/util/getEffectiveScrollbarStyle.js"
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
]
|
|
1334
|
-
},
|
|
1335
1320
|
{
|
|
1336
1321
|
"kind": "javascript-module",
|
|
1337
1322
|
"path": "dist/util/getFastNavigationGroups.js",
|
|
@@ -1752,6 +1737,21 @@
|
|
|
1752
1737
|
"declarations": [],
|
|
1753
1738
|
"exports": []
|
|
1754
1739
|
},
|
|
1740
|
+
{
|
|
1741
|
+
"kind": "javascript-module",
|
|
1742
|
+
"path": "dist/ScrollbarStyles.js",
|
|
1743
|
+
"declarations": [],
|
|
1744
|
+
"exports": [
|
|
1745
|
+
{
|
|
1746
|
+
"kind": "js",
|
|
1747
|
+
"name": "default",
|
|
1748
|
+
"declaration": {
|
|
1749
|
+
"name": "insertScrollbarStyles",
|
|
1750
|
+
"module": "dist/ScrollbarStyles.js"
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
]
|
|
1754
|
+
},
|
|
1755
1755
|
{
|
|
1756
1756
|
"kind": "javascript-module",
|
|
1757
1757
|
"path": "dist/SystemCSSVars.js",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PopupInfo } from "./patchPopup.js";
|
|
1
2
|
import type { CLDRData } from "../asset-registries/LocaleData.js";
|
|
2
3
|
import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
|
|
3
4
|
declare class OpenUI5Support {
|
|
@@ -31,7 +32,7 @@ declare class OpenUI5Support {
|
|
|
31
32
|
static _listenForThemeChange(): void;
|
|
32
33
|
static attachListeners(): void;
|
|
33
34
|
static cssVariablesLoaded(): boolean | undefined;
|
|
34
|
-
static addOpenedPopup(
|
|
35
|
+
static addOpenedPopup(popupInfo: PopupInfo): void;
|
|
35
36
|
static removeOpenedPopup(popup: object): void;
|
|
36
37
|
static getTopmostPopup(): object;
|
|
37
38
|
}
|
|
@@ -141,8 +141,8 @@ class OpenUI5Support {
|
|
|
141
141
|
// The file name is "css_variables.css" until 1.127 and "library.css" from 1.127 onwards
|
|
142
142
|
return !!link.href.match(/\/css(-|_)variables\.css/) || !!link.href.match(/\/library\.css/);
|
|
143
143
|
}
|
|
144
|
-
static addOpenedPopup(
|
|
145
|
-
addOpenedPopup(
|
|
144
|
+
static addOpenedPopup(popupInfo) {
|
|
145
|
+
addOpenedPopup(popupInfo);
|
|
146
146
|
}
|
|
147
147
|
static removeOpenedPopup(popup) {
|
|
148
148
|
removeOpenedPopup(popup);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA+D9C,MAAM,cAAc;IACnB,MAAM,CAAC,mBAAmB;QACzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,CAAC,2DAA2D;QACzE,CAAC;QACD,MAAM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AG,EAAE;gBAC5B,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACzC,OAAO;QACR,CAAC;QAED,cAAc,CAAC,qBAAqB,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACxB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACzC,OAAO;QACR,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,0BAA0B,CAAoB,CAAC,CAAC,yCAAyC;QACvJ,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACd,CAAC;QAED,wFAAwF;QACxF,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC7F,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,KAAa;QAClC,cAAc,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,KAAa;QACrC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,OAAO,eAAe,EAAE,CAAC;IAC1B,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n} from \"./patchPopup.js\";\nimport type { OpenUI5Popup } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport type { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tif (!window.sap.ui!.version) {\n\t\t\treturn true; // sap.ui.version will be removed in newer OpenUI5 versions\n\t\t}\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic initPromise?: Promise<void>;\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tif (!OpenUI5Support.initPromise) {\n\t\t\tOpenUI5Support.initPromise = new Promise<void>(resolve => {\n\t\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\t\tconst callback = () => {\n\t\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\t\tpatchPopup(Popup);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\t\tawait Core.ready();\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn OpenUI5Support.initPromise;\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The file name is \"css_variables.css\" until 1.127 and \"library.css\" from 1.127 onwards\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/) || !!link.href.match(/\\/library\\.css/);\n\t}\n\n\tstatic addOpenedPopup(popup: object) {\n\t\taddOpenedPopup(popup);\n\t}\n\n\tstatic removeOpenedPopup(popup: object) {\n\t\tremoveOpenedPopup(popup);\n\t}\n\n\tstatic getTopmostPopup() {\n\t\treturn getTopmostPopup();\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
|
|
1
|
+
{"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA+D9C,MAAM,cAAc;IACnB,MAAM,CAAC,mBAAmB;QACzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,CAAC,2DAA2D;QACzE,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAiB,CAAC;QACjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,IAA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,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACzC,OAAO;QACR,CAAC;QAED,cAAc,CAAC,qBAAqB,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACxB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACzC,OAAO;QACR,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,0BAA0B,CAAoB,CAAC,CAAC,yCAAyC;QACvJ,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACd,CAAC;QAED,wFAAwF;QACxF,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC7F,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,SAAoB;QACzC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,KAAa;QACrC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,OAAO,eAAe,EAAE,CAAC;IAC1B,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n} from \"./patchPopup.js\";\nimport type { OpenUI5Popup, PopupInfo } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport type { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tif (!window.sap.ui!.version) {\n\t\t\treturn true; // sap.ui.version will be removed in newer OpenUI5 versions\n\t\t}\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic initPromise?: Promise<void>;\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tif (!OpenUI5Support.initPromise) {\n\t\t\tOpenUI5Support.initPromise = new Promise<void>(resolve => {\n\t\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\t\tconst callback = () => {\n\t\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\t\tpatchPopup(Popup);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\t\tawait Core.ready();\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn OpenUI5Support.initPromise;\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The file name is \"css_variables.css\" until 1.127 and \"library.css\" from 1.127 onwards\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/) || !!link.href.match(/\\/library\\.css/);\n\t}\n\n\tstatic addOpenedPopup(popupInfo: PopupInfo) {\n\t\taddOpenedPopup(popupInfo);\n\t}\n\n\tstatic removeOpenedPopup(popup: object) {\n\t\tremoveOpenedPopup(popup);\n\t}\n\n\tstatic getTopmostPopup() {\n\t\treturn getTopmostPopup();\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
|
|
@@ -10,9 +10,13 @@ type OpenUI5Popup = {
|
|
|
10
10
|
onFocusEvent: (e: FocusEvent) => void;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type PopupInfo = {
|
|
14
|
+
type: "OpenUI5" | "WebComponent";
|
|
15
|
+
instance: object;
|
|
16
|
+
};
|
|
17
|
+
declare const addOpenedPopup: (popupInfo: PopupInfo) => void;
|
|
14
18
|
declare const removeOpenedPopup: (popup: object) => void;
|
|
15
19
|
declare const getTopmostPopup: () => object;
|
|
16
20
|
declare const patchPopup: (Popup: OpenUI5Popup) => void;
|
|
17
21
|
export { patchPopup, addOpenedPopup, removeOpenedPopup, getTopmostPopup, };
|
|
18
|
-
export type { OpenUI5Popup };
|
|
22
|
+
export type { OpenUI5Popup, PopupInfo };
|
|
@@ -2,17 +2,36 @@
|
|
|
2
2
|
import getSharedResource from "../getSharedResource.js";
|
|
3
3
|
// contains all OpenUI5 and Web Component popups that are currently opened
|
|
4
4
|
const AllOpenedPopupsRegistry = getSharedResource("AllOpenedPopupsRegistry", { openedRegistry: [] });
|
|
5
|
-
const addOpenedPopup = (
|
|
6
|
-
AllOpenedPopupsRegistry.openedRegistry.push(
|
|
5
|
+
const addOpenedPopup = (popupInfo) => {
|
|
6
|
+
AllOpenedPopupsRegistry.openedRegistry.push(popupInfo);
|
|
7
7
|
};
|
|
8
8
|
const removeOpenedPopup = (popup) => {
|
|
9
|
-
const index = AllOpenedPopupsRegistry.openedRegistry.
|
|
9
|
+
const index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);
|
|
10
10
|
if (index > -1) {
|
|
11
11
|
AllOpenedPopupsRegistry.openedRegistry.splice(index, 1);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
const getTopmostPopup = () => {
|
|
15
|
-
return AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1];
|
|
15
|
+
return AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Original OpenUI5 popup focus event is triggered only
|
|
19
|
+
* if there are no Web Component popups opened on top of it.
|
|
20
|
+
*
|
|
21
|
+
* @param {object} popup - The popup instance to check.
|
|
22
|
+
* @returns {boolean} True if the focus event should be triggered, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
const shouldCallOpenUI5FocusEvent = (popup) => {
|
|
25
|
+
for (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {
|
|
26
|
+
const popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];
|
|
27
|
+
if (popupInfo.type !== "OpenUI5") {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (popupInfo.instance === popup) {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
16
35
|
};
|
|
17
36
|
const openNativePopover = (domRef) => {
|
|
18
37
|
domRef.setAttribute("popover", "manual");
|
|
@@ -48,7 +67,10 @@ const patchOpen = (Popup) => {
|
|
|
48
67
|
}
|
|
49
68
|
}
|
|
50
69
|
}
|
|
51
|
-
addOpenedPopup(
|
|
70
|
+
addOpenedPopup({
|
|
71
|
+
type: "OpenUI5",
|
|
72
|
+
instance: this,
|
|
73
|
+
});
|
|
52
74
|
};
|
|
53
75
|
};
|
|
54
76
|
const patchClosed = (Popup) => {
|
|
@@ -66,9 +88,7 @@ const patchClosed = (Popup) => {
|
|
|
66
88
|
const patchFocusEvent = (Popup) => {
|
|
67
89
|
const origFocusEvent = Popup.prototype.onFocusEvent;
|
|
68
90
|
Popup.prototype.onFocusEvent = function onFocusEvent(e) {
|
|
69
|
-
|
|
70
|
-
// otherwise the focus event is handled by the Web Component Popup.
|
|
71
|
-
if (this === getTopmostPopup()) {
|
|
91
|
+
if (shouldCallOpenUI5FocusEvent(this)) {
|
|
72
92
|
origFocusEvent.call(this, e);
|
|
73
93
|
}
|
|
74
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAsBxD,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,iBAAiB,CAAuC,yBAAyB,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;AAE3I,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC/C,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,uBAAuB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC;IAC5F,IAAI,KAAK,GAAG,CAAC,CAA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AC1C,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB;IACzC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;IAC9C,kBAAkB,EAAE,CAAC,CAAC,6FAA6F;IACnH,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,+BAA+B;AACvD,CAAC,CAAC;AAEF,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,CAAC","sourcesContent":["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (e: FocusEvent) => void,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"OpenUI5\" | \"WebComponent\";\n\tinstance: object;\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<PopupInfo> }>(\"AllOpenedPopupsRegistry\", { openedRegistry: [] });\n\nconst addOpenedPopup = (popupInfo: PopupInfo) => {\n\tAllOpenedPopupsRegistry.openedRegistry.push(popupInfo);\n};\n\nconst removeOpenedPopup = (popup: object) => {\n\tconst index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Original OpenUI5 popup focus event is triggered only\n * if there are no Web Component popups opened on top of it.\n *\n * @param {object} popup - The popup instance to check.\n * @returns {boolean} True if the focus event should be triggered, false otherwise.\n */\nconst shouldCallOpenUI5FocusEvent = (popup: object) => {\n\tfor (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {\n\t\tconst popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];\n\t\tif (popupInfo.type !== \"OpenUI5\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn true;\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst isNativePopoverOpen = (root: Document | ShadowRoot = document): boolean => {\n\tif (root.querySelector(\":popover-open\")) {\n\t\treturn true;\n\t}\n\n\treturn Array.from(root.querySelectorAll(\"*\")).some(element => {\n\t\tconst shadowRoot = element.shadowRoot;\n\t\treturn shadowRoot && isNativePopoverOpen(shadowRoot);\n\t});\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = isNativePopoverOpen();\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(e: FocusEvent) {\n\t\tif (shouldCallOpenUI5FocusEvent(this)) {\n\t\t\torigFocusEvent.call(this, e);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup) => {\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, PopupInfo };\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const VersionInfo = {
|
|
2
|
-
version: "2.14.0-rc.
|
|
2
|
+
version: "2.14.0-rc.7",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 14,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "-rc.
|
|
6
|
+
suffix: "-rc.7",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1756973388,
|
|
9
9
|
};
|
|
10
10
|
export default VersionInfo;
|
|
11
11
|
//# sourceMappingURL=VersionInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.14.0-rc.
|
|
1
|
+
{"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.14.0-rc.7\",\n\tmajor: 2,\n\tminor: 14,\n\tpatch: 0,\n\tsuffix: \"-rc.7\",\n\tisNext: false,\n\tbuildTime: 1756973388,\n};\nexport default VersionInfo;"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollbarStyles.css.js","sourceRoot":"","sources":["../../../src/generated/css/ScrollbarStyles.css.ts"],"names":[],"mappings":"AAAA,eAAe,8HAA8H,CAAC","sourcesContent":["export default `html:not(:has(.ui5-content-native-scrollbars)){scrollbar-color:var(--sapScrollBar_FaceColor) var(--sapScrollBar_TrackColor)}`;"]}
|
package/dist/prod/Boot.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import
|
|
1
|
+
"use strict";import c from"./util/whenDOMReady.js";import d from"./EventProvider.js";import v from"./FontFace.js";import u from"./SystemCSSVars.js";import y from"./ScrollbarStyles.js";import{getTheme as i}from"./config/Theme.js";import a from"./theming/applyTheme.js";import{registerCurrentRuntime as S}from"./Runtimes.js";import{getFeature as m}from"./FeaturesRegistry.js";import{attachThemeRegistered as g}from"./theming/ThemeRegistered.js";import l from"./util/fixSafariActiveState.js";let o=!1,r;const p=new d,h=()=>o,P=t=>{if(!o){p.attachEvent("boot",t);return}t()},b=async()=>{if(r!==void 0)return r;const t=async n=>{if(S(),typeof document>"u"){n();return}g(F);const e=m("OpenUI5Support"),f=e?e.isOpenUI5Detected():!1,s=m("F6Navigation");e&&await e.init(),s&&!f&&s.init(),await c(),await a(i()),e&&e.attachListeners(),v(),u(),y(),l(),n(),o=!0,p.fireEvent("boot")};return r=new Promise(t),r},F=t=>{o&&t===i()&&a(i())};export{b as boot,P as attachBoot,h as isBooted};
|
|
2
2
|
//# sourceMappingURL=Boot.js.map
|
package/dist/prod/Boot.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Boot.ts"],
|
|
4
|
-
"sourcesContent": ["import whenDOMReady from \"./util/whenDOMReady.js\";\nimport EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport type { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\nimport fixSafariActiveState from \"./util/fixSafariActiveState.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\t\tfixSafariActiveState();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\teventProvider.fireEvent(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachBoot,\n\tisBooted,\n};\n"],
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAkB,yBACzB,OAAOC,MAAmB,qBAC1B,OAAOC,MAAoB,gBAC3B,OAAOC,MAAyB,qBAChC,OAAS,YAAAC,MAAgB,oBACzB,OAAOC,MAAgB,0BACvB,OAAS,0BAAAC,MAA8B,gBACvC,OAAS,cAAAC,MAAkB,wBAI3B,OAAS,yBAAAC,MAA6B,+BACtC,OAAOC,MAA0B,iCAEjC,IAAIC,EAAS,GACTC,EACJ,MAAMC,EAAgB,
|
|
6
|
-
"names": ["whenDOMReady", "EventProvider", "insertFontFace", "insertSystemCSSVars", "getTheme", "applyTheme", "registerCurrentRuntime", "getFeature", "attachThemeRegistered", "fixSafariActiveState", "booted", "bootPromise", "eventProvider", "isBooted", "attachBoot", "listener", "boot", "bootExecutor", "resolve", "onThemeRegistered", "openUI5Support", "isOpenUI5Loaded", "f6Navigation", "theme"]
|
|
4
|
+
"sourcesContent": ["import whenDOMReady from \"./util/whenDOMReady.js\";\nimport EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport insertScrollbarStyles from \"./ScrollbarStyles.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport type { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\nimport fixSafariActiveState from \"./util/fixSafariActiveState.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\t\tinsertScrollbarStyles();\n\t\tfixSafariActiveState();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\teventProvider.fireEvent(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachBoot,\n\tisBooted,\n};\n"],
|
|
5
|
+
"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Ready", "EventProvider", "insertFontFace", "insertSystemCSSVars", "insertScrollbarStyles", "getTheme", "applyTheme", "registerCurrentRuntime", "getFeature", "attachThemeRegistered", "fixSafariActiveState", "booted", "bootPromise", "eventProvider", "isBooted", "attachBoot", "listener", "boot", "bootExecutor", "resolve", "onThemeRegistered", "openUI5Support", "isOpenUI5Loaded", "f6Navigation", "theme"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ScrollbarStyles.ts"],
|
|
4
|
+
"sourcesContent": ["import { hasStyle, createStyle } from \"./ManagedStyles.js\";\nimport scrollbarStyles from \"./generated/css/ScrollbarStyles.css.js\";\n\nconst insertScrollbarStyles = () => {\n\tif (!hasStyle(\"data-ui5-scrollbar-styles\")) {\n\t\tcreateStyle(scrollbarStyles, \"data-ui5-scrollbar-styles\");\n\t}\n};\n\nexport default insertScrollbarStyles;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,YAAAA,EAAU,eAAAC,MAAmB,qBACtC,OAAOC,MAAqB,yCAE5B,MAAMC,EAAwB,IAAM,CAC9BH,EAAS,2BAA2B,GACxCC,EAAYC,EAAiB,2BAA2B,CAE1D,EAEA,eAAeC",
|
|
6
|
+
"names": ["hasStyle", "createStyle", "scrollbarStyles", "insertScrollbarStyles"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/features/OpenUI5Support.ts"],
|
|
4
|
-
"sourcesContent": ["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n} from \"./patchPopup.js\";\nimport type { OpenUI5Popup } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport type { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tif (!window.sap.ui!.version) {\n\t\t\treturn true; // sap.ui.version will be removed in newer OpenUI5 versions\n\t\t}\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic initPromise?: Promise<void>;\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tif (!OpenUI5Support.initPromise) {\n\t\t\tOpenUI5Support.initPromise = new Promise<void>(resolve => {\n\t\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\t\tconst callback = () => {\n\t\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\t\tpatchPopup(Popup);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\t\tawait Core.ready();\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn OpenUI5Support.initPromise;\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The file name is \"css_variables.css\" until 1.127 and \"library.css\" from 1.127 onwards\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/) || !!link.href.match(/\\/library\\.css/);\n\t}\n\n\tstatic addOpenedPopup(
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAkB,oBAEzB,OACC,cAAAC,EACA,kBAAAC,EACA,qBAAAC,EACA,mBAAAC,MACM,kBAEP,OAAS,mBAAAC,MAAuB,yBAChC,OAAS,YAAAC,MAAgB,qBA+DzB,MAAMC,CAAe,CACpB,OAAO,qBAAsB,CAC5B,GAAI,CAAC,OAAO,IAAI,GAAI,QACnB,MAAO,GAGR,MAAMC,EADU,OAAO,IAAI,GAAI,QACT,MAAM,GAAG,EAC/B,MAAI,CAACA,GAASA,EAAM,OAAS,EACrB,GAED,SAASA,EAAM,CAAC,CAAC,EAAI,GAAK,SAASA,EAAM,CAAC,CAAC,GAAK,GACxD,CAEA,OAAO,mBAAoB,CAC1B,OAAO,OAAO,OAAO,KAAK,IAAI,SAAY,UAC3C,CAIA,OAAO,MAAO,CACb,OAAKD,EAAe,kBAAkB,GAIjCA,EAAe,cACnBA,EAAe,YAAc,IAAI,QAAcE,GAAW,CACzD,OAAO,IAAI,GAAG,QAAQ,CAAC,kBAAkB,EAAG,MAAOC,GAAsB,CACxE,MAAMC,EAAW,IAAM,CACtB,IAAIC,EAAsB,CAAC,oBAAqB,sBAAuB,wBAAwB,EAC3FL,EAAe,oBAAoB,IACtCK,EAAO,CACN,GAAGA,EACH,2BACA,6BACA,8BACA,sBACA,gCACD,GAED,OAAO,IAAI,GAAG,QAAQA,EAAM,CAACC,EAAqBC,IAA4B,CAC7Ed,EAAac,CAAO,EACpBb,EAAWY,CAAK,EAChBJ,EAAQ,CACT,CAAC,CACF,EACIF,EAAe,oBAAoB,GACtC,MAAMG,EAAK,MAAM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,CAEA,OAAO,qBAAsB,CAC5B,GAAI,CAACb,EAAe,kBAAkB,EACrC,OAGD,MAAMc,EAAa,OAAO,IAAI,GAAG,QAAQ,wBAAwB,EAEjE,GAAId,EAAe,oBAAoB,EAAG,CACzC,MAAMS,EAAe,OAAO,IAAI,GAAG,QAAQ,4BAA4B,EACvE,OAAOK,EAAW,YAAYL,EAAa,eAAe,CAAC,EAAE,KAAK,CACnE,CAGA,MAAMI,EADO,OAAO,IAAI,GAAG,QAAQ,kBAAkB,EACjC,iBAAiB,EACrC,OAAOC,EAAW,YAAYD,EAAO,UAAU,CAAC,EAAE,KAAK,CACxD,CAEA,OAAO,uBAAwB,CAC9B,GAAIb,EAAe,oBAAoB,EAAG,CACzC,MAAMU,EAAmB,OAAO,IAAI,GAAG,QAAQ,qBAAqB,EACpEA,EAAQ,cAAc,IAAM,CAC3BX,EAASW,EAAQ,SAAS,CAAC,CAC5B,CAAC,CACF,KAAO,CACN,MAAMP,EAAO,OAAO,IAAI,GAAG,QAAQ,kBAAkB,EAC/CU,EAASV,EAAK,iBAAiB,EACrCA,EAAK,mBAAmB,IAAM,CAC7BJ,EAASc,EAAO,SAAS,CAAC,CAC3B,CAAC,CACF,CACD,CAEA,OAAO,iBAAkB,CACnBb,EAAe,kBAAkB,GAItCA,EAAe,sBAAsB,CACtC,CAEA,OAAO,oBAAqB,CAC3B,GAAI,CAACA,EAAe,kBAAkB,EACrC,OAGD,MAAMe,EAAO,CAAC,GAAG,SAAS,KAAK,QAAQ,EAAE,KAAKC,GAAMA,EAAG,KAAO,0BAA0B,EACxF,OAAKD,EAKE,CAAC,CAACA,EAAK,KAAK,MAAM,0BAA0B,GAAK,CAAC,CAACA,EAAK,KAAK,MAAM,gBAAgB,EAJlF,EAKT,CAEA,OAAO,eAAeE,
|
|
6
|
-
"names": ["patchPatcher", "patchPopup", "addOpenedPopup", "removeOpenedPopup", "getTopmostPopup", "registerFeature", "setTheme", "OpenUI5Support", "parts", "resolve", "Core", "callback", "deps", "Popup", "Patcher", "ControlBehavior", "Localization", "Theming", "Formatting", "CalendarUtils", "config", "LocaleData", "link", "el", "popup"]
|
|
4
|
+
"sourcesContent": ["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n} from \"./patchPopup.js\";\nimport type { OpenUI5Popup, PopupInfo } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport type { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tif (!window.sap.ui!.version) {\n\t\t\treturn true; // sap.ui.version will be removed in newer OpenUI5 versions\n\t\t}\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic initPromise?: Promise<void>;\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tif (!OpenUI5Support.initPromise) {\n\t\t\tOpenUI5Support.initPromise = new Promise<void>(resolve => {\n\t\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\t\tconst callback = () => {\n\t\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\t\tpatchPopup(Popup);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\t\tawait Core.ready();\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn OpenUI5Support.initPromise;\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The file name is \"css_variables.css\" until 1.127 and \"library.css\" from 1.127 onwards\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/) || !!link.href.match(/\\/library\\.css/);\n\t}\n\n\tstatic addOpenedPopup(popupInfo: PopupInfo) {\n\t\taddOpenedPopup(popupInfo);\n\t}\n\n\tstatic removeOpenedPopup(popup: object) {\n\t\tremoveOpenedPopup(popup);\n\t}\n\n\tstatic getTopmostPopup() {\n\t\treturn getTopmostPopup();\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAkB,oBAEzB,OACC,cAAAC,EACA,kBAAAC,EACA,qBAAAC,EACA,mBAAAC,MACM,kBAEP,OAAS,mBAAAC,MAAuB,yBAChC,OAAS,YAAAC,MAAgB,qBA+DzB,MAAMC,CAAe,CACpB,OAAO,qBAAsB,CAC5B,GAAI,CAAC,OAAO,IAAI,GAAI,QACnB,MAAO,GAGR,MAAMC,EADU,OAAO,IAAI,GAAI,QACT,MAAM,GAAG,EAC/B,MAAI,CAACA,GAASA,EAAM,OAAS,EACrB,GAED,SAASA,EAAM,CAAC,CAAC,EAAI,GAAK,SAASA,EAAM,CAAC,CAAC,G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,EAAK,iBAAiB,EACrCA,EAAK,mBAAmB,IAAM,CAC7BJ,EAASc,EAAO,SAAS,CAAC,CAC3B,CAAC,CACF,CACD,CAEA,OAAO,iBAAkB,CACnBb,EAAe,kBAAkB,GAItCA,EAAe,sBAAsB,CACtC,CAEA,OAAO,oBAAqB,CAC3B,GAAI,CAACA,EAAe,kBAAkB,EACrC,OAGD,MAAMe,EAAO,CAAC,GAAG,SAAS,KAAK,QAAQ,EAAE,KAAKC,GAAMA,EAAG,KAAO,0BAA0B,EACxF,OAAKD,EAKE,CAAC,CAACA,EAAK,KAAK,MAAM,0BAA0B,GAAK,CAAC,CAACA,EAAK,KAAK,MAAM,gBAAgB,EAJlF,EAKT,CAEA,OAAO,eAAeE,EAAsB,CAC3CtB,EAAesB,CAAS,CACzB,CAEA,OAAO,kBAAkBC,EAAe,CACvCtB,EAAkBsB,CAAK,CACxB,CAEA,OAAO,iBAAkB,CACxB,OAAOrB,EAAgB,CACxB,CACD,CAEAC,EAAgB,iBAAkBE,CAAc,EAEhD,eAAeA",
|
|
6
|
+
"names": ["patchPatcher", "patchPopup", "addOpenedPopup", "removeOpenedPopup", "getTopmostPopup", "registerFeature", "setTheme", "OpenUI5Support", "parts", "resolve", "Core", "callback", "deps", "Popup", "Patcher", "ControlBehavior", "Localization", "Theming", "Formatting", "CalendarUtils", "config", "LocaleData", "link", "el", "popupInfo", "popup"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import
|
|
1
|
+
"use strict";import d from"../getSharedResource.js";const n=d("AllOpenedPopupsRegistry",{openedRegistry:[]}),l=e=>{n.openedRegistry.push(e)},u=e=>{const t=n.openedRegistry.findIndex(o=>o.instance===e);t>-1&&n.openedRegistry.splice(t,1)},y=()=>n.openedRegistry[n.openedRegistry.length-1].instance,g=e=>{for(let t=n.openedRegistry.length-1;t>=0;t--){const o=n.openedRegistry[t];if(o.type!=="OpenUI5")return!1;if(o.instance===e)break}return!0},h=e=>{e.setAttribute("popover","manual"),e.showPopover()},f=e=>{e.hasAttribute("popover")&&(e.hidePopover(),e.removeAttribute("popover"))},a=(e=document)=>e.querySelector(":popover-open")?!0:Array.from(e.querySelectorAll("*")).some(t=>{const o=t.shadowRoot;return o&&a(o)}),v=e=>{const t=e.prototype.open;e.prototype.open=function(...p){t.apply(this,p);const s=a();if(["OPENING","OPEN"].includes(this.getOpenState())&&s){const r=this.getContent();if(r){const i=r instanceof HTMLElement?r:r?.getDomRef();i&&h(i)}}l({type:"OpenUI5",instance:this})}},O=e=>{const t=e.prototype._closed;e.prototype._closed=function(...p){const s=this.getContent(),c=s instanceof HTMLElement?s:s?.getDomRef();t.apply(this,p),c&&f(c),u(this)}},m=e=>{const t=e.prototype.onFocusEvent;e.prototype.onFocusEvent=function(p){g(this)&&t.call(this,p)}},I=()=>{const e=new CSSStyleSheet;e.replaceSync(".sapMPopup-CTX:popover-open { inset: unset; }"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},P=e=>{v(e),O(e),I(),m(e)};export{P as patchPopup,l as addOpenedPopup,u as removeOpenedPopup,y as getTopmostPopup};
|
|
2
2
|
//# sourceMappingURL=patchPopup.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/features/patchPopup.ts"],
|
|
4
|
-
"sourcesContent": ["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (e: FocusEvent) => void,\n\t}\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<
|
|
5
|
-
"mappings": "aACA,OAAOA,MAAuB,
|
|
6
|
-
"names": ["getSharedResource", "AllOpenedPopupsRegistry", "addOpenedPopup", "
|
|
4
|
+
"sourcesContent": ["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (e: FocusEvent) => void,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"OpenUI5\" | \"WebComponent\";\n\tinstance: object;\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<PopupInfo> }>(\"AllOpenedPopupsRegistry\", { openedRegistry: [] });\n\nconst addOpenedPopup = (popupInfo: PopupInfo) => {\n\tAllOpenedPopupsRegistry.openedRegistry.push(popupInfo);\n};\n\nconst removeOpenedPopup = (popup: object) => {\n\tconst index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Original OpenUI5 popup focus event is triggered only\n * if there are no Web Component popups opened on top of it.\n *\n * @param {object} popup - The popup instance to check.\n * @returns {boolean} True if the focus event should be triggered, false otherwise.\n */\nconst shouldCallOpenUI5FocusEvent = (popup: object) => {\n\tfor (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {\n\t\tconst popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];\n\t\tif (popupInfo.type !== \"OpenUI5\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn true;\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst isNativePopoverOpen = (root: Document | ShadowRoot = document): boolean => {\n\tif (root.querySelector(\":popover-open\")) {\n\t\treturn true;\n\t}\n\n\treturn Array.from(root.querySelectorAll(\"*\")).some(element => {\n\t\tconst shadowRoot = element.shadowRoot;\n\t\treturn shadowRoot && isNativePopoverOpen(shadowRoot);\n\t});\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = isNativePopoverOpen();\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(e: FocusEvent) {\n\t\tif (shouldCallOpenUI5FocusEvent(this)) {\n\t\t\torigFocusEvent.call(this, e);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup) => {\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, PopupInfo };\n"],
|
|
5
|
+
"mappings": "aACA,OAAOA,MAAuB,0BAuB9B,MAAMC,EAA0BD,EAAwD,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIE,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EAEMC,EAAqBC,GAAkB,CAC5C,MAAMC,EAAQL,EAAwB,eAAe,UAAUM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MAAMK,EAAcL,EAAM,UAAU,QACpCA,EAAM,UAAU,QAAU,YAAoBE,EAAa,CAC1D,MAAML,EAAU,KAAK,WAAW,EAC1BJ,EAASI,aAAmB,YAAcA,EAAUA,GAAS,UAAU,EAC7EQ,EAAY,MAAM,KAAMH,CAAI,EACxBT,GACHC,EAAmBD,CAAM,EAG1BR,EAAkB,IAAI,CACvB,CACD,EAEMqB,EAAmBN,GAAwB,CAChD,MAAMO,EAAiBP,EAAM,UAAU,aACvCA,EAAM,UAAU,aAAe,SAAsBQ,EAAe,CAC/DlB,EAA4B,IAAI,GACnCiB,EAAe,KAAK,KAAMC,CAAC,CAE7B,CACD,EAEMC,EAAqB,IAAM,CAChC,MAAMC,EAAa,IAAI,cACvBA,EAAW,YAAY,+CAA+C,EACtE,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBA,CAAU,CAC1E,EAEMC,EAAcX,GAAwB,CAC3CD,EAAUC,CAAK,EACfI,EAAYJ,CAAK,EACjBS,EAAmB,EACnBH,EAAgBN,CAAK,CACtB,EAEA,OACCW,KAAA,WACA5B,KAAA,eACAE,KAAA,kBACAI,KAAA",
|
|
6
|
+
"names": ["getSharedResource", "AllOpenedPopupsRegistry", "addOpenedPopup", "popupInfo", "removeOpenedPopup", "popup", "index", "el", "getTopmostPopup", "shouldCallOpenUI5FocusEvent", "i", "openNativePopover", "domRef", "closeNativePopover", "isNativePopoverOpen", "root", "element", "shadowRoot", "patchOpen", "Popup", "origOpen", "args", "topLayerAlreadyInUse", "patchClosed", "_origClosed", "patchFocusEvent", "origFocusEvent", "e", "createGlobalStyles", "stylesheet", "patchPopup"]
|
|
7
7
|
}
|