@addressfinder/addressfinder-webpage-tools
v2.0.0
Published
Tools to assist with the use of Addressfinder on a webpage
Downloads
128
Maintainers
Readme
AddressFinder Webpage Tools
This NPM package is designed to work alongside the AddressFinder Widget to add autocomplete capability to your Ecommerce store or webpage.
It provides three classes:
PageManager
, which identifies your address form, and handles the mapping of your address form configurations to the DOM.FormManager
, which binds AddressFinder to your form, and handles the population of the correct address fields when an address is selectedMutationManager
, which listens for mutations to the DOM, and reinitialises AddressFinder on mutations
Installation
npm install @addressfinder/addressfinder-webpage-tools
Usage
import { PageManager, MutationManager, FormManager } from '@addressfinder/addressfinder-webpage-tools'
For more examples of usage, look in the examples folder.