@useblu/ocean-react 1.54.0 → 1.54.1

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/index.js CHANGED
@@ -46445,7 +46445,7 @@ var Options = function (_a) {
46445
46445
  };
46446
46446
 
46447
46447
  var Chips = function (_a) {
46448
- var label = _a.label, icon = _a.icon, disabled = _a.disabled, defaultValue = _a.defaultValue, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.multiChoice, multiChoice = _c === void 0 ? false : _c, _d = _a.clearLabel, clearLabel = _d === void 0 ? 'Limpar' : _d, _e = _a.filterLabel, filterLabel = _e === void 0 ? 'Filtrar' : _e, initialCounter = _a.initialCounter, onClick = _a.onClick, onChange = _a.onChange;
46448
+ var label = _a.label, icon = _a.icon, disabled = _a.disabled, defaultValue = _a.defaultValue, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.multiChoice, multiChoice = _c === void 0 ? false : _c, _d = _a.clearLabel, clearLabel = _d === void 0 ? 'Limpar' : _d, _e = _a.filterLabel, filterLabel = _e === void 0 ? 'Filtrar' : _e, initialCounter = _a.initialCounter, onClick = _a.onClick, onChange = _a.onChange, onClose = _a.onClose;
46449
46449
  var wrapperRef = e.useRef(null);
46450
46450
  var _f = e__default["default"].useState(0), counter = _f[0], setCounter = _f[1];
46451
46451
  var _g = e__default["default"].useState(false), selectionIsOpen = _g[0], setSelectionIsOpen = _g[1];
@@ -46455,6 +46455,8 @@ var Chips = function (_a) {
46455
46455
  if (wrapperRef.current && !wrapperRef.current.contains(target)) {
46456
46456
  setSelectionIsOpen(false);
46457
46457
  }
46458
+ if (onClose)
46459
+ onClose();
46458
46460
  }
46459
46461
  e.useEffect(function () {
46460
46462
  document.addEventListener('mousedown', handleClickOutside);
@@ -46510,9 +46512,8 @@ var Chips = function (_a) {
46510
46512
  };
46511
46513
  var filterOptions = function () {
46512
46514
  setSelectionIsOpen(false);
46513
- if (onChange) {
46514
- onChange(selectedOptions);
46515
- }
46515
+ if (onClose)
46516
+ onClose();
46516
46517
  };
46517
46518
  return (e__default["default"].createElement("div", { className: "ods-chips", ref: wrapperRef },
46518
46519
  e__default["default"].createElement("button", { type: "button", onClick: handleClickChips, disabled: disabled, className: classNames('ods-chips__button', {