UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

95 lines (94 loc) 5.07 kB
import '@ui5/webcomponents/dist/ComboBoxItemGroup.js'; import type { ListItemGroupMoveEventDetail } from '@ui5/webcomponents/dist/ListItemGroup.js'; import type WrappingType from '@ui5/webcomponents/dist/types/WrappingType.js'; import type { CommonProps, Ui5CustomEvent, Ui5DomRef, UI5WCSlotsNode } from '@ui5/webcomponents-react-base'; import type { ReactNode } from 'react'; interface ComboBoxItemGroupAttributes { /** * Defines the accessible name of the header. * @default undefined */ headerAccessibleName?: string | undefined; /** * Defines the header text of the <code>ui5-li-group</code>. * @default undefined */ headerText?: string | undefined; /** * Defines if the text of the component should wrap when it's too long. * When set to "Normal", the content (title, description) will be wrapped * using the `ExpandableText` component.<br/> * * The text can wrap up to 100 characters on small screens (size S) and * up to 300 characters on larger screens (size M and above). When text exceeds * these limits, it truncates with an ellipsis followed by a text expansion trigger. * * Available options are: * - `None` (default) - The text will truncate with an ellipsis. * - `Normal` - The text will wrap (without truncation). * * **Note:** Available since [v2.15.0](https://github.com/UI5/webcomponents/releases/tag/v2.15.0) of **@ui5/webcomponents**. * @default "None" */ wrappingType?: WrappingType | keyof typeof WrappingType; } interface ComboBoxItemGroupDomRef extends Required<ComboBoxItemGroupAttributes>, Ui5DomRef { } interface ComboBoxItemGroupPropTypes extends ComboBoxItemGroupAttributes, Omit<CommonProps, keyof ComboBoxItemGroupAttributes | 'children' | 'header' | 'onMove' | 'onMoveOver'> { /** * Defines the items of the <code>ui5-cb-item-group</code>. * * __Supported Node Type/s:__ `Array<ComboBoxItem>` */ children?: ReactNode | ReactNode[]; /** * Defines the header of the component. * * **Note:** Using this slot, the default header text of group and the value of `headerText` property will be overwritten. * * __Note:__ The content of the prop will be rendered into a [&lt;slot&gt;](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) by assigning the respective [slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot) attribute (`slot="header"`). * Since you can't change the DOM order of slots when declaring them within a prop, it might prove beneficial to manually mount them as part of the component's children, especially when facing problems with the reading order of screen readers. * * __Note:__ When passing a custom React component to this prop, you have to make sure your component reads the `slot` prop and appends it to the most outer element of your component. * Learn more about it [here](https://ui5.github.io/webcomponents-react/v2/?path=/docs/knowledge-base-handling-slots--docs). * * __Supported Node Type/s:__ `Array<ListItemBase>` */ header?: UI5WCSlotsNode; /** * Fired when a movable list item is dropped onto a drop target. * * **Note:** `move` event is fired only if there was a preceding `move-over` with prevented default action. * * **Note:** Available since [v2.1.0](https://github.com/UI5/webcomponents/releases/tag/v2.1.0) of **@ui5/webcomponents**. * * | cancelable | bubbles | * | :--------: | :-----: | * | ❌|✅| */ onMove?: (event: Ui5CustomEvent<ComboBoxItemGroupDomRef, ListItemGroupMoveEventDetail>) => void; /** * Fired when a movable list item is moved over a potential drop target during a dragging operation. * * If the new position is valid, prevent the default action of the event using `preventDefault()`. * * **Note:** Call `event.preventDefault()` inside the handler of this event to prevent its default action/s. * * **Note:** Available since [v2.1.0](https://github.com/UI5/webcomponents/releases/tag/v2.1.0) of **@ui5/webcomponents**. * * | cancelable | bubbles | * | :--------: | :-----: | * | ✅|✅| */ onMoveOver?: (event: Ui5CustomEvent<ComboBoxItemGroupDomRef, ListItemGroupMoveEventDetail>) => void; } /** * The `ui5-cb-group-item` is type of suggestion item, * that can be used to split the `ComboBox` suggestions into groups. * * __Note:__ This is a UI5 Web Component! [ComboBoxItemGroup UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/ComboBoxItemGroup) | [Repository](https://github.com/UI5/webcomponents) * @abstract */ declare const ComboBoxItemGroup: import("react").ForwardRefExoticComponent<ComboBoxItemGroupPropTypes & import("@ui5/webcomponents-react-base").WithWebComponentPropTypes & import("react").RefAttributes<ComboBoxItemGroupDomRef>>; export { ComboBoxItemGroup }; export type { ComboBoxItemGroupDomRef, ComboBoxItemGroupPropTypes };