@ai-matrx/design-system 0.20.21 → 0.20.22

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.
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { g as MatrxDataTableProps, h as TableViewSnapshot } from '../types-n8d2I1Gu.cjs';
4
- export { A as AnyOfColumnSearch, i as CellEditType, j as CellEditsMap, e as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, M as MatrxColumnDef, f as MatrxDataTableCopyConfig, c as MatrxDataTableDensity, k as MatrxDataTableDetailConfig, l as MatrxDataTableEditConfig, m as MatrxDataTableEmptyState, n as MatrxDataTableFilterUi, o as MatrxDataTableHierarchyConfig, p as MatrxDataTableHierarchyMove, q as MatrxDataTableMobileCardControls, r as MatrxDataTableQueryControl, d as MatrxDataTableQueryState, s as MatrxDataTableRecordControls, t as MatrxDataTableSelectionConfig, u as MatrxDataTableSourceProcessing, v as MatrxDataTableToolbar, w as MatrxDataTableUrlStateConfig, x as MatrxDataTableWindowConfig, y as MatrxTablePagination, z as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, B as TableViewQuery, D as TextFilterMode, E as ToolbarFacet } from '../types-n8d2I1Gu.cjs';
3
+ import { g as MatrxDataTableProps, h as TableViewSnapshot } from '../types-B99KFITZ.cjs';
4
+ export { A as AnyOfColumnSearch, i as CellEditType, j as CellEditsMap, e as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, M as MatrxColumnDef, f as MatrxDataTableCopyConfig, c as MatrxDataTableDensity, k as MatrxDataTableDetailConfig, l as MatrxDataTableEditConfig, m as MatrxDataTableEmptyState, n as MatrxDataTableFilterUi, o as MatrxDataTableHierarchyConfig, p as MatrxDataTableHierarchyMove, q as MatrxDataTableMobileCardControls, r as MatrxDataTableQueryControl, d as MatrxDataTableQueryState, s as MatrxDataTableRecordControls, t as MatrxDataTableSelectionConfig, u as MatrxDataTableSourceProcessing, v as MatrxDataTableToolbar, w as MatrxDataTableUrlStateConfig, x as MatrxDataTableWindowConfig, y as MatrxTablePagination, z as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, B as TableViewQuery, D as TextFilterMode, E as ToolbarFacet } from '../types-B99KFITZ.cjs';
5
5
  export { MatrxDataTableHost, MatrxDataTableProvider, TableDoors, TableEntityRefProps, TableLinkProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost } from './host.cjs';
6
6
  export { DataRowInspector } from './data-row-inspector.cjs';
7
7
  export { DataRowWindow, DataRowWindowProps, DataRowWindowTab } from './data-row-window.cjs';
@@ -38,13 +38,14 @@ interface TableTitleRowProps {
38
38
  label: string;
39
39
  };
40
40
  search?: ReactNode;
41
+ tabs?: ReactNode;
41
42
  actions?: ReactNode;
42
43
  children?: ReactNode;
43
44
  className?: string;
44
45
  }
45
46
  /** Shared responsive title composition. Hosts retain their existing query,
46
47
  * navigation and persistence controllers; this component owns layout only. */
47
- declare function TableTitleRow({ title, headingLevel, context, count, search, actions, children, className, }: TableTitleRowProps): React.JSX.Element;
48
+ declare function TableTitleRow({ title, headingLevel, context, count, search, tabs, actions, children, className, }: TableTitleRowProps): React.JSX.Element;
48
49
 
49
50
  interface SavedViewsControlProps {
50
51
  views: ReadonlyArray<{
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { g as MatrxDataTableProps, h as TableViewSnapshot } from '../types-D_UZxZC5.js';
4
- export { A as AnyOfColumnSearch, i as CellEditType, j as CellEditsMap, e as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, M as MatrxColumnDef, f as MatrxDataTableCopyConfig, c as MatrxDataTableDensity, k as MatrxDataTableDetailConfig, l as MatrxDataTableEditConfig, m as MatrxDataTableEmptyState, n as MatrxDataTableFilterUi, o as MatrxDataTableHierarchyConfig, p as MatrxDataTableHierarchyMove, q as MatrxDataTableMobileCardControls, r as MatrxDataTableQueryControl, d as MatrxDataTableQueryState, s as MatrxDataTableRecordControls, t as MatrxDataTableSelectionConfig, u as MatrxDataTableSourceProcessing, v as MatrxDataTableToolbar, w as MatrxDataTableUrlStateConfig, x as MatrxDataTableWindowConfig, y as MatrxTablePagination, z as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, B as TableViewQuery, D as TextFilterMode, E as ToolbarFacet } from '../types-D_UZxZC5.js';
3
+ import { g as MatrxDataTableProps, h as TableViewSnapshot } from '../types-CryQuMmz.js';
4
+ export { A as AnyOfColumnSearch, i as CellEditType, j as CellEditsMap, e as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, M as MatrxColumnDef, f as MatrxDataTableCopyConfig, c as MatrxDataTableDensity, k as MatrxDataTableDetailConfig, l as MatrxDataTableEditConfig, m as MatrxDataTableEmptyState, n as MatrxDataTableFilterUi, o as MatrxDataTableHierarchyConfig, p as MatrxDataTableHierarchyMove, q as MatrxDataTableMobileCardControls, r as MatrxDataTableQueryControl, d as MatrxDataTableQueryState, s as MatrxDataTableRecordControls, t as MatrxDataTableSelectionConfig, u as MatrxDataTableSourceProcessing, v as MatrxDataTableToolbar, w as MatrxDataTableUrlStateConfig, x as MatrxDataTableWindowConfig, y as MatrxTablePagination, z as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, B as TableViewQuery, D as TextFilterMode, E as ToolbarFacet } from '../types-CryQuMmz.js';
5
5
  export { MatrxDataTableHost, MatrxDataTableProvider, TableDoors, TableEntityRefProps, TableLinkProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost } from './host.js';
6
6
  export { DataRowInspector } from './data-row-inspector.js';
7
7
  export { DataRowWindow, DataRowWindowProps, DataRowWindowTab } from './data-row-window.js';
@@ -38,13 +38,14 @@ interface TableTitleRowProps {
38
38
  label: string;
39
39
  };
40
40
  search?: ReactNode;
41
+ tabs?: ReactNode;
41
42
  actions?: ReactNode;
42
43
  children?: ReactNode;
43
44
  className?: string;
44
45
  }
45
46
  /** Shared responsive title composition. Hosts retain their existing query,
46
47
  * navigation and persistence controllers; this component owns layout only. */
47
- declare function TableTitleRow({ title, headingLevel, context, count, search, actions, children, className, }: TableTitleRowProps): React.JSX.Element;
48
+ declare function TableTitleRow({ title, headingLevel, context, count, search, tabs, actions, children, className, }: TableTitleRowProps): React.JSX.Element;
48
49
 
49
50
  interface SavedViewsControlProps {
50
51
  views: ReadonlyArray<{
@@ -921,6 +921,7 @@ function TableTitleRow({
921
921
  context,
922
922
  count,
923
923
  search,
924
+ tabs,
924
925
  actions,
925
926
  children,
926
927
  className
@@ -944,15 +945,17 @@ function TableTitleRow({
944
945
  children: count.value.toLocaleString()
945
946
  }
946
947
  ) : null,
948
+ tabs ? /* @__PURE__ */ jsx11("div", { className: "min-w-0 flex-1 basis-32", "data-matrx-table-toolbar-tabs": true, children: tabs }) : null,
949
+ tabs ? context : null,
947
950
  search ? /* @__PURE__ */ jsx11(
948
951
  "div",
949
952
  {
950
953
  "data-matrx-table-title-search": true,
951
- className: "order-last w-full min-w-0 sm:order-none sm:w-auto sm:min-w-64 sm:max-w-md",
954
+ className: "order-last w-full min-w-0 sm:order-none sm:w-64 sm:shrink-0 sm:max-w-md",
952
955
  children: search
953
956
  }
954
957
  ) : null,
955
- context,
958
+ !tabs ? context : null,
956
959
  children,
957
960
  actions ? /* @__PURE__ */ jsx11(
958
961
  "div",
@@ -7874,7 +7877,10 @@ function ToolbarFacets({ facets }) {
7874
7877
  function resetToolbarFacets(facets) {
7875
7878
  if (!facets) return;
7876
7879
  for (const facet of facets) {
7877
- if (facet.type !== "button-group") continue;
7880
+ if (facet.type === "custom") {
7881
+ if (facet.filter?.active) facet.filter.onReset();
7882
+ continue;
7883
+ }
7878
7884
  const def = facet.defaultValue ?? facet.options[0]?.value;
7879
7885
  if (def !== void 0 && facet.value !== def) facet.onChange(def);
7880
7886
  }
@@ -9134,19 +9140,20 @@ function MatrxDataTableCore({
9134
9140
  intelligentSearchEnabled ? columns : visibleColumns,
9135
9141
  sourceOwnsColumnFilters ? {} : columnFilters,
9136
9142
  sourceOwnsSort ? null : sort,
9137
- intelligentSearchEnabled || toolbar?.search === false || sourceOwnsSearch ? "" : searchValue,
9143
+ "",
9144
+ // Global matching and identity ranking run once across all loaded fields below.
9138
9145
  toolbar?.anyOf ? { columnIds: toolbar.anyOf.columnIds, query: anyOfValue } : void 0,
9139
9146
  layeredFilters,
9140
9147
  searchMatchMode,
9141
9148
  searchText
9142
9149
  );
9143
- if (!intelligentSearchEnabled || sourceOwnsSearch) return locallyFiltered;
9150
+ if (sourceOwnsSearch || toolbar?.search === false) return locallyFiltered;
9144
9151
  return rankTableSearchRows(
9145
9152
  locallyFiltered,
9146
9153
  columns,
9147
9154
  searchValue,
9148
9155
  {
9149
- scope: searchScope,
9156
+ scope: intelligentSearchEnabled ? searchScope : "all",
9150
9157
  ...toolbar?.intelligentSearch?.roles === void 0 ? {} : { roles: toolbar.intelligentSearch.roles },
9151
9158
  ...toolbar?.intelligentSearch?.scopes === void 0 ? {} : { scopes: toolbar.intelligentSearch.scopes },
9152
9159
  matchMode: searchMatchMode
@@ -9260,7 +9267,7 @@ function MatrxDataTableCore({
9260
9267
  const showToolbarCopy = effectiveCopy !== void 0 && effectiveCopy.showToolbar !== false;
9261
9268
  const activeFilterCount = countActiveColumnFilters(columnFilters);
9262
9269
  const facetActive = (toolbar?.facets ?? []).some((f) => {
9263
- if (f.type !== "button-group") return false;
9270
+ if (f.type === "custom") return f.filter?.active ?? false;
9264
9271
  const def = f.defaultValue ?? f.options[0]?.value;
9265
9272
  return def !== void 0 && f.value !== def;
9266
9273
  });
@@ -9880,13 +9887,13 @@ function MatrxDataTableCore({
9880
9887
  className
9881
9888
  ),
9882
9889
  children: [
9883
- viewTabs && !hideToolbar && /* @__PURE__ */ jsx40(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applySavedView, related: relatedTableActions }, tableId ?? "table"),
9884
9890
  notice,
9885
9891
  savedViewError ? /* @__PURE__ */ jsx40("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: savedViewError }) : null,
9886
9892
  toolbarActionError ? /* @__PURE__ */ jsx40("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: toolbarActionError }) : null,
9887
- !hideToolbar && (toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || tableId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs30(
9893
+ !hideToolbar && (viewTabs || toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || tableId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs30(
9888
9894
  TableTitleRow,
9889
9895
  {
9896
+ tabs: viewTabs ? /* @__PURE__ */ jsx40(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applySavedView, related: relatedTableActions }, tableId ?? "table") : void 0,
9890
9897
  ...toolbar?.title === void 0 ? {} : { title: toolbar.title },
9891
9898
  context: tableId && SavedViews ? /* @__PURE__ */ jsx40("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx40(
9892
9899
  SavedViews,
@@ -10087,7 +10094,8 @@ function MatrxDataTableCore({
10087
10094
  sheetColumns: () => declaredVisibleCopyColumns.map((column) => ({
10088
10095
  id: columnId(column),
10089
10096
  label: column.label ?? (typeof column.header === "string" ? column.header : columnId(column))
10090
- }))
10097
+ })),
10098
+ ...effectiveCopy.export?.(processed, data)
10091
10099
  }
10092
10100
  }
10093
10101
  ) : null,
@@ -10558,7 +10566,7 @@ function MatrxDataTableCore({
10558
10566
  "data-row-id": id,
10559
10567
  "data-state": isSelected ? "selected" : void 0,
10560
10568
  onClick: (e) => {
10561
- if (e.target.closest("a")) return;
10569
+ if (e.target.closest('a, button, input, select, textarea, [role="button"], [role="combobox"], [contenteditable="true"]')) return;
10562
10570
  openRow(row);
10563
10571
  },
10564
10572
  className: cn(