@megha-ui/react 1.2.765 → 1.2.766

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.
@@ -145,8 +145,16 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
145
145
  useEffect(() => {
146
146
  const _options = isSort
147
147
  ? options
148
- .sort((a, b) => (a.label > b.label ? 1 : -1))
149
- .filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()))
148
+ .sort((a, b) => {
149
+ let aValue = a.label;
150
+ let bValue = b.label;
151
+ if (aValue.toString().includes("-") &&
152
+ bValue.toString().includes("-")) {
153
+ aValue = aValue.toString().split("-")[0];
154
+ bValue = bValue.toString().split("-")[0];
155
+ }
156
+ return aValue > bValue ? 1 : -1;
157
+ }).filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()))
150
158
  : options.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
151
159
  setFilteredOptions(_options);
152
160
  const grouped = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.765",
3
+ "version": "1.2.766",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",