import { defineComponent as b, createElementBlock as d, openBlock as i, normalizeClass as s, unref as t, Fragment as y, renderList as f, createBlock as v, withKeys as x, normalizeStyle as h, withCtx as k, renderSlot as V, createElementVNode as w, toDisplayString as B } from "vue";
import a from "./pl-tabs.module.scss.js";
import C from "./Tab.vue.js";
const L = {
  name: "PlTabs"
}, T = /* @__PURE__ */ b({
  ...L,
  props: {
    modelValue: {},
    options: {},
    disabled: { type: Boolean },
    topLine: { type: Boolean },
    maxTabWidth: {}
  },
  emits: ["update:modelValue"],
  setup(l, { emit: m }) {
    const u = m, o = (n) => u("update:modelValue", n);
    return (n, $) => (i(), d("div", {
      class: s([t(a).component, { [t(a).disabled]: l.disabled, [t(a).topLine]: l.topLine }])
    }, [
      (i(!0), d(y, null, f(l.options, (e, r) => (i(), v(C, {
        key: r,
        tabindex: l.modelValue === e.value || l.disabled || e.disabled ? void 0 : 0,
        option: e,
        class: s([{ [t(a).active]: l.modelValue === e.value, [t(a).disabled]: e.disabled }, t(a).tab]),
        style: h({ "--pl-tabs-item-max-width": e.maxWidth ?? l.maxTabWidth }),
        onKeydown: x((c) => o(e.value), ["enter"]),
        onClick: (c) => o(e.value)
      }, {
        default: k(() => [
          V(n.$slots, e.value, { option: e }, () => [
            w("span", null, B(e.label), 1)
          ])
        ]),
        _: 2
      }, 1032, ["tabindex", "option", "class", "style", "onKeydown", "onClick"]))), 128))
    ], 2));
  }
});
export {
  T as default
};
//# sourceMappingURL=PlTabs.vue.js.map
