@ui5/webcomponents-base 2.17.0-rc.4 → 2.17.0

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/.tsbuildinfobuild +1 -1
  3. package/dist/UI5Element.js.map +1 -1
  4. package/dist/features/OpenUI5Support.js +3 -3
  5. package/dist/features/OpenUI5Support.js.map +1 -1
  6. package/dist/features/patchPopup.d.ts +1 -1
  7. package/dist/features/patchPopup.js +1 -2
  8. package/dist/features/patchPopup.js.map +1 -1
  9. package/dist/generated/VersionInfo.js +3 -3
  10. package/dist/generated/VersionInfo.js.map +1 -1
  11. package/dist/generated/css/BusyIndicator.css.d.ts +1 -1
  12. package/dist/generated/css/BusyIndicator.css.js +1 -1
  13. package/dist/generated/css/BusyIndicator.css.js.map +1 -1
  14. package/dist/generated/css/MultipleDragGhost.css.d.ts +1 -1
  15. package/dist/generated/css/MultipleDragGhost.css.js +1 -1
  16. package/dist/generated/css/MultipleDragGhost.css.js.map +1 -1
  17. package/dist/generated/css/ScrollbarStyles.css.d.ts +1 -1
  18. package/dist/generated/css/ScrollbarStyles.css.js +1 -1
  19. package/dist/generated/css/ScrollbarStyles.css.js.map +1 -1
  20. package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
  21. package/dist/generated/css/SystemCSSVars.css.js +1 -1
  22. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  23. package/dist/prod/UI5Element.js.map +1 -1
  24. package/dist/prod/features/OpenUI5Support.js +1 -1
  25. package/dist/prod/features/OpenUI5Support.js.map +3 -3
  26. package/dist/prod/features/patchPopup.js +1 -1
  27. package/dist/prod/features/patchPopup.js.map +3 -3
  28. package/dist/prod/generated/VersionInfo.js +1 -1
  29. package/dist/prod/generated/VersionInfo.js.map +1 -1
  30. package/dist/prod/generated/css/BusyIndicator.css.js +1 -1
  31. package/dist/prod/generated/css/BusyIndicator.css.js.map +1 -1
  32. package/dist/prod/generated/css/MultipleDragGhost.css.js +1 -1
  33. package/dist/prod/generated/css/MultipleDragGhost.css.js.map +1 -1
  34. package/dist/prod/generated/css/ScrollbarStyles.css.js +1 -1
  35. package/dist/prod/generated/css/ScrollbarStyles.css.js.map +1 -1
  36. package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
  37. package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
  38. package/dist/prod/theming/applyTheme.js +1 -1
  39. package/dist/prod/theming/applyTheme.js.map +3 -3
  40. package/dist/prod/util/SelectionAssistant.js.map +1 -1
  41. package/dist/theming/applyTheme.js +29 -15
  42. package/dist/theming/applyTheme.js.map +1 -1
  43. package/dist/types.d.ts +1 -0
  44. package/dist/types.js.map +1 -1
  45. package/dist/util/SelectionAssistant.js.map +1 -1
  46. package/package-scripts.cjs +3 -3
  47. package/package.json +3 -6
@@ -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\";\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: (...args: any[]) => void,\n\t}\n};\n\ntype OpenUI5PopupBasedControl = {\n\tprototype: {\n\t\tonsapescape: (...args: any[]) => void,\n\t\toPopup: OpenUI5Popup,\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 * 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 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 patchPopupBasedControl = (PopupBasedControl: OpenUI5PopupBasedControl) => {\n\tconst origOnsapescape = PopupBasedControl.prototype.onsapescape;\n\tPopupBasedControl.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: 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(...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: OpenUI5Popup, Dialog: OpenUI5PopupBasedControl, Popover: OpenUI5PopupBasedControl) => {\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\tpatchPopupBasedControl(Dialog); // Dialog.prototype.onsapescape\n\tpatchPopupBasedControl(Popover); // Popover.prototype.onsapescape\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, OpenUI5PopupBasedControl, PopupInfo };\n"],
5
- "mappings": "aACA,OAAOA,MAAuB,0BAC9B,OAAOC,MAA8B,gCA8BrC,MAAMC,EAA0BF,EAAwD,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIG,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EAEMC,EAAqBC,GAAkB,CAC5C,MAAMC,EAAQL,EAAwB,eAAe,UAAUM,GAAMA,EAAG,WAAaF,CAAK,EACtFC,EAAQ,IACXL,EAAwB,eAAe,OAAOK,EAAO,CAAC,CAExD,EAEME,EAAkB,IAChBP,EAAwB,eAAeA,EAAwB,eAAe,OAAS,CAAC,EAAE,SAS5FQ,EAA6BJ,GAAkB,CACpD,QAASK,EAAIT,EAAwB,eAAe,OAAS,EAAGS,GAAK,EAAGA,IAAK,CAC5E,MAAMP,EAAYF,EAAwB,eAAeS,CAAC,EAC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mB,YAAcA,EAAUA,GAAS,UAAU,EAC7EW,EAAY,MAAM,KAAMN,CAAI,EACxBT,GACHC,EAAmBD,CAAM,EAG1BR,EAAkB,IAAI,CACvB,CACD,EAEMwB,EAAmBL,GAAwB,CAChD,MAAMM,EAAiBN,EAAM,UAAU,aACvCA,EAAM,UAAU,aAAe,YAAyBF,EAAa,CAC/DZ,EAA0B,IAAI,GAClCoB,EAAe,MAAM,KAAMR,CAAI,CAEjC,CACD,EAEMS,EAAqB,IAAM,CAChC,MAAMC,EAAa,IAAI,cACvBA,EAAW,YAAY,+CAA+C,EACtE,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBA,CAAU,CAC1E,EAEMC,EAAa,CAACT,EAAqBU,EAAkCC,IAAsC,CAChHlC,EAAyB,EACzBsB,EAAUC,CAAK,EACfG,EAAYH,CAAK,EACjBO,EAAmB,EACnBF,EAAgBL,CAAK,EACrBL,EAAuBe,CAAM,EAC7Bf,EAAuBgB,CAAO,CAC/B,EAEA,OACCF,KAAA,WACA9B,KAAA,eACAE,KAAA,kBACAI,KAAA",
6
- "names": ["getSharedResource", "insertOpenUI5PopupStyles", "AllOpenedPopupsRegistry", "addOpenedPopup", "popupInfo", "removeOpenedPopup", "popup", "index", "el", "getTopmostPopup", "hasWebComponentPopupAbove", "i", "openNativePopover", "domRef", "closeNativePopover", "isNativePopoverOpen", "root", "element", "shadowRoot", "patchPopupBasedControl", "PopupBasedControl", "origOnsapescape", "args", "patchOpen", "Popup", "origOpen", "topLayerAlreadyInUse", "patchClosed", "_origClosed", "patchFocusEvent", "origFocusEvent", "createGlobalStyles", "stylesheet", "patchPopup", "Dialog", "Popover"]
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: (...args: any[]) => void,\n\t}\n};\n\ntype OpenUI5PopupBasedControl = {\n\tprototype: {\n\t\tonsapescape: (...args: any[]) => void,\n\t\toPopup: OpenUI5Popup,\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 * 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 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 patchPopupBasedControl = (PopupBasedControl: OpenUI5PopupBasedControl) => {\n\tconst origOnsapescape = PopupBasedControl.prototype.onsapescape;\n\tPopupBasedControl.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: 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(...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: OpenUI5Popup, Dialog: OpenUI5PopupBasedControl) => {\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\tpatchPopupBasedControl(Dialog); // Dialog.prototype.onsapescape\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, OpenUI5PopupBasedControl, PopupInfo };\n"],
5
+ "mappings": "aACA,OAAOA,MAAuB,0BAC9B,OAAOC,MAA8B,gCA8BrC,MAAMC,EAA0BF,EAAwD,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIG,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EA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,CAC7C,MAAMT,EAAU,KAAK,WAAW,EAChC,GAAIA,EAAS,CACZ,MAAMJ,EAASI,aAAmB,YAAcA,EAAUA,GAAS,UAAU,EACzEJ,GACHD,EAAkBC,CAAM,CAE1B,CACD,CAEAV,EAAe,CACd,KAAM,UACN,SAAU,IACX,CAAC,CACF,CACD,EAEMwB,EAAeH,GAAwB,CAC5C,MAAMI,EAAcJ,EAAM,UAAU,QACpCA,EAAM,UAAU,QAAU,YAAoBF,EAAa,CAC1D,MAAML,EAAU,KAAK,WAAW,EAC1BJ,EAASI,aAAmB,YAAcA,EAAUA,GAAS,UAAU,EAC7EW,EAAY,MAAM,KAAMN,CAAI,EACxBT,GACHC,EAAmBD,CAAM,EAG1BR,EAAkB,IAAI,CACvB,CACD,EAEMwB,EAAmBL,GAAwB,CAChD,MAAMM,EAAiBN,EAAM,UAAU,aACvCA,EAAM,UAAU,aAAe,YAAyBF,EAAa,CAC/DZ,EAA0B,IAAI,GAClCoB,EAAe,MAAM,KAAMR,CAAI,CAEjC,CACD,EAEMS,EAAqB,IAAM,CAChC,MAAMC,EAAa,IAAI,cACvBA,EAAW,YAAY,+CAA+C,EACtE,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBA,CAAU,CAC1E,EAEMC,EAAa,CAACT,EAAqBU,IAAqC,CAC7EjC,EAAyB,EACzBsB,EAAUC,CAAK,EACfG,EAAYH,CAAK,EACjBO,EAAmB,EACnBF,EAAgBL,CAAK,EACrBL,EAAuBe,CAAM,CAC9B,EAEA,OACCD,KAAA,WACA9B,KAAA,eACAE,KAAA,kBACAI,KAAA",
6
+ "names": ["getSharedResource", "insertOpenUI5PopupStyles", "AllOpenedPopupsRegistry", "addOpenedPopup", "popupInfo", "removeOpenedPopup", "popup", "index", "el", "getTopmostPopup", "hasWebComponentPopupAbove", "i", "openNativePopover", "domRef", "closeNativePopover", "isNativePopoverOpen", "root", "element", "shadowRoot", "patchPopupBasedControl", "PopupBasedControl", "origOnsapescape", "args", "patchOpen", "Popup", "origOpen", "topLayerAlreadyInUse", "patchClosed", "_origClosed", "patchFocusEvent", "origFocusEvent", "createGlobalStyles", "stylesheet", "patchPopup", "Dialog"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";const e={version:"2.17.0-rc.3",major:2,minor:17,patch:0,suffix:"-rc.3",isNext:!1,buildTime:1764230736};export default e;
1
+ "use strict";const e={version:"2.17.0-rc.5",major:2,minor:17,patch:0,suffix:"-rc.5",isNext:!1,buildTime:1764932292};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.17.0-rc.3\",\n\tmajor: 2,\n\tminor: 17,\n\tpatch: 0,\n\tsuffix: \"-rc.3\",\n\tisNext: false,\n\tbuildTime: 1764230736,\n};\nexport default VersionInfo;"],
4
+ "sourcesContent": ["const VersionInfo = {\n\tversion: \"2.17.0-rc.5\",\n\tmajor: 2,\n\tminor: 17,\n\tpatch: 0,\n\tsuffix: \"-rc.5\",\n\tisNext: false,\n\tbuildTime: 1764932292,\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";export default".busy-indicator-wrapper{position:relative;height:100%;width:100%}.busy-indicator-overlay{display:var(--ui5-v2-17-0-rc-3_web_components_busy_indicator_display);position:absolute;inset:0;background:var(--ui5-v2-17-0-rc-3_web_components_busy_indicator_background-color);z-index:99}.busy-indicator-busy-area{display:var(--ui5-v2-17-0-rc-3_web_components_busy_indicator_display);position:absolute;z-index:99;inset:0;justify-content:center;align-items:center;background-color:inherit;flex-direction:column;color:var(--_ui5-v2-17-0-rc-3_busy_indicator_color)}:host([__is-busy]) .busy-indicator-wrapper>:not(.busy-indicator-busy-area):not(.busy-indicator-overlay):not([busy-indicator-before-span]){--ui5-v2-17-0-rc-3_web_components_busy_indicator_display:none}.busy-indicator-busy-area:focus{outline:var(--_ui5-v2-17-0-rc-3_busy_indicator_focus_outline);outline-offset:-.125rem}.busy-indicator-circle{width:1rem;height:1rem;display:inline-block;background-color:currentColor;border-radius:50%}.circle-animation-0{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11)}.circle-animation-1{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.2s}.circle-animation-2{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.4s}.sapUiLocalBusy{--ui5-v2-17-0-rc-3_web_components_busy_indicator_display:none}.busy-indicator-wrapper [ui5-busy-indicator]{display:none}@keyframes grow{0%,100%,50%{-webkit-transform:scale(.5);-moz-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}25%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}";
1
+ "use strict";export default".busy-indicator-wrapper{position:relative;height:100%;width:100%}.busy-indicator-overlay{display:var(--ui5_web_components_busy_indicator_display);position:absolute;inset:0;background:var(--ui5_web_components_busy_indicator_background-color);z-index:99}.busy-indicator-busy-area{display:var(--ui5_web_components_busy_indicator_display);position:absolute;z-index:99;inset:0;justify-content:center;align-items:center;background-color:inherit;flex-direction:column;color:var(--_ui5_busy_indicator_color)}:host([__is-busy]) .busy-indicator-wrapper>:not(.busy-indicator-busy-area):not(.busy-indicator-overlay):not([busy-indicator-before-span]){--ui5_web_components_busy_indicator_display:none}.busy-indicator-busy-area:focus{outline:var(--_ui5_busy_indicator_focus_outline);outline-offset:-.125rem}.busy-indicator-circle{width:1rem;height:1rem;display:inline-block;background-color:currentColor;border-radius:50%}.circle-animation-0{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11)}.circle-animation-1{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.2s}.circle-animation-2{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.4s}.sapUiLocalBusy{--ui5_web_components_busy_indicator_display:none}.busy-indicator-wrapper [ui5-busy-indicator]{display:none}@keyframes grow{0%,100%,50%{-webkit-transform:scale(.5);-moz-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}25%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}";
2
2
  //# sourceMappingURL=BusyIndicator.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/generated/css/BusyIndicator.css.ts"],
4
- "sourcesContent": ["export default `.busy-indicator-wrapper{position:relative;height:100%;width:100%}.busy-indicator-overlay{display:var(--ui5-v2-17-0-rc-3_web_components_busy_indicator_display);position:absolute;inset:0;background:var(--ui5-v2-17-0-rc-3_web_components_busy_indicator_background-color);z-index:99}.busy-indicator-busy-area{display:var(--ui5-v2-17-0-rc-3_web_components_busy_indicator_display);position:absolute;z-index:99;inset:0;justify-content:center;align-items:center;background-color:inherit;flex-direction:column;color:var(--_ui5-v2-17-0-rc-3_busy_indicator_color)}:host([__is-busy]) .busy-indicator-wrapper>:not(.busy-indicator-busy-area):not(.busy-indicator-overlay):not([busy-indicator-before-span]){--ui5-v2-17-0-rc-3_web_components_busy_indicator_display:none}.busy-indicator-busy-area:focus{outline:var(--_ui5-v2-17-0-rc-3_busy_indicator_focus_outline);outline-offset:-.125rem}.busy-indicator-circle{width:1rem;height:1rem;display:inline-block;background-color:currentColor;border-radius:50%}.circle-animation-0{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11)}.circle-animation-1{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.2s}.circle-animation-2{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.4s}.sapUiLocalBusy{--ui5-v2-17-0-rc-3_web_components_busy_indicator_display:none}.busy-indicator-wrapper [ui5-busy-indicator]{display:none}@keyframes grow{0%,100%,50%{-webkit-transform:scale(.5);-moz-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}25%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}`;"],
4
+ "sourcesContent": ["export default `.busy-indicator-wrapper{position:relative;height:100%;width:100%}.busy-indicator-overlay{display:var(--ui5_web_components_busy_indicator_display);position:absolute;inset:0;background:var(--ui5_web_components_busy_indicator_background-color);z-index:99}.busy-indicator-busy-area{display:var(--ui5_web_components_busy_indicator_display);position:absolute;z-index:99;inset:0;justify-content:center;align-items:center;background-color:inherit;flex-direction:column;color:var(--_ui5_busy_indicator_color)}:host([__is-busy]) .busy-indicator-wrapper>:not(.busy-indicator-busy-area):not(.busy-indicator-overlay):not([busy-indicator-before-span]){--ui5_web_components_busy_indicator_display:none}.busy-indicator-busy-area:focus{outline:var(--_ui5_busy_indicator_focus_outline);outline-offset:-.125rem}.busy-indicator-circle{width:1rem;height:1rem;display:inline-block;background-color:currentColor;border-radius:50%}.circle-animation-0{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11)}.circle-animation-1{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.2s}.circle-animation-2{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.4s}.sapUiLocalBusy{--ui5_web_components_busy_indicator_display:none}.busy-indicator-wrapper [ui5-busy-indicator]{display:none}@keyframes grow{0%,100%,50%{-webkit-transform:scale(.5);-moz-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}25%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}`;"],
5
5
  "mappings": "aAAA,cAAe",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";export default":host{justify-content:center;align-items:center;display:flex;color:var(--ui5-sapList_TextColor);background-color:var(--ui5-sapList_Background);font-family:var(--ui5-sapFontFamily);height:var(--ui5-sapElement_LineHeight);border-bottom:var(--ui5-sapList_BorderWidth) solid var(--ui5-sapList_BorderColor);opacity:.8;position:absolute;padding:0 1rem;top:-1000px;left:-1000px}";
1
+ "use strict";export default":host{justify-content:center;align-items:center;display:flex;color:var(--sapList_TextColor);background-color:var(--sapList_Background);font-family:var(--sapFontFamily);height:var(--sapElement_LineHeight);border-bottom:var(--sapList_BorderWidth) solid var(--sapList_BorderColor);opacity:.8;position:absolute;padding:0 1rem;top:-1000px;left:-1000px}";
2
2
  //# sourceMappingURL=MultipleDragGhost.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/generated/css/MultipleDragGhost.css.ts"],
4
- "sourcesContent": ["export default `:host{justify-content:center;align-items:center;display:flex;color:var(--ui5-sapList_TextColor);background-color:var(--ui5-sapList_Background);font-family:var(--ui5-sapFontFamily);height:var(--ui5-sapElement_LineHeight);border-bottom:var(--ui5-sapList_BorderWidth) solid var(--ui5-sapList_BorderColor);opacity:.8;position:absolute;padding:0 1rem;top:-1000px;left:-1000px}`;"],
4
+ "sourcesContent": ["export default `:host{justify-content:center;align-items:center;display:flex;color:var(--sapList_TextColor);background-color:var(--sapList_Background);font-family:var(--sapFontFamily);height:var(--sapElement_LineHeight);border-bottom:var(--sapList_BorderWidth) solid var(--sapList_BorderColor);opacity:.8;position:absolute;padding:0 1rem;top:-1000px;left:-1000px}`;"],
5
5
  "mappings": "aAAA,cAAe",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";export default"html:not(.ui5-content-native-scrollbars){scrollbar-color:var(--ui5-sapScrollBar_FaceColor) var(--ui5-sapScrollBar_TrackColor)}";
1
+ "use strict";export default"html:not(.ui5-content-native-scrollbars){scrollbar-color:var(--sapScrollBar_FaceColor) var(--sapScrollBar_TrackColor)}";
2
2
  //# sourceMappingURL=ScrollbarStyles.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/generated/css/ScrollbarStyles.css.ts"],
4
- "sourcesContent": ["export default `html:not(.ui5-content-native-scrollbars){scrollbar-color:var(--ui5-sapScrollBar_FaceColor) var(--ui5-sapScrollBar_TrackColor)}`;"],
4
+ "sourcesContent": ["export default `html:not(.ui5-content-native-scrollbars){scrollbar-color:var(--sapScrollBar_FaceColor) var(--sapScrollBar_TrackColor)}`;"],
5
5
  "mappings": "aAAA,cAAe",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";export default":root{--_ui5-v2-17-0-rc-3_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5-v2-17-0-rc-3_content_density:compact}";
1
+ "use strict";export default":root{--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5_content_density:compact}";
2
2
  //# sourceMappingURL=SystemCSSVars.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/generated/css/SystemCSSVars.css.ts"],
4
- "sourcesContent": ["export default `:root{--_ui5-v2-17-0-rc-3_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5-v2-17-0-rc-3_content_density:compact}`;"],
4
+ "sourcesContent": ["export default `:root{--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5_content_density:compact}`;"],
5
5
  "mappings": "aAAA,cAAe",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{getThemeProperties as i,getRegisteredPackages as n,isThemeRegistered as g}from"../asset-registries/Themes.js";import{createOrUpdateStyle as c}from"../ManagedStyles.js";import p from"./getThemeDesignerTheme.js";import{fireThemeLoaded as T}from"./ThemeLoaded.js";import{attachCustomThemeStylesToHead as d,getThemeRoot as f}from"../config/ThemeRoot.js";import{DEFAULT_THEME as h}from"../generated/AssetParameters.js";import{getCurrentRuntimeIndex as l}from"../Runtimes.js";export let _lib="ui5",_package="webcomponents-theming";const a="@"+_lib+"/"+_package,u=()=>n().has(a),P=async e=>{if(!u())return;const t=await i(a,e);t&&c(t,"data-ui5-theme-properties",a,e)},y=async(e,t)=>{const s=[...n()].map(async r=>{if(r===a)return;const o=await i(r,e,t);o&&c(o,`data-ui5-component-properties-${l()}`,r)});return Promise.all(s)},k=async e=>{f()&&await d(e);const t=p();if(t)return t},E=async e=>{const t=await k(e),s=(g(e)?e:t&&t.baseThemeName)||h;await P(s),await y(s,t&&t.themeName===e?e:void 0),T(e)};export default E;
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 { createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.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 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\tif (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\t}\n\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\nconst applyTheme = async (theme: string) => {\n\t// Detect external theme if available (e.g., from theme designer or custom theme root)\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Determine which theme to use for component packages:\n\t// 1. If the requested theme is registered, use it directly\n\t// 2. If external theme exists, use its base theme (e.g., \"my_custom_theme\" extends \"sap_fiori_3\")\n\t// 3. Otherwise, fallback to the default theme\n\tconst packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;\n\tconst effectiveTheme = packagesTheme || DEFAULT_THEME;\n\n\t// Load base theme properties\n\tawait loadThemeBase(effectiveTheme);\n\n\t// Load component-specific theme properties\n\t// Pass external theme name only if it matches the requested theme to avoid conflicts\n\tawait loadComponentPackages(effectiveTheme, 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,uBAAAC,MAA2B,sBACpC,OAAOC,MAA2B,6BAClC,OAAS,mBAAAC,MAAuB,mBAChC,OAAS,iCAAAC,EAA+B,gBAAAC,MAAoB,yBAC5D,OAAS,iBAAAC,MAAqB,kCAC9B,OAAS,0BAAAC,MAA8B,iBAGhC,WAAI,KAAO,MAEP,SAAW,wBAEtB,MAAMC,EAAqB,IAAM,KAAO,IAAM,SAExCC,EAAwB,IACFV,EAAsB,EACvB,IAAIS,CAAkB,EAG3CE,EAAgB,MAAOC,GAAkB,CAC9C,GAAI,CAACF,EAAsB,EAC1B,OAGD,MAAMG,EAAU,MAAMd,EAAmBU,EAAoBG,CAAK,EAC9DC,GACHX,EAAoBW,EAAS,4BAA6BJ,EAAoBG,CAAK,CAErF,EAEME,EAAwB,MAAOF,EAAeG,IAA+B,CAGlF,MAAMC,EAAyB,CAAC,GAFLhB,EAAsB,CAEI,EAAE,IAAI,MAAMiB,GAAe,CAC/E,GAAIA,IAAgBR,EACnB,OAGD,MAAMI,EAAU,MAAMd,EAAmBkB,EAAaL,EAAOG,CAAiB,EAC1EF,GACHX,EAAoBW,EAAS,iCAAiCL,EAAuB,CAAC,GAAIS,CAAW,CAEvG,CAAC,EAED,OAAO,QAAQ,IAAID,CAAsB,CAC1C,EAEME,EAAsB,MAAON,GAAkB,CAChDN,EAAa,GAChB,MAAMD,EAA8BO,CAAK,EAI1C,MAAMO,EAAWhB,EAAsB,EACvC,GAAIgB,EACH,OAAOA,CAET,EAEMC,EAAa,MAAOR,GAAkB,CAE3C,MAAMO,EAAW,MAAMD,EAAoBN,CAAK,EAO1CS,GADgBpB,EAAkBW,CAAK,EAAIA,EAAQO,GAAYA,EAAS,gBACtCZ,EAGxC,MAAMI,EAAcU,CAAc,EAIlC,MAAMP,EAAsBO,EAAgBF,GAAYA,EAAS,YAAcP,EAAQA,EAAQ,MAAS,EAExGR,EAAgBQ,CAAK,CACtB,EAEA,eAAeQ",
6
- "names": ["getThemeProperties", "getRegisteredPackages", "isThemeRegistered", "createOrUpdateStyle", "getThemeDesignerTheme", "fireThemeLoaded", "attachCustomThemeStylesToHead", "getThemeRoot", "DEFAULT_THEME", "getCurrentRuntimeIndex", "BASE_THEME_PACKAGE", "isThemeBaseRegistered", "loadThemeBase", "theme", "cssData", "loadComponentPackages", "externalThemeName", "packagesStylesPromises", "packageName", "detectExternalTheme", "extTheme", "applyTheme", "effectiveTheme"]
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,EAAgB,MAAOC,GAAkB,CAC9C,GAAI,CAACF,EAAsB,EAC1B,OAGD,MAA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"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
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/util/SelectionAssistant.ts"],
4
- "sourcesContent": ["const copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tconst computedStyles = getComputedStyle(element);\n\n\tfor (let i = 0; i < computedStyles.length; i++) {\n\t\tconst propertyName = computedStyles[i];\n\t\tcopiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));\n\t}\n\n\telement.tagName === \"INPUT\" && setInputSpecificStyles(copiedElement);\n\n\tcopiedElement.style.position = \"absolute\";\n\tcopiedElement.style.left = `${element.getBoundingClientRect().left}px`;\n\tcopiedElement.style.top = `${element.getBoundingClientRect().top}px`;\n\n\tsetUnInteractableStyles(copiedElement);\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst setUnInteractableStyles = (element: HTMLElement) => {\n\telement.style.position = \"absolute\";\n\telement.style.userSelect = \"none\";\n\telement.style.pointerEvents = \"none\";\n\telement.style.zIndex = \"-1\";\n\telement.style.opacity = \"0\";\n};\n\nconst setInputSpecificStyles = (element: HTMLElement) => {\n\telement.style.whiteSpace = \"nowrap\";\n\telement.style.overflowX = \"auto\";\n\telement.style.overflowY = \"hidden\";\n};\n\nconst createCopy = () => {\n\tconst copiedElement = document.createElement(\"div\");\n\n\tcopiedElement.id = \"ui5-selection-mirror\";\n\tcopiedElement.contentEditable = \"true\";\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tcopiedElement.scrollTop = element.scrollTop;\n\tcopiedElement.scrollLeft = element.scrollLeft;\n};\n\nconst getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {\n\tconst { selectionStart, selectionEnd } = element;\n\tconst selectedText = element.value.slice(\n\t\tselectionStart!,\n\t\telement.selectionEnd!,\n\t);\n\tconst range = document.createRange();\n\n\trange.setStart(mirror.firstChild!, selectionEnd! - 1);\n\trange.setEnd(mirror.firstChild!, selectionEnd!);\n\n\tapplyScrollPosition(element, mirror);\n\n\tconst rangeRect = range.getBoundingClientRect();\n\tconst rectObject = {\n\t\tx: rangeRect.x,\n\t\ty: rangeRect.y,\n\t\twidth: rangeRect.width,\n\t\theight: rangeRect.height,\n\t\ttop: rangeRect.top,\n\t\tright: rangeRect.right,\n\t\tbottom: rangeRect.bottom,\n\t\tleft: rangeRect.left,\n\t};\n\n\tdocument.body.removeChild(mirror);\n\n\treturn { ...rectObject, selectedText };\n};\n\nconst getElementSelection = (element: HTMLElement) => {\n\tconst innerElement = element.shadowRoot!.querySelector(\"textarea\")\n\t\t|| element.shadowRoot!.querySelector(\"input\");\n\n\tif (!document.getElementById(\"ui5-selection-mirror\")) {\n\t\tcreateCopy();\n\t}\n\n\tconst copiedElement = document.getElementById(\n\t\t\"ui5-selection-mirror\",\n\t)!;\n\n\tcopiedElement.textContent = innerElement!.value;\n\n\tif (innerElement) {\n\t\tcopyAndApplyStyles(innerElement, copiedElement)!;\n\t}\n\n\treturn getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);\n};\n\nexport default getElementSelection;\n"],
4
+ "sourcesContent": ["const copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tconst computedStyles = getComputedStyle(element);\n\n\tfor (let i = 0; i < computedStyles.length; i++) {\n\t\tconst propertyName = computedStyles[i];\n\t\tcopiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));\n\t}\n\n\telement.tagName === \"INPUT\" && setInputSpecificStyles(copiedElement);\n\n\tcopiedElement.style.position = \"absolute\";\n\tcopiedElement.style.left = `${element.getBoundingClientRect().left}px`;\n\tcopiedElement.style.top = `${element.getBoundingClientRect().top}px`;\n\n\tsetUnInteractableStyles(copiedElement);\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst setUnInteractableStyles = (element: HTMLElement) => {\n\telement.style.position = \"absolute\";\n\telement.style.userSelect = \"none\";\n\telement.style.pointerEvents = \"none\";\n\telement.style.zIndex = \"-1\";\n\telement.style.opacity = \"0\";\n};\n\nconst setInputSpecificStyles = (element: HTMLElement) => {\n\telement.style.whiteSpace = \"nowrap\";\n\telement.style.overflowX = \"auto\";\n\telement.style.overflowY = \"hidden\";\n};\n\nconst createCopy = () => {\n\tconst copiedElement = document.createElement(\"div\");\n\n\tcopiedElement.id = \"ui5-selection-mirror\";\n\tcopiedElement.contentEditable = \"true\";\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tcopiedElement.scrollTop = element.scrollTop;\n\tcopiedElement.scrollLeft = element.scrollLeft;\n};\n\nconst getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {\n\tconst { selectionStart, selectionEnd } = element;\n\tconst selectedText = element.value.slice(\n\t\tselectionStart!,\n\t\telement.selectionEnd!,\n\t);\n\tconst range = document.createRange();\n\n\trange.setStart(mirror.firstChild!, selectionEnd! - 1);\n\trange.setEnd(mirror.firstChild!, selectionEnd!);\n\n\tapplyScrollPosition(element, mirror);\n\n\tconst rangeRect = range.getBoundingClientRect();\n\tconst rectObject = {\n\t\tx: rangeRect.x,\n\t\ty: rangeRect.y,\n\t\twidth: rangeRect.width,\n\t\theight: rangeRect.height,\n\t\ttop: rangeRect.top,\n\t\tright: rangeRect.right,\n\t\tbottom: rangeRect.bottom,\n\t\tleft: rangeRect.left,\n\t};\n\n\tdocument.body.removeChild(mirror);\n\n\treturn { ...rectObject, selectedText };\n};\n\nconst getElementSelection = (element: HTMLElement) => {\n\tconst innerElement = element.shadowRoot!.querySelector(\"textarea\")\n\t\t|| element.shadowRoot!.querySelector(\"input\");\n\n\tif (!document.getElementById(\"ui5-selection-mirror\")) {\n\t\tcreateCopy();\n\t}\n\n\tconst copiedElement = document.getElementById(\n\t\t\"ui5-selection-mirror\",\n\t)!;\n\n\tcopiedElement.textContent = innerElement!.value;\n\n\tif (innerElement) {\n\t\tcopyAndApplyStyles(innerElement, copiedElement);\n\t}\n\n\treturn getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);\n};\n\nexport default getElementSelection;\n"],
5
5
  "mappings": "aAAA,MAAMA,EAAqB,CAACC,EAAsBC,IAA+B,CAChF,MAAMC,EAAiB,iBAAiBF,CAAO,EAE/C,QAASG,EAAI,EAAGA,EAAID,EAAe,OAAQC,IAAK,CAC/C,MAAMC,EAAeF,EAAeC,CAAC,EACrCF,EAAc,MAAM,YAAYG,EAAcF,EAAe,iBAAiBE,CAAY,CAAC,CAC5F,CAEAJ,EAAQ,UAAY,SAAWK,EAAuBJ,CAAa,EAEnEA,EAAc,MAAM,SAAW,WAC/BA,EAAc,MAAM,KAAO,GAAGD,EAAQ,sBAAsB,EAAE,IAAI,KAClEC,EAAc,MAAM,IAAM,GAAGD,EAAQ,sBAAsB,EAAE,GAAG,KAEhEM,EAAwBL,CAAa,EAErC,SAAS,KAAK,YAAYA,CAAa,CACxC,EAEMK,EAA2BN,GAAyB,CACzDA,EAAQ,MAAM,SAAW,WACzBA,EAAQ,MAAM,WAAa,OAC3BA,EAAQ,MAAM,cAAgB,OAC9BA,EAAQ,MAAM,OAAS,KACvBA,EAAQ,MAAM,QAAU,GACzB,EAEMK,EAA0BL,GAAyB,CACxDA,EAAQ,MAAM,WAAa,SAC3BA,EAAQ,MAAM,UAAY,OAC1BA,EAAQ,MAAM,UAAY,QAC3B,EAEMO,EAAa,IAAM,CACxB,MAAMN,EAAgB,SAAS,cAAc,KAAK,EAElDA,EAAc,GAAK,uBACnBA,EAAc,gBAAkB,OAEhC,SAAS,KAAK,YAAYA,CAAa,CACxC,EAEMO,EAAsB,CAACR,EAAsBC,IAA+B,CACjFA,EAAc,UAAYD,EAAQ,UAClCC,EAAc,WAAaD,EAAQ,UACpC,EAEMS,EAA0B,CAACT,EAAiDU,IAA2B,CAC5G,KAAM,CAAE,eAAAC,EAAgB,aAAAC,CAAa,EAAIZ,EACnCa,EAAeb,EAAQ,MAAM,MAClCW,EACAX,EAAQ,YACT,EACMc,EAAQ,SAAS,YAAY,EAEnCA,EAAM,SAASJ,EAAO,WAAaE,EAAgB,CAAC,EACpDE,EAAM,OAAOJ,EAAO,WAAaE,CAAa,EAE9CJ,EAAoBR,EAASU,CAAM,EAEnC,MAAMK,EAAYD,EAAM,sBAAsB,EACxCE,EAAa,CAClB,EAAGD,EAAU,EACb,EAAGA,EAAU,EACb,MAAOA,EAAU,MACjB,OAAQA,EAAU,OAClB,IAAKA,EAAU,IACf,MAAOA,EAAU,MACjB,OAAQA,EAAU,OAClB,KAAMA,EAAU,IACjB,EAEA,gBAAS,KAAK,YAAYL,CAAM,EAEzB,CAAE,GAAGM,EAAY,aAAAH,CAAa,CACtC,EAEMI,EAAuBjB,GAAyB,CACrD,MAAMkB,EAAelB,EAAQ,WAAY,cAAc,UAAU,GAC7DA,EAAQ,WAAY,cAAc,OAAO,EAExC,SAAS,eAAe,sBAAsB,GAClDO,EAAW,EAGZ,MAAMN,EAAgB,SAAS,eAC9B,sBACD,EAEA,OAAAA,EAAc,YAAciB,EAAc,MAEtCA,GACHnB,EAAmBmB,EAAcjB,CAAa,EAGxCQ,EAAwBS,EAAejB,CAA+B,CAC9E,EAEA,eAAegB",
6
6
  "names": ["copyAndApplyStyles", "element", "copiedElement", "computedStyles", "i", "propertyName", "setInputSpecificStyles", "setUnInteractableStyles", "createCopy", "applyScrollPosition", "getSelectionCoordinates", "mirror", "selectionStart", "selectionEnd", "selectedText", "range", "rangeRect", "rectObject", "getElementSelection", "innerElement"]
7
7
  }
@@ -1,7 +1,8 @@
1
1
  import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from "../asset-registries/Themes.js";
2
- import { createOrUpdateStyle } from "../ManagedStyles.js";
2
+ import { removeStyle, createOrUpdateStyle } from "../ManagedStyles.js";
3
3
  import getThemeDesignerTheme from "./getThemeDesignerTheme.js";
4
4
  import { fireThemeLoaded } from "./ThemeLoaded.js";
5
+ import { getFeature } from "../FeaturesRegistry.js";
5
6
  import { attachCustomThemeStylesToHead, getThemeRoot } from "../config/ThemeRoot.js";
6
7
  import { DEFAULT_THEME } from "../generated/AssetParameters.js";
7
8
  import { getCurrentRuntimeIndex } from "../Runtimes.js";
@@ -24,6 +25,9 @@ const loadThemeBase = async (theme) => {
24
25
  createOrUpdateStyle(cssData, "data-ui5-theme-properties", BASE_THEME_PACKAGE, theme);
25
26
  }
26
27
  };
28
+ const deleteThemeBase = () => {
29
+ removeStyle("data-ui5-theme-properties", BASE_THEME_PACKAGE);
30
+ };
27
31
  const loadComponentPackages = async (theme, externalThemeName) => {
28
32
  const registeredPackages = getRegisteredPackages();
29
33
  const packagesStylesPromises = [...registeredPackages].map(async (packageName) => {
@@ -38,29 +42,39 @@ const loadComponentPackages = async (theme, externalThemeName) => {
38
42
  return Promise.all(packagesStylesPromises);
39
43
  };
40
44
  const detectExternalTheme = async (theme) => {
41
- if (getThemeRoot()) {
42
- await attachCustomThemeStylesToHead(theme);
43
- }
44
45
  // If theme designer theme is detected, use this
45
46
  const extTheme = getThemeDesignerTheme();
46
47
  if (extTheme) {
47
48
  return extTheme;
48
49
  }
50
+ // If OpenUI5Support is enabled, try to find out if it loaded variables
51
+ const openUI5Support = getFeature("OpenUI5Support");
52
+ if (openUI5Support && openUI5Support.isOpenUI5Detected()) {
53
+ const varsLoaded = openUI5Support.cssVariablesLoaded();
54
+ if (varsLoaded) {
55
+ return {
56
+ themeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName
57
+ baseThemeName: "", // baseThemeName is only relevant for custom themes
58
+ };
59
+ }
60
+ }
61
+ else if (getThemeRoot()) {
62
+ await attachCustomThemeStylesToHead(theme);
63
+ return getThemeDesignerTheme();
64
+ }
49
65
  };
50
66
  const applyTheme = async (theme) => {
51
- // Detect external theme if available (e.g., from theme designer or custom theme root)
52
67
  const extTheme = await detectExternalTheme(theme);
53
- // Determine which theme to use for component packages:
54
- // 1. If the requested theme is registered, use it directly
55
- // 2. If external theme exists, use its base theme (e.g., "my_custom_theme" extends "sap_fiori_3")
56
- // 3. Otherwise, fallback to the default theme
68
+ // Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded
69
+ if (!extTheme || theme !== extTheme.themeName) {
70
+ await loadThemeBase(theme);
71
+ }
72
+ else {
73
+ deleteThemeBase();
74
+ }
75
+ // Always load component packages properties. For non-registered themes, try with the base theme, if any
57
76
  const packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;
58
- const effectiveTheme = packagesTheme || DEFAULT_THEME;
59
- // Load base theme properties
60
- await loadThemeBase(effectiveTheme);
61
- // Load component-specific theme properties
62
- // Pass external theme name only if it matches the requested theme to avoid conflicts
63
- await loadComponentPackages(effectiveTheme, extTheme && extTheme.themeName === theme ? theme : undefined);
77
+ await loadComponentPackages(packagesTheme || DEFAULT_THEME, extTheme && extTheme.themeName === theme ? theme : undefined);
64
78
  fireThemeLoaded(theme);
65
79
  };
66
80
  export default applyTheme;
@@ -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,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;A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/Themes.js\";\nimport { createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.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 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\tif (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\t}\n\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\nconst applyTheme = async (theme: string) => {\n\t// Detect external theme if available (e.g., from theme designer or custom theme root)\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Determine which theme to use for component packages:\n\t// 1. If the requested theme is registered, use it directly\n\t// 2. If external theme exists, use its base theme (e.g., \"my_custom_theme\" extends \"sap_fiori_3\")\n\t// 3. Otherwise, fallback to the default theme\n\tconst packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;\n\tconst effectiveTheme = packagesTheme || DEFAULT_THEME;\n\n\t// Load base theme properties\n\tawait loadThemeBase(effectiveTheme);\n\n\t// Load component-specific theme properties\n\t// Pass external theme name only if it matches the requested theme to avoid conflicts\n\tawait loadComponentPackages(effectiveTheme, extTheme && extTheme.themeName === theme ? theme : undefined);\n\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"]}
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,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,2BAA2B;AAC3B,MAAM,CAAC,IAAI,IAAI,GAAG,KAAK,CAAC;AACxB,2BAA2B;AAC3B,MAAM,CAAC,IAAI,QAAQ,GAAG,uBAAuB,CAAC;AAC9C,2BAA2B;AAC3B,MAAM,kBAAkB,GAAG,GAAG,GA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AE,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"]}
package/dist/types.d.ts CHANGED
@@ -24,6 +24,7 @@ export type AccessibilityInfo = {
24
24
  role?: AriaRole;
25
25
  type?: string;
26
26
  description?: string;
27
+ label?: string;
27
28
  disabled?: boolean;
28
29
  readonly?: boolean;
29
30
  required?: boolean;
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSX } from \"./jsx-runtime.d.ts\";\n\n// General utils\nexport type LowercaseString<T> = T extends string ? Lowercase<T> : never;\n\n// Core Framework types\nexport type PromiseResolve = (value: void | PromiseLike<void>) => void;\nexport type Timeout = ReturnType<typeof setTimeout>;\nexport type Interval = ReturnType<typeof setInterval>;\n\nexport type StyleData = string;\n\nexport type ComponentStylesData = Array<ComponentStylesData> | string;\nexport type ClassMapValue = Record<string, boolean>\n\nexport type ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\nexport type PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\n// Accessibility\nexport type AriaRole = JSX.AriaRole;\nexport type AriaDisabled = JSX.AriaAttributes[\"aria-disabled\"];\nexport type AriaChecked = JSX.AriaAttributes[\"aria-checked\"];\nexport type AriaReadonly = JSX.AriaAttributes[\"aria-readonly\"];\nexport type AriaHasPopup = \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\" | \"false\";\nexport type AriaCurrent = \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\" | boolean | undefined;\nexport type AriaAutoComplete = \"list\" | \"none\" | \"inline\" | \"both\" | undefined;\nexport type AriaLandmarkRole = \"none\" | \"banner\" | \"main\" | \"region\" | \"navigation\" | \"search\" | \"complementary\" | \"form\" | \"contentinfo\"\n\nexport type AccessibilityInfo = {\n\t// The WAI-ARIA role of the component.\n\trole?: AriaRole,\n\n\t// A translated text that represents the component type.\n\ttype?: string,\n\n\t// A translated text that represents relevant component description/state - value, placeholder, label, etc.\n\tdescription?: string,\n\n\t// Disabled state of the component.\n\tdisabled?: boolean,\n\n\t// Readonly state of the component.\n\treadonly?: boolean,\n\n\t// Required state of the component.\n\trequired?: boolean,\n\n\t// An array of nodes, aggregated by the component\n\t// **Note:** Children should only be provided when it is helpful to understand the accessibility context.\n\tchildren?: Array<Node>,\n}\n\nexport type AccessibilityAttributes = {\n\tariaSetsize?: number,\n\tariaPosinset?: number,\n\tariaLabel?: string,\n\tcontrols?: LowercaseString<string>\n\texpanded?: \"true\" | \"false\" | boolean,\n\thasPopup?: AriaHasPopup,\n\tname?: string,\n\trole?: AriaRole,\n\tariaKeyShortcuts?: string,\n\tariaCurrent?: AriaCurrent,\n\tcurrent?: AriaCurrent,\n\troleDescription?: string,\n\ttitle?: string,\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSX } from \"./jsx-runtime.d.ts\";\n\n// General utils\nexport type LowercaseString<T> = T extends string ? Lowercase<T> : never;\n\n// Core Framework types\nexport type PromiseResolve = (value: void | PromiseLike<void>) => void;\nexport type Timeout = ReturnType<typeof setTimeout>;\nexport type Interval = ReturnType<typeof setInterval>;\n\nexport type StyleData = string;\n\nexport type ComponentStylesData = Array<ComponentStylesData> | string;\nexport type ClassMapValue = Record<string, boolean>\n\nexport type ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\nexport type PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\n// Accessibility\nexport type AriaRole = JSX.AriaRole;\nexport type AriaDisabled = JSX.AriaAttributes[\"aria-disabled\"];\nexport type AriaChecked = JSX.AriaAttributes[\"aria-checked\"];\nexport type AriaReadonly = JSX.AriaAttributes[\"aria-readonly\"];\nexport type AriaHasPopup = \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\" | \"false\";\nexport type AriaCurrent = \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\" | boolean | undefined;\nexport type AriaAutoComplete = \"list\" | \"none\" | \"inline\" | \"both\" | undefined;\nexport type AriaLandmarkRole = \"none\" | \"banner\" | \"main\" | \"region\" | \"navigation\" | \"search\" | \"complementary\" | \"form\" | \"contentinfo\"\n\nexport type AccessibilityInfo = {\n\t// The WAI-ARIA role of the component.\n\trole?: AriaRole,\n\n\t// A translated text that represents the component type.\n\ttype?: string,\n\n\t// A translated text that represents relevant component description/state - value, placeholder, etc.\n\tdescription?: string,\n\n\t// Label of the component, e.g. `accessible-name` or `accessible-name-ref` for form elements.\n\tlabel?: string,\n\n\t// Disabled state of the component.\n\tdisabled?: boolean,\n\n\t// Readonly state of the component.\n\treadonly?: boolean,\n\n\t// Required state of the component.\n\trequired?: boolean,\n\n\t// An array of nodes, aggregated by the component\n\t// **Note:** Children should only be provided when it is helpful to understand the accessibility context.\n\tchildren?: Array<Node>,\n}\n\nexport type AccessibilityAttributes = {\n\tariaSetsize?: number,\n\tariaPosinset?: number,\n\tariaLabel?: string,\n\tcontrols?: LowercaseString<string>\n\texpanded?: \"true\" | \"false\" | boolean,\n\thasPopup?: AriaHasPopup,\n\tname?: string,\n\trole?: AriaRole,\n\tariaKeyShortcuts?: string,\n\tariaCurrent?: AriaCurrent,\n\tcurrent?: AriaCurrent,\n\troleDescription?: string,\n\ttitle?: string,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionAssistant.js","sourceRoot":"","sources":["../../src/util/SelectionAssistant.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,CAAC,OAAoB,EAAE,aAA0B,EAAE,EAAE;IAC/E,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QACvC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,cAAc,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,OAAO,CAAC,OAAO,KAAK,OAAO,IAAI,sBAAsB,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AmB,GAAG,CAAC,OAAoB,EAAE,EAAE;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,UAAU,CAAC;WAC9D,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,EAAE,CAAC;QACtD,UAAU,EAAE,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,QAAQ,CAAC,cAAc,CAC5C,sBAAsB,CACrB,CAAC;IAEH,aAAa,CAAC,WAAW,GAAG,YAAa,CAAC,KAAK,CAAC;IAEhD,IAAI,YAAY,EAAE,CAAC;QAClB,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAE,CAAC;IAClD,CAAC;IAED,OAAO,uBAAuB,CAAC,YAAa,EAAE,aAA+B,CAAC,CAAC;AAChF,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["const copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tconst computedStyles = getComputedStyle(element);\n\n\tfor (let i = 0; i < computedStyles.length; i++) {\n\t\tconst propertyName = computedStyles[i];\n\t\tcopiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));\n\t}\n\n\telement.tagName === \"INPUT\" && setInputSpecificStyles(copiedElement);\n\n\tcopiedElement.style.position = \"absolute\";\n\tcopiedElement.style.left = `${element.getBoundingClientRect().left}px`;\n\tcopiedElement.style.top = `${element.getBoundingClientRect().top}px`;\n\n\tsetUnInteractableStyles(copiedElement);\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst setUnInteractableStyles = (element: HTMLElement) => {\n\telement.style.position = \"absolute\";\n\telement.style.userSelect = \"none\";\n\telement.style.pointerEvents = \"none\";\n\telement.style.zIndex = \"-1\";\n\telement.style.opacity = \"0\";\n};\n\nconst setInputSpecificStyles = (element: HTMLElement) => {\n\telement.style.whiteSpace = \"nowrap\";\n\telement.style.overflowX = \"auto\";\n\telement.style.overflowY = \"hidden\";\n};\n\nconst createCopy = () => {\n\tconst copiedElement = document.createElement(\"div\");\n\n\tcopiedElement.id = \"ui5-selection-mirror\";\n\tcopiedElement.contentEditable = \"true\";\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tcopiedElement.scrollTop = element.scrollTop;\n\tcopiedElement.scrollLeft = element.scrollLeft;\n};\n\nconst getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {\n\tconst { selectionStart, selectionEnd } = element;\n\tconst selectedText = element.value.slice(\n\t\tselectionStart!,\n\t\telement.selectionEnd!,\n\t);\n\tconst range = document.createRange();\n\n\trange.setStart(mirror.firstChild!, selectionEnd! - 1);\n\trange.setEnd(mirror.firstChild!, selectionEnd!);\n\n\tapplyScrollPosition(element, mirror);\n\n\tconst rangeRect = range.getBoundingClientRect();\n\tconst rectObject = {\n\t\tx: rangeRect.x,\n\t\ty: rangeRect.y,\n\t\twidth: rangeRect.width,\n\t\theight: rangeRect.height,\n\t\ttop: rangeRect.top,\n\t\tright: rangeRect.right,\n\t\tbottom: rangeRect.bottom,\n\t\tleft: rangeRect.left,\n\t};\n\n\tdocument.body.removeChild(mirror);\n\n\treturn { ...rectObject, selectedText };\n};\n\nconst getElementSelection = (element: HTMLElement) => {\n\tconst innerElement = element.shadowRoot!.querySelector(\"textarea\")\n\t\t|| element.shadowRoot!.querySelector(\"input\");\n\n\tif (!document.getElementById(\"ui5-selection-mirror\")) {\n\t\tcreateCopy();\n\t}\n\n\tconst copiedElement = document.getElementById(\n\t\t\"ui5-selection-mirror\",\n\t)!;\n\n\tcopiedElement.textContent = innerElement!.value;\n\n\tif (innerElement) {\n\t\tcopyAndApplyStyles(innerElement, copiedElement)!;\n\t}\n\n\treturn getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);\n};\n\nexport default getElementSelection;\n"]}
1
+ {"version":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AM,SAAS,GAAG,KAAK,CAAC,qBAAqB,EAAE,CAAC;IAChD,MAAM,UAAU,GAAG;QAClB,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,IAAI,EAAE,SAAS,CAAC,IAAI;KACpB,CAAC;IAEF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAElC,OAAO,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,OAAoB,EAAE,EAAE;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,UAAU,CAAC;WAC9D,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,EAAE,CAAC;QACtD,UAAU,EAAE,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,QAAQ,CAAC,cAAc,CAC5C,sBAAsB,CACrB,CAAC;IAEH,aAAa,CAAC,WAAW,GAAG,YAAa,CAAC,KAAK,CAAC;IAEhD,IAAI,YAAY,EAAE,CAAC;QAClB,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,uBAAuB,CAAC,YAAa,EAAE,aAA+B,CAAC,CAAC;AAChF,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["const copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tconst computedStyles = getComputedStyle(element);\n\n\tfor (let i = 0; i < computedStyles.length; i++) {\n\t\tconst propertyName = computedStyles[i];\n\t\tcopiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));\n\t}\n\n\telement.tagName === \"INPUT\" && setInputSpecificStyles(copiedElement);\n\n\tcopiedElement.style.position = \"absolute\";\n\tcopiedElement.style.left = `${element.getBoundingClientRect().left}px`;\n\tcopiedElement.style.top = `${element.getBoundingClientRect().top}px`;\n\n\tsetUnInteractableStyles(copiedElement);\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst setUnInteractableStyles = (element: HTMLElement) => {\n\telement.style.position = \"absolute\";\n\telement.style.userSelect = \"none\";\n\telement.style.pointerEvents = \"none\";\n\telement.style.zIndex = \"-1\";\n\telement.style.opacity = \"0\";\n};\n\nconst setInputSpecificStyles = (element: HTMLElement) => {\n\telement.style.whiteSpace = \"nowrap\";\n\telement.style.overflowX = \"auto\";\n\telement.style.overflowY = \"hidden\";\n};\n\nconst createCopy = () => {\n\tconst copiedElement = document.createElement(\"div\");\n\n\tcopiedElement.id = \"ui5-selection-mirror\";\n\tcopiedElement.contentEditable = \"true\";\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tcopiedElement.scrollTop = element.scrollTop;\n\tcopiedElement.scrollLeft = element.scrollLeft;\n};\n\nconst getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {\n\tconst { selectionStart, selectionEnd } = element;\n\tconst selectedText = element.value.slice(\n\t\tselectionStart!,\n\t\telement.selectionEnd!,\n\t);\n\tconst range = document.createRange();\n\n\trange.setStart(mirror.firstChild!, selectionEnd! - 1);\n\trange.setEnd(mirror.firstChild!, selectionEnd!);\n\n\tapplyScrollPosition(element, mirror);\n\n\tconst rangeRect = range.getBoundingClientRect();\n\tconst rectObject = {\n\t\tx: rangeRect.x,\n\t\ty: rangeRect.y,\n\t\twidth: rangeRect.width,\n\t\theight: rangeRect.height,\n\t\ttop: rangeRect.top,\n\t\tright: rangeRect.right,\n\t\tbottom: rangeRect.bottom,\n\t\tleft: rangeRect.left,\n\t};\n\n\tdocument.body.removeChild(mirror);\n\n\treturn { ...rectObject, selectedText };\n};\n\nconst getElementSelection = (element: HTMLElement) => {\n\tconst innerElement = element.shadowRoot!.querySelector(\"textarea\")\n\t\t|| element.shadowRoot!.querySelector(\"input\");\n\n\tif (!document.getElementById(\"ui5-selection-mirror\")) {\n\t\tcreateCopy();\n\t}\n\n\tconst copiedElement = document.getElementById(\n\t\t\"ui5-selection-mirror\",\n\t)!;\n\n\tcopiedElement.textContent = innerElement!.value;\n\n\tif (innerElement) {\n\t\tcopyAndApplyStyles(innerElement, copiedElement);\n\t}\n\n\treturn getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);\n};\n\nexport default getElementSelection;\n"]}
@@ -24,7 +24,7 @@ const scripts = {
24
24
  "generated": `ui5nps-script "${LIB}/rimraf/rimraf.js src/generated`,
25
25
  "dist": `ui5nps-script "${LIB}/rimraf/rimraf.js dist`,
26
26
  },
27
- lint: `eslint .`,
27
+ lint: `ui5nps-script "${LIB}/eslint/eslint.js"`,
28
28
  generate: "ui5nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace build.jsonImports",
29
29
  prepare: "ui5nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace typescript integrate.no-remaining-require build.jsonImports",
30
30
  typescript: "tsc -b",
@@ -41,7 +41,7 @@ const scripts = {
41
41
  },
42
42
  build: {
43
43
  default: `ui5nps prepare`,
44
- bundle: `vite build ${viteConfig}`,
44
+ bundle: `ui5nps-script "${LIB}/vite-bundler/vite-bundler.mjs" ${viteConfig}`,
45
45
  i18n: {
46
46
  default: "ui5nps build.i18n.defaultsjs build.i18n.json",
47
47
  defaultsjs: `ui5nps-script "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
@@ -82,7 +82,7 @@ const scripts = {
82
82
  withBundle: 'ui5nps-p watch.src watch.bundle watch.styles', // concurently
83
83
  src: 'ui5nps copy.srcWithWatch',
84
84
  bundle: `ui5nps-script ${LIB}/dev-server/dev-server.mjs ${viteConfig}`,
85
- styles: 'chokidar "src/css/*.css" -c "ui5nps generateStyles"'
85
+ styles: `ui5nps-script "${LIB}/chokidar/chokidar.js" "src/css/*.css" "ui5nps generateStyles"`
86
86
  },
87
87
  test: {
88
88
  default: 'ui5nps-p test.ssr test.ssr2 test.test-cy-ci', // concurently
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "2.17.0-rc.4",
3
+ "version": "2.17.0",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -64,12 +64,9 @@
64
64
  "@openui5/sap.ui.core": "1.120.17",
65
65
  "@sap-theming/theming-base-content": "11.29.3",
66
66
  "@ui5/cypress-internal": "0.1.0",
67
- "@ui5/webcomponents-tools": "2.17.0-rc.4",
68
- "chokidar-cli": "^3.0.0",
67
+ "@ui5/webcomponents-tools": "2.17.0",
69
68
  "clean-css": "^5.2.2",
70
69
  "cypress": "^15.3.0",
71
- "eslint": "^7.22.0",
72
- "mkdirp": "^1.0.4",
73
70
  "mocha": "^11.7.2",
74
71
  "replace-in-file": "^6.3.5",
75
72
  "resolve": "^1.20.0",
@@ -78,5 +75,5 @@
78
75
  "vite": "5.4.21"
79
76
  },
80
77
  "customElements": "dist/custom-elements.json",
81
- "gitHead": "b7e93525288be73f17828a4aec16465097c1550b"
78
+ "gitHead": "13048269dab7b8ff92e9964e7ce4b771005cf07b"
82
79
  }