woocommerce/plugins/woocommerce-blocks/assets/js/base/components/country-input/CountryInputProps.ts

28 lines
807 B
TypeScript
Raw Normal View History

/**
* Internal dependencies
*/
import { ComboboxProps } from '../combobox';
import { countries } from './stories/countries-filler';
export interface CountryInputProps extends Omit< ComboboxProps, 'options' > {
/**
* Classes to assign to the wrapper component of the input
*/
className?: string;
/**
* Whether input elements can by default have their values automatically completed by the browser.
*
* This value gets assigned to both the wrapper `Combobox` and the wrapped input element.
*/
Block-based checkout - Update address fields display logic (#47160) * Add “Address line 2” toggle * Allow apartment field to be required * Add changefile(s) from automation for the following project(s): woocommerce-blocks * Rename “Apartment, suite, etc.” to “Address line 2” * Remove unused dependency * Add key to fragment * Simplify keys * Address failing e2e tests * Change “Optional (Recommended)” to “Optional” * Toggle address line 2 visibility in editor * Add e2e tests * Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce * Update e2e tests * Update e2e tests * Ensure the address 2 field stays open when the seller empties it * Optimise hasAddress2FieldValue * Move address 2 filed related functionality into separate component * Rmove + sign from address 2 field links * WIP: Introduce AddressField component * Update AddressFields component * Refactor AddressFields and Address2Field components * Fix CSS lint error * Fix JS lint error * Fix failing e2e tests * Fix typo in e2e tests * Improve e2e selector * Fix core e2e tests * Use address line 2 label for the link text * Lazy initialise the “isFieldVisible” state * Remove obsolete code * Add inline comments for clarity * Fix JS lint error * Improve e2e tests * Revert "Remove obsolete code" This reverts commit 027d6adc896e153b68d306b49e0fb793752cb8a0. * Adjust visibility toggle * Delete obsolete changelog file * Add inline comment * Fix TS error * Remove obsolete parts * Solve TS warning * Remove obsolete “fieldsRef” * Remove obsolete “setHasFieldBeenModified” * Address various TS warnings * Fix link styling issue on mobile * Fix JS lint error * Refactor and simplify address components * Optimise Address2Field component * Improve inline docs * Move ‘+’ from CSS to i18n * Rename rest of values and pass correct onChange * force component to remount * remove unsed useEffect --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2024-05-21 08:48:24 +00:00
autoComplete?: string | undefined;
}
export interface CountryInputWithCountriesProps extends CountryInputProps {
/**
* List of countries to allow in the selection
*
* Object shape should be: `{ [Alpha-2 Country Code]: 'Full country name' }`
*/
countries: Partial< typeof countries >;
}