@capillarytech/blaze-ui 1.2.4-alpha.7 → 1.2.4

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.js CHANGED
@@ -34508,16 +34508,23 @@ const CapUnifiedSelect = _ref => {
34508
34508
  })]
34509
34509
  });
34510
34510
  }
34511
+
34512
+ // Default/success case: show selected values with their labels
34513
+ // Treat anything other than 'REQUEST'|'FAILURE' as success
34511
34514
  const values = Array.isArray(displayValue) ? displayValue : [];
34512
34515
  if (values.length === 0) return null;
34513
34516
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
34514
34517
  className: _styles.default['cap-unified-select-tooltip-values'],
34515
- children: values.map((val, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
34516
- className: _styles.default['cap-unified-select-tooltip-value-item'],
34517
- children: val
34518
- }, "cap-unified-select-disabled-tooltip-item-" + val + "-" + idx))
34518
+ children: values.map((val, idx) => {
34519
+ var _treeMaps$nodeMap$val, _treeMaps$nodeMap;
34520
+ const label = (_treeMaps$nodeMap$val = treeMaps == null || (_treeMaps$nodeMap = treeMaps.nodeMap) == null || (_treeMaps$nodeMap = _treeMaps$nodeMap[val]) == null ? void 0 : _treeMaps$nodeMap.label) != null ? _treeMaps$nodeMap$val : val;
34521
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
34522
+ className: _styles.default['cap-unified-select-tooltip-value-item'],
34523
+ children: label
34524
+ }, "cap-unified-select-disabled-tooltip-item-" + val + "-" + idx);
34525
+ })
34519
34526
  });
34520
- }, [isMulti, fetchDynamicValueStatus, displayValue]);
34527
+ }, [isMulti, fetchDynamicValueStatus, displayValue, treeMaps]);
34521
34528
 
34522
34529
  // Suffix icon with "more" tooltip
34523
34530
  const suffix = (0, _react.useMemo)(() => {
@@ -34560,12 +34567,12 @@ const CapUnifiedSelect = _ref => {
34560
34567
  // Prefix for multi-select (first selected item label)
34561
34568
  const prefix = (0, _react.useMemo)(() => {
34562
34569
  if (isMulti && Array.isArray(displayValue) && (displayValue == null ? void 0 : displayValue.length) > 0) {
34563
- var _treeMaps$nodeMap;
34570
+ var _treeMaps$nodeMap2;
34564
34571
  const firstLeafValue = displayValue.find(val => {
34565
34572
  var _treeMaps$leafValues;
34566
34573
  return treeMaps == null || (_treeMaps$leafValues = treeMaps.leafValues) == null ? void 0 : _treeMaps$leafValues.includes(val);
34567
34574
  });
34568
- return firstLeafValue ? (treeMaps == null || (_treeMaps$nodeMap = treeMaps.nodeMap) == null || (_treeMaps$nodeMap = _treeMaps$nodeMap[firstLeafValue]) == null ? void 0 : _treeMaps$nodeMap.label) || null : null;
34575
+ return firstLeafValue ? (treeMaps == null || (_treeMaps$nodeMap2 = treeMaps.nodeMap) == null || (_treeMaps$nodeMap2 = _treeMaps$nodeMap2[firstLeafValue]) == null ? void 0 : _treeMaps$nodeMap2.label) || null : null;
34569
34576
  }
34570
34577
  return null;
34571
34578
  }, [isMulti, displayValue, treeMaps]);