reka-ui
Version:
Vue port for Radix UI Primitives.
43 lines (39 loc) • 1.32 kB
JavaScript
;
const vue = require('vue');
const shared_useForwardExpose = require('../shared/useForwardExpose.cjs');
const RovingFocus_RovingFocusItem = require('../RovingFocus/RovingFocusItem.cjs');
const Primitive_Primitive = require('../Primitive/Primitive.cjs');
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "ToolbarLink",
props: {
asChild: { type: Boolean },
as: { default: "a" }
},
setup(__props) {
const props = __props;
const { forwardRef } = shared_useForwardExpose.useForwardExpose();
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(RovingFocus_RovingFocusItem._sfc_main), {
"as-child": "",
focusable: ""
}, {
default: vue.withCtx(() => [
vue.createVNode(vue.unref(Primitive_Primitive.Primitive), vue.mergeProps(props, {
ref: vue.unref(forwardRef),
onKeydown: _cache[0] || (_cache[0] = (event) => {
if (event.key === " ") event.currentTarget?.click();
})
}), {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16)
]),
_: 3
});
};
}
});
exports._sfc_main = _sfc_main;
//# sourceMappingURL=ToolbarLink.cjs.map