@semcore/core 17.0.0 → 17.0.1-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -111
- package/README.md +35 -5
- package/lib/LastInteractionType.js +36 -22
- package/lib/LastInteractionType.js.map +1 -1
- package/lib/LastInteractionType.mjs +33 -19
- package/lib/LastInteractionType.mjs.map +1 -1
- package/lib/core-types/Component.js +41 -25
- package/lib/core-types/Component.js.map +1 -1
- package/lib/core-types/Component.mjs +38 -18
- package/lib/core-types/Component.mjs.map +1 -1
- package/lib/core-types/symbols.js +9 -9
- package/lib/core-types/symbols.js.map +1 -1
- package/lib/core-types/symbols.mjs +9 -9
- package/lib/core-types/symbols.mjs.map +1 -1
- package/lib/coreFactory.js +238 -158
- package/lib/coreFactory.js.map +1 -1
- package/lib/coreFactory.mjs +189 -133
- package/lib/coreFactory.mjs.map +1 -1
- package/lib/decorators/propsObserver.js +64 -36
- package/lib/decorators/propsObserver.js.map +1 -1
- package/lib/decorators/propsObserver.mjs +61 -33
- package/lib/decorators/propsObserver.mjs.map +1 -1
- package/lib/decorators/reactive.js +17 -17
- package/lib/decorators/reactive.js.map +1 -1
- package/lib/decorators/reactive.mjs +15 -15
- package/lib/decorators/reactive.mjs.map +1 -1
- package/lib/enhancement/Children.js +59 -51
- package/lib/enhancement/Children.js.map +1 -1
- package/lib/enhancement/Children.mjs +41 -47
- package/lib/enhancement/Children.mjs.map +1 -1
- package/lib/enhancement/Root.js +37 -36
- package/lib/enhancement/Root.js.map +1 -1
- package/lib/enhancement/Root.mjs +18 -28
- package/lib/enhancement/Root.mjs.map +1 -1
- package/lib/enhancement/dataName.js +8 -7
- package/lib/enhancement/dataName.js.map +1 -1
- package/lib/enhancement/dataName.mjs +5 -5
- package/lib/enhancement/dataName.mjs.map +1 -1
- package/lib/enhancement/enhance.js +9 -6
- package/lib/enhancement/enhance.js.map +1 -1
- package/lib/enhancement/enhance.mjs +7 -4
- package/lib/enhancement/enhance.mjs.map +1 -1
- package/lib/enhancement/functionDefaultProps.js +6 -6
- package/lib/enhancement/functionDefaultProps.js.map +1 -1
- package/lib/enhancement/functionDefaultProps.mjs +4 -4
- package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
- package/lib/enhancement/i18n.js +13 -13
- package/lib/enhancement/i18n.js.map +1 -1
- package/lib/enhancement/i18n.mjs +9 -10
- package/lib/enhancement/i18n.mjs.map +1 -1
- package/lib/enhancement/inheritedName.js +8 -7
- package/lib/enhancement/inheritedName.js.map +1 -1
- package/lib/enhancement/inheritedName.mjs +5 -5
- package/lib/enhancement/inheritedName.mjs.map +1 -1
- package/lib/enhancement/staticChildren.js +56 -47
- package/lib/enhancement/staticChildren.js.map +1 -1
- package/lib/enhancement/staticChildren.mjs +48 -43
- package/lib/enhancement/staticChildren.mjs.map +1 -1
- package/lib/enhancement/style.js +27 -29
- package/lib/enhancement/style.js.map +1 -1
- package/lib/enhancement/style.mjs +20 -26
- package/lib/enhancement/style.mjs.map +1 -1
- package/lib/enhancement/uncontrolledProps.js +65 -46
- package/lib/enhancement/uncontrolledProps.js.map +1 -1
- package/lib/enhancement/uncontrolledProps.mjs +52 -43
- package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
- package/lib/esm/LastInteractionType.mjs +33 -19
- package/lib/esm/core-types/Component.mjs +38 -18
- package/lib/esm/core-types/symbols.mjs +9 -9
- package/lib/esm/coreFactory.mjs +189 -133
- package/lib/esm/enhancement/Children.mjs +41 -47
- package/lib/esm/enhancement/Root.mjs +18 -28
- package/lib/esm/enhancement/dataName.mjs +5 -5
- package/lib/esm/enhancement/enhance.mjs +7 -4
- package/lib/esm/enhancement/functionDefaultProps.mjs +4 -4
- package/lib/esm/enhancement/i18n.mjs +9 -10
- package/lib/esm/enhancement/inheritedName.mjs +5 -5
- package/lib/esm/enhancement/staticChildren.mjs +48 -43
- package/lib/esm/enhancement/style.mjs +20 -26
- package/lib/esm/enhancement/uncontrolledProps.mjs +52 -43
- package/lib/esm/register.mjs +20 -12
- package/lib/esm/styled/reshadow-core.mjs +111 -98
- package/lib/esm/styled/sstyled.mjs +41 -31
- package/lib/esm/utils/assignProps.mjs +36 -32
- package/lib/esm/utils/enhances/WithI18n.mjs +17 -15
- package/lib/esm/utils/enhances/i18nEnhance.mjs +61 -47
- package/lib/esm/utils/logger.mjs +21 -13
- package/lib/esm/utils/pick.mjs +4 -4
- package/lib/esm/utils/ref.mjs +43 -27
- package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
- package/lib/index.js +17 -17
- package/lib/register.js +24 -17
- package/lib/register.js.map +1 -1
- package/lib/register.mjs +20 -12
- package/lib/register.mjs.map +1 -1
- package/lib/styled/index.js +4 -4
- package/lib/styled/reshadow-core.js +104 -102
- package/lib/styled/reshadow-core.js.map +1 -1
- package/lib/styled/reshadow-core.mjs +111 -98
- package/lib/styled/reshadow-core.mjs.map +1 -1
- package/lib/styled/sstyled.js +53 -31
- package/lib/styled/sstyled.js.map +1 -1
- package/lib/styled/sstyled.mjs +41 -31
- package/lib/styled/sstyled.mjs.map +1 -1
- package/lib/theme/themes/dark.js +2 -2
- package/lib/theme/themes/dark.js.map +1 -1
- package/lib/theme/themes/default.js +2 -2
- package/lib/theme/themes/default.js.map +1 -1
- package/lib/theme/themes/highlights-dark.js +2 -2
- package/lib/theme/themes/highlights-dark.js.map +1 -1
- package/lib/theme/themes/highlights-light.js +2 -2
- package/lib/theme/themes/highlights-light.js.map +1 -1
- package/lib/theme/themes/light.js +2 -2
- package/lib/theme/themes/light.js.map +1 -1
- package/lib/utils/CSSinJS.js +10 -8
- package/lib/utils/CSSinJS.js.map +1 -1
- package/lib/utils/CSSinJS.mjs +7 -6
- package/lib/utils/CSSinJS.mjs.map +1 -1
- package/lib/utils/ThemeProvider.js +51 -44
- package/lib/utils/ThemeProvider.js.map +1 -1
- package/lib/utils/ThemeProvider.mjs +47 -36
- package/lib/utils/ThemeProvider.mjs.map +1 -1
- package/lib/utils/addonText.js +7 -4
- package/lib/utils/addonText.js.map +1 -1
- package/lib/utils/addonText.mjs +5 -2
- package/lib/utils/addonText.mjs.map +1 -1
- package/lib/utils/addonTextChildren.js +21 -15
- package/lib/utils/addonTextChildren.js.map +1 -1
- package/lib/utils/addonTextChildren.mjs +13 -7
- package/lib/utils/addonTextChildren.mjs.map +1 -1
- package/lib/utils/ariaProps.js +5 -7
- package/lib/utils/ariaProps.js.map +1 -1
- package/lib/utils/ariaProps.mjs +5 -7
- package/lib/utils/ariaProps.mjs.map +1 -1
- package/lib/utils/assignProps.js +37 -33
- package/lib/utils/assignProps.js.map +1 -1
- package/lib/utils/assignProps.mjs +36 -32
- package/lib/utils/assignProps.mjs.map +1 -1
- package/lib/utils/canUseDOM.js +1 -1
- package/lib/utils/capitalizeFirstLetter.js +1 -1
- package/lib/utils/color.js +95 -72
- package/lib/utils/color.js.map +1 -1
- package/lib/utils/color.mjs +94 -71
- package/lib/utils/color.mjs.map +1 -1
- package/lib/utils/compose.js +12 -3
- package/lib/utils/compose.js.map +1 -1
- package/lib/utils/compose.mjs +11 -2
- package/lib/utils/compose.mjs.map +1 -1
- package/lib/utils/createUUID.js +5 -5
- package/lib/utils/createUUID.js.map +1 -1
- package/lib/utils/createUUID.mjs +4 -4
- package/lib/utils/createUUID.mjs.map +1 -1
- package/lib/utils/cssToIntDefault.js +4 -3
- package/lib/utils/cssToIntDefault.js.map +1 -1
- package/lib/utils/cssToIntDefault.mjs +3 -2
- package/lib/utils/cssToIntDefault.mjs.map +1 -1
- package/lib/utils/enhances/WithCSS.js +8 -10
- package/lib/utils/enhances/WithCSS.js.map +1 -1
- package/lib/utils/enhances/WithCSS.mjs +6 -7
- package/lib/utils/enhances/WithCSS.mjs.map +1 -1
- package/lib/utils/enhances/WithI18n.js +19 -19
- package/lib/utils/enhances/WithI18n.js.map +1 -1
- package/lib/utils/enhances/WithI18n.mjs +17 -15
- package/lib/utils/enhances/WithI18n.mjs.map +1 -1
- package/lib/utils/enhances/a11yEnhance.js +39 -34
- package/lib/utils/enhances/a11yEnhance.js.map +1 -1
- package/lib/utils/enhances/a11yEnhance.mjs +36 -32
- package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.js +63 -55
- package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
- package/lib/utils/enhances/animatedSizeEnhance.mjs +58 -50
- package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
- package/lib/utils/enhances/contextEnhance.js +11 -12
- package/lib/utils/enhances/contextEnhance.js.map +1 -1
- package/lib/utils/enhances/contextEnhance.mjs +8 -9
- package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
- package/lib/utils/enhances/i18nEnhance.js +67 -51
- package/lib/utils/enhances/i18nEnhance.js.map +1 -1
- package/lib/utils/enhances/i18nEnhance.mjs +61 -47
- package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
- package/lib/utils/enhances/resolveColorEnhance.js +10 -12
- package/lib/utils/enhances/resolveColorEnhance.js.map +1 -1
- package/lib/utils/enhances/resolveColorEnhance.mjs +6 -8
- package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
- package/lib/utils/eventEmitter.js +57 -30
- package/lib/utils/eventEmitter.js.map +1 -1
- package/lib/utils/eventEmitter.mjs +55 -26
- package/lib/utils/eventEmitter.mjs.map +1 -1
- package/lib/utils/findComponent.js +42 -35
- package/lib/utils/findComponent.js.map +1 -1
- package/lib/utils/findComponent.mjs +33 -26
- package/lib/utils/findComponent.mjs.map +1 -1
- package/lib/utils/fire.js +13 -7
- package/lib/utils/fire.js.map +1 -1
- package/lib/utils/fire.mjs +11 -5
- package/lib/utils/fire.mjs.map +1 -1
- package/lib/utils/focus-lock/focusBorders.js +32 -28
- package/lib/utils/focus-lock/focusBorders.js.map +1 -1
- package/lib/utils/focus-lock/focusBorders.mjs +32 -26
- package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
- package/lib/utils/focus-lock/getFocusableIn.js +6 -4
- package/lib/utils/focus-lock/getFocusableIn.js.map +1 -1
- package/lib/utils/focus-lock/getFocusableIn.mjs +6 -3
- package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
- package/lib/utils/focus-lock/isFocusInside.js +6 -5
- package/lib/utils/focus-lock/isFocusInside.js.map +1 -1
- package/lib/utils/focus-lock/isFocusInside.mjs +6 -4
- package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
- package/lib/utils/focus-lock/isFocusable.js +12 -9
- package/lib/utils/focus-lock/isFocusable.js.map +1 -1
- package/lib/utils/focus-lock/isFocusable.mjs +11 -8
- package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
- package/lib/utils/focus-lock/setFocus.js +27 -21
- package/lib/utils/focus-lock/setFocus.js.map +1 -1
- package/lib/utils/focus-lock/setFocus.mjs +25 -19
- package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
- package/lib/utils/getAccessibleName.js +22 -10
- package/lib/utils/getAccessibleName.js.map +1 -1
- package/lib/utils/getAccessibleName.mjs +21 -10
- package/lib/utils/getAccessibleName.mjs.map +1 -1
- package/lib/utils/getDisplayName.js +1 -1
- package/lib/utils/getEventTarget.js +32 -13
- package/lib/utils/getEventTarget.js.map +1 -1
- package/lib/utils/getEventTarget.mjs +31 -12
- package/lib/utils/getEventTarget.mjs.map +1 -1
- package/lib/utils/getOriginChildren.js +4 -4
- package/lib/utils/getOriginChildren.js.map +1 -1
- package/lib/utils/getRandomInt.js +1 -1
- package/lib/utils/getValue.js +6 -4
- package/lib/utils/getValue.js.map +1 -1
- package/lib/utils/getValue.mjs +5 -3
- package/lib/utils/getValue.mjs.map +1 -1
- package/lib/utils/hasLabels.js +27 -16
- package/lib/utils/hasLabels.js.map +1 -1
- package/lib/utils/hasLabels.mjs +24 -14
- package/lib/utils/hasLabels.mjs.map +1 -1
- package/lib/utils/hasParent.js +2 -3
- package/lib/utils/hasParent.js.map +1 -1
- package/lib/utils/hasParent.mjs +3 -2
- package/lib/utils/hasParent.mjs.map +1 -1
- package/lib/utils/ifChildren.js +4 -6
- package/lib/utils/ifChildren.js.map +1 -1
- package/lib/utils/ifChildren.mjs +2 -4
- package/lib/utils/ifChildren.mjs.map +1 -1
- package/lib/utils/indentStyles.js +10 -5
- package/lib/utils/indentStyles.js.map +1 -1
- package/lib/utils/indentStyles.mjs +9 -5
- package/lib/utils/indentStyles.mjs.map +1 -1
- package/lib/utils/injectStyle.js +13 -11
- package/lib/utils/injectStyle.js.map +1 -1
- package/lib/utils/injectStyle.mjs +10 -9
- package/lib/utils/injectStyle.mjs.map +1 -1
- package/lib/utils/inputProps.js +5 -5
- package/lib/utils/inputProps.js.map +1 -1
- package/lib/utils/inputProps.mjs +4 -4
- package/lib/utils/inputProps.mjs.map +1 -1
- package/lib/utils/isInteractiveElement.js +9 -7
- package/lib/utils/isInteractiveElement.js.map +1 -1
- package/lib/utils/isInteractiveElement.mjs +9 -7
- package/lib/utils/isInteractiveElement.mjs.map +1 -1
- package/lib/utils/isNode.js +5 -4
- package/lib/utils/isNode.js.map +1 -1
- package/lib/utils/isNode.mjs +2 -1
- package/lib/utils/isNode.mjs.map +1 -1
- package/lib/utils/isPromise.js +1 -1
- package/lib/utils/isRetina.js +2 -7
- package/lib/utils/isRetina.js.map +1 -1
- package/lib/utils/isRetina.mjs +1 -6
- package/lib/utils/isRetina.mjs.map +1 -1
- package/lib/utils/logger.js +25 -18
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/logger.mjs +21 -13
- package/lib/utils/logger.mjs.map +1 -1
- package/lib/utils/numericChecker.js +18 -11
- package/lib/utils/numericChecker.js.map +1 -1
- package/lib/utils/numericChecker.mjs +17 -10
- package/lib/utils/numericChecker.mjs.map +1 -1
- package/lib/utils/ownerDocument.js +2 -2
- package/lib/utils/ownerDocument.js.map +1 -1
- package/lib/utils/ownerDocument.mjs +1 -1
- package/lib/utils/ownerDocument.mjs.map +1 -1
- package/lib/utils/pick.js +5 -5
- package/lib/utils/pick.js.map +1 -1
- package/lib/utils/pick.mjs +4 -4
- package/lib/utils/pick.mjs.map +1 -1
- package/lib/utils/propsForElement.js +12 -10
- package/lib/utils/propsForElement.js.map +1 -1
- package/lib/utils/propsForElement.mjs +10 -8
- package/lib/utils/propsForElement.mjs.map +1 -1
- package/lib/utils/rafTrottle.js +14 -9
- package/lib/utils/rafTrottle.js.map +1 -1
- package/lib/utils/rafTrottle.mjs +12 -7
- package/lib/utils/rafTrottle.mjs.map +1 -1
- package/lib/utils/reactToText.js +8 -5
- package/lib/utils/reactToText.js.map +1 -1
- package/lib/utils/reactToText.mjs +6 -3
- package/lib/utils/reactToText.mjs.map +1 -1
- package/lib/utils/ref.js +47 -29
- package/lib/utils/ref.js.map +1 -1
- package/lib/utils/ref.mjs +43 -27
- package/lib/utils/ref.mjs.map +1 -1
- package/lib/utils/setRef.js +2 -2
- package/lib/utils/setRef.js.map +1 -1
- package/lib/utils/syncScroll.js +24 -24
- package/lib/utils/syncScroll.js.map +1 -1
- package/lib/utils/syncScroll.mjs +21 -21
- package/lib/utils/syncScroll.mjs.map +1 -1
- package/lib/utils/uncontroll.js +18 -8
- package/lib/utils/uncontroll.js.map +1 -1
- package/lib/utils/uncontroll.mjs +17 -8
- package/lib/utils/uncontroll.mjs.map +1 -1
- package/lib/utils/uniqueID.js +27 -22
- package/lib/utils/uniqueID.js.map +1 -1
- package/lib/utils/uniqueID.mjs +25 -18
- package/lib/utils/uniqueID.mjs.map +1 -1
- package/lib/utils/use/useColorResolver.js +22 -21
- package/lib/utils/use/useColorResolver.js.map +1 -1
- package/lib/utils/use/useColorResolver.mjs +19 -17
- package/lib/utils/use/useColorResolver.mjs.map +1 -1
- package/lib/utils/use/useEnhancedEffect.js +4 -4
- package/lib/utils/use/useEnhancedEffect.js.map +1 -1
- package/lib/utils/use/useEnhancedEffect.mjs +1 -1
- package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
- package/lib/utils/use/useEventCallback.js +10 -5
- package/lib/utils/use/useEventCallback.js.map +1 -1
- package/lib/utils/use/useEventCallback.mjs +8 -3
- package/lib/utils/use/useEventCallback.mjs.map +1 -1
- package/lib/utils/use/useEventListener.js +15 -11
- package/lib/utils/use/useEventListener.js.map +1 -1
- package/lib/utils/use/useEventListener.mjs +11 -7
- package/lib/utils/use/useEventListener.mjs.map +1 -1
- package/lib/utils/use/useFocusLock.js +94 -80
- package/lib/utils/use/useFocusLock.js.map +1 -1
- package/lib/utils/use/useFocusLock.mjs +88 -71
- package/lib/utils/use/useFocusLock.mjs.map +1 -1
- package/lib/utils/use/usePreventScroll.js +26 -24
- package/lib/utils/use/usePreventScroll.js.map +1 -1
- package/lib/utils/use/usePreventScroll.mjs +21 -19
- package/lib/utils/use/usePreventScroll.mjs.map +1 -1
- package/lib/utils/use/useScrollBarWidth.js +14 -8
- package/lib/utils/use/useScrollBarWidth.js.map +1 -1
- package/lib/utils/use/useScrollBarWidth.mjs +13 -8
- package/lib/utils/use/useScrollBarWidth.mjs.map +1 -1
- package/lib/utils/useCssVariable.js +37 -32
- package/lib/utils/useCssVariable.js.map +1 -1
- package/lib/utils/useCssVariable.mjs +34 -27
- package/lib/utils/useCssVariable.mjs.map +1 -1
- package/lib/utils/zIndexStacking.js +24 -28
- package/lib/utils/zIndexStacking.js.map +1 -1
- package/lib/utils/zIndexStacking.mjs +22 -23
- package/lib/utils/zIndexStacking.mjs.map +1 -1
- package/package.json +12 -316
- package/vite.config.ts +0 -22
- package/tsconfig-utils.json +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.mjs","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","
|
|
1
|
+
{"version":3,"file":"Root.mjs","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","_ref","ref","Tag","render","source","_objectWithoutProperties","_excluded","_Root$props","props","_Root","_styles","styles","_children","children","Children","_Root$props$forwardRe","_excluded2","clearProps","Object","entries","reduce","_ref2","_ref3","_slicedToArray","name","value","undefined","child","origin","createElement","other","_objectSpread","Error","Fragment","Enhancement","init","asProps","_WrapperComponent","isFunction"],"sources":["../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../utils/assignProps';\nimport { useForkRef } from '../utils/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n Root: _Root,\n\n styles: _styles,\n\n children: _children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props: any, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n if (Tag === React.Fragment) return <React.Fragment>{other.children}</React.Fragment>;\n\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function (this: any) {\n this.Root = createRootRender();\n },\n asProps: function (this: any, props: any, _WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (this: any, render: any, props: any) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,WAAW,MAAM,0BAAsB;AAC9C,SAASC,UAAU,QAAQ,kBAAc;AAEzC,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,IAAMC,IAAI,gBAAGJ,KAAK,CAACK,UAAU,CAAC,UAAAC,IAAA,EAAsCC,GAAG,EAAE;IAAA,IAAvBC,GAAG,GAAAF,IAAA,CAAXG,MAAM;MAAUC,MAAM,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;IAC9D,IAAAC,WAAA,GAUIT,IAAI,CAACU,KAAK;MATNC,KAAK,GAAAF,WAAA,CAAXT,IAAI;MAEIY,OAAO,GAAAH,WAAA,CAAfI,MAAM;MAEIC,SAAS,GAAAL,WAAA,CAAnBM,QAAQ;MACRC,QAAQ,GAAAP,WAAA,CAARO,QAAQ;MAAAC,qBAAA,GAAAR,WAAA,CACRR,UAAU;MAAVA,UAAU,GAAAgB,qBAAA,cAAG,IAAI,GAAAA,qBAAA;MACdP,KAAK,GAAAH,wBAAA,CAAAE,WAAA,EAAAS,UAAA;IAIV,IAAMC,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACX,KAAK,CAAC,CAACY,MAAM,CAAC,UAACZ,KAAU,EAAAa,KAAA,EAAoB;MAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA;QAAjBG,IAAI,GAAAF,KAAA;QAAEG,KAAK,GAAAH,KAAA;MACvE,IAAIG,KAAK,KAAKC,SAAS,EAAE;QACvBlB,KAAK,CAACgB,IAAI,CAAC,GAAGC,KAAK;MACrB;MACA,OAAOjB,KAAK;IACd,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAMmB,KAAK,GAAG,CAAC,CAAC;IAChB;IACA,IAAI,OAAOb,QAAQ,CAACc,MAAM,KAAK,WAAW,EAAE;MAC1C;MACAD,KAAK,CAACd,QAAQ,gBAAGnB,KAAA,CAAAmC,aAAA,CAACf,QAAQ,MAAE,CAAC;IAC/B;IAEA,IAAMgB,KAAK,GAAGnC,WAAW,CAAAoC,aAAA,CAAAA,aAAA,KAElBd,UAAU;MACbhB,GAAG,EAAEL,UAAU,CAACG,UAAU,EAAEE,GAAG;IAAC,IAAA8B,aAAA,CAAAA,aAAA,KAG7BJ,KAAK,GACLvB,MAAM,CAEb,CAAC;IACD,IAAI,CAACF,GAAG,EAAE;MACR,MAAM,IAAI8B,KAAK,CAAC,uCAAuC,CAAC;IAC1D;IACA,IAAI9B,GAAG,KAAKR,KAAK,CAACuC,QAAQ,EAAE,oBAAOvC,KAAA,CAAAmC,aAAA,CAACnC,KAAK,CAACuC,QAAQ,QAAEH,KAAK,CAACjB,QAAyB,CAAC;IAEpF,oBAAOnB,KAAA,CAAAmC,aAAA,CAAC3B,GAAG,EAAK4B,KAAQ,CAAC;EAC3B,CAAC,CAAC;EACF;EACAhC,IAAI,CAACU,KAAK,GAAG,CAAC,CAAC;EACf,OAAOV,IAAI;AACb;AAEA,SAASoC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAuB;MACzB,IAAI,CAACrC,IAAI,GAAGD,gBAAgB,CAAC,CAAC;IAChC,CAAC;IACDuC,OAAO,EAAE,SAATA,OAAOA,CAAuB5B,KAAU,EAAE6B,iBAAsB,EAAEC,UAAmB,EAAE;MACrF,IAAIA,UAAU,EAAE;QACd,OAAAP,aAAA,CAAAA,aAAA,KACKvB,KAAK;UACRV,IAAI,EAAE,IAAI,CAACA;QAAI;MAEnB;MACA,OAAOU,KAAK;IACd,CAAC;IACDL,MAAM,EAAE,SAARA,MAAMA,CAAuBA,OAAW,EAAEK,KAAU,EAAE;MACpD,IAAI,CAACV,IAAI,CAACU,KAAK,GAAGA,KAAK;MACvB,OAAOL,OAAM;IACf;EACF,CAAC;AACH;AAEA,eAAe+B,WAAW","ignoreList":[]}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
7
9
|
function Enhancement() {
|
|
8
10
|
return {
|
|
9
|
-
wrapperProps: function (props, WrapperComponent) {
|
|
10
|
-
return {
|
|
11
|
-
'data-ui-name': WrapperComponent.displayName
|
|
12
|
-
|
|
13
|
-
};
|
|
11
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
12
|
+
return (0, _objectSpread2["default"])({
|
|
13
|
+
'data-ui-name': WrapperComponent.displayName
|
|
14
|
+
}, props);
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
var _default = exports
|
|
18
|
+
var _default = exports["default"] = Enhancement;
|
|
18
19
|
//# sourceMappingURL=dataName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","displayName","_default","exports"
|
|
1
|
+
{"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","_objectSpread2","displayName","_default","exports"],"sources":["../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props: any, WrapperComponent: any) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,YAAY,EAAE,SAAdA,YAAYA,CAAYC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,WAAAC,cAAA;QACE,cAAc,EAAED,gBAAgB,CAACE;MAAW,GACzCH,KAAK;IAEZ;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEcP,WAAW","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
function Enhancement() {
|
|
2
3
|
return {
|
|
3
|
-
wrapperProps: function(props, WrapperComponent) {
|
|
4
|
-
return {
|
|
5
|
-
"data-ui-name": WrapperComponent.displayName
|
|
6
|
-
|
|
7
|
-
};
|
|
4
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
5
|
+
return _objectSpread({
|
|
6
|
+
"data-ui-name": WrapperComponent.displayName
|
|
7
|
+
}, props);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataName.mjs","names":["Enhancement","wrapperProps","props","WrapperComponent","displayName"],"sources":["../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props: any, WrapperComponent: any) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"dataName.mjs","names":["Enhancement","wrapperProps","props","WrapperComponent","_objectSpread","displayName"],"sources":["../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props: any, WrapperComponent: any) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,YAAY,EAAE,SAAdA,YAAYA,CAAYC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAAC,aAAA;QACE,cAAc,EAAED,gBAAgB,CAACE;MAAW,GACzCH,KAAK;IAEZ;EACF,CAAC;AACH;AAEA,eAAeF,WAAW","ignoreList":[]}
|
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
function Enhancement() {
|
|
8
8
|
return {
|
|
9
|
-
condition: function (Component) {
|
|
10
|
-
|
|
9
|
+
condition: function condition(Component) {
|
|
10
|
+
var _Component$enhance;
|
|
11
|
+
return Boolean((_Component$enhance = Component.enhance) === null || _Component$enhance === void 0 ? void 0 : _Component$enhance.length);
|
|
11
12
|
},
|
|
12
|
-
wrapperProps: function (props, WrapperComponent) {
|
|
13
|
-
return WrapperComponent.enhance.reduce((acc, enhance)
|
|
13
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
14
|
+
return WrapperComponent.enhance.reduce(function (acc, enhance) {
|
|
15
|
+
return enhance(acc);
|
|
16
|
+
}, props);
|
|
14
17
|
}
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
|
-
var _default = exports
|
|
20
|
+
var _default = exports["default"] = Enhancement;
|
|
18
21
|
//# sourceMappingURL=enhance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.js","names":["Enhancement","condition","Component","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc","_default","exports"
|
|
1
|
+
{"version":3,"file":"enhance.js","names":["Enhancement","condition","Component","_Component$enhance","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc","_default","exports"],"sources":["../../src/enhancement/enhance.tsx"],"sourcesContent":["function Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.enhance?.length);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n return WrapperComponent.enhance.reduce((acc: any, enhance: any) => enhance(acc), props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYC,SAAc,EAAE;MAAA,IAAAC,kBAAA;MACnC,OAAOC,OAAO,EAAAD,kBAAA,GAACD,SAAS,CAACG,OAAO,cAAAF,kBAAA,uBAAjBA,kBAAA,CAAmBG,MAAM,CAAC;IAC3C,CAAC;IACDC,YAAY,EAAE,SAAdA,YAAYA,CAAYC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAOA,gBAAgB,CAACJ,OAAO,CAACK,MAAM,CAAC,UAACC,GAAQ,EAAEN,OAAY;QAAA,OAAKA,OAAO,CAACM,GAAG,CAAC;MAAA,GAAEH,KAAK,CAAC;IACzF;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEcb,WAAW","ignoreList":[]}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
function Enhancement() {
|
|
2
2
|
return {
|
|
3
|
-
condition: function(Component) {
|
|
4
|
-
|
|
3
|
+
condition: function condition(Component) {
|
|
4
|
+
var _Component$enhance;
|
|
5
|
+
return Boolean((_Component$enhance = Component.enhance) === null || _Component$enhance === void 0 ? void 0 : _Component$enhance.length);
|
|
5
6
|
},
|
|
6
|
-
wrapperProps: function(props, WrapperComponent) {
|
|
7
|
-
return WrapperComponent.enhance.reduce((acc, enhance)
|
|
7
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
8
|
+
return WrapperComponent.enhance.reduce(function(acc, enhance) {
|
|
9
|
+
return enhance(acc);
|
|
10
|
+
}, props);
|
|
8
11
|
}
|
|
9
12
|
};
|
|
10
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.mjs","names":["Enhancement","condition","Component","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc"],"sources":["../../src/enhancement/enhance.tsx"],"sourcesContent":["function Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.enhance?.length);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n return WrapperComponent.enhance.reduce((acc: any, enhance: any) => enhance(acc), props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"enhance.mjs","names":["Enhancement","condition","Component","_Component$enhance","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc"],"sources":["../../src/enhancement/enhance.tsx"],"sourcesContent":["function Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.enhance?.length);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n return WrapperComponent.enhance.reduce((acc: any, enhance: any) => enhance(acc), props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYC,SAAc,EAAE;MAAA,IAAAC,kBAAA;MACnC,OAAOC,OAAO,EAAAD,kBAAA,GAACD,SAAS,CAACG,OAAO,cAAAF,kBAAA,uBAAjBA,kBAAA,CAAmBG,MAAM,CAAC;IAC3C,CAAC;IACDC,YAAY,EAAE,SAAdA,YAAYA,CAAYC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAOA,gBAAgB,CAACJ,OAAO,CAACK,MAAM,CAAC,UAACC,GAAQ,EAAEN,OAAY;QAAA,OAAKA,OAAO,CAACM,GAAG,CAAC;MAAA,GAAEH,KAAK,CAAC;IACzF;EACF,CAAC;AACH;AAEA,eAAeR,WAAW","ignoreList":[]}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
function Enhancement() {
|
|
8
|
-
|
|
8
|
+
var defaultProps = {};
|
|
9
9
|
return {
|
|
10
|
-
condition: function (Component) {
|
|
10
|
+
condition: function condition(Component) {
|
|
11
11
|
if (!Component.defaultProps) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
@@ -16,13 +16,13 @@ function Enhancement() {
|
|
|
16
16
|
}
|
|
17
17
|
return Boolean(Object.keys(Component.defaultProps).length);
|
|
18
18
|
},
|
|
19
|
-
static: function (WrapperComponent) {
|
|
19
|
+
"static": function _static(WrapperComponent) {
|
|
20
20
|
defaultProps = WrapperComponent.defaultProps;
|
|
21
21
|
return {
|
|
22
22
|
defaultProps: {}
|
|
23
23
|
};
|
|
24
24
|
},
|
|
25
|
-
wrapperProps: function (props) {
|
|
25
|
+
wrapperProps: function wrapperProps(props) {
|
|
26
26
|
if (typeof defaultProps === 'function') {
|
|
27
27
|
// TODO: optimization
|
|
28
28
|
return Object.assign({}, defaultProps(props), props);
|
|
@@ -31,5 +31,5 @@ function Enhancement() {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
var _default = exports
|
|
34
|
+
var _default = exports["default"] = Enhancement;
|
|
35
35
|
//# sourceMappingURL=functionDefaultProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionDefaultProps.js","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign","_default","exports"
|
|
1
|
+
{"version":3,"file":"functionDefaultProps.js","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign","_default","exports"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYC,SAAc,EAAE;MACnC,IAAI,CAACA,SAAS,CAACF,YAAY,EAAE;QAC3B,OAAO,KAAK;MACd;MACA,IAAI,OAAOE,SAAS,CAACF,YAAY,KAAK,UAAU,EAAE;QAChD,OAAO,IAAI;MACb;MACA,OAAOG,OAAO,CAACC,MAAM,CAACC,IAAI,CAACH,SAAS,CAACF,YAAY,CAAC,CAACM,MAAM,CAAC;IAC5D,CAAC;IACD,UAAQ,SAARC,OAAMA,CAAYC,gBAAqB,EAAE;MACvCR,YAAY,GAAGQ,gBAAgB,CAACR,YAAY;MAC5C,OAAO;QACLA,YAAY,EAAE,CAAC;MACjB,CAAC;IACH,CAAC;IACDS,YAAY,EAAE,SAAdA,YAAYA,CAAYC,KAAU,EAAE;MAClC,IAAI,OAAOV,YAAY,KAAK,UAAU,EAAE;QACtC;QACA,OAAOI,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,CAACU,KAAK,CAAC,EAAEA,KAAK,CAAC;MACtD;MACA,OAAON,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,EAAEU,KAAK,CAAC;IAC/C;EACF,CAAC;AACH;AAAC,IAAAE,QAAA,GAAAC,OAAA,cAEcd,WAAW","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function Enhancement() {
|
|
2
|
-
|
|
2
|
+
var defaultProps = {};
|
|
3
3
|
return {
|
|
4
|
-
condition: function(Component) {
|
|
4
|
+
condition: function condition(Component) {
|
|
5
5
|
if (!Component.defaultProps) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
@@ -10,13 +10,13 @@ function Enhancement() {
|
|
|
10
10
|
}
|
|
11
11
|
return Boolean(Object.keys(Component.defaultProps).length);
|
|
12
12
|
},
|
|
13
|
-
static: function(WrapperComponent) {
|
|
13
|
+
"static": function _static(WrapperComponent) {
|
|
14
14
|
defaultProps = WrapperComponent.defaultProps;
|
|
15
15
|
return {
|
|
16
16
|
defaultProps: {}
|
|
17
17
|
};
|
|
18
18
|
},
|
|
19
|
-
wrapperProps: function(props) {
|
|
19
|
+
wrapperProps: function wrapperProps(props) {
|
|
20
20
|
if (typeof defaultProps === "function") {
|
|
21
21
|
return Object.assign({}, defaultProps(props), props);
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionDefaultProps.mjs","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"functionDefaultProps.mjs","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","static","WrapperComponent","wrapperProps","props","assign"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYC,SAAc,EAAE;MACnC,IAAI,CAACA,SAAS,CAACF,YAAY,EAAE;QAC3B,OAAO,KAAK;MACd;MACA,IAAI,OAAOE,SAAS,CAACF,YAAY,KAAK,UAAU,EAAE;QAChD,OAAO,IAAI;MACb;MACA,OAAOG,OAAO,CAACC,MAAM,CAACC,IAAI,CAACH,SAAS,CAACF,YAAY,CAAC,CAACM,MAAM,CAAC;IAC5D,CAAC;IACD,UAAQ,SAARC,OAAMA,CAAYC,gBAAqB,EAAE;MACvCR,YAAY,GAAGQ,gBAAgB,CAACR,YAAY;MAC5C,OAAO;QACLA,YAAY,EAAE,CAAC;MACjB,CAAC;IACH,CAAC;IACDS,YAAY,EAAE,SAAdA,YAAYA,CAAYC,KAAU,EAAE;MAClC,IAAI,OAAOV,YAAY,KAAK,UAAU,EAAE;QACtC;QACA,OAAOI,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,CAACU,KAAK,CAAC,EAAEA,KAAK,CAAC;MACtD;MACA,OAAON,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,EAAEU,KAAK,CAAC;IAC/C;EACF,CAAC;AACH;AAEA,eAAeX,WAAW","ignoreList":[]}
|
package/lib/enhancement/i18n.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
var _WithI18n = require("../utils/enhances/WithI18n");
|
|
12
|
+
var _excluded = ["locale"];
|
|
10
13
|
function i18nAppLocaleEnhance() {
|
|
11
14
|
return {
|
|
12
|
-
wrapperProps: props
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = props;
|
|
17
|
-
const contextLocale = _react.default.useContext(_WithI18n.Context);
|
|
15
|
+
wrapperProps: function wrapperProps(props) {
|
|
16
|
+
var locale = props.locale,
|
|
17
|
+
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
18
|
+
var contextLocale = _react["default"].useContext(_WithI18n.Context);
|
|
18
19
|
if (!locale && !contextLocale) return props;
|
|
19
|
-
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
20
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, other), {}, {
|
|
21
|
+
locale: locale !== null && locale !== void 0 ? locale : contextLocale
|
|
22
|
+
});
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
var _default = exports
|
|
26
|
+
var _default = exports["default"] = i18nAppLocaleEnhance;
|
|
27
27
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":["_react","_interopRequireDefault","require","_WithI18n","i18nAppLocaleEnhance","wrapperProps","props","locale","other","contextLocale","React","useContext","Context","
|
|
1
|
+
{"version":3,"file":"i18n.js","names":["_react","_interopRequireDefault","require","_WithI18n","_excluded","i18nAppLocaleEnhance","wrapperProps","props","locale","other","_objectWithoutProperties2","contextLocale","React","useContext","Context","_objectSpread2","_default","exports"],"sources":["../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAAqD,IAAAE,SAAA;AAErD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAE,SAAdA,YAAYA,CAAGC,KAAU,EAAK;MAC5B,IAAQC,MAAM,GAAeD,KAAK,CAA1BC,MAAM;QAAKC,KAAK,OAAAC,yBAAA,aAAKH,KAAK,EAAAH,SAAA;MAClC,IAAMO,aAAa,GAAGC,iBAAK,CAACC,UAAU,CAACC,iBAAO,CAAC;MAC/C,IAAI,CAACN,MAAM,IAAI,CAACG,aAAa,EAAE,OAAOJ,KAAK;MAC3C,WAAAQ,cAAA,iBAAAA,cAAA,iBACKN,KAAK;QACRD,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIG;MAAa;IAEnC;EACF,CAAC;AACH;AAAC,IAAAK,QAAA,GAAAC,OAAA,cAEcZ,oBAAoB","ignoreList":[]}
|
package/lib/enhancement/i18n.mjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
1
3
|
import React from "react";
|
|
2
4
|
import { Context } from "../utils/enhances/WithI18n.mjs";
|
|
5
|
+
var _excluded = ["locale"];
|
|
3
6
|
function i18nAppLocaleEnhance() {
|
|
4
7
|
return {
|
|
5
|
-
wrapperProps: (props)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
...other
|
|
9
|
-
} = props;
|
|
10
|
-
const contextLocale = React.useContext(Context);
|
|
8
|
+
wrapperProps: function wrapperProps(props) {
|
|
9
|
+
var locale = props.locale, other = _objectWithoutProperties(props, _excluded);
|
|
10
|
+
var contextLocale = React.useContext(Context);
|
|
11
11
|
if (!locale && !contextLocale) return props;
|
|
12
|
-
return {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
12
|
+
return _objectSpread(_objectSpread({}, other), {}, {
|
|
13
|
+
locale: locale !== null && locale !== void 0 ? locale : contextLocale
|
|
14
|
+
});
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.mjs","names":["React","Context","i18nAppLocaleEnhance","wrapperProps","props","locale","other","contextLocale","useContext"],"sources":["../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,OAAO,QAAQ,gCAA4B;AAEpD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,
|
|
1
|
+
{"version":3,"file":"i18n.mjs","names":["React","Context","i18nAppLocaleEnhance","wrapperProps","props","locale","other","_objectWithoutProperties","_excluded","contextLocale","useContext","_objectSpread"],"sources":["../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,OAAO,QAAQ,gCAA4B;AAEpD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAE,SAAdA,YAAYA,CAAGC,KAAU,EAAK;MAC5B,IAAQC,MAAM,GAAeD,KAAK,CAA1BC,MAAM;QAAKC,KAAK,GAAAC,wBAAA,CAAKH,KAAK,EAAAI,SAAA;MAClC,IAAMC,aAAa,GAAGT,KAAK,CAACU,UAAU,CAACT,OAAO,CAAC;MAC/C,IAAI,CAACI,MAAM,IAAI,CAACI,aAAa,EAAE,OAAOL,KAAK;MAC3C,OAAAO,aAAA,CAAAA,aAAA,KACKL,KAAK;QACRD,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAII;MAAa;IAEnC;EACF,CAAC;AACH;AAEA,eAAeP,oBAAoB","ignoreList":[]}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
7
10
|
var _symbols = require("../core-types/symbols");
|
|
8
11
|
function Enhancement() {
|
|
9
12
|
return {
|
|
10
|
-
condition: function (Component) {
|
|
13
|
+
condition: function condition(Component) {
|
|
11
14
|
return Boolean(Component.displayName);
|
|
12
15
|
},
|
|
13
|
-
static: function (WrapperComponent) {
|
|
14
|
-
return {
|
|
15
|
-
[_symbols.INHERITED_NAME]: [...new Set([...(WrapperComponent[_symbols.INHERITED_NAME] || []), WrapperComponent.displayName])]
|
|
16
|
-
};
|
|
16
|
+
"static": function _static(WrapperComponent) {
|
|
17
|
+
return (0, _defineProperty2["default"])({}, _symbols.INHERITED_NAME, (0, _toConsumableArray2["default"])(new Set([].concat((0, _toConsumableArray2["default"])(WrapperComponent[_symbols.INHERITED_NAME] || []), [WrapperComponent.displayName]))));
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
var _default = exports
|
|
21
|
+
var _default = exports["default"] = Enhancement;
|
|
21
22
|
//# sourceMappingURL=inheritedName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inheritedName.js","names":["_symbols","require","Enhancement","condition","Component","Boolean","displayName","static","WrapperComponent","INHERITED_NAME","Set","
|
|
1
|
+
{"version":3,"file":"inheritedName.js","names":["_symbols","require","Enhancement","condition","Component","Boolean","displayName","static","WrapperComponent","_defineProperty2","INHERITED_NAME","_toConsumableArray2","Set","concat","_default","exports"],"sources":["../../src/enhancement/inheritedName.tsx"],"sourcesContent":["import { INHERITED_NAME } from '../core-types/symbols';\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.displayName);\n },\n static: function (WrapperComponent: any) {\n return {\n [INHERITED_NAME]: [\n ...new Set([...(WrapperComponent[INHERITED_NAME] || []), WrapperComponent.displayName]),\n ],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,SAASC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,WAAW,CAAC;IACvC,CAAC;IACD,UAAQ,SAARC,OAAMA,CAAYC,gBAAqB,EAAE;MACvC,WAAAC,gBAAA,iBACGC,uBAAc,MAAAC,mBAAA,aACV,IAAIC,GAAG,IAAAC,MAAA,KAAAF,mBAAA,aAAMH,gBAAgB,CAACE,uBAAc,CAAC,IAAI,EAAE,IAAGF,gBAAgB,CAACF,WAAW,EAAC,CAAC;IAG7F;EACF,CAAC;AACH;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cAEcb,WAAW","ignoreList":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
3
|
import { INHERITED_NAME } from "../core-types/symbols.mjs";
|
|
2
4
|
function Enhancement() {
|
|
3
5
|
return {
|
|
4
|
-
condition: function(Component) {
|
|
6
|
+
condition: function condition(Component) {
|
|
5
7
|
return Boolean(Component.displayName);
|
|
6
8
|
},
|
|
7
|
-
static: function(WrapperComponent) {
|
|
8
|
-
return {
|
|
9
|
-
[INHERITED_NAME]: [.../* @__PURE__ */ new Set([...WrapperComponent[INHERITED_NAME] || [], WrapperComponent.displayName])]
|
|
10
|
-
};
|
|
9
|
+
"static": function _static(WrapperComponent) {
|
|
10
|
+
return _defineProperty({}, INHERITED_NAME, _toConsumableArray(new Set([].concat(_toConsumableArray(WrapperComponent[INHERITED_NAME] || []), [WrapperComponent.displayName]))));
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inheritedName.mjs","names":["INHERITED_NAME","Enhancement","condition","Component","Boolean","displayName","static","WrapperComponent","Set"],"sources":["../../src/enhancement/inheritedName.tsx"],"sourcesContent":["import { INHERITED_NAME } from '../core-types/symbols';\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.displayName);\n },\n static: function (WrapperComponent: any) {\n return {\n [INHERITED_NAME]: [\n ...new Set([...(WrapperComponent[INHERITED_NAME] || []), WrapperComponent.displayName]),\n ],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAAuB;AAEtD,SAASC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"inheritedName.mjs","names":["INHERITED_NAME","Enhancement","condition","Component","Boolean","displayName","static","WrapperComponent","_defineProperty","_toConsumableArray","Set","concat"],"sources":["../../src/enhancement/inheritedName.tsx"],"sourcesContent":["import { INHERITED_NAME } from '../core-types/symbols';\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.displayName);\n },\n static: function (WrapperComponent: any) {\n return {\n [INHERITED_NAME]: [\n ...new Set([...(WrapperComponent[INHERITED_NAME] || []), WrapperComponent.displayName]),\n ],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,2BAAuB;AAEtD,SAASC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAXA,SAASA,CAAYC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,WAAW,CAAC;IACvC,CAAC;IACD,UAAQ,SAARC,OAAMA,CAAYC,gBAAqB,EAAE;MACvC,OAAAC,eAAA,KACGR,cAAc,EAAAS,kBAAA,CACV,IAAIC,GAAG,IAAAC,MAAA,CAAAF,kBAAA,CAAMF,gBAAgB,CAACP,cAAc,CAAC,IAAI,EAAE,IAAGO,gBAAgB,CAACF,WAAW,EAAC,CAAC;IAG7F;EACF,CAAC;AACH;AAEA,eAAeJ,WAAW","ignoreList":[]}
|
|
@@ -1,82 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
7
|
+
exports["default"] = exports.STATIC_COMPONENT = exports.ROOT_COMPONENT = void 0;
|
|
8
8
|
exports.getterMethodName = getterMethodName;
|
|
9
9
|
exports.getterMethodNameByDisplayName = getterMethodNameByDisplayName;
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
13
|
var _react = _interopRequireDefault(require("react"));
|
|
11
14
|
var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
|
|
12
15
|
var _logger = _interopRequireDefault(require("../utils/logger"));
|
|
13
16
|
var _pick = _interopRequireDefault(require("../utils/pick"));
|
|
14
17
|
function assign(target, source) {
|
|
15
|
-
return Object.defineProperties(target, Object.keys(source).reduce((descriptors, key)
|
|
18
|
+
return Object.defineProperties(target, Object.keys(source).reduce(function (descriptors, key) {
|
|
16
19
|
descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
|
|
17
20
|
return descriptors;
|
|
18
21
|
}, {}));
|
|
19
22
|
}
|
|
20
23
|
function getterMethodName(name) {
|
|
21
|
-
return
|
|
24
|
+
return "get".concat(name, "Props");
|
|
22
25
|
}
|
|
23
|
-
function getterMethodNameByDisplayName(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
function getterMethodNameByDisplayName() {
|
|
27
|
+
var displayName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
28
|
+
var displayNames = displayName.split('.');
|
|
29
|
+
var name = displayNames.slice(-(displayNames.length - 1)).join('');
|
|
26
30
|
return getterMethodName(name);
|
|
27
31
|
}
|
|
28
32
|
function flatGetterMethodNames(childComponents, parentName) {
|
|
29
|
-
return Object.entries(childComponents).reduce((acc,
|
|
33
|
+
return Object.entries(childComponents).reduce(function (acc, _ref) {
|
|
34
|
+
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
35
|
+
name = _ref2[0],
|
|
36
|
+
value = _ref2[1];
|
|
30
37
|
if (Array.isArray(value)) {
|
|
31
|
-
acc.push(
|
|
38
|
+
acc.push.apply(acc, (0, _toConsumableArray2["default"])(flatGetterMethodNames(value[1], name)));
|
|
32
39
|
}
|
|
33
|
-
name = parentName ?
|
|
40
|
+
name = parentName ? "".concat(parentName).concat(name) : name;
|
|
34
41
|
acc.push(getterMethodName(name));
|
|
35
42
|
return acc;
|
|
36
43
|
}, []);
|
|
37
44
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
var STATIC_COMPONENT = exports.STATIC_COMPONENT = Symbol('STATIC_COMPONENT');
|
|
46
|
+
var ROOT_COMPONENT = exports.ROOT_COMPONENT = Symbol('ROOT_COMPONENT');
|
|
47
|
+
var SELF_GETTER_METHOD = Symbol('SELF_GETTER_METHOD');
|
|
41
48
|
function Enhancement(childComponents, createComponent, options) {
|
|
42
|
-
|
|
49
|
+
var getterMethodNames = flatGetterMethodNames(childComponents);
|
|
43
50
|
return {
|
|
44
|
-
condition: function (Component) {
|
|
51
|
+
condition: function condition(Component) {
|
|
45
52
|
return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);
|
|
46
53
|
},
|
|
47
|
-
init: function (props, WrapperComponent) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
init: function init(props, WrapperComponent) {
|
|
55
|
+
var _this = this;
|
|
56
|
+
var getterMethods = (0, _pick["default"])(this, getterMethodNames);
|
|
57
|
+
this[SELF_GETTER_METHOD] = function () {
|
|
58
|
+
var selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
|
|
59
|
+
_logger["default"].warn(true, "Getter `".concat(selfGetterMethod, "` can't be fired as it is a getter of static component"), props['data-ui-name'] || WrapperComponent.displayName);
|
|
52
60
|
};
|
|
53
|
-
assign(this, getterMethodNames.reduce((acc, name)
|
|
54
|
-
|
|
61
|
+
assign(this, getterMethodNames.reduce(function (acc, name) {
|
|
62
|
+
var getterMethod = getterMethods[name];
|
|
55
63
|
if (!getterMethod) return acc;
|
|
56
|
-
acc[name] = (
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
acc[name] = function () {
|
|
65
|
+
var childrenProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
66
|
+
var getterProps = getterMethod.call(_this, childrenProps, acc[name].index);
|
|
67
|
+
return (0, _assignProps["default"])(childrenProps, getterProps);
|
|
59
68
|
};
|
|
60
69
|
acc[name].index = -1;
|
|
61
70
|
acc[name].cache = new Set();
|
|
62
71
|
return acc;
|
|
63
72
|
}, {}));
|
|
64
73
|
},
|
|
65
|
-
static: function (WrapperComponent, Component) {
|
|
74
|
+
"static": function _static(WrapperComponent, Component) {
|
|
66
75
|
if (Object.keys(childComponents).length && !WrapperComponent.displayName) {
|
|
67
76
|
throw new Error('"displayName" is not defined');
|
|
68
77
|
}
|
|
69
|
-
return Object.entries(childComponents).reduce((acc,
|
|
70
|
-
|
|
78
|
+
return Object.entries(childComponents).reduce(function (acc, _ref3) {
|
|
79
|
+
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
80
|
+
name = _ref4[0],
|
|
81
|
+
value = _ref4[1];
|
|
82
|
+
var childComponents = {};
|
|
71
83
|
if (Array.isArray(value)) {
|
|
72
84
|
childComponents = value[1];
|
|
73
85
|
value = value[0];
|
|
74
86
|
}
|
|
75
|
-
|
|
87
|
+
var prevStaticComponent = value[STATIC_COMPONENT];
|
|
76
88
|
// @ts-ignore
|
|
77
|
-
|
|
89
|
+
var prevDisplayName = value.displayName;
|
|
78
90
|
// @ts-ignore
|
|
79
|
-
value.displayName =
|
|
91
|
+
value.displayName = "".concat(WrapperComponent.displayName, ".").concat(name);
|
|
80
92
|
value[STATIC_COMPONENT] = true;
|
|
81
93
|
value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;
|
|
82
94
|
acc[name] = createComponent(value, childComponents, options);
|
|
@@ -86,18 +98,14 @@ function Enhancement(childComponents, createComponent, options) {
|
|
|
86
98
|
return acc;
|
|
87
99
|
}, {});
|
|
88
100
|
},
|
|
89
|
-
context: function (
|
|
101
|
+
context: function context(_context) {
|
|
90
102
|
// const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
|
|
91
|
-
return {
|
|
92
|
-
...context,
|
|
93
|
-
// [getterMethod]: this[SELF_GETTER_METHOD],
|
|
94
|
-
...(0, _pick.default)(this, getterMethodNames)
|
|
95
|
-
};
|
|
103
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _context), (0, _pick["default"])(this, getterMethodNames));
|
|
96
104
|
},
|
|
97
|
-
wrapperProps: function (props, WrapperComponent) {
|
|
105
|
+
wrapperProps: function wrapperProps(props, WrapperComponent) {
|
|
98
106
|
if (!WrapperComponent[STATIC_COMPONENT]) return props;
|
|
99
|
-
|
|
100
|
-
|
|
107
|
+
var context = _react["default"].useContext(options.context);
|
|
108
|
+
var getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];
|
|
101
109
|
if (getterMethod) {
|
|
102
110
|
if (!getterMethod.cache.has(this)) {
|
|
103
111
|
getterMethod.cache.add(this);
|
|
@@ -109,15 +117,16 @@ function Enhancement(childComponents, createComponent, options) {
|
|
|
109
117
|
}
|
|
110
118
|
return props;
|
|
111
119
|
},
|
|
112
|
-
render: function (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
render: function render(_render) {
|
|
121
|
+
var _this2 = this;
|
|
122
|
+
getterMethodNames.forEach(function (name) {
|
|
123
|
+
if (_this2[name] === undefined) return;
|
|
124
|
+
_this2[name].index = -1;
|
|
125
|
+
_this2[name].cache.clear();
|
|
117
126
|
});
|
|
118
|
-
return
|
|
127
|
+
return _render;
|
|
119
128
|
}
|
|
120
129
|
};
|
|
121
130
|
}
|
|
122
|
-
var _default = exports
|
|
131
|
+
var _default = exports["default"] = Enhancement;
|
|
123
132
|
//# sourceMappingURL=staticChildren.js.map
|