var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/table/Table/tableConfig/header/index.tsx
var header_exports = {};
__export(header_exports, {
  default: () => header_default
});
module.exports = __toCommonJS(header_exports);
var import_react_resizable = require("react-resizable");
var import_styles = require("react-resizable/css/styles.css");
var import_styled_components = __toESM(require("styled-components"));
var import_CellProvider = __toESM(require("./CellProvider"));
var import_react = __toESM(require("react"));
var ResizeCellStyle = (0, import_styled_components.default)(import_react_resizable.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;
	}
`;
var CustomHeaderRow = ({ index, ...props }) => {
  return /* @__PURE__ */ import_react.default.createElement("tr", { ...props });
};
var CustomHeaderCell = (props) => {
  const {
    onResize,
    width,
    field_type,
    lock,
    editable,
    dataIndex,
    position,
    ...restProps
  } = props;
  const isCheckbox = !props.record;
  if (isCheckbox) {
    restProps.style = {
      ...restProps.style
      // paddingInlineStart: 8,
    };
  }
  if (position === "end") {
    return /* @__PURE__ */ import_react.default.createElement("td", { ...restProps }, /* @__PURE__ */ import_react.default.createElement(import_CellProvider.default, { ...props }));
  }
  return /* @__PURE__ */ import_react.default.createElement(
    ResizeCellStyle,
    {
      width: width || 200,
      height: 0,
      onResize,
      draggableOpts: { enableUserSelectHack: false }
    },
    /* @__PURE__ */ import_react.default.createElement("td", { ...restProps }, /* @__PURE__ */ import_react.default.createElement(import_CellProvider.default, { ...props }))
  );
};
var header_default = {
  Row: CustomHeaderRow,
  Cell: CustomHeaderCell
};
