@semcore/core 17.0.0-prerelease.43 → 17.0.1-prerelease.0

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