@ai-matrx/design-system 0.20.21 → 0.21.0
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/CHANGELOG.md +33 -0
- package/dist/content-transfer.cjs +15 -0
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.js +15 -0
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/data-row-inspector.cjs +15 -0
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +15 -0
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +15 -0
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +15 -0
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/host.d.cts +1 -1
- package/dist/data-table/host.d.ts +1 -1
- package/dist/data-table/index.cjs +34 -11
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +4 -3
- package/dist/data-table/index.d.ts +4 -3
- package/dist/data-table/index.js +34 -11
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/pagination.cjs +15 -0
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +15 -0
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +26 -0
- package/dist/{types-n8d2I1Gu.d.cts → types-B99KFITZ.d.cts} +9 -2
- package/dist/{types-D_UZxZC5.d.ts → types-CryQuMmz.d.ts} +9 -2
- package/package.json +1 -1
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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<{
|
package/dist/data-table/index.js
CHANGED
|
@@ -168,13 +168,28 @@ var buttonVariants = cva(
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
);
|
|
171
|
+
var TOUCH_FLOOR_SIZES = /* @__PURE__ */ new Set([
|
|
172
|
+
"xs",
|
|
173
|
+
"sm",
|
|
174
|
+
"default",
|
|
175
|
+
"md",
|
|
176
|
+
"lg",
|
|
177
|
+
"icon",
|
|
178
|
+
"icon-sm",
|
|
179
|
+
"roundIcon"
|
|
180
|
+
]);
|
|
181
|
+
var SQUARE_SIZES = /* @__PURE__ */ new Set(["icon", "icon-sm", "roundIcon"]);
|
|
171
182
|
var Button = React.forwardRef(
|
|
172
183
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
173
184
|
const Component = asChild ? Slot : "button";
|
|
185
|
+
const resolvedSize = size ?? "default";
|
|
174
186
|
return /* @__PURE__ */ jsx2(
|
|
175
187
|
Component,
|
|
176
188
|
{
|
|
177
189
|
className: cn(buttonVariants({ variant, size, className })),
|
|
190
|
+
"data-matrx-button": "",
|
|
191
|
+
"data-tap-floor": TOUCH_FLOOR_SIZES.has(resolvedSize) ? "" : void 0,
|
|
192
|
+
"data-tap-floor-square": SQUARE_SIZES.has(resolvedSize) ? "" : void 0,
|
|
178
193
|
ref,
|
|
179
194
|
...props
|
|
180
195
|
}
|
|
@@ -921,6 +936,7 @@ function TableTitleRow({
|
|
|
921
936
|
context,
|
|
922
937
|
count,
|
|
923
938
|
search,
|
|
939
|
+
tabs,
|
|
924
940
|
actions,
|
|
925
941
|
children,
|
|
926
942
|
className
|
|
@@ -944,15 +960,17 @@ function TableTitleRow({
|
|
|
944
960
|
children: count.value.toLocaleString()
|
|
945
961
|
}
|
|
946
962
|
) : null,
|
|
963
|
+
tabs ? /* @__PURE__ */ jsx11("div", { className: "min-w-0 flex-1 basis-32", "data-matrx-table-toolbar-tabs": true, children: tabs }) : null,
|
|
964
|
+
tabs ? context : null,
|
|
947
965
|
search ? /* @__PURE__ */ jsx11(
|
|
948
966
|
"div",
|
|
949
967
|
{
|
|
950
968
|
"data-matrx-table-title-search": true,
|
|
951
|
-
className: "order-last w-full min-w-0 sm:order-none sm:w-
|
|
969
|
+
className: "order-last w-full min-w-0 sm:order-none sm:w-64 sm:shrink-0 sm:max-w-md",
|
|
952
970
|
children: search
|
|
953
971
|
}
|
|
954
972
|
) : null,
|
|
955
|
-
context,
|
|
973
|
+
!tabs ? context : null,
|
|
956
974
|
children,
|
|
957
975
|
actions ? /* @__PURE__ */ jsx11(
|
|
958
976
|
"div",
|
|
@@ -7874,7 +7892,10 @@ function ToolbarFacets({ facets }) {
|
|
|
7874
7892
|
function resetToolbarFacets(facets) {
|
|
7875
7893
|
if (!facets) return;
|
|
7876
7894
|
for (const facet of facets) {
|
|
7877
|
-
if (facet.type
|
|
7895
|
+
if (facet.type === "custom") {
|
|
7896
|
+
if (facet.filter?.active) facet.filter.onReset();
|
|
7897
|
+
continue;
|
|
7898
|
+
}
|
|
7878
7899
|
const def = facet.defaultValue ?? facet.options[0]?.value;
|
|
7879
7900
|
if (def !== void 0 && facet.value !== def) facet.onChange(def);
|
|
7880
7901
|
}
|
|
@@ -9134,19 +9155,20 @@ function MatrxDataTableCore({
|
|
|
9134
9155
|
intelligentSearchEnabled ? columns : visibleColumns,
|
|
9135
9156
|
sourceOwnsColumnFilters ? {} : columnFilters,
|
|
9136
9157
|
sourceOwnsSort ? null : sort,
|
|
9137
|
-
|
|
9158
|
+
"",
|
|
9159
|
+
// Global matching and identity ranking run once across all loaded fields below.
|
|
9138
9160
|
toolbar?.anyOf ? { columnIds: toolbar.anyOf.columnIds, query: anyOfValue } : void 0,
|
|
9139
9161
|
layeredFilters,
|
|
9140
9162
|
searchMatchMode,
|
|
9141
9163
|
searchText
|
|
9142
9164
|
);
|
|
9143
|
-
if (
|
|
9165
|
+
if (sourceOwnsSearch || toolbar?.search === false) return locallyFiltered;
|
|
9144
9166
|
return rankTableSearchRows(
|
|
9145
9167
|
locallyFiltered,
|
|
9146
9168
|
columns,
|
|
9147
9169
|
searchValue,
|
|
9148
9170
|
{
|
|
9149
|
-
scope: searchScope,
|
|
9171
|
+
scope: intelligentSearchEnabled ? searchScope : "all",
|
|
9150
9172
|
...toolbar?.intelligentSearch?.roles === void 0 ? {} : { roles: toolbar.intelligentSearch.roles },
|
|
9151
9173
|
...toolbar?.intelligentSearch?.scopes === void 0 ? {} : { scopes: toolbar.intelligentSearch.scopes },
|
|
9152
9174
|
matchMode: searchMatchMode
|
|
@@ -9260,7 +9282,7 @@ function MatrxDataTableCore({
|
|
|
9260
9282
|
const showToolbarCopy = effectiveCopy !== void 0 && effectiveCopy.showToolbar !== false;
|
|
9261
9283
|
const activeFilterCount = countActiveColumnFilters(columnFilters);
|
|
9262
9284
|
const facetActive = (toolbar?.facets ?? []).some((f) => {
|
|
9263
|
-
if (f.type
|
|
9285
|
+
if (f.type === "custom") return f.filter?.active ?? false;
|
|
9264
9286
|
const def = f.defaultValue ?? f.options[0]?.value;
|
|
9265
9287
|
return def !== void 0 && f.value !== def;
|
|
9266
9288
|
});
|
|
@@ -9880,13 +9902,13 @@ function MatrxDataTableCore({
|
|
|
9880
9902
|
className
|
|
9881
9903
|
),
|
|
9882
9904
|
children: [
|
|
9883
|
-
viewTabs && !hideToolbar && /* @__PURE__ */ jsx40(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applySavedView, related: relatedTableActions }, tableId ?? "table"),
|
|
9884
9905
|
notice,
|
|
9885
9906
|
savedViewError ? /* @__PURE__ */ jsx40("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: savedViewError }) : null,
|
|
9886
9907
|
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(
|
|
9908
|
+
!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
9909
|
TableTitleRow,
|
|
9889
9910
|
{
|
|
9911
|
+
tabs: viewTabs ? /* @__PURE__ */ jsx40(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applySavedView, related: relatedTableActions }, tableId ?? "table") : void 0,
|
|
9890
9912
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
9891
9913
|
context: tableId && SavedViews ? /* @__PURE__ */ jsx40("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx40(
|
|
9892
9914
|
SavedViews,
|
|
@@ -10087,7 +10109,8 @@ function MatrxDataTableCore({
|
|
|
10087
10109
|
sheetColumns: () => declaredVisibleCopyColumns.map((column) => ({
|
|
10088
10110
|
id: columnId(column),
|
|
10089
10111
|
label: column.label ?? (typeof column.header === "string" ? column.header : columnId(column))
|
|
10090
|
-
}))
|
|
10112
|
+
})),
|
|
10113
|
+
...effectiveCopy.export?.(processed, data)
|
|
10091
10114
|
}
|
|
10092
10115
|
}
|
|
10093
10116
|
) : null,
|
|
@@ -10558,7 +10581,7 @@ function MatrxDataTableCore({
|
|
|
10558
10581
|
"data-row-id": id,
|
|
10559
10582
|
"data-state": isSelected ? "selected" : void 0,
|
|
10560
10583
|
onClick: (e) => {
|
|
10561
|
-
if (e.target.closest(
|
|
10584
|
+
if (e.target.closest('a, button, input, select, textarea, [role="button"], [role="combobox"], [contenteditable="true"]')) return;
|
|
10562
10585
|
openRow(row);
|
|
10563
10586
|
},
|
|
10564
10587
|
className: cn(
|