Address Autocomplete
A component that provides an autocomplete functionality for addresses using the Google Maps API.
This component is build on top of the Autocomplete component.
Anatomy
<script setup lang="ts">
import {
VcAutocomplete,
VcSelectItem,
} from '@wisemen/vue-core-components'
</script>
<template>
<VcAutocomplete>
<template #item>
<VcSelectItem />
</template>
</VcAutocomplete>
</template>Props
The class configuration for the component. This allows customizating the default styles by overriding them with custom values.
-Whether to clear the search term when an item is selected.
-The debounce timeout in milliseconds.
-The error associated with the input.
-The hint text of the input.
-Icon displayed on the left side of the input field.
If null, no icon is displayed.
-Icon displayed on the right side of the input field.
-The id of the element. If set to null, no ID will be applied.
-Determines whether the element is disabled. When true, the element becomes non-interactive.
-Controls the visibility of the dropdown.
When set to true, the dropdown remains hidden.
-Whether the select input should display a loading state. This is useful when data is being fetched asynchronously.
-Controls the visibility of the popper arrow.
-Whether the input is required.
-Determines whether the search term is controlled externally.
If true, the search term will only be updated when explicitly controlled via props.
If false, the search term is managed internally.
-Whether the input is touched. Used to determine if an error should be shown.
-The label of the input.
-Placeholder text for the select input when no value is selected.
-Defines how the popper content is aligned relative to the trigger element.
-An offset in pixels from the start or end alignment options.
-The HTML element that serves as the anchor point for the popover.
If set to null, the popover will be anchored to the trigger element.
-Specifies the padding (in pixels) used when handling collision detection. A larger value increases the spacing between the popper and the container edges.
-The HTML element in which the popper content should be rendered. By default, the popper content is rendered inside the viewport.
-Defines which side the content should appear on.
-The distance in pixels between the popper content and the trigger element.
-Determines the width of the popper content.
anchor-width: Matches the width of the trigger element.available-width: Expands to fit the available space.null: Uses the natural width of the content.
-Determines whether the dropdown should remain open when the selected value changes.
- If
true, the dropdown remains open after selecting an option. - If
false, the dropdown closes when an option is selected. - If
null, defaults totrueif the select allows multiple selections, otherwisefalse.
-Placeholder text for the search input.
-A unique identifier used for testing purposes. If set to null, no test ID will be applied.
-Defines the visual style of the select component.
-Default styles
overflow-hidden flex items-center size-fullpx-sm group-data-icon-left/select:pl-2 group-data-icon-right/select:pr-2 flex items-center gap-xs size-fulltext-sm text-primary group-data-disabled/select:text-disabled px-3 group-data-icon-left/select:pl-2 group-data-icon-right/select:pr-2 w-full flex items-centeroutline-none min-w-(--reka-popover-trigger-width) overflow-auto p-xs max-h-80text-tertiary text-sm p-sm-text-tertiary text-sm font-medium py-xsshrink-0 size-4.5 ml-3 text-quaternary group-data-disabled/select:text-fg-disabledshrink-0 size-4.5 mr-3 text-quaternary group-data-disabled/select:text-fg-disabledoutline-none z-10 size-full text-sm text-primary bg-transparent px-3 group-data-icon-left/select:pl-2 group-data-icon-right/select:pr-2 disabled:cursor-not-allowedoutline-none w-full cursor-pointer data-disabled:cursor-not-allowed rounded-sm p-md not-last:mb-xxs flex items-center justify-between gap-x-md text-sm data-[state=checked]:font-medium text-secondary data-disabled:text-disabled data-[state=checked]:bg-secondary not-data-disabled:data-highlighted:bg-secondary-hover not-data-disabled:hover:bg-secondary-hover not-data-disabled:data-highlighted:data-[state=checked]:brightness-98size-4 text-secondarypointer-events-none shrink-0 mr-3 size-4 text-quaternarytext-placeholder text-smrelative group/select overflow-hidden flex items-center h-10 border border-solid border-primary focus-within:border-brand-500 data-disabled:border-disabled-subtle data-invalid:border-error data-invalid:focus-within:border-error bg-primary data-disabled:bg-disabled-subtle rounded-md shadow-xs outline outline-transparent focus-within:outline-brand-500 focus-within:data-invalid:outline-error-500 duration-200 data-disabled:cursor-not-allowed-h-px bg-quaternary my-xs