hmcsl api reference
HTML/JS
document
listener: hmcsl_countrySelectorOutsideListener
is responsible of closing the country selector on click outside of component
tag country-selector
listener: hmcsl_insideClickListener
is responsible of action of click inside compoenent
boolean: isOpen
indicate if the country selector is open
function: close
close the country selector
function open
open the country select
string: value
indicates the current value of the countrySelector
dispatched_events:
input
change
tag country
listener: hmcsl_clickListener
is responsible for selecting a country in a list
PHP
hmcsl_get_countries() :array
returns a map of country_items, present in the countries directory: details, index by country name in english
[
‘Albania’=>
[‘languages’=>
[
0 => [
‘language’=>’sq’,
‘english_name=>‘Albanian’,
’native_name’=>’Shqip'
]
]
"country_name" => 'Albania',
"country_name_de" => ‘Albanien’,
"country_name_fr" => 'Albanie’,
"country_name_it" => ‘Albania’,
"country_name_pt" => ‘Albânia’,
"country_name_es" => ‘Albania'
]
...
]
string $initial_value if we want to select a specified country in the list, must be the country name in english and in lowercase
hmcsl_get_country_selector($initial_value = null) : string
returns the formatted html element
hmcsl_country_selector($initial_value = null)
print the component on the page