@dxos/react-ui-table 0.8.2-main.2f9c567 → 0.8.2-main.36232bc
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-YWNRUF4J.mjs +26 -0
- package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +107 -40
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-2QLLIPZK.cjs → chunk-TGG6OZ54.cjs} +11 -13
- package/dist/lib/node/chunk-TGG6OZ54.cjs.map +7 -0
- package/dist/lib/node/index.cjs +173 -108
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-N2RRVR7F.mjs → chunk-KKLP54L3.mjs} +9 -11
- package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +107 -40
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/RefPanel.d.ts +9 -0
- package/dist/types/src/components/Table/RefPanel.d.ts.map +1 -0
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +39 -39
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +43 -43
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/util/table-buttons.d.ts +14 -0
- package/dist/types/src/util/table-buttons.d.ts.map +1 -1
- package/dist/types/src/util/table.d.ts +2 -2
- package/dist/types/src/util/table.d.ts.map +1 -1
- package/package.json +33 -35
- package/src/components/Table/CreateRefPanel.tsx +3 -3
- package/src/components/Table/RefPanel.tsx +52 -0
- package/src/components/Table/Table.stories.tsx +2 -1
- package/src/components/Table/Table.tsx +6 -0
- package/src/components/Table/relations.stories.tsx +9 -10
- package/src/components/testing.ts +6 -7
- package/src/model/table-model.test.ts +3 -4
- package/src/model/table-presentation.test.ts +3 -4
- package/src/model/table-presentation.ts +5 -3
- package/src/types/table.ts +8 -16
- package/src/util/table-buttons.ts +23 -0
- package/src/util/table.ts +7 -7
- package/dist/lib/browser/chunk-UGGYKLOH.mjs +0 -28
- package/dist/lib/browser/chunk-UGGYKLOH.mjs.map +0 -7
- package/dist/lib/node/chunk-2QLLIPZK.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-N2RRVR7F.mjs.map +0 -7
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// packages/ui/react-ui-table/src/types/table.ts
|
|
2
|
+
import { EchoObject, Expando, LabelAnnotationId, ObjectId, Ref, S } from "@dxos/echo-schema";
|
|
3
|
+
import { ViewType } from "@dxos/schema";
|
|
4
|
+
var TableSchema = S.Struct({
|
|
5
|
+
id: ObjectId,
|
|
6
|
+
name: S.optional(S.String),
|
|
7
|
+
view: S.optional(Ref(ViewType)),
|
|
8
|
+
// TODO(burdon): Document why threads is included here?
|
|
9
|
+
threads: S.optional(S.Array(Ref(
|
|
10
|
+
Expando
|
|
11
|
+
/* ThreadType */
|
|
12
|
+
)))
|
|
13
|
+
}).annotations({
|
|
14
|
+
// TODO(burdon): Move annotation to property.
|
|
15
|
+
[LabelAnnotationId]: "name"
|
|
16
|
+
});
|
|
17
|
+
var TableType = TableSchema.pipe(EchoObject({
|
|
18
|
+
typename: "dxos.org/type/Table",
|
|
19
|
+
version: "0.1.0"
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
TableSchema,
|
|
24
|
+
TableType
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-YWNRUF4J.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/table.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { EchoObject, Expando, LabelAnnotationId, ObjectId, Ref, S } from '@dxos/echo-schema';\n// import { ThreadType } from '@dxos/plugin-space/types';\nimport { ViewType } from '@dxos/schema';\n\nexport const TableSchema = S.Struct({\n id: ObjectId,\n name: S.optional(S.String),\n view: S.optional(Ref(ViewType)),\n // TODO(burdon): Document why threads is included here?\n threads: S.optional(S.Array(Ref(Expando /* ThreadType */))),\n}).annotations({\n // TODO(burdon): Move annotation to property.\n [LabelAnnotationId]: 'name',\n});\n\nexport const TableType = TableSchema.pipe(EchoObject({ typename: 'dxos.org/type/Table', version: '0.1.0' }));\nexport interface TableType extends S.Schema.Type<typeof TableType> {}\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,YAAYC,SAASC,mBAAmBC,UAAUC,KAAKC,SAAS;AAEzE,SAASC,gBAAgB;AAElB,IAAMC,cAAcC,EAAEC,OAAO;EAClCC,IAAIC;EACJC,MAAMJ,EAAEK,SAASL,EAAEM,MAAM;EACzBC,MAAMP,EAAEK,SAASG,IAAIC,QAAAA,CAAAA;;EAErBC,SAASV,EAAEK,SAASL,EAAEW,MAAMH;IAAII;;EAAsB,CAAA,CAAA;AACxD,CAAA,EAAGC,YAAY;;EAEb,CAACC,iBAAAA,GAAoB;AACvB,CAAA;AAEO,IAAMC,YAAYhB,YAAYiB,KAAKC,WAAW;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,CAAA;",
|
|
6
|
+
"names": ["EchoObject", "Expando", "LabelAnnotationId", "ObjectId", "Ref", "S", "ViewType", "TableSchema", "S", "Struct", "id", "ObjectId", "name", "optional", "String", "view", "Ref", "ViewType", "threads", "Array", "Expando", "annotations", "LabelAnnotationId", "TableType", "pipe", "EchoObject", "typename", "version"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TableSchema,
|
|
3
3
|
TableType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YWNRUF4J.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/ui/react-ui-table/src/translations.ts
|
|
7
7
|
var translationKey = "table";
|
|
@@ -36,7 +36,7 @@ var translations_default = [
|
|
|
36
36
|
];
|
|
37
37
|
|
|
38
38
|
// packages/ui/react-ui-table/src/components/Table/Table.tsx
|
|
39
|
-
import
|
|
39
|
+
import React7, { forwardRef, useCallback as useCallback4, useImperativeHandle, useState as useState2, useMemo as useMemo4, useEffect as useEffect2 } from "react";
|
|
40
40
|
import { getValue as getValue4 } from "@dxos/echo-schema";
|
|
41
41
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
42
42
|
import { Filter } from "@dxos/react-client/echo";
|
|
@@ -150,8 +150,8 @@ var ColumnSettings = ({ model, modals, onNewColumn }) => {
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
// packages/ui/react-ui-table/src/components/Table/CreateRefPanel.tsx
|
|
153
|
-
import { Schema } from "effect";
|
|
154
153
|
import React3, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
154
|
+
import { S } from "@dxos/echo-schema";
|
|
155
155
|
import { live } from "@dxos/react-client/echo";
|
|
156
156
|
import { Popover } from "@dxos/react-ui";
|
|
157
157
|
import { Form } from "@dxos/react-ui-form";
|
|
@@ -168,7 +168,7 @@ var CreateRefPanel = ({ model, modals, __gridScope }) => {
|
|
|
168
168
|
typename: state.typename
|
|
169
169
|
}).runSync();
|
|
170
170
|
if (schema2) {
|
|
171
|
-
const omit =
|
|
171
|
+
const omit = S.omit("id");
|
|
172
172
|
return omit(schema2);
|
|
173
173
|
}
|
|
174
174
|
}, [
|
|
@@ -223,8 +223,46 @@ var CreateRefPanel = ({ model, modals, __gridScope }) => {
|
|
|
223
223
|
}), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))));
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
// packages/ui/react-ui-table/src/components/Table/
|
|
226
|
+
// packages/ui/react-ui-table/src/components/Table/RefPanel.tsx
|
|
227
227
|
import React4 from "react";
|
|
228
|
+
import { Popover as Popover2 } from "@dxos/react-ui";
|
|
229
|
+
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
230
|
+
var getRefTargetObj = (space, id) => {
|
|
231
|
+
if (space && id) {
|
|
232
|
+
return space?.db.getObjectById(id);
|
|
233
|
+
} else {
|
|
234
|
+
return void 0;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
var RefPanel = ({ model, modals }) => {
|
|
238
|
+
const state = modals.state.value;
|
|
239
|
+
const space = model?.space;
|
|
240
|
+
const targetObj = getRefTargetObj(space, state?.type === "refPanel" ? state.targetId : void 0);
|
|
241
|
+
const schema = space && state?.type === "refPanel" ? space.db.schemaRegistry.getSchema(state.typename) : void 0;
|
|
242
|
+
if (!model.view || !model.projection) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
return /* @__PURE__ */ React4.createElement(Popover2.Root, {
|
|
246
|
+
modal: false,
|
|
247
|
+
open: state?.type === "refPanel" && !!targetObj && !!schema,
|
|
248
|
+
onOpenChange: (nextOpen) => {
|
|
249
|
+
if (!nextOpen) {
|
|
250
|
+
return modals.close();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}, /* @__PURE__ */ React4.createElement(Popover2.VirtualTrigger, {
|
|
254
|
+
virtualRef: modals.trigger
|
|
255
|
+
}), /* @__PURE__ */ React4.createElement(Popover2.Portal, null, /* @__PURE__ */ React4.createElement(Popover2.Content, {
|
|
256
|
+
classNames: "md:is-64"
|
|
257
|
+
}, targetObj && schema && /* @__PURE__ */ React4.createElement(Form2, {
|
|
258
|
+
readonly: true,
|
|
259
|
+
values: targetObj,
|
|
260
|
+
schema
|
|
261
|
+
}), /* @__PURE__ */ React4.createElement(Popover2.Arrow, null))));
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
// packages/ui/react-ui-table/src/components/Table/RowActionsMenu.tsx
|
|
265
|
+
import React5 from "react";
|
|
228
266
|
import { DropdownMenu as DropdownMenu3, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
229
267
|
var RowActionsMenu = ({ model, modals }) => {
|
|
230
268
|
const { t } = useTranslation2(translationKey);
|
|
@@ -233,23 +271,23 @@ var RowActionsMenu = ({ model, modals }) => {
|
|
|
233
271
|
if (state?.type !== "row") {
|
|
234
272
|
return null;
|
|
235
273
|
}
|
|
236
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ React5.createElement(DropdownMenu3.Root, {
|
|
237
275
|
modal: false,
|
|
238
276
|
open: true,
|
|
239
277
|
onOpenChange: modals.close
|
|
240
|
-
}, /* @__PURE__ */
|
|
278
|
+
}, /* @__PURE__ */ React5.createElement(DropdownMenu3.VirtualTrigger, {
|
|
241
279
|
virtualRef: modals.trigger
|
|
242
|
-
}), /* @__PURE__ */
|
|
280
|
+
}), /* @__PURE__ */ React5.createElement(DropdownMenu3.Content, null, /* @__PURE__ */ React5.createElement(DropdownMenu3.Viewport, null, model.features.dataEditable !== false && /* @__PURE__ */ React5.createElement(DropdownMenu3.Item, {
|
|
243
281
|
"data-testid": "row-menu-delete",
|
|
244
282
|
onClick: () => model.deleteRow(state.rowIndex)
|
|
245
|
-
}, t(hasSelection ? "bulk delete row label" : "delete row label")), model.rowActions?.map((action) => /* @__PURE__ */
|
|
283
|
+
}, t(hasSelection ? "bulk delete row label" : "delete row label")), model.rowActions?.map((action) => /* @__PURE__ */ React5.createElement(DropdownMenu3.Item, {
|
|
246
284
|
key: action.id,
|
|
247
285
|
"data-testid": `row-action-${action.id}`,
|
|
248
286
|
onClick: () => {
|
|
249
287
|
modals.close();
|
|
250
288
|
model.handleRowAction(action.id, state.rowIndex);
|
|
251
289
|
}
|
|
252
|
-
}, t(action.translationKey)))), /* @__PURE__ */
|
|
290
|
+
}, t(action.translationKey)))), /* @__PURE__ */ React5.createElement(DropdownMenu3.Arrow, null)));
|
|
253
291
|
};
|
|
254
292
|
|
|
255
293
|
// packages/ui/react-ui-table/src/model/table-model.ts
|
|
@@ -344,8 +382,7 @@ var setProperties = (view, projection, properties) => {
|
|
|
344
382
|
var touch = (value) => value;
|
|
345
383
|
|
|
346
384
|
// packages/ui/react-ui-table/src/util/table.ts
|
|
347
|
-
import {
|
|
348
|
-
import { Format, FormatEnum, TypedObject, TypeEnum } from "@dxos/echo-schema";
|
|
385
|
+
import { AST, Format, FormatEnum, S as S2, TypedObject, TypeEnum } from "@dxos/echo-schema";
|
|
349
386
|
import { PublicKey } from "@dxos/react-client";
|
|
350
387
|
import { live as live3, makeRef as makeRef2 } from "@dxos/react-client/echo";
|
|
351
388
|
import { createFieldId, createView as createView2, getSchemaProperties, ViewProjection as ViewProjection2 } from "@dxos/schema";
|
|
@@ -386,13 +423,13 @@ var ContactSchema = TypedObject({
|
|
|
386
423
|
typename: `example.com/type/${PublicKey.random().truncate()}`,
|
|
387
424
|
version: "0.1.0"
|
|
388
425
|
})({
|
|
389
|
-
name:
|
|
390
|
-
[
|
|
426
|
+
name: S2.optional(S2.String).annotations({
|
|
427
|
+
[AST.TitleAnnotationId]: "Name"
|
|
391
428
|
}),
|
|
392
|
-
active:
|
|
393
|
-
email:
|
|
394
|
-
salary:
|
|
395
|
-
[
|
|
429
|
+
active: S2.optional(S2.Boolean),
|
|
430
|
+
email: S2.optional(Format.Email),
|
|
431
|
+
salary: S2.optional(Format.Currency()).annotations({
|
|
432
|
+
[AST.TitleAnnotationId]: "Salary"
|
|
396
433
|
})
|
|
397
434
|
});
|
|
398
435
|
var ContactFields = [
|
|
@@ -481,6 +518,26 @@ var columnSettingsButton = {
|
|
|
481
518
|
fieldId: el.getAttribute("data-field-id")
|
|
482
519
|
})
|
|
483
520
|
};
|
|
521
|
+
var referencedCellButton = {
|
|
522
|
+
attr: BUTTON_IDENTIFIERS.referencedCell,
|
|
523
|
+
icon: "ph--link-simple-horizontal--regular",
|
|
524
|
+
render: ({ targetId, schemaId }) => {
|
|
525
|
+
return createButton({
|
|
526
|
+
attr: BUTTON_IDENTIFIERS.referencedCell,
|
|
527
|
+
icon: referencedCellButton.icon,
|
|
528
|
+
data: {
|
|
529
|
+
"data-target-id": targetId,
|
|
530
|
+
"data-schema-id": schemaId
|
|
531
|
+
},
|
|
532
|
+
testId: "table-ref-cell-button"
|
|
533
|
+
});
|
|
534
|
+
},
|
|
535
|
+
getData: (el) => ({
|
|
536
|
+
type: "referencedCell",
|
|
537
|
+
targetId: el.getAttribute("data-target-id"),
|
|
538
|
+
schemaId: el.getAttribute("data-schema-id")
|
|
539
|
+
})
|
|
540
|
+
};
|
|
484
541
|
var rowMenuButton = {
|
|
485
542
|
attr: BUTTON_IDENTIFIERS.rowMenu,
|
|
486
543
|
icon: "ph--dots-three--regular",
|
|
@@ -525,6 +582,7 @@ var sortButton = {
|
|
|
525
582
|
var tableButtons = {
|
|
526
583
|
addColumn: addColumnButton,
|
|
527
584
|
columnSettings: columnSettingsButton,
|
|
585
|
+
referencedCell: referencedCellButton,
|
|
528
586
|
rowMenu: rowMenuButton,
|
|
529
587
|
sort: sortButton
|
|
530
588
|
};
|
|
@@ -1275,7 +1333,7 @@ var ModalController = class {
|
|
|
1275
1333
|
|
|
1276
1334
|
// packages/ui/react-ui-table/src/model/table-presentation.ts
|
|
1277
1335
|
import { signal as signal5 } from "@preact/signals-core";
|
|
1278
|
-
import { FormatEnum as FormatEnum4,
|
|
1336
|
+
import { FormatEnum as FormatEnum4, getValue as getValue3 } from "@dxos/echo-schema";
|
|
1279
1337
|
import { cellClassesForFieldType, formatForDisplay as formatForDisplay2 } from "@dxos/react-ui-form";
|
|
1280
1338
|
import { toPlaneCellIndex } from "@dxos/react-ui-grid";
|
|
1281
1339
|
import { mx } from "@dxos/react-ui-theme";
|
|
@@ -1377,8 +1435,10 @@ var TablePresentation = class {
|
|
|
1377
1435
|
if (props.format === FormatEnum4.Ref && props.referenceSchema) {
|
|
1378
1436
|
const targetObj = getValue3(obj, field.path)?.target;
|
|
1379
1437
|
if (targetObj) {
|
|
1380
|
-
|
|
1381
|
-
|
|
1438
|
+
cell.accessoryHtml = tableButtons.referencedCell.render({
|
|
1439
|
+
targetId: targetObj.id,
|
|
1440
|
+
schemaId: props.referenceSchema
|
|
1441
|
+
});
|
|
1382
1442
|
}
|
|
1383
1443
|
}
|
|
1384
1444
|
if (props.format === FormatEnum4.Boolean) {
|
|
@@ -1570,7 +1630,7 @@ var cellClassesForRowSelection = (selected, selectionMode) => {
|
|
|
1570
1630
|
};
|
|
1571
1631
|
|
|
1572
1632
|
// packages/ui/react-ui-table/src/components/TableCellEditor/TableCellEditor.tsx
|
|
1573
|
-
import
|
|
1633
|
+
import React6, { useCallback as useCallback3, useMemo as useMemo3, useRef } from "react";
|
|
1574
1634
|
import { FormatEnum as FormatEnum5 } from "@dxos/echo-schema";
|
|
1575
1635
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1576
1636
|
import { useThemeContext } from "@dxos/react-ui";
|
|
@@ -1825,7 +1885,7 @@ var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }
|
|
|
1825
1885
|
model,
|
|
1826
1886
|
editing
|
|
1827
1887
|
]);
|
|
1828
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ React6.createElement(GridCellEditor, {
|
|
1829
1889
|
extension,
|
|
1830
1890
|
getCellContent,
|
|
1831
1891
|
onBlur: handleBlur
|
|
@@ -1859,7 +1919,7 @@ var determineNavigationDelta = ({ key, shift }) => {
|
|
|
1859
1919
|
// packages/ui/react-ui-table/src/components/Table/Table.tsx
|
|
1860
1920
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/Table/Table.tsx";
|
|
1861
1921
|
var TableRoot = ({ children, role }) => {
|
|
1862
|
-
return /* @__PURE__ */
|
|
1922
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
1863
1923
|
role: "none",
|
|
1864
1924
|
className: mx2("relative !border-separator", role === "section" ? "attention-surface overflow-hidden [&_.dx-grid]:max-is-[--dx-grid-content-inline-size]" : "flex flex-col [&_.dx-grid]:grow [&_.dx-grid]:max-is-[--dx-grid-content-inline-size] [&_.dx-grid]:bs-0 [&_.dx-grid]:max-bs-[--dx-grid-content-block-size]")
|
|
1865
1925
|
}, children);
|
|
@@ -1946,6 +2006,10 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
|
|
|
1946
2006
|
modals.showColumnCreator();
|
|
1947
2007
|
break;
|
|
1948
2008
|
}
|
|
2009
|
+
case "referencedCell": {
|
|
2010
|
+
modals.showReferencePanel(data.targetId, data.schemaId);
|
|
2011
|
+
break;
|
|
2012
|
+
}
|
|
1949
2013
|
case "sort": {
|
|
1950
2014
|
model?.sorting?.toggleSort(data.fieldId);
|
|
1951
2015
|
break;
|
|
@@ -2057,7 +2121,7 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
|
|
|
2057
2121
|
const space = model.space;
|
|
2058
2122
|
invariant3(space, void 0, {
|
|
2059
2123
|
F: __dxlog_file4,
|
|
2060
|
-
L:
|
|
2124
|
+
L: 312,
|
|
2061
2125
|
S: void 0,
|
|
2062
2126
|
A: [
|
|
2063
2127
|
"space",
|
|
@@ -2094,20 +2158,20 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
|
|
|
2094
2158
|
t
|
|
2095
2159
|
]);
|
|
2096
2160
|
if (!model || !modals) {
|
|
2097
|
-
return /* @__PURE__ */
|
|
2161
|
+
return /* @__PURE__ */ React7.createElement("span", {
|
|
2098
2162
|
role: "none",
|
|
2099
2163
|
className: "attention-surface"
|
|
2100
2164
|
});
|
|
2101
2165
|
}
|
|
2102
|
-
return /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ React7.createElement(Grid.Root, {
|
|
2103
2167
|
id: model.id ?? "table-grid"
|
|
2104
|
-
}, /* @__PURE__ */
|
|
2168
|
+
}, /* @__PURE__ */ React7.createElement(TableCellEditor, {
|
|
2105
2169
|
model,
|
|
2106
2170
|
modals,
|
|
2107
2171
|
onEnter: handleEnter,
|
|
2108
2172
|
onFocus: handleFocus,
|
|
2109
2173
|
onQuery: handleQuery
|
|
2110
|
-
}), /* @__PURE__ */
|
|
2174
|
+
}), /* @__PURE__ */ React7.createElement(Grid.Content, {
|
|
2111
2175
|
className: mx2("[--dx-grid-base:var(--surface-bg)]", gridSeparatorInlineEnd, gridSeparatorBlockEnd),
|
|
2112
2176
|
frozen,
|
|
2113
2177
|
// getCells={getCells}
|
|
@@ -2120,17 +2184,20 @@ var TableMain = /* @__PURE__ */ forwardRef(({ model, presentation, ignoreAttenti
|
|
|
2120
2184
|
onKeyDown: handleKeyDown,
|
|
2121
2185
|
onWheelCapture: handleWheel,
|
|
2122
2186
|
ref: setDxGrid
|
|
2123
|
-
}), /* @__PURE__ */
|
|
2187
|
+
}), /* @__PURE__ */ React7.createElement(RowActionsMenu, {
|
|
2124
2188
|
model,
|
|
2125
2189
|
modals
|
|
2126
|
-
}), /* @__PURE__ */
|
|
2190
|
+
}), /* @__PURE__ */ React7.createElement(ColumnActionsMenu, {
|
|
2127
2191
|
model,
|
|
2128
2192
|
modals
|
|
2129
|
-
}), /* @__PURE__ */
|
|
2193
|
+
}), /* @__PURE__ */ React7.createElement(ColumnSettings, {
|
|
2130
2194
|
model,
|
|
2131
2195
|
modals,
|
|
2132
2196
|
onNewColumn: handleNewColumn
|
|
2133
|
-
}), /* @__PURE__ */
|
|
2197
|
+
}), /* @__PURE__ */ React7.createElement(CreateRefPanel, {
|
|
2198
|
+
model,
|
|
2199
|
+
modals
|
|
2200
|
+
}), /* @__PURE__ */ React7.createElement(RefPanel, {
|
|
2134
2201
|
model,
|
|
2135
2202
|
modals
|
|
2136
2203
|
}));
|
|
@@ -2141,7 +2208,7 @@ var Table = {
|
|
|
2141
2208
|
};
|
|
2142
2209
|
|
|
2143
2210
|
// packages/ui/react-ui-table/src/components/Table/DynamicTable.tsx
|
|
2144
|
-
import
|
|
2211
|
+
import React8, { useRef as useRef2, useMemo as useMemo5, useCallback as useCallback5 } from "react";
|
|
2145
2212
|
import { useDefaultValue } from "@dxos/react-ui";
|
|
2146
2213
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
2147
2214
|
|
|
@@ -2266,13 +2333,13 @@ var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, prop
|
|
|
2266
2333
|
}, [
|
|
2267
2334
|
model
|
|
2268
2335
|
]);
|
|
2269
|
-
return /* @__PURE__ */
|
|
2336
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
2270
2337
|
role: "none",
|
|
2271
2338
|
className: mx3("is-full bs-full grow grid", classNames)
|
|
2272
|
-
}, /* @__PURE__ */
|
|
2339
|
+
}, /* @__PURE__ */ React8.createElement("div", {
|
|
2273
2340
|
role: "none",
|
|
2274
2341
|
className: "grid min-bs-0 overflow-hidden"
|
|
2275
|
-
}, /* @__PURE__ */
|
|
2342
|
+
}, /* @__PURE__ */ React8.createElement(Table.Root, null, /* @__PURE__ */ React8.createElement(Table.Main, {
|
|
2276
2343
|
ref: tableRef,
|
|
2277
2344
|
model,
|
|
2278
2345
|
presentation,
|
|
@@ -2282,7 +2349,7 @@ var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, prop
|
|
|
2282
2349
|
};
|
|
2283
2350
|
|
|
2284
2351
|
// packages/ui/react-ui-table/src/components/TableToolbar/TableToolbar.tsx
|
|
2285
|
-
import
|
|
2352
|
+
import React9, { useCallback as useCallback6, useMemo as useMemo6 } from "react";
|
|
2286
2353
|
import { live as live4 } from "@dxos/live-object";
|
|
2287
2354
|
import { createGapSeparator, createMenuAction, MenuProvider, ToolbarMenu, useMenuActions } from "@dxos/react-ui-menu";
|
|
2288
2355
|
var createTableToolbarActions = (state) => {
|
|
@@ -2344,11 +2411,11 @@ var TableToolbar = ({ classNames, viewDirty, attendableId, onAction }) => {
|
|
|
2344
2411
|
state
|
|
2345
2412
|
]);
|
|
2346
2413
|
const menu = useMenuActions(actionsCreator);
|
|
2347
|
-
return /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ React9.createElement(MenuProvider, {
|
|
2348
2415
|
...menu,
|
|
2349
2416
|
attendableId,
|
|
2350
2417
|
onAction
|
|
2351
|
-
}, /* @__PURE__ */
|
|
2418
|
+
}, /* @__PURE__ */ React9.createElement(ToolbarMenu, {
|
|
2352
2419
|
classNames
|
|
2353
2420
|
}));
|
|
2354
2421
|
};
|