import { CardProps, InfoIconProps } from '@wix/design-system'; import { CSSProperties, JSXElementConstructor, ReactElement, ReactNode } from 'react'; import { AddNewButtonProps, CollectionToolbarProps, PrimaryActionButtonProps } from '../CollectionToolbar'; import { ComputedQuery, FiltersMap } from '@wix/bex-core'; import { CollectionSearchProps } from '../CollectionSearch'; import { CollectionToolbarFiltersProps, FilterElement } from '../CollectionToolbarFilters'; import { TableTopNotificationProps } from '../TableTopNotification'; import { TabsFilterProps } from '../TabsFilter'; import { ToolbarCollectionState } from '../../state'; import { CollectionViewsDropdownElement, CustomColumnsElement, ReorderModeToolbarElement } from '../assertComponentType'; import { DragAndDropBulkSubmit, DragAndDropCancel, DragAndDropSubmit } from '../DragAndDrop'; import { TableGridSwitchButtonProps } from '../TableGridSwitchButton'; import type { FiltersPanelApplyButtonBehavior } from '../FiltersPanel/FiltersPanelApplyButtonBehavior'; import type { TagsElement } from '../Tags'; import type { ExtensionMenuItemsType } from '../ExtensionMenuItems'; import { ToolbarTitleProps } from '../ToolbarTitle'; export interface ToolbarBaseProps { /** * Display a title at the left of the table toolbar. * @external */ title?: ReactNode | ReactElement; /** * Display a subtitle at the left of the table toolbar under the title. * * `text`: The subtitle text * * `info`: [InfoIconProps](https://www.docs.wixdesignsystem.com/?path=/story/components-form--infoicon) to display an info icon next to the subtitle text * * `learnMore`: an object with a `url`(required) and a `label`(optional), for displaying a link button on the subtitle * @deprecated Use title with ToolbarTitle component instead. */ subtitle?: { text: string; info?: InfoIconProps; learnMore?: { url: string; label?: string; }; }; /** * Indicates whether to show a total counter next to the table title. Please make sure to hide the counter in the page title (see hideTotal in [CollectionPage](/pages/cairo/?path=/story/components-page--collectionpage)) * @deprecated Use title with ToolbarTitle component instead. */ showTotal?: boolean; /** * Display a search input on the right of the table toolbar.
* Accepts boolean or a custom `ReactElement`. When passing `false` no search input will be displayed. * @default true * @external */ search?: boolean | FilterElement; /** * Indicates whether to show Table Title Bar or not. * Note: if you pass `titleBarDisplay = false` title bar is not removed from the DOM. For better accessibility column titles should be defined as well. * @default true * @external */ titleBarDisplay?: boolean; /** * A [``](/pages/cairo/?path=/story/components-collection-features--exportto) react element to be added to the toolbar */ exportButton?: ReactElement; /** * Enables tags feature. In this element you can pass the configuration */ tags?: TagsElement; /** * A [``](/pages/cairo/?path=/story/components-collection-features--exportto#CTA_is_out_of_the_table) react element to be rendered in table's context */ exportModal?: ReactElement; } export interface ToolbarCollectionBaseProps extends ToolbarBaseProps { children?: ReactNode | ReactNode[]; /** * Add views dropdown to the table headers.
* Must be a [Views](/pages/cairo/?path=/story/components-collection-features--views) component. * @external */ views?: CollectionViewsDropdownElement; /** * Add filters to the table's toolbar and/or to a sliding panel.
* Must be a [CollectionToolbarFilters](/pages/cairo/?path=/story/components-collection-features--toolbar-filters) component.
* `panelTitle` prop must be passed to `` * @external */ filters?: ReactElement>; /** * Display tabs at the left of the table toolbar. * @external */ tabs?: ReactElement>; selectionToolbar?: ReactElement; onSearchChange?: CollectionSearchProps['onSearchChange']; onSearchClick?: CollectionSearchProps['onSearchClick']; onSearchBlur?: CollectionSearchProps['onSearchBlur']; /** * The maximum length of the search input * @external */ searchMaxLength?: CollectionSearchProps['maxLength']; sticky?: boolean; /** * Minimum height for the container when showing the loader / empty state / error state * @default 300px * @external */ minCardHeight?: CSSProperties['minHeight']; /** * A render function to be rendered when there's an error fetching data from the server.
* The function accepts the following parameters * * `err`: The error thrown by the [fetchData](/pages/cairo/?path=/story/common-hooks--usecollection) function * * `isOnline`: Indicates whether internet connection is available * * `retry`: Retry collection fetch on failed response, similar to `collection.retryFetch` * @external */ renderError?: (params: { err: unknown; isOnline: boolean; retry: () => void; }) => ReactElement; /** * A render function to be rendered when there're no items to show in the table.
* You can use [``](/pages/cairo/?path=/story/components-collection-features--empty-state)
* The function accepts the following parameters * * `hasAvailableItems`: Indicates whether other items might have been shown using other filtering / search * * `query`: An instance of [ComputedQuery](/pages/cairo/?path=/story/common-models--computedquery) that represents the query that resulted with an empty state * @external */ renderEmptyState?: (params: { hasAvailableItems: boolean; query: ComputedQuery; }) => ReactElement; cardProps?: Partial; onSelectedItems?: (isSelectAll: boolean, items: T[]) => unknown; /** * Renders a [``](/pages/cairo/?path=/story/components-collection-features--table-top-notification) below the table header * @external */ topNotification?: ReactElement | ((params: { query: ComputedQuery; }) => ReactElement | boolean | null | undefined) | boolean | null | undefined; extraToolbar?: ReactNode; /** * Display summary bar below the toolbar. * @external */ summaryBar?: ReactNode; tableGridSwitchButton?: ReactElement; /** * A function that submits a drop event to the server. The function accepts the following arguments:
* - `from: {item: T; index: number}` - Item that was dragged * - `after: null | {item: T; index: number}` - Item that the dragged item was dropped after. If dropped at the head of the collection, this argument will be `null` * - `filters` - Currently applied filters, for cases your server holds a unique ordering per filtering (see `dragAndDropCategories` prop) * * @returns Promise * @external */ dragAndDropSubmit?: DragAndDropSubmit; /** * A function that submits a drop event to the server. The function accepts the array of following objects:
* - `from: {item: T; index: number}` - Item that was dragged * - `after: null | {item: T; index: number}` - Item that the dragged item was dropped after. If dropped at the head of the collection, this argument will be `null` * - `filters` - Currently applied filters, for cases your server holds a unique ordering per filtering (see `dragAndDropCategories` prop) * * @returns Promise * @external */ dragAndDropBulkSubmit?: DragAndDropBulkSubmit; /** * A function that cancels a drop event. The function accepts the following arguments:
* - `from: {item: T; index: number}` - Item that was dragged * - `after: null | {item: T; index: number}` - Item that the dragged item was dropped after. If dropped at the head of the collection, this argument will be `null` * - `filters` - Currently applied filters, for cases your server holds a unique ordering per filtering (see `dragAndDropCategories` prop) * * If the move should be cancelled, the function should return a toast config object with a message explaining why the move was cancelled. Otherwise, the function should return nullish value. * @external */ dragAndDropCancel?: DragAndDropCancel; /** * List of filter names combinations that your server holds a unique ordering for. If this prop is not passed, drag and drop will be enabled only when no filters are applied.
* If you pass this prop, you should explicitly pass `[]` as one of the combinations in order to enable drag and drop when no filters are applied, for example: `dragAndDropCategories={[[], ['status']]}` * @external */ dragAndDropCategories?: (keyof F)[][] | null; /** * Extension Menu Items implementation: `import { ExtensionMenuItems } from '@wix/cairo';` * @external */ extensionMenuItems?: ExtensionMenuItemsType; /** * Drag and drop reorder mode toolbar. Must be a ReorderModeToolbar component. * Accepts the following props: * - `learnMoreUrl` * - `reorderModeTitle` * @external */ dragAndDropReorderModeToolbar?: ReorderModeToolbarElement | null; /** * A [``](/pages/cairo/?path=/story/components-collection-features--custom-columns) react element to be added at the top right of the table. * @external */ customColumns?: CustomColumnsElement | null; /** * Multi level sorting. * Enables sorting on multiple columns simultaneously. * @external */ multiLevelSorting?: CollectionToolbarProps['multiLevelSorting']; /** * @deprecated Use primaryActionButton instead. * Add New button in the toolbar. * Must be a AddNewButton component. */ addNewButton?: ReactElement; /** * Primary action button in the toolbar. * Must be a PrimaryActionButton component. * @external */ primaryActionButton?: ReactElement; /** * Add `Apply` button to the filters panel footer. Panel filters will be applied only after the button is clicked. * @external */ FiltersPanelApplyButtonBehavior?: typeof FiltersPanelApplyButtonBehavior; /** * Limit the amount of rows to user can select * @external */ maxSelection?: number; /** * Indicates whether the table should have an internal scroll (instead of the default page scroll) */ internalScroll?: boolean; } export interface ToolbarCollectionProps extends ToolbarCollectionBaseProps { state: ToolbarCollectionState; } export declare function ToolbarCollection(props: ToolbarCollectionProps): JSX.Element; //# sourceMappingURL=ToolbarCollection.d.ts.map