@semcore/core 16.5.1 → 17.0.0-prerelease.17

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 (427) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/README.md +4 -4
  3. package/lib/LastInteractionType.js +22 -36
  4. package/lib/LastInteractionType.js.map +1 -1
  5. package/lib/LastInteractionType.mjs +19 -33
  6. package/lib/LastInteractionType.mjs.map +1 -1
  7. package/lib/core-types/Component.d.ts +26 -79
  8. package/lib/core-types/Component.js +24 -72
  9. package/lib/core-types/Component.js.map +1 -1
  10. package/lib/core-types/Component.mjs +18 -34
  11. package/lib/core-types/Component.mjs.map +1 -1
  12. package/lib/core-types/symbols.js +9 -9
  13. package/lib/core-types/symbols.js.map +1 -1
  14. package/lib/core-types/symbols.mjs +9 -9
  15. package/lib/core-types/symbols.mjs.map +1 -1
  16. package/lib/coreFactory.d.ts +6 -23
  17. package/lib/coreFactory.js +150 -217
  18. package/lib/coreFactory.js.map +1 -1
  19. package/lib/coreFactory.mjs +139 -194
  20. package/lib/coreFactory.mjs.map +1 -1
  21. package/lib/decorators/propsObserver.d.ts +11 -0
  22. package/lib/decorators/reactive.d.ts +11 -0
  23. package/lib/enhancement/Children.js +51 -59
  24. package/lib/enhancement/Children.js.map +1 -1
  25. package/lib/enhancement/Children.mjs +47 -41
  26. package/lib/enhancement/Children.mjs.map +1 -1
  27. package/lib/enhancement/Root.js +36 -37
  28. package/lib/enhancement/Root.js.map +1 -1
  29. package/lib/enhancement/Root.mjs +28 -18
  30. package/lib/enhancement/Root.mjs.map +1 -1
  31. package/lib/enhancement/dataName.js +7 -8
  32. package/lib/enhancement/dataName.js.map +1 -1
  33. package/lib/enhancement/dataName.mjs +5 -5
  34. package/lib/enhancement/dataName.mjs.map +1 -1
  35. package/lib/enhancement/enhance.js +6 -9
  36. package/lib/enhancement/enhance.js.map +1 -1
  37. package/lib/enhancement/enhance.mjs +5 -7
  38. package/lib/enhancement/enhance.mjs.map +1 -1
  39. package/lib/enhancement/functionDefaultProps.js +6 -6
  40. package/lib/enhancement/functionDefaultProps.js.map +1 -1
  41. package/lib/enhancement/functionDefaultProps.mjs +4 -4
  42. package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
  43. package/lib/enhancement/i18n.js +13 -13
  44. package/lib/enhancement/i18n.js.map +1 -1
  45. package/lib/enhancement/i18n.mjs +10 -9
  46. package/lib/enhancement/i18n.mjs.map +1 -1
  47. package/lib/enhancement/inheritedName.js +7 -8
  48. package/lib/enhancement/inheritedName.js.map +1 -1
  49. package/lib/enhancement/inheritedName.mjs +5 -5
  50. package/lib/enhancement/inheritedName.mjs.map +1 -1
  51. package/lib/enhancement/staticChildren.js +47 -56
  52. package/lib/enhancement/staticChildren.js.map +1 -1
  53. package/lib/enhancement/staticChildren.mjs +43 -48
  54. package/lib/enhancement/staticChildren.mjs.map +1 -1
  55. package/lib/enhancement/style.js +29 -27
  56. package/lib/enhancement/style.js.map +1 -1
  57. package/lib/enhancement/style.mjs +26 -20
  58. package/lib/enhancement/style.mjs.map +1 -1
  59. package/lib/enhancement/uncontrolledProps.js +46 -64
  60. package/lib/enhancement/uncontrolledProps.js.map +1 -1
  61. package/lib/enhancement/uncontrolledProps.mjs +43 -51
  62. package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
  63. package/lib/esm/LastInteractionType.mjs +19 -33
  64. package/lib/esm/core-types/Component.mjs +18 -34
  65. package/lib/esm/core-types/symbols.mjs +9 -9
  66. package/lib/esm/coreFactory.mjs +139 -194
  67. package/lib/esm/enhancement/Children.mjs +47 -41
  68. package/lib/esm/enhancement/Root.mjs +28 -18
  69. package/lib/esm/enhancement/dataName.mjs +5 -5
  70. package/lib/esm/enhancement/enhance.mjs +5 -7
  71. package/lib/esm/enhancement/functionDefaultProps.mjs +4 -4
  72. package/lib/esm/enhancement/i18n.mjs +10 -9
  73. package/lib/esm/enhancement/inheritedName.mjs +5 -5
  74. package/lib/esm/enhancement/staticChildren.mjs +43 -48
  75. package/lib/esm/enhancement/style.mjs +26 -20
  76. package/lib/esm/enhancement/uncontrolledProps.mjs +43 -51
  77. package/lib/esm/register.mjs +12 -20
  78. package/lib/esm/styled/reshadow-core.mjs +98 -111
  79. package/lib/esm/styled/sstyled.mjs +31 -41
  80. package/lib/esm/utils/assignProps.mjs +32 -36
  81. package/lib/esm/utils/enhances/WithI18n.mjs +16 -63
  82. package/lib/esm/utils/enhances/i18nEnhance.mjs +47 -61
  83. package/lib/esm/utils/logger.mjs +13 -21
  84. package/lib/esm/utils/pick.mjs +4 -4
  85. package/lib/esm/utils/ref.mjs +27 -57
  86. package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
  87. package/lib/index.d.ts +3 -3
  88. package/lib/index.js +17 -17
  89. package/lib/index.js.map +1 -1
  90. package/lib/index.mjs.map +1 -1
  91. package/lib/register.js +17 -24
  92. package/lib/register.js.map +1 -1
  93. package/lib/register.mjs +12 -20
  94. package/lib/register.mjs.map +1 -1
  95. package/lib/styled/index.d.ts +1 -5
  96. package/lib/styled/index.js +4 -4
  97. package/lib/styled/index.js.map +1 -1
  98. package/lib/styled/index.mjs.map +1 -1
  99. package/lib/styled/reshadow-core.js +102 -104
  100. package/lib/styled/reshadow-core.js.map +1 -1
  101. package/lib/styled/reshadow-core.mjs +98 -111
  102. package/lib/styled/reshadow-core.mjs.map +1 -1
  103. package/lib/styled/sstyled.js +31 -53
  104. package/lib/styled/sstyled.js.map +1 -1
  105. package/lib/styled/sstyled.mjs +31 -41
  106. package/lib/styled/sstyled.mjs.map +1 -1
  107. package/lib/theme/processor.js +150 -222
  108. package/lib/theme/processor.js.map +1 -1
  109. package/lib/theme/processor.mjs +148 -221
  110. package/lib/theme/processor.mjs.map +1 -1
  111. package/lib/theme/themes/dark.js +2 -2
  112. package/lib/theme/themes/dark.js.map +1 -1
  113. package/lib/theme/themes/default.js +2 -2
  114. package/lib/theme/themes/default.js.map +1 -1
  115. package/lib/theme/themes/highlights-dark.js +2 -2
  116. package/lib/theme/themes/highlights-dark.js.map +1 -1
  117. package/lib/theme/themes/highlights-light.js +2 -2
  118. package/lib/theme/themes/highlights-light.js.map +1 -1
  119. package/lib/theme/themes/light.js +2 -2
  120. package/lib/theme/themes/light.js.map +1 -1
  121. package/lib/theme/utils.js +140 -215
  122. package/lib/theme/utils.js.map +1 -1
  123. package/lib/theme/utils.mjs +135 -214
  124. package/lib/theme/utils.mjs.map +1 -1
  125. package/lib/utils/CSSinJS.js +8 -10
  126. package/lib/utils/CSSinJS.js.map +1 -1
  127. package/lib/utils/CSSinJS.mjs +6 -7
  128. package/lib/utils/CSSinJS.mjs.map +1 -1
  129. package/lib/utils/ThemeProvider.js +44 -51
  130. package/lib/utils/ThemeProvider.js.map +1 -1
  131. package/lib/utils/ThemeProvider.mjs +36 -47
  132. package/lib/utils/ThemeProvider.mjs.map +1 -1
  133. package/lib/utils/addonText.js +4 -7
  134. package/lib/utils/addonText.js.map +1 -1
  135. package/lib/utils/addonText.mjs +2 -5
  136. package/lib/utils/addonText.mjs.map +1 -1
  137. package/lib/utils/addonTextChildren.js +15 -21
  138. package/lib/utils/addonTextChildren.js.map +1 -1
  139. package/lib/utils/addonTextChildren.mjs +7 -13
  140. package/lib/utils/addonTextChildren.mjs.map +1 -1
  141. package/lib/utils/ariaProps.js +7 -5
  142. package/lib/utils/ariaProps.js.map +1 -1
  143. package/lib/utils/ariaProps.mjs +7 -5
  144. package/lib/utils/ariaProps.mjs.map +1 -1
  145. package/lib/utils/assignProps.js +33 -37
  146. package/lib/utils/assignProps.js.map +1 -1
  147. package/lib/utils/assignProps.mjs +32 -36
  148. package/lib/utils/assignProps.mjs.map +1 -1
  149. package/lib/utils/canUseDOM.js +1 -1
  150. package/lib/utils/capitalizeFirstLetter.js +1 -1
  151. package/lib/utils/color.js +72 -95
  152. package/lib/utils/color.js.map +1 -1
  153. package/lib/utils/color.mjs +71 -94
  154. package/lib/utils/color.mjs.map +1 -1
  155. package/lib/utils/compose.js +3 -12
  156. package/lib/utils/compose.js.map +1 -1
  157. package/lib/utils/compose.mjs +2 -11
  158. package/lib/utils/compose.mjs.map +1 -1
  159. package/lib/utils/createUUID.js +5 -5
  160. package/lib/utils/createUUID.js.map +1 -1
  161. package/lib/utils/createUUID.mjs +4 -4
  162. package/lib/utils/createUUID.mjs.map +1 -1
  163. package/lib/utils/cssToIntDefault.js +3 -4
  164. package/lib/utils/cssToIntDefault.js.map +1 -1
  165. package/lib/utils/cssToIntDefault.mjs +2 -3
  166. package/lib/utils/cssToIntDefault.mjs.map +1 -1
  167. package/lib/utils/enhances/WithCSS.d.ts +2 -30
  168. package/lib/utils/enhances/WithCSS.js +13 -64
  169. package/lib/utils/enhances/WithCSS.js.map +1 -1
  170. package/lib/utils/enhances/WithCSS.mjs +9 -59
  171. package/lib/utils/enhances/WithCSS.mjs.map +1 -1
  172. package/lib/utils/enhances/WithI18n.d.ts +1 -30
  173. package/lib/utils/enhances/WithI18n.js +20 -76
  174. package/lib/utils/enhances/WithI18n.js.map +1 -1
  175. package/lib/utils/enhances/WithI18n.mjs +16 -63
  176. package/lib/utils/enhances/WithI18n.mjs.map +1 -1
  177. package/lib/utils/enhances/a11yEnhance.js +34 -39
  178. package/lib/utils/enhances/a11yEnhance.js.map +1 -1
  179. package/lib/utils/enhances/a11yEnhance.mjs +32 -36
  180. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
  181. package/lib/utils/enhances/animatedSizeEnhance.d.ts +0 -4
  182. package/lib/utils/enhances/animatedSizeEnhance.js +55 -65
  183. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
  184. package/lib/utils/enhances/animatedSizeEnhance.mjs +50 -61
  185. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
  186. package/lib/utils/enhances/contextEnhance.js +12 -11
  187. package/lib/utils/enhances/contextEnhance.js.map +1 -1
  188. package/lib/utils/enhances/contextEnhance.mjs +9 -8
  189. package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
  190. package/lib/utils/enhances/i18nEnhance.d.ts +0 -4
  191. package/lib/utils/enhances/i18nEnhance.js +51 -69
  192. package/lib/utils/enhances/i18nEnhance.js.map +1 -1
  193. package/lib/utils/enhances/i18nEnhance.mjs +47 -61
  194. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
  195. package/lib/utils/enhances/resolveColorEnhance.js +12 -10
  196. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -1
  197. package/lib/utils/enhances/resolveColorEnhance.mjs +8 -6
  198. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
  199. package/lib/utils/eventEmitter.d.ts +10 -6
  200. package/lib/utils/eventEmitter.js +33 -32
  201. package/lib/utils/eventEmitter.js.map +1 -1
  202. package/lib/utils/eventEmitter.mjs +30 -31
  203. package/lib/utils/eventEmitter.mjs.map +1 -1
  204. package/lib/utils/findComponent.js +35 -42
  205. package/lib/utils/findComponent.js.map +1 -1
  206. package/lib/utils/findComponent.mjs +26 -33
  207. package/lib/utils/findComponent.mjs.map +1 -1
  208. package/lib/utils/fire.js +7 -13
  209. package/lib/utils/fire.js.map +1 -1
  210. package/lib/utils/fire.mjs +5 -11
  211. package/lib/utils/fire.mjs.map +1 -1
  212. package/lib/utils/focus-lock/focusBorders.js +28 -32
  213. package/lib/utils/focus-lock/focusBorders.js.map +1 -1
  214. package/lib/utils/focus-lock/focusBorders.mjs +26 -32
  215. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
  216. package/lib/utils/focus-lock/getFocusableIn.js +4 -6
  217. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -1
  218. package/lib/utils/focus-lock/getFocusableIn.mjs +3 -6
  219. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
  220. package/lib/utils/focus-lock/isFocusInside.js +5 -6
  221. package/lib/utils/focus-lock/isFocusInside.js.map +1 -1
  222. package/lib/utils/focus-lock/isFocusInside.mjs +4 -6
  223. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
  224. package/lib/utils/focus-lock/isFocusable.js +9 -12
  225. package/lib/utils/focus-lock/isFocusable.js.map +1 -1
  226. package/lib/utils/focus-lock/isFocusable.mjs +8 -11
  227. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
  228. package/lib/utils/focus-lock/setFocus.js +21 -27
  229. package/lib/utils/focus-lock/setFocus.js.map +1 -1
  230. package/lib/utils/focus-lock/setFocus.mjs +19 -25
  231. package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
  232. package/lib/utils/getAccessibleName.js +10 -22
  233. package/lib/utils/getAccessibleName.js.map +1 -1
  234. package/lib/utils/getAccessibleName.mjs +10 -21
  235. package/lib/utils/getAccessibleName.mjs.map +1 -1
  236. package/lib/utils/getDisplayName.js +1 -1
  237. package/lib/utils/getDisplayName.mjs +3 -5
  238. package/lib/utils/getEventTarget.js +13 -32
  239. package/lib/utils/getEventTarget.js.map +1 -1
  240. package/lib/utils/getEventTarget.mjs +12 -31
  241. package/lib/utils/getEventTarget.mjs.map +1 -1
  242. package/lib/utils/getOriginChildren.js +4 -4
  243. package/lib/utils/getOriginChildren.js.map +1 -1
  244. package/lib/utils/getRandomInt.js +1 -1
  245. package/lib/utils/getValue.js +4 -6
  246. package/lib/utils/getValue.js.map +1 -1
  247. package/lib/utils/getValue.mjs +3 -5
  248. package/lib/utils/getValue.mjs.map +1 -1
  249. package/lib/utils/hasLabels.js +16 -27
  250. package/lib/utils/hasLabels.js.map +1 -1
  251. package/lib/utils/hasLabels.mjs +14 -24
  252. package/lib/utils/hasLabels.mjs.map +1 -1
  253. package/lib/utils/hasParent.js +3 -2
  254. package/lib/utils/hasParent.js.map +1 -1
  255. package/lib/utils/hasParent.mjs +2 -3
  256. package/lib/utils/hasParent.mjs.map +1 -1
  257. package/lib/utils/ifChildren.js +6 -4
  258. package/lib/utils/ifChildren.js.map +1 -1
  259. package/lib/utils/ifChildren.mjs +4 -2
  260. package/lib/utils/ifChildren.mjs.map +1 -1
  261. package/lib/utils/injectStyle.js +11 -13
  262. package/lib/utils/injectStyle.js.map +1 -1
  263. package/lib/utils/injectStyle.mjs +9 -10
  264. package/lib/utils/injectStyle.mjs.map +1 -1
  265. package/lib/utils/inputProps.js +5 -5
  266. package/lib/utils/inputProps.js.map +1 -1
  267. package/lib/utils/inputProps.mjs +4 -4
  268. package/lib/utils/inputProps.mjs.map +1 -1
  269. package/lib/utils/isInteractiveElement.js +7 -9
  270. package/lib/utils/isInteractiveElement.js.map +1 -1
  271. package/lib/utils/isInteractiveElement.mjs +7 -9
  272. package/lib/utils/isInteractiveElement.mjs.map +1 -1
  273. package/lib/utils/isNode.js +4 -5
  274. package/lib/utils/isNode.js.map +1 -1
  275. package/lib/utils/isNode.mjs +1 -2
  276. package/lib/utils/isNode.mjs.map +1 -1
  277. package/lib/utils/isPromise.js +1 -1
  278. package/lib/utils/isRetina.js +7 -2
  279. package/lib/utils/isRetina.js.map +1 -1
  280. package/lib/utils/isRetina.mjs +6 -1
  281. package/lib/utils/isRetina.mjs.map +1 -1
  282. package/lib/utils/logger.js +18 -25
  283. package/lib/utils/logger.js.map +1 -1
  284. package/lib/utils/logger.mjs +13 -21
  285. package/lib/utils/logger.mjs.map +1 -1
  286. package/lib/utils/numericChecker.js +11 -18
  287. package/lib/utils/numericChecker.js.map +1 -1
  288. package/lib/utils/numericChecker.mjs +10 -17
  289. package/lib/utils/numericChecker.mjs.map +1 -1
  290. package/lib/utils/ownerDocument.js +2 -2
  291. package/lib/utils/ownerDocument.js.map +1 -1
  292. package/lib/utils/ownerDocument.mjs +1 -1
  293. package/lib/utils/ownerDocument.mjs.map +1 -1
  294. package/lib/utils/pick.js +5 -5
  295. package/lib/utils/pick.js.map +1 -1
  296. package/lib/utils/pick.mjs +4 -4
  297. package/lib/utils/pick.mjs.map +1 -1
  298. package/lib/utils/propsForElement.js +10 -12
  299. package/lib/utils/propsForElement.js.map +1 -1
  300. package/lib/utils/propsForElement.mjs +8 -10
  301. package/lib/utils/propsForElement.mjs.map +1 -1
  302. package/lib/utils/rafTrottle.js +9 -14
  303. package/lib/utils/rafTrottle.js.map +1 -1
  304. package/lib/utils/rafTrottle.mjs +7 -12
  305. package/lib/utils/rafTrottle.mjs.map +1 -1
  306. package/lib/utils/reactToText.js +5 -8
  307. package/lib/utils/reactToText.js.map +1 -1
  308. package/lib/utils/reactToText.mjs +3 -6
  309. package/lib/utils/reactToText.mjs.map +1 -1
  310. package/lib/utils/ref.d.ts +1 -3
  311. package/lib/utils/ref.js +29 -61
  312. package/lib/utils/ref.js.map +1 -1
  313. package/lib/utils/ref.mjs +27 -57
  314. package/lib/utils/ref.mjs.map +1 -1
  315. package/lib/utils/setRef.js +2 -2
  316. package/lib/utils/setRef.js.map +1 -1
  317. package/lib/utils/syncScroll.js +24 -24
  318. package/lib/utils/syncScroll.js.map +1 -1
  319. package/lib/utils/syncScroll.mjs +21 -21
  320. package/lib/utils/syncScroll.mjs.map +1 -1
  321. package/lib/utils/uncontroll.js +8 -18
  322. package/lib/utils/uncontroll.js.map +1 -1
  323. package/lib/utils/uncontroll.mjs +8 -17
  324. package/lib/utils/uncontroll.mjs.map +1 -1
  325. package/lib/utils/uniqueID.d.ts +0 -4
  326. package/lib/utils/uniqueID.js +23 -30
  327. package/lib/utils/uniqueID.js.map +1 -1
  328. package/lib/utils/uniqueID.mjs +19 -29
  329. package/lib/utils/uniqueID.mjs.map +1 -1
  330. package/lib/utils/use/useColorResolver.js +20 -21
  331. package/lib/utils/use/useColorResolver.js.map +1 -1
  332. package/lib/utils/use/useColorResolver.mjs +16 -18
  333. package/lib/utils/use/useColorResolver.mjs.map +1 -1
  334. package/lib/utils/use/useEnhancedEffect.d.ts +1 -1
  335. package/lib/utils/use/useEnhancedEffect.js +4 -4
  336. package/lib/utils/use/useEnhancedEffect.js.map +1 -1
  337. package/lib/utils/use/useEnhancedEffect.mjs +1 -1
  338. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
  339. package/lib/utils/use/useEventCallback.js +5 -10
  340. package/lib/utils/use/useEventCallback.js.map +1 -1
  341. package/lib/utils/use/useEventCallback.mjs +3 -8
  342. package/lib/utils/use/useEventCallback.mjs.map +1 -1
  343. package/lib/utils/use/useEventListener.js +11 -15
  344. package/lib/utils/use/useEventListener.js.map +1 -1
  345. package/lib/utils/use/useEventListener.mjs +7 -11
  346. package/lib/utils/use/useEventListener.mjs.map +1 -1
  347. package/lib/utils/use/useFocusLock.js +80 -94
  348. package/lib/utils/use/useFocusLock.js.map +1 -1
  349. package/lib/utils/use/useFocusLock.mjs +71 -88
  350. package/lib/utils/use/useFocusLock.mjs.map +1 -1
  351. package/lib/utils/use/usePreventScroll.js +26 -28
  352. package/lib/utils/use/usePreventScroll.js.map +1 -1
  353. package/lib/utils/use/usePreventScroll.mjs +21 -23
  354. package/lib/utils/use/usePreventScroll.mjs.map +1 -1
  355. package/lib/utils/use/useScrollBarWidth.js +8 -14
  356. package/lib/utils/use/useScrollBarWidth.js.map +1 -1
  357. package/lib/utils/use/useScrollBarWidth.mjs +8 -13
  358. package/lib/utils/use/useScrollBarWidth.mjs.map +1 -1
  359. package/lib/utils/useCssVariable.js +32 -37
  360. package/lib/utils/useCssVariable.js.map +1 -1
  361. package/lib/utils/useCssVariable.mjs +27 -34
  362. package/lib/utils/useCssVariable.mjs.map +1 -1
  363. package/lib/utils/zIndexStacking.d.ts +3 -1
  364. package/lib/utils/zIndexStacking.js +28 -24
  365. package/lib/utils/zIndexStacking.js.map +1 -1
  366. package/lib/utils/zIndexStacking.mjs +23 -22
  367. package/lib/utils/zIndexStacking.mjs.map +1 -1
  368. package/package.json +129 -129
  369. package/lib/enhancement/bindHandler.d.ts +0 -5
  370. package/lib/enhancement/bindHandler.js +0 -53
  371. package/lib/enhancement/bindHandler.js.map +0 -1
  372. package/lib/enhancement/bindHandler.mjs +0 -48
  373. package/lib/enhancement/bindHandler.mjs.map +0 -1
  374. package/lib/enhancement/hoistProps.d.ts +0 -10
  375. package/lib/enhancement/hoistProps.js +0 -95
  376. package/lib/enhancement/hoistProps.js.map +0 -1
  377. package/lib/enhancement/hoistProps.mjs +0 -78
  378. package/lib/enhancement/hoistProps.mjs.map +0 -1
  379. package/lib/esm/enhancement/bindHandler.mjs +0 -48
  380. package/lib/esm/enhancement/hoistProps.mjs +0 -78
  381. package/lib/esm/utils/createHoc.mjs +0 -42
  382. package/lib/esm/utils/getDisplayName.mjs +0 -6
  383. package/lib/utils/ScreenReaderOnly.d.ts +0 -8
  384. package/lib/utils/ScreenReaderOnly.js +0 -30
  385. package/lib/utils/ScreenReaderOnly.js.map +0 -1
  386. package/lib/utils/ScreenReaderOnly.mjs +0 -24
  387. package/lib/utils/ScreenReaderOnly.mjs.map +0 -1
  388. package/lib/utils/createHoc.d.ts +0 -3
  389. package/lib/utils/createHoc.js +0 -52
  390. package/lib/utils/createHoc.js.map +0 -1
  391. package/lib/utils/createHoc.mjs +0 -42
  392. package/lib/utils/createHoc.mjs.map +0 -1
  393. package/lib/utils/enhances/WithAutoFocus.d.ts +0 -14
  394. package/lib/utils/enhances/WithAutoFocus.js +0 -72
  395. package/lib/utils/enhances/WithAutoFocus.js.map +0 -1
  396. package/lib/utils/enhances/WithAutoFocus.mjs +0 -66
  397. package/lib/utils/enhances/WithAutoFocus.mjs.map +0 -1
  398. package/lib/utils/enhances/WithKeyboardFocus.d.ts +0 -46
  399. package/lib/utils/enhances/WithKeyboardFocus.js +0 -94
  400. package/lib/utils/enhances/WithKeyboardFocus.js.map +0 -1
  401. package/lib/utils/enhances/WithKeyboardFocus.mjs +0 -88
  402. package/lib/utils/enhances/WithKeyboardFocus.mjs.map +0 -1
  403. package/lib/utils/enhances/WithRef.d.ts +0 -3
  404. package/lib/utils/enhances/WithRef.js +0 -25
  405. package/lib/utils/enhances/WithRef.js.map +0 -1
  406. package/lib/utils/enhances/WithRef.mjs +0 -18
  407. package/lib/utils/enhances/WithRef.mjs.map +0 -1
  408. package/lib/utils/enhances/autoFocusEnhance.d.ts +0 -10
  409. package/lib/utils/enhances/autoFocusEnhance.js +0 -45
  410. package/lib/utils/enhances/autoFocusEnhance.js.map +0 -1
  411. package/lib/utils/enhances/autoFocusEnhance.mjs +0 -38
  412. package/lib/utils/enhances/autoFocusEnhance.mjs.map +0 -1
  413. package/lib/utils/enhances/keyboardFocusEnhance.d.ts +0 -27
  414. package/lib/utils/enhances/keyboardFocusEnhance.js +0 -63
  415. package/lib/utils/enhances/keyboardFocusEnhance.js.map +0 -1
  416. package/lib/utils/enhances/keyboardFocusEnhance.mjs +0 -57
  417. package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +0 -1
  418. package/lib/utils/if.d.ts +0 -11
  419. package/lib/utils/if.js +0 -15
  420. package/lib/utils/if.js.map +0 -1
  421. package/lib/utils/if.mjs +0 -9
  422. package/lib/utils/if.mjs.map +0 -1
  423. package/lib/utils/use/useCss.d.ts +0 -4
  424. package/lib/utils/use/useCss.js +0 -19
  425. package/lib/utils/use/useCss.js.map +0 -1
  426. package/lib/utils/use/useCss.mjs +0 -12
  427. package/lib/utils/use/useCss.mjs.map +0 -1
@@ -1,48 +0,0 @@
1
- function arraysEqual(a, b) {
2
- if (a.length !== b.length) return false;
3
- for (var i = 0; i < a.length; i++) {
4
- if (a[i] !== b[i]) return false;
5
- }
6
- return true;
7
- }
8
- function handlerBinder(fn) {
9
- return function() {
10
- for (var _len = arguments.length, depsArgs = new Array(_len), _key = 0; _key < _len; _key++) {
11
- depsArgs[_key] = arguments[_key];
12
- }
13
- var memoizeds = [];
14
- if (handlerBinder.hasher.has(fn)) {
15
- memoizeds = handlerBinder.hasher.get(fn);
16
- var memoized = memoizeds.find(function(memoized2) {
17
- return arraysEqual(memoized2.deps, depsArgs);
18
- });
19
- if (memoized) return memoized.fn;
20
- }
21
- var bindFn = fn.apply(void 0, depsArgs).bind(fn);
22
- memoizeds.push({
23
- deps: depsArgs,
24
- fn: bindFn
25
- });
26
- handlerBinder.hasher.set(fn, memoizeds);
27
- return bindFn;
28
- };
29
- }
30
- handlerBinder.hasher = /* @__PURE__ */ new WeakMap();
31
- function Enhancement() {
32
- return {
33
- condition: function condition(_Component, isFunction) {
34
- return !isFunction;
35
- },
36
- init: function init() {
37
- var _this = this;
38
- Object.keys(this).filter(function(field) {
39
- return field.startsWith("bindHandler");
40
- }).forEach(function(name) {
41
- _this[name] = handlerBinder(_this[name].bind(_this));
42
- });
43
- }
44
- };
45
- }
46
- export {
47
- Enhancement as default
48
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"bindHandler.mjs","names":["arraysEqual","a","b","length","i","handlerBinder","fn","_len","arguments","depsArgs","Array","_key","memoizeds","hasher","has","get","memoized","find","deps","bindFn","apply","bind","push","set","WeakMap","Enhancement","condition","_Component","isFunction","init","_this","Object","keys","filter","field","startsWith","forEach","name"],"sources":["../../src/enhancement/bindHandler.tsx"],"sourcesContent":["function arraysEqual(a: any, b: any) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\nfunction handlerBinder(fn: any) {\n return function (...depsArgs: any[]) {\n let memoizeds = [];\n if (handlerBinder.hasher.has(fn)) {\n memoizeds = handlerBinder.hasher.get(fn);\n const memoized = memoizeds.find((memoized: any) => arraysEqual(memoized.deps, depsArgs));\n if (memoized) return memoized.fn;\n }\n\n const bindFn = fn(...depsArgs).bind(fn);\n memoizeds.push({\n deps: depsArgs,\n fn: bindFn,\n });\n handlerBinder.hasher.set(fn, memoizeds);\n return bindFn;\n };\n}\n\nhandlerBinder.hasher = new WeakMap();\n\nfunction Enhancement() {\n return {\n condition: function (_Component: any, isFunction: boolean) {\n return !isFunction;\n },\n init: function (this: any) {\n Object.keys(this)\n .filter((field) => field.startsWith('bindHandler'))\n .forEach((name) => {\n this[name] = handlerBinder(this[name].bind(this));\n });\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAACC,CAAM,EAAEC,CAAM,EAAE;EACnC,IAAID,CAAC,CAACE,MAAM,KAAKD,CAAC,CAACC,MAAM,EA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WA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYC,UAAe,EAAEC,UAAmB,EAAE;MACzD,OAAO,CAACA,UAAU;IACpB,CAAC;IACDC,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAuB;MAAA,IAAAC,KAAA;MACzBC,MAAM,CAACC,IAAI,CAAC,IAAI,CAAC,CACdC,MAAM,CAAC,UAACC,KAAK;QAAA,OAAKA,KAAK,CAACC,UAAU,CAAC,aAAa,CAAC;MAAA,EAAC,CAClDC,OAAO,CAAC,UAACC,IAAI,EAAK;QACjBP,KAAI,CAACO,IAAI,CAAC,GAAGhC,aAAa,CAACyB,KAAI,CAACO,IAAI,CAAC,CAAChB,IAAI,CAACS,KAAI,CAAC,CAAC;MACnD,CAAC,CAAC;IACN;EACF,CAAC;AACH;AAEA,eAAeL,WAAW","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- export declare const HOIST_CONTEXT: unique symbol;
2
- /** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */
3
- declare function Enhancement(childComponents: any, Context: any): {
4
- condition: (Component: any) => boolean;
5
- init: (this: any, _props: any, _WrapperComponent: any, isFunction: boolean) => void;
6
- context: (this: any, context: any) => any;
7
- asProps: (this: any, props: any) => any;
8
- wrapperProps: (props: any, WrapperComponent: any) => any;
9
- };
10
- export default Enhancement;
@@ -1,95 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = exports.HOIST_CONTEXT = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
- var _react = _interopRequireDefault(require("react"));
13
- var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
14
- var _pick = _interopRequireDefault(require("../utils/pick"));
15
- var _useEnhancedEffect = _interopRequireDefault(require("../utils/use/useEnhancedEffect"));
16
- var HOIST_CONTEXT = exports.HOIST_CONTEXT = Symbol('HOIST_CONTEXT');
17
- var HOIST_SELF = Symbol('HOIST_SELF');
18
- var HOIST_SET = Symbol('HOIST_SET');
19
- function flatChildComponent(childComponents) {
20
- return Object.values(childComponents).reduce(function (acc, Component) {
21
- if (Array.isArray(Component)) {
22
- acc.push(Component[0]);
23
- acc.push.apply(acc, (0, _toConsumableArray2["default"])(flatChildComponent(Component[1])));
24
- } else {
25
- acc.push(Component);
26
- }
27
- return acc;
28
- }, []);
29
- }
30
-
31
- /** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */
32
- function Enhancement(childComponents, Context) {
33
- return {
34
- condition: function condition(Component) {
35
- return [Component].concat((0, _toConsumableArray2["default"])(flatChildComponent(childComponents))).some(function (Component) {
36
- var _Component$hoistProps;
37
- return Boolean((_Component$hoistProps = Component.hoistProps) === null || _Component$hoistProps === void 0 ? void 0 : _Component$hoistProps.length);
38
- });
39
- },
40
- init: function init(_props, _WrapperComponent, isFunction) {
41
- var _this = this;
42
- if (isFunction) {
43
- // TODO: might breake rules of hooks (by lsroman)
44
- this[HOIST_SELF] = _react["default"].useState({});
45
- } else {
46
- this[HOIST_SELF] = [{}, function (obj) {
47
- _this[HOIST_SELF][0] = obj;
48
- _this.forceUpdate();
49
- }];
50
- }
51
- // For optimization render
52
- this[HOIST_SET] = function (obj) {
53
- _this[HOIST_SELF][1](obj);
54
- };
55
- },
56
- context: function context(_context) {
57
- // TODO: need to optimizte container initialization (by lsroman)
58
- // WrapperComponent.hoistProps
59
- return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, _context), {}, (0, _defineProperty2["default"])({}, HOIST_CONTEXT, this[HOIST_SET]));
60
- },
61
- asProps: function asProps(props) {
62
- // TODO: need to check for no props overwriting (by lsroman)
63
- return (0, _assignProps["default"])(this[HOIST_SELF][0], props);
64
- },
65
- wrapperProps: function wrapperProps(props, WrapperComponent) {
66
- var _WrapperComponent$hoi;
67
- if ((_WrapperComponent$hoi = WrapperComponent.hoistProps) !== null && _WrapperComponent$hoi !== void 0 && _WrapperComponent$hoi.length) {
68
- var context = _react["default"].useContext(Context);
69
- var renameProps = WrapperComponent.hoistProps.reduce(function (acc, propName) {
70
- var _propName$split = propName.split(':'),
71
- _propName$split2 = (0, _slicedToArray2["default"])(_propName$split, 2),
72
- name = _propName$split2[0],
73
- rename = _propName$split2[1];
74
- acc[name] = rename || name;
75
- return acc;
76
- }, {});
77
- var hoistProps = Object.entries((0, _pick["default"])(props, Object.keys(renameProps))).reduce(function (acc, _ref) {
78
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
79
- name = _ref2[0],
80
- value = _ref2[1];
81
- acc[renameProps[name]] = value;
82
- return acc;
83
- }, {});
84
- (0, _useEnhancedEffect["default"])(function () {
85
- if (context[HOIST_CONTEXT]) {
86
- context[HOIST_CONTEXT](hoistProps);
87
- }
88
- }, Object.values(hoistProps));
89
- }
90
- return props;
91
- }
92
- };
93
- }
94
- var _default = exports["default"] = Enhancement;
95
- //# sourceMappingURL=hoistProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hoistProps.js","names":["_react","_interopRequireDefault","require","_assignProps","_pick","_useEnhancedEffect","HOIST_CONTEXT","exports","Symbol","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","push","apply","_toConsumableArray2","Enhancement","Context","condition","concat","some","_Component$hoistProps","Boolean","hoistProps","length","init","_props","_WrapperComponent","isFunction","_this","React","useState","obj","forceUpdate","context","_objectSpread3","_defineProperty2","asProps","props","assignProps","wrapperProps","WrapperComponent","_WrapperComponent$hoi","useContext","renameProps","propName","_propName$split","split","_propName$split2","_slicedToArray2","name","rename","entries","pick","keys","_ref","_ref2","value","useEnhancedEffect","_default"],"sources":["../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../utils/assignProps';\nimport pick from '../utils/pick';\nimport useEnhancedEffect from '../utils/use/useEnhancedEffect';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents: any) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc.push(Component[0]);\n acc.push(...flatChildComponent(Component[1]));\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\n/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps?.length),\n );\n },\n init: function (this: any, _props: any, _WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = React.useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj: any) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj: any) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (this: any, context: any) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n if (WrapperComponent.hoistProps?.length) {\n const context: any = React.useContext(Context);\n const renameProps: any = WrapperComponent.hoistProps.reduce((acc: any, propName: any) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc: any, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEO,IAAMI,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,MAAM,CAAC,eAAe,CAAC;AACpD,IAAMC,UAAU,GAAGD,MAAM,CAAC,YAAY,CAAC;AACvC,IAAME,SAAS,GAAGF,MAAM,CAAC,WAAW,CAAC;AAErC,SAASG,kBAAkBA,CAACC,eAAoB,EAAE;EAChD,OAAOC,MAAM,CAACC,MAAM,CAACF,eAAe,CAAC,CAACG,MAAM,CAAY,UAACC,GAAG,EAAEC,SAAS,EAAK;IAC1E,IAAIC,KAAK,CAACC,OAAO,CAACF,SAAS,CAAC,EAAE;MAC5BD,GAAG,CAACI,IAAI,CAACH,SAAS,CAAC,CAAC,CAAC,CAAC;MACtBD,GAAG,CAACI,IAAI,CAAAC,KAAA,CAARL,GAAG,MAAAM,mBAAA,aAASX,kBAAkB,CAACM,SAAS,CAAC,CAAC,CAAC,CAAC,EAAC;IAC/C,CAAC,MAAM;MACLD,GAAG,CAACI,IAAI,CAACH,SAAS,CAAC;IACrB;IACA,OAAOD,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;AACR;;AAEA;AACA,SAASO,WAAWA,CAACX,eAAoB,EAAEY,OAAY,EAAE;EACvD,OAAO;IACLC,SAAS,EAAE,SAAXA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,CAACC,MAAM,CAACgB,UAAU,CAAC,CAAC;MAC/B;MACA,OAAOe,KAAK;IACd;EACF,CAAC;AACH;AAAC,IAAAqB,QAAA,GAAA3D,OAAA,cAEcgB,WAAW","ignoreList":[]}
@@ -1,78 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
- import React from "react";
6
- import assignProps from "../utils/assignProps.mjs";
7
- import pick from "../utils/pick.mjs";
8
- import useEnhancedEffect from "../utils/use/useEnhancedEffect.mjs";
9
- var HOIST_CONTEXT = Symbol("HOIST_CONTEXT");
10
- var HOIST_SELF = Symbol("HOIST_SELF");
11
- var HOIST_SET = Symbol("HOIST_SET");
12
- function flatChildComponent(childComponents) {
13
- return Object.values(childComponents).reduce(function(acc, Component) {
14
- if (Array.isArray(Component)) {
15
- acc.push(Component[0]);
16
- acc.push.apply(acc, _toConsumableArray(flatChildComponent(Component[1])));
17
- } else {
18
- acc.push(Component);
19
- }
20
- return acc;
21
- }, []);
22
- }
23
- function Enhancement(childComponents, Context) {
24
- return {
25
- condition: function condition(Component) {
26
- return [Component].concat(_toConsumableArray(flatChildComponent(childComponents))).some(function(Component2) {
27
- var _Component$hoistProps;
28
- return Boolean((_Component$hoistProps = Component2.hoistProps) === null || _Component$hoistProps === void 0 ? void 0 : _Component$hoistProps.length);
29
- });
30
- },
31
- init: function init(_props, _WrapperComponent, isFunction) {
32
- var _this = this;
33
- if (isFunction) {
34
- this[HOIST_SELF] = React.useState({});
35
- } else {
36
- this[HOIST_SELF] = [{}, function(obj) {
37
- _this[HOIST_SELF][0] = obj;
38
- _this.forceUpdate();
39
- }];
40
- }
41
- this[HOIST_SET] = function(obj) {
42
- _this[HOIST_SELF][1](obj);
43
- };
44
- },
45
- context: function context(_context) {
46
- return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, HOIST_CONTEXT, this[HOIST_SET]));
47
- },
48
- asProps: function asProps(props) {
49
- return assignProps(this[HOIST_SELF][0], props);
50
- },
51
- wrapperProps: function wrapperProps(props, WrapperComponent) {
52
- var _WrapperComponent$hoi;
53
- if ((_WrapperComponent$hoi = WrapperComponent.hoistProps) !== null && _WrapperComponent$hoi !== void 0 && _WrapperComponent$hoi.length) {
54
- var context = React.useContext(Context);
55
- var renameProps = WrapperComponent.hoistProps.reduce(function(acc, propName) {
56
- var _propName$split = propName.split(":"), _propName$split2 = _slicedToArray(_propName$split, 2), name = _propName$split2[0], rename = _propName$split2[1];
57
- acc[name] = rename || name;
58
- return acc;
59
- }, {});
60
- var hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(function(acc, _ref) {
61
- var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], value = _ref2[1];
62
- acc[renameProps[name]] = value;
63
- return acc;
64
- }, {});
65
- useEnhancedEffect(function() {
66
- if (context[HOIST_CONTEXT]) {
67
- context[HOIST_CONTEXT](hoistProps);
68
- }
69
- }, Object.values(hoistProps));
70
- }
71
- return props;
72
- }
73
- };
74
- }
75
- export {
76
- HOIST_CONTEXT,
77
- Enhancement as default
78
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"hoistProps.mjs","names":["React","assignProps","pick","useEnhancedEffect","HOIST_CONTEXT","Symbol","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","push","apply","_toConsumableArray","Enhancement","Context","condition","concat","some","_Component$hoistProps","Boolean","hoistProps","length","init","_props","_WrapperComponent","isFunction","_this","useState","obj","forceUpdate","context","_objectSpread","_defineProperty","asProps","props","wrapperProps","WrapperComponent","_WrapperComponent$hoi","useContext","renameProps","propName","_propName$split","split","_propName$split2","_slicedToArray","name","rename","entries","keys","_ref","_ref2","value"],"sources":["../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../utils/assignProps';\nimport pick from '../utils/pick';\nimport useEnhancedEffect from '../utils/use/useEnhancedEffect';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents: any) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc.push(Component[0]);\n acc.push(...flatChildComponent(Component[1]));\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\n/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps?.length),\n );\n },\n init: function (this: any, _props: any, _WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = React.useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj: any) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj: any) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (this: any, context: any) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n if (WrapperComponent.hoistProps?.length) {\n const context: any = React.useContext(Context);\n const renameProps: any = WrapperComponent.hoistProps.reduce((acc: any, propName: any) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc: any, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,WAAW,MAAM,0BAAsB;AAC9C,OAAOC,IAAI,MAAM,mBAAe;AAChC,OAAOC,iBAAiB,MAAM,oCAAgC;AAE9D,OAAO,IAAMC,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AACpD,IAAMC,UAAU,GAAGD,MAAM,CAAC,YAAY,CAAC;AACvC,IAAME,SAAS,GAAGF,MAAM,CAAC,WAAW,CAAC;AAErC,SAASG,kBAAkBA,CAACC,eAAoB,EAAE;EAChD,OAAOC,MAAM,CAACC,MAAM,CAACF,eAAe,CAAC,CAACG,MAAM,CAAY,UAACC,GAAG,EAAEC,SAAS,EAAK;IAC1E,IAAIC,KAAK,CAACC,OAAO,CAACF,SAAS,CAAC,EAAE;MAC5BD,GAAG,CAACI,IAAI,CAACH,SAAS,CAAC,CAAC,CAAC,CAAC;MACtBD,GAAG,CAACI,IAAI,CAAAC,KAAA,CAARL,GAAG,EAAAM,kBAAA,CAASX,kBAAkB,CAACM,SAAS,CAAC,CAAC,CAAC,CAAC,EAAC;IAC/C,CAAC,MAAM;MACLD,GAAG,CAACI,IAAI,CAACH,SAAS,CAAC;IACrB;IACA,OAAOD,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;AACR;;AAEA;AACA,SAASO,WAAWA,CAACX,eAAoB,EAAEY,OAAY,EAAE;EACvD,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYR,SAAc,EAAE;MACnC,OAAO,CAACA,SAAS,EAAAS,MAAA,CAAAJ,kBAAA,CAAKX,kBAAkB,CAACC,eAAe,CAAC,GAAEe,IAAI,CAAC,UAACV,SAAS;QAAA,IAAAW,qBAAA;QAAA,OACxEC,OAAO,EAA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AAE;QACvC,IAAMS,OAAY,GAAGrC,KAAK,CAAC6C,UAAU,CAACxB,OAAO,CAAC;QAC9C,IAAMyB,WAAgB,GAAGH,gBAAgB,CAAChB,UAAU,CAACf,MAAM,CAAC,UAACC,GAAQ,EAAEkC,QAAa,EAAK;UACvF,IAAAC,eAAA,GAAuBD,QAAQ,CAACE,KAAK,CAAC,GAAG,CAAC;YAAAC,gBAAA,GAAAC,cAAA,CAAAH,eAAA;YAAnCI,IAAI,GAAAF,gBAAA;YAAEG,MAAM,GAAAH,gBAAA;UACnBrC,GAAG,CAACuC,IAAI,CAAC,GAAGC,MAAM,IAAID,IAAI;UAC1B,OAAOvC,GAAG;QACZ,CAAC,EAAE,CAAC,CAAC,CAAC;QACN,IAAMc,UAAU,GAAGjB,MAAM,CAAC4C,OAAO,CAACpD,IAAI,CAACuC,KAAK,EAAE/B,MAAM,CAAC6C,IAAI,CAACT,WAAW,CAAC,CAAC,CAAC,CAAClC,MAAM,CAC7E,UAACC,GAAQ,EAAA2C,IAAA,EAAoB;UAAA,IAAAC,KAAA,GAAAN,cAAA,CAAAK,IAAA;YAAjBJ,IAAI,GAAAK,KAAA;YAAEC,KAAK,GAAAD,KAAA;UACrB5C,GAAG,CAACiC,WAAW,CAACM,IAAI,CAAC,CAAC,GAAGM,KAAK;UAC9B,OAAO7C,GAAG;QACZ,CAAC,EACD,CAAC,CACH,CAAC;QAEDV,iBAAiB,CAAC,YAAM;UACtB,IAAIkC,OAAO,CAACjC,aAAa,CAAC,EAAE;YAC1BiC,OAAO,CAACjC,aAAa,CAAC,CAACuB,UAAU,CAAC;UACpC;QACF,CAAC,EAAEjB,MAAM,CAACC,MAAM,CAACgB,UAAU,CAAC,CAAC;MAC/B;MACA,OAAOc,KAAK;IACd;EACF,CAAC;AACH;AAEA,eAAerB,WAAW","ignoreList":[]}
@@ -1,48 +0,0 @@
1
- function arraysEqual(a, b) {
2
- if (a.length !== b.length) return false;
3
- for (var i = 0; i < a.length; i++) {
4
- if (a[i] !== b[i]) return false;
5
- }
6
- return true;
7
- }
8
- function handlerBinder(fn) {
9
- return function() {
10
- for (var _len = arguments.length, depsArgs = new Array(_len), _key = 0; _key < _len; _key++) {
11
- depsArgs[_key] = arguments[_key];
12
- }
13
- var memoizeds = [];
14
- if (handlerBinder.hasher.has(fn)) {
15
- memoizeds = handlerBinder.hasher.get(fn);
16
- var memoized = memoizeds.find(function(memoized2) {
17
- return arraysEqual(memoized2.deps, depsArgs);
18
- });
19
- if (memoized) return memoized.fn;
20
- }
21
- var bindFn = fn.apply(void 0, depsArgs).bind(fn);
22
- memoizeds.push({
23
- deps: depsArgs,
24
- fn: bindFn
25
- });
26
- handlerBinder.hasher.set(fn, memoizeds);
27
- return bindFn;
28
- };
29
- }
30
- handlerBinder.hasher = /* @__PURE__ */ new WeakMap();
31
- function Enhancement() {
32
- return {
33
- condition: function condition(_Component, isFunction) {
34
- return !isFunction;
35
- },
36
- init: function init() {
37
- var _this = this;
38
- Object.keys(this).filter(function(field) {
39
- return field.startsWith("bindHandler");
40
- }).forEach(function(name) {
41
- _this[name] = handlerBinder(_this[name].bind(_this));
42
- });
43
- }
44
- };
45
- }
46
- export {
47
- Enhancement as default
48
- };
@@ -1,78 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
- import React from "react";
6
- import assignProps from "../utils/assignProps.mjs";
7
- import pick from "../utils/pick.mjs";
8
- import useEnhancedEffect from "../utils/use/useEnhancedEffect.mjs";
9
- var HOIST_CONTEXT = Symbol("HOIST_CONTEXT");
10
- var HOIST_SELF = Symbol("HOIST_SELF");
11
- var HOIST_SET = Symbol("HOIST_SET");
12
- function flatChildComponent(childComponents) {
13
- return Object.values(childComponents).reduce(function(acc, Component) {
14
- if (Array.isArray(Component)) {
15
- acc.push(Component[0]);
16
- acc.push.apply(acc, _toConsumableArray(flatChildComponent(Component[1])));
17
- } else {
18
- acc.push(Component);
19
- }
20
- return acc;
21
- }, []);
22
- }
23
- function Enhancement(childComponents, Context) {
24
- return {
25
- condition: function condition(Component) {
26
- return [Component].concat(_toConsumableArray(flatChildComponent(childComponents))).some(function(Component2) {
27
- var _Component$hoistProps;
28
- return Boolean((_Component$hoistProps = Component2.hoistProps) === null || _Component$hoistProps === void 0 ? void 0 : _Component$hoistProps.length);
29
- });
30
- },
31
- init: function init(_props, _WrapperComponent, isFunction) {
32
- var _this = this;
33
- if (isFunction) {
34
- this[HOIST_SELF] = React.useState({});
35
- } else {
36
- this[HOIST_SELF] = [{}, function(obj) {
37
- _this[HOIST_SELF][0] = obj;
38
- _this.forceUpdate();
39
- }];
40
- }
41
- this[HOIST_SET] = function(obj) {
42
- _this[HOIST_SELF][1](obj);
43
- };
44
- },
45
- context: function context(_context) {
46
- return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, HOIST_CONTEXT, this[HOIST_SET]));
47
- },
48
- asProps: function asProps(props) {
49
- return assignProps(this[HOIST_SELF][0], props);
50
- },
51
- wrapperProps: function wrapperProps(props, WrapperComponent) {
52
- var _WrapperComponent$hoi;
53
- if ((_WrapperComponent$hoi = WrapperComponent.hoistProps) !== null && _WrapperComponent$hoi !== void 0 && _WrapperComponent$hoi.length) {
54
- var context = React.useContext(Context);
55
- var renameProps = WrapperComponent.hoistProps.reduce(function(acc, propName) {
56
- var _propName$split = propName.split(":"), _propName$split2 = _slicedToArray(_propName$split, 2), name = _propName$split2[0], rename = _propName$split2[1];
57
- acc[name] = rename || name;
58
- return acc;
59
- }, {});
60
- var hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(function(acc, _ref) {
61
- var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], value = _ref2[1];
62
- acc[renameProps[name]] = value;
63
- return acc;
64
- }, {});
65
- useEnhancedEffect(function() {
66
- if (context[HOIST_CONTEXT]) {
67
- context[HOIST_CONTEXT](hoistProps);
68
- }
69
- }, Object.values(hoistProps));
70
- }
71
- return props;
72
- }
73
- };
74
- }
75
- export {
76
- HOIST_CONTEXT,
77
- Enhancement as default
78
- };
@@ -1,42 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
- import _createClass from "@babel/runtime/helpers/esm/createClass";
6
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
7
- import _inherits from "@babel/runtime/helpers/esm/inherits";
8
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
- import hoistNonReactStatics from "hoist-non-react-statics";
10
- import React, { PureComponent } from "react";
11
- import getDisplayName from "./getDisplayName.mjs";
12
- var _excluded = ["forwardedRef"];
13
- function createHoc(EnhancedComponent) {
14
- return function createWrapper() {
15
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
16
- return function(WrappedComponent) {
17
- var Component = /* @__PURE__ */ (function(_PureComponent) {
18
- function Component2() {
19
- _classCallCheck(this, Component2);
20
- return _callSuper(this, Component2, arguments);
21
- }
22
- _inherits(Component2, _PureComponent);
23
- return _createClass(Component2, [{
24
- key: "render",
25
- value: function render() {
26
- var _WrappedComponent$def = _objectSpread(_objectSpread({}, WrappedComponent.defaultProps), this.props), forwardedRef = _WrappedComponent$def.forwardedRef, others = _objectWithoutProperties(_WrappedComponent$def, _excluded);
27
- return /* @__PURE__ */ React.createElement(EnhancedComponent, _extends({}, options, this.props), function(enhancedComponentProps) {
28
- return /* @__PURE__ */ React.createElement(WrappedComponent, _extends({
29
- forwardedRef
30
- }, others, enhancedComponentProps));
31
- });
32
- }
33
- }]);
34
- })(PureComponent);
35
- _defineProperty(Component, "displayName", getDisplayName(WrappedComponent));
36
- return hoistNonReactStatics(Component, WrappedComponent);
37
- };
38
- };
39
- }
40
- export {
41
- createHoc as default
42
- };
@@ -1,6 +0,0 @@
1
- function getDisplayName(WrappedComponent) {
2
- return WrappedComponent.displayName || WrappedComponent.name || "Component";
3
- }
4
- export {
5
- getDisplayName as default
6
- };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * @deprecated Use ScreenReaderOnly from 'flex-box' component
4
- */
5
- export declare const ScreenReaderOnly: {
6
- (props: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
7
- displayName: string;
8
- };
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ScreenReaderOnly = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- /**
11
- * @deprecated Use ScreenReaderOnly from 'flex-box' component
12
- */
13
- var ScreenReaderOnly = exports.ScreenReaderOnly = function ScreenReaderOnly(props) {
14
- return /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({}, props, {
15
- style: {
16
- position: 'absolute',
17
- width: 1,
18
- height: 1,
19
- padding: 0,
20
- margin: -1,
21
- overflow: 'hidden',
22
- whiteSpace: 'nowrap',
23
- borderWidth: 0,
24
- left: -1,
25
- top: -1
26
- }
27
- }));
28
- };
29
- ScreenReaderOnly.displayName = 'ScreenReaderOnlyRoot';
30
- //# sourceMappingURL=ScreenReaderOnly.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScreenReaderOnly.js","names":["_react","_interopRequireDefault","require","ScreenReaderOnly","exports","props","createElement","_extends2","style","position","width","height","padding","margin","overflow","whiteSpace","borderWidth","left","top","displayName"],"sources":["../../src/utils/ScreenReaderOnly.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * @deprecated Use ScreenReaderOnly from 'flex-box' component\n */\nexport const ScreenReaderOnly = (props: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n {...props}\n style={{\n position: 'absolute',\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n borderWidth: 0,\n left: -1,\n top: -1,\n }}\n />\n );\n};\nScreenReaderOnly.displayName = 'ScreenReaderOnlyRoot';\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACO,IAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAAnBA,gBAAgBA,CAAIE,KAA4C,EAAK;EAChF,oBACEL,MAAA,YAAAM,aAAA,aAAAC,SAAA,iBACMF,KAAK;IACTG,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,OAAO,EAAE,CAAC;MACVC,MAAM,EAAE,CAAC,CAAC;MACVC,QAAQ,EAAE,QAAQ;MAClBC,UAAU,EAAE,QAAQ;MACpBC,WAAW,EAAE,CAAC;MACdC,IAAI,EAAE,CAAC,CAAC;MACRC,GAAG,EAAE,CAAC;IACR;EAAE,EACH,CAAC;AAEN,CAAC;AACDf,gBAAgB,CAACgB,WAAW,GAAG,sBAAsB","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import React from 'react';
3
-
4
- /**
5
- * @deprecated Use ScreenReaderOnly from 'flex-box' component
6
- */
7
- export var ScreenReaderOnly = function ScreenReaderOnly(props) {
8
- return /*#__PURE__*/React.createElement("span", _extends({}, props, {
9
- style: {
10
- position: 'absolute',
11
- width: 1,
12
- height: 1,
13
- padding: 0,
14
- margin: -1,
15
- overflow: 'hidden',
16
- whiteSpace: 'nowrap',
17
- borderWidth: 0,
18
- left: -1,
19
- top: -1
20
- }
21
- }));
22
- };
23
- ScreenReaderOnly.displayName = 'ScreenReaderOnlyRoot';
24
- //# sourceMappingURL=ScreenReaderOnly.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScreenReaderOnly.mjs","names":["React","ScreenReaderOnly","props","createElement","_extends","style","position","width","height","padding","margin","overflow","whiteSpace","borderWidth","left","top","displayName"],"sources":["../../src/utils/ScreenReaderOnly.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * @deprecated Use ScreenReaderOnly from 'flex-box' component\n */\nexport const ScreenReaderOnly = (props: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n {...props}\n style={{\n position: 'absolute',\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n borderWidth: 0,\n left: -1,\n top: -1,\n }}\n />\n );\n};\nScreenReaderOnly.displayName = 'ScreenReaderOnlyRoot';\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;AACA;AACA;AACA,OAAO,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,KAA4C,EAAK;EAChF,oBACEF,KAAA,CAAAG,aAAA,SAAAC,QAAA,KACMF,KAAK;IACTG,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,OAAO,EAAE,CAAC;MACVC,MAAM,EAAE,CAAC,CAAC;MACVC,QAAQ,EAAE,QAAQ;MAClBC,UAAU,EAAE,QAAQ;MACpBC,WAAW,EAAE,CAAC;MACdC,IAAI,EAAE,CAAC,CAAC;MACRC,GAAG,EAAE,CAAC;IACR;EAAE,EACH,CAAC;AAEN,CAAC;AACDd,gBAAgB,CAACe,WAAW,GAAG,sBAAsB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { type ComponentClass, type ComponentType } from 'react';
2
- declare function createHoc(EnhancedComponent: any): (options?: {}) => (WrappedComponent: ComponentType) => ComponentClass;
3
- export default createHoc;
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
14
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
15
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
- var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
18
- var _react = _interopRequireWildcard(require("react"));
19
- var _getDisplayName = _interopRequireDefault(require("./getDisplayName"));
20
- var _excluded = ["forwardedRef"];
21
- function createHoc(EnhancedComponent) {
22
- return function createWrapper() {
23
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24
- return function (WrappedComponent) {
25
- var Component = /*#__PURE__*/function (_PureComponent) {
26
- function Component() {
27
- (0, _classCallCheck2["default"])(this, Component);
28
- return (0, _callSuper2["default"])(this, Component, arguments);
29
- }
30
- (0, _inherits2["default"])(Component, _PureComponent);
31
- return (0, _createClass2["default"])(Component, [{
32
- key: "render",
33
- value: function render() {
34
- // @ts-ignore
35
- var _WrappedComponent$def = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, WrappedComponent.defaultProps), this.props),
36
- forwardedRef = _WrappedComponent$def.forwardedRef,
37
- others = (0, _objectWithoutProperties2["default"])(_WrappedComponent$def, _excluded);
38
- return /*#__PURE__*/_react["default"].createElement(EnhancedComponent, (0, _extends2["default"])({}, options, this.props), function (enhancedComponentProps) {
39
- return /*#__PURE__*/_react["default"].createElement(WrappedComponent, (0, _extends2["default"])({
40
- forwardedRef: forwardedRef
41
- }, others, enhancedComponentProps));
42
- });
43
- }
44
- }]);
45
- }(_react.PureComponent);
46
- (0, _defineProperty2["default"])(Component, "displayName", (0, _getDisplayName["default"])(WrappedComponent));
47
- return (0, _hoistNonReactStatics["default"])(Component, WrappedComponent);
48
- };
49
- };
50
- }
51
- var _default = exports["default"] = createHoc;
52
- //# sourceMappingURL=createHoc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createHoc.js","names":["_hoistNonReactStatics","_interopRequireDefault","require","_react","_interopRequireWildcard","_getDisplayName","_excluded","createHoc","EnhancedComponent","createWrapper","options","arguments","length","undefined","WrappedComponent","Component","_PureComponent","_classCallCheck2","_callSuper2","_inherits2","_createClass2","key","value","render","_WrappedComponent$def","_objectSpread2","defaultProps","props","forwardedRef","others","_objectWithoutProperties2","createElement","_extends2","enhancedComponentProps","PureComponent","_defineProperty2","getDisplayName","hoistNonReactStatics","_default","exports"],"sources":["../../src/utils/createHoc.tsx"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport React, { type ComponentClass, type ComponentType, PureComponent } from 'react';\n\nimport getDisplayName from './getDisplayName';\n\nfunction createHoc(\n EnhancedComponent: any,\n): (options?: {}) => (WrappedComponent: ComponentType) => ComponentClass {\n return function createWrapper(options = {}) {\n return (WrappedComponent) => {\n class Component extends PureComponent {\n static displayName = getDisplayName(WrappedComponent);\n\n render() {\n // @ts-ignore\n const { forwardedRef, ...others } = { ...WrappedComponent.defaultProps, ...this.props };\n return (\n <EnhancedComponent {...options} {...this.props}>\n {(enhancedComponentProps: any) => (\n <WrappedComponent\n forwardedRef={forwardedRef}\n {...others}\n {...enhancedComponentProps}\n />\n )}\n </EnhancedComponent>\n );\n }\n }\n\n return hoistNonReactStatics(Component, WrappedComponent);\n };\n };\n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IAAAC,gBAAA,aAA/BpB,SAAS,iBACQ,IAAAqB,0BAAc,EAACtB,gBAAgB,CAAC;MAmBvD,OAAO,IAAAuB,gCAAoB,EAACtB,SAAS,EAAED,gBAAgB,CAAC;IAC1D,CAAC;EACH,CAAC;AACH;AAAC,IAAAwB,QAAA,GAAAC,OAAA,cAEchC,SAAS","ignoreList":[]}
@@ -1,42 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
- import _createClass from "@babel/runtime/helpers/esm/createClass";
6
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
7
- import _inherits from "@babel/runtime/helpers/esm/inherits";
8
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
- import hoistNonReactStatics from "hoist-non-react-statics";
10
- import React, { PureComponent } from "react";
11
- import getDisplayName from "./getDisplayName.mjs";
12
- var _excluded = ["forwardedRef"];
13
- function createHoc(EnhancedComponent) {
14
- return function createWrapper() {
15
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
16
- return function(WrappedComponent) {
17
- var Component = /* @__PURE__ */ (function(_PureComponent) {
18
- function Component2() {
19
- _classCallCheck(this, Component2);
20
- return _callSuper(this, Component2, arguments);
21
- }
22
- _inherits(Component2, _PureComponent);
23
- return _createClass(Component2, [{
24
- key: "render",
25
- value: function render() {
26
- var _WrappedComponent$def = _objectSpread(_objectSpread({}, WrappedComponent.defaultProps), this.props), forwardedRef = _WrappedComponent$def.forwardedRef, others = _objectWithoutProperties(_WrappedComponent$def, _excluded);
27
- return /* @__PURE__ */ React.createElement(EnhancedComponent, _extends({}, options, this.props), function(enhancedComponentProps) {
28
- return /* @__PURE__ */ React.createElement(WrappedComponent, _extends({
29
- forwardedRef
30
- }, others, enhancedComponentProps));
31
- });
32
- }
33
- }]);
34
- })(PureComponent);
35
- _defineProperty(Component, "displayName", getDisplayName(WrappedComponent));
36
- return hoistNonReactStatics(Component, WrappedComponent);
37
- };
38
- };
39
- }
40
- export {
41
- createHoc as default
42
- };