# ObjectSearchComponentProps

Props for the ObjectSearchComponent.

## Definition

```tsx
interface ObjectSearchComponentProps {
    /**
     * Header text or component for the search component.
     */
    title?: string | ReactNode;

    /**
     * Configuration for the filter panel.
     */
    filters?: FilterConfig;

    /**
     * Configuration for custom and default views.
     */
    views?: ViewsConfig;

    /**
     * Data source for the table, either a static array or a function for dynamic fetching with pagination and search.
     */
    data: RowData[] | ((page: number, pageSize: number, query?: string, filters?: Filters, sort?: Sort) => Promise<{ items: RowData[] }>);

    /**
     * Column definitions for the table.
     */
    columns: OSCColumn[];

    /**
     * Configuration for predefined action columns like Edit, Delete, and Select.
     */
    defaultActionColumns?: DefaultActionColumnsConfig;

    /**
     * Number of items to display per page.
     */
    pageSize: number;

    /**
     * Total number of items, or a function to fetch this count dynamically.
     */
    total: number | ((query?: string, filters?: Filters) => Promise<number>);

    /**
     * Indicates if data is loading, showing a loading spinner if true.
     */
    loading?: boolean;

    /**
     * Message or component to display when no items are found.
     */
    noItemsMessage?: string | ReactNode;

    /**
     * Minimum width for all cells in pixels.
     */
    minCellWidth?: number;

    /**
     * Callback triggered when a row is clicked. Overrides details panel if defined.
     */
    onClickRow?: (e: MouseEvent<HTMLDivElement>, item: any) => void;

    /**
     * Configuration for the expandable details panel. Ignored if onClickRow is defined.
     */
    detailsPanel?: DefaultDetailsPanelProps | CustomDetailsPanelProps;

    /**
     * Field in row data used as a unique identifier for each row.
     */
    idField: string;

    /**
     * Custom action buttons or components for the header area.
     */
    actionButtons?: ReactNode;

    /**
     * Custom action buttons for bulk actions when rows are selected.
     */
    bulkActionButtons?: ReactNode;

    /**
     * Array of currently selected row data objects.
     */
    selected?: RowData[];

    /**
     * Callback triggered when row selection changes.
     */
    onSelect?: (selected: RowData[]) => void;

    /**
     * Custom renderer for nested child rows.
     */
    renderChildren?: (childRows: RowData[], rowProps: TableRowBasicProps) => ReactNode;

    /**
     * Content to render in the summary area between the header and table.
     */
    summaryContent?: ReactNode;

    /**
     * Configuration for the search box, including fields for text search if data is a static array.
     */
    search?: {
        /**
         * Enables the search box.
         */
        enable: boolean;

        /**
         * Fields in the data to use for text search (required for static data arrays).
         */
        fields?: string[];

        /**
         * If true, collapses the search box by default.
         */
        collapsed?: boolean;
    };

    /**
     * Width of the list when the details panel is open. Accepts percentage string or pixels (15%-75%). Defaults to '50%'.
     */
    collapsedWidth?: string | number;

    /**
     * If true, appends view state to the URL for navigation.
     */
    appendToURL?: boolean;

    /** custom classname */
    className?: string
}
```

## Usage

```tsx
import { ObjectSearchComponentProps } from 'uxp/components';
```

## Related Types

* [FilterConfig](https://help.iviva.com/uxp/v5/additional-resources/types/filterconfig)
* [FormSectionProps](https://help.iviva.com/uxp/v5/additional-resources/types/formsectionprops)
* [DynamicFormFieldProps](https://help.iviva.com/uxp/v5/additional-resources/types/dynamicformfieldprops)
* [FormValue](https://help.iviva.com/uxp/v5/additional-resources/types/formvalue)
* [IFormData](https://help.iviva.com/uxp/v5/additional-resources/types/iformdata)
* [CustomValidateResponse](https://help.iviva.com/uxp/v5/additional-resources/types/customvalidateresponse)
* [FilterCustomRender](https://help.iviva.com/uxp/v5/additional-resources/types/filtercustomrender)
* [Filters](https://help.iviva.com/uxp/v5/additional-resources/types/filters)
* [SimpleFilter](https://help.iviva.com/uxp/v5/additional-resources/types/simplefilter)
* [ViewsConfig](https://help.iviva.com/uxp/v5/additional-resources/types/viewsconfig)
* [View](https://help.iviva.com/uxp/v5/additional-resources/types/view)
* [CustomViewConfigs](https://help.iviva.com/uxp/v5/additional-resources/types/customviewconfigs)
* [Sort](https://help.iviva.com/uxp/v5/additional-resources/types/sort)
* [SortOrder](https://help.iviva.com/uxp/v5/additional-resources/types/sortorder)
* [RowData](https://help.iviva.com/uxp/v5/additional-resources/types/rowdata)
* [OSCColumn](https://help.iviva.com/uxp/v5/additional-resources/types/osccolumn)
* [Column](https://help.iviva.com/uxp/v5/additional-resources/types/column)
* [ExportColumnFormatter](https://help.iviva.com/uxp/v5/additional-resources/types/exportcolumnformatter)
* [DefaultActionColumnsConfig](https://help.iviva.com/uxp/v5/additional-resources/types/defaultactioncolumnsconfig)
* [BaseProps](https://help.iviva.com/uxp/v5/additional-resources/types/baseprops)
* [Action](https://help.iviva.com/uxp/v5/additional-resources/types/action)
* [BaseAction](https://help.iviva.com/uxp/v5/additional-resources/types/baseaction)
* [ActionWithChildren](https://help.iviva.com/uxp/v5/additional-resources/types/actionwithchildren)
* [DefaultDetailsPanelProps](https://help.iviva.com/uxp/v5/additional-resources/types/defaultdetailspanelprops)
* [ObjectDetailsPanelBaseProps](https://help.iviva.com/uxp/v5/additional-resources/types/objectdetailspanelbaseprops)
* [DetailsContent](https://help.iviva.com/uxp/v5/additional-resources/types/detailscontent)
* [ObjectDetailsPanelHeaderProps](https://help.iviva.com/uxp/v5/additional-resources/types/objectdetailspanelheaderprops)
* [BreadcrumbItem](https://help.iviva.com/uxp/v5/additional-resources/types/breadcrumbitem)
* [AnalyticsCardProps](https://help.iviva.com/uxp/v5/additional-resources/types/analyticscardprops)
* [AdditionaDetails](https://help.iviva.com/uxp/v5/additional-resources/types/additionadetails)
* [Tab](https://help.iviva.com/uxp/v5/additional-resources/types/tab)
* [DetailsPanelTab](https://help.iviva.com/uxp/v5/additional-resources/types/detailspaneltab)
* [ToolbarItem](https://help.iviva.com/uxp/v5/additional-resources/types/toolbaritem)
* [ObjectInfoCardProps](https://help.iviva.com/uxp/v5/additional-resources/types/objectinfocardprops)
* [ObjectField](https://help.iviva.com/uxp/v5/additional-resources/types/objectfield)
* [BaseDetailsPanelConfig](https://help.iviva.com/uxp/v5/additional-resources/types/basedetailspanelconfig)
* [CustomDetailsPanelProps](https://help.iviva.com/uxp/v5/additional-resources/types/customdetailspanelprops)
* [TableRowBasicProps](https://help.iviva.com/uxp/v5/additional-resources/types/tablerowbasicprops)
* [ExtendedColumn](https://help.iviva.com/uxp/v5/additional-resources/types/extendedcolumn)
* [EditableRowConfig](https://help.iviva.com/uxp/v5/additional-resources/types/editablerowconfig)
