99 lines
2.5 KiB
JavaScript
99 lines
2.5 KiB
JavaScript
import { createContext } from "../shared/createContext.js";
|
|
import { useDirection } from "../shared/useDirection.js";
|
|
import { useForwardExpose } from "../shared/useForwardExpose.js";
|
|
import { useId } from "../shared/useId.js";
|
|
import { Primitive } from "../Primitive/Primitive.js";
|
|
import { createBlock, defineComponent, openBlock, ref, renderSlot, toRefs, unref, withCtx } from "vue";
|
|
import { useVModel } from "@vueuse/core";
|
|
|
|
//#region src/Tabs/TabsRoot.vue?vue&type=script&setup=true&lang.ts
|
|
const [injectTabsRootContext, provideTabsRootContext] = createContext("TabsRoot");
|
|
var TabsRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
__name: "TabsRoot",
|
|
props: {
|
|
defaultValue: {
|
|
type: null,
|
|
required: false
|
|
},
|
|
orientation: {
|
|
type: String,
|
|
required: false,
|
|
default: "horizontal"
|
|
},
|
|
dir: {
|
|
type: String,
|
|
required: false
|
|
},
|
|
activationMode: {
|
|
type: String,
|
|
required: false,
|
|
default: "automatic"
|
|
},
|
|
modelValue: {
|
|
type: null,
|
|
required: false
|
|
},
|
|
unmountOnHide: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: true
|
|
},
|
|
asChild: {
|
|
type: Boolean,
|
|
required: false
|
|
},
|
|
as: {
|
|
type: null,
|
|
required: false
|
|
}
|
|
},
|
|
emits: ["update:modelValue"],
|
|
setup(__props, { emit: __emit }) {
|
|
const props = __props;
|
|
const emits = __emit;
|
|
const { orientation, unmountOnHide, dir: propDir } = toRefs(props);
|
|
const dir = useDirection(propDir);
|
|
useForwardExpose();
|
|
const modelValue = useVModel(props, "modelValue", emits, {
|
|
defaultValue: props.defaultValue,
|
|
passive: props.modelValue === void 0
|
|
});
|
|
const tabsList = ref();
|
|
provideTabsRootContext({
|
|
modelValue,
|
|
changeModelValue: (value) => {
|
|
modelValue.value = value;
|
|
},
|
|
orientation,
|
|
dir,
|
|
unmountOnHide,
|
|
activationMode: props.activationMode,
|
|
baseId: useId(void 0, "reka-tabs"),
|
|
tabsList
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return openBlock(), createBlock(unref(Primitive), {
|
|
dir: unref(dir),
|
|
"data-orientation": unref(orientation),
|
|
"as-child": _ctx.asChild,
|
|
as: _ctx.as
|
|
}, {
|
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", { modelValue: unref(modelValue) })]),
|
|
_: 3
|
|
}, 8, [
|
|
"dir",
|
|
"data-orientation",
|
|
"as-child",
|
|
"as"
|
|
]);
|
|
};
|
|
}
|
|
});
|
|
|
|
//#endregion
|
|
//#region src/Tabs/TabsRoot.vue
|
|
var TabsRoot_default = TabsRoot_vue_vue_type_script_setup_true_lang_default;
|
|
|
|
//#endregion
|
|
export { TabsRoot_default, injectTabsRootContext };
|
|
//# sourceMappingURL=TabsRoot.js.map
|