@bigbinary/neeto-filters-frontend 3.0.10 → 3.0.11

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
@@ -3238,6 +3238,10 @@ var Pane = function Pane(_ref) {
3238
3238
  history.push(buildUrl(pathname, params));
3239
3239
  handleChange([], true);
3240
3240
  };
3241
+ var handleClearTermAndClose = function handleClearTermAndClose() {
3242
+ setSearchTerm("");
3243
+ onClose();
3244
+ };
3241
3245
  var handleClose = function handleClose() {
3242
3246
  columns.forEach(function (_ref2) {
3243
3247
  var key = _ref2.key;
@@ -3246,7 +3250,7 @@ var Pane = function Pane(_ref) {
3246
3250
  }, filters);
3247
3251
  if ((filter === null || filter === void 0 ? void 0 : filter.value) === "") delete searchParams[key];
3248
3252
  });
3249
- onClose();
3253
+ handleClearTermAndClose();
3250
3254
  };
3251
3255
  var isClearFiltersDisabled = !filters.some(function (_ref3) {
3252
3256
  var value = _ref3.value,
@@ -3281,10 +3285,10 @@ var Pane = function Pane(_ref) {
3281
3285
  return /*#__PURE__*/React.createElement(Item, {
3282
3286
  column: column,
3283
3287
  filters: filters,
3284
- onClose: onClose,
3285
3288
  autoFocus: column.key === isOpen,
3286
3289
  key: column.key,
3287
- onChange: handleChange
3290
+ onChange: handleChange,
3291
+ onClose: handleClearTermAndClose
3288
3292
  });
3289
3293
  }), isPresent(groupedColumns) && /*#__PURE__*/React.createElement(Accordion, {
3290
3294
  defaultActiveKey: groupedColumns.findIndex(function (_ref4) {
@@ -3304,10 +3308,10 @@ var Pane = function Pane(_ref) {
3304
3308
  return /*#__PURE__*/React.createElement(Item, {
3305
3309
  column: column,
3306
3310
  filters: filters,
3307
- onClose: onClose,
3308
3311
  autoFocus: column.key === isOpen,
3309
3312
  key: column.key,
3310
- onChange: handleChange
3313
+ onChange: handleChange,
3314
+ onClose: handleClearTermAndClose
3311
3315
  });
3312
3316
  }));
3313
3317
  })), isEmpty(ungroupedColumns) && isEmpty(groupedColumns) && /*#__PURE__*/React.createElement(Typography, {
@@ -3319,7 +3323,7 @@ var Pane = function Pane(_ref) {
3319
3323
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
3320
3324
  "data-cy": "neeto-filters-done-btn",
3321
3325
  label: t("neetoFilters.common.done"),
3322
- onClick: onClose
3326
+ onClick: handleClearTermAndClose
3323
3327
  }), /*#__PURE__*/React.createElement(Button, {
3324
3328
  "data-cy": "neeto-filters-clear-btn",
3325
3329
  disabled: isClearFiltersDisabled,