import { createVNode } from "vue";
import "./styles/table-th.scss";
import { Icon } from "../icon/icon.mjs";
import { Button } from "../button/button.mjs";
import { defineComponent } from "../../utils/define-component.mjs";
import { pick } from "../../utils/dist/index.mjs";
const TableTh = defineComponent({
  name: "VeTableTh",
  props: {
    sortable: Boolean,
    sortDesc: Boolean,
    sortIcon: {
      type: String,
      default: "$sort"
    },
    sortActiveColor: {
      type: String,
      default: "primary"
    },
    filterIcon: {
      type: String,
      default: "$filter"
    },
    filters: {
      type: Array,
      default: () => []
    },
    fixed: [Boolean, String],
    align: {
      type: String,
      default: "start"
    }
  },
  setup(props, {
    slots
  }) {
    return () => {
      var _a;
      return createVNode("th", {
        "class": ["ve-table-th", `text-${props.align}`, {
          "ve-table-th--sortable": props.sortable,
          "ve-table-th--sorted": props.sortDesc !== void 0,
          "ve-table-th--fixed-start": props.fixed === "start",
          "ve-table-th--fixed-end": props.fixed === "end"
        }]
      }, [createVNode("div", {
        "class": "ve-table-th__wrapper"
      }, [(_a = slots.default) == null ? void 0 : _a.call(slots), props.sortable && createVNode(Icon, {
        "class": {
          "ve-table-th__sorter": true,
          "ve-table-th__sorter--desc": props.sortDesc === true
        },
        "icon": props.sortIcon,
        "color": props.sortDesc !== void 0 ? props.sortActiveColor : void 0
      }, null)]), props.filters.length > 0 && createVNode(Button, {
        "class": "ve-table-th__filter",
        "icon": props.filterIcon,
        "variant": "text",
        "onClick": (e) => {
          e.stopPropagation();
        }
      }, null)]);
    };
  }
});
function filterTableThProps(attrs) {
  return pick(attrs, Object.keys(TableTh.props));
}
export {
  TableTh,
  filterTableThProps
};
//# sourceMappingURL=table-th.mjs.map
