@dxos/react-ui-table 0.8.3 → 0.8.4-main.c1de068
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-5XLSHLOG.mjs +1751 -0
- package/dist/lib/browser/chunk-5XLSHLOG.mjs.map +7 -0
- package/dist/lib/browser/chunk-L2LSB6KV.mjs +18 -0
- package/dist/lib/browser/chunk-L2LSB6KV.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +240 -1639
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +121 -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-NXZ4CJYX.mjs +20 -0
- package/dist/lib/node-esm/chunk-NXZ4CJYX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Y66YLSTC.mjs +1752 -0
- package/dist/lib/node-esm/chunk-Y66YLSTC.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +240 -1639
- 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 +122 -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/ColumnSettings.d.ts +3 -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 +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.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 +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 +1 -1
- package/dist/types/src/components/Table/relations.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 +2 -1
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +3 -2
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.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 +13 -0
- package/dist/types/src/hooks/useAddRow.d.ts.map +1 -0
- package/dist/types/src/hooks/useTableModel.d.ts +7 -6
- 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/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 +56 -20
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts +8 -0
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/model/table-sorting.d.ts +2 -2
- 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 +41 -0
- package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +3 -4
- 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 +8 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/util/dynamic-table.d.ts +3 -4
- package/dist/types/src/util/dynamic-table.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.d.ts +8 -11
- package/dist/types/src/util/table.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +48 -40
- package/src/components/Table/ColumnSettings.tsx +14 -10
- package/src/components/Table/CreateRefPanel.tsx +5 -3
- package/src/components/Table/DynamicTable.stories.tsx +2 -2
- package/src/components/Table/DynamicTable.tsx +13 -7
- package/src/components/Table/Table.stories.tsx +104 -148
- package/src/components/Table/Table.tsx +50 -32
- package/src/components/Table/relations.stories.tsx +27 -35
- package/src/components/TableCellEditor/CellValidationMessage.tsx +6 -1
- package/src/components/TableCellEditor/FormCellEditor.tsx +30 -21
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +24 -28
- package/src/components/TableCellEditor/TableCellEditor.tsx +79 -21
- package/src/components/testing.ts +7 -24
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useAddRow.ts +36 -0
- package/src/hooks/useTableModel.ts +20 -16
- package/src/index.ts +1 -2
- package/src/model/selection-model.ts +4 -2
- package/src/model/table-model.test.ts +7 -8
- package/src/model/table-model.ts +267 -78
- package/src/model/table-presentation.test.ts +6 -7
- package/src/model/table-presentation.ts +215 -132
- package/src/model/table-sorting.ts +9 -9
- package/src/playwright/playwright.config.ts +17 -0
- package/src/playwright/smoke.spec.ts +21 -20
- package/src/testing/index.ts +5 -0
- package/src/testing/useTestTableModel.ts +122 -0
- package/src/translations.ts +5 -3
- package/src/types/index.ts +2 -2
- package/src/types/schema.ts +16 -0
- package/src/util/dynamic-table.ts +19 -17
- package/src/util/table-buttons.ts +24 -1
- package/src/util/table.ts +33 -111
- 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/types/table.d.ts +0 -56
- package/dist/types/src/types/table.d.ts.map +0 -1
- package/src/playwright/playwright.config.cts +0 -18
- package/src/types/table.ts +0 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
-
import {
|
|
2
|
+
import { type ProjectionModel } from '@dxos/schema';
|
|
3
3
|
export declare const TestSchema: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
4
4
|
id: import("@dxos/keys").ObjectIdClass;
|
|
5
5
|
name: Schema.optional<typeof Schema.String>;
|
|
@@ -13,43 +13,6 @@ export declare const TestSchema: import("@dxos/echo-schema").TypedObjectPrototyp
|
|
|
13
13
|
active: Schema.optional<typeof Schema.Boolean>;
|
|
14
14
|
netWorth: Schema.optional<typeof Schema.Number>;
|
|
15
15
|
}>>;
|
|
16
|
-
export declare const createTable: (schema?: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
17
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
18
|
-
name: Schema.optional<typeof Schema.String>;
|
|
19
|
-
age: Schema.optional<typeof Schema.Number>;
|
|
20
|
-
active: Schema.optional<typeof Schema.Boolean>;
|
|
21
|
-
netWorth: Schema.optional<typeof Schema.Number>;
|
|
22
|
-
}, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
|
|
23
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
24
|
-
name: Schema.optional<typeof Schema.String>;
|
|
25
|
-
age: Schema.optional<typeof Schema.Number>;
|
|
26
|
-
active: Schema.optional<typeof Schema.Boolean>;
|
|
27
|
-
netWorth: Schema.optional<typeof Schema.Number>;
|
|
28
|
-
}>>) => import("@dxos/live-object").Live<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
29
|
-
id: string;
|
|
30
|
-
name?: string | undefined;
|
|
31
|
-
view?: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").TypedObjectFields<{
|
|
32
|
-
name: Schema.SchemaClass<string, string, never>;
|
|
33
|
-
query: Schema.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
|
|
34
|
-
schema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
35
|
-
fields: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
|
|
36
|
-
id: typeof Schema.String;
|
|
37
|
-
path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
38
|
-
visible: Schema.optional<typeof Schema.Boolean>;
|
|
39
|
-
size: Schema.optional<typeof Schema.Number>;
|
|
40
|
-
referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
41
|
-
}>>>>;
|
|
42
|
-
hiddenFields: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
|
|
43
|
-
id: typeof Schema.String;
|
|
44
|
-
path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
45
|
-
visible: Schema.optional<typeof Schema.Boolean>;
|
|
46
|
-
size: Schema.optional<typeof Schema.Number>;
|
|
47
|
-
referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
48
|
-
}>>>>>;
|
|
49
|
-
metadata: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
50
|
-
}, import("@dxos/echo-schema").TypedObjectOptions>> | undefined;
|
|
51
|
-
threads?: readonly import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>[] | undefined;
|
|
52
|
-
}>;
|
|
53
16
|
export declare const createItems: (n: number) => {
|
|
54
17
|
name: string;
|
|
55
18
|
age: number;
|
|
@@ -57,10 +20,10 @@ export declare const createItems: (n: number) => {
|
|
|
57
20
|
netWorth: number;
|
|
58
21
|
}[];
|
|
59
22
|
export type SimulatorProps = {
|
|
60
|
-
|
|
23
|
+
projection: ProjectionModel;
|
|
61
24
|
items: any[];
|
|
62
25
|
insertInterval?: number;
|
|
63
26
|
updateInterval?: number;
|
|
64
27
|
};
|
|
65
|
-
export declare const useSimulator: ({ items,
|
|
28
|
+
export declare const useSimulator: ({ items, projection, insertInterval, updateInterval }: SimulatorProps) => void;
|
|
66
29
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,UAAU;;;;;;;;;;;;GAMrB,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM;;;;;GAWpC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,uDAAuD,cAAc,SA6DjG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Schema } from 'effect';
|
|
2
|
+
import { type Space } from '@dxos/client/echo';
|
|
3
|
+
export type UseAddRowParams = {
|
|
4
|
+
space?: Space;
|
|
5
|
+
schema?: Schema.Schema.AnyNoContext;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Hook that provides a safe row creation function that handles schema validation failures.
|
|
9
|
+
* Returns a callback that attempts to create an object and returns boolean success/failure.
|
|
10
|
+
* Can accept optional data to create objects with specific content (used for committing draft rows).
|
|
11
|
+
*/
|
|
12
|
+
export declare const useAddRow: ({ space, schema }: UseAddRowParams) => (data?: any) => boolean;
|
|
13
|
+
//# sourceMappingURL=useAddRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAddRow.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAddRow.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;CACrC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,mBAAmB,eAAe,aAEhD,GAAG,YAad,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type JsonSchemaType } from '@dxos/echo-schema';
|
|
2
|
+
import { type Live } from '@dxos/live-object';
|
|
3
|
+
import { type DataType, type ProjectionModel } from '@dxos/schema';
|
|
3
4
|
import { type TableRow, TableModel, type TableModelProps, type TableRowAction } from '../model';
|
|
4
|
-
import { type TableType } from '../types';
|
|
5
5
|
export type UseTableModelParams<T extends TableRow = TableRow> = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
view?: DataType.View;
|
|
7
|
+
schema?: JsonSchemaType;
|
|
8
|
+
projection?: ProjectionModel;
|
|
8
9
|
rows?: Live<T>[];
|
|
9
10
|
rowActions?: TableRowAction[];
|
|
10
11
|
onSelectionChanged?: (selection: string[]) => void;
|
|
11
12
|
onRowAction?: (actionId: string, data: T) => void;
|
|
12
13
|
} & Pick<TableModelProps<T>, 'features' | 'onInsertRow' | 'onDeleteRows' | 'onDeleteColumn' | 'onCellUpdate' | 'onRowOrderChange'>;
|
|
13
|
-
export declare const useTableModel: <T extends TableRow = TableRow>({
|
|
14
|
+
export declare const useTableModel: <T extends TableRow = TableRow>({ view, schema, projection, rows, rowActions, features, onSelectionChanged, onRowAction, ...props }: UseTableModelParams<T>) => TableModel<T> | undefined;
|
|
14
15
|
//# sourceMappingURL=useTableModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTableModel.ts"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"useTableModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTableModel.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAE,KAAK,QAAQ,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAC/D,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;CACnD,GAAG,IAAI,CACN,eAAe,CAAC,CAAC,CAAC,EAClB,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,gBAAgB,GAAG,cAAc,GAAG,kBAAkB,CACrG,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,qGAU1D,mBAAmB,CAAC,CAAC,CAAC,KAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAkE3C,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import translations from './translations';
|
|
1
|
+
import { translations } from './translations';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export * from './hooks';
|
|
4
4
|
export * from './model';
|
|
5
|
-
export * from './types';
|
|
6
5
|
export * from './util';
|
|
7
6
|
export { translations };
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -5,12 +5,13 @@ export type SelectionMode = 'single' | 'multiple';
|
|
|
5
5
|
export declare class SelectionModel<T extends TableRow> extends Resource {
|
|
6
6
|
private readonly _rows;
|
|
7
7
|
private readonly _selectionMode;
|
|
8
|
+
private readonly _initialSelection;
|
|
8
9
|
private readonly _onSelectionChanged?;
|
|
9
10
|
private readonly _selection;
|
|
10
11
|
private readonly _validSelectedIds;
|
|
11
12
|
private readonly _hasSelection;
|
|
12
13
|
private readonly _allSelected;
|
|
13
|
-
constructor(_rows: ReadonlySignal<T[]>, _selectionMode: SelectionMode, _onSelectionChanged?: (() => void) | undefined);
|
|
14
|
+
constructor(_rows: ReadonlySignal<T[]>, _selectionMode: SelectionMode, _initialSelection: string[], _onSelectionChanged?: (() => void) | undefined);
|
|
14
15
|
protected _open(): Promise<void>;
|
|
15
16
|
get selection(): ReadonlySignal<Set<string>>;
|
|
16
17
|
get hasSelection(): ReadonlySignal<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-model.d.ts","sourceRoot":"","sources":["../../../../src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I,UAAU,MAAM,KAAG,OAAO,CAGrD;IAEK,gBAAgB,GAAI,QAAQ,CAAC,KAAG,OAAO,CAE5C;IAMK,0BAA0B,GAAI,UAAU,MAAM,KAAG,IAAI,CAc1D;IAEK,YAAY,GAAI,MAAM,KAAK,GAAG,MAAM,KAAG,IAAI,CAWhD;CACH"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { type ReadonlySignal } from '@preact/signals-core';
|
|
2
|
-
import { type Space } from '@dxos/client/echo';
|
|
3
2
|
import { Resource } from '@dxos/context';
|
|
4
|
-
import { type FieldSortType, type JsonProp } from '@dxos/echo-schema';
|
|
3
|
+
import { type FieldSortType, type JsonProp, type JsonSchemaType } from '@dxos/echo-schema';
|
|
5
4
|
import { type DxGridAxisMeta, type DxGridPlanePosition, type DxGridPosition } from '@dxos/react-ui-grid';
|
|
6
|
-
import { type
|
|
5
|
+
import { type DataType, ProjectionModel, type ValidationError } from '@dxos/schema';
|
|
7
6
|
import { type SelectionMode, SelectionModel } from './selection-model';
|
|
8
7
|
import { TableSorting } from './table-sorting';
|
|
8
|
+
import { TableView } from '../types';
|
|
9
|
+
export type TableCellType = 'standard' | 'draft' | 'header';
|
|
9
10
|
export type ValidationResult = {
|
|
10
11
|
valid: true;
|
|
11
12
|
} | {
|
|
12
13
|
valid: false;
|
|
13
14
|
error: string;
|
|
14
15
|
};
|
|
16
|
+
export type DraftRow<T extends TableRow = TableRow> = {
|
|
17
|
+
data: T;
|
|
18
|
+
valid: boolean;
|
|
19
|
+
validationErrors: ValidationError[];
|
|
20
|
+
};
|
|
15
21
|
export type TableRow = Record<JsonProp, any> & {
|
|
16
22
|
id: string;
|
|
17
23
|
};
|
|
@@ -28,18 +34,19 @@ export type TableFeatures = {
|
|
|
28
34
|
schemaEditable: boolean;
|
|
29
35
|
};
|
|
30
36
|
export type TableModelProps<T extends TableRow = TableRow> = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
projection: ViewProjection;
|
|
37
|
+
view: DataType.View;
|
|
38
|
+
schema: JsonSchemaType;
|
|
39
|
+
projection?: ProjectionModel;
|
|
35
40
|
features?: Partial<TableFeatures>;
|
|
36
41
|
sorting?: FieldSortType[];
|
|
42
|
+
initialSelection?: string[];
|
|
37
43
|
pinnedRows?: {
|
|
38
44
|
top: number[];
|
|
39
45
|
bottom: number[];
|
|
40
46
|
};
|
|
41
47
|
rowActions?: TableRowAction[];
|
|
42
|
-
|
|
48
|
+
onResolveSchema?: (typename: string) => Promise<JsonSchemaType>;
|
|
49
|
+
onInsertRow?: (data?: any) => boolean;
|
|
43
50
|
onDeleteRows?: (index: number, obj: T[]) => void;
|
|
44
51
|
onDeleteColumn?: (fieldId: string) => void;
|
|
45
52
|
onCellUpdate?: (cell: DxGridPosition) => void;
|
|
@@ -47,10 +54,9 @@ export type TableModelProps<T extends TableRow = TableRow> = {
|
|
|
47
54
|
onRowAction?: (actionId: string, data: T) => void;
|
|
48
55
|
};
|
|
49
56
|
export declare class TableModel<T extends TableRow = TableRow> extends Resource {
|
|
50
|
-
private readonly _id;
|
|
51
|
-
private readonly _space;
|
|
52
57
|
private readonly _view;
|
|
53
58
|
private readonly _projection;
|
|
59
|
+
private _table?;
|
|
54
60
|
private readonly _visibleRange;
|
|
55
61
|
private readonly _onInsertRow?;
|
|
56
62
|
private readonly _onDeleteRows?;
|
|
@@ -61,21 +67,22 @@ export declare class TableModel<T extends TableRow = TableRow> extends Resource
|
|
|
61
67
|
private readonly _rowActions;
|
|
62
68
|
private readonly _features;
|
|
63
69
|
private readonly _rows;
|
|
70
|
+
private readonly _draftRows;
|
|
64
71
|
private readonly _sorting;
|
|
65
72
|
private _pinnedRows;
|
|
66
73
|
private _selection;
|
|
67
74
|
private _columnMeta?;
|
|
68
|
-
constructor({
|
|
69
|
-
get id(): string
|
|
70
|
-
get
|
|
71
|
-
get
|
|
72
|
-
get projection():
|
|
75
|
+
constructor({ view, schema, projection, features, sorting, initialSelection, pinnedRows, rowActions, onCellUpdate, onDeleteColumn, onDeleteRows, onInsertRow, onRowOrderChange, onRowAction, }: TableModelProps<T>);
|
|
76
|
+
get id(): string;
|
|
77
|
+
get view(): DataType.View;
|
|
78
|
+
get table(): TableView;
|
|
79
|
+
get projection(): ProjectionModel;
|
|
73
80
|
get rows(): ReadonlySignal<T[]>;
|
|
74
81
|
get features(): TableFeatures;
|
|
75
82
|
/**
|
|
76
83
|
* @reactive
|
|
77
84
|
*/
|
|
78
|
-
get sorting(): TableSorting<T
|
|
85
|
+
get sorting(): TableSorting<T>;
|
|
79
86
|
/**
|
|
80
87
|
* Gets the row data at the specified display index.
|
|
81
88
|
*/
|
|
@@ -91,19 +98,48 @@ export declare class TableModel<T extends TableRow = TableRow> extends Resource
|
|
|
91
98
|
private initializeEffects;
|
|
92
99
|
setRows: (obj: T[]) => void;
|
|
93
100
|
getRowCount: () => number;
|
|
101
|
+
/**
|
|
102
|
+
* @reactive
|
|
103
|
+
*/
|
|
104
|
+
getDraftRowCount: () => number;
|
|
105
|
+
get draftRows(): ReadonlySignal<DraftRow<T>[]>;
|
|
106
|
+
/**
|
|
107
|
+
* Checks if a specific field path has validation errors for a given draft row.
|
|
108
|
+
* @param draftRowIndex - The index of the draft row to check
|
|
109
|
+
* @param fieldPath - The path of the field to check for validation errors
|
|
110
|
+
* @returns true if the field has validation errors, false otherwise
|
|
111
|
+
*/
|
|
112
|
+
hasDraftRowValidationError(draftRowIndex: number, fieldPath: string): boolean;
|
|
94
113
|
getColumnCount: () => number;
|
|
95
|
-
insertRow: (
|
|
114
|
+
insertRow: () => void;
|
|
115
|
+
private createDraftRow;
|
|
116
|
+
private validateDraftRow;
|
|
117
|
+
private validateDraftRowData;
|
|
118
|
+
commitDraftRow: (draftRowIndex: number) => boolean;
|
|
96
119
|
deleteRow: (rowIndex: number) => void;
|
|
97
120
|
handleRowAction: (actionId: string, rowIndex: number) => void;
|
|
98
|
-
getCellData: (
|
|
99
|
-
validateCellData: ({ col, row }:
|
|
100
|
-
setCellData: (
|
|
121
|
+
getCellData: (cell: DxGridPosition) => any;
|
|
122
|
+
validateCellData: ({ col, row, plane }: DxGridPosition, value: any) => Promise<ValidationResult>;
|
|
123
|
+
setCellData: (cell: DxGridPosition, value: any) => void;
|
|
101
124
|
/**
|
|
102
125
|
* Updates a cell's value using a transform function.
|
|
103
126
|
* @param {DxGridPlanePosition} position - The position of the cell to update.
|
|
104
127
|
* @param {(value: any) => any} update - A function that takes the current value and returns the updated value.
|
|
105
128
|
*/
|
|
106
129
|
updateCellData({ col, row }: DxGridPlanePosition, update: (value: any) => any): void;
|
|
130
|
+
/**
|
|
131
|
+
* Gets the domain-appropriate cell type for a given cell position.
|
|
132
|
+
* This abstracts away the low-level grid plane concepts and provides domain-specific types.
|
|
133
|
+
* @param cell - The cell position to classify
|
|
134
|
+
* @returns The domain-appropriate cell type
|
|
135
|
+
*/
|
|
136
|
+
getCellType(cell: DxGridPosition): TableCellType;
|
|
137
|
+
/**
|
|
138
|
+
* Convenience method to check if a cell is a draft cell.
|
|
139
|
+
* @param cell - The cell position to check
|
|
140
|
+
* @returns true if the cell is a draft cell, false otherwise
|
|
141
|
+
*/
|
|
142
|
+
isDraftCell(cell: DxGridPosition): boolean;
|
|
107
143
|
deleteColumn(fieldId: string): void;
|
|
108
144
|
setColumnWidth(columnIndex: number, width: number): void;
|
|
109
145
|
pinRow(rowIndex: number, side: 'top' | 'bottom'): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-model.d.ts","sourceRoot":"","sources":["../../../../src/model/table-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"table-model.d.ts","sourceRoot":"","sources":["../../../../src/model/table-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAA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AAc,EAAE,OAAO,GAAG,KAAG,IAAI,CA4B3D;IAEF;;;;OAIG;IACI,cAAc,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI;IAU3F;;;;;OAKG;IACI,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa;IAYvD;;;;OAIG;IACI,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO;IAQ1C,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAenC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAgBxD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI;IAItD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAShC,QAAQ,IAAI,IAAI;CAGxB"}
|
|
@@ -9,14 +9,22 @@ 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;
|
|
20
28
|
}
|
|
21
29
|
export declare const cellClassesForRowSelection: (selected: boolean, selectionMode: SelectionMode) => string[] | undefined;
|
|
22
30
|
//# 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;AAI7B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG/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;IA6C9E;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,cAAc;IA6JtB,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,mBAAmB;CAiB5B;AAED,eAAO,MAAM,0BAA0B,GAAI,UAAU,OAAO,EAAE,eAAe,aAAa,yBAgBzF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Signal, type ReadonlySignal } from '@preact/signals-core';
|
|
2
2
|
import { type SortDirectionType, type FieldSortType } from '@dxos/echo-schema';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DataType, ProjectionModel } from '@dxos/schema';
|
|
4
4
|
import { type TableRow } from './table-model';
|
|
5
5
|
/**
|
|
6
6
|
* Manages table sorting functionality through display and data index mapping.
|
|
@@ -31,7 +31,7 @@ export declare class TableSorting<T extends TableRow> {
|
|
|
31
31
|
private readonly _localSort;
|
|
32
32
|
private readonly _isDirty;
|
|
33
33
|
readonly sortedRows: ReadonlySignal<T[]>;
|
|
34
|
-
constructor(rows: Signal<T[]>, _view:
|
|
34
|
+
constructor(rows: Signal<T[]>, _view: DataType.View, _projection: ProjectionModel);
|
|
35
35
|
/**
|
|
36
36
|
* @reactive
|
|
37
37
|
* @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,EAAoB,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG1F,OAAO,EAAkC,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE/G,OAAO,KAAK,EAA2B,
|
|
1
|
+
{"version":3,"file":"table-sorting.d.ts","sourceRoot":"","sources":["../../../../src/model/table-sorting.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG1F,OAAO,EAAkC,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE/G,OAAO,KAAK,EAA2B,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAU9C;;;;;;;;;;;;;;;;;;;;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,41 @@
|
|
|
1
|
+
import { 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<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
query: import("@dxos/echo-schema").QueryType;
|
|
13
|
+
projection: {
|
|
14
|
+
schema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
15
|
+
fields: {
|
|
16
|
+
id: string;
|
|
17
|
+
path: import("@dxos/effect").JsonPath;
|
|
18
|
+
referencePath?: import("@dxos/effect").JsonPath | undefined;
|
|
19
|
+
visible?: boolean | undefined;
|
|
20
|
+
}[];
|
|
21
|
+
hiddenFields?: {
|
|
22
|
+
id: string;
|
|
23
|
+
path: import("@dxos/effect").JsonPath;
|
|
24
|
+
referencePath?: import("@dxos/effect").JsonPath | undefined;
|
|
25
|
+
visible?: boolean | undefined;
|
|
26
|
+
}[] | undefined;
|
|
27
|
+
};
|
|
28
|
+
presentation: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
|
|
29
|
+
}> | undefined;
|
|
30
|
+
projection: ProjectionModel | undefined;
|
|
31
|
+
tableRef: import("react").RefObject<TableController>;
|
|
32
|
+
model: import("..").TableModel<any> | undefined;
|
|
33
|
+
presentation: TablePresentation<any> | undefined;
|
|
34
|
+
space: import("@dxos/client-protocol").Space | undefined;
|
|
35
|
+
client: import("@dxos/client").Client;
|
|
36
|
+
handleInsertRow: () => void;
|
|
37
|
+
handleSaveView: () => void;
|
|
38
|
+
handleDeleteRows: (_: number, objects: any[]) => void;
|
|
39
|
+
handleDeleteColumn: (fieldId: string) => void;
|
|
40
|
+
};
|
|
41
|
+
//# 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,EAAY,eAAe,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI7C;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAuCtB,MAAM,WAAW,GAAG,EAAE;kCAShB,MAAM;CAiDnB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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";
|
|
@@ -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 * 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,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { Type } from '@dxos/echo';
|
|
3
|
+
import { JsonPath } from '@dxos/effect';
|
|
4
|
+
export declare const TableView: Type.obj<Schema.Struct<{
|
|
5
|
+
sizes: Schema.mutable<Schema.Record$<Schema.Schema<JsonPath, JsonPath, never>, typeof Schema.Number>>;
|
|
6
|
+
}>>;
|
|
7
|
+
export type TableView = Schema.Schema.Type<typeof TableView>;
|
|
8
|
+
//# 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;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,SAAS;;GAKsD,CAAC;AAC7E,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Schema } from 'effect';
|
|
2
2
|
import type { JsonSchemaType, SortDirectionType } from '@dxos/echo-schema';
|
|
3
|
-
import {
|
|
4
|
-
import { TableType } from '../types';
|
|
3
|
+
import { type DataType, ProjectionModel, type SchemaPropertyDefinition } 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,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,
|
|
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,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAEL,KAAK,QAAQ,EAEb,eAAe,EACf,KAAK,wBAAwB,EAC9B,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,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;AA0HlE,eAAO,MAAM,YA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{ type JsonSchemaType } from '@dxos/echo-schema';
|
|
2
|
+
import { type CreateViewFromSpaceProps, type DataType } from '@dxos/schema';
|
|
3
|
+
type CreateTableProps = Omit<CreateViewFromSpaceProps, 'presentation'> & {
|
|
4
|
+
sizes?: Record<string, number>;
|
|
11
5
|
};
|
|
12
|
-
export declare const
|
|
6
|
+
export declare const createTable: ({ sizes, ...props }: CreateTableProps) => Promise<{
|
|
7
|
+
jsonSchema: JsonSchemaType;
|
|
8
|
+
view: DataType.View;
|
|
9
|
+
}>;
|
|
13
10
|
export {};
|
|
14
11
|
//# sourceMappingURL=table.d.ts.map
|