@ui5/webcomponents-base 2.23.0-rc.2 → 2.23.1
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 +23 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/Boot.js +1 -0
- package/dist/Boot.js.map +1 -1
- package/dist/UI5Element.js +11 -3
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.js +1 -1
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/custom-elements-internal.json +117 -117
- package/dist/custom-elements.json +117 -117
- package/dist/features/patchPopup.js +1 -0
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/VersionInfo.js +4 -4
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/Boot.js +1 -1
- package/dist/prod/Boot.js.map +2 -2
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +2 -2
- package/dist/prod/UI5ElementMetadata.js +1 -1
- package/dist/prod/UI5ElementMetadata.js.map +3 -3
- package/dist/prod/features/patchPopup.js +1 -1
- package/dist/prod/features/patchPopup.js.map +2 -2
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/package.json +3 -3
|
@@ -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\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.js\";\nimport VersionInfo from \"../generated/VersionInfo.js\";\nimport { compareVersions } from \"../Runtimes.js\";\n\ntype PatchedFunctionRecord = {\n\tversion: VersionInfo | undefined;\n\toriginalFn: (...args: any[]) => any;\n};\n\ntype PatchedFunctionsRegistry = Record<string, PatchedFunctionRecord>;\n\nconst PatchedFunctions = getSharedResource<PatchedFunctionsRegistry>(\"PatchedFunctions\", {});\n\nconst shouldRepatch = (key: string): boolean => {\n\tconst existing = PatchedFunctions[key];\n\tif (!existing) {\n\t\treturn true;\n\t}\n\n\tif (!existing.version) {\n\t\treturn true;\n\t}\n\treturn compareVersions(VersionInfo, existing.version) > 0;\n};\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\topen: (...args: any[]) => void,\n\t_closed: (...args: any[]) => void,\n\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\tonFocusEvent: (...args: any[]) => void,\n\tgetModal: () => boolean\n};\n\ntype OpenUI5PopupClass = {\n\tprototype: OpenUI5Popup\n};\n\ntype OpenUI5DialogClass = {\n\tprototype: {\n\t\tonsapescape: (...args: any[]) => void,\n\t\toPopup: OpenUI5Popup,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"WebComponent\";\n\tinstance: object;\n} | {\n\ttype: \"OpenUI5\";\n\tinstance: OpenUI5Popup;\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\n\tif (index === AllOpenedPopupsRegistry.openedRegistry.length - 1) {\n\t\tfixTopmostOpenUI5Popup();\n\t}\n\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\tif (AllOpenedPopupsRegistry.openedRegistry.length === 0) {\n\t\treturn null;\n\t}\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Determines whether there is a Web Component popup opened above (a specified popup).\n *\n * @param {object} popup The popup instance to check against.\n * @returns {boolean} `true` if a Web Component popup is opened above (the given popup instance); otherwise `false`.\n */\nconst hasWebComponentPopupAbove = (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 === \"WebComponent\") {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst getPopupContentElement = (popup: OpenUI5Popup): HTMLElement | null => {\n\tconst content = popup.getContent();\n\treturn content instanceof HTMLElement ? content : content?.getDomRef() || null;\n};\n\nconst openNativePopoverForOpenUI5 = (popup: OpenUI5Popup) => {\n\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(popup.getOpenState());\n\tif (!openingInitiated || !isNativePopoverOpen()) {\n\t\treturn;\n\t}\n\n\tconst domRef = getPopupContentElement(popup);\n\n\tif (!domRef) {\n\t\treturn;\n\t}\n\n\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\n\tif (popup.getModal() && openUI5BlockLayer) {\n\t\topenUI5BlockLayer.setAttribute(\"popover\", \"manual\");\n\t\topenUI5BlockLayer.hidePopover();\n\t\topenUI5BlockLayer.showPopover();\n\t}\n\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopoverForOpenUI5 = (popup: OpenUI5Popup) => {\n\tconst domRef = getPopupContentElement(popup);\n\n\tif (!domRef) {\n\t\treturn;\n\t}\n\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n\n\tif (getTopmostPopup() !== popup) {\n\t\treturn;\n\t}\n\n\t// The OpenUI5 block layer is only one for all modal OpenUI5 popups,\n\t// and it is displayed above all opened pupups - OpenUI5 and Web Components,\n\t// as a result, we need to hide this block layer.\n\t// If the underlying popup is a Web Component - it is displayed like a native popover, and we don't need to do anything\n\t// If the underlying popup is an OpenUI5 popup, it will be fixed in fixTopmostOpenUI5Popup method.\n\tif (popup.getModal()) {\n\t\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\t\tif (openUI5BlockLayer && openUI5BlockLayer.hasAttribute(\"popover\")) {\n\t\t\topenUI5BlockLayer.hidePopover();\n\t\t}\n\t}\n};\n\nconst fixTopmostOpenUI5Popup = () => {\n\tif (!isNativePopoverOpen()) {\n\t\treturn;\n\t}\n\n\tconst prevPopup = AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 2];\n\tif (!prevPopup\n\t\t|| prevPopup.type !== \"OpenUI5\"\n\t\t|| !prevPopup.instance.getModal()) {\n\t\treturn;\n\t}\n\n\tconst content = getPopupContentElement(prevPopup.instance);\n\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\n\tcontent?.hidePopover();\n\topenUI5BlockLayer?.showPopover();\n\n\tcontent?.showPopover();\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 patchDialog = (Dialog: OpenUI5DialogClass) => {\n\tconst key = \"Dialog.prototype.onsapescape\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Dialog.prototype.onsapescape };\n\t}\n\tconst origOnsapescape = PatchedFunctions[key].originalFn;\n\tDialog.prototype.onsapescape = function onsapescape(...args: any[]) {\n\t\tif (hasWebComponentPopupAbove(this.oPopup)) {\n\t\t\treturn;\n\t\t}\n\n\t\torigOnsapescape.apply(this, args);\n\t};\n};\n\nconst patchOpen = (Popup: OpenUI5PopupClass) => {\n\tconst key = \"Popup.prototype.open\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Popup.prototype.open };\n\t}\n\tconst origOpen = PatchedFunctions[key].originalFn;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\topenNativePopoverForOpenUI5(this);\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5PopupClass) => {\n\tconst key = \"Popup.prototype._closed\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Popup.prototype._closed };\n\t}\n\tconst _origClosed = PatchedFunctions[key].originalFn;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tcloseNativePopoverForOpenUI5(this);\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5PopupClass) => {\n\tconst key = \"Popup.prototype.onFocusEvent\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Popup.prototype.onFocusEvent };\n\t}\n\tconst origFocusEvent = PatchedFunctions[key].originalFn;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(...args: any[]) {\n\t\tif (!hasWebComponentPopupAbove(this)) {\n\t\t\torigFocusEvent.apply(this, args);\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: OpenUI5PopupClass, Dialog: OpenUI5DialogClass) => {\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\tpatchDialog(Dialog); // Dialog.prototype.onsapescape\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5PopupClass, OpenUI5DialogClass, PopupInfo };\n"],
|
|
5
|
-
"mappings": "aACA,OAAOA,MAAuB,0BAC9B,OAAOC,MAA8B,gCACrC,OAAOC,MAAiB,8BACxB,OAAS,mBAAAC,MAAuB,iBAShC,MAAMC,EAAmBJ,EAA4C,mBAAoB,CAAC,CAAC,EAErFK,EAAiBC,GAAyB,CAC/C,MAAMC,EAAWH,EAAiBE,CAAG,EAKrC,MAJI,CAACC,GAID,CAACA,EAAS,QACN,GAEDJ,EAAgBD,EAAaK,EAAS,OAAO,EAAI,CACzD,EAoCMC,EAA0BR,EAAwD,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIS,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EAEMC,EAAqBC,GAAkB,CAC5C,MAAMC,EAAQL,EAAwB,eAAe,UAAUM,GAAMA,EAAG,WAAaF,CAAK,EAEtFC,IAAUL,EAAwB,eAAe,OAAS,GAC7DO,EAAuB,EAGpBF,EAAQ,IACXL,EAAwB,eAAe,OAAOK,EAAO,CAAC,CAExD,EAEMG,EAAkB,I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AG,GAAG,YAAc6B,EAAM,UAAU,OAAQ,GAE1H,MAAMG,EAAclC,EAAiBE,CAAG,EAAE,WAC1C6B,EAAM,UAAU,QAAU,YAAoBF,EAAa,CAC1DR,EAA6B,IAAI,EACjCa,EAAY,MAAM,KAAML,CAAI,EAC5BtB,EAAkB,IAAI,CACvB,CACD,EAEM4B,EAAmBJ,GAA6B,CACrD,MAAM7B,EAAM,+BACRD,EAAcC,CAAG,IACpBF,EAAiBE,CAAG,EAAI,CAAE,QAASJ,EAAa,WAAYE,EAAiBE,CAAG,GAAG,YAAc6B,EAAM,UAAU,YAAa,GAE/H,MAAMK,EAAiBpC,EAAiBE,CAAG,EAAE,WAC7C6B,EAAM,UAAU,aAAe,YAAyBF,EAAa,CAC/DhB,EAA0B,IAAI,GAClCuB,EAAe,MAAM,KAAMP,CAAI,CAEjC,CACD,EAEMQ,EAAqB,IAAM,CAChC,MAAMC,EAAa,IAAI,cACvBA,EAAW,YAAY,+CAA+C,EACtE,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBA,CAAU,CAC1E,EAEMC,EAAa,CAACR,EAA0BJ,IAA+B,CAC5E9B,EAAyB,EACzBiC,EAAUC,CAAK,EACfE,EAAYF,CAAK,EACjBM,EAAmB,EACnBF,EAAgBJ,CAAK,EACrBL,EAAYC,CAAM,CACnB,EAEA,OACCY,KAAA,WACAlC,KAAA,eACAE,KAAA,kBACAK,KAAA",
|
|
4
|
+
"sourcesContent": ["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.js\";\nimport VersionInfo from \"../generated/VersionInfo.js\";\nimport { compareVersions } from \"../Runtimes.js\";\n\ntype PatchedFunctionRecord = {\n\tversion: VersionInfo | undefined;\n\toriginalFn: (...args: any[]) => any;\n};\n\ntype PatchedFunctionsRegistry = Record<string, PatchedFunctionRecord>;\n\nconst PatchedFunctions = getSharedResource<PatchedFunctionsRegistry>(\"PatchedFunctions\", {});\n\nconst shouldRepatch = (key: string): boolean => {\n\tconst existing = PatchedFunctions[key];\n\tif (!existing) {\n\t\treturn true;\n\t}\n\n\tif (!existing.version) {\n\t\treturn true;\n\t}\n\treturn compareVersions(VersionInfo, existing.version) > 0;\n};\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\topen: (...args: any[]) => void,\n\t_closed: (...args: any[]) => void,\n\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\tonFocusEvent: (...args: any[]) => void,\n\tgetModal: () => boolean\n};\n\ntype OpenUI5PopupClass = {\n\tprototype: OpenUI5Popup\n};\n\ntype OpenUI5DialogClass = {\n\tprototype: {\n\t\tonsapescape: (...args: any[]) => void,\n\t\toPopup: OpenUI5Popup,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"WebComponent\";\n\tinstance: object;\n} | {\n\ttype: \"OpenUI5\";\n\tinstance: OpenUI5Popup;\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\n\tif (index === AllOpenedPopupsRegistry.openedRegistry.length - 1) {\n\t\tfixTopmostOpenUI5Popup();\n\t}\n\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\tif (AllOpenedPopupsRegistry.openedRegistry.length === 0) {\n\t\treturn null;\n\t}\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Determines whether there is a Web Component popup opened above (a specified popup).\n *\n * @param {object} popup The popup instance to check against.\n * @returns {boolean} `true` if a Web Component popup is opened above (the given popup instance); otherwise `false`.\n */\nconst hasWebComponentPopupAbove = (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 === \"WebComponent\") {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst getPopupContentElement = (popup: OpenUI5Popup): HTMLElement | null => {\n\tconst content = popup.getContent();\n\treturn content instanceof HTMLElement ? content : content?.getDomRef() || null;\n};\n\nconst openNativePopoverForOpenUI5 = (popup: OpenUI5Popup) => {\n\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(popup.getOpenState());\n\tif (!openingInitiated || !isNativePopoverOpen()) {\n\t\treturn;\n\t}\n\n\tconst domRef = getPopupContentElement(popup);\n\n\tif (!domRef) {\n\t\treturn;\n\t}\n\n\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\n\tif (popup.getModal() && openUI5BlockLayer) {\n\t\topenUI5BlockLayer.setAttribute(\"popover\", \"manual\");\n\t\topenUI5BlockLayer.hidePopover();\n\t\topenUI5BlockLayer.showPopover();\n\t}\n\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.hidePopover();\n\tdomRef.showPopover();\n};\n\nconst closeNativePopoverForOpenUI5 = (popup: OpenUI5Popup) => {\n\tconst domRef = getPopupContentElement(popup);\n\n\tif (!domRef) {\n\t\treturn;\n\t}\n\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n\n\tif (getTopmostPopup() !== popup) {\n\t\treturn;\n\t}\n\n\t// The OpenUI5 block layer is only one for all modal OpenUI5 popups,\n\t// and it is displayed above all opened pupups - OpenUI5 and Web Components,\n\t// as a result, we need to hide this block layer.\n\t// If the underlying popup is a Web Component - it is displayed like a native popover, and we don't need to do anything\n\t// If the underlying popup is an OpenUI5 popup, it will be fixed in fixTopmostOpenUI5Popup method.\n\tif (popup.getModal()) {\n\t\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\t\tif (openUI5BlockLayer && openUI5BlockLayer.hasAttribute(\"popover\")) {\n\t\t\topenUI5BlockLayer.hidePopover();\n\t\t}\n\t}\n};\n\nconst fixTopmostOpenUI5Popup = () => {\n\tif (!isNativePopoverOpen()) {\n\t\treturn;\n\t}\n\n\tconst prevPopup = AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 2];\n\tif (!prevPopup\n\t\t|| prevPopup.type !== \"OpenUI5\"\n\t\t|| !prevPopup.instance.getModal()) {\n\t\treturn;\n\t}\n\n\tconst content = getPopupContentElement(prevPopup.instance);\n\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\n\tcontent?.hidePopover();\n\topenUI5BlockLayer?.showPopover();\n\n\tcontent?.showPopover();\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 patchDialog = (Dialog: OpenUI5DialogClass) => {\n\tconst key = \"Dialog.prototype.onsapescape\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Dialog.prototype.onsapescape };\n\t}\n\tconst origOnsapescape = PatchedFunctions[key].originalFn;\n\tDialog.prototype.onsapescape = function onsapescape(...args: any[]) {\n\t\tif (hasWebComponentPopupAbove(this.oPopup)) {\n\t\t\treturn;\n\t\t}\n\n\t\torigOnsapescape.apply(this, args);\n\t};\n};\n\nconst patchOpen = (Popup: OpenUI5PopupClass) => {\n\tconst key = \"Popup.prototype.open\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Popup.prototype.open };\n\t}\n\tconst origOpen = PatchedFunctions[key].originalFn;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\topenNativePopoverForOpenUI5(this);\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5PopupClass) => {\n\tconst key = \"Popup.prototype._closed\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Popup.prototype._closed };\n\t}\n\tconst _origClosed = PatchedFunctions[key].originalFn;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tcloseNativePopoverForOpenUI5(this);\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5PopupClass) => {\n\tconst key = \"Popup.prototype.onFocusEvent\";\n\tif (shouldRepatch(key)) {\n\t\tPatchedFunctions[key] = { version: VersionInfo, originalFn: PatchedFunctions[key]?.originalFn ?? Popup.prototype.onFocusEvent };\n\t}\n\tconst origFocusEvent = PatchedFunctions[key].originalFn;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(...args: any[]) {\n\t\tif (!hasWebComponentPopupAbove(this)) {\n\t\t\torigFocusEvent.apply(this, args);\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: OpenUI5PopupClass, Dialog: OpenUI5DialogClass) => {\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\tpatchDialog(Dialog); // Dialog.prototype.onsapescape\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5PopupClass, OpenUI5DialogClass, PopupInfo };\n"],
|
|
5
|
+
"mappings": "aACA,OAAOA,MAAuB,0BAC9B,OAAOC,MAA8B,gCACrC,OAAOC,MAAiB,8BACxB,OAAS,mBAAAC,MAAuB,iBAShC,MAAMC,EAAmBJ,EAA4C,mBAAoB,CAAC,CAAC,EAErFK,EAAiBC,GAAyB,CAC/C,MAAMC,EAAWH,EAAiBE,CAAG,EAKrC,MAJI,CAACC,GAID,CAACA,EAAS,QACN,GAEDJ,EAAgBD,EAAaK,EAAS,OAAO,EAAI,CACzD,EAoCMC,EAA0BR,EAAwD,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIS,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EAEMC,EAAqBC,GAAkB,CAC5C,MAAMC,EAAQL,EAAwB,eAAe,UAAUM,GAAMA,EAAG,WAAaF,CAAK,EAEtFC,IAAUL,EAAwB,eAAe,OAAS,GAC7DO,EAAuB,EAGpBF,EAAQ,IACXL,EAAwB,eAAe,OAAOK,EAAO,CAAC,CAExD,EAEMG,EAA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EAAa,WAAYE,EAAiBE,CAAG,GAAG,YAAc6B,EAAM,UAAU,OAAQ,GAE1H,MAAMG,EAAclC,EAAiBE,CAAG,EAAE,WAC1C6B,EAAM,UAAU,QAAU,YAAoBF,EAAa,CAC1DR,EAA6B,IAAI,EACjCa,EAAY,MAAM,KAAML,CAAI,EAC5BtB,EAAkB,IAAI,CACvB,CACD,EAEM4B,EAAmBJ,GAA6B,CACrD,MAAM7B,EAAM,+BACRD,EAAcC,CAAG,IACpBF,EAAiBE,CAAG,EAAI,CAAE,QAASJ,EAAa,WAAYE,EAAiBE,CAAG,GAAG,YAAc6B,EAAM,UAAU,YAAa,GAE/H,MAAMK,EAAiBpC,EAAiBE,CAAG,EAAE,WAC7C6B,EAAM,UAAU,aAAe,YAAyBF,EAAa,CAC/DhB,EAA0B,IAAI,GAClCuB,EAAe,MAAM,KAAMP,CAAI,CAEjC,CACD,EAEMQ,EAAqB,IAAM,CAChC,MAAMC,EAAa,IAAI,cACvBA,EAAW,YAAY,+CAA+C,EACtE,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBA,CAAU,CAC1E,EAEMC,EAAa,CAACR,EAA0BJ,IAA+B,CAC5E9B,EAAyB,EACzBiC,EAAUC,CAAK,EACfE,EAAYF,CAAK,EACjBM,EAAmB,EACnBF,EAAgBJ,CAAK,EACrBL,EAAYC,CAAM,CACnB,EAEA,OACCY,KAAA,WACAlC,KAAA,eACAE,KAAA,kBACAK,KAAA",
|
|
6
6
|
"names": ["getSharedResource", "insertOpenUI5PopupStyles", "VersionInfo", "compareVersions", "PatchedFunctions", "shouldRepatch", "key", "existing", "AllOpenedPopupsRegistry", "addOpenedPopup", "popupInfo", "removeOpenedPopup", "popup", "index", "el", "fixTopmostOpenUI5Popup", "getTopmostPopup", "hasWebComponentPopupAbove", "i", "getPopupContentElement", "content", "openNativePopoverForOpenUI5", "isNativePopoverOpen", "domRef", "openUI5BlockLayer", "closeNativePopoverForOpenUI5", "prevPopup", "root", "element", "shadowRoot", "patchDialog", "Dialog", "origOnsapescape", "args", "patchOpen", "Popup", "origOpen", "patchClosed", "_origClosed", "patchFocusEvent", "origFocusEvent", "createGlobalStyles", "stylesheet", "patchPopup"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e={version:"2.23.
|
|
1
|
+
"use strict";const e={version:"2.23.1",major:2,minor:23,patch:1,suffix:"",isNext:!1,buildTime:1781204653};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.23.
|
|
5
|
-
"mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,
|
|
4
|
+
"sourcesContent": ["const VersionInfo = {\n\tversion: \"2.23.1\",\n\tmajor: 2,\n\tminor: 23,\n\tpatch: 1,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1781204653,\n};\nexport default VersionInfo;"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAc,CACnB,QAAS,SACT,MAAO,EACP,MAAO,GACP,MAAO,EACP,OAAQ,GACR,OAAQ,GACR,UAAW,UACZ,EACA,eAAeA",
|
|
6
6
|
"names": ["VersionInfo"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "2.23.
|
|
3
|
+
"version": "2.23.1",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@openui5/sap.ui.core": "1.146.0",
|
|
67
67
|
"@sap-theming/theming-base-content": "11.36.3",
|
|
68
68
|
"@ui5/cypress-internal": "0.1.0",
|
|
69
|
-
"@ui5/webcomponents-tools": "2.23.
|
|
69
|
+
"@ui5/webcomponents-tools": "2.23.1",
|
|
70
70
|
"clean-css": "^5.2.2",
|
|
71
71
|
"cypress": "15.9.0",
|
|
72
72
|
"mocha": "^11.7.2",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"customElements": "dist/custom-elements.json",
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "333345b4664ee82150b1071abc28b63d07792d07"
|
|
89
89
|
}
|