UNPKG

@wix/design-system

Version:

@wix/design-system

250 lines (247 loc) 10.1 kB
### placeholder - type: string - description: Placeholder for the input box ### valuePrefix - type: string - description: Value to place before every search term (normally should not be used) ### countryCode - type: string - description: Country code used to help with suggestions and geocoding ### value - type: string - description: Controlled mode - value to display ### status - type: "loading" | "error" | "warning" - description: Sets UI to indicate a status ### statusMessage - type: ReactNode - description: The status message to display when hovering the status icon, if not given or empty there will be no tooltip ### onChange - type: ChangeEventHandler - description: Defines a standard input onChange callback ### onBlur - type: FocusEventHandler - description: Defines a standard input onBlur callback ### onFocus - type: FocusEventHandler - description: Defines a standard input onFocus callback ### onKeyDown - type: KeyboardEventHandler<HTMLInputElement> - description: Defines a standard input onKeyDown callback ### onKeyUp - type: KeyboardEventHandler<HTMLInputElement> - description: Defines a standard input onKeyUp callback ### onPaste - type: ClipboardEventHandler<HTMLInputElement> - description: Defines a callback handler that is called when user pastes text from a clipboard (using a mouse or keyboard shortcut) ### onSet - type: (params: { originValue: string; googleResult: any; address: Address; }) => void - description: Callback for results. Will return an object containing: originValue (value in the search), googleResult (google geocode result for the search), address (which will include: formatted (google formatted address), country, countryCode, street, number, postalCode, latLng (lat, lng)) ### magnifyingGlass - type: boolean - description: Show or hide magnifying glass icon - default: true ### readOnly - type: boolean - description: Sets the input to readOnly ### autoSelect - type: boolean - description: Automatically selects the entire input text - default: true ### clearSuggestionsOnBlur - type: boolean - description: Clear the suggestions list upon input blur - default: true ### fallbackToManual - type: boolean - description: If set to `true`, we will attempt to get a Google location from the input's text if there are no suggestions. This is useful when looking for locations for which google does not give suggestions - for example: Apartment/Apt - default: false ### poweredByGoogle - type: boolean - description: Shows the Powered By Google credit in a fixed footer - default: false ### footer - type: string - description: Display a footer as the last suggestion in the list ### types - type: any[] - description: Limit the autocomplete to specific types (see [here](https://developers.google.com/places/supported_types#table3) for list) ### filterTypes - type: any[] - description: Lower level filtering of autocomplete result types (see [here](https://developers.google.com/places/supported_types) for list) ### placeDetailsFields - type: any[] - description: Fields indicating which types of Places data to return (see [here](https://developers.google.com/maps/documentation/javascript/places#place_details) ### footerOptions - type: object - description: Set the footer's options (e.g. disabled, overrideStyles, etc. ) ### handler - type: "geocode" | "places" - description: Sets how to get more details for a place (e.g. geocode, places, etc) ### Client - type: new () => GoogleMapsClient - description: Google map client implementation (should implement autocomplete and geocode functions). Normally you would use ### children - type: ReactNode - description: No description ### disabled - type: boolean - description: Specifies whether input should be disabled or not ### size - type: "tiny" | "small" | "medium" | "large" - description: Controls the size of the input. Default value: `medium` ### dataHook - type: string - description: Applies a data-hook HTML attribute that can be used in the tests ### className - type: string - description: Specifies a CSS class name to be appended to the component's root element. - internal ### ariaLabel - type: string - description: Define a string that labels the current element in case where a text label is not visible on the screen ### clearButton - type: boolean - description: Displays clear button (X) on a non-empty input ### clearButtonAriaLabel - type: string - description: Aria label for the clear button ### onClear - type: (event: KeyboardEvent<HTMLButtonElement> | MouseEvent<HTMLButtonElement, MouseEvent>) => void - description: Displays clear button (X) on a non-empty input and calls a callback function ### border - type: "none" | "standard" | "round" | "bottomLine" - description: Control the border style of input ### tabIndex - type: number - description: Indicates that element can be focused and where it participates in sequential keyboard navigation ### autoFocus - type: boolean - description: Focus the element on mount (standard React input autoFocus) ### suffix - type: ReactNode - description: Pass a component you want to show as the suffix of the input, e.g., text, icon ### role - type: string - description: Specifies the role of the input element for accessibility ### id - type: string - description: Assigns a unique identifier for the root element ### type - type: string - description: Specifies the type of `<input/>` element to display. Default is text. ### prefix - type: ReactNode - description: Pass a component you want to show as the prefix of the input, e.g., text, icon ### onEnterPressed - type: KeyboardEventHandler<HTMLInputElement> - description: Defines a callback handler that is called when the user presses -enter- ### maxLength - type: number - description: Sets the maximum number of characters that can be inserted to a field ### step - type: number - description: Specifies the interval between number values ### name - type: string - description: Reference element data when a form is submitted ### defaultValue - type: string | number - description: Defines the initial value of an input ### onCopy - type: ClipboardEventHandler<HTMLInputElement> - description: Defines a callback handler that is called when user copies text to a clipboard (using a mouse or keyboard shortcut) ### textOverflow - type: "ellipsis" | "clip" - description: Handles text overflow behavior. It can either `clip` (default) or display `ellipsis`. ### required - type: boolean - description: Specifies whether input is mandatory ### pattern - type: string - description: Sets a pattern that typed value must match to be valid (regex) ### ariaControls - type: string - description: Associate a control with the regions that it controls ### ariaDescribedby - type: string - description: Associate a region with its descriptions. Similar to aria-controls but instead associating descriptions to the region and description identifiers are separated with a space. ### autocomplete - type: string - description: Sets the value of native autocomplete attribute (check the [HTML spec](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete) for possible values ### statusMessageTooltipProps - type: TooltipCommonProps - description: Status message tooltip props ### hideStatusSuffix - type: boolean - description: Specifies whether status suffix should be hidden ### forceFocus - type: boolean - description: USED FOR TESTING - forces focus state on the input ### forceHover - type: boolean - description: USED FOR TESTING - forces hover state on the input ### menuArrow - type: boolean - description: Specifies whether input should have a dropdown menu arrow on the right side ### focusOnClearClick - type: boolean - description: Specifies whether to focus the field when clear button is clicked ### noLeftBorderRadius - type: boolean - description: Specifies whether input shouldn't have rounded corners on its left ### noRightBorderRadius - type: boolean - description: Specifies whether input shouldn't have rounded corners on its right ### onCompositionChange - type: (isComposing: boolean) => void - description: Defines a callback function called on compositionstart/compositionend events ### onEscapePressed - type: KeyboardEventHandler<HTMLInputElement> - description: Defines a callback handler that is called when the user presses -escape- ### onInputClicked - type: MouseEventHandler - description: Defines a standard input onClick callback ### disableEditing - type: boolean - description: Restricts input editing ### rtl - type: boolean - description: Specifies text direction. If true, the text will be displayed from right to left ### tooltipPlacement - type: "right" | "left" | "auto" | "auto-start" | "auto-end" | "top-start" | "top" | "top-end" | "right-start" | "right-end" | "bottom-end" | "bottom" | "bottom-start" | "left-end" | "left-start" - description: Controls placement of a status tooltip - deprecated ### withSelection - type: boolean - description: No description ### min - type: number - description: Sets a minimum value of an input. Similar to HTML5 min attribute. ### max - type: number - description: Sets a maximum value of an input. Similar to html5 max attribute. ### customInput - type: ReactNode | Function - description: Render a custom input instead of the default html input tag ### inputRef - type: null | (instance: HTMLInputElement | null) => void | RefObject<HTMLInputElement> - description: Ref to the underlying `<input>` DOM element. Accepts callback and object refs. Use for input masking libraries such as `use-mask-input`. Memoize callback refs to avoid reattaching on every render. ### inputmode - type: string - description: No description ### ariaRoledescription - type: string - description: No description ### clearButtonTooltipContent - type: ReactNode - description: When provided hover will display a tooltip with content ### clearButtonTooltipProps - type: TooltipCommonProps - description: Clear button tooltip props ### inputElementRef - type: any - description: Specifies reference of the input element - internal