@moontra/moonui-pro 2.26.12 → 2.26.14

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;
@@ -73585,7 +73586,15 @@ function DataTableQuickFilter({
73585
73586
  };
73586
73587
  const handleClear = () => {
73587
73588
  column.setFilterValue(void 0);
73589
+ setSearchValue("");
73588
73590
  };
73591
+ const filteredOptions = useMemo(() => {
73592
+ if (!searchValue)
73593
+ return availableOptions;
73594
+ return availableOptions.filter(
73595
+ (option) => option.toLowerCase().includes(searchValue.toLowerCase())
73596
+ );
73597
+ }, [availableOptions, searchValue]);
73589
73598
  return /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
73590
73599
  /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
73591
73600
  MoonUIButtonPro,
@@ -73612,35 +73621,40 @@ function DataTableQuickFilter({
73612
73621
  ]
73613
73622
  }
73614
73623
  ) }),
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
- ] }),
73624
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-[250px] p-0", align: "start", children: /* @__PURE__ */ jsxs(MoonUICommandPro, { shouldFilter: false, children: [
73625
+ /* @__PURE__ */ jsx(
73626
+ MoonUICommandInputPro,
73627
+ {
73628
+ placeholder: `Search ${label.toLowerCase()}...`,
73629
+ value: searchValue,
73630
+ onValueChange: setSearchValue
73631
+ }
73632
+ ),
73633
+ /* @__PURE__ */ jsx(MoonUICommandListPro, { children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No results found" }) : /* @__PURE__ */ jsx(MoonUICommandGroupPro, { children: filteredOptions.map((option) => {
73634
+ const isSelected = selectedValues.has(option);
73635
+ return /* @__PURE__ */ jsxs(
73636
+ MoonUICommandItemPro,
73637
+ {
73638
+ value: option,
73639
+ onSelect: () => handleSelect(option),
73640
+ children: [
73641
+ /* @__PURE__ */ jsx(
73642
+ "div",
73643
+ {
73644
+ className: cn(
73645
+ "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
73646
+ isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
73647
+ ),
73648
+ children: /* @__PURE__ */ jsx(Check, { className: cn("h-4 w-4") })
73649
+ }
73650
+ ),
73651
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: option }),
73652
+ filter.showCounts && optionCounts[option] !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: optionCounts[option] })
73653
+ ]
73654
+ },
73655
+ option
73656
+ );
73657
+ }) }) }),
73644
73658
  selectedValues.size > 0 && /* @__PURE__ */ jsx("div", { className: "border-t p-2", children: /* @__PURE__ */ jsxs(
73645
73659
  MoonUIButtonPro,
73646
73660
  {
@@ -73710,7 +73724,7 @@ function DataTableFacetedFilter({
73710
73724
  return label.toLowerCase().includes(searchQuery.toLowerCase());
73711
73725
  });
73712
73726
  }, [availableOptions, searchQuery]);
73713
- const displayTitle = title || columnId;
73727
+ const displayTitle = title || column.columnDef.header || columnId;
73714
73728
  const handleSelect = (value) => {
73715
73729
  const newValues = new Set(selectedValues);
73716
73730
  if (newValues.has(value)) {
@@ -74152,15 +74166,20 @@ function DataTable({
74152
74166
  },
74153
74167
  `quick-${filter.column}-${index2}`
74154
74168
  )) }),
74155
- facetedFilters.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: facetedFilters.map((columnId) => /* @__PURE__ */ jsx(
74156
- DataTableFacetedFilter,
74157
- {
74158
- table,
74159
- column: columnId,
74160
- data
74161
- },
74162
- `faceted-${columnId}`
74163
- )) }),
74169
+ facetedFilters.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: facetedFilters.map((filter, index2) => {
74170
+ const columnId = typeof filter === "string" ? filter : filter.column;
74171
+ const label = typeof filter === "string" ? void 0 : filter.label;
74172
+ return /* @__PURE__ */ jsx(
74173
+ DataTableFacetedFilter,
74174
+ {
74175
+ table,
74176
+ column: columnId,
74177
+ title: label,
74178
+ data
74179
+ },
74180
+ `faceted-${columnId}-${index2}`
74181
+ );
74182
+ }) }),
74164
74183
  filterable && /* @__PURE__ */ jsxs(
74165
74184
  MoonUIButtonPro,
74166
74185
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.26.12",
3
+ "version": "2.26.14",
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",