@semcore/core 17.0.0-prerelease.20-prerelease.20 → 17.0.0-prerelease.22

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 (354) hide show
  1. package/lib/LastInteractionType.js +22 -36
  2. package/lib/LastInteractionType.js.map +1 -1
  3. package/lib/LastInteractionType.mjs +19 -33
  4. package/lib/LastInteractionType.mjs.map +1 -1
  5. package/lib/core-types/Component.js +25 -41
  6. package/lib/core-types/Component.js.map +1 -1
  7. package/lib/core-types/Component.mjs +18 -38
  8. package/lib/core-types/Component.mjs.map +1 -1
  9. package/lib/core-types/symbols.js +9 -9
  10. package/lib/core-types/symbols.js.map +1 -1
  11. package/lib/core-types/symbols.mjs +9 -9
  12. package/lib/core-types/symbols.mjs.map +1 -1
  13. package/lib/coreFactory.js +143 -205
  14. package/lib/coreFactory.js.map +1 -1
  15. package/lib/coreFactory.mjs +118 -164
  16. package/lib/coreFactory.mjs.map +1 -1
  17. package/lib/decorators/propsObserver.js +36 -64
  18. package/lib/decorators/propsObserver.js.map +1 -1
  19. package/lib/decorators/propsObserver.mjs +33 -61
  20. package/lib/decorators/propsObserver.mjs.map +1 -1
  21. package/lib/decorators/reactive.js +17 -17
  22. package/lib/decorators/reactive.js.map +1 -1
  23. package/lib/decorators/reactive.mjs +15 -15
  24. package/lib/decorators/reactive.mjs.map +1 -1
  25. package/lib/enhancement/Children.js +51 -59
  26. package/lib/enhancement/Children.js.map +1 -1
  27. package/lib/enhancement/Children.mjs +47 -41
  28. package/lib/enhancement/Children.mjs.map +1 -1
  29. package/lib/enhancement/Root.js +36 -37
  30. package/lib/enhancement/Root.js.map +1 -1
  31. package/lib/enhancement/Root.mjs +28 -18
  32. package/lib/enhancement/Root.mjs.map +1 -1
  33. package/lib/enhancement/dataName.js +7 -8
  34. package/lib/enhancement/dataName.js.map +1 -1
  35. package/lib/enhancement/dataName.mjs +5 -5
  36. package/lib/enhancement/dataName.mjs.map +1 -1
  37. package/lib/enhancement/enhance.js +6 -9
  38. package/lib/enhancement/enhance.js.map +1 -1
  39. package/lib/enhancement/enhance.mjs +5 -7
  40. package/lib/enhancement/enhance.mjs.map +1 -1
  41. package/lib/enhancement/functionDefaultProps.js +6 -6
  42. package/lib/enhancement/functionDefaultProps.js.map +1 -1
  43. package/lib/enhancement/functionDefaultProps.mjs +4 -4
  44. package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
  45. package/lib/enhancement/i18n.js +13 -13
  46. package/lib/enhancement/i18n.js.map +1 -1
  47. package/lib/enhancement/i18n.mjs +10 -9
  48. package/lib/enhancement/i18n.mjs.map +1 -1
  49. package/lib/enhancement/inheritedName.js +7 -8
  50. package/lib/enhancement/inheritedName.js.map +1 -1
  51. package/lib/enhancement/inheritedName.mjs +5 -5
  52. package/lib/enhancement/inheritedName.mjs.map +1 -1
  53. package/lib/enhancement/staticChildren.js +47 -56
  54. package/lib/enhancement/staticChildren.js.map +1 -1
  55. package/lib/enhancement/staticChildren.mjs +43 -48
  56. package/lib/enhancement/staticChildren.mjs.map +1 -1
  57. package/lib/enhancement/style.js +29 -27
  58. package/lib/enhancement/style.js.map +1 -1
  59. package/lib/enhancement/style.mjs +26 -20
  60. package/lib/enhancement/style.mjs.map +1 -1
  61. package/lib/enhancement/uncontrolledProps.js +46 -65
  62. package/lib/enhancement/uncontrolledProps.js.map +1 -1
  63. package/lib/enhancement/uncontrolledProps.mjs +43 -52
  64. package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
  65. package/lib/esm/LastInteractionType.mjs +19 -33
  66. package/lib/esm/core-types/Component.mjs +18 -38
  67. package/lib/esm/core-types/symbols.mjs +9 -9
  68. package/lib/esm/coreFactory.mjs +118 -164
  69. package/lib/esm/enhancement/Children.mjs +47 -41
  70. package/lib/esm/enhancement/Root.mjs +28 -18
  71. package/lib/esm/enhancement/dataName.mjs +5 -5
  72. package/lib/esm/enhancement/enhance.mjs +5 -7
  73. package/lib/esm/enhancement/functionDefaultProps.mjs +4 -4
  74. package/lib/esm/enhancement/i18n.mjs +10 -9
  75. package/lib/esm/enhancement/inheritedName.mjs +5 -5
  76. package/lib/esm/enhancement/staticChildren.mjs +43 -48
  77. package/lib/esm/enhancement/style.mjs +26 -20
  78. package/lib/esm/enhancement/uncontrolledProps.mjs +43 -52
  79. package/lib/esm/register.mjs +12 -20
  80. package/lib/esm/styled/reshadow-core.mjs +98 -111
  81. package/lib/esm/styled/sstyled.mjs +31 -41
  82. package/lib/esm/utils/assignProps.mjs +32 -36
  83. package/lib/esm/utils/enhances/WithI18n.mjs +15 -17
  84. package/lib/esm/utils/enhances/i18nEnhance.mjs +47 -61
  85. package/lib/esm/utils/logger.mjs +13 -21
  86. package/lib/esm/utils/pick.mjs +4 -4
  87. package/lib/esm/utils/ref.mjs +27 -43
  88. package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
  89. package/lib/index.js +17 -17
  90. package/lib/register.js +17 -24
  91. package/lib/register.js.map +1 -1
  92. package/lib/register.mjs +12 -20
  93. package/lib/register.mjs.map +1 -1
  94. package/lib/styled/index.js +4 -4
  95. package/lib/styled/reshadow-core.js +102 -104
  96. package/lib/styled/reshadow-core.js.map +1 -1
  97. package/lib/styled/reshadow-core.mjs +98 -111
  98. package/lib/styled/reshadow-core.mjs.map +1 -1
  99. package/lib/styled/sstyled.js +31 -53
  100. package/lib/styled/sstyled.js.map +1 -1
  101. package/lib/styled/sstyled.mjs +31 -41
  102. package/lib/styled/sstyled.mjs.map +1 -1
  103. package/lib/theme/processor.js +150 -222
  104. package/lib/theme/processor.js.map +1 -1
  105. package/lib/theme/processor.mjs +148 -221
  106. package/lib/theme/processor.mjs.map +1 -1
  107. package/lib/theme/themes/dark.js +2 -2
  108. package/lib/theme/themes/dark.js.map +1 -1
  109. package/lib/theme/themes/default.js +2 -2
  110. package/lib/theme/themes/default.js.map +1 -1
  111. package/lib/theme/themes/highlights-dark.js +2 -2
  112. package/lib/theme/themes/highlights-dark.js.map +1 -1
  113. package/lib/theme/themes/highlights-light.js +2 -2
  114. package/lib/theme/themes/highlights-light.js.map +1 -1
  115. package/lib/theme/themes/light.js +2 -2
  116. package/lib/theme/themes/light.js.map +1 -1
  117. package/lib/theme/utils.js +140 -215
  118. package/lib/theme/utils.js.map +1 -1
  119. package/lib/theme/utils.mjs +135 -214
  120. package/lib/theme/utils.mjs.map +1 -1
  121. package/lib/utils/CSSinJS.js +8 -10
  122. package/lib/utils/CSSinJS.js.map +1 -1
  123. package/lib/utils/CSSinJS.mjs +6 -7
  124. package/lib/utils/CSSinJS.mjs.map +1 -1
  125. package/lib/utils/ThemeProvider.js +44 -51
  126. package/lib/utils/ThemeProvider.js.map +1 -1
  127. package/lib/utils/ThemeProvider.mjs +36 -47
  128. package/lib/utils/ThemeProvider.mjs.map +1 -1
  129. package/lib/utils/addonText.js +4 -7
  130. package/lib/utils/addonText.js.map +1 -1
  131. package/lib/utils/addonText.mjs +2 -5
  132. package/lib/utils/addonText.mjs.map +1 -1
  133. package/lib/utils/addonTextChildren.js +15 -21
  134. package/lib/utils/addonTextChildren.js.map +1 -1
  135. package/lib/utils/addonTextChildren.mjs +7 -13
  136. package/lib/utils/addonTextChildren.mjs.map +1 -1
  137. package/lib/utils/ariaProps.js +7 -5
  138. package/lib/utils/ariaProps.js.map +1 -1
  139. package/lib/utils/ariaProps.mjs +7 -5
  140. package/lib/utils/ariaProps.mjs.map +1 -1
  141. package/lib/utils/assignProps.js +33 -37
  142. package/lib/utils/assignProps.js.map +1 -1
  143. package/lib/utils/assignProps.mjs +32 -36
  144. package/lib/utils/assignProps.mjs.map +1 -1
  145. package/lib/utils/canUseDOM.js +1 -1
  146. package/lib/utils/capitalizeFirstLetter.js +1 -1
  147. package/lib/utils/color.js +72 -95
  148. package/lib/utils/color.js.map +1 -1
  149. package/lib/utils/color.mjs +71 -94
  150. package/lib/utils/color.mjs.map +1 -1
  151. package/lib/utils/compose.js +3 -12
  152. package/lib/utils/compose.js.map +1 -1
  153. package/lib/utils/compose.mjs +2 -11
  154. package/lib/utils/compose.mjs.map +1 -1
  155. package/lib/utils/createUUID.js +5 -5
  156. package/lib/utils/createUUID.js.map +1 -1
  157. package/lib/utils/createUUID.mjs +4 -4
  158. package/lib/utils/createUUID.mjs.map +1 -1
  159. package/lib/utils/cssToIntDefault.js +3 -4
  160. package/lib/utils/cssToIntDefault.js.map +1 -1
  161. package/lib/utils/cssToIntDefault.mjs +2 -3
  162. package/lib/utils/cssToIntDefault.mjs.map +1 -1
  163. package/lib/utils/enhances/WithCSS.js +10 -8
  164. package/lib/utils/enhances/WithCSS.js.map +1 -1
  165. package/lib/utils/enhances/WithCSS.mjs +7 -6
  166. package/lib/utils/enhances/WithCSS.mjs.map +1 -1
  167. package/lib/utils/enhances/WithI18n.js +19 -19
  168. package/lib/utils/enhances/WithI18n.js.map +1 -1
  169. package/lib/utils/enhances/WithI18n.mjs +15 -17
  170. package/lib/utils/enhances/WithI18n.mjs.map +1 -1
  171. package/lib/utils/enhances/a11yEnhance.js +34 -39
  172. package/lib/utils/enhances/a11yEnhance.js.map +1 -1
  173. package/lib/utils/enhances/a11yEnhance.mjs +32 -36
  174. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
  175. package/lib/utils/enhances/animatedSizeEnhance.js +55 -63
  176. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
  177. package/lib/utils/enhances/animatedSizeEnhance.mjs +50 -58
  178. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
  179. package/lib/utils/enhances/contextEnhance.js +12 -11
  180. package/lib/utils/enhances/contextEnhance.js.map +1 -1
  181. package/lib/utils/enhances/contextEnhance.mjs +9 -8
  182. package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
  183. package/lib/utils/enhances/i18nEnhance.js +51 -67
  184. package/lib/utils/enhances/i18nEnhance.js.map +1 -1
  185. package/lib/utils/enhances/i18nEnhance.mjs +47 -61
  186. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
  187. package/lib/utils/enhances/resolveColorEnhance.js +12 -10
  188. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -1
  189. package/lib/utils/enhances/resolveColorEnhance.mjs +8 -6
  190. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
  191. package/lib/utils/eventEmitter.js +30 -57
  192. package/lib/utils/eventEmitter.js.map +1 -1
  193. package/lib/utils/eventEmitter.mjs +26 -55
  194. package/lib/utils/eventEmitter.mjs.map +1 -1
  195. package/lib/utils/findComponent.js +35 -42
  196. package/lib/utils/findComponent.js.map +1 -1
  197. package/lib/utils/findComponent.mjs +26 -33
  198. package/lib/utils/findComponent.mjs.map +1 -1
  199. package/lib/utils/fire.js +7 -13
  200. package/lib/utils/fire.js.map +1 -1
  201. package/lib/utils/fire.mjs +5 -11
  202. package/lib/utils/fire.mjs.map +1 -1
  203. package/lib/utils/focus-lock/focusBorders.js +28 -32
  204. package/lib/utils/focus-lock/focusBorders.js.map +1 -1
  205. package/lib/utils/focus-lock/focusBorders.mjs +26 -32
  206. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
  207. package/lib/utils/focus-lock/getFocusableIn.js +4 -6
  208. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -1
  209. package/lib/utils/focus-lock/getFocusableIn.mjs +3 -6
  210. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
  211. package/lib/utils/focus-lock/isFocusInside.js +5 -6
  212. package/lib/utils/focus-lock/isFocusInside.js.map +1 -1
  213. package/lib/utils/focus-lock/isFocusInside.mjs +4 -6
  214. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
  215. package/lib/utils/focus-lock/isFocusable.js +9 -12
  216. package/lib/utils/focus-lock/isFocusable.js.map +1 -1
  217. package/lib/utils/focus-lock/isFocusable.mjs +8 -11
  218. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
  219. package/lib/utils/focus-lock/setFocus.js +21 -27
  220. package/lib/utils/focus-lock/setFocus.js.map +1 -1
  221. package/lib/utils/focus-lock/setFocus.mjs +19 -25
  222. package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
  223. package/lib/utils/getAccessibleName.js +10 -22
  224. package/lib/utils/getAccessibleName.js.map +1 -1
  225. package/lib/utils/getAccessibleName.mjs +10 -21
  226. package/lib/utils/getAccessibleName.mjs.map +1 -1
  227. package/lib/utils/getDisplayName.js +1 -1
  228. package/lib/utils/getEventTarget.js +13 -32
  229. package/lib/utils/getEventTarget.js.map +1 -1
  230. package/lib/utils/getEventTarget.mjs +12 -31
  231. package/lib/utils/getEventTarget.mjs.map +1 -1
  232. package/lib/utils/getOriginChildren.js +4 -4
  233. package/lib/utils/getOriginChildren.js.map +1 -1
  234. package/lib/utils/getRandomInt.js +1 -1
  235. package/lib/utils/getValue.js +4 -6
  236. package/lib/utils/getValue.js.map +1 -1
  237. package/lib/utils/getValue.mjs +3 -5
  238. package/lib/utils/getValue.mjs.map +1 -1
  239. package/lib/utils/hasLabels.js +16 -27
  240. package/lib/utils/hasLabels.js.map +1 -1
  241. package/lib/utils/hasLabels.mjs +14 -24
  242. package/lib/utils/hasLabels.mjs.map +1 -1
  243. package/lib/utils/hasParent.js +3 -2
  244. package/lib/utils/hasParent.js.map +1 -1
  245. package/lib/utils/hasParent.mjs +2 -3
  246. package/lib/utils/hasParent.mjs.map +1 -1
  247. package/lib/utils/ifChildren.js +6 -4
  248. package/lib/utils/ifChildren.js.map +1 -1
  249. package/lib/utils/ifChildren.mjs +4 -2
  250. package/lib/utils/ifChildren.mjs.map +1 -1
  251. package/lib/utils/injectStyle.js +11 -13
  252. package/lib/utils/injectStyle.js.map +1 -1
  253. package/lib/utils/injectStyle.mjs +9 -10
  254. package/lib/utils/injectStyle.mjs.map +1 -1
  255. package/lib/utils/inputProps.js +5 -5
  256. package/lib/utils/inputProps.js.map +1 -1
  257. package/lib/utils/inputProps.mjs +4 -4
  258. package/lib/utils/inputProps.mjs.map +1 -1
  259. package/lib/utils/isInteractiveElement.js +7 -9
  260. package/lib/utils/isInteractiveElement.js.map +1 -1
  261. package/lib/utils/isInteractiveElement.mjs +7 -9
  262. package/lib/utils/isInteractiveElement.mjs.map +1 -1
  263. package/lib/utils/isNode.js +4 -5
  264. package/lib/utils/isNode.js.map +1 -1
  265. package/lib/utils/isNode.mjs +1 -2
  266. package/lib/utils/isNode.mjs.map +1 -1
  267. package/lib/utils/isPromise.js +1 -1
  268. package/lib/utils/isRetina.js +7 -2
  269. package/lib/utils/isRetina.js.map +1 -1
  270. package/lib/utils/isRetina.mjs +6 -1
  271. package/lib/utils/isRetina.mjs.map +1 -1
  272. package/lib/utils/logger.js +18 -25
  273. package/lib/utils/logger.js.map +1 -1
  274. package/lib/utils/logger.mjs +13 -21
  275. package/lib/utils/logger.mjs.map +1 -1
  276. package/lib/utils/numericChecker.js +11 -18
  277. package/lib/utils/numericChecker.js.map +1 -1
  278. package/lib/utils/numericChecker.mjs +10 -17
  279. package/lib/utils/numericChecker.mjs.map +1 -1
  280. package/lib/utils/ownerDocument.js +2 -2
  281. package/lib/utils/ownerDocument.js.map +1 -1
  282. package/lib/utils/ownerDocument.mjs +1 -1
  283. package/lib/utils/ownerDocument.mjs.map +1 -1
  284. package/lib/utils/pick.js +5 -5
  285. package/lib/utils/pick.js.map +1 -1
  286. package/lib/utils/pick.mjs +4 -4
  287. package/lib/utils/pick.mjs.map +1 -1
  288. package/lib/utils/propsForElement.js +10 -12
  289. package/lib/utils/propsForElement.js.map +1 -1
  290. package/lib/utils/propsForElement.mjs +8 -10
  291. package/lib/utils/propsForElement.mjs.map +1 -1
  292. package/lib/utils/rafTrottle.js +9 -14
  293. package/lib/utils/rafTrottle.js.map +1 -1
  294. package/lib/utils/rafTrottle.mjs +7 -12
  295. package/lib/utils/rafTrottle.mjs.map +1 -1
  296. package/lib/utils/reactToText.js +5 -8
  297. package/lib/utils/reactToText.js.map +1 -1
  298. package/lib/utils/reactToText.mjs +3 -6
  299. package/lib/utils/reactToText.mjs.map +1 -1
  300. package/lib/utils/ref.js +29 -47
  301. package/lib/utils/ref.js.map +1 -1
  302. package/lib/utils/ref.mjs +27 -43
  303. package/lib/utils/ref.mjs.map +1 -1
  304. package/lib/utils/setRef.js +2 -2
  305. package/lib/utils/setRef.js.map +1 -1
  306. package/lib/utils/syncScroll.js +24 -24
  307. package/lib/utils/syncScroll.js.map +1 -1
  308. package/lib/utils/syncScroll.mjs +21 -21
  309. package/lib/utils/syncScroll.mjs.map +1 -1
  310. package/lib/utils/uncontroll.js +8 -18
  311. package/lib/utils/uncontroll.js.map +1 -1
  312. package/lib/utils/uncontroll.mjs +8 -17
  313. package/lib/utils/uncontroll.mjs.map +1 -1
  314. package/lib/utils/uniqueID.js +22 -27
  315. package/lib/utils/uniqueID.js.map +1 -1
  316. package/lib/utils/uniqueID.mjs +18 -25
  317. package/lib/utils/uniqueID.mjs.map +1 -1
  318. package/lib/utils/use/useColorResolver.js +20 -21
  319. package/lib/utils/use/useColorResolver.js.map +1 -1
  320. package/lib/utils/use/useColorResolver.mjs +16 -18
  321. package/lib/utils/use/useColorResolver.mjs.map +1 -1
  322. package/lib/utils/use/useEnhancedEffect.js +4 -4
  323. package/lib/utils/use/useEnhancedEffect.js.map +1 -1
  324. package/lib/utils/use/useEnhancedEffect.mjs +1 -1
  325. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
  326. package/lib/utils/use/useEventCallback.js +5 -10
  327. package/lib/utils/use/useEventCallback.js.map +1 -1
  328. package/lib/utils/use/useEventCallback.mjs +3 -8
  329. package/lib/utils/use/useEventCallback.mjs.map +1 -1
  330. package/lib/utils/use/useEventListener.js +11 -15
  331. package/lib/utils/use/useEventListener.js.map +1 -1
  332. package/lib/utils/use/useEventListener.mjs +7 -11
  333. package/lib/utils/use/useEventListener.mjs.map +1 -1
  334. package/lib/utils/use/useFocusLock.js +80 -94
  335. package/lib/utils/use/useFocusLock.js.map +1 -1
  336. package/lib/utils/use/useFocusLock.mjs +71 -88
  337. package/lib/utils/use/useFocusLock.mjs.map +1 -1
  338. package/lib/utils/use/usePreventScroll.js +26 -28
  339. package/lib/utils/use/usePreventScroll.js.map +1 -1
  340. package/lib/utils/use/usePreventScroll.mjs +21 -23
  341. package/lib/utils/use/usePreventScroll.mjs.map +1 -1
  342. package/lib/utils/use/useScrollBarWidth.js +8 -14
  343. package/lib/utils/use/useScrollBarWidth.js.map +1 -1
  344. package/lib/utils/use/useScrollBarWidth.mjs +8 -13
  345. package/lib/utils/use/useScrollBarWidth.mjs.map +1 -1
  346. package/lib/utils/useCssVariable.js +32 -37
  347. package/lib/utils/useCssVariable.js.map +1 -1
  348. package/lib/utils/useCssVariable.mjs +27 -34
  349. package/lib/utils/useCssVariable.mjs.map +1 -1
  350. package/lib/utils/zIndexStacking.js +28 -24
  351. package/lib/utils/zIndexStacking.js.map +1 -1
  352. package/lib/utils/zIndexStacking.mjs +23 -22
  353. package/lib/utils/zIndexStacking.mjs.map +1 -1
  354. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  function Enhancement() {
2
- var defaultProps = {};
2
+ let defaultProps = {};
3
3
  return {
4
- condition: function condition(Component) {
4
+ condition: function(Component) {
5
5
  if (!Component.defaultProps) {
6
6
  return false;
7
7
  }
@@ -10,13 +10,13 @@ function Enhancement() {
10
10
  }
11
11
  return Boolean(Object.keys(Component.defaultProps).length);
12
12
  },
13
- "static": function _static(WrapperComponent) {
13
+ static: function(WrapperComponent) {
14
14
  defaultProps = WrapperComponent.defaultProps;
15
15
  return {
16
16
  defaultProps: {}
17
17
  };
18
18
  },
19
- wrapperProps: function wrapperProps(props) {
19
+ wrapperProps: function(props) {
20
20
  if (typeof defaultProps === "function") {
21
21
  return Object.assign({}, defaultProps(props), props);
22
22
  }
@@ -1,17 +1,18 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
1
  import React from "react";
4
2
  import { Context } from "../utils/enhances/WithI18n.mjs";
5
- var _excluded = ["locale"];
6
3
  function i18nAppLocaleEnhance() {
7
4
  return {
8
- wrapperProps: function wrapperProps(props) {
9
- var locale = props.locale, other = _objectWithoutProperties(props, _excluded);
10
- var contextLocale = React.useContext(Context);
5
+ wrapperProps: (props) => {
6
+ const {
7
+ locale,
8
+ ...other
9
+ } = props;
10
+ const contextLocale = React.useContext(Context);
11
11
  if (!locale && !contextLocale) return props;
12
- return _objectSpread(_objectSpread({}, other), {}, {
13
- locale: locale !== null && locale !== void 0 ? locale : contextLocale
14
- });
12
+ return {
13
+ ...other,
14
+ locale: locale ?? contextLocale
15
+ };
15
16
  }
16
17
  };
17
18
  }
@@ -1,13 +1,13 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
1
  import { INHERITED_NAME } from "../core-types/symbols.mjs";
4
2
  function Enhancement() {
5
3
  return {
6
- condition: function condition(Component) {
4
+ condition: function(Component) {
7
5
  return Boolean(Component.displayName);
8
6
  },
9
- "static": function _static(WrapperComponent) {
10
- return _defineProperty({}, INHERITED_NAME, _toConsumableArray(new Set([].concat(_toConsumableArray(WrapperComponent[INHERITED_NAME] || []), [WrapperComponent.displayName]))));
7
+ static: function(WrapperComponent) {
8
+ return {
9
+ [INHERITED_NAME]: [.../* @__PURE__ */ new Set([...WrapperComponent[INHERITED_NAME] || [], WrapperComponent.displayName])]
10
+ };
11
11
  }
12
12
  };
13
13
  }
@@ -1,58 +1,51 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
1
  import React from "react";
5
2
  import assignProps from "../utils/assignProps.mjs";
6
3
  import logger from "../utils/logger.mjs";
7
4
  import pick from "../utils/pick.mjs";
8
5
  function assign(target, source) {
9
- return Object.defineProperties(target, Object.keys(source).reduce(function(descriptors, key) {
6
+ return Object.defineProperties(target, Object.keys(source).reduce((descriptors, key) => {
10
7
  descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
11
8
  return descriptors;
12
9
  }, {}));
13
10
  }
14
11
  function getterMethodName(name) {
15
- return "get".concat(name, "Props");
12
+ return `get${name}Props`;
16
13
  }
17
- function getterMethodNameByDisplayName() {
18
- var displayName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
19
- var displayNames = displayName.split(".");
20
- var name = displayNames.slice(-(displayNames.length - 1)).join("");
14
+ function getterMethodNameByDisplayName(displayName = "") {
15
+ const displayNames = displayName.split(".");
16
+ const name = displayNames.slice(-(displayNames.length - 1)).join("");
21
17
  return getterMethodName(name);
22
18
  }
23
19
  function flatGetterMethodNames(childComponents, parentName) {
24
- return Object.entries(childComponents).reduce(function(acc, _ref) {
25
- var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], value = _ref2[1];
20
+ return Object.entries(childComponents).reduce((acc, [name, value]) => {
26
21
  if (Array.isArray(value)) {
27
- acc.push.apply(acc, _toConsumableArray(flatGetterMethodNames(value[1], name)));
22
+ acc.push(...flatGetterMethodNames(value[1], name));
28
23
  }
29
- name = parentName ? "".concat(parentName).concat(name) : name;
24
+ name = parentName ? `${parentName}${name}` : name;
30
25
  acc.push(getterMethodName(name));
31
26
  return acc;
32
27
  }, []);
33
28
  }
34
- var STATIC_COMPONENT = Symbol("STATIC_COMPONENT");
35
- var ROOT_COMPONENT = Symbol("ROOT_COMPONENT");
36
- var SELF_GETTER_METHOD = Symbol("SELF_GETTER_METHOD");
29
+ const STATIC_COMPONENT = Symbol("STATIC_COMPONENT");
30
+ const ROOT_COMPONENT = Symbol("ROOT_COMPONENT");
31
+ const SELF_GETTER_METHOD = Symbol("SELF_GETTER_METHOD");
37
32
  function Enhancement(childComponents, createComponent, options) {
38
- var getterMethodNames = flatGetterMethodNames(childComponents);
33
+ const getterMethodNames = flatGetterMethodNames(childComponents);
39
34
  return {
40
- condition: function condition(Component) {
35
+ condition: function(Component) {
41
36
  return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);
42
37
  },
43
- init: function init(props, WrapperComponent) {
44
- var _this = this;
45
- var getterMethods = pick(this, getterMethodNames);
46
- this[SELF_GETTER_METHOD] = function() {
47
- var selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
48
- logger.warn(true, "Getter `".concat(selfGetterMethod, "` can't be fired as it is a getter of static component"), props["data-ui-name"] || WrapperComponent.displayName);
38
+ init: function(props, WrapperComponent) {
39
+ const getterMethods = pick(this, getterMethodNames);
40
+ this[SELF_GETTER_METHOD] = () => {
41
+ const selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
42
+ logger.warn(true, `Getter \`${selfGetterMethod}\` can't be fired as it is a getter of static component`, props["data-ui-name"] || WrapperComponent.displayName);
49
43
  };
50
- assign(this, getterMethodNames.reduce(function(acc, name) {
51
- var getterMethod = getterMethods[name];
44
+ assign(this, getterMethodNames.reduce((acc, name) => {
45
+ const getterMethod = getterMethods[name];
52
46
  if (!getterMethod) return acc;
53
- acc[name] = function() {
54
- var childrenProps = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
55
- var getterProps = getterMethod.call(_this, childrenProps, acc[name].index);
47
+ acc[name] = (childrenProps = {}) => {
48
+ const getterProps = getterMethod.call(this, childrenProps, acc[name].index);
56
49
  return assignProps(childrenProps, getterProps);
57
50
  };
58
51
  acc[name].index = -1;
@@ -60,20 +53,19 @@ function Enhancement(childComponents, createComponent, options) {
60
53
  return acc;
61
54
  }, {}));
62
55
  },
63
- "static": function _static(WrapperComponent, Component) {
56
+ static: function(WrapperComponent, Component) {
64
57
  if (Object.keys(childComponents).length && !WrapperComponent.displayName) {
65
58
  throw new Error('"displayName" is not defined');
66
59
  }
67
- return Object.entries(childComponents).reduce(function(acc, _ref3) {
68
- var _ref4 = _slicedToArray(_ref3, 2), name = _ref4[0], value = _ref4[1];
69
- var childComponents2 = {};
60
+ return Object.entries(childComponents).reduce((acc, [name, value]) => {
61
+ let childComponents2 = {};
70
62
  if (Array.isArray(value)) {
71
63
  childComponents2 = value[1];
72
64
  value = value[0];
73
65
  }
74
- var prevStaticComponent = value[STATIC_COMPONENT];
75
- var prevDisplayName = value.displayName;
76
- value.displayName = "".concat(WrapperComponent.displayName, ".").concat(name);
66
+ const prevStaticComponent = value[STATIC_COMPONENT];
67
+ const prevDisplayName = value.displayName;
68
+ value.displayName = `${WrapperComponent.displayName}.${name}`;
77
69
  value[STATIC_COMPONENT] = true;
78
70
  value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;
79
71
  acc[name] = createComponent(value, childComponents2, options);
@@ -82,13 +74,17 @@ function Enhancement(childComponents, createComponent, options) {
82
74
  return acc;
83
75
  }, {});
84
76
  },
85
- context: function context(_context) {
86
- return _objectSpread(_objectSpread({}, _context), pick(this, getterMethodNames));
77
+ context: function(context) {
78
+ return {
79
+ ...context,
80
+ // [getterMethod]: this[SELF_GETTER_METHOD],
81
+ ...pick(this, getterMethodNames)
82
+ };
87
83
  },
88
- wrapperProps: function wrapperProps(props, WrapperComponent) {
84
+ wrapperProps: function(props, WrapperComponent) {
89
85
  if (!WrapperComponent[STATIC_COMPONENT]) return props;
90
- var context = React.useContext(options.context);
91
- var getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];
86
+ const context = React.useContext(options.context);
87
+ const getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];
92
88
  if (getterMethod) {
93
89
  if (!getterMethod.cache.has(this)) {
94
90
  getterMethod.cache.add(this);
@@ -100,14 +96,13 @@ function Enhancement(childComponents, createComponent, options) {
100
96
  }
101
97
  return props;
102
98
  },
103
- render: function render(_render) {
104
- var _this2 = this;
105
- getterMethodNames.forEach(function(name) {
106
- if (_this2[name] === void 0) return;
107
- _this2[name].index = -1;
108
- _this2[name].cache.clear();
99
+ render: function(render) {
100
+ getterMethodNames.forEach((name) => {
101
+ if (this[name] === void 0) return;
102
+ this[name].index = -1;
103
+ this[name].cache.clear();
109
104
  });
110
- return _render;
105
+ return render;
111
106
  }
112
107
  };
113
108
  }
@@ -1,19 +1,15 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
1
  import React from "react";
5
2
  import { STATIC_COMPONENT } from "./staticChildren.mjs";
6
3
  import "../styled/index.mjs";
7
4
  import { sstyled } from "../styled/sstyled.mjs";
8
- var _excluded = ["_styles", "styles"], _excluded2 = ["styles"];
9
- var STYLES_CONTEXT = Symbol("STYLES_CONTEXT");
10
- var STYLES_SELF = Symbol("STYLES_SELF");
5
+ const STYLES_CONTEXT = Symbol("STYLES_CONTEXT");
6
+ const STYLES_SELF = Symbol("STYLES_SELF");
11
7
  function Enhancement(childComponents, Context) {
12
8
  return {
13
- condition: function condition(Component) {
9
+ condition: function(Component) {
14
10
  return Boolean(Component.style || Component[STATIC_COMPONENT]);
15
11
  },
16
- init: function init(props, WrapperComponent) {
12
+ init: function(props, WrapperComponent) {
17
13
  if (props.styles) {
18
14
  this[STYLES_SELF] = props.styles;
19
15
  }
@@ -21,25 +17,35 @@ function Enhancement(childComponents, Context) {
21
17
  this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);
22
18
  }
23
19
  },
24
- context: function context(_context) {
20
+ context: function(context) {
25
21
  if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {
26
- return _context;
22
+ return context;
27
23
  }
28
- return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, STYLES_CONTEXT, this[STYLES_SELF]));
24
+ return {
25
+ ...context,
26
+ [STYLES_CONTEXT]: this[STYLES_SELF]
27
+ };
29
28
  },
30
- asProps: function asProps(_ref) {
31
- var _styles = _ref._styles, styles = _ref.styles, props = _objectWithoutProperties(_ref, _excluded);
32
- return _objectSpread(_objectSpread({}, props), {}, {
29
+ asProps: function({
30
+ _styles,
31
+ styles,
32
+ ...props
33
+ }) {
34
+ return {
35
+ ...props,
33
36
  styles: this[STYLES_SELF]
34
- });
37
+ };
35
38
  },
36
- wrapperProps: function wrapperProps(_ref2) {
37
- var styles = _ref2.styles, props = _objectWithoutProperties(_ref2, _excluded2);
38
- var context = React.useContext(Context);
39
- return _objectSpread(_objectSpread({}, props), {}, {
39
+ wrapperProps: function({
40
+ styles,
41
+ ...props
42
+ }) {
43
+ const context = React.useContext(Context);
44
+ return {
45
+ ...props,
40
46
  _styles: styles,
41
47
  styles: context[STYLES_CONTEXT]
42
- });
48
+ };
43
49
  }
44
50
  };
45
51
  }
@@ -1,26 +1,18 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _arrayLikeToArray from "@babel/runtime/helpers/esm/arrayLikeToArray";
4
- import _toArray from "@babel/runtime/helpers/esm/toArray";
5
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
- import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
7
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
8
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
1
  import { callAllEventHandlers } from "../utils/assignProps.mjs";
10
2
  import capitalizeFirstLetter from "../utils/capitalizeFirstLetter.mjs";
11
3
  function assign(target, source) {
12
- return Object.defineProperties(target, Object.keys(source).reduce(function(descriptors, key) {
4
+ return Object.defineProperties(target, Object.keys(source).reduce((descriptors, key) => {
13
5
  descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
14
6
  return descriptors;
15
7
  }, {}));
16
8
  }
17
9
  function defaultProp(prop) {
18
- return "default".concat(capitalizeFirstLetter(prop));
10
+ return `default${capitalizeFirstLetter(prop)}`;
19
11
  }
20
12
  function handlerProp(prop) {
21
13
  if (prop === "value") prop = "";
22
14
  if (prop === "checked") prop = "";
23
- return "on".concat(capitalizeFirstLetter(prop), "Change");
15
+ return `on${capitalizeFirstLetter(prop)}Change`;
24
16
  }
25
17
  function isControlled(propValue) {
26
18
  return propValue !== void 0;
@@ -29,48 +21,46 @@ function uncontrolledProp(self, propName, propValue, propDefaultValue, propHandl
29
21
  function getValue() {
30
22
  return isControlled(propValue) ? propValue : propName in self.state ? self.state[propName] : propDefaultValue;
31
23
  }
32
- return [getValue(), function(value) {
33
- var oldValue = getValue();
24
+ return [getValue(), (value, ...args) => {
25
+ const oldValue = getValue();
34
26
  if (oldValue === value) return false;
35
- if (!isControlled(propValue)) self.setState(_defineProperty({}, propName, value));
36
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
37
- args[_key - 1] = arguments[_key];
38
- }
39
- return callAllEventHandlers.apply(void 0, [propHandler].concat(_toConsumableArray(chainHandler))).apply(void 0, [value].concat(args));
27
+ if (!isControlled(propValue)) self.setState({
28
+ [propName]: value
29
+ });
30
+ return callAllEventHandlers(propHandler, ...chainHandler)(value, ...args);
40
31
  }];
41
32
  }
42
33
  function uncontrolledUniversal(props, config, uncontrolledProp2) {
43
- var handlerProps = {};
44
- var uncontrolledProps = Object.keys(config).reduce(function(result, propName) {
45
- var handlerName = handlerProp(propName);
46
- var defaultPropName = defaultProp(propName);
47
- var propDefaultValue = result[defaultPropName], propValue = result[propName], propHandler = result[handlerName], other = _objectWithoutProperties(result, [defaultPropName, propName, handlerName].map(_toPropertyKey));
34
+ const handlerProps = {};
35
+ const uncontrolledProps = Object.keys(config).reduce((result, propName) => {
36
+ const handlerName = handlerProp(propName);
37
+ const defaultPropName = defaultProp(propName);
38
+ const {
39
+ [defaultPropName]: propDefaultValue,
40
+ [propName]: propValue,
41
+ [handlerName]: propHandler,
42
+ ...other
43
+ } = result;
48
44
  if (propDefaultValue === void 0) {
49
45
  console.warn(defaultPropName, 'must be installed in "defaultProps"');
50
46
  }
51
- var setter = config[propName];
52
- var chainHandler = [];
53
- if (Array.isArray(setter)) {
54
- var _setter = setter;
55
- var _setter2 = _toArray(_setter);
56
- setter = _setter2[0];
57
- chainHandler = _arrayLikeToArray(_setter2).slice(1);
58
- }
59
- setter = setter || function(v) {
60
- return v;
61
- };
62
- var _uncontrolledProp = uncontrolledProp2(propName, propValue, propDefaultValue, propHandler, chainHandler), _uncontrolledProp2 = _slicedToArray(_uncontrolledProp, 2), value = _uncontrolledProp2[0], handler = _uncontrolledProp2[1];
47
+ let setter = config[propName];
48
+ let chainHandler = [];
49
+ if (Array.isArray(setter)) [setter, ...chainHandler] = setter;
50
+ setter = setter || ((v) => v);
51
+ const [value, handler] = uncontrolledProp2(propName, propValue, propDefaultValue, propHandler, chainHandler);
63
52
  handlerProps[propName] = handler;
64
- return _objectSpread(_objectSpread({}, other), {}, _defineProperty(_defineProperty({}, propName, value), handlerName, function(eventOrValue) {
65
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
66
- args[_key2 - 1] = arguments[_key2];
67
- }
68
- var result2 = [setter.apply(void 0, [eventOrValue].concat(args))].concat(args);
69
- if (eventOrValue !== null && eventOrValue !== void 0 && eventOrValue.target) {
70
- result2.push(eventOrValue);
53
+ return {
54
+ ...other,
55
+ [propName]: value,
56
+ [handlerName]: (eventOrValue, ...args) => {
57
+ const result2 = [setter(eventOrValue, ...args), ...args];
58
+ if (eventOrValue == null ? void 0 : eventOrValue.target) {
59
+ result2.push(eventOrValue);
60
+ }
61
+ return handler(...result2);
71
62
  }
72
- return handler.apply(void 0, _toConsumableArray(result2));
73
- }));
63
+ };
74
64
  }, props);
75
65
  return [uncontrolledProps, handlerProps];
76
66
  }
@@ -79,25 +69,26 @@ function uncontrolled(self, props, config) {
79
69
  }
80
70
  function Enhancement() {
81
71
  return {
82
- condition: function condition(Component) {
72
+ condition: function(Component) {
83
73
  return Boolean(Component.prototype.uncontrolledProps);
84
74
  },
85
- init: function init() {
75
+ init: function() {
86
76
  this.state = this.state || {};
87
77
  assign(this, {
88
78
  get handlers() {
89
- var _uncontrolled = uncontrolled(this, this.props, this.uncontrolledProps()), _uncontrolled2 = _slicedToArray(_uncontrolled, 2), uncontrolledHandlers = _uncontrolled2[1];
79
+ const [, uncontrolledHandlers] = uncontrolled(this, this.props, this.uncontrolledProps());
90
80
  return uncontrolledHandlers;
91
81
  }
92
82
  });
93
83
  },
94
- context: function context(_context) {
95
- return _objectSpread(_objectSpread({}, _context), {}, {
84
+ context: function(context) {
85
+ return {
86
+ ...context,
96
87
  handlers: this.handlers
97
- });
88
+ };
98
89
  },
99
- asProps: function asProps(props) {
100
- var _uncontrolled3 = uncontrolled(this, props, this.uncontrolledProps()), _uncontrolled4 = _slicedToArray(_uncontrolled3, 1), uncontrolledProps = _uncontrolled4[0];
90
+ asProps: function(props) {
91
+ const [uncontrolledProps] = uncontrolled(this, props, this.uncontrolledProps());
101
92
  return uncontrolledProps;
102
93
  }
103
94
  };
@@ -1,28 +1,20 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- var Register = /* @__PURE__ */ (function() {
5
- function Register2() {
6
- _classCallCheck(this, Register2);
2
+ class Register {
3
+ constructor() {
7
4
  _defineProperty(this, "data", {});
8
5
  }
9
- return _createClass(Register2, [{
10
- key: "get",
11
- value: function get(name, defaultValue) {
12
- if (name in this.data) {
13
- return this.data[name];
14
- } else {
15
- return this.set(name, defaultValue);
16
- }
17
- }
18
- }, {
19
- key: "set",
20
- value: function set(name, value) {
21
- this.data[name] = value;
6
+ get(name, defaultValue) {
7
+ if (name in this.data) {
22
8
  return this.data[name];
9
+ } else {
10
+ return this.set(name, defaultValue);
23
11
  }
24
- }]);
25
- })();
12
+ }
13
+ set(name, value) {
14
+ this.data[name] = value;
15
+ return this.data[name];
16
+ }
17
+ }
26
18
  const register = new Register();
27
19
  export {
28
20
  Register,