@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
@@ -74,7 +74,7 @@ const displayFailedRegistrations = () => {
74
74
  message = `${message}\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;
75
75
  }
76
76
  });
77
- message = `${message}\n\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;
77
+ message = `${message}\n\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/UI5/webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;
78
78
  console.warn(message); // eslint-disable-line
79
79
  };
80
80
  export { registerTag, isTagRegistered, hasRegisteredTags, getAllRegisteredTags, recordTagRegistrationFailure, };
@@ -1 +1 @@
1
- {"version":3,"file":"CustomElementsRegistry.js","sourceRoot":"","sources":["../src/CustomElementsRegistry.ts"],"names":[],"mappings":"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,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,WAAW,CAAC;QAChB,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACpB,WAAW,GAAG,UAAU,CAAC;QAC1B,CAAC;aAAM,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YAC3B,WAAW,GAAG,SAAS,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,WAAW,GAAG,UAAU,CAAC;QAC1B,CAAC;QACD,OAAO,GAAG,GAAG,OAAO,QAAQ,cAAc,CAAC,WAAW,sBAAsB,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,IAAI,gDAAgD,WAAW,aAAa,YAAY,CAAC,WAAW,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAEpR,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,GAAG,GAAG,OAAO,qFAAqF,YAAY,CAAC,WAAW,kCAAkC,CAAC;QACrK,CAAC;aAAM,CAAC;YACP,OAAO,GAAG,GAAG,OAAO,+HAA+H,CAAC;QACrJ,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,GAAG,OAAO,oNAAoN,CAAC;IAEzO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;AAC9C,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC","sourcesContent":["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst hasRegisteredTags = () => {\n\treturn Definitions.size > 0;\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\thasRegisteredTags,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"]}
1
+ {"version":3,"file":"CustomElementsRegistry.js","sourceRoot":"","sources":["../src/CustomElementsRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGxF,MAAM,IAAI,GAAG,iBAAiB,CAAsB,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;AAEtC,IAAI,QAAQ,GAAG,IAAI,GAAG,EAAuB,CA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QACD,OAAO,GAAG,GAAG,OAAO,QAAQ,cAAc,CAAC,WAAW,sBAAsB,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,IAAI,gDAAgD,WAAW,aAAa,YAAY,CAAC,WAAW,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAEpR,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,GAAG,GAAG,OAAO,qFAAqF,YAAY,CAAC,WAAW,kCAAkC,CAAC;QACrK,CAAC;aAAM,CAAC;YACP,OAAO,GAAG,GAAG,OAAO,+HAA+H,CAAC;QACrJ,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,GAAG,OAAO,gNAAgN,CAAC;IAErO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;AAC9C,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC","sourcesContent":["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst hasRegisteredTags = () => {\n\treturn Definitions.size > 0;\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/UI5/webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\thasRegisteredTags,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"]}
@@ -21,7 +21,7 @@ const setCustomElementsScopingSuffix = (suffix) => {
21
21
  }
22
22
  if (hasRegisteredTags()) {
23
23
  // eslint-disable-next-line no-console
24
- console.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.");
24
+ console.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.");
25
25
  }
26
26
  suf = suffix;
27
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CustomElementsScopeUtils.js","sourceRoot":"","sources":["../src/CustomElementsScopeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,IAAI,GAAW,CAAC;AAOhB,IAAI,QAAQ,GAAU;IACrB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE,EAAE;CACX,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI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AM,UAAU,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EACN,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,GAChB,CAAC","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"]}
1
+ {"version":3,"file":"CustomElementsScopeUtils.js","sourceRoot":"","sources":["../src/CustomElementsScopeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,IAAI,GAAW,CAAC;AAOhB,IAAI,QAAQ,GAAU;IACrB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE,EAAE;CACX,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,GAAG,EAAmB,CAAC,CAAC,uFAAuF;AAErI;;;;;;;;GAQG;AACH,MAAM,8BAA8B,GAAG,CAAC,MAAc,EAAE,EAAE;IACzD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI,iBAAiB,EAAE,EAAE,CAAC;QACzB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,oMAAoM,CAAC,CAAC;IACpN,CAAC;IAED,GAAG,GAAG,MAAM,CAAC;AACd,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,8BAA8B,GAAG,GAAuB,EAAE;IAC/D,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,6BAA6B,GAAG,CAAC,KAAY,EAAE,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CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACjH,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,+BAA+B,GAAG,CAAC,GAAW,EAAE,EAAE;IACvD,IAAI,wBAAwB,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,OAAO,8BAA8B,EAAE,CAAC;IACzC,CAAC;AACF,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAClE,MAAM,IAAI,GAAG,uBAAuB,CAAC;IACrC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,UAAU,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EACN,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,GAChB,CAAC","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/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"]}
@@ -0,0 +1,5 @@
1
+ [data-sap-ui-popup][popover] {
2
+ border: none;
3
+ overflow: visible;
4
+ margin: 0;
5
+ }
@@ -593,6 +593,21 @@
593
593
  }
594
594
  ]
595
595
  },
596
+ {
597
+ "kind": "javascript-module",
598
+ "path": "dist/features/insertOpenUI5PopupStyles.js",
599
+ "declarations": [],
600
+ "exports": [
601
+ {
602
+ "kind": "js",
603
+ "name": "default",
604
+ "declaration": {
605
+ "name": "insertOpenUI5PopupStyles",
606
+ "module": "dist/features/insertOpenUI5PopupStyles.js"
607
+ }
608
+ }
609
+ ]
610
+ },
596
611
  {
597
612
  "kind": "javascript-module",
598
613
  "path": "dist/features/patchPatcher.js",
@@ -585,6 +585,21 @@
585
585
  }
586
586
  ]
587
587
  },
588
+ {
589
+ "kind": "javascript-module",
590
+ "path": "dist/features/insertOpenUI5PopupStyles.js",
591
+ "declarations": [],
592
+ "exports": [
593
+ {
594
+ "kind": "js",
595
+ "name": "default",
596
+ "declaration": {
597
+ "name": "insertOpenUI5PopupStyles",
598
+ "module": "dist/features/insertOpenUI5PopupStyles.js"
599
+ }
600
+ }
601
+ ]
602
+ },
588
603
  {
589
604
  "kind": "javascript-module",
590
605
  "path": "dist/features/patchPatcher.js",
@@ -78,9 +78,18 @@ class F6Navigation {
78
78
  // </ui5-list>
79
79
  // </ui5-flexible-column-layout>
80
80
  // Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)
81
- const firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);
82
- const shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);
83
- currentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;
81
+ const currentGroupFocusable = await this.groupElementToFocus(this.groups[currentIndex]);
82
+ let distanceToNextGroup = 1;
83
+ for (let distanceIndex = 1; distanceIndex < this.groups.length; distanceIndex++) {
84
+ const firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - distanceIndex]);
85
+ if (firstFocusable === currentGroupFocusable) {
86
+ distanceToNextGroup++;
87
+ }
88
+ else {
89
+ break;
90
+ }
91
+ }
92
+ currentIndex -= distanceToNextGroup;
84
93
  if (currentIndex < 0) {
85
94
  currentIndex = this.groups.length - 1;
86
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"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AAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,gBAAgB;QACnB,OAAO,mBAAmB,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,IAAI;QACV,MAAM,UAAU,GAAG,iBAAiB,CAAa,YAAY,EAAE,EAAE,CAAC,CAAC;QAEnE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC1B,UAAU,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;aAAM,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,CAAC;YAChE,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;YAC/B,UAAU,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;IACF,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","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"]}
1
+ {"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAM3D,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;AAErD,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,eAAe,CAAC,mBAAmB,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,2FAA2F;AAC7J,CAAC,CAAC;AAEF,MAAM,YAAY;IAKjB;QAHA,kBAAa,GAAuB,IAAI,CAAC;QACzC,WAAM,GAAuB,EAAE,CAAC;QAG/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAA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AY,CAAC","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"]}
@@ -0,0 +1,2 @@
1
+ declare const insertOpenUI5PopupStyles: () => void;
2
+ export default insertOpenUI5PopupStyles;
@@ -0,0 +1,9 @@
1
+ import { hasStyle, createStyle } from "../ManagedStyles.js";
2
+ import openUI5PopupStyles from "../generated/css/OpenUI5PopupStyles.css.js";
3
+ const insertOpenUI5PopupStyles = () => {
4
+ if (!hasStyle("data-ui5-popup-styles")) {
5
+ createStyle(openUI5PopupStyles, "data-ui5-popup-styles");
6
+ }
7
+ };
8
+ export default insertOpenUI5PopupStyles;
9
+ //# sourceMappingURL=insertOpenUI5PopupStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertOpenUI5PopupStyles.js","sourceRoot":"","sources":["../../src/features/insertOpenUI5PopupStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,4CAA4C,CAAC;AAE5E,MAAM,wBAAwB,GAAG,GAAG,EAAE;IACrC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACxC,WAAW,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;IAC1D,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC","sourcesContent":["import { hasStyle, createStyle } from \"../ManagedStyles.js\";\nimport openUI5PopupStyles from \"../generated/css/OpenUI5PopupStyles.css.js\";\n\nconst insertOpenUI5PopupStyles = () => {\n\tif (!hasStyle(\"data-ui5-popup-styles\")) {\n\t\tcreateStyle(openUI5PopupStyles, \"data-ui5-popup-styles\");\n\t}\n};\n\nexport default insertOpenUI5PopupStyles;\n"]}
@@ -1,5 +1,6 @@
1
1
  // OpenUI5's Control.js subset
2
2
  import getSharedResource from "../getSharedResource.js";
3
+ import insertOpenUI5PopupStyles from "./insertOpenUI5PopupStyles.js";
3
4
  // contains all OpenUI5 and Web Component popups that are currently opened
4
5
  const AllOpenedPopupsRegistry = getSharedResource("AllOpenedPopupsRegistry", { openedRegistry: [] });
5
6
  const addOpenedPopup = (popupInfo) => {
@@ -99,6 +100,7 @@ const createGlobalStyles = () => {
99
100
  document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];
100
101
  };
101
102
  const patchPopup = (Popup) => {
103
+ insertOpenUI5PopupStyles();
102
104
  patchOpen(Popup); // Popup.prototype.open
103
105
  patchClosed(Popup); // Popup.prototype._closed
104
106
  createGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)
@@ -1 +1 @@
1
- {"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAsBxD,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,iBAAiB,CAAuC,yBAAyB,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;AAE3I,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC/C,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,uBAAuB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC;IAC5F,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;QAChB,uBAAuB,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IAC5B,OAAO,uBAAuB,CAAC,cAAc,CAAC,uBAAuB,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC3G,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,CAAC,KAAa,EAAE,EAAE;IACrD,KAAK,IAAI,CAAC,GAAG,uBAAuB,CAAC,cAAc,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AI,CAAC,CAAC,CAAC,wBAAwB;QACvD,IAAI,MAAM,EAAE,CAAC;YACZ,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,qFAAqF;QAClH,CAAC;QAED,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC/C,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC;IACpD,KAAK,CAAC,SAAS,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,CAAa;QACjE,IAAI,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC/B,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;IACvC,UAAU,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IACxE,QAAQ,CAAC,kBAAkB,GAAG,CAAC,GAAG,QAAQ,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB;IACzC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;IAC9C,kBAAkB,EAAE,CAAC,CAAC,6FAA6F;IACnH,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,+BAA+B;AACvD,CAAC,CAAC;AAEF,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,CAAC","sourcesContent":["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\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"]}
1
+ {"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AAsBrE,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,iBAAiB,CAAuC,yBAAyB,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;AAE3I,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC/C,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,uBAAuB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,KAAK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EF,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,wBAAwB,EAAE,CAAC;IAC3B,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB;IACzC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;IAC9C,kBAAkB,EAAE,CAAC,CAAC,6FAA6F;IACnH,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,+BAA+B;AACvD,CAAC,CAAC;AAEF,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,CAAC","sourcesContent":["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (e: FocusEvent) => void,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"OpenUI5\" | \"WebComponent\";\n\tinstance: object;\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<PopupInfo> }>(\"AllOpenedPopupsRegistry\", { openedRegistry: [] });\n\nconst addOpenedPopup = (popupInfo: PopupInfo) => {\n\tAllOpenedPopupsRegistry.openedRegistry.push(popupInfo);\n};\n\nconst removeOpenedPopup = (popup: object) => {\n\tconst index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Original OpenUI5 popup focus event is triggered only\n * if there are no Web Component popups opened on top of it.\n *\n * @param {object} popup - The popup instance to check.\n * @returns {boolean} True if the focus event should be triggered, false otherwise.\n */\nconst shouldCallOpenUI5FocusEvent = (popup: object) => {\n\tfor (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {\n\t\tconst popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];\n\t\tif (popupInfo.type !== \"OpenUI5\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn true;\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst isNativePopoverOpen = (root: Document | ShadowRoot = document): boolean => {\n\tif (root.querySelector(\":popover-open\")) {\n\t\treturn true;\n\t}\n\n\treturn Array.from(root.querySelectorAll(\"*\")).some(element => {\n\t\tconst shadowRoot = element.shadowRoot;\n\t\treturn shadowRoot && isNativePopoverOpen(shadowRoot);\n\t});\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = isNativePopoverOpen();\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(e: FocusEvent) {\n\t\tif (shouldCallOpenUI5FocusEvent(this)) {\n\t\t\torigFocusEvent.call(this, e);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup) => {\n\tinsertOpenUI5PopupStyles();\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, PopupInfo };\n"]}
@@ -1,11 +1,11 @@
1
1
  const VersionInfo = {
2
- version: "2.14.0",
2
+ version: "2.15.0-rc.2",
3
3
  major: 2,
4
- minor: 14,
4
+ minor: 15,
5
5
  patch: 0,
6
- suffix: "",
6
+ suffix: "-rc.2",
7
7
  isNext: false,
8
- buildTime: 1756977409,
8
+ buildTime: 1758790021,
9
9
  };
10
10
  export default VersionInfo;
11
11
  //# sourceMappingURL=VersionInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","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;"]}
1
+ {"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.15.0-rc.2\",\n\tmajor: 2,\n\tminor: 15,\n\tpatch: 0,\n\tsuffix: \"-rc.2\",\n\tisNext: false,\n\tbuildTime: 1758790021,\n};\nexport default VersionInfo;"]}
@@ -0,0 +1,2 @@
1
+ declare const _default: "[data-sap-ui-popup][popover]{border:none;overflow:visible;margin:0}";
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export default `[data-sap-ui-popup][popover]{border:none;overflow:visible;margin:0}`;
2
+ //# sourceMappingURL=OpenUI5PopupStyles.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenUI5PopupStyles.css.js","sourceRoot":"","sources":["../../../src/generated/css/OpenUI5PopupStyles.css.ts"],"names":[],"mappings":"AAAA,eAAe,qEAAqE,CAAC","sourcesContent":["export default `[data-sap-ui-popup][popover]{border:none;overflow:visible;margin:0}`;"]}
@@ -1,26 +1,2 @@
1
- // @ts-nocheck
2
- import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
3
- const importMessageBundle = async (localeId) => {
4
- switch (localeId) {
5
- case "en": return (await fetch(new URL("../assets/i18n/messagebundle_en.json", import.meta.url))).json();
6
- case "en_US_sappsd": return (await fetch(new URL("../assets/i18n/messagebundle_en_US_sappsd.json", import.meta.url))).json();
7
- case "en_US_saprigi": return (await fetch(new URL("../assets/i18n/messagebundle_en_US_saprigi.json", import.meta.url))).json();
8
- case "en_US_saptrc": return (await fetch(new URL("../assets/i18n/messagebundle_en_US_saptrc.json", import.meta.url))).json();
9
- default: throw "unknown locale";
10
- }
11
- };
12
- const importAndCheck = async (localeId) => {
13
- const data = await importMessageBundle(localeId);
14
- if (typeof data === "string" && data.endsWith(".json")) {
15
- throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
16
- }
17
- return data;
18
- };
19
- const localeIds = ["en",
20
- "en_US_sappsd",
21
- "en_US_saprigi",
22
- "en_US_saptrc",];
23
- localeIds.forEach(localeId => {
24
- registerI18nLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "b" + "a" + "s" + "e", localeId, importAndCheck);
25
- });
1
+ export {};
26
2
  //# sourceMappingURL=i18n-fetch.js.map
@@ -1 +1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K,CAAC,CAAC;IAClM,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAI;IACtB,cAAc;IACd,eAAe;IACf,cAAc,EAAE,CAAC;AAElB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IAC5B,kBAAkB,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACvL,CAAC,CAAC,CAAC","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"]}
1
+ {"version":3,"file":"i18n-fetch.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-fetch.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1,26 +1,2 @@
1
- // @ts-nocheck
2
- import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
3
- const importMessageBundle = async (localeId) => {
4
- switch (localeId) {
5
- case "en": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en" */ "../assets/i18n/messagebundle_en.json", { with: { type: 'json' } })).default;
6
- case "en_US_sappsd": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_sappsd" */ "../assets/i18n/messagebundle_en_US_sappsd.json", { with: { type: 'json' } })).default;
7
- case "en_US_saprigi": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saprigi" */ "../assets/i18n/messagebundle_en_US_saprigi.json", { with: { type: 'json' } })).default;
8
- case "en_US_saptrc": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saptrc" */ "../assets/i18n/messagebundle_en_US_saptrc.json", { with: { type: 'json' } })).default;
9
- default: throw "unknown locale";
10
- }
11
- };
12
- const importAndCheck = async (localeId) => {
13
- const data = await importMessageBundle(localeId);
14
- if (typeof data === "string" && data.endsWith(".json")) {
15
- throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
16
- }
17
- return data;
18
- };
19
- const localeIds = ["en",
20
- "en_US_sappsd",
21
- "en_US_saprigi",
22
- "en_US_saptrc",];
23
- localeIds.forEach(localeId => {
24
- registerI18nLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "b" + "a" + "s" + "e", localeId, importAndCheck);
25
- });
1
+ export {};
26
2
  //# sourceMappingURL=i18n-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-node.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-node.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IAC9C,QAAQ,QAAQ,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,iEAAiE,CAAC,sCAAsC,EAAE,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC9K,KAAK,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,2EAA2E,CAAC,gDAAgD,EAAE,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1M,KAAK,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,4EAA4E,CAAC,iDAAiD,EAAE,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC7M,KAAK,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,2EAA2E,CAAC,gDAAgD,EAAE,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1M,OAAO,CAAC,CAAC,MAAM,gBAAgB,CAAA;IAChC,CAAC;AACF,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,+KAA+K,CAAC,CAAC;IAClM,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAI;IACtB,cAAc;IACd,eAAe;IACf,cAAc,EAAE,CAAC;AAElB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IAC5B,kBAAkB,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACvL,CAAC,CAAC,CAAC","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"]}
1
+ {"version":3,"file":"i18n-node.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n-node.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1,26 +1,2 @@
1
- // @ts-nocheck
2
- import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js";
3
- const importMessageBundle = async (localeId) => {
4
- switch (localeId) {
5
- case "en": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en" */ "../assets/i18n/messagebundle_en.json")).default;
6
- case "en_US_sappsd": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_sappsd" */ "../assets/i18n/messagebundle_en_US_sappsd.json")).default;
7
- case "en_US_saprigi": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saprigi" */ "../assets/i18n/messagebundle_en_US_saprigi.json")).default;
8
- case "en_US_saptrc": return (await import(/* webpackChunkName: "ui5-webcomponents-base-messagebundle-en_US_saptrc" */ "../assets/i18n/messagebundle_en_US_saptrc.json")).default;
9
- default: throw "unknown locale";
10
- }
11
- };
12
- const importAndCheck = async (localeId) => {
13
- const data = await importMessageBundle(localeId);
14
- if (typeof data === "string" && data.endsWith(".json")) {
15
- throw new Error(`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the "Assets" documentation for more information.`);
16
- }
17
- return data;
18
- };
19
- const localeIds = ["en",
20
- "en_US_sappsd",
21
- "en_US_saprigi",
22
- "en_US_saptrc",];
23
- localeIds.forEach(localeId => {
24
- registerI18nLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "b" + "a" + "s" + "e", localeId, importAndCheck);
25
- });
1
+ export {};
26
2
  //# sourceMappingURL=i18n.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IAC9C,QAAQ,QAAQ,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,iEAAiE,CAAC,sCAAsC,CAAC,CAAC,CAAC,OAAO,CAAC;QACrJ,KAAK,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,2EAA2E,CAAC,gDAAgD,CAAC,CAAC,CAAC,OAAO,CAAC;QACjL,KAAK,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,4EAA4E,CAAC,iDAAiD,CAAC,CAAC,CAAC,OAAO,CAAC;QACpL,KAAK,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,2EAA2E,CAAC,gDAAgD,CAAC,CAAC,CAAC,OAAO,CAAC;QACjL,OAAO,CAAC,CAAC,MAAM,gBAAgB,CAAA;IAChC,CAAC;AACF,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,+KAA+K,CAAC,CAAC;IAClM,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAI;IACtB,cAAc;IACd,eAAe;IACf,cAAc,EAAE,CAAC;AAElB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IAC5B,kBAAkB,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACvL,CAAC,CAAC,CAAC","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"]}
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/generated/json-imports/i18n.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1,10 +1,10 @@
1
- "use strict";import p from"./getSharedResource.js";import{getCurrentRuntimeIndex as u,compareRuntimes as f,getAllRuntimes as b}from"./Runtimes.js";const g=p("Tags",new Map),d=new Set;let s=new Map,c;const m=-1,h=e=>{d.add(e),g.set(e,u())},w=e=>d.has(e),R=()=>d.size>0,T=()=>[...d.values()],$=e=>{let n=g.get(e);n===void 0&&(n=m),s.has(n)||s.set(n,new Set),s.get(n).add(e),c||(c=setTimeout(()=>{y(),s=new Map,c=void 0},1e3))},y=()=>{const e=b(),n=u(),l=e[n];let t="Multiple UI5 Web Components instances detected.";e.length>1&&(t=`${t}
2
- Loading order (versions before 1.1.0 not listed): ${e.map(i=>`
3
- ${i.description}`).join("")}`),[...s.keys()].forEach(i=>{let o,r;i===m?(o=1,r={description:"Older unknown runtime"}):(o=f(n,i),r=e[i]);let a;o>0?a="an older":o<0?a="a newer":a="the same",t=`${t}
1
+ "use strict";import p from"./getSharedResource.js";import{getCurrentRuntimeIndex as u,compareRuntimes as f,getAllRuntimes as b}from"./Runtimes.js";const g=p("Tags",new Map),d=new Set;let i=new Map,c;const m=-1,h=e=>{d.add(e),g.set(e,u())},w=e=>d.has(e),R=()=>d.size>0,T=()=>[...d.values()],$=e=>{let n=g.get(e);n===void 0&&(n=m),i.has(n)||i.set(n,new Set),i.get(n).add(e),c||(c=setTimeout(()=>{y(),i=new Map,c=void 0},1e3))},y=()=>{const e=b(),n=u(),l=e[n];let t="Multiple UI5 Web Components instances detected.";e.length>1&&(t=`${t}
2
+ Loading order (versions before 1.1.0 not listed): ${e.map(s=>`
3
+ ${s.description}`).join("")}`),[...i.keys()].forEach(s=>{let o,r;s===m?(o=1,r={description:"Older unknown runtime"}):(o=f(n,s),r=e[s]);let a;o>0?a="an older":o<0?a="a newer":a="the same",t=`${t}
4
4
 
5
- "${l.description}" failed to define ${s.get(i).size} tag(s) as they were defined by a runtime of ${a} version "${r.description}": ${[...s.get(i)].sort().join(", ")}.`,o>0?t=`${t}
5
+ "${l.description}" failed to define ${i.get(s).size} tag(s) as they were defined by a runtime of ${a} version "${r.description}": ${[...i.get(s)].sort().join(", ")}.`,o>0?t=`${t}
6
6
  WARNING! If your code uses features of the above web components, unavailable in ${r.description}, it might not work as expected!`:t=`${t}
7
7
  Since the above web components were defined by the same or newer version runtime, they should be compatible with your code.`}),t=`${t}
8
8
 
9
- To prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.`,console.warn(t)};export{h as registerTag,w as isTagRegistered,R as hasRegisteredTags,T as getAllRegisteredTags,$ as recordTagRegistrationFailure};
9
+ To prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/UI5/webcomponents/blob/main/docs/2-advanced/06-scoping.md.`,console.warn(t)};export{h as registerTag,w as isTagRegistered,R as hasRegisteredTags,T as getAllRegisteredTags,$ as recordTagRegistrationFailure};
10
10
  //# sourceMappingURL=CustomElementsRegistry.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/CustomElementsRegistry.ts"],
4
- "sourcesContent": ["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst hasRegisteredTags = () => {\n\treturn Definitions.size > 0;\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\thasRegisteredTags,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"],
5
- "mappings": "aAAA,OAAOA,MAAuB,yBAC9B,OAAS,0BAAAC,EAAwB,mBAAAC,EAAiB,kBAAAC,MAAsB,gBAGxE,MAAMC,EAAOJ,EAAuC,OAAQ,IAAI,GAAK,EAC/DK,EAAc,IAAI,IAExB,IAAIC,EAAW,IAAI,IACfC,EAEJ,MAAMC,EAAkB,GAElBC,EAAeC,GAAgB,CACpCL,EAAY,IAAIK,CAAG,EACnBN,EAAK,IAAIM,EAAKT,EAAuB,CAAC,CACvC,EAEMU,EAAmBD,GACjBL,EAAY,IAAIK,CAAG,EAGrBE,EAAoB,IAClBP,EAAY,KAAO,EAGrBQ,EAAuB,IACrB,CAAC,GAAGR,EAAY,OAAO,CAAC,EAG1BS,EAAgCJ,GAAgB,CACrD,IAAIK,EAAqBX,EAAK,IAAIM,CAAG,EACjCK,IAAuB,SAC1BA,EAAqBP,GAGjBF,EAAS,IAAIS,CAAkB,GACnCT,EAAS,IAAIS,EAAoB,IAAI,GAAK,EAE3CT,EAAS,IAAIS,CAAkB,EAAG,IAAIL,CAAG,EAEpCH,IACJA,EAAiB,WAAW,IAAM,CACjCS,EAA2B,EAC3BV,EAAW,IAAI,IACfC,EAAiB,MAClB,EAAG,GAAI,EAET,EAEMS,EAA6B,IAAM,CACxC,MAAMC,EAAcd,EAAe,EAC7Be,EAAsBjB,EAAuB,EAC7CkB,EAAiBF,EAAYC,CAAmB,EAEtD,IAAIE,EAAU,kDAEVH,EAAY,OAAS,IACxBG,EAAU,GAAGA,CAAO;AAAA,oDAAuDH,EAAY,IAAII,GAAW;AAAA,EAAKA,EAAQ,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,IAG3I,CAAC,GAAGf,EAAS,KAAK,CAAC,EAAE,QAAQgB,GAAqB,CACjD,IAAIC,EACAC,EAEAF,IAAsBd,GACzBe,EAAa,EACbC,EAAe,CACd,YAAa,uBACd,IAEAD,EAAarB,EAAgBgB,EAAqBI,CAAiB,EACnEE,EAAeP,EAAYK,CAAiB,GAG7C,IAAIG,EACAF,EAAa,EAChBE,EAAc,WACJF,EAAa,EACvBE,EAAc,UAEdA,EAAc,WAEfL,EAAU,GAAGA,CAAO;AAAA;AAAA,GAAQD,EAAe,WAAW,sBAAsBb,EAAS,IAAIgB,CAAiB,EAAG,IAAI,gDAAgDG,CAAW,aAAaD,EAAa,WAAW,MAAO,CAAC,GAAGlB,EAAS,IAAIgB,CAAiB,CAAE,EAAG,KAAK,EAAE,KAAK,IAAI,CAAC,IAE5QC,EAAa,EAChBH,EAAU,GAAGA,CAAO;AAAA,kFAAqFI,EAAa,WAAW,mCAEjIJ,EAAU,GAAGA,CAAO;AAAA,4HAEtB,CAAC,EAEDA,EAAU,GAAGA,CAAO;AAAA;AAAA,gNAEpB,QAAQ,KAAKA,CAAO,CACrB,EAEA,OACCX,KAAA,YACAE,KAAA,gBACAC,KAAA,kBACAC,KAAA,qBACAC,KAAA",
4
+ "sourcesContent": ["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst hasRegisteredTags = () => {\n\treturn Definitions.size > 0;\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/UI5/webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\thasRegisteredTags,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"],
5
+ "mappings": "aAAA,OAAOA,MAAuB,yBAC9B,OAAS,0BAAAC,EAAwB,mBAAAC,EAAiB,kBAAAC,MAAsB,gBAGxE,MAAMC,EAAOJ,EAAuC,OAAQ,IAAI,GAAK,EAC/DK,EAAc,IAAI,IAExB,IAAIC,EAAW,IAAI,IACfC,EAEJ,MAAMC,EAAkB,GAElBC,EAAeC,GAAgB,CACpCL,EAAY,IAAIK,CAAG,EACnBN,EAAK,IAAIM,EAAKT,EAAuB,CAAC,CACvC,EAEMU,EAAmBD,GACjBL,EAAY,IAAIK,CAAG,EAGrBE,EAAoB,IAClBP,EAAY,KAAO,EAGrBQ,EAAuB,IACrB,CAAC,GAAGR,EAAY,OAAO,CAAC,EAG1BS,EAAgCJ,GAAgB,CACrD,IAAIK,EAAqBX,EAAK,IAAIM,CAAG,EACjCK,IAA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BACAC,KAAA,kBACAC,KAAA,qBACAC,KAAA",
6
6
  "names": ["getSharedResource", "getCurrentRuntimeIndex", "compareRuntimes", "getAllRuntimes", "Tags", "Definitions", "Failures", "failureTimeout", "UNKNOWN_RUNTIME", "registerTag", "tag", "isTagRegistered", "hasRegisteredTags", "getAllRegisteredTags", "recordTagRegistrationFailure", "tagRegRuntimeIndex", "displayFailedRegistrations", "allRuntimes", "currentRuntimeIndex", "currentRuntime", "message", "runtime", "otherRuntimeIndex", "comparison", "otherRuntime", "compareWord"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{hasRegisteredTags as a}from"./CustomElementsRegistry.js";import u from"./generated/VersionInfo.js";let s,t={include:[/^ui5-/],exclude:[]};const o=new Map,l=e=>{if(!e.match(/^[a-zA-Z0-9_-]+$/))throw new Error("Only alphanumeric characters and dashes allowed for the scoping suffix");a()&&console.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."),s=e},c=()=>s,p=e=>{if(!e||!e.include)throw new Error('"rules" must be an object with at least an "include" property');if(!Array.isArray(e.include)||e.include.some(n=>!(n instanceof RegExp)))throw new Error('"rules.include" must be an array of regular expressions');if(e.exclude&&(!Array.isArray(e.exclude)||e.exclude.some(n=>!(n instanceof RegExp))))throw new Error('"rules.exclude" must be an array of regular expressions');e.exclude=e.exclude||[],t=e,o.clear()},m=()=>t,i=e=>{if(!o.has(e)){const n=t.include.some(r=>e.match(r))&&!t.exclude.some(r=>e.match(r));o.set(e,n)}return o.get(e)},g=e=>{if(i(e))return c()},d=e=>{const n=`v${u.version.replaceAll(".","-")}`,r=/(--_?ui5)([^,:)\s]+)/g;return e.replaceAll(r,`$1-${n}$2`)};export{l as setCustomElementsScopingSuffix,c as getCustomElementsScopingSuffix,p as setCustomElementsScopingRules,m as getCustomElementsScopingRules,i as shouldScopeCustomElement,g as getEffectiveScopingSuffixForTag,d as getScopedVarName};
1
+ "use strict";import{hasRegisteredTags as a}from"./CustomElementsRegistry.js";import u from"./generated/VersionInfo.js";let s,t={include:[/^ui5-/],exclude:[]};const o=new Map,l=e=>{if(!e.match(/^[a-zA-Z0-9_-]+$/))throw new Error("Only alphanumeric characters and dashes allowed for the scoping suffix");a()&&console.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."),s=e},c=()=>s,p=e=>{if(!e||!e.include)throw new Error('"rules" must be an object with at least an "include" property');if(!Array.isArray(e.include)||e.include.some(n=>!(n instanceof RegExp)))throw new Error('"rules.include" must be an array of regular expressions');if(e.exclude&&(!Array.isArray(e.exclude)||e.exclude.some(n=>!(n instanceof RegExp))))throw new Error('"rules.exclude" must be an array of regular expressions');e.exclude=e.exclude||[],t=e,o.clear()},m=()=>t,i=e=>{if(!o.has(e)){const n=t.include.some(r=>e.match(r))&&!t.exclude.some(r=>e.match(r));o.set(e,n)}return o.get(e)},g=e=>{if(i(e))return c()},d=e=>{const n=`v${u.version.replaceAll(".","-")}`,r=/(--_?ui5)([^,:)\s]+)/g;return e.replaceAll(r,`$1-${n}$2`)};export{l as setCustomElementsScopingSuffix,c as getCustomElementsScopingSuffix,p as setCustomElementsScopingRules,m as getCustomElementsScopingRules,i as shouldScopeCustomElement,g as getEffectiveScopingSuffixForTag,d as getScopedVarName};
2
2
  //# sourceMappingURL=CustomElementsScopeUtils.js.map