@thecb/components 5.8.1-beta.2 → 5.8.1-beta.5

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
@@ -40706,6 +40706,8 @@ var InactiveTitleModule = function InactiveTitleModule(_ref) {
40706
40706
  };
40707
40707
 
40708
40708
  var Obligation = function Obligation(_ref) {
40709
+ var _firstObligation$cust, _firstObligation$desc, _firstObligation$subD;
40710
+
40709
40711
  var config = _ref.config,
40710
40712
  obligations = _ref.obligations,
40711
40713
  actions = _ref.actions,
@@ -40728,22 +40730,30 @@ var Obligation = function Obligation(_ref) {
40728
40730
  inactiveLookupInput = _ref$inactiveLookupIn === void 0 ? "Account" : _ref$inactiveLookupIn,
40729
40731
  _ref$inactiveLookupVa = _ref.inactiveLookupValue,
40730
40732
  inactiveLookupValue = _ref$inactiveLookupVa === void 0 ? "" : _ref$inactiveLookupVa;
40731
- var obligation = obligations[0];
40732
- console.log("obligation in obligation component", obligation);
40733
- var customAttributes = obligation.customAttributes;
40733
+
40734
+ /*
40735
+ The value of obligations is always an array. It can contain:
40736
+ - A single obligation
40737
+ - A group of obligations (a "collection")
40738
+
40739
+ The top level desc/subdesc for all obligations in a collection is the same
40740
+ (Collection accounts look different in the Account Details page)
40741
+ */
40742
+ var firstObligation = obligations[0];
40743
+ var customAttributes = (_firstObligation$cust = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.customAttributes) !== null && _firstObligation$cust !== void 0 ? _firstObligation$cust : {};
40734
40744
  var boxShadowValue = "0px 4px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
40735
40745
  var activeObligation = /*#__PURE__*/React__default.createElement(Box, {
40736
40746
  padding: "0",
40737
40747
  borderRadius: "4px",
40738
40748
  boxShadow: boxShadowValue,
40739
40749
  as: "section",
40740
- "aria-label": "".concat(obligation.description, " ").concat(obligation.subDescription)
40750
+ "aria-label": "".concat((_firstObligation$desc = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.description) !== null && _firstObligation$desc !== void 0 ? _firstObligation$desc : "account", " ").concat((_firstObligation$subD = firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.subDescription) !== null && _firstObligation$subD !== void 0 ? _firstObligation$subD : obligationAssocID)
40741
40751
  }, /*#__PURE__*/React__default.createElement(Box, {
40742
40752
  background: WHITE
40743
40753
  }, /*#__PURE__*/React__default.createElement(Stack, {
40744
40754
  childGap: "14px"
40745
40755
  }, /*#__PURE__*/React__default.createElement(Box, {
40746
- key: "".concat(obligations[0].id, "-top"),
40756
+ key: "".concat(firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.id, "-top"),
40747
40757
  padding: "0 8px",
40748
40758
  minWidth: "100%"
40749
40759
  }, /*#__PURE__*/React__default.createElement(Cluster, {
@@ -40763,12 +40773,12 @@ var Obligation = function Obligation(_ref) {
40763
40773
  iconValue: config.iconValue,
40764
40774
  customAttributes: customAttributes
40765
40775
  }), /*#__PURE__*/React__default.createElement(TitleModule, {
40766
- title: obligation.description,
40767
- subtitle: obligation.subDescription,
40776
+ title: firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.description,
40777
+ subtitle: firstObligation === null || firstObligation === void 0 ? void 0 : firstObligation.subDescription,
40768
40778
  titleColor: BRIGHT_GREY,
40769
40779
  isMobile: isMobile
40770
40780
  }))), !isMobile && /*#__PURE__*/React__default.createElement(AmountModule, {
40771
- totalAmountDue: obligations.reduce(function (acc, curr) {
40781
+ totalAmountDue: obligations === null || obligations === void 0 ? void 0 : obligations.reduce(function (acc, curr) {
40772
40782
  return acc + curr.amountDue;
40773
40783
  }, 0),
40774
40784
  autoPayEnabled: autoPayEnabled,
@@ -40819,7 +40829,7 @@ var Obligation = function Obligation(_ref) {
40819
40829
  }, /*#__PURE__*/React__default.createElement(Stack, {
40820
40830
  childGap: "14px"
40821
40831
  }, /*#__PURE__*/React__default.createElement(Box, {
40822
- key: "".concat(obligations[0].id, "-top"),
40832
+ key: "".concat(obligationAssocID, "-top"),
40823
40833
  padding: "0 8px",
40824
40834
  minWidth: "100%"
40825
40835
  }, /*#__PURE__*/React__default.createElement(Cluster, {