@thecb/components 10.5.2 → 10.5.3

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
@@ -48108,6 +48108,39 @@ var Obligation = function Obligation(_ref) {
48108
48108
  return inactive ? inactiveObligation : activeObligation;
48109
48109
  };
48110
48110
 
48111
+ var PartialAmountField = function PartialAmountField(_ref) {
48112
+ var lineItem = _ref.lineItem,
48113
+ field = _ref.field,
48114
+ showErrors = _ref.showErrors,
48115
+ errorMessages = _ref.errorMessages,
48116
+ moneyFormat = _ref.moneyFormat,
48117
+ fieldActions = _ref.fieldActions;
48118
+ return /*#__PURE__*/React.createElement(FormInput$1, {
48119
+ labelTextWhenNoError: lineItem.description,
48120
+ key: lineItem.id,
48121
+ field: field,
48122
+ fieldActions: fieldActions,
48123
+ showErrors: showErrors,
48124
+ errorMessages: errorMessages,
48125
+ style: {
48126
+ textAlign: "right"
48127
+ },
48128
+ placeholder: "$0.00",
48129
+ formatter: moneyFormat,
48130
+ isNum: true,
48131
+ decorator: /*#__PURE__*/React.createElement(Text$1, {
48132
+ variant: "p"
48133
+ }, "Amount owed:", " ", /*#__PURE__*/React.createElement(Text$1, {
48134
+ variant: "p",
48135
+ weight: "600"
48136
+ }, displayCurrency(lineItem.amount)))
48137
+ });
48138
+ };
48139
+ function arePropsEqual(prevProps, nextProps) {
48140
+ return equals(prevProps.errorMessages, nextProps.errorMessages) && equals(prevProps.field, nextProps.field) && equals(prevProps.showErrors, nextProps.showErrors) && equals(prevProps.moneyFormat, nextProps.moneyFormat) && equals(prevProps.lineItem, nextProps.lineItem);
48141
+ }
48142
+ var PartialAmountField$1 = /*#__PURE__*/React.memo(PartialAmountField, arePropsEqual);
48143
+
48111
48144
  var PartialAmountForm = function PartialAmountForm(_ref) {
48112
48145
  var _ref$variant = _ref.variant,
48113
48146
  variant = _ref$variant === void 0 ? "default" : _ref$variant,
@@ -48151,25 +48184,15 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
48151
48184
  height: "16px"
48152
48185
  }
48153
48186
  }), /*#__PURE__*/React.createElement(FormInputColumn, null, lineItemsNew.map(function (li) {
48154
- return /*#__PURE__*/React.createElement(FormInput$1, {
48155
- labelTextWhenNoError: li.description,
48187
+ return /*#__PURE__*/React.createElement(PartialAmountField$1, {
48156
48188
  key: li.id,
48189
+ lineItem: li,
48157
48190
  field: fields[li.id],
48158
- fieldActions: actions.fields[li.id],
48191
+ actions: actions,
48159
48192
  showErrors: showErrors,
48160
- errorMessages: getPartialAmountFormErrors(li.amount),
48161
- style: {
48162
- textAlign: "right"
48163
- },
48164
- placeholder: "$0.00",
48165
- formatter: moneyFormat,
48166
- isNum: true,
48167
- decorator: /*#__PURE__*/React.createElement(Text$1, {
48168
- variant: "p"
48169
- }, "Amount owed:", " ", /*#__PURE__*/React.createElement(Text$1, {
48170
- variant: "p",
48171
- weight: "600"
48172
- }, displayCurrency(li.amount)))
48193
+ moneyFormat: moneyFormat,
48194
+ fieldActions: actions.fields[li.id],
48195
+ errorMessages: getPartialAmountFormErrors(li.amount)
48173
48196
  });
48174
48197
  })));
48175
48198
  };
@@ -49927,10 +49950,10 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
49927
49950
  "aria-required": section.required,
49928
49951
  "aria-labelledby": ariaLabelledBy,
49929
49952
  "aria-describedby": ariaDescribedBy,
49930
- onClick: isMobile && supportsTouch || section.disabled ? noop : function () {
49953
+ onClick: isMobile && supportsTouch || section.disabled || section.id === openSection ? noop : function () {
49931
49954
  return toggleOpenSection(section.id);
49932
49955
  },
49933
- onTouchEnd: isMobile && supportsTouch && !section.disabled ? function () {
49956
+ onTouchEnd: isMobile && supportsTouch && !section.disabled && section.id !== openSection ? function () {
49934
49957
  return toggleOpenSection(section.id);
49935
49958
  } : noop,
49936
49959
  id: "inner-radio-section-".concat(sectionIndex),