@dxos/react-ui-table 0.8.3-staging.0fa589b → 0.8.4-main.1da679c
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-63UUF4IG.mjs +66 -0
- package/dist/lib/browser/chunk-63UUF4IG.mjs.map +7 -0
- package/dist/lib/browser/chunk-BBXDTWCX.mjs +1822 -0
- package/dist/lib/browser/chunk-BBXDTWCX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +816 -2152
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +124 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -5
- package/dist/lib/node-esm/chunk-K734DJB7.mjs +67 -0
- package/dist/lib/node-esm/chunk-K734DJB7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RNQDU7IQ.mjs +1823 -0
- package/dist/lib/node-esm/chunk-RNQDU7IQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +816 -2152
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +125 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -5
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts +4 -2
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts +50 -2
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/Relations.stories.d.ts +44 -0
- package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -0
- package/dist/types/src/components/Table/RowActionsMenu.d.ts +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.d.ts +3 -2
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts +42 -3
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts +2 -1
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +8 -3
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +9 -15
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +39 -3
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.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 +3 -40
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAddRow.d.ts +14 -0
- package/dist/types/src/hooks/useAddRow.d.ts.map +1 -0
- package/dist/types/src/hooks/useTableModel.d.ts +8 -7
- package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.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 +2 -1
- package/dist/types/src/model/selection-model.d.ts.map +1 -1
- package/dist/types/src/model/table-model.d.ts +59 -21
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts +10 -1
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/model/table-sorting.d.ts +3 -4
- package/dist/types/src/model/table-sorting.d.ts.map +1 -1
- package/dist/types/src/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/useTestTableModel.d.ts +22 -0
- package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +5 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +28 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/util/dynamic-table.d.ts +4 -5
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +0 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/table-buttons.d.ts +15 -1
- 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/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -44
- package/src/components/Table/ColumnActionsMenu.tsx +1 -1
- package/src/components/Table/ColumnSettings.tsx +15 -11
- package/src/components/Table/CreateRefPanel.tsx +30 -11
- package/src/components/Table/DynamicTable.stories.tsx +8 -5
- package/src/components/Table/DynamicTable.tsx +17 -10
- package/src/components/Table/{relations.stories.tsx → Relations.stories.tsx} +56 -47
- package/src/components/Table/RowActionsMenu.tsx +3 -3
- package/src/components/Table/Table.stories.tsx +126 -159
- package/src/components/Table/Table.tsx +169 -123
- package/src/components/TableCellEditor/CellValidationMessage.tsx +7 -2
- package/src/components/TableCellEditor/FormCellEditor.tsx +158 -48
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +31 -47
- package/src/components/TableCellEditor/TableCellEditor.tsx +106 -111
- package/src/components/TableToolbar/TableToolbar.tsx +2 -2
- package/src/components/testing.ts +7 -24
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useAddRow.ts +38 -0
- package/src/hooks/useTableModel.ts +21 -17
- package/src/index.ts +1 -2
- package/src/model/modal-controller.ts +1 -1
- package/src/model/selection-model.ts +6 -3
- package/src/model/table-model.test.ts +12 -9
- package/src/model/table-model.ts +288 -88
- package/src/model/table-presentation.test.ts +12 -8
- package/src/model/table-presentation.ts +263 -138
- package/src/model/table-sorting.ts +22 -13
- package/src/playwright/playwright.config.ts +17 -0
- package/src/playwright/smoke.spec.ts +137 -44
- package/src/testing/index.ts +5 -0
- package/src/testing/useTestTableModel.ts +124 -0
- package/src/translations.ts +7 -5
- package/src/types/index.ts +2 -2
- package/src/types/schema.ts +73 -0
- package/src/util/dynamic-table.ts +24 -21
- package/src/util/index.ts +0 -1
- package/src/util/schema.ts +1 -1
- package/src/util/table-buttons.ts +28 -4
- package/src/util/table-controls.ts +4 -1
- package/dist/lib/browser/chunk-TL7CKQQV.mjs +0 -27
- package/dist/lib/browser/chunk-TL7CKQQV.mjs.map +0 -7
- package/dist/lib/node/chunk-O2VPBNS5.cjs +0 -50
- package/dist/lib/node/chunk-O2VPBNS5.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -2739
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/types/index.cjs +0 -31
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GBT6GD4G.mjs +0 -29
- package/dist/lib/node-esm/chunk-GBT6GD4G.mjs.map +0 -7
- package/dist/types/src/components/Table/relations.stories.d.ts +0 -9
- package/dist/types/src/components/Table/relations.stories.d.ts.map +0 -1
- package/dist/types/src/components/TableCellEditor/extension.d.ts +0 -13
- package/dist/types/src/components/TableCellEditor/extension.d.ts.map +0 -1
- package/dist/types/src/types/table.d.ts +0 -56
- package/dist/types/src/types/table.d.ts.map +0 -1
- package/dist/types/src/util/table.d.ts +0 -14
- package/dist/types/src/util/table.d.ts.map +0 -1
- package/src/components/TableCellEditor/extension.ts +0 -61
- package/src/playwright/playwright.config.cts +0 -18
- package/src/types/table.ts +0 -27
- package/src/util/table.ts +0 -127
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DxGridPlane, type DxGridPlaneCells, type DxGridPlaneRange } from '@dxos/react-ui-grid';
|
|
2
2
|
import { type SelectionMode } from './selection-model';
|
|
3
|
-
import { type
|
|
3
|
+
import { type TableModel, type TableRow } from './table-model';
|
|
4
4
|
/**
|
|
5
5
|
* Presentation layer for a table component, handling cell rendering and grid display logic.
|
|
6
6
|
* Manages rendering of table cells, headers, selection columns, and action columns across
|
|
@@ -9,14 +9,23 @@ import { type TableRow, type TableModel } from './table-model';
|
|
|
9
9
|
export declare class TablePresentation<T extends TableRow = TableRow> {
|
|
10
10
|
private readonly model;
|
|
11
11
|
private readonly _visibleRange;
|
|
12
|
+
private fieldProjectionCache;
|
|
12
13
|
constructor(model: TableModel<T>, _visibleRange?: import("@preact/signals-core").Signal<DxGridPlaneRange>);
|
|
13
14
|
getCells(range: DxGridPlaneRange, plane: DxGridPlane): DxGridPlaneCells;
|
|
15
|
+
/**
|
|
16
|
+
* Gets a field projection, using cache if available within the current render pass.
|
|
17
|
+
*/
|
|
18
|
+
private getFieldProjection;
|
|
19
|
+
private createDataCell;
|
|
14
20
|
private getMainGridCells;
|
|
21
|
+
private getDraftRowCells;
|
|
15
22
|
private getHeaderCells;
|
|
16
23
|
private getSelectionColumnCells;
|
|
17
24
|
private getActionColumnCells;
|
|
18
25
|
private getSelectAllCell;
|
|
19
26
|
private getNewColumnCell;
|
|
27
|
+
private getDraftActionCells;
|
|
28
|
+
private getDraftIconCells;
|
|
20
29
|
}
|
|
21
30
|
export declare const cellClassesForRowSelection: (selected: boolean, selectionMode: SelectionMode) => string[] | undefined;
|
|
22
31
|
//# sourceMappingURL=table-presentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-presentation.d.ts","sourceRoot":"","sources":["../../../../src/model/table-presentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-presentation.d.ts","sourceRoot":"","sources":["../../../../src/model/table-presentation.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE/D;;;;GAIG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAIxD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAJhC,OAAO,CAAC,oBAAoB,CAAkF;gBAG3F,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,aAAa,0DAG5B;IAGG,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,GAAG,gBAAgB;IAgD9E;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,cAAc;IA+JtB,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,gBAAgB;IAyCxB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,mBAAmB;IA2B3B,OAAO,CAAC,iBAAiB;CAe1B;AAED,eAAO,MAAM,0BAA0B,GAAI,UAAU,OAAO,EAAE,eAAe,aAAa,yBAgBzF,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
import type { ViewProjection, ViewType } from '@dxos/schema';
|
|
1
|
+
import { type ReadonlySignal, type Signal } from '@preact/signals-core';
|
|
2
|
+
import type { DataType, FieldSortType, ProjectionModel, SortDirectionType } from '@dxos/schema';
|
|
4
3
|
import { type TableRow } from './table-model';
|
|
5
4
|
/**
|
|
6
5
|
* Manages table sorting functionality through display and data index mapping.
|
|
@@ -31,7 +30,7 @@ export declare class TableSorting<T extends TableRow> {
|
|
|
31
30
|
private readonly _localSort;
|
|
32
31
|
private readonly _isDirty;
|
|
33
32
|
readonly sortedRows: ReadonlySignal<T[]>;
|
|
34
|
-
constructor(rows: Signal<T[]>, _view:
|
|
33
|
+
constructor(rows: Signal<T[]>, _view: DataType.View, _projection: ProjectionModel);
|
|
35
34
|
/**
|
|
36
35
|
* @reactive
|
|
37
36
|
* @returns Local sort if present, falls back to view sort.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-sorting.d.ts","sourceRoot":"","sources":["../../../../src/model/table-sorting.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"table-sorting.d.ts","sourceRoot":"","sources":["../../../../src/model/table-sorting.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAoB,MAAM,sBAAsB,CAAC;AAK1F,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EAEb,eAAe,EAEf,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAY9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,YAAY,CAAC,CAAC,SAAS,QAAQ;IASxC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAT9B,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA6B;IACjE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgC;IAC3D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IACnD,SAAgB,UAAU,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;gBAG9C,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EACA,KAAK,EAAE,QAAQ,CAAC,IAAI,EACpB,WAAW,EAAE,eAAe;IAoB/C;;;OAGG;IACH,IAAW,OAAO,IAAI,aAAa,GAAG,SAAS,CAU9C;IAED;;;OAGG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAI1C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,GAAG,IAAI;IAO5D,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAiBjC,SAAS,IAAI,IAAI;IAIjB,IAAI,IAAI,IAAI;IAenB,OAAO,CAAC,oBAAoB;IAkC5B,OAAO,CAAC,YAAY;CAsCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.config.d.ts","sourceRoot":"","sources":["../../../../src/playwright/playwright.config.ts"],"names":[],"mappings":";AAQA,wBAQG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataType, ProjectionModel } from '@dxos/schema';
|
|
2
|
+
import { type TableController } from '../components';
|
|
3
|
+
import { TablePresentation } from '../model';
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook to create and manage a test table model for storybook demonstrations.
|
|
6
|
+
* Provides table data, schema, and handlers for table operations.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useTestTableModel: () => {
|
|
9
|
+
schema: import("effect/Schema").Schema.AnyNoContext | undefined;
|
|
10
|
+
view: import("@dxos/live-object").Live<DataType.View> | undefined;
|
|
11
|
+
projection: ProjectionModel | undefined;
|
|
12
|
+
tableRef: import("react").RefObject<TableController>;
|
|
13
|
+
model: import("..").TableModel<any> | undefined;
|
|
14
|
+
presentation: TablePresentation<any> | undefined;
|
|
15
|
+
space: import("@dxos/client-protocol").Space | undefined;
|
|
16
|
+
client: import("@dxos/client").Client;
|
|
17
|
+
handleInsertRow: () => void;
|
|
18
|
+
handleSaveView: () => void;
|
|
19
|
+
handleDeleteRows: (_: number, objects: any[]) => void;
|
|
20
|
+
handleDeleteColumn: (fieldId: string) => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useTestTableModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTestTableModel.d.ts","sourceRoot":"","sources":["../../../../src/testing/useTestTableModel.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAqB,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI7C;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;0BAwCtB,MAAM,WAAW,GAAG,EAAE;kCAShB,MAAM;CAkDnB,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const translationKey = "table";
|
|
2
|
-
declare const
|
|
1
|
+
export declare const translationKey = "react-ui-table";
|
|
2
|
+
export declare const translations: [{
|
|
3
3
|
readonly 'en-US': {
|
|
4
|
-
readonly table: {
|
|
4
|
+
readonly "react-ui-table": {
|
|
5
5
|
readonly 'object placeholder': "New table";
|
|
6
6
|
readonly 'create object label': "Create table";
|
|
7
7
|
readonly 'table name placeholder': "Table name";
|
|
8
8
|
readonly 'settings title': "Table settings";
|
|
9
|
-
readonly 'table schema label': "
|
|
10
|
-
readonly 'new schema': "New
|
|
9
|
+
readonly 'table schema label': "Record type";
|
|
10
|
+
readonly 'new schema': "New record type";
|
|
11
11
|
readonly 'continue label': "Continue";
|
|
12
12
|
readonly 'create stack section label': "Create table";
|
|
13
13
|
readonly 'add row label': "Add row";
|
|
@@ -26,5 +26,4 @@ declare const _default: readonly [{
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
}];
|
|
29
|
-
export default _default;
|
|
30
29
|
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BM,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * as Table from './schema';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { Obj, Type } from '@dxos/echo';
|
|
3
|
+
import { JsonPath, type JsonSchemaType, toEffectSchema } from '@dxos/echo-schema';
|
|
4
|
+
import { type CreateViewFromSpaceProps, type DataType } from '@dxos/schema';
|
|
5
|
+
export declare const Table: Type.obj<Schema.Struct<{
|
|
6
|
+
sizes: Schema.mutable<Schema.Record$<Schema.Schema<JsonPath, JsonPath, never>, typeof Schema.Number>>;
|
|
7
|
+
}>>;
|
|
8
|
+
export type Table = Schema.Schema.Type<typeof Table>;
|
|
9
|
+
/**
|
|
10
|
+
* Make a table view.
|
|
11
|
+
*/
|
|
12
|
+
export declare const make: (props?: Partial<Obj.MakeProps<typeof Table>>) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
13
|
+
sizes: {
|
|
14
|
+
[x: string & {
|
|
15
|
+
__JsonPath: true;
|
|
16
|
+
}]: number;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
type MakeViewProps = Omit<CreateViewFromSpaceProps, 'presentation'> & {
|
|
20
|
+
sizes?: Record<string, number>;
|
|
21
|
+
};
|
|
22
|
+
export declare const makeView: ({ sizes, ...props }: MakeViewProps) => Promise<{
|
|
23
|
+
jsonSchema: JsonSchemaType;
|
|
24
|
+
view: DataType.View;
|
|
25
|
+
schema: ReturnType<typeof toEffectSchema>;
|
|
26
|
+
}>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGlF,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,QAAQ,EAA4C,MAAM,cAAc,CAAC;AAEtH,eAAO,MAAM,KAAK;;GAWjB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,QAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,KAAK,CAAC,CAAM;;;;;;EAA6C,CAAC;AAEnH,KAAK,aAAa,GAAG,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC,GAAG;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAU,qBAG5B,aAAa,KAAG,OAAO,CAAC;IACzB,UAAU,EAAE,cAAc,CAAC;IAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAC3C,CA4BA,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Schema } from 'effect';
|
|
2
|
-
import type { JsonSchemaType
|
|
3
|
-
import {
|
|
4
|
-
import { TableType } from '../types';
|
|
2
|
+
import type { JsonSchemaType } from '@dxos/echo-schema';
|
|
3
|
+
import { type DataType, ProjectionModel, type SchemaPropertyDefinition, type SortDirectionType } from '@dxos/schema';
|
|
5
4
|
type PropertyDisplayProps = {
|
|
6
5
|
size: number;
|
|
7
6
|
title: string;
|
|
@@ -25,8 +24,8 @@ export declare const makeDynamicTable: ({ typename, jsonSchema, properties, }: {
|
|
|
25
24
|
jsonSchema: JsonSchemaType;
|
|
26
25
|
properties?: TablePropertyDefinition[];
|
|
27
26
|
}) => {
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
projection: ProjectionModel;
|
|
28
|
+
view: DataType.View;
|
|
30
29
|
};
|
|
31
30
|
export {};
|
|
32
31
|
//# sourceMappingURL=dynamic-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../../../../src/util/dynamic-table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../../../../src/util/dynamic-table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,KAAK,QAAQ,EACb,eAAe,EACf,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EAGvB,MAAM,cAAc,CAAC;AAKtB,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE/F;;GAEG;AAEH,eAAO,MAAM,aAAa,GAAI,+CAK3B;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;CACrC,KAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAWjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,uCAI9B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACxC,KAAG;IAAE,UAAU,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAA;CAerD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TableButton = 'columnSettings' | 'rowMenu' | 'newColumn' | 'referencedCell' | 'sort';
|
|
1
|
+
export type TableButton = 'columnSettings' | 'rowMenu' | 'newColumn' | 'referencedCell' | 'sort' | 'saveDraftRow';
|
|
2
2
|
export declare const BUTTON_IDENTIFIERS: {
|
|
3
3
|
[K in TableButton]: string;
|
|
4
4
|
};
|
|
@@ -11,6 +11,10 @@ type ButtonData = {
|
|
|
11
11
|
} | {
|
|
12
12
|
type: 'rowMenu';
|
|
13
13
|
rowIndex: number;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'saveDraftRow';
|
|
16
|
+
rowIndex: number;
|
|
17
|
+
disabled?: boolean;
|
|
14
18
|
} | {
|
|
15
19
|
type: 'sort';
|
|
16
20
|
fieldId: string;
|
|
@@ -47,6 +51,16 @@ export declare const tableButtons: {
|
|
|
47
51
|
type: "rowMenu";
|
|
48
52
|
}>;
|
|
49
53
|
};
|
|
54
|
+
readonly saveDraftRow: {
|
|
55
|
+
readonly attr: string;
|
|
56
|
+
readonly icon: "ph--floppy-disk--regular";
|
|
57
|
+
readonly render: ({ rowIndex, disabled }: Omit<Extract<ButtonData, {
|
|
58
|
+
type: "saveDraftRow";
|
|
59
|
+
}>, "type">) => string;
|
|
60
|
+
readonly getData: (el: HTMLElement) => Extract<ButtonData, {
|
|
61
|
+
type: "saveDraftRow";
|
|
62
|
+
}>;
|
|
63
|
+
};
|
|
50
64
|
readonly sort: {
|
|
51
65
|
readonly attr: string;
|
|
52
66
|
readonly icon: "ph--sort-ascending--regular";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-buttons.d.ts","sourceRoot":"","sources":["../../../../src/util/table-buttons.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"table-buttons.d.ts","sourceRoot":"","sources":["../../../../src/util/table-buttons.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,GAAG,cAAc,CAAC;AAElH,eAAO,MAAM,kBAAkB,EAAE;KAAG,CAAC,IAAI,WAAW,GAAG,MAAM;CAOnD,CAAC;AAEX,KAAK,UAAU,GACX;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC;AA2HlE,eAAO,MAAM,YAAY;;;;wCAhGA,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;gCAShE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC;;;;;uCAMjD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BAWrE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC;;;;;wCASpD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BAU/D,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,CAAC;;;;;kDAiCnC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,cAAc,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BAY9E,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,cAAc,CAAA;SAAE,CAAC;;;;;kDApCxC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BActE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;;CAkCzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/G,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAE3G,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAwBX,eAAO,MAAM,aAAa,GAAI,0CAK3B,mBAAmB,KAAG,MAQxB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,2CAA2D,iBAAiB,KAAG,MAS1G,CAAC;AAEF,eAAO,MAAM,aAAa;;;oEArBvB,mBAAmB,KAAG,MAAM;+BAyBb,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,UAAU,CAAA;SAAE,CAAC;;;;qEAfa,iBAAiB,KAAG,MAAM;+BAwB/F,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,QAAQ,CAAA;SAAE,CAAC;;CAM9D,CAAC"}
|