@chakra-ui/vue-utils
Advanced tools
Comparing version 0.0.0-dev-20230227050731 to 0.0.0-dev-20230304213409
# @chakra-ui/vue-utils | ||
## 0.0.0-dev-20230227050731 | ||
## 0.0.0-dev-20230304213409 | ||
@@ -12,2 +12,3 @@ ### Major Changes | ||
- bc95c4d6: Add popover component | ||
- 630d1c5c: Add slot and prop support for icon compoennts in icon button and | ||
@@ -14,0 +15,0 @@ icon |
import 'vue'; | ||
export { C as ConfigurableDocument, o as ConfigurableDocumentOrShadowRoot, p as ConfigurableLocation, q as ConfigurableNavigator, r as ConfigurableWindow, g as DebouncedRef, l as MaybeElementRef, T as TemplateRef, V as VueComponentInstance, f as contains, h as defaultDocument, i as defaultLocation, j as defaultNavigator, k as defaultWindow, u as unrefElement, m as useDebouncedRef, n as useRef } from './dom-42b5cffd.js'; | ||
export { C as ConfigurableDocument, o as ConfigurableDocumentOrShadowRoot, p as ConfigurableLocation, q as ConfigurableNavigator, r as ConfigurableWindow, g as DebouncedRef, l as MaybeElementRef, T as TemplateRef, V as VueComponentInstance, f as contains, h as defaultDocument, i as defaultLocation, j as defaultNavigator, k as defaultWindow, u as unrefElement, m as useDebouncedRef, n as useRef } from './dom-05b6d9ec.js'; |
@@ -1,5 +0,5 @@ | ||
export { A as AnyFn, a as Arrayable, C as ConfigurableDocument, o as ConfigurableDocumentOrShadowRoot, p as ConfigurableLocation, q as ConfigurableNavigator, r as ConfigurableWindow, g as DebouncedRef, D as DeepMaybeRef, F as Fn, M as MaybeBaseRef, b as MaybeComputedRef, l as MaybeElementRef, c as MaybeReadonlyRef, d as MaybeRef, s as MergedVNodeProps, R as RemovableRef, e as RemoveableRef, T as TemplateRef, V as VueComponentInstance, f as contains, h as defaultDocument, i as defaultLocation, j as defaultNavigator, k as defaultWindow, u as unrefElement, m as useDebouncedRef, n as useRef } from './dom-42b5cffd.js'; | ||
export { A as AnyFn, a as Arrayable, t as Assign, C as ConfigurableDocument, o as ConfigurableDocumentOrShadowRoot, p as ConfigurableLocation, q as ConfigurableNavigator, r as ConfigurableWindow, g as DebouncedRef, D as DeepMaybeRef, F as Fn, M as MaybeBaseRef, b as MaybeComputedRef, l as MaybeElementRef, c as MaybeReadonlyRef, d as MaybeRef, s as MergedVNodeProps, O as Optional, R as RemovableRef, e as RemoveableRef, T as TemplateRef, V as VueComponentInstance, f as contains, h as defaultDocument, i as defaultLocation, j as defaultNavigator, k as defaultWindow, u as unrefElement, m as useDebouncedRef, n as useRef } from './dom-05b6d9ec.js'; | ||
export { camelCase } from './string.js'; | ||
export { canUseDOM } from '@chakra-ui/utils'; | ||
export { CouldBeObjectComponent, CreateContextOptions, createContext, getValidChildren, isObjectComponent, resolveRef } from './vue-utils.js'; | ||
export { CouldBeObjectComponent, CreateContextOptions, createContext, getValidChildren, isObjectComponent, resolveRef, withSingleton } from './vue-utils.js'; | ||
export { debounce } from './timers.js'; | ||
@@ -6,0 +6,0 @@ export { StyleAndHTMLAttibutes, extractStyleAttrs } from './attrs.js'; |
@@ -65,3 +65,4 @@ "use strict"; | ||
useThemingProps: () => useThemingProps, | ||
vueThemingProps: () => vueThemingProps | ||
vueThemingProps: () => vueThemingProps, | ||
withSingleton: () => withSingleton | ||
}); | ||
@@ -176,2 +177,13 @@ module.exports = __toCommonJS(src_exports); | ||
__name(getValidChildren, "getValidChildren"); | ||
function withSingleton(slots, componentName, props) { | ||
const validChildren = getValidChildren(slots); | ||
if (validChildren.length > 1) { | ||
const errorMessage = `[${componentName}] : ${componentName} can only have one root element.`; | ||
console.error(errorMessage); | ||
throw new SyntaxError(errorMessage); | ||
} | ||
const finalSlot = (0, import_vue2.cloneVNode)(validChildren[0]); | ||
return (0, import_vue2.h)(finalSlot, props); | ||
} | ||
__name(withSingleton, "withSingleton"); | ||
function isObjectComponent(subject) { | ||
@@ -506,3 +518,4 @@ const validComponentTypes = ["function", "object"]; | ||
useThemingProps, | ||
vueThemingProps | ||
vueThemingProps, | ||
withSingleton | ||
}); |
@@ -1,2 +0,2 @@ | ||
import { F as Fn } from './dom-42b5cffd.js'; | ||
import { F as Fn } from './dom-05b6d9ec.js'; | ||
import 'vue'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,1 +0,1 @@ | ||
{"inputs":{"src/attrs.ts":{"bytes":1531,"imports":[]},"src/configurable.ts":{"bytes":152,"imports":[]},"src/dom-query.ts":{"bytes":1629,"imports":[]},"src/timers.ts":{"bytes":386,"imports":[]},"src/dom.ts":{"bytes":4301,"imports":[{"path":"src/timers.ts","kind":"import-statement"}]},"src/focus.ts":{"bytes":3530,"imports":[]},"src/generate-id.ts":{"bytes":418,"imports":[]},"src/types.ts":{"bytes":1776,"imports":[]},"src/string.ts":{"bytes":258,"imports":[]},"src/vue-utils.ts":{"bytes":3095,"imports":[]},"src/keys.ts":{"bytes":386,"imports":[]},"src/match.ts":{"bytes":737,"imports":[]},"src/object.ts":{"bytes":148,"imports":[]},"src/layout.ts":{"bytes":367,"imports":[]},"src/props.ts":{"bytes":1022,"imports":[]},"src/lifecycles.ts":{"bytes":1434,"imports":[]},"src/scope.ts":{"bytes":416,"imports":[]},"src/index.tsx":{"bytes":1567,"imports":[{"path":"src/types.ts","kind":"import-statement"},{"path":"src/string.ts","kind":"import-statement"},{"path":"src/configurable.ts","kind":"import-statement"},{"path":"src/dom.ts","kind":"import-statement"},{"path":"src/vue-utils.ts","kind":"import-statement"},{"path":"src/timers.ts","kind":"import-statement"},{"path":"src/attrs.ts","kind":"import-statement"},{"path":"src/focus.ts","kind":"import-statement"},{"path":"src/generate-id.ts","kind":"import-statement"},{"path":"src/dom-query.ts","kind":"import-statement"},{"path":"src/keys.ts","kind":"import-statement"},{"path":"src/match.ts","kind":"import-statement"},{"path":"src/object.ts","kind":"import-statement"},{"path":"src/layout.ts","kind":"import-statement"},{"path":"src/props.ts","kind":"import-statement"},{"path":"src/lifecycles.ts","kind":"import-statement"},{"path":"src/scope.ts","kind":"import-statement"}]}},"outputs":{"dist/attrs.js":{"imports":[],"exports":[],"entryPoint":"src/attrs.ts","inputs":{"src/attrs.ts":{"bytesInOutput":1093}},"bytes":2421},"dist/configurable.js":{"imports":[],"exports":[],"entryPoint":"src/configurable.ts","inputs":{"src/configurable.ts":{"bytesInOutput":211}},"bytes":1137},"dist/dom-query.js":{"imports":[],"exports":[],"entryPoint":"src/dom-query.ts","inputs":{"src/dom-query.ts":{"bytesInOutput":1089}},"bytes":2104},"dist/dom.js":{"imports":[],"exports":[],"entryPoint":"src/dom.ts","inputs":{"src/dom.ts":{"bytesInOutput":2003},"src/timers.ts":{"bytesInOutput":266}},"bytes":3428},"dist/focus.js":{"imports":[],"exports":[],"entryPoint":"src/focus.ts","inputs":{"src/focus.ts":{"bytesInOutput":3065}},"bytes":4112},"dist/generate-id.js":{"imports":[],"exports":[],"entryPoint":"src/generate-id.ts","inputs":{"src/generate-id.ts":{"bytesInOutput":494}},"bytes":1505},"dist/index.js":{"imports":[],"exports":[],"entryPoint":"src/index.tsx","inputs":{"src/index.tsx":{"bytesInOutput":1333},"src/string.ts":{"bytesInOutput":202},"src/configurable.ts":{"bytesInOutput":48},"src/dom.ts":{"bytesInOutput":1619},"src/timers.ts":{"bytesInOutput":266},"src/vue-utils.ts":{"bytesInOutput":1760},"src/attrs.ts":{"bytesInOutput":950},"src/focus.ts":{"bytesInOutput":2850},"src/generate-id.ts":{"bytesInOutput":355},"src/dom-query.ts":{"bytesInOutput":944},"src/keys.ts":{"bytesInOutput":471},"src/match.ts":{"bytesInOutput":480},"src/object.ts":{"bytesInOutput":59},"src/layout.ts":{"bytesInOutput":222},"src/props.ts":{"bytesInOutput":567},"src/lifecycles.ts":{"bytesInOutput":842},"src/scope.ts":{"bytesInOutput":239}},"bytes":15364},"dist/keys.js":{"imports":[],"exports":[],"entryPoint":"src/keys.ts","inputs":{"src/keys.ts":{"bytesInOutput":587}},"bytes":1500},"dist/layout.js":{"imports":[],"exports":[],"entryPoint":"src/layout.ts","inputs":{"src/layout.ts":{"bytesInOutput":348}},"bytes":1355},"dist/lifecycles.js":{"imports":[],"exports":[],"entryPoint":"src/lifecycles.ts","inputs":{"src/lifecycles.ts":{"bytesInOutput":1113}},"bytes":2190},"dist/match.js":{"imports":[],"exports":[],"entryPoint":"src/match.ts","inputs":{"src/match.ts":{"bytesInOutput":601}},"bytes":1606},"dist/object.js":{"imports":[],"exports":[],"entryPoint":"src/object.ts","inputs":{"src/object.ts":{"bytesInOutput":202}},"bytes":1433},"dist/props.js":{"imports":[],"exports":[],"entryPoint":"src/props.ts","inputs":{"src/props.ts":{"bytesInOutput":802}},"bytes":1858},"dist/scope.js":{"imports":[],"exports":[],"entryPoint":"src/scope.ts","inputs":{"src/scope.ts":{"bytesInOutput":381}},"bytes":1398},"dist/string.js":{"imports":[],"exports":[],"entryPoint":"src/string.ts","inputs":{"src/string.ts":{"bytesInOutput":334}},"bytes":1565},"dist/timers.js":{"imports":[],"exports":[],"entryPoint":"src/timers.ts","inputs":{"src/timers.ts":{"bytesInOutput":396}},"bytes":1405},"dist/types.js":{"imports":[],"exports":[],"entryPoint":"src/types.ts","inputs":{"src/types.ts":{"bytesInOutput":70}},"bytes":758},"dist/vue-utils.js":{"imports":[],"exports":[],"entryPoint":"src/vue-utils.ts","inputs":{"src/vue-utils.ts":{"bytesInOutput":2022}},"bytes":3094}}} | ||
{"inputs":{"src/attrs.ts":{"bytes":1531,"imports":[]},"src/configurable.ts":{"bytes":152,"imports":[]},"src/dom-query.ts":{"bytes":1629,"imports":[]},"src/timers.ts":{"bytes":386,"imports":[]},"src/dom.ts":{"bytes":4301,"imports":[{"path":"src/timers.ts","kind":"import-statement"}]},"src/focus.ts":{"bytes":3530,"imports":[]},"src/generate-id.ts":{"bytes":418,"imports":[]},"src/types.ts":{"bytes":2131,"imports":[]},"src/string.ts":{"bytes":258,"imports":[]},"src/vue-utils.ts":{"bytes":3772,"imports":[]},"src/keys.ts":{"bytes":386,"imports":[]},"src/match.ts":{"bytes":737,"imports":[]},"src/object.ts":{"bytes":148,"imports":[]},"src/layout.ts":{"bytes":367,"imports":[]},"src/props.ts":{"bytes":1022,"imports":[]},"src/lifecycles.ts":{"bytes":1434,"imports":[]},"src/scope.ts":{"bytes":416,"imports":[]},"src/index.tsx":{"bytes":1600,"imports":[{"path":"src/types.ts","kind":"import-statement"},{"path":"src/string.ts","kind":"import-statement"},{"path":"src/configurable.ts","kind":"import-statement"},{"path":"src/dom.ts","kind":"import-statement"},{"path":"src/vue-utils.ts","kind":"import-statement"},{"path":"src/timers.ts","kind":"import-statement"},{"path":"src/attrs.ts","kind":"import-statement"},{"path":"src/focus.ts","kind":"import-statement"},{"path":"src/generate-id.ts","kind":"import-statement"},{"path":"src/dom-query.ts","kind":"import-statement"},{"path":"src/keys.ts","kind":"import-statement"},{"path":"src/match.ts","kind":"import-statement"},{"path":"src/object.ts","kind":"import-statement"},{"path":"src/layout.ts","kind":"import-statement"},{"path":"src/props.ts","kind":"import-statement"},{"path":"src/lifecycles.ts","kind":"import-statement"},{"path":"src/scope.ts","kind":"import-statement"}]}},"outputs":{"dist/attrs.js":{"imports":[],"exports":[],"entryPoint":"src/attrs.ts","inputs":{"src/attrs.ts":{"bytesInOutput":1093}},"bytes":2421},"dist/configurable.js":{"imports":[],"exports":[],"entryPoint":"src/configurable.ts","inputs":{"src/configurable.ts":{"bytesInOutput":211}},"bytes":1137},"dist/dom-query.js":{"imports":[],"exports":[],"entryPoint":"src/dom-query.ts","inputs":{"src/dom-query.ts":{"bytesInOutput":1089}},"bytes":2104},"dist/dom.js":{"imports":[],"exports":[],"entryPoint":"src/dom.ts","inputs":{"src/dom.ts":{"bytesInOutput":2003},"src/timers.ts":{"bytesInOutput":266}},"bytes":3428},"dist/focus.js":{"imports":[],"exports":[],"entryPoint":"src/focus.ts","inputs":{"src/focus.ts":{"bytesInOutput":3065}},"bytes":4112},"dist/generate-id.js":{"imports":[],"exports":[],"entryPoint":"src/generate-id.ts","inputs":{"src/generate-id.ts":{"bytesInOutput":494}},"bytes":1505},"dist/index.js":{"imports":[],"exports":[],"entryPoint":"src/index.tsx","inputs":{"src/index.tsx":{"bytesInOutput":1371},"src/string.ts":{"bytesInOutput":202},"src/configurable.ts":{"bytesInOutput":48},"src/dom.ts":{"bytesInOutput":1619},"src/timers.ts":{"bytesInOutput":266},"src/vue-utils.ts":{"bytesInOutput":2229},"src/attrs.ts":{"bytesInOutput":950},"src/focus.ts":{"bytesInOutput":2850},"src/generate-id.ts":{"bytesInOutput":355},"src/dom-query.ts":{"bytesInOutput":944},"src/keys.ts":{"bytesInOutput":471},"src/match.ts":{"bytesInOutput":480},"src/object.ts":{"bytesInOutput":59},"src/layout.ts":{"bytesInOutput":222},"src/props.ts":{"bytesInOutput":567},"src/lifecycles.ts":{"bytesInOutput":842},"src/scope.ts":{"bytesInOutput":239}},"bytes":15888},"dist/keys.js":{"imports":[],"exports":[],"entryPoint":"src/keys.ts","inputs":{"src/keys.ts":{"bytesInOutput":587}},"bytes":1500},"dist/layout.js":{"imports":[],"exports":[],"entryPoint":"src/layout.ts","inputs":{"src/layout.ts":{"bytesInOutput":348}},"bytes":1355},"dist/lifecycles.js":{"imports":[],"exports":[],"entryPoint":"src/lifecycles.ts","inputs":{"src/lifecycles.ts":{"bytesInOutput":1113}},"bytes":2190},"dist/match.js":{"imports":[],"exports":[],"entryPoint":"src/match.ts","inputs":{"src/match.ts":{"bytesInOutput":601}},"bytes":1606},"dist/object.js":{"imports":[],"exports":[],"entryPoint":"src/object.ts","inputs":{"src/object.ts":{"bytesInOutput":202}},"bytes":1433},"dist/props.js":{"imports":[],"exports":[],"entryPoint":"src/props.ts","inputs":{"src/props.ts":{"bytesInOutput":802}},"bytes":1858},"dist/scope.js":{"imports":[],"exports":[],"entryPoint":"src/scope.ts","inputs":{"src/scope.ts":{"bytesInOutput":381}},"bytes":1398},"dist/string.js":{"imports":[],"exports":[],"entryPoint":"src/string.ts","inputs":{"src/string.ts":{"bytesInOutput":334}},"bytes":1565},"dist/timers.js":{"imports":[],"exports":[],"entryPoint":"src/timers.ts","inputs":{"src/timers.ts":{"bytesInOutput":396}},"bytes":1405},"dist/types.js":{"imports":[],"exports":[],"entryPoint":"src/types.ts","inputs":{"src/types.ts":{"bytesInOutput":70}},"bytes":758},"dist/vue-utils.js":{"imports":[],"exports":[],"entryPoint":"src/vue-utils.ts","inputs":{"src/vue-utils.ts":{"bytesInOutput":2527}},"bytes":3616}}} |
@@ -1,1 +0,1 @@ | ||
{"inputs":{"src/attrs.ts":{"bytes":1531,"imports":[]},"src/configurable.ts":{"bytes":152,"imports":[]},"src/dom-query.ts":{"bytes":1629,"imports":[]},"src/timers.ts":{"bytes":386,"imports":[]},"src/dom.ts":{"bytes":4301,"imports":[{"path":"src/timers.ts","kind":"import-statement"}]},"src/focus.ts":{"bytes":3530,"imports":[]},"src/generate-id.ts":{"bytes":418,"imports":[]},"src/types.ts":{"bytes":1776,"imports":[]},"src/string.ts":{"bytes":258,"imports":[]},"src/vue-utils.ts":{"bytes":3095,"imports":[]},"src/keys.ts":{"bytes":386,"imports":[]},"src/match.ts":{"bytes":737,"imports":[]},"src/object.ts":{"bytes":148,"imports":[]},"src/layout.ts":{"bytes":367,"imports":[]},"src/props.ts":{"bytes":1022,"imports":[]},"src/lifecycles.ts":{"bytes":1434,"imports":[]},"src/scope.ts":{"bytes":416,"imports":[]},"src/index.tsx":{"bytes":1567,"imports":[{"path":"src/types.ts","kind":"import-statement"},{"path":"src/string.ts","kind":"import-statement"},{"path":"src/configurable.ts","kind":"import-statement"},{"path":"src/dom.ts","kind":"import-statement"},{"path":"src/vue-utils.ts","kind":"import-statement"},{"path":"src/timers.ts","kind":"import-statement"},{"path":"src/attrs.ts","kind":"import-statement"},{"path":"src/focus.ts","kind":"import-statement"},{"path":"src/generate-id.ts","kind":"import-statement"},{"path":"src/dom-query.ts","kind":"import-statement"},{"path":"src/keys.ts","kind":"import-statement"},{"path":"src/match.ts","kind":"import-statement"},{"path":"src/object.ts","kind":"import-statement"},{"path":"src/layout.ts","kind":"import-statement"},{"path":"src/props.ts","kind":"import-statement"},{"path":"src/lifecycles.ts","kind":"import-statement"},{"path":"src/scope.ts","kind":"import-statement"}]}},"outputs":{"dist/types.mjs":{"imports":[{"path":"dist/chunk-WBQAMGXK.mjs","kind":"import-statement"}],"exports":[],"entryPoint":"src/types.ts","inputs":{},"bytes":31},"dist/vue-utils.mjs":{"imports":[{"path":"dist/chunk-A4MHKJPM.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["createContext","getValidChildren","isObjectComponent","resolveRef"],"entryPoint":"src/vue-utils.ts","inputs":{},"bytes":225},"dist/layout.mjs":{"imports":[{"path":"dist/chunk-GDKUSTFQ.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["orient"],"entryPoint":"src/layout.ts","inputs":{},"bytes":101},"dist/lifecycles.mjs":{"imports":[{"path":"dist/chunk-VZI6ZS64.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnBeforeMount","tryOnBeforeUnmount","tryOnMounted","tryOnUnmounted"],"entryPoint":"src/lifecycles.ts","inputs":{},"bytes":233},"dist/match.mjs":{"imports":[{"path":"dist/chunk-RR63ISK3.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["match"],"entryPoint":"src/match.ts","inputs":{},"bytes":99},"dist/object.mjs":{"imports":[{"path":"dist/chunk-IQQWXFXZ.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["mergeWith"],"entryPoint":"src/object.ts","inputs":{},"bytes":107},"dist/props.mjs":{"imports":[{"path":"dist/chunk-BRH7MJVF.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["SAO","SNA","SNAO","useThemingProps","vueThemingProps"],"entryPoint":"src/props.ts","inputs":{},"bytes":201},"dist/scope.mjs":{"imports":[{"path":"dist/chunk-7IQUBLZY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnScopeDispose"],"entryPoint":"src/scope.ts","inputs":{},"bytes":123},"dist/string.mjs":{"imports":[{"path":"dist/chunk-B4YDOGMH.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["camelCase"],"entryPoint":"src/string.ts","inputs":{},"bytes":107},"dist/timers.mjs":{"imports":[{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["debounce"],"entryPoint":"src/timers.ts","inputs":{},"bytes":105},"dist/attrs.mjs":{"imports":[{"path":"dist/chunk-ZYWZ54GH.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["extractStyleAttrs"],"entryPoint":"src/attrs.ts","inputs":{},"bytes":123},"dist/configurable.mjs":{"imports":[{"path":"dist/chunk-QRBG3VYN.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["canUseDOM"],"entryPoint":"src/configurable.ts","inputs":{},"bytes":107},"dist/dom-query.mjs":{"imports":[{"path":"dist/chunk-K3OX44D2.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["getSelector"],"entryPoint":"src/dom-query.ts","inputs":{},"bytes":111},"dist/dom.mjs":{"imports":[{"path":"dist/chunk-XMDYVJXS.mjs","kind":"import-statement"},{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["contains","defaultDocument","defaultLocation","defaultNavigator","defaultWindow","unrefElement","useDebouncedRef","useRef"],"entryPoint":"src/dom.ts","inputs":{},"bytes":376},"dist/focus.mjs":{"imports":[{"path":"dist/chunk-QTD2M7TA.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["Focus","FocusResult","focusElement","focusIn"],"entryPoint":"src/focus.ts","inputs":{},"bytes":183},"dist/generate-id.mjs":{"imports":[{"path":"dist/chunk-QD6EC5KN.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["genId"],"entryPoint":"src/generate-id.ts","inputs":{},"bytes":99},"dist/index.mjs":{"imports":[{"path":"dist/chunk-WBQAMGXK.mjs","kind":"import-statement"},{"path":"dist/chunk-A4MHKJPM.mjs","kind":"import-statement"},{"path":"dist/chunk-GDKUSTFQ.mjs","kind":"import-statement"},{"path":"dist/chunk-VZI6ZS64.mjs","kind":"import-statement"},{"path":"dist/chunk-RR63ISK3.mjs","kind":"import-statement"},{"path":"dist/chunk-IQQWXFXZ.mjs","kind":"import-statement"},{"path":"dist/chunk-BRH7MJVF.mjs","kind":"import-statement"},{"path":"dist/chunk-7IQUBLZY.mjs","kind":"import-statement"},{"path":"dist/chunk-B4YDOGMH.mjs","kind":"import-statement"},{"path":"dist/chunk-ZYWZ54GH.mjs","kind":"import-statement"},{"path":"dist/chunk-QRBG3VYN.mjs","kind":"import-statement"},{"path":"dist/chunk-K3OX44D2.mjs","kind":"import-statement"},{"path":"dist/chunk-XMDYVJXS.mjs","kind":"import-statement"},{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-QTD2M7TA.mjs","kind":"import-statement"},{"path":"dist/chunk-QD6EC5KN.mjs","kind":"import-statement"},{"path":"dist/chunk-EM4XXEGM.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["AnyFn","Arrayable","DebouncedRef","DeepMaybeRef","Fn","Focus","FocusResult","Keys","MaybeBaseRef","MaybeComputedRef","MaybeElementRef","MaybeReadonlyRef","MaybeRef","RemovableRef","RemoveableRef","SAO","SNA","SNAO","StyleAndHTMLAttibutes","TemplateRef","VueComponentInstance","camelCase","canUseDOM","contains","createContext","debounce","defaultDocument","defaultLocation","defaultNavigator","defaultWindow","extractStyleAttrs","focusElement","focusIn","genId","getSelector","getValidChildren","isObjectComponent","match","mergeWith","orient","resolveRef","tryOnBeforeMount","tryOnBeforeUnmount","tryOnMounted","tryOnScopeDispose","tryOnUnmounted","unrefElement","useDebouncedRef","useRef","useThemingProps","vueThemingProps"],"entryPoint":"src/index.tsx","inputs":{"src/index.tsx":{"bytesInOutput":0}},"bytes":1767},"dist/chunk-WBQAMGXK.mjs":{"imports":[],"exports":[],"inputs":{"src/types.ts":{"bytesInOutput":0}},"bytes":0},"dist/chunk-A4MHKJPM.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["createContext","getValidChildren","isObjectComponent","resolveRef"],"inputs":{"src/vue-utils.ts":{"bytesInOutput":1664}},"bytes":1818},"dist/chunk-GDKUSTFQ.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["orient"],"inputs":{"src/layout.ts":{"bytesInOutput":222}},"bytes":311},"dist/chunk-VZI6ZS64.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnBeforeMount","tryOnBeforeUnmount","tryOnMounted","tryOnUnmounted"],"inputs":{"src/lifecycles.ts":{"bytesInOutput":746}},"bytes":905},"dist/chunk-RR63ISK3.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["match"],"inputs":{"src/match.ts":{"bytesInOutput":480}},"bytes":567},"dist/chunk-IQQWXFXZ.mjs":{"imports":[],"exports":["mergeWith"],"inputs":{"src/object.ts":{"bytesInOutput":42}},"bytes":84},"dist/chunk-BRH7MJVF.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["SAO","SNA","SNAO","useThemingProps","vueThemingProps"],"inputs":{"src/props.ts":{"bytesInOutput":532}},"bytes":670},"dist/chunk-7IQUBLZY.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnScopeDispose"],"inputs":{"src/scope.ts":{"bytesInOutput":226}},"bytes":325},"dist/chunk-B4YDOGMH.mjs":{"imports":[],"exports":["camelCase"],"inputs":{"src/string.ts":{"bytesInOutput":132}},"bytes":174},"dist/chunk-ZYWZ54GH.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["extractStyleAttrs"],"inputs":{"src/attrs.ts":{"bytesInOutput":842}},"bytes":941},"dist/chunk-QRBG3VYN.mjs":{"imports":[],"exports":["canUseDOM"],"inputs":{"src/configurable.ts":{"bytesInOutput":46}},"bytes":94},"dist/chunk-K3OX44D2.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["getSelector"],"inputs":{"src/dom-query.ts":{"bytesInOutput":944}},"bytes":1041},"dist/chunk-XMDYVJXS.mjs":{"imports":[{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["contains","defaultDocument","defaultLocation","defaultNavigator","defaultWindow","unrefElement","useDebouncedRef","useRef"],"inputs":{"src/dom.ts":{"bytesInOutput":1488}},"bytes":1747},"dist/chunk-LOPJBGHY.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["debounce"],"inputs":{"src/timers.ts":{"bytesInOutput":266}},"bytes":357},"dist/chunk-QTD2M7TA.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["Focus","FocusResult","focusElement","focusIn"],"inputs":{"src/focus.ts":{"bytesInOutput":2834}},"bytes":2963},"dist/chunk-QD6EC5KN.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["genId"],"inputs":{"src/generate-id.ts":{"bytesInOutput":355}},"bytes":448},"dist/keys.mjs":{"imports":[{"path":"dist/chunk-EM4XXEGM.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["Keys"],"entryPoint":"src/keys.ts","inputs":{},"bytes":97},"dist/chunk-EM4XXEGM.mjs":{"imports":[],"exports":["Keys"],"inputs":{"src/keys.ts":{"bytesInOutput":471}},"bytes":506},"dist/chunk-INDHDMU3.mjs":{"imports":[],"exports":["__name"],"inputs":{},"bytes":151}}} | ||
{"inputs":{"src/attrs.ts":{"bytes":1531,"imports":[]},"src/configurable.ts":{"bytes":152,"imports":[]},"src/dom-query.ts":{"bytes":1629,"imports":[]},"src/timers.ts":{"bytes":386,"imports":[]},"src/dom.ts":{"bytes":4301,"imports":[{"path":"src/timers.ts","kind":"import-statement"}]},"src/focus.ts":{"bytes":3530,"imports":[]},"src/generate-id.ts":{"bytes":418,"imports":[]},"src/types.ts":{"bytes":2131,"imports":[]},"src/string.ts":{"bytes":258,"imports":[]},"src/vue-utils.ts":{"bytes":3772,"imports":[]},"src/keys.ts":{"bytes":386,"imports":[]},"src/match.ts":{"bytes":737,"imports":[]},"src/object.ts":{"bytes":148,"imports":[]},"src/layout.ts":{"bytes":367,"imports":[]},"src/props.ts":{"bytes":1022,"imports":[]},"src/lifecycles.ts":{"bytes":1434,"imports":[]},"src/scope.ts":{"bytes":416,"imports":[]},"src/index.tsx":{"bytes":1600,"imports":[{"path":"src/types.ts","kind":"import-statement"},{"path":"src/string.ts","kind":"import-statement"},{"path":"src/configurable.ts","kind":"import-statement"},{"path":"src/dom.ts","kind":"import-statement"},{"path":"src/vue-utils.ts","kind":"import-statement"},{"path":"src/timers.ts","kind":"import-statement"},{"path":"src/attrs.ts","kind":"import-statement"},{"path":"src/focus.ts","kind":"import-statement"},{"path":"src/generate-id.ts","kind":"import-statement"},{"path":"src/dom-query.ts","kind":"import-statement"},{"path":"src/keys.ts","kind":"import-statement"},{"path":"src/match.ts","kind":"import-statement"},{"path":"src/object.ts","kind":"import-statement"},{"path":"src/layout.ts","kind":"import-statement"},{"path":"src/props.ts","kind":"import-statement"},{"path":"src/lifecycles.ts","kind":"import-statement"},{"path":"src/scope.ts","kind":"import-statement"}]}},"outputs":{"dist/types.mjs":{"imports":[{"path":"dist/chunk-WBQAMGXK.mjs","kind":"import-statement"}],"exports":[],"entryPoint":"src/types.ts","inputs":{},"bytes":31},"dist/vue-utils.mjs":{"imports":[{"path":"dist/chunk-Z7EPKPW7.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["createContext","getValidChildren","isObjectComponent","resolveRef","withSingleton"],"entryPoint":"src/vue-utils.ts","inputs":{},"bytes":259},"dist/layout.mjs":{"imports":[{"path":"dist/chunk-GDKUSTFQ.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["orient"],"entryPoint":"src/layout.ts","inputs":{},"bytes":101},"dist/lifecycles.mjs":{"imports":[{"path":"dist/chunk-VZI6ZS64.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnBeforeMount","tryOnBeforeUnmount","tryOnMounted","tryOnUnmounted"],"entryPoint":"src/lifecycles.ts","inputs":{},"bytes":233},"dist/match.mjs":{"imports":[{"path":"dist/chunk-RR63ISK3.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["match"],"entryPoint":"src/match.ts","inputs":{},"bytes":99},"dist/object.mjs":{"imports":[{"path":"dist/chunk-IQQWXFXZ.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["mergeWith"],"entryPoint":"src/object.ts","inputs":{},"bytes":107},"dist/props.mjs":{"imports":[{"path":"dist/chunk-BRH7MJVF.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["SAO","SNA","SNAO","useThemingProps","vueThemingProps"],"entryPoint":"src/props.ts","inputs":{},"bytes":201},"dist/scope.mjs":{"imports":[{"path":"dist/chunk-7IQUBLZY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnScopeDispose"],"entryPoint":"src/scope.ts","inputs":{},"bytes":123},"dist/string.mjs":{"imports":[{"path":"dist/chunk-B4YDOGMH.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["camelCase"],"entryPoint":"src/string.ts","inputs":{},"bytes":107},"dist/timers.mjs":{"imports":[{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["debounce"],"entryPoint":"src/timers.ts","inputs":{},"bytes":105},"dist/attrs.mjs":{"imports":[{"path":"dist/chunk-ZYWZ54GH.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["extractStyleAttrs"],"entryPoint":"src/attrs.ts","inputs":{},"bytes":123},"dist/configurable.mjs":{"imports":[{"path":"dist/chunk-QRBG3VYN.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["canUseDOM"],"entryPoint":"src/configurable.ts","inputs":{},"bytes":107},"dist/dom-query.mjs":{"imports":[{"path":"dist/chunk-K3OX44D2.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["getSelector"],"entryPoint":"src/dom-query.ts","inputs":{},"bytes":111},"dist/dom.mjs":{"imports":[{"path":"dist/chunk-XMDYVJXS.mjs","kind":"import-statement"},{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["contains","defaultDocument","defaultLocation","defaultNavigator","defaultWindow","unrefElement","useDebouncedRef","useRef"],"entryPoint":"src/dom.ts","inputs":{},"bytes":376},"dist/focus.mjs":{"imports":[{"path":"dist/chunk-QTD2M7TA.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["Focus","FocusResult","focusElement","focusIn"],"entryPoint":"src/focus.ts","inputs":{},"bytes":183},"dist/generate-id.mjs":{"imports":[{"path":"dist/chunk-QD6EC5KN.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["genId"],"entryPoint":"src/generate-id.ts","inputs":{},"bytes":99},"dist/index.mjs":{"imports":[{"path":"dist/chunk-WBQAMGXK.mjs","kind":"import-statement"},{"path":"dist/chunk-Z7EPKPW7.mjs","kind":"import-statement"},{"path":"dist/chunk-GDKUSTFQ.mjs","kind":"import-statement"},{"path":"dist/chunk-VZI6ZS64.mjs","kind":"import-statement"},{"path":"dist/chunk-RR63ISK3.mjs","kind":"import-statement"},{"path":"dist/chunk-IQQWXFXZ.mjs","kind":"import-statement"},{"path":"dist/chunk-BRH7MJVF.mjs","kind":"import-statement"},{"path":"dist/chunk-7IQUBLZY.mjs","kind":"import-statement"},{"path":"dist/chunk-B4YDOGMH.mjs","kind":"import-statement"},{"path":"dist/chunk-ZYWZ54GH.mjs","kind":"import-statement"},{"path":"dist/chunk-QRBG3VYN.mjs","kind":"import-statement"},{"path":"dist/chunk-K3OX44D2.mjs","kind":"import-statement"},{"path":"dist/chunk-XMDYVJXS.mjs","kind":"import-statement"},{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-QTD2M7TA.mjs","kind":"import-statement"},{"path":"dist/chunk-QD6EC5KN.mjs","kind":"import-statement"},{"path":"dist/chunk-EM4XXEGM.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["AnyFn","Arrayable","DebouncedRef","DeepMaybeRef","Fn","Focus","FocusResult","Keys","MaybeBaseRef","MaybeComputedRef","MaybeElementRef","MaybeReadonlyRef","MaybeRef","RemovableRef","RemoveableRef","SAO","SNA","SNAO","StyleAndHTMLAttibutes","TemplateRef","VueComponentInstance","camelCase","canUseDOM","contains","createContext","debounce","defaultDocument","defaultLocation","defaultNavigator","defaultWindow","extractStyleAttrs","focusElement","focusIn","genId","getSelector","getValidChildren","isObjectComponent","match","mergeWith","orient","resolveRef","tryOnBeforeMount","tryOnBeforeUnmount","tryOnMounted","tryOnScopeDispose","tryOnUnmounted","unrefElement","useDebouncedRef","useRef","useThemingProps","vueThemingProps","withSingleton"],"entryPoint":"src/index.tsx","inputs":{"src/index.tsx":{"bytesInOutput":0}},"bytes":1801},"dist/chunk-WBQAMGXK.mjs":{"imports":[],"exports":[],"inputs":{"src/types.ts":{"bytesInOutput":0}},"bytes":0},"dist/chunk-Z7EPKPW7.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["createContext","getValidChildren","isObjectComponent","resolveRef","withSingleton"],"inputs":{"src/vue-utils.ts":{"bytesInOutput":2114}},"bytes":2285},"dist/chunk-GDKUSTFQ.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["orient"],"inputs":{"src/layout.ts":{"bytesInOutput":222}},"bytes":311},"dist/chunk-VZI6ZS64.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnBeforeMount","tryOnBeforeUnmount","tryOnMounted","tryOnUnmounted"],"inputs":{"src/lifecycles.ts":{"bytesInOutput":746}},"bytes":905},"dist/chunk-RR63ISK3.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["match"],"inputs":{"src/match.ts":{"bytesInOutput":480}},"bytes":567},"dist/chunk-IQQWXFXZ.mjs":{"imports":[],"exports":["mergeWith"],"inputs":{"src/object.ts":{"bytesInOutput":42}},"bytes":84},"dist/chunk-BRH7MJVF.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["SAO","SNA","SNAO","useThemingProps","vueThemingProps"],"inputs":{"src/props.ts":{"bytesInOutput":532}},"bytes":670},"dist/chunk-7IQUBLZY.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["tryOnScopeDispose"],"inputs":{"src/scope.ts":{"bytesInOutput":226}},"bytes":325},"dist/chunk-B4YDOGMH.mjs":{"imports":[],"exports":["camelCase"],"inputs":{"src/string.ts":{"bytesInOutput":132}},"bytes":174},"dist/chunk-ZYWZ54GH.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["extractStyleAttrs"],"inputs":{"src/attrs.ts":{"bytesInOutput":842}},"bytes":941},"dist/chunk-QRBG3VYN.mjs":{"imports":[],"exports":["canUseDOM"],"inputs":{"src/configurable.ts":{"bytesInOutput":46}},"bytes":94},"dist/chunk-K3OX44D2.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["getSelector"],"inputs":{"src/dom-query.ts":{"bytesInOutput":944}},"bytes":1041},"dist/chunk-XMDYVJXS.mjs":{"imports":[{"path":"dist/chunk-LOPJBGHY.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["contains","defaultDocument","defaultLocation","defaultNavigator","defaultWindow","unrefElement","useDebouncedRef","useRef"],"inputs":{"src/dom.ts":{"bytesInOutput":1488}},"bytes":1747},"dist/chunk-LOPJBGHY.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["debounce"],"inputs":{"src/timers.ts":{"bytesInOutput":266}},"bytes":357},"dist/chunk-QTD2M7TA.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["Focus","FocusResult","focusElement","focusIn"],"inputs":{"src/focus.ts":{"bytesInOutput":2834}},"bytes":2963},"dist/chunk-QD6EC5KN.mjs":{"imports":[{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["genId"],"inputs":{"src/generate-id.ts":{"bytesInOutput":355}},"bytes":448},"dist/keys.mjs":{"imports":[{"path":"dist/chunk-EM4XXEGM.mjs","kind":"import-statement"},{"path":"dist/chunk-INDHDMU3.mjs","kind":"import-statement"}],"exports":["Keys"],"entryPoint":"src/keys.ts","inputs":{},"bytes":97},"dist/chunk-EM4XXEGM.mjs":{"imports":[],"exports":["Keys"],"inputs":{"src/keys.ts":{"bytesInOutput":471}},"bytes":506},"dist/chunk-INDHDMU3.mjs":{"imports":[],"exports":["__name"],"inputs":{},"bytes":151}}} |
@@ -1,2 +0,2 @@ | ||
import { F as Fn } from './dom-42b5cffd.js'; | ||
import { F as Fn } from './dom-05b6d9ec.js'; | ||
import 'vue'; | ||
@@ -3,0 +3,0 @@ |
import 'vue'; | ||
export { A as AnyFn, a as Arrayable, D as DeepMaybeRef, F as Fn, M as MaybeBaseRef, b as MaybeComputedRef, c as MaybeReadonlyRef, d as MaybeRef, s as MergedVNodeProps, R as RemovableRef, e as RemoveableRef } from './dom-42b5cffd.js'; | ||
export { A as AnyFn, a as Arrayable, t as Assign, D as DeepMaybeRef, F as Fn, M as MaybeBaseRef, b as MaybeComputedRef, c as MaybeReadonlyRef, d as MaybeRef, s as MergedVNodeProps, O as Optional, R as RemovableRef, e as RemoveableRef } from './dom-05b6d9ec.js'; |
@@ -0,3 +1,5 @@ | ||
import * as vue from 'vue'; | ||
import { Slots, VNode, ComputedRef, Ref } from 'vue'; | ||
import { b as MaybeComputedRef, d as MaybeRef } from './dom-42b5cffd.js'; | ||
import { Dict } from '@chakra-ui/utils'; | ||
import { b as MaybeComputedRef, d as MaybeRef } from './dom-05b6d9ec.js'; | ||
@@ -35,2 +37,12 @@ interface CreateContextOptions { | ||
declare function getValidChildren(slots: Slots | null): VNode[]; | ||
/** | ||
* Returns a copy of only the valid default slot | ||
* | ||
* @param slots - the slots object from the component setup | ||
* @param componentName component display name for thrown errors | ||
* @returns A VNode clone of the default slot | ||
*/ | ||
declare function withSingleton(slots: Slots, componentName: string, props?: Dict): VNode<vue.RendererNode, vue.RendererElement, { | ||
[key: string]: any; | ||
}>; | ||
interface CouldBeObjectComponent { | ||
@@ -50,2 +62,2 @@ setup?: FunctionConstructor; | ||
export { CouldBeObjectComponent, CreateContextOptions, createContext, getValidChildren, isObjectComponent, resolveRef }; | ||
export { CouldBeObjectComponent, CreateContextOptions, createContext, getValidChildren, isObjectComponent, resolveRef, withSingleton }; |
@@ -27,3 +27,4 @@ "use strict"; | ||
isObjectComponent: () => isObjectComponent, | ||
resolveRef: () => resolveRef | ||
resolveRef: () => resolveRef, | ||
withSingleton: () => withSingleton | ||
}); | ||
@@ -63,2 +64,13 @@ module.exports = __toCommonJS(vue_utils_exports); | ||
__name(getValidChildren, "getValidChildren"); | ||
function withSingleton(slots, componentName, props) { | ||
const validChildren = getValidChildren(slots); | ||
if (validChildren.length > 1) { | ||
const errorMessage = `[${componentName}] : ${componentName} can only have one root element.`; | ||
console.error(errorMessage); | ||
throw new SyntaxError(errorMessage); | ||
} | ||
const finalSlot = (0, import_vue.cloneVNode)(validChildren[0]); | ||
return (0, import_vue.h)(finalSlot, props); | ||
} | ||
__name(withSingleton, "withSingleton"); | ||
function isObjectComponent(subject) { | ||
@@ -86,3 +98,4 @@ const validComponentTypes = ["function", "object"]; | ||
isObjectComponent, | ||
resolveRef | ||
resolveRef, | ||
withSingleton | ||
}); |
{ | ||
"name": "@chakra-ui/vue-utils", | ||
"version": "0.0.0-dev-20230227050731", | ||
"version": "0.0.0-dev-20230304213409", | ||
"main": "dist/index.js", | ||
@@ -43,5 +43,5 @@ "module": "dist/index.mjs", | ||
"types:check": "tsc --noEmit", | ||
"dev": "tsup --watch", | ||
"dev": "concurrently 'tsup --watch' 'tsup src --dts-only --watch'", | ||
"build:types": "tsup src --dts-only" | ||
} | ||
} |
@@ -80,1 +80,12 @@ import { ComputedRef, Ref, VNodeProps } from "vue" | ||
export type Arrayable<T> = T[] | T | ||
/** | ||
* Assign property types from right to left. | ||
* Handy for overriding e.g. `onChange` from an HTMLElement with your own type | ||
*/ | ||
export type Assign<Target, Source> = Omit<Target, keyof Source> & Source | ||
/** | ||
* Type to make properties optional and preserve their type | ||
*/ | ||
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K> |
@@ -1,2 +0,2 @@ | ||
import { isObject } from "@chakra-ui/utils" | ||
import { Dict, isObject } from "@chakra-ui/utils" | ||
import { | ||
@@ -13,2 +13,4 @@ inject, | ||
ref, | ||
cloneVNode, | ||
h, | ||
} from "vue" | ||
@@ -88,2 +90,26 @@ import { MaybeComputedRef, MaybeRef } from "./types" | ||
/** | ||
* Returns a copy of only the valid default slot | ||
* | ||
* @param slots - the slots object from the component setup | ||
* @param componentName component display name for thrown errors | ||
* @returns A VNode clone of the default slot | ||
*/ | ||
export function withSingleton( | ||
slots: Slots, | ||
componentName: string, | ||
props?: Dict | ||
) { | ||
const validChildren = getValidChildren(slots) | ||
if (validChildren.length > 1) { | ||
const errorMessage = `[${componentName}] : ${componentName} can only have one root element.` | ||
console.error(errorMessage) | ||
throw new SyntaxError(errorMessage) | ||
} | ||
const finalSlot = cloneVNode(validChildren[0]) | ||
return h(finalSlot, props) | ||
} | ||
export interface CouldBeObjectComponent { | ||
@@ -90,0 +116,0 @@ setup?: FunctionConstructor |
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
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
141968
3481