maru_design2 2.22.1 → 2.22.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.22.2](https://github.com/42maru-ai/maru-design2/compare/v2.22.1...v2.22.2) (2025-02-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * :bug: SearchInput - update search & close logic [#480](https://github.com/42maru-ai/maru-design2/issues/480) ([8813b80](https://github.com/42maru-ai/maru-design2/commit/8813b80cb3f647b9b320d7371b8700112c99a323))
9
+
3
10
  ## [2.22.1](https://github.com/42maru-ai/maru-design2/compare/v2.22.0...v2.22.1) (2025-02-07)
4
11
 
5
12
 
@@ -12,6 +12,7 @@ interface Props {
12
12
  searchButtonContent?: string;
13
13
  onSearch: () => void;
14
14
  inputWrapperRef: React.RefObject<HTMLDivElement>;
15
+ onClose: () => void;
15
16
  }
16
- declare function Filter({ on, formats, hoverContent, resetButtonContent, onReset, searchButtonContent, onSearch, inputWrapperRef, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ declare function Filter({ on, formats, hoverContent, resetButtonContent, onReset, searchButtonContent, onSearch, inputWrapperRef, onClose, }: Props): import("react/jsx-runtime").JSX.Element;
17
18
  export default Filter;
@@ -29,6 +29,7 @@ export interface SearchInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
29
29
  resetButtonContent?: string;
30
30
  onSearch: () => void;
31
31
  searchButtonContent?: string;
32
+ onClose: () => void;
32
33
  };
33
34
  }
34
35
  export declare function SearchInput({ hiddenClearButton, className, filter, ...props }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
package/dist/index.js CHANGED
@@ -26531,13 +26531,18 @@ function Filter(_a) {
26531
26531
  onReset = _a.onReset,
26532
26532
  searchButtonContent = _a.searchButtonContent,
26533
26533
  onSearch = _a.onSearch,
26534
- inputWrapperRef = _a.inputWrapperRef;
26534
+ inputWrapperRef = _a.inputWrapperRef,
26535
+ onClose = _a.onClose;
26535
26536
  var _b = useState(false),
26536
26537
  open = _b[0],
26537
26538
  setOpen = _b[1];
26538
- var handlePopoverClose = function handlePopoverClose() {
26539
- onSearch();
26539
+ var handleClose = function handleClose() {
26540
26540
  setOpen(false);
26541
+ onClose();
26542
+ };
26543
+ var handleSearch = function handleSearch() {
26544
+ onSearch();
26545
+ handleClose();
26541
26546
  };
26542
26547
  return jsxs(Fragment, {
26543
26548
  children: [jsx("button", __assign({
@@ -26561,7 +26566,7 @@ function Filter(_a) {
26561
26566
  })), jsx(Popover, __assign({
26562
26567
  anchorEl: inputWrapperRef.current,
26563
26568
  open: open,
26564
- onClose: handlePopoverClose,
26569
+ onClose: handleClose,
26565
26570
  direction: "bottom-end",
26566
26571
  className: "maru-search-input-filter-popover"
26567
26572
  }, {
@@ -26589,7 +26594,7 @@ function Filter(_a) {
26589
26594
  }, {
26590
26595
  children: resetButtonContent
26591
26596
  })), jsx(Button, __assign({
26592
- onClick: onSearch
26597
+ onClick: handleSearch
26593
26598
  }, {
26594
26599
  children: searchButtonContent
26595
26600
  }))]
@@ -26624,7 +26629,8 @@ function SearchInput(_a) {
26624
26629
  resetButtonContent: filter.resetButtonContent,
26625
26630
  onSearch: filter.onSearch,
26626
26631
  searchButtonContent: filter.searchButtonContent,
26627
- inputWrapperRef: inputWrapperRef
26632
+ inputWrapperRef: inputWrapperRef,
26633
+ onClose: filter.onClose
26628
26634
  }) : undefined,
26629
26635
  hiddenClearButton: hiddenClearButton
26630
26636
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maru_design2",
3
- "version": "2.22.1",
3
+ "version": "2.22.2",
4
4
  "main": "./dist/index.js",
5
5
  "author": "zena-42maru",
6
6
  "license": "MIT",