@equinor/eds-utils
Advanced tools
Comparing version 0.2.3 to 0.3.0-dev.20220905
@@ -25,17 +25,2 @@ 'use strict'; | ||
/** Returns a memoized function that calls passed refs sequentially with passed element */ | ||
const useCombinedRefs = function () { | ||
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { | ||
refs[_key] = arguments[_key]; | ||
} | ||
return react.useCallback(element => refs.forEach(ref => { | ||
if (typeof ref === 'function') { | ||
ref(element); | ||
} else if (ref && typeof ref === 'object') { | ||
ref.current = element; | ||
} | ||
}), [refs]); | ||
}; | ||
const autoWidthModifier = { | ||
@@ -62,2 +47,4 @@ name: 'sameWidth', | ||
}; | ||
/** @deprecated This hook is no longer used internally and will be removed in a future version. */ | ||
const usePopper = _ref3 => { | ||
@@ -588,2 +575,16 @@ let { | ||
const mergeRefs = function () { | ||
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { | ||
refs[_key] = arguments[_key]; | ||
} | ||
return element => refs.forEach(ref => { | ||
if (typeof ref === 'function') { | ||
ref(element); | ||
} else if (ref && typeof ref === 'object') { | ||
ref.current = element; | ||
} | ||
}); | ||
}; | ||
// Workaround | ||
@@ -611,2 +612,3 @@ // React ignores 'dispathEvent' on input/textarea, see https://github.com/facebook/react/issues/10135 | ||
exports.joinHandlers = joinHandlers; | ||
exports.mergeRefs = mergeRefs; | ||
exports.outlineTemplate = outlineTemplate; | ||
@@ -618,3 +620,2 @@ exports.setReactInputValue = setReactInputValue; | ||
exports.useAutoResize = useAutoResize; | ||
exports.useCombinedRefs = useCombinedRefs; | ||
exports.useGlobalKeyPress = useGlobalKeyPress; | ||
@@ -621,0 +622,0 @@ exports.useHideBodyScroll = useHideBodyScroll; |
@@ -25,2 +25,4 @@ import { useMemo } from 'react'; | ||
}; | ||
/** @deprecated This hook is no longer used internally and will be removed in a future version. */ | ||
const usePopper = _ref3 => { | ||
@@ -27,0 +29,0 @@ let { |
export { useOutsideClick } from './hooks/useOutsideClick.js'; | ||
export { useCombinedRefs } from './hooks/useCombinedRefs.js'; | ||
export { usePopper } from './hooks/usePopper.js'; | ||
@@ -12,2 +11,3 @@ export { useGlobalKeyPress } from './hooks/useGlobalKeyPress.js'; | ||
export { joinHandlers } from './utils/joinHandlers.js'; | ||
export { mergeRefs } from './utils/mergeRefs.js'; | ||
export { setReactInputValue } from './utils/setReactInputValue.js'; | ||
@@ -14,0 +14,0 @@ export { bordersTemplate } from './utils/templates/borders.js'; |
export { useOutsideClick } from './useOutsideClick'; | ||
export { useCombinedRefs } from './useCombinedRefs'; | ||
export * from './usePopper'; | ||
@@ -4,0 +3,0 @@ export { useGlobalKeyPress } from './useGlobalKeyPress'; |
@@ -11,2 +11,3 @@ import type { CSSProperties } from 'react'; | ||
}; | ||
/** @deprecated This hook is no longer used internally and will be removed in a future version. */ | ||
export declare const usePopper: ({ anchorEl, popperEl, arrowRef, placement, offset, autoWidth, }: PopperParams) => { | ||
@@ -13,0 +14,0 @@ styles: { |
export * from './templates'; | ||
export { joinHandlers } from './joinHandlers'; | ||
export { mergeRefs } from './mergeRefs'; | ||
export { setReactInputValue } from './setReactInputValue'; | ||
export type { OverridableComponent } from './overridableComponent'; | ||
export declare const trimSpaces: (text: string) => string; |
{ | ||
"name": "@equinor/eds-utils", | ||
"version": "0.2.3", | ||
"version": "0.3.0-dev.20220905", | ||
"description": "Utility functions and hooks for the Equinor Design System", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44077
49
1223