@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.cjs.js CHANGED
@@ -48116,6 +48116,39 @@ var Obligation = function Obligation(_ref) {
48116
48116
  return inactive ? inactiveObligation : activeObligation;
48117
48117
  };
48118
48118
 
48119
+ var PartialAmountField = function PartialAmountField(_ref) {
48120
+ var lineItem = _ref.lineItem,
48121
+ field = _ref.field,
48122
+ showErrors = _ref.showErrors,
48123
+ errorMessages = _ref.errorMessages,
48124
+ moneyFormat = _ref.moneyFormat,
48125
+ fieldActions = _ref.fieldActions;
48126
+ return /*#__PURE__*/React__default.createElement(FormInput$1, {
48127
+ labelTextWhenNoError: lineItem.description,
48128
+ key: lineItem.id,
48129
+ field: field,
48130
+ fieldActions: fieldActions,
48131
+ showErrors: showErrors,
48132
+ errorMessages: errorMessages,
48133
+ style: {
48134
+ textAlign: "right"
48135
+ },
48136
+ placeholder: "$0.00",
48137
+ formatter: moneyFormat,
48138
+ isNum: true,
48139
+ decorator: /*#__PURE__*/React__default.createElement(Text$1, {
48140
+ variant: "p"
48141
+ }, "Amount owed:", " ", /*#__PURE__*/React__default.createElement(Text$1, {
48142
+ variant: "p",
48143
+ weight: "600"
48144
+ }, displayCurrency(lineItem.amount)))
48145
+ });
48146
+ };
48147
+ function arePropsEqual(prevProps, nextProps) {
48148
+ 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);
48149
+ }
48150
+ var PartialAmountField$1 = /*#__PURE__*/React__default.memo(PartialAmountField, arePropsEqual);
48151
+
48119
48152
  var PartialAmountForm = function PartialAmountForm(_ref) {
48120
48153
  var _ref$variant = _ref.variant,
48121
48154
  variant = _ref$variant === void 0 ? "default" : _ref$variant,
@@ -48159,25 +48192,15 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
48159
48192
  height: "16px"
48160
48193
  }
48161
48194
  }), /*#__PURE__*/React__default.createElement(FormInputColumn, null, lineItemsNew.map(function (li) {
48162
- return /*#__PURE__*/React__default.createElement(FormInput$1, {
48163
- labelTextWhenNoError: li.description,
48195
+ return /*#__PURE__*/React__default.createElement(PartialAmountField$1, {
48164
48196
  key: li.id,
48197
+ lineItem: li,
48165
48198
  field: fields[li.id],
48166
- fieldActions: actions.fields[li.id],
48199
+ actions: actions,
48167
48200
  showErrors: showErrors,
48168
- errorMessages: getPartialAmountFormErrors(li.amount),
48169
- style: {
48170
- textAlign: "right"
48171
- },
48172
- placeholder: "$0.00",
48173
- formatter: moneyFormat,
48174
- isNum: true,
48175
- decorator: /*#__PURE__*/React__default.createElement(Text$1, {
48176
- variant: "p"
48177
- }, "Amount owed:", " ", /*#__PURE__*/React__default.createElement(Text$1, {
48178
- variant: "p",
48179
- weight: "600"
48180
- }, displayCurrency(li.amount)))
48201
+ moneyFormat: moneyFormat,
48202
+ fieldActions: actions.fields[li.id],
48203
+ errorMessages: getPartialAmountFormErrors(li.amount)
48181
48204
  });
48182
48205
  })));
48183
48206
  };
@@ -49935,10 +49958,10 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
49935
49958
  "aria-required": section.required,
49936
49959
  "aria-labelledby": ariaLabelledBy,
49937
49960
  "aria-describedby": ariaDescribedBy,
49938
- onClick: isMobile && supportsTouch || section.disabled ? noop : function () {
49961
+ onClick: isMobile && supportsTouch || section.disabled || section.id === openSection ? noop : function () {
49939
49962
  return toggleOpenSection(section.id);
49940
49963
  },
49941
- onTouchEnd: isMobile && supportsTouch && !section.disabled ? function () {
49964
+ onTouchEnd: isMobile && supportsTouch && !section.disabled && section.id !== openSection ? function () {
49942
49965
  return toggleOpenSection(section.id);
49943
49966
  } : noop,
49944
49967
  id: "inner-radio-section-".concat(sectionIndex),