@moontra/moonui-pro 2.26.19 → 2.26.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.
package/dist/index.mjs CHANGED
@@ -73509,6 +73509,7 @@ function DataTableQuickFilter({
73509
73509
  data
73510
73510
  }) {
73511
73511
  const [open, setOpen] = useState(false);
73512
+ const [searchValue, setSearchValue] = useState("");
73512
73513
  const column = t__default.useMemo(() => {
73513
73514
  let col = table.getColumn(filter.column);
73514
73515
  if (!col) {
@@ -73592,8 +73593,16 @@ function DataTableQuickFilter({
73592
73593
  };
73593
73594
  const handleClear = () => {
73594
73595
  column?.setFilterValue(void 0);
73596
+ setSearchValue("");
73595
73597
  };
73596
73598
  const label = filter.label || filter.column;
73599
+ const filteredOptions = useMemo(() => {
73600
+ if (!searchValue)
73601
+ return availableOptions;
73602
+ return availableOptions.filter(
73603
+ (option) => option.toLowerCase().includes(searchValue.toLowerCase())
73604
+ );
73605
+ }, [availableOptions, searchValue]);
73597
73606
  const isDisabled = !column || availableOptions.length === 0;
73598
73607
  return /* @__PURE__ */ jsxs(MoonUIPopoverPro, { open, onOpenChange: setOpen, children: [
73599
73608
  /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
@@ -73623,7 +73632,19 @@ function DataTableQuickFilter({
73623
73632
  }
73624
73633
  ) }),
73625
73634
  /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-[250px] p-0", align: "start", children: /* @__PURE__ */ jsxs("div", { className: "p-2", children: [
73626
- availableOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-center text-sm text-muted-foreground py-4", children: "No options available" }) : /* @__PURE__ */ jsx("div", { className: "space-y-1", children: availableOptions.map((option) => {
73635
+ availableOptions.length > 0 && /* @__PURE__ */ jsx("div", { className: "pb-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
73636
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
73637
+ /* @__PURE__ */ jsx(
73638
+ MoonUIInputPro,
73639
+ {
73640
+ placeholder: `Search ${label.toLowerCase()}...`,
73641
+ value: searchValue,
73642
+ onChange: (e) => setSearchValue(e.target.value),
73643
+ className: "h-8 w-full pl-8"
73644
+ }
73645
+ )
73646
+ ] }) }),
73647
+ availableOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-center text-sm text-muted-foreground py-4", children: "No options available" }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-center text-sm text-muted-foreground py-4", children: "No results found" }) : /* @__PURE__ */ jsx("div", { className: "space-y-1 max-h-[300px] overflow-y-auto", children: filteredOptions.map((option) => {
73627
73648
  const isSelected = selectedValues.has(option);
73628
73649
  return /* @__PURE__ */ jsxs(
73629
73650
  "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.26.19",
3
+ "version": "2.26.20",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",