@semcore/core 16.0.0-prerelease.9 → 16.0.1-prerelease.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/README.md +1 -31
  3. package/lib/{LastInteractionType.cjs → LastInteractionType.js} +4 -6
  4. package/lib/LastInteractionType.js.map +1 -0
  5. package/lib/LastInteractionType.mjs +1 -2
  6. package/lib/LastInteractionType.mjs.map +1 -1
  7. package/lib/core-types/Component.d.ts +11 -13
  8. package/lib/core-types/Component.js +88 -0
  9. package/lib/core-types/Component.js.map +1 -0
  10. package/lib/core-types/Component.mjs +11 -14
  11. package/lib/core-types/Component.mjs.map +1 -1
  12. package/lib/core-types/UnknownProperties.js +2 -0
  13. package/lib/core-types/UnknownProperties.js.map +1 -0
  14. package/lib/core-types/UnknownProperties.mjs.map +1 -1
  15. package/lib/core-types/reshadow.d.js +2 -0
  16. package/lib/core-types/reshadow.d.js.map +1 -0
  17. package/lib/core-types/reshadow.d.mjs.map +1 -1
  18. package/lib/core-types/symbols.js +16 -0
  19. package/lib/core-types/symbols.js.map +1 -0
  20. package/lib/core-types/symbols.mjs.map +1 -1
  21. package/lib/coreFactory.d.ts +4 -4
  22. package/lib/{coreFactory.cjs → coreFactory.js} +38 -39
  23. package/lib/coreFactory.js.map +1 -0
  24. package/lib/coreFactory.mjs +39 -34
  25. package/lib/coreFactory.mjs.map +1 -1
  26. package/lib/enhancement/{Children.cjs → Children.js} +10 -11
  27. package/lib/enhancement/Children.js.map +1 -0
  28. package/lib/enhancement/Children.mjs +8 -8
  29. package/lib/enhancement/Children.mjs.map +1 -1
  30. package/lib/enhancement/Root.d.ts +1 -1
  31. package/lib/enhancement/{Root.cjs → Root.js} +6 -7
  32. package/lib/enhancement/Root.js.map +1 -0
  33. package/lib/enhancement/Root.mjs +2 -6
  34. package/lib/enhancement/Root.mjs.map +1 -1
  35. package/lib/enhancement/bindHandler.d.ts +1 -1
  36. package/lib/enhancement/{bindHandler.cjs → bindHandler.js} +3 -4
  37. package/lib/enhancement/bindHandler.js.map +1 -0
  38. package/lib/enhancement/bindHandler.mjs +1 -1
  39. package/lib/enhancement/bindHandler.mjs.map +1 -1
  40. package/lib/enhancement/{dataName.cjs → dataName.js} +3 -4
  41. package/lib/enhancement/dataName.js.map +1 -0
  42. package/lib/enhancement/dataName.mjs.map +1 -1
  43. package/lib/enhancement/{enhance.cjs → enhance.js} +2 -3
  44. package/lib/enhancement/enhance.js.map +1 -0
  45. package/lib/enhancement/enhance.mjs.map +1 -1
  46. package/lib/enhancement/{functionDefaultProps.cjs → functionDefaultProps.js} +2 -3
  47. package/lib/enhancement/functionDefaultProps.js.map +1 -0
  48. package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
  49. package/lib/enhancement/hoistProps.d.ts +1 -1
  50. package/lib/enhancement/{hoistProps.cjs → hoistProps.js} +6 -8
  51. package/lib/enhancement/hoistProps.js.map +1 -0
  52. package/lib/enhancement/hoistProps.mjs +2 -2
  53. package/lib/enhancement/hoistProps.mjs.map +1 -1
  54. package/lib/enhancement/{i18n.cjs → i18n.js} +3 -4
  55. package/lib/enhancement/i18n.js.map +1 -0
  56. package/lib/enhancement/i18n.mjs.map +1 -1
  57. package/lib/enhancement/{inheritedName.cjs → inheritedName.js} +3 -4
  58. package/lib/enhancement/inheritedName.js.map +1 -0
  59. package/lib/enhancement/inheritedName.mjs.map +1 -1
  60. package/lib/enhancement/{staticChildren.cjs → staticChildren.js} +6 -9
  61. package/lib/enhancement/staticChildren.js.map +1 -0
  62. package/lib/enhancement/staticChildren.mjs +1 -1
  63. package/lib/enhancement/staticChildren.mjs.map +1 -1
  64. package/lib/enhancement/{style.cjs → style.js} +5 -7
  65. package/lib/enhancement/style.js.map +1 -0
  66. package/lib/enhancement/style.mjs +2 -3
  67. package/lib/enhancement/style.mjs.map +1 -1
  68. package/lib/enhancement/{uncontrolledProps.cjs → uncontrolledProps.js} +5 -7
  69. package/lib/enhancement/uncontrolledProps.js.map +1 -0
  70. package/lib/enhancement/uncontrolledProps.mjs +2 -3
  71. package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
  72. package/lib/esm/LastInteractionType.mjs +1 -2
  73. package/lib/esm/core-types/Component.mjs +11 -14
  74. package/lib/esm/coreFactory.mjs +39 -34
  75. package/lib/esm/enhancement/Children.mjs +8 -8
  76. package/lib/esm/enhancement/Root.mjs +2 -6
  77. package/lib/esm/enhancement/bindHandler.mjs +1 -1
  78. package/lib/esm/enhancement/hoistProps.mjs +2 -2
  79. package/lib/esm/enhancement/staticChildren.mjs +1 -1
  80. package/lib/esm/enhancement/style.mjs +2 -3
  81. package/lib/esm/enhancement/uncontrolledProps.mjs +2 -3
  82. package/lib/esm/index.mjs +3 -2
  83. package/lib/esm/register.mjs +1 -2
  84. package/lib/esm/styled/index.mjs +8 -0
  85. package/lib/esm/styled/reshadow-core.mjs +219 -3
  86. package/lib/esm/styled/sstyled.mjs +1 -1
  87. package/lib/esm/utils/assignProps.mjs +10 -0
  88. package/lib/esm/utils/createHoc.mjs +47 -0
  89. package/lib/esm/utils/enhances/WithI18n.mjs +41 -15
  90. package/lib/esm/utils/enhances/i18nEnhance.mjs +91 -0
  91. package/lib/esm/utils/getDisplayName.mjs +6 -0
  92. package/lib/esm/utils/logger.mjs +1 -2
  93. package/lib/esm/utils/ref.mjs +46 -2
  94. package/lib/index.d.ts +5 -5
  95. package/lib/{index.cjs → index.js} +5 -5
  96. package/lib/index.js.map +1 -0
  97. package/lib/index.mjs +3 -2
  98. package/lib/index.mjs.map +1 -1
  99. package/lib/{register.cjs → register.js} +5 -8
  100. package/lib/register.js.map +1 -0
  101. package/lib/register.mjs +1 -2
  102. package/lib/register.mjs.map +1 -1
  103. package/lib/styled/index.d.ts +1 -2
  104. package/lib/styled/{index.cjs → index.js} +1 -1
  105. package/lib/styled/index.js.map +1 -0
  106. package/lib/styled/index.mjs +8 -6
  107. package/lib/styled/index.mjs.map +1 -1
  108. package/lib/styled/{reshadow-core.cjs → reshadow-core.js} +28 -51
  109. package/lib/styled/reshadow-core.js.map +1 -0
  110. package/lib/styled/reshadow-core.mjs +219 -3
  111. package/lib/styled/reshadow-core.mjs.map +1 -1
  112. package/lib/styled/sstyled.d.ts +2 -2
  113. package/lib/styled/{sstyled.cjs → sstyled.js} +4 -4
  114. package/lib/styled/sstyled.js.map +1 -0
  115. package/lib/styled/sstyled.mjs +1 -1
  116. package/lib/styled/sstyled.mjs.map +1 -1
  117. package/lib/theme/dark.json +4 -4
  118. package/lib/theme/light.json +4 -44
  119. package/lib/theme/{processor.cjs → processor.js} +62 -64
  120. package/lib/theme/processor.js.map +1 -0
  121. package/lib/theme/processor.mjs +52 -53
  122. package/lib/theme/processor.mjs.map +1 -1
  123. package/lib/theme/themes/auto.css +228 -6
  124. package/lib/theme/themes/dark.css +114 -3
  125. package/lib/theme/themes/dark.d.ts +92 -1
  126. package/lib/theme/themes/{dark.cjs → dark.js} +95 -5
  127. package/lib/theme/themes/dark.js.map +1 -0
  128. package/lib/theme/themes/dark.mjs +93 -2
  129. package/lib/theme/themes/dark.mjs.map +1 -1
  130. package/lib/theme/themes/default.css +114 -3
  131. package/lib/theme/themes/default.d.ts +92 -1
  132. package/lib/theme/themes/{light.cjs → default.js} +95 -5
  133. package/lib/theme/themes/default.js.map +1 -0
  134. package/lib/theme/themes/default.mjs +93 -2
  135. package/lib/theme/themes/default.mjs.map +1 -1
  136. package/lib/theme/themes/light.css +114 -3
  137. package/lib/theme/themes/light.d.ts +92 -1
  138. package/lib/theme/themes/{default.cjs → light.js} +95 -5
  139. package/lib/theme/themes/light.js.map +1 -0
  140. package/lib/theme/themes/light.mjs +93 -2
  141. package/lib/theme/themes/light.mjs.map +1 -1
  142. package/lib/theme/utils.d.ts +2 -1
  143. package/lib/theme/{utils.cjs → utils.js} +37 -33
  144. package/lib/theme/utils.js.map +1 -0
  145. package/lib/theme/utils.mjs +31 -23
  146. package/lib/theme/utils.mjs.map +1 -1
  147. package/lib/utils/CSSinJS.d.ts +1 -1
  148. package/lib/utils/{CSSinJS.cjs → CSSinJS.js} +5 -6
  149. package/lib/utils/CSSinJS.js.map +1 -0
  150. package/lib/utils/CSSinJS.mjs +2 -2
  151. package/lib/utils/CSSinJS.mjs.map +1 -1
  152. package/lib/utils/ScreenReaderOnly.d.ts +1 -1
  153. package/lib/utils/{ScreenReaderOnly.cjs → ScreenReaderOnly.js} +3 -4
  154. package/lib/utils/ScreenReaderOnly.js.map +1 -0
  155. package/lib/utils/ScreenReaderOnly.mjs.map +1 -1
  156. package/lib/utils/ThemeProvider.d.ts +1 -1
  157. package/lib/utils/{ThemeProvider.cjs → ThemeProvider.js} +6 -10
  158. package/lib/utils/ThemeProvider.js.map +1 -0
  159. package/lib/utils/ThemeProvider.mjs.map +1 -1
  160. package/lib/utils/addonText.d.ts +1 -1
  161. package/lib/utils/{addonText.cjs → addonText.js} +2 -2
  162. package/lib/utils/addonText.js.map +1 -0
  163. package/lib/utils/addonText.mjs.map +1 -1
  164. package/lib/utils/addonTextChildren.d.ts +1 -1
  165. package/lib/utils/{addonTextChildren.cjs → addonTextChildren.js} +4 -5
  166. package/lib/utils/addonTextChildren.js.map +1 -0
  167. package/lib/utils/addonTextChildren.mjs +1 -1
  168. package/lib/utils/addonTextChildren.mjs.map +1 -1
  169. package/lib/utils/ariaProps.d.ts +1 -1
  170. package/lib/utils/{ariaProps.cjs → ariaProps.js} +1 -1
  171. package/lib/utils/ariaProps.js.map +1 -0
  172. package/lib/utils/ariaProps.mjs.map +1 -1
  173. package/lib/utils/assignProps.d.ts +1 -1
  174. package/lib/utils/{assignProps.cjs → assignProps.js} +3 -3
  175. package/lib/utils/assignProps.js.map +1 -0
  176. package/lib/utils/assignProps.mjs +10 -0
  177. package/lib/utils/assignProps.mjs.map +1 -1
  178. package/lib/utils/{canUseDOM.cjs → canUseDOM.js} +1 -1
  179. package/lib/utils/canUseDOM.js.map +1 -0
  180. package/lib/utils/canUseDOM.mjs.map +1 -1
  181. package/lib/utils/{capitalizeFirstLetter.cjs → capitalizeFirstLetter.js} +1 -1
  182. package/lib/utils/capitalizeFirstLetter.js.map +1 -0
  183. package/lib/utils/capitalizeFirstLetter.mjs.map +1 -1
  184. package/lib/utils/{color.cjs → color.js} +19 -19
  185. package/lib/utils/color.js.map +1 -0
  186. package/lib/utils/color.mjs +16 -15
  187. package/lib/utils/color.mjs.map +1 -1
  188. package/lib/utils/{compose.cjs → compose.js} +1 -1
  189. package/lib/utils/compose.js.map +1 -0
  190. package/lib/utils/compose.mjs.map +1 -1
  191. package/lib/utils/createHoc.d.ts +1 -1
  192. package/lib/utils/{createHoc.cjs → createHoc.js} +12 -12
  193. package/lib/utils/createHoc.js.map +1 -0
  194. package/lib/utils/createHoc.mjs +24 -23
  195. package/lib/utils/createHoc.mjs.map +1 -1
  196. package/lib/utils/{createUUID.cjs → createUUID.js} +1 -1
  197. package/lib/utils/createUUID.js.map +1 -0
  198. package/lib/utils/createUUID.mjs.map +1 -1
  199. package/lib/utils/cssToIntDefault.d.ts +1 -1
  200. package/lib/utils/{cssToIntDefault.cjs → cssToIntDefault.js} +3 -3
  201. package/lib/utils/cssToIntDefault.js.map +1 -0
  202. package/lib/utils/cssToIntDefault.mjs +2 -2
  203. package/lib/utils/cssToIntDefault.mjs.map +1 -1
  204. package/lib/utils/enhances/WithAutoFocus.d.ts +3 -3
  205. package/lib/utils/enhances/{WithAutoFocus.cjs → WithAutoFocus.js} +13 -13
  206. package/lib/utils/enhances/WithAutoFocus.js.map +1 -0
  207. package/lib/utils/enhances/WithAutoFocus.mjs +11 -9
  208. package/lib/utils/enhances/WithAutoFocus.mjs.map +1 -1
  209. package/lib/utils/enhances/WithCSS.d.ts +4 -4
  210. package/lib/utils/enhances/{WithCSS.cjs → WithCSS.js} +16 -21
  211. package/lib/utils/enhances/WithCSS.js.map +1 -0
  212. package/lib/utils/enhances/WithCSS.mjs +8 -8
  213. package/lib/utils/enhances/WithCSS.mjs.map +1 -1
  214. package/lib/utils/enhances/WithI18n.d.ts +3 -3
  215. package/lib/utils/enhances/{WithI18n.cjs → WithI18n.js} +20 -23
  216. package/lib/utils/enhances/WithI18n.js.map +1 -0
  217. package/lib/utils/enhances/WithI18n.mjs +41 -15
  218. package/lib/utils/enhances/WithI18n.mjs.map +1 -1
  219. package/lib/utils/enhances/WithKeyboardFocus.d.ts +4 -3
  220. package/lib/utils/enhances/{WithKeyboardFocus.cjs → WithKeyboardFocus.js} +29 -25
  221. package/lib/utils/enhances/WithKeyboardFocus.js.map +1 -0
  222. package/lib/utils/enhances/WithKeyboardFocus.mjs +26 -19
  223. package/lib/utils/enhances/WithKeyboardFocus.mjs.map +1 -1
  224. package/lib/utils/enhances/WithRef.d.ts +1 -1
  225. package/lib/utils/enhances/{WithRef.cjs → WithRef.js} +4 -5
  226. package/lib/utils/enhances/WithRef.js.map +1 -0
  227. package/lib/utils/enhances/WithRef.mjs +1 -1
  228. package/lib/utils/enhances/WithRef.mjs.map +1 -1
  229. package/lib/utils/enhances/{a11yEnhance.cjs → a11yEnhance.js} +10 -11
  230. package/lib/utils/enhances/a11yEnhance.js.map +1 -0
  231. package/lib/utils/enhances/a11yEnhance.mjs +7 -7
  232. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
  233. package/lib/utils/enhances/animatedSizeEnhance.d.ts +1 -1
  234. package/lib/utils/enhances/{animatedSizeEnhance.cjs → animatedSizeEnhance.js} +13 -11
  235. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -0
  236. package/lib/utils/enhances/animatedSizeEnhance.mjs +11 -7
  237. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
  238. package/lib/utils/enhances/autoFocusEnhance.d.ts +1 -1
  239. package/lib/utils/enhances/{autoFocusEnhance.cjs → autoFocusEnhance.js} +3 -4
  240. package/lib/utils/enhances/autoFocusEnhance.js.map +1 -0
  241. package/lib/utils/enhances/autoFocusEnhance.mjs.map +1 -1
  242. package/lib/utils/enhances/{contextEnhance.cjs → contextEnhance.js} +3 -4
  243. package/lib/utils/enhances/contextEnhance.js.map +1 -0
  244. package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
  245. package/lib/utils/enhances/i18nEnhance.d.ts +2 -2
  246. package/lib/utils/enhances/{i18nEnhance.cjs → i18nEnhance.js} +11 -11
  247. package/lib/utils/enhances/i18nEnhance.js.map +1 -0
  248. package/lib/utils/enhances/i18nEnhance.mjs +36 -37
  249. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
  250. package/lib/utils/enhances/keyboardFocusEnhance.d.ts +1 -1
  251. package/lib/utils/enhances/{keyboardFocusEnhance.cjs → keyboardFocusEnhance.js} +8 -8
  252. package/lib/utils/enhances/keyboardFocusEnhance.js.map +1 -0
  253. package/lib/utils/enhances/keyboardFocusEnhance.mjs +2 -2
  254. package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +1 -1
  255. package/lib/utils/enhances/{resolveColorEnhance.cjs → resolveColorEnhance.js} +5 -6
  256. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -0
  257. package/lib/utils/enhances/resolveColorEnhance.mjs +2 -2
  258. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
  259. package/lib/utils/{eventEmitter.cjs → eventEmitter.js} +3 -4
  260. package/lib/utils/eventEmitter.js.map +1 -0
  261. package/lib/utils/eventEmitter.mjs.map +1 -1
  262. package/lib/utils/findComponent.d.ts +2 -2
  263. package/lib/utils/{findComponent.cjs → findComponent.js} +15 -16
  264. package/lib/utils/findComponent.js.map +1 -0
  265. package/lib/utils/findComponent.mjs +12 -12
  266. package/lib/utils/findComponent.mjs.map +1 -1
  267. package/lib/utils/{fire.cjs → fire.js} +2 -2
  268. package/lib/utils/fire.js.map +1 -0
  269. package/lib/utils/fire.mjs.map +1 -1
  270. package/lib/utils/focus-lock/{focusBorders.cjs → focusBorders.js} +13 -17
  271. package/lib/utils/focus-lock/focusBorders.js.map +1 -0
  272. package/lib/utils/focus-lock/focusBorders.mjs +8 -8
  273. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
  274. package/lib/utils/focus-lock/{getFocusableIn.cjs → getFocusableIn.js} +3 -4
  275. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -0
  276. package/lib/utils/focus-lock/getFocusableIn.mjs +1 -1
  277. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
  278. package/lib/utils/focus-lock/{isFocusInside.cjs → isFocusInside.js} +2 -3
  279. package/lib/utils/focus-lock/isFocusInside.js.map +1 -0
  280. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
  281. package/lib/utils/focus-lock/{isFocusable.cjs → isFocusable.js} +3 -4
  282. package/lib/utils/focus-lock/isFocusable.js.map +1 -0
  283. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
  284. package/lib/utils/focus-lock/{setFocus.cjs → setFocus.js} +5 -6
  285. package/lib/utils/focus-lock/setFocus.js.map +1 -0
  286. package/lib/utils/focus-lock/setFocus.mjs +2 -2
  287. package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
  288. package/lib/utils/{getAccessibleName.cjs → getAccessibleName.js} +2 -2
  289. package/lib/utils/getAccessibleName.js.map +1 -0
  290. package/lib/utils/getAccessibleName.mjs.map +1 -1
  291. package/lib/utils/getDisplayName.d.ts +1 -1
  292. package/lib/utils/{getDisplayName.cjs → getDisplayName.js} +1 -1
  293. package/lib/utils/getDisplayName.js.map +1 -0
  294. package/lib/utils/getDisplayName.mjs +5 -3
  295. package/lib/utils/getDisplayName.mjs.map +1 -1
  296. package/lib/utils/{getEventTarget.cjs → getEventTarget.js} +3 -4
  297. package/lib/utils/getEventTarget.js.map +1 -0
  298. package/lib/utils/getEventTarget.mjs.map +1 -1
  299. package/lib/utils/{getOriginChildren.cjs → getOriginChildren.js} +4 -5
  300. package/lib/utils/getOriginChildren.js.map +1 -0
  301. package/lib/utils/getOriginChildren.mjs +1 -1
  302. package/lib/utils/getOriginChildren.mjs.map +1 -1
  303. package/lib/utils/{getRandomInt.cjs → getRandomInt.js} +1 -1
  304. package/lib/utils/getRandomInt.js.map +1 -0
  305. package/lib/utils/getRandomInt.mjs.map +1 -1
  306. package/lib/utils/{getValue.cjs → getValue.js} +2 -4
  307. package/lib/utils/getValue.js.map +1 -0
  308. package/lib/utils/getValue.mjs +1 -3
  309. package/lib/utils/getValue.mjs.map +1 -1
  310. package/lib/utils/{hasLabels.cjs → hasLabels.js} +6 -7
  311. package/lib/utils/hasLabels.js.map +1 -0
  312. package/lib/utils/hasLabels.mjs +3 -3
  313. package/lib/utils/hasLabels.mjs.map +1 -1
  314. package/lib/utils/{hasParent.cjs → hasParent.js} +3 -4
  315. package/lib/utils/hasParent.js.map +1 -0
  316. package/lib/utils/hasParent.mjs +3 -2
  317. package/lib/utils/hasParent.mjs.map +1 -1
  318. package/lib/utils/if.d.ts +2 -2
  319. package/lib/utils/{if.cjs → if.js} +2 -3
  320. package/lib/utils/if.js.map +1 -0
  321. package/lib/utils/if.mjs.map +1 -1
  322. package/lib/utils/ifChildren.d.ts +1 -1
  323. package/lib/utils/{ifChildren.cjs → ifChildren.js} +2 -3
  324. package/lib/utils/ifChildren.js.map +1 -0
  325. package/lib/utils/ifChildren.mjs.map +1 -1
  326. package/lib/utils/{injectStyle.cjs → injectStyle.js} +4 -6
  327. package/lib/utils/injectStyle.js.map +1 -0
  328. package/lib/utils/injectStyle.mjs +1 -2
  329. package/lib/utils/injectStyle.mjs.map +1 -1
  330. package/lib/utils/{inputProps.cjs → inputProps.js} +2 -3
  331. package/lib/utils/inputProps.js.map +1 -0
  332. package/lib/utils/inputProps.mjs.map +1 -1
  333. package/lib/utils/isInteractiveElement.d.ts +1 -0
  334. package/lib/utils/isInteractiveElement.js +34 -0
  335. package/lib/utils/isInteractiveElement.js.map +1 -0
  336. package/lib/utils/isInteractiveElement.mjs +28 -0
  337. package/lib/utils/isInteractiveElement.mjs.map +1 -0
  338. package/lib/utils/{isNode.cjs → isNode.js} +2 -2
  339. package/lib/utils/isNode.js.map +1 -0
  340. package/lib/utils/isNode.mjs.map +1 -1
  341. package/lib/utils/{isPromise.cjs → isPromise.js} +1 -1
  342. package/lib/utils/isPromise.js.map +1 -0
  343. package/lib/utils/isPromise.mjs.map +1 -1
  344. package/lib/utils/{isRetina.cjs → isRetina.js} +1 -1
  345. package/lib/utils/isRetina.js.map +1 -0
  346. package/lib/utils/isRetina.mjs.map +1 -1
  347. package/lib/utils/{logger.cjs → logger.js} +5 -8
  348. package/lib/utils/logger.js.map +1 -0
  349. package/lib/utils/logger.mjs +1 -2
  350. package/lib/utils/logger.mjs.map +1 -1
  351. package/lib/utils/{numericChecker.cjs → numericChecker.js} +1 -1
  352. package/lib/utils/numericChecker.js.map +1 -0
  353. package/lib/utils/numericChecker.mjs.map +1 -1
  354. package/lib/utils/{ownerDocument.cjs → ownerDocument.js} +1 -1
  355. package/lib/utils/ownerDocument.js.map +1 -0
  356. package/lib/utils/ownerDocument.mjs.map +1 -1
  357. package/lib/utils/{pick.cjs → pick.js} +1 -1
  358. package/lib/utils/pick.js.map +1 -0
  359. package/lib/utils/pick.mjs.map +1 -1
  360. package/lib/utils/propsForElement.d.ts +1 -1
  361. package/lib/utils/{propsForElement.cjs → propsForElement.js} +3 -4
  362. package/lib/utils/propsForElement.js.map +1 -0
  363. package/lib/utils/propsForElement.mjs.map +1 -1
  364. package/lib/utils/{rafTrottle.cjs → rafTrottle.js} +2 -3
  365. package/lib/utils/rafTrottle.js.map +1 -0
  366. package/lib/utils/rafTrottle.mjs.map +1 -1
  367. package/lib/utils/reactToText.d.ts +1 -1
  368. package/lib/utils/{reactToText.cjs → reactToText.js} +2 -3
  369. package/lib/utils/reactToText.js.map +1 -0
  370. package/lib/utils/reactToText.mjs.map +1 -1
  371. package/lib/utils/ref.d.ts +4 -2
  372. package/lib/utils/{ref.cjs → ref.js} +4 -3
  373. package/lib/utils/ref.js.map +1 -0
  374. package/lib/utils/ref.mjs +46 -2
  375. package/lib/utils/ref.mjs.map +1 -1
  376. package/lib/utils/{setRef.cjs → setRef.js} +2 -3
  377. package/lib/utils/setRef.js.map +1 -0
  378. package/lib/utils/setRef.mjs.map +1 -1
  379. package/lib/utils/{syncScroll.cjs → syncScroll.js} +3 -3
  380. package/lib/utils/syncScroll.js.map +1 -0
  381. package/lib/utils/syncScroll.mjs +1 -1
  382. package/lib/utils/syncScroll.mjs.map +1 -1
  383. package/lib/utils/uncontroll.d.ts +1 -1
  384. package/lib/utils/{uncontroll.cjs → uncontroll.js} +2 -2
  385. package/lib/utils/uncontroll.js.map +1 -0
  386. package/lib/utils/uncontroll.mjs.map +1 -1
  387. package/lib/utils/uniqueID.d.ts +1 -1
  388. package/lib/utils/{uniqueID.cjs → uniqueID.js} +6 -6
  389. package/lib/utils/uniqueID.js.map +1 -0
  390. package/lib/utils/uniqueID.mjs +3 -0
  391. package/lib/utils/uniqueID.mjs.map +1 -1
  392. package/lib/utils/use/{useColorResolver.cjs → useColorResolver.js} +8 -107
  393. package/lib/utils/use/useColorResolver.js.map +1 -0
  394. package/lib/utils/use/useColorResolver.mjs +5 -103
  395. package/lib/utils/use/useColorResolver.mjs.map +1 -1
  396. package/lib/utils/use/useCss.d.ts +1 -1
  397. package/lib/utils/use/{useCss.cjs → useCss.js} +3 -4
  398. package/lib/utils/use/useCss.js.map +1 -0
  399. package/lib/utils/use/useCss.mjs.map +1 -1
  400. package/lib/utils/use/{useEnhancedEffect.cjs → useEnhancedEffect.js} +3 -4
  401. package/lib/utils/use/useEnhancedEffect.js.map +1 -0
  402. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
  403. package/lib/utils/use/{useEventCallback.cjs → useEventCallback.js} +2 -2
  404. package/lib/utils/use/useEventCallback.js.map +1 -0
  405. package/lib/utils/use/useEventCallback.mjs.map +1 -1
  406. package/lib/utils/use/{useEventListener.cjs → useEventListener.js} +4 -5
  407. package/lib/utils/use/useEventListener.js.map +1 -0
  408. package/lib/utils/use/useEventListener.mjs +1 -1
  409. package/lib/utils/use/useEventListener.mjs.map +1 -1
  410. package/lib/utils/use/useFocusLock.d.ts +1 -1
  411. package/lib/utils/use/{useFocusLock.cjs → useFocusLock.js} +9 -12
  412. package/lib/utils/use/useFocusLock.js.map +1 -0
  413. package/lib/utils/use/useFocusLock.mjs +4 -4
  414. package/lib/utils/use/useFocusLock.mjs.map +1 -1
  415. package/lib/utils/use/{usePreventScroll.cjs → usePreventScroll.js} +3 -3
  416. package/lib/utils/use/usePreventScroll.js.map +1 -0
  417. package/lib/utils/use/usePreventScroll.mjs +1 -1
  418. package/lib/utils/use/usePreventScroll.mjs.map +1 -1
  419. package/lib/utils/useCssVariable.d.ts +2 -2
  420. package/lib/utils/{useCssVariable.cjs → useCssVariable.js} +4 -6
  421. package/lib/utils/useCssVariable.js.map +1 -0
  422. package/lib/utils/useCssVariable.mjs.map +1 -1
  423. package/lib/utils/{zIndexStacking.cjs → zIndexStacking.js} +7 -10
  424. package/lib/utils/zIndexStacking.js.map +1 -0
  425. package/lib/utils/zIndexStacking.mjs +2 -2
  426. package/lib/utils/zIndexStacking.mjs.map +1 -1
  427. package/package.json +45 -23
  428. package/vite.config.ts +1 -1
  429. package/lib/LastInteractionType.cjs.map +0 -1
  430. package/lib/core-types/Component.cjs +0 -59
  431. package/lib/core-types/Component.cjs.map +0 -1
  432. package/lib/core-types/UnknownProperties.cjs +0 -2
  433. package/lib/core-types/UnknownProperties.cjs.map +0 -1
  434. package/lib/core-types/reshadow.d.cjs +0 -2
  435. package/lib/core-types/reshadow.d.cjs.map +0 -1
  436. package/lib/core-types/symbols.cjs +0 -25
  437. package/lib/core-types/symbols.cjs.map +0 -1
  438. package/lib/coreFactory.cjs.map +0 -1
  439. package/lib/enhancement/Children.cjs.map +0 -1
  440. package/lib/enhancement/Root.cjs.map +0 -1
  441. package/lib/enhancement/bindHandler.cjs.map +0 -1
  442. package/lib/enhancement/dataName.cjs.map +0 -1
  443. package/lib/enhancement/enhance.cjs.map +0 -1
  444. package/lib/enhancement/functionDefaultProps.cjs.map +0 -1
  445. package/lib/enhancement/hoistProps.cjs.map +0 -1
  446. package/lib/enhancement/i18n.cjs.map +0 -1
  447. package/lib/enhancement/inheritedName.cjs.map +0 -1
  448. package/lib/enhancement/staticChildren.cjs.map +0 -1
  449. package/lib/enhancement/style.cjs.map +0 -1
  450. package/lib/enhancement/uncontrolledProps.cjs.map +0 -1
  451. package/lib/index.cjs.map +0 -1
  452. package/lib/register.cjs.map +0 -1
  453. package/lib/styled/index.cjs.map +0 -1
  454. package/lib/styled/reshadow-core.cjs.map +0 -1
  455. package/lib/styled/sstyled.cjs.map +0 -1
  456. package/lib/theme/processor.cjs.map +0 -1
  457. package/lib/theme/themes/dark.cjs.map +0 -1
  458. package/lib/theme/themes/default.cjs.map +0 -1
  459. package/lib/theme/themes/light.cjs.map +0 -1
  460. package/lib/theme/utils.cjs.map +0 -1
  461. package/lib/utils/CSSinJS.cjs.map +0 -1
  462. package/lib/utils/ScreenReaderOnly.cjs.map +0 -1
  463. package/lib/utils/ThemeProvider.cjs.map +0 -1
  464. package/lib/utils/addonText.cjs.map +0 -1
  465. package/lib/utils/addonTextChildren.cjs.map +0 -1
  466. package/lib/utils/ariaProps.cjs.map +0 -1
  467. package/lib/utils/assignProps.cjs.map +0 -1
  468. package/lib/utils/canUseDOM.cjs.map +0 -1
  469. package/lib/utils/capitalizeFirstLetter.cjs.map +0 -1
  470. package/lib/utils/color.cjs.map +0 -1
  471. package/lib/utils/compose.cjs.map +0 -1
  472. package/lib/utils/createHoc.cjs.map +0 -1
  473. package/lib/utils/createUUID.cjs.map +0 -1
  474. package/lib/utils/cssToIntDefault.cjs.map +0 -1
  475. package/lib/utils/enhances/WithAutoFocus.cjs.map +0 -1
  476. package/lib/utils/enhances/WithCSS.cjs.map +0 -1
  477. package/lib/utils/enhances/WithI18n.cjs.map +0 -1
  478. package/lib/utils/enhances/WithKeyboardFocus.cjs.map +0 -1
  479. package/lib/utils/enhances/WithRef.cjs.map +0 -1
  480. package/lib/utils/enhances/a11yEnhance.cjs.map +0 -1
  481. package/lib/utils/enhances/animatedSizeEnhance.cjs.map +0 -1
  482. package/lib/utils/enhances/autoFocusEnhance.cjs.map +0 -1
  483. package/lib/utils/enhances/contextEnhance.cjs.map +0 -1
  484. package/lib/utils/enhances/i18nEnhance.cjs.map +0 -1
  485. package/lib/utils/enhances/keyboardFocusEnhance.cjs.map +0 -1
  486. package/lib/utils/enhances/resolveColorEnhance.cjs.map +0 -1
  487. package/lib/utils/eventEmitter.cjs.map +0 -1
  488. package/lib/utils/findComponent.cjs.map +0 -1
  489. package/lib/utils/fire.cjs.map +0 -1
  490. package/lib/utils/focus-lock/focusBorders.cjs.map +0 -1
  491. package/lib/utils/focus-lock/getFocusableIn.cjs.map +0 -1
  492. package/lib/utils/focus-lock/isFocusInside.cjs.map +0 -1
  493. package/lib/utils/focus-lock/isFocusable.cjs.map +0 -1
  494. package/lib/utils/focus-lock/setFocus.cjs.map +0 -1
  495. package/lib/utils/getAccessibleName.cjs.map +0 -1
  496. package/lib/utils/getDisplayName.cjs.map +0 -1
  497. package/lib/utils/getEventTarget.cjs.map +0 -1
  498. package/lib/utils/getOriginChildren.cjs.map +0 -1
  499. package/lib/utils/getRandomInt.cjs.map +0 -1
  500. package/lib/utils/getValue.cjs.map +0 -1
  501. package/lib/utils/hasLabels.cjs.map +0 -1
  502. package/lib/utils/hasParent.cjs.map +0 -1
  503. package/lib/utils/if.cjs.map +0 -1
  504. package/lib/utils/ifChildren.cjs.map +0 -1
  505. package/lib/utils/injectStyle.cjs.map +0 -1
  506. package/lib/utils/inputProps.cjs.map +0 -1
  507. package/lib/utils/isNode.cjs.map +0 -1
  508. package/lib/utils/isPromise.cjs.map +0 -1
  509. package/lib/utils/isRetina.cjs.map +0 -1
  510. package/lib/utils/logger.cjs.map +0 -1
  511. package/lib/utils/numericChecker.cjs.map +0 -1
  512. package/lib/utils/ownerDocument.cjs.map +0 -1
  513. package/lib/utils/pick.cjs.map +0 -1
  514. package/lib/utils/propsForElement.cjs.map +0 -1
  515. package/lib/utils/rafTrottle.cjs.map +0 -1
  516. package/lib/utils/reactToText.cjs.map +0 -1
  517. package/lib/utils/ref.cjs.map +0 -1
  518. package/lib/utils/setRef.cjs.map +0 -1
  519. package/lib/utils/syncScroll.cjs.map +0 -1
  520. package/lib/utils/uncontroll.cjs.map +0 -1
  521. package/lib/utils/uniqueID.cjs.map +0 -1
  522. package/lib/utils/use/useColorResolver.cjs.map +0 -1
  523. package/lib/utils/use/useCss.cjs.map +0 -1
  524. package/lib/utils/use/useEnhancedEffect.cjs.map +0 -1
  525. package/lib/utils/use/useEventCallback.cjs.map +0 -1
  526. package/lib/utils/use/useEventListener.cjs.map +0 -1
  527. package/lib/utils/use/useFocusLock.cjs.map +0 -1
  528. package/lib/utils/use/usePreventScroll.cjs.map +0 -1
  529. package/lib/utils/useCssVariable.cjs.map +0 -1
  530. package/lib/utils/zIndexStacking.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"WithI18n.mjs","names":["React","Component","createContext","createHoc","useAsyncI18nMessages","createIntl","createIntlCache","Context","undefined","I18nProvider","Provider","I18nConsumer","Consumer","messagesCache","getText","dictionaries","locale","key","dictionary","WithI18n","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","selfLocale","_this$props","props","contextLocale","context","_createClass","value","render","_ref","children","useI18n","_React$useContext","fallbackDictionary","lang","useContext","resolvedDictionary","intl","useMemo","messages","useCallback","messageId","variables","formatMessage","id"],"sources":["../../../src/utils/enhances/WithI18n.tsx"],"sourcesContent":["import React, { Component, createContext } from 'react';\nimport createHoc from '../createHoc';\nimport { useAsyncI18nMessages } from './i18nEnhance';\nimport { UnknownProperties } from '../../core-types/UnknownProperties';\nimport { createIntl, createIntlCache } from '@formatjs/intl';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\nconst messagesCache = createIntlCache();\n\nfunction getText(dictionaries: Dictionary, locale: LocaleKeys) {\n return function (key: keyof DictionaryItem) {\n const dictionary = dictionaries[locale];\n return dictionary ? (dictionary as any)[key] : (dictionaries as any)['en'][key];\n };\n}\n\n/** @deprecated */\nexport interface IWithI18nInjectedProps extends WithI18nInjectedProps, UnknownProperties {}\nexport type WithI18nInjectedProps = {\n getText: WithI18n['getText'];\n};\n\n/** @deprecated */\nexport interface IWithI18nProps extends WithI18nProps, UnknownProperties {}\nexport type WithI18nProps = WithI18nInjectedProps & {\n locale?: LocaleKeys;\n\n children?(props: IWithI18nInjectedProps): React.ReactNode;\n};\n\n/**\n * @deprecated use `useI18n` instead\n */\nclass WithI18n extends Component<IWithI18nProps> {\n /* @ts-ignore */\n context: LocaleKeys;\n\n static contextType = Context;\n static defaultProps = {\n getText,\n };\n\n getText = (dictionary: Dictionary, selfLocale?: string): string => {\n const { locale, getText } = this.props;\n const contextLocale = this.context;\n return getText(dictionary, selfLocale || locale || contextLocale);\n };\n\n render() {\n const { children } = this.props as any;\n return children({\n getText: this.getText,\n });\n }\n}\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context) ?? locale;\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);\n const intl = React.useMemo(\n () => createIntl({ locale: lang, messages: resolvedDictionary }, messagesCache),\n [resolvedDictionary, lang],\n );\n\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return intl.formatMessage({ id: messageId ?? '' }, variables);\n },\n [intl],\n );\n};\n\nexport default createHoc(WithI18n);\nexport { useI18n, I18nProvider, I18nConsumer };\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,aAAa,QAAQ,OAAO;AACvD,OAAOC,SA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,MAAM,EAAEkC,IAAI;MAAEK,QAAQ,EAAEH;IAAmB,CAAC,EAAEvC,aAAa,CAAC;EAAA,GAC/E,CAACuC,kBAAkB,EAAEF,IAAI,CAAC,CAC3B;EAED,OAAOlD,KAAK,CAACwD,WAAW,CACtB,UAACC,SAAiB,EAAEC,SAA0D,EAAK;IACjF,OAAOL,IAAI,CAACM,aAAa,CAAC;MAAEC,EAAE,EAAEH,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI;IAAG,CAAC,EAAEC,SAAS,CAAC;EAC/D,CAAC,EACD,CAACL,IAAI,CAAC,CACP;AACH,CAAC;AAED,eAAelD,SAAS,CAACgB,QAAQ,CAAC;AAClC,SAAS4B,OAAO,EAAEtC,YAAY,EAAEE,YAAY"}
1
+ {"version":3,"file":"WithI18n.mjs","names":["createIntl","createIntlCache","React","Component","createContext","createHoc","useAsyncI18nMessages","Context","undefined","I18nProvider","Provider","I18nConsumer","Consumer","messagesCache","getText","dictionaries","locale","key","dictionary","WithI18n","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","selfLocale","_this$props","props","contextLocale","context","_inherits","_createClass","value","render","_ref","children","useI18n","_React$useContext","fallbackDictionary","lang","useContext","resolvedDictionary","intl","useMemo","messages","useCallback","messageId","variables","formatMessage","id"],"sources":["../../../src/utils/enhances/WithI18n.tsx"],"sourcesContent":["import { createIntl, createIntlCache } from '@formatjs/intl';\nimport React, { Component, createContext } from 'react';\n\nimport createHoc from '../createHoc';\nimport { useAsyncI18nMessages } from './i18nEnhance';\nimport type { UnknownProperties } from '../../core-types/UnknownProperties';\n\nexport type LocaleKeys = string;\nexport type DictionaryItem = { [key: string]: string };\nexport type Dictionary = { [locale: string]: DictionaryItem | (() => Promise<DictionaryItem>) };\nexport const Context = createContext<LocaleKeys | undefined>(undefined);\nconst { Provider: I18nProvider, Consumer: I18nConsumer } = Context;\nconst messagesCache = createIntlCache();\n\nfunction getText(dictionaries: Dictionary, locale: LocaleKeys) {\n return function (key: keyof DictionaryItem) {\n const dictionary = dictionaries[locale];\n return dictionary ? (dictionary as any)[key] : (dictionaries as any)['en'][key];\n };\n}\n\n/** @deprecated */\nexport interface IWithI18nInjectedProps extends WithI18nInjectedProps, UnknownProperties {}\nexport type WithI18nInjectedProps = {\n getText: WithI18n['getText'];\n};\n\n/** @deprecated */\nexport interface IWithI18nProps extends WithI18nProps, UnknownProperties {}\nexport type WithI18nProps = WithI18nInjectedProps & {\n locale?: LocaleKeys;\n\n children?(props: IWithI18nInjectedProps): React.ReactNode;\n};\n\n/**\n * @deprecated use `useI18n` instead\n */\nclass WithI18n extends Component<IWithI18nProps> {\n /* @ts-ignore */\n context: LocaleKeys;\n\n static contextType = Context;\n static defaultProps = {\n getText,\n };\n\n getText = (dictionary: Dictionary, selfLocale?: string): string => {\n const { locale, getText } = this.props;\n const contextLocale = this.context;\n return getText(dictionary, selfLocale || locale || contextLocale);\n };\n\n render() {\n const { children } = this.props as any;\n return children({\n getText: this.getText,\n });\n }\n}\n\nconst useI18n = (\n dictionary: Dictionary,\n locale: LocaleKeys = 'en',\n fallbackDictionary?: Dictionary,\n) => {\n const lang = React.useContext(Context) ?? locale;\n const resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);\n const intl = React.useMemo(\n () => createIntl({ locale: lang, messages: resolvedDictionary }, messagesCache),\n [resolvedDictionary, lang],\n );\n\n return React.useCallback(\n (messageId: string, variables?: { [key: string]: string | number | undefined }) => {\n return intl.formatMessage({ id: messageId ?? '' }, variables);\n },\n [intl],\n );\n};\n\nexport default createHoc(WithI18n);\nexport { useI18n, I18nProvider, I18nConsumer };\n"],"mappings":";;;;;;;;AAAA,SAASA,UAAU,EAAEC,eAAe,QAAQ,gBAAgB;AAC5D,OAAOC,KAAK,IAAIC,SAAS,EAAEC,aAAa,QAAQ,OAAO;AAEvD,OAAOC,SAAS,MAAM,kBAAc;AACpC,SAASC,oBAAoB,QAAQ,mBAAe;AAMpD,OAAO,IAA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L,IAAI,CAACM,aAAa,CAAC;MAAEC,EAAE,EAAEH,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI;IAAG,CAAC,EAAEC,SAAS,CAAC;EAC/D,CAAC,EACD,CAACL,IAAI,CACP,CAAC;AACH,CAAC;AAED,eAAe5C,SAAS,CAACc,QAAQ,CAAC;AAClC,SAASwB,OAAO,EAAElC,YAAY,EAAEE,YAAY","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import React, { PureComponent } from 'react';
2
- import { UnknownProperties } from '../../core-types/UnknownProperties';
1
+ import type React from 'react';
2
+ import { PureComponent } from 'react';
3
+ import type { UnknownProperties } from '../../core-types/UnknownProperties';
3
4
  /** @deprecated */
4
5
  export interface IEnhancedWithKeyboardFocusInjectedProps extends EnhancedWithKeyboardFocusInjectedProps {
5
6
  }
@@ -41,5 +42,5 @@ export declare class EnhancedWithKeyboardFocus extends PureComponent<IEnhancedWi
41
42
  handlerMouseDown: (e: MouseEvent) => void;
42
43
  render(): React.ReactNode;
43
44
  }
44
- declare const _default: (options?: {} | undefined) => (WrappedComponent: React.ComponentType) => React.ComponentClass<{}, any>;
45
+ declare const _default: (options?: {}) => (WrappedComponent: React.ComponentType) => React.ComponentClass;
45
46
  export default _default;
@@ -1,59 +1,66 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports["default"] = exports.EnhancedWithKeyboardFocus = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
10
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
12
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
11
13
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
13
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
15
  var _react = require("react");
15
16
  var _createHoc = _interopRequireDefault(require("../createHoc"));
16
- var _uncontroll = require("../uncontroll");
17
17
  var _fire = _interopRequireDefault(require("../fire"));
18
+ var _uncontroll = require("../uncontroll");
19
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
20
+ /** @deprecated */
21
+
22
+ /** @deprecated */
23
+
24
+ /** @deprecated */
25
+
18
26
  var usingKeyBoard = true;
19
- var EnhancedWithKeyboardFocus = /*#__PURE__*/function (_PureComponent) {
20
- (0, _inherits2["default"])(EnhancedWithKeyboardFocus, _PureComponent);
21
- var _super = (0, _createSuper2["default"])(EnhancedWithKeyboardFocus);
27
+ var EnhancedWithKeyboardFocus = exports.EnhancedWithKeyboardFocus = /*#__PURE__*/function (_PureComponent) {
22
28
  function EnhancedWithKeyboardFocus() {
23
29
  var _this;
24
30
  (0, _classCallCheck2["default"])(this, EnhancedWithKeyboardFocus);
25
31
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
32
  args[_key] = arguments[_key];
27
33
  }
28
- _this = _super.call.apply(_super, [this].concat(args));
29
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
34
+ _this = _callSuper(this, EnhancedWithKeyboardFocus, [].concat(args));
35
+ (0, _defineProperty2["default"])(_this, "state", {
30
36
  keyboardFocused: false
31
37
  });
32
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerFocus", function (e) {
33
- (0, _fire["default"])((0, _assertThisInitialized2["default"])(_this), 'onFocus', e);
38
+ (0, _defineProperty2["default"])(_this, "handlerFocus", function (e) {
39
+ (0, _fire["default"])(_this, 'onFocus', e);
34
40
  if (usingKeyBoard) {
35
- (0, _uncontroll.internalSetState)((0, _assertThisInitialized2["default"])(_this), {
41
+ (0, _uncontroll.internalSetState)(_this, {
36
42
  keyboardFocused: true
37
43
  });
38
44
  }
39
45
  });
40
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerBlur", function (e) {
41
- (0, _fire["default"])((0, _assertThisInitialized2["default"])(_this), 'onBlur', e);
42
- (0, _uncontroll.internalSetState)((0, _assertThisInitialized2["default"])(_this), {
46
+ (0, _defineProperty2["default"])(_this, "handlerBlur", function (e) {
47
+ (0, _fire["default"])(_this, 'onBlur', e);
48
+ (0, _uncontroll.internalSetState)(_this, {
43
49
  keyboardFocused: false
44
50
  });
45
51
  });
46
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerKeyDown", function (e) {
47
- (0, _fire["default"])((0, _assertThisInitialized2["default"])(_this), 'onKeyDown', e);
52
+ (0, _defineProperty2["default"])(_this, "handlerKeyDown", function (e) {
53
+ (0, _fire["default"])(_this, 'onKeyDown', e);
48
54
  usingKeyBoard = true;
49
55
  });
50
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerMouseDown", function (e) {
51
- (0, _fire["default"])((0, _assertThisInitialized2["default"])(_this), 'onMouseDown', e);
56
+ (0, _defineProperty2["default"])(_this, "handlerMouseDown", function (e) {
57
+ (0, _fire["default"])(_this, 'onMouseDown', e);
52
58
  usingKeyBoard = false;
53
59
  });
54
60
  return _this;
55
61
  }
56
- (0, _createClass2["default"])(EnhancedWithKeyboardFocus, [{
62
+ (0, _inherits2["default"])(EnhancedWithKeyboardFocus, _PureComponent);
63
+ return (0, _createClass2["default"])(EnhancedWithKeyboardFocus, [{
57
64
  key: "render",
58
65
  value: function render() {
59
66
  var _this$props = this.props,
@@ -81,13 +88,10 @@ var EnhancedWithKeyboardFocus = /*#__PURE__*/function (_PureComponent) {
81
88
  return state;
82
89
  }
83
90
  }]);
84
- return EnhancedWithKeyboardFocus;
85
91
  }(_react.PureComponent);
86
- exports.EnhancedWithKeyboardFocus = EnhancedWithKeyboardFocus;
87
92
  (0, _defineProperty2["default"])(EnhancedWithKeyboardFocus, "displayName", 'EnhancedWithKeyboardFocus');
88
93
  (0, _defineProperty2["default"])(EnhancedWithKeyboardFocus, "defaultProps", {
89
94
  tabIndex: 0
90
95
  });
91
- var _default = (0, _createHoc["default"])(EnhancedWithKeyboardFocus);
92
- exports["default"] = _default;
93
- //# sourceMappingURL=WithKeyboardFocus.cjs.map
96
+ var _default = exports["default"] = (0, _createHoc["default"])(EnhancedWithKeyboardFocus);
97
+ //# sourceMappingURL=WithKeyboardFocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithKeyboardFocus.js","names":["_react","require","_createHoc","_interopRequireDefault","_fire","_uncontroll","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","usingKeyBoard","EnhancedWithKeyboardFocus","exports","_PureComponent","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","keyboardFocused","fire","internalSetState","_inherits2","_createClass2","key","value","render","_this$props","props","children","tabIndex","disabled","state","onFocus","handlerFocus","onBlur","handlerBlur","onKeyDown","handlerKeyDown","onMouseDown","handlerMouseDown","getDerivedStateFromProps","undefined","PureComponent","_default","createHoc"],"sources":["../../../src/utils/enhances/WithKeyboardFocus.tsx"],"sourcesContent":["import type React from 'react';\nimport { PureComponent } from 'react';\n\nimport type { UnknownProperties } from '../../core-types/UnknownProperties';\nimport createHoc from '../createHoc';\nimport fire from '../fire';\nimport { internalSetState } from '../uncontroll';\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusInjectedProps\n extends EnhancedWithKeyboardFocusInjectedProps {}\nexport type EnhancedWithKeyboardFocusInjectedProps = {\n tabIndex: number;\n keyboardFocused: boolean;\n\n onFocus(e: FocusEvent): void;\n\n onBlur(e: FocusEvent): void;\n\n onKeyDown(e: KeyboardEvent): void;\n\n onMouseDown(e: MouseEvent): void;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusProps\n extends EnhancedWithKeyboardFocusProps,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusProps = {\n keyboardFocused?: boolean;\n tabIndex?: number;\n disabled?: boolean;\n\n children(props: IEnhancedWithKeyboardFocusInjectedProps): React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusState\n extends EnhancedWithKeyboardFocusState,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusState = {\n keyboardFocused: boolean;\n};\n\nlet usingKeyBoard = true;\n\nexport class EnhancedWithKeyboardFocus extends PureComponent<\n IEnhancedWithKeyboardFocusProps,\n IEnhancedWithKeyboardFocusState\n> {\n static displayName = 'EnhancedWithKeyboardFocus';\n\n static defaultProps = {\n tabIndex: 0,\n };\n\n static getDerivedStateFromProps(props: any, state: any) {\n if (props.keyboardFocused !== undefined) {\n return {\n keyboardFocused: props.keyboardFocused,\n };\n }\n return state;\n }\n\n state = {\n keyboardFocused: false,\n };\n\n handlerFocus = (e: FocusEvent) => {\n fire(this, 'onFocus', e);\n if (usingKeyBoard) {\n internalSetState(this, { keyboardFocused: true });\n }\n };\n\n handlerBlur = (e: FocusEvent) => {\n fire(this, 'onBlur', e);\n internalSetState(this, { keyboardFocused: false });\n };\n\n handlerKeyDown = (e: KeyboardEvent) => {\n fire(this, 'onKeyDown', e);\n usingKeyBoard = true;\n };\n\n handlerMouseDown = (e: MouseEvent) => {\n fire(this, 'onMouseDown', e);\n usingKeyBoard = false;\n };\n\n render() {\n const { children, tabIndex, disabled } = this.props;\n const { keyboardFocused } = this.state;\n return children({\n tabIndex: disabled ? -1 : tabIndex!,\n keyboardFocused,\n onFocus: this.handlerFocus,\n onBlur: this.handlerBlur,\n onKeyDown: this.handlerKeyDown,\n onMouseDown: this.handlerMouseDown,\n });\n }\n}\n\nexport default createHoc(EnhancedWithKeyboardFocus);\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAAiD,SAAAK,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAEjD;;AAgBA;;AAYA;;AAQA,IAAIQ,aAAa,GAAG,IAAI;AAAC,IAEZC,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,0BAAAE,cAAA;EAAA,SAAAF,0BAAA;IAAA,IAAAG,KAAA;IAAA,IAAAC,gBAAA,mBAAAJ,yBAAA;IAAA,SAAAK,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAf,UAAA,OAAAY,yBAAA,KAAAW,MAAA,CAAAH,IAAA;IAAA,IAAAI,gBAAA,aAAAT,KAAA,WAmB5B;MACNU,eAAe,EAAE;IACnB,CAAC;IAA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ACdC,QAAQ,EAAEC,QAAQ,GAAG,CAAC,CAAC,GAAGD,QAAS;QACnCX,eAAe,EAAfA,eAAe;QACfc,OAAO,EAAE,IAAI,CAACC,YAAY;QAC1BC,MAAM,EAAE,IAAI,CAACC,WAAW;QACxBC,SAAS,EAAE,IAAI,CAACC,cAAc;QAC9BC,WAAW,EAAE,IAAI,CAACC;MACpB,CAAC,CAAC;IACJ;EAAC;IAAAhB,GAAA;IAAAC,KAAA,EA9CD,SAAOgB,wBAAwBA,CAACb,KAAU,EAAEI,KAAU,EAAE;MACtD,IAAIJ,KAAK,CAACT,eAAe,KAAKuB,SAAS,EAAE;QACvC,OAAO;UACLvB,eAAe,EAAES,KAAK,CAACT;QACzB,CAAC;MACH;MACA,OAAOa,KAAK;IACd;EAAC;AAAA,EAjB4CW,oBAAa;AAAA,IAAAzB,gBAAA,aAA/CZ,yBAAyB,iBAIf,2BAA2B;AAAA,IAAAY,gBAAA,aAJrCZ,yBAAyB,kBAMd;EACpBwB,QAAQ,EAAE;AACZ,CAAC;AAAA,IAAAc,QAAA,GAAArC,OAAA,cAmDY,IAAAsC,qBAAS,EAACvC,yBAAyB,CAAC","ignoreList":[]}
@@ -1,52 +1,60 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
4
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
4
6
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
9
  import { PureComponent } from 'react';
8
10
  import createHoc from "../createHoc.mjs";
9
- import { internalSetState } from "../uncontroll.mjs";
10
11
  import fire from "../fire.mjs";
12
+ import { internalSetState } from "../uncontroll.mjs";
13
+
14
+ /** @deprecated */
15
+
16
+ /** @deprecated */
17
+
18
+ /** @deprecated */
19
+
11
20
  var usingKeyBoard = true;
12
21
  export var EnhancedWithKeyboardFocus = /*#__PURE__*/function (_PureComponent) {
13
- _inherits(EnhancedWithKeyboardFocus, _PureComponent);
14
- var _super = _createSuper(EnhancedWithKeyboardFocus);
15
22
  function EnhancedWithKeyboardFocus() {
16
23
  var _this;
17
24
  _classCallCheck(this, EnhancedWithKeyboardFocus);
18
25
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
19
26
  args[_key] = arguments[_key];
20
27
  }
21
- _this = _super.call.apply(_super, [this].concat(args));
22
- _defineProperty(_assertThisInitialized(_this), "state", {
28
+ _this = _callSuper(this, EnhancedWithKeyboardFocus, [].concat(args));
29
+ _defineProperty(_this, "state", {
23
30
  keyboardFocused: false
24
31
  });
25
- _defineProperty(_assertThisInitialized(_this), "handlerFocus", function (e) {
26
- fire(_assertThisInitialized(_this), 'onFocus', e);
32
+ _defineProperty(_this, "handlerFocus", function (e) {
33
+ fire(_this, 'onFocus', e);
27
34
  if (usingKeyBoard) {
28
- internalSetState(_assertThisInitialized(_this), {
35
+ internalSetState(_this, {
29
36
  keyboardFocused: true
30
37
  });
31
38
  }
32
39
  });
33
- _defineProperty(_assertThisInitialized(_this), "handlerBlur", function (e) {
34
- fire(_assertThisInitialized(_this), 'onBlur', e);
35
- internalSetState(_assertThisInitialized(_this), {
40
+ _defineProperty(_this, "handlerBlur", function (e) {
41
+ fire(_this, 'onBlur', e);
42
+ internalSetState(_this, {
36
43
  keyboardFocused: false
37
44
  });
38
45
  });
39
- _defineProperty(_assertThisInitialized(_this), "handlerKeyDown", function (e) {
40
- fire(_assertThisInitialized(_this), 'onKeyDown', e);
46
+ _defineProperty(_this, "handlerKeyDown", function (e) {
47
+ fire(_this, 'onKeyDown', e);
41
48
  usingKeyBoard = true;
42
49
  });
43
- _defineProperty(_assertThisInitialized(_this), "handlerMouseDown", function (e) {
44
- fire(_assertThisInitialized(_this), 'onMouseDown', e);
50
+ _defineProperty(_this, "handlerMouseDown", function (e) {
51
+ fire(_this, 'onMouseDown', e);
45
52
  usingKeyBoard = false;
46
53
  });
47
54
  return _this;
48
55
  }
49
- _createClass(EnhancedWithKeyboardFocus, [{
56
+ _inherits(EnhancedWithKeyboardFocus, _PureComponent);
57
+ return _createClass(EnhancedWithKeyboardFocus, [{
50
58
  key: "render",
51
59
  value: function render() {
52
60
  var _this$props = this.props,
@@ -74,7 +82,6 @@ export var EnhancedWithKeyboardFocus = /*#__PURE__*/function (_PureComponent) {
74
82
  return state;
75
83
  }
76
84
  }]);
77
- return EnhancedWithKeyboardFocus;
78
85
  }(PureComponent);
79
86
  _defineProperty(EnhancedWithKeyboardFocus, "displayName", 'EnhancedWithKeyboardFocus');
80
87
  _defineProperty(EnhancedWithKeyboardFocus, "defaultProps", {
@@ -1 +1 @@
1
- {"version":3,"file":"WithKeyboardFocus.mjs","names":["PureComponent","createHoc","internalSetState","fire","usingKeyBoard","EnhancedWithKeyboardFocus","_PureComponent","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","keyboardFocused","e","_createClass","key","value","render","_this$props","props","children","tabIndex","disabled","state","onFocus","handlerFocus","onBlur","handlerBlur","onKeyDown","handlerKeyDown","onMouseDown","handlerMouseDown","getDerivedStateFromProps","undefined"],"sources":["../../../src/utils/enhances/WithKeyboardFocus.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport createHoc from '../createHoc';\nimport { internalSetState } from '../uncontroll';\nimport fire from '../fire';\nimport { UnknownProperties } from '../../core-types/UnknownProperties';\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusInjectedProps\n extends EnhancedWithKeyboardFocusInjectedProps {}\nexport type EnhancedWithKeyboardFocusInjectedProps = {\n tabIndex: number;\n keyboardFocused: boolean;\n\n onFocus(e: FocusEvent): void;\n\n onBlur(e: FocusEvent): void;\n\n onKeyDown(e: KeyboardEvent): void;\n\n onMouseDown(e: MouseEvent): void;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusProps\n extends EnhancedWithKeyboardFocusProps,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusProps = {\n keyboardFocused?: boolean;\n tabIndex?: number;\n disabled?: boolean;\n\n children(props: IEnhancedWithKeyboardFocusInjectedProps): React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusState\n extends EnhancedWithKeyboardFocusState,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusState = {\n keyboardFocused: boolean;\n};\n\nlet usingKeyBoard = true;\n\nexport class EnhancedWithKeyboardFocus extends PureComponent<\n IEnhancedWithKeyboardFocusProps,\n IEnhancedWithKeyboardFocusState\n> {\n static displayName = 'EnhancedWithKeyboardFocus';\n\n static defaultProps = {\n tabIndex: 0,\n };\n\n static getDerivedStateFromProps(props: any, state: any) {\n if (props.keyboardFocused !== undefined) {\n return {\n keyboardFocused: props.keyboardFocused,\n };\n }\n return state;\n }\n\n state = {\n keyboardFocused: false,\n };\n\n handlerFocus = (e: FocusEvent) => {\n fire(this, 'onFocus', e);\n if (usingKeyBoard) {\n internalSetState(this, { keyboardFocused: true });\n }\n };\n\n handlerBlur = (e: FocusEvent) => {\n fire(this, 'onBlur', e);\n internalSetState(this, { keyboardFocused: false });\n };\n\n handlerKeyDown = (e: KeyboardEvent) => {\n fire(this, 'onKeyDown', e);\n usingKeyBoard = true;\n };\n\n handlerMouseDown = (e: MouseEvent) => {\n fire(this, 'onMouseDown', e);\n usingKeyBoard = false;\n };\n\n render() {\n const { children, tabIndex, disabled } = this.props;\n const { keyboardFocused } = this.state;\n return children({\n tabIndex: disabled ? -1 : tabIndex!,\n keyboardFocused,\n onFocus: this.handlerFocus,\n onBlur: this.handlerBlur,\n onKeyDown: this.handlerKeyDown,\n onMouseDown: this.handlerMouseDown,\n });\n }\n}\n\nexport default createHoc(EnhancedWithKeyboardFocus);\n"],"mappings":";;;;;;AAAA,SAAgBA,aAAa,QAAQ,OAAO;AAC5C,OAAOC,SAAS,MAAM,kBAAc;AACpC,SAASC,gBAAgB,QAAQ,mBAAe;AAChD,OAAOC,IAAI,MAAM,aAAS;AAuC1B,IAAIC,aAAa,GAAG,IAAI;AAExB,WAAaC,yBAAyB,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,yBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,yBAAA;EAAA,SAAAA,0BAAA;IAAA,IAAAK,KAAA;IAAAC,eAAA,OAAAN,yBAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAL,IAAA;IAAAM,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,YAmB5B;MACNa,eAAe,EAAE;IACnB,CAAC;IAAAF,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,mBAEc,UAACc,CAAa,EAAK;MAChCrB,IAAI,CAAAmB,sBAAA,CAAAZ,KAAA,GAAO,SAAS,EAAEc,CAAC,CAAC;MACxB,IAAIpB,aAAa,EAAE;QACjBF,gBAAgB,CAAAoB,sBAAA,CAAAZ,KAAA,GAAO;UAAEa,eAAe,EAAE;QAAK,CAAC,CAAC;MACnD;IACF,CAAC;IA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C;IAAAhB,GAAA;IAAAC,KAAA,EA9CD,SAAAgB,yBAAgCb,KAAU,EAAEI,KAAU,EAAE;MACtD,IAAIJ,KAAK,CAACP,eAAe,KAAKqB,SAAS,EAAE;QACvC,OAAO;UACLrB,eAAe,EAAEO,KAAK,CAACP;QACzB,CAAC;MACH;MACA,OAAOW,KAAK;IACd;EAAC;EAAA,OAAA7B,yBAAA;AAAA,EAjB4CL,aAAa;AAyD3DqB,eAAA,CAzDYhB,yBAAyB,iBAIf,2BAA2B;AAAAgB,eAAA,CAJrChB,yBAAyB,kBAMd;EACpB2B,QAAQ,EAAE;AACZ,CAAC;AAmDH,eAAe/B,SAAS,CAACI,yBAAyB,CAAC"}
1
+ {"version":3,"file":"WithKeyboardFocus.mjs","names":["PureComponent","createHoc","fire","internalSetState","usingKeyBoard","EnhancedWithKeyboardFocus","_PureComponent","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","keyboardFocused","e","_inherits","_createClass","key","value","render","_this$props","props","children","tabIndex","disabled","state","onFocus","handlerFocus","onBlur","handlerBlur","onKeyDown","handlerKeyDown","onMouseDown","handlerMouseDown","getDerivedStateFromProps","undefined"],"sources":["../../../src/utils/enhances/WithKeyboardFocus.tsx"],"sourcesContent":["import type React from 'react';\nimport { PureComponent } from 'react';\n\nimport type { UnknownProperties } from '../../core-types/UnknownProperties';\nimport createHoc from '../createHoc';\nimport fire from '../fire';\nimport { internalSetState } from '../uncontroll';\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusInjectedProps\n extends EnhancedWithKeyboardFocusInjectedProps {}\nexport type EnhancedWithKeyboardFocusInjectedProps = {\n tabIndex: number;\n keyboardFocused: boolean;\n\n onFocus(e: FocusEvent): void;\n\n onBlur(e: FocusEvent): void;\n\n onKeyDown(e: KeyboardEvent): void;\n\n onMouseDown(e: MouseEvent): void;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusProps\n extends EnhancedWithKeyboardFocusProps,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusProps = {\n keyboardFocused?: boolean;\n tabIndex?: number;\n disabled?: boolean;\n\n children(props: IEnhancedWithKeyboardFocusInjectedProps): React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IEnhancedWithKeyboardFocusState\n extends EnhancedWithKeyboardFocusState,\n UnknownProperties {}\nexport type EnhancedWithKeyboardFocusState = {\n keyboardFocused: boolean;\n};\n\nlet usingKeyBoard = true;\n\nexport class EnhancedWithKeyboardFocus extends PureComponent<\n IEnhancedWithKeyboardFocusProps,\n IEnhancedWithKeyboardFocusState\n> {\n static displayName = 'EnhancedWithKeyboardFocus';\n\n static defaultProps = {\n tabIndex: 0,\n };\n\n static getDerivedStateFromProps(props: any, state: any) {\n if (props.keyboardFocused !== undefined) {\n return {\n keyboardFocused: props.keyboardFocused,\n };\n }\n return state;\n }\n\n state = {\n keyboardFocused: false,\n };\n\n handlerFocus = (e: FocusEvent) => {\n fire(this, 'onFocus', e);\n if (usingKeyBoard) {\n internalSetState(this, { keyboardFocused: true });\n }\n };\n\n handlerBlur = (e: FocusEvent) => {\n fire(this, 'onBlur', e);\n internalSetState(this, { keyboardFocused: false });\n };\n\n handlerKeyDown = (e: KeyboardEvent) => {\n fire(this, 'onKeyDown', e);\n usingKeyBoard = true;\n };\n\n handlerMouseDown = (e: MouseEvent) => {\n fire(this, 'onMouseDown', e);\n usingKeyBoard = false;\n };\n\n render() {\n const { children, tabIndex, disabled } = this.props;\n const { keyboardFocused } = this.state;\n return children({\n tabIndex: disabled ? -1 : tabIndex!,\n keyboardFocused,\n onFocus: this.handlerFocus,\n onBlur: this.handlerBlur,\n onKeyDown: this.handlerKeyDown,\n onMouseDown: this.handlerMouseDown,\n });\n }\n}\n\nexport default createHoc(EnhancedWithKeyboardFocus);\n"],"mappings":";;;;;;;;AACA,SAASA,aAAa,QAAQ,OAAO;AAGrC,OAAOC,SAAS,MAAM,kBAAc;AACpC,OAAOC,IAAI,MAAM,aAAS;AAC1B,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,KAAK;IACvB,CAAC;IAAA,OAAAG,KAAA;EAAA;EAAAa,SAAA,CAAAf,yBAAA,EAAAC,cAAA;EAAA,OAAAe,YAAA,CAAAhB,yBAAA;IAAAiB,GAAA;IAAAC,KAAA,EAED,SAAAC,MAAMA,CAAA,EAAG;MACP,IAAAC,WAAA,GAAyC,IAAI,CAACC,KAAK;QAA3CC,QAAQ,GAAAF,WAAA,CAARE,QAAQ;QAAEC,QAAQ,GAAAH,WAAA,CAARG,QAAQ;QAAEC,QAAQ,GAAAJ,WAAA,CAARI,QAAQ;MACpC,IAAQX,eAAe,GAAK,IAAI,CAACY,KAAK,CAA9BZ,eAAe;MACvB,OAAOS,QAAQ,CAAC;QACdC,QAAQ,EAAEC,QAAQ,GAAG,CAAC,CAAC,GAAGD,QAAS;QACnCV,eAAe,EAAfA,eAAe;QACfa,OAAO,EAAE,IAAI,CAACC,YAAY;QAC1BC,MAAM,EAAE,IAAI,CAACC,WAAW;QACxBC,SAAS,EAAE,IAAI,CAACC,cAAc;QAC9BC,WAAW,EAAE,IAAI,CAACC;MACpB,CAAC,CAAC;IACJ;EAAC;IAAAhB,GAAA;IAAAC,KAAA,EA9CD,SAAOgB,wBAAwBA,CAACb,KAAU,EAAEI,KAAU,EAAE;MACtD,IAAIJ,KAAK,CAACR,eAAe,KAAKsB,SAAS,EAAE;QACvC,OAAO;UACLtB,eAAe,EAAEQ,KAAK,CAACR;QACzB,CAAC;MACH;MACA,OAAOY,KAAK;IACd;EAAC;AAAA,EAjB4C9B,aAAa;AAyD3DiB,eAAA,CAzDYZ,yBAAyB,iBAIf,2BAA2B;AAAAY,eAAA,CAJrCZ,yBAAyB,kBAMd;EACpBuB,QAAQ,EAAE;AACZ,CAAC;AAmDH,eAAe3B,SAAS,CAACI,yBAAyB,CAAC","ignoreList":[]}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare function WithForwardRef(): <T extends React.ComponentType<{}>>(Component: T) => any;
2
+ declare function WithForwardRef(): <T extends React.ComponentType>(Component: T) => any;
3
3
  export default WithForwardRef;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports["default"] = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
9
10
  var _react = _interopRequireDefault(require("react"));
10
11
  var _getDisplayName = _interopRequireDefault(require("../getDisplayName"));
11
- var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
12
12
  function WithForwardRef() {
13
13
  return function ForwardRef(Component) {
14
14
  var Wrapped = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
@@ -21,6 +21,5 @@ function WithForwardRef() {
21
21
  return (0, _hoistNonReactStatics["default"])(Wrapped, Component);
22
22
  };
23
23
  }
24
- var _default = WithForwardRef;
25
- exports["default"] = _default;
26
- //# sourceMappingURL=WithRef.cjs.map
24
+ var _default = exports["default"] = WithForwardRef;
25
+ //# sourceMappingURL=WithRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithRef.js","names":["_hoistNonReactStatics","_interopRequireDefault","require","_react","_getDisplayName","WithForwardRef","ForwardRef","Component","Wrapped","React","forwardRef","props","ref","createElement","_extends2","defaultProps","forwardedRef","displayName","getDisplayName","hoistNonReactStatics","_default","exports"],"sources":["../../../src/utils/enhances/WithRef.tsx"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport React from 'react';\n\nimport getDisplayName from '../getDisplayName';\n\nfunction WithForwardRef() {\n return function ForwardRef<T extends React.ComponentType>(Component: T) {\n const Wrapped = React.forwardRef((props, ref) => {\n // @ts-ignore\n return <Component {...(Component.defaultProps || {})} {...props} forwardedRef={ref} />;\n });\n Wrapped.displayName = getDisplayName(Component);\n return hoistNonReactStatics(Wrapped, Component) as any;\n };\n}\n\nexport default WithForwardRef;\n"],"mappings":";;;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,SAASG,cAAcA,CAAA,EAAG;EACxB,OAAO,SAASC,UAAUA,CAAgCC,SAAY,EAAE;IACtE,IAAMC,OAAO,gBAAGC,iBAAK,CAACC,UAAU,CAAC,UAACC,KAAK,EAAEC,GAAG,EAAK;MAC/C;MACA,oBAAOT,MAAA,YAAAU,aAAA,CAACN,SAAS,MAAAO,SAAA,iBAAMP,SAAS,CAACQ,YAAY,IAAI,CAAC,CAAC,EAAOJ,KAAK;QAAEK,YAAY,EAAEJ;MAAI,EAAE,CAAC;IACxF,CAAC,CAAC;IACFJ,OAAO,CAACS,WAAW,GAAG,IAAAC,0BAAc,EAACX,SAAS,CAAC;IAC/C,OAAO,IAAAY,gCAAoB,EAACX,OAAO,EAAED,SAAS,CAAC;EACjD,CAAC;AACH;AAAC,IAAAa,QAAA,GAAAC,OAAA,cAEchB,cAAc","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import hoistNonReactStatics from 'hoist-non-react-statics';
2
3
  import React from 'react';
3
4
  import getDisplayName from "../getDisplayName.mjs";
4
- import hoistNonReactStatics from 'hoist-non-react-statics';
5
5
  function WithForwardRef() {
6
6
  return function ForwardRef(Component) {
7
7
  var Wrapped = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"WithRef.mjs","names":["React","getDisplayName","hoistNonReactStatics","WithForwardRef","ForwardRef","Component","Wrapped","forwardRef","props","ref","createElement","_extends","defaultProps","forwardedRef","displayName"],"sources":["../../../src/utils/enhances/WithRef.tsx"],"sourcesContent":["import React from 'react';\nimport getDisplayName from '../getDisplayName';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nfunction WithForwardRef() {\n return function ForwardRef<T extends React.ComponentType>(Component: T) {\n const Wrapped = React.forwardRef((props, ref) => {\n // @ts-ignore\n return <Component {...(Component.defaultProps || {})} {...props} forwardedRef={ref} />;\n });\n Wrapped.displayName = getDisplayName(Component);\n return hoistNonReactStatics(Wrapped, Component) as any;\n };\n}\n\nexport default WithForwardRef;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,cAAc,MAAM,uBAAmB;AAC9C,OAAOC,oBAAoB,MAAM,yBAAyB;AAE1D,SAASC,cAAcA,CAAA,EAAG;EACxB,OAAO,SAASC,UAAUA,CAAgCC,SAAY,EAAE;IACtE,IAAMC,OAAO,gBAAGN,KAAK,CAACO,UAAU,CAAC,UAACC,KAAK,EAAEC,GAAG,EAAK;MAC/C;MACA,oBAAOT,KAAA,CAAAU,aAAA,CAACL,SAAS,EAAAM,QAAA,KAAMN,SAAS,CAACO,YAAY,IAAI,CAAC,CAAC,EAAOJ,KAAK;QAAEK,YAAY,EAAEJ;MAAI,GAAG;IACxF,CAAC,CAAC;IACFH,OAAO,CAACQ,WAAW,GAAGb,cAAc,CAACI,SAAS,CAAC;IAC/C,OAAOH,oBAAoB,CAACI,OAAO,EAAED,SAAS,CAAC;EACjD,CAAC;AACH;AAEA,eAAeF,cAAc"}
1
+ {"version":3,"file":"WithRef.mjs","names":["hoistNonReactStatics","React","getDisplayName","WithForwardRef","ForwardRef","Component","Wrapped","forwardRef","props","ref","createElement","_extends","defaultProps","forwardedRef","displayName"],"sources":["../../../src/utils/enhances/WithRef.tsx"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport React from 'react';\n\nimport getDisplayName from '../getDisplayName';\n\nfunction WithForwardRef() {\n return function ForwardRef<T extends React.ComponentType>(Component: T) {\n const Wrapped = React.forwardRef((props, ref) => {\n // @ts-ignore\n return <Component {...(Component.defaultProps || {})} {...props} forwardedRef={ref} />;\n });\n Wrapped.displayName = getDisplayName(Component);\n return hoistNonReactStatics(Wrapped, Component) as any;\n };\n}\n\nexport default WithForwardRef;\n"],"mappings":";AAAA,OAAOA,oBAAoB,MAAM,yBAAyB;AAC1D,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,cAAc,MAAM,uBAAmB;AAE9C,SAASC,cAAcA,CAAA,EAAG;EACxB,OAAO,SAASC,UAAUA,CAAgCC,SAAY,EAAE;IACtE,IAAMC,OAAO,gBAAGL,KAAK,CAACM,UAAU,CAAC,UAACC,KAAK,EAAEC,GAAG,EAAK;MAC/C;MACA,oBAAOR,KAAA,CAAAS,aAAA,CAACL,SAAS,EAAAM,QAAA,KAAMN,SAAS,CAACO,YAAY,IAAI,CAAC,CAAC,EAAOJ,KAAK;QAAEK,YAAY,EAAEJ;MAAI,EAAE,CAAC;IACxF,CAAC,CAAC;IACFH,OAAO,CAACQ,WAAW,GAAGZ,cAAc,CAACG,SAAS,CAAC;IAC/C,OAAOL,oBAAoB,CAACM,OAAO,EAAED,SAAS,CAAC;EACjD,CAAC;AACH;AAEA,eAAeF,cAAc","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -9,7 +9,7 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _assignProps = require("../assignProps");
11
11
  var defaultOnNeighborChange = function defaultOnNeighborChange(neighborElement) {
12
- neighborElement === null || neighborElement === void 0 ? void 0 : neighborElement.focus();
12
+ neighborElement === null || neighborElement === void 0 || neighborElement.focus();
13
13
  };
14
14
  var defaultFindNeighbor = function defaultFindNeighbor(listSelectors, element, direction) {
15
15
  var elementSibling = ['right', 'top'].includes(direction) ? 1 : -1;
@@ -29,10 +29,10 @@ var a11yEnhance = function a11yEnhance(options) {
29
29
  var childSelector = options.childSelector;
30
30
  return function (props) {
31
31
  if (!childSelector) throw "parameter childSelector not passed in options for a11yEnhance for ".concat(props['data-ui-name']);
32
- var getNeighbor = function getNeighbor(listSelectors, element, direction) {
32
+ var _getNeighbor = function getNeighbor(listSelectors, element, direction) {
33
33
  var neighbor = findNeighbor(listSelectors, element, direction);
34
34
  if (!neighbor) return element;
35
- if ('disabled' in neighbor && neighbor.disabled) return getNeighbor(listSelectors, neighbor, direction);
35
+ if ('disabled' in neighbor && neighbor.disabled) return _getNeighbor(listSelectors, neighbor, direction);
36
36
  return neighbor;
37
37
  };
38
38
  var handleKeyDown = function handleKeyDown(event) {
@@ -47,19 +47,19 @@ var a11yEnhance = function a11yEnhance(options) {
47
47
  if (!listSelectors.length) throw "no children found querySelectorAll([".concat(childAttrName, "=\"").concat(childAttrValue, "\"] a11yEnhance for ").concat(props['data-ui-name']);
48
48
  switch (event.key) {
49
49
  case 'ArrowLeft':
50
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'left'), props);
50
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'left'), props);
51
51
  event.preventDefault();
52
52
  break;
53
53
  case 'ArrowTop':
54
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'top'), props);
54
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'top'), props);
55
55
  event.preventDefault();
56
56
  break;
57
57
  case 'ArrowRight':
58
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'right'), props);
58
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'right'), props);
59
59
  event.preventDefault();
60
60
  break;
61
61
  case 'ArrowBottom':
62
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'bottom'), props);
62
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'bottom'), props);
63
63
  event.preventDefault();
64
64
  break;
65
65
  }
@@ -69,6 +69,5 @@ var a11yEnhance = function a11yEnhance(options) {
69
69
  });
70
70
  };
71
71
  };
72
- var _default = a11yEnhance;
73
- exports["default"] = _default;
74
- //# sourceMappingURL=a11yEnhance.cjs.map
72
+ var _default = exports["default"] = a11yEnhance;
73
+ //# sourceMappingURL=a11yEnhance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11yEnhance.js","names":["_assignProps","require","defaultOnNeighborChange","neighborElement","focus","defaultFindNeighbor","listSelectors","element","direction","elementSibling","includes","indexElement","findIndex","node","lengthList","length","lastIndex","indexNext","a11yEnhance","options","findNeighbor","onNeighborChange","childSelector","props","concat","getNeighbor","neighbor","disabled","handleKeyDown","event","parent","currentTarget","selectedElement","target","_ref","_ref2","_slicedToArray2","childAttrName","childAttrValue","getAttribute","Array","from","querySelectorAll","key","preventDefault","_objectSpread2","onKeyDown","callAllEventHandlers","_default","exports"],"sources":["../../../src/utils/enhances/a11yEnhance.tsx"],"sourcesContent":["import type React from 'react';\n\nimport { callAllEventHandlers } from '../assignProps';\n\ntype OnNeighborChange<P> = (neighborElement: HTMLElement, props: P) => void;\ntype FindNeighbor = (\n listSelectors: HTMLElement[],\n element: HTMLElement,\n direction: string,\n) => HTMLElement | undefined;\ntype ChildSelector<P> = [string, string] | ((props: P) => [string, string]);\n\ntype A11yEnhanceOptions<P = any> = {\n findNeighbor?: FindNeighbor;\n onNeighborChange?: OnNeighborChange<P>;\n childSelector: ChildSelector<P>;\n};\n\nconst defaultOnNeighborChange: OnNeighborChange<any> = (neighborElement) => {\n neighborElement?.focus();\n};\n\nconst defaultFindNeighbor: FindNeighbor = (listSelectors, element, direction) => {\n const elementSibling = ['right', 'top'].includes(direction) ? 1 : -1;\n const indexElement = listSelectors.findIndex((node) => node === element);\n const lengthList = listSelectors.length;\n\n const lastIndex = lengthList - 1;\n let indexNext = indexElement + elementSibling;\n if (indexNext < 0) indexNext = lastIndex;\n if (indexNext > lastIndex) indexNext = 0;\n return listSelectors[indexNext];\n};\n\nconst a11yEnhance = (options: A11yEnhanceOptions) => {\n const findNeighbor = options.findNeighbor || defaultFindNeighbor;\n const onNeighborChange = options.onNeighborChange || defaultOnNeighborChange;\n const { childSelector } = options;\n\n return (props: any) => {\n if (!childSelector)\n throw `parameter childSelector not passed in options for a11yEnhance for ${props['data-ui-name']}`;\n const getNeighbor = (\n listSelectors: any,\n element: HTMLElement,\n direction: string,\n ): HTMLElement => {\n const neighbor = findNeighbor(listSelectors, element, direction);\n if (!neighbor) return element;\n if ('disabled' in neighbor && neighbor.disabled)\n return getNeighbor(listSelectors, neighbor, direction);\n return neighbor;\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n const parent = event.currentTarget;\n const selectedElement = event.target as HTMLElement;\n const [childAttrName, childAttrValue] =\n typeof childSelector === 'function' ? childSelector(props) : childSelector;\n if (!selectedElement.getAttribute(childAttrName)) return;\n\n const listSelectors = Array.from(\n parent.querySelectorAll(`[${childAttrName}=\"${childAttrValue}\"]`),\n );\n if (!listSelectors.length)\n throw `no children found querySelectorAll([${childAttrName}=\"${childAttrValue}\"] a11yEnhance for ${props['data-ui-name']}`;\n\n switch (event.key) {\n case 'ArrowLeft':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'left'), props);\n event.preventDefault();\n break;\n case 'ArrowTop':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'top'), props);\n event.preventDefault();\n break;\n case 'ArrowRight':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'right'), props);\n event.preventDefault();\n break;\n case 'ArrowBottom':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'bottom'), props);\n event.preventDefault();\n break;\n }\n };\n\n return {\n ...props,\n onKeyDown: callAllEventHandlers(props.onKeyDown, handleKeyDown),\n };\n };\n};\n\nexport default a11yEnhance;\n"],"mappings":";;;;;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAgBA,IAAMC,uB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CAACe,cAAc,CAAC,CAAC;UACtB;QACF,KAAK,YAAY;UACfvB,gBAAgB,CAACI,YAAW,CAACnB,aAAa,EAAE0B,eAAe,EAAE,OAAO,CAAC,EAAET,KAAK,CAAC;UAC7EM,KAAK,CAACe,cAAc,CAAC,CAAC;UACtB;QACF,KAAK,aAAa;UAChBvB,gBAAgB,CAACI,YAAW,CAACnB,aAAa,EAAE0B,eAAe,EAAE,QAAQ,CAAC,EAAET,KAAK,CAAC;UAC9EM,KAAK,CAACe,cAAc,CAAC,CAAC;UACtB;MACJ;IACF,CAAC;IAED,WAAAC,cAAA,iBAAAA,cAAA,iBACKtB,KAAK;MACRuB,SAAS,EAAE,IAAAC,iCAAoB,EAACxB,KAAK,CAACuB,SAAS,EAAElB,aAAa;IAAC;EAEnE,CAAC;AACH,CAAC;AAAC,IAAAoB,QAAA,GAAAC,OAAA,cAEa/B,WAAW","ignoreList":[]}
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import { callAllEventHandlers } from "../assignProps.mjs";
4
4
  var defaultOnNeighborChange = function defaultOnNeighborChange(neighborElement) {
5
- neighborElement === null || neighborElement === void 0 ? void 0 : neighborElement.focus();
5
+ neighborElement === null || neighborElement === void 0 || neighborElement.focus();
6
6
  };
7
7
  var defaultFindNeighbor = function defaultFindNeighbor(listSelectors, element, direction) {
8
8
  var elementSibling = ['right', 'top'].includes(direction) ? 1 : -1;
@@ -22,10 +22,10 @@ var a11yEnhance = function a11yEnhance(options) {
22
22
  var childSelector = options.childSelector;
23
23
  return function (props) {
24
24
  if (!childSelector) throw "parameter childSelector not passed in options for a11yEnhance for ".concat(props['data-ui-name']);
25
- var getNeighbor = function getNeighbor(listSelectors, element, direction) {
25
+ var _getNeighbor = function getNeighbor(listSelectors, element, direction) {
26
26
  var neighbor = findNeighbor(listSelectors, element, direction);
27
27
  if (!neighbor) return element;
28
- if ('disabled' in neighbor && neighbor.disabled) return getNeighbor(listSelectors, neighbor, direction);
28
+ if ('disabled' in neighbor && neighbor.disabled) return _getNeighbor(listSelectors, neighbor, direction);
29
29
  return neighbor;
30
30
  };
31
31
  var handleKeyDown = function handleKeyDown(event) {
@@ -40,19 +40,19 @@ var a11yEnhance = function a11yEnhance(options) {
40
40
  if (!listSelectors.length) throw "no children found querySelectorAll([".concat(childAttrName, "=\"").concat(childAttrValue, "\"] a11yEnhance for ").concat(props['data-ui-name']);
41
41
  switch (event.key) {
42
42
  case 'ArrowLeft':
43
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'left'), props);
43
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'left'), props);
44
44
  event.preventDefault();
45
45
  break;
46
46
  case 'ArrowTop':
47
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'top'), props);
47
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'top'), props);
48
48
  event.preventDefault();
49
49
  break;
50
50
  case 'ArrowRight':
51
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'right'), props);
51
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'right'), props);
52
52
  event.preventDefault();
53
53
  break;
54
54
  case 'ArrowBottom':
55
- onNeighborChange(getNeighbor(listSelectors, selectedElement, 'bottom'), props);
55
+ onNeighborChange(_getNeighbor(listSelectors, selectedElement, 'bottom'), props);
56
56
  event.preventDefault();
57
57
  break;
58
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"a11yEnhance.mjs","names":["callAllEventHandlers","defaultOnNeighborChange","neighborElement","focus","defaultFindNeighbor","listSelectors","element","direction","elementSibling","includes","indexElement","findIndex","node","lengthList","length","lastIndex","indexNext","a11yEnhance","options","findNeighbor","onNeighborChange","childSelector","props","concat","getNeighbor","neighbor","disabled","handleKeyDown","event","parent","currentTarget","selectedElement","target","_ref","_ref2","_slicedToArray","childAttrName","childAttrValue","getAttribute","Array","from","querySelectorAll","key","preventDefault","_objectSpread","onKeyDown"],"sources":["../../../src/utils/enhances/a11yEnhance.tsx"],"sourcesContent":["import { callAllEventHandlers } from '../assignProps';\nimport React from 'react';\n\ntype OnNeighborChange<P> = (neighborElement: HTMLElement, props: P) => void;\ntype FindNeighbor = (\n listSelectors: HTMLElement[],\n element: HTMLElement,\n direction: string,\n) => HTMLElement | undefined;\ntype ChildSelector<P> = [string, string] | ((props: P) => [string, string]);\n\ntype A11yEnhanceOptions<P = any> = {\n findNeighbor?: FindNeighbor;\n onNeighborChange?: OnNeighborChange<P>;\n childSelector: ChildSelector<P>;\n};\n\nconst defaultOnNeighborChange: OnNeighborChange<any> = (neighborElement) => {\n neighborElement?.focus();\n};\n\nconst defaultFindNeighbor: FindNeighbor = (listSelectors, element, direction) => {\n const elementSibling = ['right', 'top'].includes(direction) ? 1 : -1;\n const indexElement = listSelectors.findIndex((node) => node === element);\n const lengthList = listSelectors.length;\n\n const lastIndex = lengthList - 1;\n let indexNext = indexElement + elementSibling;\n if (indexNext < 0) indexNext = lastIndex;\n if (indexNext > lastIndex) indexNext = 0;\n return listSelectors[indexNext];\n};\n\nconst a11yEnhance = (options: A11yEnhanceOptions) => {\n const findNeighbor = options.findNeighbor || defaultFindNeighbor;\n const onNeighborChange = options.onNeighborChange || defaultOnNeighborChange;\n const { childSelector } = options;\n\n return (props: any) => {\n if (!childSelector)\n throw `parameter childSelector not passed in options for a11yEnhance for ${props['data-ui-name']}`;\n const getNeighbor = (\n listSelectors: any,\n element: HTMLElement,\n direction: string,\n ): HTMLElement => {\n const neighbor = findNeighbor(listSelectors, element, direction);\n if (!neighbor) return element;\n if ('disabled' in neighbor && neighbor.disabled)\n return getNeighbor(listSelectors, neighbor, direction);\n return neighbor;\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n const parent = event.currentTarget;\n const selectedElement = event.target as HTMLElement;\n const [childAttrName, childAttrValue] =\n typeof childSelector === 'function' ? childSelector(props) : childSelector;\n if (!selectedElement.getAttribute(childAttrName)) return;\n\n const listSelectors = Array.from(\n parent.querySelectorAll(`[${childAttrName}=\"${childAttrValue}\"]`),\n );\n if (!listSelectors.length)\n throw `no children found querySelectorAll([${childAttrName}=\"${childAttrValue}\"] a11yEnhance for ${props['data-ui-name']}`;\n\n switch (event.key) {\n case 'ArrowLeft':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'left'), props);\n event.preventDefault();\n break;\n case 'ArrowTop':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'top'), props);\n event.preventDefault();\n break;\n case 'ArrowRight':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'right'), props);\n event.preventDefault();\n break;\n case 'ArrowBottom':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'bottom'), props);\n event.preventDefault();\n break;\n }\n };\n\n return {\n ...props,\n onKeyDown: callAllEventHandlers(props.onKeyDown, handleKeyDown),\n };\n };\n};\n\nexport default a11yEnhance;\n"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,oBAAgB;AAiBrD,IAAMC,uBAA8C,GAAG,SAAjDA,uBAA8CA,CAAIC,eAAe,EAAK;EAC1EA,eAAe,aAAfA,eAAe,uBAAfA,eAAe,CAAEC,KAAK,EAAE;AAC1B,CAAC;AAED,IAAMC,mBAAiC,GAAG,SAApCA,mBAAiCA,CAAIC,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAK;EAC/E,IAAMC,cAAc,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAACC,QAAQ,CAACF,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;EACpE,IAAMG,YAAY,GAAGL,aAAa,CAACM,SAAS,CAAC,UAACC,IAAI;IAAA,OAAKA,IAAI,KAAKN,OAAO;EAAA,EAAC;EACxE,IAAMO,UAAU,GAAGR,aAAa,CAACS,MAAM;EAEvC,IAAMC,SAAS,GAAGF,UAAU,GAAG,CAAC;EAChC,IAAIG,SAAS,GAAGN,YAAY,GAAGF,cAAc;EAC7C,IAAIQ,SAAS,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YAAY,CAACF,aAAa,CAAC,EAAE;MAElD,IAAM/B,aAAa,GAAGkC,KAAK,CAACC,IAAI,CAC9BX,MAAM,CAACY,gBAAgB,KAAAlB,MAAA,CAAKa,aAAa,SAAAb,MAAA,CAAKc,cAAc,SAAK,CAClE;MACD,IAAI,CAAChC,aAAa,CAACS,MAAM,EACvB,6CAAAS,MAAA,CAA6Ca,aAAa,SAAAb,MAAA,CAAKc,cAAc,0BAAAd,MAAA,CAAsBD,KAAK,CAAC,cAAc,CAAC;MAE1H,QAAQM,KAAK,CAACc,GAAG;QACf,KAAK,WAAW;UACdtB,gBAAgB,CAACI,WAAW,CAACnB,aAAa,EAAE0B,eAAe,EAAE,MAAM,CAAC,EAAET,KAAK,CAAC;UAC5EM,KAAK,CAACe,cAAc,EAAE;UACtB;QACF,KAAK,UAAU;UACbvB,gBAAgB,CAACI,WAAW,CAACnB,aAAa,EAAE0B,eAAe,EAAE,KAAK,CAAC,EAAET,KAAK,CAAC;UAC3EM,KAAK,CAACe,cAAc,EAAE;UACtB;QACF,KAAK,YAAY;UACfvB,gBAAgB,CAACI,WAAW,CAACnB,aAAa,EAAE0B,eAAe,EAAE,OAAO,CAAC,EAAET,KAAK,CAAC;UAC7EM,KAAK,CAACe,cAAc,EAAE;UACtB;QACF,KAAK,aAAa;UAChBvB,gBAAgB,CAACI,WAAW,CAACnB,aAAa,EAAE0B,eAAe,EAAE,QAAQ,CAAC,EAAET,KAAK,CAAC;UAC9EM,KAAK,CAACe,cAAc,EAAE;UACtB;MAAM;IAEZ,CAAC;IAED,OAAAC,aAAA,CAAAA,aAAA,KACKtB,KAAK;MACRuB,SAAS,EAAE7C,oBAAoB,CAACsB,KAAK,CAACuB,SAAS,EAAElB,aAAa;IAAC;EAEnE,CAAC;AACH,CAAC;AAED,eAAeV,WAAW"}
1
+ {"version":3,"file":"a11yEnhance.mjs","names":["callAllEventHandlers","defaultOnNeighborChange","neighborElement","focus","defaultFindNeighbor","listSelectors","element","direction","elementSibling","includes","indexElement","findIndex","node","lengthList","length","lastIndex","indexNext","a11yEnhance","options","findNeighbor","onNeighborChange","childSelector","props","concat","getNeighbor","neighbor","disabled","handleKeyDown","event","parent","currentTarget","selectedElement","target","_ref","_ref2","_slicedToArray","childAttrName","childAttrValue","getAttribute","Array","from","querySelectorAll","key","preventDefault","_objectSpread","onKeyDown"],"sources":["../../../src/utils/enhances/a11yEnhance.tsx"],"sourcesContent":["import type React from 'react';\n\nimport { callAllEventHandlers } from '../assignProps';\n\ntype OnNeighborChange<P> = (neighborElement: HTMLElement, props: P) => void;\ntype FindNeighbor = (\n listSelectors: HTMLElement[],\n element: HTMLElement,\n direction: string,\n) => HTMLElement | undefined;\ntype ChildSelector<P> = [string, string] | ((props: P) => [string, string]);\n\ntype A11yEnhanceOptions<P = any> = {\n findNeighbor?: FindNeighbor;\n onNeighborChange?: OnNeighborChange<P>;\n childSelector: ChildSelector<P>;\n};\n\nconst defaultOnNeighborChange: OnNeighborChange<any> = (neighborElement) => {\n neighborElement?.focus();\n};\n\nconst defaultFindNeighbor: FindNeighbor = (listSelectors, element, direction) => {\n const elementSibling = ['right', 'top'].includes(direction) ? 1 : -1;\n const indexElement = listSelectors.findIndex((node) => node === element);\n const lengthList = listSelectors.length;\n\n const lastIndex = lengthList - 1;\n let indexNext = indexElement + elementSibling;\n if (indexNext < 0) indexNext = lastIndex;\n if (indexNext > lastIndex) indexNext = 0;\n return listSelectors[indexNext];\n};\n\nconst a11yEnhance = (options: A11yEnhanceOptions) => {\n const findNeighbor = options.findNeighbor || defaultFindNeighbor;\n const onNeighborChange = options.onNeighborChange || defaultOnNeighborChange;\n const { childSelector } = options;\n\n return (props: any) => {\n if (!childSelector)\n throw `parameter childSelector not passed in options for a11yEnhance for ${props['data-ui-name']}`;\n const getNeighbor = (\n listSelectors: any,\n element: HTMLElement,\n direction: string,\n ): HTMLElement => {\n const neighbor = findNeighbor(listSelectors, element, direction);\n if (!neighbor) return element;\n if ('disabled' in neighbor && neighbor.disabled)\n return getNeighbor(listSelectors, neighbor, direction);\n return neighbor;\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n const parent = event.currentTarget;\n const selectedElement = event.target as HTMLElement;\n const [childAttrName, childAttrValue] =\n typeof childSelector === 'function' ? childSelector(props) : childSelector;\n if (!selectedElement.getAttribute(childAttrName)) return;\n\n const listSelectors = Array.from(\n parent.querySelectorAll(`[${childAttrName}=\"${childAttrValue}\"]`),\n );\n if (!listSelectors.length)\n throw `no children found querySelectorAll([${childAttrName}=\"${childAttrValue}\"] a11yEnhance for ${props['data-ui-name']}`;\n\n switch (event.key) {\n case 'ArrowLeft':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'left'), props);\n event.preventDefault();\n break;\n case 'ArrowTop':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'top'), props);\n event.preventDefault();\n break;\n case 'ArrowRight':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'right'), props);\n event.preventDefault();\n break;\n case 'ArrowBottom':\n onNeighborChange(getNeighbor(listSelectors, selectedElement, 'bottom'), props);\n event.preventDefault();\n break;\n }\n };\n\n return {\n ...props,\n onKeyDown: callAllEventHandlers(props.onKeyDown, handleKeyDown),\n };\n };\n};\n\nexport default a11yEnhance;\n"],"mappings":";;AAEA,SAASA,oBAAoB,QAAQ,oBAAgB;AAgBrD,IAAMC,uBAA8C,GAAG,SAAjDA,uBAA8CA,CAAIC,eAAe,EAAK;EAC1EA,eAAe,aAAfA,eAAe,eAAfA,eAAe,CAAEC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED,IAAMC,mBAAiC,GAAG,SAApCA,mBAAiCA,CAAIC,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAK;EAC/E,IAAMC,cAAc,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAACC,QAAQ,CAACF,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;EACpE,IAAMG,YAAY,GAAGL,aAAa,CAACM,SAAS,CAA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A,KACKtB,KAAK;MACRuB,SAAS,EAAE7C,oBAAoB,CAACsB,KAAK,CAACuB,SAAS,EAAElB,aAAa;IAAC;EAEnE,CAAC;AACH,CAAC;AAED,eAAeV,WAAW","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { UnknownProperties } from '../../core-types/UnknownProperties';
1
+ import type { UnknownProperties } from '../../core-types/UnknownProperties';
2
2
  /** @deprecated */
3
3
  export interface IWithAnimatedSizeEnhanceProps extends WithAnimatedSizeEnhanceProps, UnknownProperties {
4
4
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -12,6 +12,8 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _ref2 = require("../ref");
13
13
  var _useEnhancedEffect = _interopRequireDefault(require("../use/useEnhancedEffect"));
14
14
  var _excluded = ["ref", "__animatedEnhanceInstanceId", "duration"];
15
+ /** @deprecated */
16
+
15
17
  var uniqueId = 0;
16
18
  function animatedSizeEnhance(_ref) {
17
19
  var _ref$animateProps = _ref.animateProps,
@@ -39,6 +41,7 @@ function animatedSizeEnhance(_ref) {
39
41
  return value === undefined;
40
42
  })) {
41
43
  for (var i = 0; i < animateProps.length; i++) {
44
+ // @ts-ignore
42
45
  lastSizesRef.current[i] = node.getBoundingClientRect()[animateProps[i]];
43
46
  }
44
47
  return;
@@ -59,30 +62,30 @@ function animatedSizeEnhance(_ref) {
59
62
  node.style[animateProps[_i2]] = "".concat(lastSizesRef.current[_i2], "px");
60
63
  }
61
64
  var timeout = -1;
62
- var handleTransitionEnd = function handleTransitionEnd() {
65
+ var _handleTransitionEnd = function handleTransitionEnd() {
63
66
  clearTimeout(timeout);
64
67
  if (!node) return;
65
68
  node.style.transition = null;
66
69
  for (var _i3 = 0; _i3 < animateProps.length; _i3++) {
67
70
  node.style[animateProps[_i3]] = null;
68
71
  }
69
- node.removeEventListener('transitionend', handleTransitionEnd);
70
- node.removeEventListener('transitioncancel', handleTransitionEnd);
72
+ node.removeEventListener('transitionend', _handleTransitionEnd);
73
+ node.removeEventListener('transitioncancel', _handleTransitionEnd);
71
74
  };
72
75
  var animationFrame = requestAnimationFrame(function () {
73
76
  if (!node) return;
74
- node.addEventListener('transitionend', handleTransitionEnd);
75
- node.addEventListener('transitioncancel', handleTransitionEnd);
77
+ node.addEventListener('transitionend', _handleTransitionEnd);
78
+ node.addEventListener('transitioncancel', _handleTransitionEnd);
76
79
  node.style.transition = "".concat(duration, "ms all ease-in-out");
77
80
  for (var _i4 = 0; _i4 < animateProps.length; _i4++) {
78
81
  lastSizesRef.current[_i4] = sizes[_i4];
79
82
  node.style[animateProps[_i4]] = "".concat(sizes[_i4], "px");
80
83
  }
81
84
  });
82
- timeout = setTimeout(handleTransitionEnd, 500);
85
+ timeout = setTimeout(_handleTransitionEnd, 500);
83
86
  return function () {
84
87
  cancelAnimationFrame(animationFrame);
85
- handleTransitionEnd();
88
+ _handleTransitionEnd();
86
89
  };
87
90
  }, [__animatedEnhanceInstanceId, props.animationsDisabled, duration].concat((0, _toConsumableArray2["default"])(onChangeOf.map(function (propName) {
88
91
  return props[propName];
@@ -93,6 +96,5 @@ function animatedSizeEnhance(_ref) {
93
96
  }, other);
94
97
  };
95
98
  }
96
- var _default = animatedSizeEnhance;
97
- exports["default"] = _default;
98
- //# sourceMappingURL=animatedSizeEnhance.cjs.map
99
+ var _default = exports["default"] = animatedSizeEnhance;
100
+ //# sourceMappingURL=animatedSizeEnhance.js.map