@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
55 lines (54 loc) • 2.28 kB
TypeScript
import { TextFieldProps } from '@mui/material/TextField';
import { AutocompleteProps } from '@mui/material';
import { SCCategoryType } from '@selfcommunity/types/src/index';
export interface CategoryAutocompleteProps extends Pick<AutocompleteProps<SCCategoryType | null, any, any, any>, Exclude<keyof AutocompleteProps<SCCategoryType | null, any, any, any>, 'open' | 'onOpen' | 'onClose' | 'onChange' | 'filterSelectedOptions' | 'disableCloseOnSelect' | 'options' | 'getOptionLabel' | 'value' | 'selectOnFocus' | 'clearOnBlur' | 'blurOnSelect' | 'handleHomeEndKeys' | 'clearIcon' | 'noOptionsText' | 'isOptionEqualToValue' | 'renderTags' | 'renderOption' | 'renderInput'>> {
/**
* The maximum number of categories that will be visible when not focused.
* @default 0
*/
limitCountCategories?: number;
/**
* If checkbox is selected
* @default false
*/
checkboxSelect?: boolean;
/**
* The props applied to text field
* @default {variant: 'outlined, label: categories_label}
*/
TextFieldProps?: TextFieldProps;
/**
* Callback for change event on poll object
* @param value
*/
onChange?: (value: any) => void;
/**
* Feed API Query Params
* @default [{'limit': 10, 'offset': 0}]
*/
endpointQueryParams?: Record<string, string | number | boolean>;
}
/**
* > API documentation for the Community-JS Category Autocomplete component. Learn about the available props and the CSS API.
*
*
* This component renders a bar that allows users to search (with autocomplete) for all the categories available in the application.
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/CategoryAutocomplete)
*
* #### Import
* ```jsx
* import {CategoryAutocomplete} from '@selfcommunity/react-ui';
* ```
* #### Component Name
* The name `SCCategoryAutocomplete` can be used when providing style overrides in the theme.
*
* #### CSS
*
* |Rule Name|Global class|Description|
* |---|---|---|
* |root|.SCCategoryAutocomplete-root|Styles applied to the root element.|
*
* @param inProps
*/
declare const CategoryAutocomplete: (inProps: CategoryAutocompleteProps) => JSX.Element;
export default CategoryAutocomplete;