@yamada-ui/utils
Advanced tools
Comparing version 1.6.2 to 1.7.0-dev-20241225014442
@@ -12,4 +12,4 @@ export { filterEmpty } from './array.js'; | ||
export { FlattenObjectOptions, assignAfter, filterObject, filterUndefined, flattenObject, getMemoizedObject, getObject, keysFormObject, memoizeObject, merge, objectFromEntries, omitObject, pickObject, replaceObject, splitObject } from './object.js'; | ||
export { AsyncFnReturn, AsyncState, AsyncStateRetry, FunctionReturningPromise, MaybeRenderProp, PromiseType, UseIsMountedProps, UseIsMountedReturn, UseMountedProps, UseMountedReturn, assignRef, createContext, createId, cx, findChild, findChildren, getValidChildren, includesChildren, isRefObject, isSomeElement, isValidElement, mergeRefs, omitChildren, pickChildren, useAsync, useAsyncFunc, useAsyncRetry, useCallbackRef, useIsMounted, useIsSsr, useMergeRefs, useMounted, useSafeLayoutEffect, useUnmountEffect, useUpdateEffect } from './react.js'; | ||
export { AsyncFnReturn, AsyncState, AsyncStateRetry, FunctionReturningPromise, MaybeRenderProp, PromiseType, UseIsMountedProps, UseIsMountedReturn, UseMountedProps, UseMountedReturn, assignRef, createContext, createId, cx, findChild, findChildren, getRef, getValidChildren, includesChildren, isRefObject, isSomeElement, isValidElement, mergeRefs, omitChildren, pickChildren, useAsync, useAsyncFunc, useAsyncRetry, useCallbackRef, useIsMounted, useIsSsr, useMergeRefs, useMounted, useSafeLayoutEffect, useUnmountEffect, useUpdateEffect } from './react.js'; | ||
export { antonym, escape, toCamelCase, toKebabCase, toPascalCase, toTitleCase, transformSize } from './string.js'; | ||
import 'react'; |
@@ -31,4 +31,4 @@ "use strict"; | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
var index_exports = {}; | ||
__export(index_exports, { | ||
COLOR_SCHEMES: () => COLOR_SCHEMES, | ||
@@ -77,2 +77,3 @@ SEMANTIC_COLOR_SCHEMES: () => SEMANTIC_COLOR_SCHEMES, | ||
getPx: () => getPx, | ||
getRef: () => getRef, | ||
getValidChildren: () => getValidChildren, | ||
@@ -173,3 +174,3 @@ handlerAll: () => handlerAll, | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
module.exports = __toCommonJS(index_exports); | ||
@@ -1142,2 +1143,12 @@ // src/array.ts | ||
} | ||
function getRef(element) { | ||
var _a, _b; | ||
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get; | ||
if (getter && "isReactWarning" in getter && getter.isReactWarning) | ||
return element.ref; | ||
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get; | ||
if (getter && "isReactWarning" in getter && getter.isReactWarning) | ||
return element.props.ref; | ||
return element.props.ref || element.ref; | ||
} | ||
function assignRef(ref, value) { | ||
@@ -1376,2 +1387,3 @@ if (ref == null) return; | ||
getPx, | ||
getRef, | ||
getValidChildren, | ||
@@ -1378,0 +1390,0 @@ handlerAll, |
@@ -51,2 +51,5 @@ import * as React from 'react'; | ||
}; | ||
declare function getRef<Y = HTMLElement>(element: React.ReactElement<{ | ||
ref: React.Ref<Y>; | ||
}>): React.Ref<Y> | undefined; | ||
declare function assignRef<T = any>(ref: ReactRef<T> | undefined, value: T): void; | ||
@@ -116,2 +119,2 @@ declare function mergeRefs<T = any>(...refs: (null | ReactRef<T> | undefined)[]): (node: null | T) => void; | ||
export { type AsyncFnReturn, type AsyncState, type AsyncStateRetry, type FunctionReturningPromise, type MaybeRenderProp, type PromiseType, type UseIsMountedProps, type UseIsMountedReturn, type UseMountedProps, type UseMountedReturn, assignRef, createContext, createId, cx, findChild, findChildren, getValidChildren, includesChildren, isRefObject, isSomeElement, isValidElement, mergeRefs, omitChildren, pickChildren, useAsync, useAsyncFunc, useAsyncRetry, useCallbackRef, useIsMounted, useIsSsr, useMergeRefs, useMounted, useSafeLayoutEffect, useUnmountEffect, useUpdateEffect }; | ||
export { type AsyncFnReturn, type AsyncState, type AsyncStateRetry, type FunctionReturningPromise, type MaybeRenderProp, type PromiseType, type UseIsMountedProps, type UseIsMountedReturn, type UseMountedProps, type UseMountedReturn, assignRef, createContext, createId, cx, findChild, findChildren, getRef, getValidChildren, includesChildren, isRefObject, isSomeElement, isValidElement, mergeRefs, omitChildren, pickChildren, useAsync, useAsyncFunc, useAsyncRetry, useCallbackRef, useIsMounted, useIsSsr, useMergeRefs, useMounted, useSafeLayoutEffect, useUnmountEffect, useUpdateEffect }; |
@@ -39,2 +39,3 @@ "use strict"; | ||
findChildren: () => findChildren, | ||
getRef: () => getRef, | ||
getValidChildren: () => getValidChildren, | ||
@@ -207,2 +208,12 @@ includesChildren: () => includesChildren, | ||
} | ||
function getRef(element) { | ||
var _a, _b; | ||
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get; | ||
if (getter && "isReactWarning" in getter && getter.isReactWarning) | ||
return element.ref; | ||
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get; | ||
if (getter && "isReactWarning" in getter && getter.isReactWarning) | ||
return element.props.ref; | ||
return element.props.ref || element.ref; | ||
} | ||
function assignRef(ref, value) { | ||
@@ -316,2 +327,3 @@ if (ref == null) return; | ||
findChildren, | ||
getRef, | ||
getValidChildren, | ||
@@ -318,0 +330,0 @@ includesChildren, |
{ | ||
"name": "@yamada-ui/utils", | ||
"version": "1.6.2", | ||
"version": "1.7.0-dev-20241225014442", | ||
"description": "Yamada UI utils", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
434371
5635
1