@ui5/webcomponents-base 2.15.0-rc.0 → 2.15.0-rc.3
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 +27 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/css/OpenUI5PopupStyles.css +5 -0
- package/dist/custom-elements-internal.json +15 -0
- package/dist/custom-elements.json +15 -0
- package/dist/features/insertOpenUI5PopupStyles.d.ts +2 -0
- package/dist/features/insertOpenUI5PopupStyles.js +9 -0
- package/dist/features/insertOpenUI5PopupStyles.js.map +1 -0
- package/dist/features/patchPopup.js +2 -0
- 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/OpenUI5PopupStyles.css.d.ts +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -0
- package/dist/generated/json-imports/i18n-fetch.js +1 -25
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -1
- package/dist/generated/json-imports/i18n-node.js +1 -25
- package/dist/generated/json-imports/i18n-node.js.map +1 -1
- package/dist/generated/json-imports/i18n.js +1 -25
- package/dist/generated/json-imports/i18n.js.map +1 -1
- package/dist/prod/features/insertOpenUI5PopupStyles.js +2 -0
- package/dist/prod/features/insertOpenUI5PopupStyles.js.map +7 -0
- 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/OpenUI5PopupStyles.css.js +2 -0
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n-fetch.js +1 -1
- package/dist/prod/generated/json-imports/i18n-fetch.js.map +4 -4
- package/dist/prod/generated/json-imports/i18n-node.js +1 -1
- package/dist/prod/generated/json-imports/i18n-node.js.map +4 -4
- package/dist/prod/generated/json-imports/i18n.js +1 -1
- package/dist/prod/generated/json-imports/i18n.js.map +4 -4
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +2 -2
- package/dist/theming/applyTheme.d.ts +2 -0
- package/dist/theming/applyTheme.js +5 -1
- package/dist/theming/applyTheme.js.map +1 -1
- package/package-scripts.cjs +58 -38
- package/package.json +22 -18
- package/src/css/OpenUI5PopupStyles.css +5 -0
|
@@ -593,6 +593,21 @@
|
|
|
593
593
|
}
|
|
594
594
|
]
|
|
595
595
|
},
|
|
596
|
+
{
|
|
597
|
+
"kind": "javascript-module",
|
|
598
|
+
"path": "dist/features/insertOpenUI5PopupStyles.js",
|
|
599
|
+
"declarations": [],
|
|
600
|
+
"exports": [
|
|
601
|
+
{
|
|
602
|
+
"kind": "js",
|
|
603
|
+
"name": "default",
|
|
604
|
+
"declaration": {
|
|
605
|
+
"name": "insertOpenUI5PopupStyles",
|
|
606
|
+
"module": "dist/features/insertOpenUI5PopupStyles.js"
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
]
|
|
610
|
+
},
|
|
596
611
|
{
|
|
597
612
|
"kind": "javascript-module",
|
|
598
613
|
"path": "dist/features/patchPatcher.js",
|
|
@@ -585,6 +585,21 @@
|
|
|
585
585
|
}
|
|
586
586
|
]
|
|
587
587
|
},
|
|
588
|
+
{
|
|
589
|
+
"kind": "javascript-module",
|
|
590
|
+
"path": "dist/features/insertOpenUI5PopupStyles.js",
|
|
591
|
+
"declarations": [],
|
|
592
|
+
"exports": [
|
|
593
|
+
{
|
|
594
|
+
"kind": "js",
|
|
595
|
+
"name": "default",
|
|
596
|
+
"declaration": {
|
|
597
|
+
"name": "insertOpenUI5PopupStyles",
|
|
598
|
+
"module": "dist/features/insertOpenUI5PopupStyles.js"
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
]
|
|
602
|
+
},
|
|
588
603
|
{
|
|
589
604
|
"kind": "javascript-module",
|
|
590
605
|
"path": "dist/features/patchPatcher.js",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { hasStyle, createStyle } from "../ManagedStyles.js";
|
|
2
|
+
import openUI5PopupStyles from "../generated/css/OpenUI5PopupStyles.css.js";
|
|
3
|
+
const insertOpenUI5PopupStyles = () => {
|
|
4
|
+
if (!hasStyle("data-ui5-popup-styles")) {
|
|
5
|
+
createStyle(openUI5PopupStyles, "data-ui5-popup-styles");
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export default insertOpenUI5PopupStyles;
|
|
9
|
+
//# sourceMappingURL=insertOpenUI5PopupStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertOpenUI5PopupStyles.js","sourceRoot":"","sources":["../../src/features/insertOpenUI5PopupStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,4CAA4C,CAAC;AAE5E,MAAM,wBAAwB,GAAG,GAAG,EAAE;IACrC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACxC,WAAW,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;IAC1D,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC","sourcesContent":["import { hasStyle, createStyle } from \"../ManagedStyles.js\";\nimport openUI5PopupStyles from \"../generated/css/OpenUI5PopupStyles.css.js\";\n\nconst insertOpenUI5PopupStyles = () => {\n\tif (!hasStyle(\"data-ui5-popup-styles\")) {\n\t\tcreateStyle(openUI5PopupStyles, \"data-ui5-popup-styles\");\n\t}\n};\n\nexport default insertOpenUI5PopupStyles;\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// OpenUI5's Control.js subset
|
|
2
2
|
import getSharedResource from "../getSharedResource.js";
|
|
3
|
+
import insertOpenUI5PopupStyles from "./insertOpenUI5PopupStyles.js";
|
|
3
4
|
// contains all OpenUI5 and Web Component popups that are currently opened
|
|
4
5
|
const AllOpenedPopupsRegistry = getSharedResource("AllOpenedPopupsRegistry", { openedRegistry: [] });
|
|
5
6
|
const addOpenedPopup = (popupInfo) => {
|
|
@@ -99,6 +100,7 @@ const createGlobalStyles = () => {
|
|
|
99
100
|
document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];
|
|
100
101
|
};
|
|
101
102
|
const patchPopup = (Popup) => {
|
|
103
|
+
insertOpenUI5PopupStyles();
|
|
102
104
|
patchOpen(Popup); // Popup.prototype.open
|
|
103
105
|
patchClosed(Popup); // Popup.prototype._closed
|
|
104
106
|
createGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)
|
|
@@ -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;AACxD,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AAsBrE,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,CAA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AC5E,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,wBAAwB,EAAE,CAAC;IAC3B,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\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.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\tinsertOpenUI5PopupStyles();\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.15.0-rc.
|
|
2
|
+
version: "2.15.0-rc.3",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 15,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "-rc.
|
|
6
|
+
suffix: "-rc.3",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1759392542,
|
|
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.15.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.15.0-rc.3\",\n\tmajor: 2,\n\tminor: 15,\n\tpatch: 0,\n\tsuffix: \"-rc.3\",\n\tisNext: false,\n\tbuildTime: 1759392542,\n};\nexport default VersionInfo;"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenUI5PopupStyles.css.js","sourceRoot":"","sources":["../../../src/generated/css/OpenUI5PopupStyles.css.ts"],"names":[],"mappings":"AAAA,eAAe,qEAAqE,CAAC","sourcesContent":["export default `[data-sap-ui-popup][popover]{border:none;overflow:visible;margin:0}`;"]}
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
|
|
3
|
-
const importMessageBundle = async (localeId) => {
|
|
4
|
-
switch (localeId) {
|
|
5
|
-
case "en": return (await fetch(new URL("../assets/i18n/messagebundle_en.json", import.meta.url))).json();
|
|
6
|
-
case "en_US_sappsd": return (await fetch(new URL("../assets/i18n/messagebundle_en_US_sappsd.json", import.meta.url))).json();
|
|
7
|
-
case "en_US_saprigi": return (await fetch(new URL("../assets/i18n/messagebundle_en_US_saprigi.json", import.meta.url))).json();
|
|
8
|
-
case "en_US_saptrc": return (await fetch(new URL("../assets/i18n/messagebundle_en_US_saptrc.json", import.meta.url))).json();
|
|
9
|
-
default: throw "unknown locale";
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const importAndCheck = async (localeId) => {
|
|
13
|
-
const data = await importMessageBundle(localeId);
|
|
14
|
-
if (typeof data === "string" && data.endsWith(".json")) {
|
|
15
|
-
throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
|
|
16
|
-
}
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
const localeIds = ["en",
|
|
20
|
-
"en_US_sappsd",
|
|
21
|
-
"en_US_saprigi",
|
|
22
|
-
"en_US_saptrc",];
|
|
23
|
-
localeIds.forEach(localeId => {
|
|
24
|
-
registerI18nLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "b" + "a" + "s" + "e", localeId, importAndCheck);
|
|
25
|
-
});
|
|
1
|
+
export {};
|
|
26
2
|
//# sourceMappingURL=i18n-fetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-fetch.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n-fetch.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-fetch.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
|
|
3
|
-
const importMessageBundle = async (localeId) => {
|
|
4
|
-
switch (localeId) {
|
|
5
|
-
case "en": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en" */ "../assets/i18n/messagebundle_en.json", { with: { type: 'json' } })).default;
|
|
6
|
-
case "en_US_sappsd": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_sappsd" */ "../assets/i18n/messagebundle_en_US_sappsd.json", { with: { type: 'json' } })).default;
|
|
7
|
-
case "en_US_saprigi": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saprigi" */ "../assets/i18n/messagebundle_en_US_saprigi.json", { with: { type: 'json' } })).default;
|
|
8
|
-
case "en_US_saptrc": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saptrc" */ "../assets/i18n/messagebundle_en_US_saptrc.json", { with: { type: 'json' } })).default;
|
|
9
|
-
default: throw "unknown locale";
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const importAndCheck = async (localeId) => {
|
|
13
|
-
const data = await importMessageBundle(localeId);
|
|
14
|
-
if (typeof data === "string" && data.endsWith(".json")) {
|
|
15
|
-
throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
|
|
16
|
-
}
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
const localeIds = ["en",
|
|
20
|
-
"en_US_sappsd",
|
|
21
|
-
"en_US_saprigi",
|
|
22
|
-
"en_US_saptrc",];
|
|
23
|
-
localeIds.forEach(localeId => {
|
|
24
|
-
registerI18nLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "b" + "a" + "s" + "e", localeId, importAndCheck);
|
|
25
|
-
});
|
|
1
|
+
export {};
|
|
26
2
|
//# sourceMappingURL=i18n-node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n-node.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n-node.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-node.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
|
|
3
|
-
const importMessageBundle = async (localeId) => {
|
|
4
|
-
switch (localeId) {
|
|
5
|
-
case "en": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en" */ "../assets/i18n/messagebundle_en.json")).default;
|
|
6
|
-
case "en_US_sappsd": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_sappsd" */ "../assets/i18n/messagebundle_en_US_sappsd.json")).default;
|
|
7
|
-
case "en_US_saprigi": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saprigi" */ "../assets/i18n/messagebundle_en_US_saprigi.json")).default;
|
|
8
|
-
case "en_US_saptrc": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saptrc" */ "../assets/i18n/messagebundle_en_US_saptrc.json")).default;
|
|
9
|
-
default: throw "unknown locale";
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const importAndCheck = async (localeId) => {
|
|
13
|
-
const data = await importMessageBundle(localeId);
|
|
14
|
-
if (typeof data === "string" && data.endsWith(".json")) {
|
|
15
|
-
throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
|
|
16
|
-
}
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
const localeIds = ["en",
|
|
20
|
-
"en_US_sappsd",
|
|
21
|
-
"en_US_saprigi",
|
|
22
|
-
"en_US_saptrc",];
|
|
23
|
-
localeIds.forEach(localeId => {
|
|
24
|
-
registerI18nLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "b" + "a" + "s" + "e", localeId, importAndCheck);
|
|
25
|
-
});
|
|
1
|
+
export {};
|
|
26
2
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{hasStyle as p,createStyle as t}from"../ManagedStyles.js";import e from"../generated/css/OpenUI5PopupStyles.css.js";const o=()=>{p("data-ui5-popup-styles")||t(e,"data-ui5-popup-styles")};export default o;
|
|
2
|
+
//# sourceMappingURL=insertOpenUI5PopupStyles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/insertOpenUI5PopupStyles.ts"],
|
|
4
|
+
"sourcesContent": ["import { hasStyle, createStyle } from \"../ManagedStyles.js\";\nimport openUI5PopupStyles from \"../generated/css/OpenUI5PopupStyles.css.js\";\n\nconst insertOpenUI5PopupStyles = () => {\n\tif (!hasStyle(\"data-ui5-popup-styles\")) {\n\t\tcreateStyle(openUI5PopupStyles, \"data-ui5-popup-styles\");\n\t}\n};\n\nexport default insertOpenUI5PopupStyles;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,YAAAA,EAAU,eAAAC,MAAmB,sBACtC,OAAOC,MAAwB,6CAE/B,MAAMC,EAA2B,IAAM,CACjCH,EAAS,uBAAuB,GACpCC,EAAYC,EAAoB,uBAAuB,CAEzD,EAEA,eAAeC",
|
|
6
|
+
"names": ["hasStyle", "createStyle", "openUI5PopupStyles", "insertOpenUI5PopupStyles"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import
|
|
1
|
+
"use strict";import y from"../getSharedResource.js";import d from"./insertOpenUI5PopupStyles.js";const n=y("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)},g=()=>n.openedRegistry[n.openedRegistry.length-1].instance,f=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()},v=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)}),O=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})}},m=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&&v(c),u(this)}},I=e=>{const t=e.prototype.onFocusEvent;e.prototype.onFocusEvent=function(p){f(this)&&t.call(this,p)}},P=()=>{const e=new CSSStyleSheet;e.replaceSync(".sapMPopup-CTX:popover-open { inset: unset; }"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},E=e=>{d(),O(e),m(e),P(),I(e)};export{E as patchPopup,l as addOpenedPopup,u as removeOpenedPopup,g 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\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,
|
|
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"]
|
|
4
|
+
"sourcesContent": ["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.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\tinsertOpenUI5PopupStyles();\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,0BAC9B,OAAOC,MAA8B,gCAuBrC,MAAMC,EAA0BF,EAAwD,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EAASI,aAAmB,YAAcA,EAAUA,GAAS,UAAU,EACzEJ,GACHD,EAAkBC,CAAM,CAE1B,CACD,CAEAV,EAAe,CACd,KAAM,UACN,SAAU,IACX,CAAC,CACF,CACD,EAEMqB,EAAeJ,GAAwB,CAC5C,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,CAC3CnB,EAAyB,EACzBkB,EAAUC,CAAK,EACfI,EAAYJ,CAAK,EACjBS,EAAmB,EACnBH,EAAgBN,CAAK,CACtB,EAEA,OACCW,KAAA,WACA5B,KAAA,eACAE,KAAA,kBACAI,KAAA",
|
|
6
|
+
"names": ["getSharedResource", "insertOpenUI5PopupStyles", "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
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e={version:"2.15.0-rc.
|
|
1
|
+
"use strict";const e={version:"2.15.0-rc.3",major:2,minor:15,patch:0,suffix:"-rc.3",isNext:!1,buildTime:1759392542};export default e;
|
|
2
2
|
//# sourceMappingURL=VersionInfo.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/generated/VersionInfo.ts"],
|
|
4
|
-
"sourcesContent": ["const VersionInfo = {\n\tversion: \"2.15.0-rc.
|
|
4
|
+
"sourcesContent": ["const VersionInfo = {\n\tversion: \"2.15.0-rc.3\",\n\tmajor: 2,\n\tminor: 15,\n\tpatch: 0,\n\tsuffix: \"-rc.3\",\n\tisNext: false,\n\tbuildTime: 1759392542,\n};\nexport default VersionInfo;"],
|
|
5
5
|
"mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,cACT,MAAO,EACP,MAAO,GACP,MAAO,EACP,OAAQ,QACR,OAAQ,GACR,UAAW,UACZ,EACA,eAAeA",
|
|
6
6
|
"names": ["VersionInfo"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=i18n-fetch.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=i18n-node.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{getThemeProperties as n,getRegisteredPackages as m,isThemeRegistered as
|
|
1
|
+
"use strict";import{getThemeProperties as n,getRegisteredPackages as m,isThemeRegistered as g}from"../asset-registries/Themes.js";import{removeStyle as d,createOrUpdateStyle as p}from"../ManagedStyles.js";import c from"./getThemeDesignerTheme.js";import{fireThemeLoaded as f}from"./ThemeLoaded.js";import{getFeature as u}from"../FeaturesRegistry.js";import{attachCustomThemeStylesToHead as T,getThemeRoot as h}from"../config/ThemeRoot.js";import{DEFAULT_THEME as l}from"../generated/AssetParameters.js";import{getCurrentRuntimeIndex as y}from"../Runtimes.js";export let _lib="ui5",_package="webcomponents-theming";const s="@"+_lib+"/"+_package,S=()=>m().has(s),P=async e=>{if(!S())return;const t=await n(s,e);t&&p(t,"data-ui5-theme-properties",s,e)},E=()=>{d("data-ui5-theme-properties",s)},U=async(e,t)=>{const o=[...m()].map(async a=>{if(a===s)return;const i=await n(a,e,t);i&&p(i,`data-ui5-component-properties-${y()}`,a)});return Promise.all(o)},k=async e=>{const t=c();if(t)return t;const r=u("OpenUI5Support");if(r&&r.isOpenUI5Detected()){if(r.cssVariablesLoaded())return{themeName:r.getConfigurationSettingsObject()?.theme,baseThemeName:""}}else if(h())return await T(e),c()},w=async e=>{const t=await k(e);!t||e!==t.themeName?await P(e):E();const r=g(e)?e:t&&t.baseThemeName;await U(r||l,t&&t.themeName===e?e:void 0),f(e)};export default w;
|
|
2
2
|
//# sourceMappingURL=applyTheme.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/theming/applyTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\n\n// eslint-disable-next-line\
|
|
5
|
-
"mappings": "aAAA,OAAS,sBAAAA,EAAoB,yBAAAC,EAAuB,qBAAAC,MAAyB,gCAC7E,OAAS,eAAAC,EAAa,uBAAAC,MAA2B,sBACjD,OAAOC,MAA2B,6BAClC,OAAS,mBAAAC,MAAuB,mBAChC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,iCAAAC,EAA+B,gBAAAC,MAAoB,yBAE5D,OAAS,iBAAAC,MAAqB,kCAC9B,OAAS,0BAAAC,MAA8B,
|
|
4
|
+
"sourcesContent": ["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\n\n// eslint-disable-next-line\nexport let _lib = \"ui5\";\n// eslint-disable-next-line\nexport let _package = \"webcomponents-theming\";\n// eslint-disable-next-line\nconst BASE_THEME_PACKAGE = \"@\" + _lib + \"/\" + _package;\n\nconst isThemeBaseRegistered = () => {\n\tconst registeredPackages = getRegisteredPackages();\n\treturn registeredPackages.has(BASE_THEME_PACKAGE);\n};\n\nconst loadThemeBase = async (theme: string) => {\n\tif (!isThemeBaseRegistered()) {\n\t\treturn;\n\t}\n\n\tconst cssData = await getThemeProperties(BASE_THEME_PACKAGE, theme);\n\tif (cssData) {\n\t\tcreateOrUpdateStyle(cssData, \"data-ui5-theme-properties\", BASE_THEME_PACKAGE, theme);\n\t}\n};\n\nconst deleteThemeBase = () => {\n\tremoveStyle(\"data-ui5-theme-properties\", BASE_THEME_PACKAGE);\n};\n\nconst loadComponentPackages = async (theme: string, externalThemeName?: string) => {\n\tconst registeredPackages = getRegisteredPackages();\n\n\tconst packagesStylesPromises = [...registeredPackages].map(async packageName => {\n\t\tif (packageName === BASE_THEME_PACKAGE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cssData = await getThemeProperties(packageName, theme, externalThemeName);\n\t\tif (cssData) {\n\t\t\tcreateOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);\n\t\t}\n\t});\n\n\treturn Promise.all(packagesStylesPromises);\n};\n\nconst detectExternalTheme = async (theme: string) => {\n\t// If theme designer theme is detected, use this\n\tconst extTheme = getThemeDesignerTheme();\n\tif (extTheme) {\n\t\treturn extTheme;\n\t}\n\n\t// If OpenUI5Support is enabled, try to find out if it loaded variables\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support && openUI5Support.isOpenUI5Detected()) {\n\t\tconst varsLoaded = openUI5Support.cssVariablesLoaded();\n\t\tif (varsLoaded) {\n\t\t\treturn {\n\t\t\t\tthemeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName\n\t\t\t\tbaseThemeName: \"\", // baseThemeName is only relevant for custom themes\n\t\t\t};\n\t\t}\n\t} else if (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\n\t\treturn getThemeDesignerTheme();\n\t}\n};\n\nconst applyTheme = async (theme: string) => {\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded\n\tif (!extTheme || theme !== extTheme.themeName) {\n\t\tawait loadThemeBase(theme);\n\t} else {\n\t\tdeleteThemeBase();\n\t}\n\n\t// Always load component packages properties. For non-registered themes, try with the base theme, if any\n\tconst packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;\n\tawait loadComponentPackages(packagesTheme || DEFAULT_THEME, extTheme && extTheme.themeName === theme ? theme : undefined);\n\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,sBAAAA,EAAoB,yBAAAC,EAAuB,qBAAAC,MAAyB,gCAC7E,OAAS,eAAAC,EAAa,uBAAAC,MAA2B,sBACjD,OAAOC,MAA2B,6BAClC,OAAS,mBAAAC,MAAuB,mBAChC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,iCAAAC,EAA+B,gBAAAC,MAAoB,yBAE5D,OAAS,iBAAAC,MAAqB,kCAC9B,OAAS,0BAAAC,MAA8B,iBAGhC,WAAI,KAAO,MAEP,SAAW,wBAEtB,MAAMC,EAAqB,IAAM,KAAO,IAAM,SAExCC,EAAwB,IACFZ,EAAsB,EACvB,IAAIW,CAAkB,EAG3CE,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isteredPackages", "isThemeRegistered", "removeStyle", "createOrUpdateStyle", "getThemeDesignerTheme", "fireThemeLoaded", "getFeature", "attachCustomThemeStylesToHead", "getThemeRoot", "DEFAULT_THEME", "getCurrentRuntimeIndex", "BASE_THEME_PACKAGE", "isThemeBaseRegistered", "loadThemeBase", "theme", "cssData", "deleteThemeBase", "loadComponentPackages", "externalThemeName", "packagesStylesPromises", "packageName", "detectExternalTheme", "extTheme", "openUI5Support", "applyTheme", "packagesTheme"]
|
|
7
7
|
}
|
|
@@ -7,7 +7,11 @@ import { attachCustomThemeStylesToHead, getThemeRoot } from "../config/ThemeRoot
|
|
|
7
7
|
import { DEFAULT_THEME } from "../generated/AssetParameters.js";
|
|
8
8
|
import { getCurrentRuntimeIndex } from "../Runtimes.js";
|
|
9
9
|
// eslint-disable-next-line
|
|
10
|
-
|
|
10
|
+
export let _lib = "ui5";
|
|
11
|
+
// eslint-disable-next-line
|
|
12
|
+
export let _package = "webcomponents-theming";
|
|
13
|
+
// eslint-disable-next-line
|
|
14
|
+
const BASE_THEME_PACKAGE = "@" + _lib + "/" + _package;
|
|
11
15
|
const isThemeBaseRegistered = () => {
|
|
12
16
|
const registeredPackages = getRegisteredPackages();
|
|
13
17
|
return registeredPackages.has(BASE_THEME_PACKAGE);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyTheme.js","sourceRoot":"","sources":["../../src/theming/applyTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,M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AAE,CAAC;QAC1D,MAAM,UAAU,GAAG,cAAc,CAAC,kBAAkB,EAAE,CAAC;QACvD,IAAI,UAAU,EAAE,CAAC;YAChB,OAAO;gBACN,SAAS,EAAE,cAAc,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,iBAAiB;gBACpF,aAAa,EAAE,EAAE,EAAE,mDAAmD;aACtE,CAAC;QACH,CAAC;IACF,CAAC;SAAM,IAAI,YAAY,EAAE,EAAE,CAAC;QAC3B,MAAM,6BAA6B,CAAC,KAAK,CAAC,CAAC;QAE3C,OAAO,qBAAqB,EAAE,CAAC;IAChC,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;IAC1C,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAElD,kHAAkH;IAClH,IAAI,CAAC,QAAQ,IAAI,KAAK,KAAK,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC/C,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;SAAM,CAAC;QACP,eAAe,EAAE,CAAC;IACnB,CAAC;IAED,wGAAwG;IACxG,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAAC;IAC5F,MAAM,qBAAqB,CAAC,aAAa,IAAI,aAAa,EAAE,QAAQ,IAAI,QAAQ,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE1H,eAAe,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\n\n// eslint-disable-next-line\nexport let _lib = \"ui5\";\n// eslint-disable-next-line\nexport let _package = \"webcomponents-theming\";\n// eslint-disable-next-line\nconst BASE_THEME_PACKAGE = \"@\" + _lib + \"/\" + _package;\n\nconst isThemeBaseRegistered = () => {\n\tconst registeredPackages = getRegisteredPackages();\n\treturn registeredPackages.has(BASE_THEME_PACKAGE);\n};\n\nconst loadThemeBase = async (theme: string) => {\n\tif (!isThemeBaseRegistered()) {\n\t\treturn;\n\t}\n\n\tconst cssData = await getThemeProperties(BASE_THEME_PACKAGE, theme);\n\tif (cssData) {\n\t\tcreateOrUpdateStyle(cssData, \"data-ui5-theme-properties\", BASE_THEME_PACKAGE, theme);\n\t}\n};\n\nconst deleteThemeBase = () => {\n\tremoveStyle(\"data-ui5-theme-properties\", BASE_THEME_PACKAGE);\n};\n\nconst loadComponentPackages = async (theme: string, externalThemeName?: string) => {\n\tconst registeredPackages = getRegisteredPackages();\n\n\tconst packagesStylesPromises = [...registeredPackages].map(async packageName => {\n\t\tif (packageName === BASE_THEME_PACKAGE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cssData = await getThemeProperties(packageName, theme, externalThemeName);\n\t\tif (cssData) {\n\t\t\tcreateOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);\n\t\t}\n\t});\n\n\treturn Promise.all(packagesStylesPromises);\n};\n\nconst detectExternalTheme = async (theme: string) => {\n\t// If theme designer theme is detected, use this\n\tconst extTheme = getThemeDesignerTheme();\n\tif (extTheme) {\n\t\treturn extTheme;\n\t}\n\n\t// If OpenUI5Support is enabled, try to find out if it loaded variables\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support && openUI5Support.isOpenUI5Detected()) {\n\t\tconst varsLoaded = openUI5Support.cssVariablesLoaded();\n\t\tif (varsLoaded) {\n\t\t\treturn {\n\t\t\t\tthemeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName\n\t\t\t\tbaseThemeName: \"\", // baseThemeName is only relevant for custom themes\n\t\t\t};\n\t\t}\n\t} else if (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\n\t\treturn getThemeDesignerTheme();\n\t}\n};\n\nconst applyTheme = async (theme: string) => {\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded\n\tif (!extTheme || theme !== extTheme.themeName) {\n\t\tawait loadThemeBase(theme);\n\t} else {\n\t\tdeleteThemeBase();\n\t}\n\n\t// Always load component packages properties. For non-registered themes, try with the base theme, if any\n\tconst packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;\n\tawait loadComponentPackages(packagesTheme || DEFAULT_THEME, extTheme && extTheme.themeName === theme ? theme : undefined);\n\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"]}
|