"use strict";
const vue = require("vue");
const useDefaults = require("./useDefaults-YXpmugKp.js");
const useNumberishToStyle = require("./useNumberishToStyle-ipmFoR-c.js");
const useColorVariantClasses = require("./useColorVariantClasses-BjkZZDqD.js");
const useId = require("./useId-Dl8Hi5_U.js");
const defaultStickyHeaderHeight = "300px";
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "BTableSimple",
  props: {
    bordered: { type: Boolean, default: false },
    borderless: { type: Boolean, default: false },
    borderVariant: { default: null },
    captionTop: { type: Boolean, default: false },
    dark: { type: Boolean, default: false },
    fixed: { type: Boolean, default: false },
    hover: { type: Boolean, default: false },
    id: { default: void 0 },
    noBorderCollapse: { type: Boolean, default: false },
    outlined: { type: Boolean, default: false },
    responsive: { type: [Boolean, String], default: false },
    small: { type: Boolean, default: false },
    stacked: { type: [Boolean, String], default: false },
    stickyHeader: { type: [Boolean, String, Number], default: false },
    striped: { type: Boolean, default: false },
    stripedColumns: { type: Boolean, default: false },
    variant: { default: null },
    tableAttrs: { default: void 0 },
    tableClass: { default: void 0 }
  },
  setup(__props) {
    const _props = __props;
    const props = useDefaults.useDefaults(_props, "BTableSimple");
    const computedId = useId.useId(() => props.id);
    const colorClasses = useColorVariantClasses.useColorVariantClasses(
      vue.computed(() => ({
        borderVariant: props.borderVariant
      }))
    );
    const computedClasses = vue.computed(() => [
      props.tableClass,
      "table",
      "b-table",
      colorClasses.value,
      {
        "border": props.outlined,
        "table-bordered": props.bordered,
        "table-borderless": props.borderless,
        "caption-top": props.captionTop,
        "table-dark": props.dark,
        "table-hover": props.hover,
        "b-table-stacked": props.stacked === true,
        [`b-table-stacked-${props.stacked}`]: typeof props.stacked === "string",
        "table-striped": props.striped,
        "table-sm": props.small,
        [`table-${props.variant}`]: props.variant !== null,
        "table-striped-columns": props.stripedColumns,
        "b-table-fixed": props.fixed,
        "b-table-no-border-collapse": props.noBorderCollapse
      }
    ]);
    const computedTableAttrs = vue.computed(() => ({
      id: computedId.value,
      class: computedClasses.value,
      ...props.tableAttrs
    }));
    const computedSticky = useNumberishToStyle.useNumberishToStyle(
      vue.computed(
        () => (props.stickyHeader === true ? defaultStickyHeaderHeight : props.stickyHeader) || Number.NaN
      )
    );
    const stickyIsValid = vue.computed(() => props.stickyHeader !== false);
    const isResponsive = vue.computed(() => props.responsive !== false || stickyIsValid.value);
    const responsiveStyles = vue.computed(
      () => stickyIsValid.value ? { maxHeight: computedSticky.value } : void 0
    );
    const responsiveClasses = vue.computed(() => ({
      "table-responsive": props.responsive === true,
      [`table-responsive-${props.responsive}`]: typeof props.responsive === "string",
      "b-table-sticky-header": stickyIsValid.value
    }));
    return (_ctx, _cache) => {
      return isResponsive.value ? (vue.openBlock(), vue.createElementBlock("div", {
        key: 0,
        class: vue.normalizeClass(responsiveClasses.value),
        style: vue.normalizeStyle(responsiveStyles.value)
      }, [
        vue.createElementVNode("table", vue.normalizeProps(vue.guardReactiveProps(computedTableAttrs.value)), [
          vue.renderSlot(_ctx.$slots, "default")
        ], 16)
      ], 6)) : (vue.openBlock(), vue.createElementBlock("table", vue.normalizeProps(vue.mergeProps({ key: 1 }, computedTableAttrs.value)), [
        vue.renderSlot(_ctx.$slots, "default")
      ], 16));
    };
  }
});
exports._sfc_main = _sfc_main;
//# sourceMappingURL=BTableSimple.vue_vue_type_script_setup_true_lang-fbqLNWG6.js.map
