var _excluded = ["children", "layoutType", "rowKey", "data", "dataSources", "gridDataSourceKey", "loading", "total", "pagination", "onPageChange", "searchParams", "onSearch", "onReset", "floorMap", "calendar", "resourceWall", "floorMapLayoutContext", "defaultBodyView", "bodyViewStorageKey", "bodyViewSwitchable", "lockedBodyView", "floorMapLayoutRef", "floorMapFooter", "layoutVariant", "className", "style"];
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import React, { useMemo, useState, useCallback, useEffect } from 'react';
import { getColumnVisibilityFromLocal, getRecordBoardColumnSettingFromLocal, saveColumnVisibilityToLocal } from '@pisell/utils';
import { RecordBoardProvider } from "./context/RecordBoardProvider";
import { getRecordBoardColumnKey } from "./utils/recordBoardColumns";
var defaultPagination = {
  pageNumber: 1,
  pageSize: 20
};
function readBodyViewFromStorage(key, fallback) {
  if (typeof window === 'undefined' || !key) return fallback;
  try {
    var raw = localStorage.getItem(key);
    if (raw === 'grid' || raw === 'floorMap' || raw === 'calendar' || raw === 'resourceWall') return raw;
  } catch (_unused) {
    /* ignore quota / private mode */
  }
  return fallback;
}
function getAccumulationKey(record, rowKey, index) {
  var _ref, _ref2, _record$id;
  if (typeof rowKey === 'function') {
    return rowKey(record);
  }
  if (typeof rowKey === 'string' && record != null && rowKey in record) {
    return record[rowKey];
  }
  return (_ref = (_ref2 = (_record$id = record === null || record === void 0 ? void 0 : record.id) !== null && _record$id !== void 0 ? _record$id : record === null || record === void 0 ? void 0 : record.key) !== null && _ref2 !== void 0 ? _ref2 : record) !== null && _ref !== void 0 ? _ref : index;
}
function mergeAccumulatedRows(previousRows, nextRows, rowKey) {
  if (previousRows.length === 0) return nextRows;
  if (nextRows.length === 0) return previousRows;
  var merged = new Map();
  previousRows.forEach(function (row, index) {
    merged.set(getAccumulationKey(row, rowKey, index), row);
  });
  nextRows.forEach(function (row, index) {
    merged.set(getAccumulationKey(row, rowKey, previousRows.length + index), row);
  });
  return Array.from(merged.values());
}
function isSameRowArray(left, right) {
  if (left === right) return true;
  if (left.length !== right.length) return false;
  return left.every(function (item, index) {
    return item === right[index];
  });
}

/**
 * 从打散 props 合并出 childComponentProps（供 context 使用）。
 */
function mergeChildComponentProps(props) {
  var hasAny = props.grid != null || props.toolBar != null || props.search != null || props.paginationConfig != null || props.batchActionBar != null || props.cardList != null;
  if (!hasAny) return undefined;
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.grid != null && {
    grid: props.grid
  }), props.toolBar != null && {
    toolBar: props.toolBar
  }), props.search != null && {
    search: props.search
  }), props.paginationConfig != null && {
    pagination: props.paginationConfig
  }), props.batchActionBar != null && {
    batchActionBar: props.batchActionBar
  }), props.cardList != null && {
    cardList: props.cardList
  });
}

/**
 * 默认的 context 值（用于无数据源时的占位 / 设计态）
 */
function getDefaultRecordBoardContext(layoutType, selection, rowKey) {
  return {
    data: [],
    loading: false,
    total: 0,
    pagination: defaultPagination,
    onPageChange: function onPageChange() {},
    searchParams: {},
    onSearch: function onSearch() {},
    onReset: function onReset() {},
    layoutType: layoutType,
    selectedKeys: selection.selectedKeys,
    selectedRows: selection.selectedRows,
    onSelectionChange: selection.onSelectionChange,
    rowKey: rowKey,
    childComponentProps: undefined,
    scrollAreaHeight: null,
    setScrollAreaHeight: undefined,
    filterResetKey: undefined,
    setFilterResetKey: undefined,
    bodyView: 'grid',
    setBodyView: function setBodyView() {},
    floorMapProps: undefined,
    floorMapLayoutContext: undefined,
    defaultBodyView: undefined,
    bodyViewSwitchable: true,
    floorMapLayoutRef: undefined,
    floorMapFooter: undefined,
    calendarProps: undefined,
    resourceWallProps: undefined,
    dataSources: undefined,
    gridDataSourceKey: undefined,
    paginationRender: undefined
  };
}

/**
 * RecordBoard 容器：提供统一的 data / pagination / search 上下文。
 * 打散 props：列表/分页/搜索/多选、grid/toolBar/…；可选根级 **floorMap**（兼容透传）。
 * 平面图推荐在 ShellFrame 内使用 **PisellRecordBoard.FloorMap** 声明，与根级 `floorMap` 合并（子优先）。
 */
var PisellRecordBoard = function PisellRecordBoard(props) {
  var _props$columnVisibili, _props$grid;
  var children = props.children,
    _props$layoutType = props.layoutType,
    layoutType = _props$layoutType === void 0 ? 'grid' : _props$layoutType,
    rowKeyProp = props.rowKey,
    dataProp = props.data,
    dataSourcesProp = props.dataSources,
    gridDataSourceKeyProp = props.gridDataSourceKey,
    loadingProp = props.loading,
    totalProp = props.total,
    paginationProp = props.pagination,
    onPageChangeProp = props.onPageChange,
    searchParamsProp = props.searchParams,
    onSearchProp = props.onSearch,
    onResetProp = props.onReset,
    floorMapProp = props.floorMap,
    calendarProp = props.calendar,
    resourceWallProp = props.resourceWall,
    floorMapLayoutContextProp = props.floorMapLayoutContext,
    defaultBodyView = props.defaultBodyView,
    bodyViewStorageKey = props.bodyViewStorageKey,
    _props$bodyViewSwitch = props.bodyViewSwitchable,
    bodyViewSwitchable = _props$bodyViewSwitch === void 0 ? true : _props$bodyViewSwitch,
    lockedBodyViewProp = props.lockedBodyView,
    floorMapLayoutRef = props.floorMapLayoutRef,
    floorMapFooter = props.floorMapFooter,
    _props$layoutVariant = props.layoutVariant,
    layoutVariant = _props$layoutVariant === void 0 ? 'default' : _props$layoutVariant,
    classNameProp = props.className,
    styleProp = props.style,
    rest = _objectWithoutProperties(props, _excluded);
  var effectiveLockedBodyView = bodyViewSwitchable === false ? lockedBodyViewProp !== null && lockedBodyViewProp !== void 0 ? lockedBodyViewProp : 'floorMap' : undefined;

  /** 默认占满父容器高度（父容器需有高度，如 height:100vh 或 height:100%） */
  var fillHeight = true;

  /** 列显隐持久化 key：优先 columnVisibilityStorageKey，其次 __id（与 DataSourceContainer 一致，复用 @pisell/utils 的 key 规则） */
  var columnVisibilityStorageKey = (_props$columnVisibili = props.columnVisibilityStorageKey) !== null && _props$columnVisibili !== void 0 ? _props$columnVisibili : props.__id;
  var mergedChildComponentProps = useMemo(function () {
    return mergeChildComponentProps(props);
  }, [props.grid, props.toolBar, props.search, props.paginationConfig, props.batchActionBar, props.cardList]);
  var _useState = useState([]),
    _useState2 = _slicedToArray(_useState, 2),
    internalSelectedKeys = _useState2[0],
    setInternalSelectedKeys = _useState2[1];
  var _useState3 = useState([]),
    _useState4 = _slicedToArray(_useState3, 2),
    internalSelectedRows = _useState4[0],
    setInternalSelectedRows = _useState4[1];
  var _useState5 = useState(null),
    _useState6 = _slicedToArray(_useState5, 2),
    scrollAreaHeight = _useState6[0],
    setScrollAreaHeight = _useState6[1];
  /** 点击重置时递增，供 ToolBar 给 PisellFilter 设 key 以强制重挂载，清空弹窗内高级筛选表单 */
  var _useState7 = useState(0),
    _useState8 = _slicedToArray(_useState7, 2),
    filterResetKey = _useState8[0],
    setFilterResetKey = _useState8[1];
  var _useState9 = useState([]),
    _useState10 = _slicedToArray(_useState9, 2),
    accumulatedDataRows = _useState10[0],
    setAccumulatedDataRows = _useState10[1];
  var _useState11 = useState(function () {
      if (effectiveLockedBodyView != null) {
        return effectiveLockedBodyView;
      }
      var fallback = defaultBodyView === 'floorMap' ? 'floorMap' : defaultBodyView === 'calendar' ? 'calendar' : defaultBodyView === 'resourceWall' ? 'resourceWall' : 'grid';
      return readBodyViewFromStorage(bodyViewStorageKey, fallback);
    }),
    _useState12 = _slicedToArray(_useState11, 2),
    bodyView = _useState12[0],
    setBodyViewState = _useState12[1];
  var setBodyView = useCallback(function (v) {
    if (bodyViewSwitchable === false && effectiveLockedBodyView != null && v !== effectiveLockedBodyView) {
      return;
    }
    setBodyViewState(v);
    if (typeof window !== 'undefined' && bodyViewStorageKey) {
      try {
        localStorage.setItem(bodyViewStorageKey, v);
      } catch (_unused2) {
        /* ignore */
      }
    }
  }, [bodyViewStorageKey, bodyViewSwitchable, effectiveLockedBodyView]);
  useEffect(function () {
    if (bodyViewSwitchable === false && effectiveLockedBodyView != null && bodyView !== effectiveLockedBodyView) {
      setBodyViewState(effectiveLockedBodyView);
    }
  }, [bodyViewSwitchable, effectiveLockedBodyView, bodyView]);
  var paginationForAccumulation = paginationProp !== undefined ? paginationProp : defaultPagination;
  var gridInfiniteScrollEnabled = ((_props$grid = props.grid) === null || _props$grid === void 0 ? void 0 : _props$grid.infiniteScroll) !== false;
  var dataRowsForInfiniteScroll = useMemo(function () {
    if (dataProp === undefined || !gridInfiniteScrollEnabled) {
      return dataProp;
    }
    if (paginationForAccumulation.pageNumber <= 1) {
      return dataProp;
    }
    return mergeAccumulatedRows(accumulatedDataRows, dataProp, rowKeyProp);
  }, [dataProp, gridInfiniteScrollEnabled, paginationForAccumulation.pageNumber, accumulatedDataRows, rowKeyProp]);
  useEffect(function () {
    if (dataProp === undefined || !gridInfiniteScrollEnabled) {
      setAccumulatedDataRows([]);
      return;
    }
    var nextRows = dataRowsForInfiniteScroll !== null && dataRowsForInfiniteScroll !== void 0 ? dataRowsForInfiniteScroll : [];
    setAccumulatedDataRows(function (prev) {
      return isSameRowArray(prev, nextRows) ? prev : nextRows;
    });
  }, [dataProp, dataRowsForInfiniteScroll, gridInfiniteScrollEnabled]);
  var _useState13 = useState(function () {
      var _props$grid$defaultHi, _props$grid2, _props$grid$columns, _props$grid3;
      var fromConfig = (_props$grid$defaultHi = (_props$grid2 = props.grid) === null || _props$grid2 === void 0 ? void 0 : _props$grid2.defaultHiddenColumnKeys) !== null && _props$grid$defaultHi !== void 0 ? _props$grid$defaultHi : [];
      var fromColumns = ((_props$grid$columns = (_props$grid3 = props.grid) === null || _props$grid3 === void 0 ? void 0 : _props$grid3.columns) !== null && _props$grid$columns !== void 0 ? _props$grid$columns : []).filter(function (col) {
        return col.hidden === true;
      }).map(function (col) {
        return getRecordBoardColumnKey(col);
      }).filter(Boolean);
      var allHiddenKeys = Array.from(new Set([].concat(_toConsumableArray(fromConfig), _toConsumableArray(fromColumns))));
      var defaultVis = {};
      allHiddenKeys.forEach(function (k) {
        defaultVis[k] = false;
      });
      if (typeof columnVisibilityStorageKey === 'string' && columnVisibilityStorageKey) {
        if (typeof getRecordBoardColumnSettingFromLocal === 'function') {
          var saved = getRecordBoardColumnSettingFromLocal(columnVisibilityStorageKey);
          if (saved !== null && saved !== void 0 && saved.columnVisibility && Object.keys(saved.columnVisibility).length > 0) {
            return _objectSpread(_objectSpread({}, defaultVis), saved.columnVisibility);
          }
        } else if (typeof getColumnVisibilityFromLocal === 'function') {
          var savedVis = getColumnVisibilityFromLocal(columnVisibilityStorageKey);
          if (savedVis && Object.keys(savedVis).length > 0) {
            return _objectSpread(_objectSpread({}, defaultVis), savedVis);
          }
        }
      }
      return defaultVis;
    }),
    _useState14 = _slicedToArray(_useState13, 2),
    internalColumnVisibility = _useState14[0],
    setInternalColumnVisibility = _useState14[1];
  var _useState15 = useState(function () {
      if (typeof columnVisibilityStorageKey === 'string' && columnVisibilityStorageKey && typeof getRecordBoardColumnSettingFromLocal === 'function') {
        var _saved$columnOrder;
        var saved = getRecordBoardColumnSettingFromLocal(columnVisibilityStorageKey);
        return (_saved$columnOrder = saved === null || saved === void 0 ? void 0 : saved.columnOrder) !== null && _saved$columnOrder !== void 0 ? _saved$columnOrder : null;
      }
      return null;
    }),
    _useState16 = _slicedToArray(_useState15, 2),
    internalColumnOrder = _useState16[0],
    setInternalColumnOrder = _useState16[1];
  useEffect(function () {
    if (typeof columnVisibilityStorageKey !== 'string' || !columnVisibilityStorageKey) return;
    saveColumnVisibilityToLocal({
      componentId: columnVisibilityStorageKey,
      columnVisibility: internalColumnVisibility,
      columnOrder: internalColumnOrder !== null && internalColumnOrder !== void 0 ? internalColumnOrder : undefined
    });
  }, [columnVisibilityStorageKey, internalColumnVisibility, internalColumnOrder]);
  var onSelectionChangeInternal = useCallback(function (keys, rows) {
    setInternalSelectedKeys(keys);
    setInternalSelectedRows(rows);
  }, []);
  var onColumnVisibilityChangeInternal = useCallback(function (visibility) {
    setInternalColumnVisibility(function (prev) {
      return _objectSpread(_objectSpread({}, prev), visibility);
    });
  }, []);
  var onColumnOrderChangeInternal = useCallback(function (columnKeys) {
    setInternalColumnOrder(columnKeys);
  }, []);
  var contextValue = useMemo(function () {
    var _gridSelection$select;
    var defaultCtx = getDefaultRecordBoardContext(layoutType, {
      selectedKeys: internalSelectedKeys,
      selectedRows: internalSelectedRows,
      onSelectionChange: onSelectionChangeInternal
    }, rowKeyProp);

    /** 分页状态（推导表格切片前需要） */
    var pagination = paginationProp !== undefined ? paginationProp : defaultCtx.pagination;
    var gridInfiniteScroll = gridInfiniteScrollEnabled;

    /**
     * 表格数据：
     * - 显式传入 `data` 时始终用 `data`（如服务端分页当前页）；
     * - 否则若存在 `dataSources` + `gridDataSourceKey`，从对应数组做客户端分页切片。
     * - `infiniteScroll` 时对该路径做**累积**切片：slice(0, pageNumber * pageSize)，与触底加载多页一致。
     */
    var data;
    var total;
    if (dataProp !== undefined) {
      data = dataRowsForInfiniteScroll !== null && dataRowsForInfiniteScroll !== void 0 ? dataRowsForInfiniteScroll : dataProp;
      total = totalProp !== undefined ? totalProp : defaultCtx.total;
    } else if (dataSourcesProp != null && gridDataSourceKeyProp != null && gridDataSourceKeyProp !== '') {
      var _dataSourcesProp$grid;
      var raw = (_dataSourcesProp$grid = dataSourcesProp[gridDataSourceKeyProp]) !== null && _dataSourcesProp$grid !== void 0 ? _dataSourcesProp$grid : [];
      total = totalProp !== undefined ? totalProp : raw.length;
      var pageNumber = pagination.pageNumber,
        pageSize = pagination.pageSize;
      var safeSize = Math.max(1, pageSize);
      if (gridInfiniteScroll) {
        var end = Math.min(raw.length, pageNumber * safeSize);
        data = raw.slice(0, end);
      } else {
        var start = Math.max(0, (pageNumber - 1) * safeSize);
        data = raw.slice(start, start + safeSize);
      }
    } else {
      data = defaultCtx.data;
      total = totalProp !== undefined ? totalProp : defaultCtx.total;
    }
    var loading = loadingProp !== undefined ? loadingProp : defaultCtx.loading;
    var onPageChange = onPageChangeProp !== null && onPageChangeProp !== void 0 ? onPageChangeProp : defaultCtx.onPageChange;
    var searchParams = searchParamsProp !== undefined ? searchParamsProp : defaultCtx.searchParams;
    var onSearch = onSearchProp !== null && onSearchProp !== void 0 ? onSearchProp : defaultCtx.onSearch;
    var onReset = onResetProp !== null && onResetProp !== void 0 ? onResetProp : defaultCtx.onReset;
    var rowKey = rowKeyProp !== null && rowKeyProp !== void 0 ? rowKeyProp : defaultCtx.rowKey;
    var gridSelection = props.grid;
    var hasControlledSelection = (gridSelection === null || gridSelection === void 0 ? void 0 : gridSelection.selectedKeys) != null && Array.isArray(gridSelection.selectedKeys) && typeof gridSelection.onSelectionChange === 'function';
    var selectedKeys = hasControlledSelection ? gridSelection.selectedKeys : internalSelectedKeys;
    var selectedRows = hasControlledSelection ? (_gridSelection$select = gridSelection.selectedRows) !== null && _gridSelection$select !== void 0 ? _gridSelection$select : [] : internalSelectedRows;
    var onSelectionChange = hasControlledSelection ? gridSelection.onSelectionChange : onSelectionChangeInternal;
    return _objectSpread(_objectSpread({}, defaultCtx), {}, {
      layoutType: layoutType,
      layoutVariant: layoutVariant,
      rowKey: rowKey,
      dataSources: dataSourcesProp,
      gridDataSourceKey: gridDataSourceKeyProp,
      data: data,
      loading: loading,
      total: total,
      pagination: pagination,
      onPageChange: onPageChange,
      searchParams: searchParams,
      onSearch: onSearch,
      onReset: onReset,
      selectedKeys: selectedKeys,
      selectedRows: selectedRows,
      onSelectionChange: onSelectionChange,
      columnVisibility: internalColumnVisibility,
      onColumnVisibilityChange: onColumnVisibilityChangeInternal,
      columnOrder: internalColumnOrder,
      onColumnOrderChange: onColumnOrderChangeInternal,
      childComponentProps: mergedChildComponentProps !== null && mergedChildComponentProps !== void 0 ? mergedChildComponentProps : defaultCtx.childComponentProps,
      fillHeight: fillHeight,
      scrollAreaHeight: scrollAreaHeight,
      setScrollAreaHeight: setScrollAreaHeight,
      filterResetKey: filterResetKey,
      setFilterResetKey: setFilterResetKey,
      bodyView: bodyView,
      setBodyView: setBodyView,
      floorMapProps: floorMapProp,
      floorMapLayoutContext: floorMapLayoutContextProp,
      defaultBodyView: defaultBodyView,
      bodyViewSwitchable: bodyViewSwitchable,
      floorMapLayoutRef: floorMapLayoutRef,
      floorMapFooter: floorMapFooter,
      calendarProps: calendarProp,
      resourceWallProps: resourceWallProp,
      /**
       * 业务方传入的自定义分页渲染：注入 ctx 后，shellFrame 内置的
       * `<RecordBoardPagination />` 会优先使用它（详见 RecordBoardPagination 实现）。
       */
      paginationRender: props.paginationRender,
      gridInfiniteScroll: gridInfiniteScroll
    });
  }, [layoutType, layoutVariant, rowKeyProp, dataProp, dataSourcesProp, gridDataSourceKeyProp, loadingProp, totalProp, paginationProp, onPageChangeProp, searchParamsProp, onSearchProp, onResetProp, mergedChildComponentProps, internalSelectedKeys, internalSelectedRows, onSelectionChangeInternal, internalColumnVisibility, onColumnVisibilityChangeInternal, internalColumnOrder, onColumnOrderChangeInternal, fillHeight, scrollAreaHeight, filterResetKey, floorMapProp, floorMapLayoutContextProp, defaultBodyView, bodyViewSwitchable, floorMapLayoutRef, floorMapFooter, calendarProp, resourceWallProp, bodyView, setBodyView, props.paginationRender, gridInfiniteScrollEnabled, dataRowsForInfiniteScroll]);
  var content = /*#__PURE__*/React.createElement(RecordBoardProvider, {
    value: contextValue
  }, children);
  return /*#__PURE__*/React.createElement("div", {
    className: classNameProp ? "pisell-record-board-root ".concat(classNameProp) : 'pisell-record-board-root',
    style: _objectSpread({
      height: '100%',
      display: 'flex',
      flexDirection: 'column',
      minHeight: 0
    }, styleProp)
  }, content);
};
export default PisellRecordBoard;