@ui5/webcomponents-base 2.0.0-rc.1 → 2.0.0-rc.3

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 (59) hide show
  1. package/CHANGELOG.md +172 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/Boot.js +2 -3
  4. package/dist/Boot.js.map +1 -1
  5. package/dist/Keys.d.ts +2 -1
  6. package/dist/Keys.js +4 -1
  7. package/dist/Keys.js.map +1 -1
  8. package/dist/UI5Element.js +1 -0
  9. package/dist/UI5Element.js.map +1 -1
  10. package/dist/asset-registries/Icons.js +1 -1
  11. package/dist/asset-registries/Icons.js.map +1 -1
  12. package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +3 -3
  13. package/dist/asset-registries/util/getIconCollectionByTheme.js +3 -3
  14. package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -1
  15. package/dist/config/Theme.d.ts +3 -2
  16. package/dist/config/Theme.js +7 -3
  17. package/dist/config/Theme.js.map +1 -1
  18. package/dist/custom-elements-internal.json +180 -6
  19. package/dist/custom-elements.json +75 -0
  20. package/dist/features/OpenUI5Support.js +8 -2
  21. package/dist/features/OpenUI5Support.js.map +1 -1
  22. package/dist/features/patchPatcher.d.ts +11 -0
  23. package/dist/features/patchPatcher.js +11 -0
  24. package/dist/features/patchPatcher.js.map +1 -0
  25. package/dist/features/patchPopup.d.ts +14 -0
  26. package/dist/features/patchPopup.js +50 -0
  27. package/dist/features/patchPopup.js.map +1 -0
  28. package/dist/generated/AssetParameters.js +1 -1
  29. package/dist/generated/AssetParameters.js.map +1 -1
  30. package/dist/generated/VersionInfo.js +3 -3
  31. package/dist/generated/VersionInfo.js.map +1 -1
  32. package/dist/ssr-dom.js +0 -3
  33. package/dist/types/AriaHasPopup.d.ts +32 -0
  34. package/dist/types/AriaHasPopup.js +34 -0
  35. package/dist/types/AriaHasPopup.js.map +1 -0
  36. package/dist/types/AriaLandmarkRole.d.ts +79 -0
  37. package/dist/types/AriaLandmarkRole.js +81 -0
  38. package/dist/types/AriaLandmarkRole.js.map +1 -0
  39. package/dist/types/AriaRole.d.ts +27 -0
  40. package/dist/types/AriaRole.js +29 -0
  41. package/dist/types/AriaRole.js.map +1 -0
  42. package/dist/types/ValueState.d.ts +3 -3
  43. package/dist/types/ValueState.js +3 -3
  44. package/dist/types/ValueState.js.map +1 -1
  45. package/dist/types.d.ts +15 -2
  46. package/dist/types.js.map +1 -1
  47. package/dist/util/clamp.js +2 -1
  48. package/dist/util/clamp.js.map +1 -1
  49. package/package-scripts.cjs +3 -1
  50. package/package.json +6 -5
  51. package/tsconfig.json +2 -2
  52. package/.eslintignore +0 -17
  53. package/.eslintrc.cjs +0 -3
  54. package/bundle.esm.js +0 -65
  55. package/dist/ssr-dom.js.map +0 -1
  56. package/lib/generate-asset-parameters/index.js +0 -27
  57. package/lib/generate-styles/index.js +0 -31
  58. package/lib/generate-version-info/index.js +0 -32
  59. package/used-modules.txt +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,0BAA0B,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,MAAM,oBAAoB,GAAG,QAAQ,CAAC,CAAC,wCAAwC;AA2B/E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;AAC9C,MAAM,QAAQ,GAAG,iBAAiB,CAAwB,mBAAmB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAC1F,MAAM,sBAAsB,GAAG,iBAAiB,CAA8D,mBAAmB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAE9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AClC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,KAAK,EAAE,IAAY,EAA+B,EAAE;IACjF,IAAI,CAAC,IAAI,EAAE;QACV,OAAO;KACP;IAED,IAAI,QAAQ,GAAiD,eAAe,CAAC,IAAI,CAAC,CAAC;IAEnF,IAAI,CAAC,QAAQ,EAAE;QACd,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;KACnC;IAED,IAAI,QAAQ,IAAI,QAAQ,KAAK,cAAc,IAAI,QAAQ,CAAC,OAAO,EAAE;QAChE,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC7D,OAAO,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;KAC5C;AACF,CAAC,CAAC;AAEF,uBAAuB;AACvB,MAAM,mBAAmB,GAAG,KAAK,IAAI,EAAE;IACtC,+DAA+D;IAC/D,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/B,MAAM,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,OAAO,EACN,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACnB,CAAC","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"./util/IconCollectionsAlias.js\";\nimport { registerIconCollectionForTheme } from \"./util/IconCollectionsByTheme.js\";\nimport getEffectiveIconCollection from \"./util/getIconCollectionByTheme.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\nconst DEFAULT_THEME_FAMILY = \"legacy\"; // includes sap_belize_* and sap_fiori_*\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData | Array<CollectionData>>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tthemeFamily?: \"legacy\" | \"sap_horizon\",\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData| Array<CollectionData>>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\".\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\treturn { name, collection };\n};\n\nconst getIconDataSync = (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getIconData = async (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\n\tlet iconData: string | CollectionData | Array<CollectionData> = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(getEffectiveIconCollection(collection)))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tconst registeredIconData = getRegisteredIconData(collection, name);\n\n\tif (registeredIconData) {\n\t\treturn registeredIconData;\n\t}\n\n\t// not filled by another await. many getters will await on the same loader, but fill only once\n\tif (Array.isArray(iconData)) {\n\t\ticonData.forEach(data => {\n\t\t\t_fillRegistry(data);\n\t\t\tregisterIconCollectionForTheme(collection, { [data.themeFamily || DEFAULT_THEME_FAMILY]: data.collection });\n\t\t});\n\t} else {\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getRegisteredIconData = (collection: string, name: string) => {\n\tconst registryKey = `${getEffectiveIconCollection(collection)}/${name}`;\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"]}
1
+ {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,0BAA0B,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,MAAM,oBAAoB,GAAG,QAAQ,CAA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/IconCollectionsAlias.js\";\nimport { registerIconCollectionForTheme } from \"./util/IconCollectionsByTheme.js\";\nimport getEffectiveIconCollection from \"./util/getIconCollectionByTheme.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\nconst DEFAULT_THEME_FAMILY = \"legacy\"; // includes sap_fiori_*\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData | Array<CollectionData>>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tthemeFamily?: \"legacy\" | \"sap_horizon\",\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData| Array<CollectionData>>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\".\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\treturn { name, collection };\n};\n\nconst getIconDataSync = (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getIconData = async (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\n\tlet iconData: string | CollectionData | Array<CollectionData> = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(getEffectiveIconCollection(collection)))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tconst registeredIconData = getRegisteredIconData(collection, name);\n\n\tif (registeredIconData) {\n\t\treturn registeredIconData;\n\t}\n\n\t// not filled by another await. many getters will await on the same loader, but fill only once\n\tif (Array.isArray(iconData)) {\n\t\ticonData.forEach(data => {\n\t\t\t_fillRegistry(data);\n\t\t\tregisterIconCollectionForTheme(collection, { [data.themeFamily || DEFAULT_THEME_FAMILY]: data.collection });\n\t\t});\n\t} else {\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getRegisteredIconData = (collection: string, name: string) => {\n\tconst registryKey = `${getEffectiveIconCollection(collection)}/${name}`;\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"]}
@@ -2,9 +2,9 @@ import type { IconCollection } from "../../config/Icons.js";
2
2
  /**
3
3
  * Returns the effective theme dependant icon collection:
4
4
  *
5
- * - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon"
6
- * - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
7
- * - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
5
+ * - "no collection" resolves to "SAP-icons-v4" in "Quartz" and to "SAP-icons-v5" in "Horizon"
6
+ * - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz" and resolves to "tnt-v3" in "Horizon"
7
+ * - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz" and resolves to "business-suite-v2" in "Horizon"
8
8
  *
9
9
  * @param { IconCollection } collectionName
10
10
  * @returns { IconCollection } the effective collection name
@@ -5,9 +5,9 @@ import { getIconCollectionForTheme } from "./IconCollectionsByTheme.js";
5
5
  /**
6
6
  * Returns the effective theme dependant icon collection:
7
7
  *
8
- * - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon"
9
- * - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
10
- * - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
8
+ * - "no collection" resolves to "SAP-icons-v4" in "Quartz" and to "SAP-icons-v5" in "Horizon"
9
+ * - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz" and resolves to "tnt-v3" in "Horizon"
10
+ * - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz" and resolves to "business-suite-v2" in "Horizon"
11
11
  *
12
12
  * @param { IconCollection } collectionName
13
13
  * @returns { IconCollection } the effective collection name
@@ -1 +1 @@
1
- {"version":3,"file":"getIconCollectionByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/getIconCollectionByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,cAA+B,EAAkB,EAAE;IACtF,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEnE,uHAAuH;IACvH,IAAI,CAAC,cAAc,IAAI,qBAAqB,EAAE;QAC7C,OAAO,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;KACvD;IAED,4DAA4D;IAC5D,IAAI,CAAC,cAAc,EAAE;QACpB,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC;KAC9C;IAED,wIAAwI;IACxI,OAAO,yBAAyB,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { getTheme } from \"../../config/Theme.js\";\nimport type { IconCollection } from \"../../config/Icons.js\";\nimport { getDefaultIconCollection } from \"../../config/Icons.js\";\nimport { getIconCollectionByAlias } from \"./IconCollectionsAlias.js\";\nimport { getIconCollectionForTheme } from \"./IconCollectionsByTheme.js\";\n\n/**\n * Returns the effective theme dependant icon collection:\n *\n * - \"no collection\" resolves to \"SAP-icons-v4\" in \"Quartz\" and \"Belize\", and to \"SAP-icons-v5\" in \"Horizon\"\n * - \"tnt\" (and its alias \"SAP-icons-TNT\") resolves to \"tnt-v2\" in \"Quartz\", \"Belize\", and resolves to \"tnt-v3\" in \"Horizon\"\n * - \"business-suite\" (and its alias \"BusinessSuiteInAppSymbols\") resolves to \"business-suite-v1\" in \"Quartz\", \"Belize\", and resolves to \"business-suite-v2\" in \"Horizon\"\n *\n * @param { IconCollection } collectionName\n * @returns { IconCollection } the effective collection name\n */\nconst getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {\n\tconst defaultIconCollection = getDefaultIconCollection(getTheme());\n\n\t// no collection + default collection, configured via setDefaultIconCollection - return the configured icon collection.\n\tif (!collectionName && defaultIconCollection) {\n\t\treturn getIconCollectionByAlias(defaultIconCollection);\n\t}\n\n\t// no collection - return \"SAP-icons-v4\" or \"SAP-icons-v5\".\n\tif (!collectionName) {\n\t\treturn getIconCollectionForTheme(\"SAP-icons\");\n\t}\n\n\t// has collection - return \"SAP-icons-v4\", \"SAP-icons-v5\", \"tnt-v1\", \"tnt-v2\", \"business-suite-v1\", \"business-suite-v2\", or custom ones.\n\treturn getIconCollectionForTheme(collectionName);\n};\n\nexport default getEffectiveIconCollection;\n"]}
1
+ {"version":3,"file":"getIconCollectionByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/getIconCollectionByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,cAA+B,EAAkB,EAAE;IACtF,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEnE,uHAAuH;IACvH,IAAI,CAAC,cAAc,IAAI,qBAAqB,EAAE;QAC7C,OAAO,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;KACvD;IAED,4DAA4D;IAC5D,IAAI,CAAC,cAAc,EAAE;QACpB,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC;KAC9C;IAED,wIAAwI;IACxI,OAAO,yBAAyB,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { getTheme } from \"../../config/Theme.js\";\nimport type { IconCollection } from \"../../config/Icons.js\";\nimport { getDefaultIconCollection } from \"../../config/Icons.js\";\nimport { getIconCollectionByAlias } from \"./IconCollectionsAlias.js\";\nimport { getIconCollectionForTheme } from \"./IconCollectionsByTheme.js\";\n\n/**\n * Returns the effective theme dependant icon collection:\n *\n * - \"no collection\" resolves to \"SAP-icons-v4\" in \"Quartz\" and to \"SAP-icons-v5\" in \"Horizon\"\n * - \"tnt\" (and its alias \"SAP-icons-TNT\") resolves to \"tnt-v2\" in \"Quartz\" and resolves to \"tnt-v3\" in \"Horizon\"\n * - \"business-suite\" (and its alias \"BusinessSuiteInAppSymbols\") resolves to \"business-suite-v1\" in \"Quartz\" and resolves to \"business-suite-v2\" in \"Horizon\"\n *\n * @param { IconCollection } collectionName\n * @returns { IconCollection } the effective collection name\n */\nconst getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {\n\tconst defaultIconCollection = getDefaultIconCollection(getTheme());\n\n\t// no collection + default collection, configured via setDefaultIconCollection - return the configured icon collection.\n\tif (!collectionName && defaultIconCollection) {\n\t\treturn getIconCollectionByAlias(defaultIconCollection);\n\t}\n\n\t// no collection - return \"SAP-icons-v4\" or \"SAP-icons-v5\".\n\tif (!collectionName) {\n\t\treturn getIconCollectionForTheme(\"SAP-icons\");\n\t}\n\n\t// has collection - return \"SAP-icons-v4\", \"SAP-icons-v5\", \"tnt-v1\", \"tnt-v2\", \"business-suite-v1\", \"business-suite-v2\", or custom ones.\n\treturn getIconCollectionForTheme(collectionName);\n};\n\nexport default getEffectiveIconCollection;\n"]}
@@ -28,11 +28,12 @@ declare const getDefaultTheme: () => string;
28
28
  */
29
29
  declare const isTheme: (theme: string) => boolean;
30
30
  /**
31
- * Returns if the currently set theme is part of legacy theme families ("sap_belize" or "sap_fiori_3").
31
+ * Returns if the currently set theme is part of legacy theme families ("sap_fiori_3").
32
32
  * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.
33
33
  *
34
34
  * @private
35
35
  * @returns { boolean }
36
36
  */
37
37
  declare const isLegacyThemeFamily: () => boolean;
38
- export { getTheme, setTheme, isTheme, isLegacyThemeFamily, getDefaultTheme, };
38
+ declare const isLegacyThemeFamilyAsync: () => Promise<boolean>;
39
+ export { getTheme, setTheme, isTheme, isLegacyThemeFamily, isLegacyThemeFamilyAsync, getDefaultTheme, };
@@ -3,7 +3,7 @@ import { reRenderAllUI5Elements } from "../Render.js";
3
3
  import applyTheme from "../theming/applyTheme.js";
4
4
  import getThemeDesignerTheme from "../theming/getThemeDesignerTheme.js";
5
5
  import { DEFAULT_THEME, SUPPORTED_THEMES } from "../generated/AssetParameters.js";
6
- import { isBooted } from "../Boot.js";
6
+ import { boot, isBooted } from "../Boot.js";
7
7
  let curTheme;
8
8
  /**
9
9
  * Returns the current theme.
@@ -55,7 +55,7 @@ const isTheme = (theme) => {
55
55
  return currentTheme === theme || currentTheme === `${theme}_exp`;
56
56
  };
57
57
  /**
58
- * Returns if the currently set theme is part of legacy theme families ("sap_belize" or "sap_fiori_3").
58
+ * Returns if the currently set theme is part of legacy theme families ("sap_fiori_3").
59
59
  * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.
60
60
  *
61
61
  * @private
@@ -68,6 +68,10 @@ const isLegacyThemeFamily = () => {
68
68
  }
69
69
  return !currentTheme.startsWith("sap_horizon");
70
70
  };
71
+ const isLegacyThemeFamilyAsync = async () => {
72
+ await boot();
73
+ return isLegacyThemeFamily();
74
+ };
71
75
  const isKnownTheme = (theme) => SUPPORTED_THEMES.includes(theme);
72
- export { getTheme, setTheme, isTheme, isLegacyThemeFamily, getDefaultTheme, };
76
+ export { getTheme, setTheme, isTheme, isLegacyThemeFamily, isLegacyThemeFamilyAsync, getDefaultTheme, };
73
77
  //# sourceMappingURL=Theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sour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AAG,GAAG,EAAE;IAChC,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;IAEhC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE;QAChC,OAAO,CAAC,qBAAqB,EAAE,EAAE,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;KAC1E;IAED,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEzE,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,eAAe,GACf,CAAC","sourcesContent":["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { isBooted } from \"../Boot.js\";\n\nlet curTheme: string;\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_belize\" or \"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tgetDefaultTheme,\n};\n"]}
1
+ {"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/config/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,qBAAqB,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE5C,IAAI,QAAgB,CAAC;AAErB;;;;GAIG;AACH,MAAM,QAAQ,GAAG,GAAW,EAAE;IAC7B,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC3B,QAAQ,GAAG,kBAAkB,EAAE,CAAC;KAChC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AA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ACnB,wBAAwB,EACxB,eAAe,GACf,CAAC","sourcesContent":["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\n\nlet curTheme: string;\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n};\n"]}
@@ -479,6 +479,36 @@
479
479
  }
480
480
  ]
481
481
  },
482
+ {
483
+ "kind": "javascript-module",
484
+ "path": "dist/features/patchPatcher.js",
485
+ "declarations": [],
486
+ "exports": [
487
+ {
488
+ "kind": "js",
489
+ "name": "default",
490
+ "declaration": {
491
+ "name": "patchPatcher",
492
+ "module": "dist/features/patchPatcher.js"
493
+ }
494
+ }
495
+ ]
496
+ },
497
+ {
498
+ "kind": "javascript-module",
499
+ "path": "dist/features/patchPopup.js",
500
+ "declarations": [],
501
+ "exports": [
502
+ {
503
+ "kind": "js",
504
+ "name": "default",
505
+ "declaration": {
506
+ "name": "patchPopup",
507
+ "module": "dist/features/patchPopup.js"
508
+ }
509
+ }
510
+ ]
511
+ },
482
512
  {
483
513
  "kind": "javascript-module",
484
514
  "path": "dist/locale/Locale.js",
@@ -811,6 +841,150 @@
811
841
  }
812
842
  ]
813
843
  },
844
+ {
845
+ "kind": "javascript-module",
846
+ "path": "dist/types/AriaHasPopup.js",
847
+ "declarations": [
848
+ {
849
+ "kind": "enum",
850
+ "name": "AriaHasPopup",
851
+ "description": "Different types of ARIA hasPopup.",
852
+ "_ui5privacy": "public",
853
+ "members": [
854
+ {
855
+ "kind": "field",
856
+ "static": true,
857
+ "privacy": "public",
858
+ "description": "Dialog popup type.",
859
+ "default": "Dialog",
860
+ "name": "Dialog",
861
+ "readonly": true
862
+ },
863
+ {
864
+ "kind": "field",
865
+ "static": true,
866
+ "privacy": "public",
867
+ "description": "Grid popup type.",
868
+ "default": "Grid",
869
+ "name": "Grid",
870
+ "readonly": true
871
+ },
872
+ {
873
+ "kind": "field",
874
+ "static": true,
875
+ "privacy": "public",
876
+ "description": "ListBox popup type.",
877
+ "default": "ListBox",
878
+ "name": "ListBox",
879
+ "readonly": true
880
+ },
881
+ {
882
+ "kind": "field",
883
+ "static": true,
884
+ "privacy": "public",
885
+ "description": "Menu popup type.",
886
+ "default": "Menu",
887
+ "name": "Menu",
888
+ "readonly": true
889
+ },
890
+ {
891
+ "kind": "field",
892
+ "static": true,
893
+ "privacy": "public",
894
+ "description": "Tree popup type.",
895
+ "default": "Tree",
896
+ "name": "Tree",
897
+ "readonly": true
898
+ }
899
+ ]
900
+ }
901
+ ],
902
+ "exports": [
903
+ {
904
+ "kind": "js",
905
+ "name": "default",
906
+ "declaration": {
907
+ "name": "AriaHasPopup",
908
+ "module": "dist/types/AriaHasPopup.js"
909
+ }
910
+ }
911
+ ]
912
+ },
913
+ {
914
+ "kind": "javascript-module",
915
+ "path": "dist/types/AriaLandmarkRole.js",
916
+ "declarations": [],
917
+ "exports": [
918
+ {
919
+ "kind": "js",
920
+ "name": "default",
921
+ "declaration": {
922
+ "name": "AriaLandmarkRole",
923
+ "module": "dist/types/AriaLandmarkRole.js"
924
+ }
925
+ }
926
+ ]
927
+ },
928
+ {
929
+ "kind": "javascript-module",
930
+ "path": "dist/types/AriaRole.js",
931
+ "declarations": [
932
+ {
933
+ "kind": "enum",
934
+ "name": "AriaRole",
935
+ "description": "Types of ARIA roles.",
936
+ "_ui5privacy": "public",
937
+ "members": [
938
+ {
939
+ "kind": "field",
940
+ "static": true,
941
+ "privacy": "public",
942
+ "description": "The ARIA role \"alertdialog\".",
943
+ "default": "AlertDialog",
944
+ "name": "AlertDialog",
945
+ "readonly": true
946
+ },
947
+ {
948
+ "kind": "field",
949
+ "static": true,
950
+ "privacy": "public",
951
+ "description": "The ARIA role \"button\".",
952
+ "default": "Button",
953
+ "name": "Button",
954
+ "readonly": true
955
+ },
956
+ {
957
+ "kind": "field",
958
+ "static": true,
959
+ "privacy": "public",
960
+ "description": "The ARIA role \"dialog\".",
961
+ "default": "Dialog",
962
+ "name": "Dialog",
963
+ "readonly": true
964
+ },
965
+ {
966
+ "kind": "field",
967
+ "static": true,
968
+ "privacy": "public",
969
+ "description": "The ARIA role \"link\".",
970
+ "default": "Link",
971
+ "name": "Link",
972
+ "readonly": true
973
+ }
974
+ ]
975
+ }
976
+ ],
977
+ "exports": [
978
+ {
979
+ "kind": "js",
980
+ "name": "default",
981
+ "declaration": {
982
+ "name": "AriaRole",
983
+ "module": "dist/types/AriaRole.js"
984
+ }
985
+ }
986
+ ]
987
+ },
814
988
  {
815
989
  "kind": "javascript-module",
816
990
  "path": "dist/types/CSSColor.js",
@@ -1329,24 +1503,24 @@
1329
1503
  "kind": "field",
1330
1504
  "static": true,
1331
1505
  "privacy": "public",
1332
- "default": "Success",
1333
- "name": "Success",
1506
+ "default": "Positive",
1507
+ "name": "Positive",
1334
1508
  "readonly": true
1335
1509
  },
1336
1510
  {
1337
1511
  "kind": "field",
1338
1512
  "static": true,
1339
1513
  "privacy": "public",
1340
- "default": "Warning",
1341
- "name": "Warning",
1514
+ "default": "Critical",
1515
+ "name": "Critical",
1342
1516
  "readonly": true
1343
1517
  },
1344
1518
  {
1345
1519
  "kind": "field",
1346
1520
  "static": true,
1347
1521
  "privacy": "public",
1348
- "default": "Error",
1349
- "name": "Error",
1522
+ "default": "Negative",
1523
+ "name": "Negative",
1350
1524
  "readonly": true
1351
1525
  },
1352
1526
  {
@@ -471,6 +471,36 @@
471
471
  }
472
472
  ]
473
473
  },
474
+ {
475
+ "kind": "javascript-module",
476
+ "path": "dist/features/patchPatcher.js",
477
+ "declarations": [],
478
+ "exports": [
479
+ {
480
+ "kind": "js",
481
+ "name": "default",
482
+ "declaration": {
483
+ "name": "patchPatcher",
484
+ "module": "dist/features/patchPatcher.js"
485
+ }
486
+ }
487
+ ]
488
+ },
489
+ {
490
+ "kind": "javascript-module",
491
+ "path": "dist/features/patchPopup.js",
492
+ "declarations": [],
493
+ "exports": [
494
+ {
495
+ "kind": "js",
496
+ "name": "default",
497
+ "declaration": {
498
+ "name": "patchPopup",
499
+ "module": "dist/features/patchPopup.js"
500
+ }
501
+ }
502
+ ]
503
+ },
474
504
  {
475
505
  "kind": "javascript-module",
476
506
  "path": "dist/locale/Locale.js",
@@ -762,6 +792,51 @@
762
792
  }
763
793
  ]
764
794
  },
795
+ {
796
+ "kind": "javascript-module",
797
+ "path": "dist/types/AriaHasPopup.js",
798
+ "declarations": [],
799
+ "exports": [
800
+ {
801
+ "kind": "js",
802
+ "name": "default",
803
+ "declaration": {
804
+ "name": "AriaHasPopup",
805
+ "module": "dist/types/AriaHasPopup.js"
806
+ }
807
+ }
808
+ ]
809
+ },
810
+ {
811
+ "kind": "javascript-module",
812
+ "path": "dist/types/AriaLandmarkRole.js",
813
+ "declarations": [],
814
+ "exports": [
815
+ {
816
+ "kind": "js",
817
+ "name": "default",
818
+ "declaration": {
819
+ "name": "AriaLandmarkRole",
820
+ "module": "dist/types/AriaLandmarkRole.js"
821
+ }
822
+ }
823
+ ]
824
+ },
825
+ {
826
+ "kind": "javascript-module",
827
+ "path": "dist/types/AriaRole.js",
828
+ "declarations": [],
829
+ "exports": [
830
+ {
831
+ "kind": "js",
832
+ "name": "default",
833
+ "declaration": {
834
+ "name": "AriaRole",
835
+ "module": "dist/types/AriaRole.js"
836
+ }
837
+ }
838
+ ]
839
+ },
765
840
  {
766
841
  "kind": "javascript-module",
767
842
  "path": "dist/types/CSSColor.js",
@@ -1,3 +1,5 @@
1
+ import patchPatcher from "./patchPatcher.js";
2
+ import patchPopup from "./patchPopup.js";
1
3
  import { registerFeature } from "../FeaturesRegistry.js";
2
4
  import { setTheme } from "../config/Theme.js";
3
5
  class OpenUI5Support {
@@ -19,7 +21,7 @@ class OpenUI5Support {
19
21
  return new Promise(resolve => {
20
22
  window.sap.ui.require(["sap/ui/core/Core"], async (Core) => {
21
23
  const callback = () => {
22
- let deps = ["sap/ui/core/LocaleData"];
24
+ let deps = ["sap/ui/core/Popup", "sap/ui/core/Patcher", "sap/ui/core/LocaleData"];
23
25
  if (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core
24
26
  deps = [
25
27
  ...deps,
@@ -30,7 +32,11 @@ class OpenUI5Support {
30
32
  "sap/ui/core/date/CalendarUtils",
31
33
  ];
32
34
  }
33
- window.sap.ui.require(deps, resolve);
35
+ window.sap.ui.require(deps, (Popup, Patcher) => {
36
+ patchPatcher(Patcher);
37
+ patchPopup(Popup);
38
+ resolve();
39
+ });
34
40
  };
35
41
  if (OpenUI5Support.isAtLeastVersion116()) {
36
42
  await Core.ready();
@@ -1 +1 @@
1
- {"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA+D9C,MAAM,cAAc;IACnB,MAAM,CAAC,mBAAmB;QACzB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAiB,CAAC;QACjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,OAAO,KAAK,CAAC;SACb;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,iBAAiB;QACvB,OAAO,OAAO,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,KAAK,UAAU,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,IAAI;QACV,IAAI,CAAC,cAAc,CAAC,iBAAiB,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AC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;SACH;aAAM;YACN,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAgB,CAAC;YACtE,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACvC,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE;gBAC5B,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;SACH;IACF,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO;SACP;QAED,cAAc,CAAC,qBAAqB,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACxB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE;YACxC,OAAO;SACP;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,0BAA0B,CAAoB,CAAC,CAAC,yCAAyC;QACvJ,IAAI,CAAC,IAAI,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACtD,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn new Promise<void>(resolve => {\n\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\tconst callback = () => {\n\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/LocaleData\"];\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\twindow.sap.ui.require(deps, resolve);\n\t\t\t\t};\n\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\tawait Core.ready();\n\t\t\t\t\tcallback();\n\t\t\t\t} else {\n\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/);\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
1
+ {"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA+D9C,MAAM,cAAc;IACnB,MAAM,CAAC,mBAAmB;QACzB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAiB,CAAC;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,EAAE,EAAE;YACxC,OAAO;SACP;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,0BAA0B,CAAoB,CAAC,CAAC,yCAAyC;QACvJ,IAAI,CAAC,IAAI,EAAE;YACV,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IACtD,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport patchPopup from \"./patchPopup.js\";\nimport type { OpenUI5Popup } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\treturn new Promise<void>(resolve => {\n\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\tconst callback = () => {\n\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\tpatchPopup(Popup);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\tawait Core.ready();\n\t\t\t\t\tcallback();\n\t\t\t\t} else {\n\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/);\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
@@ -0,0 +1,11 @@
1
+ type OpenUI5Patcher = {
2
+ prototype: {
3
+ _mAttributes: {
4
+ [key: string]: string;
5
+ };
6
+ openEnd: () => OpenUI5Patcher;
7
+ };
8
+ };
9
+ declare const patchPatcher: (Patcher: OpenUI5Patcher) => void;
10
+ export default patchPatcher;
11
+ export type { OpenUI5Patcher };
@@ -0,0 +1,11 @@
1
+ const patchPatcher = (Patcher) => {
2
+ const origOpenEnd = Patcher.prototype.openEnd;
3
+ Patcher.prototype.openEnd = function openEnd() {
4
+ if (this._mAttributes.popover) {
5
+ delete this._mAttributes.popover; // The "popover" attribute will be managed externally, don't let Patcher remove it
6
+ }
7
+ return origOpenEnd.apply(this);
8
+ };
9
+ };
10
+ export default patchPatcher;
11
+ //# sourceMappingURL=patchPatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patchPatcher.js","sourceRoot":"","sources":["../../src/features/patchPatcher.ts"],"names":[],"mappings":"AAOA,MAAM,YAAY,GAAG,CAAC,OAAuB,EAAE,EAAE;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAC9C,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,OAAO;QAC3C,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;YAC9B,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,kFAAkF;SACpH;QACD,OAAO,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["type OpenUI5Patcher = {\n\tprototype: {\n\t\t_mAttributes: { [key: string]: string },\n\t\topenEnd: () => OpenUI5Patcher,\n\t}\n};\n\nconst patchPatcher = (Patcher: OpenUI5Patcher) => {\n\tconst origOpenEnd = Patcher.prototype.openEnd;\n\tPatcher.prototype.openEnd = function openEnd() {\n\t\tif (this._mAttributes.popover) {\n\t\t\tdelete this._mAttributes.popover; // The \"popover\" attribute will be managed externally, don't let Patcher remove it\n\t\t}\n\t\treturn origOpenEnd.apply(this);\n\t};\n};\n\nexport default patchPatcher;\nexport type { OpenUI5Patcher };\n"]}
@@ -0,0 +1,14 @@
1
+ type Element = {
2
+ getDomRef: () => HTMLElement | null;
3
+ };
4
+ type OpenUI5Popup = {
5
+ prototype: {
6
+ open: (...args: any[]) => void;
7
+ _closed: (...args: any[]) => void;
8
+ getOpenState: () => "CLOSED" | "CLOSING" | "OPEN" | "OPENING";
9
+ getContent: () => Element;
10
+ };
11
+ };
12
+ declare const patchPopup: (Popup: OpenUI5Popup) => void;
13
+ export default patchPopup;
14
+ export type { OpenUI5Popup };