UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

130 lines (129 loc) 5.86 kB
import '@ui5/webcomponents-fiori/dist/UserSettingsDialog.js'; import type { UserSettingsItemSelectEventDetail } from '@ui5/webcomponents-fiori/dist/UserSettingsDialog.js'; import type { CommonProps, Ui5CustomEvent, Ui5DomRef, UI5WCSlotsNode } from '@ui5/webcomponents-react-base'; import type { ReactNode } from 'react'; interface UserSettingsDialogAttributes { /** * Defines the headerText of the item. * @default undefined */ headerText?: string | undefined; /** * Defines, if the User Settings Dialog is opened. * @default false */ open?: boolean; /** * Defines whether the dialog offers Save and Cancel actions in its footer. * * When true, the footer renders a Save (Emphasized) and a Cancel button * instead of the default Close button. Save and Cancel each fire a * corresponding event; the application is responsible for closing the * dialog (typically after persisting or discarding the changes). * @default false */ saveMode?: boolean; /** * Defines if the Search Field would be displayed. * * **Note:** By default the Search Field is not displayed. * @default false */ showSearchField?: boolean; } interface UserSettingsDialogDomRef extends Required<UserSettingsDialogAttributes>, Ui5DomRef { } interface UserSettingsDialogPropTypes extends UserSettingsDialogAttributes, Omit<CommonProps, keyof UserSettingsDialogAttributes | 'children' | 'fixedItems' | 'onBeforeClose' | 'onCancel' | 'onClose' | 'onOpen' | 'onSave' | 'onSelectionChange'> { /** * Defines the user settings items. * * **Note:** If no setting item is set as `selected`, the first one will be selected. * * __Supported Node Type/s:__ `Array<UserSettingsItem>` */ children?: ReactNode | ReactNode[]; /** * Defines the fixed user settings items. * * __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="fixedItems"`). * 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<UserSettingsItem>` */ fixedItems?: UI5WCSlotsNode; /** * Fired before the settings dialog is closed. * * **Note:** This event is cancelable via `preventDefault()`, allowing the application to keep the * dialog open — for example, to prompt the user about unsaved changes before dismissal. * * **Note:** Call `event.preventDefault()` inside the handler of this event to prevent its default action/s. * * | cancelable | bubbles | * | :--------: | :-----: | * | ✅|❌| */ onBeforeClose?: (event: Ui5CustomEvent<UserSettingsDialogDomRef>) => void; /** * Fired when the Cancel button in the footer is clicked. * The dialog does not close automatically — the application is responsible * for closing it after discarding the changes. * * | cancelable | bubbles | * | :--------: | :-----: | * | ❌|❌| */ onCancel?: (event: Ui5CustomEvent<UserSettingsDialogDomRef>) => void; /** * Fired when the settings dialog is closed. * * | cancelable | bubbles | * | :--------: | :-----: | * | ❌|❌| */ onClose?: (event: Ui5CustomEvent<UserSettingsDialogDomRef>) => void; /** * Fired when the settings dialog is opened. * * | cancelable | bubbles | * | :--------: | :-----: | * | ❌|❌| */ onOpen?: (event: Ui5CustomEvent<UserSettingsDialogDomRef>) => void; /** * Fired when the Save button in the footer is clicked. * The dialog does not close automatically — the application is responsible * for closing it after persisting the changes. * * | cancelable | bubbles | * | :--------: | :-----: | * | ❌|❌| */ onSave?: (event: Ui5CustomEvent<UserSettingsDialogDomRef>) => void; /** * Fired when an item is selected. * * **Note:** Call `event.preventDefault()` inside the handler of this event to prevent its default action/s. * * | cancelable | bubbles | * | :--------: | :-----: | * | ✅|❌| */ onSelectionChange?: (event: Ui5CustomEvent<UserSettingsDialogDomRef, UserSettingsItemSelectEventDetail>) => void; } /** * The `UserSettingsDialog` is an SAP Fiori-specific web component used in the `UserMenu`. * It allows the user to easily view information and settings for an account. * * * * __Note:__ This is a UI5 Web Component! [UserSettingsDialog UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/fiori/UserSettingsDialog) | [Repository](https://github.com/UI5/webcomponents) * * @since [2.8.0](https://github.com/UI5/webcomponents/releases/tag/v2.8.0) of __@ui5/webcomponents-fiori__. */ declare const UserSettingsDialog: import("react").ForwardRefExoticComponent<UserSettingsDialogPropTypes & import("@ui5/webcomponents-react-base").WithWebComponentPropTypes & import("react").RefAttributes<UserSettingsDialogDomRef>>; export { UserSettingsDialog }; export type { UserSettingsDialogDomRef, UserSettingsDialogPropTypes };