@ui5/webcomponents-base 0.0.0-d9b978d1d → 0.0.0-da0d3eb88

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 (251) hide show
  1. package/CHANGELOG.md +653 -0
  2. package/README.md +0 -8
  3. package/config/wdio.conf.cjs +0 -8
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/Boot.d.ts +3 -2
  6. package/dist/Boot.js +8 -6
  7. package/dist/Boot.js.map +1 -1
  8. package/dist/Device.d.ts +1 -2
  9. package/dist/Device.js +5 -12
  10. package/dist/Device.js.map +1 -1
  11. package/dist/IgnoreCustomElements.d.ts +3 -5
  12. package/dist/IgnoreCustomElements.js +3 -5
  13. package/dist/IgnoreCustomElements.js.map +1 -1
  14. package/dist/InitialConfiguration.d.ts +1 -2
  15. package/dist/InitialConfiguration.js +1 -5
  16. package/dist/InitialConfiguration.js.map +1 -1
  17. package/dist/Keys.d.ts +3 -1
  18. package/dist/Keys.js +5 -1
  19. package/dist/Keys.js.map +1 -1
  20. package/dist/ManagedStyles.js +24 -98
  21. package/dist/ManagedStyles.js.map +1 -1
  22. package/dist/MediaRange.d.ts +6 -12
  23. package/dist/MediaRange.js +21 -31
  24. package/dist/MediaRange.js.map +1 -1
  25. package/dist/UI5Element.d.ts +36 -54
  26. package/dist/UI5Element.js +152 -101
  27. package/dist/UI5Element.js.map +1 -1
  28. package/dist/UI5ElementMetadata.d.ts +12 -13
  29. package/dist/UI5ElementMetadata.js +24 -13
  30. package/dist/UI5ElementMetadata.js.map +1 -1
  31. package/dist/asset-registries/Icons.js +1 -1
  32. package/dist/asset-registries/Icons.js.map +1 -1
  33. package/dist/asset-registries/Illustrations.d.ts +1 -0
  34. package/dist/asset-registries/Illustrations.js +12 -19
  35. package/dist/asset-registries/Illustrations.js.map +1 -1
  36. package/dist/asset-registries/LocaleData.js +1 -1
  37. package/dist/asset-registries/LocaleData.js.map +1 -1
  38. package/dist/asset-registries/i18n.d.ts +2 -2
  39. package/dist/asset-registries/i18n.js +2 -2
  40. package/dist/asset-registries/i18n.js.map +1 -1
  41. package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +1 -1
  42. package/dist/asset-registries/util/IconCollectionsByTheme.js +1 -1
  43. package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -1
  44. package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +3 -3
  45. package/dist/asset-registries/util/getIconCollectionByTheme.js +3 -3
  46. package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -1
  47. package/dist/config/AnimationMode.js +2 -1
  48. package/dist/config/AnimationMode.js.map +1 -1
  49. package/dist/config/Icons.d.ts +7 -7
  50. package/dist/config/Icons.js +7 -7
  51. package/dist/config/Icons.js.map +1 -1
  52. package/dist/config/Language.d.ts +1 -1
  53. package/dist/config/Language.js +6 -3
  54. package/dist/config/Language.js.map +1 -1
  55. package/dist/config/Theme.d.ts +4 -3
  56. package/dist/config/Theme.js +13 -6
  57. package/dist/config/Theme.js.map +1 -1
  58. package/dist/config/ThemeRoot.d.ts +2 -4
  59. package/dist/config/ThemeRoot.js +2 -4
  60. package/dist/config/ThemeRoot.js.map +1 -1
  61. package/dist/config/Timezone.d.ts +1 -1
  62. package/dist/config/Timezone.js +1 -1
  63. package/dist/config/Timezone.js.map +1 -1
  64. package/dist/css/SystemCSSVars.css +0 -8
  65. package/dist/decorators/customElement.d.ts +3 -3
  66. package/dist/decorators/customElement.js +11 -6
  67. package/dist/decorators/customElement.js.map +1 -1
  68. package/dist/decorators/event.d.ts +5 -2
  69. package/dist/decorators/event.js.map +1 -1
  70. package/dist/decorators.d.ts +5 -0
  71. package/dist/decorators.js +6 -0
  72. package/dist/decorators.js.map +1 -0
  73. package/dist/delegate/ItemNavigation.d.ts +8 -8
  74. package/dist/delegate/ItemNavigation.js +9 -9
  75. package/dist/delegate/ItemNavigation.js.map +1 -1
  76. package/dist/delegate/ResizeHandler.d.ts +4 -6
  77. package/dist/delegate/ResizeHandler.js +4 -6
  78. package/dist/delegate/ResizeHandler.js.map +1 -1
  79. package/dist/features/InputElementsFormSupport.d.ts +18 -0
  80. package/dist/features/InputElementsFormSupport.js +40 -0
  81. package/dist/features/InputElementsFormSupport.js.map +1 -0
  82. package/dist/features/OpenUI5Support.d.ts +0 -2
  83. package/dist/features/OpenUI5Support.js +6 -21
  84. package/dist/features/OpenUI5Support.js.map +1 -1
  85. package/dist/features/patchPatcher.d.ts +11 -0
  86. package/dist/features/patchPatcher.js +11 -0
  87. package/dist/features/patchPatcher.js.map +1 -0
  88. package/dist/features/patchPopup.d.ts +14 -0
  89. package/dist/features/patchPopup.js +50 -0
  90. package/dist/features/patchPopup.js.map +1 -0
  91. package/dist/generated/AssetParameters.js +1 -1
  92. package/dist/generated/AssetParameters.js.map +1 -1
  93. package/dist/generated/VersionInfo.js +5 -5
  94. package/dist/generated/VersionInfo.js.map +1 -1
  95. package/dist/generated/css/SystemCSSVars.css.js +1 -1
  96. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  97. package/dist/i18nBundle.d.ts +1 -3
  98. package/dist/i18nBundle.js +1 -4
  99. package/dist/i18nBundle.js.map +1 -1
  100. package/dist/locale/applyDirection.d.ts +3 -2
  101. package/dist/locale/applyDirection.js +3 -2
  102. package/dist/locale/applyDirection.js.map +1 -1
  103. package/dist/locale/getEffectiveDir.d.ts +1 -1
  104. package/dist/locale/getEffectiveDir.js +3 -19
  105. package/dist/locale/getEffectiveDir.js.map +1 -1
  106. package/dist/renderer/LitRenderer.js +2 -8
  107. package/dist/renderer/LitRenderer.js.map +1 -1
  108. package/dist/renderer/directives/style-map.d.ts +13 -0
  109. package/dist/renderer/directives/style-map.js +59 -59
  110. package/dist/renderer/directives/style-map.js.map +1 -0
  111. package/dist/renderer/executeTemplate.d.ts +8 -0
  112. package/dist/renderer/executeTemplate.js +1 -0
  113. package/dist/renderer/executeTemplate.js.map +1 -1
  114. package/dist/sap/base/Log.js +698 -188
  115. package/dist/sap/base/assert.js +28 -1
  116. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  117. package/dist/sap/base/security/URLListValidator.js +253 -6
  118. package/dist/sap/base/security/encodeCSS.js +34 -8
  119. package/dist/sap/base/security/encodeXML.js +47 -17
  120. package/dist/sap/base/security/sanitizeHTML.js +35 -13
  121. package/dist/sap/base/strings/toHex.js +27 -2
  122. package/dist/sap/base/util/now.js +24 -3
  123. package/dist/sap/base/util/uid.js +27 -0
  124. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
  125. package/dist/ssr-dom-shim.d.ts +1 -0
  126. package/dist/ssr-dom-shim.js +12 -0
  127. package/dist/ssr-dom-shim.js.map +1 -0
  128. package/dist/ssr-dom.d.ts +0 -0
  129. package/dist/ssr-dom.js +0 -0
  130. package/dist/theming/getConstructableStyle.d.ts +1 -1
  131. package/dist/theming/getConstructableStyle.js +3 -3
  132. package/dist/theming/getConstructableStyle.js.map +1 -1
  133. package/dist/theming/getEffectiveStyle.d.ts +1 -1
  134. package/dist/theming/getEffectiveStyle.js +5 -12
  135. package/dist/theming/getEffectiveStyle.js.map +1 -1
  136. package/dist/types/AnimationMode.d.ts +0 -8
  137. package/dist/types/AnimationMode.js +0 -8
  138. package/dist/types/AnimationMode.js.map +1 -1
  139. package/dist/types/AriaHasPopup.d.ts +32 -0
  140. package/dist/types/AriaHasPopup.js +34 -0
  141. package/dist/types/AriaHasPopup.js.map +1 -0
  142. package/dist/types/AriaLandmarkRole.d.ts +79 -0
  143. package/dist/types/AriaLandmarkRole.js +81 -0
  144. package/dist/types/AriaLandmarkRole.js.map +1 -0
  145. package/dist/types/AriaRole.d.ts +27 -0
  146. package/dist/types/AriaRole.js +29 -0
  147. package/dist/types/AriaRole.js.map +1 -0
  148. package/dist/types/CSSColor.d.ts +0 -4
  149. package/dist/types/CSSColor.js +0 -4
  150. package/dist/types/CSSColor.js.map +1 -1
  151. package/dist/types/CSSSize.d.ts +0 -4
  152. package/dist/types/CSSSize.js +0 -4
  153. package/dist/types/CSSSize.js.map +1 -1
  154. package/dist/types/CalendarType.d.ts +0 -9
  155. package/dist/types/CalendarType.js +0 -9
  156. package/dist/types/CalendarType.js.map +1 -1
  157. package/dist/types/DOMReference.d.ts +1 -5
  158. package/dist/types/DOMReference.js +1 -5
  159. package/dist/types/DOMReference.js.map +1 -1
  160. package/dist/types/DataType.d.ts +1 -6
  161. package/dist/types/DataType.js +1 -6
  162. package/dist/types/DataType.js.map +1 -1
  163. package/dist/types/Float.d.ts +0 -3
  164. package/dist/types/Float.js +0 -3
  165. package/dist/types/Float.js.map +1 -1
  166. package/dist/types/Integer.d.ts +0 -3
  167. package/dist/types/Integer.js +0 -3
  168. package/dist/types/Integer.js.map +1 -1
  169. package/dist/types/InvisibleMessageMode.d.ts +0 -6
  170. package/dist/types/InvisibleMessageMode.js +0 -6
  171. package/dist/types/InvisibleMessageMode.js.map +1 -1
  172. package/dist/types/ItemNavigationBehavior.d.ts +0 -6
  173. package/dist/types/ItemNavigationBehavior.js +0 -6
  174. package/dist/types/ItemNavigationBehavior.js.map +1 -1
  175. package/dist/types/MovePlacement.d.ts +20 -0
  176. package/dist/types/MovePlacement.js +22 -0
  177. package/dist/types/MovePlacement.js.map +1 -0
  178. package/dist/types/NavigationMode.d.ts +0 -8
  179. package/dist/types/NavigationMode.js +0 -8
  180. package/dist/types/NavigationMode.js.map +1 -1
  181. package/dist/types/Orientation.d.ts +16 -0
  182. package/dist/types/Orientation.js +18 -0
  183. package/dist/types/Orientation.js.map +1 -0
  184. package/dist/types/ValueState.d.ts +3 -17
  185. package/dist/types/ValueState.js +3 -17
  186. package/dist/types/ValueState.js.map +1 -1
  187. package/dist/types.d.ts +24 -1
  188. package/dist/types.js.map +1 -1
  189. package/dist/updateShadowRoot.d.ts +1 -2
  190. package/dist/updateShadowRoot.js +5 -29
  191. package/dist/updateShadowRoot.js.map +1 -1
  192. package/dist/util/InvisibleMessage.js +2 -2
  193. package/dist/util/InvisibleMessage.js.map +1 -1
  194. package/dist/util/PopupUtils.d.ts +1 -3
  195. package/dist/util/PopupUtils.js +1 -15
  196. package/dist/util/PopupUtils.js.map +1 -1
  197. package/dist/util/clamp.js +2 -1
  198. package/dist/util/clamp.js.map +1 -1
  199. package/dist/util/createLinkInHead.d.ts +1 -1
  200. package/dist/util/createLinkInHead.js +1 -1
  201. package/dist/util/createLinkInHead.js.map +1 -1
  202. package/dist/util/detectNavigatorLanguage.d.ts +2 -2
  203. package/dist/util/detectNavigatorLanguage.js +6 -1
  204. package/dist/util/detectNavigatorLanguage.js.map +1 -1
  205. package/dist/util/dragAndDrop/DragRegistry.d.ts +12 -0
  206. package/dist/util/dragAndDrop/DragRegistry.js +68 -0
  207. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -0
  208. package/dist/util/dragAndDrop/findClosestPosition.d.ts +7 -0
  209. package/dist/util/dragAndDrop/findClosestPosition.js +59 -0
  210. package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
  211. package/dist/util/dragAndDrop/longDragOverHandler.d.ts +2 -0
  212. package/dist/util/dragAndDrop/longDragOverHandler.js +25 -0
  213. package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -0
  214. package/dist/util/getClassCopy.d.ts +17 -12
  215. package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -2
  216. package/dist/util/getDesigntimePropertyAsArray.js +2 -1
  217. package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
  218. package/index.js +1 -17
  219. package/package-scripts.cjs +18 -14
  220. package/package.json +20 -8
  221. package/src/css/SystemCSSVars.css +0 -8
  222. package/tsconfig.json +3 -0
  223. package/.eslintignore +0 -16
  224. package/.eslintrc.cjs +0 -3
  225. package/bundle.esm.js +0 -67
  226. package/dist/CSP.d.ts +0 -30
  227. package/dist/CSP.js +0 -51
  228. package/dist/CSP.js.map +0 -1
  229. package/dist/StaticArea.js +0 -7
  230. package/dist/StaticArea.js.map +0 -1
  231. package/dist/StaticAreaItem.d.ts +0 -37
  232. package/dist/StaticAreaItem.js +0 -102
  233. package/dist/StaticAreaItem.js.map +0 -1
  234. package/dist/api.json +0 -1
  235. package/dist/config/RTL.d.ts +0 -7
  236. package/dist/config/RTL.js +0 -37
  237. package/dist/config/RTL.js.map +0 -1
  238. package/dist/theming/getEffectiveLinksHrefs.d.ts +0 -3
  239. package/dist/theming/getEffectiveLinksHrefs.js +0 -17
  240. package/dist/theming/getEffectiveLinksHrefs.js.map +0 -1
  241. package/dist/theming/preloadLinks.d.ts +0 -3
  242. package/dist/theming/preloadLinks.js +0 -19
  243. package/dist/theming/preloadLinks.js.map +0 -1
  244. package/dist/util/createStyleInHead.d.ts +0 -8
  245. package/dist/util/createStyleInHead.js +0 -18
  246. package/dist/util/createStyleInHead.js.map +0 -1
  247. package/lib/generate-asset-parameters/index.js +0 -27
  248. package/lib/generate-styles/index.js +0 -31
  249. package/lib/generate-version-info/index.js +0 -32
  250. package/src/renderer/directives/style-map.js +0 -72
  251. package/used-modules.txt +0 -10
@@ -10,17 +10,11 @@ const effectiveSvg = (strings, ...values) => {
10
10
  const fn = litStatic ? litStatic.svg : svg;
11
11
  return fn(strings, ...values);
12
12
  };
13
- const litRender = (templateResult, container, styleStrOrHrefsArr, forStaticArea, options) => {
13
+ const litRender = (templateResult, container, options) => {
14
14
  const openUI5Enablement = getFeature("OpenUI5Enablement");
15
- if (openUI5Enablement && !forStaticArea) {
15
+ if (openUI5Enablement) {
16
16
  templateResult = openUI5Enablement.wrapTemplateResultInBusyMarkup(effectiveHtml, options.host, templateResult);
17
17
  }
18
- if (typeof styleStrOrHrefsArr === "string") {
19
- templateResult = effectiveHtml `<style>${styleStrOrHrefsArr}</style>${templateResult}`;
20
- }
21
- else if (Array.isArray(styleStrOrHrefsArr) && styleStrOrHrefsArr.length) {
22
- templateResult = effectiveHtml `${styleStrOrHrefsArr.map(href => effectiveHtml `<link type="text/css" rel="stylesheet" href="${href}">`)}${templateResult}`;
23
- }
24
18
  render(templateResult, container, options);
25
19
  };
26
20
  const scopeTag = (tag, tags, suffix) => {
@@ -1 +1 @@
1
- {"version":3,"file":"LitRenderer.js","sourceRoot":"","sources":["../../src/renderer/LitRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,IAAI,EACJ,GAAG,GAEH,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOpD,MAAM,aAAa,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAsB,EAAE,EAAE;IAClF,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAsB,EAAE,EAAE;IACjF,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3C,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,SAAS,GAAa,CAAC,cAAsC,EAAE,SAAyC,EAAE,kBAAsD,EAAE,aAAsB,EAAE,OAAwB,EAAE,EAAE;IAC3N,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;IACpF,IAAI,iBAAiB,IAAI,CAAC,aAAa,EAAE;QACxC,cAAc,GAAG,iBAAiB,CAAC,8BAA8B,CAAC,aAAa,EAAE,OAAO,CAAC,IAAkB,EAAE,cAAgC,CAAC,CAAC;KAC/I;IAED,IAAI,OAAO,kBAAkB,KAAK,QAAQ,EAAE;QAC3C,cAAc,GAAG,aAAa,CAAA,UAAU,kBAAkB,WAAW,cAAc,EAAE,CAAC;KACtF;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,kBAAkB,CAAC,MAAM,EAAE;QAC1E,cAAc,GAAG,aAAa,CAAA,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAA,gDAAgD,IAAI,IAAI,CAAC,GAAG,cAAc,EAAE,CAAC;KAC1J;IACD,MAAM,CAAC,cAAgC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,IAAmB,EAAE,MAAc,EAAE,EAAE;IACrE,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,IAAI,SAAS,EAAE;QACd,OAAO,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACrF;AACF,CAAC,CAAC;AAEF,OAAO,EACN,aAAa,IAAI,IAAI,EACrB,YAAY,IAAI,GAAG,GACnB,CAAC;AACF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,oCAAoC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,eAAe,SAAS,CAAC","sourcesContent":["import {\n\trender,\n\thtml,\n\tsvg,\n\tTemplateResult,\n} from \"lit-html\";\n\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type { LitStatic } from \"../CustomElementsScope.js\";\nimport type OpenUI5Enablement from \"../features/OpenUI5Enablement.js\";\nimport type UI5Element from \"../UI5Element.js\";\nimport type { Renderer, RendererOptions } from \"../UI5Element.js\";\nimport { TemplateFunctionResult } from \"./executeTemplate.js\";\n\nconst effectiveHtml = (strings: TemplateStringsArray, ...values: Array<unknown>) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tconst fn = litStatic ? litStatic.html : html;\n\treturn fn(strings, ...values);\n};\n\nconst effectiveSvg = (strings: TemplateStringsArray, ...values: Array<unknown>) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tconst fn = litStatic ? litStatic.svg : svg;\n\treturn fn(strings, ...values);\n};\n\nconst litRender: Renderer = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, styleStrOrHrefsArr: string | Array<string> | undefined, forStaticArea: boolean, options: RendererOptions) => {\n\tconst openUI5Enablement = getFeature<typeof OpenUI5Enablement>(\"OpenUI5Enablement\");\n\tif (openUI5Enablement && !forStaticArea) {\n\t\ttemplateResult = openUI5Enablement.wrapTemplateResultInBusyMarkup(effectiveHtml, options.host as UI5Element, templateResult as TemplateResult);\n\t}\n\n\tif (typeof styleStrOrHrefsArr === \"string\") {\n\t\ttemplateResult = effectiveHtml`<style>${styleStrOrHrefsArr}</style>${templateResult}`;\n\t} else if (Array.isArray(styleStrOrHrefsArr) && styleStrOrHrefsArr.length) {\n\t\ttemplateResult = effectiveHtml`${styleStrOrHrefsArr.map(href => effectiveHtml`<link type=\"text/css\" rel=\"stylesheet\" href=\"${href}\">`)}${templateResult}`;\n\t}\n\trender(templateResult as TemplateResult, container, options);\n};\n\nconst scopeTag = (tag: string, tags: Array<string>, suffix: string) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tif (litStatic) {\n\t\treturn litStatic.unsafeStatic((tags || []).includes(tag) ? `${tag}-${suffix}` : tag);\n\t}\n};\n\nexport {\n\teffectiveHtml as html,\n\teffectiveSvg as svg,\n};\nexport { scopeTag };\nexport { repeat } from \"lit-html/directives/repeat.js\";\nexport { classMap } from \"lit-html/directives/class-map.js\";\n// @ts-ignore style-map is a JS file\nexport { styleMap } from \"./directives/style-map.js\";\nexport { ifDefined } from \"lit-html/directives/if-defined.js\";\nexport { unsafeHTML } from \"lit-html/directives/unsafe-html.js\";\n\nexport default litRender;\n"]}
1
+ {"version":3,"file":"LitRenderer.js","sourceRoot":"","sources":["../../src/renderer/LitRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,IAAI,EACJ,GAAG,GAEH,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOpD,MAAM,aAAa,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAsB,EAAE,EAAE;IAClF,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAsB,EAAE,EAAE;IACjF,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3C,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,SAAS,GAAa,CAAC,cAAsC,EAAE,SAAyC,EAAE,OAAwB,EAAE,EAAE;IAC3I,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;IACpF,IAAI,iBAAiB,EAAE;QACtB,cAAc,GAAG,iBAAiB,CAAC,8BAA8B,CAAC,aAAa,EAAE,OAAO,CAAC,IAAkB,EAAE,cAAgC,CAAC,CAAC;KAC/I;IAED,MAAM,CAAC,cAAgC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,IAAmB,EAAE,MAAc,EAAE,EAAE;IACrE,MAAM,SAAS,GAAG,UAAU,CAAmB,WAAW,CAAC,CAAC;IAC5D,IAAI,SAAS,EAAE;QACd,OAAO,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACrF;AACF,CAAC,CAAC;AAEF,OAAO,EACN,aAAa,IAAI,IAAI,EACrB,YAAY,IAAI,GAAG,GACnB,CAAC;AACF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,oCAAoC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,eAAe,SAAS,CAAC","sourcesContent":["import {\n\trender,\n\thtml,\n\tsvg,\n\tTemplateResult,\n} from \"lit-html\";\n\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type { LitStatic } from \"../CustomElementsScope.js\";\nimport type OpenUI5Enablement from \"../features/OpenUI5Enablement.js\";\nimport type UI5Element from \"../UI5Element.js\";\nimport type { Renderer, RendererOptions } from \"../UI5Element.js\";\nimport { TemplateFunctionResult } from \"./executeTemplate.js\";\n\nconst effectiveHtml = (strings: TemplateStringsArray, ...values: Array<unknown>) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tconst fn = litStatic ? litStatic.html : html;\n\treturn fn(strings, ...values);\n};\n\nconst effectiveSvg = (strings: TemplateStringsArray, ...values: Array<unknown>) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tconst fn = litStatic ? litStatic.svg : svg;\n\treturn fn(strings, ...values);\n};\n\nconst litRender: Renderer = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, options: RendererOptions) => {\n\tconst openUI5Enablement = getFeature<typeof OpenUI5Enablement>(\"OpenUI5Enablement\");\n\tif (openUI5Enablement) {\n\t\ttemplateResult = openUI5Enablement.wrapTemplateResultInBusyMarkup(effectiveHtml, options.host as UI5Element, templateResult as TemplateResult);\n\t}\n\n\trender(templateResult as TemplateResult, container, options);\n};\n\nconst scopeTag = (tag: string, tags: Array<string>, suffix: string) => {\n\tconst litStatic = getFeature<typeof LitStatic>(\"LitStatic\");\n\tif (litStatic) {\n\t\treturn litStatic.unsafeStatic((tags || []).includes(tag) ? `${tag}-${suffix}` : tag);\n\t}\n};\n\nexport {\n\teffectiveHtml as html,\n\teffectiveSvg as svg,\n};\nexport { scopeTag };\nexport { repeat } from \"lit-html/directives/repeat.js\";\nexport { classMap } from \"lit-html/directives/class-map.js\";\n// @ts-ignore style-map is a JS file\nexport { styleMap } from \"./directives/style-map.js\";\nexport { ifDefined } from \"lit-html/directives/if-defined.js\";\nexport { unsafeHTML } from \"lit-html/directives/unsafe-html.js\";\n\nexport default litRender;\n"]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2018 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ import { Directive } from 'lit-html/directive.js';
7
+ declare class StyleMapDirective extends Directive {
8
+ constructor(partInfo: any);
9
+ render(styleInfo: any): string;
10
+ update(part: any, [styleInfo]: [any]): symbol;
11
+ }
12
+ export declare const styleMap: (styleInfo: any) => import("lit-html/directive.js").DirectiveResult<typeof StyleMapDirective>;
13
+ export {};
@@ -1,72 +1,72 @@
1
+ // @ts-nocheck
2
+ /* eslint-disable */
1
3
  /**
2
4
  * @license
3
5
  * Copyright 2018 Google LLC
4
6
  * SPDX-License-Identifier: BSD-3-Clause
5
7
  */
6
-
7
8
  /**
8
9
  * This is the original style-map.js directive from lit-html 2 with the only difference that "render" is not called even for the first rendering (update is used instead)
9
10
  */
10
-
11
11
  import { noChange } from 'lit-html';
12
12
  import { directive, Directive, PartType, } from 'lit-html/directive.js';
13
13
  class StyleMapDirective extends Directive {
14
- constructor(partInfo) {
15
- var _a;
16
- super(partInfo);
17
- if (partInfo.type !== PartType.ATTRIBUTE ||
18
- partInfo.name !== 'style' ||
19
- ((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {
20
- throw new Error('The `styleMap` directive must be used in the `style` attribute ' +
21
- 'and must be the only part in the attribute.');
22
- }
23
- }
24
- render(styleInfo) {
25
- return "";
26
- }
27
- update(part, [styleInfo]) {
28
- const { style } = part.element;
29
- if (this._previousStyleProperties === undefined) {
30
- this._previousStyleProperties = new Set();
31
- for (const name in styleInfo) {
32
- this._previousStyleProperties.add(name);
33
- }
34
- // return this.render(styleInfo);
35
- }
36
- // Remove old properties that no longer exist in styleInfo
37
- // We use forEach() instead of for-of so that re don't require down-level
38
- // iteration.
39
- this._previousStyleProperties.forEach((name) => {
40
- // If the name isn't in styleInfo or it's null/undefined
41
- if (styleInfo[name] == null) {
42
- this._previousStyleProperties.delete(name);
43
- if (name.includes('-')) {
44
- style.removeProperty(name);
45
- }
46
- else {
47
- // Note reset using empty string (vs null) as IE11 does not always
48
- // reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)
49
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
- style[name] = '';
51
- }
52
- }
53
- });
54
- // Add or update properties
55
- for (const name in styleInfo) {
56
- const value = styleInfo[name];
57
- if (value != null) {
58
- this._previousStyleProperties.add(name);
59
- if (name.includes('-')) {
60
- style.setProperty(name, value);
61
- }
62
- else {
63
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
64
- style[name] = value;
65
- }
66
- }
67
- }
68
- return noChange;
69
- }
14
+ constructor(partInfo) {
15
+ var _a;
16
+ super(partInfo);
17
+ if (partInfo.type !== PartType.ATTRIBUTE ||
18
+ partInfo.name !== 'style' ||
19
+ ((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {
20
+ throw new Error('The `styleMap` directive must be used in the `style` attribute ' +
21
+ 'and must be the only part in the attribute.');
22
+ }
23
+ }
24
+ render(styleInfo) {
25
+ return "";
26
+ }
27
+ update(part, [styleInfo]) {
28
+ const { style } = part.element;
29
+ if (this._previousStyleProperties === undefined) {
30
+ this._previousStyleProperties = new Set();
31
+ for (const name in styleInfo) {
32
+ this._previousStyleProperties.add(name);
33
+ }
34
+ // return this.render(styleInfo);
35
+ }
36
+ // Remove old properties that no longer exist in styleInfo
37
+ // We use forEach() instead of for-of so that re don't require down-level
38
+ // iteration.
39
+ this._previousStyleProperties.forEach((name) => {
40
+ // If the name isn't in styleInfo or it's null/undefined
41
+ if (styleInfo[name] == null) {
42
+ this._previousStyleProperties.delete(name);
43
+ if (name.includes('-')) {
44
+ style.removeProperty(name);
45
+ }
46
+ else {
47
+ // Note reset using empty string (vs null) as IE11 does not always
48
+ // reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ style[name] = '';
51
+ }
52
+ }
53
+ });
54
+ // Add or update properties
55
+ for (const name in styleInfo) {
56
+ const value = styleInfo[name];
57
+ if (value != null) {
58
+ this._previousStyleProperties.add(name);
59
+ if (name.includes('-')) {
60
+ style.setProperty(name, value);
61
+ }
62
+ else {
63
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
64
+ style[name] = value;
65
+ }
66
+ }
67
+ }
68
+ return noChange;
69
+ }
70
70
  }
71
-
72
71
  export const styleMap = directive(StyleMapDirective);
72
+ //# sourceMappingURL=style-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-map.js","sourceRoot":"","sources":["../../../src/renderer/directives/style-map.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,oBAAoB;AACpB;;;;GAIG;AAEH;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,MAAM,uBAAuB,CAAC;AACxE,MAAM,iBAAkB,SAAQ,SAAS;IACxC,YAAY,QAAQ;QACnB,IAAI,EAAE,CAAC;QACP,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,SAAS;YACvC,QAAQ,CAAC,IAAI,KAAK,OAAO;YACzB,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC9E,MAAM,IAAI,KAAK,CAAC,iEAAiE;gBAChF,6CAA6C,CAAC,CAAC;SAChD;IACF,CAAC;IACD,MAAM,CAAC,SAAS;QACf,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAC/B,IAAI,IAAI,CAAC,wBAAwB,KAAK,SAAS,EAAE;YAChD,IAAI,CAAC,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAC;YAC1C,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;gBAC7B,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;aACxC;YACD,iCAAiC;SACjC;QACD,0DAA0D;QAC1D,yEAAyE;QACzE,aAAa;QACb,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9C,wDAAwD;YACxD,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE;gBAC5B,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACvB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;iBAC3B;qBACI;oBACJ,kEAAkE;oBAClE,+GAA+G;oBAC/G,8DAA8D;oBAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;iBACjB;aACD;QACF,CAAC,CAAC,CAAC;QACH,2BAA2B;QAC3B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;YAC7B,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC9B,IAAI,KAAK,IAAI,IAAI,EAAE;gBAClB,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACxC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACvB,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;iBAC/B;qBACI;oBACJ,8DAA8D;oBAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;iBACpB;aACD;SACD;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["// @ts-nocheck\n/* eslint-disable */\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * This is the original style-map.js directive from lit-html 2 with the only difference that \"render\" is not called even for the first rendering (update is used instead)\n */\n\nimport { noChange } from 'lit-html';\nimport { directive, Directive, PartType, } from 'lit-html/directive.js';\nclass StyleMapDirective extends Directive {\n\tconstructor(partInfo) {\n\t\tvar _a;\n\t\tsuper(partInfo);\n\t\tif (partInfo.type !== PartType.ATTRIBUTE ||\n\t\t\tpartInfo.name !== 'style' ||\n\t\t\t((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {\n\t\t\tthrow new Error('The `styleMap` directive must be used in the `style` attribute ' +\n\t\t\t\t'and must be the only part in the attribute.');\n\t\t}\n\t}\n\trender(styleInfo) {\n\t\treturn \"\";\n\t}\n\tupdate(part, [styleInfo]) {\n\t\tconst { style } = part.element;\n\t\tif (this._previousStyleProperties === undefined) {\n\t\t\tthis._previousStyleProperties = new Set();\n\t\t\tfor (const name in styleInfo) {\n\t\t\t\tthis._previousStyleProperties.add(name);\n\t\t\t}\n\t\t\t// return this.render(styleInfo);\n\t\t}\n\t\t// Remove old properties that no longer exist in styleInfo\n\t\t// We use forEach() instead of for-of so that re don't require down-level\n\t\t// iteration.\n\t\tthis._previousStyleProperties.forEach((name) => {\n\t\t\t// If the name isn't in styleInfo or it's null/undefined\n\t\t\tif (styleInfo[name] == null) {\n\t\t\t\tthis._previousStyleProperties.delete(name);\n\t\t\t\tif (name.includes('-')) {\n\t\t\t\t\tstyle.removeProperty(name);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Note reset using empty string (vs null) as IE11 does not always\n\t\t\t\t\t// reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tstyle[name] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t// Add or update properties\n\t\tfor (const name in styleInfo) {\n\t\t\tconst value = styleInfo[name];\n\t\t\tif (value != null) {\n\t\t\t\tthis._previousStyleProperties.add(name);\n\t\t\t\tif (name.includes('-')) {\n\t\t\t\t\tstyle.setProperty(name, value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tstyle[name] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn noChange;\n\t}\n}\n\nexport const styleMap = directive(StyleMapDirective);\n"]}
@@ -9,5 +9,13 @@ type TemplateFunction = (component: UI5Element, tagsToScope: Array<string>, scop
9
9
  * @public
10
10
  */
11
11
  declare const executeTemplate: (template: TemplateFunction, component: UI5Element) => TemplateFunctionResult;
12
+ /**
13
+ * Returns all tags, used inside component's template subject to scoping.
14
+ * @param component - the component
15
+ * @returns {Array[]}
16
+ * @private
17
+ */
18
+ declare const getTagsToScope: (component: UI5Element) => string[];
12
19
  export default executeTemplate;
20
+ export { getTagsToScope };
13
21
  export type { TemplateFunction, TemplateFunctionResult };
@@ -27,4 +27,5 @@ const getTagsToScope = (component) => {
27
27
  return tagsToScope;
28
28
  };
29
29
  export default executeTemplate;
30
+ export { getTagsToScope };
30
31
  //# sourceMappingURL=executeTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"executeTemplate.js","sourceRoot":"","sources":["../../src/renderer/executeTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAM1G;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,CAAC,QAA0B,EAAE,SAAqB,EAA0B,EAAE;IACrG,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,8BAA8B,EAAE,CAAC;IAC/C,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,cAAc,GAAG,CAAC,SAAqB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,SAAS,CAAC,WAAgC,CAAC;IAExD,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC;IACrD,MAAM,WAAW,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC,GAAsB,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAElJ,IAAI,wBAAwB,CAAC,YAAY,CAAC,EAAE;QAC3C,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC/B;IAED,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from \"../CustomElementsScopeUtils.js\";\nimport type UI5Element from \"../UI5Element.js\";\n\ntype TemplateFunctionResult = object;\ntype TemplateFunction = (component: UI5Element, tagsToScope: Array<string>, scope: string | undefined) => TemplateFunctionResult;\n\n/**\n * Runs a component's template with the component's current state, while also scoping HTML\n *\n * @param template - the template to execute\n * @param component - the component\n * @public\n */\nconst executeTemplate = (template: TemplateFunction, component: UI5Element): TemplateFunctionResult => {\n\tconst tagsToScope = getTagsToScope(component);\n\tconst scope = getCustomElementsScopingSuffix();\n\treturn template.call(component, component, tagsToScope, scope);\n};\n\n/**\n * Returns all tags, used inside component's template subject to scoping.\n * @param component - the component\n * @returns {Array[]}\n * @private\n */\nconst getTagsToScope = (component: UI5Element) => {\n\tconst ctor = component.constructor as typeof UI5Element;\n\n\tconst componentTag = ctor.getMetadata().getPureTag();\n\tconst tagsToScope = ctor.getUniqueDependencies().map((dep: typeof UI5Element) => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);\n\n\tif (shouldScopeCustomElement(componentTag)) {\n\t\ttagsToScope.push(componentTag);\n\t}\n\n\treturn tagsToScope;\n};\n\nexport default executeTemplate;\nexport type { TemplateFunction, TemplateFunctionResult };\n"]}
1
+ {"version":3,"file":"executeTemplate.js","sourceRoot":"","sources":["../../src/renderer/executeTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAM1G;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,CAAC,QAA0B,EAAE,SAAqB,EAA0B,EAAE;IACrG,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,8BAA8B,EAAE,CAAC;IAC/C,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,cAAc,GAAG,CAAC,SAAqB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,SAAS,CAAC,WAAgC,CAAC;IAExD,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC;IACrD,MAAM,WAAW,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC,GAAsB,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAElJ,IAAI,wBAAwB,CAAC,YAAY,CAAC,EAAE;QAC3C,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC/B;IAED,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from \"../CustomElementsScopeUtils.js\";\nimport type UI5Element from \"../UI5Element.js\";\n\ntype TemplateFunctionResult = object;\ntype TemplateFunction = (component: UI5Element, tagsToScope: Array<string>, scope: string | undefined) => TemplateFunctionResult;\n\n/**\n * Runs a component's template with the component's current state, while also scoping HTML\n *\n * @param template - the template to execute\n * @param component - the component\n * @public\n */\nconst executeTemplate = (template: TemplateFunction, component: UI5Element): TemplateFunctionResult => {\n\tconst tagsToScope = getTagsToScope(component);\n\tconst scope = getCustomElementsScopingSuffix();\n\treturn template.call(component, component, tagsToScope, scope);\n};\n\n/**\n * Returns all tags, used inside component's template subject to scoping.\n * @param component - the component\n * @returns {Array[]}\n * @private\n */\nconst getTagsToScope = (component: UI5Element) => {\n\tconst ctor = component.constructor as typeof UI5Element;\n\n\tconst componentTag = ctor.getMetadata().getPureTag();\n\tconst tagsToScope = ctor.getUniqueDependencies().map((dep: typeof UI5Element) => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);\n\n\tif (shouldScopeCustomElement(componentTag)) {\n\t\ttagsToScope.push(componentTag);\n\t}\n\n\treturn tagsToScope;\n};\n\nexport default executeTemplate;\nexport { getTagsToScope };\nexport type { TemplateFunction, TemplateFunctionResult };\n"]}