'use strict';

require('../../../../utils/index.cjs');
var log = require('../../../../utils/log.cjs');

const INTERNAL_COL_DEFINE = "RC_TABLE_INTERNAL_COL_DEFINE";
function getExpandableProps(props) {
  const { expandable, ...legacyExpandableConfig } = props;
  let config;
  if (props.expandable !== void 0) {
    config = {
      ...legacyExpandableConfig,
      ...expandable
    };
  } else {
    if (process.env.NODE_ENV !== "production" && [
      "indentSize",
      "expandedRowKeys",
      "defaultExpandedRowKeys",
      "defaultExpandAllRows",
      "expandedRowRender",
      "expandRowByClick",
      "expandIcon",
      "onExpand",
      "onExpandedRowsChange",
      "expandedRowClassName",
      "expandIconColumnIndex",
      "showExpandColumn"
    ].some((prop) => prop in props))
      log.warning(false, "expanded related props have been moved into `expandable`.");
    config = legacyExpandableConfig;
  }
  if (config.showExpandColumn === false)
    config.expandIconColumnIndex = -1;
  return config;
}
function getDataAndAriaProps(props) {
  return Object.keys(props).reduce((memo, key) => {
    if (key.startsWith("data-") || key.startsWith("aria-"))
      memo[key] = props[key];
    return memo;
  }, {});
}

exports.INTERNAL_COL_DEFINE = INTERNAL_COL_DEFINE;
exports.getDataAndAriaProps = getDataAndAriaProps;
exports.getExpandableProps = getExpandableProps;
//# sourceMappingURL=legacyUtil.cjs.map
