@thecb/components 4.0.22-beta.1 → 4.0.23
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
|
@@ -33517,33 +33517,17 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
33517
33517
|
|
|
33518
33518
|
var zipErrorMessages = (_zipErrorMessages = {}, _defineProperty(_zipErrorMessages, required.error, "Zip code is required"), _defineProperty(_zipErrorMessages, hasLength.error, "Zip code must be 5 or 9 digits"), _zipErrorMessages);
|
|
33519
33519
|
|
|
33520
|
-
var stateProvinceErrorMessages = _defineProperty({}, required.error, "State or Province is required");
|
|
33520
|
+
var stateProvinceErrorMessages = _defineProperty({}, required.error, "State or Province is required"); // const countryErrorMessages = {
|
|
33521
|
+
// [required.error]: "Country is required"
|
|
33522
|
+
// };
|
|
33521
33523
|
|
|
33522
|
-
var countryErrorMessages = _defineProperty({}, required.error, "Country is required");
|
|
33523
33524
|
|
|
33524
33525
|
var isUS = fields.country.rawValue === "US";
|
|
33525
33526
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
33526
33527
|
variant: variant,
|
|
33527
33528
|
role: "form",
|
|
33528
33529
|
"aria-label": "Address"
|
|
33529
|
-
}, /*#__PURE__*/React__default.createElement(FormInputColumn, null, /*#__PURE__*/React__default.createElement(
|
|
33530
|
-
labelTextWhenNoError: "Country",
|
|
33531
|
-
errorMessages: countryErrorMessages,
|
|
33532
|
-
field: fields.country,
|
|
33533
|
-
onChange: function onChange(value) {
|
|
33534
|
-
actions.fields.country.set(value); // temporary measure to not dirty fields until
|
|
33535
|
-
// we can write a reset function for fields
|
|
33536
|
-
|
|
33537
|
-
if (fields.stateProvince.rawValue) {
|
|
33538
|
-
actions.fields.stateProvince.set("");
|
|
33539
|
-
}
|
|
33540
|
-
|
|
33541
|
-
if (fields.zip.rawValue) {
|
|
33542
|
-
actions.fields.zip.set("");
|
|
33543
|
-
}
|
|
33544
|
-
},
|
|
33545
|
-
showErrors: showErrors
|
|
33546
|
-
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
33530
|
+
}, /*#__PURE__*/React__default.createElement(FormInputColumn, null, /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
33547
33531
|
labelTextWhenNoError: "Address",
|
|
33548
33532
|
errorMessages: street1ErrorMessages,
|
|
33549
33533
|
field: fields.street1,
|
|
@@ -33913,6 +33897,8 @@ var EditableList = function EditableList(_ref) {
|
|
|
33913
33897
|
title = _ref$title === void 0 ? "" : _ref$title,
|
|
33914
33898
|
_ref$titleWeight = _ref.titleWeight,
|
|
33915
33899
|
titleWeight = _ref$titleWeight === void 0 ? "400" : _ref$titleWeight,
|
|
33900
|
+
_ref$canAdd = _ref.canAdd,
|
|
33901
|
+
canAdd = _ref$canAdd === void 0 ? true : _ref$canAdd,
|
|
33916
33902
|
addItem = _ref.addItem,
|
|
33917
33903
|
removeItem = _ref.removeItem,
|
|
33918
33904
|
editItem = _ref.editItem,
|
|
@@ -33996,7 +33982,7 @@ var EditableList = function EditableList(_ref) {
|
|
|
33996
33982
|
},
|
|
33997
33983
|
extraStyles: "min-width: 0;"
|
|
33998
33984
|
}))));
|
|
33999
|
-
})), (!maxItems || items.length < maxItems) && /*#__PURE__*/React__default.createElement(Box, {
|
|
33985
|
+
})), canAdd && (!maxItems || items.length < maxItems) && /*#__PURE__*/React__default.createElement(Box, {
|
|
34000
33986
|
padding: items.length === 0 ? "0" : "1rem 0 0"
|
|
34001
33987
|
}, /*#__PURE__*/React__default.createElement(Placeholder$1, {
|
|
34002
33988
|
text: "Add a".concat(itemName[0].match(/[aieouAIEOU]/) ? "n" : "", " ").concat(itemName),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
import { required, hasLength } from "redux-freeform";
|
|
3
3
|
import StateProvinceDropdown from "../../atoms/state-province-dropdown";
|
|
4
|
-
import CountryDropdown from "../../atoms/country-dropdown";
|
|
4
|
+
// import CountryDropdown from "../../atoms/country-dropdown";
|
|
5
5
|
import { zipFormat } from "../../../util/formats";
|
|
6
6
|
import { noop } from "../../../util/general";
|
|
7
7
|
import {
|
|
@@ -35,16 +35,16 @@ const AddressForm = ({
|
|
|
35
35
|
const stateProvinceErrorMessages = {
|
|
36
36
|
[required.error]: "State or Province is required"
|
|
37
37
|
};
|
|
38
|
-
const countryErrorMessages = {
|
|
39
|
-
|
|
40
|
-
};
|
|
38
|
+
// const countryErrorMessages = {
|
|
39
|
+
// [required.error]: "Country is required"
|
|
40
|
+
// };
|
|
41
41
|
|
|
42
42
|
const isUS = fields.country.rawValue === "US";
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<FormContainer variant={variant} role="form" aria-label="Address">
|
|
46
46
|
<FormInputColumn>
|
|
47
|
-
<CountryDropdown
|
|
47
|
+
{/* <CountryDropdown
|
|
48
48
|
labelTextWhenNoError="Country"
|
|
49
49
|
errorMessages={countryErrorMessages}
|
|
50
50
|
field={fields.country}
|
|
@@ -60,7 +60,7 @@ const AddressForm = ({
|
|
|
60
60
|
}
|
|
61
61
|
}}
|
|
62
62
|
showErrors={showErrors}
|
|
63
|
-
/>
|
|
63
|
+
/> */}
|
|
64
64
|
<FormInput
|
|
65
65
|
labelTextWhenNoError="Address"
|
|
66
66
|
errorMessages={street1ErrorMessages}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
const EditableList = ({
|
|
19
19
|
title = "",
|
|
20
20
|
titleWeight = "400",
|
|
21
|
+
canAdd = true,
|
|
21
22
|
addItem,
|
|
22
23
|
removeItem,
|
|
23
24
|
editItem,
|
|
@@ -123,7 +124,7 @@ const EditableList = ({
|
|
|
123
124
|
);
|
|
124
125
|
})}
|
|
125
126
|
</Box>
|
|
126
|
-
{(!maxItems || items.length < maxItems) && (
|
|
127
|
+
{canAdd && (!maxItems || items.length < maxItems) && (
|
|
127
128
|
<Box padding={items.length === 0 ? "0" : "1rem 0 0"}>
|
|
128
129
|
<Placeholder
|
|
129
130
|
text={`Add a${
|