rockin 0.0.19 → 0.0.20

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.
@@ -850,6 +850,7 @@ function GridAsyncComboboxCell({
850
850
  const selectedValue = value ?? String(cell.value ?? "");
851
851
  const [query, setQuery] = React3.useState("");
852
852
  const [options, setOptions] = React3.useState([]);
853
+ const [selectedOption, setSelectedOption] = React3.useState(null);
853
854
  const [isLoading, setIsLoading] = React3.useState(false);
854
855
  const requestId = React3.useRef(0);
855
856
  const loadOptionsRef = React3.useRef(loadOptions);
@@ -892,19 +893,21 @@ function GridAsyncComboboxCell({
892
893
  }
893
894
  };
894
895
  }, [debounceMs, minQueryLength, query, stableLoadOptions]);
896
+ const selectedItem = options.find((option) => option.value === selectedValue) ?? (selectedOption?.value === selectedValue ? selectedOption : null);
895
897
  return /* @__PURE__ */ jsxs2(
896
898
  Combobox,
897
899
  {
898
900
  items: options,
899
- itemToStringLabel: (item) => options.find((option) => option.value === item)?.label ?? String(item ?? ""),
900
- onValueChange: (nextValue) => {
901
- if (nextValue === null) return;
902
- const option = options.find((item) => item.value === nextValue);
903
- onChange?.(nextValue, option);
904
- cell.grid.updateCell(cell.rowId, cell.columnId, nextValue);
905
- setQuery(option?.label ?? nextValue);
901
+ itemToStringLabel: (item) => item?.label ?? "",
902
+ itemToStringValue: (item) => item?.value ?? "",
903
+ onValueChange: (nextOption) => {
904
+ if (nextOption === null) return;
905
+ setSelectedOption(nextOption);
906
+ onChange?.(nextOption.value, nextOption);
907
+ cell.grid.updateCell(cell.rowId, cell.columnId, nextOption.value);
908
+ setQuery(nextOption.label);
906
909
  },
907
- value: selectedValue,
910
+ value: selectedItem,
908
911
  children: [
909
912
  /* @__PURE__ */ jsx7(
910
913
  ComboboxInput,
@@ -919,7 +922,7 @@ function GridAsyncComboboxCell({
919
922
  /* @__PURE__ */ jsxs2(ComboboxContent, { children: [
920
923
  isLoading && /* @__PURE__ */ jsx7(ComboboxEmpty, { children: "Loading..." }),
921
924
  !isLoading && query.trim().length >= minQueryLength && options.length === 0 && /* @__PURE__ */ jsx7(ComboboxEmpty, { children: "No results found." }),
922
- /* @__PURE__ */ jsx7(ComboboxList, { children: options.map((option) => /* @__PURE__ */ jsx7(ComboboxItem, { value: option.value, children: option.label }, option.value)) })
925
+ /* @__PURE__ */ jsx7(ComboboxList, { children: options.map((option) => /* @__PURE__ */ jsx7(ComboboxItem, { value: option, children: option.label }, option.value)) })
923
926
  ] })
924
927
  ]
925
928
  }
@@ -17,7 +17,7 @@ import {
17
17
  useDataTableSearch,
18
18
  useMediaQuery,
19
19
  useMounted
20
- } from "../chunk-J2SGPPFU.js";
20
+ } from "../chunk-JOEZM5MO.js";
21
21
  import "../chunk-ATPUW3SQ.js";
22
22
 
23
23
  // src/hooks/useSearchParams.ts
package/dist/ui/index.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  useDataTableSearch,
46
46
  useMediaQuery,
47
47
  useMounted
48
- } from "../chunk-J2SGPPFU.js";
48
+ } from "../chunk-JOEZM5MO.js";
49
49
  import {
50
50
  Tooltip,
51
51
  TooltipContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rockin",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Reusable React UI components, hooks, icons, utilities, and styles for Rock Star projects.",
5
5
  "keywords": [
6
6
  "react",