@torq-north/react-tools 1.4.1 → 1.4.2

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 CHANGED
@@ -645,7 +645,10 @@ function findTextFor(value, options) {
645
645
  for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
646
646
  var option = options_1[_i];
647
647
  if (isGroup(option)) {
648
- return findTextFor(value, option.options);
648
+ var foundOption = findTextFor(value, option.options);
649
+ if (foundOption) {
650
+ return foundOption;
651
+ }
649
652
  }
650
653
  else if (typeof option === "string") {
651
654
  if (option === value) {
@@ -658,7 +661,6 @@ function findTextFor(value, options) {
658
661
  }
659
662
  }
660
663
  }
661
- return "Unknown";
662
664
  }
663
665
  function MultiSelectFormField(_a) {
664
666
  var _b, _c;
@@ -680,7 +682,9 @@ function MultiSelectFormField(_a) {
680
682
  select: {
681
683
  endAdornment: isClearable ? (jsxRuntime.jsx(material.Box, { pr: 2, children: jsxRuntime.jsx(material.IconButton, { size: (_b = slotProps === null || slotProps === void 0 ? void 0 : slotProps.textField) === null || _b === void 0 ? void 0 : _b.size, onClick: function () { return onChange([]); }, children: jsxRuntime.jsx(CloseIcon, { fontSize: "inherit" }) }) })) : undefined,
682
684
  multiple: true,
683
- renderValue: function (selected) { return (jsxRuntime.jsx(material.Box, { whiteSpace: "normal", children: selected.map(function (s) { return findTextFor(s, options); }).join(", ") })); },
685
+ renderValue: function (selected) { return (jsxRuntime.jsx(material.Box, { whiteSpace: "normal", children: selected
686
+ .map(function (s) { var _a; return (_a = findTextFor(s, options)) !== null && _a !== void 0 ? _a : "Unknown"; })
687
+ .join(", ") })); },
684
688
  },
685
689
  },
686
690
  }, (_c = slotProps === null || slotProps === void 0 ? void 0 : slotProps.textField) !== null && _c !== void 0 ? _c : {});