@semcore/core 16.5.1 → 17.0.0-prerelease.14
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
package/lib/enhancement/Root.js
CHANGED
|
@@ -1,54 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
7
|
+
exports.default = void 0;
|
|
11
8
|
var _react = _interopRequireDefault(require("react"));
|
|
12
9
|
var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
|
|
13
|
-
var
|
|
14
|
-
var _excluded = ["render"],
|
|
15
|
-
_excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
|
|
10
|
+
var _ref = require("../utils/ref");
|
|
16
11
|
function createRootRender() {
|
|
17
12
|
// @ts-ignore
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
forwardRef =
|
|
28
|
-
props
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
value = _ref3[1];
|
|
13
|
+
const Root = /*#__PURE__*/_react.default.forwardRef(function ({
|
|
14
|
+
render: Tag,
|
|
15
|
+
...source
|
|
16
|
+
}, ref) {
|
|
17
|
+
const {
|
|
18
|
+
Root: _Root,
|
|
19
|
+
styles: _styles,
|
|
20
|
+
children: _children,
|
|
21
|
+
Children,
|
|
22
|
+
forwardRef = null,
|
|
23
|
+
...props
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
} = Root.props;
|
|
26
|
+
const clearProps = Object.entries(props).reduce((props, [name, value]) => {
|
|
33
27
|
if (value !== undefined) {
|
|
34
28
|
props[name] = value;
|
|
35
29
|
}
|
|
36
30
|
return props;
|
|
37
31
|
}, {});
|
|
38
|
-
|
|
32
|
+
const child = {};
|
|
39
33
|
// TODO: need to find better check solution (by lsroman)
|
|
40
34
|
if (typeof Children.origin !== 'undefined') {
|
|
41
35
|
// @ts-ignore
|
|
42
|
-
child.children = /*#__PURE__*/_react
|
|
36
|
+
child.children = /*#__PURE__*/_react.default.createElement(Children, null);
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
const other = (0, _assignProps.default)({
|
|
39
|
+
...clearProps,
|
|
40
|
+
ref: (0, _ref.useForkRef)(forwardRef, ref)
|
|
41
|
+
}, {
|
|
42
|
+
...child,
|
|
43
|
+
...source
|
|
44
|
+
});
|
|
47
45
|
if (!Tag) {
|
|
48
46
|
throw new Error('`render` prop of Root is not provided');
|
|
49
47
|
}
|
|
50
|
-
if (Tag === _react
|
|
51
|
-
return /*#__PURE__*/_react
|
|
48
|
+
if (Tag === _react.default.Fragment) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, other.children);
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(Tag, other);
|
|
52
50
|
});
|
|
53
51
|
// @ts-ignore
|
|
54
52
|
Root.props = {};
|
|
@@ -56,22 +54,23 @@ function createRootRender() {
|
|
|
56
54
|
}
|
|
57
55
|
function Enhancement() {
|
|
58
56
|
return {
|
|
59
|
-
init: function
|
|
57
|
+
init: function () {
|
|
60
58
|
this.Root = createRootRender();
|
|
61
59
|
},
|
|
62
|
-
asProps: function
|
|
60
|
+
asProps: function (props, _WrapperComponent, isFunction) {
|
|
63
61
|
if (isFunction) {
|
|
64
|
-
return
|
|
62
|
+
return {
|
|
63
|
+
...props,
|
|
65
64
|
Root: this.Root
|
|
66
|
-
}
|
|
65
|
+
};
|
|
67
66
|
}
|
|
68
67
|
return props;
|
|
69
68
|
},
|
|
70
|
-
render: function render
|
|
69
|
+
render: function (render, props) {
|
|
71
70
|
this.Root.props = props;
|
|
72
|
-
return
|
|
71
|
+
return render;
|
|
73
72
|
}
|
|
74
73
|
};
|
|
75
74
|
}
|
|
76
|
-
var _default = exports
|
|
75
|
+
var _default = exports.default = Enhancement;
|
|
77
76
|
//# sourceMappingURL=Root.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.js","names":["_react","_interopRequireDefault","require","_assignProps","
|
|
1
|
+
{"version":3,"file":"Root.js","names":["_react","_interopRequireDefault","require","_assignProps","_ref","createRootRender","Root","React","forwardRef","render","Tag","source","ref","_Root","styles","_styles","children","_children","Children","props","clearProps","Object","entries","reduce","name","value","undefined","child","origin","default","createElement","other","assignProps","useForkRef","Error","Fragment","Enhancement","init","asProps","_WrapperComponent","isFunction","_default","exports"],"sources":["../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../utils/assignProps';\nimport { useForkRef } from '../utils/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n Root: _Root,\n\n styles: _styles,\n\n children: _children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props: any, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n if (Tag === React.Fragment) return <React.Fragment>{other.children}</React.Fragment>;\n\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function (this: any) {\n this.Root = createRootRender();\n },\n asProps: function (this: any, props: any, _WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (this: any, render: any, props: any) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEA,SAASG,gBAAgBA,CAAA,EAAG;EAC1B;EACA,MAAMC,IAAI,gBAAGC,cAAK,CAACC,UAAU,CAAC,UAAU;IAAEC,MAAM,EAAEC,GAAG;IAAE,GAAGC;EAAO,CAAC,EAAEC,GAAG,EAAE;IACvE,MAAM;MACJN,IAAI,EAAEO,KAAK;MAEXC,MAAM,EAAEC,OAAO;MAEfC,QAAQ,EAAEC,SAAS;MACnBC,QAAQ;MACRV,UAAU,GAAG,IAAI;MACjB,GAAGW;MACH;IACF,CAAC,GAAGb,IAAI,CAACa,KAAK;IAEd,MAAMC,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACH,KAAK,CAAC,CAACI,MAAM,CAAC,CAACJ,KAAU,EAAE,CAACK,IAAI,EAAEC,KAAK,CAAC,KAAK;MAC7E,IAAIA,KAAK,KAAKC,SAAS,EAAE;QACvBP,KAAK,CAACK,IAAI,CAAC,GAAGC,KAAK;MACrB;MACA,OAAON,KAAK;IACd,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,MAAMQ,KAAK,GAAG,CAAC,CAAC;IAChB;IACA,IAAI,OAAOT,QAAQ,CAACU,MAAM,KAAK,WAAW,EAAE;MAC1C;MACAD,KAAK,CAACX,QAAQ,gBAAGhB,MAAA,CAAA6B,OAAA,CAAAC,aAAA,CAACZ,QAAQ,MAAE,CAAC;IAC/B;IAEA,MAAMa,KAAK,GAAG,IAAAC,oBAAW,EACvB;MACE,GAAGZ,UAAU;MACbR,GAAG,EAAE,IAAAqB,eAAU,EAACzB,UAAU,EAAEI,GAAG;IACjC,CAAC,EACD;MACE,GAAGe,KAAK;MACR,GAAGhB;IACL,CACF,CAAC;IACD,IAAI,CAACD,GAAG,EAAE;MACR,MAAM,IAAIwB,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IACA,IAAIxB,GAAG,KAAKH,cAAK,CAAC4B,QAAQ,EAAE,oBAAOnC,MAAA,CAAA6B,OAAA,CAAAC,aAAA,CAAC9B,MAAA,CAAA6B,OAAK,CAACM,QAAQ,QAAEJ,KAAK,CAACf,QAAyB,CAAC;IAEpF,oBAAOhB,MAAA,CAAA6B,OAAA,CAAAC,aAAA,CAACpB,GAAG,EAAKqB,KAAQ,CAAC;EAC3B,CAAC,CAAC;EACF;EACAzB,IAAI,CAACa,KAAK,GAAG,CAAC,CAAC;EACf,OAAOb,IAAI;AACb;AAEA,SAAS8B,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,IAAI,EAAE,SAAAA,CAAA,EAAqB;MACzB,IAAI,CAAC/B,IAAI,GAAGD,gBAAgB,CAAC,CAAC;IAChC,CAAC;IACDiC,OAAO,EAAE,SAAAA,CAAqBnB,KAAU,EAAEoB,iBAAsB,EAAEC,UAAmB,EAAE;MACrF,IAAIA,UAAU,EAAE;QACd,OAAO;UACL,GAAGrB,KAAK;UACRb,IAAI,EAAE,IAAI,CAACA;QACb,CAAC;MACH;MACA,OAAOa,KAAK;IACd,CAAC;IACDV,MAAM,EAAE,SAAAA,CAAqBA,MAAW,EAAEU,KAAU,EAAE;MACpD,IAAI,CAACb,IAAI,CAACa,KAAK,GAAGA,KAAK;MACvB,OAAOV,MAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAgC,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAEcO,WAAW","ignoreList":[]}
|
package/lib/enhancement/Root.mjs
CHANGED
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.mjs","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","
|
|
1
|
+
{"version":3,"file":"Root.mjs","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","render","Tag","source","ref","_Root","styles","_styles","children","_children","Children","props","clearProps","Object","entries","reduce","name","value","undefined","child","origin","createElement","other","Error","Fragment","Enhancement","init","asProps","_WrapperComponent","isFunction"],"sources":["../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../utils/assignProps';\nimport { useForkRef } from '../utils/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n Root: _Root,\n\n styles: _styles,\n\n children: _children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props: any, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n if (Tag === React.Fragment) return <React.Fragment>{other.children}</React.Fragment>;\n\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function (this: any) {\n this.Root = createRootRender();\n },\n asProps: function (this: any, props: any, _WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (this: any, render: any, props: any) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,WAAW,MAAM,0BAAsB;AAC9C,SAASC,UAAU,QAAQ,kBAAc;AAEzC,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,MAAMC,IAAI,gBAAGJ,KAAK,CAACK,UAAU,CAAC,UAAU;IAAEC,MAAM,EAAEC,GAAG;IAAE,GAAGC;EAAO,CAAC,EAAEC,GAAG,EAAE;IACvE,MAAM;MACJL,IAAI,EAAEM,KAAK;MAEXC,MAAM,EAAEC,OAAO;MAEfC,QAAQ,EAAEC,SAAS;MACnBC,QAAQ;MACRV,UAAU,GAAG,IAAI;MACjB,GAAGW;MACH;IACF,CAAC,GAAGZ,IAAI,CAACY,KAAK;IAEd,MAAMC,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACH,KAAK,CAAC,CAACI,MAAM,CAAC,CAACJ,KAAU,EAAE,CAACK,IAAI,EAAEC,KAAK,CAAC,KAAK;MAC7E,IAAIA,KAAK,KAAKC,SAAS,EAAE;QACvBP,KAAK,CAACK,IAAI,CAAC,GAAGC,KAAK;MACrB;MACA,OAAON,KAAK;IACd,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,MAAMQ,KAAK,GAAG,CAAC,CAAC;IAChB;IACA,IAAI,OAAOT,QAAQ,CAACU,MAAM,KAAK,WAAW,EAAE;MAC1C;MACAD,KAAK,CAACX,QAAQ,gBAAGb,KAAA,CAAA0B,aAAA,CAACX,QAAQ,MAAE,CAAC;IAC/B;IAEA,MAAMY,KAAK,GAAG1B,WAAW,CACvB;MACE,GAAGgB,UAAU;MACbR,GAAG,EAAEP,UAAU,CAACG,UAAU,EAAEI,GAAG;IACjC,CAAC,EACD;MACE,GAAGe,KAAK;MACR,GAAGhB;IACL,CACF,CAAC;IACD,IAAI,CAACD,GAAG,EAAE;MACR,MAAM,IAAIqB,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IACA,IAAIrB,GAAG,KAAKP,KAAK,CAAC6B,QAAQ,EAAE,oBAAO7B,KAAA,CAAA0B,aAAA,CAAC1B,KAAK,CAAC6B,QAAQ,QAAEF,KAAK,CAACd,QAAyB,CAAC;IAEpF,oBAAOb,KAAA,CAAA0B,aAAA,CAACnB,GAAG,EAAKoB,KAAQ,CAAC;EAC3B,CAAC,CAAC;EACF;EACAvB,IAAI,CAACY,KAAK,GAAG,CAAC,CAAC;EACf,OAAOZ,IAAI;AACb;AAEA,SAAS0B,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,IAAI,EAAE,SAAAA,CAAA,EAAqB;MACzB,IAAI,CAAC3B,IAAI,GAAGD,gBAAgB,CAAC,CAAC;IAChC,CAAC;IACD6B,OAAO,EAAE,SAAAA,CAAqBhB,KAAU,EAAEiB,iBAAsB,EAAEC,UAAmB,EAAE;MACrF,IAAIA,UAAU,EAAE;QACd,OAAO;UACL,GAAGlB,KAAK;UACRZ,IAAI,EAAE,IAAI,CAACA;QACb,CAAC;MACH;MACA,OAAOY,KAAK;IACd,CAAC;IACDV,MAAM,EAAE,SAAAA,CAAqBA,MAAW,EAAEU,KAAU,EAAE;MACpD,IAAI,CAACZ,IAAI,CAACY,KAAK,GAAGA,KAAK;MACvB,OAAOV,MAAM;IACf;EACF,CAAC;AACH;AAEA,eAAewB,WAAW","ignoreList":[]}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
6
|
+
exports.default = void 0;
|
|
9
7
|
function Enhancement() {
|
|
10
8
|
return {
|
|
11
|
-
wrapperProps: function
|
|
12
|
-
return
|
|
13
|
-
'data-ui-name': WrapperComponent.displayName
|
|
14
|
-
|
|
9
|
+
wrapperProps: function (props, WrapperComponent) {
|
|
10
|
+
return {
|
|
11
|
+
'data-ui-name': WrapperComponent.displayName,
|
|
12
|
+
...props
|
|
13
|
+
};
|
|
15
14
|
}
|
|
16
15
|
};
|
|
17
16
|
}
|
|
18
|
-
var _default = exports
|
|
17
|
+
var _default = exports.default = Enhancement;
|
|
19
18
|
//# sourceMappingURL=dataName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","
|
|
1
|
+
{"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","displayName","_default","exports","default"],"sources":["../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props: any, WrapperComponent: any) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,YAAY,EAAE,SAAAA,CAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAO;QACL,cAAc,EAAEA,gBAAgB,CAACC,WAAW;QAC5C,GAAGF;MACL,CAAC;IACH;EACF,CAAC;AACH;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcP,WAAW","ignoreList":[]}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataName.mjs","names":["Enhancement","wrapperProps","props","WrapperComponent","
|
|
1
|
+
{"version":3,"file":"dataName.mjs","names":["Enhancement","wrapperProps","props","WrapperComponent","displayName"],"sources":["../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props: any, WrapperComponent: any) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,YAAY,EAAE,SAAAA,CAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAO;QACL,cAAc,EAAEA,gBAAgB,CAACC,WAAW;QAC5C,GAAGF;MACL,CAAC;IACH;EACF,CAAC;AACH;AAEA,eAAeF,WAAW","ignoreList":[]}
|
|
@@ -3,19 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
function Enhancement() {
|
|
8
8
|
return {
|
|
9
|
-
condition: function
|
|
10
|
-
|
|
11
|
-
return Boolean((_Component$enhance = Component.enhance) === null || _Component$enhance === void 0 ? void 0 : _Component$enhance.length);
|
|
9
|
+
condition: function (Component) {
|
|
10
|
+
return Boolean(Component.enhance?.length);
|
|
12
11
|
},
|
|
13
|
-
wrapperProps: function
|
|
14
|
-
return WrapperComponent.enhance.reduce(
|
|
15
|
-
return enhance(acc);
|
|
16
|
-
}, props);
|
|
12
|
+
wrapperProps: function (props, WrapperComponent) {
|
|
13
|
+
return WrapperComponent.enhance.reduce((acc, enhance) => enhance(acc), props);
|
|
17
14
|
}
|
|
18
15
|
};
|
|
19
16
|
}
|
|
20
|
-
var _default = exports
|
|
17
|
+
var _default = exports.default = Enhancement;
|
|
21
18
|
//# sourceMappingURL=enhance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.js","names":["Enhancement","condition","Component","
|
|
1
|
+
{"version":3,"file":"enhance.js","names":["Enhancement","condition","Component","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc","_default","exports","default"],"sources":["../../src/enhancement/enhance.tsx"],"sourcesContent":["function Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.enhance?.length);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n return WrapperComponent.enhance.reduce((acc: any, enhance: any) => enhance(acc), props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,CAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,OAAO,EAAEC,MAAM,CAAC;IAC3C,CAAC;IACDC,YAAY,EAAE,SAAAA,CAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAOA,gBAAgB,CAACJ,OAAO,CAACK,MAAM,CAAC,CAACC,GAAQ,EAAEN,OAAY,KAAKA,OAAO,CAACM,GAAG,CAAC,EAAEH,KAAK,CAAC;IACzF;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcb,WAAW","ignoreList":[]}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.mjs","names":["Enhancement","condition","Component","
|
|
1
|
+
{"version":3,"file":"enhance.mjs","names":["Enhancement","condition","Component","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc"],"sources":["../../src/enhancement/enhance.tsx"],"sourcesContent":["function Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.enhance?.length);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n return WrapperComponent.enhance.reduce((acc: any, enhance: any) => enhance(acc), props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,CAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,OAAO,EAAEC,MAAM,CAAC;IAC3C,CAAC;IACDC,YAAY,EAAE,SAAAA,CAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAOA,gBAAgB,CAACJ,OAAO,CAACK,MAAM,CAAC,CAACC,GAAQ,EAAEN,OAAY,KAAKA,OAAO,CAACM,GAAG,CAAC,EAAEH,KAAK,CAAC;IACzF;EACF,CAAC;AACH;AAEA,eAAeP,WAAW","ignoreList":[]}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
function Enhancement() {
|
|
8
|
-
|
|
8
|
+
let defaultProps = {};
|
|
9
9
|
return {
|
|
10
|
-
condition: function
|
|
10
|
+
condition: function (Component) {
|
|
11
11
|
if (!Component.defaultProps) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
@@ -16,13 +16,13 @@ function Enhancement() {
|
|
|
16
16
|
}
|
|
17
17
|
return Boolean(Object.keys(Component.defaultProps).length);
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
static: function (WrapperComponent) {
|
|
20
20
|
defaultProps = WrapperComponent.defaultProps;
|
|
21
21
|
return {
|
|
22
22
|
defaultProps: {}
|
|
23
23
|
};
|
|
24
24
|
},
|
|
25
|
-
wrapperProps: function
|
|
25
|
+
wrapperProps: function (props) {
|
|
26
26
|
if (typeof defaultProps === 'function') {
|
|
27
27
|
// TODO: optimization
|
|
28
28
|
return Object.assign({}, defaultProps(props), props);
|
|
@@ -31,5 +31,5 @@ function Enhancement() {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
var _default = exports
|
|
34
|
+
var _default = exports.default = Enhancement;
|
|
35
35
|
//# sourceMappingURL=functionDefaultProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionDefaultProps.js","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign","_default","exports"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"functionDefaultProps.js","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign","_default","exports","default"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,CAAUC,SAAc,EAAE;MACnC,IAAI,CAACA,SAAS,CAACF,YAAY,EAAE;QAC3B,OAAO,KAAK;MACd;MACA,IAAI,OAAOE,SAAS,CAACF,YAAY,KAAK,UAAU,EAAE;QAChD,OAAO,IAAI;MACb;MACA,OAAOG,OAAO,CAACC,MAAM,CAACC,IAAI,CAACH,SAAS,CAACF,YAAY,CAAC,CAACM,MAAM,CAAC;IAC5D,CAAC;IACDC,MAAM,EAAE,SAAAA,CAAUC,gBAAqB,EAAE;MACvCR,YAAY,GAAGQ,gBAAgB,CAACR,YAAY;MAC5C,OAAO;QACLA,YAAY,EAAE,CAAC;MACjB,CAAC;IACH,CAAC;IACDS,YAAY,EAAE,SAAAA,CAAUC,KAAU,EAAE;MAClC,IAAI,OAAOV,YAAY,KAAK,UAAU,EAAE;QACtC;QACA,OAAOI,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,CAACU,KAAK,CAAC,EAAEA,KAAK,CAAC;MACtD;MACA,OAAON,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,EAAEU,KAAK,CAAC;IAC/C;EACF,CAAC;AACH;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcf,WAAW","ignoreList":[]}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionDefaultProps.mjs","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"functionDefaultProps.mjs","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,CAAUC,SAAc,EAAE;MACnC,IAAI,CAACA,SAAS,CAACF,YAAY,EAAE;QAC3B,OAAO,KAAK;MACd;MACA,IAAI,OAAOE,SAAS,CAACF,YAAY,KAAK,UAAU,EAAE;QAChD,OAAO,IAAI;MACb;MACA,OAAOG,OAAO,CAACC,MAAM,CAACC,IAAI,CAACH,SAAS,CAACF,YAAY,CAAC,CAACM,MAAM,CAAC;IAC5D,CAAC;IACDC,MAAM,EAAE,SAAAA,CAAUC,gBAAqB,EAAE;MACvCR,YAAY,GAAGQ,gBAAgB,CAACR,YAAY;MAC5C,OAAO;QACLA,YAAY,EAAE,CAAC;MACjB,CAAC;IACH,CAAC;IACDS,YAAY,EAAE,SAAAA,CAAUC,KAAU,EAAE;MAClC,IAAI,OAAOV,YAAY,KAAK,UAAU,EAAE;QACtC;QACA,OAAOI,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,CAACU,KAAK,CAAC,EAAEA,KAAK,CAAC;MACtD;MACA,OAAON,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,EAAEU,KAAK,CAAC;IAC/C;EACF,CAAC;AACH;AAEA,eAAeX,WAAW","ignoreList":[]}
|
package/lib/enhancement/i18n.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
7
|
+
exports.default = void 0;
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _WithI18n = require("../utils/enhances/WithI18n");
|
|
12
|
-
var _excluded = ["locale"];
|
|
13
10
|
function i18nAppLocaleEnhance() {
|
|
14
11
|
return {
|
|
15
|
-
wrapperProps:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
wrapperProps: props => {
|
|
13
|
+
const {
|
|
14
|
+
locale,
|
|
15
|
+
...other
|
|
16
|
+
} = props;
|
|
17
|
+
const contextLocale = _react.default.useContext(_WithI18n.Context);
|
|
19
18
|
if (!locale && !contextLocale) return props;
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return {
|
|
20
|
+
...other,
|
|
21
|
+
locale: locale ?? contextLocale
|
|
22
|
+
};
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
var _default = exports
|
|
26
|
+
var _default = exports.default = i18nAppLocaleEnhance;
|
|
27
27
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":["_react","_interopRequireDefault","require","_WithI18n","
|
|
1
|
+
{"version":3,"file":"i18n.js","names":["_react","_interopRequireDefault","require","_WithI18n","i18nAppLocaleEnhance","wrapperProps","props","locale","other","contextLocale","React","useContext","Context","_default","exports","default"],"sources":["../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAEA,SAASE,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAGC,KAAU,IAAK;MAC5B,MAAM;QAAEC,MAAM;QAAE,GAAGC;MAAM,CAAC,GAAGF,KAAK;MAClC,MAAMG,aAAa,GAAGC,cAAK,CAACC,UAAU,CAACC,iBAAO,CAAC;MAC/C,IAAI,CAACL,MAAM,IAAI,CAACE,aAAa,EAAE,OAAOH,KAAK;MAC3C,OAAO;QACL,GAAGE,KAAK;QACRD,MAAM,EAAEA,MAAM,IAAIE;MACpB,CAAC;IACH;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcX,oBAAoB","ignoreList":[]}
|
package/lib/enhancement/i18n.mjs
CHANGED
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.mjs","names":["React","Context","i18nAppLocaleEnhance","wrapperProps","props","locale","other","
|
|
1
|
+
{"version":3,"file":"i18n.mjs","names":["React","Context","i18nAppLocaleEnhance","wrapperProps","props","locale","other","contextLocale","useContext"],"sources":["../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,OAAO,QAAQ,gCAA4B;AAEpD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAGC,KAAU,IAAK;MAC5B,MAAM;QAAEC,MAAM;QAAE,GAAGC;MAAM,CAAC,GAAGF,KAAK;MAClC,MAAMG,aAAa,GAAGP,KAAK,CAACQ,UAAU,CAACP,OAAO,CAAC;MAC/C,IAAI,CAACI,MAAM,IAAI,CAACE,aAAa,EAAE,OAAOH,KAAK;MAC3C,OAAO;QACL,GAAGE,KAAK;QACRD,MAAM,EAAEA,MAAM,IAAIE;MACpB,CAAC;IACH;EACF,CAAC;AACH;AAEA,eAAeL,oBAAoB","ignoreList":[]}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
6
|
+
exports.default = void 0;
|
|
10
7
|
var _symbols = require("../core-types/symbols");
|
|
11
8
|
function Enhancement() {
|
|
12
9
|
return {
|
|
13
|
-
condition: function
|
|
10
|
+
condition: function (Component) {
|
|
14
11
|
return Boolean(Component.displayName);
|
|
15
12
|
},
|
|
16
|
-
|
|
17
|
-
return
|
|
13
|
+
static: function (WrapperComponent) {
|
|
14
|
+
return {
|
|
15
|
+
[_symbols.INHERITED_NAME]: [...new Set([...(WrapperComponent[_symbols.INHERITED_NAME] || []), WrapperComponent.displayName])]
|
|
16
|
+
};
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
var _default = exports
|
|
20
|
+
var _default = exports.default = Enhancement;
|
|
22
21
|
//# sourceMappingURL=inheritedName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inheritedName.js","names":["_symbols","require","Enhancement","condition","Component","Boolean","displayName","static","WrapperComponent","
|
|
1
|
+
{"version":3,"file":"inheritedName.js","names":["_symbols","require","Enhancement","condition","Component","Boolean","displayName","static","WrapperComponent","INHERITED_NAME","Set","_default","exports","default"],"sources":["../../src/enhancement/inheritedName.tsx"],"sourcesContent":["import { INHERITED_NAME } from '../core-types/symbols';\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.displayName);\n },\n static: function (WrapperComponent: any) {\n return {\n [INHERITED_NAME]: [\n ...new Set([...(WrapperComponent[INHERITED_NAME] || []), WrapperComponent.displayName]),\n ],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,SAASC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,CAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,WAAW,CAAC;IACvC,CAAC;IACDC,MAAM,EAAE,SAAAA,CAAUC,gBAAqB,EAAE;MACvC,OAAO;QACL,CAACC,uBAAc,GAAG,CAChB,GAAG,IAAIC,GAAG,CAAC,CAAC,IAAIF,gBAAgB,CAACC,uBAAc,CAAC,IAAI,EAAE,CAAC,EAAED,gBAAgB,CAACF,WAAW,CAAC,CAAC;MAE3F,CAAC;IACH;EACF,CAAC;AACH;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcX,WAAW","ignoreList":[]}
|