UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

1 lines 3.08 kB
define([], function() { return "import * as React from 'react';\r\n\r\n/**\r\n * TextField component props.\r\n */\r\nexport interface ITextFieldProps extends React.HTMLProps<HTMLInputElement | HTMLTextAreaElement> {\r\n /**\r\n * Whether or not the textfield is a multiline textfield.\r\n * @default false\r\n */\r\n multiline?: boolean;\r\n\r\n /**\r\n * Whether or not the multiline textfield is resizable.\r\n * @default true\r\n */\r\n resizable?: boolean;\r\n\r\n /**\r\n * Whether or not the textfield is underlined.\r\n * @default false\r\n */\r\n underlined?: boolean;\r\n\r\n /**\r\n * Label for the textfield.\r\n */\r\n label?: string;\r\n\r\n /**\r\n * The textfield input description\r\n */\r\n description?: string;\r\n\r\n /**\r\n * CSS class for the icon.\r\n */\r\n iconClass?: string;\r\n\r\n /**\r\n * Default value of the textfield, if any. Only provide this if the textfield is an uncontrolled component;\r\n * otherwise, use the \"value\" property.\r\n */\r\n defaultValue?: string;\r\n\r\n /**\r\n * Current value of the textfield. Only provide this if the textfield is a controlled component where you\r\n * are maintaining its current state; otherwise, use the \"defaultValue\" property.\r\n */\r\n value?: string;\r\n\r\n /**\r\n * Disabled state of the textfield.\r\n * @default false\r\n */\r\n disabled?: boolean;\r\n\r\n /**\r\n * Default value of the textfield, if any.\r\n */\r\n errorMessage?: string;\r\n\r\n /**\r\n * Callback for the onChanged event.\r\n */\r\n onChanged?: (newValue: any) => void;\r\n\r\n /**\r\n * Callback for the onBeforeChange event.\r\n */\r\n onBeforeChange?: (newValue: any) => void;\r\n\r\n /**\r\n * Callback for the onNotifyValidationResult event.\r\n */\r\n onNotifyValidationResult?: (errorMessage: string, value: string) => void;\r\n\r\n /**\r\n * The method is used to get the validation error message and determine whether the input value is valid or not.\r\n *\r\n * When it returns string:\r\n * - If valid, it returns empty string.\r\n * - If invalid, it returns the error message string and the text field will\r\n * show a red border and show an error message below the text field.\r\n *\r\n * When it returns Promise<string>:\r\n * - The resolved value is display as error message.\r\n * - The rejected, the value is thrown away.\r\n *\r\n */\r\n onGetErrorMessage?: (value: string) => string | PromiseLike<string>;\r\n\r\n /**\r\n * Text field will start to validate after users stop typing for `deferredValidationTime` milliseconds.\r\n * @default 200\r\n */\r\n deferredValidationTime?: number;\r\n\r\n /**\r\n * Optional class anme that is added to the container of the component.\r\n */\r\n className?: string;\r\n\r\n /**\r\n * Optional class name that is added specifically to the input/textarea element.\r\n */\r\n inputClassName?: string;\r\n\r\n /**\r\n * Aria Label for textfield, if any.\r\n */\r\n ariaLabel?: string;\r\n}\r\n"; });