import { showContextMenu as e } from "../contextMenu/index.js";
import { rotate as t } from "./domain.js";
import { createCommentVNode as n, createElementBlock as r, createTextVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, toDisplayString as c, withModifiers as l } from "vue";
var u = ["^data-col-id"], d = /* @__PURE__ */ a({
	__name: "ThCell",
	props: { col: {} },
	emits: [
		"delete:column",
		"expand:column",
		"change:sort"
	],
	setup(a, { emit: d }) {
		let f = d;
		function p(t) {
			t.preventDefault();
			let n = [];
			n.length && e(t, n);
		}
		function m(e) {
			let n = e.sort?.direction ?? "DESC";
			f("change:sort", {
				colId: e.id,
				direction: t(n, ["DESC", "ASC"])
			});
		}
		return (e, t) => (s(), r("div", {
			class: o(["cell th-cell", {
				"justify-center": a.col.justify,
				frozen: a.col.frozen
			}]),
			"^data-col-id": a.col.id,
			onContextmenu: p
		}, [
			a.col.valueType ? (s(), r("div", {
				key: 0,
				class: o(a.col.valueType)
			}, null, 2)) : n("", !0),
			i(" " + c(a.col.label) + " ", 1),
			a.col.sort ? (s(), r("div", {
				key: 1,
				class: o(["sort", a.col.sort.direction]),
				onClick: t[0] ||= l(() => m(a.col), ["stop"])
			}, null, 2)) : n("", !0)
		], 42, u));
	}
});
export { d as default };

//# sourceMappingURL=ThCell.vue2.js.map