@mountainpass/addressr-vue 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -171,6 +171,28 @@ Implements the WAI-ARIA combobox pattern:
|
|
|
171
171
|
- Accessible label always present
|
|
172
172
|
- Infinite scroll with loading indicator
|
|
173
173
|
|
|
174
|
+
## Postcode, Locality, and State search
|
|
175
|
+
|
|
176
|
+
For narrower lookups (postcode-only picker on a shipping form, suburb autocomplete, state dropdown) the package also exports three drop-in components and matching headless composables. Each mirrors `AddressAutocomplete`'s a11y, keyboard, and slot contract; the only difference is the `select` event payload is the `SearchResult` itself (no follow-up detail fetch — see ADR 006).
|
|
177
|
+
|
|
178
|
+
```vue
|
|
179
|
+
<script setup>
|
|
180
|
+
import {
|
|
181
|
+
PostcodeAutocomplete,
|
|
182
|
+
LocalityAutocomplete,
|
|
183
|
+
StateAutocomplete,
|
|
184
|
+
} from '@mountainpass/addressr-vue';
|
|
185
|
+
</script>
|
|
186
|
+
|
|
187
|
+
<template>
|
|
188
|
+
<PostcodeAutocomplete api-key="..." @select="(r) => console.log(r.postcode, r.localities)" />
|
|
189
|
+
<LocalityAutocomplete api-key="..." @select="(r) => console.log(r.name, r.state.abbreviation, r.postcode)" />
|
|
190
|
+
<StateAutocomplete api-key="..." @select="(r) => console.log(r.name, r.abbreviation)" />
|
|
191
|
+
</template>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Headless equivalents `usePostcodeSearch`, `useLocalitySearch`, `useStateSearch` are also exported and follow the same shape as `useAddressSearch`.
|
|
195
|
+
|
|
174
196
|
## Re-exports
|
|
175
197
|
|
|
176
198
|
This package re-exports everything from [`@mountainpass/addressr-core`](../core) for convenience -- `createAddressrClient`, `parseHighlight`, and all types.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mountainpass/addressr-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Vue address autocomplete component for Australian address search via Addressr",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mountain Pass",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@windyroad/link-header": "^1.0.1",
|
|
36
|
-
"@mountainpass/addressr-core": "0.
|
|
36
|
+
"@mountainpass/addressr-core": "0.7.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@testing-library/jest-dom": "^6.6.3",
|