@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.
- package/CHANGELOG.md +12 -1
- package/README.md +4 -4
- package/lib/LastInteractionType.js +22 -36
- package/lib/LastInteractionType.js.map +1 -1
- package/lib/LastInteractionType.mjs +19 -33
- package/lib/LastInteractionType.mjs.map +1 -1
- package/lib/core-types/Component.d.ts +26 -79
- package/lib/core-types/Component.js +24 -72
- package/lib/core-types/Component.js.map +1 -1
- package/lib/core-types/Component.mjs +18 -34
- package/lib/core-types/Component.mjs.map +1 -1
- package/lib/core-types/symbols.js +9 -9
- package/lib/core-types/symbols.js.map +1 -1
- package/lib/core-types/symbols.mjs +9 -9
- package/lib/core-types/symbols.mjs.map +1 -1
- package/lib/coreFactory.d.ts +6 -23
- package/lib/coreFactory.js +150 -217
- package/lib/coreFactory.js.map +1 -1
- package/lib/coreFactory.mjs +139 -194
- package/lib/coreFactory.mjs.map +1 -1
- package/lib/decorators/propsObserver.d.ts +11 -0
- package/lib/decorators/reactive.d.ts +11 -0
- package/lib/enhancement/Children.js +51 -59
- package/lib/enhancement/Children.js.map +1 -1
- package/lib/enhancement/Children.mjs +47 -41
- package/lib/enhancement/Children.mjs.map +1 -1
- package/lib/enhancement/Root.js +36 -37
- package/lib/enhancement/Root.js.map +1 -1
- package/lib/enhancement/Root.mjs +28 -18
- package/lib/enhancement/Root.mjs.map +1 -1
- package/lib/enhancement/dataName.js +7 -8
- package/lib/enhancement/dataName.js.map +1 -1
- package/lib/enhancement/dataName.mjs +5 -5
- package/lib/enhancement/dataName.mjs.map +1 -1
- package/lib/enhancement/enhance.js +6 -9
- package/lib/enhancement/enhance.js.map +1 -1
- package/lib/enhancement/enhance.mjs +5 -7
- package/lib/enhancement/enhance.mjs.map +1 -1
- package/lib/enhancement/functionDefaultProps.js +6 -6
- package/lib/enhancement/functionDefaultProps.js.map +1 -1
- package/lib/enhancement/functionDefaultProps.mjs +4 -4
- package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
- package/lib/enhancement/i18n.js +13 -13
- package/lib/enhancement/i18n.js.map +1 -1
- package/lib/enhancement/i18n.mjs +10 -9
- package/lib/enhancement/i18n.mjs.map +1 -1
- package/lib/enhancement/inheritedName.js +7 -8
- package/lib/enhancement/inheritedName.js.map +1 -1
- package/lib/enhancement/inheritedName.mjs +5 -5
- package/lib/enhancement/inheritedName.mjs.map +1 -1
- package/lib/enhancement/staticChildren.js +47 -56
- package/lib/enhancement/staticChildren.js.map +1 -1
- package/lib/enhancement/staticChildren.mjs +43 -48
- package/lib/enhancement/staticChildren.mjs.map +1 -1
- package/lib/enhancement/style.js +29 -27
- package/lib/enhancement/style.js.map +1 -1
- package/lib/enhancement/style.mjs +26 -20
- package/lib/enhancement/style.mjs.map +1 -1
- package/lib/enhancement/uncontrolledProps.js +46 -64
- package/lib/enhancement/uncontrolledProps.js.map +1 -1
- package/lib/enhancement/uncontrolledProps.mjs +43 -51
- package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
- package/lib/esm/LastInteractionType.mjs +19 -33
- package/lib/esm/core-types/Component.mjs +18 -34
- package/lib/esm/core-types/symbols.mjs +9 -9
- package/lib/esm/coreFactory.mjs +139 -194
- package/lib/esm/enhancement/Children.mjs +47 -41
- package/lib/esm/enhancement/Root.mjs +28 -18
- package/lib/esm/enhancement/dataName.mjs +5 -5
- package/lib/esm/enhancement/enhance.mjs +5 -7
- package/lib/esm/enhancement/functionDefaultProps.mjs +4 -4
- package/lib/esm/enhancement/i18n.mjs +10 -9
- package/lib/esm/enhancement/inheritedName.mjs +5 -5
- package/lib/esm/enhancement/staticChildren.mjs +43 -48
- package/lib/esm/enhancement/style.mjs +26 -20
- package/lib/esm/enhancement/uncontrolledProps.mjs +43 -51
- package/lib/esm/register.mjs +12 -20
- package/lib/esm/styled/reshadow-core.mjs +98 -111
- package/lib/esm/styled/sstyled.mjs +31 -41
- package/lib/esm/utils/assignProps.mjs +32 -36
- package/lib/esm/utils/enhances/WithI18n.mjs +16 -63
- package/lib/esm/utils/enhances/i18nEnhance.mjs +47 -61
- package/lib/esm/utils/logger.mjs +13 -21
- package/lib/esm/utils/pick.mjs +4 -4
- package/lib/esm/utils/ref.mjs +27 -57
- package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +17 -17
- package/lib/index.js.map +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/register.js +17 -24
- package/lib/register.js.map +1 -1
- package/lib/register.mjs +12 -20
- package/lib/register.mjs.map +1 -1
- package/lib/styled/index.d.ts +1 -5
- package/lib/styled/index.js +4 -4
- package/lib/styled/index.js.map +1 -1
- package/lib/styled/index.mjs.map +1 -1
- package/lib/styled/reshadow-core.js +102 -104
- package/lib/styled/reshadow-core.js.map +1 -1
- package/lib/styled/reshadow-core.mjs +98 -111
- package/lib/styled/reshadow-core.mjs.map +1 -1
- package/lib/styled/sstyled.js +31 -53
- package/lib/styled/sstyled.js.map +1 -1
- package/lib/styled/sstyled.mjs +31 -41
- package/lib/styled/sstyled.mjs.map +1 -1
- package/lib/theme/processor.js +150 -222
- package/lib/theme/processor.js.map +1 -1
- package/lib/theme/processor.mjs +148 -221
- package/lib/theme/processor.mjs.map +1 -1
- package/lib/theme/themes/dark.js +2 -2
- package/lib/theme/themes/dark.js.map +1 -1
- package/lib/theme/themes/default.js +2 -2
- package/lib/theme/themes/default.js.map +1 -1
- package/lib/theme/themes/highlights-dark.js +2 -2
- package/lib/theme/themes/highlights-dark.js.map +1 -1
- package/lib/theme/themes/highlights-light.js +2 -2
- package/lib/theme/themes/highlights-light.js.map +1 -1
- package/lib/theme/themes/light.js +2 -2
- package/lib/theme/themes/light.js.map +1 -1
- package/lib/theme/utils.js +140 -215
- package/lib/theme/utils.js.map +1 -1
- package/lib/theme/utils.mjs +135 -214
- package/lib/theme/utils.mjs.map +1 -1
- package/lib/utils/CSSinJS.js +8 -10
- package/lib/utils/CSSinJS.js.map +1 -1
- package/lib/utils/CSSinJS.mjs +6 -7
- package/lib/utils/CSSinJS.mjs.map +1 -1
- package/lib/utils/ThemeProvider.js +44 -51
- package/lib/utils/ThemeProvider.js.map +1 -1
- package/lib/utils/ThemeProvider.mjs +36 -47
- package/lib/utils/ThemeProvider.mjs.map +1 -1
- package/lib/utils/addonText.js +4 -7
- package/lib/utils/addonText.js.map +1 -1
- package/lib/utils/addonText.mjs +2 -5
- package/lib/utils/addonText.mjs.map +1 -1
- package/lib/utils/addonTextChildren.js +15 -21
- package/lib/utils/addonTextChildren.js.map +1 -1
- package/lib/utils/addonTextChildren.mjs +7 -13
- package/lib/utils/addonTextChildren.mjs.map +1 -1
- package/lib/utils/ariaProps.js +7 -5
- package/lib/utils/ariaProps.js.map +1 -1
- package/lib/utils/ariaProps.mjs +7 -5
- package/lib/utils/ariaProps.mjs.map +1 -1
- package/lib/utils/assignProps.js +33 -37
- package/lib/utils/assignProps.js.map +1 -1
- package/lib/utils/assignProps.mjs +32 -36
- package/lib/utils/assignProps.mjs.map +1 -1
- package/lib/utils/canUseDOM.js +1 -1
- package/lib/utils/capitalizeFirstLetter.js +1 -1
- package/lib/utils/color.js +72 -95
- package/lib/utils/color.js.map +1 -1
- package/lib/utils/color.mjs +71 -94
- package/lib/utils/color.mjs.map +1 -1
- package/lib/utils/compose.js +3 -12
- package/lib/utils/compose.js.map +1 -1
- package/lib/utils/compose.mjs +2 -11
- package/lib/utils/compose.mjs.map +1 -1
- package/lib/utils/createUUID.js +5 -5
- package/lib/utils/createUUID.js.map +1 -1
- package/lib/utils/createUUID.mjs +4 -4
- package/lib/utils/createUUID.mjs.map +1 -1
- package/lib/utils/cssToIntDefault.js +3 -4
- package/lib/utils/cssToIntDefault.js.map +1 -1
- package/lib/utils/cssToIntDefault.mjs +2 -3
- package/lib/utils/cssToIntDefault.mjs.map +1 -1
- package/lib/utils/enhances/WithCSS.d.ts +2 -30
- package/lib/utils/enhances/WithCSS.js +13 -64
- package/lib/utils/enhances/WithCSS.js.map +1 -1
- package/lib/utils/enhances/WithCSS.mjs +9 -59
- package/lib/utils/enhances/WithCSS.mjs.map +1 -1
- package/lib/utils/enhances/WithI18n.d.ts +1 -30
- package/lib/utils/enhances/WithI18n.js +20 -76
- package/lib/utils/enhances/WithI18n.js.map +1 -1
- package/lib/utils/enhances/WithI18n.mjs +16 -63
- package/lib/utils/enhances/WithI18n.mjs.map +1 -1
- package/lib/utils/enhances/a11yEnhance.js +34 -39
- package/lib/utils/enhances/a11yEnhance.js.map +1 -1
- package/lib/utils/enhances/a11yEnhance.mjs +32 -36
- package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.d.ts +0 -4
- package/lib/utils/enhances/animatedSizeEnhance.js +55 -65
- package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.mjs +50 -61
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
- package/lib/utils/enhances/contextEnhance.js +12 -11
- package/lib/utils/enhances/contextEnhance.js.map +1 -1
- package/lib/utils/enhances/contextEnhance.mjs +9 -8
- package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
- package/lib/utils/enhances/i18nEnhance.d.ts +0 -4
- package/lib/utils/enhances/i18nEnhance.js +51 -69
- package/lib/utils/enhances/i18nEnhance.js.map +1 -1
- package/lib/utils/enhances/i18nEnhance.mjs +47 -61
- package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
- package/lib/utils/enhances/resolveColorEnhance.js +12 -10
- package/lib/utils/enhances/resolveColorEnhance.js.map +1 -1
- package/lib/utils/enhances/resolveColorEnhance.mjs +8 -6
- package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
- package/lib/utils/eventEmitter.d.ts +10 -6
- package/lib/utils/eventEmitter.js +33 -32
- package/lib/utils/eventEmitter.js.map +1 -1
- package/lib/utils/eventEmitter.mjs +30 -31
- package/lib/utils/eventEmitter.mjs.map +1 -1
- package/lib/utils/findComponent.js +35 -42
- package/lib/utils/findComponent.js.map +1 -1
- package/lib/utils/findComponent.mjs +26 -33
- package/lib/utils/findComponent.mjs.map +1 -1
- package/lib/utils/fire.js +7 -13
- package/lib/utils/fire.js.map +1 -1
- package/lib/utils/fire.mjs +5 -11
- package/lib/utils/fire.mjs.map +1 -1
- package/lib/utils/focus-lock/focusBorders.js +28 -32
- package/lib/utils/focus-lock/focusBorders.js.map +1 -1
- package/lib/utils/focus-lock/focusBorders.mjs +26 -32
- package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
- package/lib/utils/focus-lock/getFocusableIn.js +4 -6
- package/lib/utils/focus-lock/getFocusableIn.js.map +1 -1
- package/lib/utils/focus-lock/getFocusableIn.mjs +3 -6
- package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
- package/lib/utils/focus-lock/isFocusInside.js +5 -6
- package/lib/utils/focus-lock/isFocusInside.js.map +1 -1
- package/lib/utils/focus-lock/isFocusInside.mjs +4 -6
- package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
- package/lib/utils/focus-lock/isFocusable.js +9 -12
- package/lib/utils/focus-lock/isFocusable.js.map +1 -1
- package/lib/utils/focus-lock/isFocusable.mjs +8 -11
- package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
- package/lib/utils/focus-lock/setFocus.js +21 -27
- package/lib/utils/focus-lock/setFocus.js.map +1 -1
- package/lib/utils/focus-lock/setFocus.mjs +19 -25
- package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
- package/lib/utils/getAccessibleName.js +10 -22
- package/lib/utils/getAccessibleName.js.map +1 -1
- package/lib/utils/getAccessibleName.mjs +10 -21
- package/lib/utils/getAccessibleName.mjs.map +1 -1
- package/lib/utils/getDisplayName.js +1 -1
- package/lib/utils/getDisplayName.mjs +3 -5
- package/lib/utils/getEventTarget.js +13 -32
- package/lib/utils/getEventTarget.js.map +1 -1
- package/lib/utils/getEventTarget.mjs +12 -31
- package/lib/utils/getEventTarget.mjs.map +1 -1
- package/lib/utils/getOriginChildren.js +4 -4
- package/lib/utils/getOriginChildren.js.map +1 -1
- package/lib/utils/getRandomInt.js +1 -1
- package/lib/utils/getValue.js +4 -6
- package/lib/utils/getValue.js.map +1 -1
- package/lib/utils/getValue.mjs +3 -5
- package/lib/utils/getValue.mjs.map +1 -1
- package/lib/utils/hasLabels.js +16 -27
- package/lib/utils/hasLabels.js.map +1 -1
- package/lib/utils/hasLabels.mjs +14 -24
- package/lib/utils/hasLabels.mjs.map +1 -1
- package/lib/utils/hasParent.js +3 -2
- package/lib/utils/hasParent.js.map +1 -1
- package/lib/utils/hasParent.mjs +2 -3
- package/lib/utils/hasParent.mjs.map +1 -1
- package/lib/utils/ifChildren.js +6 -4
- package/lib/utils/ifChildren.js.map +1 -1
- package/lib/utils/ifChildren.mjs +4 -2
- package/lib/utils/ifChildren.mjs.map +1 -1
- package/lib/utils/injectStyle.js +11 -13
- package/lib/utils/injectStyle.js.map +1 -1
- package/lib/utils/injectStyle.mjs +9 -10
- package/lib/utils/injectStyle.mjs.map +1 -1
- package/lib/utils/inputProps.js +5 -5
- package/lib/utils/inputProps.js.map +1 -1
- package/lib/utils/inputProps.mjs +4 -4
- package/lib/utils/inputProps.mjs.map +1 -1
- package/lib/utils/isInteractiveElement.js +7 -9
- package/lib/utils/isInteractiveElement.js.map +1 -1
- package/lib/utils/isInteractiveElement.mjs +7 -9
- package/lib/utils/isInteractiveElement.mjs.map +1 -1
- package/lib/utils/isNode.js +4 -5
- package/lib/utils/isNode.js.map +1 -1
- package/lib/utils/isNode.mjs +1 -2
- package/lib/utils/isNode.mjs.map +1 -1
- package/lib/utils/isPromise.js +1 -1
- package/lib/utils/isRetina.js +7 -2
- package/lib/utils/isRetina.js.map +1 -1
- package/lib/utils/isRetina.mjs +6 -1
- package/lib/utils/isRetina.mjs.map +1 -1
- package/lib/utils/logger.js +18 -25
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/logger.mjs +13 -21
- package/lib/utils/logger.mjs.map +1 -1
- package/lib/utils/numericChecker.js +11 -18
- package/lib/utils/numericChecker.js.map +1 -1
- package/lib/utils/numericChecker.mjs +10 -17
- package/lib/utils/numericChecker.mjs.map +1 -1
- package/lib/utils/ownerDocument.js +2 -2
- package/lib/utils/ownerDocument.js.map +1 -1
- package/lib/utils/ownerDocument.mjs +1 -1
- package/lib/utils/ownerDocument.mjs.map +1 -1
- package/lib/utils/pick.js +5 -5
- package/lib/utils/pick.js.map +1 -1
- package/lib/utils/pick.mjs +4 -4
- package/lib/utils/pick.mjs.map +1 -1
- package/lib/utils/propsForElement.js +10 -12
- package/lib/utils/propsForElement.js.map +1 -1
- package/lib/utils/propsForElement.mjs +8 -10
- package/lib/utils/propsForElement.mjs.map +1 -1
- package/lib/utils/rafTrottle.js +9 -14
- package/lib/utils/rafTrottle.js.map +1 -1
- package/lib/utils/rafTrottle.mjs +7 -12
- package/lib/utils/rafTrottle.mjs.map +1 -1
- package/lib/utils/reactToText.js +5 -8
- package/lib/utils/reactToText.js.map +1 -1
- package/lib/utils/reactToText.mjs +3 -6
- package/lib/utils/reactToText.mjs.map +1 -1
- package/lib/utils/ref.d.ts +1 -3
- package/lib/utils/ref.js +29 -61
- package/lib/utils/ref.js.map +1 -1
- package/lib/utils/ref.mjs +27 -57
- package/lib/utils/ref.mjs.map +1 -1
- package/lib/utils/setRef.js +2 -2
- package/lib/utils/setRef.js.map +1 -1
- package/lib/utils/syncScroll.js +24 -24
- package/lib/utils/syncScroll.js.map +1 -1
- package/lib/utils/syncScroll.mjs +21 -21
- package/lib/utils/syncScroll.mjs.map +1 -1
- package/lib/utils/uncontroll.js +8 -18
- package/lib/utils/uncontroll.js.map +1 -1
- package/lib/utils/uncontroll.mjs +8 -17
- package/lib/utils/uncontroll.mjs.map +1 -1
- package/lib/utils/uniqueID.d.ts +0 -4
- package/lib/utils/uniqueID.js +23 -30
- package/lib/utils/uniqueID.js.map +1 -1
- package/lib/utils/uniqueID.mjs +19 -29
- package/lib/utils/uniqueID.mjs.map +1 -1
- package/lib/utils/use/useColorResolver.js +20 -21
- package/lib/utils/use/useColorResolver.js.map +1 -1
- package/lib/utils/use/useColorResolver.mjs +16 -18
- package/lib/utils/use/useColorResolver.mjs.map +1 -1
- package/lib/utils/use/useEnhancedEffect.d.ts +1 -1
- package/lib/utils/use/useEnhancedEffect.js +4 -4
- package/lib/utils/use/useEnhancedEffect.js.map +1 -1
- package/lib/utils/use/useEnhancedEffect.mjs +1 -1
- package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
- package/lib/utils/use/useEventCallback.js +5 -10
- package/lib/utils/use/useEventCallback.js.map +1 -1
- package/lib/utils/use/useEventCallback.mjs +3 -8
- package/lib/utils/use/useEventCallback.mjs.map +1 -1
- package/lib/utils/use/useEventListener.js +11 -15
- package/lib/utils/use/useEventListener.js.map +1 -1
- package/lib/utils/use/useEventListener.mjs +7 -11
- package/lib/utils/use/useEventListener.mjs.map +1 -1
- package/lib/utils/use/useFocusLock.js +80 -94
- package/lib/utils/use/useFocusLock.js.map +1 -1
- package/lib/utils/use/useFocusLock.mjs +71 -88
- package/lib/utils/use/useFocusLock.mjs.map +1 -1
- package/lib/utils/use/usePreventScroll.js +26 -28
- package/lib/utils/use/usePreventScroll.js.map +1 -1
- package/lib/utils/use/usePreventScroll.mjs +21 -23
- package/lib/utils/use/usePreventScroll.mjs.map +1 -1
- package/lib/utils/use/useScrollBarWidth.js +8 -14
- package/lib/utils/use/useScrollBarWidth.js.map +1 -1
- package/lib/utils/use/useScrollBarWidth.mjs +8 -13
- package/lib/utils/use/useScrollBarWidth.mjs.map +1 -1
- package/lib/utils/useCssVariable.js +32 -37
- package/lib/utils/useCssVariable.js.map +1 -1
- package/lib/utils/useCssVariable.mjs +27 -34
- package/lib/utils/useCssVariable.mjs.map +1 -1
- package/lib/utils/zIndexStacking.d.ts +3 -1
- package/lib/utils/zIndexStacking.js +28 -24
- package/lib/utils/zIndexStacking.js.map +1 -1
- package/lib/utils/zIndexStacking.mjs +23 -22
- package/lib/utils/zIndexStacking.mjs.map +1 -1
- package/package.json +129 -129
- package/lib/enhancement/bindHandler.d.ts +0 -5
- package/lib/enhancement/bindHandler.js +0 -53
- package/lib/enhancement/bindHandler.js.map +0 -1
- package/lib/enhancement/bindHandler.mjs +0 -48
- package/lib/enhancement/bindHandler.mjs.map +0 -1
- package/lib/enhancement/hoistProps.d.ts +0 -10
- package/lib/enhancement/hoistProps.js +0 -95
- package/lib/enhancement/hoistProps.js.map +0 -1
- package/lib/enhancement/hoistProps.mjs +0 -78
- package/lib/enhancement/hoistProps.mjs.map +0 -1
- package/lib/esm/enhancement/bindHandler.mjs +0 -48
- package/lib/esm/enhancement/hoistProps.mjs +0 -78
- package/lib/esm/utils/createHoc.mjs +0 -42
- package/lib/esm/utils/getDisplayName.mjs +0 -6
- package/lib/utils/ScreenReaderOnly.d.ts +0 -8
- package/lib/utils/ScreenReaderOnly.js +0 -30
- package/lib/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/utils/ScreenReaderOnly.mjs +0 -24
- package/lib/utils/ScreenReaderOnly.mjs.map +0 -1
- package/lib/utils/createHoc.d.ts +0 -3
- package/lib/utils/createHoc.js +0 -52
- package/lib/utils/createHoc.js.map +0 -1
- package/lib/utils/createHoc.mjs +0 -42
- package/lib/utils/createHoc.mjs.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.d.ts +0 -14
- package/lib/utils/enhances/WithAutoFocus.js +0 -72
- package/lib/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.mjs +0 -66
- package/lib/utils/enhances/WithAutoFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.d.ts +0 -46
- package/lib/utils/enhances/WithKeyboardFocus.js +0 -94
- package/lib/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.mjs +0 -88
- package/lib/utils/enhances/WithKeyboardFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithRef.d.ts +0 -3
- package/lib/utils/enhances/WithRef.js +0 -25
- package/lib/utils/enhances/WithRef.js.map +0 -1
- package/lib/utils/enhances/WithRef.mjs +0 -18
- package/lib/utils/enhances/WithRef.mjs.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.d.ts +0 -10
- package/lib/utils/enhances/autoFocusEnhance.js +0 -45
- package/lib/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.mjs +0 -38
- package/lib/utils/enhances/autoFocusEnhance.mjs.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.d.ts +0 -27
- package/lib/utils/enhances/keyboardFocusEnhance.js +0 -63
- package/lib/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.mjs +0 -57
- package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +0 -1
- package/lib/utils/if.d.ts +0 -11
- package/lib/utils/if.js +0 -15
- package/lib/utils/if.js.map +0 -1
- package/lib/utils/if.mjs +0 -9
- package/lib/utils/if.mjs.map +0 -1
- package/lib/utils/use/useCss.d.ts +0 -4
- package/lib/utils/use/useCss.js +0 -19
- package/lib/utils/use/useCss.js.map +0 -1
- package/lib/utils/use/useCss.mjs +0 -12
- package/lib/utils/use/useCss.mjs.map +0 -1
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
1
|
import React from "react";
|
|
6
2
|
import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var GETTER_REG = /^get[\w]+Props$/;
|
|
3
|
+
const CHILDREN_SELF = Symbol("CHILDREN_SELF");
|
|
4
|
+
const GETTER_REG = /^get[\w]+Props$/;
|
|
10
5
|
function splitPropsAndGetters(props) {
|
|
11
|
-
return Object.entries(props).reduce(
|
|
12
|
-
var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
|
|
6
|
+
return Object.entries(props).reduce((acc, [key, value]) => {
|
|
13
7
|
if (GETTER_REG.exec(key) === null) {
|
|
14
8
|
acc.props[key] = value;
|
|
15
9
|
} else {
|
|
@@ -27,67 +21,79 @@ function getterToArray(getter) {
|
|
|
27
21
|
}
|
|
28
22
|
return getter;
|
|
29
23
|
}
|
|
30
|
-
function mergeObjects() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
function mergeObjects(a = {}, b = {}) {
|
|
25
|
+
const core = {
|
|
26
|
+
...a,
|
|
27
|
+
...b
|
|
28
|
+
};
|
|
29
|
+
return Object.keys(core).reduce((acc, key) => {
|
|
35
30
|
a[key] = getterToArray(a[key]);
|
|
36
31
|
b[key] = getterToArray(b[key]);
|
|
37
|
-
acc[key] = [
|
|
32
|
+
acc[key] = [...a[key], ...b[key]];
|
|
38
33
|
return acc;
|
|
39
34
|
}, {});
|
|
40
35
|
}
|
|
41
36
|
function assignGettersChain(getters) {
|
|
42
|
-
return function() {
|
|
43
|
-
|
|
44
|
-
return getters.reduce(function(acc, getter) {
|
|
37
|
+
return function(props = {}) {
|
|
38
|
+
return getters.reduce((acc, getter) => {
|
|
45
39
|
return getter(acc);
|
|
46
40
|
}, props);
|
|
47
41
|
};
|
|
48
42
|
}
|
|
49
43
|
function createChildren(Context, contexts) {
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
const Children = function() {
|
|
45
|
+
const children = Children.origin;
|
|
52
46
|
if (typeof children === "function") {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
const {
|
|
48
|
+
handlers = {},
|
|
49
|
+
getters = {},
|
|
50
|
+
...props
|
|
51
|
+
} = [...contexts, Context].reduce((acc, ctx) => {
|
|
52
|
+
const {
|
|
53
|
+
handlers: handlers2,
|
|
54
|
+
...propsAndGetters
|
|
55
|
+
} = React.useContext(ctx);
|
|
56
|
+
const {
|
|
57
|
+
props: props2,
|
|
58
|
+
getters: getters2
|
|
59
|
+
} = splitPropsAndGetters(propsAndGetters);
|
|
60
|
+
return Object.assign({}, acc, {
|
|
57
61
|
handlers: Object.assign({}, acc.handlers, handlers2),
|
|
58
|
-
getters: mergeObjects(acc.getters, getters2)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
getters: mergeObjects(acc.getters, getters2),
|
|
63
|
+
...props2
|
|
64
|
+
});
|
|
65
|
+
}, Children.props);
|
|
66
|
+
const mergedGetters = Object.entries(getters).reduce((acc, [key, value]) => {
|
|
63
67
|
acc[key] = assignGettersChain(value);
|
|
64
68
|
return acc;
|
|
65
69
|
}, {});
|
|
66
|
-
return children(
|
|
70
|
+
return children({
|
|
71
|
+
...props,
|
|
72
|
+
...mergedGetters
|
|
73
|
+
}, handlers);
|
|
67
74
|
} else if (children === void 0) {
|
|
68
75
|
return null;
|
|
69
76
|
}
|
|
70
77
|
return children;
|
|
71
78
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return
|
|
79
|
+
Children.origin = null;
|
|
80
|
+
Children.props = {};
|
|
81
|
+
Children[CHILDREN_COMPONENT] = true;
|
|
82
|
+
return Children;
|
|
76
83
|
}
|
|
77
84
|
function Enhancement(Context, parent) {
|
|
78
85
|
return {
|
|
79
|
-
init: function
|
|
80
|
-
|
|
81
|
-
return component[CONTEXT_COMPONENT];
|
|
82
|
-
}).filter(Boolean);
|
|
86
|
+
init: function() {
|
|
87
|
+
const contexts = (Array.isArray(parent) ? parent : [parent]).map((component) => component[CONTEXT_COMPONENT]).filter(Boolean);
|
|
83
88
|
this[CHILDREN_SELF] = createChildren(Context, contexts);
|
|
84
89
|
},
|
|
85
|
-
asProps: function
|
|
90
|
+
asProps: function(props) {
|
|
86
91
|
this[CHILDREN_SELF].origin = props.children;
|
|
87
92
|
this[CHILDREN_SELF].props = props;
|
|
88
|
-
return
|
|
93
|
+
return {
|
|
94
|
+
...props,
|
|
89
95
|
Children: this[CHILDREN_SELF]
|
|
90
|
-
}
|
|
96
|
+
};
|
|
91
97
|
}
|
|
92
98
|
};
|
|
93
99
|
}
|
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
1
|
import React from "react";
|
|
5
2
|
import assignProps from "../utils/assignProps.mjs";
|
|
6
3
|
import { useForkRef } from "../utils/ref.mjs";
|
|
7
|
-
var _excluded = ["render"], _excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
|
|
8
4
|
function createRootRender() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const Root = /* @__PURE__ */ React.forwardRef(function({
|
|
6
|
+
render: Tag,
|
|
7
|
+
...source
|
|
8
|
+
}, ref) {
|
|
9
|
+
const {
|
|
10
|
+
Root: _Root,
|
|
11
|
+
styles: _styles,
|
|
12
|
+
children: _children,
|
|
13
|
+
Children,
|
|
14
|
+
forwardRef = null,
|
|
15
|
+
...props
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
} = Root.props;
|
|
18
|
+
const clearProps = Object.entries(props).reduce((props2, [name, value]) => {
|
|
14
19
|
if (value !== void 0) {
|
|
15
20
|
props2[name] = value;
|
|
16
21
|
}
|
|
17
22
|
return props2;
|
|
18
23
|
}, {});
|
|
19
|
-
|
|
24
|
+
const child = {};
|
|
20
25
|
if (typeof Children.origin !== "undefined") {
|
|
21
26
|
child.children = /* @__PURE__ */ React.createElement(Children, null);
|
|
22
27
|
}
|
|
23
|
-
|
|
28
|
+
const other = assignProps({
|
|
29
|
+
...clearProps,
|
|
24
30
|
ref: useForkRef(forwardRef, ref)
|
|
25
|
-
}
|
|
31
|
+
}, {
|
|
32
|
+
...child,
|
|
33
|
+
...source
|
|
34
|
+
});
|
|
26
35
|
if (!Tag) {
|
|
27
36
|
throw new Error("`render` prop of Root is not provided");
|
|
28
37
|
}
|
|
@@ -34,20 +43,21 @@ function createRootRender() {
|
|
|
34
43
|
}
|
|
35
44
|
function Enhancement() {
|
|
36
45
|
return {
|
|
37
|
-
init: function
|
|
46
|
+
init: function() {
|
|
38
47
|
this.Root = createRootRender();
|
|
39
48
|
},
|
|
40
|
-
asProps: function
|
|
49
|
+
asProps: function(props, _WrapperComponent, isFunction) {
|
|
41
50
|
if (isFunction) {
|
|
42
|
-
return
|
|
51
|
+
return {
|
|
52
|
+
...props,
|
|
43
53
|
Root: this.Root
|
|
44
|
-
}
|
|
54
|
+
};
|
|
45
55
|
}
|
|
46
56
|
return props;
|
|
47
57
|
},
|
|
48
|
-
render: function
|
|
58
|
+
render: function(render, props) {
|
|
49
59
|
this.Root.props = props;
|
|
50
|
-
return
|
|
60
|
+
return render;
|
|
51
61
|
}
|
|
52
62
|
};
|
|
53
63
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
1
|
function Enhancement() {
|
|
3
2
|
return {
|
|
4
|
-
wrapperProps: function
|
|
5
|
-
return
|
|
6
|
-
"data-ui-name": WrapperComponent.displayName
|
|
7
|
-
|
|
3
|
+
wrapperProps: function(props, WrapperComponent) {
|
|
4
|
+
return {
|
|
5
|
+
"data-ui-name": WrapperComponent.displayName,
|
|
6
|
+
...props
|
|
7
|
+
};
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
function Enhancement() {
|
|
2
2
|
return {
|
|
3
|
-
condition: function
|
|
4
|
-
var
|
|
5
|
-
return Boolean((
|
|
3
|
+
condition: function(Component) {
|
|
4
|
+
var _a;
|
|
5
|
+
return Boolean((_a = Component.enhance) == null ? void 0 : _a.length);
|
|
6
6
|
},
|
|
7
|
-
wrapperProps: function
|
|
8
|
-
return WrapperComponent.enhance.reduce(
|
|
9
|
-
return enhance(acc);
|
|
10
|
-
}, props);
|
|
7
|
+
wrapperProps: function(props, WrapperComponent) {
|
|
8
|
+
return WrapperComponent.enhance.reduce((acc, enhance) => enhance(acc), props);
|
|
11
9
|
}
|
|
12
10
|
};
|
|
13
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function Enhancement() {
|
|
2
|
-
|
|
2
|
+
let defaultProps = {};
|
|
3
3
|
return {
|
|
4
|
-
condition: function
|
|
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
|
-
|
|
13
|
+
static: function(WrapperComponent) {
|
|
14
14
|
defaultProps = WrapperComponent.defaultProps;
|
|
15
15
|
return {
|
|
16
16
|
defaultProps: {}
|
|
17
17
|
};
|
|
18
18
|
},
|
|
19
|
-
wrapperProps: function
|
|
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:
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
13
|
-
|
|
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
|
|
4
|
+
condition: function(Component) {
|
|
7
5
|
return Boolean(Component.displayName);
|
|
8
6
|
},
|
|
9
|
-
|
|
10
|
-
return
|
|
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(
|
|
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
|
|
12
|
+
return `get${name}Props`;
|
|
16
13
|
}
|
|
17
|
-
function getterMethodNameByDisplayName() {
|
|
18
|
-
|
|
19
|
-
|
|
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(
|
|
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
|
|
22
|
+
acc.push(...flatGetterMethodNames(value[1], name));
|
|
28
23
|
}
|
|
29
|
-
name = parentName ?
|
|
24
|
+
name = parentName ? `${parentName}${name}` : name;
|
|
30
25
|
acc.push(getterMethodName(name));
|
|
31
26
|
return acc;
|
|
32
27
|
}, []);
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
33
|
+
const getterMethodNames = flatGetterMethodNames(childComponents);
|
|
39
34
|
return {
|
|
40
|
-
condition: function
|
|
35
|
+
condition: function(Component) {
|
|
41
36
|
return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);
|
|
42
37
|
},
|
|
43
|
-
init: function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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(
|
|
51
|
-
|
|
44
|
+
assign(this, getterMethodNames.reduce((acc, name) => {
|
|
45
|
+
const getterMethod = getterMethods[name];
|
|
52
46
|
if (!getterMethod) return acc;
|
|
53
|
-
acc[name] =
|
|
54
|
-
|
|
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
|
-
|
|
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(
|
|
68
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
value.displayName =
|
|
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
|
|
86
|
-
return
|
|
77
|
+
context: function(context) {
|
|
78
|
+
return {
|
|
79
|
+
...context,
|
|
80
|
+
// [getterMethod]: this[SELF_GETTER_METHOD],
|
|
81
|
+
...pick(this, getterMethodNames)
|
|
82
|
+
};
|
|
87
83
|
},
|
|
88
|
-
wrapperProps: function
|
|
84
|
+
wrapperProps: function(props, WrapperComponent) {
|
|
89
85
|
if (!WrapperComponent[STATIC_COMPONENT]) return props;
|
|
90
|
-
|
|
91
|
-
|
|
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
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
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
|
-
|
|
9
|
-
|
|
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
|
|
9
|
+
condition: function(Component) {
|
|
14
10
|
return Boolean(Component.style || Component[STATIC_COMPONENT]);
|
|
15
11
|
},
|
|
16
|
-
init: function
|
|
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
|
|
20
|
+
context: function(context) {
|
|
25
21
|
if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {
|
|
26
|
-
return
|
|
22
|
+
return context;
|
|
27
23
|
}
|
|
28
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
...context,
|
|
26
|
+
[STYLES_CONTEXT]: this[STYLES_SELF]
|
|
27
|
+
};
|
|
29
28
|
},
|
|
30
|
-
asProps: function
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
}
|