@dxos/react-ui-table 0.8.2-main.f11618f → 0.8.2-staging.42af850
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-U6LL2AVU.mjs +26 -0
- package/dist/lib/browser/chunk-U6LL2AVU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1074 -828
- 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-CXDGXPM6.cjs} +12 -12
- package/dist/lib/node/chunk-CXDGXPM6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +1080 -837
- 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-EFSM52KQ.mjs} +10 -10
- package/dist/lib/node-esm/chunk-EFSM52KQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1074 -828
- 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 +3 -4
- 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 +2 -0
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts +1 -0
- 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/FormCellEditor.d.ts +13 -0
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -0
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +3 -0
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.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 +6 -3
- 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 +46 -45
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/util/dynamic-table.d.ts +4 -3
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/schema.d.ts +12 -0
- package/dist/types/src/util/schema.d.ts.map +1 -0
- package/dist/types/src/util/signals.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 +41 -34
- package/src/components/Table/CreateRefPanel.tsx +3 -3
- package/src/components/Table/DynamicTable.stories.tsx +2 -2
- package/src/components/Table/DynamicTable.tsx +4 -5
- package/src/components/Table/Table.stories.tsx +76 -42
- package/src/components/Table/Table.tsx +8 -5
- package/src/components/Table/relations.stories.tsx +17 -20
- package/src/components/TableCellEditor/FormCellEditor.tsx +94 -0
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +10 -8
- package/src/components/TableCellEditor/TableCellEditor.tsx +45 -4
- package/src/components/TableToolbar/TableToolbar.tsx +63 -33
- package/src/components/testing.ts +7 -6
- package/src/hooks/useTableModel.ts +4 -2
- package/src/model/selection-model.ts +1 -1
- package/src/model/table-model.test.ts +4 -3
- package/src/model/table-model.ts +1 -1
- package/src/model/table-presentation.test.ts +4 -3
- package/src/model/table-presentation.ts +53 -7
- package/src/types/table.ts +16 -11
- package/src/util/dynamic-table.ts +7 -4
- package/src/util/index.ts +1 -0
- package/src/util/schema.ts +36 -0
- package/src/util/table-buttons.ts +1 -1
- package/src/util/table.ts +11 -10
- 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
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { Expando } from '@dxos/echo-schema';
|
|
3
|
+
export declare const TableSchema: Schema.Struct<{
|
|
4
|
+
id: import("@dxos/keys").ObjectIdClass;
|
|
5
|
+
name: Schema.optional<typeof Schema.String>;
|
|
6
|
+
view: Schema.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
|
|
7
|
+
name: Schema.SchemaClass<string, string, never>;
|
|
8
|
+
query: Schema.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
|
|
9
|
+
schema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
10
|
+
fields: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
|
|
11
|
+
id: typeof Schema.String;
|
|
12
|
+
path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
13
|
+
visible: Schema.optional<typeof Schema.Boolean>;
|
|
14
|
+
size: Schema.optional<typeof Schema.Number>;
|
|
15
|
+
referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
15
16
|
}>>>>;
|
|
16
|
-
hiddenFields:
|
|
17
|
-
id: typeof
|
|
18
|
-
path:
|
|
19
|
-
visible:
|
|
20
|
-
size:
|
|
21
|
-
referencePath:
|
|
17
|
+
hiddenFields: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
|
|
18
|
+
id: typeof Schema.String;
|
|
19
|
+
path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
20
|
+
visible: Schema.optional<typeof Schema.Boolean>;
|
|
21
|
+
size: Schema.optional<typeof Schema.Number>;
|
|
22
|
+
referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
22
23
|
}>>>>>;
|
|
23
|
-
metadata:
|
|
24
|
+
metadata: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
24
25
|
}, import("@dxos/echo-schema").TypedObjectOptions>>>;
|
|
25
|
-
threads:
|
|
26
|
+
threads: Schema.optional<Schema.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
|
|
26
27
|
}>;
|
|
27
|
-
export declare const TableType: import("@dxos/echo-schema").
|
|
28
|
-
id: import("@dxos/
|
|
29
|
-
name:
|
|
30
|
-
view:
|
|
31
|
-
name:
|
|
32
|
-
query:
|
|
33
|
-
schema:
|
|
34
|
-
fields:
|
|
35
|
-
id: typeof
|
|
36
|
-
path:
|
|
37
|
-
visible:
|
|
38
|
-
size:
|
|
39
|
-
referencePath:
|
|
28
|
+
export declare const TableType: import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
|
|
29
|
+
id: import("@dxos/keys").ObjectIdClass;
|
|
30
|
+
name: Schema.optional<typeof Schema.String>;
|
|
31
|
+
view: Schema.optional<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>>;
|
|
40
41
|
}>>>>;
|
|
41
|
-
hiddenFields:
|
|
42
|
-
id: typeof
|
|
43
|
-
path:
|
|
44
|
-
visible:
|
|
45
|
-
size:
|
|
46
|
-
referencePath:
|
|
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>>;
|
|
47
48
|
}>>>>>;
|
|
48
|
-
metadata:
|
|
49
|
+
metadata: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
49
50
|
}, import("@dxos/echo-schema").TypedObjectOptions>>>;
|
|
50
|
-
threads:
|
|
51
|
-
}
|
|
52
|
-
export interface TableType extends
|
|
51
|
+
threads: Schema.optional<Schema.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
|
|
52
|
+
}>, {}>;
|
|
53
|
+
export interface TableType extends Schema.Schema.Type<typeof TableType> {
|
|
53
54
|
}
|
|
54
55
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/types/table.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/types/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAiB,OAAO,EAA+B,MAAM,mBAAmB,CAAC;AAGxF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAMc,CAAC;AAGvC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;OAKrB,CAAC;AACF,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Schema } from 'effect';
|
|
2
|
+
import type { JsonSchemaType, SortDirectionType } from '@dxos/echo-schema';
|
|
2
3
|
import { ViewProjection, type SchemaPropertyDefinition } from '@dxos/schema';
|
|
3
4
|
import { TableType } from '../types';
|
|
4
5
|
type PropertyDisplayProps = {
|
|
@@ -10,11 +11,11 @@ export type TablePropertyDefinition = SchemaPropertyDefinition & Partial<Propert
|
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated
|
|
12
13
|
*/
|
|
13
|
-
export declare const
|
|
14
|
+
export declare const getBaseSchema: ({ typename, properties, jsonSchema, schema, }: {
|
|
14
15
|
typename?: string;
|
|
15
16
|
properties?: TablePropertyDefinition[];
|
|
16
17
|
jsonSchema?: JsonSchemaType;
|
|
17
|
-
schema?:
|
|
18
|
+
schema?: Schema.Schema.AnyNoContext;
|
|
18
19
|
}) => {
|
|
19
20
|
typename: string;
|
|
20
21
|
jsonSchema: JsonSchemaType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../../../../src/util/dynamic-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,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;AAGrC,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAGL,cAAc,EAEd,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,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,KAAK,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAkBjD,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,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,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,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a narrowed schema from an original schema that only includes
|
|
4
|
+
* the specified paths. This allows form components to only display
|
|
5
|
+
* and edit/validate specific fields rather than the entire object.
|
|
6
|
+
*
|
|
7
|
+
* @param schema The original schema to narrow
|
|
8
|
+
* @param paths Array of field paths to extract
|
|
9
|
+
* @returns A narrowed Schema instance containing only the properties at the specified paths
|
|
10
|
+
*/
|
|
11
|
+
export declare const narrowSchema: <S extends Schema.Schema.AnyNoContext>(schema: S, paths: string[]) => Schema.Schema<unknown, unknown> | undefined;
|
|
12
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/util/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,EAC/D,QAAQ,CAAC,EACT,OAAO,MAAM,EAAE,KACd,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAgBpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../../../src/util/signals.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../../../src/util/signals.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,OAAO,CAAC,MAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"AAKA,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,
|
|
1
|
+
{"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"AAKA,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,MAQ1G,CAAC;AAEF,eAAO,MAAM,aAAa;;;oEApBvB,mBAAmB,KAAG,MAAM;+BAwBb,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,UAAU,CAAA;SAAE,CAAC;;;;qEAda,iBAAiB,KAAG,MAAM;+BAuB/F,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,QAAQ,CAAA;SAAE,CAAC;;CAM9D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { type Client } from '@dxos/react-client';
|
|
3
3
|
import { type Space } from '@dxos/react-client/echo';
|
|
4
4
|
import { type TableType } from '../types';
|
|
@@ -9,6 +9,6 @@ type InitialiseTableProps = {
|
|
|
9
9
|
typename?: string;
|
|
10
10
|
initialRow?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const initializeTable: ({ client, space, table, typename, initialRow, }: InitialiseTableProps) => Promise<
|
|
12
|
+
export declare const initializeTable: ({ client, space, table, typename, initialRow, }: InitialiseTableProps) => Promise<Schema.Schema.AnyNoContext>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAYhC,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAQ,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,iDAMnC,oBAAoB,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CA0C3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/util/tag.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAA6B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/util/tag.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAA6B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,MAAM,EAAE,GAAG,SAgBzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-table",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.42af850",
|
|
4
4
|
"description": "A table component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -45,60 +45,67 @@
|
|
|
45
45
|
"@codemirror/state": "^6.4.1",
|
|
46
46
|
"@codemirror/view": "^6.34.1",
|
|
47
47
|
"@fluentui/react-tabster": "^9.24.2",
|
|
48
|
-
"@preact/
|
|
48
|
+
"@preact-signals/safe-react": "^0.9.0",
|
|
49
|
+
"@preact/signals-core": "^1.9.0",
|
|
49
50
|
"@radix-ui/react-context": "1.1.1",
|
|
50
51
|
"@radix-ui/react-primitive": "2.0.2",
|
|
51
52
|
"@radix-ui/react-slot": "1.1.2",
|
|
52
53
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
53
54
|
"date-fns": "^3.3.1",
|
|
54
55
|
"lodash.orderby": "^4.6.0",
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/echo-schema": "0.8.2-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/live-object": "0.8.2-
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/plugin-search": "0.8.2-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/react-ui-
|
|
68
|
-
"@dxos/react-ui-
|
|
69
|
-
"@dxos/react-ui-
|
|
70
|
-
"@dxos/react-ui-
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/react-ui-
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/util": "0.8.2-
|
|
56
|
+
"@dxos/context": "0.8.2-staging.42af850",
|
|
57
|
+
"@dxos/echo-schema": "0.8.2-staging.42af850",
|
|
58
|
+
"@dxos/effect": "0.8.2-staging.42af850",
|
|
59
|
+
"@dxos/debug": "0.8.2-staging.42af850",
|
|
60
|
+
"@dxos/invariant": "0.8.2-staging.42af850",
|
|
61
|
+
"@dxos/keys": "0.8.2-staging.42af850",
|
|
62
|
+
"@dxos/lit-grid": "0.8.2-staging.42af850",
|
|
63
|
+
"@dxos/live-object": "0.8.2-staging.42af850",
|
|
64
|
+
"@dxos/log": "0.8.2-staging.42af850",
|
|
65
|
+
"@dxos/plugin-search": "0.8.2-staging.42af850",
|
|
66
|
+
"@dxos/plugin-space": "0.8.2-staging.42af850",
|
|
67
|
+
"@dxos/react-client": "0.8.2-staging.42af850",
|
|
68
|
+
"@dxos/react-ui-editor": "0.8.2-staging.42af850",
|
|
69
|
+
"@dxos/react-ui-form": "0.8.2-staging.42af850",
|
|
70
|
+
"@dxos/react-ui-attention": "0.8.2-staging.42af850",
|
|
71
|
+
"@dxos/react-ui-grid": "0.8.2-staging.42af850",
|
|
72
|
+
"@dxos/react-ui-menu": "0.8.2-staging.42af850",
|
|
73
|
+
"@dxos/react-ui-stack": "0.8.2-staging.42af850",
|
|
74
|
+
"@dxos/react-ui-searchlist": "0.8.2-staging.42af850",
|
|
75
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-staging.42af850",
|
|
76
|
+
"@dxos/react-ui-types": "0.8.2-staging.42af850",
|
|
77
|
+
"@dxos/schema": "0.8.2-staging.42af850",
|
|
78
|
+
"@dxos/react-ui-tag-picker": "0.8.2-staging.42af850",
|
|
79
|
+
"@dxos/util": "0.8.2-staging.42af850"
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
82
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
83
|
+
"@effect/platform": "0.80.12",
|
|
81
84
|
"@phosphor-icons/react": "^2.1.5",
|
|
82
85
|
"@types/lodash.orderby": "^4.6.9",
|
|
83
86
|
"@types/react": "~18.2.0",
|
|
84
87
|
"@types/react-dom": "~18.2.0",
|
|
88
|
+
"effect": "3.14.21",
|
|
85
89
|
"fast-check": "^3.19.0",
|
|
86
90
|
"react": "~18.2.0",
|
|
87
91
|
"react-dom": "~18.2.0",
|
|
88
92
|
"vite": "5.4.7",
|
|
89
|
-
"@dxos/echo-signals": "0.8.2-
|
|
90
|
-
"@dxos/random": "0.8.2-
|
|
91
|
-
"@dxos/react-ui": "0.8.2-
|
|
92
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
93
|
-
"@dxos/storybook-utils": "0.8.2-
|
|
94
|
-
"@dxos/test-utils": "0.8.2-
|
|
93
|
+
"@dxos/echo-signals": "0.8.2-staging.42af850",
|
|
94
|
+
"@dxos/random": "0.8.2-staging.42af850",
|
|
95
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
96
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850",
|
|
97
|
+
"@dxos/storybook-utils": "0.8.2-staging.42af850",
|
|
98
|
+
"@dxos/test-utils": "0.8.2-staging.42af850"
|
|
95
99
|
},
|
|
96
100
|
"peerDependencies": {
|
|
101
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
102
|
+
"@effect/platform": "0.80.12",
|
|
97
103
|
"@phosphor-icons/react": "^2.1.5",
|
|
104
|
+
"effect": "^3.13.3",
|
|
98
105
|
"react": "~18.2.0",
|
|
99
106
|
"react-dom": "~18.2.0",
|
|
100
|
-
"@dxos/react-ui": "0.8.2-
|
|
101
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
107
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
108
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850"
|
|
102
109
|
},
|
|
103
110
|
"publishConfig": {
|
|
104
111
|
"access": "public"
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import React, { useCallback, useMemo } from 'react';
|
|
6
7
|
|
|
7
|
-
import { S } from '@dxos/echo-schema';
|
|
8
8
|
import { live } from '@dxos/react-client/echo';
|
|
9
9
|
import { Popover } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
@@ -20,14 +20,14 @@ export const CreateRefPanel = ({ model, modals, __gridScope }: GridScopedProps<C
|
|
|
20
20
|
const space = model?.space;
|
|
21
21
|
const state = modals.state.value;
|
|
22
22
|
|
|
23
|
-
const schema = useMemo<
|
|
23
|
+
const schema = useMemo<Schema.Schema<any> | undefined>(() => {
|
|
24
24
|
if (!space || state?.type !== 'createRefPanel') {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const [schema] = space.db.schemaRegistry.query({ typename: state.typename }).runSync();
|
|
29
29
|
if (schema) {
|
|
30
|
-
const omit =
|
|
30
|
+
const omit = Schema.omit<any, any, ['id']>('id');
|
|
31
31
|
return omit(schema);
|
|
32
32
|
}
|
|
33
33
|
}, [space, state]);
|
|
@@ -59,7 +59,7 @@ const meta: Meta = {
|
|
|
59
59
|
title: 'ui/react-ui-table/DynamicTable',
|
|
60
60
|
component: DynamicTable,
|
|
61
61
|
parameters: { translations },
|
|
62
|
-
decorators: [
|
|
62
|
+
decorators: [withLayout({ fullscreen: true }), withTheme],
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export default meta;
|
|
@@ -128,7 +128,7 @@ export const WithEchoSchema: StoryObj = {
|
|
|
128
128
|
const client = useClient();
|
|
129
129
|
const { space } = useClientProvider();
|
|
130
130
|
const schema = useSchema(client, space, Testing.Contact.typename);
|
|
131
|
-
const objects = useQuery(space, schema ? Filter.
|
|
131
|
+
const objects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
132
132
|
if (!schema) {
|
|
133
133
|
return <div>Loading schema...</div>;
|
|
134
134
|
}
|
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type Schema } from 'effect';
|
|
5
6
|
import React, { useRef, useMemo, useCallback } from 'react';
|
|
6
7
|
|
|
7
|
-
import { type
|
|
8
|
+
import { type JsonSchemaType } from '@dxos/echo-schema';
|
|
8
9
|
import { type ThemedClassName, useDefaultValue } from '@dxos/react-ui';
|
|
9
10
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
11
|
|
|
11
12
|
import { Table, type TableController } from './Table';
|
|
12
13
|
import { useTableModel } from '../../hooks';
|
|
13
14
|
import { type TableFeatures, TablePresentation, type TableRowAction } from '../../model';
|
|
14
|
-
import {
|
|
15
|
+
import { getBaseSchema, makeDynamicTable, type TablePropertyDefinition } from '../../util';
|
|
15
16
|
|
|
16
17
|
type DynamicTableProps = ThemedClassName<{
|
|
17
18
|
name?: string; // TODO(burdon): Remove?
|
|
18
19
|
rows: any[];
|
|
19
20
|
properties?: TablePropertyDefinition[];
|
|
20
21
|
jsonSchema?: JsonSchemaType;
|
|
21
|
-
schema?:
|
|
22
|
+
schema?: Schema.Schema.AnyNoContext;
|
|
22
23
|
features?: Partial<TableFeatures>;
|
|
23
24
|
rowActions?: TableRowAction[];
|
|
24
25
|
onRowClick?: (row: any) => void;
|
|
@@ -27,8 +28,6 @@ type DynamicTableProps = ThemedClassName<{
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Properties define both the schema and display characteristics of the table columns.
|
|
30
|
-
*
|
|
31
|
-
* @deprecated Use Table.
|
|
32
31
|
*/
|
|
33
32
|
// TODO(burdon): Instead of creating component variants, create helpers/hooks that normalize the props.
|
|
34
33
|
// TODO(burdon): Warning: Cannot update a component (`DynamicTable`) while rendering a different component (`DynamicTable`).
|