@ui5/webcomponents-base 2.15.0-rc.0 → 2.15.0-rc.2
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 +19 -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/package-scripts.cjs +34 -23
- package/package.json +24 -15
- 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,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC;IAC5F,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;QAChB,uBAAuB,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CA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ACzC,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.2",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 15,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "-rc.
|
|
6
|
+
suffix: "-rc.2",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1758790021,
|
|
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.2\",\n\tmajor: 2,\n\tminor: 15,\n\tpatch: 0,\n\tsuffix: \"-rc.2\",\n\tisNext: false,\n\tbuildTime: 1758790021,\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,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIG,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EAEMC,EAAqBC,GAAkB,CAC5C,MAAMC,EAAQL,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eJ,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.2",major:2,minor:15,patch:0,suffix:"-rc.2",isNext:!1,buildTime:1758790021};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.2\",\n\tmajor: 2,\n\tminor: 15,\n\tpatch: 0,\n\tsuffix: \"-rc.2\",\n\tisNext: false,\n\tbuildTime: 1758790021,\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
|
}
|
package/package-scripts.cjs
CHANGED
|
@@ -14,68 +14,79 @@ const LIB = path.join(__dirname, `../tools/lib/`);
|
|
|
14
14
|
const viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
|
|
15
15
|
|
|
16
16
|
const scripts = {
|
|
17
|
-
|
|
17
|
+
__ui5envs: {
|
|
18
|
+
UI5_TS: true,
|
|
19
|
+
UI5_BASE: true,
|
|
20
|
+
UI5_CEM_MODE: "dev",
|
|
21
|
+
},
|
|
22
|
+
clean: "rimraf src/generated && rimraf dist",
|
|
18
23
|
lint: `eslint .`,
|
|
19
|
-
generate: "
|
|
20
|
-
prepare: "
|
|
24
|
+
generate: "ui5nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace build.jsonImports",
|
|
25
|
+
prepare: "ui5nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace typescript integrate.no-remaining-require build.jsonImports",
|
|
21
26
|
typescript: "tsc -b",
|
|
22
27
|
integrate: {
|
|
23
|
-
default: "
|
|
28
|
+
default: "ui5nps integrate.copy-used-modules integrate.amd-to-es6 integrate.third-party",
|
|
24
29
|
"copy-used-modules": `node "${copyUsedModules}" ./used-modules.txt dist/`,
|
|
25
30
|
"amd-to-es6": `node "${amdToES6}" dist/`,
|
|
26
31
|
"no-remaining-require": `node "${noRequire}" dist/`,
|
|
27
32
|
"third-party": {
|
|
28
|
-
default: "
|
|
29
|
-
copy: "
|
|
33
|
+
default: "ui5nps integrate.third-party.copy integrate.third-party.fix",
|
|
34
|
+
copy: "copy-and-watch ../../node_modules/@openui5/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js dist/sap/ui/thirdparty/",
|
|
30
35
|
fix: "replace-in-file 240 xA0 dist/sap/ui/thirdparty/caja-html-sanitizer.js"
|
|
31
36
|
},
|
|
32
37
|
},
|
|
33
38
|
build: {
|
|
34
|
-
default: `
|
|
39
|
+
default: `ui5nps prepare`,
|
|
35
40
|
bundle: `vite build ${viteConfig}`,
|
|
36
41
|
i18n: {
|
|
37
|
-
default: "
|
|
42
|
+
default: "ui5nps build.i18n.defaultsjs build.i18n.json",
|
|
38
43
|
defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
|
|
39
44
|
json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
|
|
40
45
|
},
|
|
41
46
|
jsonImports: {
|
|
42
|
-
default: "
|
|
47
|
+
default: "ui5nps build.jsonImports.i18n",
|
|
43
48
|
i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n src/generated/json-imports`,
|
|
44
49
|
},
|
|
45
50
|
},
|
|
46
51
|
copy: {
|
|
47
|
-
default: "
|
|
52
|
+
default: "ui5nps copy.src",
|
|
48
53
|
src: `copy-and-watch "src/**/*.{js,css,d.ts}" dist/`,
|
|
54
|
+
srcWithWatch: `copy-and-watch "src/**/*.{js,css,d.ts}" dist/ --watch --skip-initial-copy`,
|
|
49
55
|
},
|
|
50
56
|
generateAssetParameters: `node "${assetParametersScript}"`,
|
|
51
57
|
generateVersionInfo: `node "${versionScript}"`,
|
|
52
58
|
generateStyles: `node "${stylesScript}"`,
|
|
53
59
|
generateFontFace: `node "${fontFaceScript}"`,
|
|
54
|
-
|
|
55
|
-
generateTestTemplates: `mkdirp test/test-elements/generated/templates && cross-env UI5_BASE=true UI5_TS=true node "${LIB}/hbs2ui5/index.js" -d test/test-elements -o test/test-elements/generated/templates`,
|
|
60
|
+
generateTestTemplates: `node "${LIB}/hbs2ui5/index.js" -d test/test-elements -o test/test-elements/generated/templates`,
|
|
56
61
|
generateProd: {
|
|
57
|
-
"default": "
|
|
62
|
+
"default": "ui5nps generateProd.remove-dev-mode generateProd.copy-prod",
|
|
58
63
|
"remove-dev-mode": `node "${LIB}/remove-dev-mode/remove-dev-mode.mjs"`,
|
|
59
64
|
"copy-prod": `copy-and-watch "dist/sap/**/*" dist/prod/sap/ && copy-and-watch "dist/thirdparty/preact/**/*.js" dist/prod/thirdparty/preact/ && copy-and-watch "dist/generated/assets/**/*.json" dist/prod/generated/assets/`,
|
|
60
65
|
},
|
|
61
66
|
generateAPI: {
|
|
62
|
-
default: "
|
|
63
|
-
generateCEM: `
|
|
64
|
-
validateCEM: `
|
|
67
|
+
default: "ui5nps generateAPI.generateCEM generateAPI.validateCEM",
|
|
68
|
+
generateCEM: `cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs"`,
|
|
69
|
+
validateCEM: `node "${LIB}/cem/validate.js"`,
|
|
65
70
|
},
|
|
66
71
|
watch: {
|
|
67
|
-
default: '
|
|
68
|
-
withBundle: '
|
|
69
|
-
src: '
|
|
72
|
+
default: 'ui5nps-p watch.src watch.styles', // concurently
|
|
73
|
+
withBundle: 'ui5nps-p watch.src watch.bundle watch.styles', // concurently
|
|
74
|
+
src: 'ui5nps copy.srcWithWatch',
|
|
70
75
|
bundle: `node ${LIB}/dev-server/dev-server.mjs ${viteConfig}`,
|
|
71
|
-
styles: 'chokidar "src/css/*.css" -c "
|
|
76
|
+
styles: 'chokidar "src/css/*.css" -c "ui5nps generateStyles"'
|
|
72
77
|
},
|
|
73
78
|
test: {
|
|
74
|
-
default: '
|
|
79
|
+
default: 'ui5nps-p test.ssr test.ssr2 test.test-cy-ci', // concurently
|
|
75
80
|
ssr: `mocha test/ssr`,
|
|
76
81
|
ssr2: "node -e \"import('./dist/Device.js')\"",
|
|
77
|
-
"test-cy-ci":
|
|
78
|
-
|
|
82
|
+
"test-cy-ci": {
|
|
83
|
+
default: "ui5nps generateTestTemplates test.test-cy-ci.cypress",
|
|
84
|
+
cypress: ` yarn cypress run --component --browser chrome`
|
|
85
|
+
},
|
|
86
|
+
"test-cy-open": {
|
|
87
|
+
default: "ui5nps generateTestTemplates test.test-cy-open.cypress",
|
|
88
|
+
cypress: ` yarn cypress open --component --browser chrome`
|
|
89
|
+
}
|
|
79
90
|
},
|
|
80
91
|
};
|
|
81
92
|
|