/* @oracle/oraclejet-preact: undefined */
import { jsx } from 'preact/jsx-runtime';
import { forwardRef } from 'preact/compat';
import { tableViewStyles } from './UNSAFE_TableView/themes/TableViewStyles.css.js';
import './CollectionInteractionContext-7cf19abc.js';
import { u as useCollectionInteractionContext } from './useCollectionInteractionContext-3895c632.js';
import { c as classNames } from './classNames-4e12b00d.js';
import { d as dimensionInterpolations } from './dimensions-d4159ace.js';
import { m as mergeInterpolations } from './mergeInterpolations-e2db2a66.js';
import { T as Table } from './Table-b8c41429.js';

const mergedInterpolations = mergeInterpolations([
    ...Object.values(dimensionInterpolations)
]);
/**
 * Component that renders data in rows of columns.
 * This component is non-virtualized and renders all rows provided in the data prop.
 */
const TableView = forwardRef(({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, getAccessibleRowHeaders, children, columns, columnOrder, columnWidths, contextMenuConfig, viewportConfig, layout = 'contents', data, getRowKey, hasMore = false, onLoadMore, currentCellOverride, onPersistCurrentCell, currentRowVariant, gridlines = { horizontal: 'visible', vertical: 'hidden' }, selectionMode = { row: 'none', column: 'none' }, selected, onSelectionChange, onRowAction, sortCriterion = [], onSortCriterionChange, horizontalScrollPositionOverride, verticalScrollPositionOverride, columnResizingIndicator, onColumnResizing, onColumnResize, noDataRenderer, testId, ...dimensions }, ref) => {
    const isEmbedded = useCollectionInteractionContext() === 'embedded';
    const rowVariant = currentRowVariant != null ? currentRowVariant : isEmbedded ? 'highlight' : 'none';
    const { ...mergedStyles } = mergedInterpolations(dimensions);
    const isExternalScroller = viewportConfig?.scroller() != null;
    const classArray = [tableViewStyles.base];
    classArray.push(isExternalScroller ? tableViewStyles.externalScroller : tableViewStyles.internalScroller);
    const tableViewClasses = classNames(classArray);
    return (jsx("div", { class: tableViewClasses, style: mergedStyles, children: jsx(Table, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, getAccessibleRowHeaders: getAccessibleRowHeaders, children: children, columns: columns, columnOrder: columnOrder, columnWidths: columnWidths, contextMenuConfig: contextMenuConfig, viewportConfig: viewportConfig, layout: layout, data: data, getRowKey: getRowKey, hasMore: hasMore, onLoadMore: onLoadMore, currentCellOverride: currentCellOverride, onPersistCurrentCell: onPersistCurrentCell, currentRowVariant: rowVariant, gridlines: gridlines, selectionMode: selectionMode, selected: selected, onSelectionChange: onSelectionChange, onRowAction: onRowAction, horizontalScrollPositionOverride: horizontalScrollPositionOverride, verticalScrollPositionOverride: verticalScrollPositionOverride, sortCriterion: sortCriterion, onSortCriterionChange: onSortCriterionChange, columnResizingIndicator: columnResizingIndicator, onColumnResizing: onColumnResizing, onColumnResize: onColumnResize, noDataRenderer: noDataRenderer, testId: testId, ref: ref }) }));
});

export { TableView as T };
//# sourceMappingURL=TableView-2261b9de.js.map
