sprint-asia-custom-component 0.1.19 → 0.1.21

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
@@ -46536,8 +46536,10 @@
46536
46536
 
46537
46537
  const SearchDropdown = ({
46538
46538
  options = ["Loading..."],
46539
+ valueOptions = ["Loading..."],
46539
46540
  placeholderSearch = "Search Here",
46540
46541
  filterDropdown = "Filter",
46542
+ setFilterDropdown,
46541
46543
  setValueFilterDropdown,
46542
46544
  filterSearch,
46543
46545
  setValueFilterSearch,
@@ -46550,8 +46552,9 @@
46550
46552
  onEnterPress();
46551
46553
  }
46552
46554
  };
46553
- const handleClickOption = value => {
46555
+ const handleClickOption = (data, value) => {
46554
46556
  setIsOpen(false);
46557
+ setFilterDropdown(data);
46555
46558
  setValueFilterDropdown(value);
46556
46559
  };
46557
46560
  return /*#__PURE__*/React__default["default"].createElement("div", {
@@ -46578,7 +46581,7 @@
46578
46581
  }, options?.length > 0 ? options.map((option, index) => /*#__PURE__*/React__default["default"].createElement("div", {
46579
46582
  key: index,
46580
46583
  className: "hover:bg-neutral20 bg-white py-2.5 px-4 my-0.5 rounded-md cursor-pointer",
46581
- onClick: () => handleClickOption(option)
46584
+ onClick: () => handleClickOption(valueOptions[index], option)
46582
46585
  }, /*#__PURE__*/React__default["default"].createElement("div", {
46583
46586
  className: "flex justify-between"
46584
46587
  }, /*#__PURE__*/React__default["default"].createElement("p", {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprint-asia-custom-component",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.19",
4
+ "version": "0.1.21",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -3,8 +3,10 @@ import { PiMagnifyingGlass, PiCaretDown, PiCaretUp } from 'react-icons/pi';
3
3
 
4
4
  const SearchDropdown = ({
5
5
  options = ["Loading..."],
6
+ valueOptions = ["Loading..."],
6
7
  placeholderSearch = "Search Here",
7
8
  filterDropdown = "Filter",
9
+ setFilterDropdown,
8
10
  setValueFilterDropdown,
9
11
  filterSearch,
10
12
  setValueFilterSearch,
@@ -19,8 +21,9 @@ const SearchDropdown = ({
19
21
  }
20
22
  };
21
23
 
22
- const handleClickOption = (value) => {
24
+ const handleClickOption = (data, value) => {
23
25
  setIsOpen(false)
26
+ setFilterDropdown(data)
24
27
  setValueFilterDropdown(value)
25
28
  }
26
29
 
@@ -49,7 +52,7 @@ const SearchDropdown = ({
49
52
  <div
50
53
  key={index}
51
54
  className='hover:bg-neutral20 bg-white py-2.5 px-4 my-0.5 rounded-md cursor-pointer'
52
- onClick={() => handleClickOption(option)}
55
+ onClick={() => handleClickOption(valueOptions[index], option)}
53
56
  >
54
57
  <div className='flex justify-between'>
55
58
  <p className='text-sm text-black font-semibold'>{option}</p>