UNPKG

@carbon/ibm-products

Version:
93 lines 2.81 kB
/** * Copyright IBM Corp. 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { ReactNode } from 'react'; import { type SearchProps, type TagProps, type CheckboxProps } from '@carbon/react'; /** * ---------------- * AddSelectColumn * ---------------- * A composable column component that wraps AddSelectRow items. * Provides optional search functionality with custom actions slot. * Lives inside AddSelectContent and can have multiple instances. */ export interface AddSelectColumnProps { /** * AddSelectRow children */ children?: ReactNode; /** * Column title displayed in the header */ title?: string; /** * Label text for the search input */ searchLabel?: string; /** * Placeholder text for the search input */ searchPlaceholder?: string; /** * Callback when search value changes */ onSearch?: (value: string) => void; /** * Actions slot - adds custom actions (filter/sort) next to search */ actionsSlot?: ReactNode; /** * Whether to hide the search input */ hideSearch?: boolean; /** * Whether to enable multi-selection (checkboxes) or single selection (radio buttons) */ multi?: boolean; /** * Whether to show the "Select All" checkbox (only applicable when multi is true) */ showSelectAll?: boolean; /** * Total number of items in the column (for display in tag) */ itemCount?: number; /** * Whether all items are currently selected */ allSelected?: boolean; /** * Whether the "Select All" checkbox is in an indeterminate state */ allIndeterminate?: boolean; /** * Callback when "Select All" is toggled */ onSelectAll?: (checked: boolean) => void; /** * Callback when navigating to children */ onNavigate?: (itemId: string, title: string, parentId: string) => void; /** * Optional class name */ className?: string; /** * Additional props to pass to the Search component */ searchProps?: Omit<SearchProps, 'labelText' | 'placeholder' | 'size' | 'onChange' | 'value'>; /** * Additional props to pass to the Tag component */ tagProps?: Omit<TagProps<'div'>, 'type' | 'size' | 'children'>; /** * Additional props to pass to the Checkbox component (Select All) */ selectAllCheckboxProps?: Omit<CheckboxProps, 'id' | 'className' | 'checked' | 'onChange' | 'labelText'>; } declare const AddSelectColumn: React.ForwardRefExoticComponent<AddSelectColumnProps & React.RefAttributes<HTMLDivElement>>; export default AddSelectColumn; //# sourceMappingURL=AddSelectColumn.d.ts.map