@ai-matrx/design-system 0.60.8 → 0.60.9

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/data-table/copy-helpers.d.cts +1 -1
  3. package/dist/data-table/copy-helpers.d.ts +1 -1
  4. package/dist/data-table/filter-engine.d.cts +1 -1
  5. package/dist/data-table/filter-engine.d.ts +1 -1
  6. package/dist/data-table/host.d.cts +1 -1
  7. package/dist/data-table/host.d.ts +1 -1
  8. package/dist/data-table/index.cjs +357 -334
  9. package/dist/data-table/index.cjs.map +1 -1
  10. package/dist/data-table/index.d.cts +2 -2
  11. package/dist/data-table/index.d.ts +2 -2
  12. package/dist/data-table/index.js +357 -334
  13. package/dist/data-table/index.js.map +1 -1
  14. package/dist/data-table/infer-filter.d.cts +1 -1
  15. package/dist/data-table/infer-filter.d.ts +1 -1
  16. package/dist/data-table/layered-filters.d.cts +1 -1
  17. package/dist/data-table/layered-filters.d.ts +1 -1
  18. package/dist/data-table/query-control.d.cts +1 -1
  19. package/dist/data-table/query-control.d.ts +1 -1
  20. package/dist/data-table/types.cjs.map +1 -1
  21. package/dist/data-table/types.d.cts +1 -1
  22. package/dist/data-table/types.d.ts +1 -1
  23. package/dist/data-table/url-state.d.cts +1 -1
  24. package/dist/data-table/url-state.d.ts +1 -1
  25. package/dist/data-table/xlsx.d.cts +1 -1
  26. package/dist/data-table/xlsx.d.ts +1 -1
  27. package/dist/index.cjs +365 -233
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +19 -2
  30. package/dist/index.d.ts +19 -2
  31. package/dist/index.js +365 -233
  32. package/dist/index.js.map +1 -1
  33. package/dist/{layered-filters-BsnawJgC.d.ts → layered-filters-B0q8G3QR.d.ts} +21 -0
  34. package/dist/{layered-filters-C9MwGVTc.d.cts → layered-filters-CisXX8K5.d.cts} +21 -0
  35. package/package.json +1 -1
@@ -34013,7 +34013,7 @@ function ScopeFilter({ filter, id }) {
34013
34013
  value: filter.value,
34014
34014
  disabled: filter.disabled,
34015
34015
  onChange: (event) => filter.onChange?.(event.target.value),
34016
- className: "h-[var(--matrx-table-control-size,2rem)] min-w-0 max-w-full rounded-md border border-input bg-background px-2 text-xs text-foreground disabled:opacity-50",
34016
+ className: "h-[var(--matrx-table-control-size,2rem)] min-w-0 max-w-full rounded-md border border-input bg-background px-2 text-sm text-foreground disabled:opacity-50",
34017
34017
  children: filter.options?.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value))
34018
34018
  }
34019
34019
  )
@@ -34029,7 +34029,7 @@ function TableScopeBar({ lanes, value, onChange, dimension, organization }) {
34029
34029
  "aria-label": "Record scope",
34030
34030
  value,
34031
34031
  onChange: (event) => onChange(event.target.value),
34032
- className: "h-[var(--matrx-table-control-size,2rem)] w-full rounded-md border border-input bg-background px-2 text-xs sm:hidden",
34032
+ className: "h-[var(--matrx-table-control-size,2rem)] w-full rounded-md border border-input bg-background px-2 text-sm sm:hidden",
34033
34033
  children: lanes.map((lane) => /* @__PURE__ */ jsxs("option", { value: lane.value, disabled: lane.disabled, children: [
34034
34034
  lane.label,
34035
34035
  lane.count == null ? "" : ` (${lane.count.toLocaleString()})`
@@ -34045,10 +34045,10 @@ function TableScopeBar({ lanes, value, onChange, dimension, organization }) {
34045
34045
  "aria-label": lane.count == null ? lane.label : `${lane.label}, ${lane.count.toLocaleString()} records`,
34046
34046
  disabled: lane.disabled,
34047
34047
  onClick: () => onChange(lane.value),
34048
- className: `h-[var(--matrx-table-control-size,2rem)] shrink-0 whitespace-nowrap border-b-2 px-2 text-xs disabled:opacity-50 ${value === lane.value ? "border-primary font-semibold text-foreground" : "border-transparent text-muted-foreground"}`,
34048
+ className: `h-[var(--matrx-table-control-size,2rem)] shrink-0 whitespace-nowrap border-b-2 px-2 text-sm font-medium disabled:opacity-50 ${value === lane.value ? "border-primary font-semibold text-foreground" : "border-transparent text-muted-foreground"}`,
34049
34049
  children: [
34050
34050
  lane.label,
34051
- lane.count == null ? null : /* @__PURE__ */ jsx("span", { className: "ml-1 text-[10px] tabular-nums", children: lane.count.toLocaleString() })
34051
+ lane.count == null ? null : /* @__PURE__ */ jsx("span", { className: "ml-1 text-xs tabular-nums", children: lane.count.toLocaleString() })
34052
34052
  ]
34053
34053
  },
34054
34054
  lane.value
@@ -52805,6 +52805,8 @@ function MatrxDataTableCore(coreProps) {
52805
52805
  stickyHeader = true,
52806
52806
  className,
52807
52807
  tableClassName,
52808
+ frameHeight = "fill",
52809
+ emptyHeader = "show",
52808
52810
  mobileCards,
52809
52811
  mobileCardsBreakpoint = "sm",
52810
52812
  getRowHref,
@@ -53745,6 +53747,10 @@ function MatrxDataTableCore(coreProps) {
53745
53747
  ]);
53746
53748
  const totalItems = appendQuery ? appendQuery.pagination.totalItems ?? processed.length : remoteQuery?.mode === "controlled" ? Math.max(0, remoteQuery.totalItems) : processed.length;
53747
53749
  const sourceTotal = sourceProcessing?.sourceTotal;
53750
+ const sortSourceTotal = appendQuery ? appendQuery.pagination.sourceRecords ? appendQuery.pagination.sourceRecords.total : appendQuery.pagination.totalItems : remoteQuery?.mode === "controlled" ? remoteQuery.totalItems : sourceTotal;
53751
+ const sortSourceLoaded = appendQuery?.pagination.sourceRecords?.loaded ?? data.length;
53752
+ const sortSourceIsPartial = sortSourceTotal === void 0 ? Boolean(appendQuery?.pagination.hasNextPage || appendQuery?.pagination.error) : sortSourceLoaded < sortSourceTotal;
53753
+ const localSortNotice = sort !== null && !sourceOwnsSort && (appendQuery !== null || remoteQuery?.mode === "controlled") && sortSourceIsPartial ? appendQuery ? "Sorted within loaded rows; unloaded rows have not been included." : "Sorted within this source page; other pages keep the server order." : null;
53748
53754
  const allRowsAreLoaded = !remoteQuery && (sourceTotal === void 0 || sourceTotal <= data.length);
53749
53755
  const effectivePageSize = remoteQuery ? Math.max(pageSize, 1) : pageSize === 0 ? Math.max(totalItems, 1) : Math.max(pageSize, 1);
53750
53756
  const pageCount = Math.max(1, Math.ceil(totalItems / effectivePageSize));
@@ -55446,6 +55452,9 @@ function MatrxDataTableCore(coreProps) {
55446
55452
  // horizontally. The translucent zebra/hover tints remain
55447
55453
  // desktop-only so densely layered mobile content stays crisp.
55448
55454
  "group/matrx-row border-b border-border/60 bg-card transition-colors",
55455
+ // A row a host's keyboard cursor focuses (tabIndex -1, e.g. the list shell's row
55456
+ // keys) shows where it is — owned here, never by a host's `[&_[data-row-id]]` reach.
55457
+ "focus-visible:bg-accent focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary",
55449
55458
  (detailEnabled || Boolean(onRowOpen) || canExpandRow(row)) && "cursor-pointer",
55450
55459
  rowClassName?.(row, index),
55451
55460
  draggedRowId === id && "opacity-40",
@@ -55877,7 +55886,6 @@ function MatrxDataTableCore(coreProps) {
55877
55886
  notice,
55878
55887
  savedViewError ? /* @__PURE__ */ jsx60(ErrorBox, { className: "shrink-0 text-xs text-destructive", message: savedViewError, operation: "Save or apply a saved view", origin: "design-system/MatrxDataTable" }) : null,
55879
55888
  toolbarActionError ? /* @__PURE__ */ jsx60(ErrorBox, { className: "shrink-0 text-xs text-destructive", message: toolbarActionError, operation: "Run a table toolbar action", origin: "design-system/MatrxDataTable" }) : null,
55880
- scopeBar ? /* @__PURE__ */ jsx60(TableScopeBar, { ...scopeBar }) : null,
55881
55889
  summaryMetrics.length > 0 ? /* @__PURE__ */ jsx60(
55882
55890
  "section",
55883
55891
  {
@@ -55886,7 +55894,7 @@ function MatrxDataTableCore(coreProps) {
55886
55894
  "aria-label": `Table summary: ${summaryCaption}`,
55887
55895
  className: "flex w-full min-w-0 shrink-0 flex-nowrap items-stretch gap-2 overflow-x-auto overscroll-x-contain",
55888
55896
  children: summaryMetrics.map((metric) => /* @__PURE__ */ jsxs49("div", { className: "min-w-24 shrink-0 whitespace-nowrap rounded-md border border-border bg-card px-3 py-2 shadow-xs", children: [
55889
- /* @__PURE__ */ jsx60("div", { className: "text-xs text-muted-foreground", children: metric.label }),
55897
+ /* @__PURE__ */ jsx60("div", { className: "text-sm font-medium text-muted-foreground", children: metric.label }),
55890
55898
  /* @__PURE__ */ jsxs49("div", { className: "mt-0.5 text-sm font-semibold tabular-nums text-foreground", children: [
55891
55899
  metric.value,
55892
55900
  metric.unavailable ? /* @__PURE__ */ jsx60(ErrorBox, { as: "span", className: "sr-only", message: `${metric.label} is unavailable`, operation: "Summarize this table", origin: "design-system/MatrxDataTable" }) : null
@@ -55894,359 +55902,372 @@ function MatrxDataTableCore(coreProps) {
55894
55902
  ] }, metric.id))
55895
55903
  }
55896
55904
  ) : null,
55897
- /* @__PURE__ */ jsx60(MatrxTableChrome, { part: "toolbar", epoch: toolbarEpoch, render: () => placeToolbar(!hideToolbar && (showViewTabs || toolbar?.title || toolbar?.titleCount || showSearch || toolbar?.customSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || savedViewsId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs49(
55898
- TableTitleRow,
55899
- {
55900
- ...toolbar?.singleRow ? { singleRow: true } : {},
55901
- tabs: viewTabs && viewTabsStore ? /* @__PURE__ */ jsx60(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applyLatestSavedView, related: relatedTableActions, ...viewTabsStore ? { store: viewTabsStore } : {} }, savedViewsId ?? "table") : viewTabs && savedViewsId && SavedViews ? /* @__PURE__ */ jsx60(SavedViews, { tableId: savedViewsId, snapshot: currentViewSnapshot, defaultSnapshot: declaredDefaultViewSnapshot, onApply: applyLatestSavedView, presentation: "tabs", related: relatedTableActions }) : void 0,
55902
- ...toolbar?.title === void 0 ? {} : { title: toolbar.title },
55903
- ...toolbar?.titleCount === void 0 ? {} : { count: toolbar.titleCount },
55904
- context: savedViewsId && SavedViews && !viewTabs ? /* @__PURE__ */ jsx60("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx60(
55905
- SavedViews,
55906
- {
55907
- tableId: savedViewsId,
55908
- snapshot: currentViewSnapshot,
55909
- defaultSnapshot: declaredDefaultViewSnapshot,
55910
- onApply: applyLatestSavedView
55911
- }
55912
- ) }) : void 0,
55913
- search: (toolbarSearch.node = toolbar?.customSearch ?? (showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ jsx60(
55914
- TableSearch,
55915
- {
55916
- value: searchValue,
55917
- onChange: setSearchValue,
55918
- scope: searchScope,
55919
- onScopeChange: setSearchScope,
55920
- scopes: intelligentSearchScopes,
55921
- ...toolbar?.searchPlaceholder === void 0 ? {} : { placeholder: toolbar.searchPlaceholder }
55922
- }
55923
- ) : /* @__PURE__ */ jsxs49(
55924
- "div",
55905
+ scopeBar ? /* @__PURE__ */ jsx60(TableScopeBar, { ...scopeBar }) : null,
55906
+ /* @__PURE__ */ jsx60(MatrxTableChrome, { part: "toolbar", epoch: toolbarEpoch, render: () => {
55907
+ const tabsNode = viewTabs && viewTabsStore ? /* @__PURE__ */ jsx60(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applyLatestSavedView, related: relatedTableActions, ...viewTabsStore ? { store: viewTabsStore } : {} }, savedViewsId ?? "table") : viewTabs && savedViewsId && SavedViews ? /* @__PURE__ */ jsx60(SavedViews, { tableId: savedViewsId, snapshot: currentViewSnapshot, defaultSnapshot: declaredDefaultViewSnapshot, onApply: applyLatestSavedView, presentation: "tabs", related: relatedTableActions }) : void 0;
55908
+ const tabsPlaced = Boolean(toolbar && "tabsPortalInto" in toolbar);
55909
+ const tabsTarget = toolbar && "tabsPortalInto" in toolbar ? toolbar.tabsPortalInto : null;
55910
+ return /* @__PURE__ */ jsxs49(Fragment20, { children: [
55911
+ tabsPlaced && tabsTarget && tabsNode && !hideToolbar ? createPortal4(
55912
+ /* @__PURE__ */ jsx60("div", { "data-matrx-table-toolbar-tabs": "", "data-matrx-table-tabs-placed": "", className: "flex min-w-0 max-w-full [&_[data-matrx-table-tabs]]:border-b-0", children: tabsNode }),
55913
+ tabsTarget
55914
+ ) : null,
55915
+ placeToolbar(!hideToolbar && (showViewTabs || toolbar?.title || toolbar?.titleCount || showSearch || toolbar?.customSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || savedViewsId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs49(
55916
+ TableTitleRow,
55925
55917
  {
55926
- "data-matrx-table-search": true,
55927
- className: cn(
55928
- "flex min-w-0 flex-1 sm:w-full sm:flex-none",
55929
- toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
55930
- ),
55918
+ ...toolbar?.singleRow ? { singleRow: true } : {},
55919
+ tabs: tabsPlaced ? void 0 : tabsNode,
55920
+ ...toolbar?.title === void 0 ? {} : { title: toolbar.title },
55921
+ ...toolbar?.titleCount === void 0 ? {} : { count: toolbar.titleCount },
55922
+ context: savedViewsId && SavedViews && !viewTabs ? /* @__PURE__ */ jsx60("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx60(
55923
+ SavedViews,
55924
+ {
55925
+ tableId: savedViewsId,
55926
+ snapshot: currentViewSnapshot,
55927
+ defaultSnapshot: declaredDefaultViewSnapshot,
55928
+ onApply: applyLatestSavedView
55929
+ }
55930
+ ) }) : void 0,
55931
+ search: (toolbarSearch.node = toolbar?.customSearch ?? (showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ jsx60(
55932
+ TableSearch,
55933
+ {
55934
+ value: searchValue,
55935
+ onChange: setSearchValue,
55936
+ scope: searchScope,
55937
+ onScopeChange: setSearchScope,
55938
+ scopes: intelligentSearchScopes,
55939
+ ...toolbar?.searchPlaceholder === void 0 ? {} : { placeholder: toolbar.searchPlaceholder }
55940
+ }
55941
+ ) : /* @__PURE__ */ jsxs49(
55942
+ "div",
55943
+ {
55944
+ "data-matrx-table-search": true,
55945
+ className: cn(
55946
+ "flex min-w-0 flex-1 sm:w-full sm:flex-none",
55947
+ toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
55948
+ ),
55949
+ children: [
55950
+ /* @__PURE__ */ jsxs49("div", { className: "relative min-w-0 flex-1", children: [
55951
+ /* @__PURE__ */ jsx60(Search, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
55952
+ /* @__PURE__ */ jsx60(
55953
+ Input,
55954
+ {
55955
+ value: searchValue,
55956
+ onChange: (e) => setSearchValue(e.target.value),
55957
+ placeholder: toolbar?.searchPlaceholder ?? "Search\u2026",
55958
+ className: cn(
55959
+ "h-8 pl-7 pr-7 text-sm",
55960
+ toolbar?.searchMatch && "rounded-r-none"
55961
+ ),
55962
+ style: { fontSize: "16px" }
55963
+ }
55964
+ ),
55965
+ searchValue ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
55966
+ /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60(
55967
+ "button",
55968
+ {
55969
+ type: "button",
55970
+ "aria-label": "Clear search",
55971
+ className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
55972
+ onClick: () => setSearchValue(""),
55973
+ children: /* @__PURE__ */ jsx60(X, { className: "h-5 w-5" })
55974
+ }
55975
+ ) }),
55976
+ /* @__PURE__ */ jsx60(TooltipContent, { children: "Clear search" })
55977
+ ] }) : null
55978
+ ] }),
55979
+ toolbar?.searchMatch ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
55980
+ /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs49(
55981
+ Button,
55982
+ {
55983
+ type: "button",
55984
+ variant: searchMatchMode === "whole_words" ? "secondary" : "outline",
55985
+ size: "sm",
55986
+ className: "h-8 shrink-0 gap-1 rounded-l-none border-l-0 px-2 text-xs",
55987
+ "aria-pressed": searchMatchMode === "whole_words",
55988
+ "aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
55989
+ onClick: () => setSearchMatchMode(
55990
+ searchMatchMode === "whole_words" ? "contains" : "whole_words"
55991
+ ),
55992
+ children: [
55993
+ /* @__PURE__ */ jsx60(WholeWord, { className: "h-5 w-5" }),
55994
+ searchMatchMode === "whole_words" ? "Whole words" : "Contains"
55995
+ ]
55996
+ }
55997
+ ) }),
55998
+ /* @__PURE__ */ jsx60(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
55999
+ ] }) : null
56000
+ ]
56001
+ }
56002
+ ) : null), pinnedFolded && pinnedRowActive ? void 0 : toolbarSearch.node),
55931
56003
  children: [
55932
- /* @__PURE__ */ jsxs49("div", { className: "relative min-w-0 flex-1", children: [
56004
+ toolbar?.layeredFilters ? /* @__PURE__ */ jsx60(
56005
+ LayeredFilterBuilder,
56006
+ {
56007
+ fields: toolbar.layeredFilters.fields,
56008
+ rules: layeredFilters,
56009
+ onChange: setLayeredFilters,
56010
+ maxRules: toolbar.layeredFilters.maxRules,
56011
+ label: toolbar.layeredFilters.label
56012
+ }
56013
+ ) : null,
56014
+ toolbar?.anyOf ? /* @__PURE__ */ jsxs49("div", { className: "relative w-full max-w-xs", children: [
55933
56015
  /* @__PURE__ */ jsx60(Search, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
55934
56016
  /* @__PURE__ */ jsx60(
55935
56017
  Input,
55936
56018
  {
55937
- value: searchValue,
55938
- onChange: (e) => setSearchValue(e.target.value),
55939
- placeholder: toolbar?.searchPlaceholder ?? "Search\u2026",
55940
- className: cn(
55941
- "h-8 pl-7 pr-7 text-sm",
55942
- toolbar?.searchMatch && "rounded-r-none"
55943
- ),
56019
+ value: anyOfValue,
56020
+ onChange: (e) => setAnyOfValue(e.target.value),
56021
+ placeholder: toolbar.anyOf.placeholder ?? "Match any of\u2026",
56022
+ className: "h-8 pl-7 pr-7 text-sm",
55944
56023
  style: { fontSize: "16px" }
55945
56024
  }
55946
56025
  ),
55947
- searchValue ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
56026
+ anyOfValue ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
55948
56027
  /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60(
55949
56028
  "button",
55950
56029
  {
55951
56030
  type: "button",
55952
- "aria-label": "Clear search",
56031
+ "aria-label": "Clear match-any search",
55953
56032
  className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
55954
- onClick: () => setSearchValue(""),
56033
+ onClick: () => setAnyOfValue(""),
55955
56034
  children: /* @__PURE__ */ jsx60(X, { className: "h-5 w-5" })
55956
56035
  }
55957
56036
  ) }),
55958
- /* @__PURE__ */ jsx60(TooltipContent, { children: "Clear search" })
56037
+ /* @__PURE__ */ jsx60(TooltipContent, { children: "Clear match-any search" })
55959
56038
  ] }) : null
55960
- ] }),
55961
- toolbar?.searchMatch ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
55962
- /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs49(
55963
- Button,
55964
- {
55965
- type: "button",
55966
- variant: searchMatchMode === "whole_words" ? "secondary" : "outline",
55967
- size: "sm",
55968
- className: "h-8 shrink-0 gap-1 rounded-l-none border-l-0 px-2 text-xs",
55969
- "aria-pressed": searchMatchMode === "whole_words",
55970
- "aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
55971
- onClick: () => setSearchMatchMode(
55972
- searchMatchMode === "whole_words" ? "contains" : "whole_words"
55973
- ),
55974
- children: [
55975
- /* @__PURE__ */ jsx60(WholeWord, { className: "h-5 w-5" }),
55976
- searchMatchMode === "whole_words" ? "Whole words" : "Contains"
55977
- ]
55978
- }
55979
- ) }),
55980
- /* @__PURE__ */ jsx60(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
55981
- ] }) : null
55982
- ]
55983
- }
55984
- ) : null), pinnedFolded && pinnedRowActive ? void 0 : toolbarSearch.node),
55985
- children: [
55986
- toolbar?.layeredFilters ? /* @__PURE__ */ jsx60(
55987
- LayeredFilterBuilder,
55988
- {
55989
- fields: toolbar.layeredFilters.fields,
55990
- rules: layeredFilters,
55991
- onChange: setLayeredFilters,
55992
- maxRules: toolbar.layeredFilters.maxRules,
55993
- label: toolbar.layeredFilters.label
55994
- }
55995
- ) : null,
55996
- toolbar?.anyOf ? /* @__PURE__ */ jsxs49("div", { className: "relative w-full max-w-xs", children: [
55997
- /* @__PURE__ */ jsx60(Search, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
55998
- /* @__PURE__ */ jsx60(
55999
- Input,
56000
- {
56001
- value: anyOfValue,
56002
- onChange: (e) => setAnyOfValue(e.target.value),
56003
- placeholder: toolbar.anyOf.placeholder ?? "Match any of\u2026",
56004
- className: "h-8 pl-7 pr-7 text-sm",
56005
- style: { fontSize: "16px" }
56006
- }
56007
- ),
56008
- anyOfValue ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
56009
- /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60(
56010
- "button",
56039
+ ] }) : null,
56040
+ renderedFacets ? /* @__PURE__ */ jsx60(ToolbarFacets, { facets: renderedFacets }) : null,
56041
+ toolbar?.leading ? /* @__PURE__ */ jsx60(
56042
+ "div",
56011
56043
  {
56012
- type: "button",
56013
- "aria-label": "Clear match-any search",
56014
- className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
56015
- onClick: () => setAnyOfValue(""),
56016
- children: /* @__PURE__ */ jsx60(X, { className: "h-5 w-5" })
56044
+ "data-matrx-table-toolbar-extras": true,
56045
+ className: "order-last flex w-full min-w-0 flex-wrap items-center gap-2",
56046
+ children: toolbar.leading
56017
56047
  }
56018
- ) }),
56019
- /* @__PURE__ */ jsx60(TooltipContent, { children: "Clear match-any search" })
56020
- ] }) : null
56021
- ] }) : null,
56022
- renderedFacets ? /* @__PURE__ */ jsx60(ToolbarFacets, { facets: renderedFacets }) : null,
56023
- toolbar?.leading ? /* @__PURE__ */ jsx60(
56024
- "div",
56025
- {
56026
- "data-matrx-table-toolbar-extras": true,
56027
- className: "order-last flex w-full min-w-0 flex-wrap items-center gap-2",
56028
- children: toolbar.leading
56029
- }
56030
- ) : null,
56031
- drill && drill.question.where.length > 0 ? /* @__PURE__ */ jsx60(
56032
- MatrxDrillTrail,
56033
- {
56034
- dimensions: drill.dimensions,
56035
- question: drill.question,
56036
- onQuestionChange: drill.onQuestionChange,
56037
- rootLabel: drill.rootLabel ?? "All records",
56038
- emptyLabel: drill.emptyLabel,
56039
- className: "max-w-full"
56040
- }
56041
- ) : null,
56042
- /* @__PURE__ */ jsxs49(
56043
- "div",
56044
- {
56045
- "data-matrx-table-actions": true,
56046
- className: cn(
56047
- "ml-auto flex min-w-0 items-center gap-0",
56048
- toolbar?.singleRow ? "shrink-0 flex-nowrap" : "flex-wrap"
56049
- ),
56050
- children: [
56051
- toolbar?.singleRow && coverageResult && coverageResult.notice ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
56052
- /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs49(
56053
- "span",
56054
- {
56055
- "data-matrx-table-coverage": true,
56056
- "data-matrx-table-coverage-scope": coverageResult.scope,
56057
- role: "status",
56058
- tabIndex: 0,
56059
- className: "mr-1 inline-flex shrink-0 items-center whitespace-nowrap rounded-md border border-amber-300/70 bg-amber-50 px-2 py-0.5 text-[11px] font-semibold text-amber-900 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-200",
56060
- children: [
56061
- coverageResult.badge,
56062
- /* @__PURE__ */ jsxs49("span", { className: "sr-only", children: [
56063
- ": ",
56064
- coverageResult.notice
56065
- ] })
56066
- ]
56067
- }
56068
- ) }),
56069
- /* @__PURE__ */ jsx60(TooltipContent, { className: "max-w-xs", children: coverageResult.notice })
56070
- ] }) : null,
56071
- renderToolbarControls(/* @__PURE__ */ jsxs49(Fragment20, { children: [
56072
- hasActiveFilters ? /* @__PURE__ */ jsx60(
56073
- TableToolbarAction,
56074
- {
56075
- HostAction: host.ToolbarAction,
56076
- ariaLabel: "Clear all filters",
56077
- tooltip: "Clear search and filters; keep columns and sort",
56078
- onClick: clearAllFilters,
56079
- children: /* @__PURE__ */ jsx60(Eraser, {})
56080
- }
56081
- ) : null,
56082
- drill ? /* @__PURE__ */ jsxs49(Fragment20, { children: [
56083
- drill.windowDimension ? /* @__PURE__ */ jsx60(
56084
- MatrxDrillWindowMenu,
56085
- {
56086
- question: drill.question,
56087
- onQuestionChange: drill.onQuestionChange,
56088
- dimensionLabel: drill.dimensions.find((d) => d.key === drill.windowDimension)?.label ?? drill.windowDimension
56089
- }
56090
- ) : null,
56091
- drillGrouped ? /* @__PURE__ */ jsx60(
56092
- MatrxDrillMeasurePicker,
56093
- {
56094
- measures: drill.measures,
56095
- question: drill.question,
56096
- onQuestionChange: drill.onQuestionChange
56097
- }
56098
- ) : null,
56099
- /* @__PURE__ */ jsx60(
56100
- MatrxDrillGroupByMenu,
56101
- {
56102
- dimensions: drill.dimensions,
56103
- question: drill.question,
56104
- onQuestionChange: drill.onQuestionChange
56105
- }
56106
- )
56107
- ] }) : grouping?.onColumnIdChange ? /* @__PURE__ */ jsxs49(
56108
- Select,
56109
- {
56110
- value: groupingColumnId ?? NO_GROUPING_VALUE,
56111
- onValueChange: (value) => grouping.onColumnIdChange?.(value === NO_GROUPING_VALUE ? null : value),
56112
- children: [
56048
+ ) : null,
56049
+ drill && drill.question.where.length > 0 ? /* @__PURE__ */ jsx60(
56050
+ MatrxDrillTrail,
56051
+ {
56052
+ dimensions: drill.dimensions,
56053
+ question: drill.question,
56054
+ onQuestionChange: drill.onQuestionChange,
56055
+ rootLabel: drill.rootLabel ?? "All records",
56056
+ emptyLabel: drill.emptyLabel,
56057
+ className: "max-w-full"
56058
+ }
56059
+ ) : null,
56060
+ /* @__PURE__ */ jsxs49(
56061
+ "div",
56062
+ {
56063
+ "data-matrx-table-actions": true,
56064
+ className: cn(
56065
+ "ml-auto flex min-w-0 items-center gap-0",
56066
+ toolbar?.singleRow ? "shrink-0 flex-nowrap" : "flex-wrap"
56067
+ ),
56068
+ children: [
56069
+ toolbar?.singleRow && coverageResult && coverageResult.notice ? /* @__PURE__ */ jsxs49(Tooltip, { children: [
56070
+ /* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs49(
56071
+ "span",
56072
+ {
56073
+ "data-matrx-table-coverage": true,
56074
+ "data-matrx-table-coverage-scope": coverageResult.scope,
56075
+ role: "status",
56076
+ tabIndex: 0,
56077
+ className: "mr-1 inline-flex shrink-0 items-center whitespace-nowrap rounded-md border border-amber-300/70 bg-amber-50 px-2 py-0.5 text-[11px] font-semibold text-amber-900 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-200",
56078
+ children: [
56079
+ coverageResult.badge,
56080
+ /* @__PURE__ */ jsxs49("span", { className: "sr-only", children: [
56081
+ ": ",
56082
+ coverageResult.notice
56083
+ ] })
56084
+ ]
56085
+ }
56086
+ ) }),
56087
+ /* @__PURE__ */ jsx60(TooltipContent, { className: "max-w-xs", children: coverageResult.notice })
56088
+ ] }) : null,
56089
+ renderToolbarControls(/* @__PURE__ */ jsxs49(Fragment20, { children: [
56090
+ hasActiveFilters ? /* @__PURE__ */ jsx60(
56091
+ TableToolbarAction,
56092
+ {
56093
+ HostAction: host.ToolbarAction,
56094
+ ariaLabel: "Clear all filters",
56095
+ tooltip: "Clear search and filters; keep columns and sort",
56096
+ onClick: clearAllFilters,
56097
+ children: /* @__PURE__ */ jsx60(Eraser, {})
56098
+ }
56099
+ ) : null,
56100
+ drill ? /* @__PURE__ */ jsxs49(Fragment20, { children: [
56101
+ drill.windowDimension ? /* @__PURE__ */ jsx60(
56102
+ MatrxDrillWindowMenu,
56103
+ {
56104
+ question: drill.question,
56105
+ onQuestionChange: drill.onQuestionChange,
56106
+ dimensionLabel: drill.dimensions.find((d) => d.key === drill.windowDimension)?.label ?? drill.windowDimension
56107
+ }
56108
+ ) : null,
56109
+ drillGrouped ? /* @__PURE__ */ jsx60(
56110
+ MatrxDrillMeasurePicker,
56111
+ {
56112
+ measures: drill.measures,
56113
+ question: drill.question,
56114
+ onQuestionChange: drill.onQuestionChange
56115
+ }
56116
+ ) : null,
56113
56117
  /* @__PURE__ */ jsx60(
56114
- SelectTrigger,
56118
+ MatrxDrillGroupByMenu,
56115
56119
  {
56116
- "data-matrx-table-group-by": true,
56117
- "aria-label": "Group rows by a column",
56118
- className: "h-8 w-auto min-w-[9rem] gap-1 text-xs",
56119
- children: /* @__PURE__ */ jsx60(SelectValue, { placeholder: "No groups" })
56120
+ dimensions: drill.dimensions,
56121
+ question: drill.question,
56122
+ onQuestionChange: drill.onQuestionChange
56120
56123
  }
56121
- ),
56122
- /* @__PURE__ */ jsxs49(SelectContent, { children: [
56123
- /* @__PURE__ */ jsx60(SelectItem, { value: NO_GROUPING_VALUE, children: "No groups" }),
56124
- groupableColumns.map((col) => /* @__PURE__ */ jsx60(SelectItem, { value: columnId(col), children: `Group by ${col.label ?? (typeof col.header === "string" ? col.header : columnId(col))}` }, columnId(col)))
56125
- ] })
56126
- ]
56127
- }
56128
- ) : null,
56129
- columns.length > 0 && toolbar?.columns !== false ? /* @__PURE__ */ jsx60(
56130
- TableToolbarAction,
56131
- {
56132
- HostAction: host.ToolbarAction,
56133
- ariaLabel: "Columns",
56134
- tooltip: "Show, hide, or reorder columns",
56135
- onClick: () => setColumnManagerOpen(true),
56136
- children: /* @__PURE__ */ jsx60(SlidersHorizontal, {})
56137
- }
56138
- ) : null,
56139
- toolbar?.refresh ? /* @__PURE__ */ jsx60(
56140
- TableToolbarAction,
56141
- {
56142
- HostAction: host.ToolbarAction,
56143
- ariaLabel: toolbar.refresh.label ?? "Refresh",
56144
- tooltip: isFetching ? "Refreshing table data" : toolbar.refresh.label ?? "Refresh",
56145
- disabled: isFetching || toolbarActionPending.refresh,
56146
- busy: isFetching || toolbarActionPending.refresh,
56147
- onClick: () => {
56148
- if (toolbarActionPendingRef.current.refresh) return;
56149
- toolbarActionPendingRef.current.refresh = true;
56150
- setToolbarActionPending((current) => ({ ...current, refresh: true }));
56151
- setToolbarActionError(null);
56152
- void Promise.resolve().then(() => toolbar.refresh?.onRefresh()).catch((cause) => {
56153
- const message = cause instanceof Error ? cause.message : String(cause);
56154
- setToolbarActionError(`Refresh failed: ${message}`);
56155
- toast.error(`Refresh failed: ${message}`);
56156
- }).finally(() => {
56157
- toolbarActionPendingRef.current.refresh = false;
56158
- setToolbarActionPending((current) => ({ ...current, refresh: false }));
56159
- });
56160
- },
56161
- children: /* @__PURE__ */ jsx60(RefreshControlIcon, { spinning: isFetching || toolbarActionPending.refresh })
56162
- }
56163
- ) : null,
56164
- toolbar?.add ? /* @__PURE__ */ jsx60(
56165
- TableToolbarAction,
56166
- {
56167
- HostAction: host.ToolbarAction,
56168
- ariaLabel: "Add",
56169
- tooltip: toolbar.add.disabled ? toolbar.add.disabledReason ?? "Add unavailable" : "Add",
56170
- disabled: toolbar.add.disabled || toolbarActionPending.add,
56171
- busy: toolbarActionPending.add,
56172
- onClick: () => {
56173
- if (toolbarActionPendingRef.current.add) return;
56174
- toolbarActionPendingRef.current.add = true;
56175
- setToolbarActionPending((current) => ({ ...current, add: true }));
56176
- setToolbarActionError(null);
56177
- void Promise.resolve().then(() => toolbar.add?.onAdd()).catch((cause) => {
56178
- const message = cause instanceof Error ? cause.message : String(cause);
56179
- setToolbarActionError(`Add failed: ${message}`);
56180
- toast.error(`Add failed: ${message}`);
56181
- }).finally(() => {
56182
- toolbarActionPendingRef.current.add = false;
56183
- setToolbarActionPending((current) => ({ ...current, add: false }));
56184
- });
56185
- },
56186
- children: /* @__PURE__ */ jsx60(Plus, {})
56187
- }
56188
- ) : null,
56189
- toolbar?.actions
56190
- ] }), showToolbarCopy && effectiveCopy ? /* @__PURE__ */ jsx60(ToolbarListedLabel, { label: "Copy or export", children: /* @__PURE__ */ jsx60(
56191
- CopyButtons,
56192
- {
56193
- size: "toolbar",
56194
- sourceId: `${tableCopySourceNamespace}:view`,
56195
- label: effectiveCopy.listLabel ?? `${effectiveCopy.label} view`,
56196
- ...effectiveCopy.references ? { references: effectiveCopy.references(processed, data) } : {},
56197
- ...effectiveCopy.triggerVariant ? { triggerVariant: effectiveCopy.triggerVariant } : {},
56198
- ...copy === void 0 ? {} : {
56199
- human: () => {
56200
- const { processed: processed2, data: data2 } = chromeLatest.current;
56201
- return effectiveCopy.listHuman?.(processed2, data2) ?? buildViewHuman(effectiveCopy, processed2, effectiveCopyColumns);
56202
- },
56203
- json: () => {
56204
- const { processed: processed2, data: data2 } = chromeLatest.current;
56205
- return effectiveCopy.listJson?.(processed2, data2) ?? processed2.map((r) => effectiveCopy.agentRow ? effectiveCopy.agentRow(r) : r);
56124
+ )
56125
+ ] }) : grouping?.onColumnIdChange ? /* @__PURE__ */ jsxs49(
56126
+ Select,
56127
+ {
56128
+ value: groupingColumnId ?? NO_GROUPING_VALUE,
56129
+ onValueChange: (value) => grouping.onColumnIdChange?.(value === NO_GROUPING_VALUE ? null : value),
56130
+ children: [
56131
+ /* @__PURE__ */ jsx60(
56132
+ SelectTrigger,
56133
+ {
56134
+ "data-matrx-table-group-by": true,
56135
+ "aria-label": "Group rows by a column",
56136
+ className: "h-8 w-auto min-w-[9rem] gap-1 text-xs",
56137
+ children: /* @__PURE__ */ jsx60(SelectValue, { placeholder: "No groups" })
56138
+ }
56139
+ ),
56140
+ /* @__PURE__ */ jsxs49(SelectContent, { children: [
56141
+ /* @__PURE__ */ jsx60(SelectItem, { value: NO_GROUPING_VALUE, children: "No groups" }),
56142
+ groupableColumns.map((col) => /* @__PURE__ */ jsx60(SelectItem, { value: columnId(col), children: `Group by ${col.label ?? (typeof col.header === "string" ? col.header : columnId(col))}` }, columnId(col)))
56143
+ ] })
56144
+ ]
56145
+ }
56146
+ ) : null,
56147
+ columns.length > 0 && toolbar?.columns !== false ? /* @__PURE__ */ jsx60(
56148
+ TableToolbarAction,
56149
+ {
56150
+ HostAction: host.ToolbarAction,
56151
+ ariaLabel: "Columns",
56152
+ tooltip: "Show, hide, or reorder columns",
56153
+ onClick: () => setColumnManagerOpen(true),
56154
+ children: /* @__PURE__ */ jsx60(SlidersHorizontal, {})
56155
+ }
56156
+ ) : null,
56157
+ toolbar?.refresh ? /* @__PURE__ */ jsx60(
56158
+ TableToolbarAction,
56159
+ {
56160
+ HostAction: host.ToolbarAction,
56161
+ ariaLabel: toolbar.refresh.label ?? "Refresh",
56162
+ tooltip: isFetching ? "Refreshing table data" : toolbar.refresh.label ?? "Refresh",
56163
+ disabled: isFetching || toolbarActionPending.refresh,
56164
+ busy: isFetching || toolbarActionPending.refresh,
56165
+ onClick: () => {
56166
+ if (toolbarActionPendingRef.current.refresh) return;
56167
+ toolbarActionPendingRef.current.refresh = true;
56168
+ setToolbarActionPending((current) => ({ ...current, refresh: true }));
56169
+ setToolbarActionError(null);
56170
+ void Promise.resolve().then(() => toolbar.refresh?.onRefresh()).catch((cause) => {
56171
+ const message = cause instanceof Error ? cause.message : String(cause);
56172
+ setToolbarActionError(`Refresh failed: ${message}`);
56173
+ toast.error(`Refresh failed: ${message}`);
56174
+ }).finally(() => {
56175
+ toolbarActionPendingRef.current.refresh = false;
56176
+ setToolbarActionPending((current) => ({ ...current, refresh: false }));
56177
+ });
56178
+ },
56179
+ children: /* @__PURE__ */ jsx60(RefreshControlIcon, { spinning: isFetching || toolbarActionPending.refresh })
56180
+ }
56181
+ ) : null,
56182
+ toolbar?.add ? /* @__PURE__ */ jsx60(
56183
+ TableToolbarAction,
56184
+ {
56185
+ HostAction: host.ToolbarAction,
56186
+ ariaLabel: "Add",
56187
+ tooltip: toolbar.add.disabled ? toolbar.add.disabledReason ?? "Add unavailable" : "Add",
56188
+ disabled: toolbar.add.disabled || toolbarActionPending.add,
56189
+ busy: toolbarActionPending.add,
56190
+ onClick: () => {
56191
+ if (toolbarActionPendingRef.current.add) return;
56192
+ toolbarActionPendingRef.current.add = true;
56193
+ setToolbarActionPending((current) => ({ ...current, add: true }));
56194
+ setToolbarActionError(null);
56195
+ void Promise.resolve().then(() => toolbar.add?.onAdd()).catch((cause) => {
56196
+ const message = cause instanceof Error ? cause.message : String(cause);
56197
+ setToolbarActionError(`Add failed: ${message}`);
56198
+ toast.error(`Add failed: ${message}`);
56199
+ }).finally(() => {
56200
+ toolbarActionPendingRef.current.add = false;
56201
+ setToolbarActionPending((current) => ({ ...current, add: false }));
56202
+ });
56203
+ },
56204
+ children: /* @__PURE__ */ jsx60(Plus, {})
56205
+ }
56206
+ ) : null,
56207
+ toolbar?.actions
56208
+ ] }), showToolbarCopy && effectiveCopy ? /* @__PURE__ */ jsx60(ToolbarListedLabel, { label: "Copy or export", children: /* @__PURE__ */ jsx60(
56209
+ CopyButtons,
56210
+ {
56211
+ size: "toolbar",
56212
+ sourceId: `${tableCopySourceNamespace}:view`,
56213
+ label: effectiveCopy.listLabel ?? `${effectiveCopy.label} view`,
56214
+ ...effectiveCopy.references ? { references: effectiveCopy.references(processed, data) } : {},
56215
+ ...effectiveCopy.triggerVariant ? { triggerVariant: effectiveCopy.triggerVariant } : {},
56216
+ ...copy === void 0 ? {} : {
56217
+ human: () => {
56218
+ const { processed: processed2, data: data2 } = chromeLatest.current;
56219
+ return effectiveCopy.listHuman?.(processed2, data2) ?? buildViewHuman(effectiveCopy, processed2, effectiveCopyColumns);
56220
+ },
56221
+ json: () => {
56222
+ const { processed: processed2, data: data2 } = chromeLatest.current;
56223
+ return effectiveCopy.listJson?.(processed2, data2) ?? processed2.map((r) => effectiveCopy.agentRow ? effectiveCopy.agentRow(r) : r);
56224
+ }
56225
+ },
56226
+ agent: () => {
56227
+ const { processed: processed2, data: data2 } = chromeLatest.current;
56228
+ return copy !== void 0 && effectiveCopy.listAgent ? effectiveCopy.listAgent(processed2, data2) : copy === void 0 ? buildDefaultTableViewAgentInput(effectiveCopy, processed2, data2, declaredVisibleCopyColumns, {
56229
+ search: searchValue,
56230
+ searchMatchMode,
56231
+ anyOf: anyOfValue,
56232
+ filterCount: activeFilterCount + completeLayeredFilterRules(layeredFilters).length,
56233
+ sort: sort ? `${sort.id}:${sort.direction}` : null
56234
+ }) : buildViewAgentInput(effectiveCopy, processed2, data2, {
56235
+ search: searchValue,
56236
+ searchMatchMode,
56237
+ anyOf: anyOfValue,
56238
+ filterCount: activeFilterCount + completeLayeredFilterRules(layeredFilters).length,
56239
+ sort: sort ? `${sort.id}:${sort.direction}` : null
56240
+ });
56241
+ },
56242
+ aiVariants: [
56243
+ ...effectiveCopy.aiVariants?.(processed, data) ?? [],
56244
+ ...copySubsetVariantFor(() => chromeLatest.current.processed, "view")
56245
+ ],
56246
+ ...effectiveCopy.aiCustom ? { aiCustom: effectiveCopy.aiCustom(processed, data) } : {},
56247
+ export: {
56248
+ items: [],
56249
+ sheetRows: () => chromeLatest.current.processed.map(
56250
+ (row) => projectDefaultTableCopyRow(row, declaredVisibleCopyColumns)
56251
+ ),
56252
+ sheetColumns: () => declaredVisibleCopyColumns.map((column) => ({
56253
+ id: columnId(column),
56254
+ label: column.label ?? (typeof column.header === "string" ? column.header : columnId(column))
56255
+ })),
56256
+ ...effectiveCopy.export?.(processed, data)
56257
+ }
56206
56258
  }
56207
- },
56208
- agent: () => {
56209
- const { processed: processed2, data: data2 } = chromeLatest.current;
56210
- return copy !== void 0 && effectiveCopy.listAgent ? effectiveCopy.listAgent(processed2, data2) : copy === void 0 ? buildDefaultTableViewAgentInput(effectiveCopy, processed2, data2, declaredVisibleCopyColumns, {
56211
- search: searchValue,
56212
- searchMatchMode,
56213
- anyOf: anyOfValue,
56214
- filterCount: activeFilterCount + completeLayeredFilterRules(layeredFilters).length,
56215
- sort: sort ? `${sort.id}:${sort.direction}` : null
56216
- }) : buildViewAgentInput(effectiveCopy, processed2, data2, {
56217
- search: searchValue,
56218
- searchMatchMode,
56219
- anyOf: anyOfValue,
56220
- filterCount: activeFilterCount + completeLayeredFilterRules(layeredFilters).length,
56221
- sort: sort ? `${sort.id}:${sort.direction}` : null
56222
- });
56223
- },
56224
- aiVariants: [
56225
- ...effectiveCopy.aiVariants?.(processed, data) ?? [],
56226
- ...copySubsetVariantFor(() => chromeLatest.current.processed, "view")
56227
- ],
56228
- ...effectiveCopy.aiCustom ? { aiCustom: effectiveCopy.aiCustom(processed, data) } : {},
56229
- export: {
56230
- items: [],
56231
- sheetRows: () => chromeLatest.current.processed.map(
56232
- (row) => projectDefaultTableCopyRow(row, declaredVisibleCopyColumns)
56233
- ),
56234
- sheetColumns: () => declaredVisibleCopyColumns.map((column) => ({
56235
- id: columnId(column),
56236
- label: column.label ?? (typeof column.header === "string" ? column.header : columnId(column))
56237
- })),
56238
- ...effectiveCopy.export?.(processed, data)
56239
- }
56240
- }
56241
- ) }) : null)
56242
- ]
56243
- }
56244
- ),
56245
- toolbarEnd.node
56246
- ]
56247
- }
56248
- )) }),
56259
+ ) }) : null)
56260
+ ]
56261
+ }
56262
+ ),
56263
+ toolbarEnd.node
56264
+ ]
56265
+ }
56266
+ ))
56267
+ ] });
56268
+ } }),
56249
56269
  /* @__PURE__ */ jsxs49("div", { "data-matrx-table-body-region": true, className: "flex min-h-0 flex-1 flex-col gap-2", children: [
56270
+ localSortNotice && !isLoading && !readView.failure ? /* @__PURE__ */ jsx60("p", { "data-matrx-table-local-sort-scope": true, role: "status", className: "shrink-0 text-xs text-muted-foreground", children: localSortNotice }) : null,
56250
56271
  coverageResult && coverageResult.notice && !toolbar?.singleRow ? /* @__PURE__ */ jsxs49(
56251
56272
  "div",
56252
56273
  {
@@ -56406,6 +56427,7 @@ function MatrxDataTableCore(coreProps) {
56406
56427
  "relative h-full w-full overflow-auto rounded-md border border-border bg-card",
56407
56428
  // Embedded: the host (the card) is the frame; the rows sit on its surface.
56408
56429
  embedded && "h-auto rounded-none border-0 bg-transparent",
56430
+ frameHeight === "content" && "h-auto max-h-full",
56409
56431
  mobileCards && tableWithCardsClass,
56410
56432
  tableClassName
56411
56433
  ),
@@ -56474,6 +56496,7 @@ function MatrxDataTableCore(coreProps) {
56474
56496
  {
56475
56497
  ref: tableHeaderRef,
56476
56498
  "data-matrx-table-sticky-header": stickyHeader ? "true" : void 0,
56499
+ hidden: emptyHeader === "hide" && !isLoading && data.length === 0 && activeFilterCount === 0,
56477
56500
  className: cn(
56478
56501
  // 🚨 ABOVE THE FROZEN COLUMN, NOT UNDER IT. A frozen body
56479
56502
  // cell is `sm:z-20` so it can slide under the columns to