@ui5/webcomponents-base 0.0.0-b132dd7b9 → 0.0.0-b3a4f8020

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 (349) hide show
  1. package/AGENTS.md +195 -0
  2. package/CHANGELOG.md +563 -0
  3. package/CLAUDE.md +1 -0
  4. package/LICENSE.txt +201 -0
  5. package/README.md +7 -7
  6. package/dist/.tsbuildinfobuild +1 -1
  7. package/dist/Assets-fetch.d.ts +1 -0
  8. package/dist/Assets-fetch.js +3 -0
  9. package/dist/Assets-fetch.js.map +1 -0
  10. package/dist/Assets-node.d.ts +12 -0
  11. package/dist/Assets-node.js +14 -0
  12. package/dist/Assets-node.js.map +1 -0
  13. package/dist/Assets.d.ts +1 -0
  14. package/dist/Assets.js +3 -0
  15. package/dist/Assets.js.map +1 -0
  16. package/dist/Boot.d.ts +2 -1
  17. package/dist/Boot.js +44 -14
  18. package/dist/Boot.js.map +1 -1
  19. package/dist/CustomElementsRegistry.js +1 -1
  20. package/dist/CustomElementsRegistry.js.map +1 -1
  21. package/dist/CustomElementsScopeUtils.d.ts +10 -3
  22. package/dist/CustomElementsScopeUtils.js +13 -3
  23. package/dist/CustomElementsScopeUtils.js.map +1 -1
  24. package/dist/DragAndDrop.d.ts +2 -0
  25. package/dist/DragAndDrop.js +5 -0
  26. package/dist/DragAndDrop.js.map +1 -0
  27. package/dist/FontFace.css +36 -0
  28. package/dist/FontFace.js +0 -8
  29. package/dist/FontFace.js.map +1 -1
  30. package/dist/InitialConfiguration.js +7 -0
  31. package/dist/InitialConfiguration.js.map +1 -1
  32. package/dist/Keys.d.ts +4 -1
  33. package/dist/Keys.js +4 -1
  34. package/dist/Keys.js.map +1 -1
  35. package/dist/ManagedStyles.js +1 -1
  36. package/dist/ManagedStyles.js.map +1 -1
  37. package/dist/ScrollbarStyles.d.ts +2 -0
  38. package/dist/ScrollbarStyles.js +9 -0
  39. package/dist/ScrollbarStyles.js.map +1 -0
  40. package/dist/SystemCSSVars.js +2 -4
  41. package/dist/SystemCSSVars.js.map +1 -1
  42. package/dist/UI5Element.d.ts +35 -9
  43. package/dist/UI5Element.js +59 -27
  44. package/dist/UI5Element.js.map +1 -1
  45. package/dist/UI5ElementMetadata.d.ts +1 -1
  46. package/dist/UI5ElementMetadata.js.map +1 -1
  47. package/dist/asset-registries/Icons.d.ts +42 -8
  48. package/dist/asset-registries/Icons.js +51 -8
  49. package/dist/asset-registries/Icons.js.map +1 -1
  50. package/dist/asset-registries/Illustrations.d.ts +133 -8
  51. package/dist/asset-registries/Illustrations.js +82 -1
  52. package/dist/asset-registries/Illustrations.js.map +1 -1
  53. package/dist/asset-registries/LocaleData.js +2 -1
  54. package/dist/asset-registries/LocaleData.js.map +1 -1
  55. package/dist/asset-registries/Themes.d.ts +5 -2
  56. package/dist/asset-registries/Themes.js +3 -3
  57. package/dist/asset-registries/Themes.js.map +1 -1
  58. package/dist/config/Language.d.ts +2 -1
  59. package/dist/config/Language.js +12 -1
  60. package/dist/config/Language.js.map +1 -1
  61. package/dist/config/Theme.d.ts +13 -1
  62. package/dist/config/Theme.js +18 -1
  63. package/dist/config/Theme.js.map +1 -1
  64. package/dist/config/ThemeRoot.d.ts +3 -1
  65. package/dist/config/ThemeRoot.js +3 -1
  66. package/dist/config/ThemeRoot.js.map +1 -1
  67. package/dist/css/MultipleDragGhost.css +17 -0
  68. package/dist/css/OpenUI5PopupStyles.css +10 -0
  69. package/dist/css/ScrollbarStyles.css +3 -0
  70. package/dist/css/SystemCSSVars.css +28 -3
  71. package/dist/custom-elements-internal.json +1855 -1738
  72. package/dist/custom-elements.json +1462 -1345
  73. package/dist/decorators/slot-strict.d.ts +27 -0
  74. package/dist/decorators/slot-strict.js +54 -0
  75. package/dist/decorators/slot-strict.js.map +1 -0
  76. package/dist/decorators/slot.d.ts +18 -0
  77. package/dist/decorators/slot.js +18 -0
  78. package/dist/decorators/slot.js.map +1 -1
  79. package/dist/decorators.d.ts +2 -1
  80. package/dist/decorators.js +2 -1
  81. package/dist/decorators.js.map +1 -1
  82. package/dist/features/F6Navigation.d.ts +1 -0
  83. package/dist/features/F6Navigation.js +23 -14
  84. package/dist/features/F6Navigation.js.map +1 -1
  85. package/dist/features/InputElementsFormSupport.d.ts +1 -1
  86. package/dist/features/InputElementsFormSupport.js +6 -2
  87. package/dist/features/InputElementsFormSupport.js.map +1 -1
  88. package/dist/features/OpenUI5Support.d.ts +15 -4
  89. package/dist/features/OpenUI5Support.js +83 -42
  90. package/dist/features/OpenUI5Support.js.map +1 -1
  91. package/dist/features/insertOpenUI5PopupStyles.d.ts +2 -0
  92. package/dist/features/insertOpenUI5PopupStyles.js +9 -0
  93. package/dist/features/insertOpenUI5PopupStyles.js.map +1 -0
  94. package/dist/features/patchPatcher.d.ts +7 -6
  95. package/dist/features/patchPatcher.js +14 -4
  96. package/dist/features/patchPatcher.js.map +1 -1
  97. package/dist/features/patchPopup.d.ts +26 -8
  98. package/dist/features/patchPopup.js +118 -25
  99. package/dist/features/patchPopup.js.map +1 -1
  100. package/dist/generated/VersionInfo.js +6 -6
  101. package/dist/generated/VersionInfo.js.map +1 -1
  102. package/dist/generated/assets/i18n/messagebundle_en.json +1 -0
  103. package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
  104. package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
  105. package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
  106. package/dist/generated/css/FontFace.css.d.ts +1 -1
  107. package/dist/generated/css/FontFace.css.js +36 -1
  108. package/dist/generated/css/FontFace.css.js.map +1 -1
  109. package/dist/generated/css/MultipleDragGhost.css.d.ts +2 -0
  110. package/dist/generated/css/MultipleDragGhost.css.js +2 -0
  111. package/dist/generated/css/MultipleDragGhost.css.js.map +1 -0
  112. package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +2 -0
  113. package/dist/generated/css/OpenUI5PopupStyles.css.js +2 -0
  114. package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -0
  115. package/dist/generated/css/ScrollbarStyles.css.d.ts +2 -0
  116. package/dist/generated/css/ScrollbarStyles.css.js +2 -0
  117. package/dist/generated/css/ScrollbarStyles.css.js.map +1 -0
  118. package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
  119. package/dist/generated/css/SystemCSSVars.css.js +1 -1
  120. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  121. package/dist/generated/i18n/i18n-defaults.d.ts +3 -0
  122. package/dist/generated/i18n/i18n-defaults.js +3 -0
  123. package/dist/generated/i18n/i18n-defaults.js.map +1 -0
  124. package/dist/generated/json-imports/i18n-fetch.d.ts +1 -0
  125. package/dist/generated/json-imports/i18n-fetch.js +2 -0
  126. package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
  127. package/dist/generated/json-imports/i18n-node.d.ts +1 -0
  128. package/dist/generated/json-imports/i18n-node.js +2 -0
  129. package/dist/generated/json-imports/i18n-node.js.map +1 -0
  130. package/dist/generated/json-imports/i18n.d.ts +1 -0
  131. package/dist/generated/json-imports/i18n.js +2 -0
  132. package/dist/generated/json-imports/i18n.js.map +1 -0
  133. package/dist/index.d.ts +3 -1
  134. package/dist/index.js +5 -1
  135. package/dist/index.js.map +1 -1
  136. package/dist/jsx-runtime.d.ts +1 -0
  137. package/dist/jsx-runtime.js.map +1 -1
  138. package/dist/prod/Assets-fetch.js +2 -0
  139. package/dist/prod/Assets-fetch.js.map +7 -0
  140. package/dist/prod/Assets-node.js +2 -0
  141. package/dist/prod/Assets-node.js.map +7 -0
  142. package/dist/prod/Assets.js +2 -0
  143. package/dist/prod/Assets.js.map +7 -0
  144. package/dist/prod/Boot.js +1 -1
  145. package/dist/prod/Boot.js.map +3 -3
  146. package/dist/prod/CustomElementsRegistry.js +5 -5
  147. package/dist/prod/CustomElementsRegistry.js.map +2 -2
  148. package/dist/prod/CustomElementsScopeUtils.js +1 -1
  149. package/dist/prod/CustomElementsScopeUtils.js.map +3 -3
  150. package/dist/prod/DragAndDrop.js +2 -0
  151. package/dist/prod/DragAndDrop.js.map +7 -0
  152. package/dist/prod/FontFace.js +1 -1
  153. package/dist/prod/FontFace.js.map +3 -3
  154. package/dist/prod/InitialConfiguration.js +1 -1
  155. package/dist/prod/InitialConfiguration.js.map +2 -2
  156. package/dist/prod/Keys.js +1 -1
  157. package/dist/prod/Keys.js.map +3 -3
  158. package/dist/prod/ManagedStyles.js +1 -1
  159. package/dist/prod/ManagedStyles.js.map +2 -2
  160. package/dist/prod/ScrollbarStyles.js +2 -0
  161. package/dist/prod/ScrollbarStyles.js.map +7 -0
  162. package/dist/prod/SystemCSSVars.js +1 -1
  163. package/dist/prod/SystemCSSVars.js.map +3 -3
  164. package/dist/prod/UI5Element.js +1 -1
  165. package/dist/prod/UI5Element.js.map +3 -3
  166. package/dist/prod/UI5ElementMetadata.js +1 -1
  167. package/dist/prod/UI5ElementMetadata.js.map +1 -1
  168. package/dist/prod/asset-registries/Icons.js +1 -1
  169. package/dist/prod/asset-registries/Icons.js.map +3 -3
  170. package/dist/prod/asset-registries/Illustrations.js +1 -1
  171. package/dist/prod/asset-registries/Illustrations.js.map +3 -3
  172. package/dist/prod/asset-registries/LocaleData.js +1 -1
  173. package/dist/prod/asset-registries/LocaleData.js.map +2 -2
  174. package/dist/prod/asset-registries/Themes.js +1 -1
  175. package/dist/prod/asset-registries/Themes.js.map +3 -3
  176. package/dist/prod/config/Language.js +1 -1
  177. package/dist/prod/config/Language.js.map +3 -3
  178. package/dist/prod/config/Theme.js +1 -1
  179. package/dist/prod/config/Theme.js.map +3 -3
  180. package/dist/prod/config/ThemeRoot.js.map +2 -2
  181. package/dist/prod/decorators/slot-strict.js +2 -0
  182. package/dist/prod/decorators/slot-strict.js.map +7 -0
  183. package/dist/prod/decorators/slot.js.map +2 -2
  184. package/dist/prod/decorators.js +1 -1
  185. package/dist/prod/decorators.js.map +3 -3
  186. package/dist/prod/features/F6Navigation.js +1 -1
  187. package/dist/prod/features/F6Navigation.js.map +3 -3
  188. package/dist/prod/features/InputElementsFormSupport.js +1 -1
  189. package/dist/prod/features/InputElementsFormSupport.js.map +3 -3
  190. package/dist/prod/features/OpenUI5Support.js +1 -1
  191. package/dist/prod/features/OpenUI5Support.js.map +3 -3
  192. package/dist/prod/features/insertOpenUI5PopupStyles.js +2 -0
  193. package/dist/prod/features/insertOpenUI5PopupStyles.js.map +7 -0
  194. package/dist/prod/features/patchPatcher.js +1 -1
  195. package/dist/prod/features/patchPatcher.js.map +3 -3
  196. package/dist/prod/features/patchPopup.js +1 -1
  197. package/dist/prod/features/patchPopup.js.map +3 -3
  198. package/dist/prod/generated/VersionInfo.js +1 -1
  199. package/dist/prod/generated/VersionInfo.js.map +2 -2
  200. package/dist/prod/generated/assets/i18n/messagebundle_en.json +1 -0
  201. package/dist/prod/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
  202. package/dist/prod/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
  203. package/dist/prod/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
  204. package/dist/prod/generated/css/FontFace.css.js +36 -1
  205. package/dist/prod/generated/css/FontFace.css.js.map +2 -2
  206. package/dist/prod/generated/css/MultipleDragGhost.css.js +2 -0
  207. package/dist/prod/generated/css/MultipleDragGhost.css.js.map +7 -0
  208. package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +2 -0
  209. package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +7 -0
  210. package/dist/prod/generated/css/ScrollbarStyles.css.js +2 -0
  211. package/dist/prod/generated/css/ScrollbarStyles.css.js.map +7 -0
  212. package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
  213. package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
  214. package/dist/prod/generated/i18n/i18n-defaults.js +2 -0
  215. package/dist/prod/generated/i18n/i18n-defaults.js.map +7 -0
  216. package/dist/prod/generated/json-imports/i18n-fetch.js +2 -0
  217. package/dist/prod/generated/json-imports/i18n-fetch.js.map +7 -0
  218. package/dist/prod/generated/json-imports/i18n-node.js +2 -0
  219. package/dist/prod/generated/json-imports/i18n-node.js.map +7 -0
  220. package/dist/prod/generated/json-imports/i18n.js +2 -0
  221. package/dist/prod/generated/json-imports/i18n.js.map +7 -0
  222. package/dist/prod/index.js +1 -1
  223. package/dist/prod/index.js.map +3 -3
  224. package/dist/prod/jsx-runtime.js.map +2 -2
  225. package/dist/prod/ssr-dom-shim.js +1 -1
  226. package/dist/prod/ssr-dom-shim.js.map +2 -2
  227. package/dist/prod/theming/applyTheme.js +1 -1
  228. package/dist/prod/theming/applyTheme.js.map +3 -3
  229. package/dist/prod/theming/componentStyles.js +3 -0
  230. package/dist/prod/theming/componentStyles.js.map +7 -0
  231. package/dist/prod/thirdparty/preact/preact.module.js +1 -1
  232. package/dist/prod/updateShadowRoot.js +1 -1
  233. package/dist/prod/updateShadowRoot.js.map +3 -3
  234. package/dist/prod/util/FocusableElements.js +1 -1
  235. package/dist/prod/util/FocusableElements.js.map +2 -2
  236. package/dist/prod/util/SelectionAssistant.js +1 -1
  237. package/dist/prod/util/SelectionAssistant.js.map +3 -3
  238. package/dist/prod/util/TabbableElements.js +1 -1
  239. package/dist/prod/util/TabbableElements.js.map +2 -2
  240. package/dist/prod/util/createInstanceChecker.js +2 -0
  241. package/dist/prod/util/createInstanceChecker.js.map +7 -0
  242. package/dist/prod/util/createMultiInstanceChecker.js +2 -0
  243. package/dist/prod/util/createMultiInstanceChecker.js.map +7 -0
  244. package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
  245. package/dist/prod/util/dragAndDrop/DragRegistry.js.map +3 -3
  246. package/dist/prod/util/getParentElement.js +2 -0
  247. package/dist/prod/util/getParentElement.js.map +7 -0
  248. package/dist/prod/util/isElementHidden.js +1 -1
  249. package/dist/prod/util/isElementHidden.js.map +3 -3
  250. package/dist/prod/util/isEventMarked.js +2 -0
  251. package/dist/prod/util/isEventMarked.js.map +7 -0
  252. package/dist/prod/util/valueStateNavigation.js +2 -0
  253. package/dist/prod/util/valueStateNavigation.js.map +7 -0
  254. package/dist/prod/validateThemeRoot.js +1 -1
  255. package/dist/prod/validateThemeRoot.js.map +2 -2
  256. package/dist/ssr-dom-shim.js +2 -1
  257. package/dist/ssr-dom-shim.js.map +1 -1
  258. package/dist/theming/applyTheme.d.ts +2 -0
  259. package/dist/theming/applyTheme.js +20 -5
  260. package/dist/theming/applyTheme.js.map +1 -1
  261. package/dist/theming/componentStyles.d.ts +3 -0
  262. package/dist/theming/componentStyles.js +15 -0
  263. package/dist/theming/componentStyles.js.map +1 -0
  264. package/dist/thirdparty/preact/preact.module.js +1 -1
  265. package/dist/types.d.ts +11 -3
  266. package/dist/types.js.map +1 -1
  267. package/dist/updateShadowRoot.js +2 -1
  268. package/dist/updateShadowRoot.js.map +1 -1
  269. package/dist/util/FocusableElements.js +3 -3
  270. package/dist/util/FocusableElements.js.map +1 -1
  271. package/dist/util/SelectionAssistant.js +0 -8
  272. package/dist/util/SelectionAssistant.js.map +1 -1
  273. package/dist/util/TabbableElements.js +2 -2
  274. package/dist/util/TabbableElements.js.map +1 -1
  275. package/dist/util/createInstanceChecker.d.ts +2 -0
  276. package/dist/util/createInstanceChecker.js +8 -0
  277. package/dist/util/createInstanceChecker.js.map +1 -0
  278. package/dist/util/createMultiInstanceChecker.d.ts +2 -0
  279. package/dist/util/createMultiInstanceChecker.js +19 -0
  280. package/dist/util/createMultiInstanceChecker.js.map +1 -0
  281. package/dist/util/dragAndDrop/DragRegistry.d.ts +14 -8
  282. package/dist/util/dragAndDrop/DragRegistry.js +46 -50
  283. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
  284. package/dist/util/getClassCopy.d.ts +4 -3
  285. package/dist/util/getParentElement.d.ts +2 -0
  286. package/dist/util/getParentElement.js +5 -0
  287. package/dist/util/getParentElement.js.map +1 -0
  288. package/dist/util/isElementHidden.js +2 -1
  289. package/dist/util/isElementHidden.js.map +1 -1
  290. package/dist/util/isEventMarked.d.ts +2 -0
  291. package/dist/util/isEventMarked.js +6 -0
  292. package/dist/util/isEventMarked.js.map +1 -0
  293. package/dist/util/valueStateNavigation.d.ts +8 -0
  294. package/dist/util/valueStateNavigation.js +40 -0
  295. package/dist/util/valueStateNavigation.js.map +1 -0
  296. package/dist/validateThemeRoot.js +6 -2
  297. package/dist/validateThemeRoot.js.map +1 -1
  298. package/package-scripts.cjs +64 -33
  299. package/package.json +27 -22
  300. package/src/css/MultipleDragGhost.css +17 -0
  301. package/src/css/OpenUI5PopupStyles.css +10 -0
  302. package/src/css/ScrollbarStyles.css +3 -0
  303. package/src/css/SystemCSSVars.css +28 -3
  304. package/src/i18n/messagebundle.properties +5 -0
  305. package/src/i18n/messagebundle_en.properties +2 -0
  306. package/src/i18n/messagebundle_en_US_sappsd.properties +2 -0
  307. package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
  308. package/src/i18n/messagebundle_en_US_saptrc.properties +2 -0
  309. package/src/thirdparty/preact/preact.module.js +1 -1
  310. package/cypress/specs/Accessor.cy.tsx +0 -79
  311. package/cypress/specs/Boot.cy.tsx +0 -19
  312. package/cypress/specs/ConfigurationChange.cy.tsx +0 -41
  313. package/cypress/specs/ConfigurationScript.cy.tsx +0 -133
  314. package/cypress/specs/ConfigurationURL.cy.tsx +0 -201
  315. package/cypress/specs/CustomMount.cy.tsx +0 -9
  316. package/cypress/specs/CustomTheme.cy.tsx +0 -36
  317. package/cypress/specs/EventProvider.cy.tsx +0 -59
  318. package/cypress/specs/Events.cy.tsx +0 -28
  319. package/cypress/specs/SystemDOMElements.cy.tsx +0 -8
  320. package/cypress/specs/Theming.cy.tsx +0 -74
  321. package/cypress/specs/UI5ElementInvalidation.cy.tsx +0 -252
  322. package/cypress/specs/UI5ElementLifecycle.cy.tsx +0 -82
  323. package/cypress/specs/UI5ElementListenForChildPropChanges.cy.tsx +0 -83
  324. package/cypress/specs/UI5ElementMetadataExt.cy.tsx +0 -42
  325. package/cypress/specs/UI5ElementPropertyValidation.cy.tsx +0 -16
  326. package/cypress/specs/UI5ElementPropsAndAttrs.cy.tsx +0 -113
  327. package/cypress/specs/UI5ElementShadowDOM.cy.tsx +0 -30
  328. package/cypress/specs/UI5ElementSlots.cy.tsx +0 -136
  329. package/cypress/specs/WithComplexTemplate.cy.tsx +0 -32
  330. package/cypress/specs/i18n_texts.cy.tsx +0 -129
  331. package/cypress/specs/util/FocusableElements.cy.tsx +0 -48
  332. package/cypress/support/commands.ts +0 -39
  333. package/cypress/support/component-index.html +0 -12
  334. package/cypress/support/component.ts +0 -17
  335. package/cypress/tsconfig.json +0 -21
  336. package/dist/css/FontFace.css +0 -96
  337. package/dist/css/OverrideFontFace.css +0 -32
  338. package/dist/generated/css/OverrideFontFace.css.d.ts +0 -2
  339. package/dist/generated/css/OverrideFontFace.css.js +0 -2
  340. package/dist/generated/css/OverrideFontFace.css.js.map +0 -1
  341. package/dist/prod/generated/css/OverrideFontFace.css.js +0 -2
  342. package/dist/prod/generated/css/OverrideFontFace.css.js.map +0 -7
  343. package/dist/prod/util/getEffectiveScrollbarStyle.js +0 -28
  344. package/dist/prod/util/getEffectiveScrollbarStyle.js.map +0 -7
  345. package/dist/util/getEffectiveScrollbarStyle.d.ts +0 -2
  346. package/dist/util/getEffectiveScrollbarStyle.js +0 -36
  347. package/dist/util/getEffectiveScrollbarStyle.js.map +0 -1
  348. package/src/css/FontFace.css +0 -96
  349. package/src/css/OverrideFontFace.css +0 -32
@@ -1 +1 @@
1
- {"version":3,"file":"applyTheme.js","sourceRoot":"","sources":["../../src/theming/applyTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE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,wGAAwG;IACxG,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAAC;IAC5F,MAAM,qBAAqB,CAAC,aAAa,IAAI,aAAa,EAAE,QAAQ,IAAI,QAAQ,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE1H,eAAe,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\n\nconst BASE_THEME_PACKAGE = \"@ui5/webcomponents-theming\";\n\nconst isThemeBaseRegistered = () => {\n\tconst registeredPackages = getRegisteredPackages();\n\treturn registeredPackages.has(BASE_THEME_PACKAGE);\n};\n\nconst loadThemeBase = async (theme: string) => {\n\tif (!isThemeBaseRegistered()) {\n\t\treturn;\n\t}\n\n\tconst cssData = await getThemeProperties(BASE_THEME_PACKAGE, theme);\n\tif (cssData) {\n\t\tcreateOrUpdateStyle(cssData, \"data-ui5-theme-properties\", BASE_THEME_PACKAGE, theme);\n\t}\n};\n\nconst deleteThemeBase = () => {\n\tremoveStyle(\"data-ui5-theme-properties\", BASE_THEME_PACKAGE);\n};\n\nconst loadComponentPackages = async (theme: string, externalThemeName?: string) => {\n\tconst registeredPackages = getRegisteredPackages();\n\n\tconst packagesStylesPromises = [...registeredPackages].map(async packageName => {\n\t\tif (packageName === BASE_THEME_PACKAGE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cssData = await getThemeProperties(packageName, theme, externalThemeName);\n\t\tif (cssData) {\n\t\t\tcreateOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);\n\t\t}\n\t});\n\n\treturn Promise.all(packagesStylesPromises);\n};\n\nconst detectExternalTheme = async (theme: string) => {\n\t// If theme designer theme is detected, use this\n\tconst extTheme = getThemeDesignerTheme();\n\tif (extTheme) {\n\t\treturn extTheme;\n\t}\n\n\t// If OpenUI5Support is enabled, try to find out if it loaded variables\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support && openUI5Support.isOpenUI5Detected()) {\n\t\tconst varsLoaded = openUI5Support.cssVariablesLoaded();\n\t\tif (varsLoaded) {\n\t\t\treturn {\n\t\t\t\tthemeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName\n\t\t\t\tbaseThemeName: \"\", // baseThemeName is only relevant for custom themes\n\t\t\t};\n\t\t}\n\t} else if (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\n\t\treturn getThemeDesignerTheme();\n\t}\n};\n\nconst applyTheme = async (theme: string) => {\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded\n\tif (!extTheme || theme !== extTheme.themeName) {\n\t\tawait loadThemeBase(theme);\n\t} else {\n\t\tdeleteThemeBase();\n\t}\n\n\t// Always load component packages properties. For non-registered themes, try with the base theme, if any\n\tconst packagesTheme = isThemeRegistered(theme) ? theme : extTheme && extTheme.baseThemeName;\n\tawait loadComponentPackages(packagesTheme || DEFAULT_THEME, extTheme && extTheme.themeName === theme ? theme : undefined);\n\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"]}
1
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B,CAAC,CAAC;IAEnE,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5B,eAAe,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport { setBaseTheme } from \"../config/Theme.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\nimport { updateComponentStyles } from \"./componentStyles.js\";\n\n// eslint-disable-next-line\nexport let _lib = \"ui5\";\n// eslint-disable-next-line\nexport let _package = \"webcomponents-theming\";\n// eslint-disable-next-line\nconst BASE_THEME_PACKAGE = \"@\" + _lib + \"/\" + _package;\n\nconst isThemeBaseRegistered = () => {\n\tconst registeredPackages = getRegisteredPackages();\n\treturn registeredPackages.has(BASE_THEME_PACKAGE);\n};\n\nconst loadThemeBase = async (theme: string) => {\n\tif (!isThemeBaseRegistered()) {\n\t\treturn;\n\t}\n\n\tconst cssData = await getThemeProperties(BASE_THEME_PACKAGE, theme);\n\tif (cssData) {\n\t\tcreateOrUpdateStyle(cssData, \"data-ui5-theme-properties\", BASE_THEME_PACKAGE, theme);\n\t}\n};\n\nconst deleteThemeBase = () => {\n\tremoveStyle(\"data-ui5-theme-properties\", BASE_THEME_PACKAGE);\n};\n\nconst loadComponentPackages = async (theme: string, externalThemeName?: string) => {\n\tconst registeredPackages = getRegisteredPackages();\n\n\tconst packagesStylesPromises = [...registeredPackages.entries()].map(async ([packageName, { cssVariablesTarget }]) => {\n\t\tif (packageName === BASE_THEME_PACKAGE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cssData = await getThemeProperties(packageName, theme, externalThemeName);\n\t\tif (cssData) {\n\t\t\tif (cssVariablesTarget === \"root\") {\n\t\t\t\tcreateOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);\n\t\t\t} else if (cssVariablesTarget === \"host\") {\n\t\t\t\tupdateComponentStyles(packageName, cssData);\n\t\t\t}\n\t\t}\n\t});\n\n\treturn Promise.all(packagesStylesPromises);\n};\n\nconst detectExternalTheme = async (theme: string) => {\n\t// If theme designer theme is detected, use this\n\tconst extTheme = getThemeDesignerTheme();\n\tif (extTheme) {\n\t\treturn extTheme;\n\t}\n\n\t// If OpenUI5Support is enabled, try to find out if it loaded variables\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support && openUI5Support.isOpenUI5Detected()) {\n\t\tconst varsLoaded = openUI5Support.cssVariablesLoaded();\n\t\tif (varsLoaded) {\n\t\t\treturn {\n\t\t\t\tthemeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName\n\t\t\t\tbaseThemeName: \"\", // baseThemeName is only relevant for custom themes\n\t\t\t};\n\t\t}\n\t} else if (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\n\t\treturn getThemeDesignerTheme();\n\t}\n};\n\nconst applyTheme = async (theme: string) => {\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded\n\tif (!extTheme || theme !== extTheme.themeName) {\n\t\tawait loadThemeBase(theme);\n\t} else {\n\t\tdeleteThemeBase();\n\t}\n\n\t// Always load component packages properties. For non-registered themes, try with the base theme, if any\n\tconst externalThemeName = extTheme && extTheme.themeName === theme ? theme : undefined;\n\tconst baseThemeName = extTheme && extTheme.baseThemeName;\n\tconst effectiveThemeName = isThemeRegistered(theme) ? theme : (baseThemeName || DEFAULT_THEME);\n\n\tawait loadComponentPackages(effectiveThemeName, externalThemeName);\n\n\tsetBaseTheme(baseThemeName);\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"]}
@@ -0,0 +1,3 @@
1
+ declare const getComponentStyles: () => CSSStyleSheet;
2
+ declare const updateComponentStyles: (packageName: string, content: string) => void;
3
+ export { getComponentStyles, updateComponentStyles, };
@@ -0,0 +1,15 @@
1
+ const packageMap = new Map();
2
+ let componentsStyleSheet;
3
+ const getComponentStyles = () => {
4
+ if (!componentsStyleSheet) {
5
+ componentsStyleSheet = new CSSStyleSheet();
6
+ }
7
+ return componentsStyleSheet;
8
+ };
9
+ const updateComponentStyles = (packageName, content) => {
10
+ packageMap.set(packageName, content);
11
+ const combinedStyles = Array.from(packageMap.values()).join("\n");
12
+ getComponentStyles().replaceSync(combinedStyles);
13
+ };
14
+ export { getComponentStyles, updateComponentStyles, };
15
+ //# sourceMappingURL=componentStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentStyles.js","sourceRoot":"","sources":["../../src/theming/componentStyles.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC7C,IAAI,oBAAmC,CAAC;AAExC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC/B,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC3B,oBAAoB,GAAG,IAAI,aAAa,EAAE,CAAC;IAC5C,CAAC;IAED,OAAO,oBAAoB,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,WAAmB,EAAE,OAAe,EAAE,EAAE;IACtE,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAErC,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE,kBAAkB,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,OAAO,EACN,kBAAkB,EAClB,qBAAqB,GACrB,CAAC","sourcesContent":["const packageMap = new Map<string, string>();\nlet componentsStyleSheet: CSSStyleSheet;\n\nconst getComponentStyles = () => {\n\tif (!componentsStyleSheet) {\n\t\tcomponentsStyleSheet = new CSSStyleSheet();\n\t}\n\n\treturn componentsStyleSheet;\n};\n\nconst updateComponentStyles = (packageName: string, content: string) => {\n\tpackageMap.set(packageName, content);\n\n\tconst combinedStyles = Array.from(packageMap.values()).join(\"\\n\");\n\tgetComponentStyles().replaceSync(combinedStyles);\n};\n\nexport {\n\tgetComponentStyles,\n\tupdateComponentStyles,\n};\n"]}
@@ -1 +1 @@
1
- var n,l,t,u,i,o,r,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var t in l)n[t]=l[t];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,t,u){var i,o,r,e={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:e[r]=t[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m(l,e,i,o,null)}function m(n,u,i,o,r){var e={type:n,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?C(n):null}function S(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,t,u,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(t=i.length,o=void 0,f=(r=(u=n).__v).__e,c=[],s=[],u.__P&&((o=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),F(u.__P,o,r,u.__n,u.__P.namespaceURI,32&r.__u?[f]:null,c,null==f?C(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,z(c,o,s),o.__e!=f&&S(o)),i.length>t&&i.sort(e));P.__r=0}function $(n,l,t,u,i,o,r,e,f,c,s){var a,h,y,d,w,_,g=u&&u.__k||v,m=l.length;for(f=I(t,l,g,f),a=0;a<m;a++)null!=(y=t.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=F(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=H(y,f,n):"function"==typeof y.type&&void 0!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return t.__e=w,f}function I(n,l,t,u){var i,o,r,e,f,c=l.length,s=t.length,a=s,h=0;for(n.__k=[],i=0;i<c;i++)null!=(o=l[i])&&"boolean"!=typeof o&&"function"!=typeof o?(e=i+h,(o=n.__k[i]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,r=null,-1!==(f=o.__i=O(o,t,e,a))&&(a--,(r=t[f])&&(r.__u|=2)),null==r||null===r.__v?(-1==f&&h--,"function"!=typeof o.type&&(o.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,o.__u|=4))):o=n.__k[i]=null;if(a)for(i=0;i<s;i++)null!=(r=t[i])&&0==(2&r.__u)&&(r.__e==u&&(u=C(r)),q(r,r));return u}function H(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=H(u[i],l,t));return l}n.__e!=l&&(l&&n.type&&!t.contains(l)&&(l=C(n)),t.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function L(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){L(n,l)}):l.push(n)),l}function O(n,l,t,u){var i=n.key,o=n.type,r=t-1,e=t+1,f=l[t];if(null===f||f&&i==f.key&&o===f.type&&0==(2&f.__u))return t;if(("function"!=typeof o||o===k||i)&&u>(null!=f&&0==(2&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(2&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(2&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,t){"-"===l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||y.test(l)?t:t+"px"}function j(n,l,t,u,i){var o,r;n:if("style"===l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||T(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||T(n.style,l,t[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,o?a:s,o)):n.removeEventListener(l,o?a:s,o);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{r=n.tagName&&n.tagName.includes("-"),t!==u&&(n[l]=null!=t||r?t:"");break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function A(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u<u.t)return;return u(l.event?l.event(t):t)}}}function F(n,t,u,i,o,r,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,H,L,O,T,j=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),r=[f=t.__e=u.__e]),(a=l.__b)&&a(t);n:if("function"==typeof j)try{if(b=t.props,C="prototype"in j&&j.prototype.render,S=(a=j.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,u.__c?m=(h=t.__c=u.__c).__=h.__E:(C?t.__c=h=new j(b,M):(t.__c=h=new x(b,M),h.constructor=j,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=t,p)C&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||t.__v===u.__v)){for(t.__v!==u.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.some(function(n){n&&(n.__=t)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,H=0,C){for(h.state=h.__s,h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do{h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(O=null!=a&&a.type===k&&null==a.key?a.props.children:a)?O:[O],t,u,i,o,r,e,f,c,s),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(t.__v=null,c||null!=r)if(n.then){for(t.__u|=c?160:128;f&&8===f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,t.__e=f}else for(T=r.length;T--;)_(r[T]);else t.__e=u.__e,t.__k=u.__k;l.__e(n,t,u)}else null==r&&t.__v===u.__v?(t.__k=u.__k,t.__e=u.__e):f=t.__e=N(u.__e,t,u,i,o,r,e,c,s);return(a=l.diffed)&&a(t),128&t.__u?void 0:f}function z(n,t,u){for(var i=0;i<u.length;i++)V(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function N(t,u,i,o,r,e,f,c,s){var a,h,v,y,w,g,m,b,k=i.props,x=u.props,S=u.type;if("svg"===S?r="http://www.w3.org/2000/svg":"math"===S?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!S&&(S?w.localName===S:3===w.nodeType)){t=w,e[a]=null;break}if(null==t){if(null===S)return document.createTextNode(x);t=document.createElementNS(r,S,x.is&&x),c&&(l.__m&&l.__m(u,e),c=!1),e=null}if(null===S)k===x||c&&t.data===x||(t.data=x);else{if(e=e&&n.call(t.childNodes),k=i.props||p,!c&&null!=e)for(k={},a=0;a<t.attributes.length;a++)k[(w=t.attributes[a]).name]=w.value;for(a in k)if(w=k[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;j(t,a,null,w,r)}for(a in x)w=x[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||k[a]===w||((a.startsWith("on")||"ref"===a&&"function"==typeof w)&&(b=o[Object.keys(o)[0]])&&(w=w.bind(b.props.value)),j(t,a,w,k[a],r));if(h)c||v&&(h.__html===v.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),u.__k=[];else if(v&&(t.innerHTML=""),$(t,d(y)?y:[y],u,i,o,"foreignObject"===S?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"===S&&null==g?t.removeAttribute("value"):void 0!==g&&(g!==t[a]||"progress"===S&&!g||"option"===S&&g!==k[a])&&j(t,a,g,k[a],r),a="checked",void 0!==m&&m!==t[a]&&j(t,a,m,k[a],r))}return t}function V(n,t,u){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==t||(n.__u=n(t))}else n.current=t}catch(n){l.__e(n,u)}}function q(n,t,u){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],t,u||"function"!=typeof n.type);u||_(n.__e),n.__c=n.__=n.__e=void 0}function B(n,l,t){return this.constructor(n,t)}function D(t,u,i){var o,r,e,f;u===document&&(u=document.documentElement),l.__&&l.__(t,u),r=(o="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],F(u,t=(!o&&i||u).__k=g(k,null,[t]),r||p,p,u.namespaceURI,!o&&i?[i]:r?null:u.firstChild?n.call(u.childNodes):null,e,!o&&i?i:r?r.__e:u.firstChild,o,f),z(e,t,f)}function E(n,l){D(n,l,E)}function G(l,t,u){var i,o,r,e,f=w({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==r?i=t[r]:"ref"==r?o=t[r]:f[r]=void 0===t[r]&&void 0!==e?e[r]:t[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),m(l.type,f,i||l.key,o||l.ref,null)}function J(n,l){var t={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t}n=v.slice,l={__e:function(n,l,t,u){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,u||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},t),this.props)),n&&w(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=A(!1),a=A(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,u as isValidElement,l as options,D as render,L as toChildArray};
1
+ var n,l,t,u,i,o,r,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var t in l)n[t]=l[t];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,t,u){var i,o,r,e={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:e[r]=t[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m(l,e,i,o,null)}function m(n,u,i,o,r){var e={type:n,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?C(n):null}function S(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,t,u,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(t=i.length,o=void 0,f=(r=(u=n).__v).__e,c=[],s=[],u.__P&&((o=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),F(u.__P,o,r,u.__n,u.__P.namespaceURI,32&r.__u?[f]:null,c,null==f?C(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,z(c,o,s),o.__e!=f&&S(o)),i.length>t&&i.sort(e));P.__r=0}function $(n,l,t,u,i,o,r,e,f,c,s){var a,h,y,d,w,_,g=u&&u.__k||v,m=l.length;for(f=I(t,l,g,f),a=0;a<m;a++)null!=(y=t.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=F(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=H(y,f,n):"function"==typeof y.type&&void 0!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return t.__e=w,f}function I(n,l,t,u){var i,o,r,e,f,c=l.length,s=t.length,a=s,h=0;for(n.__k=[],i=0;i<c;i++)null!=(o=l[i])&&"boolean"!=typeof o&&"function"!=typeof o?(e=i+h,(o=n.__k[i]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,r=null,-1!==(f=o.__i=O(o,t,e,a))&&(a--,(r=t[f])&&(r.__u|=2)),null==r||null===r.__v?(-1==f&&h--,"function"!=typeof o.type&&(o.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,o.__u|=4))):o=n.__k[i]=null;if(a)for(i=0;i<s;i++)null!=(r=t[i])&&0==(2&r.__u)&&(r.__e==u&&(u=C(r)),q(r,r));return u}function H(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=H(u[i],l,t));return l}n.__e!=l&&(l&&n.type&&!t.contains(l)&&(l=C(n)),t.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function L(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){L(n,l)}):l.push(n)),l}function O(n,l,t,u){var i=n.key,o=n.type,r=t-1,e=t+1,f=l[t];if(null===f||f&&i==f.key&&o===f.type&&0==(2&f.__u))return t;if(("function"!=typeof o||o===k||i)&&u>(null!=f&&0==(2&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(2&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(2&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,t){"-"===l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||y.test(l)?t:t+"px"}function j(n,l,t,u,i){var o,r;n:if("style"===l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||T(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||T(n.style,l,t[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,o?a:s,o)):n.removeEventListener(l,o?a:s,o);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{r=n.tagName&&n.tagName.includes("-"),/*t!==u&&*/(n[l]=null!=t||r?t:"");break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function A(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u<u.t)return;return u(l.event?l.event(t):t)}}}function F(n,t,u,i,o,r,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,H,L,O,T,j=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),r=[f=t.__e=u.__e]),(a=l.__b)&&a(t);n:if("function"==typeof j)try{if(b=t.props,C="prototype"in j&&j.prototype.render,S=(a=j.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,u.__c?m=(h=t.__c=u.__c).__=h.__E:(C?t.__c=h=new j(b,M):(t.__c=h=new x(b,M),h.constructor=j,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=t,p)C&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||t.__v===u.__v)){for(t.__v!==u.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.some(function(n){n&&(n.__=t)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,H=0,C){for(h.state=h.__s,h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do{h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(O=null!=a&&a.type===k&&null==a.key?a.props.children:a)?O:[O],t,u,i,o,r,e,f,c,s),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(t.__v=null,c||null!=r)if(n.then){for(t.__u|=c?160:128;f&&8===f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,t.__e=f}else for(T=r.length;T--;)_(r[T]);else t.__e=u.__e,t.__k=u.__k;l.__e(n,t,u)}else null==r&&t.__v===u.__v?(t.__k=u.__k,t.__e=u.__e):f=t.__e=N(u.__e,t,u,i,o,r,e,c,s);return(a=l.diffed)&&a(t),128&t.__u?void 0:f}function z(n,t,u){for(var i=0;i<u.length;i++)V(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function N(t,u,i,o,r,e,f,c,s){var a,h,v,y,w,g,m,b,k=i.props,x=u.props,S=u.type;if("svg"===S?r="http://www.w3.org/2000/svg":"math"===S?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!S&&(S?w.localName===S:3===w.nodeType)){t=w,e[a]=null;break}if(null==t){if(null===S)return document.createTextNode(x);t=document.createElementNS(r,S,x.is&&x),c&&(l.__m&&l.__m(u,e),c=!1),e=null}if(null===S)k===x||c&&t.data===x||(t.data=x);else{if(e=e&&n.call(t.childNodes),k=i.props||p,!c&&null!=e)for(k={},a=0;a<t.attributes.length;a++)k[(w=t.attributes[a]).name]=w.value;for(a in k)if(w=k[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;j(t,a,null,w,r)}for(a in x)w=x[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||k[a]===w||((a.startsWith("on")||"ref"===a&&"function"==typeof w)&&(b=o[Object.keys(o)[0]])&&(w=w.bind(b.props.value)),j(t,a,w,k[a],r));if(h)c||v&&(h.__html===v.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),u.__k=[];else if(v&&(t.innerHTML=""),$(t,d(y)?y:[y],u,i,o,"foreignObject"===S?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"===S&&null==g?t.removeAttribute("value"):void 0!==g&&(g!==t[a]||"progress"===S&&!g||"option"===S&&g!==k[a])&&j(t,a,g,k[a],r),a="checked",void 0!==m&&m!==t[a]&&j(t,a,m,k[a],r))}return t}function V(n,t,u){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==t||(n.__u=n(t))}else n.current=t}catch(n){l.__e(n,u)}}function q(n,t,u){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],t,u||"function"!=typeof n.type);u||_(n.__e),n.__c=n.__=n.__e=void 0}function B(n,l,t){return this.constructor(n,t)}function D(t,u,i){var o,r,e,f;u===document&&(u=document.documentElement),l.__&&l.__(t,u),r=(o="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],F(u,t=(!o&&i||u).__k=g(k,null,[t]),r||p,p,u.namespaceURI,!o&&i?[i]:r?null:u.firstChild?n.call(u.childNodes):null,e,!o&&i?i:r?r.__e:u.firstChild,o,f),z(e,t,f)}function E(n,l){D(n,l,E)}function G(l,t,u){var i,o,r,e,f=w({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==r?i=t[r]:"ref"==r?o=t[r]:f[r]=void 0===t[r]&&void 0!==e?e[r]:t[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),m(l.type,f,i||l.key,o||l.ref,null)}function J(n,l){var t={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t}n=v.slice,l={__e:function(n,l,t,u){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,u||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},t),this.props)),n&&w(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=A(!1),a=A(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,u as isValidElement,l as options,D as render,L as toChildArray};
package/dist/types.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import type { JSX } from "./jsx-runtime.d.ts";
2
+ import type { Slot, DefaultSlot } from "./UI5Element.js";
2
3
  export type LowercaseString<T> = T extends string ? Lowercase<T> : never;
4
+ export type { Slot, DefaultSlot, };
3
5
  export type PromiseResolve = (value: void | PromiseLike<void>) => void;
4
6
  export type Timeout = ReturnType<typeof setTimeout>;
5
7
  export type Interval = ReturnType<typeof setInterval>;
@@ -13,18 +15,22 @@ export type PassiveEventListenerObject = EventListenerObject & {
13
15
  passive: boolean;
14
16
  };
15
17
  export type AriaRole = JSX.AriaRole;
16
- export type AriaHasPopup = "dialog" | "grid" | "listbox" | "menu" | "tree";
18
+ export type AriaDisabled = JSX.AriaAttributes["aria-disabled"];
19
+ export type AriaChecked = JSX.AriaAttributes["aria-checked"];
20
+ export type AriaReadonly = JSX.AriaAttributes["aria-readonly"];
21
+ export type AriaHasPopup = "dialog" | "grid" | "listbox" | "menu" | "tree" | "false";
17
22
  export type AriaCurrent = "page" | "step" | "location" | "date" | "time" | "true" | "false" | boolean | undefined;
18
23
  export type AriaAutoComplete = "list" | "none" | "inline" | "both" | undefined;
19
24
  export type AriaLandmarkRole = "none" | "banner" | "main" | "region" | "navigation" | "search" | "complementary" | "form" | "contentinfo";
20
25
  export type AccessibilityInfo = {
21
26
  role?: AriaRole;
22
- type?: LowercaseString<string>;
27
+ type?: string;
23
28
  description?: string;
29
+ label?: string;
24
30
  disabled?: boolean;
25
31
  readonly?: boolean;
26
32
  required?: boolean;
27
- children?: Array<HTMLElement>;
33
+ children?: Array<Node>;
28
34
  };
29
35
  export type AccessibilityAttributes = {
30
36
  ariaSetsize?: number;
@@ -38,4 +44,6 @@ export type AccessibilityAttributes = {
38
44
  ariaKeyShortcuts?: string;
39
45
  ariaCurrent?: AriaCurrent;
40
46
  current?: AriaCurrent;
47
+ roleDescription?: string;
48
+ title?: string;
41
49
  };
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSX } from \"./jsx-runtime.d.ts\";\n\n// General utils\nexport type LowercaseString<T> = T extends string ? Lowercase<T> : never;\n\n// Core Framework types\nexport type PromiseResolve = (value: void | PromiseLike<void>) => void;\nexport type Timeout = ReturnType<typeof setTimeout>;\nexport type Interval = ReturnType<typeof setInterval>;\n\nexport type StyleData = string;\n\nexport type ComponentStylesData = Array<ComponentStylesData> | string;\nexport type ClassMapValue = Record<string, boolean>\n\nexport type ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\nexport type PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\n// Accessibility\nexport type AriaRole = JSX.AriaRole;\nexport type AriaHasPopup = \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\";\nexport type AriaCurrent = \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\" | boolean | undefined;\nexport type AriaAutoComplete = \"list\" | \"none\" | \"inline\" | \"both\" | undefined;\nexport type AriaLandmarkRole = \"none\" | \"banner\" | \"main\" | \"region\" | \"navigation\" | \"search\" | \"complementary\" | \"form\" | \"contentinfo\"\n\nexport type AccessibilityInfo = {\n\t// The WAI-ARIA role of the component.\n\trole?: AriaRole,\n\n\t// A translated text that represents the component type. Used when several components share same role,\n\t// f.e. Select and ComboBox both have role=\"combobox\".\n\ttype?: LowercaseString<string>,\n\n\t// A translated text that represents relevant component description/state - value, placeholder, label, etc.\n\tdescription?: string,\n\n\t // The component disabled state.\n\tdisabled?: boolean,\n\n\t// The component readonly state.\n\treadonly?: boolean,\n\n\t// The component required state.\n\trequired?: boolean,\n\n\t// An array of elements, aggregated by the component\n\t// <b>Note:</b> Children should only be provided when it is helpful to understand the accessibility context.\n\tchildren?: Array<HTMLElement>,\n}\n\nexport type AccessibilityAttributes = {\n\tariaSetsize?: number,\n\tariaPosinset?: number,\n\tariaLabel?: string,\n\tcontrols?: LowercaseString<string>\n\texpanded?: \"true\" | \"false\" | boolean,\n\thasPopup?: AriaHasPopup,\n\tname?: string,\n\trole?: AriaRole,\n\tariaKeyShortcuts?: string,\n\tariaCurrent?: AriaCurrent,\n\tcurrent?: AriaCurrent,\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSX } from \"./jsx-runtime.d.ts\";\nimport type { Slot, DefaultSlot } from \"./UI5Element.js\";\n\n// General utils\nexport type LowercaseString<T> = T extends string ? Lowercase<T> : never;\n\n// Core Framework types\nexport type {\n\tSlot,\n\tDefaultSlot,\n};\n\nexport type PromiseResolve = (value: void | PromiseLike<void>) => void;\nexport type Timeout = ReturnType<typeof setTimeout>;\nexport type Interval = ReturnType<typeof setInterval>;\n\nexport type StyleData = string;\n\nexport type ComponentStylesData = Array<ComponentStylesData> | string;\nexport type ClassMapValue = Record<string, boolean>\n\nexport type ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\nexport type PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\n// Accessibility\nexport type AriaRole = JSX.AriaRole;\nexport type AriaDisabled = JSX.AriaAttributes[\"aria-disabled\"];\nexport type AriaChecked = JSX.AriaAttributes[\"aria-checked\"];\nexport type AriaReadonly = JSX.AriaAttributes[\"aria-readonly\"];\nexport type AriaHasPopup = \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\" | \"false\";\nexport type AriaCurrent = \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\" | boolean | undefined;\nexport type AriaAutoComplete = \"list\" | \"none\" | \"inline\" | \"both\" | undefined;\nexport type AriaLandmarkRole = \"none\" | \"banner\" | \"main\" | \"region\" | \"navigation\" | \"search\" | \"complementary\" | \"form\" | \"contentinfo\"\n\nexport type AccessibilityInfo = {\n\t// The WAI-ARIA role of the component.\n\trole?: AriaRole,\n\n\t// A translated text that represents the component type.\n\ttype?: string,\n\n\t// A translated text that represents relevant component description/state - value, placeholder, etc.\n\tdescription?: string,\n\n\t// Label of the component, e.g. `accessible-name` or `accessible-name-ref` for form elements.\n\tlabel?: string,\n\n\t// Disabled state of the component.\n\tdisabled?: boolean,\n\n\t// Readonly state of the component.\n\treadonly?: boolean,\n\n\t// Required state of the component.\n\trequired?: boolean,\n\n\t// An array of nodes, aggregated by the component\n\t// **Note:** Children should only be provided when it is helpful to understand the accessibility context.\n\tchildren?: Array<Node>,\n}\n\nexport type AccessibilityAttributes = {\n\tariaSetsize?: number,\n\tariaPosinset?: number,\n\tariaLabel?: string,\n\tcontrols?: LowercaseString<string>\n\texpanded?: \"true\" | \"false\" | boolean,\n\thasPopup?: AriaHasPopup,\n\tname?: string,\n\trole?: AriaRole,\n\tariaKeyShortcuts?: string,\n\tariaCurrent?: AriaCurrent,\n\tcurrent?: AriaCurrent,\n\troleDescription?: string,\n\ttitle?: string,\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import getConstructableStyle from "./theming/getConstructableStyle.js";
2
+ import { getComponentStyles } from "./theming/componentStyles.js";
2
3
  /**
3
4
  * Updates the shadow root of a UI5Element or its static area item
4
5
  * @param element
@@ -10,7 +11,7 @@ const updateShadowRoot = (element) => {
10
11
  console.warn(`There is no shadow root to update`); // eslint-disable-line
11
12
  return;
12
13
  }
13
- shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);
14
+ shadowRoot.adoptedStyleSheets = [getComponentStyles(), ...getConstructableStyle(ctor)];
14
15
  ctor.renderer(element, shadowRoot);
15
16
  };
16
17
  export default updateShadowRoot;
@@ -1 +1 @@
1
- {"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAGvE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAmB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAEtC,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC,sBAAsB;QACzE,OAAO;IACR,CAAC;IAED,UAAU,CAAC,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);\n\tctor.renderer(element, shadowRoot);\n};\n\nexport default updateShadowRoot;\n"]}
1
+ {"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAmB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAEtC,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC,sBAAsB;QACzE,OAAO;IACR,CAAC;IAED,UAAU,CAAC,kBAAkB,GAAG,CAAC,kBAAkB,EAAE,EAAE,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IACvF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport { getComponentStyles } from \"./theming/componentStyles.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = [getComponentStyles(), ...getConstructableStyle(ctor)];\n\tctor.renderer(element, shadowRoot);\n};\n\nexport default updateShadowRoot;\n"]}
@@ -39,10 +39,10 @@ const findFocusableElement = async (container, forward, startFromContainer) => {
39
39
  let assignedElements;
40
40
  let currentIndex = -1;
41
41
  if (container.shadowRoot) {
42
- child = forward ? container.shadowRoot.firstChild : container.shadowRoot.lastChild;
42
+ child = forward ? container.shadowRoot.firstElementChild : container.shadowRoot.lastElementChild;
43
43
  }
44
44
  else if (container instanceof HTMLSlotElement && container.assignedNodes()) {
45
- assignedElements = container.assignedNodes();
45
+ assignedElements = container.assignedElements();
46
46
  currentIndex = forward ? 0 : assignedElements.length - 1;
47
47
  child = assignedElements[currentIndex];
48
48
  }
@@ -84,7 +84,7 @@ const findFocusableElement = async (container, forward, startFromContainer) => {
84
84
  }
85
85
  }
86
86
  }
87
- child = forward ? originalChild.nextSibling : originalChild.previousSibling;
87
+ child = forward ? originalChild.nextElementSibling : originalChild.previousElementSibling;
88
88
  // If the child element is not part of the currently assigned element,
89
89
  // we have to check the next/previous element assigned to the slot or continue with the next/previous sibling of the slot,
90
90
  // otherwise, the nextSibling/previousSibling is the next element inside the light DOM
@@ -1 +1 @@
1
- {"version":3,"file":"FocusableElements.js","sourceRoot":"","sources":["../../src/util/FocusableElements.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,MAAM,WAAW,GAAG,CAAC,EAAe,EAAE,EAAE;IACvC,OAAO,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EAAe,EAAE,EAAE;IACxC,MAAM,aAAa,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAE3C,OAAO,CAAC,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;WAClG,CAAC,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACnG,CAAC,CA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AgB,CAAC;QACvD,CAAC;IACF,CAAC;IAED,oCAAoC;IAEpC,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,uBAAuB,GACvB,CAAC","sourcesContent":["import isElementHidden from \"./isElementHidden.js\";\nimport isElementClickable from \"./isElementClickable.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { isSafari } from \"../Device.js\";\n\ntype FocusableElementPromise = Promise<HTMLElement | null>;\n\nconst isFocusTrap = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-trap\");\n};\n\nconst isScrollable = (el: HTMLElement) => {\n\tconst computedStyle = getComputedStyle(el);\n\n\treturn (el.scrollHeight > el.clientHeight && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowY) >= 0)\n\t\t|| (el.scrollWidth > el.clientWidth && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowX) >= 0);\n};\n\nconst getFirstFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, true, startFromContainer);\n};\n\nconst getLastFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, false, startFromContainer);\n};\n\nconst isElemFocusable = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-redirect\") || !isElementHidden(el);\n};\n\nconst isUI5ElementWithNegativeTabIndex = (el: HTMLElement) => {\n\tif (instanceOfUI5Element(el)) {\n\t\tconst tabIndex = el.getAttribute(\"tabindex\");\n\t\tif (tabIndex !== null && parseInt(tabIndex) < 0) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst findFocusableElement = async (container: HTMLElement, forward: boolean, startFromContainer?: boolean): FocusableElementPromise => {\n\tlet child: HTMLElement | undefined;\n\tlet assignedElements;\n\tlet currentIndex = -1;\n\n\tif (container.shadowRoot) {\n\t\tchild = forward ? container.shadowRoot.firstChild as HTMLElement : container.shadowRoot.lastChild as HTMLElement;\n\t} else if (container instanceof HTMLSlotElement && container.assignedNodes()) {\n\t\tassignedElements = container.assignedNodes();\n\t\tcurrentIndex = forward ? 0 : assignedElements.length - 1;\n\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t} else if (startFromContainer) {\n\t\tchild = container;\n\t} else {\n\t\tchild = forward ? container.firstElementChild as HTMLElement : container.lastElementChild as HTMLElement;\n\t}\n\n\tlet focusableDescendant;\n\n\t/* eslint-disable no-await-in-loop */\n\n\twhile (child) {\n\t\tconst originalChild: HTMLElement | undefined = child;\n\n\t\tif (!isElementHidden(originalChild) && !isUI5ElementWithNegativeTabIndex(originalChild)) {\n\t\t\tif (instanceOfUI5Element(child)) {\n\t\t\t\t// getDomRef is used because some components mark their focusable ref in an inner\n\t\t\t\t// html but there might also be focusable targets outside of it\n\t\t\t\t// as an example - TreeItemBase\n\t\t\t\t// div - root of the component returned by getDomRef()\n\t\t\t\t// \tli.ui5-li-tree - returned by getFocusDomRef() and may not be focusable (ItemNavigation manages tabindex)\n\t\t\t\t// \tul.subtree - may still contain focusable targets (sub nodes of the tree item)\n\t\t\t\tawait child._waitForDomRef();\n\t\t\t\tchild = child.getDomRef();\n\t\t\t}\n\n\t\t\tif (!child || isElementHidden(child)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (child.nodeType === 1 && isElemFocusable(child) && !isFocusTrap(child)) {\n\t\t\t\tif (isElementClickable(child)) {\n\t\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t\t}\n\n\t\t\t\tfocusableDescendant = await findFocusableElement(child, forward);\n\n\t\t\t\t// check if it is a keyboard focusable scroll container\n\t\t\t\tif (!isSafari() && !focusableDescendant && isScrollable(child)) {\n\t\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t\t}\n\n\t\t\t\tif (focusableDescendant) {\n\t\t\t\t\treturn (focusableDescendant && typeof focusableDescendant.focus === \"function\") ? focusableDescendant : null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tchild = forward ? originalChild.nextSibling as HTMLElement : originalChild.previousSibling as HTMLElement;\n\n\t\t// If the child element is not part of the currently assigned element,\n\t\t// we have to check the next/previous element assigned to the slot or continue with the next/previous sibling of the slot,\n\t\t// otherwise, the nextSibling/previousSibling is the next element inside the light DOM\n\t\tif (assignedElements && !assignedElements[currentIndex].contains(child)) {\n\t\t\tcurrentIndex = forward ? currentIndex + 1 : currentIndex - 1;\n\n\t\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t\t}\n\t}\n\n\t/* eslint-enable no-await-in-loop */\n\n\treturn null;\n};\n\nexport {\n\tgetFirstFocusableElement,\n\tgetLastFocusableElement,\n};\n"]}
1
+ {"version":3,"file":"FocusableElements.js","sourceRoot":"","sources":["../../src/util/FocusableElements.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,MAAM,WAAW,GAAG,CAAC,EAAe,EAAE,EAAE;IACvC,OAAO,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EAAe,EAAE,EAAE;IACxC,MAAM,aAAa,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAE3C,OAAO,CAAC,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;WAClG,CAAC,EAAE,CAAC,WAAW,GAAG,EAAE,C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,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC;YAE7D,KAAK,GAAG,gBAAgB,CAAC,YAAY,CAAgB,CAAC;QACvD,CAAC;IACF,CAAC;IAED,oCAAoC;IAEpC,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,uBAAuB,GACvB,CAAC","sourcesContent":["import isElementHidden from \"./isElementHidden.js\";\nimport isElementClickable from \"./isElementClickable.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { isSafari } from \"../Device.js\";\n\ntype FocusableElementPromise = Promise<HTMLElement | null>;\n\nconst isFocusTrap = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-trap\");\n};\n\nconst isScrollable = (el: HTMLElement) => {\n\tconst computedStyle = getComputedStyle(el);\n\n\treturn (el.scrollHeight > el.clientHeight && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowY) >= 0)\n\t\t|| (el.scrollWidth > el.clientWidth && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowX) >= 0);\n};\n\nconst getFirstFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, true, startFromContainer);\n};\n\nconst getLastFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, false, startFromContainer);\n};\n\nconst isElemFocusable = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-redirect\") || !isElementHidden(el);\n};\n\nconst isUI5ElementWithNegativeTabIndex = (el: HTMLElement) => {\n\tif (instanceOfUI5Element(el)) {\n\t\tconst tabIndex = el.getAttribute(\"tabindex\");\n\t\tif (tabIndex !== null && parseInt(tabIndex) < 0) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst findFocusableElement = async (container: HTMLElement, forward: boolean, startFromContainer?: boolean): FocusableElementPromise => {\n\tlet child: HTMLElement | undefined;\n\tlet assignedElements;\n\tlet currentIndex = -1;\n\n\tif (container.shadowRoot) {\n\t\tchild = forward ? container.shadowRoot.firstElementChild as HTMLElement : container.shadowRoot.lastElementChild as HTMLElement;\n\t} else if (container instanceof HTMLSlotElement && container.assignedNodes()) {\n\t\tassignedElements = container.assignedElements();\n\t\tcurrentIndex = forward ? 0 : assignedElements.length - 1;\n\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t} else if (startFromContainer) {\n\t\tchild = container;\n\t} else {\n\t\tchild = forward ? container.firstElementChild as HTMLElement : container.lastElementChild as HTMLElement;\n\t}\n\n\tlet focusableDescendant;\n\n\t/* eslint-disable no-await-in-loop */\n\n\twhile (child) {\n\t\tconst originalChild: HTMLElement | undefined = child;\n\n\t\tif (!isElementHidden(originalChild) && !isUI5ElementWithNegativeTabIndex(originalChild)) {\n\t\t\tif (instanceOfUI5Element(child)) {\n\t\t\t\t// getDomRef is used because some components mark their focusable ref in an inner\n\t\t\t\t// html but there might also be focusable targets outside of it\n\t\t\t\t// as an example - TreeItemBase\n\t\t\t\t// div - root of the component returned by getDomRef()\n\t\t\t\t// \tli.ui5-li-tree - returned by getFocusDomRef() and may not be focusable (ItemNavigation manages tabindex)\n\t\t\t\t// \tul.subtree - may still contain focusable targets (sub nodes of the tree item)\n\t\t\t\tawait child._waitForDomRef();\n\t\t\t\tchild = child.getDomRef();\n\t\t\t}\n\n\t\t\tif (!child || isElementHidden(child)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (child.nodeType === 1 && isElemFocusable(child) && !isFocusTrap(child)) {\n\t\t\t\tif (isElementClickable(child)) {\n\t\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t\t}\n\n\t\t\t\tfocusableDescendant = await findFocusableElement(child, forward);\n\n\t\t\t\t// check if it is a keyboard focusable scroll container\n\t\t\t\tif (!isSafari() && !focusableDescendant && isScrollable(child)) {\n\t\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t\t}\n\n\t\t\t\tif (focusableDescendant) {\n\t\t\t\t\treturn (focusableDescendant && typeof focusableDescendant.focus === \"function\") ? focusableDescendant : null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tchild = forward ? originalChild.nextElementSibling as HTMLElement : originalChild.previousElementSibling as HTMLElement;\n\n\t\t// If the child element is not part of the currently assigned element,\n\t\t// we have to check the next/previous element assigned to the slot or continue with the next/previous sibling of the slot,\n\t\t// otherwise, the nextSibling/previousSibling is the next element inside the light DOM\n\t\tif (assignedElements && !assignedElements[currentIndex].contains(child)) {\n\t\t\tcurrentIndex = forward ? currentIndex + 1 : currentIndex - 1;\n\n\t\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t\t}\n\t}\n\n\t/* eslint-enable no-await-in-loop */\n\n\treturn null;\n};\n\nexport {\n\tgetFirstFocusableElement,\n\tgetLastFocusableElement,\n};\n"]}
@@ -1,4 +1,3 @@
1
- import getEffectiveScrollbarStyle from "../util/getEffectiveScrollbarStyle.js";
2
1
  const copyAndApplyStyles = (element, copiedElement) => {
3
2
  const computedStyles = getComputedStyle(element);
4
3
  for (let i = 0; i < computedStyles.length; i++) {
@@ -24,17 +23,10 @@ const setInputSpecificStyles = (element) => {
24
23
  element.style.overflowX = "auto";
25
24
  element.style.overflowY = "hidden";
26
25
  };
27
- const applyScrollStylings = () => {
28
- const sheet = new CSSStyleSheet();
29
- const styles = getEffectiveScrollbarStyle();
30
- sheet.replaceSync(styles);
31
- document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
32
- };
33
26
  const createCopy = () => {
34
27
  const copiedElement = document.createElement("div");
35
28
  copiedElement.id = "ui5-selection-mirror";
36
29
  copiedElement.contentEditable = "true";
37
- applyScrollStylings();
38
30
  document.body.appendChild(copiedElement);
39
31
  };
40
32
  const applyScrollPosition = (element, copiedElement) => {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionAssistant.js","sourceRoot":"","sources":["../../src/util/SelectionAssistant.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAE/E,MAAM,kBAAkB,GAAG,CAAC,OAAoB,EAAE,aAA0B,EAAE,EAAE;IAC/E,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,MAAM,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QACvC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,cAAc,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,OAAO,CAAC,OAAO,KAAK,OAAO,IAAI,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAErE,aAAa,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;IAC1C,aAAa,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,IAAI,IAAI,CAAC;IACvE,aAAa,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,GAAG,IAAI,CAAC;IAErE,uBAAuB,CAAC,aAAa,CAAC,CAAC;IAEvC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,OAAoB,EAAE,EAAE;IACxD,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;IACpC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC;IAClC,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAA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GAAG,QAAQ,CAAC,cAAc,CAC5C,sBAAsB,CACrB,CAAC;IAEH,aAAa,CAAC,WAAW,GAAG,YAAa,CAAC,KAAK,CAAC;IAEhD,IAAI,YAAY,EAAE,CAAC;QAClB,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAE,CAAC;IAClD,CAAC;IAED,OAAO,uBAAuB,CAAC,YAAa,EAAE,aAA+B,CAAC,CAAC;AAChF,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import getEffectiveScrollbarStyle from \"../util/getEffectiveScrollbarStyle.js\";\n\nconst copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tconst computedStyles = getComputedStyle(element);\n\n\tfor (let i = 0; i < computedStyles.length; i++) {\n\t\tconst propertyName = computedStyles[i];\n\t\tcopiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));\n\t}\n\n\telement.tagName === \"INPUT\" && setInputSpecificStyles(copiedElement);\n\n\tcopiedElement.style.position = \"absolute\";\n\tcopiedElement.style.left = `${element.getBoundingClientRect().left}px`;\n\tcopiedElement.style.top = `${element.getBoundingClientRect().top}px`;\n\n\tsetUnInteractableStyles(copiedElement);\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst setUnInteractableStyles = (element: HTMLElement) => {\n\telement.style.position = \"absolute\";\n\telement.style.userSelect = \"none\";\n\telement.style.pointerEvents = \"none\";\n\telement.style.zIndex = \"-1\";\n\telement.style.opacity = \"0\";\n};\n\nconst setInputSpecificStyles = (element: HTMLElement) => {\n\telement.style.whiteSpace = \"nowrap\";\n\telement.style.overflowX = \"auto\";\n\telement.style.overflowY = \"hidden\";\n};\n\nconst applyScrollStylings = () => {\n\tconst sheet = new CSSStyleSheet();\n\tconst styles = getEffectiveScrollbarStyle();\n\n\tsheet.replaceSync(styles);\n\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];\n};\n\nconst createCopy = () => {\n\tconst copiedElement = document.createElement(\"div\");\n\n\tcopiedElement.id = \"ui5-selection-mirror\";\n\tcopiedElement.contentEditable = \"true\";\n\n\tapplyScrollStylings();\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tcopiedElement.scrollTop = element.scrollTop;\n\tcopiedElement.scrollLeft = element.scrollLeft;\n};\n\nconst getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {\n\tconst { selectionStart, selectionEnd } = element;\n\tconst selectedText = element.value.slice(\n\t\tselectionStart!,\n\t\telement.selectionEnd!,\n\t);\n\tconst range = document.createRange();\n\n\trange.setStart(mirror.firstChild!, selectionEnd! - 1);\n\trange.setEnd(mirror.firstChild!, selectionEnd!);\n\n\tapplyScrollPosition(element, mirror);\n\n\tconst rangeRect = range.getBoundingClientRect();\n\tconst rectObject = {\n\t\tx: rangeRect.x,\n\t\ty: rangeRect.y,\n\t\twidth: rangeRect.width,\n\t\theight: rangeRect.height,\n\t\ttop: rangeRect.top,\n\t\tright: rangeRect.right,\n\t\tbottom: rangeRect.bottom,\n\t\tleft: rangeRect.left,\n\t};\n\n\tdocument.body.removeChild(mirror);\n\n\treturn { ...rectObject, selectedText };\n};\n\nconst getElementSelection = (element: HTMLElement) => {\n\tconst innerElement = element.shadowRoot!.querySelector(\"textarea\")\n\t\t|| element.shadowRoot!.querySelector(\"input\");\n\n\tif (!document.getElementById(\"ui5-selection-mirror\")) {\n\t\tcreateCopy();\n\t}\n\n\tconst copiedElement = document.getElementById(\n\t\t\"ui5-selection-mirror\",\n\t)!;\n\n\tcopiedElement.textContent = innerElement!.value;\n\n\tif (innerElement) {\n\t\tcopyAndApplyStyles(innerElement, copiedElement)!;\n\t}\n\n\treturn getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);\n};\n\nexport default getElementSelection;\n"]}
1
+ {"version":3,"file":"SelectionAssistant.js","sourceRoot":"","sources":["../../src/util/SelectionAssistant.ts"],"names":[],"mappings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G;QAClB,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,IAAI,EAAE,SAAS,CAAC,IAAI;KACpB,CAAC;IAEF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAElC,OAAO,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,OAAoB,EAAE,EAAE;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,UAAU,CAAC;WAC9D,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,EAAE,CAAC;QACtD,UAAU,EAAE,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,QAAQ,CAAC,cAAc,CAC5C,sBAAsB,CACrB,CAAC;IAEH,aAAa,CAAC,WAAW,GAAG,YAAa,CAAC,KAAK,CAAC;IAEhD,IAAI,YAAY,EAAE,CAAC;QAClB,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,uBAAuB,CAAC,YAAa,EAAE,aAA+B,CAAC,CAAC;AAChF,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["const copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tconst computedStyles = getComputedStyle(element);\n\n\tfor (let i = 0; i < computedStyles.length; i++) {\n\t\tconst propertyName = computedStyles[i];\n\t\tcopiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));\n\t}\n\n\telement.tagName === \"INPUT\" && setInputSpecificStyles(copiedElement);\n\n\tcopiedElement.style.position = \"absolute\";\n\tcopiedElement.style.left = `${element.getBoundingClientRect().left}px`;\n\tcopiedElement.style.top = `${element.getBoundingClientRect().top}px`;\n\n\tsetUnInteractableStyles(copiedElement);\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst setUnInteractableStyles = (element: HTMLElement) => {\n\telement.style.position = \"absolute\";\n\telement.style.userSelect = \"none\";\n\telement.style.pointerEvents = \"none\";\n\telement.style.zIndex = \"-1\";\n\telement.style.opacity = \"0\";\n};\n\nconst setInputSpecificStyles = (element: HTMLElement) => {\n\telement.style.whiteSpace = \"nowrap\";\n\telement.style.overflowX = \"auto\";\n\telement.style.overflowY = \"hidden\";\n};\n\nconst createCopy = () => {\n\tconst copiedElement = document.createElement(\"div\");\n\n\tcopiedElement.id = \"ui5-selection-mirror\";\n\tcopiedElement.contentEditable = \"true\";\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tcopiedElement.scrollTop = element.scrollTop;\n\tcopiedElement.scrollLeft = element.scrollLeft;\n};\n\nconst getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {\n\tconst { selectionStart, selectionEnd } = element;\n\tconst selectedText = element.value.slice(\n\t\tselectionStart!,\n\t\telement.selectionEnd!,\n\t);\n\tconst range = document.createRange();\n\n\trange.setStart(mirror.firstChild!, selectionEnd! - 1);\n\trange.setEnd(mirror.firstChild!, selectionEnd!);\n\n\tapplyScrollPosition(element, mirror);\n\n\tconst rangeRect = range.getBoundingClientRect();\n\tconst rectObject = {\n\t\tx: rangeRect.x,\n\t\ty: rangeRect.y,\n\t\twidth: rangeRect.width,\n\t\theight: rangeRect.height,\n\t\ttop: rangeRect.top,\n\t\tright: rangeRect.right,\n\t\tbottom: rangeRect.bottom,\n\t\tleft: rangeRect.left,\n\t};\n\n\tdocument.body.removeChild(mirror);\n\n\treturn { ...rectObject, selectedText };\n};\n\nconst getElementSelection = (element: HTMLElement) => {\n\tconst innerElement = element.shadowRoot!.querySelector(\"textarea\")\n\t\t|| element.shadowRoot!.querySelector(\"input\");\n\n\tif (!document.getElementById(\"ui5-selection-mirror\")) {\n\t\tcreateCopy();\n\t}\n\n\tconst copiedElement = document.getElementById(\n\t\t\"ui5-selection-mirror\",\n\t)!;\n\n\tcopiedElement.textContent = innerElement!.value;\n\n\tif (innerElement) {\n\t\tcopyAndApplyStyles(innerElement, copiedElement);\n\t}\n\n\treturn getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);\n};\n\nexport default getElementSelection;\n"]}
@@ -7,7 +7,7 @@ import isElementTabbable from "./isElementTabbable.js";
7
7
  * @returns { Array<HTMLElement> } the tabbable elements
8
8
  */
9
9
  const getTabbableElements = (el) => {
10
- return getTabbables([...el.children]);
10
+ return getTabbables(el.tagName === "SLOT" ? [el] : [...el.children]);
11
11
  };
12
12
  /**
13
13
  * Returns the last tabbable element within the provided HTMLElement.
@@ -37,7 +37,7 @@ const getTabbables = (nodes, tabbables) => {
37
37
  tabbableElements.push(currentElement);
38
38
  }
39
39
  if (currentElement.tagName === "SLOT") {
40
- getTabbables(currentElement.assignedNodes(), tabbableElements);
40
+ getTabbables(currentElement.assignedElements(), tabbableElements);
41
41
  }
42
42
  else {
43
43
  const children = currentElement.shadowRoot ? currentElement.shadowRoot.children : currentElement.children;
@@ -1 +1 @@
1
- {"version":3,"file":"TabbableElements.js","sourceRoot":"","sources":["../../src/util/TabbableElements.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,CAAC,EAAe,EAAsB,EAAE;IACnE,OAAO,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MA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AC,CAAC;QAC/C,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,mBAAmB,EACnB,sBAAsB,GACtB,CAAC","sourcesContent":["import isElementTabbable from \"./isElementTabbable.js\";\n\n/**\n * Returns the tabbable elements within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { Array<HTMLElement> } the tabbable elements\n */\nconst getTabbableElements = (el: HTMLElement): Array<HTMLElement> => {\n\treturn getTabbables([...el.children]);\n};\n\n/**\n * Returns the last tabbable element within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { HTMLElement | null } the last tabbable element or \"null\" if not found\n */\nconst getLastTabbableElement = (el: HTMLElement): HTMLElement | null => {\n\tconst tabbables = getTabbables([...el.children]);\n\treturn tabbables.length ? tabbables[tabbables.length - 1] : null;\n};\n\nconst getTabbables = (nodes: Array<Node>, tabbables?: Array<HTMLElement>): Array<HTMLElement> => {\n\tconst tabbableElements = tabbables || [];\n\n\tif (!nodes) {\n\t\treturn tabbableElements;\n\t}\n\n\tnodes.forEach(currentNode => {\n\t\tif (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentElement = currentNode as HTMLElement;\n\t\tif (currentElement.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isElementTabbable(currentElement)) {\n\t\t\ttabbableElements.push(currentElement);\n\t\t}\n\n\t\tif (currentElement.tagName === \"SLOT\") {\n\t\t\tgetTabbables((currentElement as HTMLSlotElement).assignedNodes() as Array<HTMLElement>, tabbableElements);\n\t\t} else {\n\t\t\tconst children = currentElement.shadowRoot ? currentElement.shadowRoot.children : currentElement.children;\n\t\t\tgetTabbables([...children], tabbableElements);\n\t\t}\n\t});\n\n\treturn tabbableElements;\n};\n\nexport {\n\tgetTabbableElements,\n\tgetLastTabbableElement,\n};\n"]}
1
+ {"version":3,"file":"TabbableElements.js","sourceRoot":"","sources":["../../src/util/TabbableElements.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,CAAC,EAAe,EAAsB,EAAE;IACnE,OAAO,YAAY,CAAC,EAAE,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtE,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,CAAC,EAAe,EAAsB,EAAE;IACtE,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAkB,EAAE,SAA8B,EAAsB,EAAE;IAC/F,MAAM,gBAAgB,GAAG,SAAS,IAAI,EAAE,CAAC;IAEzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO,gBAAgB,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAC3B,IAAI,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,WAAW,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;YAC3F,OAAO;QACR,CAAC;QAED,MAAM,cAAc,GAAG,WAA0B,CAAC;QAClD,IAAI,cAAc,CAAC,YAAY,CAAC,qBAAqB,CAAC,EAAE,CAAC;YACxD,OAAO;QACR,CAAC;QAED,IAAI,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC;YACvC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,cAAc,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;YACvC,YAAY,CAAE,cAAkC,CAAC,gBAAgB,EAAE,EAAE,gBAAgB,CAAC,CAAC;QACxF,CAAC;aAAM,CAAC;YACP,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC1G,YAAY,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,mBAAmB,EACnB,sBAAsB,GACtB,CAAC","sourcesContent":["import isElementTabbable from \"./isElementTabbable.js\";\n\n/**\n * Returns the tabbable elements within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { Array<HTMLElement> } the tabbable elements\n */\nconst getTabbableElements = (el: HTMLElement): Array<HTMLElement> => {\n\treturn getTabbables(el.tagName === \"SLOT\" ? [el] : [...el.children]);\n};\n\n/**\n * Returns the last tabbable element within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { HTMLElement | null } the last tabbable element or \"null\" if not found\n */\nconst getLastTabbableElement = (el: HTMLElement): HTMLElement | null => {\n\tconst tabbables = getTabbables([...el.children]);\n\treturn tabbables.length ? tabbables[tabbables.length - 1] : null;\n};\n\nconst getTabbables = (nodes: Array<Node>, tabbables?: Array<HTMLElement>): Array<HTMLElement> => {\n\tconst tabbableElements = tabbables || [];\n\n\tif (!nodes) {\n\t\treturn tabbableElements;\n\t}\n\n\tnodes.forEach(currentNode => {\n\t\tif (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentElement = currentNode as HTMLElement;\n\t\tif (currentElement.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isElementTabbable(currentElement)) {\n\t\t\ttabbableElements.push(currentElement);\n\t\t}\n\n\t\tif (currentElement.tagName === \"SLOT\") {\n\t\t\tgetTabbables((currentElement as HTMLSlotElement).assignedElements(), tabbableElements);\n\t\t} else {\n\t\t\tconst children = currentElement.shadowRoot ? currentElement.shadowRoot.children : currentElement.children;\n\t\t\tgetTabbables([...children], tabbableElements);\n\t\t}\n\t});\n\n\treturn tabbableElements;\n};\n\nexport {\n\tgetTabbableElements,\n\tgetLastTabbableElement,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ declare function createChecker<T, P extends keyof T = keyof T>(prop: P): (object: any) => object is T;
2
+ export default createChecker;
@@ -0,0 +1,8 @@
1
+ // createInstanceChecker<A>("isAItem")
2
+ function createChecker(prop) {
3
+ return (object) => {
4
+ return object !== undefined && prop in object && object[prop] === true;
5
+ };
6
+ }
7
+ export default createChecker;
8
+ //# sourceMappingURL=createInstanceChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createInstanceChecker.js","sourceRoot":"","sources":["../../src/util/createInstanceChecker.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,SAAS,aAAa,CAAiC,IAAO;IAC7D,OAAO,CAAC,MAAW,EAAe,EAAE;QACnC,OAAO,MAAM,KAAK,SAAS,IAAI,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACxE,CAAC,CAAC;AACH,CAAC;AAED,eAAe,aAAa,CAAC","sourcesContent":["// createInstanceChecker<A>(\"isAItem\")\nfunction createChecker<T, P extends keyof T = keyof T>(prop: P) {\n\treturn (object: any): object is T => {\n\t\treturn object !== undefined && prop in object && object[prop] === true;\n\t};\n}\n\nexport default createChecker;\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const createMultiInstanceChecker: <T>(props: string[] | string) => (object: any) => object is T;
2
+ export default createMultiInstanceChecker;
@@ -0,0 +1,19 @@
1
+ // Allows filtering of multiple types at once
2
+ // const isInstanceOfAOrB = createMultiInstanceChecker<A | B>(["isAItem", "isBItem"])
3
+ // const filteredItems = items.filter(isInstanceOfAOrB)
4
+ //
5
+ // Alternatively, use "createInstanceChecker" and filter separately:
6
+ // const isInstanceOfA = createInstanceChecker<A>("isAItem");
7
+ // const isInstanceOfB = createInstanceChecker<A>("isBItem")
8
+ // const filteredItems = [...items.filter(isInstanceOfA), ...items.filter(isInstanceOfB)];
9
+ export const createMultiInstanceChecker = (props) => {
10
+ return (object) => {
11
+ if (!object) {
12
+ return false;
13
+ }
14
+ const propsArray = Array.isArray(props) ? props : [props];
15
+ return propsArray.some(prop => prop in object && object[prop] === true);
16
+ };
17
+ };
18
+ export default createMultiInstanceChecker;
19
+ //# sourceMappingURL=createMultiInstanceChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMultiInstanceChecker.js","sourceRoot":"","sources":["../../src/util/createMultiInstanceChecker.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qFAAqF;AACrF,uDAAuD;AACvD,EAAE;AACF,oEAAoE;AACpE,6DAA6D;AAC7D,4DAA4D;AAC5D,0FAA0F;AAC1F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAI,KAAwB,EAAE,EAAE;IACzE,OAAO,CAAC,MAAW,EAAe,EAAE;QACnC,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,OAAO,KAAK,CAAC;QACd,CAAC;QAED,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1D,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;IACzE,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["// Allows filtering of multiple types at once\n// const isInstanceOfAOrB = createMultiInstanceChecker<A | B>([\"isAItem\", \"isBItem\"])\n// const filteredItems = items.filter(isInstanceOfAOrB)\n//\n// Alternatively, use \"createInstanceChecker\" and filter separately:\n// const isInstanceOfA = createInstanceChecker<A>(\"isAItem\");\n// const isInstanceOfB = createInstanceChecker<A>(\"isBItem\")\n// const filteredItems = [...items.filter(isInstanceOfA), ...items.filter(isInstanceOfB)];\nexport const createMultiInstanceChecker = <T>(props: string[] | string) => {\n\treturn (object: any): object is T => {\n\t\tif (!object) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst propsArray = Array.isArray(props) ? props : [props];\n\t\treturn propsArray.some(prop => prop in object && object[prop] === true);\n\t};\n};\n\nexport default createMultiInstanceChecker;\n"]}
@@ -1,7 +1,13 @@
1
- import type UI5Element from "../../UI5Element.js";
2
1
  import type MovePlacement from "../../types/MovePlacement.js";
3
- declare const setDraggedElement: (element: HTMLElement | null) => void;
4
- type SetDraggedElementFunction = typeof setDraggedElement;
2
+ /**
3
+ * Starts a multiple drag operation by creating a drag ghost element.
4
+ * The drag ghost will be displayed when dragging multiple items.
5
+ *
6
+ * @param {number} count - The number of items being dragged.
7
+ * @param {DragEvent} e - The drag event that triggered the operation.
8
+ * @public
9
+ */
10
+ declare const startMultipleDrag: (count: number, e: DragEvent) => Promise<void>;
5
11
  type DragAndDropSettings = {
6
12
  /**
7
13
  * Allow cross-browser and file drag and drop.
@@ -23,11 +29,11 @@ type MoveEventDetail = {
23
29
  };
24
30
  };
25
31
  declare const DragRegistry: {
26
- subscribe: (subscriber: UI5Element) => void;
27
- unsubscribe: (subscriber: UI5Element) => void;
28
- addSelfManagedArea: (area: HTMLElement | ShadowRoot) => (element: HTMLElement | null) => void;
29
- removeSelfManagedArea: (area: HTMLElement | ShadowRoot) => void;
32
+ setDraggedElement: (element: HTMLElement | null, e?: DragEvent) => void;
33
+ clearDraggedElement: () => void;
30
34
  getDraggedElement: () => HTMLElement | null;
35
+ startMultipleDrag: (count: number, e: DragEvent) => Promise<void>;
31
36
  };
32
37
  export default DragRegistry;
33
- export type { SetDraggedElementFunction, DragAndDropSettings, MoveEventDetail, };
38
+ export { startMultipleDrag, };
39
+ export type { DragAndDropSettings, MoveEventDetail, };
@@ -1,66 +1,62 @@
1
+ import MultipleDragGhostCss from "../../generated/css/MultipleDragGhost.css.js";
2
+ import { getI18nBundle } from "../../i18nBundle.js";
3
+ import { DRAG_DROP_MULTIPLE_TEXT, } from "../../generated/i18n/i18n-defaults.js";
4
+ const MIN_MULTI_DRAG_COUNT = 2;
1
5
  let draggedElement = null;
2
- let globalHandlersAttached = false;
3
- const subscribers = new Set();
4
- const selfManagedDragAreas = new Set();
5
- const ondragstart = (e) => {
6
- if (!e.dataTransfer || !(e.target instanceof HTMLElement)) {
7
- return;
8
- }
9
- if (!selfManagedDragAreas.has(e.target)) {
10
- draggedElement = e.target;
11
- }
12
- };
13
- const ondragend = () => {
14
- draggedElement = null;
6
+ const setDraggedElement = (element, e) => {
7
+ draggedElement = element;
8
+ // Store the dragged element's ID in the dataTransfer object to ensure
9
+ // the drag operation is recognized across different browsers and contexts.
10
+ // Without this, Safari browser in iOS may not recognize the drag operation.
11
+ e?.dataTransfer?.setData("text/plain", element ? element.id : "");
15
12
  };
16
- const ondrop = () => {
13
+ const clearDraggedElement = () => {
17
14
  draggedElement = null;
18
15
  };
19
- const setDraggedElement = (element) => {
20
- draggedElement = element;
21
- };
22
16
  const getDraggedElement = () => {
23
17
  return draggedElement;
24
18
  };
25
- const attachGlobalHandlers = () => {
26
- if (globalHandlersAttached) {
19
+ const createDefaultMultiDragElement = async (count) => {
20
+ const dragElement = document.createElement("div");
21
+ const i18nBundle = await getI18nBundle("@ui5/webcomponents-base");
22
+ const dragElementShadow = dragElement.attachShadow({ mode: "open" });
23
+ const styles = new CSSStyleSheet();
24
+ styles.replaceSync(MultipleDragGhostCss);
25
+ dragElementShadow.adoptedStyleSheets = [styles];
26
+ dragElementShadow.textContent = i18nBundle.getText(DRAG_DROP_MULTIPLE_TEXT, count);
27
+ return dragElement;
28
+ };
29
+ /**
30
+ * Starts a multiple drag operation by creating a drag ghost element.
31
+ * The drag ghost will be displayed when dragging multiple items.
32
+ *
33
+ * @param {number} count - The number of items being dragged.
34
+ * @param {DragEvent} e - The drag event that triggered the operation.
35
+ * @public
36
+ */
37
+ const startMultipleDrag = async (count, e) => {
38
+ if (count < MIN_MULTI_DRAG_COUNT) {
39
+ console.warn(`Cannot start multiple drag with count ${count}. Minimum is ${MIN_MULTI_DRAG_COUNT}.`); // eslint-disable-line
27
40
  return;
28
41
  }
29
- document.body.addEventListener("dragstart", ondragstart);
30
- document.body.addEventListener("dragend", ondragend);
31
- document.body.addEventListener("drop", ondrop);
32
- };
33
- const detachGlobalHandlers = () => {
34
- document.body.removeEventListener("dragstart", ondragstart);
35
- document.body.removeEventListener("dragend", ondragend);
36
- document.body.removeEventListener("drop", ondrop);
37
- globalHandlersAttached = false;
38
- };
39
- const subscribe = (subscriber) => {
40
- subscribers.add(subscriber);
41
- if (!globalHandlersAttached) {
42
- attachGlobalHandlers();
43
- }
44
- };
45
- const unsubscribe = (subscriber) => {
46
- subscribers.delete(subscriber);
47
- if (subscribers.size === 0 && globalHandlersAttached) {
48
- detachGlobalHandlers();
42
+ if (!e.dataTransfer) {
43
+ return;
49
44
  }
50
- };
51
- const addSelfManagedArea = (area) => {
52
- selfManagedDragAreas.add(area);
53
- return setDraggedElement;
54
- };
55
- const removeSelfManagedArea = (area) => {
56
- selfManagedDragAreas.delete(area);
45
+ const customDragElement = await createDefaultMultiDragElement(count);
46
+ // Add to document body temporarily
47
+ document.body.appendChild(customDragElement);
48
+ e.dataTransfer.setDragImage(customDragElement, 0, 0);
49
+ // Clean up the temporary element after the drag operation starts
50
+ requestAnimationFrame(() => {
51
+ customDragElement.remove();
52
+ });
57
53
  };
58
54
  const DragRegistry = {
59
- subscribe,
60
- unsubscribe,
61
- addSelfManagedArea,
62
- removeSelfManagedArea,
55
+ setDraggedElement,
56
+ clearDraggedElement,
63
57
  getDraggedElement,
58
+ startMultipleDrag,
64
59
  };
65
60
  export default DragRegistry;
61
+ export { startMultipleDrag, };
66
62
  //# sourceMappingURL=DragRegistry.js.map