@moontra/moonui-pro 2.26.13 → 2.26.15

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
@@ -73508,6 +73508,7 @@ function DataTableQuickFilter({
73508
73508
  filter,
73509
73509
  data
73510
73510
  }) {
73511
+ const [searchValue, setSearchValue] = useState("");
73511
73512
  const column = table.getColumn(filter.column);
73512
73513
  if (!column) {
73513
73514
  return null;
@@ -73519,6 +73520,17 @@ function DataTableQuickFilter({
73519
73520
  if (filterValueAccessor) {
73520
73521
  return filterValueAccessor(row);
73521
73522
  }
73523
+ const accessor = column.columnDef.accessorKey || column.columnDef.accessorFn;
73524
+ if (typeof accessor === "function") {
73525
+ return accessor(row);
73526
+ } else if (accessor) {
73527
+ const keys2 = accessor.split(".");
73528
+ let value2 = row;
73529
+ for (const key of keys2) {
73530
+ value2 = value2?.[key];
73531
+ }
73532
+ return value2;
73533
+ }
73522
73534
  const value = row[filter.column];
73523
73535
  return value;
73524
73536
  };
@@ -73536,8 +73548,17 @@ function DataTableQuickFilter({
73536
73548
  uniqueValues.add(String(value));
73537
73549
  }
73538
73550
  });
73539
- return Array.from(uniqueValues).sort().slice(0, 50);
73540
- }, [data, filter.options, filterOptions]);
73551
+ const options = Array.from(uniqueValues).sort().slice(0, 50);
73552
+ if (typeof window !== "undefined" && true) {
73553
+ console.log(`QuickFilter Debug [${filter.column}]:`, {
73554
+ dataLength: data.length,
73555
+ uniqueValues: uniqueValues.size,
73556
+ options,
73557
+ filterOptions: filter.options
73558
+ });
73559
+ }
73560
+ return options;
73561
+ }, [data, filter.options, filterOptions, filter.column]);
73541
73562
  const optionCounts = useMemo(() => {
73542
73563
  if (!filter.showCounts)
73543
73564
  return {};
@@ -73585,7 +73606,15 @@ function DataTableQuickFilter({
73585
73606
  };
73586
73607
  const handleClear = () => {
73587
73608
  column.setFilterValue(void 0);
73609
+ setSearchValue("");
73588
73610
  };
73611
+ const filteredOptions = useMemo(() => {
73612
+ if (!searchValue)
73613
+ return availableOptions;
73614
+ return availableOptions.filter(
73615
+ (option) => option.toLowerCase().includes(searchValue.toLowerCase())
73616
+ );
73617
+ }, [availableOptions, searchValue]);
73589
73618
  return /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
73590
73619
  /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
73591
73620
  MoonUIButtonPro,
@@ -73612,35 +73641,40 @@ function DataTableQuickFilter({
73612
73641
  ]
73613
73642
  }
73614
73643
  ) }),
73615
- /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-[250px] p-0", align: "start", children: /* @__PURE__ */ jsxs(MoonUICommandPro, { children: [
73616
- /* @__PURE__ */ jsx(MoonUICommandInputPro, { placeholder: `Search ${label.toLowerCase()}...` }),
73617
- /* @__PURE__ */ jsxs(MoonUICommandListPro, { children: [
73618
- /* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No results found." }),
73619
- /* @__PURE__ */ jsx(MoonUICommandGroupPro, { children: availableOptions.map((option) => {
73620
- const isSelected = selectedValues.has(option);
73621
- return /* @__PURE__ */ jsxs(
73622
- MoonUICommandItemPro,
73623
- {
73624
- onSelect: () => handleSelect(option),
73625
- children: [
73626
- /* @__PURE__ */ jsx(
73627
- "div",
73628
- {
73629
- className: cn(
73630
- "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
73631
- isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
73632
- ),
73633
- children: /* @__PURE__ */ jsx(Check, { className: cn("h-4 w-4") })
73634
- }
73635
- ),
73636
- /* @__PURE__ */ jsx("span", { className: "flex-1", children: option }),
73637
- filter.showCounts && optionCounts[option] !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: optionCounts[option] })
73638
- ]
73639
- },
73640
- option
73641
- );
73642
- }) })
73643
- ] }),
73644
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-[250px] p-0", align: "start", children: /* @__PURE__ */ jsxs(MoonUICommandPro, { shouldFilter: false, children: [
73645
+ /* @__PURE__ */ jsx(
73646
+ MoonUICommandInputPro,
73647
+ {
73648
+ placeholder: `Search ${label.toLowerCase()}...`,
73649
+ value: searchValue,
73650
+ onValueChange: setSearchValue
73651
+ }
73652
+ ),
73653
+ /* @__PURE__ */ jsx(MoonUICommandListPro, { children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No results found" }) : /* @__PURE__ */ jsx(MoonUICommandGroupPro, { children: filteredOptions.map((option) => {
73654
+ const isSelected = selectedValues.has(option);
73655
+ return /* @__PURE__ */ jsxs(
73656
+ MoonUICommandItemPro,
73657
+ {
73658
+ value: option,
73659
+ onSelect: () => handleSelect(option),
73660
+ children: [
73661
+ /* @__PURE__ */ jsx(
73662
+ "div",
73663
+ {
73664
+ className: cn(
73665
+ "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
73666
+ isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
73667
+ ),
73668
+ children: /* @__PURE__ */ jsx(Check, { className: cn("h-4 w-4") })
73669
+ }
73670
+ ),
73671
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: option }),
73672
+ filter.showCounts && optionCounts[option] !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: optionCounts[option] })
73673
+ ]
73674
+ },
73675
+ option
73676
+ );
73677
+ }) }) }),
73644
73678
  selectedValues.size > 0 && /* @__PURE__ */ jsx("div", { className: "border-t p-2", children: /* @__PURE__ */ jsxs(
73645
73679
  MoonUIButtonPro,
73646
73680
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.26.13",
3
+ "version": "2.26.15",
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",