import React, { ReactElement } from 'react'; import { FiltersMap, KeyedItem } from '@wix/bex-core'; import { TableColumn } from '../../model'; import { TableState } from '../../state'; import type { TableDragAndDropType } from '../TableDragAndDrop'; import { CollectionTableWSRTableBaseProps } from './CollectionTableWSRTable'; import { BulkActionModalRenderProp, BulkActionToolbarRenderProp } from '../BulkAction'; import { CollectionTableActionCellProps } from './CollectionTableBaseCommonProps'; import { type DataExtensionElement, type DataExtensionType } from '../DataExtension'; import type { FieldsSourceProvider } from '../fieldsSourceProvider'; import type { TagsElement } from '../Tags'; export interface CollectionTableBaseProps extends Omit, 'resizable'>, CollectionTableActionCellProps { /** * Defines the columns of the table. Accepts an array of [`TableColumn`](./?path=/story/common-types--tablecolumn) objects. * @overrideType [TableColumn](./?path=/story/common-types--tablecolumn)[] * @external */ columns: TableColumn[]; /** * Whether to show a checkbox column for selecting items. * @default false * @external */ showSelection?: boolean; /** * A callback method to be called on row click. Signature: `onRowClick(rowData, rowNum)`. To enable hover effect you should set this prop. * @external */ onRowClick?: (item: T, index: number) => void; /** * A [``](./?path=/story/features-export--exportto) react element to be added to the toolbar. */ exportButton?: ReactElement; /** * Adds functionality to allow visitors to reorder items manually. * For more information, see the [Drag and Drop Overview](./?path=/story/features-sort-drag-and-drop--overview). * @overrideType [TableDragAndDrop](./?path=/story/features-sort-drag-and-drop--tabledraganddrop) * @external */ dragAndDrop?: TableDragAndDropType; /** * Data extension implementation: `import { DataExtension } from '@wix/patterns';` */ dataExtension?: DataExtensionType | DataExtensionElement; /** * Attaches a field source to the table — the way to add a source's fields, * filters, and field management. Build it with `tableSchemaSource(...)` for a * schema source (also spread its `collectionConfig` into the collection hook), * or `dataExtensionTableSource(...)` for DataExtension, which extends the * consumer's own collection. */ /** A fields source (e.g. `dataExtensionTableSource(...)`) whose fields become * columns and whose field management wires into the table. Schema sources * attach via the `@wix/patterns/schema` collection hooks instead. */ fieldsSource?: FieldsSourceProvider; tags?: TagsElement; forceResize?: boolean; /** * A function that receives the item of the row and returns a string for tooltip content. * @external */ checkboxTooltipContent?: (rowData: KeyedItem) => string | undefined; /** * Render a custom toolbar when more than 1 item is selected.
* The function accepts the following parameters * * `selectedValues`: The items that were checked via the selection column * * `uncheckedValues`: The items that were unchecked via the selection column * * `allSelected`: Indicates whether the "Select All" checkbox is checked * * `openModal`: Opens the modal that contains the component from `bulkActionModal` render prop * * `clearSelection`: Clears all existing selection, call this after the action on the selected items was done * * `total`: Total items in the server (taken from [`fetchData`](./?path=/story/common-hooks--usecollection) return value). * * `openConfirmModal`: Opens a `` to confirm an action about to be applied on the selected items. * * `query`: ComputedQuery - Representation of the current paging, sorting & filtering applied. Usually for using together with bulk action such as `updateAll` and `deleteAll` * * > When passed, enables `showSelection` by default. * @external */ bulkActionToolbar?: BulkActionToolbarRenderProp; /** * When true, wraps every column header with the AddField hover popover. * The "+" button is revealed when the consumer hovers a column header and * triggers either the schema's `addField` or the data-extension's custom * fields modal. Off by default. * @external */ showAddFieldButton?: boolean; /** * Opens a modal from the [`MultiBulkActionToolbar`](./?path=/story/features-actions-bulk-actions--multibulkactiontoolbar). * Supported parameters: * + `selectedValues`: Selected item values. * + `uncheckedValues`: Unselected item values. * + `isSelectAll`: [bool] Whether the **Select All** option is selected. * + `closeModal`: Closes the modal. * + `query`: [object] Instance of [ComputedQuery](./?path=/story/common-types--computedquery) that represents the query that resulted in an empty state. Representation of the current paging, sorting and filtering applied. Usually for using together with bulk action such as `updateAll` and `deleteAll`. * @external */ bulkActionModal?: BulkActionModalRenderProp; } export interface CollectionTableProps extends CollectionTableBaseProps { state: TableState; keyedItems?: KeyedItem[]; isUsingExpandCollapse?: boolean; } declare function _CollectionTable(props: CollectionTableProps): React.JSX.Element; export declare const CollectionTable: typeof _CollectionTable & { displayName: string; }; export {}; //# sourceMappingURL=CollectionTable.d.ts.map