@thecb/components 10.4.0-beta.10 → 10.4.0-beta.12

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
@@ -46745,8 +46745,8 @@ var AutopayModal = function AutopayModal(_ref) {
46745
46745
  allowedPaymentInstruments = _ref.allowedPaymentInstruments,
46746
46746
  _ref$disableActions = _ref.disableActions,
46747
46747
  disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions,
46748
- _action = _ref.action,
46749
- _onClick = _ref.onClick,
46748
+ action = _ref.action,
46749
+ onClick = _ref.onClick,
46750
46750
  onKeyPress = _ref.onKeyPress;
46751
46751
  var generateMethodNeededText = function generateMethodNeededText(planText, allowedPaymentInstruments) {
46752
46752
  var allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
@@ -46778,8 +46778,8 @@ var AutopayModal = function AutopayModal(_ref) {
46778
46778
  return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46779
46779
  text: autoPayActive ? "Turn off ".concat(shortPlan) : "Set Up ".concat(shortPlan),
46780
46780
  variant: "secondary",
46781
- action: function action() {
46782
- _action || toggleModal(true);
46781
+ action: action || function () {
46782
+ return toggleModal(true);
46783
46783
  },
46784
46784
  dataQa: "Turn off Autopay",
46785
46785
  extraStyles: isMobile ? "flex-grow: 1; width: 100%; margin: 0;" : "flex-grow: 1; min-width: 165px;",
@@ -46791,8 +46791,8 @@ var AutopayModal = function AutopayModal(_ref) {
46791
46791
  return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46792
46792
  text: autoPayActive ? "Manage ".concat(shortPlan) : "Set Up ".concat(shortPlan),
46793
46793
  variant: "tertiary",
46794
- action: function action() {
46795
- _action || toggleModal(true);
46794
+ action: action || function () {
46795
+ return toggleModal(true);
46796
46796
  },
46797
46797
  dataQa: "Manage Autopay",
46798
46798
  extraStyles: isMobile && "flex-grow: 1; width: 100%;",
@@ -46803,8 +46803,8 @@ var AutopayModal = function AutopayModal(_ref) {
46803
46803
  {
46804
46804
  return /*#__PURE__*/React__default.createElement(Box, {
46805
46805
  padding: "0",
46806
- onClick: function onClick() {
46807
- _onClick || toggleModal(true);
46806
+ onClick: onClick || function () {
46807
+ toggleModal(true);
46808
46808
  },
46809
46809
  hoverStyles: hoverStyles,
46810
46810
  activeStyles: activeStyles,
@@ -46814,8 +46814,8 @@ var AutopayModal = function AutopayModal(_ref) {
46814
46814
  align: "center"
46815
46815
  }, /*#__PURE__*/React__default.createElement(AutopayOnIcon, null), /*#__PURE__*/React__default.createElement(Text$1, {
46816
46816
  variant: "pS",
46817
- onClick: function onClick() {
46818
- return _onClick || toggleModal(true);
46817
+ onClick: onClick || function () {
46818
+ return toggleModal(true);
46819
46819
  },
46820
46820
  onKeyPress: onKeyPress || function (e) {
46821
46821
  e.key === "Enter" && toggleModal(true);
@@ -46832,10 +46832,10 @@ var AutopayModal = function AutopayModal(_ref) {
46832
46832
  }
46833
46833
  };
46834
46834
  return /*#__PURE__*/React__default.createElement(Modal$1, _extends({
46835
- showModal: disableActions ? noop$1 : function () {
46835
+ showModal: function showModal() {
46836
46836
  return toggleModal(true);
46837
46837
  },
46838
- hideModal: disableActions ? noop$1 : function () {
46838
+ hideModal: function hideModal() {
46839
46839
  return toggleModal(false);
46840
46840
  },
46841
46841
  modalOpen: modalOpen
@@ -46889,13 +46889,19 @@ var AmountModule = function AmountModule(_ref) {
46889
46889
  subDescription: subDescription,
46890
46890
  allowedPaymentInstruments: allowedPaymentInstruments,
46891
46891
  disableActions: disableActions,
46892
- action: function action() {
46893
- return disableActions ? noop$1 : toggleModal(true);
46892
+ action: disableActions ? function () {
46893
+ return noop$1;
46894
+ } : function () {
46895
+ return toggleModal(true);
46894
46896
  },
46895
- onClick: function onClick() {
46896
- return disableActions ? noop$1 : toggleModal(true);
46897
+ onClick: disableActions ? function () {
46898
+ return noop$1;
46899
+ } : function () {
46900
+ toggleModal(true);
46897
46901
  },
46898
- onKeyPress: disableActions ? noop$1 : function (e) {
46902
+ onKeyPress: disableActions ? function () {
46903
+ return noop$1;
46904
+ } : function (e) {
46899
46905
  e.key === "Enter" && toggleModal(true);
46900
46906
  }
46901
46907
  })));
@@ -46975,7 +46981,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
46975
46981
  description: description,
46976
46982
  subDescription: subDescription,
46977
46983
  allowedPaymentInstruments: allowedPaymentInstruments,
46978
- disableActions: disableActions
46984
+ isInCustomerManagement: disableActions
46979
46985
  }))), /*#__PURE__*/React__default.createElement(Box, {
46980
46986
  padding: isMobile ? "16px" : "0"
46981
46987
  }, /*#__PURE__*/React__default.createElement(Cluster, {
@@ -46988,7 +46994,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
46988
46994
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46989
46995
  variant: "tertiary",
46990
46996
  text: config.type === "ACCOUNT" ? "Account Details" : "Property Details",
46991
- action: disableActions ? noop$1 : handleDetailsClick,
46997
+ action: handleDetailsClick,
46992
46998
  dataQa: "Account Details",
46993
46999
  extraStyles: isMobile && "flex-grow: 1; width: 100%;"
46994
47000
  })), /*#__PURE__*/React__default.createElement(Box, {
@@ -46998,10 +47004,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
46998
47004
  variant: "tertiary",
46999
47005
  text: "Set Up ".concat(planType),
47000
47006
  action: function action() {
47001
- if (!disableActions) {
47002
- setDetailedObligation(obligations, config, obligationAssocID);
47003
- handleAutopayAction();
47004
- }
47007
+ setDetailedObligation(obligations, config, obligationAssocID);
47008
+ handleAutopayAction();
47005
47009
  },
47006
47010
  dataQa: "Set Up Autopay",
47007
47011
  extraStyles: isMobile && "flex-grow: 1; width: 100%;",
@@ -47022,12 +47026,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
47022
47026
  description: description,
47023
47027
  subDescription: subDescription,
47024
47028
  allowedPaymentInstruments: allowedPaymentInstruments,
47025
- disableActions: disableActions,
47026
- action: disableActions ? noop$1 : toggleModal(true),
47027
- onClick: disableActions ? noop$1 : toggleModal(true),
47028
- onKeyPress: disableActions ? noop$1 : function (e) {
47029
- e.key === "Enter" && toggleModal(true);
47030
- }
47029
+ isInCustomerManagement: disableActions
47031
47030
  })), !isMobile && /*#__PURE__*/React__default.createElement(Box, {
47032
47031
  padding: "0"
47033
47032
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
@@ -47064,8 +47063,8 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47064
47063
  removeAccount = _ref.removeAccount,
47065
47064
  accountType = _ref.accountType,
47066
47065
  isMobile = _ref.isMobile,
47067
- _ref$disableActions = _ref.disableActions,
47068
- disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions;
47066
+ _ref$isInCustomerMana = _ref.isInCustomerManagement,
47067
+ isInCustomerManagement = _ref$isInCustomerMana === void 0 ? false : _ref$isInCustomerMana;
47069
47068
  var _useState = React.useState(false),
47070
47069
  _useState2 = _slicedToArray(_useState, 2),
47071
47070
  modalIsOpen = _useState2[0],
@@ -47078,10 +47077,10 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47078
47077
  }, "".concat(agencyName, " - ")) : "";
47079
47078
  var identifier = accountType === "Account" && obligations.length > 1 ? "accounts" : accountType === "Property" && obligations.length > 1 ? "properties" : accountType.toLowerCase();
47080
47079
  return /*#__PURE__*/React__default.createElement(Modal$1, {
47081
- showModal: disableActions ? noop : function () {
47080
+ showModal: function showModal() {
47082
47081
  return setModalIsOpen(true);
47083
47082
  },
47084
- hideModal: disableActions ? noop : function () {
47083
+ hideModal: function hideModal() {
47085
47084
  return setModalIsOpen(false);
47086
47085
  },
47087
47086
  modalOpen: modalIsOpen,
@@ -47089,10 +47088,8 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47089
47088
  modalBodyText: "Are you sure you want to remove the ".concat(identifier, " ").concat(accounts, "? Any autopay scheduled against ").concat(obligations.length > 1 ? "them" : "it", " will be deactivated."),
47090
47089
  continueButtonText: "Remove",
47091
47090
  continueAction: function continueAction() {
47092
- if (!disableActions) {
47093
- removeAccount();
47094
- setModalIsOpen(false);
47095
- }
47091
+ removeAccount();
47092
+ setModalIsOpen(false);
47096
47093
  },
47097
47094
  useDangerButton: true
47098
47095
  }, /*#__PURE__*/React__default.createElement(Box, {
@@ -47101,12 +47098,12 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47101
47098
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
47102
47099
  text: "Remove",
47103
47100
  variant: "secondary",
47104
- action: disableActions ? noop : function () {
47101
+ action: isInCustomerManagement ? noop : function () {
47105
47102
  return setModalIsOpen(true);
47106
47103
  },
47107
47104
  dataQa: "Remove Account",
47108
47105
  extraStyles: isMobile ? "flex-grow: 1; width: 100%; margin: 0;" : "flex-grow: 1;",
47109
- disabled: disableActions
47106
+ disabled: isInCustomerManagement
47110
47107
  })));
47111
47108
  };
47112
47109
 
@@ -47167,12 +47164,7 @@ var InactiveControlsModule = function InactiveControlsModule(_ref) {
47167
47164
  description: description,
47168
47165
  subDescription: subDescription,
47169
47166
  allowedPaymentInstruments: allowedPaymentInstruments,
47170
- disableActions: disableActions,
47171
- action: disableActions ? noop$1 : toggleModal(true),
47172
- onClick: disableActions ? noop$1 : toggleModal(true),
47173
- onKeyPress: disableActions ? noop$1 : function (e) {
47174
- e.key === "Enter" && toggleModal(true);
47175
- }
47167
+ disableActions: disableActions
47176
47168
  })), /*#__PURE__*/React__default.createElement(Box, {
47177
47169
  padding: "0",
47178
47170
  extraStyles: "flex-grow: 1;"
@@ -47181,7 +47173,7 @@ var InactiveControlsModule = function InactiveControlsModule(_ref) {
47181
47173
  removeAccount: disableActions ? noop$1 : handleRemoveAccount,
47182
47174
  accountType: configType === "ACCOUNT" ? "Account" : "Property",
47183
47175
  isMobile: isMobile,
47184
- disableActions: disableActions
47176
+ isInCustomerManagement: disableActions
47185
47177
  }))));
47186
47178
  };
47187
47179