import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import CustomHeaderCell$1 from "./CellProvider/index.js";
import React from "react";
import styled from "styled-components";
import { Resizable } from "react-resizable";
import "react-resizable/css/styles.css";
//#region src/components/table/Table/tableConfig/header/index.tsx
const _excluded = ["index"], _excluded2 = [
	"onResize",
	"width",
	"field_type",
	"lock",
	"editable",
	"dataIndex",
	"position"
];
const ResizeCellStyle = styled(Resizable)`
	&::before {
		position: absolute;
		top: 50%;
		right: 0;
		width: 1px;
		height: 1.6em;
		background-color: rgba(0, 0, 0, 0.06);
		transform: translateY(-50%);
		transition: background-color 0.3s;
		content: "";
	}

	&:last-child::before {
		display: none;
	}

	.react-resizable {
		position: relative;
		background-clip: padding-box;
	}

	.react-resizable-handle {
		position: absolute;
		width: 10px;
		height: 100%;
		bottom: 0;
		cursor: col-resize;
		background-image: none;
		z-index: 1;
	}
`;
const CustomHeaderRow = (_ref) => {
	let { index } = _ref, props = _objectWithoutProperties(_ref, _excluded);
	return /* @__PURE__ */ React.createElement("tr", props);
};
const CustomHeaderCell = (props) => {
	const { onResize, width, field_type, lock, editable, dataIndex, position } = props, restProps = _objectWithoutProperties(props, _excluded2);
	if (!props.record) restProps.style = _objectSpread2({}, restProps.style);
	if (position === "end") return /* @__PURE__ */ React.createElement("td", restProps, /* @__PURE__ */ React.createElement(CustomHeaderCell$1, props));
	return /* @__PURE__ */ React.createElement(ResizeCellStyle, {
		width: width || 200,
		height: 0,
		onResize,
		draggableOpts: { enableUserSelectHack: false }
	}, /* @__PURE__ */ React.createElement("td", restProps, /* @__PURE__ */ React.createElement(CustomHeaderCell$1, props)));
};
var header_default = {
	Row: CustomHeaderRow,
	Cell: CustomHeaderCell
};
//#endregion
export { header_default as default };
