@thecb/components 10.4.0-beta.11 → 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.esm.js CHANGED
@@ -46737,8 +46737,8 @@ var AutopayModal = function AutopayModal(_ref) {
46737
46737
  allowedPaymentInstruments = _ref.allowedPaymentInstruments,
46738
46738
  _ref$disableActions = _ref.disableActions,
46739
46739
  disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions,
46740
- _action = _ref.action,
46741
- _onClick = _ref.onClick,
46740
+ action = _ref.action,
46741
+ onClick = _ref.onClick,
46742
46742
  onKeyPress = _ref.onKeyPress;
46743
46743
  var generateMethodNeededText = function generateMethodNeededText(planText, allowedPaymentInstruments) {
46744
46744
  var allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
@@ -46770,8 +46770,8 @@ var AutopayModal = function AutopayModal(_ref) {
46770
46770
  return /*#__PURE__*/React.createElement(ButtonWithAction, {
46771
46771
  text: autoPayActive ? "Turn off ".concat(shortPlan) : "Set Up ".concat(shortPlan),
46772
46772
  variant: "secondary",
46773
- action: function action() {
46774
- _action || toggleModal(true);
46773
+ action: action || function () {
46774
+ return toggleModal(true);
46775
46775
  },
46776
46776
  dataQa: "Turn off Autopay",
46777
46777
  extraStyles: isMobile ? "flex-grow: 1; width: 100%; margin: 0;" : "flex-grow: 1; min-width: 165px;",
@@ -46783,8 +46783,8 @@ var AutopayModal = function AutopayModal(_ref) {
46783
46783
  return /*#__PURE__*/React.createElement(ButtonWithAction, {
46784
46784
  text: autoPayActive ? "Manage ".concat(shortPlan) : "Set Up ".concat(shortPlan),
46785
46785
  variant: "tertiary",
46786
- action: function action() {
46787
- _action || toggleModal(true);
46786
+ action: action || function () {
46787
+ return toggleModal(true);
46788
46788
  },
46789
46789
  dataQa: "Manage Autopay",
46790
46790
  extraStyles: isMobile && "flex-grow: 1; width: 100%;",
@@ -46795,8 +46795,8 @@ var AutopayModal = function AutopayModal(_ref) {
46795
46795
  {
46796
46796
  return /*#__PURE__*/React.createElement(Box, {
46797
46797
  padding: "0",
46798
- onClick: function onClick() {
46799
- _onClick || toggleModal(true);
46798
+ onClick: onClick || function () {
46799
+ toggleModal(true);
46800
46800
  },
46801
46801
  hoverStyles: hoverStyles,
46802
46802
  activeStyles: activeStyles,
@@ -46806,8 +46806,8 @@ var AutopayModal = function AutopayModal(_ref) {
46806
46806
  align: "center"
46807
46807
  }, /*#__PURE__*/React.createElement(AutopayOnIcon, null), /*#__PURE__*/React.createElement(Text$1, {
46808
46808
  variant: "pS",
46809
- onClick: function onClick() {
46810
- return _onClick || toggleModal(true);
46809
+ onClick: onClick || function () {
46810
+ return toggleModal(true);
46811
46811
  },
46812
46812
  onKeyPress: onKeyPress || function (e) {
46813
46813
  e.key === "Enter" && toggleModal(true);
@@ -46824,10 +46824,10 @@ var AutopayModal = function AutopayModal(_ref) {
46824
46824
  }
46825
46825
  };
46826
46826
  return /*#__PURE__*/React.createElement(Modal$1, _extends({
46827
- showModal: disableActions ? noop$1 : function () {
46827
+ showModal: function showModal() {
46828
46828
  return toggleModal(true);
46829
46829
  },
46830
- hideModal: disableActions ? noop$1 : function () {
46830
+ hideModal: function hideModal() {
46831
46831
  return toggleModal(false);
46832
46832
  },
46833
46833
  modalOpen: modalOpen
@@ -46881,11 +46881,15 @@ var AmountModule = function AmountModule(_ref) {
46881
46881
  subDescription: subDescription,
46882
46882
  allowedPaymentInstruments: allowedPaymentInstruments,
46883
46883
  disableActions: disableActions,
46884
- action: function action() {
46885
- return disableActions ? noop$1 : toggleModal(true);
46884
+ action: disableActions ? function () {
46885
+ return noop$1;
46886
+ } : function () {
46887
+ return toggleModal(true);
46886
46888
  },
46887
- onClick: function onClick() {
46888
- return disableActions ? noop$1 : toggleModal(true);
46889
+ onClick: disableActions ? function () {
46890
+ return noop$1;
46891
+ } : function () {
46892
+ toggleModal(true);
46889
46893
  },
46890
46894
  onKeyPress: disableActions ? function () {
46891
46895
  return noop$1;
@@ -46969,7 +46973,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
46969
46973
  description: description,
46970
46974
  subDescription: subDescription,
46971
46975
  allowedPaymentInstruments: allowedPaymentInstruments,
46972
- disableActions: disableActions
46976
+ isInCustomerManagement: disableActions
46973
46977
  }))), /*#__PURE__*/React.createElement(Box, {
46974
46978
  padding: isMobile ? "16px" : "0"
46975
46979
  }, /*#__PURE__*/React.createElement(Cluster, {
@@ -46982,7 +46986,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
46982
46986
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
46983
46987
  variant: "tertiary",
46984
46988
  text: config.type === "ACCOUNT" ? "Account Details" : "Property Details",
46985
- action: disableActions ? noop$1 : handleDetailsClick,
46989
+ action: handleDetailsClick,
46986
46990
  dataQa: "Account Details",
46987
46991
  extraStyles: isMobile && "flex-grow: 1; width: 100%;"
46988
46992
  })), /*#__PURE__*/React.createElement(Box, {
@@ -46992,10 +46996,8 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
46992
46996
  variant: "tertiary",
46993
46997
  text: "Set Up ".concat(planType),
46994
46998
  action: function action() {
46995
- if (!disableActions) {
46996
- setDetailedObligation(obligations, config, obligationAssocID);
46997
- handleAutopayAction();
46998
- }
46999
+ setDetailedObligation(obligations, config, obligationAssocID);
47000
+ handleAutopayAction();
46999
47001
  },
47000
47002
  dataQa: "Set Up Autopay",
47001
47003
  extraStyles: isMobile && "flex-grow: 1; width: 100%;",
@@ -47016,18 +47018,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
47016
47018
  description: description,
47017
47019
  subDescription: subDescription,
47018
47020
  allowedPaymentInstruments: allowedPaymentInstruments,
47019
- disableActions: disableActions,
47020
- action: function action() {
47021
- return disableActions ? noop$1 : toggleModal(true);
47022
- },
47023
- onClick: function onClick() {
47024
- return disableActions ? noop$1 : toggleModal(true);
47025
- },
47026
- onKeyPress: disableActions ? function () {
47027
- return noop$1;
47028
- } : function (e) {
47029
- e.key === "Enter" && toggleModal(true);
47030
- }
47021
+ isInCustomerManagement: disableActions
47031
47022
  })), !isMobile && /*#__PURE__*/React.createElement(Box, {
47032
47023
  padding: "0"
47033
47024
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
@@ -47064,8 +47055,8 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47064
47055
  removeAccount = _ref.removeAccount,
47065
47056
  accountType = _ref.accountType,
47066
47057
  isMobile = _ref.isMobile,
47067
- _ref$disableActions = _ref.disableActions,
47068
- disableActions = _ref$disableActions === void 0 ? false : _ref$disableActions;
47058
+ _ref$isInCustomerMana = _ref.isInCustomerManagement,
47059
+ isInCustomerManagement = _ref$isInCustomerMana === void 0 ? false : _ref$isInCustomerMana;
47069
47060
  var _useState = useState(false),
47070
47061
  _useState2 = _slicedToArray(_useState, 2),
47071
47062
  modalIsOpen = _useState2[0],
@@ -47078,10 +47069,10 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47078
47069
  }, "".concat(agencyName, " - ")) : "";
47079
47070
  var identifier = accountType === "Account" && obligations.length > 1 ? "accounts" : accountType === "Property" && obligations.length > 1 ? "properties" : accountType.toLowerCase();
47080
47071
  return /*#__PURE__*/React.createElement(Modal$1, {
47081
- showModal: disableActions ? noop : function () {
47072
+ showModal: function showModal() {
47082
47073
  return setModalIsOpen(true);
47083
47074
  },
47084
- hideModal: disableActions ? noop : function () {
47075
+ hideModal: function hideModal() {
47085
47076
  return setModalIsOpen(false);
47086
47077
  },
47087
47078
  modalOpen: modalIsOpen,
@@ -47089,10 +47080,8 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47089
47080
  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
47081
  continueButtonText: "Remove",
47091
47082
  continueAction: function continueAction() {
47092
- if (!disableActions) {
47093
- removeAccount();
47094
- setModalIsOpen(false);
47095
- }
47083
+ removeAccount();
47084
+ setModalIsOpen(false);
47096
47085
  },
47097
47086
  useDangerButton: true
47098
47087
  }, /*#__PURE__*/React.createElement(Box, {
@@ -47101,12 +47090,12 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
47101
47090
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
47102
47091
  text: "Remove",
47103
47092
  variant: "secondary",
47104
- action: disableActions ? noop : function () {
47093
+ action: isInCustomerManagement ? noop : function () {
47105
47094
  return setModalIsOpen(true);
47106
47095
  },
47107
47096
  dataQa: "Remove Account",
47108
47097
  extraStyles: isMobile ? "flex-grow: 1; width: 100%; margin: 0;" : "flex-grow: 1;",
47109
- disabled: disableActions
47098
+ disabled: isInCustomerManagement
47110
47099
  })));
47111
47100
  };
47112
47101
 
@@ -47167,18 +47156,7 @@ var InactiveControlsModule = function InactiveControlsModule(_ref) {
47167
47156
  description: description,
47168
47157
  subDescription: subDescription,
47169
47158
  allowedPaymentInstruments: allowedPaymentInstruments,
47170
- disableActions: disableActions,
47171
- action: function action() {
47172
- return disableActions ? noop$1 : toggleModal(true);
47173
- },
47174
- onClick: function onClick() {
47175
- return disableActions ? noop$1 : toggleModal(true);
47176
- },
47177
- onKeyPress: disableActions ? function () {
47178
- return noop$1;
47179
- } : function (e) {
47180
- e.key === "Enter" && toggleModal(true);
47181
- }
47159
+ disableActions: disableActions
47182
47160
  })), /*#__PURE__*/React.createElement(Box, {
47183
47161
  padding: "0",
47184
47162
  extraStyles: "flex-grow: 1;"
@@ -47187,7 +47165,7 @@ var InactiveControlsModule = function InactiveControlsModule(_ref) {
47187
47165
  removeAccount: disableActions ? noop$1 : handleRemoveAccount,
47188
47166
  accountType: configType === "ACCOUNT" ? "Account" : "Property",
47189
47167
  isMobile: isMobile,
47190
- disableActions: disableActions
47168
+ isInCustomerManagement: disableActions
47191
47169
  }))));
47192
47170
  };
47193
47171