This NPM package is designed to work alongside the AddressFinder Widget to add autocomplete capability to your Ecommerce store or webpage.
It provides nine 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 selected -
EmailPageManager
, which identifies your email form, and handles the mapping of your email form configurations to the DOM. -
EmailFormManager
, which binds AddressfinderEmail to your form, and handles the validation of the email input field. -
PhonePageManager
, which identifies your phone form, and handles the mapping of your phone form configurations to the DOM. -
PhoneFormManager
, which binds AddressfinderPhone to your form, and handles the validation of the phone input field. -
ValidationPageManager
, A base class that the EmailPageManager and PhonePageManager extend from. -
ValidationFormManager
, A base class that the EmailFormManager and PhoneFormManager extend from. -
MutationManager
, which listens for mutations to the DOM, and reinitialises AddressFinder widgets on mutations
npm install @addressfinder/addressfinder-webpage-tools
import { PageManager, MutationManager, FormManager } from '@addressfinder/addressfinder-webpage-tools'
For more examples of usage, look in the examples folder.