@ai-matrx/design-system 0.34.0 → 0.36.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 +58 -0
- package/dist/content-transfer.cjs +3 -1
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.js +3 -1
- 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 +3 -1
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +3 -1
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +3 -1
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +3 -1
- 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 +57 -22
- 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 +57 -22
- 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 +18 -0
- package/dist/data-table/spreadsheet.cjs.map +1 -1
- package/dist/data-table/spreadsheet.d.cts +5 -0
- package/dist/data-table/spreadsheet.d.ts +5 -0
- package/dist/data-table/spreadsheet.js +18 -0
- 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/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-CFmCZXVn.d.ts → types-Cxm5XK0L.d.ts} +25 -7
- package/dist/{types-CYkwg9jR.d.cts → types-kiV-CAuZ.d.cts} +25 -7
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-
|
|
1
|
+
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-kiV-CAuZ.cjs';
|
|
2
2
|
import '../content-transfer.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@ai-matrx/kit/content-transfer';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-
|
|
1
|
+
import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-Cxm5XK0L.js';
|
|
2
2
|
import '../content-transfer.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@ai-matrx/kit/content-transfer';
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ComponentType, ReactNode, MouseEventHandler } from 'react';
|
|
3
3
|
import { CopyControlProps } from './copy-types.cjs';
|
|
4
4
|
export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.cjs';
|
|
5
|
-
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-
|
|
5
|
+
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-kiV-CAuZ.cjs';
|
|
6
6
|
import { MatrxTableMenuTarget, MatrxTableMenuPayload } from './menu-targets.cjs';
|
|
7
7
|
import '../content-transfer.cjs';
|
|
8
8
|
import '@ai-matrx/kit/content-transfer';
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ComponentType, ReactNode, MouseEventHandler } from 'react';
|
|
3
3
|
import { CopyControlProps } from './copy-types.js';
|
|
4
4
|
export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.js';
|
|
5
|
-
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-
|
|
5
|
+
import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-Cxm5XK0L.js';
|
|
6
6
|
import { MatrxTableMenuTarget, MatrxTableMenuPayload } from './menu-targets.js';
|
|
7
7
|
import '../content-transfer.js';
|
|
8
8
|
import '@ai-matrx/kit/content-transfer';
|
|
@@ -2594,6 +2594,7 @@ var PopoverContent = React13.forwardRef(
|
|
|
2594
2594
|
sideOffset = 4,
|
|
2595
2595
|
container,
|
|
2596
2596
|
animated = true,
|
|
2597
|
+
sizing = "fixed",
|
|
2597
2598
|
...props
|
|
2598
2599
|
}, ref) => {
|
|
2599
2600
|
const portalContainer = usePortalContainer(container);
|
|
@@ -2610,7 +2611,8 @@ var PopoverContent = React13.forwardRef(
|
|
|
2610
2611
|
// z, DOM portal order decides, so a dialog opened FROM a popover stacks
|
|
2611
2612
|
// above it, and a popover opened from a dialog still stacks above the
|
|
2612
2613
|
// dialog. z-[10001] buried dialogs behind fullscreen popovers.
|
|
2613
|
-
"z-[10000]
|
|
2614
|
+
"z-[10000] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",
|
|
2615
|
+
sizing === "content" ? "w-auto min-w-[min(max(var(--radix-popover-trigger-width),20rem),calc(100vw-2rem))] max-w-[min(28rem,calc(100vw-2rem))]" : "w-72",
|
|
2614
2616
|
animated && MOTION_POPPER,
|
|
2615
2617
|
className
|
|
2616
2618
|
),
|
|
@@ -6296,8 +6298,9 @@ function ColumnHeaderCell({
|
|
|
6296
6298
|
const menuContent = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6297
6299
|
PopoverContent,
|
|
6298
6300
|
{
|
|
6301
|
+
sizing: "content",
|
|
6299
6302
|
align: "start",
|
|
6300
|
-
className: "
|
|
6303
|
+
className: "p-2",
|
|
6301
6304
|
onClick: (e) => e.stopPropagation(),
|
|
6302
6305
|
onOpenAutoFocus: (event) => {
|
|
6303
6306
|
const content = event.currentTarget;
|
|
@@ -8436,6 +8439,19 @@ function targetsAnEditor(target) {
|
|
|
8436
8439
|
if (!element) return false;
|
|
8437
8440
|
return element.closest("input, textarea, select, [contenteditable='true']") !== null;
|
|
8438
8441
|
}
|
|
8442
|
+
function camePastAPortal(target, host) {
|
|
8443
|
+
if (typeof Element === "undefined") return false;
|
|
8444
|
+
const element = target instanceof Element ? target : null;
|
|
8445
|
+
const owner = host instanceof Element ? host : null;
|
|
8446
|
+
if (!element || !owner) return false;
|
|
8447
|
+
return !owner.contains(element);
|
|
8448
|
+
}
|
|
8449
|
+
function camePastAPortalIntoTheContainer(target) {
|
|
8450
|
+
if (typeof Element === "undefined") return false;
|
|
8451
|
+
const element = target instanceof Element ? target : null;
|
|
8452
|
+
if (!element) return false;
|
|
8453
|
+
return element.closest('[data-matrx-table-spreadsheet="true"]') === null;
|
|
8454
|
+
}
|
|
8439
8455
|
function useSpreadsheetGrid(options) {
|
|
8440
8456
|
const [range, setRange] = (0, import_react15.useState)(null);
|
|
8441
8457
|
const [fillTarget, setFillTarget] = (0, import_react15.useState)(null);
|
|
@@ -8607,6 +8623,7 @@ function useSpreadsheetGrid(options) {
|
|
|
8607
8623
|
const current = optionsRef.current;
|
|
8608
8624
|
if (!current) return;
|
|
8609
8625
|
if (targetsAnEditor(event.target)) return;
|
|
8626
|
+
if (camePastAPortalIntoTheContainer(event.target)) return;
|
|
8610
8627
|
const accel = event.metaKey || event.ctrlKey;
|
|
8611
8628
|
if (accel && (event.key === "z" || event.key === "Z")) {
|
|
8612
8629
|
event.preventDefault();
|
|
@@ -8693,6 +8710,7 @@ function useSpreadsheetGrid(options) {
|
|
|
8693
8710
|
const onCopy = (0, import_react15.useCallback)(
|
|
8694
8711
|
(event) => {
|
|
8695
8712
|
if (!optionsRef.current || !range || targetsAnEditor(event.target)) return;
|
|
8713
|
+
if (camePastAPortalIntoTheContainer(event.target)) return;
|
|
8696
8714
|
const text = selectionAsTsv();
|
|
8697
8715
|
if (!text) return;
|
|
8698
8716
|
event.preventDefault();
|
|
@@ -8703,6 +8721,7 @@ function useSpreadsheetGrid(options) {
|
|
|
8703
8721
|
const onCut = (0, import_react15.useCallback)(
|
|
8704
8722
|
(event) => {
|
|
8705
8723
|
if (!optionsRef.current || !range || targetsAnEditor(event.target)) return;
|
|
8724
|
+
if (camePastAPortalIntoTheContainer(event.target)) return;
|
|
8706
8725
|
const text = selectionAsTsv();
|
|
8707
8726
|
if (!text) return;
|
|
8708
8727
|
event.preventDefault();
|
|
@@ -8715,6 +8734,7 @@ function useSpreadsheetGrid(options) {
|
|
|
8715
8734
|
(event) => {
|
|
8716
8735
|
const current = optionsRef.current;
|
|
8717
8736
|
if (!current || current.paste === false || !range || targetsAnEditor(event.target)) return;
|
|
8737
|
+
if (camePastAPortalIntoTheContainer(event.target)) return;
|
|
8718
8738
|
const text = event.clipboardData?.getData("text/plain") ?? "";
|
|
8719
8739
|
if (!text) return;
|
|
8720
8740
|
event.preventDefault();
|
|
@@ -8798,6 +8818,7 @@ function useSpreadsheetGrid(options) {
|
|
|
8798
8818
|
...inFillPreview ? { "data-matrx-cell-fill-preview": "true" } : {},
|
|
8799
8819
|
onMouseDown: (event) => {
|
|
8800
8820
|
if (event.button !== 0) return;
|
|
8821
|
+
if (camePastAPortal(event.target ?? null, event.currentTarget)) return;
|
|
8801
8822
|
event.preventDefault();
|
|
8802
8823
|
const origin = event.currentTarget;
|
|
8803
8824
|
if (typeof HTMLElement !== "undefined" && origin instanceof HTMLElement) {
|
|
@@ -10995,8 +11016,9 @@ function EditableTableCell({
|
|
|
10995
11016
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10996
11017
|
PopoverContent,
|
|
10997
11018
|
{
|
|
11019
|
+
sizing: "content",
|
|
10998
11020
|
align: "start",
|
|
10999
|
-
className: "
|
|
11021
|
+
className: "p-2",
|
|
11000
11022
|
onClick: (e) => e.stopPropagation(),
|
|
11001
11023
|
children: [
|
|
11002
11024
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
@@ -13158,14 +13180,14 @@ function MatrxDataTableCore({
|
|
|
13158
13180
|
const coverageResult = (0, import_react21.useMemo)(() => {
|
|
13159
13181
|
if (!coverage) return null;
|
|
13160
13182
|
return describeCoverage({
|
|
13161
|
-
loaded:
|
|
13183
|
+
loaded: data.length,
|
|
13162
13184
|
...coverage.matched === void 0 ? {} : { matched: coverage.matched },
|
|
13163
13185
|
...coverage.total === void 0 ? {} : { total: coverage.total },
|
|
13164
13186
|
...coverage.cap === void 0 ? {} : { cap: coverage.cap },
|
|
13165
13187
|
answeredBy: coverage.answeredBy ?? "client",
|
|
13166
13188
|
...coverage.noun === void 0 ? {} : { noun: coverage.noun }
|
|
13167
13189
|
});
|
|
13168
|
-
}, [coverage,
|
|
13190
|
+
}, [coverage, data.length]);
|
|
13169
13191
|
const bodyEntries = (0, import_react21.useMemo)(() => {
|
|
13170
13192
|
const from = effectiveRowWindow ? effectiveRowWindow.start : 0;
|
|
13171
13193
|
const to = effectiveRowWindow ? effectiveRowWindow.end : void 0;
|
|
@@ -13386,13 +13408,26 @@ function MatrxDataTableCore({
|
|
|
13386
13408
|
setWindowRowSnapshot(null);
|
|
13387
13409
|
};
|
|
13388
13410
|
const canExpandRow = (row) => Boolean(expandedDetail && (expandedDetail.canExpand?.(row) ?? true));
|
|
13389
|
-
const
|
|
13411
|
+
const isMultiExpandedDetail = (detail2) => "expandedIds" in detail2;
|
|
13412
|
+
const isRowExpanded = (row) => {
|
|
13413
|
+
if (!expandedDetail || !canExpandRow(row)) return false;
|
|
13414
|
+
const id = getRowId(row);
|
|
13415
|
+
return isMultiExpandedDetail(expandedDetail) ? expandedDetail.expandedIds.has(id) : expandedDetail.expandedId === id;
|
|
13416
|
+
};
|
|
13390
13417
|
const toggleExpanded = (row) => {
|
|
13391
13418
|
if (!expandedDetail || !canExpandRow(row)) return;
|
|
13392
13419
|
const id = getRowId(row);
|
|
13393
|
-
expandedDetail
|
|
13394
|
-
|
|
13395
|
-
|
|
13420
|
+
if (isMultiExpandedDetail(expandedDetail)) {
|
|
13421
|
+
const nextExpandedIds = new Set(expandedDetail.expandedIds);
|
|
13422
|
+
if (nextExpandedIds.has(id)) {
|
|
13423
|
+
nextExpandedIds.delete(id);
|
|
13424
|
+
} else {
|
|
13425
|
+
nextExpandedIds.add(id);
|
|
13426
|
+
}
|
|
13427
|
+
expandedDetail.onExpandedIdsChange(nextExpandedIds);
|
|
13428
|
+
return;
|
|
13429
|
+
}
|
|
13430
|
+
expandedDetail.onExpandedIdChange(expandedDetail.expandedId === id ? null : id);
|
|
13396
13431
|
};
|
|
13397
13432
|
const openRow = (row) => {
|
|
13398
13433
|
if (canExpandRow(row)) {
|
|
@@ -14430,6 +14465,19 @@ function MatrxDataTableCore({
|
|
|
14430
14465
|
}
|
|
14431
14466
|
),
|
|
14432
14467
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-matrx-table-body-region": true, className: "flex min-h-0 flex-1 flex-col gap-2", children: [
|
|
14468
|
+
coverageResult && coverageResult.notice ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
14469
|
+
"div",
|
|
14470
|
+
{
|
|
14471
|
+
"data-matrx-table-coverage": true,
|
|
14472
|
+
"data-matrx-table-coverage-scope": coverageResult.scope,
|
|
14473
|
+
role: "status",
|
|
14474
|
+
className: "flex shrink-0 items-start gap-2 rounded-md border border-amber-300/70 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-200",
|
|
14475
|
+
children: [
|
|
14476
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "font-semibold", children: coverageResult.badge }),
|
|
14477
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: coverageResult.notice })
|
|
14478
|
+
]
|
|
14479
|
+
}
|
|
14480
|
+
) : null,
|
|
14433
14481
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "relative min-h-0 flex-1", children: [
|
|
14434
14482
|
mobileCards ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
14435
14483
|
"div",
|
|
@@ -14536,19 +14584,6 @@ function MatrxDataTableCore({
|
|
|
14536
14584
|
]
|
|
14537
14585
|
}
|
|
14538
14586
|
) : null,
|
|
14539
|
-
coverageResult && coverageResult.notice ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
14540
|
-
"div",
|
|
14541
|
-
{
|
|
14542
|
-
"data-matrx-table-coverage": true,
|
|
14543
|
-
"data-matrx-table-coverage-scope": coverageResult.scope,
|
|
14544
|
-
role: "status",
|
|
14545
|
-
className: "mb-1 flex items-start gap-2 rounded-md border border-amber-300/70 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-200",
|
|
14546
|
-
children: [
|
|
14547
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "font-semibold", children: coverageResult.badge }),
|
|
14548
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: coverageResult.notice })
|
|
14549
|
-
]
|
|
14550
|
-
}
|
|
14551
|
-
) : null,
|
|
14552
14587
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
14553
14588
|
"div",
|
|
14554
14589
|
{
|