@dxos/react-ui-table 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112
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/dist/lib/browser/{chunk-4KOQTPFC.mjs → chunk-5V5FV3GS.mjs} +9 -12
- package/dist/lib/browser/{chunk-4KOQTPFC.mjs.map → chunk-5V5FV3GS.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-KOSV2J5N.mjs → chunk-5H6GHWNR.mjs} +9 -12
- package/dist/lib/node-esm/{chunk-KOSV2J5N.mjs.map → chunk-5H6GHWNR.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -35
- package/src/hooks/useTableModel.ts +4 -5
- package/src/model/table-presentation.ts +4 -4
|
@@ -1393,7 +1393,7 @@ var TablePresentation = class {
|
|
|
1393
1393
|
fieldId: field.id
|
|
1394
1394
|
})}
|
|
1395
1395
|
`,
|
|
1396
|
-
className: "
|
|
1396
|
+
className: "bg-axis-surface! text-axis-text! [&>div]:flex [&>div]:items-stretch"
|
|
1397
1397
|
};
|
|
1398
1398
|
}
|
|
1399
1399
|
return cells;
|
|
@@ -1444,7 +1444,7 @@ var TablePresentation = class {
|
|
|
1444
1444
|
col: 0,
|
|
1445
1445
|
row: 0
|
|
1446
1446
|
})]: {
|
|
1447
|
-
className: "
|
|
1447
|
+
className: "bg-axis-surface!",
|
|
1448
1448
|
readonly: true,
|
|
1449
1449
|
value: ""
|
|
1450
1450
|
}
|
|
@@ -1460,7 +1460,7 @@ var TablePresentation = class {
|
|
|
1460
1460
|
header: true,
|
|
1461
1461
|
checked: this.model.selection.allRowsSelected
|
|
1462
1462
|
}),
|
|
1463
|
-
className: "
|
|
1463
|
+
className: "bg-axis-surface!",
|
|
1464
1464
|
readonly: true,
|
|
1465
1465
|
value: ""
|
|
1466
1466
|
}
|
|
@@ -1475,7 +1475,7 @@ var TablePresentation = class {
|
|
|
1475
1475
|
accessoryHtml: this.model.features.schemaEditable ? tableButtons.addColumn.render({
|
|
1476
1476
|
disabled: (this.model.projection?.getFields()?.length ?? 0) >= VIEW_FIELD_LIMIT
|
|
1477
1477
|
}) : void 0,
|
|
1478
|
-
className: "
|
|
1478
|
+
className: "bg-axis-surface!",
|
|
1479
1479
|
readonly: true,
|
|
1480
1480
|
value: ""
|
|
1481
1481
|
}
|
|
@@ -1604,11 +1604,10 @@ var useProjectionModel = (schema, table, registry) => {
|
|
|
1604
1604
|
import { RegistryContext } from "@effect-atom/atom-react";
|
|
1605
1605
|
import { useContext, useEffect, useMemo, useState as useState2 } from "react";
|
|
1606
1606
|
import { Obj as Obj4 } from "@dxos/echo";
|
|
1607
|
-
import {
|
|
1608
|
-
import { isNonNullable } from "@dxos/util";
|
|
1607
|
+
import { useSelection, useSelectionActions } from "@dxos/react-ui-attention";
|
|
1609
1608
|
var useTableModel = ({ object, projection, db, rows, rowActions, features, onSelectionChanged, onRowAction, ...props }) => {
|
|
1610
1609
|
const registry = useContext(RegistryContext);
|
|
1611
|
-
const selected =
|
|
1610
|
+
const selected = useSelection(object && Obj4.getURI(object), "multi");
|
|
1612
1611
|
const initialSelection = useMemo(() => selected, [
|
|
1613
1612
|
object
|
|
1614
1613
|
]);
|
|
@@ -1654,9 +1653,7 @@ var useTableModel = ({ object, projection, db, rows, rowActions, features, onSel
|
|
|
1654
1653
|
model,
|
|
1655
1654
|
rows
|
|
1656
1655
|
]);
|
|
1657
|
-
const {
|
|
1658
|
-
model?.id
|
|
1659
|
-
].filter(isNonNullable));
|
|
1656
|
+
const { multi, clear } = useSelectionActions(model?.id);
|
|
1660
1657
|
useEffect(() => {
|
|
1661
1658
|
if (!model) {
|
|
1662
1659
|
return;
|
|
@@ -1665,7 +1662,7 @@ var useTableModel = ({ object, projection, db, rows, rowActions, features, onSel
|
|
|
1665
1662
|
const selectedItems = [
|
|
1666
1663
|
...model.selection.selection
|
|
1667
1664
|
];
|
|
1668
|
-
|
|
1665
|
+
multi(selectedItems);
|
|
1669
1666
|
onSelectionChanged?.(selectedItems);
|
|
1670
1667
|
});
|
|
1671
1668
|
return () => {
|
|
@@ -1699,4 +1696,4 @@ export {
|
|
|
1699
1696
|
useProjectionModel,
|
|
1700
1697
|
useTableModel
|
|
1701
1698
|
};
|
|
1702
|
-
//# sourceMappingURL=chunk-
|
|
1699
|
+
//# sourceMappingURL=chunk-5V5FV3GS.mjs.map
|