UNPKG

4.2 kBSource Map (JSON)View Raw
1{"version":3,"file":"Autofill.types.js","sourceRoot":"../src/","sources":["components/Autofill/Autofill.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { Autofill } from './Autofill';\nimport { IRefObject, KeyCodes } from '../../Utilities';\n\n/**\n * {@docCategory Autofill}\n */\nexport interface IAutofill {\n /**\n * The current index of the cursor in the input area. Returns -1 if the input element\n * is not ready.\n */\n cursorLocation: number | null;\n /**\n * A boolean for whether or not there is a value selected in the input area.\n */\n isValueSelected: boolean;\n /**\n * The current text value that the user has entered.\n */\n value: string;\n /**\n * The current index of where the selection starts. Returns -1 if the input element\n * is not ready.\n */\n selectionStart: number | null;\n /**\n * the current index of where the selection ends. Returns -1 if the input element\n * is not ready.\n */\n selectionEnd: number | null;\n /**\n * The current input element.\n */\n inputElement: HTMLInputElement | null;\n /**\n * Focus the input element.\n */\n focus(): void;\n /**\n * Clear all text in the input. Sets value to '';\n */\n clear(): void;\n}\n\n/**\n * {@docCategory Autofill}\n */\nexport interface IAutofillProps extends React.InputHTMLAttributes<HTMLInputElement | Autofill> {\n /**\n * Gets the compoonent ref.\n */\n componentRef?: IRefObject<IAutofill>;\n\n /**\n * The suggested autofill value that will display.\n */\n suggestedDisplayValue?: string;\n\n /**\n * A callback for when the current input value changes.\n *\n * @param composing - true if the change event was triggered while the\n * inner input was in the middle of a multi-character composition.\n * (for example, jp-hiragana IME input)\n */\n onInputValueChange?: (newValue?: string, composing?: boolean) => void;\n\n /**\n * When the user uses left arrow, right arrow, clicks, or deletes text autofill is disabled\n * Since the user has taken control. It is automatically reenabled when the user enters text and the\n * cursor is at the end of the text in the input box. This specifies other key presses that will reenabled\n * autofill.\n * @defaultvalue [KeyCodes.down, KeyCodes.up]\n */\n enableAutofillOnKeyPress?: KeyCodes[];\n\n /**\n * The default value to be visible. This is different from placeholder\n * because it actually sets the current value of the picker\n * Note: This will only be set upon component creation\n * and will not update with subsequent prop updates.\n */\n defaultVisibleValue?: string;\n\n /**\n * Handler for checking and updating the value if needed\n * in componentWillReceiveProps\n *\n * @returns - the updated value to set, if needed\n */\n updateValueInWillReceiveProps?: () => string | null;\n\n /**\n * Handler for checking if the full value of the input should\n * be seleced in componentDidUpdate\n *\n * @returns - should the full value of the input be selected?\n */\n shouldSelectFullInputValueInComponentDidUpdate?: () => boolean;\n\n /**\n * A callback used to modify the input string.\n *\n * @param composing - true if the change event was triggered while the\n * inner input was in the middle of a multi-character composition.\n * (for example, jp-hiragana IME input)\n */\n onInputChange?: (value: string, composing: boolean) => string;\n\n /**\n * Should the value of the input be selected? True if we're focused on our input, false otherwise.\n * We need to explicitly not select the text in the autofill if we are no longer focused.\n * In IE11, selecting a input will also focus the input, causing other element's focus to be stolen.\n */\n preventValueSelection?: boolean;\n}\n\n/**\n * Deprecated, do not use.\n * @deprecated do not use, will be removed in 6.0\n * {@docCategory Autofill}\n */\nexport interface IBaseAutoFill extends IAutofill {}\n\n/**\n * Deprecated, do not use.\n * @deprecated do not use, will be removed in 6.0\n * {@docCategory Autofill}\n */\nexport interface IBaseAutoFillProps extends IAutofillProps {}\n"]}
\No newline at end of file