@semcore/core 2.39.4 → 16.0.0-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +2 -2
- package/lib/LastInteractionType.d.ts +11 -0
- package/lib/LastInteractionType.js +57 -0
- package/lib/LastInteractionType.js.map +1 -0
- package/lib/LastInteractionType.mjs +51 -0
- package/lib/LastInteractionType.mjs.map +1 -0
- package/lib/core-types/Component.d.ts +189 -0
- package/lib/core-types/Component.js +59 -0
- package/lib/core-types/Component.js.map +1 -0
- package/lib/core-types/Component.mjs +51 -0
- package/lib/core-types/Component.mjs.map +1 -0
- package/lib/core-types/UnknownProperties.d.ts +3 -0
- package/lib/core-types/UnknownProperties.js +2 -0
- package/lib/core-types/UnknownProperties.js.map +1 -0
- package/lib/core-types/UnknownProperties.mjs +2 -0
- package/lib/core-types/UnknownProperties.mjs.map +1 -0
- package/lib/core-types/reshadow.d.js +2 -0
- package/lib/core-types/reshadow.d.js.map +1 -0
- package/lib/core-types/reshadow.d.mjs +2 -0
- package/lib/core-types/reshadow.d.mjs.map +1 -0
- package/lib/core-types/symbols.d.ts +9 -0
- package/lib/core-types/symbols.js +25 -0
- package/lib/core-types/symbols.js.map +1 -0
- package/lib/core-types/symbols.mjs +20 -0
- package/lib/core-types/symbols.mjs.map +1 -0
- package/lib/coreFactory.d.ts +27 -0
- package/lib/coreFactory.js +352 -0
- package/lib/coreFactory.js.map +1 -0
- package/lib/coreFactory.mjs +324 -0
- package/lib/coreFactory.mjs.map +1 -0
- package/lib/enhancement/Children.d.ts +5 -0
- package/lib/enhancement/Children.js +119 -0
- package/lib/enhancement/Children.js.map +1 -0
- package/lib/enhancement/Children.mjs +96 -0
- package/lib/enhancement/Children.mjs.map +1 -0
- package/lib/enhancement/Root.d.ts +6 -0
- package/lib/enhancement/Root.js +78 -0
- package/lib/enhancement/Root.js.map +1 -0
- package/lib/enhancement/Root.mjs +56 -0
- package/lib/enhancement/Root.mjs.map +1 -0
- package/lib/enhancement/bindHandler.d.ts +5 -0
- package/lib/enhancement/bindHandler.js +54 -0
- package/lib/enhancement/bindHandler.js.map +1 -0
- package/lib/enhancement/bindHandler.mjs +48 -0
- package/lib/enhancement/bindHandler.mjs.map +1 -0
- package/lib/enhancement/dataName.d.ts +4 -0
- package/lib/enhancement/dataName.js +20 -0
- package/lib/enhancement/dataName.js.map +1 -0
- package/lib/enhancement/dataName.mjs +13 -0
- package/lib/enhancement/dataName.mjs.map +1 -0
- package/lib/enhancement/enhance.d.ts +5 -0
- package/lib/enhancement/enhance.js +22 -0
- package/lib/enhancement/enhance.js.map +1 -0
- package/lib/enhancement/enhance.mjs +16 -0
- package/lib/enhancement/enhance.mjs.map +1 -0
- package/lib/enhancement/functionDefaultProps.d.ts +8 -0
- package/lib/enhancement/functionDefaultProps.js +36 -0
- package/lib/enhancement/functionDefaultProps.js.map +1 -0
- package/lib/enhancement/functionDefaultProps.mjs +29 -0
- package/lib/enhancement/functionDefaultProps.mjs.map +1 -0
- package/lib/enhancement/hoistProps.d.ts +10 -0
- package/lib/enhancement/hoistProps.js +97 -0
- package/lib/enhancement/hoistProps.js.map +1 -0
- package/lib/enhancement/hoistProps.mjs +78 -0
- package/lib/enhancement/hoistProps.mjs.map +1 -0
- package/lib/enhancement/i18n.d.ts +4 -0
- package/lib/enhancement/i18n.js +28 -0
- package/lib/enhancement/i18n.js.map +1 -0
- package/lib/enhancement/i18n.mjs +20 -0
- package/lib/enhancement/i18n.mjs.map +1 -0
- package/lib/enhancement/inheritedName.d.ts +8 -0
- package/lib/enhancement/inheritedName.js +23 -0
- package/lib/enhancement/inheritedName.js.map +1 -0
- package/lib/enhancement/inheritedName.mjs +16 -0
- package/lib/enhancement/inheritedName.mjs.map +1 -0
- package/lib/enhancement/staticChildren.d.ts +13 -0
- package/lib/enhancement/staticChildren.js +135 -0
- package/lib/enhancement/staticChildren.js.map +1 -0
- package/lib/enhancement/staticChildren.mjs +120 -0
- package/lib/enhancement/staticChildren.mjs.map +1 -0
- package/lib/enhancement/style.d.ts +9 -0
- package/lib/enhancement/style.js +60 -0
- package/lib/enhancement/style.js.map +1 -0
- package/lib/enhancement/style.mjs +49 -0
- package/lib/enhancement/style.mjs.map +1 -0
- package/lib/enhancement/uncontrolledProps.d.ts +7 -0
- package/lib/enhancement/uncontrolledProps.js +131 -0
- package/lib/enhancement/uncontrolledProps.js.map +1 -0
- package/lib/enhancement/uncontrolledProps.mjs +107 -0
- package/lib/enhancement/uncontrolledProps.mjs.map +1 -0
- package/lib/esm/LastInteractionType.mjs +51 -0
- package/lib/esm/core-types/Component.mjs +51 -0
- package/lib/esm/core-types/symbols.mjs +20 -0
- package/lib/esm/coreFactory.mjs +324 -0
- package/lib/esm/enhancement/Children.mjs +96 -0
- package/lib/esm/enhancement/Root.mjs +56 -0
- package/lib/esm/enhancement/bindHandler.mjs +48 -0
- package/lib/esm/enhancement/dataName.mjs +13 -0
- package/lib/esm/enhancement/enhance.mjs +16 -0
- package/lib/esm/enhancement/functionDefaultProps.mjs +29 -0
- package/lib/esm/enhancement/hoistProps.mjs +78 -0
- package/lib/esm/enhancement/i18n.mjs +20 -0
- package/lib/esm/enhancement/inheritedName.mjs +16 -0
- package/lib/esm/enhancement/staticChildren.mjs +120 -0
- package/lib/esm/enhancement/style.mjs +49 -0
- package/lib/esm/enhancement/uncontrolledProps.mjs +107 -0
- package/lib/esm/index.mjs +22 -4
- package/lib/esm/register.mjs +31 -0
- package/lib/esm/styled/index.mjs +8 -0
- package/lib/esm/styled/reshadow-core.mjs +234 -0
- package/lib/esm/styled/sstyled.mjs +121 -0
- package/lib/esm/utils/assignProps.mjs +86 -0
- package/lib/esm/utils/canUseDOM.mjs +6 -0
- package/lib/esm/utils/capitalizeFirstLetter.mjs +6 -0
- package/lib/esm/utils/createHoc.mjs +44 -0
- package/lib/esm/utils/enhances/WithI18n.mjs +78 -0
- package/lib/esm/utils/enhances/i18nEnhance.mjs +91 -0
- package/lib/esm/utils/getDisplayName.mjs +6 -0
- package/lib/esm/utils/logger.mjs +35 -0
- package/lib/esm/utils/pick.mjs +15 -0
- package/lib/esm/utils/ref.mjs +87 -0
- package/lib/esm/utils/use/useEnhancedEffect.mjs +6 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +103 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +24 -0
- package/lib/index.mjs.map +1 -0
- package/lib/register.d.ts +8 -0
- package/lib/register.js +37 -0
- package/lib/register.js.map +1 -0
- package/lib/register.mjs +31 -0
- package/lib/register.mjs.map +1 -0
- package/lib/styled/index.d.ts +11 -0
- package/lib/styled/index.js +32 -0
- package/lib/styled/index.js.map +1 -0
- package/lib/styled/index.mjs +8 -0
- package/lib/styled/index.mjs.map +1 -0
- package/lib/styled/reshadow-core.d.ts +37 -0
- package/lib/styled/reshadow-core.js +256 -0
- package/lib/styled/reshadow-core.js.map +1 -0
- package/lib/styled/reshadow-core.mjs +234 -0
- package/lib/styled/reshadow-core.mjs.map +1 -0
- package/lib/styled/sstyled.d.ts +17 -0
- package/lib/styled/sstyled.js +149 -0
- package/lib/styled/sstyled.js.map +1 -0
- package/lib/styled/sstyled.mjs +121 -0
- package/lib/styled/sstyled.mjs.map +1 -0
- package/lib/theme/dark.json +2506 -0
- package/lib/theme/exclude-tokens.json +10 -0
- package/lib/theme/light.json +2584 -0
- package/lib/theme/processor.d.ts +1 -0
- package/lib/theme/processor.js +315 -0
- package/lib/theme/processor.js.map +1 -0
- package/lib/theme/processor.mjs +307 -0
- package/lib/theme/processor.mjs.map +1 -0
- package/lib/theme/themes/auto.css +1465 -0
- package/lib/theme/themes/dark.css +723 -0
- package/lib/theme/themes/dark.d.ts +378 -0
- package/lib/theme/themes/dark.js +385 -0
- package/lib/theme/themes/dark.js.map +1 -0
- package/lib/theme/themes/dark.mjs +378 -0
- package/lib/theme/themes/dark.mjs.map +1 -0
- package/lib/theme/themes/default.css +742 -0
- package/lib/theme/themes/default.d.ts +387 -0
- package/lib/theme/themes/default.js +394 -0
- package/lib/theme/themes/default.js.map +1 -0
- package/lib/theme/themes/default.mjs +387 -0
- package/lib/theme/themes/default.mjs.map +1 -0
- package/lib/theme/themes/light.css +742 -0
- package/lib/theme/themes/light.d.ts +387 -0
- package/lib/theme/themes/light.js +394 -0
- package/lib/theme/themes/light.js.map +1 -0
- package/lib/theme/themes/light.mjs +387 -0
- package/lib/theme/themes/light.mjs.map +1 -0
- package/lib/theme/utils.d.ts +52 -0
- package/lib/theme/utils.js +297 -0
- package/lib/theme/utils.js.map +1 -0
- package/lib/theme/utils.mjs +286 -0
- package/lib/theme/utils.mjs.map +1 -0
- package/lib/utils/CSSinJS.d.ts +5 -0
- package/lib/utils/CSSinJS.js +36 -0
- package/lib/utils/CSSinJS.js.map +1 -0
- package/lib/utils/CSSinJS.mjs +28 -0
- package/lib/utils/CSSinJS.mjs.map +1 -0
- package/lib/utils/ScreenReaderOnly.d.ts +8 -0
- package/lib/utils/ScreenReaderOnly.js +31 -0
- package/lib/utils/ScreenReaderOnly.js.map +1 -0
- package/lib/utils/ScreenReaderOnly.mjs +24 -0
- package/lib/utils/ScreenReaderOnly.mjs.map +1 -0
- package/lib/utils/ThemeProvider.d.ts +15 -0
- package/lib/utils/ThemeProvider.js +82 -0
- package/lib/utils/ThemeProvider.js.map +1 -0
- package/lib/utils/ThemeProvider.mjs +71 -0
- package/lib/utils/ThemeProvider.mjs.map +1 -0
- package/lib/utils/addonText.d.ts +2 -0
- package/lib/utils/addonText.js +18 -0
- package/lib/utils/addonText.js.map +1 -0
- package/lib/utils/addonText.mjs +11 -0
- package/lib/utils/addonText.mjs.map +1 -0
- package/lib/utils/addonTextChildren.d.ts +3 -0
- package/lib/utils/addonTextChildren.js +45 -0
- package/lib/utils/addonTextChildren.js.map +1 -0
- package/lib/utils/addonTextChildren.mjs +37 -0
- package/lib/utils/addonTextChildren.mjs.map +1 -0
- package/lib/utils/ariaProps.d.ts +12 -0
- package/lib/utils/ariaProps.js +22 -0
- package/lib/utils/ariaProps.js.map +1 -0
- package/lib/utils/ariaProps.mjs +16 -0
- package/lib/utils/ariaProps.mjs.map +1 -0
- package/lib/utils/assignProps.d.ts +11 -0
- package/lib/utils/assignProps.js +93 -0
- package/lib/utils/assignProps.js.map +1 -0
- package/lib/utils/assignProps.mjs +86 -0
- package/lib/utils/assignProps.mjs.map +1 -0
- package/lib/utils/canUseDOM.d.ts +1 -0
- package/lib/utils/canUseDOM.js +10 -0
- package/lib/utils/canUseDOM.js.map +1 -0
- package/lib/utils/canUseDOM.mjs +6 -0
- package/lib/utils/canUseDOM.mjs.map +1 -0
- package/lib/utils/capitalizeFirstLetter.d.ts +1 -0
- package/lib/utils/capitalizeFirstLetter.js +10 -0
- package/lib/utils/capitalizeFirstLetter.js.map +1 -0
- package/lib/utils/capitalizeFirstLetter.mjs +6 -0
- package/lib/utils/capitalizeFirstLetter.mjs.map +1 -0
- package/lib/utils/color.d.ts +5 -0
- package/lib/utils/color.js +208 -0
- package/lib/utils/color.js.map +1 -0
- package/lib/utils/color.mjs +196 -0
- package/lib/utils/color.mjs.map +1 -0
- package/lib/utils/compose.d.ts +1 -0
- package/lib/utils/compose.js +21 -0
- package/lib/utils/compose.js.map +1 -0
- package/lib/utils/compose.mjs +15 -0
- package/lib/utils/compose.mjs.map +1 -0
- package/lib/utils/createHoc.d.ts +3 -0
- package/lib/utils/createHoc.js +55 -0
- package/lib/utils/createHoc.js.map +1 -0
- package/lib/utils/createHoc.mjs +44 -0
- package/lib/utils/createHoc.mjs.map +1 -0
- package/lib/utils/createUUID.d.ts +1 -0
- package/lib/utils/createUUID.js +15 -0
- package/lib/utils/createUUID.js.map +1 -0
- package/lib/utils/createUUID.mjs +9 -0
- package/lib/utils/createUUID.mjs.map +1 -0
- package/lib/utils/cssToIntDefault.d.ts +8 -0
- package/lib/utils/cssToIntDefault.js +22 -0
- package/lib/utils/cssToIntDefault.js.map +1 -0
- package/lib/utils/cssToIntDefault.mjs +16 -0
- package/lib/utils/cssToIntDefault.mjs.map +1 -0
- package/lib/utils/enhances/WithAutoFocus.d.ts +14 -0
- package/lib/utils/enhances/WithAutoFocus.js +75 -0
- package/lib/utils/enhances/WithAutoFocus.js.map +1 -0
- package/lib/utils/enhances/WithAutoFocus.mjs +67 -0
- package/lib/utils/enhances/WithAutoFocus.mjs.map +1 -0
- package/lib/utils/enhances/WithCSS.d.ts +41 -0
- package/lib/utils/enhances/WithCSS.js +93 -0
- package/lib/utils/enhances/WithCSS.js.map +1 -0
- package/lib/utils/enhances/WithCSS.mjs +79 -0
- package/lib/utils/enhances/WithCSS.mjs.map +1 -0
- package/lib/utils/enhances/WithI18n.d.ts +43 -0
- package/lib/utils/enhances/WithI18n.js +95 -0
- package/lib/utils/enhances/WithI18n.js.map +1 -0
- package/lib/utils/enhances/WithI18n.mjs +78 -0
- package/lib/utils/enhances/WithI18n.mjs.map +1 -0
- package/lib/utils/enhances/WithKeyboardFocus.d.ts +45 -0
- package/lib/utils/enhances/WithKeyboardFocus.js +93 -0
- package/lib/utils/enhances/WithKeyboardFocus.js.map +1 -0
- package/lib/utils/enhances/WithKeyboardFocus.mjs +84 -0
- package/lib/utils/enhances/WithKeyboardFocus.mjs.map +1 -0
- package/lib/utils/enhances/WithRef.d.ts +3 -0
- package/lib/utils/enhances/WithRef.js +26 -0
- package/lib/utils/enhances/WithRef.js.map +1 -0
- package/lib/utils/enhances/WithRef.mjs +18 -0
- package/lib/utils/enhances/WithRef.mjs.map +1 -0
- package/lib/utils/enhances/a11yEnhance.d.ts +10 -0
- package/lib/utils/enhances/a11yEnhance.js +74 -0
- package/lib/utils/enhances/a11yEnhance.js.map +1 -0
- package/lib/utils/enhances/a11yEnhance.mjs +66 -0
- package/lib/utils/enhances/a11yEnhance.mjs.map +1 -0
- package/lib/utils/enhances/animatedSizeEnhance.d.ts +12 -0
- package/lib/utils/enhances/animatedSizeEnhance.js +98 -0
- package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -0
- package/lib/utils/enhances/animatedSizeEnhance.mjs +90 -0
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -0
- package/lib/utils/enhances/autoFocusEnhance.d.ts +10 -0
- package/lib/utils/enhances/autoFocusEnhance.js +46 -0
- package/lib/utils/enhances/autoFocusEnhance.js.map +1 -0
- package/lib/utils/enhances/autoFocusEnhance.mjs +38 -0
- package/lib/utils/enhances/autoFocusEnhance.mjs.map +1 -0
- package/lib/utils/enhances/contextEnhance.d.ts +3 -0
- package/lib/utils/enhances/contextEnhance.js +22 -0
- package/lib/utils/enhances/contextEnhance.js.map +1 -0
- package/lib/utils/enhances/contextEnhance.mjs +14 -0
- package/lib/utils/enhances/contextEnhance.mjs.map +1 -0
- package/lib/utils/enhances/i18nEnhance.d.ts +25 -0
- package/lib/utils/enhances/i18nEnhance.js +101 -0
- package/lib/utils/enhances/i18nEnhance.js.map +1 -0
- package/lib/utils/enhances/i18nEnhance.mjs +91 -0
- package/lib/utils/enhances/i18nEnhance.mjs.map +1 -0
- package/lib/utils/enhances/keyboardFocusEnhance.d.ts +27 -0
- package/lib/utils/enhances/keyboardFocusEnhance.js +63 -0
- package/lib/utils/enhances/keyboardFocusEnhance.js.map +1 -0
- package/lib/utils/enhances/keyboardFocusEnhance.mjs +57 -0
- package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +1 -0
- package/lib/utils/enhances/resolveColorEnhance.d.ts +2 -0
- package/lib/utils/enhances/resolveColorEnhance.js +25 -0
- package/lib/utils/enhances/resolveColorEnhance.js.map +1 -0
- package/lib/utils/enhances/resolveColorEnhance.mjs +17 -0
- package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -0
- package/lib/utils/eventEmitter.d.ts +9 -0
- package/lib/utils/eventEmitter.js +41 -0
- package/lib/utils/eventEmitter.js.map +1 -0
- package/lib/utils/eventEmitter.mjs +34 -0
- package/lib/utils/eventEmitter.mjs.map +1 -0
- package/lib/utils/findComponent.d.ts +12 -0
- package/lib/utils/findComponent.js +106 -0
- package/lib/utils/findComponent.js.map +1 -0
- package/lib/utils/findComponent.mjs +95 -0
- package/lib/utils/findComponent.mjs.map +1 -0
- package/lib/utils/fire.d.ts +2 -0
- package/lib/utils/fire.js +23 -0
- package/lib/utils/fire.js.map +1 -0
- package/lib/utils/fire.mjs +15 -0
- package/lib/utils/fire.mjs.map +1 -0
- package/lib/utils/focus-lock/focusBorders.d.ts +4 -0
- package/lib/utils/focus-lock/focusBorders.js +72 -0
- package/lib/utils/focus-lock/focusBorders.js.map +1 -0
- package/lib/utils/focus-lock/focusBorders.mjs +62 -0
- package/lib/utils/focus-lock/focusBorders.mjs.map +1 -0
- package/lib/utils/focus-lock/getFocusableIn.d.ts +1 -0
- package/lib/utils/focus-lock/getFocusableIn.js +26 -0
- package/lib/utils/focus-lock/getFocusableIn.js.map +1 -0
- package/lib/utils/focus-lock/getFocusableIn.mjs +19 -0
- package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -0
- package/lib/utils/focus-lock/isFocusInside.d.ts +1 -0
- package/lib/utils/focus-lock/isFocusInside.js +16 -0
- package/lib/utils/focus-lock/isFocusInside.js.map +1 -0
- package/lib/utils/focus-lock/isFocusInside.mjs +9 -0
- package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -0
- package/lib/utils/focus-lock/isFocusable.d.ts +1 -0
- package/lib/utils/focus-lock/isFocusable.js +51 -0
- package/lib/utils/focus-lock/isFocusable.js.map +1 -0
- package/lib/utils/focus-lock/isFocusable.mjs +43 -0
- package/lib/utils/focus-lock/isFocusable.mjs.map +1 -0
- package/lib/utils/focus-lock/setFocus.d.ts +1 -0
- package/lib/utils/focus-lock/setFocus.js +63 -0
- package/lib/utils/focus-lock/setFocus.js.map +1 -0
- package/lib/utils/focus-lock/setFocus.mjs +55 -0
- package/lib/utils/focus-lock/setFocus.mjs.map +1 -0
- package/lib/utils/getAccessibleName.d.ts +1 -0
- package/lib/utils/getAccessibleName.js +56 -0
- package/lib/utils/getAccessibleName.js.map +1 -0
- package/lib/utils/getAccessibleName.mjs +49 -0
- package/lib/utils/getAccessibleName.mjs.map +1 -0
- package/lib/utils/getDisplayName.d.ts +2 -0
- package/lib/utils/getDisplayName.js +10 -0
- package/lib/utils/getDisplayName.js.map +1 -0
- package/lib/utils/getDisplayName.mjs +6 -0
- package/lib/utils/getDisplayName.mjs.map +1 -0
- package/lib/utils/getEventTarget.d.ts +1 -0
- package/lib/utils/getEventTarget.js +53 -0
- package/lib/utils/getEventTarget.js.map +1 -0
- package/lib/utils/getEventTarget.mjs +45 -0
- package/lib/utils/getEventTarget.mjs.map +1 -0
- package/lib/utils/getOriginChildren.d.ts +2 -0
- package/lib/utils/getOriginChildren.js +18 -0
- package/lib/utils/getOriginChildren.js.map +1 -0
- package/lib/utils/getOriginChildren.mjs +10 -0
- package/lib/utils/getOriginChildren.mjs.map +1 -0
- package/lib/utils/getRandomInt.d.ts +1 -0
- package/lib/utils/getRandomInt.js +11 -0
- package/lib/utils/getRandomInt.js.map +1 -0
- package/lib/utils/getRandomInt.mjs +5 -0
- package/lib/utils/getRandomInt.mjs.map +1 -0
- package/lib/utils/getValue.d.ts +1 -0
- package/lib/utils/getValue.js +16 -0
- package/lib/utils/getValue.js.map +1 -0
- package/lib/utils/getValue.mjs +10 -0
- package/lib/utils/getValue.mjs.map +1 -0
- package/lib/utils/hasLabels.d.ts +7 -0
- package/lib/utils/hasLabels.js +47 -0
- package/lib/utils/hasLabels.js.map +1 -0
- package/lib/utils/hasLabels.mjs +39 -0
- package/lib/utils/hasLabels.mjs.map +1 -0
- package/lib/utils/hasParent.d.ts +1 -0
- package/lib/utils/hasParent.js +14 -0
- package/lib/utils/hasParent.js.map +1 -0
- package/lib/utils/hasParent.mjs +7 -0
- package/lib/utils/hasParent.mjs.map +1 -0
- package/lib/utils/if.d.ts +11 -0
- package/lib/utils/if.js +16 -0
- package/lib/utils/if.js.map +1 -0
- package/lib/utils/if.mjs +9 -0
- package/lib/utils/if.mjs.map +1 -0
- package/lib/utils/ifChildren.d.ts +8 -0
- package/lib/utils/ifChildren.js +17 -0
- package/lib/utils/ifChildren.js.map +1 -0
- package/lib/utils/ifChildren.mjs +10 -0
- package/lib/utils/ifChildren.mjs.map +1 -0
- package/lib/utils/injectStyle.d.ts +2 -0
- package/lib/utils/injectStyle.js +49 -0
- package/lib/utils/injectStyle.js.map +1 -0
- package/lib/utils/injectStyle.mjs +41 -0
- package/lib/utils/injectStyle.mjs.map +1 -0
- package/lib/utils/inputProps.d.ts +2 -0
- package/lib/utils/inputProps.js +22 -0
- package/lib/utils/inputProps.js.map +1 -0
- package/lib/utils/inputProps.mjs +14 -0
- package/lib/utils/inputProps.mjs.map +1 -0
- package/lib/utils/isInteractiveElement.d.ts +1 -0
- package/lib/utils/isInteractiveElement.js +34 -0
- package/lib/utils/isInteractiveElement.js.map +1 -0
- package/lib/utils/isInteractiveElement.mjs +28 -0
- package/lib/utils/isInteractiveElement.mjs.map +1 -0
- package/lib/utils/isNode.d.ts +1 -0
- package/lib/utils/isNode.js +28 -0
- package/lib/utils/isNode.js.map +1 -0
- package/lib/utils/isNode.mjs +21 -0
- package/lib/utils/isNode.mjs.map +1 -0
- package/lib/utils/isPromise.d.ts +1 -0
- package/lib/utils/isPromise.js +10 -0
- package/lib/utils/isPromise.js.map +1 -0
- package/lib/utils/isPromise.mjs +4 -0
- package/lib/utils/isPromise.mjs.map +1 -0
- package/lib/utils/isRetina.d.ts +1 -0
- package/lib/utils/isRetina.js +15 -0
- package/lib/utils/isRetina.js.map +1 -0
- package/lib/utils/isRetina.mjs +9 -0
- package/lib/utils/isRetina.mjs.map +1 -0
- package/lib/utils/logger.d.ts +9 -0
- package/lib/utils/logger.js +40 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/logger.mjs +35 -0
- package/lib/utils/logger.mjs.map +1 -0
- package/lib/utils/numericChecker.d.ts +5 -0
- package/lib/utils/numericChecker.js +33 -0
- package/lib/utils/numericChecker.js.map +1 -0
- package/lib/utils/numericChecker.mjs +27 -0
- package/lib/utils/numericChecker.mjs.map +1 -0
- package/lib/utils/ownerDocument.d.ts +1 -0
- package/lib/utils/ownerDocument.js +10 -0
- package/lib/utils/ownerDocument.js.map +1 -0
- package/lib/utils/ownerDocument.mjs +4 -0
- package/lib/utils/ownerDocument.mjs.map +1 -0
- package/lib/utils/pick.d.ts +1 -0
- package/lib/utils/pick.js +19 -0
- package/lib/utils/pick.js.map +1 -0
- package/lib/utils/pick.mjs +15 -0
- package/lib/utils/pick.mjs.map +1 -0
- package/lib/utils/propsForElement.d.ts +3 -0
- package/lib/utils/propsForElement.js +59 -0
- package/lib/utils/propsForElement.js.map +1 -0
- package/lib/utils/propsForElement.mjs +50 -0
- package/lib/utils/propsForElement.mjs.map +1 -0
- package/lib/utils/rafTrottle.d.ts +2 -0
- package/lib/utils/rafTrottle.js +33 -0
- package/lib/utils/rafTrottle.js.map +1 -0
- package/lib/utils/rafTrottle.mjs +26 -0
- package/lib/utils/rafTrottle.mjs.map +1 -0
- package/lib/utils/reactToText.d.ts +3 -0
- package/lib/utils/reactToText.js +33 -0
- package/lib/utils/reactToText.js.map +1 -0
- package/lib/utils/reactToText.mjs +26 -0
- package/lib/utils/reactToText.mjs.map +1 -0
- package/lib/utils/ref.d.ts +10 -0
- package/lib/utils/ref.js +96 -0
- package/lib/utils/ref.js.map +1 -0
- package/lib/utils/ref.mjs +87 -0
- package/lib/utils/ref.mjs.map +1 -0
- package/lib/utils/setRef.d.ts +2 -0
- package/lib/utils/setRef.js +10 -0
- package/lib/utils/setRef.js.map +1 -0
- package/lib/utils/setRef.mjs +3 -0
- package/lib/utils/setRef.mjs.map +1 -0
- package/lib/utils/syncScroll.d.ts +1 -0
- package/lib/utils/syncScroll.js +61 -0
- package/lib/utils/syncScroll.js.map +1 -0
- package/lib/utils/syncScroll.mjs +54 -0
- package/lib/utils/syncScroll.mjs.map +1 -0
- package/lib/utils/uncontroll.d.ts +4 -0
- package/lib/utils/uncontroll.js +47 -0
- package/lib/utils/uncontroll.js.map +1 -0
- package/lib/utils/uncontroll.mjs +38 -0
- package/lib/utils/uncontroll.mjs.map +1 -0
- package/lib/utils/uniqueID.d.ts +12 -0
- package/lib/utils/uniqueID.js +42 -0
- package/lib/utils/uniqueID.js.map +1 -0
- package/lib/utils/uniqueID.mjs +33 -0
- package/lib/utils/uniqueID.mjs.map +1 -0
- package/lib/utils/use/useColorResolver.d.ts +1 -0
- package/lib/utils/use/useColorResolver.js +208 -0
- package/lib/utils/use/useColorResolver.js.map +1 -0
- package/lib/utils/use/useColorResolver.mjs +200 -0
- package/lib/utils/use/useColorResolver.mjs.map +1 -0
- package/lib/utils/use/useCss.d.ts +4 -0
- package/lib/utils/use/useCss.js +20 -0
- package/lib/utils/use/useCss.js.map +1 -0
- package/lib/utils/use/useCss.mjs +12 -0
- package/lib/utils/use/useCss.mjs.map +1 -0
- package/lib/utils/use/useEnhancedEffect.d.ts +3 -0
- package/lib/utils/use/useEnhancedEffect.js +13 -0
- package/lib/utils/use/useEnhancedEffect.js.map +1 -0
- package/lib/utils/use/useEnhancedEffect.mjs +6 -0
- package/lib/utils/use/useEnhancedEffect.mjs.map +1 -0
- package/lib/utils/use/useEventCallback.d.ts +4 -0
- package/lib/utils/use/useEventCallback.js +25 -0
- package/lib/utils/use/useEventCallback.js.map +1 -0
- package/lib/utils/use/useEventCallback.mjs +19 -0
- package/lib/utils/use/useEventCallback.mjs.map +1 -0
- package/lib/utils/use/useEventListener.d.ts +2 -0
- package/lib/utils/use/useEventListener.js +33 -0
- package/lib/utils/use/useEventListener.js.map +1 -0
- package/lib/utils/use/useEventListener.mjs +25 -0
- package/lib/utils/use/useEventListener.mjs.map +1 -0
- package/lib/utils/use/useFocusLock.d.ts +10 -0
- package/lib/utils/use/useFocusLock.js +289 -0
- package/lib/utils/use/useFocusLock.js.map +1 -0
- package/lib/utils/use/useFocusLock.mjs +266 -0
- package/lib/utils/use/useFocusLock.mjs.map +1 -0
- package/lib/utils/use/usePreventScroll.d.ts +2 -0
- package/lib/utils/use/usePreventScroll.js +78 -0
- package/lib/utils/use/usePreventScroll.js.map +1 -0
- package/lib/utils/use/usePreventScroll.mjs +70 -0
- package/lib/utils/use/usePreventScroll.mjs.map +1 -0
- package/lib/utils/useCssVariable.d.ts +8 -0
- package/lib/utils/useCssVariable.js +55 -0
- package/lib/utils/useCssVariable.js.map +1 -0
- package/lib/utils/useCssVariable.mjs +46 -0
- package/lib/utils/useCssVariable.mjs.map +1 -0
- package/lib/utils/zIndexStacking.d.ts +8 -0
- package/lib/utils/zIndexStacking.js +48 -0
- package/lib/utils/zIndexStacking.js.map +1 -0
- package/lib/utils/zIndexStacking.mjs +38 -0
- package/lib/utils/zIndexStacking.mjs.map +1 -0
- package/package.json +297 -10
- package/tsconfig-utils.json +4 -0
- package/vite.config.ts +24 -0
- package/lib/cjs/index.js +0 -23
- package/lib/cjs/index.js.map +0 -1
- package/lib/es6/index.js +0 -4
- package/lib/es6/index.js.map +0 -1
- package/lib/types/index.d.ts +0 -3
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _get from "@babel/runtime/helpers/esm/get";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
6
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
8
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
9
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
10
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
11
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
12
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
13
|
+
import React from "react";
|
|
14
|
+
import hoistNonReactStatics from "hoist-non-react-statics";
|
|
15
|
+
import { useForkRef } from "./utils/ref.mjs";
|
|
16
|
+
import useEnhancedEffect from "./utils/use/useEnhancedEffect.mjs";
|
|
17
|
+
import assignProps$1 from "./utils/assignProps.mjs";
|
|
18
|
+
import { Component } from "./core-types/Component.mjs";
|
|
19
|
+
import Enhancement$1 from "./enhancement/Children.mjs";
|
|
20
|
+
import Enhancement$2 from "./enhancement/Root.mjs";
|
|
21
|
+
import Enhancement$3 from "./enhancement/uncontrolledProps.mjs";
|
|
22
|
+
import Enhancement$5 from "./enhancement/functionDefaultProps.mjs";
|
|
23
|
+
import Enhancement$4, { ROOT_COMPONENT, getterMethodNameByDisplayName, STATIC_COMPONENT } from "./enhancement/staticChildren.mjs";
|
|
24
|
+
import Enhancement$6 from "./enhancement/inheritedName.mjs";
|
|
25
|
+
import Enhancement$a from "./enhancement/hoistProps.mjs";
|
|
26
|
+
import Enhancement$7 from "./enhancement/dataName.mjs";
|
|
27
|
+
import Enhancement$8 from "./enhancement/enhance.mjs";
|
|
28
|
+
import Enhancement$9 from "./enhancement/style.mjs";
|
|
29
|
+
import Enhancement from "./enhancement/bindHandler.mjs";
|
|
30
|
+
import i18nAppLocaleEnhance from "./enhancement/i18n.mjs";
|
|
31
|
+
import { CORE_AS_PROPS, CORE_INSTANCE, CORE_INIT, CORE_COMPONENT, PARENT_COMPONENTS, CONTEXT_COMPONENT, CREATE_COMPONENT } from "./core-types/symbols.mjs";
|
|
32
|
+
var _excluded = ["forwardRef"], _excluded2 = ["forwardRef", "__WRAPPER_PROPS_BIND__"], _excluded3 = ["ref"];
|
|
33
|
+
function isEmptyObject(obj) {
|
|
34
|
+
return Object.getOwnPropertyNames(obj).length === 0 && Object.getOwnPropertySymbols && // For IE 11
|
|
35
|
+
Object.getOwnPropertySymbols(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
|
|
36
|
+
}
|
|
37
|
+
function createGetField(enhancements, Component2, isFunction) {
|
|
38
|
+
return function getField(key) {
|
|
39
|
+
return enhancements.filter(function(enhancement) {
|
|
40
|
+
if (!enhancement.condition) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return enhancement.condition(Component2, isFunction);
|
|
44
|
+
}).reduce(function(acc, item) {
|
|
45
|
+
if (item[key]) {
|
|
46
|
+
acc.push(item[key]);
|
|
47
|
+
}
|
|
48
|
+
return acc;
|
|
49
|
+
}, []);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function createForwardWrapper(Component2, wrapperProps, statics, isFunction) {
|
|
53
|
+
var RootComponent = Component2[ROOT_COMPONENT];
|
|
54
|
+
var getterMethodName = getterMethodNameByDisplayName(Component2 === null || Component2 === void 0 ? void 0 : Component2.displayName);
|
|
55
|
+
var getterMethod = RootComponent !== null && RootComponent !== void 0 && RootComponent.prototype ? RootComponent.prototype[getterMethodName] : void 0;
|
|
56
|
+
var useGetterIndex = (getterMethod === null || getterMethod === void 0 ? void 0 : getterMethod.length) >= 2;
|
|
57
|
+
function WrapperForwardRefWithBind(_ref, ref) {
|
|
58
|
+
var _ref$forwardRef = _ref.forwardRef, forwardRef = _ref$forwardRef === void 0 ? null : _ref$forwardRef, other = _objectWithoutProperties(_ref, _excluded);
|
|
59
|
+
return /* @__PURE__ */ React.createElement(BindingWrapper, _extends({}, other, {
|
|
60
|
+
forwardRef: useForkRef(ref, forwardRef)
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
function WrapperForwardRef(_ref2, ref) {
|
|
64
|
+
var _ref2$forwardRef = _ref2.forwardRef, forwardRef = _ref2$forwardRef === void 0 ? null : _ref2$forwardRef, __WRAPPER_PROPS_BIND__ = _ref2.__WRAPPER_PROPS_BIND__, other = _objectWithoutProperties(_ref2, _excluded2);
|
|
65
|
+
var _reduce = (__WRAPPER_PROPS_BIND__ || wrapperProps).reduce(function(acc, enhancement) {
|
|
66
|
+
return enhancement(acc, WrapperComponent, isFunction);
|
|
67
|
+
}, other), _reduce$ref = _reduce.ref, enhancementRef = _reduce$ref === void 0 ? null : _reduce$ref, props = _objectWithoutProperties(_reduce, _excluded3);
|
|
68
|
+
return /* @__PURE__ */ React.createElement(Component2, _extends({}, props, {
|
|
69
|
+
forwardRef: useForkRef(enhancementRef, ref, forwardRef)
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
var BindingWrapper = /* @__PURE__ */ function(_React$Component) {
|
|
73
|
+
_inherits(BindingWrapper2, _React$Component);
|
|
74
|
+
var _super = _createSuper(BindingWrapper2);
|
|
75
|
+
function BindingWrapper2() {
|
|
76
|
+
var _this;
|
|
77
|
+
_classCallCheck(this, BindingWrapper2);
|
|
78
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
79
|
+
args[_key] = arguments[_key];
|
|
80
|
+
}
|
|
81
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
82
|
+
_defineProperty(_assertThisInitialized(_this), "index", -1);
|
|
83
|
+
return _this;
|
|
84
|
+
}
|
|
85
|
+
_createClass(BindingWrapper2, [{
|
|
86
|
+
key: "render",
|
|
87
|
+
value: function render() {
|
|
88
|
+
var _this2 = this;
|
|
89
|
+
return /* @__PURE__ */ React.createElement(WrapperForwardRef, _extends({}, this.props, {
|
|
90
|
+
__WRAPPER_PROPS_BIND__: wrapperProps.map(function(fn) {
|
|
91
|
+
return fn.bind(_this2);
|
|
92
|
+
})
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
}]);
|
|
96
|
+
return BindingWrapper2;
|
|
97
|
+
}(React.Component);
|
|
98
|
+
var WrapperComponent = /* @__PURE__ */ React.forwardRef(useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef);
|
|
99
|
+
hoistNonReactStatics(WrapperComponent, Component2);
|
|
100
|
+
WrapperComponent.displayName = Component2.displayName;
|
|
101
|
+
WrapperComponent.defaultProps = Component2.defaultProps;
|
|
102
|
+
statics.forEach(function(enhancement) {
|
|
103
|
+
return Object.assign(WrapperComponent, enhancement(WrapperComponent, Component2, isFunction));
|
|
104
|
+
});
|
|
105
|
+
return WrapperComponent;
|
|
106
|
+
}
|
|
107
|
+
function wrapClass(OriginComponent, enhancements, Context) {
|
|
108
|
+
var getField = createGetField(enhancements, OriginComponent, false);
|
|
109
|
+
var inits = getField("init");
|
|
110
|
+
var props = getField("asProps");
|
|
111
|
+
var renders = getField("render");
|
|
112
|
+
var statics = getField("static");
|
|
113
|
+
var wrapperProps = getField("wrapperProps");
|
|
114
|
+
var contexts = getField("context");
|
|
115
|
+
var Component2 = /* @__PURE__ */ function(_OriginComponent2) {
|
|
116
|
+
_inherits(Component3, _OriginComponent2);
|
|
117
|
+
var _super2 = _createSuper(Component3);
|
|
118
|
+
function Component3(props2, context) {
|
|
119
|
+
var _this3;
|
|
120
|
+
_classCallCheck(this, Component3);
|
|
121
|
+
_this3 = _super2.call(this, props2, context);
|
|
122
|
+
_defineProperty(_assertThisInitialized(_this3), CORE_AS_PROPS, null);
|
|
123
|
+
_defineProperty(_assertThisInitialized(_this3), CORE_INSTANCE, WrapperComponent);
|
|
124
|
+
_defineProperty(_assertThisInitialized(_this3), CORE_INIT, false);
|
|
125
|
+
inits.forEach(function(enhancement) {
|
|
126
|
+
return enhancement.call(_assertThisInitialized(_this3), props2, WrapperComponent, false);
|
|
127
|
+
});
|
|
128
|
+
_this3[CORE_INIT] = true;
|
|
129
|
+
return _this3;
|
|
130
|
+
}
|
|
131
|
+
_createClass(Component3, [{
|
|
132
|
+
key: "asProps",
|
|
133
|
+
get: function get() {
|
|
134
|
+
var _this4 = this;
|
|
135
|
+
if (!this[CORE_INIT]) {
|
|
136
|
+
throw new Error("Can not call asProps in constructor");
|
|
137
|
+
}
|
|
138
|
+
if (!this[CORE_AS_PROPS]) {
|
|
139
|
+
this[CORE_AS_PROPS] = props.reduce(function(acc, enhancement) {
|
|
140
|
+
return enhancement.call(_this4, acc, WrapperComponent, false);
|
|
141
|
+
}, this.props);
|
|
142
|
+
}
|
|
143
|
+
return this[CORE_AS_PROPS];
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "setContext",
|
|
147
|
+
value: function setContext() {
|
|
148
|
+
var _this5 = this;
|
|
149
|
+
var contextProps = _get(_getPrototypeOf(Component3.prototype), "setContext", this) ? _get(_getPrototypeOf(Component3.prototype), "setContext", this).call(this) : {};
|
|
150
|
+
return contexts.reduce(function(acc, enhancement) {
|
|
151
|
+
return enhancement.call(_this5, acc, WrapperComponent, false);
|
|
152
|
+
}, contextProps);
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "render",
|
|
156
|
+
value: function render() {
|
|
157
|
+
var _this6 = this;
|
|
158
|
+
this[CORE_AS_PROPS] = null;
|
|
159
|
+
if (!_get(_getPrototypeOf(Component3.prototype), "render", this)) {
|
|
160
|
+
throw new Error("Component `render` method is not defined");
|
|
161
|
+
}
|
|
162
|
+
var asProps = this.asProps;
|
|
163
|
+
var ctx = this.setContext();
|
|
164
|
+
var render2 = renders.reduce(function(acc, enhancement) {
|
|
165
|
+
return enhancement.call(_this6, acc, asProps, WrapperComponent, false);
|
|
166
|
+
}, _get(_getPrototypeOf(Component3.prototype), "render", this).call(this));
|
|
167
|
+
if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
168
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, {
|
|
169
|
+
value: _objectSpread(_objectSpread({}, asProps), ctx)
|
|
170
|
+
}, render2);
|
|
171
|
+
} else {
|
|
172
|
+
return render2;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}]);
|
|
176
|
+
return Component3;
|
|
177
|
+
}(OriginComponent);
|
|
178
|
+
var WrapperComponent = createForwardWrapper(Component2, wrapperProps, statics, false);
|
|
179
|
+
return WrapperComponent;
|
|
180
|
+
}
|
|
181
|
+
function wrapFunction(OriginComponent, enhancements, Context) {
|
|
182
|
+
var getField = createGetField(enhancements, OriginComponent, true);
|
|
183
|
+
var inits = getField("init");
|
|
184
|
+
var props = getField("asProps");
|
|
185
|
+
var renders = getField("render");
|
|
186
|
+
var statics = getField("static");
|
|
187
|
+
var wrapperProps = getField("wrapperProps");
|
|
188
|
+
var contexts = getField("context");
|
|
189
|
+
var Component2 = /* @__PURE__ */ React.memo(function FunctionMemoComponent(other) {
|
|
190
|
+
var selfRef = React.useRef({});
|
|
191
|
+
var firstRender = React.useRef(true);
|
|
192
|
+
useEnhancedEffect(function() {
|
|
193
|
+
firstRender.current = false;
|
|
194
|
+
}, []);
|
|
195
|
+
if (firstRender.current) {
|
|
196
|
+
inits.forEach(function(enhancement) {
|
|
197
|
+
return enhancement.call(selfRef.current, other, WrapperComponent, true);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
var asProps = props.reduce(function(acc, enhancement) {
|
|
201
|
+
return enhancement.call(selfRef.current, acc, WrapperComponent, true);
|
|
202
|
+
}, other);
|
|
203
|
+
var ctx = contexts.reduce(function(acc, enhancement) {
|
|
204
|
+
return enhancement.call(selfRef.current, acc, WrapperComponent, true);
|
|
205
|
+
}, {});
|
|
206
|
+
var render = renders.reduce(function(acc, enhancement) {
|
|
207
|
+
return enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true);
|
|
208
|
+
}, /* @__PURE__ */ React.createElement(OriginComponent, asProps));
|
|
209
|
+
if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
210
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, {
|
|
211
|
+
value: _objectSpread(_objectSpread({}, asProps), ctx)
|
|
212
|
+
}, render);
|
|
213
|
+
} else {
|
|
214
|
+
return render;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
Object.assign(Component2, OriginComponent);
|
|
218
|
+
var WrapperComponent = createForwardWrapper(Component2, wrapperProps, statics, true);
|
|
219
|
+
return WrapperComponent;
|
|
220
|
+
}
|
|
221
|
+
function wrapCore(OriginComponent, enhancements, Context) {
|
|
222
|
+
var Component2 = function Component3(_ref3) {
|
|
223
|
+
var Root = _ref3.Root;
|
|
224
|
+
var defaultProps = OriginComponent.defaultProps || {};
|
|
225
|
+
return /* @__PURE__ */ React.createElement(Root, _extends({}, defaultProps, {
|
|
226
|
+
render: OriginComponent
|
|
227
|
+
}));
|
|
228
|
+
};
|
|
229
|
+
hoistNonReactStatics(Component2, OriginComponent);
|
|
230
|
+
Component2.displayName = OriginComponent.displayName;
|
|
231
|
+
return wrapFunction(Component2, enhancements, Context);
|
|
232
|
+
}
|
|
233
|
+
function createComposeComponent(OriginComponent, Context, enhancements) {
|
|
234
|
+
if (React.PureComponent.isPrototypeOf(OriginComponent) || React.Component.isPrototypeOf(OriginComponent)) {
|
|
235
|
+
if (OriginComponent.prototype instanceof Component) {
|
|
236
|
+
return wrapClass(OriginComponent, enhancements, Context);
|
|
237
|
+
} else {
|
|
238
|
+
throw new Error("Must inherit from our component");
|
|
239
|
+
}
|
|
240
|
+
} else if (typeof OriginComponent === "function") {
|
|
241
|
+
return wrapFunction(OriginComponent, enhancements, Context);
|
|
242
|
+
} else if (OriginComponent[CORE_COMPONENT]) {
|
|
243
|
+
return wrapCore(OriginComponent, enhancements, Context);
|
|
244
|
+
} else {
|
|
245
|
+
throw new Error("Must be a React component");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function assignProps(p1, p2) {
|
|
249
|
+
return assignProps$1(p2, p1);
|
|
250
|
+
}
|
|
251
|
+
function createComponent(OriginComponent) {
|
|
252
|
+
var childComponents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
253
|
+
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
254
|
+
var _options$context = options.context, context = _options$context === void 0 ? /* @__PURE__ */ React.createContext({}) : _options$context, _options$parent = options.parent, parent = _options$parent === void 0 ? [] : _options$parent, _options$enhancements = options.enhancements, enhancements = _options$enhancements === void 0 ? [] : _options$enhancements;
|
|
255
|
+
var parents = Array.isArray(parent) ? parent : [parent];
|
|
256
|
+
if (parents.length) {
|
|
257
|
+
var wholeFamily = parents.reduce(function(acc, parent2) {
|
|
258
|
+
if (parent2[PARENT_COMPONENTS]) {
|
|
259
|
+
acc = [].concat(_toConsumableArray(parent2[PARENT_COMPONENTS]), _toConsumableArray(acc));
|
|
260
|
+
}
|
|
261
|
+
return acc;
|
|
262
|
+
}, parents);
|
|
263
|
+
OriginComponent[PARENT_COMPONENTS] = wholeFamily;
|
|
264
|
+
parents = wholeFamily;
|
|
265
|
+
}
|
|
266
|
+
if (OriginComponent[CORE_COMPONENT]) {
|
|
267
|
+
parents.push(OriginComponent);
|
|
268
|
+
}
|
|
269
|
+
var Component2 = createComposeComponent(OriginComponent, context, [].concat(_toConsumableArray(enhancements.map(function(f) {
|
|
270
|
+
return f(context, parents, createComponent, childComponents);
|
|
271
|
+
})), [
|
|
272
|
+
i18nAppLocaleEnhance(),
|
|
273
|
+
Enhancement(),
|
|
274
|
+
Enhancement$1(context, parents),
|
|
275
|
+
// root must be under the children
|
|
276
|
+
Enhancement$2(),
|
|
277
|
+
Enhancement$3(),
|
|
278
|
+
Enhancement$4(childComponents, createComponent, {
|
|
279
|
+
context,
|
|
280
|
+
parent,
|
|
281
|
+
enhancements
|
|
282
|
+
}),
|
|
283
|
+
// functionDefaultProps must be under the staticChild
|
|
284
|
+
Enhancement$5(),
|
|
285
|
+
// inheritedName must be under the staticChild
|
|
286
|
+
Enhancement$6(),
|
|
287
|
+
// dataName must be under the staticChild
|
|
288
|
+
Enhancement$7(),
|
|
289
|
+
// enhanceEnhancement must be under the functionDefaultPropsEnhancement
|
|
290
|
+
Enhancement$8(),
|
|
291
|
+
Enhancement$9(childComponents, context),
|
|
292
|
+
// must be the last one so any properties can be raised
|
|
293
|
+
Enhancement$a(childComponents, context)
|
|
294
|
+
]));
|
|
295
|
+
Component2[CONTEXT_COMPONENT] = context;
|
|
296
|
+
Component2._______childrenComponents = childComponents;
|
|
297
|
+
Component2[CREATE_COMPONENT] = function() {
|
|
298
|
+
var _OriginComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : OriginComponent;
|
|
299
|
+
var _childComponents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : childComponents;
|
|
300
|
+
var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : options;
|
|
301
|
+
return createComponent(_OriginComponent, _childComponents, _options);
|
|
302
|
+
};
|
|
303
|
+
Component2[CORE_COMPONENT] = true;
|
|
304
|
+
return Component2;
|
|
305
|
+
}
|
|
306
|
+
function createBaseComponent(OriginComponent) {
|
|
307
|
+
var Component2 = null;
|
|
308
|
+
if (!React.PureComponent.isPrototypeOf(OriginComponent) && !React.Component.isPrototypeOf(OriginComponent) && typeof OriginComponent === "function") {
|
|
309
|
+
Component2 = /* @__PURE__ */ React.forwardRef(OriginComponent);
|
|
310
|
+
Component2.displayName = OriginComponent.displayName;
|
|
311
|
+
Component2.defaultProps = _objectSpread({
|
|
312
|
+
"data-ui-name": OriginComponent.displayName
|
|
313
|
+
}, OriginComponent.defaultProps);
|
|
314
|
+
Component2[CORE_COMPONENT] = true;
|
|
315
|
+
} else {
|
|
316
|
+
throw new Error("createBaseComponent accepts only functional component");
|
|
317
|
+
}
|
|
318
|
+
return Component2;
|
|
319
|
+
}
|
|
320
|
+
export {
|
|
321
|
+
assignProps,
|
|
322
|
+
createBaseComponent,
|
|
323
|
+
createComponent
|
|
324
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
import React from "react";
|
|
6
|
+
import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
|
|
7
|
+
var _excluded = ["handlers", "getters"], _excluded2 = ["handlers"];
|
|
8
|
+
var CHILDREN_SELF = Symbol("CHILDREN_SELF");
|
|
9
|
+
var GETTER_REG = /^get[\w]+Props$/;
|
|
10
|
+
function splitPropsAndGetters(props) {
|
|
11
|
+
return Object.entries(props).reduce(function(acc, _ref) {
|
|
12
|
+
var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
|
|
13
|
+
if (GETTER_REG.exec(key) === null) {
|
|
14
|
+
acc.props[key] = value;
|
|
15
|
+
} else {
|
|
16
|
+
acc.getters[key] = value;
|
|
17
|
+
}
|
|
18
|
+
return acc;
|
|
19
|
+
}, {
|
|
20
|
+
props: {},
|
|
21
|
+
getters: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function getterToArray(getter) {
|
|
25
|
+
if (!Array.isArray(getter)) {
|
|
26
|
+
return typeof getter === "function" ? [getter] : [];
|
|
27
|
+
}
|
|
28
|
+
return getter;
|
|
29
|
+
}
|
|
30
|
+
function mergeObjects() {
|
|
31
|
+
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
32
|
+
var b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
33
|
+
var core = _objectSpread(_objectSpread({}, a), b);
|
|
34
|
+
return Object.keys(core).reduce(function(acc, key) {
|
|
35
|
+
a[key] = getterToArray(a[key]);
|
|
36
|
+
b[key] = getterToArray(b[key]);
|
|
37
|
+
acc[key] = [].concat(_toConsumableArray(a[key]), _toConsumableArray(b[key]));
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
}
|
|
41
|
+
function assignGettersChain(getters) {
|
|
42
|
+
return function() {
|
|
43
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
44
|
+
return getters.reduce(function(acc, getter) {
|
|
45
|
+
return getter(acc);
|
|
46
|
+
}, props);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function createChildren(Context, contexts) {
|
|
50
|
+
var Children = function Children2() {
|
|
51
|
+
var children = Children2.origin;
|
|
52
|
+
if (typeof children === "function") {
|
|
53
|
+
var _reduce = [].concat(_toConsumableArray(contexts), [Context]).reduce(function(acc, ctx) {
|
|
54
|
+
var _ref3 = React.useContext(ctx), handlers2 = _ref3.handlers, propsAndGetters = _objectWithoutProperties(_ref3, _excluded2);
|
|
55
|
+
var _splitPropsAndGetters = splitPropsAndGetters(propsAndGetters), props2 = _splitPropsAndGetters.props, getters2 = _splitPropsAndGetters.getters;
|
|
56
|
+
return Object.assign({}, acc, _objectSpread({
|
|
57
|
+
handlers: Object.assign({}, acc.handlers, handlers2),
|
|
58
|
+
getters: mergeObjects(acc.getters, getters2)
|
|
59
|
+
}, props2));
|
|
60
|
+
}, Children2.props), _reduce$handlers = _reduce.handlers, handlers = _reduce$handlers === void 0 ? {} : _reduce$handlers, _reduce$getters = _reduce.getters, getters = _reduce$getters === void 0 ? {} : _reduce$getters, props = _objectWithoutProperties(_reduce, _excluded);
|
|
61
|
+
var mergedGetters = Object.entries(getters).reduce(function(acc, _ref4) {
|
|
62
|
+
var _ref5 = _slicedToArray(_ref4, 2), key = _ref5[0], value = _ref5[1];
|
|
63
|
+
acc[key] = assignGettersChain(value);
|
|
64
|
+
return acc;
|
|
65
|
+
}, {});
|
|
66
|
+
return children(_objectSpread(_objectSpread({}, props), mergedGetters), handlers);
|
|
67
|
+
} else if (children === void 0) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return children;
|
|
71
|
+
};
|
|
72
|
+
Children.origin = null;
|
|
73
|
+
Children.props = {};
|
|
74
|
+
Children[CHILDREN_COMPONENT] = true;
|
|
75
|
+
return Children;
|
|
76
|
+
}
|
|
77
|
+
function Enhancement(Context, parent) {
|
|
78
|
+
return {
|
|
79
|
+
init: function init() {
|
|
80
|
+
var contexts = (Array.isArray(parent) ? parent : [parent]).map(function(component) {
|
|
81
|
+
return component[CONTEXT_COMPONENT];
|
|
82
|
+
}).filter(Boolean);
|
|
83
|
+
this[CHILDREN_SELF] = createChildren(Context, contexts);
|
|
84
|
+
},
|
|
85
|
+
asProps: function asProps(props) {
|
|
86
|
+
this[CHILDREN_SELF].origin = props.children;
|
|
87
|
+
this[CHILDREN_SELF].props = props;
|
|
88
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
89
|
+
Children: this[CHILDREN_SELF]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
Enhancement as default
|
|
96
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
import React from "react";
|
|
5
|
+
import assignProps from "../utils/assignProps.mjs";
|
|
6
|
+
import { useForkRef } from "../utils/ref.mjs";
|
|
7
|
+
var _excluded = ["render"], _excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
|
|
8
|
+
function createRootRender() {
|
|
9
|
+
var Root = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
10
|
+
var Tag = _ref.render, source = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
var _Root$props = Root.props, _Root = _Root$props.Root, styles = _Root$props.styles, children = _Root$props.children, Children = _Root$props.Children, _Root$props$forwardRe = _Root$props.forwardRef, forwardRef = _Root$props$forwardRe === void 0 ? null : _Root$props$forwardRe, props = _objectWithoutProperties(_Root$props, _excluded2);
|
|
12
|
+
var clearProps = Object.entries(props).reduce(function(props2, _ref2) {
|
|
13
|
+
var _ref3 = _slicedToArray(_ref2, 2), name = _ref3[0], value = _ref3[1];
|
|
14
|
+
if (value !== void 0) {
|
|
15
|
+
props2[name] = value;
|
|
16
|
+
}
|
|
17
|
+
return props2;
|
|
18
|
+
}, {});
|
|
19
|
+
var child = {};
|
|
20
|
+
if (typeof Children.origin !== "undefined") {
|
|
21
|
+
child.children = /* @__PURE__ */ React.createElement(Children, null);
|
|
22
|
+
}
|
|
23
|
+
var other = assignProps(_objectSpread(_objectSpread({}, clearProps), {}, {
|
|
24
|
+
ref: useForkRef(forwardRef, ref)
|
|
25
|
+
}), _objectSpread(_objectSpread({}, child), source));
|
|
26
|
+
if (!Tag) {
|
|
27
|
+
throw new Error("`render` prop of Root is not provided");
|
|
28
|
+
}
|
|
29
|
+
if (Tag === React.Fragment) return /* @__PURE__ */ React.createElement(React.Fragment, null, other.children);
|
|
30
|
+
return /* @__PURE__ */ React.createElement(Tag, other);
|
|
31
|
+
});
|
|
32
|
+
Root.props = {};
|
|
33
|
+
return Root;
|
|
34
|
+
}
|
|
35
|
+
function Enhancement() {
|
|
36
|
+
return {
|
|
37
|
+
init: function init() {
|
|
38
|
+
this.Root = createRootRender();
|
|
39
|
+
},
|
|
40
|
+
asProps: function asProps(props, WrapperComponent, isFunction) {
|
|
41
|
+
if (isFunction) {
|
|
42
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
43
|
+
Root: this.Root
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return props;
|
|
47
|
+
},
|
|
48
|
+
render: function render(_render, props) {
|
|
49
|
+
this.Root.props = props;
|
|
50
|
+
return _render;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
Enhancement as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function arraysEqual(a, b) {
|
|
2
|
+
if (a.length !== b.length) return false;
|
|
3
|
+
for (var i = 0; i < a.length; i++) {
|
|
4
|
+
if (a[i] !== b[i]) return false;
|
|
5
|
+
}
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
function handlerBinder(fn) {
|
|
9
|
+
return function() {
|
|
10
|
+
for (var _len = arguments.length, depsArgs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11
|
+
depsArgs[_key] = arguments[_key];
|
|
12
|
+
}
|
|
13
|
+
var memoizeds = [];
|
|
14
|
+
if (handlerBinder.hasher.has(fn)) {
|
|
15
|
+
memoizeds = handlerBinder.hasher.get(fn);
|
|
16
|
+
var memoized = memoizeds.find(function(memoized2) {
|
|
17
|
+
return arraysEqual(memoized2.deps, depsArgs);
|
|
18
|
+
});
|
|
19
|
+
if (memoized) return memoized.fn;
|
|
20
|
+
}
|
|
21
|
+
var bindFn = fn.apply(void 0, depsArgs).bind(fn);
|
|
22
|
+
memoizeds.push({
|
|
23
|
+
deps: depsArgs,
|
|
24
|
+
fn: bindFn
|
|
25
|
+
});
|
|
26
|
+
handlerBinder.hasher.set(fn, memoizeds);
|
|
27
|
+
return bindFn;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
handlerBinder.hasher = /* @__PURE__ */ new WeakMap();
|
|
31
|
+
function Enhancement() {
|
|
32
|
+
return {
|
|
33
|
+
condition: function condition(Component, isFunction) {
|
|
34
|
+
return !isFunction;
|
|
35
|
+
},
|
|
36
|
+
init: function init() {
|
|
37
|
+
var _this = this;
|
|
38
|
+
Object.keys(this).filter(function(field) {
|
|
39
|
+
return field.startsWith("bindHandler");
|
|
40
|
+
}).forEach(function(name) {
|
|
41
|
+
_this[name] = handlerBinder(_this[name].bind(_this));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
Enhancement as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
function Enhancement() {
|
|
3
|
+
return {
|
|
4
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
5
|
+
return _objectSpread({
|
|
6
|
+
"data-ui-name": WrapperComponent.displayName
|
|
7
|
+
}, props);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
Enhancement as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function Enhancement() {
|
|
2
|
+
return {
|
|
3
|
+
condition: function condition(Component) {
|
|
4
|
+
var _Component$enhance;
|
|
5
|
+
return Boolean((_Component$enhance = Component.enhance) === null || _Component$enhance === void 0 ? void 0 : _Component$enhance.length);
|
|
6
|
+
},
|
|
7
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
8
|
+
return WrapperComponent.enhance.reduce(function(acc, enhance) {
|
|
9
|
+
return enhance(acc);
|
|
10
|
+
}, props);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
Enhancement as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function Enhancement() {
|
|
2
|
+
var defaultProps = {};
|
|
3
|
+
return {
|
|
4
|
+
condition: function condition(Component) {
|
|
5
|
+
if (!Component.defaultProps) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (typeof Component.defaultProps === "function") {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return Boolean(Object.keys(Component.defaultProps).length);
|
|
12
|
+
},
|
|
13
|
+
"static": function _static(WrapperComponent) {
|
|
14
|
+
defaultProps = WrapperComponent.defaultProps;
|
|
15
|
+
return {
|
|
16
|
+
defaultProps: {}
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
wrapperProps: function wrapperProps(props) {
|
|
20
|
+
if (typeof defaultProps === "function") {
|
|
21
|
+
return Object.assign({}, defaultProps(props), props);
|
|
22
|
+
}
|
|
23
|
+
return Object.assign({}, defaultProps, props);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
Enhancement as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import assignProps from "../utils/assignProps.mjs";
|
|
7
|
+
import useEnhancedEffect from "../utils/use/useEnhancedEffect.mjs";
|
|
8
|
+
import pick from "../utils/pick.mjs";
|
|
9
|
+
var HOIST_CONTEXT = Symbol("HOIST_CONTEXT");
|
|
10
|
+
var HOIST_SELF = Symbol("HOIST_SELF");
|
|
11
|
+
var HOIST_SET = Symbol("HOIST_SET");
|
|
12
|
+
function flatChildComponent(childComponents) {
|
|
13
|
+
return Object.values(childComponents).reduce(function(acc, Component) {
|
|
14
|
+
if (Array.isArray(Component)) {
|
|
15
|
+
acc.push(Component[0]);
|
|
16
|
+
acc.push.apply(acc, _toConsumableArray(flatChildComponent(Component[1])));
|
|
17
|
+
} else {
|
|
18
|
+
acc.push(Component);
|
|
19
|
+
}
|
|
20
|
+
return acc;
|
|
21
|
+
}, []);
|
|
22
|
+
}
|
|
23
|
+
function Enhancement(childComponents, Context) {
|
|
24
|
+
return {
|
|
25
|
+
condition: function condition(Component) {
|
|
26
|
+
return [Component].concat(_toConsumableArray(flatChildComponent(childComponents))).some(function(Component2) {
|
|
27
|
+
var _Component$hoistProps;
|
|
28
|
+
return Boolean((_Component$hoistProps = Component2.hoistProps) === null || _Component$hoistProps === void 0 ? void 0 : _Component$hoistProps.length);
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
init: function init(props, WrapperComponent, isFunction) {
|
|
32
|
+
var _this = this;
|
|
33
|
+
if (isFunction) {
|
|
34
|
+
this[HOIST_SELF] = React.useState({});
|
|
35
|
+
} else {
|
|
36
|
+
this[HOIST_SELF] = [{}, function(obj) {
|
|
37
|
+
_this[HOIST_SELF][0] = obj;
|
|
38
|
+
_this.forceUpdate();
|
|
39
|
+
}];
|
|
40
|
+
}
|
|
41
|
+
this[HOIST_SET] = function(obj) {
|
|
42
|
+
_this[HOIST_SELF][1](obj);
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
context: function context(_context) {
|
|
46
|
+
return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, HOIST_CONTEXT, this[HOIST_SET]));
|
|
47
|
+
},
|
|
48
|
+
asProps: function asProps(props) {
|
|
49
|
+
return assignProps(this[HOIST_SELF][0], props);
|
|
50
|
+
},
|
|
51
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
52
|
+
var _WrapperComponent$hoi;
|
|
53
|
+
if ((_WrapperComponent$hoi = WrapperComponent.hoistProps) !== null && _WrapperComponent$hoi !== void 0 && _WrapperComponent$hoi.length) {
|
|
54
|
+
var context = React.useContext(Context);
|
|
55
|
+
var renameProps = WrapperComponent.hoistProps.reduce(function(acc, propName) {
|
|
56
|
+
var _propName$split = propName.split(":"), _propName$split2 = _slicedToArray(_propName$split, 2), name = _propName$split2[0], rename = _propName$split2[1];
|
|
57
|
+
acc[name] = rename || name;
|
|
58
|
+
return acc;
|
|
59
|
+
}, {});
|
|
60
|
+
var hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(function(acc, _ref) {
|
|
61
|
+
var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], value = _ref2[1];
|
|
62
|
+
acc[renameProps[name]] = value;
|
|
63
|
+
return acc;
|
|
64
|
+
}, {});
|
|
65
|
+
useEnhancedEffect(function() {
|
|
66
|
+
if (context[HOIST_CONTEXT]) {
|
|
67
|
+
context[HOIST_CONTEXT](hoistProps);
|
|
68
|
+
}
|
|
69
|
+
}, Object.values(hoistProps));
|
|
70
|
+
}
|
|
71
|
+
return props;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
HOIST_CONTEXT,
|
|
77
|
+
Enhancement as default
|
|
78
|
+
};
|