@ui5/webcomponents-base 2.0.0-rc.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +1 -4
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/Boot.js.map +1 -1
  5. package/dist/CustomElementsRegistry.js.map +1 -1
  6. package/dist/InitialConfiguration.d.ts +1 -1
  7. package/dist/InitialConfiguration.js.map +1 -1
  8. package/dist/ManagedStyles.d.ts +1 -1
  9. package/dist/ManagedStyles.js.map +1 -1
  10. package/dist/Render.js.map +1 -1
  11. package/dist/UI5Element.d.ts +11 -9
  12. package/dist/UI5Element.js +115 -109
  13. package/dist/UI5Element.js.map +1 -1
  14. package/dist/UI5ElementMetadata.d.ts +6 -15
  15. package/dist/UI5ElementMetadata.js +3 -71
  16. package/dist/UI5ElementMetadata.js.map +1 -1
  17. package/dist/asset-registries/Icons.d.ts +1 -1
  18. package/dist/asset-registries/Icons.js.map +1 -1
  19. package/dist/connectToComponent.js.map +1 -1
  20. package/dist/converters/DOMReference.d.ts +5 -0
  21. package/dist/converters/DOMReference.js +13 -0
  22. package/dist/converters/DOMReference.js.map +1 -0
  23. package/dist/custom-elements-internal.json +15 -275
  24. package/dist/custom-elements.json +15 -269
  25. package/dist/decorators/property.d.ts +1 -1
  26. package/dist/decorators/property.js +1 -1
  27. package/dist/decorators/property.js.map +1 -1
  28. package/dist/decorators/slot.d.ts +1 -1
  29. package/dist/decorators/slot.js.map +1 -1
  30. package/dist/delegate/ItemNavigation.d.ts +1 -1
  31. package/dist/delegate/ItemNavigation.js.map +1 -1
  32. package/dist/features/F6Navigation.js +1 -1
  33. package/dist/features/F6Navigation.js.map +1 -1
  34. package/dist/features/InputElementsFormSupport.d.ts +1 -1
  35. package/dist/features/InputElementsFormSupport.js.map +1 -1
  36. package/dist/features/OpenUI5Enablement.d.ts +1 -1
  37. package/dist/features/OpenUI5Enablement.js.map +1 -1
  38. package/dist/features/OpenUI5Support.d.ts +1 -1
  39. package/dist/features/OpenUI5Support.js +3 -0
  40. package/dist/features/OpenUI5Support.js.map +1 -1
  41. package/dist/features/patchPopup.d.ts +1 -0
  42. package/dist/features/patchPopup.js +11 -0
  43. package/dist/features/patchPopup.js.map +1 -1
  44. package/dist/generated/VersionInfo.js +3 -3
  45. package/dist/generated/VersionInfo.js.map +1 -1
  46. package/dist/prod/Boot.js +1 -1
  47. package/dist/prod/Boot.js.map +1 -1
  48. package/dist/prod/CustomElementsRegistry.js +2 -2
  49. package/dist/prod/CustomElementsRegistry.js.map +1 -1
  50. package/dist/prod/InitialConfiguration.js.map +1 -1
  51. package/dist/prod/ManagedStyles.js +1 -1
  52. package/dist/prod/ManagedStyles.js.map +1 -1
  53. package/dist/prod/Render.js +1 -1
  54. package/dist/prod/Render.js.map +1 -1
  55. package/dist/prod/UI5Element.js +1 -1
  56. package/dist/prod/UI5Element.js.map +3 -3
  57. package/dist/prod/UI5ElementMetadata.js +1 -1
  58. package/dist/prod/UI5ElementMetadata.js.map +3 -3
  59. package/dist/prod/asset-registries/Icons.js +1 -1
  60. package/dist/prod/asset-registries/Icons.js.map +2 -2
  61. package/dist/prod/connectToComponent.js +1 -1
  62. package/dist/prod/connectToComponent.js.map +1 -1
  63. package/dist/prod/converters/DOMReference.js +2 -0
  64. package/dist/prod/converters/DOMReference.js.map +7 -0
  65. package/dist/prod/decorators/property.js +1 -1
  66. package/dist/prod/decorators/property.js.map +2 -2
  67. package/dist/prod/decorators/slot.js +1 -1
  68. package/dist/prod/decorators/slot.js.map +1 -1
  69. package/dist/prod/delegate/ItemNavigation.js.map +1 -1
  70. package/dist/prod/features/F6Navigation.js +1 -1
  71. package/dist/prod/features/F6Navigation.js.map +2 -2
  72. package/dist/prod/features/InputElementsFormSupport.js.map +1 -1
  73. package/dist/prod/features/OpenUI5Enablement.js.map +1 -1
  74. package/dist/prod/features/OpenUI5Support.js +1 -1
  75. package/dist/prod/features/OpenUI5Support.js.map +2 -2
  76. package/dist/prod/features/patchPopup.js +1 -1
  77. package/dist/prod/features/patchPopup.js.map +3 -3
  78. package/dist/prod/generated/VersionInfo.js +1 -1
  79. package/dist/prod/generated/VersionInfo.js.map +2 -2
  80. package/dist/prod/renderer/LitRenderer.js +1 -1
  81. package/dist/prod/renderer/LitRenderer.js.map +2 -2
  82. package/dist/prod/theming/getConstructableStyle.js +1 -1
  83. package/dist/prod/theming/getConstructableStyle.js.map +1 -1
  84. package/dist/prod/theming/getEffectiveStyle.js +1 -1
  85. package/dist/prod/theming/getEffectiveStyle.js.map +1 -1
  86. package/dist/prod/util/AriaLabelHelper.js +1 -1
  87. package/dist/prod/util/AriaLabelHelper.js.map +2 -2
  88. package/dist/prod/util/TabbableElements.js +1 -1
  89. package/dist/prod/util/TabbableElements.js.map +3 -3
  90. package/dist/prod/util/debounce.js +1 -1
  91. package/dist/prod/util/debounce.js.map +1 -1
  92. package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
  93. package/dist/prod/util/dragAndDrop/DragRegistry.js.map +2 -2
  94. package/dist/prod/util/isElementTabbable.js +1 -1
  95. package/dist/prod/util/isElementTabbable.js.map +3 -3
  96. package/dist/renderer/LitRenderer.d.ts +1 -1
  97. package/dist/renderer/LitRenderer.js.map +1 -1
  98. package/dist/theming/getConstructableStyle.d.ts +1 -1
  99. package/dist/theming/getConstructableStyle.js.map +1 -1
  100. package/dist/theming/getEffectiveStyle.js.map +1 -1
  101. package/dist/util/AriaLabelHelper.d.ts +1 -1
  102. package/dist/util/AriaLabelHelper.js.map +1 -1
  103. package/dist/util/TabbableElements.js +3 -10
  104. package/dist/util/TabbableElements.js.map +1 -1
  105. package/dist/util/debounce.js.map +1 -1
  106. package/dist/util/dragAndDrop/DragRegistry.js +0 -2
  107. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
  108. package/dist/util/getClassCopy.d.ts +5 -2
  109. package/dist/util/isElementTabbable.js +2 -2
  110. package/dist/util/isElementTabbable.js.map +1 -1
  111. package/package.json +3 -3
  112. package/dist/prod/types/CSSColor.js +0 -2
  113. package/dist/prod/types/CSSColor.js.map +0 -7
  114. package/dist/prod/types/CSSSize.js +0 -2
  115. package/dist/prod/types/CSSSize.js.map +0 -7
  116. package/dist/prod/types/DOMReference.js +0 -2
  117. package/dist/prod/types/DOMReference.js.map +0 -7
  118. package/dist/prod/types/DataType.js +0 -2
  119. package/dist/prod/types/DataType.js.map +0 -7
  120. package/dist/prod/types/Float.js +0 -2
  121. package/dist/prod/types/Float.js.map +0 -7
  122. package/dist/prod/types/Integer.js +0 -2
  123. package/dist/prod/types/Integer.js.map +0 -7
  124. package/dist/types/CSSColor.d.ts +0 -11
  125. package/dist/types/CSSColor.js +0 -14
  126. package/dist/types/CSSColor.js.map +0 -1
  127. package/dist/types/CSSSize.d.ts +0 -11
  128. package/dist/types/CSSSize.js +0 -14
  129. package/dist/types/CSSSize.js.map +0 -1
  130. package/dist/types/DOMReference.d.ts +0 -13
  131. package/dist/types/DOMReference.js +0 -21
  132. package/dist/types/DOMReference.js.map +0 -1
  133. package/dist/types/DataType.d.ts +0 -20
  134. package/dist/types/DataType.js +0 -39
  135. package/dist/types/DataType.js.map +0 -1
  136. package/dist/types/Float.d.ts +0 -14
  137. package/dist/types/Float.js +0 -18
  138. package/dist/types/Float.js.map +0 -1
  139. package/dist/types/Integer.d.ts +0 -14
  140. package/dist/types/Integer.js +0 -18
  141. package/dist/types/Integer.js.map +0 -1
@@ -4,6 +4,9 @@ import { registerFeature } from "../FeaturesRegistry.js";
4
4
  import { setTheme } from "../config/Theme.js";
5
5
  class OpenUI5Support {
6
6
  static isAtLeastVersion116() {
7
+ if (!window.sap.ui.version) {
8
+ return true; // sap.ui.version will be removed in newer OpenUI5 versions
9
+ }
7
10
  const version = window.sap.ui.version;
8
11
  const parts = version.split(".");
9
12
  if (!parts || parts.length < 2) {
@@ -1 +1 @@
1
- {"version":3,"file":"OpenUI5Support.js","sourceRoot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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 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"]}
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;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AAe;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 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 type { 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\tif (!window.sap.ui!.version) {\n\t\t\treturn true; // sap.ui.version will be removed in newer OpenUI5 versions\n\t\t}\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"]}
@@ -7,6 +7,7 @@ type OpenUI5Popup = {
7
7
  _closed: (...args: any[]) => void;
8
8
  getOpenState: () => "CLOSED" | "CLOSING" | "OPEN" | "OPENING";
9
9
  getContent: () => Element;
10
+ onFocusEvent: (e: FocusEvent) => void;
10
11
  };
11
12
  };
12
13
  declare const patchPopup: (Popup: OpenUI5Popup) => void;
@@ -36,6 +36,16 @@ const patchClosed = (Popup) => {
36
36
  }
37
37
  };
38
38
  };
39
+ const patchFocusEvent = (Popup) => {
40
+ const origFocusEvent = Popup.prototype.onFocusEvent;
41
+ Popup.prototype.onFocusEvent = function onFocusEvent(e) {
42
+ const isTypeFocus = e.type === "focus" || e.type === "activate";
43
+ const target = e.target;
44
+ if (!isTypeFocus || !target.closest("[ui5-popover],[ui5-responsive-popover],[ui5-dialog]")) {
45
+ origFocusEvent.call(this, e);
46
+ }
47
+ };
48
+ };
39
49
  const createGlobalStyles = () => {
40
50
  const stylesheet = new CSSStyleSheet();
41
51
  stylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);
@@ -45,6 +55,7 @@ const patchPopup = (Popup) => {
45
55
  patchOpen(Popup); // Popup.prototype.open
46
56
  patchClosed(Popup); // Popup.prototype._closed
47
57
  createGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)
58
+ patchFocusEvent(Popup); // Popup.prototype.onFocusEvent
48
59
  };
49
60
  export default patchPopup;
50
61
  //# sourceMappingURL=patchPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAeA,MAAM,iBAAiB,GAAG,CAAC,MAAmB,EAAE,EAAE;IACjD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,WAAW,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,MAAmB,EAAE,EAAE;IAClD,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;QACnC,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;KAClC;AACF,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAmB,EAAE,EAAE;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;IACtC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,IAAI,CAAC,GAAG,IAAW;QAClD,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,C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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;AACpH,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["// OpenUI5's Element.js subset\ntype Element = {\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: () => Element, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t}\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 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 = !!document.body.querySelector(\":popover-open\"); // check if there is already something in the top layer\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.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\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.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\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};\n\nexport default patchPopup;\nexport type { OpenUI5Popup };\n"]}
1
+ {"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAgBA,MAAM,iBAAiB,GAAG,CAAC,MAAmB,EAAE,EAAE;IACjD,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,WAAW,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,MAAmB,EAAE,EAAE;IAClD,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;QACnC,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;KAClC;AACF,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAmB,EAAE,EAAE;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;IACtC,KAAK,CAAC,SAAS,CAA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KAAK,CAAC,SAAS,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,CAAa;QACjE,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;QAChE,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAC;QACvC,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,qDAAqD,CAAC,EAAE;YAC3F,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SAC7B;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,eAAe,UAAU,CAAC","sourcesContent":["// OpenUI5's Element.js subset\ntype Element = {\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: () => Element, // 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\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 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 = !!document.body.querySelector(\":popover-open\"); // check if there is already something in the top layer\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.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\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.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\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(e: FocusEvent) {\n\t\tconst isTypeFocus = e.type === \"focus\" || e.type === \"activate\";\n\t\tconst target = e.target as HTMLElement;\n\t\tif (!isTypeFocus || !target.closest(\"[ui5-popover],[ui5-responsive-popover],[ui5-dialog]\")) {\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 default patchPopup;\nexport type { OpenUI5Popup };\n"]}
@@ -1,11 +1,11 @@
1
1
  const VersionInfo = {
2
- version: "2.0.0-rc.5",
2
+ version: "2.0.0",
3
3
  major: 2,
4
4
  minor: 0,
5
5
  patch: 0,
6
- suffix: "-rc.5",
6
+ suffix: "",
7
7
  isNext: false,
8
- buildTime: 1717680065,
8
+ buildTime: 1720013643,
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,YAAY;IACrB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,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.0.0-rc.5\",\n\tmajor: 2,\n\tminor: 0,\n\tpatch: 0,\n\tsuffix: \"-rc.5\",\n\tisNext: false,\n\tbuildTime: 1717680065,\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,OAAO;IAChB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,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.0.0\",\n\tmajor: 2,\n\tminor: 0,\n\tpatch: 0,\n\tsuffix: \"\",\n\tisNext: false,\n\tbuildTime: 1720013643,\n};\nexport default VersionInfo;"]}
package/dist/prod/Boot.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";import d from"./util/whenDOMReady.js";import c from"./EventProvider.js";import u from"./FontFace.js";import v from"./SystemCSSVars.js";import{getTheme as i}from"./config/Theme.js";import a from"./theming/applyTheme.js";import{registerCurrentRuntime as g}from"./Runtimes.js";import{getFeature as m}from"./FeaturesRegistry.js";import{attachThemeRegistered as y}from"./theming/ThemeRegistered.js";let o=!1,r;const p=new c,h=()=>o,P=e=>{if(!o){p.attachEvent("boot",e);return}e()},l=async()=>{if(r!==void 0)return r;const e=async n=>{if(g(),typeof document>"u"){n();return}y(S);const t=m("OpenUI5Support"),f=t?t.isOpenUI5Detected():!1,s=m("F6Navigation");t&&await t.init(),s&&!f&&s.init(),await d(),await a(i()),t&&t.attachListeners(),u(),v(),n(),o=!0,await p.fireEventAsync("boot")};return r=new Promise(e),r},S=e=>{o&&e===i()&&a(i())};export{l as boot,P as attachBoot,h as isBooted};
1
+ "use strict";import d from"./util/whenDOMReady.js";import c from"./EventProvider.js";import u from"./FontFace.js";import v from"./SystemCSSVars.js";import{getTheme as i}from"./config/Theme.js";import a from"./theming/applyTheme.js";import{registerCurrentRuntime as y}from"./Runtimes.js";import{getFeature as p}from"./FeaturesRegistry.js";import{attachThemeRegistered as g}from"./theming/ThemeRegistered.js";let o=!1,r;const m=new c,h=()=>o,P=e=>{if(!o){m.attachEvent("boot",e);return}e()},l=async()=>{if(r!==void 0)return r;const e=async n=>{if(y(),typeof document>"u"){n();return}g(S);const t=p("OpenUI5Support"),f=t?t.isOpenUI5Detected():!1,s=p("F6Navigation");t&&await t.init(),s&&!f&&s.init(),await d(),await a(i()),t&&t.attachListeners(),u(),v(),n(),o=!0,await m.fireEventAsync("boot")};return r=new Promise(e),r},S=e=>{o&&e===i()&&a(i())};export{l as boot,P as attachBoot,h as isBooted};
2
2
  //# sourceMappingURL=Boot.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Boot.ts"],
4
- "sourcesContent": ["import whenDOMReady from \"./util/whenDOMReady.js\";\nimport EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\tawait eventProvider.fireEventAsync(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachBoot,\n\tisBooted,\n};\n"],
4
+ "sourcesContent": ["import whenDOMReady from \"./util/whenDOMReady.js\";\nimport EventProvider from \"./EventProvider.js\";\nimport insertFontFace from \"./FontFace.js\";\nimport insertSystemCSSVars from \"./SystemCSSVars.js\";\nimport { getTheme } from \"./config/Theme.js\";\nimport applyTheme from \"./theming/applyTheme.js\";\nimport { registerCurrentRuntime } from \"./Runtimes.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type F6Navigation from \"./features/F6Navigation.js\";\nimport type { PromiseResolve } from \"./types.js\";\nimport { attachThemeRegistered } from \"./theming/ThemeRegistered.js\";\n\nlet booted = false;\nlet bootPromise: Promise<void>;\nconst eventProvider = new EventProvider<void, void>();\n\nconst isBooted = (): boolean => {\n\treturn booted;\n};\n\n/**\n * Attaches a callback that will be executed after boot finishes.\n * **Note:** If the framework already booted, the callback will be immediately executed.\n * @public\n * @param { Function } listener\n */\nconst attachBoot = (listener: () => void) => {\n\tif (!booted) {\n\t\teventProvider.attachEvent(\"boot\", listener);\n\t\treturn;\n\t}\n\n\tlistener();\n};\n\nconst boot = async (): Promise<void> => {\n\tif (bootPromise !== undefined) {\n\t\treturn bootPromise;\n\t}\n\n\tconst bootExecutor = async (resolve: PromiseResolve) => {\n\t\tregisterCurrentRuntime();\n\n\t\tif (typeof document === \"undefined\") {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tattachThemeRegistered(onThemeRegistered);\n\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Loaded = openUI5Support ? openUI5Support.isOpenUI5Detected() : false;\n\t\tconst f6Navigation = getFeature<typeof F6Navigation>(\"F6Navigation\");\n\n\t\tif (openUI5Support) {\n\t\t\tawait openUI5Support.init();\n\t\t}\n\n\t\tif (f6Navigation && !isOpenUI5Loaded) {\n\t\t\tf6Navigation.init();\n\t\t}\n\n\t\tawait whenDOMReady();\n\t\tawait applyTheme(getTheme());\n\t\topenUI5Support && openUI5Support.attachListeners();\n\t\tinsertFontFace();\n\t\tinsertSystemCSSVars();\n\n\t\tresolve();\n\n\t\tbooted = true;\n\t\tawait eventProvider.fireEventAsync(\"boot\");\n\t};\n\n\tbootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);\n\treturn bootPromise;\n};\n\n/**\n * Callback, executed after theme properties registration\n * to apply the newly registered theme.\n * @private\n * @param { string } theme\n */\nconst onThemeRegistered = (theme: string) => {\n\tif (booted && theme === getTheme()) { // getTheme should only be called if \"booted\" is true\n\t\tapplyTheme(getTheme());\n\t}\n};\n\nexport {\n\tboot,\n\tattachB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"applyTheme", "registerCurrentRuntime", "getFeature", "attachThemeRegistered", "booted", "bootPromise", "eventProvider", "isBooted", "attachBoot", "listener", "boot", "bootExecutor", "resolve", "onThemeRegistered", "openUI5Support", "isOpenUI5Loaded", "f6Navigation", "theme"]
7
7
  }
@@ -1,4 +1,4 @@
1
- "use strict";import p from"./getSharedResource.js";import{getCurrentRuntimeIndex as u,compareRuntimes as f,getAllRuntimes as b}from"./Runtimes.js";const m=p("Tags",new Map),d=new Set;let s=new Map,c;const g=-1,h=e=>{d.add(e),m.set(e,u())},w=e=>d.has(e),$=()=>[...d.values()],R=e=>{let n=m.get(e);n===void 0&&(n=g),s.has(n)||s.set(n,new Set),s.get(n).add(e),c||(c=setTimeout(()=>{T(),s=new Map,c=void 0},1e3))},T=()=>{const e=b(),n=u(),l=e[n];let t="Multiple UI5 Web Components instances detected.";e.length>1&&(t=`${t}
1
+ "use strict";import p from"./getSharedResource.js";import{getCurrentRuntimeIndex as u,compareRuntimes as f,getAllRuntimes as b}from"./Runtimes.js";const m=p("Tags",new Map),d=new Set;let s=new Map,c;const g=-1,h=e=>{d.add(e),m.set(e,u())},w=e=>d.has(e),$=()=>[...d.values()],y=e=>{let n=m.get(e);n===void 0&&(n=g),s.has(n)||s.set(n,new Set),s.get(n).add(e),c||(c=setTimeout(()=>{R(),s=new Map,c=void 0},1e3))},R=()=>{const e=b(),n=u(),l=e[n];let t="Multiple UI5 Web Components instances detected.";e.length>1&&(t=`${t}
2
2
  Loading order (versions before 1.1.0 not listed): ${e.map(i=>`
3
3
  ${i.description}`).join("")}`),[...s.keys()].forEach(i=>{let o,r;i===g?(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}
4
4
 
@@ -6,5 +6,5 @@ ${i.description}`).join("")}`),[...s.keys()].forEach(i=>{let o,r;i===g?(o=1,r={d
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/03-scoping.md.`,console.warn(t)};export{h as registerTag,w as isTagRegistered,$ as getAllRegisteredTags,R 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/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`,console.warn(t)};export{h as registerTag,w as isTagRegistered,$ as getAllRegisteredTags,y 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 { 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 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/03-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"],
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 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/03-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nex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e,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,sBAAsBZ,EAAS,IAAIe,CAAiB,EAAG,IAAI,gDAAgDG,CAAW,aAAaD,EAAa,WAAW,MAAO,CAAC,GAAGjB,EAAS,IAAIe,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,OACCV,KAAA,YACAE,KAAA,gBACAC,KAAA,qBACAC,KAAA",
6
6
  "names": ["getSharedResource", "getCurrentRuntimeIndex", "compareRuntimes", "getAllRuntimes", "Tags", "Definitions", "Failures", "failureTimeout", "UNKNOWN_RUNTIME", "registerTag", "tag", "isTagRegistered", "getAllRegisteredTags", "recordTagRegistrationFailure", "tagRegRuntimeIndex", "displayFailedRegistrations", "allRuntimes", "currentRuntimeIndex", "currentRuntime", "message", "runtime", "otherRuntimeIndex", "comparison", "otherRuntime", "compareWord"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/InitialConfiguration.ts"],
4
- "sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport validateThemeRoot from \"./validateThemeRoot.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport CalendarType from \"./types/CalendarType.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(window.location.search);\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn validateThemeRoot(themeRoot);\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n\n\tinitialized = true;\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n};\n"],
4
+ "sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport validateThemeRoot from \"./validateThemeRoot.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport type CalendarType from \"./types/CalendarType.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(window.location.search);\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn validateThemeRoot(themeRoot);\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tparseURLParameters();\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n\n\tinitialized = true;\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n};\n"],
5
5
  "mappings": "aAAA,OAAOA,MAAW,wBAClB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,iBAAAC,MAAqB,iCAC9B,OAAOC,MAAuB,yBAG9B,OAAOC,MAAmB,2BAG1B,IAAIC,EAAc,GAgBdC,EAA+B,CAClC,cAAeF,EAAc,KAC7B,MAAOF,EACP,UAAW,OACX,IAAK,OACL,SAAU,OACV,SAAU,OACV,aAAc,OACd,sBAAuB,OACvB,WAAY,GACZ,eAAgB,CAAC,EACjB,qBAAsB,EACvB,EAGA,MAAMK,EAAmB,KACxBC,EAAkB,EACXF,EAAc,eAGhBG,EAAW,KAChBD,EAAkB,EACXF,EAAc,OAGhBI,EAAe,KACpBF,EAAkB,EACXF,EAAc,WAGhBK,EAAc,KACnBH,EAAkB,EACXF,EAAc,UAQhBM,EAA0B,KAC/BJ,EAAkB,EACXF,EAAc,sBAGhBO,EAAgB,KACrBL,EAAkB,EACXF,EAAc,YAOhBQ,EAAkB,KACvBN,EAA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G,EAAE,CAAC,EAEtCd,EAAe,IAAIM,CAAK,IAC3BA,EAAQN,EAAe,IAAIe,CAAc,GAGtCF,IAAU,SACbzB,EAAc,MAAQwB,EAAyBC,EAAOP,CAAK,EAEvDA,GAASA,EAAM,SAAS,GAAG,IAC9BlB,EAAc,UAAYsB,EAA6BJ,CAAK,IAG7DlB,EAAcyB,CAAK,EAAIP,CAEzB,EAEMU,EAA4B,IAAM,CACvC,MAAMC,EAAiBlC,EAAkC,gBAAgB,EACzE,GAAI,CAACkC,GAAkB,CAACA,EAAe,kBAAkB,EACxD,OAGD,MAAMC,EAAgBD,EAAe,+BAA+B,EACpE7B,EAAgBN,EAAMM,EAAe8B,CAAa,CACnD,EAEM5B,EAAoB,IAAM,CAC3B,OAAO,SAAa,KAAeH,IAKvCc,EAAyB,EAGzBG,EAAmB,EAGnBY,EAA0B,EAE1B7B,EAAc,GACf,EAEA,OACCE,KAAA,iBACAE,KAAA,SACAC,KAAA,aACAC,KAAA,YACAC,KAAA,wBACAC,KAAA,cACAC,KAAA,gBACAC,KAAA,yBACAC,KAAA,YACAC,KAAA",
6
6
  "names": ["merge", "getFeature", "DEFAULT_THEME", "validateThemeRoot", "AnimationMode", "initialized", "initialConfig", "getAnimationMode", "initConfiguration", "getTheme", "getThemeRoot", "getLanguage", "getFetchDefaultLanguage", "getNoConflict", "getCalendarType", "getSecondaryCalendarType", "getTimezone", "getFormatSettings", "booleanMapping", "parseConfigurationScript", "configScript", "configJSON", "parseURLParameters", "params", "value", "key", "parts", "applyURLParam", "normalizeThemeRootParamValue", "themeRoot", "normalizeThemeParamValue", "param", "paramType", "lowerCaseValue", "applyOpenUI5Configuration", "openUI5Support", "OpenUI5Config"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import{getCurrentRuntimeIndex as a,compareRuntimes as g}from"./Runtimes.js";const l=typeof document>"u",o=(e,t)=>t?`${e}|${t}`:e,f=e=>e===void 0?!0:g(a(),parseInt(e))===1,u=(e,t,n="",i)=>{const s=typeof e=="string"?e:e.content,c=a(),r=new CSSStyleSheet;r.replaceSync(s),r._ui5StyleId=o(t,n),i&&(r._ui5RuntimeIndex=c,r._ui5Theme=i),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]},S=(e,t,n="",i)=>{const s=typeof e=="string"?e:e.content,c=a(),r=document.adoptedStyleSheets.find(d=>d._ui5StyleId===o(t,n));if(r)if(!i)r.replaceSync(s||"");else{const d=r._ui5RuntimeIndex;(r._ui5Theme!==i||f(d))&&(r.replaceSync(s||""),r._ui5RuntimeIndex=String(c),r._ui5Theme=i)}},y=(e,t="")=>l?!0:!!document.adoptedStyleSheets.find(n=>n._ui5StyleId===o(e,t)),p=(e,t="")=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n._ui5StyleId!==o(e,t))},m=(e,t,n="",i)=>{y(t,n)?S(e,t,n,i):u(e,t,n,i)},R=(e,t)=>{if(e===void 0)return t;if(t===void 0)return e;const n=typeof t=="string"?t:t.content;return typeof e=="string"?`${e} ${n}`:{content:`${e.content} ${n}`,packageName:e.packageName,fileName:e.fileName}};export{u as createStyle,y as hasStyle,S as updateStyle,p as removeStyle,m as createOrUpdateStyle,R as mergeStyles};
1
+ "use strict";import{getCurrentRuntimeIndex as a,compareRuntimes as g}from"./Runtimes.js";const l=typeof document>"u",o=(e,t)=>t?`${e}|${t}`:e,f=e=>e===void 0?!0:g(a(),parseInt(e))===1,u=(e,t,n="",s)=>{const i=typeof e=="string"?e:e.content,c=a(),r=new CSSStyleSheet;r.replaceSync(i),r._ui5StyleId=o(t,n),s&&(r._ui5RuntimeIndex=c,r._ui5Theme=s),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]},y=(e,t,n="",s)=>{const i=typeof e=="string"?e:e.content,c=a(),r=document.adoptedStyleSheets.find(d=>d._ui5StyleId===o(t,n));if(r)if(!s)r.replaceSync(i||"");else{const d=r._ui5RuntimeIndex;(r._ui5Theme!==s||f(d))&&(r.replaceSync(i||""),r._ui5RuntimeIndex=String(c),r._ui5Theme=s)}},S=(e,t="")=>l?!0:!!document.adoptedStyleSheets.find(n=>n._ui5StyleId===o(e,t)),p=(e,t="")=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n._ui5StyleId!==o(e,t))},m=(e,t,n="",s)=>{S(t,n)?y(e,t,n,s):u(e,t,n,s)},R=(e,t)=>{if(e===void 0)return t;if(t===void 0)return e;const n=typeof t=="string"?t:t.content;return typeof e=="string"?`${e} ${n}`:{content:`${e.content} ${n}`,packageName:e.packageName,fileName:e.fileName}};export{u as createStyle,S as hasStyle,y as updateStyle,p as removeStyle,m as createOrUpdateStyle,R as mergeStyles};
2
2
  //# sourceMappingURL=ManagedStyles.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ManagedStyles.ts"],
4
- "sourcesContent": ["import { StyleData, StyleDataCSP } from \"./types.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(data, name, value, theme);\n\t} else {\n\t\tcreateStyle(data, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: StyleData, style2?: StyleData) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\tconst style2Content = typeof style2 === \"string\" ? style2 : style2.content;\n\tif (typeof style1 === \"string\") {\n\t\treturn `${style1} ${style2Content}`;\n\t}\n\treturn {\n\t\tcontent: `${style1.content} ${style2Content}`,\n\t\tpackageName: style1.packageName,\n\t\tfileName: style1.fileName,\n\t};\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n\nexport type {\n\tStyleData,\n\tStyleDataCSP,\n};\n"],
4
+ "sourcesContent": ["import type { StyleData, StyleDataCSP } from \"./types.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (data: StyleData, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(data, name, value, theme);\n\t} else {\n\t\tcreateStyle(data, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: StyleData, style2?: StyleData) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\tconst style2Content = typeof style2 === \"string\" ? style2 : style2.content;\n\tif (typeof style1 === \"string\") {\n\t\treturn `${style1} ${style2Content}`;\n\t}\n\treturn {\n\t\tcontent: `${style1.content} ${style2Content}`,\n\t\tpackageName: style1.packageName,\n\t\tfileName: style1.fileName,\n\t};\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n\nexport type {\n\tStyleData,\n\tStyleDataCSP,\n};\n"],
5
5
  "mappings": "aACA,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AAS,mBAAqB,SAAS,mBAAmB,OAAOU,GAAOA,EAA2B,cAAgBZ,EAAWC,EAAMC,CAAK,CAAC,CAC3I,EAEMc,EAAsB,CAACV,EAAiBL,EAAcC,EAAQ,GAAIK,IAAmB,CACtFO,EAASb,EAAMC,CAAK,EACvBS,EAAYL,EAAML,EAAMC,EAAOK,CAAK,EAEpCF,EAAYC,EAAML,EAAMC,EAAOK,CAAK,CAEtC,EAEMU,EAAc,CAACC,EAAoBC,IAAuB,CAC/D,GAAID,IAAW,OACd,OAAOC,EAER,GAAIA,IAAW,OACd,OAAOD,EAER,MAAME,EAAgB,OAAOD,GAAW,SAAWA,EAASA,EAAO,QACnE,OAAI,OAAOD,GAAW,SACd,GAAGA,CAAM,IAAIE,CAAa,GAE3B,CACN,QAAS,GAAGF,EAAO,OAAO,IAAIE,CAAa,GAC3C,YAAaF,EAAO,YACpB,SAAUA,EAAO,QAClB,CACD,EAEA,OACCb,KAAA,YACAS,KAAA,SACAH,KAAA,YACAI,KAAA,YACAC,KAAA,oBACAC,KAAA",
6
6
  "names": ["getCurrentRuntimeIndex", "compareRuntimes", "isSSR", "getStyleId", "name", "value", "shouldUpdate", "runtimeIndex", "createStyle", "data", "theme", "content", "currentRuntimeIndex", "stylesheet", "updateStyle", "sh", "stylesheetRuntimeIndex", "hasStyle", "removeStyle", "createOrUpdateStyle", "mergeStyles", "style1", "style2", "style2Content"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import g from"./EventProvider.js";import v from"./RenderQueue.js";import{getAllRegisteredTags as A}from"./CustomElementsRegistry.js";import{isRtlAware as R}from"./locale/RTLAwareRegistry.js";const s=new Set,d=new g,n=new v;let t,a,m,i;const l=async e=>{n.add(e),await P()},c=e=>{d.fireEvent("beforeComponentRender",e),s.add(e),e._render()},h=e=>{n.remove(e),s.delete(e)},P=async()=>{i||(i=new Promise(e=>{window.requestAnimationFrame(()=>{n.process(c),i=null,e(),m||(m=setTimeout(()=>{m=void 0,n.isEmpty()&&y()},200))})})),await i},I=()=>t||(t=new Promise(e=>{a=e,window.requestAnimationFrame(()=>{n.isEmpty()&&(t=void 0,e())})}),t),U=()=>{const e=A().map(r=>customElements.whenDefined(r));return Promise.all(e)},f=async()=>{await U(),await I()},y=()=>{n.isEmpty()&&a&&(a(),a=void 0,t=void 0)},C=async e=>{s.forEach(r=>{const o=r.constructor,u=o.getMetadata().getTag(),w=R(o),p=o.getMetadata().isLanguageAware(),E=o.getMetadata().isThemeAware();(!e||e.tag===u||e.rtlAware&&w||e.languageAware&&p||e.themeAware&&E)&&l(r)}),await f()},T=e=>{d.attachEvent("beforeComponentRender",e)},b=e=>{d.detachEvent("beforeComponentRender",e)};export{l as renderDeferred,c as renderImmediately,h as cancelRender,f as renderFinished,C as reRenderAllUI5Elements,T as attachBeforeComponentRender,b as detachBeforeComponentRender};
1
+ "use strict";import g from"./EventProvider.js";import v from"./RenderQueue.js";import{getAllRegisteredTags as A}from"./CustomElementsRegistry.js";import{isRtlAware as R}from"./locale/RTLAwareRegistry.js";const s=new Set,d=new g,n=new v;let t,a,m,i;const l=async e=>{n.add(e),await P()},c=e=>{d.fireEvent("beforeComponentRender",e),s.add(e),e._render()},h=e=>{n.remove(e),s.delete(e)},P=async()=>{i||(i=new Promise(e=>{window.requestAnimationFrame(()=>{n.process(c),i=null,e(),m||(m=setTimeout(()=>{m=void 0,n.isEmpty()&&U()},200))})})),await i},y=()=>t||(t=new Promise(e=>{a=e,window.requestAnimationFrame(()=>{n.isEmpty()&&(t=void 0,e())})}),t),I=()=>{const e=A().map(r=>customElements.whenDefined(r));return Promise.all(e)},f=async()=>{await I(),await y()},U=()=>{n.isEmpty()&&a&&(a(),a=void 0,t=void 0)},C=async e=>{s.forEach(r=>{const o=r.constructor,u=o.getMetadata().getTag(),w=R(o),p=o.getMetadata().isLanguageAware(),E=o.getMetadata().isThemeAware();(!e||e.tag===u||e.rtlAware&&w||e.languageAware&&p||e.themeAware&&E)&&l(r)}),await f()},T=e=>{d.attachEvent("beforeComponentRender",e)},b=e=>{d.detachEvent("beforeComponentRender",e)};export{l as renderDeferred,c as renderImmediately,h as cancelRender,f as renderFinished,C as reRenderAllUI5Elements,T as attachBeforeComponentRender,b as detachBeforeComponentRender};
2
2
  //# sourceMappingURL=Render.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Render.ts"],
4
- "sourcesContent": ["import EventProvider from \"./EventProvider.js\";\nimport RenderQueue from \"./RenderQueue.js\";\nimport { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { isRtlAware } from \"./locale/RTLAwareRegistry.js\";\nimport type UI5Element from \"./UI5Element.js\";\nimport { PromiseResolve, Timeout } from \"./types.js\";\n\ntype BeforeComponentRenderCallback = (webComponent: UI5Element) => void;\n\nconst registeredElements = new Set<UI5Element>();\nconst eventProvider = new EventProvider<UI5Element, void>();\n\nconst invalidatedWebComponents = new RenderQueue(); // Queue for invalidated web components\n\nlet renderTaskPromise: Promise<void> | undefined,\n\trenderTaskPromiseResolve: PromiseResolve | undefined;\n\nlet mutationObserverTimer: Timeout | undefined;\n\nlet queuePromise: Promise<void> | null;\n\n/**\n * Schedules a render task (if not already scheduled) to render the component\n *\n * @param webComponent\n * @returns {Promise}\n */\nconst renderDeferred = async (webComponent: UI5Element) => {\n\t// Enqueue the web component\n\tinvalidatedWebComponents.add(webComponent);\n\n\t// Schedule a rendering task\n\tawait scheduleRenderTask();\n};\n\n/**\n * Renders a component synchronously and adds it to the registry of rendered components\n *\n * @param webComponent\n */\nconst renderImmediately = (webComponent: UI5Element) => {\n\teventProvider.fireEvent(\"beforeComponentRender\", webComponent);\n\tregisteredElements.add(webComponent);\n\twebComponent._render();\n};\n\n/**\n * Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components\n *\n * @param webComponent\n */\nconst cancelRender = (webComponent: UI5Element) => {\n\tinvalidatedWebComponents.remove(webComponent);\n\tregisteredElements.delete(webComponent);\n};\n\n/**\n * Schedules a rendering task, if not scheduled already\n */\nconst scheduleRenderTask = async () => {\n\tif (!queuePromise) {\n\t\tqueuePromise = new Promise<void>(resolve => {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t// Render all components in the queue\n\n\t\t\t\t// console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line\n\t\t\t\tinvalidatedWebComponents.process(renderImmediately);\n\t\t\t\t// console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line\n\n\t\t\t\t// Resolve the promise so that callers of renderDeferred can continue\n\t\t\t\tqueuePromise = null;\n\t\t\t\tresolve();\n\n\t\t\t\t// Wait for Mutation observer before the render task is considered finished\n\t\t\t\tif (!mutationObserverTimer) {\n\t\t\t\t\tmutationObserverTimer = setTimeout(() => {\n\t\t\t\t\t\tmutationObserverTimer = undefined;\n\t\t\t\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\t\t\t\t_resolveTaskPromise();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 200);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tawait queuePromise;\n};\n\n/**\n * return a promise that will be resolved once all invalidated web components are rendered\n */\nconst whenDOMUpdated = () => {\n\tif (renderTaskPromise) {\n\t\treturn renderTaskPromise;\n\t}\n\n\trenderTaskPromise = new Promise<void>(resolve => {\n\t\trenderTaskPromiseResolve = resolve;\n\t\twindow.requestAnimationFrame(() => {\n\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\trenderTaskPromise = undefined;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n\n\treturn renderTaskPromise;\n};\n\nconst whenAllCustomElementsAreDefined = () => {\n\tconst definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));\n\treturn Promise.all(definedPromises);\n};\n\nconst renderFinished = async () => {\n\tawait whenAllCustomElementsAreDefined();\n\tawait whenDOMUpdated();\n};\n\nconst _resolveTaskPromise = () => {\n\tif (!invalidatedWebComponents.isEmpty()) {\n\t\t// More updates are pending. Resolve will be called again\n\t\treturn;\n\t}\n\n\tif (renderTaskPromiseResolve) {\n\t\trenderTaskPromiseResolve();\n\t\trenderTaskPromiseResolve = undefined;\n\t\trenderTaskPromise = undefined;\n\t}\n};\n\n/**\n * Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.\n *\n * Usage:\n * reRenderAllUI5Elements() -> re-renders all components\n * reRenderAllUI5Elements({tag: \"ui5-button\"}) -> re-renders only instances of ui5-button\n * reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components\n * reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components\n * reRenderAllUI5Elements({themeAware: true}) -> re-renders only themeAware components\n * reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware\n * etc...\n *\n * @public\n * @param {object|undefined} filters - Object with keys that can be \"rtlAware\" or \"languageAware\"\n * @returns {Promise<void>}\n */\nconst reRenderAllUI5Elements = async (filters?: {tag?: string, rtlAware?: boolean, languageAware?: boolean, themeAware?: boolean}) => {\n\tregisteredElements.forEach((element: UI5Element) => {\n\t\tconst ctor = element.constructor as typeof UI5Element;\n\t\tconst tag = ctor.getMetadata().getTag();\n\t\tconst rtlAware = isRtlAware(ctor);\n\t\tconst languageAware = ctor.getMetadata().isLanguageAware();\n\t\tconst themeAware = ctor.getMetadata().isThemeAware();\n\t\tif (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware) || (filters.themeAware && themeAware)) {\n\t\t\trenderDeferred(element);\n\t\t}\n\t});\n\tawait renderFinished();\n};\n\nconst attachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.attachEvent(\"beforeComponentRender\", listener);\n};\n\nconst detachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.detachEvent(\"beforeComponentRender\", listener);\n};\n\nexport {\n\trenderDeferred,\n\trenderImmediately,\n\tcancelRender,\n\trenderFinished,\n\treRenderAllUI5Elements,\n\tattachBeforeComponentRender,\n\tdetachBeforeComponentRender,\n};\n"],
4
+ "sourcesContent": ["import EventProvider from \"./EventProvider.js\";\nimport RenderQueue from \"./RenderQueue.js\";\nimport { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { isRtlAware } from \"./locale/RTLAwareRegistry.js\";\nimport type UI5Element from \"./UI5Element.js\";\nimport type { PromiseResolve, Timeout } from \"./types.js\";\n\ntype BeforeComponentRenderCallback = (webComponent: UI5Element) => void;\n\nconst registeredElements = new Set<UI5Element>();\nconst eventProvider = new EventProvider<UI5Element, void>();\n\nconst invalidatedWebComponents = new RenderQueue(); // Queue for invalidated web components\n\nlet renderTaskPromise: Promise<void> | undefined,\n\trenderTaskPromiseResolve: PromiseResolve | undefined;\n\nlet mutationObserverTimer: Timeout | undefined;\n\nlet queuePromise: Promise<void> | null;\n\n/**\n * Schedules a render task (if not already scheduled) to render the component\n *\n * @param webComponent\n * @returns {Promise}\n */\nconst renderDeferred = async (webComponent: UI5Element) => {\n\t// Enqueue the web component\n\tinvalidatedWebComponents.add(webComponent);\n\n\t// Schedule a rendering task\n\tawait scheduleRenderTask();\n};\n\n/**\n * Renders a component synchronously and adds it to the registry of rendered components\n *\n * @param webComponent\n */\nconst renderImmediately = (webComponent: UI5Element) => {\n\teventProvider.fireEvent(\"beforeComponentRender\", webComponent);\n\tregisteredElements.add(webComponent);\n\twebComponent._render();\n};\n\n/**\n * Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components\n *\n * @param webComponent\n */\nconst cancelRender = (webComponent: UI5Element) => {\n\tinvalidatedWebComponents.remove(webComponent);\n\tregisteredElements.delete(webComponent);\n};\n\n/**\n * Schedules a rendering task, if not scheduled already\n */\nconst scheduleRenderTask = async () => {\n\tif (!queuePromise) {\n\t\tqueuePromise = new Promise<void>(resolve => {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t// Render all components in the queue\n\n\t\t\t\t// console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line\n\t\t\t\tinvalidatedWebComponents.process(renderImmediately);\n\t\t\t\t// console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line\n\n\t\t\t\t// Resolve the promise so that callers of renderDeferred can continue\n\t\t\t\tqueuePromise = null;\n\t\t\t\tresolve();\n\n\t\t\t\t// Wait for Mutation observer before the render task is considered finished\n\t\t\t\tif (!mutationObserverTimer) {\n\t\t\t\t\tmutationObserverTimer = setTimeout(() => {\n\t\t\t\t\t\tmutationObserverTimer = undefined;\n\t\t\t\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\t\t\t\t_resolveTaskPromise();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 200);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tawait queuePromise;\n};\n\n/**\n * return a promise that will be resolved once all invalidated web components are rendered\n */\nconst whenDOMUpdated = () => {\n\tif (renderTaskPromise) {\n\t\treturn renderTaskPromise;\n\t}\n\n\trenderTaskPromise = new Promise<void>(resolve => {\n\t\trenderTaskPromiseResolve = resolve;\n\t\twindow.requestAnimationFrame(() => {\n\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\trenderTaskPromise = undefined;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n\n\treturn renderTaskPromise;\n};\n\nconst whenAllCustomElementsAreDefined = () => {\n\tconst definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));\n\treturn Promise.all(definedPromises);\n};\n\nconst renderFinished = async () => {\n\tawait whenAllCustomElementsAreDefined();\n\tawait whenDOMUpdated();\n};\n\nconst _resolveTaskPromise = () => {\n\tif (!invalidatedWebComponents.isEmpty()) {\n\t\t// More updates are pending. Resolve will be called again\n\t\treturn;\n\t}\n\n\tif (renderTaskPromiseResolve) {\n\t\trenderTaskPromiseResolve();\n\t\trenderTaskPromiseResolve = undefined;\n\t\trenderTaskPromise = undefined;\n\t}\n};\n\n/**\n * Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.\n *\n * Usage:\n * reRenderAllUI5Elements() -> re-renders all components\n * reRenderAllUI5Elements({tag: \"ui5-button\"}) -> re-renders only instances of ui5-button\n * reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components\n * reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components\n * reRenderAllUI5Elements({themeAware: true}) -> re-renders only themeAware components\n * reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware\n * etc...\n *\n * @public\n * @param {object|undefined} filters - Object with keys that can be \"rtlAware\" or \"languageAware\"\n * @returns {Promise<void>}\n */\nconst reRenderAllUI5Elements = async (filters?: {tag?: string, rtlAware?: boolean, languageAware?: boolean, themeAware?: boolean}) => {\n\tregisteredElements.forEach((element: UI5Element) => {\n\t\tconst ctor = element.constructor as typeof UI5Element;\n\t\tconst tag = ctor.getMetadata().getTag();\n\t\tconst rtlAware = isRtlAware(ctor);\n\t\tconst languageAware = ctor.getMetadata().isLanguageAware();\n\t\tconst themeAware = ctor.getMetadata().isThemeAware();\n\t\tif (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware) || (filters.themeAware && themeAware)) {\n\t\t\trenderDeferred(element);\n\t\t}\n\t});\n\tawait renderFinished();\n};\n\nconst attachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.attachEvent(\"beforeComponentRender\", listener);\n};\n\nconst detachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.detachEvent(\"beforeComponentRender\", listener);\n};\n\nexport {\n\trenderDeferred,\n\trenderImmediately,\n\tcancelRender,\n\trenderFinished,\n\treRenderAllUI5Elements,\n\tattachBeforeComponentRender,\n\tdetachBeforeComponentRender,\n};\n"],
5
5
  "mappings": "aAAA,OAAOA,MAAmB,qBAC1B,OAAOC,MAAiB,mBACxB,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,cAAAC,MAAkB,+BAM3B,MAAMC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C,EAAOD,EAAQ,YACfJ,EAAMK,EAAK,YAAY,EAAE,OAAO,EAChCC,EAAWxB,EAAWuB,CAAI,EAC1BE,EAAgBF,EAAK,YAAY,EAAE,gBAAgB,EACnDG,EAAaH,EAAK,YAAY,EAAE,aAAa,GAC/C,CAACF,GAAYA,EAAQ,MAAQH,GAASG,EAAQ,UAAYG,GAAcH,EAAQ,eAAiBI,GAAmBJ,EAAQ,YAAcK,IAC7IlB,EAAec,CAAO,CAExB,CAAC,EACD,MAAMH,EAAe,CACtB,EAEMQ,EAA+BC,GAA4C,CAChF1B,EAAc,YAAY,wBAAyB0B,CAAQ,CAC5D,EAEMC,EAA+BD,GAA4C,CAChF1B,EAAc,YAAY,wBAAyB0B,CAAQ,CAC5D,EAEA,OACCpB,KAAA,eACAG,KAAA,kBACAC,KAAA,aACAO,KAAA,eACAC,KAAA,uBACAO,KAAA,4BACAE,KAAA",
6
6
  "names": ["EventProvider", "RenderQueue", "getAllRegisteredTags", "isRtlAware", "registeredElements", "eventProvider", "invalidatedWebComponents", "renderTaskPromise", "renderTaskPromiseResolve", "mutationObserverTimer", "queuePromise", "renderDeferred", "webComponent", "scheduleRenderTask", "renderImmediately", "cancelRender", "resolve", "_resolveTaskPromise", "whenDOMUpdated", "whenAllCustomElementsAreDefined", "definedPromises", "tag", "renderFinished", "reRenderAllUI5Elements", "filters", "element", "ctor", "rtlAware", "languageAware", "themeAware", "attachBeforeComponentRender", "listener", "detachBeforeComponentRender"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import O from"./thirdparty/merge.js";import{boot as L}from"./Boot.js";import U from"./UI5ElementMetadata.js";import S from"./EventProvider.js";import F from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as V}from"./IgnoreCustomElements.js";import{renderDeferred as N,renderImmediately as j,cancelRender as k}from"./Render.js";import{registerTag as x,isTagRegistered as H,recordTagRegistrationFailure as $}from"./CustomElementsRegistry.js";import{observeDOMNode as z,unobserveDOMNode as W}from"./DOMObserver.js";import{skipOriginalEvent as q}from"./config/NoConflict.js";import B from"./locale/getEffectiveDir.js";import{kebabToCamelCase as I,camelToKebabCase as K}from"./util/StringHelper.js";import D from"./util/isValidPropertyName.js";import{getSlotName as G,getSlottedNodesList as b}from"./util/SlotsHelper.js";import A from"./util/arraysAreEqual.js";import{markAsRtlAware as J}from"./locale/RTLAwareRegistry.js";import Q from"./renderer/executeTemplate.js";import{attachFormElementInternals as X,setFormValue as P}from"./features/InputElementsFormSupport.js";let Y=0;const T=new Map,E=new Map;function y(u){this._suppressInvalidation||(this.onInvalidation(u),this._changedState.push(u),N(this),this._invalidationEventProvider.fireEvent("invalidate",{...u,target:this}))}function Z(u,M){do{const t=Object.getOwnPropertyDescriptor(u,M);if(t)return t;u=Object.getPrototypeOf(u)}while(u&&u!==HTMLElement.prototype)}class C extends HTMLElement{constructor(){super();const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._invalidationEventProvider=new S,this._componentStateFinalizedEventProvider=new S;let e;if(this._domRefReadyPromise=new Promise(o=>{e=o}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._slotsAssignedNodes=new WeakMap,this._state={...t.getMetadata().getInitialState()},this._upgradeAllProperties(),t._needsShadowDOM()){const o={mode:"open"};this.attachShadow({...o,...t.getMetadata().getShadowRootOptions()})}}get _id(){return this.__id||(this.__id=`ui5wc_${++Y}`),this.__id}render(){const t=this.constructor.template;return Q(t,this)}async connectedCallback(){const t=this.constructor;this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),this._inDOM&&(j(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this._domRefReadyPromise._deferredResolve(),k(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const e=this.constructor.getMetadata();if(!e.hasSlots())return;const a=e.canSlotText(),s=Object.keys(e.getSlots()).some(d=>e.getSlots()[d].cloned),i={childList:!0,subtree:a||s,characterData:a};z(this,this._processChildren.bind(this),i)}_stopObservingDOMChildren(){W(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),o=t.getMetadata().canSlotText(),a=Array.from(o?this.childNodes:this.children),s=new Map,i=new Map;for(const[l,m]of Object.entries(e)){const c=m.propertyName||l;i.set(c,l),s.set(c,[...this._state[c]]),this._clearSlot(l,m)}const d=new Map,n=new Map,r=a.map(async(l,m)=>{const c=G(l),f=e[c];if(f===void 0){if(c!=="default"){const p=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${c}, ignoring`,l,`Valid values are: ${p}`)}return}if(f.individualSlots){const p=(d.get(c)||0)+1;d.set(c,p),l._individualSlot=`${c}-${p}`}if(l instanceof HTMLElement){const p=l.localName;if(p.includes("-")&&!V(p)){if(!customElements.get(p)){const w=customElements.whenDefined(p);let _=T.get(p);_||(_=new Promise(R=>setTimeout(R,1e3)),T.set(p,_)),await Promise.race([w,_])}customElements.upgrade(l)}}if(l=t.getMetadata().constructor.validateSlotValue(l,f),v(l)&&f.invalidateOnChildChange){const p=this._getChildChangeListener(c);l.attachInvalidate.call(l,p)}l instanceof HTMLSlotElement&&this._attachSlotChange(l,c,!!f.invalidateOnChildChange);const g=f.propertyName||c;n.has(g)?n.get(g).push({child:l,idx:m}):n.set(g,[{child:l,idx:m}])});await Promise.all(r),n.forEach((l,m)=>{this._state[m]=l.sort((c,f)=>c.idx-f.idx).map(c=>c.child)});let h=!1;for(const[l,m]of Object.entries(e)){const c=m.propertyName||l;A(s.get(c),this._state[c])||(y.call(this,{type:"slot",name:i.get(c),reason:"children"}),h=!0,t.getMetadata().isFormAssociated()&&P(this))}h||y.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const o=e.propertyName||t;this._state[o].forEach(s=>{if(v(s)){const i=this._getChildChangeListener(t);s.detachInvalidate.call(s,i)}s instanceof HTMLSlotElement&&this._detachSlotChange(s,t)}),this._state[o]=[]}attachInvalidate(t){this._invalidationEventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._invalidationEventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)&&y.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,o){let a;if(this._doNotSyncAttributes.has(t))return;const s=this.constructor.getMetadata().getProperties(),i=t.replace(/^ui5-/,""),d=I(i);if(s.hasOwnProperty(d)){const n=s[d],r=n.type;let h=n.validator;r&&r.isDataTypeClass&&(h=r),h?a=h.attributeToProperty(o):r===Boolean?a=o!==null:a=o,this[d]=a}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&X(this)}static get formAssociated(){return this.getMetadata().isFormAssociated()}_updateAttribute(t,e){const o=this.constructor;if(!o.getMetadata().hasAttribute(t))return;const s=o.getMetadata().getProperties()[t],i=s.type;let d=s.validator;const n=K(t),r=this.getAttribute(n);if(i&&i.isDataTypeClass&&(d=i),d){const h=d.propertyToAttribute(e);h===null?(this._doNotSyncAttributes.add(n),this.removeAttribute(n),this._doNotSyncAttributes.delete(n)):this.setAttribute(n,h)}else i===Boolean?e===!0&&r===null?this.setAttribute(n,""):e===!1&&r!==null&&this.removeAttribute(n):typeof e!="object"&&r!==e&&this.setAttribute(n,e)}_upgradeProperty(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}_upgradeAllProperties(){this.constructor.getMetadata().getPropertiesList().forEach(this._upgradeProperty.bind(this))}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e,o){const a=this._getSlotChangeListener(e);t.addEventListener("slotchange",s=>{if(a.call(t,s),o){const i=this._slotsAssignedNodes.get(t);i&&i.forEach(n=>{if(v(n)){const r=this._getChildChangeListener(e);n.detachInvalidate.call(n,r)}});const d=b([t]);this._slotsAssignedNodes.set(t,d),d.forEach(n=>{if(v(n)){const r=this._getChildChangeListener(e);n.attachInvalidate.call(n,r)}})}})}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){y.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this._suppressInvalidation=!0,this.onBeforeRendering(),this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized"),this._suppressInvalidation=!1,this._changedState=[],t._needsShadowDOM()&&F(this),e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!(!this.shadowRoot||this.shadowRoot.children.length===0))return this.shadowRoot.children[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,o=!1,a=!0){const s=this._fireEvent(t,e,o,a),i=I(t);return i!==t?s&&this._fireEvent(i,e,o,a):s}_fireEvent(t,e,o=!1,a=!0){const s=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:a,cancelable:o}),i=this.dispatchEvent(s);if(q(t))return i;const d=new CustomEvent(t,{detail:e,composed:!1,bubbles:a,cancelable:o});return this.dispatchEvent(d)&&i}getSlottedNodes(t){return b(this[t])}attachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized",t)}detachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized",t)}get effectiveDir(){return J(this.constructor),B(this)}get isUI5Element(){return!0}get classes(){return{}}get accessibilityInfo(){return{}}static get observedAttributes(){return this.getMetadata().getAttributesList()}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),o=this.getMetadata().getProperties();for(const[a,s]of Object.entries(o)){if(D(a)||console.warn(`"${a}" is not a valid property name. Use a name that does not collide with DOM APIs`),s.type===Boolean&&s.defaultValue)throw new Error(`Cannot set a default value for property "${a}". All booleans are false by default.`);if(s.type===Array)throw new Error(`Wrong type for property "${a}". Properties cannot be of type Array - use "multiple: true" and set "type" to the single value type, such as "String", "Object", etc...`);if(s.type===Object&&s.defaultValue)throw new Error(`Cannot set a default value for property "${a}". All properties of type "Object" are empty objects by default.`);if(s.multiple&&s.defaultValue)throw new Error(`Cannot set a default value for property "${a}". All multiple properties are empty arrays by default.`);const i=Z(t,a);let d;i?.set&&(d=i.set);let n;i?.get&&(n=i.get),Object.defineProperty(t,a,{get(){if(n)return n.call(this);if(this._state[a]!==void 0)return this._state[a];const r=s.defaultValue;return s.type===Boolean?!1:s.type===String?r:s.multiple?[]:r},set(r){let h;const l=this.constructor;r=l.getMetadata().constructor.validatePropertyValue(r,s);const c=s.type;let f=s.validator;const g=n?n.call(this):this._state[a];c&&c.isDataTypeClass&&(f=c),f?h=!f.valuesAreEqual(g,r):Array.isArray(g)&&Array.isArray(r)&&s.multiple&&s.compareValues?h=!A(g,r):h=g!==r,h&&(d?d.call(this,r):this._state[a]=r,y.call(this,{type:"property",name:a,newValue:r,oldValue:g}),l.getMetadata().isFormAssociated()&&P(this),this._updateAttribute(a,r))}})}if(e){const a=this.getMetadata().getSlots();for(const[s,i]of Object.entries(a)){D(s)||console.warn(`"${s}" is not a valid property name. Use a name that does not collide with DOM APIs`);const d=i.propertyName||s;Object.defineProperty(t,d,{get(){return this._state[d]!==void 0?this._state[d]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}})}}}static{this.metadata={}}static{this.styles=""}static get dependencies(){return[]}static getUniqueDependencies(){if(!E.has(this)){const t=this.dependencies.filter((e,o,a)=>a.indexOf(e)===o);E.set(this,t)}return E.get(this)||[]}static whenDependenciesDefined(){return Promise.all(this.getUniqueDependencies().map(t=>t.define()))}static async onDefine(){return Promise.resolve()}static async define(){await L(),await Promise.all([this.whenDependenciesDefined(),this.onDefine()]);const t=this.getMetadata().getTag(),e=H(t),o=customElements.get(t);return o&&!e?$(t):o||(this._generateAccessors(),x(t),customElements.define(t,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==C;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const o=O({},...t);return this._metadata=new U(o),this._metadata}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage}checkValidity(){return this._internals?.checkValidity()}reportValidity(){return this._internals?.reportValidity()}}const v=u=>"isUI5Element"in u;export default C;export{v as instanceOfUI5Element};
1
+ "use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import T from"./thirdparty/merge.js";import{boot as U}from"./Boot.js";import L from"./UI5ElementMetadata.js";import S from"./EventProvider.js";import F from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as N}from"./IgnoreCustomElements.js";import{renderDeferred as V,renderImmediately as k,cancelRender as j}from"./Render.js";import{registerTag as x,isTagRegistered as z,recordTagRegistrationFailure as H}from"./CustomElementsRegistry.js";import{observeDOMNode as $,unobserveDOMNode as W}from"./DOMObserver.js";import{skipOriginalEvent as B}from"./config/NoConflict.js";import K from"./locale/getEffectiveDir.js";import{kebabToCamelCase as g,camelToKebabCase as q}from"./util/StringHelper.js";import w from"./util/isValidPropertyName.js";import{getSlotName as G,getSlottedNodesList as R}from"./util/SlotsHelper.js";import J from"./util/arraysAreEqual.js";import{markAsRtlAware as Q}from"./locale/RTLAwareRegistry.js";import X from"./renderer/executeTemplate.js";import{attachFormElementInternals as Y,setFormValue as b}from"./features/InputElementsFormSupport.js";let Z=0;const P=new Map,M=new Map,A={fromAttribute(d,u){return u===Boolean?d!==null:u===Number?d===null?void 0:parseFloat(d):d},toAttribute(d,u){return u===Boolean?d?"":null:u===Object||u===Array||d==null?null:String(d)}};function y(d){this._suppressInvalidation||(this.onInvalidation(d),this._changedState.push(d),V(this),this._invalidationEventProvider.fireEvent("invalidate",{...d,target:this}))}function tt(d,u){do{const t=Object.getOwnPropertyDescriptor(d,u);if(t)return t;d=Object.getPrototypeOf(d)}while(d&&d!==HTMLElement.prototype)}class I extends HTMLElement{constructor(){super();this._rendered=!1;const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._invalidationEventProvider=new S,this._componentStateFinalizedEventProvider=new S;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._slotsAssignedNodes=new WeakMap,this._state={...t.getMetadata().getInitialState()},this.initializedProperties=new Map,this.constructor.getMetadata().getPropertiesList().forEach(n=>{if(this.hasOwnProperty(n)){const o=this[n];this.initializedProperties.set(n,o)}}),this._initShadowRoot()}_initShadowRoot(){const t=this.constructor;if(t._needsShadowDOM()){const e={mode:"open"};this.attachShadow({...e,...t.getMetadata().getShadowRootOptions()}),t.getMetadata().slotsAreManaged()&&this.shadowRoot.addEventListener("slotchange",this._onShadowRootSlotChange.bind(this))}}_onShadowRootSlotChange(t){t.target?.getRootNode()===this.shadowRoot&&this._processChildren()}get _id(){return this.__id||(this.__id=`ui5wc_${++Z}`),this.__id}render(){const t=this.constructor.template;return X(t,this)}async connectedCallback(){const t=this.constructor;this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),this._inDOM&&(k(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this._domRefReadyPromise._deferredResolve(),j(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const e=this.constructor.getMetadata();if(!e.hasSlots())return;const n=e.canSlotText(),o={childList:!0,subtree:n,characterData:n};$(this,this._processChildren.bind(this),o)}_stopObservingDOMChildren(){W(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),s=t.getMetadata().canSlotText(),n=Array.from(s?this.childNodes:this.children),o=new Map,a=new Map;for(const[r,f]of Object.entries(e)){const c=f.propertyName||r;a.set(c,r),o.set(c,[...this._state[c]]),this._clearSlot(r,f)}const l=new Map,i=new Map,h=n.map(async(r,f)=>{const c=G(r),m=e[c];if(m===void 0){if(c!=="default"){const p=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${c}, ignoring`,r,`Valid values are: ${p}`)}return}if(m.individualSlots){const p=(l.get(c)||0)+1;l.set(c,p),r._individualSlot=`${c}-${p}`}if(r instanceof HTMLElement){const p=r.localName;if(p.includes("-")&&!N(p)){if(!customElements.get(p)){const D=customElements.whenDefined(p);let E=P.get(p);E||(E=new Promise(O=>setTimeout(O,1e3)),P.set(p,E)),await Promise.race([D,E])}customElements.upgrade(r)}}if(r=t.getMetadata().constructor.validateSlotValue(r,m),v(r)&&m.invalidateOnChildChange){const p=this._getChildChangeListener(c);r.attachInvalidate.call(r,p)}r instanceof HTMLSlotElement&&this._attachSlotChange(r,c,!!m.invalidateOnChildChange);const C=m.propertyName||c;i.has(C)?i.get(C).push({child:r,idx:f}):i.set(C,[{child:r,idx:f}])});await Promise.all(h),i.forEach((r,f)=>{this._state[f]=r.sort((c,m)=>c.idx-m.idx).map(c=>c.child),this._state[g(f)]=this._state[f]});let _=!1;for(const[r,f]of Object.entries(e)){const c=f.propertyName||r;J(o.get(c),this._state[c])||(y.call(this,{type:"slot",name:a.get(c),reason:"children"}),_=!0,t.getMetadata().isFormAssociated()&&b(this))}_||y.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const s=e.propertyName||t;this._state[s].forEach(o=>{if(v(o)){const a=this._getChildChangeListener(t);o.detachInvalidate.call(o,a)}o instanceof HTMLSlotElement&&this._detachSlotChange(o,t)}),this._state[s]=[],this._state[g(s)]=this._state[s]}attachInvalidate(t){this._invalidationEventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._invalidationEventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)&&y.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,s){let n;if(this._doNotSyncAttributes.has(t))return;const o=this.constructor.getMetadata().getProperties(),a=t.replace(/^ui5-/,""),l=g(a);if(o.hasOwnProperty(l)){const i=o[l];n=(i.converter??A).fromAttribute(s,i.type),this[l]=n}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&Y(this)}static get formAssociated(){return this.getMetadata().isFormAssociated()}_updateAttribute(t,e){const s=this.constructor;if(!s.getMetadata().hasAttribute(t))return;const o=s.getMetadata().getProperties()[t],a=q(t),i=(o.converter||A).toAttribute(e,o.type);i==null?(this._doNotSyncAttributes.add(a),this.removeAttribute(a),this._doNotSyncAttributes.delete(a)):this.setAttribute(a,i)}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e,s){const n=this._getSlotChangeListener(e);t.addEventListener("slotchange",o=>{if(n.call(t,o),s){const a=this._slotsAssignedNodes.get(t);a&&a.forEach(i=>{if(v(i)){const h=this._getChildChangeListener(e);i.detachInvalidate.call(i,h)}});const l=R([t]);this._slotsAssignedNodes.set(t,l),l.forEach(i=>{if(v(i)){const h=this._getChildChangeListener(e);i.attachInvalidate.call(i,h)}})}})}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){y.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}updateAttributes(){const e=this.constructor.getMetadata().getProperties();for(const[s,n]of Object.entries(e))this._updateAttribute(s,this[s])}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this.initializedProperties.size>0&&(Array.from(this.initializedProperties.entries()).forEach(([s,n])=>{delete this[s],this[s]=n}),this.initializedProperties.clear()),this._suppressInvalidation=!0,this.onBeforeRendering(),this._rendered||this.updateAttributes(),this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized"),this._suppressInvalidation=!1,this._changedState=[],t._needsShadowDOM()&&F(this),this._rendered=!0,e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!(!this.shadowRoot||this.shadowRoot.children.length===0))return this.shadowRoot.children[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e===this?HTMLElement.prototype.focus.call(this,t):e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,s=!1,n=!0){const o=this._fireEvent(t,e,s,n),a=g(t);return a!==t?o&&this._fireEvent(a,e,s,n):o}_fireEvent(t,e,s=!1,n=!0){const o=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:n,cancelable:s}),a=this.dispatchEvent(o);if(B(t))return a;const l=new CustomEvent(t,{detail:e,composed:!1,bubbles:n,cancelable:s});return this.dispatchEvent(l)&&a}getSlottedNodes(t){return R(this[t])}attachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized",t)}detachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized",t)}get effectiveDir(){return Q(this.constructor),K(this)}get isUI5Element(){return!0}get classes(){return{}}get accessibilityInfo(){return{}}static get observedAttributes(){return this.getMetadata().getAttributesList()}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),s=this.getMetadata().getProperties();for(const[n,o]of Object.entries(s)){w(n)||console.warn(`"${n}" is not a valid property name. Use a name that does not collide with DOM APIs`);const a=tt(t,n);let l;a?.set&&(l=a.set);let i;a?.get&&(i=a.get),Object.defineProperty(t,n,{get(){return i?i.call(this):this._state[n]},set(h){const _=this.constructor,r=i?i.call(this):this._state[n];r!==h&&(l?l.call(this,h):this._state[n]=h,y.call(this,{type:"property",name:n,newValue:h,oldValue:r}),this._rendered&&this._updateAttribute(n,h),_.getMetadata().isFormAssociated()&&b(this))}})}if(e){const n=this.getMetadata().getSlots();for(const[o,a]of Object.entries(n)){w(o)||console.warn(`"${o}" is not a valid property name. Use a name that does not collide with DOM APIs`);const l=a.propertyName||o,i={get(){return this._state[l]!==void 0?this._state[l]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}};Object.defineProperty(t,l,i),l!==g(l)&&Object.defineProperty(t,g(l),i)}}}static{this.metadata={}}static{this.styles=""}static get dependencies(){return[]}static getUniqueDependencies(){if(!M.has(this)){const t=this.dependencies.filter((e,s,n)=>n.indexOf(e)===s);M.set(this,t)}return M.get(this)||[]}static whenDependenciesDefined(){return Promise.all(this.getUniqueDependencies().map(t=>t.define()))}static async onDefine(){return Promise.resolve()}static async define(){await U(),await Promise.all([this.whenDependenciesDefined(),this.onDefine()]);const t=this.getMetadata().getTag(),e=z(t),s=customElements.get(t);return s&&!e?H(t):s||(this._generateAccessors(),x(t),customElements.define(t,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==I;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const s=T({},...t);return this._metadata=new L(s),this._metadata}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage}checkValidity(){return this._internals?.checkValidity()}reportValidity(){return this._internals?.reportValidity()}}const v=d=>"isUI5Element"in d;export default I;export{v as instanceOfUI5Element};
2
2
  //# sourceMappingURL=UI5Element.js.map