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