@motor-hero/ui-kit 0.48.0 → 0.48.1
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/components/combobox.d.ts.map +1 -1
- package/dist/components/multi-combobox.d.ts.map +1 -1
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/combobox.tsx +4 -1
- package/src/components/multi-combobox.tsx +6 -2
package/dist/index.js
CHANGED
|
@@ -748,7 +748,10 @@ function Combobox({
|
|
|
748
748
|
const selected = fromPage ?? (value ? labelCache.current.get(value) : void 0) ?? (creatable && value ? { value, label: value } : void 0);
|
|
749
749
|
const handleOpenChange = (next) => {
|
|
750
750
|
setOpen(next);
|
|
751
|
-
if (!next)
|
|
751
|
+
if (!next) {
|
|
752
|
+
setSearch("");
|
|
753
|
+
onSearchChange?.("");
|
|
754
|
+
}
|
|
752
755
|
};
|
|
753
756
|
const handleSelect = (next) => {
|
|
754
757
|
onChange(deselectable && next === value ? "" : next);
|
|
@@ -1789,6 +1792,10 @@ function MultiCombobox({
|
|
|
1789
1792
|
const [open, setOpen] = React8.useState(false);
|
|
1790
1793
|
const isDesktop = useIsDesktop();
|
|
1791
1794
|
const isServer = onSearchChange !== void 0;
|
|
1795
|
+
const handleOpenChange = (next) => {
|
|
1796
|
+
setOpen(next);
|
|
1797
|
+
if (!next) onSearchChange?.("");
|
|
1798
|
+
};
|
|
1792
1799
|
const labelCache = React8.useRef(/* @__PURE__ */ new Map());
|
|
1793
1800
|
const byValue = /* @__PURE__ */ new Map();
|
|
1794
1801
|
for (const option of options) byValue.set(option.value, option);
|
|
@@ -1917,7 +1924,7 @@ function MultiCombobox({
|
|
|
1917
1924
|
}
|
|
1918
1925
|
);
|
|
1919
1926
|
if (isDesktop) {
|
|
1920
|
-
return /* @__PURE__ */ jsxs17(PopoverPrimitive5.Root, { open, onOpenChange:
|
|
1927
|
+
return /* @__PURE__ */ jsxs17(PopoverPrimitive5.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
1921
1928
|
/* @__PURE__ */ jsx21(PopoverPrimitive5.Trigger, { asChild: true, disabled, children: trigger }),
|
|
1922
1929
|
/* @__PURE__ */ jsx21(PopoverPrimitive5.Portal, { children: /* @__PURE__ */ jsx21(
|
|
1923
1930
|
PopoverPrimitive5.Content,
|
|
@@ -1931,7 +1938,7 @@ function MultiCombobox({
|
|
|
1931
1938
|
) })
|
|
1932
1939
|
] });
|
|
1933
1940
|
}
|
|
1934
|
-
return /* @__PURE__ */ jsxs17(DrawerPrimitive5.Root, { open, onOpenChange:
|
|
1941
|
+
return /* @__PURE__ */ jsxs17(DrawerPrimitive5.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
1935
1942
|
/* @__PURE__ */ jsx21(DrawerPrimitive5.Trigger, { asChild: true, disabled, children: trigger }),
|
|
1936
1943
|
/* @__PURE__ */ jsxs17(DrawerPrimitive5.Portal, { children: [
|
|
1937
1944
|
/* @__PURE__ */ jsx21(DrawerPrimitive5.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|