{"_id":"@afrigis/vue-address-search","_rev":"4-5fc1e2d72e7ea815cc999e40b297c81a","name":"@afrigis/vue-address-search","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@afrigis/vue-address-search","version":"0.0.1","author":{"name":"CF Haasbroek","email":"cf@afrigis.co.za"},"_id":"@afrigis/vue-address-search@0.0.1","maintainers":[{"name":"cfhaasbroek","email":"cf@afrigis.co.za"},{"name":"sydneyag","email":"sydney@afrigis.co.za"}],"homepage":"http://afrigis.co.za/","dist":{"shasum":"620ddd38279582c208d6e898ad416417e84d24e9","tarball":"https://registry.npmjs.org/@afrigis/vue-address-search/-/vue-address-search-0.0.1.tgz","fileCount":11,"integrity":"sha512-NqhGHhnRedSFJS5qyTJiav/vlVfRTqL1hfS63m1SHxuNFezUo6KBAvBa00rbvQyx649nKmuV+X2ucSla+MQGng==","signatures":[{"sig":"MEYCIQDZ0wsF1V6p63/vluwD5NO/0yp+oKLF8JiEfgu1Op9dDAIhANa1YpK9RLOH9kNeAVzJ2dG5SjhZvnoUVHPkrYWKZmjR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35312},"main":"dist/VueAfrigisAddressSearch.umd.js","type":"module","unpkg":"dist/VueAfrigisAddressSearch.umd.js","module":"dist/VueAfrigisAddressSearch.es.js","exports":{".":{"import":"./dist/VueAfrigisAddressSearch.es.js","require":"./dist/VueAfrigisAddressSearch.umd.js"}},"gitHead":"a810c89952ea0c0ebc594edd422592f143984cf2","private":false,"scripts":{"lint":"eslint .","serve":"vite","test:ui":"vitest --ui","lint:fix":"eslint . --fix","build:npm":"vite build","test:unit":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"cfhaasbroek","email":"cf@afrigis.co.za"},"_npmVersion":"10.9.2","description":"The AfriGIS VueJs Address Search composable is aimed at creating accessible underlying logic and functionality to implement AfriGIS Search UI components without prescribing a specific visual style.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"vue":"^3.5.13","@afrigis/address-search":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","jsdom":"26.0.0","eslint":"^9.20.0","vitest":"3.0.4","prettier":"3.4.2","@eslint/js":"^9.20.0","@vitest/ui":"3.0.4","typescript":"^5.7.3","@types/node":"^22.13.1","@vue/test-utils":"2.4.1","vite-plugin-dts":"^4.5.0","typescript-eslint":"^8.23.0","@vitejs/plugin-vue":"^5.2.3","@vitest/coverage-v8":"3.0.4","vite-plugin-compression":"0.5.1","vite-plugin-require-transform":"1.0.21","vite-plugin-css-injected-by-js":"3.5.2"},"optionalDependencies":{"@rollup/rollup-linux-x64-musl":"^4.34.6"},"_npmOperationalInternal":{"tmp":"tmp/vue-address-search_0.0.1_1742980567077_0.5374857475289205","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@afrigis/vue-address-search","version":"0.0.2","author":{"name":"CF Haasbroek","email":"cf@afrigis.co.za"},"_id":"@afrigis/vue-address-search@0.0.2","maintainers":[{"name":"cfhaasbroek","email":"cf@afrigis.co.za"},{"name":"sydneyag","email":"sydney@afrigis.co.za"}],"homepage":"http://afrigis.co.za/","dist":{"shasum":"ab4566d8921e05cd1d4c3c7ffaac0841e5fe3f56","tarball":"https://registry.npmjs.org/@afrigis/vue-address-search/-/vue-address-search-0.0.2.tgz","fileCount":11,"integrity":"sha512-0NMd7R7bsqNPuFlm0ZWJZCWuWWBvuM48XkoHAmfqEI+k3w6k3nbkGd5jgZdCl+caJB6Ne4piencqeQ5y68/hFQ==","signatures":[{"sig":"MEYCIQDINwQMuvNY6sWM/yzvDZKGEUqrD9VxoQoT+qthRrgJiwIhAKpN/mYuD4NGiw6D7EsfWP/6jldkGZ5WgrDQTXnC1fV5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35314},"main":"dist/VueAfrigisAddressSearch.umd.js","type":"module","unpkg":"dist/VueAfrigisAddressSearch.umd.js","module":"dist/VueAfrigisAddressSearch.es.js","exports":{".":{"import":"./dist/VueAfrigisAddressSearch.es.js","require":"./dist/VueAfrigisAddressSearch.umd.js"}},"gitHead":"dd5820f2ba46012b3469948886ca9ac84d9f8e38","private":false,"scripts":{"lint":"eslint .","serve":"vite","test:ui":"vitest --ui","lint:fix":"eslint . --fix","build:npm":"vite build","test:unit":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"cfhaasbroek","email":"cf@afrigis.co.za"},"_npmVersion":"10.9.2","description":"The AfriGIS VueJs Address Search composable is aimed at creating accessible underlying logic and functionality to implement AfriGIS Search UI components without prescribing a specific visual style.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"vue":"^3.5.13","@afrigis/address-search":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","jsdom":"26.0.0","eslint":"^9.20.0","vitest":"^3.0.9","prettier":"3.4.2","@eslint/js":"^9.20.0","@vitest/ui":"^3.0.9","typescript":"^5.7.3","@types/node":"^22.13.1","@vue/test-utils":"2.4.1","vite-plugin-dts":"^4.5.0","typescript-eslint":"^8.23.0","@vitejs/plugin-vue":"^5.2.3","@vitest/coverage-v8":"^3.0.9","vite-plugin-compression":"0.5.1","vite-plugin-require-transform":"1.0.21","vite-plugin-css-injected-by-js":"3.5.2"},"optionalDependencies":{"@rollup/rollup-linux-x64-musl":"^4.34.6"},"_npmOperationalInternal":{"tmp":"tmp/vue-address-search_0.0.2_1742981511742_0.378101723283202","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-03-26T09:16:07.020Z","modified":"2026-03-26T13:28:31.937Z","0.0.1":"2025-03-26T09:16:07.303Z","0.0.2":"2025-03-26T09:31:51.944Z"},"author":{"name":"CF Haasbroek","email":"cf@afrigis.co.za"},"homepage":"http://afrigis.co.za/","description":"The AfriGIS VueJs Address Search composable is aimed at creating accessible underlying logic and functionality to implement AfriGIS Search UI components without prescribing a specific visual style.","maintainers":[{"email":"cf@afrigis.co.za","name":"cfhaasbroek"},{"email":"pieterv@afrigis.co.za","name":"pietercachet"},{"email":"sydney@afrigis.co.za","name":"sydneyag"},{"email":"mmohiahmed@gmail.com","name":"mmohiahmed"}],"readme":"# AfriGIS VueJs Address Search\n\nThe AfriGIS VueJs Address Search composable is aimed at creating accessible underlying logic and functionality to implement AfriGIS Search UI components without prescribing a specific visual style.\n\n## Quick features\n\n### Configure Debounce rate\nThe debounce rate is the time, measured in milliseconds, to wait after initial input before registering any subsequent inputs. The default setting is 350ms.\n\n### Configure Minimum characters for suggestions\nSpecify the minimum number of characters of input required before address suggestions are returned. The default is 3 characters.\n\n### Configure Max Results for suggestions\nSpecify the maximum  number of address suggestions to return in the results. The default value is 5, but values of between 1 and 20 are accepted.\n\n### Configure Include Types for autocomplete and address search\nSpecify an array of string for the address types to include in the suggestions for [Autocomplete API]( https://developers.afrigis.co.za/portfolio/autocomplete/) and [Geocode API]( https://developers.afrigis.co.za/portfolio/search/) (address search). Refer to [Address types]( https://developers.afrigis.co.za/address-types/) for more details.\n\n### Configure Exclude Types for autocomplete\nDefine which address types to include in the suggestions for Autocomplete API, using an array of strings.  Refer to [Address types]( https://developers.afrigis.co.za/address-types/) for more details.\n\n### Configure Payload Format for Selected Addresses\nAfriGIS provides detailed address information using the [Place Details API]( https://developers.afrigis.co.za/portfolio/place-details/) by structuring the results by address type. Alternatively, the results can be returned in a structure suitable for deliveries by using the [Delivery Address Format API](https://developers.afrigis.co.za/portfolio/delivery-address-format/)\n\n## Running Examples\n\n* Clone the repo\n* Run NPM Install\n* Run Development Server\n```bash\nnpm run serve\n```\n\n## Initialisation\n\n```\nconst inputText = ref('');\nconst apiKey = ref('YOUR_API_KEY');\n\nconst {\n  clear,\n  isSelected,\n  suggestions,\n  search,\n  selectedAddress,\n  selectSuggestion,\n  setAddressComponentsFormat,\n  setApiKey,\n  setExcludeTypes,\n  setIncludeTypes,\n  setMaxResults,\n  setJwtToken,\n} = useAfrigisAddressSearch(\n  inputText,\n  {\n    apiKey: apiKey.value,\n    // Further options are optional\n  },\n);\n```\n\nInitialisation takes a ref for input text and an options object as input.\n\nAn explanation of the properties follows:\n\n```\nexport interface IAfrigisVueAddressSearchOptions {\n  // API key for authentication.\n  // Required\n  apiKey: string;                                    \n\n  // Default is \"https://afrigis.services\"                                      \n  baseUrl?: string;\n\n  // Minimum characters required before suggestions engine kick in. Default is 3 characters                                                                           \n  minChars?: number;                                                                            \n\n  // Debounce rate in milliseconds, default is 350ms\n  debounceMs?: number;                              \n\n  // Maximum amount of suggestions to return, a value between 1 and 20, default is 5                                            \n  maxResults?: number;\n\n  // Array of strings to specify which types to include in suggestions, refer to https://developers.afrigis.co.za/oas3/autocomplete-api/api/v3/autocomplete\n  includeTypes?: string[]; // array of strings\n\n  // Array of strings to specify which types to exclude in suggestions, refer to https://developers.afrigis.co.za/oas3/autocomplete-api/api/v3/autocomplete\n  excludeTypes?: string[]; // array of strings\n\n  // Specifies which format to return the selected Address Payload in. Default is 'details'\n  addressComponentsFormat?: 'details' | 'delivery';\n\n  // JWT token for authentication\n  jwtToken?: string;\n}\n```\n\n## Composable Instance computed Properties\n\n### isSelected\nIndicator used to show if a suggestion has been selected. Is set to true before the selected address payload\nis retrieved.\n\n### suggestions\nArray, with a list of suggestions for an input, elements implement IAfriGISAddressSearchSuggestion.\n\n### selectedAddress\nObject, containing the payload of a selected Address. Format depends on the addressComponentsFormat that was set.\n\n\n## Composable Instance functions\n\n### clear()\n\nResets the selected Address and the suggestions\n\n\n### inputChanged(input: string)\n\nFires off the call to retrieve autocomplete suggestions\n\n\n### search(query: string)\n\nFires off the call to retrieve address search suggestions (a backup to autocomplete)\n\n### selectSuggestion(reference:string)\n\nFires off the call to retrieve the Address Information for a specific address reference\n\n### setApiKey(apiKey: string)\n\nSets the API key (useful in a multi-tenant situation)\n\n### setAddressComponentsFormat(format: 'details' | 'delivery')\n\nSets the Address Information Format for selected Addresses\n\n### setToken(token: string)\n\nSets the JWT token. Necessary for long-running frontends as the JWT token expires in 60 minutes.\n\n### setIncludeTypes(values: string[])\n\nSets the Include Types to limit suggestions to specific address types.\n\n### setExcludeTypes(values: string[])\n\nSets the Exclude Types to exclude specific address types from suggestions.\n\n","readmeFilename":"README.md"}