@ai-matrx/design-system 0.42.1 → 0.43.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 +14 -0
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +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 +75 -3
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +2 -2
- package/dist/data-table/index.d.ts +2 -2
- package/dist/data-table/index.js +75 -3
- 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/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/spreadsheet.cjs +68 -1
- package/dist/data-table/spreadsheet.cjs.map +1 -1
- package/dist/data-table/spreadsheet.d.cts +55 -1
- package/dist/data-table/spreadsheet.d.ts +55 -1
- package/dist/data-table/spreadsheet.js +68 -1
- package/dist/data-table/spreadsheet.js.map +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/{types-afUz93xo.d.ts → types-CUR8Hbt5.d.ts} +12 -0
- package/dist/{types-q5ficDSo.d.cts → types-CqU57qk8.d.cts} +12 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-
|
|
4
|
-
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, n as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, o as MatrxDataTableDetailConfig, p as MatrxDataTableEditConfig, q as MatrxDataTableEmptyState, r as MatrxDataTableExpandedDetailConfig, s as MatrxDataTableFacetsConfig, t as MatrxDataTableFilterUi, u as MatrxDataTableGroupingConfig, v as MatrxDataTableHierarchyConfig, w as MatrxDataTableHierarchyMove, x as MatrxDataTableMobileCardControls, y as MatrxDataTableMultiExpandedDetailConfig, z as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, B as MatrxDataTableSelectionConfig, D as MatrxDataTableSingleExpandedDetailConfig, E as MatrxDataTableSourceProcessing, F as MatrxDataTableSpreadsheetConfig, G as MatrxDataTableStyleConfig, H as MatrxDataTableToolbar, I as MatrxDataTableUrlStateConfig, J as MatrxDataTableVirtualizeConfig, K as MatrxDataTableWindowConfig, N as MatrxTablePagination, O as SortDirection, S as SortState, P as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, Q as TableSearchRole, R as TableSearchScope, U as TableViewQuery, V as TextFilterMode, W as ToolbarFacet, X as inferTableSearchRole, Y as rankTableSearchRows, Z as resolveTableSearchScopes } from '../types-
|
|
3
|
+
import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-CqU57qk8.cjs';
|
|
4
|
+
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, n as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, o as MatrxDataTableDetailConfig, p as MatrxDataTableEditConfig, q as MatrxDataTableEmptyState, r as MatrxDataTableExpandedDetailConfig, s as MatrxDataTableFacetsConfig, t as MatrxDataTableFilterUi, u as MatrxDataTableGroupingConfig, v as MatrxDataTableHierarchyConfig, w as MatrxDataTableHierarchyMove, x as MatrxDataTableMobileCardControls, y as MatrxDataTableMultiExpandedDetailConfig, z as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, B as MatrxDataTableSelectionConfig, D as MatrxDataTableSingleExpandedDetailConfig, E as MatrxDataTableSourceProcessing, F as MatrxDataTableSpreadsheetConfig, G as MatrxDataTableStyleConfig, H as MatrxDataTableToolbar, I as MatrxDataTableUrlStateConfig, J as MatrxDataTableVirtualizeConfig, K as MatrxDataTableWindowConfig, N as MatrxTablePagination, O as SortDirection, S as SortState, P as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, Q as TableSearchRole, R as TableSearchScope, U as TableViewQuery, V as TextFilterMode, W as ToolbarFacet, X as inferTableSearchRole, Y as rankTableSearchRows, Z as resolveTableSearchScopes } from '../types-CqU57qk8.cjs';
|
|
5
5
|
export { MatrxDataTableHost, MatrxDataTableProvider, MatrxTableRowAlchemy, TableContextMenuBoundaryProps, TableDoors, TableEntityRefProps, TableLinkProps, TableMenuIconProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy } from './host.cjs';
|
|
6
6
|
import { CopyControlProps } from './copy-types.cjs';
|
|
7
7
|
export { AgentPayloadInput } from './copy-types.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-
|
|
4
|
-
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, n as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, o as MatrxDataTableDetailConfig, p as MatrxDataTableEditConfig, q as MatrxDataTableEmptyState, r as MatrxDataTableExpandedDetailConfig, s as MatrxDataTableFacetsConfig, t as MatrxDataTableFilterUi, u as MatrxDataTableGroupingConfig, v as MatrxDataTableHierarchyConfig, w as MatrxDataTableHierarchyMove, x as MatrxDataTableMobileCardControls, y as MatrxDataTableMultiExpandedDetailConfig, z as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, B as MatrxDataTableSelectionConfig, D as MatrxDataTableSingleExpandedDetailConfig, E as MatrxDataTableSourceProcessing, F as MatrxDataTableSpreadsheetConfig, G as MatrxDataTableStyleConfig, H as MatrxDataTableToolbar, I as MatrxDataTableUrlStateConfig, J as MatrxDataTableVirtualizeConfig, K as MatrxDataTableWindowConfig, N as MatrxTablePagination, O as SortDirection, S as SortState, P as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, Q as TableSearchRole, R as TableSearchScope, U as TableViewQuery, V as TextFilterMode, W as ToolbarFacet, X as inferTableSearchRole, Y as rankTableSearchRows, Z as resolveTableSearchScopes } from '../types-
|
|
3
|
+
import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-CUR8Hbt5.js';
|
|
4
|
+
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, n as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, o as MatrxDataTableDetailConfig, p as MatrxDataTableEditConfig, q as MatrxDataTableEmptyState, r as MatrxDataTableExpandedDetailConfig, s as MatrxDataTableFacetsConfig, t as MatrxDataTableFilterUi, u as MatrxDataTableGroupingConfig, v as MatrxDataTableHierarchyConfig, w as MatrxDataTableHierarchyMove, x as MatrxDataTableMobileCardControls, y as MatrxDataTableMultiExpandedDetailConfig, z as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, B as MatrxDataTableSelectionConfig, D as MatrxDataTableSingleExpandedDetailConfig, E as MatrxDataTableSourceProcessing, F as MatrxDataTableSpreadsheetConfig, G as MatrxDataTableStyleConfig, H as MatrxDataTableToolbar, I as MatrxDataTableUrlStateConfig, J as MatrxDataTableVirtualizeConfig, K as MatrxDataTableWindowConfig, N as MatrxTablePagination, O as SortDirection, S as SortState, P as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, Q as TableSearchRole, R as TableSearchScope, U as TableViewQuery, V as TextFilterMode, W as ToolbarFacet, X as inferTableSearchRole, Y as rankTableSearchRows, Z as resolveTableSearchScopes } from '../types-CUR8Hbt5.js';
|
|
5
5
|
export { MatrxDataTableHost, MatrxDataTableProvider, MatrxTableRowAlchemy, TableContextMenuBoundaryProps, TableDoors, TableEntityRefProps, TableLinkProps, TableMenuIconProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy } from './host.js';
|
|
6
6
|
import { CopyControlProps } from './copy-types.js';
|
|
7
7
|
export { AgentPayloadInput } from './copy-types.js';
|
package/dist/data-table/index.js
CHANGED
|
@@ -8533,8 +8533,23 @@ function canRedo(stack) {
|
|
|
8533
8533
|
function targetsAnEditor(target) {
|
|
8534
8534
|
const element = target instanceof Element ? target : null;
|
|
8535
8535
|
if (!element) return false;
|
|
8536
|
+
if (element.closest(`[${TYPE_CATCHER_ATTR}]`)) return false;
|
|
8536
8537
|
return element.closest("input, textarea, select, [contenteditable='true']") !== null;
|
|
8537
8538
|
}
|
|
8539
|
+
var TYPE_CATCHER_ATTR = "data-matrx-type-catcher";
|
|
8540
|
+
var TYPE_CATCHER_STYLE = {
|
|
8541
|
+
position: "fixed",
|
|
8542
|
+
top: 0,
|
|
8543
|
+
left: 0,
|
|
8544
|
+
width: 1,
|
|
8545
|
+
height: 1,
|
|
8546
|
+
padding: 0,
|
|
8547
|
+
border: 0,
|
|
8548
|
+
opacity: 0,
|
|
8549
|
+
overflow: "hidden",
|
|
8550
|
+
resize: "none",
|
|
8551
|
+
pointerEvents: "none"
|
|
8552
|
+
};
|
|
8538
8553
|
function camePastAPortal(target, host) {
|
|
8539
8554
|
if (typeof Element === "undefined") return false;
|
|
8540
8555
|
const element = target instanceof Element ? target : null;
|
|
@@ -8554,6 +8569,8 @@ function useSpreadsheetGrid(options) {
|
|
|
8554
8569
|
const [fillTarget, setFillTarget] = useState16(null);
|
|
8555
8570
|
const [stack, setStack] = useState16(() => createUndoStack(options?.undoDepth ?? 100));
|
|
8556
8571
|
const draggingRef = useRef13(null);
|
|
8572
|
+
const catcherRef = useRef13(null);
|
|
8573
|
+
const composingRef = useRef13(false);
|
|
8557
8574
|
const optionsRef = useRef13(options);
|
|
8558
8575
|
optionsRef.current = options;
|
|
8559
8576
|
const rowIds = options?.rowIds ?? [];
|
|
@@ -8932,7 +8949,9 @@ function useSpreadsheetGrid(options) {
|
|
|
8932
8949
|
event.preventDefault();
|
|
8933
8950
|
const origin = event.currentTarget;
|
|
8934
8951
|
if (typeof HTMLElement !== "undefined" && origin instanceof HTMLElement) {
|
|
8935
|
-
origin.closest('[data-matrx-table-spreadsheet="true"]')
|
|
8952
|
+
const container = origin.closest('[data-matrx-table-spreadsheet="true"]');
|
|
8953
|
+
const catcher = container?.querySelector(`[${TYPE_CATCHER_ATTR}]`);
|
|
8954
|
+
(catcher ?? container)?.focus({ preventScroll: true });
|
|
8936
8955
|
}
|
|
8937
8956
|
setRange(
|
|
8938
8957
|
(previous) => event.shiftKey && previous ? { anchor: previous.anchor, focus: address } : { anchor: address, focus: address }
|
|
@@ -9003,11 +9022,58 @@ function useSpreadsheetGrid(options) {
|
|
|
9003
9022
|
window.addEventListener("mouseup", commit);
|
|
9004
9023
|
return () => window.removeEventListener("mouseup", commit);
|
|
9005
9024
|
}, [options, fillRequestBase, applyPatches, announceSkips, screenPatches, refuseWrite]);
|
|
9025
|
+
const takeTypedText = useCallback7(
|
|
9026
|
+
(text) => {
|
|
9027
|
+
if (catcherRef.current) catcherRef.current.value = "";
|
|
9028
|
+
const current = optionsRef.current;
|
|
9029
|
+
const focused = range?.focus;
|
|
9030
|
+
if (!current || !focused || current.readOnly || !current.onEditRequest) return;
|
|
9031
|
+
if (text.trim() === "") return;
|
|
9032
|
+
current.onEditRequest(focused, text);
|
|
9033
|
+
},
|
|
9034
|
+
[range]
|
|
9035
|
+
);
|
|
9036
|
+
const typeCatcherProps = {
|
|
9037
|
+
ref: (element) => {
|
|
9038
|
+
catcherRef.current = element;
|
|
9039
|
+
},
|
|
9040
|
+
tabIndex: -1,
|
|
9041
|
+
"aria-label": "Type to edit the selected cell",
|
|
9042
|
+
inputMode: "none",
|
|
9043
|
+
autoComplete: "off",
|
|
9044
|
+
autoCorrect: "off",
|
|
9045
|
+
autoCapitalize: "off",
|
|
9046
|
+
spellCheck: false,
|
|
9047
|
+
rows: 1,
|
|
9048
|
+
[TYPE_CATCHER_ATTR]: "",
|
|
9049
|
+
style: TYPE_CATCHER_STYLE,
|
|
9050
|
+
onInput: (event) => {
|
|
9051
|
+
const kind = event.nativeEvent?.inputType;
|
|
9052
|
+
if (typeof kind === "string" && (kind.startsWith("insertFromPaste") || kind.startsWith("insertFromDrop"))) {
|
|
9053
|
+
event.currentTarget.value = "";
|
|
9054
|
+
return;
|
|
9055
|
+
}
|
|
9056
|
+
if (composingRef.current) return;
|
|
9057
|
+
takeTypedText(event.currentTarget.value);
|
|
9058
|
+
},
|
|
9059
|
+
onCompositionStart: () => {
|
|
9060
|
+
composingRef.current = true;
|
|
9061
|
+
},
|
|
9062
|
+
onCompositionEnd: (event) => {
|
|
9063
|
+
composingRef.current = false;
|
|
9064
|
+
takeTypedText(event.data || event.currentTarget.value);
|
|
9065
|
+
}
|
|
9066
|
+
};
|
|
9006
9067
|
return {
|
|
9007
9068
|
range,
|
|
9008
9069
|
bounds,
|
|
9009
9070
|
enabled: options !== null,
|
|
9071
|
+
typeCatcherProps,
|
|
9010
9072
|
containerProps: {
|
|
9073
|
+
onFocus: (event) => {
|
|
9074
|
+
if (event.target !== event.currentTarget) return;
|
|
9075
|
+
catcherRef.current?.focus({ preventScroll: true });
|
|
9076
|
+
},
|
|
9011
9077
|
tabIndex: options ? 0 : -1,
|
|
9012
9078
|
onKeyDown,
|
|
9013
9079
|
onCopy,
|
|
@@ -14002,13 +14068,17 @@ function MatrxDataTableCore({
|
|
|
14002
14068
|
}));
|
|
14003
14069
|
};
|
|
14004
14070
|
const requestCellEdit = (address, seed) => {
|
|
14005
|
-
if (!editEnabled) return false;
|
|
14071
|
+
if (!editEnabled && !spreadsheet?.onEditRequest) return false;
|
|
14006
14072
|
const row = data.find((candidate) => getRowId(candidate) === address.rowId);
|
|
14007
14073
|
if (!row) return false;
|
|
14008
14074
|
const column = visibleColumns.find(
|
|
14009
14075
|
(candidate) => columnId(candidate) === address.fieldName
|
|
14010
14076
|
);
|
|
14011
|
-
if (!column?.editable
|
|
14077
|
+
if (!column?.editable) {
|
|
14078
|
+
const own = spreadsheet?.onEditRequest;
|
|
14079
|
+
return own ? own({ rowId: address.rowId, columnId: address.fieldName }, seed) : false;
|
|
14080
|
+
}
|
|
14081
|
+
if (!(column.editableIf?.(row) ?? true)) return false;
|
|
14012
14082
|
const field = column.accessorKey ? String(column.accessorKey) : columnId(column);
|
|
14013
14083
|
setEditRequest((current) => ({
|
|
14014
14084
|
rowId: address.rowId,
|
|
@@ -15137,6 +15207,7 @@ function MatrxDataTableCore({
|
|
|
15137
15207
|
onCopy: sheet.containerProps.onCopy,
|
|
15138
15208
|
onCut: sheet.containerProps.onCut,
|
|
15139
15209
|
onPaste: sheet.containerProps.onPaste,
|
|
15210
|
+
onFocus: sheet.containerProps.onFocus,
|
|
15140
15211
|
"data-matrx-table-spreadsheet": "true"
|
|
15141
15212
|
} : {},
|
|
15142
15213
|
"aria-busy": isLoading || isFetching,
|
|
@@ -15147,6 +15218,7 @@ function MatrxDataTableCore({
|
|
|
15147
15218
|
tableClassName
|
|
15148
15219
|
),
|
|
15149
15220
|
children: [
|
|
15221
|
+
spreadsheetEnabled ? /* @__PURE__ */ jsx43("textarea", { ...sheet.typeCatcherProps }) : null,
|
|
15150
15222
|
hierarchy && draggedRow ? /* @__PURE__ */ jsx43(
|
|
15151
15223
|
HierarchyRootDropTarget,
|
|
15152
15224
|
{
|