@dxos/react-ui-table 0.7.5-main.499c70c → 0.7.5-main.6a330ac
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-AT7O4RAD.mjs → chunk-3FR6NHPD.mjs} +6 -4
- package/dist/lib/browser/chunk-3FR6NHPD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +482 -284
- 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-YSBXNBDJ.cjs → chunk-NB3SFHGA.cjs} +8 -6
- package/dist/lib/node/chunk-NB3SFHGA.cjs.map +7 -0
- package/dist/lib/node/index.cjs +474 -270
- 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-6OH2NHUX.mjs → chunk-RLVVOZW5.mjs} +6 -4
- package/dist/lib/node-esm/chunk-RLVVOZW5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +482 -284
- 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/_deprecated/components/Cell/Cell.d.ts +2 -2
- package/dist/types/src/_deprecated/components/Cell/Cell.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/Cell/CellCombobox.d.ts +1 -2
- package/dist/types/src/_deprecated/components/Cell/CellCombobox.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.d.ts +2 -3
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.stories.d.ts +6 -7
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.stories.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.d.ts +1 -2
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.stories.d.ts +6 -7
- package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.stories.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/Table/Table.d.ts +5 -5
- package/dist/types/src/_deprecated/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/Table/Table.stories.d.ts +8 -9
- package/dist/types/src/_deprecated/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/Table/TableBody.d.ts +1 -2
- package/dist/types/src/_deprecated/components/Table/TableBody.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/Table/TableContext.d.ts +1 -1
- package/dist/types/src/_deprecated/components/Table/TableContext.d.ts.map +1 -1
- package/dist/types/src/_deprecated/components/Table/TableHead.d.ts +1 -2
- package/dist/types/src/_deprecated/components/Table/TableHead.d.ts.map +1 -1
- package/dist/types/src/_deprecated/schema/Schema.stories.d.ts +2 -3
- package/dist/types/src/_deprecated/schema/Schema.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +1 -2
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts +1 -2
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts +1 -2
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/RefPanel.d.ts +1 -2
- package/dist/types/src/components/Table/RefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts +1 -2
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.d.ts +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 -4
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +1 -2
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +17 -0
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -0
- package/dist/types/src/components/TableToolbar/index.d.ts +2 -0
- package/dist/types/src/components/TableToolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +12 -35
- 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/table-model.d.ts +11 -19
- 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/model/table-sorting.d.ts +53 -0
- package/dist/types/src/model/table-sorting.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +21 -90
- package/dist/types/src/types/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 +2 -1
- package/dist/types/src/util/table.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -34
- package/src/_deprecated/schema/Schema.stories.tsx +1 -1
- package/src/components/Table/ColumnActionsMenu.tsx +4 -4
- package/src/components/Table/CreateRefPanel.tsx +3 -4
- package/src/components/Table/Table.stories.tsx +55 -44
- package/src/components/Table/Table.tsx +4 -0
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +1 -1
- package/src/components/TableToolbar/TableToolbar.tsx +72 -0
- package/src/components/{Toolbar → TableToolbar}/index.ts +1 -1
- package/src/components/index.ts +1 -1
- package/src/hooks/useTableModel.ts +21 -0
- package/src/model/table-model.test.ts +0 -5
- package/src/model/table-model.ts +41 -99
- package/src/model/table-presentation.ts +25 -4
- package/src/model/table-sorting.ts +215 -0
- package/src/playwright/smoke.spec.ts +35 -13
- package/src/translations.ts +2 -1
- package/src/types/table.ts +3 -3
- package/src/util/table-buttons.ts +33 -3
- package/src/util/table-controls.ts +2 -2
- package/src/util/table.ts +85 -52
- package/dist/lib/browser/chunk-AT7O4RAD.mjs.map +0 -7
- package/dist/lib/node/chunk-YSBXNBDJ.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-6OH2NHUX.mjs.map +0 -7
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -21
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/common.d.ts +0 -14
- package/dist/types/src/components/Toolbar/common.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/index.d.ts +0 -2
- package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
- package/dist/types/src/playwright/playwright.config.d.ts +0 -3
- package/dist/types/src/playwright/playwright.config.d.ts.map +0 -1
- package/src/components/Toolbar/Toolbar.tsx +0 -87
- package/src/components/Toolbar/common.tsx +0 -71
- /package/src/playwright/{playwright.config.ts → playwright.config.cts} +0 -0
|
@@ -1,125 +1,56 @@
|
|
|
1
|
-
import { S } from '@dxos/echo-schema';
|
|
1
|
+
import { S, Expando } from '@dxos/echo-schema';
|
|
2
2
|
export declare const TableSchema: S.Struct<{
|
|
3
3
|
id: import("@dxos/echo-schema").ObjectIdClass;
|
|
4
4
|
name: S.optional<typeof S.String>;
|
|
5
|
-
view: S.optional<import("@dxos/echo-schema").Ref$<import("
|
|
5
|
+
view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
|
|
6
6
|
name: S.SchemaClass<string, string, never>;
|
|
7
7
|
query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
|
|
8
8
|
schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
9
9
|
fields: S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
10
10
|
id: typeof S.String;
|
|
11
|
-
path: S.Schema<import("@dxos/
|
|
11
|
+
path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
12
12
|
visible: S.optional<typeof S.Boolean>;
|
|
13
13
|
size: S.optional<typeof S.Number>;
|
|
14
|
-
referencePath: S.optional<S.Schema<import("@dxos/
|
|
14
|
+
referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
15
15
|
}>>>>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
anchor: S.optional<typeof S.String>;
|
|
20
|
-
status: S.optional<S.Union<[S.Literal<["staged"]>, S.Literal<["active"]>, S.Literal<["resolved"]>]>>;
|
|
21
|
-
messages: S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
22
|
-
timestamp: typeof S.String;
|
|
23
|
-
state: S.optional<S.Enums<typeof import("@dxos/plugin-space").MessageState>>;
|
|
24
|
-
sender: S.mutable<S.Struct<{
|
|
25
|
-
contact: S.optional<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
26
|
-
name: S.optional<typeof S.String>;
|
|
27
|
-
identifiers: S.mutable<S.Array$<S.Struct<{
|
|
28
|
-
type: typeof S.String;
|
|
29
|
-
value: typeof S.String;
|
|
30
|
-
}>>>;
|
|
31
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
32
|
-
identityKey: S.optional<typeof S.String>;
|
|
33
|
-
email: S.optional<typeof S.String>;
|
|
34
|
-
name: S.optional<typeof S.String>;
|
|
35
|
-
}>>;
|
|
36
|
-
text: typeof S.String;
|
|
37
|
-
parts: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>>>;
|
|
38
|
-
properties: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
39
|
-
context: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>;
|
|
40
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
41
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
16
|
+
metadata: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
17
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>>>;
|
|
18
|
+
threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
|
|
42
19
|
}>;
|
|
43
|
-
declare const TableType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("
|
|
20
|
+
declare const TableType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
44
21
|
readonly id: import("@dxos/echo-schema").ObjectIdClass;
|
|
45
22
|
readonly name: S.optional<typeof S.String>;
|
|
46
|
-
readonly view: S.optional<import("@dxos/echo-schema").Ref$<import("
|
|
23
|
+
readonly view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
|
|
47
24
|
name: S.SchemaClass<string, string, never>;
|
|
48
25
|
query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
|
|
49
26
|
schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
50
27
|
fields: S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
51
28
|
id: typeof S.String;
|
|
52
|
-
path: S.Schema<import("@dxos/
|
|
29
|
+
path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
53
30
|
visible: S.optional<typeof S.Boolean>;
|
|
54
31
|
size: S.optional<typeof S.Number>;
|
|
55
|
-
referencePath: S.optional<S.Schema<import("@dxos/
|
|
32
|
+
referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
56
33
|
}>>>>;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
status: S.optional<S.Union<[S.Literal<["staged"]>, S.Literal<["active"]>, S.Literal<["resolved"]>]>>;
|
|
62
|
-
messages: S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
63
|
-
timestamp: typeof S.String;
|
|
64
|
-
state: S.optional<S.Enums<typeof import("@dxos/plugin-space").MessageState>>;
|
|
65
|
-
sender: S.mutable<S.Struct<{
|
|
66
|
-
contact: S.optional<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
67
|
-
name: S.optional<typeof S.String>;
|
|
68
|
-
identifiers: S.mutable<S.Array$<S.Struct<{
|
|
69
|
-
type: typeof S.String;
|
|
70
|
-
value: typeof S.String;
|
|
71
|
-
}>>>;
|
|
72
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
73
|
-
identityKey: S.optional<typeof S.String>;
|
|
74
|
-
email: S.optional<typeof S.String>;
|
|
75
|
-
name: S.optional<typeof S.String>;
|
|
76
|
-
}>>;
|
|
77
|
-
text: typeof S.String;
|
|
78
|
-
parts: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>>>;
|
|
79
|
-
properties: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
80
|
-
context: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>;
|
|
81
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
82
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
83
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
34
|
+
metadata: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
35
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>>>;
|
|
36
|
+
readonly threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
|
|
37
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>, S.Struct.Encoded<{
|
|
84
38
|
readonly id: import("@dxos/echo-schema").ObjectIdClass;
|
|
85
39
|
readonly name: S.optional<typeof S.String>;
|
|
86
|
-
readonly view: S.optional<import("@dxos/echo-schema").Ref$<import("
|
|
40
|
+
readonly view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
|
|
87
41
|
name: S.SchemaClass<string, string, never>;
|
|
88
42
|
query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
|
|
89
43
|
schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
90
44
|
fields: S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
91
45
|
id: typeof S.String;
|
|
92
|
-
path: S.Schema<import("@dxos/
|
|
46
|
+
path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
93
47
|
visible: S.optional<typeof S.Boolean>;
|
|
94
48
|
size: S.optional<typeof S.Number>;
|
|
95
|
-
referencePath: S.optional<S.Schema<import("@dxos/
|
|
49
|
+
referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
96
50
|
}>>>>;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
anchor: S.optional<typeof S.String>;
|
|
101
|
-
status: S.optional<S.Union<[S.Literal<["staged"]>, S.Literal<["active"]>, S.Literal<["resolved"]>]>>;
|
|
102
|
-
messages: S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
103
|
-
timestamp: typeof S.String;
|
|
104
|
-
state: S.optional<S.Enums<typeof import("@dxos/plugin-space").MessageState>>;
|
|
105
|
-
sender: S.mutable<S.Struct<{
|
|
106
|
-
contact: S.optional<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
107
|
-
name: S.optional<typeof S.String>;
|
|
108
|
-
identifiers: S.mutable<S.Array$<S.Struct<{
|
|
109
|
-
type: typeof S.String;
|
|
110
|
-
value: typeof S.String;
|
|
111
|
-
}>>>;
|
|
112
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
113
|
-
identityKey: S.optional<typeof S.String>;
|
|
114
|
-
email: S.optional<typeof S.String>;
|
|
115
|
-
name: S.optional<typeof S.String>;
|
|
116
|
-
}>>;
|
|
117
|
-
text: typeof S.String;
|
|
118
|
-
parts: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>>>;
|
|
119
|
-
properties: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
120
|
-
context: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>;
|
|
121
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
122
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
51
|
+
metadata: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
52
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>>>;
|
|
53
|
+
readonly threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
|
|
123
54
|
}>>;
|
|
124
55
|
export declare class TableType extends TableType_base {
|
|
125
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/types/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,CAAC,EAAe,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/types/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,CAAC,EAAe,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI3E,eAAO,MAAM,WAAW;;;;cAUD,EAAE,WAAW;eAIsH,EAAG,MAAM;gBAAmI,EAAG,QAAQ,CAAC,EAAE,MAAM;gBAAgJ,EAAG,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;uBAAqB,EAAG,MAAM;kBAAe,EAAG,MAAM;qBAA6C,EAAG,QAAQ,QAAO,EAAG,OAAO;kBAAgB,EAAG,QAAQ,QAAO,EAAG,MAAM;2BAAyB,EAAG,QAAQ,CAAC,EAAE,MAAM;;kBAA+G,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,QAAO,EAAG,MAAM,SAAQ,EAAG,GAAG;;;EARj3B,CAAC;;;;;cAIoB,EAAE,WAAW;eAIsH,EAAG,MAAM;gBAAmI,EAAG,QAAQ,CAAC,EAAE,MAAM;gBAAgJ,EAAG,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;uBAAqB,EAAG,MAAM;kBAAe,EAAG,MAAM;qBAA6C,EAAG,QAAQ,QAAO,EAAG,OAAO;kBAAgB,EAAG,QAAQ,QAAO,EAAG,MAAM;2BAAyB,EAAG,QAAQ,CAAC,EAAE,MAAM;;kBAA+G,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,QAAO,EAAG,MAAM,SAAQ,EAAG,GAAG;;;;;;;cAJ51B,EAAE,WAAW;eAIsH,EAAG,MAAM;gBAAmI,EAAG,QAAQ,CAAC,EAAE,MAAM;gBAAgJ,EAAG,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;uBAAqB,EAAG,MAAM;kBAAe,EAAG,MAAM;qBAA6C,EAAG,QAAQ,QAAO,EAAG,OAAO;kBAAgB,EAAG,QAAQ,QAAO,EAAG,MAAM;2BAAyB,EAAG,QAAQ,CAAC,EAAE,MAAM;;kBAA+G,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,QAAO,EAAG,MAAM,SAAQ,EAAG,GAAG;;;;AAJn3B,qBAAa,SAAU,SAAQ,cAGT;CAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TableButton = 'columnSettings' | 'rowMenu' | 'newColumn' | 'referencedCell';
|
|
1
|
+
export type TableButton = 'columnSettings' | 'rowMenu' | 'newColumn' | 'referencedCell' | 'sort';
|
|
2
2
|
export declare const BUTTON_IDENTIFIERS: {
|
|
3
3
|
[K in TableButton]: string;
|
|
4
4
|
};
|
|
@@ -15,6 +15,10 @@ type ButtonData = {
|
|
|
15
15
|
} | {
|
|
16
16
|
type: 'rowMenu';
|
|
17
17
|
rowIndex: number;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'sort';
|
|
20
|
+
fieldId: string;
|
|
21
|
+
direction?: 'asc' | 'desc';
|
|
18
22
|
};
|
|
19
23
|
export declare const tableButtons: {
|
|
20
24
|
readonly addColumn: {
|
|
@@ -57,6 +61,16 @@ export declare const tableButtons: {
|
|
|
57
61
|
type: "rowMenu";
|
|
58
62
|
}>;
|
|
59
63
|
};
|
|
64
|
+
readonly sort: {
|
|
65
|
+
readonly attr: string;
|
|
66
|
+
readonly icon: "ph--sort-ascending--regular";
|
|
67
|
+
readonly render: ({ fieldId, direction }: Omit<Extract<ButtonData, {
|
|
68
|
+
type: "sort";
|
|
69
|
+
}>, "type">) => string;
|
|
70
|
+
readonly getData: (el: HTMLElement) => Extract<ButtonData, {
|
|
71
|
+
type: "sort";
|
|
72
|
+
}>;
|
|
73
|
+
};
|
|
60
74
|
};
|
|
61
75
|
export {};
|
|
62
76
|
//# sourceMappingURL=table-buttons.d.ts.map
|
|
@@ -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,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,CAAC;AAEjG,eAAO,MAAM,kBAAkB,EAAE;KAAG,CAAC,IAAI,WAAW,GAAG,MAAM;CAMnD,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,gBAAgB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC;AA2HlE,eAAO,MAAM,YAAY;;;;wCA/FA,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;+BAUrE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC;;;;;kDAS1C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BAWhF,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC;;;;;wCAUpD,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;;;;;kDASnC,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;;CAazD,CAAC"}
|
|
@@ -5,7 +5,8 @@ type InitialiseTableProps = {
|
|
|
5
5
|
space: Space;
|
|
6
6
|
table: TableType;
|
|
7
7
|
initialRow?: boolean;
|
|
8
|
+
initialSchema?: string;
|
|
8
9
|
};
|
|
9
|
-
export declare const initializeTable: ({ space, table, initialRow, }: InitialiseTableProps) => Promise<EchoSchema>;
|
|
10
|
+
export declare const initializeTable: ({ space, table, initialRow, initialSchema, }: InitialiseTableProps) => Promise<EchoSchema>;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,UAAU,EAIhB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,UAAU,EAIhB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAMF,eAAO,MAAM,eAAe,iDAKzB,oBAAoB,KAAG,OAAO,CAAC,UAAU,CAwF3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.7.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-table",
|
|
3
|
-
"version": "0.7.5-main.
|
|
3
|
+
"version": "0.7.5-main.6a330ac",
|
|
4
4
|
"description": "A table component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
"./deprecated": {
|
|
12
13
|
"types": "./dist/types/src/_deprecated/index.d.ts",
|
|
@@ -43,36 +44,37 @@
|
|
|
43
44
|
"@codemirror/autocomplete": "^6.18.1",
|
|
44
45
|
"@codemirror/state": "^6.4.1",
|
|
45
46
|
"@codemirror/view": "^6.34.1",
|
|
46
|
-
"@fluentui/react-tabster": "
|
|
47
|
+
"@fluentui/react-tabster": "9.23.3",
|
|
47
48
|
"@preact/signals-core": "^1.6.0",
|
|
48
|
-
"@radix-ui/react-context": "
|
|
49
|
-
"@radix-ui/react-primitive": "
|
|
50
|
-
"@radix-ui/react-slot": "
|
|
51
|
-
"@radix-ui/react-use-controllable-state": "
|
|
49
|
+
"@radix-ui/react-context": "1.1.1",
|
|
50
|
+
"@radix-ui/react-primitive": "2.0.2",
|
|
51
|
+
"@radix-ui/react-slot": "1.1.2",
|
|
52
|
+
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
52
53
|
"@tanstack/react-table": "^8.13.2",
|
|
53
54
|
"@tanstack/react-virtual": "^3.9.0",
|
|
54
55
|
"date-fns": "^3.3.1",
|
|
55
56
|
"lodash.orderby": "^4.6.0",
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/plugin-search": "0.7.5-main.
|
|
65
|
-
"@dxos/plugin-space": "0.7.5-main.
|
|
66
|
-
"@dxos/react-client": "0.7.5-main.
|
|
67
|
-
"@dxos/react-ui-
|
|
68
|
-
"@dxos/react-ui-grid": "0.7.5-main.
|
|
69
|
-
"@dxos/react-ui-
|
|
70
|
-
"@dxos/react-ui-
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/react-ui-stack": "0.7.5-main.
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/schema": "0.7.5-main.
|
|
57
|
+
"@dxos/context": "0.7.5-main.6a330ac",
|
|
58
|
+
"@dxos/debug": "0.7.5-main.6a330ac",
|
|
59
|
+
"@dxos/echo-schema": "0.7.5-main.6a330ac",
|
|
60
|
+
"@dxos/invariant": "0.7.5-main.6a330ac",
|
|
61
|
+
"@dxos/lit-grid": "0.7.5-main.6a330ac",
|
|
62
|
+
"@dxos/keys": "0.7.5-main.6a330ac",
|
|
63
|
+
"@dxos/live-object": "0.7.5-main.6a330ac",
|
|
64
|
+
"@dxos/log": "0.7.5-main.6a330ac",
|
|
65
|
+
"@dxos/plugin-search": "0.7.5-main.6a330ac",
|
|
66
|
+
"@dxos/plugin-space": "0.7.5-main.6a330ac",
|
|
67
|
+
"@dxos/react-client": "0.7.5-main.6a330ac",
|
|
68
|
+
"@dxos/react-ui-attention": "0.7.5-main.6a330ac",
|
|
69
|
+
"@dxos/react-ui-grid": "0.7.5-main.6a330ac",
|
|
70
|
+
"@dxos/react-ui-form": "0.7.5-main.6a330ac",
|
|
71
|
+
"@dxos/react-ui-menu": "0.7.5-main.6a330ac",
|
|
72
|
+
"@dxos/react-ui-searchlist": "0.7.5-main.6a330ac",
|
|
73
|
+
"@dxos/react-ui-stack": "0.7.5-main.6a330ac",
|
|
74
|
+
"@dxos/react-ui-syntax-highlighter": "0.7.5-main.6a330ac",
|
|
75
|
+
"@dxos/react-ui-types": "0.7.5-main.6a330ac",
|
|
76
|
+
"@dxos/schema": "0.7.5-main.6a330ac",
|
|
77
|
+
"@dxos/util": "0.7.5-main.6a330ac"
|
|
76
78
|
},
|
|
77
79
|
"devDependencies": {
|
|
78
80
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -83,19 +85,19 @@
|
|
|
83
85
|
"react": "~18.2.0",
|
|
84
86
|
"react-dom": "~18.2.0",
|
|
85
87
|
"vite": "5.4.7",
|
|
86
|
-
"@dxos/echo-signals": "0.7.5-main.
|
|
87
|
-
"@dxos/random": "0.7.5-main.
|
|
88
|
-
"@dxos/react-ui-theme": "0.7.5-main.
|
|
89
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
88
|
+
"@dxos/echo-signals": "0.7.5-main.6a330ac",
|
|
89
|
+
"@dxos/random": "0.7.5-main.6a330ac",
|
|
90
|
+
"@dxos/react-ui-theme": "0.7.5-main.6a330ac",
|
|
91
|
+
"@dxos/react-ui": "0.7.5-main.6a330ac",
|
|
92
|
+
"@dxos/test-utils": "0.7.5-main.6a330ac",
|
|
93
|
+
"@dxos/storybook-utils": "0.7.5-main.6a330ac"
|
|
92
94
|
},
|
|
93
95
|
"peerDependencies": {
|
|
94
96
|
"@phosphor-icons/react": "^2.1.5",
|
|
95
97
|
"react": "~18.2.0",
|
|
96
98
|
"react-dom": "~18.2.0",
|
|
97
|
-
"@dxos/react-ui-theme": "0.7.5-main.
|
|
98
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
99
|
+
"@dxos/react-ui-theme": "0.7.5-main.6a330ac",
|
|
100
|
+
"@dxos/react-ui": "0.7.5-main.6a330ac"
|
|
99
101
|
},
|
|
100
102
|
"publishConfig": {
|
|
101
103
|
"access": "public"
|
|
@@ -18,7 +18,7 @@ export const ColumnActionsMenu = ({ model, modals }: ColumnActionsMenuProps) =>
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const currentSort = model.sorting;
|
|
21
|
+
const currentSort = model.sorting?.sorting;
|
|
22
22
|
const isCurrentColumnSorted = currentSort?.fieldId === state.fieldId;
|
|
23
23
|
|
|
24
24
|
return (
|
|
@@ -30,7 +30,7 @@ export const ColumnActionsMenu = ({ model, modals }: ColumnActionsMenuProps) =>
|
|
|
30
30
|
{(!isCurrentColumnSorted || currentSort?.direction === 'asc') && (
|
|
31
31
|
<DropdownMenu.Item
|
|
32
32
|
data-testid='column-sort-descending'
|
|
33
|
-
onClick={() => model.setSort(state.fieldId, 'desc')}
|
|
33
|
+
onClick={() => model.sorting?.setSort(state.fieldId, 'desc')}
|
|
34
34
|
>
|
|
35
35
|
{t('column action sort descending')}
|
|
36
36
|
</DropdownMenu.Item>
|
|
@@ -38,13 +38,13 @@ export const ColumnActionsMenu = ({ model, modals }: ColumnActionsMenuProps) =>
|
|
|
38
38
|
{(!isCurrentColumnSorted || currentSort?.direction === 'desc') && (
|
|
39
39
|
<DropdownMenu.Item
|
|
40
40
|
data-testid='column-sort-ascending'
|
|
41
|
-
onClick={() => model.setSort(state.fieldId, 'asc')}
|
|
41
|
+
onClick={() => model.sorting?.setSort(state.fieldId, 'asc')}
|
|
42
42
|
>
|
|
43
43
|
{t('column action sort ascending')}
|
|
44
44
|
</DropdownMenu.Item>
|
|
45
45
|
)}
|
|
46
46
|
{isCurrentColumnSorted && (
|
|
47
|
-
<DropdownMenu.Item data-testid='column-clear-sort' onClick={() => model.clearSort()}>
|
|
47
|
+
<DropdownMenu.Item data-testid='column-clear-sort' onClick={() => model.sorting?.clearSort()}>
|
|
48
48
|
{t('column action clear sorting')}
|
|
49
49
|
</DropdownMenu.Item>
|
|
50
50
|
)}
|
|
@@ -19,13 +19,13 @@ export const CreateRefPanel = ({ model, modals, __gridScope }: GridScopedProps<C
|
|
|
19
19
|
const { id: gridId } = useGridContext('TableCellEditor', __gridScope);
|
|
20
20
|
const space = getSpace(model?.table);
|
|
21
21
|
const state = modals.state.value;
|
|
22
|
+
|
|
22
23
|
const schema = useMemo<S.Schema<any> | undefined>(() => {
|
|
23
24
|
if (!space || state?.type !== 'createRefPanel') {
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
const schema: S.Schema<any> | undefined = space.db.schemaRegistry.getSchema(state.typename)?.schema;
|
|
28
|
+
const [schema] = space.db.schemaRegistry.query({ typename: state.typename }).runSync();
|
|
29
29
|
if (schema) {
|
|
30
30
|
const omit = S.omit<any, any, ['id']>('id');
|
|
31
31
|
return omit(schema);
|
|
@@ -38,12 +38,11 @@ export const CreateRefPanel = ({ model, modals, __gridScope }: GridScopedProps<C
|
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const schema
|
|
41
|
+
const [schema] = space.db.schemaRegistry.query({ typename: state.typename }).runSync();
|
|
42
42
|
if (schema) {
|
|
43
43
|
const obj = space.db.add(create(schema, values));
|
|
44
44
|
state.onCreate?.(obj);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
46
|
void modals.close();
|
|
48
47
|
},
|
|
49
48
|
[modals, space, state],
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta } from '@storybook/react';
|
|
8
8
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { type EchoSchema } from '@dxos/echo-schema';
|
|
11
10
|
import { invariant } from '@dxos/invariant';
|
|
12
11
|
import { useGlobalFilteredObjects } from '@dxos/plugin-search';
|
|
13
12
|
import { faker } from '@dxos/random';
|
|
14
|
-
import { Filter, useQuery, create } from '@dxos/react-client/echo';
|
|
13
|
+
import { Filter, useQuery, useSchema, create } from '@dxos/react-client/echo';
|
|
15
14
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
16
15
|
import { useDefaultValue } from '@dxos/react-ui';
|
|
17
16
|
import { ViewEditor } from '@dxos/react-ui-form';
|
|
@@ -25,7 +24,7 @@ import { TablePresentation } from '../../model';
|
|
|
25
24
|
import translations from '../../translations';
|
|
26
25
|
import { TableType } from '../../types';
|
|
27
26
|
import { initializeTable } from '../../util';
|
|
28
|
-
import {
|
|
27
|
+
import { TableToolbar } from '../TableToolbar';
|
|
29
28
|
import { createItems, createTable, type SimulatorProps, useSimulator } from '../testing';
|
|
30
29
|
|
|
31
30
|
// NOTE(ZaymonFC): We rely on this seed being 0 in the smoke tests.
|
|
@@ -41,13 +40,13 @@ const DefaultStory = () => {
|
|
|
41
40
|
|
|
42
41
|
const tables = useQuery(space, Filter.schema(TableType));
|
|
43
42
|
const [table, setTable] = useState<TableType>();
|
|
44
|
-
const
|
|
43
|
+
const schema = useSchema(space, table?.view?.target?.query.type);
|
|
44
|
+
|
|
45
45
|
useEffect(() => {
|
|
46
46
|
if (space && tables.length && !table) {
|
|
47
47
|
const table = tables[0];
|
|
48
48
|
invariant(table.view);
|
|
49
49
|
setTable(table);
|
|
50
|
-
setSchema(space.db.schemaRegistry.getSchema(table.view.target!.query.type));
|
|
51
50
|
}
|
|
52
51
|
}, [space, tables]);
|
|
53
52
|
|
|
@@ -84,21 +83,6 @@ const DefaultStory = () => {
|
|
|
84
83
|
[table, projection],
|
|
85
84
|
);
|
|
86
85
|
|
|
87
|
-
const handleAction = useCallback(
|
|
88
|
-
(action: { type: string }) => {
|
|
89
|
-
switch (action.type) {
|
|
90
|
-
case 'on-thread-create': {
|
|
91
|
-
console.log('Thread creation triggered');
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
case 'add-row': {
|
|
95
|
-
handleInsertRow();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
[table],
|
|
100
|
-
);
|
|
101
|
-
|
|
102
86
|
const tableRef = useRef<TableController>(null);
|
|
103
87
|
const handleCellUpdate = useCallback((cell: any) => {
|
|
104
88
|
tableRef.current?.update?.(cell);
|
|
@@ -125,6 +109,36 @@ const DefaultStory = () => {
|
|
|
125
109
|
}
|
|
126
110
|
}, [model]);
|
|
127
111
|
|
|
112
|
+
const handleAction = useCallback(
|
|
113
|
+
(action: { type: string }) => {
|
|
114
|
+
switch (action.type) {
|
|
115
|
+
case 'on-thread-create': {
|
|
116
|
+
console.log('Thread creation triggered');
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
case 'add-row': {
|
|
120
|
+
handleInsertRow();
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case 'save-view': {
|
|
124
|
+
model?.saveView();
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
[table, model],
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
const onTypenameChanged = useCallback(
|
|
133
|
+
(typename: string) => {
|
|
134
|
+
if (table?.view?.target) {
|
|
135
|
+
schema?.updateTypename(typename);
|
|
136
|
+
table.view.target.query.type = typename;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
[table?.view?.target, schema],
|
|
140
|
+
);
|
|
141
|
+
|
|
128
142
|
if (!schema || !table) {
|
|
129
143
|
return <div />;
|
|
130
144
|
}
|
|
@@ -132,11 +146,7 @@ const DefaultStory = () => {
|
|
|
132
146
|
return (
|
|
133
147
|
<div className='grow grid grid-cols-[1fr_350px]'>
|
|
134
148
|
<div className='grid grid-rows-[min-content_1fr] min-bs-0 overflow-hidden'>
|
|
135
|
-
<
|
|
136
|
-
<Toolbar.Editing />
|
|
137
|
-
<Toolbar.Separator />
|
|
138
|
-
<Toolbar.Actions />
|
|
139
|
-
</Toolbar.Root>
|
|
149
|
+
<TableToolbar classNames='border-b border-separator' onAction={handleAction} />
|
|
140
150
|
<Table.Root>
|
|
141
151
|
<Table.Main ref={tableRef} model={model} presentation={presentation} ignoreAttention />
|
|
142
152
|
</Table.Root>
|
|
@@ -147,6 +157,7 @@ const DefaultStory = () => {
|
|
|
147
157
|
registry={space?.db.schemaRegistry}
|
|
148
158
|
schema={schema}
|
|
149
159
|
view={table.view.target!}
|
|
160
|
+
onTypenameChanged={onTypenameChanged}
|
|
150
161
|
onDelete={handleDeleteColumn}
|
|
151
162
|
/>
|
|
152
163
|
)}
|
|
@@ -163,7 +174,7 @@ type StoryProps = {
|
|
|
163
174
|
rows?: number;
|
|
164
175
|
} & Pick<SimulatorProps, 'insertInterval' | 'updateInterval'>;
|
|
165
176
|
|
|
166
|
-
const
|
|
177
|
+
const _TablePerformanceStory = (props: StoryProps) => {
|
|
167
178
|
const getDefaultRows = useCallback(() => 10, []);
|
|
168
179
|
const rows = useDefaultValue(props.rows, getDefaultRows);
|
|
169
180
|
const table = useMemo(() => createTable(), []);
|
|
@@ -236,22 +247,22 @@ const meta: Meta<StoryProps> = {
|
|
|
236
247
|
|
|
237
248
|
export default meta;
|
|
238
249
|
|
|
239
|
-
type Story = StoryObj<StoryProps>;
|
|
240
|
-
|
|
241
250
|
export const Default = {};
|
|
242
251
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
252
|
+
// TODO(ZaymonFC): Restore the performance stories.
|
|
253
|
+
// type Story = StoryObj<StoryProps>;
|
|
254
|
+
// export const Mutations: Story = {
|
|
255
|
+
// render: TablePerformanceStory,
|
|
256
|
+
// args: {
|
|
257
|
+
// rows: 1000,
|
|
258
|
+
// updateInterval: 1,
|
|
259
|
+
// },
|
|
260
|
+
// };
|
|
261
|
+
|
|
262
|
+
// export const RapidInsertions: Story = {
|
|
263
|
+
// render: TablePerformanceStory,
|
|
264
|
+
// args: {
|
|
265
|
+
// rows: 0,
|
|
266
|
+
// insertInterval: 100,
|
|
267
|
+
// },
|
|
268
|
+
// };
|
|
@@ -38,7 +38,7 @@ const DefaultStory = ({ editing }: StoryProps) => {
|
|
|
38
38
|
const table = tables[0];
|
|
39
39
|
invariant(table.view);
|
|
40
40
|
setTable(table);
|
|
41
|
-
setSchema(space.db.schemaRegistry.getSchema(table.view.target!.query.type));
|
|
41
|
+
setSchema(space.db.schemaRegistry.getSchema(table.view.target!.query.type!));
|
|
42
42
|
}
|
|
43
43
|
}, [space, tables]);
|
|
44
44
|
|