@semcore/core 16.0.0-prerelease.4 → 16.0.0-prerelease.7
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/lib/LastInteractionType.cjs +57 -0
- package/lib/LastInteractionType.cjs.map +1 -0
- package/lib/LastInteractionType.d.ts +1 -1
- package/lib/LastInteractionType.mjs +51 -0
- package/lib/core-types/Component.cjs +59 -0
- package/lib/core-types/Component.cjs.map +1 -0
- package/lib/core-types/Component.mjs +28 -31
- package/lib/core-types/UnknownProperties.cjs +2 -0
- package/lib/core-types/UnknownProperties.cjs.map +1 -0
- package/lib/core-types/reshadow.d.cjs +2 -0
- package/lib/core-types/reshadow.d.cjs.map +1 -0
- package/lib/core-types/symbols.cjs +25 -0
- package/lib/core-types/symbols.cjs.map +1 -0
- package/lib/core-types/symbols.mjs +20 -10
- package/lib/coreFactory.cjs +352 -0
- package/lib/coreFactory.cjs.map +1 -0
- package/lib/coreFactory.mjs +324 -0
- package/lib/enhancement/Children.cjs +119 -0
- package/lib/enhancement/Children.cjs.map +1 -0
- package/lib/enhancement/Children.mjs +34 -49
- package/lib/enhancement/Root.cjs +78 -0
- package/lib/enhancement/Root.cjs.map +1 -0
- package/lib/enhancement/Root.mjs +25 -35
- package/lib/enhancement/bindHandler.cjs +54 -0
- package/lib/enhancement/bindHandler.cjs.map +1 -0
- package/lib/enhancement/bindHandler.mjs +10 -9
- package/lib/enhancement/dataName.cjs +20 -0
- package/lib/enhancement/dataName.cjs.map +1 -0
- package/lib/enhancement/dataName.mjs +5 -4
- package/lib/enhancement/enhance.cjs +22 -0
- package/lib/enhancement/enhance.cjs.map +1 -0
- package/lib/enhancement/enhance.mjs +4 -3
- package/lib/enhancement/functionDefaultProps.cjs +36 -0
- package/lib/enhancement/functionDefaultProps.cjs.map +1 -0
- package/lib/enhancement/functionDefaultProps.mjs +5 -5
- package/lib/enhancement/hoistProps.cjs +97 -0
- package/lib/enhancement/hoistProps.cjs.map +1 -0
- package/lib/enhancement/hoistProps.mjs +22 -32
- package/lib/enhancement/i18n.cjs +28 -0
- package/lib/enhancement/i18n.cjs.map +1 -0
- package/lib/enhancement/i18n.mjs +8 -8
- package/lib/enhancement/inheritedName.cjs +23 -0
- package/lib/enhancement/inheritedName.cjs.map +1 -0
- package/lib/enhancement/inheritedName.mjs +5 -4
- package/lib/enhancement/staticChildren.cjs +135 -0
- package/lib/enhancement/staticChildren.cjs.map +1 -0
- package/lib/enhancement/staticChildren.mjs +35 -38
- package/lib/enhancement/style.cjs +60 -0
- package/lib/enhancement/style.cjs.map +1 -0
- package/lib/enhancement/style.mjs +16 -17
- package/lib/enhancement/uncontrolledProps.cjs +131 -0
- package/lib/enhancement/uncontrolledProps.cjs.map +1 -0
- package/lib/enhancement/uncontrolledProps.mjs +28 -44
- package/lib/esm/LastInteractionType.mjs +29 -20
- package/lib/esm/core-types/Component.mjs +40 -29
- package/lib/esm/core-types/symbols.mjs +18 -10
- package/lib/esm/coreFactory.mjs +273 -184
- package/lib/esm/enhancement/Children.mjs +72 -48
- package/lib/esm/enhancement/Root.mjs +49 -32
- package/lib/esm/enhancement/bindHandler.mjs +34 -30
- package/lib/esm/enhancement/dataName.mjs +7 -7
- package/lib/esm/enhancement/enhance.mjs +9 -9
- package/lib/esm/enhancement/functionDefaultProps.mjs +19 -9
- package/lib/esm/enhancement/hoistProps.mjs +62 -42
- package/lib/esm/enhancement/i18n.mjs +13 -11
- package/lib/esm/enhancement/inheritedName.mjs +9 -9
- package/lib/esm/enhancement/staticChildren.mjs +100 -58
- package/lib/esm/enhancement/style.mjs +38 -26
- package/lib/esm/enhancement/uncontrolledProps.mjs +81 -62
- package/lib/esm/index.mjs +21 -21
- package/lib/esm/register.mjs +22 -15
- package/lib/esm/styled/reshadow-core.mjs +9 -7
- package/lib/esm/styled/sstyled.mjs +98 -55
- package/lib/esm/utils/assignProps.mjs +65 -31
- package/lib/esm/utils/canUseDOM.mjs +3 -3
- package/lib/esm/utils/capitalizeFirstLetter.mjs +3 -3
- package/lib/esm/utils/enhances/WithI18n.mjs +44 -38
- package/lib/esm/utils/logger.mjs +24 -16
- package/lib/esm/utils/pick.mjs +11 -6
- package/lib/esm/utils/ref.mjs +33 -24
- package/lib/esm/utils/use/useEnhancedEffect.mjs +4 -4
- package/lib/index.cjs +103 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.mjs +23 -0
- package/lib/register.cjs +37 -0
- package/lib/register.cjs.map +1 -0
- package/lib/register.mjs +13 -11
- package/lib/styled/index.cjs +32 -0
- package/lib/styled/index.cjs.map +1 -0
- package/lib/styled/reshadow-core.cjs +256 -0
- package/lib/styled/reshadow-core.cjs.map +1 -0
- package/lib/styled/reshadow-core.mjs +8 -233
- package/lib/styled/sstyled.cjs +149 -0
- package/lib/styled/sstyled.cjs.map +1 -0
- package/lib/styled/sstyled.mjs +40 -61
- package/lib/theme/processor.cjs +315 -0
- package/lib/theme/processor.cjs.map +1 -0
- package/lib/theme/themes/dark.cjs +385 -0
- package/lib/theme/themes/dark.cjs.map +1 -0
- package/lib/theme/themes/default.cjs +394 -0
- package/lib/theme/themes/default.cjs.map +1 -0
- package/lib/theme/themes/light.cjs +394 -0
- package/lib/theme/themes/light.cjs.map +1 -0
- package/lib/theme/utils.cjs +297 -0
- package/lib/theme/utils.cjs.map +1 -0
- package/lib/utils/CSSinJS.cjs +36 -0
- package/lib/utils/CSSinJS.cjs.map +1 -0
- package/lib/utils/ScreenReaderOnly.cjs +31 -0
- package/lib/utils/ScreenReaderOnly.cjs.map +1 -0
- package/lib/utils/ThemeProvider.cjs +82 -0
- package/lib/utils/ThemeProvider.cjs.map +1 -0
- package/lib/utils/addonText.cjs +18 -0
- package/lib/utils/addonText.cjs.map +1 -0
- package/lib/utils/addonText.d.ts +1 -1
- package/lib/utils/addonTextChildren.cjs +45 -0
- package/lib/utils/addonTextChildren.cjs.map +1 -0
- package/lib/utils/ariaProps.cjs +22 -0
- package/lib/utils/ariaProps.cjs.map +1 -0
- package/lib/utils/assignProps.cjs +93 -0
- package/lib/utils/assignProps.cjs.map +1 -0
- package/lib/utils/assignProps.mjs +30 -38
- package/lib/utils/canUseDOM.cjs +10 -0
- package/lib/utils/canUseDOM.cjs.map +1 -0
- package/lib/utils/canUseDOM.mjs +5 -3
- package/lib/utils/capitalizeFirstLetter.cjs +10 -0
- package/lib/utils/capitalizeFirstLetter.cjs.map +1 -0
- package/lib/utils/capitalizeFirstLetter.mjs +4 -2
- package/lib/utils/color.cjs +208 -0
- package/lib/utils/color.cjs.map +1 -0
- package/lib/utils/compose.cjs +21 -0
- package/lib/utils/compose.cjs.map +1 -0
- package/lib/utils/createHoc.cjs +55 -0
- package/lib/utils/createHoc.cjs.map +1 -0
- package/lib/utils/createUUID.cjs +15 -0
- package/lib/utils/createUUID.cjs.map +1 -0
- package/lib/utils/cssToIntDefault.cjs +22 -0
- package/lib/utils/cssToIntDefault.cjs.map +1 -0
- package/lib/utils/enhances/WithAutoFocus.cjs +75 -0
- package/lib/utils/enhances/WithAutoFocus.cjs.map +1 -0
- package/lib/utils/enhances/WithCSS.cjs +93 -0
- package/lib/utils/enhances/WithCSS.cjs.map +1 -0
- package/lib/utils/enhances/WithI18n.cjs +95 -0
- package/lib/utils/enhances/WithI18n.cjs.map +1 -0
- package/lib/utils/enhances/WithI18n.mjs +28 -57
- package/lib/utils/enhances/WithKeyboardFocus.cjs +93 -0
- package/lib/utils/enhances/WithKeyboardFocus.cjs.map +1 -0
- package/lib/utils/enhances/WithRef.cjs +26 -0
- package/lib/utils/enhances/WithRef.cjs.map +1 -0
- package/lib/utils/enhances/a11yEnhance.cjs +74 -0
- package/lib/utils/enhances/a11yEnhance.cjs.map +1 -0
- package/lib/utils/enhances/animatedSizeEnhance.cjs +98 -0
- package/lib/utils/enhances/animatedSizeEnhance.cjs.map +1 -0
- package/lib/utils/enhances/autoFocusEnhance.cjs +46 -0
- package/lib/utils/enhances/autoFocusEnhance.cjs.map +1 -0
- package/lib/utils/enhances/contextEnhance.cjs +22 -0
- package/lib/utils/enhances/contextEnhance.cjs.map +1 -0
- package/lib/utils/enhances/i18nEnhance.cjs +101 -0
- package/lib/utils/enhances/i18nEnhance.cjs.map +1 -0
- package/lib/utils/enhances/keyboardFocusEnhance.cjs +63 -0
- package/lib/utils/enhances/keyboardFocusEnhance.cjs.map +1 -0
- package/lib/utils/enhances/resolveColorEnhance.cjs +25 -0
- package/lib/utils/enhances/resolveColorEnhance.cjs.map +1 -0
- package/lib/utils/eventEmitter.cjs +41 -0
- package/lib/utils/eventEmitter.cjs.map +1 -0
- package/lib/utils/findComponent.cjs +106 -0
- package/lib/utils/findComponent.cjs.map +1 -0
- package/lib/utils/fire.cjs +23 -0
- package/lib/utils/fire.cjs.map +1 -0
- package/lib/utils/focus-lock/focusBorders.cjs +72 -0
- package/lib/utils/focus-lock/focusBorders.cjs.map +1 -0
- package/lib/utils/focus-lock/getFocusableIn.cjs +26 -0
- package/lib/utils/focus-lock/getFocusableIn.cjs.map +1 -0
- package/lib/utils/focus-lock/isFocusInside.cjs +16 -0
- package/lib/utils/focus-lock/isFocusInside.cjs.map +1 -0
- package/lib/utils/focus-lock/isFocusable.cjs +51 -0
- package/lib/utils/focus-lock/isFocusable.cjs.map +1 -0
- package/lib/utils/focus-lock/setFocus.cjs +63 -0
- package/lib/utils/focus-lock/setFocus.cjs.map +1 -0
- package/lib/utils/getAccessibleName.cjs +56 -0
- package/lib/utils/getAccessibleName.cjs.map +1 -0
- package/lib/utils/getDisplayName.cjs +10 -0
- package/lib/utils/getDisplayName.cjs.map +1 -0
- package/lib/utils/getEventTarget.cjs +53 -0
- package/lib/utils/getEventTarget.cjs.map +1 -0
- package/lib/utils/getOriginChildren.cjs +18 -0
- package/lib/utils/getOriginChildren.cjs.map +1 -0
- package/lib/utils/getRandomInt.cjs +11 -0
- package/lib/utils/getRandomInt.cjs.map +1 -0
- package/lib/utils/getValue.cjs +16 -0
- package/lib/utils/getValue.cjs.map +1 -0
- package/lib/utils/hasLabels.cjs +47 -0
- package/lib/utils/hasLabels.cjs.map +1 -0
- package/lib/utils/hasParent.cjs +14 -0
- package/lib/utils/hasParent.cjs.map +1 -0
- package/lib/utils/if.cjs +16 -0
- package/lib/utils/if.cjs.map +1 -0
- package/lib/utils/ifChildren.cjs +17 -0
- package/lib/utils/ifChildren.cjs.map +1 -0
- package/lib/utils/injectStyle.cjs +49 -0
- package/lib/utils/injectStyle.cjs.map +1 -0
- package/lib/utils/inputProps.cjs +22 -0
- package/lib/utils/inputProps.cjs.map +1 -0
- package/lib/utils/isNode.cjs +28 -0
- package/lib/utils/isNode.cjs.map +1 -0
- package/lib/utils/isPromise.cjs +10 -0
- package/lib/utils/isPromise.cjs.map +1 -0
- package/lib/utils/isRetina.cjs +15 -0
- package/lib/utils/isRetina.cjs.map +1 -0
- package/lib/utils/logger.cjs +40 -0
- package/lib/utils/logger.cjs.map +1 -0
- package/lib/utils/logger.mjs +19 -16
- package/lib/utils/numericChecker.cjs +33 -0
- package/lib/utils/numericChecker.cjs.map +1 -0
- package/lib/utils/ownerDocument.cjs +10 -0
- package/lib/utils/ownerDocument.cjs.map +1 -0
- package/lib/utils/pick.cjs +19 -0
- package/lib/utils/pick.cjs.map +1 -0
- package/lib/utils/pick.mjs +4 -2
- package/lib/utils/propsForElement.cjs +59 -0
- package/lib/utils/propsForElement.cjs.map +1 -0
- package/lib/utils/rafTrottle.cjs +33 -0
- package/lib/utils/rafTrottle.cjs.map +1 -0
- package/lib/utils/reactToText.cjs +33 -0
- package/lib/utils/reactToText.cjs.map +1 -0
- package/lib/utils/ref.cjs +95 -0
- package/lib/utils/ref.cjs.map +1 -0
- package/lib/utils/ref.mjs +20 -60
- package/lib/utils/setRef.cjs +10 -0
- package/lib/utils/setRef.cjs.map +1 -0
- package/lib/utils/syncScroll.cjs +61 -0
- package/lib/utils/syncScroll.cjs.map +1 -0
- package/lib/utils/uncontroll.cjs +47 -0
- package/lib/utils/uncontroll.cjs.map +1 -0
- package/lib/utils/uniqueID.cjs +42 -0
- package/lib/utils/uniqueID.cjs.map +1 -0
- package/lib/utils/use/useColorResolver.cjs +208 -0
- package/lib/utils/use/useColorResolver.cjs.map +1 -0
- package/lib/utils/use/useCss.cjs +20 -0
- package/lib/utils/use/useCss.cjs.map +1 -0
- package/lib/utils/use/useEnhancedEffect.cjs +13 -0
- package/lib/utils/use/useEnhancedEffect.cjs.map +1 -0
- package/lib/utils/use/useEnhancedEffect.mjs +4 -3
- package/lib/utils/use/useEventCallback.cjs +25 -0
- package/lib/utils/use/useEventCallback.cjs.map +1 -0
- package/lib/utils/use/useEventListener.cjs +33 -0
- package/lib/utils/use/useEventListener.cjs.map +1 -0
- package/lib/utils/use/useFocusLock.cjs +289 -0
- package/lib/utils/use/useFocusLock.cjs.map +1 -0
- package/lib/utils/use/usePreventScroll.cjs +78 -0
- package/lib/utils/use/usePreventScroll.cjs.map +1 -0
- package/lib/utils/useCssVariable.cjs +55 -0
- package/lib/utils/useCssVariable.cjs.map +1 -0
- package/lib/utils/zIndexStacking.cjs +48 -0
- package/lib/utils/zIndexStacking.cjs.map +1 -0
- package/package.json +7 -7
- package/vite.config.ts +8 -0
- package/lib/cjs/LastInteractionType.js +0 -57
- package/lib/cjs/LastInteractionType.js.map +0 -1
- package/lib/cjs/core-types/Component.js +0 -59
- package/lib/cjs/core-types/Component.js.map +0 -1
- package/lib/cjs/core-types/UnknownProperties.js +0 -2
- package/lib/cjs/core-types/UnknownProperties.js.map +0 -1
- package/lib/cjs/core-types/reshadow.d.js +0 -2
- package/lib/cjs/core-types/reshadow.d.js.map +0 -1
- package/lib/cjs/core-types/symbols.js +0 -25
- package/lib/cjs/core-types/symbols.js.map +0 -1
- package/lib/cjs/coreFactory.js +0 -352
- package/lib/cjs/coreFactory.js.map +0 -1
- package/lib/cjs/enhancement/Children.js +0 -119
- package/lib/cjs/enhancement/Children.js.map +0 -1
- package/lib/cjs/enhancement/Root.js +0 -78
- package/lib/cjs/enhancement/Root.js.map +0 -1
- package/lib/cjs/enhancement/bindHandler.js +0 -54
- package/lib/cjs/enhancement/bindHandler.js.map +0 -1
- package/lib/cjs/enhancement/dataName.js +0 -20
- package/lib/cjs/enhancement/dataName.js.map +0 -1
- package/lib/cjs/enhancement/enhance.js +0 -22
- package/lib/cjs/enhancement/enhance.js.map +0 -1
- package/lib/cjs/enhancement/functionDefaultProps.js +0 -36
- package/lib/cjs/enhancement/functionDefaultProps.js.map +0 -1
- package/lib/cjs/enhancement/hoistProps.js +0 -97
- package/lib/cjs/enhancement/hoistProps.js.map +0 -1
- package/lib/cjs/enhancement/i18n.js +0 -28
- package/lib/cjs/enhancement/i18n.js.map +0 -1
- package/lib/cjs/enhancement/inheritedName.js +0 -23
- package/lib/cjs/enhancement/inheritedName.js.map +0 -1
- package/lib/cjs/enhancement/staticChildren.js +0 -135
- package/lib/cjs/enhancement/staticChildren.js.map +0 -1
- package/lib/cjs/enhancement/style.js +0 -60
- package/lib/cjs/enhancement/style.js.map +0 -1
- package/lib/cjs/enhancement/uncontrolledProps.js +0 -131
- package/lib/cjs/enhancement/uncontrolledProps.js.map +0 -1
- package/lib/cjs/index.js +0 -103
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/register.js +0 -37
- package/lib/cjs/register.js.map +0 -1
- package/lib/cjs/styled/index.js +0 -32
- package/lib/cjs/styled/index.js.map +0 -1
- package/lib/cjs/styled/reshadow-core.js +0 -256
- package/lib/cjs/styled/reshadow-core.js.map +0 -1
- package/lib/cjs/styled/sstyled.js +0 -149
- package/lib/cjs/styled/sstyled.js.map +0 -1
- package/lib/cjs/theme/dark.json +0 -2506
- package/lib/cjs/theme/exclude-tokens.json +0 -10
- package/lib/cjs/theme/light.json +0 -2584
- package/lib/cjs/theme/processor.js +0 -315
- package/lib/cjs/theme/processor.js.map +0 -1
- package/lib/cjs/theme/themes/auto.css +0 -1465
- package/lib/cjs/theme/themes/dark.css +0 -723
- package/lib/cjs/theme/themes/dark.js +0 -385
- package/lib/cjs/theme/themes/dark.js.map +0 -1
- package/lib/cjs/theme/themes/default.css +0 -742
- package/lib/cjs/theme/themes/default.js +0 -394
- package/lib/cjs/theme/themes/default.js.map +0 -1
- package/lib/cjs/theme/themes/light.css +0 -742
- package/lib/cjs/theme/themes/light.js +0 -394
- package/lib/cjs/theme/themes/light.js.map +0 -1
- package/lib/cjs/theme/utils.js +0 -297
- package/lib/cjs/theme/utils.js.map +0 -1
- package/lib/cjs/utils/CSSinJS.js +0 -36
- package/lib/cjs/utils/CSSinJS.js.map +0 -1
- package/lib/cjs/utils/ScreenReaderOnly.js +0 -31
- package/lib/cjs/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/cjs/utils/ThemeProvider.js +0 -82
- package/lib/cjs/utils/ThemeProvider.js.map +0 -1
- package/lib/cjs/utils/addonText.js +0 -18
- package/lib/cjs/utils/addonText.js.map +0 -1
- package/lib/cjs/utils/addonTextChildren.js +0 -45
- package/lib/cjs/utils/addonTextChildren.js.map +0 -1
- package/lib/cjs/utils/ariaProps.js +0 -22
- package/lib/cjs/utils/ariaProps.js.map +0 -1
- package/lib/cjs/utils/assignProps.js +0 -93
- package/lib/cjs/utils/assignProps.js.map +0 -1
- package/lib/cjs/utils/canUseDOM.js +0 -10
- package/lib/cjs/utils/canUseDOM.js.map +0 -1
- package/lib/cjs/utils/capitalizeFirstLetter.js +0 -10
- package/lib/cjs/utils/capitalizeFirstLetter.js.map +0 -1
- package/lib/cjs/utils/color.js +0 -208
- package/lib/cjs/utils/color.js.map +0 -1
- package/lib/cjs/utils/compose.js +0 -21
- package/lib/cjs/utils/compose.js.map +0 -1
- package/lib/cjs/utils/createHoc.js +0 -55
- package/lib/cjs/utils/createHoc.js.map +0 -1
- package/lib/cjs/utils/createUUID.js +0 -15
- package/lib/cjs/utils/createUUID.js.map +0 -1
- package/lib/cjs/utils/cssToIntDefault.js +0 -22
- package/lib/cjs/utils/cssToIntDefault.js.map +0 -1
- package/lib/cjs/utils/enhances/WithAutoFocus.js +0 -75
- package/lib/cjs/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/cjs/utils/enhances/WithCSS.js +0 -93
- package/lib/cjs/utils/enhances/WithCSS.js.map +0 -1
- package/lib/cjs/utils/enhances/WithI18n.js +0 -95
- package/lib/cjs/utils/enhances/WithI18n.js.map +0 -1
- package/lib/cjs/utils/enhances/WithKeyboardFocus.js +0 -93
- package/lib/cjs/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/cjs/utils/enhances/WithRef.js +0 -26
- package/lib/cjs/utils/enhances/WithRef.js.map +0 -1
- package/lib/cjs/utils/enhances/a11yEnhance.js +0 -74
- package/lib/cjs/utils/enhances/a11yEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/animatedSizeEnhance.js +0 -98
- package/lib/cjs/utils/enhances/animatedSizeEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/autoFocusEnhance.js +0 -46
- package/lib/cjs/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/contextEnhance.js +0 -22
- package/lib/cjs/utils/enhances/contextEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/i18nEnhance.js +0 -101
- package/lib/cjs/utils/enhances/i18nEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/keyboardFocusEnhance.js +0 -63
- package/lib/cjs/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/cjs/utils/enhances/resolveColorEnhance.js +0 -25
- package/lib/cjs/utils/enhances/resolveColorEnhance.js.map +0 -1
- package/lib/cjs/utils/eventEmitter.js +0 -41
- package/lib/cjs/utils/eventEmitter.js.map +0 -1
- package/lib/cjs/utils/findComponent.js +0 -106
- package/lib/cjs/utils/findComponent.js.map +0 -1
- package/lib/cjs/utils/fire.js +0 -23
- package/lib/cjs/utils/fire.js.map +0 -1
- package/lib/cjs/utils/focus-lock/focusBorders.js +0 -72
- package/lib/cjs/utils/focus-lock/focusBorders.js.map +0 -1
- package/lib/cjs/utils/focus-lock/getFocusableIn.js +0 -26
- package/lib/cjs/utils/focus-lock/getFocusableIn.js.map +0 -1
- package/lib/cjs/utils/focus-lock/isFocusInside.js +0 -16
- package/lib/cjs/utils/focus-lock/isFocusInside.js.map +0 -1
- package/lib/cjs/utils/focus-lock/isFocusable.js +0 -51
- package/lib/cjs/utils/focus-lock/isFocusable.js.map +0 -1
- package/lib/cjs/utils/focus-lock/setFocus.js +0 -63
- package/lib/cjs/utils/focus-lock/setFocus.js.map +0 -1
- package/lib/cjs/utils/getAccessibleName.js +0 -56
- package/lib/cjs/utils/getAccessibleName.js.map +0 -1
- package/lib/cjs/utils/getDisplayName.js +0 -10
- package/lib/cjs/utils/getDisplayName.js.map +0 -1
- package/lib/cjs/utils/getEventTarget.js +0 -53
- package/lib/cjs/utils/getEventTarget.js.map +0 -1
- package/lib/cjs/utils/getOriginChildren.js +0 -18
- package/lib/cjs/utils/getOriginChildren.js.map +0 -1
- package/lib/cjs/utils/getRandomInt.js +0 -11
- package/lib/cjs/utils/getRandomInt.js.map +0 -1
- package/lib/cjs/utils/getValue.js +0 -16
- package/lib/cjs/utils/getValue.js.map +0 -1
- package/lib/cjs/utils/hasLabels.js +0 -47
- package/lib/cjs/utils/hasLabels.js.map +0 -1
- package/lib/cjs/utils/hasParent.js +0 -14
- package/lib/cjs/utils/hasParent.js.map +0 -1
- package/lib/cjs/utils/if.js +0 -16
- package/lib/cjs/utils/if.js.map +0 -1
- package/lib/cjs/utils/ifChildren.js +0 -17
- package/lib/cjs/utils/ifChildren.js.map +0 -1
- package/lib/cjs/utils/injectStyle.js +0 -49
- package/lib/cjs/utils/injectStyle.js.map +0 -1
- package/lib/cjs/utils/inputProps.js +0 -22
- package/lib/cjs/utils/inputProps.js.map +0 -1
- package/lib/cjs/utils/isNode.js +0 -28
- package/lib/cjs/utils/isNode.js.map +0 -1
- package/lib/cjs/utils/isPromise.js +0 -10
- package/lib/cjs/utils/isPromise.js.map +0 -1
- package/lib/cjs/utils/isRetina.js +0 -15
- package/lib/cjs/utils/isRetina.js.map +0 -1
- package/lib/cjs/utils/logger.js +0 -40
- package/lib/cjs/utils/logger.js.map +0 -1
- package/lib/cjs/utils/numericChecker.js +0 -33
- package/lib/cjs/utils/numericChecker.js.map +0 -1
- package/lib/cjs/utils/ownerDocument.js +0 -10
- package/lib/cjs/utils/ownerDocument.js.map +0 -1
- package/lib/cjs/utils/pick.js +0 -19
- package/lib/cjs/utils/pick.js.map +0 -1
- package/lib/cjs/utils/propsForElement.js +0 -59
- package/lib/cjs/utils/propsForElement.js.map +0 -1
- package/lib/cjs/utils/rafTrottle.js +0 -33
- package/lib/cjs/utils/rafTrottle.js.map +0 -1
- package/lib/cjs/utils/reactToText.js +0 -33
- package/lib/cjs/utils/reactToText.js.map +0 -1
- package/lib/cjs/utils/ref.js +0 -95
- package/lib/cjs/utils/ref.js.map +0 -1
- package/lib/cjs/utils/setRef.js +0 -10
- package/lib/cjs/utils/setRef.js.map +0 -1
- package/lib/cjs/utils/syncScroll.js +0 -61
- package/lib/cjs/utils/syncScroll.js.map +0 -1
- package/lib/cjs/utils/uncontroll.js +0 -47
- package/lib/cjs/utils/uncontroll.js.map +0 -1
- package/lib/cjs/utils/uniqueID.js +0 -42
- package/lib/cjs/utils/uniqueID.js.map +0 -1
- package/lib/cjs/utils/use/useColorResolver.js +0 -208
- package/lib/cjs/utils/use/useColorResolver.js.map +0 -1
- package/lib/cjs/utils/use/useCss.js +0 -20
- package/lib/cjs/utils/use/useCss.js.map +0 -1
- package/lib/cjs/utils/use/useEnhancedEffect.js +0 -13
- package/lib/cjs/utils/use/useEnhancedEffect.js.map +0 -1
- package/lib/cjs/utils/use/useEventCallback.js +0 -25
- package/lib/cjs/utils/use/useEventCallback.js.map +0 -1
- package/lib/cjs/utils/use/useEventListener.js +0 -33
- package/lib/cjs/utils/use/useEventListener.js.map +0 -1
- package/lib/cjs/utils/use/useFocusLock.js +0 -289
- package/lib/cjs/utils/use/useFocusLock.js.map +0 -1
- package/lib/cjs/utils/use/usePreventScroll.js +0 -78
- package/lib/cjs/utils/use/usePreventScroll.js.map +0 -1
- package/lib/cjs/utils/useCssVariable.js +0 -55
- package/lib/cjs/utils/useCssVariable.js.map +0 -1
- package/lib/cjs/utils/zIndexStacking.js +0 -48
- package/lib/cjs/utils/zIndexStacking.js.map +0 -1
- package/lib/core-types/Component.js +0 -59
- package/lib/core-types/Component.js.map +0 -1
- package/lib/core-types/Component.mjs.map +0 -1
- package/lib/core-types/UnknownProperties.js +0 -2
- package/lib/core-types/UnknownProperties.js.map +0 -1
- package/lib/core-types/UnknownProperties.mjs +0 -3
- package/lib/core-types/UnknownProperties.mjs.map +0 -1
- package/lib/core-types/reshadow.d.js +0 -2
- package/lib/core-types/reshadow.d.js.map +0 -1
- package/lib/core-types/reshadow.d.mjs +0 -2
- package/lib/core-types/reshadow.d.mjs.map +0 -1
- package/lib/core-types/symbols.js +0 -25
- package/lib/core-types/symbols.js.map +0 -1
- package/lib/core-types/symbols.mjs.map +0 -1
- package/lib/enhancement/Children.js +0 -119
- package/lib/enhancement/Children.js.map +0 -1
- package/lib/enhancement/Children.mjs.map +0 -1
- package/lib/enhancement/Root.js +0 -78
- package/lib/enhancement/Root.js.map +0 -1
- package/lib/enhancement/Root.mjs.map +0 -1
- package/lib/enhancement/bindHandler.js +0 -54
- package/lib/enhancement/bindHandler.js.map +0 -1
- package/lib/enhancement/bindHandler.mjs.map +0 -1
- package/lib/enhancement/dataName.js +0 -20
- package/lib/enhancement/dataName.js.map +0 -1
- package/lib/enhancement/dataName.mjs.map +0 -1
- package/lib/enhancement/enhance.js +0 -22
- package/lib/enhancement/enhance.js.map +0 -1
- package/lib/enhancement/enhance.mjs.map +0 -1
- package/lib/enhancement/functionDefaultProps.js +0 -36
- package/lib/enhancement/functionDefaultProps.js.map +0 -1
- package/lib/enhancement/functionDefaultProps.mjs.map +0 -1
- package/lib/enhancement/hoistProps.js +0 -97
- package/lib/enhancement/hoistProps.js.map +0 -1
- package/lib/enhancement/hoistProps.mjs.map +0 -1
- package/lib/enhancement/i18n.js +0 -28
- package/lib/enhancement/i18n.js.map +0 -1
- package/lib/enhancement/i18n.mjs.map +0 -1
- package/lib/enhancement/inheritedName.js +0 -23
- package/lib/enhancement/inheritedName.js.map +0 -1
- package/lib/enhancement/inheritedName.mjs.map +0 -1
- package/lib/enhancement/staticChildren.js +0 -135
- package/lib/enhancement/staticChildren.js.map +0 -1
- package/lib/enhancement/staticChildren.mjs.map +0 -1
- package/lib/enhancement/style.js +0 -60
- package/lib/enhancement/style.js.map +0 -1
- package/lib/enhancement/style.mjs.map +0 -1
- package/lib/enhancement/uncontrolledProps.js +0 -131
- package/lib/enhancement/uncontrolledProps.js.map +0 -1
- package/lib/enhancement/uncontrolledProps.mjs.map +0 -1
- package/lib/es6/LastInteractionType.js +0 -49
- package/lib/es6/LastInteractionType.js.map +0 -1
- package/lib/es6/core-types/Component.js +0 -54
- package/lib/es6/core-types/Component.js.map +0 -1
- package/lib/es6/core-types/UnknownProperties.js +0 -2
- package/lib/es6/core-types/UnknownProperties.js.map +0 -1
- package/lib/es6/core-types/reshadow.d.js +0 -2
- package/lib/es6/core-types/reshadow.d.js.map +0 -1
- package/lib/es6/core-types/symbols.js +0 -10
- package/lib/es6/core-types/symbols.js.map +0 -1
- package/lib/es6/coreFactory.js +0 -343
- package/lib/es6/coreFactory.js.map +0 -1
- package/lib/es6/enhancement/Children.js +0 -111
- package/lib/es6/enhancement/Children.js.map +0 -1
- package/lib/es6/enhancement/Root.js +0 -70
- package/lib/es6/enhancement/Root.js.map +0 -1
- package/lib/es6/enhancement/bindHandler.js +0 -47
- package/lib/es6/enhancement/bindHandler.js.map +0 -1
- package/lib/es6/enhancement/dataName.js +0 -12
- package/lib/es6/enhancement/dataName.js.map +0 -1
- package/lib/es6/enhancement/enhance.js +0 -15
- package/lib/es6/enhancement/enhance.js.map +0 -1
- package/lib/es6/enhancement/functionDefaultProps.js +0 -29
- package/lib/es6/enhancement/functionDefaultProps.js.map +0 -1
- package/lib/es6/enhancement/hoistProps.js +0 -88
- package/lib/es6/enhancement/hoistProps.js.map +0 -1
- package/lib/es6/enhancement/i18n.js +0 -20
- package/lib/es6/enhancement/i18n.js.map +0 -1
- package/lib/es6/enhancement/inheritedName.js +0 -15
- package/lib/es6/enhancement/inheritedName.js.map +0 -1
- package/lib/es6/enhancement/staticChildren.js +0 -123
- package/lib/es6/enhancement/staticChildren.js.map +0 -1
- package/lib/es6/enhancement/style.js +0 -51
- package/lib/es6/enhancement/style.js.map +0 -1
- package/lib/es6/enhancement/uncontrolledProps.js +0 -123
- package/lib/es6/enhancement/uncontrolledProps.js.map +0 -1
- package/lib/es6/index.js +0 -9
- package/lib/es6/index.js.map +0 -1
- package/lib/es6/register.js +0 -29
- package/lib/es6/register.js.map +0 -1
- package/lib/es6/styled/index.js +0 -6
- package/lib/es6/styled/index.js.map +0 -1
- package/lib/es6/styled/reshadow-core.js +0 -243
- package/lib/es6/styled/reshadow-core.js.map +0 -1
- package/lib/es6/styled/sstyled.js +0 -142
- package/lib/es6/styled/sstyled.js.map +0 -1
- package/lib/es6/theme/dark.json +0 -2506
- package/lib/es6/theme/exclude-tokens.json +0 -10
- package/lib/es6/theme/light.json +0 -2584
- package/lib/es6/theme/processor.js +0 -307
- package/lib/es6/theme/processor.js.map +0 -1
- package/lib/es6/theme/themes/auto.css +0 -1465
- package/lib/es6/theme/themes/dark.css +0 -723
- package/lib/es6/theme/themes/dark.js +0 -378
- package/lib/es6/theme/themes/dark.js.map +0 -1
- package/lib/es6/theme/themes/default.css +0 -742
- package/lib/es6/theme/themes/default.js +0 -387
- package/lib/es6/theme/themes/default.js.map +0 -1
- package/lib/es6/theme/themes/light.css +0 -742
- package/lib/es6/theme/themes/light.js +0 -387
- package/lib/es6/theme/themes/light.js.map +0 -1
- package/lib/es6/theme/utils.js +0 -286
- package/lib/es6/theme/utils.js.map +0 -1
- package/lib/es6/utils/CSSinJS.js +0 -28
- package/lib/es6/utils/CSSinJS.js.map +0 -1
- package/lib/es6/utils/ScreenReaderOnly.js +0 -24
- package/lib/es6/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/es6/utils/ThemeProvider.js +0 -71
- package/lib/es6/utils/ThemeProvider.js.map +0 -1
- package/lib/es6/utils/addonText.js +0 -11
- package/lib/es6/utils/addonText.js.map +0 -1
- package/lib/es6/utils/addonTextChildren.js +0 -37
- package/lib/es6/utils/addonTextChildren.js.map +0 -1
- package/lib/es6/utils/ariaProps.js +0 -16
- package/lib/es6/utils/ariaProps.js.map +0 -1
- package/lib/es6/utils/assignProps.js +0 -84
- package/lib/es6/utils/assignProps.js.map +0 -1
- package/lib/es6/utils/canUseDOM.js +0 -4
- package/lib/es6/utils/canUseDOM.js.map +0 -1
- package/lib/es6/utils/capitalizeFirstLetter.js +0 -4
- package/lib/es6/utils/capitalizeFirstLetter.js.map +0 -1
- package/lib/es6/utils/color.js +0 -196
- package/lib/es6/utils/color.js.map +0 -1
- package/lib/es6/utils/compose.js +0 -15
- package/lib/es6/utils/compose.js.map +0 -1
- package/lib/es6/utils/createHoc.js +0 -46
- package/lib/es6/utils/createHoc.js.map +0 -1
- package/lib/es6/utils/createUUID.js +0 -9
- package/lib/es6/utils/createUUID.js.map +0 -1
- package/lib/es6/utils/cssToIntDefault.js +0 -16
- package/lib/es6/utils/cssToIntDefault.js.map +0 -1
- package/lib/es6/utils/enhances/WithAutoFocus.js +0 -67
- package/lib/es6/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/es6/utils/enhances/WithCSS.js +0 -79
- package/lib/es6/utils/enhances/WithCSS.js.map +0 -1
- package/lib/es6/utils/enhances/WithI18n.js +0 -83
- package/lib/es6/utils/enhances/WithI18n.js.map +0 -1
- package/lib/es6/utils/enhances/WithKeyboardFocus.js +0 -84
- package/lib/es6/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/es6/utils/enhances/WithRef.js +0 -18
- package/lib/es6/utils/enhances/WithRef.js.map +0 -1
- package/lib/es6/utils/enhances/a11yEnhance.js +0 -66
- package/lib/es6/utils/enhances/a11yEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/animatedSizeEnhance.js +0 -90
- package/lib/es6/utils/enhances/animatedSizeEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/autoFocusEnhance.js +0 -38
- package/lib/es6/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/contextEnhance.js +0 -14
- package/lib/es6/utils/enhances/contextEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/i18nEnhance.js +0 -92
- package/lib/es6/utils/enhances/i18nEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/keyboardFocusEnhance.js +0 -57
- package/lib/es6/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/es6/utils/enhances/resolveColorEnhance.js +0 -17
- package/lib/es6/utils/enhances/resolveColorEnhance.js.map +0 -1
- package/lib/es6/utils/eventEmitter.js +0 -34
- package/lib/es6/utils/eventEmitter.js.map +0 -1
- package/lib/es6/utils/findComponent.js +0 -95
- package/lib/es6/utils/findComponent.js.map +0 -1
- package/lib/es6/utils/fire.js +0 -15
- package/lib/es6/utils/fire.js.map +0 -1
- package/lib/es6/utils/focus-lock/focusBorders.js +0 -62
- package/lib/es6/utils/focus-lock/focusBorders.js.map +0 -1
- package/lib/es6/utils/focus-lock/getFocusableIn.js +0 -19
- package/lib/es6/utils/focus-lock/getFocusableIn.js.map +0 -1
- package/lib/es6/utils/focus-lock/isFocusInside.js +0 -9
- package/lib/es6/utils/focus-lock/isFocusInside.js.map +0 -1
- package/lib/es6/utils/focus-lock/isFocusable.js +0 -43
- package/lib/es6/utils/focus-lock/isFocusable.js.map +0 -1
- package/lib/es6/utils/focus-lock/setFocus.js +0 -55
- package/lib/es6/utils/focus-lock/setFocus.js.map +0 -1
- package/lib/es6/utils/getAccessibleName.js +0 -49
- package/lib/es6/utils/getAccessibleName.js.map +0 -1
- package/lib/es6/utils/getDisplayName.js +0 -4
- package/lib/es6/utils/getDisplayName.js.map +0 -1
- package/lib/es6/utils/getEventTarget.js +0 -45
- package/lib/es6/utils/getEventTarget.js.map +0 -1
- package/lib/es6/utils/getOriginChildren.js +0 -10
- package/lib/es6/utils/getOriginChildren.js.map +0 -1
- package/lib/es6/utils/getRandomInt.js +0 -5
- package/lib/es6/utils/getRandomInt.js.map +0 -1
- package/lib/es6/utils/getValue.js +0 -10
- package/lib/es6/utils/getValue.js.map +0 -1
- package/lib/es6/utils/hasLabels.js +0 -39
- package/lib/es6/utils/hasLabels.js.map +0 -1
- package/lib/es6/utils/hasParent.js +0 -7
- package/lib/es6/utils/hasParent.js.map +0 -1
- package/lib/es6/utils/if.js +0 -9
- package/lib/es6/utils/if.js.map +0 -1
- package/lib/es6/utils/ifChildren.js +0 -10
- package/lib/es6/utils/ifChildren.js.map +0 -1
- package/lib/es6/utils/injectStyle.js +0 -41
- package/lib/es6/utils/injectStyle.js.map +0 -1
- package/lib/es6/utils/inputProps.js +0 -14
- package/lib/es6/utils/inputProps.js.map +0 -1
- package/lib/es6/utils/isNode.js +0 -21
- package/lib/es6/utils/isNode.js.map +0 -1
- package/lib/es6/utils/isPromise.js +0 -4
- package/lib/es6/utils/isPromise.js.map +0 -1
- package/lib/es6/utils/isRetina.js +0 -9
- package/lib/es6/utils/isRetina.js.map +0 -1
- package/lib/es6/utils/logger.js +0 -32
- package/lib/es6/utils/logger.js.map +0 -1
- package/lib/es6/utils/numericChecker.js +0 -27
- package/lib/es6/utils/numericChecker.js.map +0 -1
- package/lib/es6/utils/ownerDocument.js +0 -4
- package/lib/es6/utils/ownerDocument.js.map +0 -1
- package/lib/es6/utils/pick.js +0 -13
- package/lib/es6/utils/pick.js.map +0 -1
- package/lib/es6/utils/propsForElement.js +0 -50
- package/lib/es6/utils/propsForElement.js.map +0 -1
- package/lib/es6/utils/rafTrottle.js +0 -26
- package/lib/es6/utils/rafTrottle.js.map +0 -1
- package/lib/es6/utils/reactToText.js +0 -26
- package/lib/es6/utils/reactToText.js.map +0 -1
- package/lib/es6/utils/ref.js +0 -83
- package/lib/es6/utils/ref.js.map +0 -1
- package/lib/es6/utils/setRef.js +0 -3
- package/lib/es6/utils/setRef.js.map +0 -1
- package/lib/es6/utils/syncScroll.js +0 -54
- package/lib/es6/utils/syncScroll.js.map +0 -1
- package/lib/es6/utils/uncontroll.js +0 -38
- package/lib/es6/utils/uncontroll.js.map +0 -1
- package/lib/es6/utils/uniqueID.js +0 -33
- package/lib/es6/utils/uniqueID.js.map +0 -1
- package/lib/es6/utils/use/useColorResolver.js +0 -200
- package/lib/es6/utils/use/useColorResolver.js.map +0 -1
- package/lib/es6/utils/use/useCss.js +0 -12
- package/lib/es6/utils/use/useCss.js.map +0 -1
- package/lib/es6/utils/use/useEnhancedEffect.js +0 -5
- package/lib/es6/utils/use/useEnhancedEffect.js.map +0 -1
- package/lib/es6/utils/use/useEventCallback.js +0 -19
- package/lib/es6/utils/use/useEventCallback.js.map +0 -1
- package/lib/es6/utils/use/useEventListener.js +0 -25
- package/lib/es6/utils/use/useEventListener.js.map +0 -1
- package/lib/es6/utils/use/useFocusLock.js +0 -266
- package/lib/es6/utils/use/useFocusLock.js.map +0 -1
- package/lib/es6/utils/use/usePreventScroll.js +0 -70
- package/lib/es6/utils/use/usePreventScroll.js.map +0 -1
- package/lib/es6/utils/useCssVariable.js +0 -46
- package/lib/es6/utils/useCssVariable.js.map +0 -1
- package/lib/es6/utils/zIndexStacking.js +0 -38
- package/lib/es6/utils/zIndexStacking.js.map +0 -1
- package/lib/register.js +0 -37
- package/lib/register.js.map +0 -1
- package/lib/register.mjs.map +0 -1
- package/lib/styled/index.js +0 -32
- package/lib/styled/index.js.map +0 -1
- package/lib/styled/index.mjs +0 -6
- package/lib/styled/index.mjs.map +0 -1
- package/lib/styled/reshadow-core.js +0 -256
- package/lib/styled/reshadow-core.js.map +0 -1
- package/lib/styled/reshadow-core.mjs.map +0 -1
- package/lib/styled/sstyled.js +0 -149
- package/lib/styled/sstyled.js.map +0 -1
- package/lib/styled/sstyled.mjs.map +0 -1
- package/lib/theme/processor.js +0 -315
- package/lib/theme/processor.js.map +0 -1
- package/lib/theme/processor.mjs +0 -307
- package/lib/theme/processor.mjs.map +0 -1
- package/lib/theme/themes/dark.js +0 -385
- package/lib/theme/themes/dark.js.map +0 -1
- package/lib/theme/themes/dark.mjs +0 -378
- package/lib/theme/themes/dark.mjs.map +0 -1
- package/lib/theme/themes/default.js +0 -394
- package/lib/theme/themes/default.js.map +0 -1
- package/lib/theme/themes/default.mjs +0 -387
- package/lib/theme/themes/default.mjs.map +0 -1
- package/lib/theme/themes/light.js +0 -394
- package/lib/theme/themes/light.js.map +0 -1
- package/lib/theme/themes/light.mjs +0 -387
- package/lib/theme/themes/light.mjs.map +0 -1
- package/lib/theme/utils.js +0 -297
- package/lib/theme/utils.js.map +0 -1
- package/lib/theme/utils.mjs +0 -286
- package/lib/theme/utils.mjs.map +0 -1
- package/lib/types/LastInteractionType.d.ts +0 -11
- package/lib/types/core-types/UnknownProperties.d.ts +0 -3
- package/lib/types/core-types/symbols.d.ts +0 -9
- package/lib/types/register.d.ts +0 -8
- package/lib/types/styled/index.d.ts +0 -11
- package/lib/types/styled/reshadow-core.d.ts +0 -37
- package/lib/types/styled/sstyled.d.ts +0 -17
- package/lib/types/theme/themes/default.d.ts +0 -387
- package/lib/types/utils/CSSinJS.d.ts +0 -5
- package/lib/types/utils/ScreenReaderOnly.d.ts +0 -8
- package/lib/types/utils/ThemeProvider.d.ts +0 -15
- package/lib/types/utils/addonText.d.ts +0 -2
- package/lib/types/utils/addonTextChildren.d.ts +0 -3
- package/lib/types/utils/ariaProps.d.ts +0 -12
- package/lib/types/utils/assignProps.d.ts +0 -11
- package/lib/types/utils/canUseDOM.d.ts +0 -1
- package/lib/types/utils/capitalizeFirstLetter.d.ts +0 -1
- package/lib/types/utils/color.d.ts +0 -5
- package/lib/types/utils/compose.d.ts +0 -1
- package/lib/types/utils/createHoc.d.ts +0 -3
- package/lib/types/utils/createUUID.d.ts +0 -1
- package/lib/types/utils/cssToIntDefault.d.ts +0 -8
- package/lib/types/utils/enhances/WithAutoFocus.d.ts +0 -14
- package/lib/types/utils/enhances/WithCSS.d.ts +0 -41
- package/lib/types/utils/enhances/WithI18n.d.ts +0 -43
- package/lib/types/utils/enhances/WithKeyboardFocus.d.ts +0 -45
- package/lib/types/utils/enhances/WithRef.d.ts +0 -3
- package/lib/types/utils/enhances/a11yEnhance.d.ts +0 -10
- package/lib/types/utils/enhances/animatedSizeEnhance.d.ts +0 -12
- package/lib/types/utils/enhances/autoFocusEnhance.d.ts +0 -10
- package/lib/types/utils/enhances/contextEnhance.d.ts +0 -3
- package/lib/types/utils/enhances/i18nEnhance.d.ts +0 -25
- package/lib/types/utils/enhances/keyboardFocusEnhance.d.ts +0 -27
- package/lib/types/utils/enhances/resolveColorEnhance.d.ts +0 -2
- package/lib/types/utils/eventEmitter.d.ts +0 -9
- package/lib/types/utils/findComponent.d.ts +0 -12
- package/lib/types/utils/fire.d.ts +0 -2
- package/lib/types/utils/focus-lock/focusBorders.d.ts +0 -4
- package/lib/types/utils/focus-lock/getFocusableIn.d.ts +0 -1
- package/lib/types/utils/focus-lock/isFocusInside.d.ts +0 -1
- package/lib/types/utils/focus-lock/isFocusable.d.ts +0 -1
- package/lib/types/utils/focus-lock/setFocus.d.ts +0 -1
- package/lib/types/utils/getAccessibleName.d.ts +0 -1
- package/lib/types/utils/getDisplayName.d.ts +0 -2
- package/lib/types/utils/getEventTarget.d.ts +0 -1
- package/lib/types/utils/getOriginChildren.d.ts +0 -2
- package/lib/types/utils/getRandomInt.d.ts +0 -1
- package/lib/types/utils/getValue.d.ts +0 -1
- package/lib/types/utils/hasLabels.d.ts +0 -7
- package/lib/types/utils/hasParent.d.ts +0 -1
- package/lib/types/utils/if.d.ts +0 -11
- package/lib/types/utils/ifChildren.d.ts +0 -8
- package/lib/types/utils/injectStyle.d.ts +0 -2
- package/lib/types/utils/inputProps.d.ts +0 -2
- package/lib/types/utils/isNode.d.ts +0 -1
- package/lib/types/utils/isPromise.d.ts +0 -1
- package/lib/types/utils/isRetina.d.ts +0 -1
- package/lib/types/utils/logger.d.ts +0 -9
- package/lib/types/utils/numericChecker.d.ts +0 -5
- package/lib/types/utils/ownerDocument.d.ts +0 -1
- package/lib/types/utils/pick.d.ts +0 -1
- package/lib/types/utils/propsForElement.d.ts +0 -3
- package/lib/types/utils/rafTrottle.d.ts +0 -2
- package/lib/types/utils/reactToText.d.ts +0 -3
- package/lib/types/utils/ref.d.ts +0 -8
- package/lib/types/utils/setRef.d.ts +0 -2
- package/lib/types/utils/syncScroll.d.ts +0 -1
- package/lib/types/utils/uncontroll.d.ts +0 -4
- package/lib/types/utils/uniqueID.d.ts +0 -12
- package/lib/types/utils/use/useColorResolver.d.ts +0 -1
- package/lib/types/utils/use/useCss.d.ts +0 -4
- package/lib/types/utils/use/useEnhancedEffect.d.ts +0 -3
- package/lib/types/utils/use/useEventCallback.d.ts +0 -4
- package/lib/types/utils/use/useEventListener.d.ts +0 -2
- package/lib/types/utils/use/useFocusLock.d.ts +0 -10
- package/lib/types/utils/use/usePreventScroll.d.ts +0 -2
- package/lib/types/utils/useCssVariable.d.ts +0 -8
- package/lib/types/utils/zIndexStacking.d.ts +0 -8
- package/lib/utils/CSSinJS.js +0 -36
- package/lib/utils/CSSinJS.js.map +0 -1
- package/lib/utils/CSSinJS.mjs +0 -28
- package/lib/utils/CSSinJS.mjs.map +0 -1
- package/lib/utils/ScreenReaderOnly.js +0 -31
- package/lib/utils/ScreenReaderOnly.js.map +0 -1
- package/lib/utils/ScreenReaderOnly.mjs +0 -24
- package/lib/utils/ScreenReaderOnly.mjs.map +0 -1
- package/lib/utils/ThemeProvider.js +0 -82
- package/lib/utils/ThemeProvider.js.map +0 -1
- package/lib/utils/ThemeProvider.mjs +0 -71
- package/lib/utils/ThemeProvider.mjs.map +0 -1
- package/lib/utils/addonText.js +0 -18
- package/lib/utils/addonText.js.map +0 -1
- package/lib/utils/addonText.mjs +0 -11
- package/lib/utils/addonText.mjs.map +0 -1
- package/lib/utils/addonTextChildren.js +0 -45
- package/lib/utils/addonTextChildren.js.map +0 -1
- package/lib/utils/addonTextChildren.mjs +0 -37
- package/lib/utils/addonTextChildren.mjs.map +0 -1
- package/lib/utils/ariaProps.js +0 -22
- package/lib/utils/ariaProps.js.map +0 -1
- package/lib/utils/ariaProps.mjs +0 -16
- package/lib/utils/ariaProps.mjs.map +0 -1
- package/lib/utils/assignProps.js +0 -93
- package/lib/utils/assignProps.js.map +0 -1
- package/lib/utils/assignProps.mjs.map +0 -1
- package/lib/utils/canUseDOM.js +0 -10
- package/lib/utils/canUseDOM.js.map +0 -1
- package/lib/utils/canUseDOM.mjs.map +0 -1
- package/lib/utils/capitalizeFirstLetter.js +0 -10
- package/lib/utils/capitalizeFirstLetter.js.map +0 -1
- package/lib/utils/capitalizeFirstLetter.mjs.map +0 -1
- package/lib/utils/color.js +0 -208
- package/lib/utils/color.js.map +0 -1
- package/lib/utils/color.mjs +0 -196
- package/lib/utils/color.mjs.map +0 -1
- package/lib/utils/compose.js +0 -21
- package/lib/utils/compose.js.map +0 -1
- package/lib/utils/compose.mjs +0 -15
- package/lib/utils/compose.mjs.map +0 -1
- package/lib/utils/createHoc.js +0 -55
- package/lib/utils/createHoc.js.map +0 -1
- package/lib/utils/createHoc.mjs +0 -46
- package/lib/utils/createHoc.mjs.map +0 -1
- package/lib/utils/createUUID.js +0 -15
- package/lib/utils/createUUID.js.map +0 -1
- package/lib/utils/createUUID.mjs +0 -9
- package/lib/utils/createUUID.mjs.map +0 -1
- package/lib/utils/cssToIntDefault.js +0 -22
- package/lib/utils/cssToIntDefault.js.map +0 -1
- package/lib/utils/cssToIntDefault.mjs +0 -16
- package/lib/utils/cssToIntDefault.mjs.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.js +0 -75
- package/lib/utils/enhances/WithAutoFocus.js.map +0 -1
- package/lib/utils/enhances/WithAutoFocus.mjs +0 -67
- package/lib/utils/enhances/WithAutoFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithCSS.js +0 -93
- package/lib/utils/enhances/WithCSS.js.map +0 -1
- package/lib/utils/enhances/WithCSS.mjs +0 -79
- package/lib/utils/enhances/WithCSS.mjs.map +0 -1
- package/lib/utils/enhances/WithI18n.js +0 -95
- package/lib/utils/enhances/WithI18n.js.map +0 -1
- package/lib/utils/enhances/WithI18n.mjs.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.js +0 -93
- package/lib/utils/enhances/WithKeyboardFocus.js.map +0 -1
- package/lib/utils/enhances/WithKeyboardFocus.mjs +0 -84
- package/lib/utils/enhances/WithKeyboardFocus.mjs.map +0 -1
- package/lib/utils/enhances/WithRef.js +0 -26
- package/lib/utils/enhances/WithRef.js.map +0 -1
- package/lib/utils/enhances/WithRef.mjs +0 -18
- package/lib/utils/enhances/WithRef.mjs.map +0 -1
- package/lib/utils/enhances/a11yEnhance.js +0 -74
- package/lib/utils/enhances/a11yEnhance.js.map +0 -1
- package/lib/utils/enhances/a11yEnhance.mjs +0 -66
- package/lib/utils/enhances/a11yEnhance.mjs.map +0 -1
- package/lib/utils/enhances/animatedSizeEnhance.js +0 -98
- package/lib/utils/enhances/animatedSizeEnhance.js.map +0 -1
- package/lib/utils/enhances/animatedSizeEnhance.mjs +0 -90
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.js +0 -46
- package/lib/utils/enhances/autoFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/autoFocusEnhance.mjs +0 -38
- package/lib/utils/enhances/autoFocusEnhance.mjs.map +0 -1
- package/lib/utils/enhances/contextEnhance.js +0 -22
- package/lib/utils/enhances/contextEnhance.js.map +0 -1
- package/lib/utils/enhances/contextEnhance.mjs +0 -14
- package/lib/utils/enhances/contextEnhance.mjs.map +0 -1
- package/lib/utils/enhances/i18nEnhance.js +0 -101
- package/lib/utils/enhances/i18nEnhance.js.map +0 -1
- package/lib/utils/enhances/i18nEnhance.mjs +0 -92
- package/lib/utils/enhances/i18nEnhance.mjs.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.js +0 -63
- package/lib/utils/enhances/keyboardFocusEnhance.js.map +0 -1
- package/lib/utils/enhances/keyboardFocusEnhance.mjs +0 -57
- package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +0 -1
- package/lib/utils/enhances/resolveColorEnhance.js +0 -25
- package/lib/utils/enhances/resolveColorEnhance.js.map +0 -1
- package/lib/utils/enhances/resolveColorEnhance.mjs +0 -17
- package/lib/utils/enhances/resolveColorEnhance.mjs.map +0 -1
- package/lib/utils/eventEmitter.js +0 -41
- package/lib/utils/eventEmitter.js.map +0 -1
- package/lib/utils/eventEmitter.mjs +0 -34
- package/lib/utils/eventEmitter.mjs.map +0 -1
- package/lib/utils/findComponent.js +0 -106
- package/lib/utils/findComponent.js.map +0 -1
- package/lib/utils/findComponent.mjs +0 -95
- package/lib/utils/findComponent.mjs.map +0 -1
- package/lib/utils/fire.js +0 -23
- package/lib/utils/fire.js.map +0 -1
- package/lib/utils/fire.mjs +0 -15
- package/lib/utils/fire.mjs.map +0 -1
- package/lib/utils/focus-lock/focusBorders.js +0 -72
- package/lib/utils/focus-lock/focusBorders.js.map +0 -1
- package/lib/utils/focus-lock/focusBorders.mjs +0 -62
- package/lib/utils/focus-lock/focusBorders.mjs.map +0 -1
- package/lib/utils/focus-lock/getFocusableIn.js +0 -26
- package/lib/utils/focus-lock/getFocusableIn.js.map +0 -1
- package/lib/utils/focus-lock/getFocusableIn.mjs +0 -19
- package/lib/utils/focus-lock/getFocusableIn.mjs.map +0 -1
- package/lib/utils/focus-lock/isFocusInside.js +0 -16
- package/lib/utils/focus-lock/isFocusInside.js.map +0 -1
- package/lib/utils/focus-lock/isFocusInside.mjs +0 -9
- package/lib/utils/focus-lock/isFocusInside.mjs.map +0 -1
- package/lib/utils/focus-lock/isFocusable.js +0 -51
- package/lib/utils/focus-lock/isFocusable.js.map +0 -1
- package/lib/utils/focus-lock/isFocusable.mjs +0 -43
- package/lib/utils/focus-lock/isFocusable.mjs.map +0 -1
- package/lib/utils/focus-lock/setFocus.js +0 -63
- package/lib/utils/focus-lock/setFocus.js.map +0 -1
- package/lib/utils/focus-lock/setFocus.mjs +0 -55
- package/lib/utils/focus-lock/setFocus.mjs.map +0 -1
- package/lib/utils/getAccessibleName.js +0 -56
- package/lib/utils/getAccessibleName.js.map +0 -1
- package/lib/utils/getAccessibleName.mjs +0 -49
- package/lib/utils/getAccessibleName.mjs.map +0 -1
- package/lib/utils/getDisplayName.js +0 -10
- package/lib/utils/getDisplayName.js.map +0 -1
- package/lib/utils/getDisplayName.mjs +0 -4
- package/lib/utils/getDisplayName.mjs.map +0 -1
- package/lib/utils/getEventTarget.js +0 -53
- package/lib/utils/getEventTarget.js.map +0 -1
- package/lib/utils/getEventTarget.mjs +0 -45
- package/lib/utils/getEventTarget.mjs.map +0 -1
- package/lib/utils/getOriginChildren.js +0 -18
- package/lib/utils/getOriginChildren.js.map +0 -1
- package/lib/utils/getOriginChildren.mjs +0 -10
- package/lib/utils/getOriginChildren.mjs.map +0 -1
- package/lib/utils/getRandomInt.js +0 -11
- package/lib/utils/getRandomInt.js.map +0 -1
- package/lib/utils/getRandomInt.mjs +0 -5
- package/lib/utils/getRandomInt.mjs.map +0 -1
- package/lib/utils/getValue.js +0 -16
- package/lib/utils/getValue.js.map +0 -1
- package/lib/utils/getValue.mjs +0 -10
- package/lib/utils/getValue.mjs.map +0 -1
- package/lib/utils/hasLabels.js +0 -47
- package/lib/utils/hasLabels.js.map +0 -1
- package/lib/utils/hasLabels.mjs +0 -39
- package/lib/utils/hasLabels.mjs.map +0 -1
- package/lib/utils/hasParent.js +0 -14
- package/lib/utils/hasParent.js.map +0 -1
- package/lib/utils/hasParent.mjs +0 -7
- package/lib/utils/hasParent.mjs.map +0 -1
- package/lib/utils/if.js +0 -16
- package/lib/utils/if.js.map +0 -1
- package/lib/utils/if.mjs +0 -9
- package/lib/utils/if.mjs.map +0 -1
- package/lib/utils/ifChildren.js +0 -17
- package/lib/utils/ifChildren.js.map +0 -1
- package/lib/utils/ifChildren.mjs +0 -10
- package/lib/utils/ifChildren.mjs.map +0 -1
- package/lib/utils/injectStyle.js +0 -49
- package/lib/utils/injectStyle.js.map +0 -1
- package/lib/utils/injectStyle.mjs +0 -41
- package/lib/utils/injectStyle.mjs.map +0 -1
- package/lib/utils/inputProps.js +0 -22
- package/lib/utils/inputProps.js.map +0 -1
- package/lib/utils/inputProps.mjs +0 -14
- package/lib/utils/inputProps.mjs.map +0 -1
- package/lib/utils/isNode.js +0 -28
- package/lib/utils/isNode.js.map +0 -1
- package/lib/utils/isNode.mjs +0 -21
- package/lib/utils/isNode.mjs.map +0 -1
- package/lib/utils/isPromise.js +0 -10
- package/lib/utils/isPromise.js.map +0 -1
- package/lib/utils/isPromise.mjs +0 -4
- package/lib/utils/isPromise.mjs.map +0 -1
- package/lib/utils/isRetina.js +0 -15
- package/lib/utils/isRetina.js.map +0 -1
- package/lib/utils/isRetina.mjs +0 -9
- package/lib/utils/isRetina.mjs.map +0 -1
- package/lib/utils/logger.js +0 -40
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/logger.mjs.map +0 -1
- package/lib/utils/numericChecker.js +0 -33
- package/lib/utils/numericChecker.js.map +0 -1
- package/lib/utils/numericChecker.mjs +0 -27
- package/lib/utils/numericChecker.mjs.map +0 -1
- package/lib/utils/ownerDocument.js +0 -10
- package/lib/utils/ownerDocument.js.map +0 -1
- package/lib/utils/ownerDocument.mjs +0 -4
- package/lib/utils/ownerDocument.mjs.map +0 -1
- package/lib/utils/pick.js +0 -19
- package/lib/utils/pick.js.map +0 -1
- package/lib/utils/pick.mjs.map +0 -1
- package/lib/utils/propsForElement.js +0 -59
- package/lib/utils/propsForElement.js.map +0 -1
- package/lib/utils/propsForElement.mjs +0 -50
- package/lib/utils/propsForElement.mjs.map +0 -1
- package/lib/utils/rafTrottle.js +0 -33
- package/lib/utils/rafTrottle.js.map +0 -1
- package/lib/utils/rafTrottle.mjs +0 -26
- package/lib/utils/rafTrottle.mjs.map +0 -1
- package/lib/utils/reactToText.js +0 -33
- package/lib/utils/reactToText.js.map +0 -1
- package/lib/utils/reactToText.mjs +0 -26
- package/lib/utils/reactToText.mjs.map +0 -1
- package/lib/utils/ref.js +0 -95
- package/lib/utils/ref.js.map +0 -1
- package/lib/utils/ref.mjs.map +0 -1
- package/lib/utils/setRef.js +0 -10
- package/lib/utils/setRef.js.map +0 -1
- package/lib/utils/setRef.mjs +0 -3
- package/lib/utils/setRef.mjs.map +0 -1
- package/lib/utils/syncScroll.js +0 -61
- package/lib/utils/syncScroll.js.map +0 -1
- package/lib/utils/syncScroll.mjs +0 -54
- package/lib/utils/syncScroll.mjs.map +0 -1
- package/lib/utils/uncontroll.js +0 -47
- package/lib/utils/uncontroll.js.map +0 -1
- package/lib/utils/uncontroll.mjs +0 -38
- package/lib/utils/uncontroll.mjs.map +0 -1
- package/lib/utils/uniqueID.js +0 -42
- package/lib/utils/uniqueID.js.map +0 -1
- package/lib/utils/uniqueID.mjs +0 -33
- package/lib/utils/uniqueID.mjs.map +0 -1
- package/lib/utils/use/useColorResolver.js +0 -208
- package/lib/utils/use/useColorResolver.js.map +0 -1
- package/lib/utils/use/useColorResolver.mjs +0 -200
- package/lib/utils/use/useColorResolver.mjs.map +0 -1
- package/lib/utils/use/useCss.js +0 -20
- package/lib/utils/use/useCss.js.map +0 -1
- package/lib/utils/use/useCss.mjs +0 -12
- package/lib/utils/use/useCss.mjs.map +0 -1
- package/lib/utils/use/useEnhancedEffect.js +0 -13
- package/lib/utils/use/useEnhancedEffect.js.map +0 -1
- package/lib/utils/use/useEnhancedEffect.mjs.map +0 -1
- package/lib/utils/use/useEventCallback.js +0 -25
- package/lib/utils/use/useEventCallback.js.map +0 -1
- package/lib/utils/use/useEventCallback.mjs +0 -19
- package/lib/utils/use/useEventCallback.mjs.map +0 -1
- package/lib/utils/use/useEventListener.js +0 -33
- package/lib/utils/use/useEventListener.js.map +0 -1
- package/lib/utils/use/useEventListener.mjs +0 -25
- package/lib/utils/use/useEventListener.mjs.map +0 -1
- package/lib/utils/use/useFocusLock.js +0 -289
- package/lib/utils/use/useFocusLock.js.map +0 -1
- package/lib/utils/use/useFocusLock.mjs +0 -266
- package/lib/utils/use/useFocusLock.mjs.map +0 -1
- package/lib/utils/use/usePreventScroll.js +0 -78
- package/lib/utils/use/usePreventScroll.js.map +0 -1
- package/lib/utils/use/usePreventScroll.mjs +0 -70
- package/lib/utils/use/usePreventScroll.mjs.map +0 -1
- package/lib/utils/useCssVariable.js +0 -55
- package/lib/utils/useCssVariable.js.map +0 -1
- package/lib/utils/useCssVariable.mjs +0 -46
- package/lib/utils/useCssVariable.mjs.map +0 -1
- package/lib/utils/zIndexStacking.js +0 -48
- package/lib/utils/zIndexStacking.js.map +0 -1
- package/lib/utils/zIndexStacking.mjs +0 -38
- package/lib/utils/zIndexStacking.mjs.map +0 -1
- /package/lib/{types/core-types → core-types}/Component.d.ts +0 -0
- /package/lib/{types/coreFactory.d.ts → coreFactory.d.ts} +0 -0
- /package/lib/{types/enhancement → enhancement}/Children.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/Root.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/bindHandler.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/dataName.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/enhance.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/functionDefaultProps.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/hoistProps.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/i18n.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/inheritedName.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/staticChildren.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/style.d.ts +0 -0
- /package/lib/{types/enhancement → enhancement}/uncontrolledProps.d.ts +0 -0
- /package/lib/{types/index.d.ts → index.d.ts} +0 -0
- /package/lib/{types/theme → theme}/processor.d.ts +0 -0
- /package/lib/{types/theme → theme}/themes/dark.d.ts +0 -0
- /package/lib/{types/theme → theme}/themes/light.d.ts +0 -0
- /package/lib/{types/theme → theme}/utils.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uncontrolledProps.js","names":["_assignProps","require","_capitalizeFirstLetter","_interopRequireDefault","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","defaultProp","prop","concat","capitalizeFirstLetter","handlerProp","isControlled","propValue","undefined","uncontrolledProp","self","propName","propDefaultValue","propHandler","chainHandler","getValue","state","value","oldValue","setState","_defineProperty2","_len","arguments","length","args","Array","_key","callAllEventHandlers","apply","_toConsumableArray2","uncontrolledUniversal","props","config","handlerProps","uncontrolledProps","result","_objectSpread2","handlerName","defaultPropName","other","_objectWithoutProperties2","map","_toPropertyKey2","console","warn","setter","isArray","_setter","_setter2","_toArray2","slice","v","_uncontrolledProp","_uncontrolledProp2","_slicedToArray2","handler","_objectSpread3","eventOrValue","_len2","_key2","push","uncontrolled","bind","Enhancement","condition","Component","Boolean","prototype","init","handlers","_uncontrolled","_uncontrolled2","uncontrolledHandlers","context","asProps","_uncontrolled3","_uncontrolled4","_default","exports"],"sources":["../../src/enhancement/uncontrolledProps.tsx"],"sourcesContent":["import { callAllEventHandlers } from '../utils/assignProps';\nimport capitalizeFirstLetter from '../utils/capitalizeFirstLetter';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nfunction defaultProp(prop: any) {\n return `default${capitalizeFirstLetter(prop)}`;\n}\n\nfunction handlerProp(prop: any) {\n if (prop === 'value') prop = '';\n if (prop === 'checked') prop = '';\n return `on${capitalizeFirstLetter(prop)}Change`;\n}\n\nfunction isControlled(propValue: any) {\n return propValue !== undefined;\n}\n\nfunction uncontrolledProp(\n self: any,\n propName: any,\n propValue: any,\n propDefaultValue: any,\n propHandler: any,\n chainHandler: any,\n) {\n function getValue() {\n return isControlled(propValue)\n ? propValue\n : propName in self.state\n ? self.state[propName]\n : propDefaultValue;\n }\n\n return [\n getValue(),\n (value: any, ...args: any[]) => {\n const oldValue = getValue();\n if (oldValue === value) return false;\n if (!isControlled(propValue)) self.setState({ [propName]: value });\n return callAllEventHandlers(propHandler, ...chainHandler)(value, ...args);\n },\n ];\n}\n\nfunction uncontrolledUniversal(props: any, config: any, uncontrolledProp: any) {\n const handlerProps = {};\n const uncontrolledProps = Object.keys(config).reduce((result, propName) => {\n const handlerName = handlerProp(propName);\n const defaultPropName = defaultProp(propName);\n const {\n [defaultPropName]: propDefaultValue,\n [propName]: propValue,\n [handlerName]: propHandler,\n ...other\n } = result;\n\n if (propDefaultValue === undefined) {\n console.warn(defaultPropName, 'must be installed in \"defaultProps\"');\n }\n\n // if (typeof propDefaultValue === 'function' && propDefaultValue.defaultInit) {\n // propDefaultValue = propDefaultValue(result);\n // }\n\n let setter = config[propName];\n let chainHandler = [];\n\n if (Array.isArray(setter)) [setter, ...chainHandler] = setter;\n setter = setter || ((v: any) => v);\n\n const [value, handler] = uncontrolledProp(\n propName,\n propValue,\n propDefaultValue,\n propHandler,\n chainHandler,\n );\n // TODO: need to warn about recursion (by lsroman)\n (handlerProps as any)[propName] = handler;\n\n return {\n ...other,\n [propName]: value,\n [handlerName]: (eventOrValue: any, ...args: any[]) => {\n const result = [setter(eventOrValue, ...args), ...args];\n if (eventOrValue?.target) {\n result.push(eventOrValue);\n }\n return handler(...result);\n },\n };\n }, props);\n return [uncontrolledProps, handlerProps];\n}\n\nfunction uncontrolled(self: any, props: any, config: any) {\n return uncontrolledUniversal(props, config, uncontrolledProp.bind(undefined, self));\n}\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.prototype.uncontrolledProps);\n },\n init: function (this: any) {\n this.state = this.state || {};\n assign(this, {\n get handlers() {\n const [, uncontrolledHandlers] = uncontrolled(this, this.props, this.uncontrolledProps());\n return uncontrolledHandlers;\n },\n });\n },\n context: function (this: any, context: any) {\n return {\n ...context,\n handlers: this.handlers,\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to omit unneccessary props (by lsroman)\n const [uncontrolledProps] = uncontrolled(this, props, this.uncontrolledProps());\n return uncontrolledProps;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uncontrolledProps.mjs","names":["callAllEventHandlers","capitalizeFirstLetter","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","defaultProp","prop","concat","handlerProp","isControlled","propValue","undefined","uncontrolledProp","self","propName","propDefaultValue","propHandler","chainHandler","getValue","state","value","oldValue","setState","_defineProperty","_len","arguments","length","args","Array","_key","apply","_toConsumableArray","uncontrolledUniversal","props","config","handlerProps","uncontrolledProps","result","_objectSpread2","handlerName","defaultPropName","other","_objectWithoutProperties","map","_toPropertyKey","console","warn","setter","isArray","_setter","_setter2","_toArray","slice","v","_uncontrolledProp","_uncontrolledProp2","_slicedToArray","handler","_objectSpread","eventOrValue","_len2","_key2","push","uncontrolled","bind","Enhancement","condition","Component","Boolean","prototype","init","handlers","_uncontrolled","_uncontrolled2","uncontrolledHandlers","context","asProps","_uncontrolled3","_uncontrolled4"],"sources":["../../src/enhancement/uncontrolledProps.tsx"],"sourcesContent":["import { callAllEventHandlers } from '../utils/assignProps';\nimport capitalizeFirstLetter from '../utils/capitalizeFirstLetter';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nfunction defaultProp(prop: any) {\n return `default${capitalizeFirstLetter(prop)}`;\n}\n\nfunction handlerProp(prop: any) {\n if (prop === 'value') prop = '';\n if (prop === 'checked') prop = '';\n return `on${capitalizeFirstLetter(prop)}Change`;\n}\n\nfunction isControlled(propValue: any) {\n return propValue !== undefined;\n}\n\nfunction uncontrolledProp(\n self: any,\n propName: any,\n propValue: any,\n propDefaultValue: any,\n propHandler: any,\n chainHandler: any,\n) {\n function getValue() {\n return isControlled(propValue)\n ? propValue\n : propName in self.state\n ? self.state[propName]\n : propDefaultValue;\n }\n\n return [\n getValue(),\n (value: any, ...args: any[]) => {\n const oldValue = getValue();\n if (oldValue === value) return false;\n if (!isControlled(propValue)) self.setState({ [propName]: value });\n return callAllEventHandlers(propHandler, ...chainHandler)(value, ...args);\n },\n ];\n}\n\nfunction uncontrolledUniversal(props: any, config: any, uncontrolledProp: any) {\n const handlerProps = {};\n const uncontrolledProps = Object.keys(config).reduce((result, propName) => {\n const handlerName = handlerProp(propName);\n const defaultPropName = defaultProp(propName);\n const {\n [defaultPropName]: propDefaultValue,\n [propName]: propValue,\n [handlerName]: propHandler,\n ...other\n } = result;\n\n if (propDefaultValue === undefined) {\n console.warn(defaultPropName, 'must be installed in \"defaultProps\"');\n }\n\n // if (typeof propDefaultValue === 'function' && propDefaultValue.defaultInit) {\n // propDefaultValue = propDefaultValue(result);\n // }\n\n let setter = config[propName];\n let chainHandler = [];\n\n if (Array.isArray(setter)) [setter, ...chainHandler] = setter;\n setter = setter || ((v: any) => v);\n\n const [value, handler] = uncontrolledProp(\n propName,\n propValue,\n propDefaultValue,\n propHandler,\n chainHandler,\n );\n // TODO: need to warn about recursion (by lsroman)\n (handlerProps as any)[propName] = handler;\n\n return {\n ...other,\n [propName]: value,\n [handlerName]: (eventOrValue: any, ...args: any[]) => {\n const result = [setter(eventOrValue, ...args), ...args];\n if (eventOrValue?.target) {\n result.push(eventOrValue);\n }\n return handler(...result);\n },\n };\n }, props);\n return [uncontrolledProps, handlerProps];\n}\n\nfunction uncontrolled(self: any, props: any, config: any) {\n return uncontrolledUniversal(props, config, uncontrolledProp.bind(undefined, self));\n}\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.prototype.uncontrolledProps);\n },\n init: function (this: any) {\n this.state = this.state || {};\n assign(this, {\n get handlers() {\n const [, uncontrolledHandlers] = uncontrolled(this, this.props, this.uncontrolledProps());\n return uncontrolledHandlers;\n },\n });\n },\n context: function (this: any, context: any) {\n return {\n ...context,\n handlers: this.handlers,\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to omit unneccessary props (by lsroman)\n const [uncontrolledProps] = uncontrolled(this, props, this.uncontrolledProps());\n return uncontrolledProps;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"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"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import canUseDOM from './utils/canUseDOM';
|
|
5
|
-
var LastInteractionType = /*#__PURE__*/function () {
|
|
6
|
-
function LastInteractionType() {
|
|
7
|
-
_classCallCheck(this, LastInteractionType);
|
|
8
|
-
_defineProperty(this, "lastFocusSource", 'none');
|
|
9
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
10
|
-
this.handleMouseDown = this.handleMouseDown.bind(this);
|
|
11
|
-
if (canUseDOM()) {
|
|
12
|
-
document.addEventListener('mousedown', this.handleMouseDown, {
|
|
13
|
-
capture: true
|
|
14
|
-
});
|
|
15
|
-
document.addEventListener('keydown', this.handleKeyDown, {
|
|
16
|
-
capture: true
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
_createClass(LastInteractionType, [{
|
|
21
|
-
key: "type",
|
|
22
|
-
get: function get() {
|
|
23
|
-
return this.lastFocusSource;
|
|
24
|
-
}
|
|
25
|
-
}, {
|
|
26
|
-
key: "isKeyboard",
|
|
27
|
-
value: function isKeyboard() {
|
|
28
|
-
return this.lastFocusSource === 'keyboard';
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
key: "isMouse",
|
|
32
|
-
value: function isMouse() {
|
|
33
|
-
return this.lastFocusSource === 'mouse';
|
|
34
|
-
}
|
|
35
|
-
}, {
|
|
36
|
-
key: "handleMouseDown",
|
|
37
|
-
value: function handleMouseDown() {
|
|
38
|
-
this.lastFocusSource = 'mouse';
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
key: "handleKeyDown",
|
|
42
|
-
value: function handleKeyDown() {
|
|
43
|
-
this.lastFocusSource = 'keyboard';
|
|
44
|
-
}
|
|
45
|
-
}]);
|
|
46
|
-
return LastInteractionType;
|
|
47
|
-
}();
|
|
48
|
-
export var lastInteraction = new LastInteractionType();
|
|
49
|
-
//# sourceMappingURL=LastInteractionType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LastInteractionType.js","names":["canUseDOM","LastInteractionType","_classCallCheck","_defineProperty","handleKeyDown","bind","handleMouseDown","document","addEventListener","capture","_createClass","key","get","lastFocusSource","value","isKeyboard","isMouse","lastInteraction"],"sources":["../../src/LastInteractionType.ts"],"sourcesContent":["import canUseDOM from './utils/canUseDOM';\n\nclass LastInteractionType {\n private lastFocusSource: 'mouse' | 'keyboard' | 'none' = 'none';\n\n constructor() {\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleMouseDown = this.handleMouseDown.bind(this);\n\n if (canUseDOM()) {\n document.addEventListener('mousedown', this.handleMouseDown, { capture: true });\n document.addEventListener('keydown', this.handleKeyDown, { capture: true });\n }\n }\n\n public get type() {\n return this.lastFocusSource;\n }\n\n public isKeyboard() {\n return this.lastFocusSource === 'keyboard';\n }\n\n public isMouse() {\n return this.lastFocusSource === 'mouse';\n }\n\n private handleMouseDown() {\n this.lastFocusSource = 'mouse';\n }\n\n private handleKeyDown() {\n this.lastFocusSource = 'keyboard';\n }\n}\n\nexport const lastInteraction = new LastInteractionType();\n"],"mappings":";;;AAAA,OAAOA,SAAS,MAAM,mBAAmB;AAAC,IAEpCC,mBAAmB;EAGvB,SAAAA,oBAAA,EAAc;IAAAC,eAAA,OAAAD,mBAAA;IAAAE,eAAA,0BAF2C,MAAM;IAG7D,IAAI,CAACC,aAAa,GAAG,IAAI,CAACA,aAAa,CAACC,IAAI,CAAC,IAAI,CAAC;IAClD,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACD,IAAI,CAAC,IAAI,CAAC;IAEtD,IAAIL,SAAS,EAAE,EAAE;MACfO,QAAQ,CAACC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAACF,eAAe,EAAE;QAAEG,OAAO,EAAE;MAAK,CAAC,CAAC;MAC/EF,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAACJ,aAAa,EAAE;QAAEK,OAAO,EAAE;MAAK,CAAC,CAAC;IAC7E;EACF;EAACC,YAAA,CAAAT,mBAAA;IAAAU,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAkB;MAChB,OAAO,IAAI,CAACC,eAAe;IAC7B;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAC,WAAA,EAAoB;MAClB,OAAO,IAAI,CAACF,eAAe,KAAK,UAAU;IAC5C;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAE,QAAA,EAAiB;MACf,OAAO,IAAI,CAACH,eAAe,KAAK,OAAO;IACzC;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAR,gBAAA,EAA0B;MACxB,IAAI,CAACO,eAAe,GAAG,OAAO;IAChC;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAV,cAAA,EAAwB;MACtB,IAAI,CAACS,eAAe,GAAG,UAAU;IACnC;EAAC;EAAA,OAAAZ,mBAAA;AAAA;AAGH,OAAO,IAAMgB,eAAe,GAAG,IAAIhB,mBAAmB,EAAE"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
import { PureComponent } from 'react';
|
|
8
|
-
import { CORE_COMPONENT, CREATE_COMPONENT } from './symbols';
|
|
9
|
-
|
|
10
|
-
/** @deprecated */
|
|
11
|
-
|
|
12
|
-
var Root = undefined;
|
|
13
|
-
export { Root };
|
|
14
|
-
|
|
15
|
-
/** @deprecated */
|
|
16
|
-
var RootComponent = /*#__PURE__*/function (_PureComponent) {
|
|
17
|
-
_inherits(RootComponent, _PureComponent);
|
|
18
|
-
var _super = _createSuper(RootComponent);
|
|
19
|
-
function RootComponent() {
|
|
20
|
-
var _this;
|
|
21
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
|
-
args[_key] = arguments[_key];
|
|
23
|
-
}
|
|
24
|
-
_classCallCheck(this, RootComponent);
|
|
25
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
26
|
-
_defineProperty(_assertThisInitialized(_this), "Root", undefined);
|
|
27
|
-
_defineProperty(_assertThisInitialized(_this), "isControlled", false);
|
|
28
|
-
return _this;
|
|
29
|
-
}
|
|
30
|
-
_createClass(RootComponent, [{
|
|
31
|
-
key: "handlers",
|
|
32
|
-
get: function get() {
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
}, {
|
|
36
|
-
key: "asProps",
|
|
37
|
-
get: function get() {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
}]);
|
|
41
|
-
return RootComponent;
|
|
42
|
-
}(PureComponent);
|
|
43
|
-
export var Component = RootComponent;
|
|
44
|
-
/** @deprecated */
|
|
45
|
-
|
|
46
|
-
export var Intergalactic;
|
|
47
|
-
(function (_Intergalactic) {
|
|
48
|
-
var InternalTypings;
|
|
49
|
-
(function (_InternalTypings) {})(InternalTypings || (InternalTypings = _Intergalactic.InternalTypings || (_Intergalactic.InternalTypings = {})));
|
|
50
|
-
})(Intergalactic || (Intergalactic = {}));
|
|
51
|
-
export var wrapIntergalacticComponent = function wrapIntergalacticComponent(wrapper) {
|
|
52
|
-
return wrapper;
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=Component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","names":["PureComponent","CORE_COMPONENT","CREATE_COMPONENT","Root","undefined","RootComponent","_PureComponent","_inherits","_super","_createSuper","_this","_len","arguments","length","args","Array","_key","_classCallCheck","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","key","get","Component","Intergalactic","_Intergalactic","InternalTypings","_InternalTypings","wrapIntergalacticComponent","wrapper"],"sources":["../../../src/core-types/Component.ts"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react';\nimport { IStyledProps } from '../styled/index';\nimport { CORE_COMPONENT, CREATE_COMPONENT } from './symbols';\n\n/** @deprecated */\ntype KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : K;\n} extends { [_ in keyof T]: infer U }\n ? U\n : never;\n\n/** @deprecated */\nexport type HandlersType<UCProps> = { [K in keyof UCProps]?: <T = unknown>(arg: T) => void };\n/** @deprecated */\nexport type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> =\n | ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode)\n | ReactNode;\n\n/** @deprecated */\nexport type RootComponentHandler = (...args: any[]) => void | false;\n\n/** @deprecated */\nexport interface IRootComponentHandlers {\n [key: string]: RootComponentHandler;\n}\n\n/** @deprecated */\nexport interface IRootComponentProps<Props = {}, Ctx = {}> {\n forwardRef?: RefObject<any>;\n Children?: any;\n children?: ChildrenType<Props, Ctx>;\n styles?: IStyledProps['styles'];\n 'data-ui-name'?: string;\n}\n\n/** @deprecated */\nexport type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;\n\n/** @deprecated */\nexport type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> &\n Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & { Root?: Root };\n\n/** @deprecated */\nexport type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<\n Pick<Props, KnownKeys<Props>>,\n 'children'\n> & {\n children?: ChildrenType<Props, Ctx, UCProps>;\n [key: string]: unknown;\n};\n\n/** @deprecated */\nexport type CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\n/** @deprecated */\nexport type ReturnEl = React.ReactElement | null;\n\nexport interface IRootNodeProps {\n render: React.ElementType | string;\n tag?: React.ElementType | string;\n\n [key: string]: any;\n}\n\ntype Root = ForwardRefExoticComponent<IRootNodeProps>;\n\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;\n/**\n * @deprecated since version ^1.8.0\n */\n/** @deprecated */\nexport type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;\n/** @deprecated */\nexport type PropGetterFn = <T extends {}>(props?: T) => T & { [key: string]: unknown };\n/** @deprecated */\nexport type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;\n/** @deprecated */\nexport type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(\n props?: P,\n) => Merge<ReturnType<G1>, ReturnType<G2>> & P;\n\nconst Root: Root = undefined as any;\n\nexport { Root };\n\n/** @deprecated */\nabstract class RootComponent<\n Props = {},\n Context = {},\n State = {},\n Enhance extends readonly ((...args: any[]) => any)[] = [],\n> extends PureComponent<Props, State> {\n get handlers(): Readonly<IRootComponentHandlers> {\n return {};\n }\n\n get asProps() {\n return {} as Readonly<\n Merge<\n Props &\n IRootComponentProps<Props, Context> &\n Intergalactic.InternalTypings.ExtractEnhanceType<Enhance>,\n AllHTMLAttributes<any>\n >\n >;\n }\n\n Root: Root = undefined as any;\n\n isControlled = false;\n}\n\nexport const Component = RootComponent;\n/** @deprecated */\nexport type Component<\n Props = {},\n Context = {},\n State = {},\n Handlers extends IRootComponentHandlers = IRootComponentHandlers,\n> = React.ComponentClass<Props, State> & {\n isControlled: boolean;\n\n handlers: Readonly<Handlers>;\n\n asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;\n\n Root: Root;\n};\n\nexport namespace Intergalactic {\n type ReactFCProps<C extends React.FC> = C extends React.FC<infer Props> ? Omit<Props, 'tag'> : {};\n type ReactComponentProps<C extends React.ComponentClass> = C extends React.ComponentClass<\n infer Props\n >\n ? Omit<Props, 'tag'>\n : never;\n type ReactFCLike = (props: any) => any;\n type ReactFCLikeProps<C extends ReactFCLike> = C extends (props: infer Props) => any ? Props : {};\n type ComponentChildren<\n Props,\n Context,\n RenderingResult = InternalTypings.ReturnResult,\n AdditionalContext extends any[] = never[],\n > =\n | ((props: MergeProps<Context, Props>, ...args: AdditionalContext) => RenderingResult)\n | InternalTypings.ReturnResult;\n type ComponentBasicProps<Tag extends InternalTypings.ComponentTag> = {\n ref?: React.Ref<InternalTypings.ComponentHtmlElement<Tag> | null>;\n /** @private DO NOT USE IT. Low-level api that prevents specified props from being applied as DOM attribute. */\n __excludeProps?: string[];\n };\n type MergeProps<HighPriorityProps, LowPriorityProps> = {\n [K in keyof LowPriorityProps]: K extends keyof HighPriorityProps\n ? HighPriorityProps[K]\n : LowPriorityProps[K];\n } & HighPriorityProps;\n /** @private */\n export namespace InternalTypings {\n export type EfficientOmit<Type, Keys> = {\n [Property in keyof Type as Exclude<Property, Keys>]: Type[Property];\n };\n export type ExtractEnhanceType<F extends readonly ((...args: any[]) => any)[]> =\n F['length'] extends 0\n ? {}\n : F['length'] extends 1\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n }\n : F['length'] extends 2\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n }\n : F['length'] extends 3\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n }\n : F['length'] extends 4\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n } & {\n [K in keyof ReturnType<F[3]>]: ReturnType<F[3]>[K];\n }\n : {};\n export type ComponentPropsNesting<Tag extends InternalTypings.ComponentTag> = Omit<\n MergeProps<\n Tag extends React.FC\n ? ReactFCProps<Tag>\n : Tag extends React.ComponentClass\n ? ReactComponentProps<Tag>\n : Tag extends ReactFCLike\n ? ReactFCLikeProps<Tag>\n : Tag extends keyof JSX.IntrinsicElements\n ? JSX.IntrinsicElements[Tag]\n : {},\n Tag extends { __nestedProps: infer NestedProps } ? NestedProps : {}\n >,\n 'children' | 'tag'\n >;\n export type ReturnResult =\n | React.ReactElement\n | React.ReactNode\n | React.ReactNode[]\n | string\n | null;\n export type ComponentTag =\n | keyof JSX.IntrinsicElements\n | React.ComponentClass\n | React.FC\n | ReactFCLike;\n export type ComponentProps<\n Tag extends ComponentTag,\n BaseTag extends ComponentTag | never,\n Props,\n Context = never,\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n ReturnResult,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<\n EfficientOmit<Props, 'tag' | 'children'>,\n MergeProps<ComponentPropsNesting<Tag>, ComponentPropsNesting<BaseTag>>\n >;\n export type PropsRenderingResultComponentProps<\n Tag extends ComponentTag,\n Props,\n Context = {},\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n Partial<\n EfficientOmit<\n MergeProps<Props, ComponentPropsNesting<Tag>>,\n 'children' | 'tag' | 'ref'\n > & {\n children?: React.ReactNode;\n }\n >,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<EfficientOmit<Props, 'tag' | 'children'>, ComponentPropsNesting<Tag>>;\n export type ComponentRenderingResults = React.ReactElement;\n export type ComponentAdditive<\n BaseTag extends ComponentTag,\n Tag extends ComponentTag,\n Props = {},\n Context = {},\n AdditionalContext = {},\n > = {\n __nestedProps: ComponentPropsNesting<BaseTag>;\n __tag: Tag;\n __props: Props;\n __context: Context;\n __additionalContext: AdditionalContext;\n displayName: string;\n };\n export type InferJsxIntrinsicElement<T extends React.DetailedHTMLProps<any, any>> =\n T extends React.DetailedHTMLProps<infer _, infer Element> ? Element : HTMLElement;\n type InferElementFromRef<T> = T extends React.Ref<infer Element> ? Element : never;\n type InferRefElementFromProps<T> = 'ref' extends keyof T\n ? InferElementFromRef<T['ref']>\n : HTMLElement;\n export type ComponentHtmlElement<Tag extends ComponentTag> =\n Tag extends keyof JSX.IntrinsicElements\n ? InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>\n : Tag extends { __nestedProps: infer NestedProps }\n ? InferRefElementFromProps<NestedProps>\n : HTMLElement;\n export type UntypeRefAndTag<Props> = Intergalactic.InternalTypings.EfficientOmit<\n Props,\n 'ref' | 'tag'\n > & {\n ref: React.Ref<any>;\n tag: Intergalactic.InternalTypings.ComponentTag;\n };\n }\n export type Component<\n BaseTag extends InternalTypings.ComponentTag = never,\n BaseProps = {},\n Context = {},\n AdditionalContext extends any[] = never[],\n > = (<Tag extends InternalTypings.ComponentTag = BaseTag, Props extends BaseProps = BaseProps>(\n props: InternalTypings.ComponentProps<Tag, BaseTag, Props, Context, AdditionalContext>,\n ) => InternalTypings.ComponentRenderingResults) &\n InternalTypings.ComponentAdditive<BaseTag, Tag, BaseProps, Context, AdditionalContext>;\n export type Tag = InternalTypings.ComponentTag;\n export type DomProps<Tag extends keyof JSX.IntrinsicElements> =\n InternalTypings.InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>;\n export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n > &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n}\n\nexport const wrapIntergalacticComponent = <\n Component extends Intergalactic.Component<any, any, any, any>,\n PropsExtending = {},\n>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<Component>\n > &\n PropsExtending,\n ) => React.ReactNode,\n): Intergalactic.Component<\n Component['__tag'],\n Component['__props'] & Component['__nestedProps'] & PropsExtending,\n Component['__context'],\n Component['__additionalContext']\n> => wrapper as any;\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"],"mappings":";;;;;;AAAA,SAGEA,aAAa,QAIR,OAAO;AAEd,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,WAAW;;AAE5D;;AAiFA,IAAMC,IAAU,GAAGC,SAAgB;AAEnC,SAASD,IAAI;;AAEb;AAAA,IACeE,aAAa,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAAA,SAAAA,cAAA;IAAA,IAAAK,KAAA;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAC,eAAA,OAAAZ,aAAA;IAAAK,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAN,IAAA;IAAAO,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,WAqBbN,SAAS;IAAAiB,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,mBAEP,KAAK;IAAA,OAAAA,KAAA;EAAA;EAAAa,YAAA,CAAAlB,aAAA;IAAAmB,GAAA;IAAAC,GAAA,EAjBpB,SAAAA,IAAA,EAAiD;MAC/C,OAAO,CAAC,CAAC;IACX;EAAC;IAAAD,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAc;MACZ,OAAO,CAAC,CAAC;IAQX;EAAC;EAAA,OAAApB,aAAA;AAAA,EAdOL,aAAa;AAqBvB,OAAO,IAAM0B,SAAS,GAAGrB,aAAa;AACtC;;AAgBA,WAAAsB,aAAA;AAyLC,WAAAC,cAAA;EAAA,IAAAC,eAAA;EAAA,WAAAC,gBAAA,MA7JkBD,eAAe,KAAfA,eAAe,GAAAD,cAAA,CAAfC,eAAe,KAAAD,cAAA,CAAfC,eAAe;AAAA,GA5BjBF,aAAa,KAAbA,aAAa;AA2L9B,OAAO,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAIrCC,OAKoB;EAAA,OAMjBA,OAAO;AAAA,CAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnknownProperties.js","names":[],"sources":["../../../src/core-types/UnknownProperties.ts"],"sourcesContent":["export type UnknownProperties = {\n [key: string]: unknown;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reshadow.d.js","names":[],"sources":["../../../src/core-types/reshadow.d.ts"],"sourcesContent":["declare module 'hoist-non-react-statics' {\n const hoistNonReactStatics: any;\n export default hoistNonReactStatics;\n}\n"],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export var CORE_COMPONENT = Symbol('CORE_COMPONENT');
|
|
2
|
-
export var CORE_INSTANCE = Symbol('CORE_INSTANCE');
|
|
3
|
-
export var CORE_AS_PROPS = Symbol('CORE_AS_PROPS');
|
|
4
|
-
export var CORE_INIT = Symbol('CORE_INIT');
|
|
5
|
-
export var CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');
|
|
6
|
-
export var CREATE_COMPONENT = Symbol('CREATE_COMPONENT');
|
|
7
|
-
export var PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');
|
|
8
|
-
export var CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');
|
|
9
|
-
export var INHERITED_NAME = Symbol('INHERITED_NAME');
|
|
10
|
-
//# sourceMappingURL=symbols.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","names":["CORE_COMPONENT","Symbol","CORE_INSTANCE","CORE_AS_PROPS","CORE_INIT","CONTEXT_COMPONENT","CREATE_COMPONENT","PARENT_COMPONENTS","CHILDREN_COMPONENT","INHERITED_NAME"],"sources":["../../../src/core-types/symbols.ts"],"sourcesContent":["export const CORE_COMPONENT = Symbol('CORE_COMPONENT');\nexport const CORE_INSTANCE = Symbol('CORE_INSTANCE');\nexport const CORE_AS_PROPS = Symbol('CORE_AS_PROPS');\nexport const CORE_INIT = Symbol('CORE_INIT');\nexport const CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');\nexport const CREATE_COMPONENT = Symbol('CREATE_COMPONENT');\nexport const PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');\nexport const CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');\nexport const INHERITED_NAME = Symbol('INHERITED_NAME');\n"],"mappings":"AAAA,OAAO,IAAMA,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AACtD,OAAO,IAAMC,aAAa,GAAGD,MAAM,CAAC,eAAe,CAAC;AACpD,OAAO,IAAME,aAAa,GAAGF,MAAM,CAAC,eAAe,CAAC;AACpD,OAAO,IAAMG,SAAS,GAAGH,MAAM,CAAC,WAAW,CAAC;AAC5C,OAAO,IAAMI,iBAAiB,GAAGJ,MAAM,CAAC,mBAAmB,CAAC;AAC5D,OAAO,IAAMK,gBAAgB,GAAGL,MAAM,CAAC,kBAAkB,CAAC;AAC1D,OAAO,IAAMM,iBAAiB,GAAGN,MAAM,CAAC,mBAAmB,CAAC;AAC5D,OAAO,IAAMO,kBAAkB,GAAGP,MAAM,CAAC,oBAAoB,CAAC;AAC9D,OAAO,IAAMQ,cAAc,GAAGR,MAAM,CAAC,gBAAgB,CAAC"}
|
package/lib/es6/coreFactory.js
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
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
|