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