office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
1 lines • 1.87 kB
JavaScript
define([], function() { return "import { IRenderFunction } from '../../common/IRenderFunction';\r\nexport interface IDropdownProps {\r\n /**\r\n * Descriptive label for the Dropdown\r\n */\r\n label: string;\r\n\r\n /**\r\n * Id of the drop down\r\n */\r\n id?: string;\r\n\r\n /**\r\n * The key that will be initially used to set a selected item.\r\n */\r\n defaultSelectedKey?: string | number;\r\n\r\n /**\r\n * The key of the selected item. If you provide this, you must maintain selection\r\n * state by observing onChange events and passing a new value in when changed.\r\n */\r\n selectedKey?: string | number;\r\n\r\n /**\r\n * Collection of options for this Dropdown\r\n */\r\n options?: IDropdownOption[];\r\n\r\n /**\r\n * Callback issues when the selected option changes\r\n */\r\n onChanged?: (option: IDropdownOption, index?: number) => void;\r\n\r\n /**\r\n * Optional custom renderer for the dropdown item\r\n */\r\n onRenderItem?: IRenderFunction<IDropdownOption>;\r\n\r\n /**\r\n * Whether or not the Dropdown is disabled.\r\n */\r\n disabled?: boolean;\r\n\r\n // @todo: Update version numbers for depriate and removal\r\n /**\r\n * @deprecated\r\n * Deprecated at v0.52.0, to be removed at >= v1.0.0. Use 'disabled' instead.\r\n */\r\n isDisabled?: boolean;\r\n\r\n}\r\n\r\nexport interface IDropdownOption {\r\n /**\r\n * Arbitrary string associated with this option.\r\n */\r\n key: string | number;\r\n\r\n /**\r\n * Text to render for this option\r\n */\r\n text: string;\r\n\r\n /**\r\n * Index for this option\r\n */\r\n index?: number;\r\n\r\n /** If option is selected. */\r\n selected?: boolean;\r\n\r\n /**\r\n * @deprecated\r\n * Deprecated at v.65.1 and will be removed by v 1.0. Use 'selected' instead.\r\n */\r\n isSelected?: boolean;\r\n}\r\n"; });