/*!
 * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */
import { MRT_ColumnDef, MRT_Row, MRT_RowSelectionState, MRT_SortingState, MRT_TableInstance, MRT_TableOptions } from "material-react-table";
import { ReactNode } from "react";
import { type MenuButtonProps } from "../Buttons/MenuButton.js";
import { DataTableRowData, DataTableRowSelectionState } from "../index.js";
import { DataFilter } from "../labs/DataFilters.js";
import { paginationTypeValues } from "../Pagination/constants.js";
import { densityValues } from "./constants.js";
import { DataTableRowActionsProps } from "./DataTableRowActions.js";
export type DataTableColumn<T extends DataTableRowData> = MRT_ColumnDef<T> & {
    /**
     * @deprecated use hasTextWrapping instead of enableWrapping
     */
    enableWrapping?: boolean;
    hasTextWrapping?: boolean;
};
export type DataTableGetDataType = {
    filters?: DataFilter[];
    page?: number;
    resultsPerPage?: number;
    search?: string;
    sort?: MRT_SortingState;
};
export type DataTableOnReorderRowsType = {
    newRowIndex: number;
    rowId: string;
};
export type DataTableRenderDetailPanelType = {
    row: MRT_Row<DataTableRowData>;
    table: MRT_TableInstance<DataTableRowData>;
};
export type DataTableProps = {
    /**
     * An optional action button above the table.
     */
    additionalActionButton?: ReactNode;
    /**
     * MenuItems that go in an optional action menu above the table.
     */
    additionalActionMenuItems?: ReactNode;
    /**
     * Menu items to include in the bulk actions menu, which appears above the table if a row or rows are selected
     */
    bulkActionMenuItems?: (selectedRows: MRT_RowSelectionState) => MenuButtonProps["children"];
    /**
     * The columns that make up the table
     */
    columns: DataTableColumn<DataTableRowData>[];
    /**
     * The current page number.
     */
    currentPage?: number;
    /**
     * The component to display when the table is displaying the initial empty state
     */
    emptyPlaceholder?: ReactNode;
    /**
     * If `error` is not undefined, the DataTable will indicate an error.
     */
    errorMessage?: string;
    /**
     * An optional set of filters to render in the filters menu
     */
    filters?: Array<DataFilter | DataTableColumn<DataTableRowData> | string>;
    /**
     * Callback that fires whenever the table needs to fetch new data, due to changes in
     * page, results per page, search input, filters, or sorting
     */
    getData: ({ page, resultsPerPage, search, filters, sort, }: DataTableGetDataType) => MRT_TableOptions<DataTableRowData>["data"] | Promise<MRT_TableOptions<DataTableRowData>["data"]>;
    /**
     * The function to get the ID of a row
     */
    getRowId?: MRT_TableOptions<DataTableRowData>["getRowId"];
    /**
     * If true, the end user will be able to change the table density.
     */
    hasChangeableDensity?: boolean;
    /**
     * If true, the end user can resize individual columns.
     */
    hasColumnResizing?: boolean;
    /**
     * If true, the end user will be able to show/hide columns.
     */
    hasColumnVisibility?: boolean;
    /**
     * If true, the end user will be able to filter columns.
     */
    hasFilters?: boolean;
    /**
     * If true, the table will include pagination controls.
     */
    hasPagination?: boolean;
    /**
     * If true, the end user can reorder rows via a drag-and-drop interface
     */
    hasRowReordering?: boolean;
    /**
     * If true, the table will include checkboxes on each row, enabling
     * the user to select some or all rows.
     */
    hasRowSelection?: boolean;
    /**
     * If true, the global table search controls will be shown.
     */
    hasSearch?: boolean;
    /**
     * If true, the search field will include a Search button, rather than
     * firing on input change.
     */
    hasSearchSubmitButton?: boolean;
    /**
     * If true, the end user can sort columns (ascending, descending, or neither)
     */
    hasSorting?: boolean;
    /**
     * The initial density (height & padding) of the table rows. This is available even if the
     * table density isn't changeable by the end user via hasChangeableDensity.
     */
    initialDensity?: (typeof densityValues)[number];
    /**
     * The initial search value
     */
    initialSearchValue?: string;
    /**
     * Is the next or show-more button disabled
     */
    isPaginationMoreDisabled?: boolean;
    /**
     * The highest page number allowed to be manually input in pagination
     */
    maxPages?: number;
    /**
     * The largest number of rows allowed to be shown per page. This only affects the row input
     * in pagination.
     */
    maxResultsPerPage?: number;
    /**
     * The component to display when the query returns no results
     */
    noResultsPlaceholder?: ReactNode;
    /**
     * Callback that fires when a row (or rows) is selected or unselected.
     */
    onChangeRowSelection?: (rowSelection: DataTableRowSelectionState) => void;
    /**
     * Callback that fires when the user reorders rows within the table. Can be used
     * to propagate order change to the backend.
     */
    onReorderRows?: ({ rowId, newRowIndex }: DataTableOnReorderRowsType) => void;
    /**
     * The type of pagination controls shown. Defaults to next/prev buttons, but can be
     * set to a simple "Load more" button by setting to "loadMore".
     */
    paginationType?: (typeof paginationTypeValues)[number];
    /**
     * The optional component to display when expanding a row.
     */
    renderDetailPanel?: MRT_TableOptions<DataTableRowData>["renderDetailPanel"];
    /**
     * The number of results per page.
     */
    resultsPerPage?: number;
    /**
     * Action buttons to display in each row
     */
    rowActionButtons?: DataTableRowActionsProps["rowActionButtons"];
    /**
     * Menu items to include in the optional actions menu on each row.
     */
    rowActionMenuItems?: DataTableRowActionsProps["rowActionMenuItems"];
    /**
     * The debounce time, in milliseconds, for the search input firing
     * `onChangeSearch` when changed. If `hasSearchSubmitButton` is true,
     * this doesn't do anything.
     */
    searchDelayTime?: number;
    /**
     * Allows for external control of the selected row state
     * use in tandem with onChangeRowSelection to manage your state
     */
    selectedRows?: DataTableRowSelectionState;
    /**
     * The total number of rows in the table. Optional, because it's sometimes impossible
     * to calculate. Used in table pagination to know when to disable the "next"/"more" button.
     */
    totalRows?: number;
};
declare const MemoizedDataTable: import("react").MemoExoticComponent<({ additionalActionButton, additionalActionMenuItems, bulkActionMenuItems, columns, currentPage, emptyPlaceholder, errorMessage: errorMessageProp, filters: filtersProp, getData, getRowId, hasChangeableDensity, hasColumnResizing, hasColumnVisibility, hasFilters, hasPagination, hasRowReordering, hasRowSelection, hasSearch, hasSearchSubmitButton, hasSorting, initialDensity, initialSearchValue, isPaginationMoreDisabled, noResultsPlaceholder, onChangeRowSelection, onReorderRows, paginationType, renderDetailPanel, resultsPerPage, maxResultsPerPage, maxPages, rowActionButtons, rowActionMenuItems, searchDelayTime, selectedRows, totalRows, }: DataTableProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
export { MemoizedDataTable as DataTable };
//# sourceMappingURL=DataTable.d.ts.map