UNPKG

@ark-ui/vue

Version:

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

36 lines (33 loc) 1.29 kB
import { defineComponent, useId, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useDatePickerContext } from './use-date-picker-context.js'; import { DatePickerTablePropsProvider } from './use-date-picker-table-props-context.js'; import { useDatePickerViewPropsContext } from './use-date-picker-view-props-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "date-picker-table", props: { view: {}, columns: {}, id: {}, asChild: { type: Boolean } }, setup(__props) { const props = __props; const datePicker = useDatePickerContext(); const viewProps = useDatePickerViewPropsContext(); const uid = useId(); const id = props.id ?? uid; DatePickerTablePropsProvider({ ...props, id, ...viewProps }); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).table, mergeProps(unref(datePicker).getTableProps(props), { "as-child": __props.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };