@ui5/webcomponents-base 2.14.0 → 2.15.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +7 -7
  3. package/dist/.tsbuildinfobuild +1 -1
  4. package/dist/CustomElementsRegistry.js +1 -1
  5. package/dist/CustomElementsRegistry.js.map +1 -1
  6. package/dist/CustomElementsScopeUtils.js +1 -1
  7. package/dist/CustomElementsScopeUtils.js.map +1 -1
  8. package/dist/css/OpenUI5PopupStyles.css +5 -0
  9. package/dist/custom-elements-internal.json +15 -0
  10. package/dist/custom-elements.json +15 -0
  11. package/dist/features/F6Navigation.js +12 -3
  12. package/dist/features/F6Navigation.js.map +1 -1
  13. package/dist/features/insertOpenUI5PopupStyles.d.ts +2 -0
  14. package/dist/features/insertOpenUI5PopupStyles.js +9 -0
  15. package/dist/features/insertOpenUI5PopupStyles.js.map +1 -0
  16. package/dist/features/patchPopup.js +2 -0
  17. package/dist/features/patchPopup.js.map +1 -1
  18. package/dist/generated/VersionInfo.js +4 -4
  19. package/dist/generated/VersionInfo.js.map +1 -1
  20. package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +2 -0
  21. package/dist/generated/css/OpenUI5PopupStyles.css.js +2 -0
  22. package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -0
  23. package/dist/generated/json-imports/i18n-fetch.js +1 -25
  24. package/dist/generated/json-imports/i18n-fetch.js.map +1 -1
  25. package/dist/generated/json-imports/i18n-node.js +1 -25
  26. package/dist/generated/json-imports/i18n-node.js.map +1 -1
  27. package/dist/generated/json-imports/i18n.js +1 -25
  28. package/dist/generated/json-imports/i18n.js.map +1 -1
  29. package/dist/prod/CustomElementsRegistry.js +5 -5
  30. package/dist/prod/CustomElementsRegistry.js.map +2 -2
  31. package/dist/prod/CustomElementsScopeUtils.js +1 -1
  32. package/dist/prod/CustomElementsScopeUtils.js.map +2 -2
  33. package/dist/prod/features/F6Navigation.js +1 -1
  34. package/dist/prod/features/F6Navigation.js.map +3 -3
  35. package/dist/prod/features/insertOpenUI5PopupStyles.js +2 -0
  36. package/dist/prod/features/insertOpenUI5PopupStyles.js.map +7 -0
  37. package/dist/prod/features/patchPopup.js +1 -1
  38. package/dist/prod/features/patchPopup.js.map +3 -3
  39. package/dist/prod/generated/VersionInfo.js +1 -1
  40. package/dist/prod/generated/VersionInfo.js.map +2 -2
  41. package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +2 -0
  42. package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +7 -0
  43. package/dist/prod/generated/json-imports/i18n-fetch.js +1 -1
  44. package/dist/prod/generated/json-imports/i18n-fetch.js.map +4 -4
  45. package/dist/prod/generated/json-imports/i18n-node.js +1 -1
  46. package/dist/prod/generated/json-imports/i18n-node.js.map +4 -4
  47. package/dist/prod/generated/json-imports/i18n.js +1 -1
  48. package/dist/prod/generated/json-imports/i18n.js.map +4 -4
  49. package/package-scripts.cjs +34 -23
  50. package/package.json +25 -16
  51. package/src/css/OpenUI5PopupStyles.css +5 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/CustomElementsScopeUtils.ts"],
4
- "sourcesContent": ["import { hasRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport VersionInfo from \"./generated/VersionInfo.js\";\n\nlet suf: string;\n\ntype Rules = {\n\tinclude: Array<RegExp>,\n\texclude: Array<RegExp>,\n};\n\nlet rulesObj: Rules = {\n\tinclude: [/^ui5-/],\n\texclude: [],\n};\n\nconst tagsCache = new Map<string, boolean>(); // true/false means the tag should/should not be cached, undefined means not known yet.\n\n/**\n * Sets the suffix to be used for custom elements scoping, f.e. pass \"demo\" to get tags such as \"ui5-button-demo\".\n *\n * **Note:** By default all tags starting with \"ui5-\" will be scoped, unless you change this by calling \"setCustomElementsScopingRules\"\n * **Note:** Setting the scoping suffix must be done before importing any components.\n *\n * @public\n * @param suffix The scoping suffix\n */\nconst setCustomElementsScopingSuffix = (suffix: string) => {\n\tif (!suffix.match(/^[a-zA-Z0-9_-]+$/)) {\n\t\tthrow new Error(\"Only alphanumeric characters and dashes allowed for the scoping suffix\");\n\t}\n\n\tif (hasRegisteredTags()) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\"Setting the scoping suffix must be done before importing any components. For proper usage, read the scoping section: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.\");\n\t}\n\n\tsuf = suffix;\n};\n\n/**\n * Returns the currently set scoping suffix, or undefined if not set.\n *\n * @public\n * @returns {String|undefined}\n */\nconst getCustomElementsScopingSuffix = (): string | undefined => {\n\treturn suf;\n};\n\n/**\n * Sets the rules, governing which custom element tags to scope and which not, f.e.\n * setCustomElementsScopingRules({include: [/^ui5-/]}, exclude: [/^ui5-mylib-/, /^ui5-carousel$/]);\n * will scope all elements starting with \"ui5-\" but not the ones starting with \"ui5-mylib-\" and not \"ui5-carousel\".\n *\n * @public\n * @param rules Object with \"include\" and \"exclude\" properties, both arrays of regular expressions. Note that \"include\"\n * rules are applied first and \"exclude\" rules second.\n */\nconst setCustomElementsScopingRules = (rules: Rules) => {\n\tif (!rules || !rules.include) {\n\t\tthrow new Error(`\"rules\" must be an object with at least an \"include\" property`);\n\t}\n\n\tif (!Array.isArray(rules.include) || rules.include.some(rule => !(rule instanceof RegExp))) {\n\t\tthrow new Error(`\"rules.include\" must be an array of regular expressions`);\n\t}\n\n\tif (rules.exclude && (!Array.isArray(rules.exclude) || rules.exclude.some(rule => !(rule instanceof RegExp)))) {\n\t\tthrow new Error(`\"rules.exclude\" must be an array of regular expressions`);\n\t}\n\n\trules.exclude = rules.exclude || [];\n\trulesObj = rules;\n\ttagsCache.clear(); // reset the cache upon setting new rules\n};\n\n/**\n * Returns the rules, governing which custom element tags to scope and which not. By default, all elements\n * starting with \"ui5-\" are scoped. The default rules are: {include: [/^ui5-/]}.\n *\n * @public\n * @returns {Object}\n */\nconst getCustomElementsScopingRules = () => {\n\treturn rulesObj;\n};\n\n/**\n * Determines whether custom elements with the given tag should be scoped or not.\n * The tag is first matched against the \"include\" rules and then against the \"exclude\" rules and the\n * result is cached until new rules are set.\n *\n * @public\n * @param tag\n */\nconst shouldScopeCustomElement = (tag: string) => {\n\tif (!tagsCache.has(tag)) {\n\t\tconst result = rulesObj.include.some(rule => tag.match(rule)) && !rulesObj.exclude.some(rule => tag.match(rule));\n\t\ttagsCache.set(tag, result);\n\t}\n\n\treturn tagsCache.get(tag);\n};\n\n/**\n * Returns the currently set scoping suffix, if any and if the tag should be scoped, or undefined otherwise.\n *\n * @public\n * @param tag\n * @returns {String}\n */\nconst getEffectiveScopingSuffixForTag = (tag: string) => {\n\tif (shouldScopeCustomElement(tag)) {\n\t\treturn getCustomElementsScopingSuffix();\n\t}\n};\n\n/**\n * @public\n * Used for getting a scoped name for a CSS variable using the same transformation used in the build\n * @name the name of the css variable as written in the code\n * @returns a variable name with the current version inserted as available at runtime\n */\nconst getScopedVarName = (name: string) => {\n\tconst versionStr = `v${VersionInfo.version.replaceAll(\".\", \"-\")}`;\n\tconst expr = /(--_?ui5)([^,:)\\s]+)/g;\n\treturn name.replaceAll(expr, `$1-${versionStr}$2`);\n};\n\nexport {\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tshouldScopeCustomElement,\n\tgetEffectiveScopingSuffixForTag,\n\tgetScopedVarName,\n};\n"],
5
- "mappings": "aAAA,OAAS,qBAAAA,MAAyB,8BAClC,OAAOC,MAAiB,6BAExB,IAAIC,EAOAC,EAAkB,CACrB,QAAS,CAAC,OAAO,EACjB,QAAS,CAAC,CACX,EAEA,MAAMC,EAAY,IAAI,IAWhBC,EAAkCC,GAAmB,CAC1D,GAAI,CAACA,EAAO,MAAM,kBAAkB,EACnC,MAAM,IAAI,MAAM,wEAAwE,EAGrFN,EAAkB,GAErB,QAA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";\n\nlet suf: string;\n\ntype Rules = {\n\tinclude: Array<RegExp>,\n\texclude: Array<RegExp>,\n};\n\nlet rulesObj: Rules = {\n\tinclude: [/^ui5-/],\n\texclude: [],\n};\n\nconst tagsCache = new Map<string, boolean>(); // true/false means the tag should/should not be cached, undefined means not known yet.\n\n/**\n * Sets the suffix to be used for custom elements scoping, f.e. pass \"demo\" to get tags such as \"ui5-button-demo\".\n *\n * **Note:** By default all tags starting with \"ui5-\" will be scoped, unless you change this by calling \"setCustomElementsScopingRules\"\n * **Note:** Setting the scoping suffix must be done before importing any components.\n *\n * @public\n * @param suffix The scoping suffix\n */\nconst setCustomElementsScopingSuffix = (suffix: string) => {\n\tif (!suffix.match(/^[a-zA-Z0-9_-]+$/)) {\n\t\tthrow new Error(\"Only alphanumeric characters and dashes allowed for the scoping suffix\");\n\t}\n\n\tif (hasRegisteredTags()) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\"Setting the scoping suffix must be done before importing any components. For proper usage, read the scoping section: https://github.com/UI5/webcomponents/blob/main/docs/2-advanced/06-scoping.md.\");\n\t}\n\n\tsuf = suffix;\n};\n\n/**\n * Returns the currently set scoping suffix, or undefined if not set.\n *\n * @public\n * @returns {String|undefined}\n */\nconst getCustomElementsScopingSuffix = (): string | undefined => {\n\treturn suf;\n};\n\n/**\n * Sets the rules, governing which custom element tags to scope and which not, f.e.\n * setCustomElementsScopingRules({include: [/^ui5-/]}, exclude: [/^ui5-mylib-/, /^ui5-carousel$/]);\n * will scope all elements starting with \"ui5-\" but not the ones starting with \"ui5-mylib-\" and not \"ui5-carousel\".\n *\n * @public\n * @param rules Object with \"include\" and \"exclude\" properties, both arrays of regular expressions. Note that \"include\"\n * rules are applied first and \"exclude\" rules second.\n */\nconst setCustomElementsScopingRules = (rules: Rules) => {\n\tif (!rules || !rules.include) {\n\t\tthrow new Error(`\"rules\" must be an object with at least an \"include\" property`);\n\t}\n\n\tif (!Array.isArray(rules.include) || rules.include.some(rule => !(rule instanceof RegExp))) {\n\t\tthrow new Error(`\"rules.include\" must be an array of regular expressions`);\n\t}\n\n\tif (rules.exclude && (!Array.isArray(rules.exclude) || rules.exclude.some(rule => !(rule instanceof RegExp)))) {\n\t\tthrow new Error(`\"rules.exclude\" must be an array of regular expressions`);\n\t}\n\n\trules.exclude = rules.exclude || [];\n\trulesObj = rules;\n\ttagsCache.clear(); // reset the cache upon setting new rules\n};\n\n/**\n * Returns the rules, governing which custom element tags to scope and which not. By default, all elements\n * starting with \"ui5-\" are scoped. The default rules are: {include: [/^ui5-/]}.\n *\n * @public\n * @returns {Object}\n */\nconst getCustomElementsScopingRules = () => {\n\treturn rulesObj;\n};\n\n/**\n * Determines whether custom elements with the given tag should be scoped or not.\n * The tag is first matched against the \"include\" rules and then against the \"exclude\" rules and the\n * result is cached until new rules are set.\n *\n * @public\n * @param tag\n */\nconst shouldScopeCustomElement = (tag: string) => {\n\tif (!tagsCache.has(tag)) {\n\t\tconst result = rulesObj.include.some(rule => tag.match(rule)) && !rulesObj.exclude.some(rule => tag.match(rule));\n\t\ttagsCache.set(tag, result);\n\t}\n\n\treturn tagsCache.get(tag);\n};\n\n/**\n * Returns the currently set scoping suffix, if any and if the tag should be scoped, or undefined otherwise.\n *\n * @public\n * @param tag\n * @returns {String}\n */\nconst getEffectiveScopingSuffixForTag = (tag: string) => {\n\tif (shouldScopeCustomElement(tag)) {\n\t\treturn getCustomElementsScopingSuffix();\n\t}\n};\n\n/**\n * @public\n * Used for getting a scoped name for a CSS variable using the same transformation used in the build\n * @name the name of the css variable as written in the code\n * @returns a variable name with the current version inserted as available at runtime\n */\nconst getScopedVarName = (name: string) => {\n\tconst versionStr = `v${VersionInfo.version.replaceAll(\".\", \"-\")}`;\n\tconst expr = /(--_?ui5)([^,:)\\s]+)/g;\n\treturn name.replaceAll(expr, `$1-${versionStr}$2`);\n};\n\nexport {\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetC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C/B,OAAON,EAA+B,CAExC,EAQMS,EAAoBC,GAAiB,CAC1C,MAAMC,EAAa,IAAIjB,EAAY,QAAQ,WAAW,IAAK,GAAG,CAAC,GACzDkB,EAAO,wBACb,OAAOF,EAAK,WAAWE,EAAM,MAAMD,CAAU,IAAI,CAClD,EAEA,OACCb,KAAA,+BACAE,KAAA,+BACAC,KAAA,8BACAG,KAAA,8BACAC,KAAA,yBACAG,KAAA,gCACAC,KAAA",
6
6
  "names": ["hasRegisteredTags", "VersionInfo", "suf", "rulesObj", "tagsCache", "setCustomElementsScopingSuffix", "suffix", "getCustomElementsScopingSuffix", "setCustomElementsScopingRules", "rules", "rule", "getCustomElementsScopingRules", "shouldScopeCustomElement", "tag", "result", "getEffectiveScopingSuffixForTag", "getScopedVarName", "name", "versionStr", "expr"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{getFeature as m,registerFeature as c}from"../FeaturesRegistry.js";import{isF6Next as d,isF6Previous as h}from"../Keys.js";import{getFirstFocusableElement as f}from"../util/FocusableElements.js";import g from"../util/getFastNavigationGroups.js";import E from"../util/isElementClickable.js";import{getCurrentRuntimeIndex as w,compareRuntimes as v}from"../Runtimes.js";import y from"../getSharedResource.js";import a from"../util/getParentElement.js";const p=w(),F=l=>l===void 0?!0:v(p,l)===1;class n{constructor(){this.selectedGroup=null;this.groups=[];this.keydownHandler=this._keydownHandler.bind(this),this.attachEventListeners()}attachEventListeners(){document.addEventListener("keydown",this.keydownHandler)}removeEventListeners(){document.removeEventListener("keydown",this.keydownHandler)}async groupElementToFocus(e){if(e){if(E(e))return e;const t=await f(e);if(t)return t}}async findNextFocusableGroupElement(e){let t;for(let o=0;o<this.groups.length;o++){let s;if(e>-1?e+1>=this.groups.length?(e=0,s=this.groups[e]):(e+=1,s=this.groups[e]):(e=0,s=this.groups[e]),t=await this.groupElementToFocus(s),t)break}return t}async findPreviousFocusableGroupElement(e){let t;for(let o=0;o<this.groups.length;o++){let s;if(e>0?(e=await this.groupElementToFocus(this.groups[e-1])===await this.groupElementToFocus(this.groups[e])?e-2:e-1,e<0&&(e=this.groups.length-1),s=this.groups[e]):(e=this.groups.length-1,s=this.groups[e]),t=await this.groupElementToFocus(s),t)break}return t}async _keydownHandler(e){const t=m("OpenUI5Support");if(t&&t.isOpenUI5Detected()){this.destroy();return}const s=d(e),r=h(e);if(!(s||r)||(this.updateGroups(),this.groups.length<1))return;e.preventDefault();let i;if(this.groups.length===0)return i=await this.groupElementToFocus(this.groups[0]),i?.focus();let u=-1;this.selectedGroup&&(u=this.groups.indexOf(this.selectedGroup)),s&&(i=await this.findNextFocusableGroupElement(u)),r&&(i=await this.findPreviousFocusableGroupElement(u)),i?.focus()}updateGroups(){const e=this.findContainer();this.setSelectedGroup(),this.groups=g(e)}findContainer(){const e=window.document.querySelector("html");let t=this.deepActive(window.document);for(;t&&t!==e;){const o=t.closest("[data-sap-ui-fastnavgroup-container='true']");if(o)return o;t=a(t)}return document.body}setSelectedGroup(e=window.document){const t=window.document.querySelector("html");let o=this.deepActive(e);for(;o&&o.getAttribute("data-sap-ui-fastnavgroup")!=="true"&&o!==t;)o=a(o);this.selectedGroup=o}deepActive(e){return e?.activeElement?.shadowRoot?.activeElement?this.deepActive(e.activeElement.shadowRoot):e.activeElement}destroy(){this.removeEventListeners()}get _ui5RuntimeIndex(){return p}static init(){const e=y("F6Registry",{});e.instance?F(e.instance?._ui5RuntimeIndex)&&(e.instance?.destroy(),e.instance=new n):e.instance=new n}}c("F6Navigation",n);export default n;
1
+ "use strict";import{getFeature as c,registerFeature as m}from"../FeaturesRegistry.js";import{isF6Next as d,isF6Previous as h}from"../Keys.js";import{getFirstFocusableElement as f}from"../util/FocusableElements.js";import g from"../util/getFastNavigationGroups.js";import E from"../util/isElementClickable.js";import{getCurrentRuntimeIndex as w,compareRuntimes as v}from"../Runtimes.js";import y from"../getSharedResource.js";import a from"../util/getParentElement.js";const p=w(),F=l=>l===void 0?!0:v(p,l)===1;class r{constructor(){this.selectedGroup=null;this.groups=[];this.keydownHandler=this._keydownHandler.bind(this),this.attachEventListeners()}attachEventListeners(){document.addEventListener("keydown",this.keydownHandler)}removeEventListeners(){document.removeEventListener("keydown",this.keydownHandler)}async groupElementToFocus(e){if(e){if(E(e))return e;const t=await f(e);if(t)return t}}async findNextFocusableGroupElement(e){let t;for(let o=0;o<this.groups.length;o++){let s;if(e>-1?e+1>=this.groups.length?(e=0,s=this.groups[e]):(e+=1,s=this.groups[e]):(e=0,s=this.groups[e]),t=await this.groupElementToFocus(s),t)break}return t}async findPreviousFocusableGroupElement(e){let t;for(let o=0;o<this.groups.length;o++){let s;if(e>0){const u=await this.groupElementToFocus(this.groups[e]);let i=1;for(let n=1;n<this.groups.length&&await this.groupElementToFocus(this.groups[e-n])===u;n++)i++;e-=i,e<0&&(e=this.groups.length-1),s=this.groups[e]}else e=this.groups.length-1,s=this.groups[e];if(t=await this.groupElementToFocus(s),t)break}return t}async _keydownHandler(e){const t=c("OpenUI5Support");if(t&&t.isOpenUI5Detected()){this.destroy();return}const s=d(e),u=h(e);if(!(s||u)||(this.updateGroups(),this.groups.length<1))return;e.preventDefault();let i;if(this.groups.length===0)return i=await this.groupElementToFocus(this.groups[0]),i?.focus();let n=-1;this.selectedGroup&&(n=this.groups.indexOf(this.selectedGroup)),s&&(i=await this.findNextFocusableGroupElement(n)),u&&(i=await this.findPreviousFocusableGroupElement(n)),i?.focus()}updateGroups(){const e=this.findContainer();this.setSelectedGroup(),this.groups=g(e)}findContainer(){const e=window.document.querySelector("html");let t=this.deepActive(window.document);for(;t&&t!==e;){const o=t.closest("[data-sap-ui-fastnavgroup-container='true']");if(o)return o;t=a(t)}return document.body}setSelectedGroup(e=window.document){const t=window.document.querySelector("html");let o=this.deepActive(e);for(;o&&o.getAttribute("data-sap-ui-fastnavgroup")!=="true"&&o!==t;)o=a(o);this.selectedGroup=o}deepActive(e){return e?.activeElement?.shadowRoot?.activeElement?this.deepActive(e.activeElement.shadowRoot):e.activeElement}destroy(){this.removeEventListeners()}get _ui5RuntimeIndex(){return p}static init(){const e=y("F6Registry",{});e.instance?F(e.instance?._ui5RuntimeIndex)&&(e.instance?.destroy(),e.instance=new r):e.instance=new r}}m("F6Navigation",r);export default r;
2
2
  //# sourceMappingURL=F6Navigation.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/features/F6Navigation.ts"],
4
- "sourcesContent": ["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\nimport getParentElement from \"../util/getParentElement.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tif (nextElement) {\n\t\t\tif (isElementClickable(nextElement)) {\n\t\t\t\treturn nextElement;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null = this.deepActive(root);\n\n\t\twhile (element && element.getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"],
5
- "mappings": "aAAA,OAAS,cAAAA,EAAY,mBAAAC,MAAuB,yBAC5C,OAAS,YAAAC,EAAU,gB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A,IAAYD,GAAa,CAC1C,MAAME,EAAiBD,EAAQ,QAAqB,6CAA6C,EAEjG,GAAIC,EACH,OAAOA,EAGRD,EAAUf,EAAiBe,CAAO,CACnC,CAEA,OAAO,SAAS,IACjB,CAEA,iBAAiBE,EAA6B,OAAO,SAAU,CAC9D,MAAMH,EAAc,OAAO,SAAS,cAAc,MAAM,EACxD,IAAIC,EAA0B,KAAK,WAAWE,CAAI,EAElD,KAAOF,GAAWA,EAAQ,aAAa,0BAA0B,IAAM,QAAUA,IAAYD,GAC5FC,EAAUf,EAAiBe,CAAO,EAGnC,KAAK,cAAgBA,CACtB,CAEA,WAAWE,EAA4C,CACtD,OAAIA,GAAM,eAAe,YAAY,cAC7B,KAAK,WAAWA,EAAK,cAAc,UAAU,EAG9CA,EAAK,aACb,CAEA,SAAU,CACT,KAAK,qBAAqB,CAC3B,CAEA,IAAI,kBAAmB,CACtB,OAAOhB,CACR,CAEA,OAAO,MAAO,CACb,MAAMiB,EAAanB,EAA8B,aAAc,CAAC,CAAC,EAE5DmB,EAAW,SAELhB,EAAagB,EAAW,UAAU,gBAAgB,IAC5DA,EAAW,UAAU,QAAQ,EAC7BA,EAAW,SAAW,IAAId,GAH1Bc,EAAW,SAAW,IAAId,CAK5B,CACD,CAEAb,EAAgB,eAAgBa,CAAY,EAE5C,eAAeA",
6
- "names": ["getFeature", "registerFeature", "isF6Next", "isF6Previous", "getFirstFocusableElement", "getFastNavigationGroups", "isElementClickable", "getCurrentRuntimeIndex", "compareRuntimes", "getSharedResource", "getParentElement", "currentRuntimeINdex", "shouldUpdate", "runtimeIndex", "F6Navigation", "nextElement", "elementToFocus", "currentIndex", "index", "event", "openUI5Support", "forward", "backward", "container", "htmlElement", "element", "closestScopeEl", "root", "f6Registry"]
4
+ "sourcesContent": ["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\nimport getParentElement from \"../util/getParentElement.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tif (nextElement) {\n\t\t\tif (isElementClickable(nextElement)) {\n\t\t\t\treturn nextElement;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst currentGroupFocusable = await this.groupElementToFocus(this.groups[currentIndex]);\n\t\t\t\tlet distanceToNextGroup = 1;\n\n\t\t\t\tfor (let distanceIndex = 1; distanceIndex < this.groups.length; distanceIndex++) {\n\t\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - distanceIndex]);\n\n\t\t\t\t\tif (firstFocusable === currentGroupFocusable) {\n\t\t\t\t\t\tdistanceToNextGroup++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcurrentIndex -= distanceToNextGroup;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null = this.deepActive(root);\n\n\t\twhile (element && element.getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"],
5
+ "mappings": "aAAA,OAAS,cAAAA,EAAY,mBAAAC,MAAuB,yBAC5C,OAAS,YAAAC,EAAU,gBAAAC,MAAoB,aACvC,OAAS,4BAAAC,MAAgC,+BACzC,OAAOC,MAA6B,qCACpC,OAAOC,MAAwB,gCAC/B,OAAS,0BAAAC,EAAwB,mBAAAC,MAAuB,iBACxD,OAAOC,MAAuB,0BAE9B,OAAOC,MAAsB,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EACH,OAAOA,EAGRD,EAAUlB,EAAiBkB,CAAO,CACnC,CAEA,OAAO,SAAS,IACjB,CAEA,iBAAiBE,EAA6B,OAAO,SAAU,CAC9D,MAAMH,EAAc,OAAO,SAAS,cAAc,MAAM,EACxD,IAAIC,EAA0B,KAAK,WAAWE,CAAI,EAElD,KAAOF,GAAWA,EAAQ,aAAa,0BAA0B,IAAM,QAAUA,IAAYD,GAC5FC,EAAUlB,EAAiBkB,CAAO,EAGnC,KAAK,cAAgBA,CACtB,CAEA,WAAWE,EAA4C,CACtD,OAAIA,GAAM,eAAe,YAAY,cAC7B,KAAK,WAAWA,EAAK,cAAc,UAAU,EAG9CA,EAAK,aACb,CAEA,SAAU,CACT,KAAK,qBAAqB,CAC3B,CAEA,IAAI,kBAAmB,CACtB,OAAOnB,CACR,CAEA,OAAO,MAAO,CACb,MAAMoB,EAAatB,EAA8B,aAAc,CAAC,CAAC,EAE5DsB,EAAW,SAELnB,EAAamB,EAAW,UAAU,gBAAgB,IAC5DA,EAAW,UAAU,QAAQ,EAC7BA,EAAW,SAAW,IAAIjB,GAH1BiB,EAAW,SAAW,IAAIjB,CAK5B,CACD,CAEAb,EAAgB,eAAgBa,CAAY,EAE5C,eAAeA",
6
+ "names": ["getFeature", "registerFeature", "isF6Next", "isF6Previous", "getFirstFocusableElement", "getFastNavigationGroups", "isElementClickable", "getCurrentRuntimeIndex", "compareRuntimes", "getSharedResource", "getParentElement", "currentRuntimeINdex", "shouldUpdate", "runtimeIndex", "F6Navigation", "nextElement", "elementToFocus", "currentIndex", "index", "currentGroupFocusable", "distanceToNextGroup", "distanceIndex", "event", "openUI5Support", "forward", "backward", "container", "htmlElement", "element", "closestScopeEl", "root", "f6Registry"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";import{hasStyle as p,createStyle as t}from"../ManagedStyles.js";import e from"../generated/css/OpenUI5PopupStyles.css.js";const o=()=>{p("data-ui5-popup-styles")||t(e,"data-ui5-popup-styles")};export default o;
2
+ //# sourceMappingURL=insertOpenUI5PopupStyles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/insertOpenUI5PopupStyles.ts"],
4
+ "sourcesContent": ["import { hasStyle, createStyle } from \"../ManagedStyles.js\";\nimport openUI5PopupStyles from \"../generated/css/OpenUI5PopupStyles.css.js\";\n\nconst insertOpenUI5PopupStyles = () => {\n\tif (!hasStyle(\"data-ui5-popup-styles\")) {\n\t\tcreateStyle(openUI5PopupStyles, \"data-ui5-popup-styles\");\n\t}\n};\n\nexport default insertOpenUI5PopupStyles;\n"],
5
+ "mappings": "aAAA,OAAS,YAAAA,EAAU,eAAAC,MAAmB,sBACtC,OAAOC,MAAwB,6CAE/B,MAAMC,EAA2B,IAAM,CACjCH,EAAS,uBAAuB,GACpCC,EAAYC,EAAoB,uBAAuB,CAEzD,EAEA,eAAeC",
6
+ "names": ["hasStyle", "createStyle", "openUI5PopupStyles", "insertOpenUI5PopupStyles"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";import d from"../getSharedResource.js";const n=d("AllOpenedPopupsRegistry",{openedRegistry:[]}),l=e=>{n.openedRegistry.push(e)},u=e=>{const t=n.openedRegistry.findIndex(o=>o.instance===e);t>-1&&n.openedRegistry.splice(t,1)},y=()=>n.openedRegistry[n.openedRegistry.length-1].instance,g=e=>{for(let t=n.openedRegistry.length-1;t>=0;t--){const o=n.openedRegistry[t];if(o.type!=="OpenUI5")return!1;if(o.instance===e)break}return!0},h=e=>{e.setAttribute("popover","manual"),e.showPopover()},f=e=>{e.hasAttribute("popover")&&(e.hidePopover(),e.removeAttribute("popover"))},a=(e=document)=>e.querySelector(":popover-open")?!0:Array.from(e.querySelectorAll("*")).some(t=>{const o=t.shadowRoot;return o&&a(o)}),v=e=>{const t=e.prototype.open;e.prototype.open=function(...p){t.apply(this,p);const s=a();if(["OPENING","OPEN"].includes(this.getOpenState())&&s){const r=this.getContent();if(r){const i=r instanceof HTMLElement?r:r?.getDomRef();i&&h(i)}}l({type:"OpenUI5",instance:this})}},O=e=>{const t=e.prototype._closed;e.prototype._closed=function(...p){const s=this.getContent(),c=s instanceof HTMLElement?s:s?.getDomRef();t.apply(this,p),c&&f(c),u(this)}},m=e=>{const t=e.prototype.onFocusEvent;e.prototype.onFocusEvent=function(p){g(this)&&t.call(this,p)}},I=()=>{const e=new CSSStyleSheet;e.replaceSync(".sapMPopup-CTX:popover-open { inset: unset; }"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},P=e=>{v(e),O(e),I(),m(e)};export{P as patchPopup,l as addOpenedPopup,u as removeOpenedPopup,y as getTopmostPopup};
1
+ "use strict";import y from"../getSharedResource.js";import d from"./insertOpenUI5PopupStyles.js";const n=y("AllOpenedPopupsRegistry",{openedRegistry:[]}),l=e=>{n.openedRegistry.push(e)},u=e=>{const t=n.openedRegistry.findIndex(o=>o.instance===e);t>-1&&n.openedRegistry.splice(t,1)},g=()=>n.openedRegistry[n.openedRegistry.length-1].instance,f=e=>{for(let t=n.openedRegistry.length-1;t>=0;t--){const o=n.openedRegistry[t];if(o.type!=="OpenUI5")return!1;if(o.instance===e)break}return!0},h=e=>{e.setAttribute("popover","manual"),e.showPopover()},v=e=>{e.hasAttribute("popover")&&(e.hidePopover(),e.removeAttribute("popover"))},a=(e=document)=>e.querySelector(":popover-open")?!0:Array.from(e.querySelectorAll("*")).some(t=>{const o=t.shadowRoot;return o&&a(o)}),O=e=>{const t=e.prototype.open;e.prototype.open=function(...p){t.apply(this,p);const s=a();if(["OPENING","OPEN"].includes(this.getOpenState())&&s){const r=this.getContent();if(r){const i=r instanceof HTMLElement?r:r?.getDomRef();i&&h(i)}}l({type:"OpenUI5",instance:this})}},m=e=>{const t=e.prototype._closed;e.prototype._closed=function(...p){const s=this.getContent(),c=s instanceof HTMLElement?s:s?.getDomRef();t.apply(this,p),c&&v(c),u(this)}},I=e=>{const t=e.prototype.onFocusEvent;e.prototype.onFocusEvent=function(p){f(this)&&t.call(this,p)}},P=()=>{const e=new CSSStyleSheet;e.replaceSync(".sapMPopup-CTX:popover-open { inset: unset; }"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},E=e=>{d(),O(e),m(e),P(),I(e)};export{E as patchPopup,l as addOpenedPopup,u as removeOpenedPopup,g as getTopmostPopup};
2
2
  //# sourceMappingURL=patchPopup.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/features/patchPopup.ts"],
4
- "sourcesContent": ["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (e: FocusEvent) => void,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"OpenUI5\" | \"WebComponent\";\n\tinstance: object;\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<PopupInfo> }>(\"AllOpenedPopupsRegistry\", { openedRegistry: [] });\n\nconst addOpenedPopup = (popupInfo: PopupInfo) => {\n\tAllOpenedPopupsRegistry.openedRegistry.push(popupInfo);\n};\n\nconst removeOpenedPopup = (popup: object) => {\n\tconst index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Original OpenUI5 popup focus event is triggered only\n * if there are no Web Component popups opened on top of it.\n *\n * @param {object} popup - The popup instance to check.\n * @returns {boolean} True if the focus event should be triggered, false otherwise.\n */\nconst shouldCallOpenUI5FocusEvent = (popup: object) => {\n\tfor (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {\n\t\tconst popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];\n\t\tif (popupInfo.type !== \"OpenUI5\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn true;\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst isNativePopoverOpen = (root: Document | ShadowRoot = document): boolean => {\n\tif (root.querySelector(\":popover-open\")) {\n\t\treturn true;\n\t}\n\n\treturn Array.from(root.querySelectorAll(\"*\")).some(element => {\n\t\tconst shadowRoot = element.shadowRoot;\n\t\treturn shadowRoot && isNativePopoverOpen(shadowRoot);\n\t});\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = isNativePopoverOpen();\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(e: FocusEvent) {\n\t\tif (shouldCallOpenUI5FocusEvent(this)) {\n\t\t\torigFocusEvent.call(this, e);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup) => {\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, PopupInfo };\n"],
5
- "mappings": "aACA,OAAOA,MAAuB,0BAuB9B,MAAMC,EAA0BD,EAAwD,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIE,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EAEMC,E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AU,IACX,CAAC,CACF,CACD,EAEMqB,EAAeJ,GAAwB,CAC5C,MAAMK,EAAcL,EAAM,UAAU,QACpCA,EAAM,UAAU,QAAU,YAAoBE,EAAa,CAC1D,MAAML,EAAU,KAAK,WAAW,EAC1BJ,EAASI,aAAmB,YAAcA,EAAUA,GAAS,UAAU,EAC7EQ,EAAY,MAAM,KAAMH,CAAI,EACxBT,GACHC,EAAmBD,CAAM,EAG1BR,EAAkB,IAAI,CACvB,CACD,EAEMqB,EAAmBN,GAAwB,CAChD,MAAMO,EAAiBP,EAAM,UAAU,aACvCA,EAAM,UAAU,aAAe,SAAsBQ,EAAe,CAC/DlB,EAA4B,IAAI,GACnCiB,EAAe,KAAK,KAAMC,CAAC,CAE7B,CACD,EAEMC,EAAqB,IAAM,CAChC,MAAMC,EAAa,IAAI,cACvBA,EAAW,YAAY,+CAA+C,EACtE,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBA,CAAU,CAC1E,EAEMC,EAAcX,GAAwB,CAC3CD,EAAUC,CAAK,EACfI,EAAYJ,CAAK,EACjBS,EAAmB,EACnBH,EAAgBN,CAAK,CACtB,EAEA,OACCW,KAAA,WACA5B,KAAA,eACAE,KAAA,kBACAI,KAAA",
6
- "names": ["getSharedResource", "AllOpenedPopupsRegistry", "addOpenedPopup", "popupInfo", "removeOpenedPopup", "popup", "index", "el", "getTopmostPopup", "shouldCallOpenUI5FocusEvent", "i", "openNativePopover", "domRef", "closeNativePopover", "isNativePopoverOpen", "root", "element", "shadowRoot", "patchOpen", "Popup", "origOpen", "args", "topLayerAlreadyInUse", "patchClosed", "_origClosed", "patchFocusEvent", "origFocusEvent", "e", "createGlobalStyles", "stylesheet", "patchPopup"]
4
+ "sourcesContent": ["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (e: FocusEvent) => void,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"OpenUI5\" | \"WebComponent\";\n\tinstance: object;\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<PopupInfo> }>(\"AllOpenedPopupsRegistry\", { openedRegistry: [] });\n\nconst addOpenedPopup = (popupInfo: PopupInfo) => {\n\tAllOpenedPopupsRegistry.openedRegistry.push(popupInfo);\n};\n\nconst removeOpenedPopup = (popup: object) => {\n\tconst index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Original OpenUI5 popup focus event is triggered only\n * if there are no Web Component popups opened on top of it.\n *\n * @param {object} popup - The popup instance to check.\n * @returns {boolean} True if the focus event should be triggered, false otherwise.\n */\nconst shouldCallOpenUI5FocusEvent = (popup: object) => {\n\tfor (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {\n\t\tconst popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];\n\t\tif (popupInfo.type !== \"OpenUI5\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn true;\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst isNativePopoverOpen = (root: Document | ShadowRoot = document): boolean => {\n\tif (root.querySelector(\":popover-open\")) {\n\t\treturn true;\n\t}\n\n\treturn Array.from(root.querySelectorAll(\"*\")).some(element => {\n\t\tconst shadowRoot = element.shadowRoot;\n\t\treturn shadowRoot && isNativePopoverOpen(shadowRoot);\n\t});\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = isNativePopoverOpen();\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(e: FocusEvent) {\n\t\tif (shouldCallOpenUI5FocusEvent(this)) {\n\t\t\torigFocusEvent.call(this, e);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup) => {\n\tinsertOpenUI5PopupStyles();\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, PopupInfo };\n"],
5
+ "mappings": "aACA,OAAOA,MAAuB,0BAC9B,OAAOC,MAA8B,gCAuBrC,MAAMC,EAA0BF,EAAwD,0BAA2B,CAAE,eAAgB,CAAC,CAAE,CAAC,EAEnIG,EAAkBC,GAAyB,CAChDF,EAAwB,eAAe,KAAKE,CAAS,CACtD,EAEMC,EAAqBC,GAAkB,CAC5C,MAAMC,EAAQL,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,SAU5FQ,EAA+BJ,GAAkB,CACtD,QAASK,EAAIT,EAAwB,eAAe,OAAS,EAAGS,GAAK,EAAGA,IAAK,CAC5E,MAAMP,EAAYF,EAAwB,eAAeS,CAAC,EAC1D,GAAIP,EAAU,OAAS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,UAAU,aAAe,SAAsBQ,EAAe,CAC/DlB,EAA4B,IAAI,GACnCiB,EAAe,KAAK,KAAMC,CAAC,CAE7B,CACD,EAEMC,EAAqB,IAAM,CAChC,MAAMC,EAAa,IAAI,cACvBA,EAAW,YAAY,+CAA+C,EACtE,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBA,CAAU,CAC1E,EAEMC,EAAcX,GAAwB,CAC3CnB,EAAyB,EACzBkB,EAAUC,CAAK,EACfI,EAAYJ,CAAK,EACjBS,EAAmB,EACnBH,EAAgBN,CAAK,CACtB,EAEA,OACCW,KAAA,WACA5B,KAAA,eACAE,KAAA,kBACAI,KAAA",
6
+ "names": ["getSharedResource", "insertOpenUI5PopupStyles", "AllOpenedPopupsRegistry", "addOpenedPopup", "popupInfo", "removeOpenedPopup", "popup", "index", "el", "getTopmostPopup", "shouldCallOpenUI5FocusEvent", "i", "openNativePopover", "domRef", "closeNativePopover", "isNativePopoverOpen", "root", "element", "shadowRoot", "patchOpen", "Popup", "origOpen", "args", "topLayerAlreadyInUse", "patchClosed", "_origClosed", "patchFocusEvent", "origFocusEvent", "e", "createGlobalStyles", "stylesheet", "patchPopup"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";const e={version:"2.14.0",major:2,minor:14,patch:0,suffix:"",isNext:!1,buildTime:1756977409};export default e;
1
+ "use strict";const e={version:"2.15.0-rc.2",major:2,minor:15,patch:0,suffix:"-rc.2",isNext:!1,buildTime:1758790021};export default e;
2
2
  //# sourceMappingURL=VersionInfo.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/generated/VersionInfo.ts"],
4
- "sourcesContent": ["const VersionInfo = {\n\tversion: \"2.14.0\",\n\tmajor: 2,\n\tminor: 14,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1756977409,\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",
4
+ "sourcesContent": ["const VersionInfo = {\n\tversion: \"2.15.0-rc.2\",\n\tmajor: 2,\n\tminor: 15,\n\tpatch: 0,\n\tsuffix: \"-rc.2\",\n\tisNext: false,\n\tbuildTime: 1758790021,\n};\nexport default VersionInfo;"],
5
+ "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
  }
@@ -0,0 +1,2 @@
1
+ "use strict";export default"[data-sap-ui-popup][popover]{border:none;overflow:visible;margin:0}";
2
+ //# sourceMappingURL=OpenUI5PopupStyles.css.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/generated/css/OpenUI5PopupStyles.css.ts"],
4
+ "sourcesContent": ["export default `[data-sap-ui-popup][popover]{border:none;overflow:visible;margin:0}`;"],
5
+ "mappings": "aAAA,cAAe",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";import{registerI18nLoader as s}from"@ui5/webcomponents-base/dist/asset-registries/i18n.js";const t=async e=>{switch(e){case"en":return(await fetch(new URL("../assets/i18n/messagebundle_en.json",import.meta.url))).json();case"en_US_sappsd":return(await fetch(new URL("../assets/i18n/messagebundle_en_US_sappsd.json",import.meta.url))).json();case"en_US_saprigi":return(await fetch(new URL("../assets/i18n/messagebundle_en_US_saprigi.json",import.meta.url))).json();case"en_US_saptrc":return(await fetch(new URL("../assets/i18n/messagebundle_en_US_saptrc.json",import.meta.url))).json();default:throw"unknown locale"}},a=async e=>{const n=await t(e);if(typeof n=="string"&&n.endsWith(".json"))throw new Error('[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.');return n},r=["en","en_US_sappsd","en_US_saprigi","en_US_saptrc"];r.forEach(e=>{s("@ui5/webcomponents-base",e,a)});
1
+ "use strict";
2
2
  //# sourceMappingURL=i18n-fetch.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/generated/json-imports/i18n-fetch.ts"],
4
- "sourcesContent": ["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en.json\", import.meta.url))).json();\n\t\tcase \"en_US_sappsd\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en_US_sappsd.json\", import.meta.url))).json();\n\t\tcase \"en_US_saprigi\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en_US_saprigi.json\", import.meta.url))).json();\n\t\tcase \"en_US_saptrc\": return (await fetch(new URL(\"../assets/i18n/messagebundle_en_US_saptrc.json\", import.meta.url))).json();\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_sappsd\",\n\t\"en_US_saprigi\",\n\t\"en_US_saptrc\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@\" + \"u\" + \"i\" + \"5\" + \"/\" + \"w\" + \"e\" + \"b\" + \"c\" + \"o\" + \"m\" + \"p\" + \"o\" + \"n\" + \"e\" + \"n\" + \"t\" + \"s\" + \"-\" + \"b\" + \"a\" + \"s\" + \"e\", localeId, importAndCheck);\n});\n"],
5
- "mappings": "aACA,OAAS,sBAAAA,MAA0B,wDAEnC,MAAMC,EAAsB,MAAOC,GAAa,CAC/C,OAAQA,EAAU,CACf,IAAK,KAAM,OAAQ,MAAM,MAAM,IAAI,IAAI,uCAAwC,YAAY,GAAG,CAAC,GAAG,KAAK,EACzG,IAAK,eAAgB,OAAQ,MAAM,MAAM,IAAI,IAAI,iDAAkD,YAAY,GAAG,CAAC,GAAG,KAAK,EAC3H,IAAK,gBAAiB,OAAQ,MAAM,MAAM,IAAI,IAAI,kDAAmD,YAAY,GAAG,CAAC,GAAG,KAAK,EAC7H,IAAK,eAAgB,OAAQ,MAAM,MAAM,IAAI,IAAI,iDAAkD,YAAY,GAAG,CAAC,GAAG,KAAK,EAC3H,QAAS,KAAM,gBAChB,CACD,EAEMC,EAAiB,MAAOD,GAAa,CAC1C,MAAME,EAAO,MAAMH,EAAoBC,CAAQ,EAC/C,GAAI,OAAOE,GAAS,UAAYA,EAAK,SAAS,OAAO,EACpD,MAAM,IAAI,MAAM,+KAA+K,EAEhM,OAAOA,CACR,EAEMC,EAAY,CAAC,KAClB,eACA,gBACA,cAAe,EAEhBA,EAAU,QAAQH,GAAY,CAC7BF,EAAmB,0BAAyIE,EAAUC,CAAc,CACrL,CAAC",
6
- "names": ["registerI18nLoader", "importMessageBundle", "localeId", "importAndCheck", "data", "localeIds"]
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{registerI18nLoader as n}from"@ui5/webcomponents-base/dist/asset-registries/i18n.js";const a=async t=>{switch(t){case"en":return(await import("../assets/i18n/messagebundle_en.json",{with:{type:"json"}})).default;case"en_US_sappsd":return(await import("../assets/i18n/messagebundle_en_US_sappsd.json",{with:{type:"json"}})).default;case"en_US_saprigi":return(await import("../assets/i18n/messagebundle_en_US_saprigi.json",{with:{type:"json"}})).default;case"en_US_saptrc":return(await import("../assets/i18n/messagebundle_en_US_saptrc.json",{with:{type:"json"}})).default;default:throw"unknown locale"}},i=async t=>{const e=await a(t);if(typeof e=="string"&&e.endsWith(".json"))throw new Error('[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.');return e},s=["en","en_US_sappsd","en_US_saprigi","en_US_saptrc"];s.forEach(t=>{n("@ui5/webcomponents-base",t,i)});
1
+ "use strict";
2
2
  //# sourceMappingURL=i18n-node.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/generated/json-imports/i18n-node.ts"],
4
- "sourcesContent": ["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en\" */ \"../assets/i18n/messagebundle_en.json\", {with: { type: 'json'}})).default;\n\t\tcase \"en_US_sappsd\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_sappsd\" */ \"../assets/i18n/messagebundle_en_US_sappsd.json\", {with: { type: 'json'}})).default;\n\t\tcase \"en_US_saprigi\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saprigi\" */ \"../assets/i18n/messagebundle_en_US_saprigi.json\", {with: { type: 'json'}})).default;\n\t\tcase \"en_US_saptrc\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saptrc\" */ \"../assets/i18n/messagebundle_en_US_saptrc.json\", {with: { type: 'json'}})).default;\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_sappsd\",\n\t\"en_US_saprigi\",\n\t\"en_US_saptrc\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@\" + \"u\" + \"i\" + \"5\" + \"/\" + \"w\" + \"e\" + \"b\" + \"c\" + \"o\" + \"m\" + \"p\" + \"o\" + \"n\" + \"e\" + \"n\" + \"t\" + \"s\" + \"-\" + \"b\" + \"a\" + \"s\" + \"e\", localeId, importAndCheck);\n});\n"],
5
- "mappings": "aACA,OAAS,sBAAAA,MAA0B,wDAEnC,MAAMC,EAAsB,MAAOC,GAAa,CAC/C,OAAQA,EAAU,CACf,IAAK,KAAM,OAAQ,KAAM,QAAyE,uCAAwC,CAAC,KAAM,CAAE,KAAM,MAAM,CAAC,CAAC,GAAG,QACtK,IAAK,eAAgB,OAAQ,KAAM,QAAmF,iDAAkD,CAAC,KAAM,CAAE,KAAM,MAAM,CAAC,CAAC,GAAG,QAClM,IAAK,gBAAiB,OAAQ,KAAM,QAAoF,kDAAmD,CAAC,KAAM,CAAE,KAAM,MAAM,CAAC,CAAC,GAAG,QACrM,IAAK,eAAgB,OAAQ,KAAM,QAAmF,iDAAkD,CAAC,KAAM,CAAE,KAAM,MAAM,CAAC,CAAC,GAAG,QAClM,QAAS,KAAM,gBAChB,CACD,EAEMC,EAAiB,MAAOD,GAAa,CAC1C,MAAME,EAAO,MAAMH,EAAoBC,CAAQ,EAC/C,GAAI,OAAOE,GAAS,UAAYA,EAAK,SAAS,OAAO,EACpD,MAAM,IAAI,MAAM,+KAA+K,EAEhM,OAAOA,CACR,EAEMC,EAAY,CAAC,KAClB,eACA,gBACA,cAAe,EAEhBA,EAAU,QAAQH,GAAY,CAC7BF,EAAmB,0BAAyIE,EAAUC,CAAc,CACrL,CAAC",
6
- "names": ["registerI18nLoader", "importMessageBundle", "localeId", "importAndCheck", "data", "localeIds"]
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{registerI18nLoader as n}from"@ui5/webcomponents-base/dist/asset-registries/i18n.js";const a=async e=>{switch(e){case"en":return(await import("../assets/i18n/messagebundle_en.json")).default;case"en_US_sappsd":return(await import("../assets/i18n/messagebundle_en_US_sappsd.json")).default;case"en_US_saprigi":return(await import("../assets/i18n/messagebundle_en_US_saprigi.json")).default;case"en_US_saptrc":return(await import("../assets/i18n/messagebundle_en_US_saptrc.json")).default;default:throw"unknown locale"}},r=async e=>{const t=await a(e);if(typeof t=="string"&&t.endsWith(".json"))throw new Error('[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.');return t},i=["en","en_US_sappsd","en_US_saprigi","en_US_saptrc"];i.forEach(e=>{n("@ui5/webcomponents-base",e,r)});
1
+ "use strict";
2
2
  //# sourceMappingURL=i18n.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/generated/json-imports/i18n.ts"],
4
- "sourcesContent": ["// @ts-nocheck\nimport { registerI18nLoader } from \"@ui5/webcomponents-base/dist/asset-registries/i18n.js\";\n\nconst importMessageBundle = async (localeId) => {\n\tswitch (localeId) {\n\t\t\t\tcase \"en\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en\" */ \"../assets/i18n/messagebundle_en.json\")).default;\n\t\tcase \"en_US_sappsd\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_sappsd\" */ \"../assets/i18n/messagebundle_en_US_sappsd.json\")).default;\n\t\tcase \"en_US_saprigi\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saprigi\" */ \"../assets/i18n/messagebundle_en_US_saprigi.json\")).default;\n\t\tcase \"en_US_saptrc\": return (await import(/* webpackChunkName: \"ui5-webcomponents-base-messagebundle-en_US_saptrc\" */ \"../assets/i18n/messagebundle_en_US_saptrc.json\")).default;\n\t\tdefault: throw \"unknown locale\"\n\t}\n}\n\nconst importAndCheck = async (localeId) => {\n\tconst data = await importMessageBundle(localeId);\n\tif (typeof data === \"string\" && data.endsWith(\".json\")) {\n\t\tthrow new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.`);\n\t}\n\treturn data;\n}\n\nconst localeIds = [\"en\",\n\t\"en_US_sappsd\",\n\t\"en_US_saprigi\",\n\t\"en_US_saptrc\",];\n\nlocaleIds.forEach(localeId => {\n\tregisterI18nLoader(\"@\" + \"u\" + \"i\" + \"5\" + \"/\" + \"w\" + \"e\" + \"b\" + \"c\" + \"o\" + \"m\" + \"p\" + \"o\" + \"n\" + \"e\" + \"n\" + \"t\" + \"s\" + \"-\" + \"b\" + \"a\" + \"s\" + \"e\", localeId, importAndCheck);\n});\n"],
5
- "mappings": "aACA,OAAS,sBAAAA,MAA0B,wDAEnC,MAAMC,EAAsB,MAAOC,GAAa,CAC/C,OAAQA,EAAU,CACf,IAAK,KAAM,OAAQ,KAAM,QAAyE,sCAAsC,GAAG,QAC7I,IAAK,eAAgB,OAAQ,KAAM,QAAmF,gDAAgD,GAAG,QACzK,IAAK,gBAAiB,OAAQ,KAAM,QAAoF,iDAAiD,GAAG,QAC5K,IAAK,eAAgB,OAAQ,KAAM,QAAmF,gDAAgD,GAAG,QACzK,QAAS,KAAM,gBAChB,CACD,EAEMC,EAAiB,MAAOD,GAAa,CAC1C,MAAME,EAAO,MAAMH,EAAoBC,CAAQ,EAC/C,GAAI,OAAOE,GAAS,UAAYA,EAAK,SAAS,OAAO,EACpD,MAAM,IAAI,MAAM,+KAA+K,EAEhM,OAAOA,CACR,EAEMC,EAAY,CAAC,KAClB,eACA,gBACA,cAAe,EAEhBA,EAAU,QAAQH,GAAY,CAC7BF,EAAmB,0BAAyIE,EAAUC,CAAc,CACrL,CAAC",
6
- "names": ["registerI18nLoader", "importMessageBundle", "localeId", "importAndCheck", "data", "localeIds"]
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
7
  }
@@ -14,68 +14,79 @@ const LIB = path.join(__dirname, `../tools/lib/`);
14
14
  const viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
15
15
 
16
16
  const scripts = {
17
- clean: "rimraf src/generated && rimraf dist && rimraf .port",
17
+ __ui5envs: {
18
+ UI5_TS: true,
19
+ UI5_BASE: true,
20
+ UI5_CEM_MODE: "dev",
21
+ },
22
+ clean: "rimraf src/generated && rimraf dist",
18
23
  lint: `eslint .`,
19
- generate: "cross-env UI5_TS=true nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace generateTemplates build.jsonImports",
20
- prepare: "cross-env UI5_TS=true nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace generateTemplates typescript integrate.no-remaining-require build.jsonImports",
24
+ generate: "ui5nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace build.jsonImports",
25
+ prepare: "ui5nps clean build.i18n integrate copy generateAssetParameters generateVersionInfo generateStyles generateFontFace typescript integrate.no-remaining-require build.jsonImports",
21
26
  typescript: "tsc -b",
22
27
  integrate: {
23
- default: "nps integrate.copy-used-modules integrate.amd-to-es6 integrate.third-party",
28
+ default: "ui5nps integrate.copy-used-modules integrate.amd-to-es6 integrate.third-party",
24
29
  "copy-used-modules": `node "${copyUsedModules}" ./used-modules.txt dist/`,
25
30
  "amd-to-es6": `node "${amdToES6}" dist/`,
26
31
  "no-remaining-require": `node "${noRequire}" dist/`,
27
32
  "third-party": {
28
- default: "nps integrate.third-party.copy integrate.third-party.fix",
29
- copy: "mkdirp dist/sap/ui/thirdparty/ && copy-and-watch ../../node_modules/@openui5/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js dist/sap/ui/thirdparty/",
33
+ default: "ui5nps integrate.third-party.copy integrate.third-party.fix",
34
+ copy: "copy-and-watch ../../node_modules/@openui5/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js dist/sap/ui/thirdparty/",
30
35
  fix: "replace-in-file 240 xA0 dist/sap/ui/thirdparty/caja-html-sanitizer.js"
31
36
  },
32
37
  },
33
38
  build: {
34
- default: `nps prepare`,
39
+ default: `ui5nps prepare`,
35
40
  bundle: `vite build ${viteConfig}`,
36
41
  i18n: {
37
- default: "nps build.i18n.defaultsjs build.i18n.json",
42
+ default: "ui5nps build.i18n.defaultsjs build.i18n.json",
38
43
  defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
39
44
  json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
40
45
  },
41
46
  jsonImports: {
42
- default: "mkdirp src/generated/json-imports && nps build.jsonImports.i18n",
47
+ default: "ui5nps build.jsonImports.i18n",
43
48
  i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n src/generated/json-imports`,
44
49
  },
45
50
  },
46
51
  copy: {
47
- default: "nps copy.src",
52
+ default: "ui5nps copy.src",
48
53
  src: `copy-and-watch "src/**/*.{js,css,d.ts}" dist/`,
54
+ srcWithWatch: `copy-and-watch "src/**/*.{js,css,d.ts}" dist/ --watch --skip-initial-copy`,
49
55
  },
50
56
  generateAssetParameters: `node "${assetParametersScript}"`,
51
57
  generateVersionInfo: `node "${versionScript}"`,
52
58
  generateStyles: `node "${stylesScript}"`,
53
59
  generateFontFace: `node "${fontFaceScript}"`,
54
- generateTemplates: ``,
55
- generateTestTemplates: `mkdirp test/test-elements/generated/templates && cross-env UI5_BASE=true UI5_TS=true node "${LIB}/hbs2ui5/index.js" -d test/test-elements -o test/test-elements/generated/templates`,
60
+ generateTestTemplates: `node "${LIB}/hbs2ui5/index.js" -d test/test-elements -o test/test-elements/generated/templates`,
56
61
  generateProd: {
57
- "default": "nps generateProd.remove-dev-mode generateProd.copy-prod",
62
+ "default": "ui5nps generateProd.remove-dev-mode generateProd.copy-prod",
58
63
  "remove-dev-mode": `node "${LIB}/remove-dev-mode/remove-dev-mode.mjs"`,
59
64
  "copy-prod": `copy-and-watch "dist/sap/**/*" dist/prod/sap/ && copy-and-watch "dist/thirdparty/preact/**/*.js" dist/prod/thirdparty/preact/ && copy-and-watch "dist/generated/assets/**/*.json" dist/prod/generated/assets/`,
60
65
  },
61
66
  generateAPI: {
62
- default: "nps generateAPI.generateCEM generateAPI.validateCEM",
63
- generateCEM: `cross-env UI5_CEM_MODE='dev' cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs"`,
64
- validateCEM: `cross-env UI5_CEM_MODE='dev' node "${LIB}/cem/validate.js"`,
67
+ default: "ui5nps generateAPI.generateCEM generateAPI.validateCEM",
68
+ generateCEM: `cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs"`,
69
+ validateCEM: `node "${LIB}/cem/validate.js"`,
65
70
  },
66
71
  watch: {
67
- default: 'concurrently "nps watch.src" "nps watch.styles"',
68
- withBundle: 'concurrently "nps watch.src" "nps watch.bundle" "nps watch.styles"',
69
- src: 'nps "copy.src --watch --skip-initial-copy"',
72
+ default: 'ui5nps-p watch.src watch.styles', // concurently
73
+ withBundle: 'ui5nps-p watch.src watch.bundle watch.styles', // concurently
74
+ src: 'ui5nps copy.srcWithWatch',
70
75
  bundle: `node ${LIB}/dev-server/dev-server.mjs ${viteConfig}`,
71
- styles: 'chokidar "src/css/*.css" -c "nps generateStyles"'
76
+ styles: 'chokidar "src/css/*.css" -c "ui5nps generateStyles"'
72
77
  },
73
78
  test: {
74
- default: 'concurrently "nps test.ssr" "nps test.ssr2" "nps test.test-cy-ci"',
79
+ default: 'ui5nps-p test.ssr test.ssr2 test.test-cy-ci', // concurently
75
80
  ssr: `mocha test/ssr`,
76
81
  ssr2: "node -e \"import('./dist/Device.js')\"",
77
- "test-cy-ci": `nps generateTestTemplates && cross-env UI5_BASE=true yarn cypress run --component --browser chrome`,
78
- "test-cy-open": `nps generateTestTemplates && cross-env UI5_BASE=true yarn cypress open --component --browser chrome`,
82
+ "test-cy-ci": {
83
+ default: "ui5nps generateTestTemplates test.test-cy-ci.cypress",
84
+ cypress: ` yarn cypress run --component --browser chrome`
85
+ },
86
+ "test-cy-open": {
87
+ default: "ui5nps generateTestTemplates test.test-cy-open.cypress",
88
+ cypress: ` yarn cypress open --component --browser chrome`
89
+ }
79
90
  },
80
91
  };
81
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "2.14.0",
3
+ "version": "2.15.0-rc.2",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "https://github.com/SAP/ui5-webcomponents.git",
16
+ "url": "https://github.com/UI5/webcomponents.git",
17
17
  "directory": "packages/base"
18
18
  },
19
19
  "exports": {
@@ -43,36 +43,45 @@
43
43
  },
44
44
  "types": "./dist",
45
45
  "scripts": {
46
- "clean": "nps clean",
47
- "lint": "nps lint",
48
- "start": "nps start",
49
- "build": "nps build",
50
- "generate": "nps generate",
51
- "generateAPI": "nps generateAPI",
52
- "generateProd": "nps generateProd",
53
- "bundle": "nps build.bundle",
54
- "test": "nps test",
55
- "test:cypress:open": "nps test.test-cy-open",
46
+ "clean": "wc-dev clean",
47
+ "lint": "wc-dev lint",
48
+ "start": "wc-dev start",
49
+ "build": "wc-dev build",
50
+ "generate": "wc-dev generate",
51
+ "generateAPI": "wc-dev generateAPI",
52
+ "generateProd": "wc-dev generateProd",
53
+ "bundle": "wc-dev build.bundle",
54
+ "test": "wc-dev test",
55
+ "test:cypress:open": "wc-dev test.test-cy-open",
56
56
  "prepublishOnly": "tsc -b"
57
57
  },
58
58
  "dependencies": {
59
59
  "@lit-labs/ssr-dom-shim": "^1.1.2",
60
+ "chokidar-cli": "^3.0.0",
60
61
  "lit-html": "^2.0.1"
61
62
  },
62
63
  "devDependencies": {
64
+ "@custom-elements-manifest/analyzer": "^0.10.6",
63
65
  "@openui5/sap.ui.core": "1.120.17",
64
66
  "@sap-theming/theming-base-content": "11.29.3",
65
67
  "@ui5/cypress-internal": "0.0.0",
66
- "@ui5/webcomponents-tools": "2.14.0",
67
- "chromedriver": "^138.0.5",
68
+ "@ui5/webcomponents-tools": "2.15.0-rc.2",
68
69
  "clean-css": "^5.2.2",
70
+ "concurrently": "^9.2.1",
69
71
  "copy-and-watch": "^0.1.5",
70
72
  "cross-env": "^7.0.3",
73
+ "cypress": "^13.0.0",
71
74
  "eslint": "^7.22.0",
72
75
  "mkdirp": "^1.0.4",
76
+ "mocha": "^11.7.2",
77
+ "nps": "^5.10.0",
73
78
  "replace-in-file": "^6.3.5",
74
79
  "resolve": "^1.20.0",
75
- "touch": "^3.1.0"
80
+ "rimraf": "^6.0.1",
81
+ "touch": "^3.1.0",
82
+ "typescript": "^5.6.2",
83
+ "vite": "5.4.8"
76
84
  },
77
- "gitHead": "798113e3338ae2e3570cbee2ad0eb629d70445e4"
85
+ "customElements": "dist/custom-elements.json",
86
+ "gitHead": "ed55cd91014aec191705b37b57e8cf5dc8cc95ce"
78
87
  }
@@ -0,0 +1,5 @@
1
+ [data-sap-ui-popup][popover] {
2
+ border: none;
3
+ overflow: visible;
4
+ margin: 0;
5
+ }