@semcore/core 2.39.1 → 16.0.0-prerelease.4
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 +7 -0
- package/README.md +2 -2
- package/lib/LastInteractionType.d.ts +11 -0
- package/lib/cjs/LastInteractionType.js +57 -0
- package/lib/cjs/LastInteractionType.js.map +1 -0
- package/lib/cjs/core-types/Component.js +59 -0
- package/lib/cjs/core-types/Component.js.map +1 -0
- package/lib/cjs/core-types/UnknownProperties.js +2 -0
- package/lib/cjs/core-types/UnknownProperties.js.map +1 -0
- package/lib/cjs/core-types/reshadow.d.js +2 -0
- package/lib/cjs/core-types/reshadow.d.js.map +1 -0
- package/lib/cjs/core-types/symbols.js +25 -0
- package/lib/cjs/core-types/symbols.js.map +1 -0
- package/lib/cjs/coreFactory.js +352 -0
- package/lib/cjs/coreFactory.js.map +1 -0
- package/lib/cjs/enhancement/Children.js +119 -0
- package/lib/cjs/enhancement/Children.js.map +1 -0
- package/lib/cjs/enhancement/Root.js +78 -0
- package/lib/cjs/enhancement/Root.js.map +1 -0
- package/lib/cjs/enhancement/bindHandler.js +54 -0
- package/lib/cjs/enhancement/bindHandler.js.map +1 -0
- package/lib/cjs/enhancement/dataName.js +20 -0
- package/lib/cjs/enhancement/dataName.js.map +1 -0
- package/lib/cjs/enhancement/enhance.js +22 -0
- package/lib/cjs/enhancement/enhance.js.map +1 -0
- package/lib/cjs/enhancement/functionDefaultProps.js +36 -0
- package/lib/cjs/enhancement/functionDefaultProps.js.map +1 -0
- package/lib/cjs/enhancement/hoistProps.js +97 -0
- package/lib/cjs/enhancement/hoistProps.js.map +1 -0
- package/lib/cjs/enhancement/i18n.js +28 -0
- package/lib/cjs/enhancement/i18n.js.map +1 -0
- package/lib/cjs/enhancement/inheritedName.js +23 -0
- package/lib/cjs/enhancement/inheritedName.js.map +1 -0
- package/lib/cjs/enhancement/staticChildren.js +135 -0
- package/lib/cjs/enhancement/staticChildren.js.map +1 -0
- package/lib/cjs/enhancement/style.js +60 -0
- package/lib/cjs/enhancement/style.js.map +1 -0
- package/lib/cjs/enhancement/uncontrolledProps.js +131 -0
- package/lib/cjs/enhancement/uncontrolledProps.js.map +1 -0
- package/lib/cjs/index.js +97 -17
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/register.js +37 -0
- package/lib/cjs/register.js.map +1 -0
- package/lib/cjs/styled/index.js +32 -0
- package/lib/cjs/styled/index.js.map +1 -0
- package/lib/cjs/styled/reshadow-core.js +256 -0
- package/lib/cjs/styled/reshadow-core.js.map +1 -0
- package/lib/cjs/styled/sstyled.js +149 -0
- package/lib/cjs/styled/sstyled.js.map +1 -0
- package/lib/cjs/theme/dark.json +2506 -0
- package/lib/cjs/theme/exclude-tokens.json +10 -0
- package/lib/cjs/theme/light.json +2584 -0
- package/lib/cjs/theme/processor.js +315 -0
- package/lib/cjs/theme/processor.js.map +1 -0
- package/lib/cjs/theme/themes/auto.css +1465 -0
- package/lib/cjs/theme/themes/dark.css +723 -0
- package/lib/cjs/theme/themes/dark.js +385 -0
- package/lib/cjs/theme/themes/dark.js.map +1 -0
- package/lib/cjs/theme/themes/default.css +742 -0
- package/lib/cjs/theme/themes/default.js +394 -0
- package/lib/cjs/theme/themes/default.js.map +1 -0
- package/lib/cjs/theme/themes/light.css +742 -0
- package/lib/cjs/theme/themes/light.js +394 -0
- package/lib/cjs/theme/themes/light.js.map +1 -0
- package/lib/cjs/theme/utils.js +297 -0
- package/lib/cjs/theme/utils.js.map +1 -0
- package/lib/cjs/utils/CSSinJS.js +36 -0
- package/lib/cjs/utils/CSSinJS.js.map +1 -0
- package/lib/cjs/utils/ScreenReaderOnly.js +31 -0
- package/lib/cjs/utils/ScreenReaderOnly.js.map +1 -0
- package/lib/cjs/utils/ThemeProvider.js +82 -0
- package/lib/cjs/utils/ThemeProvider.js.map +1 -0
- package/lib/cjs/utils/addonText.js +18 -0
- package/lib/cjs/utils/addonText.js.map +1 -0
- package/lib/cjs/utils/addonTextChildren.js +45 -0
- package/lib/cjs/utils/addonTextChildren.js.map +1 -0
- package/lib/cjs/utils/ariaProps.js +22 -0
- package/lib/cjs/utils/ariaProps.js.map +1 -0
- package/lib/cjs/utils/assignProps.js +93 -0
- package/lib/cjs/utils/assignProps.js.map +1 -0
- package/lib/cjs/utils/canUseDOM.js +10 -0
- package/lib/cjs/utils/canUseDOM.js.map +1 -0
- package/lib/cjs/utils/capitalizeFirstLetter.js +10 -0
- package/lib/cjs/utils/capitalizeFirstLetter.js.map +1 -0
- package/lib/cjs/utils/color.js +208 -0
- package/lib/cjs/utils/color.js.map +1 -0
- package/lib/cjs/utils/compose.js +21 -0
- package/lib/cjs/utils/compose.js.map +1 -0
- package/lib/cjs/utils/createHoc.js +55 -0
- package/lib/cjs/utils/createHoc.js.map +1 -0
- package/lib/cjs/utils/createUUID.js +15 -0
- package/lib/cjs/utils/createUUID.js.map +1 -0
- package/lib/cjs/utils/cssToIntDefault.js +22 -0
- package/lib/cjs/utils/cssToIntDefault.js.map +1 -0
- package/lib/cjs/utils/enhances/WithAutoFocus.js +75 -0
- package/lib/cjs/utils/enhances/WithAutoFocus.js.map +1 -0
- package/lib/cjs/utils/enhances/WithCSS.js +93 -0
- package/lib/cjs/utils/enhances/WithCSS.js.map +1 -0
- package/lib/cjs/utils/enhances/WithI18n.js +95 -0
- package/lib/cjs/utils/enhances/WithI18n.js.map +1 -0
- package/lib/cjs/utils/enhances/WithKeyboardFocus.js +93 -0
- package/lib/cjs/utils/enhances/WithKeyboardFocus.js.map +1 -0
- package/lib/cjs/utils/enhances/WithRef.js +26 -0
- package/lib/cjs/utils/enhances/WithRef.js.map +1 -0
- package/lib/cjs/utils/enhances/a11yEnhance.js +74 -0
- package/lib/cjs/utils/enhances/a11yEnhance.js.map +1 -0
- package/lib/cjs/utils/enhances/animatedSizeEnhance.js +98 -0
- package/lib/cjs/utils/enhances/animatedSizeEnhance.js.map +1 -0
- package/lib/cjs/utils/enhances/autoFocusEnhance.js +46 -0
- package/lib/cjs/utils/enhances/autoFocusEnhance.js.map +1 -0
- package/lib/cjs/utils/enhances/contextEnhance.js +22 -0
- package/lib/cjs/utils/enhances/contextEnhance.js.map +1 -0
- package/lib/cjs/utils/enhances/i18nEnhance.js +101 -0
- package/lib/cjs/utils/enhances/i18nEnhance.js.map +1 -0
- package/lib/cjs/utils/enhances/keyboardFocusEnhance.js +63 -0
- package/lib/cjs/utils/enhances/keyboardFocusEnhance.js.map +1 -0
- package/lib/cjs/utils/enhances/resolveColorEnhance.js +25 -0
- package/lib/cjs/utils/enhances/resolveColorEnhance.js.map +1 -0
- package/lib/cjs/utils/eventEmitter.js +41 -0
- package/lib/cjs/utils/eventEmitter.js.map +1 -0
- package/lib/cjs/utils/findComponent.js +106 -0
- package/lib/cjs/utils/findComponent.js.map +1 -0
- package/lib/cjs/utils/fire.js +23 -0
- package/lib/cjs/utils/fire.js.map +1 -0
- package/lib/cjs/utils/focus-lock/focusBorders.js +72 -0
- package/lib/cjs/utils/focus-lock/focusBorders.js.map +1 -0
- package/lib/cjs/utils/focus-lock/getFocusableIn.js +26 -0
- package/lib/cjs/utils/focus-lock/getFocusableIn.js.map +1 -0
- package/lib/cjs/utils/focus-lock/isFocusInside.js +16 -0
- package/lib/cjs/utils/focus-lock/isFocusInside.js.map +1 -0
- package/lib/cjs/utils/focus-lock/isFocusable.js +51 -0
- package/lib/cjs/utils/focus-lock/isFocusable.js.map +1 -0
- package/lib/cjs/utils/focus-lock/setFocus.js +63 -0
- package/lib/cjs/utils/focus-lock/setFocus.js.map +1 -0
- package/lib/cjs/utils/getAccessibleName.js +56 -0
- package/lib/cjs/utils/getAccessibleName.js.map +1 -0
- package/lib/cjs/utils/getDisplayName.js +10 -0
- package/lib/cjs/utils/getDisplayName.js.map +1 -0
- package/lib/cjs/utils/getEventTarget.js +53 -0
- package/lib/cjs/utils/getEventTarget.js.map +1 -0
- package/lib/cjs/utils/getOriginChildren.js +18 -0
- package/lib/cjs/utils/getOriginChildren.js.map +1 -0
- package/lib/cjs/utils/getRandomInt.js +11 -0
- package/lib/cjs/utils/getRandomInt.js.map +1 -0
- package/lib/cjs/utils/getValue.js +16 -0
- package/lib/cjs/utils/getValue.js.map +1 -0
- package/lib/cjs/utils/hasLabels.js +47 -0
- package/lib/cjs/utils/hasLabels.js.map +1 -0
- package/lib/cjs/utils/hasParent.js +14 -0
- package/lib/cjs/utils/hasParent.js.map +1 -0
- package/lib/cjs/utils/if.js +16 -0
- package/lib/cjs/utils/if.js.map +1 -0
- package/lib/cjs/utils/ifChildren.js +17 -0
- package/lib/cjs/utils/ifChildren.js.map +1 -0
- package/lib/cjs/utils/injectStyle.js +49 -0
- package/lib/cjs/utils/injectStyle.js.map +1 -0
- package/lib/cjs/utils/inputProps.js +22 -0
- package/lib/cjs/utils/inputProps.js.map +1 -0
- package/lib/cjs/utils/isNode.js +28 -0
- package/lib/cjs/utils/isNode.js.map +1 -0
- package/lib/cjs/utils/isPromise.js +10 -0
- package/lib/cjs/utils/isPromise.js.map +1 -0
- package/lib/cjs/utils/isRetina.js +15 -0
- package/lib/cjs/utils/isRetina.js.map +1 -0
- package/lib/cjs/utils/logger.js +40 -0
- package/lib/cjs/utils/logger.js.map +1 -0
- package/lib/cjs/utils/numericChecker.js +33 -0
- package/lib/cjs/utils/numericChecker.js.map +1 -0
- package/lib/cjs/utils/ownerDocument.js +10 -0
- package/lib/cjs/utils/ownerDocument.js.map +1 -0
- package/lib/cjs/utils/pick.js +19 -0
- package/lib/cjs/utils/pick.js.map +1 -0
- package/lib/cjs/utils/propsForElement.js +59 -0
- package/lib/cjs/utils/propsForElement.js.map +1 -0
- package/lib/cjs/utils/rafTrottle.js +33 -0
- package/lib/cjs/utils/rafTrottle.js.map +1 -0
- package/lib/cjs/utils/reactToText.js +33 -0
- package/lib/cjs/utils/reactToText.js.map +1 -0
- package/lib/cjs/utils/ref.js +95 -0
- package/lib/cjs/utils/ref.js.map +1 -0
- package/lib/cjs/utils/setRef.js +10 -0
- package/lib/cjs/utils/setRef.js.map +1 -0
- package/lib/cjs/utils/syncScroll.js +61 -0
- package/lib/cjs/utils/syncScroll.js.map +1 -0
- package/lib/cjs/utils/uncontroll.js +47 -0
- package/lib/cjs/utils/uncontroll.js.map +1 -0
- package/lib/cjs/utils/uniqueID.js +42 -0
- package/lib/cjs/utils/uniqueID.js.map +1 -0
- package/lib/cjs/utils/use/useColorResolver.js +208 -0
- package/lib/cjs/utils/use/useColorResolver.js.map +1 -0
- package/lib/cjs/utils/use/useCss.js +20 -0
- package/lib/cjs/utils/use/useCss.js.map +1 -0
- package/lib/cjs/utils/use/useEnhancedEffect.js +13 -0
- package/lib/cjs/utils/use/useEnhancedEffect.js.map +1 -0
- package/lib/cjs/utils/use/useEventCallback.js +25 -0
- package/lib/cjs/utils/use/useEventCallback.js.map +1 -0
- package/lib/cjs/utils/use/useEventListener.js +33 -0
- package/lib/cjs/utils/use/useEventListener.js.map +1 -0
- package/lib/cjs/utils/use/useFocusLock.js +289 -0
- package/lib/cjs/utils/use/useFocusLock.js.map +1 -0
- package/lib/cjs/utils/use/usePreventScroll.js +78 -0
- package/lib/cjs/utils/use/usePreventScroll.js.map +1 -0
- package/lib/cjs/utils/useCssVariable.js +55 -0
- package/lib/cjs/utils/useCssVariable.js.map +1 -0
- package/lib/cjs/utils/zIndexStacking.js +48 -0
- package/lib/cjs/utils/zIndexStacking.js.map +1 -0
- package/lib/core-types/Component.js +59 -0
- package/lib/core-types/Component.js.map +1 -0
- package/lib/core-types/Component.mjs +54 -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 +3 -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 +10 -0
- package/lib/core-types/symbols.mjs.map +1 -0
- package/lib/enhancement/Children.js +119 -0
- package/lib/enhancement/Children.js.map +1 -0
- package/lib/enhancement/Children.mjs +111 -0
- package/lib/enhancement/Children.mjs.map +1 -0
- package/lib/enhancement/Root.js +78 -0
- package/lib/enhancement/Root.js.map +1 -0
- package/lib/enhancement/Root.mjs +70 -0
- package/lib/enhancement/Root.mjs.map +1 -0
- package/lib/enhancement/bindHandler.js +54 -0
- package/lib/enhancement/bindHandler.js.map +1 -0
- package/lib/enhancement/bindHandler.mjs +47 -0
- package/lib/enhancement/bindHandler.mjs.map +1 -0
- package/lib/enhancement/dataName.js +20 -0
- package/lib/enhancement/dataName.js.map +1 -0
- package/lib/enhancement/dataName.mjs +12 -0
- package/lib/enhancement/dataName.mjs.map +1 -0
- package/lib/enhancement/enhance.js +22 -0
- package/lib/enhancement/enhance.js.map +1 -0
- package/lib/enhancement/enhance.mjs +15 -0
- package/lib/enhancement/enhance.mjs.map +1 -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.js +97 -0
- package/lib/enhancement/hoistProps.js.map +1 -0
- package/lib/enhancement/hoistProps.mjs +88 -0
- package/lib/enhancement/hoistProps.mjs.map +1 -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.js +23 -0
- package/lib/enhancement/inheritedName.js.map +1 -0
- package/lib/enhancement/inheritedName.mjs +15 -0
- package/lib/enhancement/inheritedName.mjs.map +1 -0
- package/lib/enhancement/staticChildren.js +135 -0
- package/lib/enhancement/staticChildren.js.map +1 -0
- package/lib/enhancement/staticChildren.mjs +123 -0
- package/lib/enhancement/staticChildren.mjs.map +1 -0
- package/lib/enhancement/style.js +60 -0
- package/lib/enhancement/style.js.map +1 -0
- package/lib/enhancement/style.mjs +51 -0
- package/lib/enhancement/style.mjs.map +1 -0
- package/lib/enhancement/uncontrolledProps.js +131 -0
- package/lib/enhancement/uncontrolledProps.js.map +1 -0
- package/lib/enhancement/uncontrolledProps.mjs +123 -0
- package/lib/enhancement/uncontrolledProps.mjs.map +1 -0
- package/lib/es6/LastInteractionType.js +49 -0
- package/lib/es6/LastInteractionType.js.map +1 -0
- package/lib/es6/core-types/Component.js +54 -0
- package/lib/es6/core-types/Component.js.map +1 -0
- package/lib/es6/core-types/UnknownProperties.js +2 -0
- package/lib/es6/core-types/UnknownProperties.js.map +1 -0
- package/lib/es6/core-types/reshadow.d.js +2 -0
- package/lib/es6/core-types/reshadow.d.js.map +1 -0
- package/lib/es6/core-types/symbols.js +10 -0
- package/lib/es6/core-types/symbols.js.map +1 -0
- package/lib/es6/coreFactory.js +343 -0
- package/lib/es6/coreFactory.js.map +1 -0
- package/lib/es6/enhancement/Children.js +111 -0
- package/lib/es6/enhancement/Children.js.map +1 -0
- package/lib/es6/enhancement/Root.js +70 -0
- package/lib/es6/enhancement/Root.js.map +1 -0
- package/lib/es6/enhancement/bindHandler.js +47 -0
- package/lib/es6/enhancement/bindHandler.js.map +1 -0
- package/lib/es6/enhancement/dataName.js +12 -0
- package/lib/es6/enhancement/dataName.js.map +1 -0
- package/lib/es6/enhancement/enhance.js +15 -0
- package/lib/es6/enhancement/enhance.js.map +1 -0
- package/lib/es6/enhancement/functionDefaultProps.js +29 -0
- package/lib/es6/enhancement/functionDefaultProps.js.map +1 -0
- package/lib/es6/enhancement/hoistProps.js +88 -0
- package/lib/es6/enhancement/hoistProps.js.map +1 -0
- package/lib/es6/enhancement/i18n.js +20 -0
- package/lib/es6/enhancement/i18n.js.map +1 -0
- package/lib/es6/enhancement/inheritedName.js +15 -0
- package/lib/es6/enhancement/inheritedName.js.map +1 -0
- package/lib/es6/enhancement/staticChildren.js +123 -0
- package/lib/es6/enhancement/staticChildren.js.map +1 -0
- package/lib/es6/enhancement/style.js +51 -0
- package/lib/es6/enhancement/style.js.map +1 -0
- package/lib/es6/enhancement/uncontrolledProps.js +123 -0
- package/lib/es6/enhancement/uncontrolledProps.js.map +1 -0
- package/lib/es6/index.js +8 -3
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/register.js +29 -0
- package/lib/es6/register.js.map +1 -0
- package/lib/es6/styled/index.js +6 -0
- package/lib/es6/styled/index.js.map +1 -0
- package/lib/es6/styled/reshadow-core.js +243 -0
- package/lib/es6/styled/reshadow-core.js.map +1 -0
- package/lib/es6/styled/sstyled.js +142 -0
- package/lib/es6/styled/sstyled.js.map +1 -0
- package/lib/es6/theme/dark.json +2506 -0
- package/lib/es6/theme/exclude-tokens.json +10 -0
- package/lib/es6/theme/light.json +2584 -0
- package/lib/es6/theme/processor.js +307 -0
- package/lib/es6/theme/processor.js.map +1 -0
- package/lib/es6/theme/themes/auto.css +1465 -0
- package/lib/es6/theme/themes/dark.css +723 -0
- package/lib/es6/theme/themes/dark.js +378 -0
- package/lib/es6/theme/themes/dark.js.map +1 -0
- package/lib/es6/theme/themes/default.css +742 -0
- package/lib/es6/theme/themes/default.js +387 -0
- package/lib/es6/theme/themes/default.js.map +1 -0
- package/lib/es6/theme/themes/light.css +742 -0
- package/lib/es6/theme/themes/light.js +387 -0
- package/lib/es6/theme/themes/light.js.map +1 -0
- package/lib/es6/theme/utils.js +286 -0
- package/lib/es6/theme/utils.js.map +1 -0
- package/lib/es6/utils/CSSinJS.js +28 -0
- package/lib/es6/utils/CSSinJS.js.map +1 -0
- package/lib/es6/utils/ScreenReaderOnly.js +24 -0
- package/lib/es6/utils/ScreenReaderOnly.js.map +1 -0
- package/lib/es6/utils/ThemeProvider.js +71 -0
- package/lib/es6/utils/ThemeProvider.js.map +1 -0
- package/lib/es6/utils/addonText.js +11 -0
- package/lib/es6/utils/addonText.js.map +1 -0
- package/lib/es6/utils/addonTextChildren.js +37 -0
- package/lib/es6/utils/addonTextChildren.js.map +1 -0
- package/lib/es6/utils/ariaProps.js +16 -0
- package/lib/es6/utils/ariaProps.js.map +1 -0
- package/lib/es6/utils/assignProps.js +84 -0
- package/lib/es6/utils/assignProps.js.map +1 -0
- package/lib/es6/utils/canUseDOM.js +4 -0
- package/lib/es6/utils/canUseDOM.js.map +1 -0
- package/lib/es6/utils/capitalizeFirstLetter.js +4 -0
- package/lib/es6/utils/capitalizeFirstLetter.js.map +1 -0
- package/lib/es6/utils/color.js +196 -0
- package/lib/es6/utils/color.js.map +1 -0
- package/lib/es6/utils/compose.js +15 -0
- package/lib/es6/utils/compose.js.map +1 -0
- package/lib/es6/utils/createHoc.js +46 -0
- package/lib/es6/utils/createHoc.js.map +1 -0
- package/lib/es6/utils/createUUID.js +9 -0
- package/lib/es6/utils/createUUID.js.map +1 -0
- package/lib/es6/utils/cssToIntDefault.js +16 -0
- package/lib/es6/utils/cssToIntDefault.js.map +1 -0
- package/lib/es6/utils/enhances/WithAutoFocus.js +67 -0
- package/lib/es6/utils/enhances/WithAutoFocus.js.map +1 -0
- package/lib/es6/utils/enhances/WithCSS.js +79 -0
- package/lib/es6/utils/enhances/WithCSS.js.map +1 -0
- package/lib/es6/utils/enhances/WithI18n.js +83 -0
- package/lib/es6/utils/enhances/WithI18n.js.map +1 -0
- package/lib/es6/utils/enhances/WithKeyboardFocus.js +84 -0
- package/lib/es6/utils/enhances/WithKeyboardFocus.js.map +1 -0
- package/lib/es6/utils/enhances/WithRef.js +18 -0
- package/lib/es6/utils/enhances/WithRef.js.map +1 -0
- package/lib/es6/utils/enhances/a11yEnhance.js +66 -0
- package/lib/es6/utils/enhances/a11yEnhance.js.map +1 -0
- package/lib/es6/utils/enhances/animatedSizeEnhance.js +90 -0
- package/lib/es6/utils/enhances/animatedSizeEnhance.js.map +1 -0
- package/lib/es6/utils/enhances/autoFocusEnhance.js +38 -0
- package/lib/es6/utils/enhances/autoFocusEnhance.js.map +1 -0
- package/lib/es6/utils/enhances/contextEnhance.js +14 -0
- package/lib/es6/utils/enhances/contextEnhance.js.map +1 -0
- package/lib/es6/utils/enhances/i18nEnhance.js +92 -0
- package/lib/es6/utils/enhances/i18nEnhance.js.map +1 -0
- package/lib/es6/utils/enhances/keyboardFocusEnhance.js +57 -0
- package/lib/es6/utils/enhances/keyboardFocusEnhance.js.map +1 -0
- package/lib/es6/utils/enhances/resolveColorEnhance.js +17 -0
- package/lib/es6/utils/enhances/resolveColorEnhance.js.map +1 -0
- package/lib/es6/utils/eventEmitter.js +34 -0
- package/lib/es6/utils/eventEmitter.js.map +1 -0
- package/lib/es6/utils/findComponent.js +95 -0
- package/lib/es6/utils/findComponent.js.map +1 -0
- package/lib/es6/utils/fire.js +15 -0
- package/lib/es6/utils/fire.js.map +1 -0
- package/lib/es6/utils/focus-lock/focusBorders.js +62 -0
- package/lib/es6/utils/focus-lock/focusBorders.js.map +1 -0
- package/lib/es6/utils/focus-lock/getFocusableIn.js +19 -0
- package/lib/es6/utils/focus-lock/getFocusableIn.js.map +1 -0
- package/lib/es6/utils/focus-lock/isFocusInside.js +9 -0
- package/lib/es6/utils/focus-lock/isFocusInside.js.map +1 -0
- package/lib/es6/utils/focus-lock/isFocusable.js +43 -0
- package/lib/es6/utils/focus-lock/isFocusable.js.map +1 -0
- package/lib/es6/utils/focus-lock/setFocus.js +55 -0
- package/lib/es6/utils/focus-lock/setFocus.js.map +1 -0
- package/lib/es6/utils/getAccessibleName.js +49 -0
- package/lib/es6/utils/getAccessibleName.js.map +1 -0
- package/lib/es6/utils/getDisplayName.js +4 -0
- package/lib/es6/utils/getDisplayName.js.map +1 -0
- package/lib/es6/utils/getEventTarget.js +45 -0
- package/lib/es6/utils/getEventTarget.js.map +1 -0
- package/lib/es6/utils/getOriginChildren.js +10 -0
- package/lib/es6/utils/getOriginChildren.js.map +1 -0
- package/lib/es6/utils/getRandomInt.js +5 -0
- package/lib/es6/utils/getRandomInt.js.map +1 -0
- package/lib/es6/utils/getValue.js +10 -0
- package/lib/es6/utils/getValue.js.map +1 -0
- package/lib/es6/utils/hasLabels.js +39 -0
- package/lib/es6/utils/hasLabels.js.map +1 -0
- package/lib/es6/utils/hasParent.js +7 -0
- package/lib/es6/utils/hasParent.js.map +1 -0
- package/lib/es6/utils/if.js +9 -0
- package/lib/es6/utils/if.js.map +1 -0
- package/lib/es6/utils/ifChildren.js +10 -0
- package/lib/es6/utils/ifChildren.js.map +1 -0
- package/lib/es6/utils/injectStyle.js +41 -0
- package/lib/es6/utils/injectStyle.js.map +1 -0
- package/lib/es6/utils/inputProps.js +14 -0
- package/lib/es6/utils/inputProps.js.map +1 -0
- package/lib/es6/utils/isNode.js +21 -0
- package/lib/es6/utils/isNode.js.map +1 -0
- package/lib/es6/utils/isPromise.js +4 -0
- package/lib/es6/utils/isPromise.js.map +1 -0
- package/lib/es6/utils/isRetina.js +9 -0
- package/lib/es6/utils/isRetina.js.map +1 -0
- package/lib/es6/utils/logger.js +32 -0
- package/lib/es6/utils/logger.js.map +1 -0
- package/lib/es6/utils/numericChecker.js +27 -0
- package/lib/es6/utils/numericChecker.js.map +1 -0
- package/lib/es6/utils/ownerDocument.js +4 -0
- package/lib/es6/utils/ownerDocument.js.map +1 -0
- package/lib/es6/utils/pick.js +13 -0
- package/lib/es6/utils/pick.js.map +1 -0
- package/lib/es6/utils/propsForElement.js +50 -0
- package/lib/es6/utils/propsForElement.js.map +1 -0
- package/lib/es6/utils/rafTrottle.js +26 -0
- package/lib/es6/utils/rafTrottle.js.map +1 -0
- package/lib/es6/utils/reactToText.js +26 -0
- package/lib/es6/utils/reactToText.js.map +1 -0
- package/lib/es6/utils/ref.js +83 -0
- package/lib/es6/utils/ref.js.map +1 -0
- package/lib/es6/utils/setRef.js +3 -0
- package/lib/es6/utils/setRef.js.map +1 -0
- package/lib/es6/utils/syncScroll.js +54 -0
- package/lib/es6/utils/syncScroll.js.map +1 -0
- package/lib/es6/utils/uncontroll.js +38 -0
- package/lib/es6/utils/uncontroll.js.map +1 -0
- package/lib/es6/utils/uniqueID.js +33 -0
- package/lib/es6/utils/uniqueID.js.map +1 -0
- package/lib/es6/utils/use/useColorResolver.js +200 -0
- package/lib/es6/utils/use/useColorResolver.js.map +1 -0
- package/lib/es6/utils/use/useCss.js +12 -0
- package/lib/es6/utils/use/useCss.js.map +1 -0
- package/lib/es6/utils/use/useEnhancedEffect.js +5 -0
- package/lib/es6/utils/use/useEnhancedEffect.js.map +1 -0
- package/lib/es6/utils/use/useEventCallback.js +19 -0
- package/lib/es6/utils/use/useEventCallback.js.map +1 -0
- package/lib/es6/utils/use/useEventListener.js +25 -0
- package/lib/es6/utils/use/useEventListener.js.map +1 -0
- package/lib/es6/utils/use/useFocusLock.js +266 -0
- package/lib/es6/utils/use/useFocusLock.js.map +1 -0
- package/lib/es6/utils/use/usePreventScroll.js +70 -0
- package/lib/es6/utils/use/usePreventScroll.js.map +1 -0
- package/lib/es6/utils/useCssVariable.js +46 -0
- package/lib/es6/utils/useCssVariable.js.map +1 -0
- package/lib/es6/utils/zIndexStacking.js +38 -0
- package/lib/es6/utils/zIndexStacking.js.map +1 -0
- package/lib/esm/LastInteractionType.mjs +42 -0
- package/lib/esm/core-types/Component.mjs +40 -0
- package/lib/esm/core-types/symbols.mjs +12 -0
- package/lib/esm/coreFactory.mjs +235 -0
- package/lib/esm/enhancement/Children.mjs +72 -0
- package/lib/esm/enhancement/Root.mjs +43 -0
- package/lib/esm/enhancement/bindHandler.mjs +44 -0
- package/lib/esm/enhancement/dataName.mjs +13 -0
- package/lib/esm/enhancement/enhance.mjs +16 -0
- package/lib/esm/enhancement/functionDefaultProps.mjs +19 -0
- package/lib/esm/enhancement/hoistProps.mjs +58 -0
- package/lib/esm/enhancement/i18n.mjs +18 -0
- package/lib/esm/enhancement/inheritedName.mjs +16 -0
- package/lib/esm/enhancement/staticChildren.mjs +78 -0
- package/lib/esm/enhancement/style.mjs +38 -0
- package/lib/esm/enhancement/uncontrolledProps.mjs +88 -0
- package/lib/esm/index.mjs +21 -4
- package/lib/esm/register.mjs +24 -0
- package/lib/esm/styled/reshadow-core.mjs +16 -0
- package/lib/esm/styled/sstyled.mjs +78 -0
- package/lib/esm/utils/assignProps.mjs +42 -0
- package/lib/esm/utils/canUseDOM.mjs +6 -0
- package/lib/esm/utils/capitalizeFirstLetter.mjs +6 -0
- package/lib/esm/utils/enhances/WithI18n.mjs +48 -0
- package/lib/esm/utils/logger.mjs +27 -0
- package/lib/esm/utils/pick.mjs +10 -0
- package/lib/esm/utils/ref.mjs +34 -0
- package/lib/esm/utils/use/useEnhancedEffect.mjs +6 -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 +29 -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 +6 -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 +243 -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 +142 -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.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.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.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.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/types/LastInteractionType.d.ts +11 -0
- package/lib/types/core-types/Component.d.ts +189 -0
- package/lib/types/core-types/UnknownProperties.d.ts +3 -0
- package/lib/types/core-types/symbols.d.ts +9 -0
- package/lib/types/coreFactory.d.ts +27 -0
- package/lib/types/enhancement/Children.d.ts +5 -0
- package/lib/types/enhancement/Root.d.ts +6 -0
- package/lib/types/enhancement/bindHandler.d.ts +5 -0
- package/lib/types/enhancement/dataName.d.ts +4 -0
- package/lib/types/enhancement/enhance.d.ts +5 -0
- package/lib/types/enhancement/functionDefaultProps.d.ts +8 -0
- package/lib/types/enhancement/hoistProps.d.ts +10 -0
- package/lib/types/enhancement/i18n.d.ts +4 -0
- package/lib/types/enhancement/inheritedName.d.ts +8 -0
- package/lib/types/enhancement/staticChildren.d.ts +13 -0
- package/lib/types/enhancement/style.d.ts +9 -0
- package/lib/types/enhancement/uncontrolledProps.d.ts +7 -0
- package/lib/types/index.d.ts +11 -3
- package/lib/types/register.d.ts +8 -0
- package/lib/types/styled/index.d.ts +11 -0
- package/lib/types/styled/reshadow-core.d.ts +37 -0
- package/lib/types/styled/sstyled.d.ts +17 -0
- package/lib/types/theme/processor.d.ts +1 -0
- package/lib/types/theme/themes/dark.d.ts +378 -0
- package/lib/types/theme/themes/default.d.ts +387 -0
- package/lib/types/theme/themes/light.d.ts +387 -0
- package/lib/types/theme/utils.d.ts +52 -0
- package/lib/types/utils/CSSinJS.d.ts +5 -0
- package/lib/types/utils/ScreenReaderOnly.d.ts +8 -0
- package/lib/types/utils/ThemeProvider.d.ts +15 -0
- package/lib/types/utils/addonText.d.ts +2 -0
- package/lib/types/utils/addonTextChildren.d.ts +3 -0
- package/lib/types/utils/ariaProps.d.ts +12 -0
- package/lib/types/utils/assignProps.d.ts +11 -0
- package/lib/types/utils/canUseDOM.d.ts +1 -0
- package/lib/types/utils/capitalizeFirstLetter.d.ts +1 -0
- package/lib/types/utils/color.d.ts +5 -0
- package/lib/types/utils/compose.d.ts +1 -0
- package/lib/types/utils/createHoc.d.ts +3 -0
- package/lib/types/utils/createUUID.d.ts +1 -0
- package/lib/types/utils/cssToIntDefault.d.ts +8 -0
- package/lib/types/utils/enhances/WithAutoFocus.d.ts +14 -0
- package/lib/types/utils/enhances/WithCSS.d.ts +41 -0
- package/lib/types/utils/enhances/WithI18n.d.ts +43 -0
- package/lib/types/utils/enhances/WithKeyboardFocus.d.ts +45 -0
- package/lib/types/utils/enhances/WithRef.d.ts +3 -0
- package/lib/types/utils/enhances/a11yEnhance.d.ts +10 -0
- package/lib/types/utils/enhances/animatedSizeEnhance.d.ts +12 -0
- package/lib/types/utils/enhances/autoFocusEnhance.d.ts +10 -0
- package/lib/types/utils/enhances/contextEnhance.d.ts +3 -0
- package/lib/types/utils/enhances/i18nEnhance.d.ts +25 -0
- package/lib/types/utils/enhances/keyboardFocusEnhance.d.ts +27 -0
- package/lib/types/utils/enhances/resolveColorEnhance.d.ts +2 -0
- package/lib/types/utils/eventEmitter.d.ts +9 -0
- package/lib/types/utils/findComponent.d.ts +12 -0
- package/lib/types/utils/fire.d.ts +2 -0
- package/lib/types/utils/focus-lock/focusBorders.d.ts +4 -0
- package/lib/types/utils/focus-lock/getFocusableIn.d.ts +1 -0
- package/lib/types/utils/focus-lock/isFocusInside.d.ts +1 -0
- package/lib/types/utils/focus-lock/isFocusable.d.ts +1 -0
- package/lib/types/utils/focus-lock/setFocus.d.ts +1 -0
- package/lib/types/utils/getAccessibleName.d.ts +1 -0
- package/lib/types/utils/getDisplayName.d.ts +2 -0
- package/lib/types/utils/getEventTarget.d.ts +1 -0
- package/lib/types/utils/getOriginChildren.d.ts +2 -0
- package/lib/types/utils/getRandomInt.d.ts +1 -0
- package/lib/types/utils/getValue.d.ts +1 -0
- package/lib/types/utils/hasLabels.d.ts +7 -0
- package/lib/types/utils/hasParent.d.ts +1 -0
- package/lib/types/utils/if.d.ts +11 -0
- package/lib/types/utils/ifChildren.d.ts +8 -0
- package/lib/types/utils/injectStyle.d.ts +2 -0
- package/lib/types/utils/inputProps.d.ts +2 -0
- package/lib/types/utils/isNode.d.ts +1 -0
- package/lib/types/utils/isPromise.d.ts +1 -0
- package/lib/types/utils/isRetina.d.ts +1 -0
- package/lib/types/utils/logger.d.ts +9 -0
- package/lib/types/utils/numericChecker.d.ts +5 -0
- package/lib/types/utils/ownerDocument.d.ts +1 -0
- package/lib/types/utils/pick.d.ts +1 -0
- package/lib/types/utils/propsForElement.d.ts +3 -0
- package/lib/types/utils/rafTrottle.d.ts +2 -0
- package/lib/types/utils/reactToText.d.ts +3 -0
- package/lib/types/utils/ref.d.ts +8 -0
- package/lib/types/utils/setRef.d.ts +2 -0
- package/lib/types/utils/syncScroll.d.ts +1 -0
- package/lib/types/utils/uncontroll.d.ts +4 -0
- package/lib/types/utils/uniqueID.d.ts +12 -0
- package/lib/types/utils/use/useColorResolver.d.ts +1 -0
- package/lib/types/utils/use/useCss.d.ts +4 -0
- package/lib/types/utils/use/useEnhancedEffect.d.ts +3 -0
- package/lib/types/utils/use/useEventCallback.d.ts +4 -0
- package/lib/types/utils/use/useEventListener.d.ts +2 -0
- package/lib/types/utils/use/useFocusLock.d.ts +10 -0
- package/lib/types/utils/use/usePreventScroll.d.ts +2 -0
- package/lib/types/utils/useCssVariable.d.ts +8 -0
- package/lib/types/utils/zIndexStacking.d.ts +8 -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 +84 -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 +4 -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 +4 -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 +46 -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 +83 -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 +92 -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 +4 -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/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 +32 -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 +13 -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 +8 -0
- package/lib/utils/ref.js +95 -0
- package/lib/utils/ref.js.map +1 -0
- package/lib/utils/ref.mjs +83 -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 +5 -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 +269 -7
- package/tsconfig-utils.json +4 -0
- package/vite.config.ts +15 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
+
import _get from "@babel/runtime/helpers/get";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
7
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
8
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
10
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
12
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
13
|
+
var _excluded = ["forwardRef"],
|
|
14
|
+
_excluded2 = ["forwardRef", "__WRAPPER_PROPS_BIND__"],
|
|
15
|
+
_excluded3 = ["ref"];
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
18
|
+
import { useForkRef } from './utils/ref';
|
|
19
|
+
import useEnhancedEffect from './utils/use/useEnhancedEffect';
|
|
20
|
+
import _assignProps from './utils/assignProps';
|
|
21
|
+
import { Component } from './core-types/Component';
|
|
22
|
+
import childrenEnhancement from './enhancement/Children';
|
|
23
|
+
import rootEnhancement from './enhancement/Root';
|
|
24
|
+
import uncontrolledPropsEnhancement from './enhancement/uncontrolledProps';
|
|
25
|
+
import functionDefaultPropsEnhancement from './enhancement/functionDefaultProps';
|
|
26
|
+
import staticChildrenEnhancement, { STATIC_COMPONENT, ROOT_COMPONENT, getterMethodNameByDisplayName } from './enhancement/staticChildren';
|
|
27
|
+
import inheritedNameEnhancement from './enhancement/inheritedName';
|
|
28
|
+
import hoistPropsEnhancement from './enhancement/hoistProps';
|
|
29
|
+
import dataNameEnhancement from './enhancement/dataName';
|
|
30
|
+
import enhanceEnhancement from './enhancement/enhance';
|
|
31
|
+
import styleEnhancement from './enhancement/style';
|
|
32
|
+
import bindHandlerEnhancement from './enhancement/bindHandler';
|
|
33
|
+
import i18nAppLocaleEnhance from './enhancement/i18n';
|
|
34
|
+
import { CORE_AS_PROPS, CORE_INIT, PARENT_COMPONENTS, CORE_INSTANCE, CORE_COMPONENT, CREATE_COMPONENT, CONTEXT_COMPONENT } from './core-types/symbols';
|
|
35
|
+
function isEmptyObject(obj) {
|
|
36
|
+
return Object.getOwnPropertyNames(obj).length === 0 && Object.getOwnPropertySymbols &&
|
|
37
|
+
// For IE 11
|
|
38
|
+
Object.getOwnPropertySymbols(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
|
|
39
|
+
}
|
|
40
|
+
function createGetField(enhancements, Component, isFunction) {
|
|
41
|
+
return function getField(key) {
|
|
42
|
+
return enhancements.filter(function (enhancement) {
|
|
43
|
+
if (!enhancement.condition) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return enhancement.condition(Component, isFunction);
|
|
47
|
+
}).reduce(function (acc, item) {
|
|
48
|
+
if (item[key]) {
|
|
49
|
+
acc.push(item[key]);
|
|
50
|
+
}
|
|
51
|
+
return acc;
|
|
52
|
+
}, []);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function createForwardWrapper(Component, wrapperProps, statics, isFunction) {
|
|
56
|
+
var RootComponent = Component[ROOT_COMPONENT];
|
|
57
|
+
var getterMethodName = getterMethodNameByDisplayName(Component === null || Component === void 0 ? void 0 : Component.displayName);
|
|
58
|
+
var getterMethod = RootComponent !== null && RootComponent !== void 0 && RootComponent.prototype ? RootComponent.prototype[getterMethodName] : undefined;
|
|
59
|
+
var useGetterIndex = (getterMethod === null || getterMethod === void 0 ? void 0 : getterMethod.length) >= 2;
|
|
60
|
+
function WrapperForwardRefWithBind(_ref, ref) {
|
|
61
|
+
var _ref$forwardRef = _ref.forwardRef,
|
|
62
|
+
forwardRef = _ref$forwardRef === void 0 ? null : _ref$forwardRef,
|
|
63
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
64
|
+
return /*#__PURE__*/React.createElement(BindingWrapper, _extends({}, other, {
|
|
65
|
+
forwardRef: useForkRef(ref, forwardRef)
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
function WrapperForwardRef(_ref2, ref) {
|
|
69
|
+
var _ref2$forwardRef = _ref2.forwardRef,
|
|
70
|
+
forwardRef = _ref2$forwardRef === void 0 ? null : _ref2$forwardRef,
|
|
71
|
+
__WRAPPER_PROPS_BIND__ = _ref2.__WRAPPER_PROPS_BIND__,
|
|
72
|
+
other = _objectWithoutProperties(_ref2, _excluded2);
|
|
73
|
+
var _reduce = (__WRAPPER_PROPS_BIND__ || wrapperProps).reduce(function (acc, enhancement) {
|
|
74
|
+
return enhancement(acc, WrapperComponent, isFunction);
|
|
75
|
+
}, other),
|
|
76
|
+
_reduce$ref = _reduce.ref,
|
|
77
|
+
enhancementRef = _reduce$ref === void 0 ? null : _reduce$ref,
|
|
78
|
+
props = _objectWithoutProperties(_reduce, _excluded3);
|
|
79
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
80
|
+
forwardRef: useForkRef(enhancementRef, ref, forwardRef)
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
var BindingWrapper = /*#__PURE__*/function (_React$Component) {
|
|
84
|
+
_inherits(BindingWrapper, _React$Component);
|
|
85
|
+
var _super = _createSuper(BindingWrapper);
|
|
86
|
+
function BindingWrapper() {
|
|
87
|
+
var _this;
|
|
88
|
+
_classCallCheck(this, BindingWrapper);
|
|
89
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
90
|
+
args[_key] = arguments[_key];
|
|
91
|
+
}
|
|
92
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
93
|
+
_defineProperty(_assertThisInitialized(_this), "index", -1);
|
|
94
|
+
return _this;
|
|
95
|
+
}
|
|
96
|
+
_createClass(BindingWrapper, [{
|
|
97
|
+
key: "render",
|
|
98
|
+
value: function render() {
|
|
99
|
+
var _this2 = this;
|
|
100
|
+
return /*#__PURE__*/React.createElement(WrapperForwardRef, _extends({}, this.props, {
|
|
101
|
+
__WRAPPER_PROPS_BIND__: wrapperProps.map(function (fn) {
|
|
102
|
+
return fn.bind(_this2);
|
|
103
|
+
})
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
}]);
|
|
107
|
+
return BindingWrapper;
|
|
108
|
+
}(React.Component);
|
|
109
|
+
var WrapperComponent = /*#__PURE__*/React.forwardRef(useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef);
|
|
110
|
+
hoistNonReactStatics(WrapperComponent, Component);
|
|
111
|
+
WrapperComponent.displayName = Component.displayName;
|
|
112
|
+
// TODO: defaultProps is only empty
|
|
113
|
+
WrapperComponent.defaultProps = Component.defaultProps;
|
|
114
|
+
// STATIC
|
|
115
|
+
statics.forEach(function (enhancement) {
|
|
116
|
+
return Object.assign(WrapperComponent, enhancement(WrapperComponent, Component, isFunction));
|
|
117
|
+
});
|
|
118
|
+
return WrapperComponent;
|
|
119
|
+
}
|
|
120
|
+
function wrapClass(OriginComponent, enhancements, Context) {
|
|
121
|
+
var getField = createGetField(enhancements, OriginComponent, false);
|
|
122
|
+
var inits = getField('init');
|
|
123
|
+
var props = getField('asProps');
|
|
124
|
+
var renders = getField('render');
|
|
125
|
+
var statics = getField('static');
|
|
126
|
+
var wrapperProps = getField('wrapperProps');
|
|
127
|
+
var contexts = getField('context');
|
|
128
|
+
var Component = /*#__PURE__*/function (_OriginComponent2) {
|
|
129
|
+
_inherits(Component, _OriginComponent2);
|
|
130
|
+
var _super2 = _createSuper(Component);
|
|
131
|
+
function Component(props, context) {
|
|
132
|
+
var _this3;
|
|
133
|
+
_classCallCheck(this, Component);
|
|
134
|
+
_this3 = _super2.call(this, props, context);
|
|
135
|
+
// INITS
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this3), CORE_AS_PROPS, null);
|
|
137
|
+
_defineProperty(_assertThisInitialized(_this3), CORE_INSTANCE, WrapperComponent);
|
|
138
|
+
_defineProperty(_assertThisInitialized(_this3), CORE_INIT, false);
|
|
139
|
+
inits.forEach(function (enhancement) {
|
|
140
|
+
return enhancement.call(_assertThisInitialized(_this3), props, WrapperComponent, false);
|
|
141
|
+
});
|
|
142
|
+
_this3[CORE_INIT] = true;
|
|
143
|
+
return _this3;
|
|
144
|
+
}
|
|
145
|
+
_createClass(Component, [{
|
|
146
|
+
key: "asProps",
|
|
147
|
+
get: function get() {
|
|
148
|
+
var _this4 = this;
|
|
149
|
+
// TODO if not production
|
|
150
|
+
if (!this[CORE_INIT]) {
|
|
151
|
+
throw new Error('Can not call asProps in constructor');
|
|
152
|
+
}
|
|
153
|
+
if (!this[CORE_AS_PROPS]) {
|
|
154
|
+
// PROPS
|
|
155
|
+
this[CORE_AS_PROPS] = props.reduce(function (acc, enhancement) {
|
|
156
|
+
return enhancement.call(_this4, acc, WrapperComponent, false);
|
|
157
|
+
}, this.props);
|
|
158
|
+
}
|
|
159
|
+
return this[CORE_AS_PROPS];
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "setContext",
|
|
163
|
+
value: function setContext() {
|
|
164
|
+
var _this5 = this;
|
|
165
|
+
var contextProps = _get(_getPrototypeOf(Component.prototype), "setContext", this) ? _get(_getPrototypeOf(Component.prototype), "setContext", this).call(this) : {};
|
|
166
|
+
// CONTEXT
|
|
167
|
+
return contexts.reduce(function (acc, enhancement) {
|
|
168
|
+
return enhancement.call(_this5, acc, WrapperComponent, false);
|
|
169
|
+
}, contextProps);
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
key: "render",
|
|
173
|
+
value: function render() {
|
|
174
|
+
var _this6 = this;
|
|
175
|
+
this[CORE_AS_PROPS] = null;
|
|
176
|
+
// TODO if not production
|
|
177
|
+
if (!_get(_getPrototypeOf(Component.prototype), "render", this)) {
|
|
178
|
+
throw new Error('Component `render` method is not defined');
|
|
179
|
+
}
|
|
180
|
+
var asProps = this.asProps;
|
|
181
|
+
var ctx = this.setContext();
|
|
182
|
+
// RENDER
|
|
183
|
+
var render = renders.reduce(function (acc, enhancement) {
|
|
184
|
+
return enhancement.call(_this6, acc, asProps, WrapperComponent, false);
|
|
185
|
+
}, _get(_getPrototypeOf(Component.prototype), "render", this).call(this));
|
|
186
|
+
if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
187
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
188
|
+
value: _objectSpread(_objectSpread({}, asProps), ctx)
|
|
189
|
+
}, render);
|
|
190
|
+
} else {
|
|
191
|
+
return render;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}]);
|
|
195
|
+
return Component;
|
|
196
|
+
}(OriginComponent);
|
|
197
|
+
var WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, false);
|
|
198
|
+
return WrapperComponent;
|
|
199
|
+
}
|
|
200
|
+
function wrapFunction(OriginComponent, enhancements, Context) {
|
|
201
|
+
var getField = createGetField(enhancements, OriginComponent, true);
|
|
202
|
+
var inits = getField('init');
|
|
203
|
+
var props = getField('asProps');
|
|
204
|
+
var renders = getField('render');
|
|
205
|
+
var statics = getField('static');
|
|
206
|
+
var wrapperProps = getField('wrapperProps');
|
|
207
|
+
var contexts = getField('context');
|
|
208
|
+
var Component = /*#__PURE__*/React.memo(function FunctionMemoComponent(other) {
|
|
209
|
+
var selfRef = React.useRef({});
|
|
210
|
+
var firstRender = React.useRef(true);
|
|
211
|
+
useEnhancedEffect(function () {
|
|
212
|
+
firstRender.current = false;
|
|
213
|
+
}, []);
|
|
214
|
+
if (firstRender.current) {
|
|
215
|
+
// INITS
|
|
216
|
+
inits.forEach(function (enhancement) {
|
|
217
|
+
return enhancement.call(selfRef.current, other, WrapperComponent, true);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
// PROPS
|
|
221
|
+
var asProps = props.reduce(function (acc, enhancement) {
|
|
222
|
+
return enhancement.call(selfRef.current, acc, WrapperComponent, true);
|
|
223
|
+
}, other);
|
|
224
|
+
// CONTEXT
|
|
225
|
+
var ctx = contexts.reduce(function (acc, enhancement) {
|
|
226
|
+
return enhancement.call(selfRef.current, acc, WrapperComponent, true);
|
|
227
|
+
}, {});
|
|
228
|
+
|
|
229
|
+
// RENDER
|
|
230
|
+
var render = renders.reduce(function (acc, enhancement) {
|
|
231
|
+
return enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true);
|
|
232
|
+
}, /*#__PURE__*/React.createElement(OriginComponent, asProps));
|
|
233
|
+
if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
234
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
235
|
+
value: _objectSpread(_objectSpread({}, asProps), ctx)
|
|
236
|
+
}, render);
|
|
237
|
+
} else {
|
|
238
|
+
return render;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
Object.assign(Component, OriginComponent);
|
|
242
|
+
var WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, true);
|
|
243
|
+
return WrapperComponent;
|
|
244
|
+
}
|
|
245
|
+
function wrapCore(OriginComponent, enhancements, Context) {
|
|
246
|
+
var Component = function Component(_ref3) {
|
|
247
|
+
var Root = _ref3.Root;
|
|
248
|
+
var defaultProps = OriginComponent.defaultProps || {};
|
|
249
|
+
return /*#__PURE__*/React.createElement(Root, _extends({}, defaultProps, {
|
|
250
|
+
render: OriginComponent
|
|
251
|
+
}));
|
|
252
|
+
};
|
|
253
|
+
hoistNonReactStatics(Component, OriginComponent);
|
|
254
|
+
Component.displayName = OriginComponent.displayName;
|
|
255
|
+
return wrapFunction(Component, enhancements, Context);
|
|
256
|
+
}
|
|
257
|
+
function createComposeComponent(OriginComponent, Context, enhancements) {
|
|
258
|
+
if (React.PureComponent.isPrototypeOf(OriginComponent) || React.Component.isPrototypeOf(OriginComponent)) {
|
|
259
|
+
if (OriginComponent.prototype instanceof Component) {
|
|
260
|
+
return wrapClass(OriginComponent, enhancements, Context);
|
|
261
|
+
} else {
|
|
262
|
+
throw new Error('Must inherit from our component');
|
|
263
|
+
}
|
|
264
|
+
} else if (typeof OriginComponent === 'function') {
|
|
265
|
+
return wrapFunction(OriginComponent, enhancements, Context);
|
|
266
|
+
} else if (OriginComponent[CORE_COMPONENT]) {
|
|
267
|
+
return wrapCore(OriginComponent, enhancements, Context);
|
|
268
|
+
} else {
|
|
269
|
+
throw new Error('Must be a React component');
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export function assignProps(p1, p2) {
|
|
273
|
+
return _assignProps(p2, p1);
|
|
274
|
+
}
|
|
275
|
+
function createComponent(OriginComponent) {
|
|
276
|
+
var childComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
277
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
278
|
+
var _options$context = options.context,
|
|
279
|
+
context = _options$context === void 0 ? /*#__PURE__*/React.createContext({}) : _options$context,
|
|
280
|
+
_options$parent = options.parent,
|
|
281
|
+
parent = _options$parent === void 0 ? [] : _options$parent,
|
|
282
|
+
_options$enhancements = options.enhancements,
|
|
283
|
+
enhancements = _options$enhancements === void 0 ? [] : _options$enhancements;
|
|
284
|
+
var parents = Array.isArray(parent) ? parent : [parent];
|
|
285
|
+
if (parents.length) {
|
|
286
|
+
var wholeFamily = parents.reduce(function (acc, parent) {
|
|
287
|
+
if (parent[PARENT_COMPONENTS]) {
|
|
288
|
+
acc = [].concat(_toConsumableArray(parent[PARENT_COMPONENTS]), _toConsumableArray(acc));
|
|
289
|
+
}
|
|
290
|
+
return acc;
|
|
291
|
+
}, parents);
|
|
292
|
+
OriginComponent[PARENT_COMPONENTS] = wholeFamily;
|
|
293
|
+
parents = wholeFamily;
|
|
294
|
+
}
|
|
295
|
+
if (OriginComponent[CORE_COMPONENT]) {
|
|
296
|
+
parents.push(OriginComponent);
|
|
297
|
+
}
|
|
298
|
+
var Component = createComposeComponent(OriginComponent, context, [].concat(_toConsumableArray(enhancements.map(function (f) {
|
|
299
|
+
return f(context, parents, createComponent, childComponents);
|
|
300
|
+
})), [i18nAppLocaleEnhance(), bindHandlerEnhancement(), childrenEnhancement(context, parents),
|
|
301
|
+
// root must be under the children
|
|
302
|
+
rootEnhancement(), uncontrolledPropsEnhancement(), staticChildrenEnhancement(childComponents, createComponent, {
|
|
303
|
+
context: context,
|
|
304
|
+
parent: parent,
|
|
305
|
+
enhancements: enhancements
|
|
306
|
+
}),
|
|
307
|
+
// functionDefaultProps must be under the staticChild
|
|
308
|
+
functionDefaultPropsEnhancement(),
|
|
309
|
+
// inheritedName must be under the staticChild
|
|
310
|
+
inheritedNameEnhancement(),
|
|
311
|
+
// dataName must be under the staticChild
|
|
312
|
+
dataNameEnhancement(),
|
|
313
|
+
// enhanceEnhancement must be under the functionDefaultPropsEnhancement
|
|
314
|
+
enhanceEnhancement(), styleEnhancement(childComponents, context),
|
|
315
|
+
// must be the last one so any properties can be raised
|
|
316
|
+
hoistPropsEnhancement(childComponents, context)]));
|
|
317
|
+
Component[CONTEXT_COMPONENT] = context;
|
|
318
|
+
Component._______childrenComponents = childComponents;
|
|
319
|
+
Component[CREATE_COMPONENT] = function () {
|
|
320
|
+
var _OriginComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : OriginComponent;
|
|
321
|
+
var _childComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : childComponents;
|
|
322
|
+
var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : options;
|
|
323
|
+
return createComponent(_OriginComponent, _childComponents, _options);
|
|
324
|
+
};
|
|
325
|
+
Component[CORE_COMPONENT] = true;
|
|
326
|
+
return Component;
|
|
327
|
+
}
|
|
328
|
+
function createBaseComponent(OriginComponent) {
|
|
329
|
+
var Component = null;
|
|
330
|
+
if (!React.PureComponent.isPrototypeOf(OriginComponent) && !React.Component.isPrototypeOf(OriginComponent) && typeof OriginComponent === 'function') {
|
|
331
|
+
Component = /*#__PURE__*/React.forwardRef(OriginComponent);
|
|
332
|
+
Component.displayName = OriginComponent.displayName;
|
|
333
|
+
Component.defaultProps = _objectSpread({
|
|
334
|
+
'data-ui-name': OriginComponent.displayName
|
|
335
|
+
}, OriginComponent.defaultProps);
|
|
336
|
+
Component[CORE_COMPONENT] = true;
|
|
337
|
+
} else {
|
|
338
|
+
throw new Error('createBaseComponent accepts only functional component');
|
|
339
|
+
}
|
|
340
|
+
return Component;
|
|
341
|
+
}
|
|
342
|
+
export { createComponent, createBaseComponent };
|
|
343
|
+
//# sourceMappingURL=coreFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreFactory.js","names":["React","hoistNonReactStatics","useForkRef","useEnhancedEffect","_assignProps","Component","childrenEnhancement","rootEnhancement","uncontrolledPropsEnhancement","functionDefaultPropsEnhancement","staticChildrenEnhancement","STATIC_COMPONENT","ROOT_COMPONENT","getterMethodNameByDisplayName","inheritedNameEnhancement","hoistPropsEnhancement","dataNameEnhancement","enhanceEnhancement","styleEnhancement","bindHandlerEnhancement","i18nAppLocaleEnhance","CORE_AS_PROPS","CORE_INIT","PARENT_COMPONENTS","CORE_INSTANCE","CORE_COMPONENT","CREATE_COMPONENT","CONTEXT_COMPONENT","isEmptyObject","obj","Object","getOwnPropertyNames","length","getOwnPropertySymbols","getPrototypeOf","prototype","createGetField","enhancements","isFunction","getField","key","filter","enhancement","condition","reduce","acc","item","push","createForwardWrapper","wrapperProps","statics","RootComponent","getterMethodName","displayName","getterMethod","undefined","useGetterIndex","WrapperForwardRefWithBind","_ref","ref","_ref$forwardRef","forwardRef","other","_objectWithoutProperties","_excluded","createElement","BindingWrapper","_extends","WrapperForwardRef","_ref2","_ref2$forwardRef","__WRAPPER_PROPS_BIND__","_excluded2","_reduce","WrapperComponent","_reduce$ref","enhancementRef","props","_excluded3","_React$Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","value","render","_this2","map","fn","bind","defaultProps","forEach","assign","wrapClass","OriginComponent","Context","inits","renders","contexts","_OriginComponent2","_super2","context","_this3","get","_this4","Error","setContext","_this5","contextProps","_get","_getPrototypeOf","_this6","asProps","ctx","Provider","_objectSpread","wrapFunction","memo","FunctionMemoComponent","selfRef","useRef","firstRender","current","wrapCore","_ref3","Root","createComposeComponent","PureComponent","isPrototypeOf","assignProps","p1","p2","createComponent","childComponents","options","_options$context","createContext","_options$parent","parent","_options$enhancements","parents","isArray","wholeFamily","_toConsumableArray","f","_______childrenComponents","_OriginComponent","_childComponents","_options","createBaseComponent"],"sources":["../../src/coreFactory.tsx"],"sourcesContent":["import React, { ForwardRefExoticComponent, RefAttributes } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { useForkRef } from './utils/ref';\nimport useEnhancedEffect from './utils/use/useEnhancedEffect';\nimport _assignProps from './utils/assignProps';\n\nimport { Component, PropsWithRenderFnChildren } from './core-types/Component';\n\nimport childrenEnhancement from './enhancement/Children';\nimport rootEnhancement from './enhancement/Root';\nimport uncontrolledPropsEnhancement from './enhancement/uncontrolledProps';\nimport functionDefaultPropsEnhancement from './enhancement/functionDefaultProps';\nimport staticChildrenEnhancement, {\n STATIC_COMPONENT,\n ROOT_COMPONENT,\n getterMethodNameByDisplayName,\n} from './enhancement/staticChildren';\nimport inheritedNameEnhancement from './enhancement/inheritedName';\nimport hoistPropsEnhancement from './enhancement/hoistProps';\nimport dataNameEnhancement from './enhancement/dataName';\nimport enhanceEnhancement from './enhancement/enhance';\nimport styleEnhancement from './enhancement/style';\nimport bindHandlerEnhancement from './enhancement/bindHandler';\nimport i18nAppLocaleEnhance from './enhancement/i18n';\nimport {\n CORE_AS_PROPS,\n CORE_INIT,\n PARENT_COMPONENTS,\n CORE_INSTANCE,\n CORE_COMPONENT,\n CREATE_COMPONENT,\n CONTEXT_COMPONENT,\n CHILDREN_COMPONENT,\n INHERITED_NAME,\n} from './core-types/symbols';\n\nfunction isEmptyObject(obj: any) {\n return (\n Object.getOwnPropertyNames(obj).length === 0 &&\n Object.getOwnPropertySymbols && // For IE 11\n Object.getOwnPropertySymbols(obj).length === 0 &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n}\n\nfunction createGetField(enhancements: any, Component: any, isFunction: boolean) {\n return function getField(key: string) {\n return enhancements\n .filter((enhancement: any) => {\n if (!enhancement.condition) {\n return true;\n }\n return enhancement.condition(Component, isFunction);\n })\n .reduce((acc: any, item: any) => {\n if (item[key]) {\n acc.push(item[key]);\n }\n return acc;\n }, []);\n };\n}\n\nfunction createForwardWrapper(Component: any, wrapperProps: any, statics: any, isFunction: any) {\n const RootComponent = Component[ROOT_COMPONENT];\n const getterMethodName = getterMethodNameByDisplayName(Component?.displayName);\n const getterMethod = RootComponent?.prototype\n ? RootComponent.prototype[getterMethodName]\n : undefined;\n const useGetterIndex = getterMethod?.length >= 2;\n\n function WrapperForwardRefWithBind({ forwardRef = null, ...other }, ref: any) {\n return <BindingWrapper {...other} forwardRef={useForkRef(ref, forwardRef)} />;\n }\n\n function WrapperForwardRef(\n { forwardRef = null, __WRAPPER_PROPS_BIND__, ...other }: any,\n ref: any,\n ) {\n const { ref: enhancementRef = null, ...props } = (\n __WRAPPER_PROPS_BIND__ || wrapperProps\n ).reduce((acc: any, enhancement: any) => enhancement(acc, WrapperComponent, isFunction), other);\n return <Component {...props} forwardRef={useForkRef(enhancementRef, ref, forwardRef)} />;\n }\n\n class BindingWrapper extends React.Component<any> {\n index = -1;\n render() {\n return (\n <WrapperForwardRef\n {...this.props}\n __WRAPPER_PROPS_BIND__={wrapperProps.map((fn: any) => fn.bind(this))}\n />\n );\n }\n }\n\n const WrapperComponent = React.forwardRef(\n useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef,\n );\n\n hoistNonReactStatics(WrapperComponent, Component);\n\n WrapperComponent.displayName = Component.displayName;\n // TODO: defaultProps is only empty\n WrapperComponent.defaultProps = Component.defaultProps;\n // STATIC\n statics.forEach((enhancement: any) =>\n Object.assign(WrapperComponent, enhancement(WrapperComponent, Component, isFunction)),\n );\n\n return WrapperComponent;\n}\n\nfunction wrapClass(OriginComponent: any, enhancements: any, Context: any) {\n const getField = createGetField(enhancements, OriginComponent, false);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n class Component extends OriginComponent {\n [CORE_AS_PROPS] = null;\n [CORE_INSTANCE] = WrapperComponent;\n [CORE_INIT] = false;\n\n constructor(props: any, context: any) {\n super(props, context);\n // INITS\n inits.forEach((enhancement: any) => enhancement.call(this, props, WrapperComponent, false));\n this[CORE_INIT] = true;\n }\n\n get asProps() {\n // TODO if not production\n if (!this[CORE_INIT]) {\n throw new Error('Can not call asProps in constructor');\n }\n if (!this[CORE_AS_PROPS]) {\n // PROPS\n this[CORE_AS_PROPS] = props.reduce(\n (acc: any, enhancement: any) => enhancement.call(this, acc, WrapperComponent, false),\n this.props,\n );\n }\n return this[CORE_AS_PROPS];\n }\n\n setContext() {\n const contextProps = super.setContext ? super.setContext() : {};\n // CONTEXT\n return contexts.reduce(\n (acc: any, enhancement: any) => enhancement.call(this, acc, WrapperComponent, false),\n contextProps,\n );\n }\n\n render() {\n this[CORE_AS_PROPS] = null;\n // TODO if not production\n if (!super.render) {\n throw new Error('Component `render` method is not defined');\n }\n const asProps: any = this.asProps;\n const ctx = this.setContext();\n // RENDER\n const render = renders.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(this, acc, asProps, WrapperComponent, false),\n super.render(),\n );\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n }\n }\n\n const WrapperComponent: any = createForwardWrapper(Component, wrapperProps, statics, false);\n return WrapperComponent;\n}\n\nfunction wrapFunction(OriginComponent: any, enhancements: any, Context: any) {\n const getField = createGetField(enhancements, OriginComponent, true);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n const Component = React.memo(function FunctionMemoComponent(other) {\n const selfRef = React.useRef({});\n const firstRender = React.useRef(true);\n useEnhancedEffect(() => {\n firstRender.current = false;\n }, []);\n if (firstRender.current) {\n // INITS\n inits.forEach((enhancement: any) =>\n enhancement.call(selfRef.current, other, WrapperComponent, true),\n );\n }\n // PROPS\n const asProps = props.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(selfRef.current, acc, WrapperComponent, true),\n other,\n );\n // CONTEXT\n const ctx = contexts.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(selfRef.current, acc, WrapperComponent, true),\n {},\n );\n\n // RENDER\n const render = renders.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true),\n <OriginComponent {...asProps} />,\n );\n\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n });\n Object.assign(Component, OriginComponent);\n const WrapperComponent: any = createForwardWrapper(Component, wrapperProps, statics, true);\n return WrapperComponent;\n}\n\nfunction wrapCore(OriginComponent: any, enhancements: any, Context: any) {\n const Component = function ({ Root }: any) {\n const defaultProps = OriginComponent.defaultProps || {};\n return <Root {...defaultProps} render={OriginComponent} />;\n };\n hoistNonReactStatics(Component, OriginComponent);\n Component.displayName = OriginComponent.displayName;\n return wrapFunction(Component, enhancements, Context);\n}\n\nfunction createComposeComponent(OriginComponent: any, Context: any, enhancements: any): any {\n if (\n React.PureComponent.isPrototypeOf(OriginComponent) ||\n React.Component.isPrototypeOf(OriginComponent)\n ) {\n if (OriginComponent.prototype instanceof Component) {\n return wrapClass(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must inherit from our component');\n }\n } else if (typeof OriginComponent === 'function') {\n return wrapFunction(OriginComponent, enhancements, Context);\n } else if (OriginComponent[CORE_COMPONENT]) {\n return wrapCore(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must be a React component');\n }\n}\n\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n\ninterface ClassWithUncontrolledProps<Props> {\n uncontrolledProps(): unknown;\n}\n\nexport function assignProps(p1: any, p2: any) {\n return _assignProps(p2, p1);\n}\n\nfunction createComponent<ComponentProps, ChildComponentProps = {}, ContextType = {}, FNType = null>(\n OriginComponent: any,\n childComponents: any = {},\n options: {\n context?: React.Context<ContextType>;\n parent?: ComponentType<unknown> | ComponentType<unknown>[];\n enhancements?: [any];\n } = {},\n): ComponentType<\n ComponentProps extends Component<infer Props> ? Props : ComponentProps,\n ChildComponentProps,\n ContextType,\n ComponentProps extends ClassWithUncontrolledProps<any>\n ? ReturnType<ComponentProps['uncontrolledProps']>\n : { [key: string]: (arg: unknown) => void },\n FNType\n> {\n const {\n context = React.createContext<ContextType>({} as ContextType),\n parent = [],\n enhancements = [],\n } = options;\n let parents = Array.isArray(parent) ? parent : [parent];\n if (parents.length) {\n const wholeFamily = parents.reduce((acc: any, parent: any) => {\n if (parent[PARENT_COMPONENTS]) {\n acc = [...parent[PARENT_COMPONENTS], ...acc];\n }\n return acc;\n }, parents);\n OriginComponent[PARENT_COMPONENTS] = wholeFamily;\n parents = wholeFamily;\n }\n if (OriginComponent[CORE_COMPONENT]) {\n parents.push(OriginComponent);\n }\n const Component = createComposeComponent(OriginComponent, context, [\n // @ts-ignore\n ...enhancements.map((f) => f(context, parents, createComponent, childComponents)),\n i18nAppLocaleEnhance(),\n bindHandlerEnhancement(),\n childrenEnhancement(context, parents),\n // root must be under the children\n rootEnhancement(),\n uncontrolledPropsEnhancement(),\n staticChildrenEnhancement(childComponents, createComponent, {\n context,\n parent,\n enhancements,\n }),\n // functionDefaultProps must be under the staticChild\n functionDefaultPropsEnhancement(),\n // inheritedName must be under the staticChild\n inheritedNameEnhancement(),\n // dataName must be under the staticChild\n dataNameEnhancement(),\n // enhanceEnhancement must be under the functionDefaultPropsEnhancement\n enhanceEnhancement(),\n styleEnhancement(childComponents, context),\n // must be the last one so any properties can be raised\n hoistPropsEnhancement(childComponents, context),\n ]);\n Component[CONTEXT_COMPONENT] = context;\n Component._______childrenComponents = childComponents;\n Component[CREATE_COMPONENT] = function (\n _OriginComponent = OriginComponent,\n _childComponents = childComponents,\n _options = options,\n ) {\n return createComponent(_OriginComponent, _childComponents, _options);\n };\n Component[CORE_COMPONENT] = true;\n return Component;\n}\n\nfunction createBaseComponent<ComponentProps>(OriginComponent: any): ComponentType<ComponentProps> {\n let Component = null;\n if (\n !React.PureComponent.isPrototypeOf(OriginComponent) &&\n !React.Component.isPrototypeOf(OriginComponent) &&\n typeof OriginComponent === 'function'\n ) {\n Component = React.forwardRef(OriginComponent);\n Component.displayName = OriginComponent.displayName;\n Component.defaultProps = {\n 'data-ui-name': OriginComponent.displayName,\n ...OriginComponent.defaultProps,\n };\n (Component as any)[CORE_COMPONENT] = true;\n } else {\n throw new Error('createBaseComponent accepts only functional component');\n }\n return Component as any;\n}\n\nexport { createComponent, createBaseComponent };\n"],"mappings":";;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAoD,OAAO;AACvE,OAAOC,oBAAoB,MAAM,yBAAyB;AAE1D,SAASC,UAAU,QAAQ,aAAa;AACxC,OAAOC,iBAAiB,MAAM,+BAA+B;AAC7D,OAAOC,YAAY,MAAM,qBAAqB;AAE9C,SAASC,SAAS,QAAmC,wBAAwB;AAE7E,OAAOC,mBAAmB,MAAM,wBAAwB;AACxD,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,4BAA4B,MAAM,iCAAiC;AAC1E,OAAOC,+BAA+B,MAAM,oCAAoC;AAChF,OAAOC,yBAAyB,IAC9BC,gBAAgB,EAChBC,cAAc,EACdC,6BAA6B,QACxB,8BAA8B;AACrC,OAAOC,wBAAwB,MAAM,6BAA6B;AAClE,OAAOC,qBAAqB,MAAM,0BAA0B;AAC5D,OAAOC,mBAAmB,MAAM,wBAAwB;AACxD,OAAOC,kBAAkB,MAAM,uBAAuB;AACtD,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,sBAAsB,MAAM,2BAA2B;AAC9D,OAAOC,oBAAoB,MAAM,oBAAoB;AACrD,SACEC,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,aAAa,EACbC,cAAc,EACdC,gBAAgB,EAChBC,iBAAiB,QAGZ,sBAAsB;AAE7B,SAASC,aAAaA,CAACC,GAAQ,EAAE;EAC/B,OACEC,MAAM,CAACC,mBAAmB,CAACF,GAAG,CAAC,CAACG,MAAM,KAAK,CAAC,IAC5CF,MAAM,CAACG,qBAAqB;EAAI;EAChCH,MAAM,CAACG,qBAAqB,CAACJ,GAAG,CAAC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SAAS,CAACgD,WAAW,GAAGqD,eAAe,CAACrD,WAAW;IACnDhD,SAAS,CAACiG,YAAY,GAAAyB,aAAA;MACpB,cAAc,EAAErB,eAAe,CAACrD;IAAW,GACxCqD,eAAe,CAACJ,YAAY,CAChC;IACAjG,SAAS,CAASoB,cAAc,CAAC,GAAG,IAAI;EAC3C,CAAC,MAAM;IACL,MAAM,IAAI4F,KAAK,CAAC,uDAAuD,CAAC;EAC1E;EACA,OAAOhH,SAAS;AAClB;AAEA,SAAS2I,eAAe,EAAEiB,mBAAmB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
var _excluded = ["handlers", "getters"],
|
|
6
|
+
_excluded2 = ["handlers"];
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { CONTEXT_COMPONENT, CHILDREN_COMPONENT } from '../core-types/symbols';
|
|
9
|
+
var CHILDREN_SELF = Symbol('CHILDREN_SELF');
|
|
10
|
+
var GETTER_REG = /^get[\w]+Props$/;
|
|
11
|
+
function splitPropsAndGetters(props) {
|
|
12
|
+
return Object.entries(props).reduce(function (acc, _ref) {
|
|
13
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
14
|
+
key = _ref2[0],
|
|
15
|
+
value = _ref2[1];
|
|
16
|
+
if (GETTER_REG.exec(key) === null) {
|
|
17
|
+
acc.props[key] = value;
|
|
18
|
+
} else {
|
|
19
|
+
acc.getters[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return acc;
|
|
22
|
+
}, {
|
|
23
|
+
props: {},
|
|
24
|
+
getters: {}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function getterToArray(getter) {
|
|
28
|
+
if (!Array.isArray(getter)) {
|
|
29
|
+
return typeof getter === 'function' ? [getter] : [];
|
|
30
|
+
}
|
|
31
|
+
return getter;
|
|
32
|
+
}
|
|
33
|
+
function mergeObjects() {
|
|
34
|
+
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35
|
+
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36
|
+
var core = _objectSpread(_objectSpread({}, a), b);
|
|
37
|
+
return Object.keys(core).reduce(function (acc, key) {
|
|
38
|
+
a[key] = getterToArray(a[key]);
|
|
39
|
+
b[key] = getterToArray(b[key]);
|
|
40
|
+
acc[key] = [].concat(_toConsumableArray(a[key]), _toConsumableArray(b[key]));
|
|
41
|
+
return acc;
|
|
42
|
+
}, {});
|
|
43
|
+
}
|
|
44
|
+
function assignGettersChain(getters) {
|
|
45
|
+
return function () {
|
|
46
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47
|
+
return getters.reduce(function (acc, getter) {
|
|
48
|
+
return getter(acc);
|
|
49
|
+
}, props);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function createChildren(Context, contexts) {
|
|
53
|
+
var Children = function Children() {
|
|
54
|
+
var children = Children.origin;
|
|
55
|
+
if (typeof children === 'function') {
|
|
56
|
+
var _reduce = [].concat(_toConsumableArray(contexts), [Context]).reduce(function (acc, ctx) {
|
|
57
|
+
var _ref3 = React.useContext(ctx),
|
|
58
|
+
handlers = _ref3.handlers,
|
|
59
|
+
propsAndGetters = _objectWithoutProperties(_ref3, _excluded2);
|
|
60
|
+
var _splitPropsAndGetters = splitPropsAndGetters(propsAndGetters),
|
|
61
|
+
props = _splitPropsAndGetters.props,
|
|
62
|
+
getters = _splitPropsAndGetters.getters;
|
|
63
|
+
return Object.assign({}, acc, _objectSpread({
|
|
64
|
+
handlers: Object.assign({}, acc.handlers, handlers),
|
|
65
|
+
getters: mergeObjects(acc.getters, getters)
|
|
66
|
+
}, props));
|
|
67
|
+
}, Children.props),
|
|
68
|
+
_reduce$handlers = _reduce.handlers,
|
|
69
|
+
handlers = _reduce$handlers === void 0 ? {} : _reduce$handlers,
|
|
70
|
+
_reduce$getters = _reduce.getters,
|
|
71
|
+
getters = _reduce$getters === void 0 ? {} : _reduce$getters,
|
|
72
|
+
props = _objectWithoutProperties(_reduce, _excluded);
|
|
73
|
+
var mergedGetters = Object.entries(getters).reduce(function (acc, _ref4) {
|
|
74
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
75
|
+
key = _ref5[0],
|
|
76
|
+
value = _ref5[1];
|
|
77
|
+
acc[key] = assignGettersChain(value);
|
|
78
|
+
return acc;
|
|
79
|
+
}, {});
|
|
80
|
+
return children(_objectSpread(_objectSpread({}, props), mergedGetters), handlers);
|
|
81
|
+
} else if (children === undefined) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return children;
|
|
85
|
+
};
|
|
86
|
+
Children.origin = null;
|
|
87
|
+
Children.props = {};
|
|
88
|
+
Children[CHILDREN_COMPONENT] = true;
|
|
89
|
+
return Children;
|
|
90
|
+
}
|
|
91
|
+
function Enhancement(Context, parent) {
|
|
92
|
+
return {
|
|
93
|
+
init: function init() {
|
|
94
|
+
var contexts = (Array.isArray(parent) ? parent : [parent]).map(function (component) {
|
|
95
|
+
return component[CONTEXT_COMPONENT];
|
|
96
|
+
}).filter(Boolean);
|
|
97
|
+
this[CHILDREN_SELF] = createChildren(Context, contexts);
|
|
98
|
+
},
|
|
99
|
+
asProps: function asProps(props) {
|
|
100
|
+
// TODO: learn the reason what it was used for (by lsroman)
|
|
101
|
+
// this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;
|
|
102
|
+
this[CHILDREN_SELF].origin = props.children;
|
|
103
|
+
this[CHILDREN_SELF].props = props;
|
|
104
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
105
|
+
Children: this[CHILDREN_SELF]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export default Enhancement;
|
|
111
|
+
//# sourceMappingURL=Children.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Children.js","names":["React","CONTEXT_COMPONENT","CHILDREN_COMPONENT","CHILDREN_SELF","Symbol","GETTER_REG","splitPropsAndGetters","props","Object","entries","reduce","acc","_ref","_ref2","_slicedToArray","key","value","exec","getters","getterToArray","getter","Array","isArray","mergeObjects","a","arguments","length","undefined","b","core","_objectSpread","keys","concat","_toConsumableArray","assignGettersChain","createChildren","Context","contexts","Children","children","origin","_reduce","ctx","_ref3","useContext","handlers","propsAndGetters","_objectWithoutProperties","_excluded2","_splitPropsAndGetters","assign","_reduce$handlers","_reduce$getters","_excluded","mergedGetters","_ref4","_ref5","Enhancement","parent","init","map","component","filter","Boolean","asProps"],"sources":["../../../src/enhancement/Children.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTEXT_COMPONENT, CHILDREN_COMPONENT } from '../core-types/symbols';\n\nconst CHILDREN_SELF = Symbol('CHILDREN_SELF');\n\nconst GETTER_REG = /^get[\\w]+Props$/;\n\nfunction splitPropsAndGetters(props: any) {\n return Object.entries(props).reduce(\n (acc: any, [key, value]) => {\n if (GETTER_REG.exec(key) === null) {\n acc.props[key] = value;\n } else {\n acc.getters[key] = value;\n }\n return acc;\n },\n { props: {}, getters: {} },\n );\n}\n\nfunction getterToArray(getter: any) {\n if (!Array.isArray(getter)) {\n return typeof getter === 'function' ? [getter] : [];\n }\n return getter;\n}\n\nfunction mergeObjects(a: any = {}, b: any = {}) {\n const core = { ...a, ...b };\n return Object.keys(core).reduce((acc: any, key) => {\n a[key] = getterToArray(a[key]);\n b[key] = getterToArray(b[key]);\n acc[key] = [...a[key], ...b[key]];\n return acc;\n }, {});\n}\n\nfunction assignGettersChain(getters: Array<Function>) {\n return function (props = {}) {\n return getters.reduce((acc, getter) => {\n return getter(acc);\n }, props);\n };\n}\n\nfunction createChildren(Context: any, contexts: any) {\n const Children: any = function () {\n const children = Children.origin;\n if (typeof children === 'function') {\n const {\n handlers = {},\n getters = {},\n ...props\n } = [...contexts, Context].reduce((acc, ctx) => {\n const { handlers, ...propsAndGetters } = React.useContext(ctx) as any;\n const { props, getters } = splitPropsAndGetters(propsAndGetters);\n return Object.assign({}, acc, {\n handlers: Object.assign({}, acc.handlers, handlers),\n getters: mergeObjects(acc.getters, getters),\n ...props,\n });\n }, Children.props);\n\n const mergedGetters = Object.entries(getters).reduce((acc: any, [key, value]) => {\n acc[key] = assignGettersChain(value as []);\n return acc;\n }, {});\n\n return children({ ...props, ...mergedGetters }, handlers);\n } else if (children === undefined) {\n return null;\n }\n return children;\n };\n Children.origin = null;\n Children.props = {};\n Children[CHILDREN_COMPONENT] = true;\n return Children;\n}\n\nfunction Enhancement(this: any, Context: any, parent: any) {\n return {\n init: function (this: any) {\n const contexts = (Array.isArray(parent) ? parent : [parent])\n .map((component) => component[CONTEXT_COMPONENT])\n .filter(Boolean);\n this[CHILDREN_SELF] = createChildren(Context, contexts);\n },\n asProps: function (this: any, props: any) {\n // TODO: learn the reason what it was used for (by lsroman)\n // this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;\n this[CHILDREN_SELF].origin = props.children;\n this[CHILDREN_SELF].props = props;\n return {\n ...props,\n Children: this[CHILDREN_SELF],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,uBAAuB;AAE7E,IAAMC,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAE7C,IAAMC,UAAU,GAAG,iBAAiB;AAEpC,SAASC,oBAAoBA,CAACC,KAAU,EAAE;EACxC,OAAOC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAACG,MAAM,CACjC,UAACC,GAAQ,EAAAC,IAAA,EAAmB;IAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA;MAAhBG,GAAG,GAA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AAI,EAAE,SAAAA,KAAA,EAAqB;MACzB,IAAMtB,QAAQ,GAAG,CAAChB,KAAK,CAACC,OAAO,CAACoC,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,EACxDE,GAAG,CAAC,UAACC,SAAS;QAAA,OAAKA,SAAS,CAAC5D,iBAAiB,CAAC;MAAA,EAAC,CAChD6D,MAAM,CAACC,OAAO,CAAC;MAClB,IAAI,CAAC5D,aAAa,CAAC,GAAGgC,cAAc,CAACC,OAAO,EAAEC,QAAQ,CAAC;IACzD,CAAC;IACD2B,OAAO,EAAE,SAAAA,QAAqBzD,KAAU,EAAE;MACxC;MACA;MACA,IAAI,CAACJ,aAAa,CAAC,CAACqC,MAAM,GAAGjC,KAAK,CAACgC,QAAQ;MAC3C,IAAI,CAACpC,aAAa,CAAC,CAACI,KAAK,GAAGA,KAAK;MACjC,OAAAuB,aAAA,CAAAA,aAAA,KACKvB,KAAK;QACR+B,QAAQ,EAAE,IAAI,CAACnC,aAAa;MAAC;IAEjC;EACF,CAAC;AACH;AAEA,eAAesD,WAAW"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["render"],
|
|
5
|
+
_excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import assignProps from '../utils/assignProps';
|
|
8
|
+
import { useForkRef } from '../utils/ref';
|
|
9
|
+
function createRootRender() {
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
var Root = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
12
|
+
var Tag = _ref.render,
|
|
13
|
+
source = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
var _Root$props = Root.props,
|
|
15
|
+
_Root = _Root$props.Root,
|
|
16
|
+
styles = _Root$props.styles,
|
|
17
|
+
children = _Root$props.children,
|
|
18
|
+
Children = _Root$props.Children,
|
|
19
|
+
_Root$props$forwardRe = _Root$props.forwardRef,
|
|
20
|
+
forwardRef = _Root$props$forwardRe === void 0 ? null : _Root$props$forwardRe,
|
|
21
|
+
props = _objectWithoutProperties(_Root$props, _excluded2);
|
|
22
|
+
var clearProps = Object.entries(props).reduce(function (props, _ref2) {
|
|
23
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
24
|
+
name = _ref3[0],
|
|
25
|
+
value = _ref3[1];
|
|
26
|
+
if (value !== undefined) {
|
|
27
|
+
props[name] = value;
|
|
28
|
+
}
|
|
29
|
+
return props;
|
|
30
|
+
}, {});
|
|
31
|
+
var child = {};
|
|
32
|
+
// TODO: need to find better check solution (by lsroman)
|
|
33
|
+
if (typeof Children.origin !== 'undefined') {
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
child.children = /*#__PURE__*/React.createElement(Children, null);
|
|
36
|
+
}
|
|
37
|
+
var other = assignProps(_objectSpread(_objectSpread({}, clearProps), {}, {
|
|
38
|
+
ref: useForkRef(forwardRef, ref)
|
|
39
|
+
}), _objectSpread(_objectSpread({}, child), source));
|
|
40
|
+
if (!Tag) {
|
|
41
|
+
throw new Error('`render` prop of Root is not provided');
|
|
42
|
+
}
|
|
43
|
+
if (Tag === React.Fragment) return /*#__PURE__*/React.createElement(React.Fragment, null, other.children);
|
|
44
|
+
return /*#__PURE__*/React.createElement(Tag, other);
|
|
45
|
+
});
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
Root.props = {};
|
|
48
|
+
return Root;
|
|
49
|
+
}
|
|
50
|
+
function Enhancement() {
|
|
51
|
+
return {
|
|
52
|
+
init: function init() {
|
|
53
|
+
this.Root = createRootRender();
|
|
54
|
+
},
|
|
55
|
+
asProps: function asProps(props, WrapperComponent, isFunction) {
|
|
56
|
+
if (isFunction) {
|
|
57
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
58
|
+
Root: this.Root
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return props;
|
|
62
|
+
},
|
|
63
|
+
render: function render(_render, props) {
|
|
64
|
+
this.Root.props = props;
|
|
65
|
+
return _render;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export default Enhancement;
|
|
70
|
+
//# sourceMappingURL=Root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Root.js","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","_ref","ref","Tag","render","source","_objectWithoutProperties","_excluded","_Root$props","props","_Root","styles","children","Children","_Root$props$forwardRe","_excluded2","clearProps","Object","entries","reduce","_ref2","_ref3","_slicedToArray","name","value","undefined","child","origin","createElement","other","_objectSpread","Error","Fragment","Enhancement","init","asProps","WrapperComponent","isFunction"],"sources":["../../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\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,\n\n 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;AACzB,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,IAAMC,IAAI,gBAAGJ,KAAK,CAACK,UAAU,CAAC,UAAAC,IAAA,EAAsCC,GAAG,EAAE;IAAA,IAAvBC,GAAG,GAAAF,IAAA,CAAXG,MAAM;MAAUC,MAAM,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;IAC9D,IAAAC,WAAA,GAUIT,IAAI,CAACU,KAAK;MATNC,KAAK,GAAAF,WAAA,CAAXT,IAAI;MAEJY,MAAM,GAAAH,WAAA,CAANG,MAAM;MAENC,QAAQ,GAAAJ,WAAA,CAARI,QAAQ;MACRC,QAAQ,GAAAL,WAAA,CAARK,QAAQ;MAAAC,qBAAA,GAAAN,WAAA,CACRR,UAAU;MAAVA,UAAU,GAAAc,qBAAA,cAAG,IAAI,GAAAA,qBAAA;MACdL,KAAK,GAAAH,wBAAA,CAAAE,WAAA,EAAAO,UAAA;IAIV,IAAMC,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACT,KAAK,CAAC,CAACU,MAAM,CAAC,UAACV,KAAU,EAAAW,KAAA,EAAoB;MAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA;QAAjBG,IAAI,GAAAF,KAAA;QAAEG,KAAK,GAAAH,KAAA;MACvE,IAAIG,KAAK,KAAKC,SAAS,EAAE;QACvBhB,KAAK,CAACc,IAAI,CAAC,GAAGC,KAAK;MACrB;MACA,OAAOf,KAAK;IACd,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAMiB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