@thecb/components 4.3.10 → 4.3.13
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
|
@@ -15886,10 +15886,19 @@ function _assertThisInitialized(self) {
|
|
|
15886
15886
|
return self;
|
|
15887
15887
|
}
|
|
15888
15888
|
|
|
15889
|
+
function _setPrototypeOf(o, p) {
|
|
15890
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
15891
|
+
o.__proto__ = p;
|
|
15892
|
+
return o;
|
|
15893
|
+
};
|
|
15894
|
+
|
|
15895
|
+
return _setPrototypeOf(o, p);
|
|
15896
|
+
}
|
|
15897
|
+
|
|
15889
15898
|
function _inheritsLoose(subClass, superClass) {
|
|
15890
15899
|
subClass.prototype = Object.create(superClass.prototype);
|
|
15891
15900
|
subClass.prototype.constructor = subClass;
|
|
15892
|
-
subClass
|
|
15901
|
+
_setPrototypeOf(subClass, superClass);
|
|
15893
15902
|
}
|
|
15894
15903
|
|
|
15895
15904
|
function _getPrototypeOf(o) {
|
|
@@ -15899,15 +15908,6 @@ function _getPrototypeOf(o) {
|
|
|
15899
15908
|
return _getPrototypeOf(o);
|
|
15900
15909
|
}
|
|
15901
15910
|
|
|
15902
|
-
function _setPrototypeOf(o, p) {
|
|
15903
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
15904
|
-
o.__proto__ = p;
|
|
15905
|
-
return o;
|
|
15906
|
-
};
|
|
15907
|
-
|
|
15908
|
-
return _setPrototypeOf(o, p);
|
|
15909
|
-
}
|
|
15910
|
-
|
|
15911
15911
|
function _isNativeFunction(fn) {
|
|
15912
15912
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
15913
15913
|
}
|
|
@@ -15918,7 +15918,7 @@ function _isNativeReflectConstruct() {
|
|
|
15918
15918
|
if (typeof Proxy === "function") return true;
|
|
15919
15919
|
|
|
15920
15920
|
try {
|
|
15921
|
-
|
|
15921
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
15922
15922
|
return true;
|
|
15923
15923
|
} catch (e) {
|
|
15924
15924
|
return false;
|
|
@@ -16058,7 +16058,9 @@ var ERRORS = {
|
|
|
16058
16058
|
"73": "Please provide a valid CSS variable.\n\n",
|
|
16059
16059
|
"74": "CSS variable not found and no default was provided.\n\n",
|
|
16060
16060
|
"75": "important requires a valid style object, got a %s instead.\n\n",
|
|
16061
|
-
"76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"
|
|
16061
|
+
"76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
|
|
16062
|
+
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
16063
|
+
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
16062
16064
|
};
|
|
16063
16065
|
/**
|
|
16064
16066
|
* super basic version of sprintf
|
|
@@ -22464,13 +22466,15 @@ var SearchableSelect = function SearchableSelect(_ref) {
|
|
|
22464
22466
|
padding: "0.5rem 0",
|
|
22465
22467
|
extraStyles: "overflow-y: scroll; height: 250px;"
|
|
22466
22468
|
}, /*#__PURE__*/React__default.createElement(Stack, null, itemList.map(function (value) {
|
|
22469
|
+
var _selectedItems$find;
|
|
22470
|
+
|
|
22467
22471
|
return /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
22468
22472
|
key: value.name,
|
|
22469
22473
|
title: value.name,
|
|
22470
22474
|
name: value.name,
|
|
22471
|
-
checked: selectedItems.find(function (item) {
|
|
22472
|
-
return item.name === value.name;
|
|
22473
|
-
}),
|
|
22475
|
+
checked: (_selectedItems$find = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.find(function (item) {
|
|
22476
|
+
return (item === null || item === void 0 ? void 0 : item.name) === (value === null || value === void 0 ? void 0 : value.name);
|
|
22477
|
+
})) !== null && _selectedItems$find !== void 0 ? _selectedItems$find : false,
|
|
22474
22478
|
onChange: function onChange() {
|
|
22475
22479
|
return handleSelect(value);
|
|
22476
22480
|
},
|
|
@@ -37408,6 +37412,7 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
|
|
|
37408
37412
|
selectAgency = _ref.selectAgency,
|
|
37409
37413
|
roleOptions = _ref.roleOptions,
|
|
37410
37414
|
clientOptions = _ref.clientOptions,
|
|
37415
|
+
namesDisabled = _ref.namesDisabled,
|
|
37411
37416
|
emailDisabled = _ref.emailDisabled,
|
|
37412
37417
|
roleDisabled = _ref.roleDisabled,
|
|
37413
37418
|
selectionDisabled = _ref.selectionDisabled,
|
|
@@ -37441,7 +37446,7 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
|
|
|
37441
37446
|
|
|
37442
37447
|
var lastNameErrorMessages = _defineProperty({}, required.error, "Last name is required");
|
|
37443
37448
|
|
|
37444
|
-
var emailErrorMessages = _defineProperty({},
|
|
37449
|
+
var emailErrorMessages = _defineProperty({}, isProbablyEmail.error, "Invalid email address");
|
|
37445
37450
|
|
|
37446
37451
|
var roleErrorMessages = _defineProperty({}, required.error, "Role is required");
|
|
37447
37452
|
|
|
@@ -37508,7 +37513,8 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
|
|
|
37508
37513
|
showErrors: showErrors,
|
|
37509
37514
|
onKeyDown: function onKeyDown(e) {
|
|
37510
37515
|
return e.key === "Enter" && handleSubmit(e);
|
|
37511
|
-
}
|
|
37516
|
+
},
|
|
37517
|
+
disabled: namesDisabled
|
|
37512
37518
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
37513
37519
|
labelTextWhenNoError: "Last Name",
|
|
37514
37520
|
errorMessages: lastNameErrorMessages,
|
|
@@ -37517,7 +37523,8 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
|
|
|
37517
37523
|
showErrors: showErrors,
|
|
37518
37524
|
onKeyDown: function onKeyDown(e) {
|
|
37519
37525
|
return e.key === "Enter" && handleSubmit(e);
|
|
37520
|
-
}
|
|
37526
|
+
},
|
|
37527
|
+
disabled: namesDisabled
|
|
37521
37528
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
37522
37529
|
labelTextWhenNoError: "Email",
|
|
37523
37530
|
errorMessages: emailErrorMessages,
|
|
@@ -40356,11 +40363,14 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
40356
40363
|
showErrors = _ref.showErrors,
|
|
40357
40364
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
40358
40365
|
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
40359
|
-
isMobile = _ref.isMobile,
|
|
40360
40366
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
40361
40367
|
saveToWallet = _ref.saveToWallet,
|
|
40362
40368
|
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
40363
40369
|
deniedCards = _ref.deniedCards;
|
|
40370
|
+
|
|
40371
|
+
var _useContext = React.useContext(styled.ThemeContext),
|
|
40372
|
+
isMobile = _useContext.isMobile;
|
|
40373
|
+
|
|
40364
40374
|
React.useEffect(function () {
|
|
40365
40375
|
if (deniedCards) {
|
|
40366
40376
|
deniedCards.map(function (card) {
|
|
@@ -40424,7 +40434,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
40424
40434
|
},
|
|
40425
40435
|
isNum: true
|
|
40426
40436
|
}), /*#__PURE__*/React__default.createElement(FormInputRow, {
|
|
40427
|
-
breakpoint: "
|
|
40437
|
+
breakpoint: isMobile ? "1000rem" : "21rem",
|
|
40438
|
+
childGap: isMobile ? "0rem" : "1rem"
|
|
40428
40439
|
}, /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
40429
40440
|
labelTextWhenNoError: "Expiration date (MM/YY)",
|
|
40430
40441
|
errorMessages: expirationDateErrors,
|
|
@@ -40469,6 +40480,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
40469
40480
|
})));
|
|
40470
40481
|
};
|
|
40471
40482
|
|
|
40483
|
+
var PaymentFormCard$1 = withWindowSize(PaymentFormCard);
|
|
40484
|
+
|
|
40472
40485
|
var formConfig$8 = {
|
|
40473
40486
|
country: {
|
|
40474
40487
|
defaultValue: "US",
|
|
@@ -40500,9 +40513,9 @@ var _createFormState$8 = createFormState(formConfig$8),
|
|
|
40500
40513
|
mapStateToProps$9 = _createFormState$8.mapStateToProps,
|
|
40501
40514
|
mapDispatchToProps$8 = _createFormState$8.mapDispatchToProps;
|
|
40502
40515
|
|
|
40503
|
-
PaymentFormCard.reducer = reducer$8;
|
|
40504
|
-
PaymentFormCard.mapStateToProps = mapStateToProps$9;
|
|
40505
|
-
PaymentFormCard.mapDispatchToProps = mapDispatchToProps$8;
|
|
40516
|
+
PaymentFormCard$1.reducer = reducer$8;
|
|
40517
|
+
PaymentFormCard$1.mapStateToProps = mapStateToProps$9;
|
|
40518
|
+
PaymentFormCard$1.mapDispatchToProps = mapDispatchToProps$8;
|
|
40506
40519
|
|
|
40507
40520
|
var PhoneForm = function PhoneForm(_ref) {
|
|
40508
40521
|
var _phoneErrorMessage;
|
|
@@ -41862,7 +41875,7 @@ exports.PasswordRequirements = PasswordRequirements;
|
|
|
41862
41875
|
exports.PaymentButtonBar = PaymentButtonBar;
|
|
41863
41876
|
exports.PaymentDetails = PaymentDetails$1;
|
|
41864
41877
|
exports.PaymentFormACH = PaymentFormACH;
|
|
41865
|
-
exports.PaymentFormCard = PaymentFormCard;
|
|
41878
|
+
exports.PaymentFormCard = PaymentFormCard$1;
|
|
41866
41879
|
exports.PaymentIcon = PaymentIcon;
|
|
41867
41880
|
exports.PaymentMethodAddIcon = PaymentMethodAddIcon$1;
|
|
41868
41881
|
exports.PaymentMethodIcon = PaymentMethodIcon$1;
|
package/package.json
CHANGED
|
@@ -63,7 +63,10 @@ const SearchableSelect = ({
|
|
|
63
63
|
key={value.name}
|
|
64
64
|
title={value.name}
|
|
65
65
|
name={value.name}
|
|
66
|
-
checked={
|
|
66
|
+
checked={
|
|
67
|
+
selectedItems?.find(item => item?.name === value?.name) ??
|
|
68
|
+
false
|
|
69
|
+
}
|
|
67
70
|
onChange={() => handleSelect(value)}
|
|
68
71
|
textExtraStyles={`margin: 0;`}
|
|
69
72
|
disabled={disabled}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
|
-
import { required } from "redux-freeform";
|
|
2
|
+
import { required, isProbablyEmail } from "redux-freeform";
|
|
3
3
|
import { Stack, Box, Cluster } from "../../atoms/layouts";
|
|
4
4
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
5
5
|
import Heading from "../../atoms/heading";
|
|
@@ -47,6 +47,7 @@ const InternalUserInfoForm = ({
|
|
|
47
47
|
selectAgency,
|
|
48
48
|
roleOptions,
|
|
49
49
|
clientOptions,
|
|
50
|
+
namesDisabled,
|
|
50
51
|
emailDisabled,
|
|
51
52
|
roleDisabled,
|
|
52
53
|
selectionDisabled,
|
|
@@ -78,7 +79,7 @@ const InternalUserInfoForm = ({
|
|
|
78
79
|
[required.error]: "Last name is required"
|
|
79
80
|
};
|
|
80
81
|
const emailErrorMessages = {
|
|
81
|
-
[
|
|
82
|
+
[isProbablyEmail.error]: "Invalid email address"
|
|
82
83
|
};
|
|
83
84
|
const roleErrorMessages = {
|
|
84
85
|
[required.error]: "Role is required"
|
|
@@ -151,6 +152,7 @@ const InternalUserInfoForm = ({
|
|
|
151
152
|
fieldActions={actions.fields.firstName}
|
|
152
153
|
showErrors={showErrors}
|
|
153
154
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
155
|
+
disabled={namesDisabled}
|
|
154
156
|
/>
|
|
155
157
|
<FormInput
|
|
156
158
|
labelTextWhenNoError="Last Name"
|
|
@@ -159,6 +161,7 @@ const InternalUserInfoForm = ({
|
|
|
159
161
|
fieldActions={actions.fields.lastName}
|
|
160
162
|
showErrors={showErrors}
|
|
161
163
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
164
|
+
disabled={namesDisabled}
|
|
162
165
|
/>
|
|
163
166
|
<FormInput
|
|
164
167
|
labelTextWhenNoError="Email"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
1
|
+
import React, { useEffect, useContext } from "react";
|
|
2
|
+
import { ThemeContext } from "styled-components";
|
|
2
3
|
import { required, hasLength, matchesRegex } from "redux-freeform";
|
|
3
4
|
import Checkbox from "../../atoms/checkbox";
|
|
4
5
|
import CountryDropdown from "../../atoms/country-dropdown";
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
FormInputRow
|
|
21
22
|
} from "../../atoms/form-layouts";
|
|
22
23
|
import { Box } from "../../atoms/layouts";
|
|
24
|
+
import withWindowSize from "../../withWindowSize";
|
|
23
25
|
|
|
24
26
|
const PaymentFormCard = ({
|
|
25
27
|
variant = "default",
|
|
@@ -29,12 +31,12 @@ const PaymentFormCard = ({
|
|
|
29
31
|
actions,
|
|
30
32
|
showErrors,
|
|
31
33
|
handleSubmit = noop,
|
|
32
|
-
isMobile,
|
|
33
34
|
showWalletCheckbox,
|
|
34
35
|
saveToWallet,
|
|
35
36
|
walletCheckboxMarked,
|
|
36
37
|
deniedCards
|
|
37
38
|
}) => {
|
|
39
|
+
const { isMobile } = useContext(ThemeContext);
|
|
38
40
|
useEffect(() => {
|
|
39
41
|
if (deniedCards) {
|
|
40
42
|
deniedCards.map(card =>
|
|
@@ -116,7 +118,10 @@ const PaymentFormCard = ({
|
|
|
116
118
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
117
119
|
isNum
|
|
118
120
|
/>
|
|
119
|
-
<FormInputRow
|
|
121
|
+
<FormInputRow
|
|
122
|
+
breakpoint={isMobile ? "1000rem" : "21rem"}
|
|
123
|
+
childGap={isMobile ? "0rem" : "1rem"}
|
|
124
|
+
>
|
|
120
125
|
<FormInput
|
|
121
126
|
labelTextWhenNoError="Expiration date (MM/YY)"
|
|
122
127
|
errorMessages={expirationDateErrors}
|
|
@@ -172,4 +177,4 @@ const PaymentFormCard = ({
|
|
|
172
177
|
);
|
|
173
178
|
};
|
|
174
179
|
|
|
175
|
-
export default PaymentFormCard;
|
|
180
|
+
export default withWindowSize(PaymentFormCard);
|