@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
45 lines (44 loc) • 1.9 kB
TypeScript
import { TextFieldProps } from '@mui/material/TextField';
import { AutocompleteProps } from '@mui/material';
import { SCTagType } from '@selfcommunity/types/src/index';
import { TagChipProps } from '../../shared/TagChip';
export interface TagAutocompleteProps extends Pick<AutocompleteProps<SCTagType | null, any, any, any>, Exclude<keyof AutocompleteProps<SCTagType | null, any, any, any>, 'open' | 'onOpen' | 'onClose' | 'onChange' | 'filterSelectedOptions' | 'disableCloseOnSelect' | 'options' | 'getOptionLabel' | 'value' | 'selectOnFocus' | 'clearOnBlur' | 'blurOnSelect' | 'handleHomeEndKeys' | 'noOptionsText' | 'isOptionEqualToValue' | 'renderTags' | 'renderOption' | 'renderInput'>> {
defaultValue: SCTagType[] | any;
/**
* The props applied to text field
* @default {variant: 'outlined, label: tags_label}
*/
TextFieldProps?: TextFieldProps;
/**
* The props to spread to TagChip component
*/
TagChipProps?: Pick<TagChipProps, Exclude<keyof TagChipProps, 'tag'>>;
/**
* Callback for change event on poll object
* @param value
*/
onChange?: (value: any) => void;
}
/**
* > API documentation for the Community-JS Tag 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 tags available in the application.
*
* #### Import
* ```jsx
* import {TagAutocomplete} from '@selfcommunity/react-ui';
* ```
* #### Component Name
* The name `SCTagAutocomplete` can be used when providing style overrides in the theme.
*
* #### CSS
*
* |Rule Name|Global class|Description|
* |---|---|---|
* |root|.SCTagAutocomplete-root|Styles applied to the root element.|
*
* @param inProps
*/
declare const TagAutocomplete: (inProps: TagAutocompleteProps) => JSX.Element;
export default TagAutocomplete;