@thecb/components 4.1.8-beta.1 → 4.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js
CHANGED
|
@@ -34218,33 +34218,17 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
34218
34218
|
|
|
34219
34219
|
var zipErrorMessages = (_zipErrorMessages = {}, _defineProperty(_zipErrorMessages, required.error, "Zip code is required"), _defineProperty(_zipErrorMessages, hasLength.error, "Zip code must be 5 or 9 digits"), _zipErrorMessages);
|
|
34220
34220
|
|
|
34221
|
-
var stateProvinceErrorMessages = _defineProperty({}, required.error, "State or Province is required");
|
|
34221
|
+
var stateProvinceErrorMessages = _defineProperty({}, required.error, "State or Province is required"); // const countryErrorMessages = {
|
|
34222
|
+
// [required.error]: "Country is required"
|
|
34223
|
+
// };
|
|
34222
34224
|
|
|
34223
|
-
var countryErrorMessages = _defineProperty({}, required.error, "Country is required");
|
|
34224
34225
|
|
|
34225
34226
|
var isUS = fields.country.rawValue === "US";
|
|
34226
34227
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
34227
34228
|
variant: variant,
|
|
34228
34229
|
role: "form",
|
|
34229
34230
|
"aria-label": "Address"
|
|
34230
|
-
}, /*#__PURE__*/React__default.createElement(FormInputColumn, null, /*#__PURE__*/React__default.createElement(
|
|
34231
|
-
labelTextWhenNoError: "Country",
|
|
34232
|
-
errorMessages: countryErrorMessages,
|
|
34233
|
-
field: fields.country,
|
|
34234
|
-
onChange: function onChange(value) {
|
|
34235
|
-
actions.fields.country.set(value); // temporary measure to not dirty fields until
|
|
34236
|
-
// we can write a reset function for fields
|
|
34237
|
-
|
|
34238
|
-
if (fields.stateProvince.rawValue) {
|
|
34239
|
-
actions.fields.stateProvince.set("");
|
|
34240
|
-
}
|
|
34241
|
-
|
|
34242
|
-
if (fields.zip.rawValue) {
|
|
34243
|
-
actions.fields.zip.set("");
|
|
34244
|
-
}
|
|
34245
|
-
},
|
|
34246
|
-
showErrors: showErrors
|
|
34247
|
-
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
34231
|
+
}, /*#__PURE__*/React__default.createElement(FormInputColumn, null, /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
34248
34232
|
labelTextWhenNoError: "Address",
|
|
34249
34233
|
errorMessages: street1ErrorMessages,
|
|
34250
34234
|
field: fields.street1,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { required, hasLength } from "redux-freeform";
|
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import StateProvinceDropdown from "../../atoms/state-province-dropdown";
|
|
5
5
|
import Checkbox from "../../atoms/checkbox";
|
|
6
|
-
import CountryDropdown from "../../atoms/country-dropdown";
|
|
6
|
+
// import CountryDropdown from "../../atoms/country-dropdown";
|
|
7
7
|
import { zipFormat } from "../../../util/formats";
|
|
8
8
|
import { noop } from "../../../util/general";
|
|
9
9
|
import {
|
|
@@ -51,16 +51,16 @@ const AddressForm = ({
|
|
|
51
51
|
const stateProvinceErrorMessages = {
|
|
52
52
|
[required.error]: "State or Province is required"
|
|
53
53
|
};
|
|
54
|
-
const countryErrorMessages = {
|
|
55
|
-
|
|
56
|
-
};
|
|
54
|
+
// const countryErrorMessages = {
|
|
55
|
+
// [required.error]: "Country is required"
|
|
56
|
+
// };
|
|
57
57
|
|
|
58
58
|
const isUS = fields.country.rawValue === "US";
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<FormContainer variant={variant} role="form" aria-label="Address">
|
|
62
62
|
<FormInputColumn>
|
|
63
|
-
<CountryDropdown
|
|
63
|
+
{/* <CountryDropdown
|
|
64
64
|
labelTextWhenNoError="Country"
|
|
65
65
|
errorMessages={countryErrorMessages}
|
|
66
66
|
field={fields.country}
|
|
@@ -76,7 +76,7 @@ const AddressForm = ({
|
|
|
76
76
|
}
|
|
77
77
|
}}
|
|
78
78
|
showErrors={showErrors}
|
|
79
|
-
/>
|
|
79
|
+
/> */}
|
|
80
80
|
<FormInput
|
|
81
81
|
labelTextWhenNoError="Address"
|
|
82
82
|
errorMessages={street1ErrorMessages}
|