UNPKG

@ark-ui/vue

Version:

A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.

36 lines (29 loc) 1.07 kB
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const asyncList = require('@zag-js/async-list'); const vue$1 = require('@zag-js/vue'); const vue = require('vue'); const cleanProps = require('../../utils/clean-props.cjs'); function _interopNamespaceDefault(e) { const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { for (const k in e) { if (k !== 'default') { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const asyncList__namespace = /*#__PURE__*/_interopNamespaceDefault(asyncList); const useAsyncList = (props = {}) => { const context = vue.computed(() => cleanProps.cleanProps(vue.toValue(props))); const service = vue$1.useMachine(asyncList__namespace.machine, context); return vue.computed(() => asyncList__namespace.connect(service)); }; exports.useAsyncList = useAsyncList;