import { Accessibility, InputBehaviorProps } from '@fluentui/accessibility'; import * as React from 'react'; import * as PropTypes from 'prop-types'; import { UIComponentProps, ChildrenComponentProps, ShorthandFactory } from '../../utils'; import { SupportedIntrinsicInputProps } from '../../utils/htmlPropsUtils'; import { ShorthandValue, ComponentEventHandler } from '../../types'; import { BoxProps } from '../Box/Box'; import { ComponentWithAs } from '@fluentui/react-bindings'; import { InputLabelProps, LabelPosition } from './InputLabel'; export interface InputProps extends UIComponentProps, ChildrenComponentProps, SupportedIntrinsicInputProps { /** * Accessibility behavior if overridden by the user. */ accessibility?: Accessibility; /** A property that will change the icon on the input and clear the input on click on Cancel. */ clearable?: boolean; /** The default value of the input. */ defaultValue?: string | string[]; /** An Input can be disabled. */ disabled?: boolean; /** An input can take the width of its container. */ fluid?: boolean; /** Optional Icon to display inside the Input. */ icon?: ShorthandValue; /** An Input with icon can format the icon to appear at the start or at the end of the input field. */ iconPosition?: 'start' | 'end'; /** An input can be used inline with text. */ inline?: boolean; /** Shorthand for the input component. */ input?: ShorthandValue; /** An input can have inverted colors. */ inverted?: boolean; /** * Called on change. * * @param event - React's original SyntheticEvent. * @param data - All props and proposed value. */ onChange?: ComponentEventHandler; /** The HTML input type. */ type?: string; /** (DEPRECATED) Ref for input DOM node. */ inputRef?: React.Ref; /** The value of the input. */ value?: string | number; /** A label for the input. */ label?: ShorthandValue; /** Poisition for the label */ labelPosition?: LabelPosition; /** Shorthand for the wrapper component. */ wrapper?: ShorthandValue; /** Input can be required to be valid. */ required?: boolean; /** Input can have error state */ error?: boolean; /** Input can have error indicator when error is true */ errorIndicator?: ShorthandValue; /** Optional Icon to display inside the Input if required and fulfilled. */ successIndicator?: ShorthandValue; /** Indicates whether the successIndicator should be visible. */ showSuccessIndicator?: boolean; } export interface InputSlotClassNames { input: string; icon: string; } export declare const inputClassName = "ui-input"; export declare type InputStylesProps = Required & { hasIcon: boolean; hasValue: boolean; requiredAndSuccessful: boolean; }>; export declare const inputSlotClassNames: InputSlotClassNames; /** * An Input is a field used to elicit an input from a user. * * @accessibility * For good screen reader experience set `aria-label` or `aria-labelledby` attribute for input. */ export declare const Input: ( = "input">(props: Pick, Exclude, "inline" | "icon" | "multiple" | "disabled" | "form" | "input" | "label" | "pattern" | "children" | "list" | "step" | "id" | "checked" | "as" | "defaultChecked" | "defaultValue" | "className" | "placeholder" | "autoCapitalize" | "autoCorrect" | "onFocus" | "onBlur" | "onChange" | "onInput" | "onKeyDown" | "onKeyPress" | "onKeyUp" | "onClick" | "onContextMenu" | "onDrag" | "onDragEnd" | "onDragEnter" | "onDragExit" | "onDragLeave" | "onDragOver" | "onDragStart" | "onDrop" | "onMouseDown" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseOut" | "onMouseOver" | "onMouseUp" | "onSelect" | "onTouchCancel" | "onTouchEnd" | "onTouchMove" | "onTouchStart" | "design" | "styles" | "variables" | "type" | "error" | "value" | "name" | "selected" | "accept" | "autoComplete" | "autoFocus" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "required" | "accessibility" | "inverted" | "fluid" | "labelPosition" | "iconPosition" | "wrapper" | "clearable" | "inputRef" | "errorIndicator" | "successIndicator" | "showSuccessIndicator">> & { as?: TExtendedElementType; } & InputProps) => JSX.Element) & { propTypes?: React.WeakValidationMap & { as: React.Requireable any) | (new (props: any, context?: any) => any)>; }; contextTypes?: PropTypes.ValidationMap; defaultProps?: Partial; displayName?: string; readonly __PRIVATE_PROPS?: Pick, HTMLInputElement>, "hidden" | "color" | "size" | "style" | "multiple" | "disabled" | "form" | "title" | "pattern" | "key" | "children" | "list" | "step" | "aria-label" | "role" | "tabIndex" | "id" | "aria-autocomplete" | "aria-checked" | "aria-current" | "aria-disabled" | "aria-expanded" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-selected" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "aria-activedescendant" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-describedby" | "aria-details" | "aria-errormessage" | "aria-flowto" | "aria-labelledby" | "aria-owns" | "aria-posinset" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "checked" | "contextMenu" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "dir" | "draggable" | "lang" | "placeholder" | "slot" | "spellCheck" | "inputMode" | "is" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-atomic" | "aria-busy" | "aria-dropeffect" | "aria-grabbed" | "aria-keyshortcuts" | "aria-placeholder" | "aria-relevant" | "aria-roledescription" | "aria-setsize" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "height" | "width" | "alt" | "src" | "type" | "value" | "name" | "accept" | "autoComplete" | "autoFocus" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "required" | "capture" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & { ref?: React.Ref; }, "hidden" | "color" | "size" | "style" | "title" | "key" | "ref" | "aria-label" | "role" | "tabIndex" | "aria-autocomplete" | "aria-checked" | "aria-current" | "aria-disabled" | "aria-expanded" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-selected" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "aria-activedescendant" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-describedby" | "aria-details" | "aria-errormessage" | "aria-flowto" | "aria-labelledby" | "aria-owns" | "aria-posinset" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "contextMenu" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "dir" | "draggable" | "lang" | "slot" | "spellCheck" | "inputMode" | "is" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-atomic" | "aria-busy" | "aria-dropeffect" | "aria-grabbed" | "aria-keyshortcuts" | "aria-placeholder" | "aria-relevant" | "aria-roledescription" | "aria-setsize" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancelCapture" | "onTouchEndCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "height" | "width" | "alt" | "src" | "capture" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & { as?: "input"; } & InputProps; } & { create: ShorthandFactory; Label: ComponentWithAs<"label", InputLabelProps & BoxProps>; };