var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/table/hooks/useGenScroll.ts
var useGenScroll_exports = {};
__export(useGenScroll_exports, {
  default: () => useGenScroll_default
});
module.exports = __toCommonJS(useGenScroll_exports);
var import_react = require("react");
var useGenScroll = (params) => {
  const { wrapHeight, scroll: propsScroll, columns, isShowPagination } = params;
  const scroll = (0, import_react.useMemo)(() => {
    if (propsScroll == null ? void 0 : propsScroll.autoCalc) {
      return {
        x: (propsScroll == null ? void 0 : propsScroll.x) || columns.reduce((p, c) => {
          return p + (c.width || 250);
        }, 0) || 2e3,
        y: (propsScroll == null ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - (isShowPagination ? 50 + 24 : 24), 100),
        scrollToFirstRowOnChange: propsScroll == null ? void 0 : propsScroll.scrollToFirstRowOnChange
      };
    }
    return propsScroll;
  }, [propsScroll, wrapHeight, columns, isShowPagination]);
  return scroll;
};
var useGenScroll_default = useGenScroll;
