@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.
Files changed (117) hide show
  1. package/dist/lib/browser/{chunk-AT7O4RAD.mjs → chunk-3FR6NHPD.mjs} +6 -4
  2. package/dist/lib/browser/chunk-3FR6NHPD.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +482 -284
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +1 -1
  7. package/dist/lib/node/{chunk-YSBXNBDJ.cjs → chunk-NB3SFHGA.cjs} +8 -6
  8. package/dist/lib/node/chunk-NB3SFHGA.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +474 -270
  10. package/dist/lib/node/index.cjs.map +4 -4
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/types/index.cjs +3 -3
  13. package/dist/lib/node/types/index.cjs.map +1 -1
  14. package/dist/lib/node-esm/{chunk-6OH2NHUX.mjs → chunk-RLVVOZW5.mjs} +6 -4
  15. package/dist/lib/node-esm/chunk-RLVVOZW5.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +482 -284
  17. package/dist/lib/node-esm/index.mjs.map +4 -4
  18. package/dist/lib/node-esm/meta.json +1 -1
  19. package/dist/lib/node-esm/types/index.mjs +1 -1
  20. package/dist/types/src/_deprecated/components/Cell/Cell.d.ts +2 -2
  21. package/dist/types/src/_deprecated/components/Cell/Cell.d.ts.map +1 -1
  22. package/dist/types/src/_deprecated/components/Cell/CellCombobox.d.ts +1 -2
  23. package/dist/types/src/_deprecated/components/Cell/CellCombobox.d.ts.map +1 -1
  24. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.d.ts +2 -3
  25. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.d.ts.map +1 -1
  26. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.stories.d.ts +6 -7
  27. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.stories.d.ts.map +1 -1
  28. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.d.ts +1 -2
  29. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.d.ts.map +1 -1
  30. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.stories.d.ts +6 -7
  31. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.stories.d.ts.map +1 -1
  32. package/dist/types/src/_deprecated/components/Table/Table.d.ts +5 -5
  33. package/dist/types/src/_deprecated/components/Table/Table.d.ts.map +1 -1
  34. package/dist/types/src/_deprecated/components/Table/Table.stories.d.ts +8 -9
  35. package/dist/types/src/_deprecated/components/Table/Table.stories.d.ts.map +1 -1
  36. package/dist/types/src/_deprecated/components/Table/TableBody.d.ts +1 -2
  37. package/dist/types/src/_deprecated/components/Table/TableBody.d.ts.map +1 -1
  38. package/dist/types/src/_deprecated/components/Table/TableContext.d.ts +1 -1
  39. package/dist/types/src/_deprecated/components/Table/TableContext.d.ts.map +1 -1
  40. package/dist/types/src/_deprecated/components/Table/TableHead.d.ts +1 -2
  41. package/dist/types/src/_deprecated/components/Table/TableHead.d.ts.map +1 -1
  42. package/dist/types/src/_deprecated/schema/Schema.stories.d.ts +2 -3
  43. package/dist/types/src/_deprecated/schema/Schema.stories.d.ts.map +1 -1
  44. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +1 -2
  45. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
  46. package/dist/types/src/components/Table/ColumnSettings.d.ts +1 -2
  47. package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
  48. package/dist/types/src/components/Table/CreateRefPanel.d.ts +1 -2
  49. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
  50. package/dist/types/src/components/Table/RefPanel.d.ts +1 -2
  51. package/dist/types/src/components/Table/RefPanel.d.ts.map +1 -1
  52. package/dist/types/src/components/Table/RowActionsMenu.d.ts +1 -2
  53. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  54. package/dist/types/src/components/Table/Table.d.ts +1 -1
  55. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  56. package/dist/types/src/components/Table/Table.stories.d.ts +1 -4
  57. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  58. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +1 -2
  59. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  60. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +17 -0
  61. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -0
  62. package/dist/types/src/components/TableToolbar/index.d.ts +2 -0
  63. package/dist/types/src/components/TableToolbar/index.d.ts.map +1 -0
  64. package/dist/types/src/components/index.d.ts +1 -1
  65. package/dist/types/src/components/index.d.ts.map +1 -1
  66. package/dist/types/src/components/testing.d.ts +12 -35
  67. package/dist/types/src/components/testing.d.ts.map +1 -1
  68. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  69. package/dist/types/src/model/table-model.d.ts +11 -19
  70. package/dist/types/src/model/table-model.d.ts.map +1 -1
  71. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  72. package/dist/types/src/model/table-sorting.d.ts +53 -0
  73. package/dist/types/src/model/table-sorting.d.ts.map +1 -0
  74. package/dist/types/src/translations.d.ts +2 -1
  75. package/dist/types/src/translations.d.ts.map +1 -1
  76. package/dist/types/src/types/table.d.ts +21 -90
  77. package/dist/types/src/types/table.d.ts.map +1 -1
  78. package/dist/types/src/util/table-buttons.d.ts +15 -1
  79. package/dist/types/src/util/table-buttons.d.ts.map +1 -1
  80. package/dist/types/src/util/table.d.ts +2 -1
  81. package/dist/types/src/util/table.d.ts.map +1 -1
  82. package/dist/types/tsconfig.tsbuildinfo +1 -1
  83. package/package.json +36 -34
  84. package/src/_deprecated/schema/Schema.stories.tsx +1 -1
  85. package/src/components/Table/ColumnActionsMenu.tsx +4 -4
  86. package/src/components/Table/CreateRefPanel.tsx +3 -4
  87. package/src/components/Table/Table.stories.tsx +55 -44
  88. package/src/components/Table/Table.tsx +4 -0
  89. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +1 -1
  90. package/src/components/TableToolbar/TableToolbar.tsx +72 -0
  91. package/src/components/{Toolbar → TableToolbar}/index.ts +1 -1
  92. package/src/components/index.ts +1 -1
  93. package/src/hooks/useTableModel.ts +21 -0
  94. package/src/model/table-model.test.ts +0 -5
  95. package/src/model/table-model.ts +41 -99
  96. package/src/model/table-presentation.ts +25 -4
  97. package/src/model/table-sorting.ts +215 -0
  98. package/src/playwright/smoke.spec.ts +35 -13
  99. package/src/translations.ts +2 -1
  100. package/src/types/table.ts +3 -3
  101. package/src/util/table-buttons.ts +33 -3
  102. package/src/util/table-controls.ts +2 -2
  103. package/src/util/table.ts +85 -52
  104. package/dist/lib/browser/chunk-AT7O4RAD.mjs.map +0 -7
  105. package/dist/lib/node/chunk-YSBXNBDJ.cjs.map +0 -7
  106. package/dist/lib/node-esm/chunk-6OH2NHUX.mjs.map +0 -7
  107. package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -21
  108. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
  109. package/dist/types/src/components/Toolbar/common.d.ts +0 -14
  110. package/dist/types/src/components/Toolbar/common.d.ts.map +0 -1
  111. package/dist/types/src/components/Toolbar/index.d.ts +0 -2
  112. package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
  113. package/dist/types/src/playwright/playwright.config.d.ts +0 -3
  114. package/dist/types/src/playwright/playwright.config.d.ts.map +0 -1
  115. package/src/components/Toolbar/Toolbar.tsx +0 -87
  116. package/src/components/Toolbar/common.tsx +0 -71
  117. /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("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
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/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>;
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/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>>;
14
+ referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
15
15
  }>>>>;
16
- }, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
17
- threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
18
- name: S.optional<typeof S.String>;
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("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
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("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
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/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>;
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/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>>;
32
+ referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
56
33
  }>>>>;
57
- }, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
58
- readonly threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
59
- name: S.optional<typeof S.String>;
60
- anchor: S.optional<typeof S.String>;
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("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
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/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>;
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/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>>;
49
+ referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
96
50
  }>>>>;
97
- }, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
98
- readonly threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
99
- name: S.optional<typeof S.String>;
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;AAIlE,eAAO,MAAM,WAAW;;;;cAcyB,EAAG,WAAW;eAAoP,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;;;;cAA0vG,EAAG,QAAQ,QAAO,EAAG,MAAM;gBAAqD,EAAG,QAAQ,QAAO,EAAG,MAAM;gBAAc,EAAG,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,cAAa,EAAG,OAAO,cAAa,EAAG,OAAO;kBAAgC,EAAG,OAAO,CAAC,EAAE,MAAM,QAAQ,mBAAmB,cAAc,6DAA6D;8BAAyG,EAAG,MAAM;mBAA8C,EAAG,QAAQ,CAAC,EAAE,KAAK;oBAAsF,EAAG,OAAO,CAAC,EAAE,MAAM;yBAAuB,EAAG,QAAQ,QAAQ,mBAAmB,cAAc,6DAA6D;0BAA2C,EAAG,QAAQ,QAAO,EAAG,MAAM;iCAA+B,EAAG,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM;qCAAmC,EAAG,MAAM;sCAAmC,EAAG,MAA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AA6C,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;AAExF,eAAO,MAAM,kBAAkB,EAAE;KAAG,CAAC,IAAI,WAAW,GAAG,MAAM;CAKnD,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,CAAC;AAgG1C,eAAO,MAAM,YAAY;;;;wCAvEA,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,C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AAC,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;AAG3B,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;CACtB,CAAC;AAIF,eAAO,MAAM,eAAe,kCAIzB,oBAAoB,KAAG,OAAO,CAAC,UAAU,CA0D3C,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.2"}
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.499c70c",
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": "^9.19.0",
47
+ "@fluentui/react-tabster": "9.23.3",
47
48
  "@preact/signals-core": "^1.6.0",
48
- "@radix-ui/react-context": "^1.0.0",
49
- "@radix-ui/react-primitive": "^1.0.2",
50
- "@radix-ui/react-slot": "^1.0.1",
51
- "@radix-ui/react-use-controllable-state": "^1.0.0",
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/echo-schema": "0.7.5-main.499c70c",
57
- "@dxos/lit-grid": "0.7.5-main.499c70c",
58
- "@dxos/context": "0.7.5-main.499c70c",
59
- "@dxos/debug": "0.7.5-main.499c70c",
60
- "@dxos/keys": "0.7.5-main.499c70c",
61
- "@dxos/invariant": "0.7.5-main.499c70c",
62
- "@dxos/log": "0.7.5-main.499c70c",
63
- "@dxos/live-object": "0.7.5-main.499c70c",
64
- "@dxos/plugin-search": "0.7.5-main.499c70c",
65
- "@dxos/plugin-space": "0.7.5-main.499c70c",
66
- "@dxos/react-client": "0.7.5-main.499c70c",
67
- "@dxos/react-ui-form": "0.7.5-main.499c70c",
68
- "@dxos/react-ui-grid": "0.7.5-main.499c70c",
69
- "@dxos/react-ui-searchlist": "0.7.5-main.499c70c",
70
- "@dxos/react-ui-attention": "0.7.5-main.499c70c",
71
- "@dxos/react-ui-syntax-highlighter": "0.7.5-main.499c70c",
72
- "@dxos/react-ui-stack": "0.7.5-main.499c70c",
73
- "@dxos/react-ui-types": "0.7.5-main.499c70c",
74
- "@dxos/util": "0.7.5-main.499c70c",
75
- "@dxos/schema": "0.7.5-main.499c70c"
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.499c70c",
87
- "@dxos/random": "0.7.5-main.499c70c",
88
- "@dxos/react-ui-theme": "0.7.5-main.499c70c",
89
- "@dxos/react-ui": "0.7.5-main.499c70c",
90
- "@dxos/storybook-utils": "0.7.5-main.499c70c",
91
- "@dxos/test-utils": "0.7.5-main.499c70c"
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.499c70c",
98
- "@dxos/react-ui": "0.7.5-main.499c70c"
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"
@@ -15,7 +15,7 @@ import { schemaToColumnDefs } from './column-utils';
15
15
  import { Table } from '../components';
16
16
 
17
17
  export default {
18
- title: 'ui/react-ui-table/Schema',
18
+ title: 'ui/react-ui-table/deprecated/Schema',
19
19
  decorators: [withTheme, withLayout()],
20
20
  };
21
21
 
@@ -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
- // TODO(burdon): Factor out.
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: S.Schema<any> | undefined = space.db.schemaRegistry.getSchema(state.typename)?.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 StoryObj, type Meta } from '@storybook/react';
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 { Toolbar } from '../Toolbar';
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 [schema, setSchema] = useState<EchoSchema>();
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
- <Toolbar.Root classNames='border-b border-separator' onAction={handleAction}>
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 TablePerformanceStory = (props: StoryProps) => {
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
- export const Mutations: Story = {
244
- render: TablePerformanceStory,
245
- args: {
246
- rows: 1000,
247
- updateInterval: 1,
248
- },
249
- };
250
-
251
- export const RapidInsertions: Story = {
252
- render: TablePerformanceStory,
253
- args: {
254
- rows: 0,
255
- insertInterval: 100,
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
+ // };
@@ -145,6 +145,10 @@ const TableMain = forwardRef<TableController, TableMainProps>(
145
145
  modals.showReferencePanel(data.targetId, data.schemaId);
146
146
  break;
147
147
  }
148
+ case 'sort': {
149
+ model?.sorting?.toggleSort(data.fieldId);
150
+ break;
151
+ }
148
152
  }
149
153
  return;
150
154
  }
@@ -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