@dxos/react-ui-table 0.8.1-main.ae460ac → 0.8.1-staging.31c3ee1

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 (201) hide show
  1. package/dist/lib/browser/{chunk-3FR6NHPD.mjs → chunk-YWNRUF4J.mjs} +8 -6
  2. package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +625 -225
  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-NB3SFHGA.cjs → chunk-TGG6OZ54.cjs} +10 -8
  8. package/dist/lib/node/chunk-TGG6OZ54.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +618 -220
  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-RLVVOZW5.mjs → chunk-KKLP54L3.mjs} +8 -6
  15. package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +625 -225
  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/components/Table/ColumnActionsMenu.d.ts +2 -1
  21. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
  22. package/dist/types/src/components/Table/ColumnSettings.d.ts +2 -1
  23. package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
  24. package/dist/types/src/components/Table/CreateRefPanel.d.ts +2 -1
  25. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
  26. package/dist/types/src/components/Table/DynamicTable.d.ts +24 -0
  27. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -0
  28. package/dist/types/src/components/Table/DynamicTable.stories.d.ts +10 -0
  29. package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -0
  30. package/dist/types/src/components/Table/RefPanel.d.ts +2 -1
  31. package/dist/types/src/components/Table/RefPanel.d.ts.map +1 -1
  32. package/dist/types/src/components/Table/RowActionsMenu.d.ts +2 -1
  33. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  34. package/dist/types/src/components/Table/Table.d.ts +2 -1
  35. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  36. package/dist/types/src/components/Table/Table.stories.d.ts +4 -3
  37. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  38. package/dist/types/src/components/Table/index.d.ts +1 -0
  39. package/dist/types/src/components/Table/index.d.ts.map +1 -1
  40. package/dist/types/src/components/Table/relations.stories.d.ts +9 -0
  41. package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -0
  42. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +2 -1
  43. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  44. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  45. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -1
  46. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  47. package/dist/types/src/components/testing.d.ts +14 -7
  48. package/dist/types/src/components/testing.d.ts.map +1 -1
  49. package/dist/types/src/hooks/useTableModel.d.ts +8 -9
  50. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  51. package/dist/types/src/model/index.d.ts +1 -0
  52. package/dist/types/src/model/index.d.ts.map +1 -1
  53. package/dist/types/src/model/selection-model.d.ts +6 -3
  54. package/dist/types/src/model/selection-model.d.ts.map +1 -1
  55. package/dist/types/src/model/table-model.d.ts +42 -16
  56. package/dist/types/src/model/table-model.d.ts.map +1 -1
  57. package/dist/types/src/model/table-presentation.d.ts +4 -4
  58. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  59. package/dist/types/src/model/table-sorting.d.ts +2 -2
  60. package/dist/types/src/model/table-sorting.d.ts.map +1 -1
  61. package/dist/types/src/types/table.d.ts +16 -20
  62. package/dist/types/src/types/table.d.ts.map +1 -1
  63. package/dist/types/src/util/dynamic-table.d.ts +31 -0
  64. package/dist/types/src/util/dynamic-table.d.ts.map +1 -0
  65. package/dist/types/src/util/index.d.ts +1 -0
  66. package/dist/types/src/util/index.d.ts.map +1 -1
  67. package/dist/types/src/util/table-controls.d.ts +2 -2
  68. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  69. package/dist/types/src/util/table.d.ts +5 -3
  70. package/dist/types/src/util/table.d.ts.map +1 -1
  71. package/package.json +38 -37
  72. package/src/components/Table/ColumnActionsMenu.tsx +6 -4
  73. package/src/components/Table/ColumnSettings.tsx +5 -6
  74. package/src/components/Table/CreateRefPanel.tsx +3 -3
  75. package/src/components/Table/DynamicTable.stories.tsx +155 -0
  76. package/src/components/Table/DynamicTable.tsx +104 -0
  77. package/src/components/Table/RefPanel.tsx +3 -3
  78. package/src/components/Table/RowActionsMenu.tsx +18 -3
  79. package/src/components/Table/Table.stories.tsx +170 -115
  80. package/src/components/Table/Table.tsx +71 -26
  81. package/src/components/Table/index.ts +1 -0
  82. package/src/components/Table/relations.stories.tsx +113 -0
  83. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +15 -5
  84. package/src/components/TableCellEditor/TableCellEditor.tsx +102 -4
  85. package/src/components/testing.ts +1 -1
  86. package/src/hooks/useTableModel.ts +35 -14
  87. package/src/model/index.ts +1 -0
  88. package/src/model/selection-model.ts +12 -2
  89. package/src/model/table-model.test.ts +2 -2
  90. package/src/model/table-model.ts +117 -32
  91. package/src/model/table-presentation.test.ts +2 -2
  92. package/src/model/table-presentation.ts +94 -22
  93. package/src/model/table-sorting.ts +3 -2
  94. package/src/playwright/smoke.spec.ts +2 -3
  95. package/src/types/table.ts +9 -10
  96. package/src/util/dynamic-table.ts +103 -0
  97. package/src/util/index.ts +1 -0
  98. package/src/util/table-controls.ts +4 -4
  99. package/src/util/table.ts +68 -65
  100. package/dist/lib/browser/_deprecated/index.mjs +0 -1483
  101. package/dist/lib/browser/_deprecated/index.mjs.map +0 -7
  102. package/dist/lib/browser/chunk-3FR6NHPD.mjs.map +0 -7
  103. package/dist/lib/node/_deprecated/index.cjs +0 -1511
  104. package/dist/lib/node/_deprecated/index.cjs.map +0 -7
  105. package/dist/lib/node/chunk-NB3SFHGA.cjs.map +0 -7
  106. package/dist/lib/node-esm/_deprecated/index.mjs +0 -1485
  107. package/dist/lib/node-esm/_deprecated/index.mjs.map +0 -7
  108. package/dist/lib/node-esm/chunk-RLVVOZW5.mjs.map +0 -7
  109. package/dist/types/src/_deprecated/components/Cell/Cell.d.ts +0 -12
  110. package/dist/types/src/_deprecated/components/Cell/Cell.d.ts.map +0 -1
  111. package/dist/types/src/_deprecated/components/Cell/CellCombobox.d.ts +0 -12
  112. package/dist/types/src/_deprecated/components/Cell/CellCombobox.d.ts.map +0 -1
  113. package/dist/types/src/_deprecated/components/Cell/index.d.ts +0 -2
  114. package/dist/types/src/_deprecated/components/Cell/index.d.ts.map +0 -1
  115. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.d.ts +0 -22
  116. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.d.ts.map +0 -1
  117. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.stories.d.ts +0 -35
  118. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnMenu.stories.d.ts.map +0 -1
  119. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.d.ts +0 -14
  120. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.d.ts.map +0 -1
  121. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.stories.d.ts +0 -83
  122. package/dist/types/src/_deprecated/components/ColumnMenu/ColumnSettings.stories.d.ts.map +0 -1
  123. package/dist/types/src/_deprecated/components/ColumnMenu/index.d.ts +0 -3
  124. package/dist/types/src/_deprecated/components/ColumnMenu/index.d.ts.map +0 -1
  125. package/dist/types/src/_deprecated/components/Table/Table.d.ts +0 -20
  126. package/dist/types/src/_deprecated/components/Table/Table.d.ts.map +0 -1
  127. package/dist/types/src/_deprecated/components/Table/Table.stories.d.ts +0 -115
  128. package/dist/types/src/_deprecated/components/Table/Table.stories.d.ts.map +0 -1
  129. package/dist/types/src/_deprecated/components/Table/TableBody.d.ts +0 -11
  130. package/dist/types/src/_deprecated/components/Table/TableBody.d.ts.map +0 -1
  131. package/dist/types/src/_deprecated/components/Table/TableContext.d.ts +0 -13
  132. package/dist/types/src/_deprecated/components/Table/TableContext.d.ts.map +0 -1
  133. package/dist/types/src/_deprecated/components/Table/TableHead.d.ts +0 -8
  134. package/dist/types/src/_deprecated/components/Table/TableHead.d.ts.map +0 -1
  135. package/dist/types/src/_deprecated/components/Table/TableRootContext.d.ts +0 -17
  136. package/dist/types/src/_deprecated/components/Table/TableRootContext.d.ts.map +0 -1
  137. package/dist/types/src/_deprecated/components/Table/index.d.ts +0 -5
  138. package/dist/types/src/_deprecated/components/Table/index.d.ts.map +0 -1
  139. package/dist/types/src/_deprecated/components/Table/props.d.ts +0 -42
  140. package/dist/types/src/_deprecated/components/Table/props.d.ts.map +0 -1
  141. package/dist/types/src/_deprecated/components/index.d.ts +0 -4
  142. package/dist/types/src/_deprecated/components/index.d.ts.map +0 -1
  143. package/dist/types/src/_deprecated/helpers.d.ts +0 -91
  144. package/dist/types/src/_deprecated/helpers.d.ts.map +0 -1
  145. package/dist/types/src/_deprecated/hooks/index.d.ts +0 -5
  146. package/dist/types/src/_deprecated/hooks/index.d.ts.map +0 -1
  147. package/dist/types/src/_deprecated/hooks/useColumnSizing.d.ts +0 -12
  148. package/dist/types/src/_deprecated/hooks/useColumnSizing.d.ts.map +0 -1
  149. package/dist/types/src/_deprecated/hooks/useColumnSorting.d.ts +0 -15
  150. package/dist/types/src/_deprecated/hooks/useColumnSorting.d.ts.map +0 -1
  151. package/dist/types/src/_deprecated/hooks/usePinLastRow.d.ts +0 -3
  152. package/dist/types/src/_deprecated/hooks/usePinLastRow.d.ts.map +0 -1
  153. package/dist/types/src/_deprecated/hooks/useRowSelection.d.ts +0 -7
  154. package/dist/types/src/_deprecated/hooks/useRowSelection.d.ts.map +0 -1
  155. package/dist/types/src/_deprecated/index.d.ts +0 -8
  156. package/dist/types/src/_deprecated/index.d.ts.map +0 -1
  157. package/dist/types/src/_deprecated/schema/Schema.stories.d.ts +0 -10
  158. package/dist/types/src/_deprecated/schema/Schema.stories.d.ts.map +0 -1
  159. package/dist/types/src/_deprecated/schema/column-utils.d.ts +0 -7
  160. package/dist/types/src/_deprecated/schema/column-utils.d.ts.map +0 -1
  161. package/dist/types/src/_deprecated/schema/index.d.ts +0 -3
  162. package/dist/types/src/_deprecated/schema/index.d.ts.map +0 -1
  163. package/dist/types/src/_deprecated/schema/types.d.ts +0 -27
  164. package/dist/types/src/_deprecated/schema/types.d.ts.map +0 -1
  165. package/dist/types/src/_deprecated/theme.d.ts +0 -29
  166. package/dist/types/src/_deprecated/theme.d.ts.map +0 -1
  167. package/dist/types/src/_deprecated/translations.d.ts +0 -21
  168. package/dist/types/src/_deprecated/translations.d.ts.map +0 -1
  169. package/dist/types/src/_deprecated/types.d.ts +0 -26
  170. package/dist/types/src/_deprecated/types.d.ts.map +0 -1
  171. package/src/_deprecated/components/Cell/Cell.tsx +0 -88
  172. package/src/_deprecated/components/Cell/CellCombobox.tsx +0 -103
  173. package/src/_deprecated/components/Cell/index.ts +0 -5
  174. package/src/_deprecated/components/ColumnMenu/ColumnMenu.stories.tsx +0 -129
  175. package/src/_deprecated/components/ColumnMenu/ColumnMenu.tsx +0 -182
  176. package/src/_deprecated/components/ColumnMenu/ColumnSettings.stories.tsx +0 -108
  177. package/src/_deprecated/components/ColumnMenu/ColumnSettings.tsx +0 -207
  178. package/src/_deprecated/components/ColumnMenu/index.ts +0 -6
  179. package/src/_deprecated/components/Table/Table.stories.tsx +0 -508
  180. package/src/_deprecated/components/Table/Table.tsx +0 -301
  181. package/src/_deprecated/components/Table/TableBody.tsx +0 -82
  182. package/src/_deprecated/components/Table/TableContext.tsx +0 -34
  183. package/src/_deprecated/components/Table/TableHead.tsx +0 -78
  184. package/src/_deprecated/components/Table/TableRootContext.ts +0 -39
  185. package/src/_deprecated/components/Table/index.ts +0 -8
  186. package/src/_deprecated/components/Table/props.ts +0 -60
  187. package/src/_deprecated/components/index.ts +0 -7
  188. package/src/_deprecated/helpers.tsx +0 -526
  189. package/src/_deprecated/hooks/index.ts +0 -8
  190. package/src/_deprecated/hooks/useColumnSizing.ts +0 -46
  191. package/src/_deprecated/hooks/useColumnSorting.ts +0 -64
  192. package/src/_deprecated/hooks/usePinLastRow.ts +0 -47
  193. package/src/_deprecated/hooks/useRowSelection.ts +0 -40
  194. package/src/_deprecated/index.ts +0 -12
  195. package/src/_deprecated/schema/Schema.stories.tsx +0 -59
  196. package/src/_deprecated/schema/column-utils.ts +0 -54
  197. package/src/_deprecated/schema/index.ts +0 -6
  198. package/src/_deprecated/schema/types.ts +0 -40
  199. package/src/_deprecated/theme.ts +0 -82
  200. package/src/_deprecated/translations.ts +0 -26
  201. package/src/_deprecated/types.ts +0 -38
@@ -1 +1 @@
1
- {"version":3,"file":"useTableModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTableModel.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,KAAK,YAAY,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CA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CAAC,EAClB,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,gBAAgB,GAAG,cAAc,GAAG,kBAAkB,CACrG,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,QAAQ,2GAS7C,mBAAmB,CAAC,CAAC,CAAC,KAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAyD3C,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './table-model';
2
2
  export * from './modal-controller';
3
3
  export * from './table-presentation';
4
+ export type { SelectionMode } from './selection-model';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/model/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/model/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,18 +1,21 @@
1
1
  import { type ReadonlySignal } from '@preact/signals-core';
2
2
  import { Resource } from '@dxos/context';
3
- import { type BaseTableRow } from './table-model';
4
- export declare class SelectionModel<T extends BaseTableRow> extends Resource {
3
+ import { type TableRow } from './table-model';
4
+ export type SelectionMode = 'single' | 'multiple';
5
+ export declare class SelectionModel<T extends TableRow> extends Resource {
5
6
  private readonly _rows;
7
+ private readonly _selectionMode;
6
8
  private readonly _onSelectionChanged?;
7
9
  private readonly _selection;
8
10
  private readonly _validSelectedIds;
9
11
  private readonly _hasSelection;
10
12
  private readonly _allSelected;
11
- constructor(_rows: ReadonlySignal<T[]>, _onSelectionChanged?: (() => void) | undefined);
13
+ constructor(_rows: ReadonlySignal<T[]>, _selectionMode: SelectionMode, _onSelectionChanged?: (() => void) | undefined);
12
14
  protected _open(): Promise<void>;
13
15
  get selection(): ReadonlySignal<Set<string>>;
14
16
  get hasSelection(): ReadonlySignal<boolean>;
15
17
  get allRowsSeleted(): ReadonlySignal<boolean>;
18
+ get selectionMode(): SelectionMode;
16
19
  getSelectedRows: () => T[];
17
20
  isRowIndexSelected: (rowIndex: number) => boolean;
18
21
  isObjectSelected: (object: T) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"selection-model.d.ts","sourceRoot":"","sources":["../../../../src/model/selection-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,qBAAa,cAAc,CAAC,CAAC,SAAS,YAAY,CAAE,SAAQ,QAAQ;IAyBhE,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAzBvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;IAE7D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAQ/B;IAEH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkE;IAEhG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAO1B;gBAGgB,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,EAC1B,mBAAmB,CAAC,GAAE,MAAM,IAAI,aAAA;cAK1B,KAAK;IAY9B,IAAW,SAAS,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAElD;IAED,IAAW,YAAY,IAAI,cAAc,CAAC,OAAO,CAAC,CAEjD;IAED,IAAW,cAAc,IAAI,cAAc,CAAC,OAAO,CAAC,CAEnD;IAEM,eAAe,QAAO,CAAC,EAAE,CAG9B;IAEK,kBAAkB,aAAc,MAAM,KAAG,OAAO,CAGrD;IAEK,gBAAgB,WAAY,CAAC,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rD;IAEK,gBAAgB,WAAY,CAAC,KAAG,OAAO,CAE5C;IAMK,0BAA0B,aAAc,MAAM,KAAG,IAAI,CAc1D;IAEK,YAAY,SAAU,KAAK,GAAG,MAAM,KAAG,IAAI,CAWhD;CACH"}
@@ -1,60 +1,85 @@
1
1
  import { type ReadonlySignal } from '@preact/signals-core';
2
+ import { type Space } from '@dxos/client/echo';
2
3
  import { Resource } from '@dxos/context';
3
4
  import { type FieldSortType, type JsonProp } from '@dxos/echo-schema';
4
5
  import { type DxGridAxisMeta, type DxGridPlanePosition, type DxGridPosition } from '@dxos/react-ui-grid';
5
- import { type ViewProjection } from '@dxos/schema';
6
- import { SelectionModel } from './selection-model';
6
+ import { type ViewType, type ViewProjection } from '@dxos/schema';
7
+ import { type SelectionMode, SelectionModel } from './selection-model';
7
8
  import { TableSorting } from './table-sorting';
8
- import { type TableType } from '../types';
9
- export type BaseTableRow = Record<JsonProp, any> & {
9
+ export type TableRow = Record<JsonProp, any> & {
10
10
  id: string;
11
11
  };
12
- export type TableModelProps<T extends BaseTableRow = {
12
+ export type TableRowAction = {
13
13
  id: string;
14
- }> = {
15
- table: TableType;
14
+ translationKey: string;
15
+ };
16
+ export type TableFeatures = {
17
+ selection: {
18
+ enabled: boolean;
19
+ mode?: SelectionMode;
20
+ };
21
+ dataEditable: boolean;
22
+ schemaEditable: boolean;
23
+ };
24
+ export type TableModelProps<T extends TableRow = TableRow> = {
25
+ id?: string;
26
+ space?: Space;
27
+ view?: ViewType;
16
28
  projection: ViewProjection;
29
+ features?: Partial<TableFeatures>;
17
30
  sorting?: FieldSortType[];
18
31
  pinnedRows?: {
19
32
  top: number[];
20
33
  bottom: number[];
21
34
  };
35
+ rowActions?: TableRowAction[];
22
36
  onInsertRow?: (index?: number) => void;
23
37
  onDeleteRows?: (index: number, obj: T[]) => void;
24
38
  onDeleteColumn?: (fieldId: string) => void;
25
39
  onCellUpdate?: (cell: DxGridPosition) => void;
26
- onRowOrderChanged?: () => void;
40
+ onRowOrderChange?: () => void;
41
+ onRowAction?: (actionId: string, data: T) => void;
27
42
  };
28
- export declare class TableModel<T extends BaseTableRow = {
29
- id: string;
30
- }> extends Resource {
31
- readonly id: string;
32
- private readonly _table;
43
+ export declare class TableModel<T extends TableRow = TableRow> extends Resource {
44
+ private readonly _id;
45
+ private readonly _space;
46
+ private readonly _view;
33
47
  private readonly _projection;
34
48
  private readonly _visibleRange;
35
49
  private readonly _onInsertRow?;
36
50
  private readonly _onDeleteRows?;
37
51
  private readonly _onDeleteColumn?;
38
52
  private readonly _onCellUpdate?;
39
- private readonly _onRowOrderChanged?;
53
+ private readonly _onRowOrderChange?;
54
+ private readonly _onRowAction?;
55
+ private readonly _rowActions;
56
+ private readonly _features;
40
57
  private readonly _rows;
41
58
  private readonly _sorting;
42
59
  private _pinnedRows;
43
60
  private _selection;
44
61
  private _columnMeta?;
45
- constructor({ table, projection, sorting, pinnedRows, onCellUpdate, onDeleteColumn, onDeleteRows, onInsertRow, onRowOrderChanged, }: TableModelProps<T>);
46
- get table(): TableType;
62
+ constructor({ id, space, view, projection, features, sorting, pinnedRows, rowActions, onCellUpdate, onDeleteColumn, onDeleteRows, onInsertRow, onRowOrderChange, onRowAction, }: TableModelProps<T>);
63
+ get id(): string | undefined;
64
+ get space(): Space | undefined;
65
+ get view(): ViewType | undefined;
47
66
  get projection(): ViewProjection;
48
67
  get rows(): ReadonlySignal<T[]>;
68
+ get features(): TableFeatures;
49
69
  /**
50
70
  * @reactive
51
71
  */
52
72
  get sorting(): TableSorting<T> | undefined;
73
+ /**
74
+ * Gets the row data at the specified display index.
75
+ */
76
+ getRowAt(displayIndex: number): T | undefined;
53
77
  get pinnedRows(): NonNullable<TableModelProps<T>['pinnedRows']>;
54
78
  get columnMeta(): ReadonlySignal<DxGridAxisMeta>;
55
79
  get selection(): SelectionModel<T>;
56
80
  /** @reactive */
57
81
  get isViewDirty(): boolean;
82
+ get rowActions(): TableRowAction[];
58
83
  protected _open(): Promise<void>;
59
84
  private initializeColumnMeta;
60
85
  private initializeEffects;
@@ -63,6 +88,7 @@ export declare class TableModel<T extends BaseTableRow = {
63
88
  getColumnCount: () => number;
64
89
  insertRow: (rowIndex?: number) => void;
65
90
  deleteRow: (rowIndex: number) => void;
91
+ handleRowAction: (actionId: string, rowIndex: number) => void;
66
92
  getCellData: ({ col, row }: DxGridPlanePosition) => any;
67
93
  setCellData: ({ col, row }: DxGridPlanePosition, value: any) => void;
68
94
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"table-model.d.ts","sourceRoot":"","sources":["../../../../src/model/table-model.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,aAAa,EAAkC,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAKtG,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI;IACrE,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,EA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ExC;cAMwB,KAAK;IAS9B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,iBAAiB;IAkClB,OAAO,QAAS,CAAC,EAAE,KAAG,IAAI,CAE/B;IAEK,WAAW,QAAO,MAAM,CAA4B;IAEpD,cAAc,QAAO,MAAM,CAAmC;IAE9D,SAAS,cAAe,MAAM,KAAG,IAAI,CAG1C;IAEK,SAAS,aAAc,MAAM,KAAG,IAAI,CAazC;IAEK,eAAe,aAAc,MAAM,YAAY,MAAM,KAAG,IAAI,CAWjE;IAEK,WAAW,iBAAkB,mBAAmB,KAAG,GAAG,CA2B3D;IAEK,WAAW,iBAAkB,mBAAmB,SAAS,GAAG,KAAG,IAAI,CAgCxE;IAEF;;;;OAIG;IACI,cAAc,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI;IAcpF,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAenC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAgBxD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI;IAItD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQhC,QAAQ,IAAI,IAAI;CAGxB"}
@@ -1,13 +1,12 @@
1
1
  import { type DxGridPlane, type DxGridPlaneCells, type DxGridPlaneRange } from '@dxos/react-ui-grid';
2
- import { type BaseTableRow, type TableModel } from './table-model';
2
+ import { type SelectionMode } from './selection-model';
3
+ import { type TableRow, type TableModel } from './table-model';
3
4
  /**
4
5
  * Presentation layer for a table component, handling cell rendering and grid display logic.
5
6
  * Manages rendering of table cells, headers, selection columns, and action columns across
6
7
  * different grid planes.
7
8
  */
8
- export declare class TablePresentation<T extends BaseTableRow = {
9
- id: string;
10
- }> {
9
+ export declare class TablePresentation<T extends TableRow = TableRow> {
11
10
  private readonly model;
12
11
  private readonly _visibleRange;
13
12
  constructor(model: TableModel<T>, _visibleRange?: import("@preact/signals-core").Signal<DxGridPlaneRange>);
@@ -19,4 +18,5 @@ export declare class TablePresentation<T extends BaseTableRow = {
19
18
  private getSelectAllCell;
20
19
  private getNewColumnCell;
21
20
  }
21
+ export declare const cellClassesForRowSelection: (selected: boolean, selectionMode: SelectionMode) => string[] | undefined;
22
22
  //# sourceMappingURL=table-presentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table-presentation.d.ts","sourceRoot":"","sources":["../../../../src/model/table-presentation.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAGnE;;;;GAIG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;IAElE,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,aAAa,0DAG5B;IAGG,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,GAAG,gBAAgB;IAoB9E,OAAO,CAAC,gBAAgB;IAgGxB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,gBAAgB;CAYzB"}
1
+ {"version":3,"file":"table-presentation.d.ts","sourceRoot":"","sources":["../../../../src/model/table-presentation.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAGtB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG/D;;;;GAIG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAExD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,aAAa,0DAG5B;IAGG,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,GAAG,gBAAgB;IAoC9E,OAAO,CAAC,gBAAgB;IAyHxB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,gBAAgB;CAczB;AAED,eAAO,MAAM,0BAA0B,aAAc,OAAO,iBAAiB,aAAa,yBAgBzF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { type Signal, type ReadonlySignal } from '@preact/signals-core';
2
2
  import { type SortDirectionType, type FieldSortType } from '@dxos/echo-schema';
3
3
  import type { ViewProjection, ViewType } from '@dxos/schema';
4
- import { type BaseTableRow } from './table-model';
4
+ import { type TableRow } from './table-model';
5
5
  /**
6
6
  * Manages table sorting functionality through display and data index mapping.
7
7
  *
@@ -23,7 +23,7 @@ import { type BaseTableRow } from './table-model';
23
23
  * │ 2: "Cherry" │ => │ 2: "Cherry" │ => │ 2 => 2 │
24
24
  * └──────────────┘ └──────────────┘ └────────┘
25
25
  */
26
- export declare class TableSorting<T extends BaseTableRow> {
26
+ export declare class TableSorting<T extends TableRow> {
27
27
  private readonly _view;
28
28
  private readonly _projection;
29
29
  private readonly _displayToDataIndex;
@@ -1 +1 @@
1
- {"version":3,"file":"table-sorting.d.ts","sourceRo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CAAC,oBAAoB;IAkC5B,OAAO,CAAC,YAAY;CAsCrB"}
@@ -1,4 +1,4 @@
1
- import { S, Expando } from '@dxos/echo-schema';
1
+ import { Expando, S } 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>;
@@ -13,14 +13,21 @@ export declare const TableSchema: S.Struct<{
13
13
  size: S.optional<typeof S.Number>;
14
14
  referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
15
15
  }>>>>;
16
+ hiddenFields: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
17
+ id: typeof S.String;
18
+ path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
19
+ visible: S.optional<typeof S.Boolean>;
20
+ size: S.optional<typeof S.Number>;
21
+ referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
22
+ }>>>>>;
16
23
  metadata: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
17
24
  }, import("@dxos/echo-schema").TypedObjectOptions>>>;
18
25
  threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
19
26
  }>;
20
- declare const TableType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
21
- readonly id: import("@dxos/echo-schema").ObjectIdClass;
22
- readonly name: S.optional<typeof S.String>;
23
- readonly view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
27
+ export declare const TableType: import("@dxos/echo-schema").EchoObjectSchema<S.Struct<{
28
+ id: import("@dxos/echo-schema").ObjectIdClass;
29
+ name: S.optional<typeof S.String>;
30
+ view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
24
31
  name: S.SchemaClass<string, string, never>;
25
32
  query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
26
33
  schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
@@ -31,28 +38,17 @@ declare const TableType_base: import("@dxos/echo-schema").TypedObjectPrototype<i
31
38
  size: S.optional<typeof S.Number>;
32
39
  referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
33
40
  }>>>>;
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<{
38
- readonly id: import("@dxos/echo-schema").ObjectIdClass;
39
- readonly name: S.optional<typeof S.String>;
40
- readonly view: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").TypedObjectFields<{
41
- name: S.SchemaClass<string, string, never>;
42
- query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
43
- schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
44
- fields: S.mutable<S.Array$<S.mutable<S.Struct<{
41
+ hiddenFields: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
45
42
  id: typeof S.String;
46
43
  path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
47
44
  visible: S.optional<typeof S.Boolean>;
48
45
  size: S.optional<typeof S.Number>;
49
46
  referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
50
- }>>>>;
47
+ }>>>>>;
51
48
  metadata: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
52
49
  }, import("@dxos/echo-schema").TypedObjectOptions>>>;
53
- readonly threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
50
+ threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<Expando>>>;
54
51
  }>>;
55
- export declare class TableType extends TableType_base {
52
+ export interface TableType extends S.Schema.Type<typeof TableType> {
56
53
  }
57
- export {};
58
54
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
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;;;;cAUa,EAAG,WAClC;eAGmK,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;;;EARh4B,CAAC;;;;;cAIkC,EAAG,WAClC;eAGmK,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;;;;;;;cAJ71B,EAAG,WAClC;eA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AG,MAAM,SAAQ,EAAG,GAAG;;;EAJ38C,CAAC;AAEH,eAAO,MAAM,SAAS;;;;cACgB,EAAG,WAAW;eAC8K,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;;sBAAyQ,EAAG,QAAQ,CAAC,EAAE,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;;kBAAgH,EAAG,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,QAAO,EAAG,MAAM,SAAQ,EAAG,GAAG;;;GAFj2C,CAAC;AAC7G,MAAM,WAAW,SAAU,SAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG"}
@@ -0,0 +1,31 @@
1
+ import type { BaseSchema, JsonSchemaType, SortDirectionType } from '@dxos/echo-schema';
2
+ import { ViewProjection, type SchemaPropertyDefinition } from '@dxos/schema';
3
+ import { TableType } from '../types';
4
+ type PropertyDisplayProps = {
5
+ size: number;
6
+ title: string;
7
+ sort: SortDirectionType;
8
+ };
9
+ export type TablePropertyDefinition = SchemaPropertyDefinition & Partial<PropertyDisplayProps>;
10
+ /**
11
+ * @deprecated
12
+ */
13
+ export declare const getBaseSchems: ({ typename, properties, jsonSchema, schema, }: {
14
+ typename?: string;
15
+ properties?: TablePropertyDefinition[];
16
+ jsonSchema?: JsonSchemaType;
17
+ schema?: BaseSchema;
18
+ }) => {
19
+ typename: string;
20
+ jsonSchema: JsonSchemaType;
21
+ };
22
+ export declare const makeDynamicTable: ({ typename, jsonSchema, properties, }: {
23
+ typename: string;
24
+ jsonSchema: JsonSchemaType;
25
+ properties?: TablePropertyDefinition[];
26
+ }) => {
27
+ table: TableType;
28
+ projection: ViewProjection;
29
+ };
30
+ export {};
31
+ //# sourceMappingURL=dynamic-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../../../../src/util/dynamic-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvF,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,kDAKvB;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,KAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAWjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,0CAI1B;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,3 +1,4 @@
1
+ export * from './dynamic-table';
1
2
  export * from './signals';
2
3
  export * from './table';
3
4
  export * from './table-buttons';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,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"}
@@ -22,8 +22,8 @@ export declare const CONTROL_IDENTIFIERS: {
22
22
  readonly checkbox: "data-table-checkbox";
23
23
  readonly switch: "data-table-switch";
24
24
  };
25
- export declare const renderCheckbox: ({ rowIndex, header, checked, disabled, }: RenderCheckboxProps) => string;
26
- export declare const renderSwitch: ({ colIndex, rowIndex, checked, disabled }: RenderSwitchProps) => string;
25
+ export declare const CheckboxStory: ({ rowIndex, header, checked, disabled, }: RenderCheckboxProps) => string;
26
+ export declare const SwitchStory: ({ colIndex, rowIndex, checked, disabled }: RenderSwitchProps) => string;
27
27
  export declare const tableControls: {
28
28
  readonly checkbox: {
29
29
  readonly attr: "data-table-checkbox";
@@ -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;IAA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AC;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,6CAKvB,mBAAmB,KAAG,MAQxB,CAAC;AAEF,eAAO,MAAM,WAAW,8CAA+D,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,12 +1,14 @@
1
- import { type EchoSchema } from '@dxos/echo-schema';
1
+ import { S } from '@dxos/echo-schema';
2
+ import { type Client } from '@dxos/react-client';
2
3
  import { type Space } from '@dxos/react-client/echo';
3
4
  import { type TableType } from '../types';
4
5
  type InitialiseTableProps = {
6
+ client: Client;
5
7
  space: Space;
6
8
  table: TableType;
9
+ typename?: string;
7
10
  initialRow?: boolean;
8
- initialSchema?: string;
9
11
  };
10
- export declare const initializeTable: ({ space, table, initialRow, initialSchema, }: InitialiseTableProps) => Promise<EchoSchema>;
12
+ export declare const initializeTable: ({ client, space, table, typename, initialRow, }: InitialiseTableProps) => Promise<S.Schema.AnyNoContext>;
11
13
  export {};
12
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,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
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAOL,CAAC,EAGF,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGtE,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,oDAMzB,oBAAoB,KAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CA8CtD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-table",
3
- "version": "0.8.1-main.ae460ac",
3
+ "version": "0.8.1-staging.31c3ee1",
4
4
  "description": "A table component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,9 +10,9 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  "./deprecated": {
13
- "types": "./dist/types/src/_deprecated/index.d.ts",
14
- "browser": "./dist/lib/browser/_deprecated/index.mjs",
15
- "node": "./dist/lib/node-esm/_deprecated/index.mjs"
13
+ "types": "./dist/types/src/deprecated/index.d.ts",
14
+ "browser": "./dist/lib/browser/deprecated/index.mjs",
15
+ "node": "./dist/lib/node-esm/deprecated/index.mjs"
16
16
  },
17
17
  ".": {
18
18
  "types": "./dist/types/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "typesVersions": {
30
30
  "*": {
31
31
  "deprecated": [
32
- "dist/types/src/_deprecated/index.d.ts"
32
+ "dist/types/src/deprecated/index.d.ts"
33
33
  ],
34
34
  "types": [
35
35
  "dist/types/src/types/index.d.ts"
@@ -44,37 +44,38 @@
44
44
  "@codemirror/autocomplete": "^6.18.1",
45
45
  "@codemirror/state": "^6.4.1",
46
46
  "@codemirror/view": "^6.34.1",
47
- "@fluentui/react-tabster": "9.23.3",
47
+ "@fluentui/react-tabster": "^9.24.2",
48
48
  "@preact/signals-core": "^1.6.0",
49
49
  "@radix-ui/react-context": "1.1.1",
50
50
  "@radix-ui/react-primitive": "2.0.2",
51
51
  "@radix-ui/react-slot": "1.1.2",
52
52
  "@radix-ui/react-use-controllable-state": "1.1.0",
53
- "@tanstack/react-table": "^8.13.2",
54
- "@tanstack/react-virtual": "^3.9.0",
55
53
  "date-fns": "^3.3.1",
56
54
  "lodash.orderby": "^4.6.0",
57
- "@dxos/context": "0.8.1-main.ae460ac",
58
- "@dxos/echo-schema": "0.8.1-main.ae460ac",
59
- "@dxos/invariant": "0.8.1-main.ae460ac",
60
- "@dxos/keys": "0.8.1-main.ae460ac",
61
- "@dxos/lit-grid": "0.8.1-main.ae460ac",
62
- "@dxos/live-object": "0.8.1-main.ae460ac",
63
- "@dxos/debug": "0.8.1-main.ae460ac",
64
- "@dxos/log": "0.8.1-main.ae460ac",
65
- "@dxos/plugin-search": "0.8.1-main.ae460ac",
66
- "@dxos/plugin-space": "0.8.1-main.ae460ac",
67
- "@dxos/react-client": "0.8.1-main.ae460ac",
68
- "@dxos/react-ui-form": "0.8.1-main.ae460ac",
69
- "@dxos/react-ui-grid": "0.8.1-main.ae460ac",
70
- "@dxos/react-ui-menu": "0.8.1-main.ae460ac",
71
- "@dxos/react-ui-attention": "0.8.1-main.ae460ac",
72
- "@dxos/react-ui-stack": "0.8.1-main.ae460ac",
73
- "@dxos/react-ui-searchlist": "0.8.1-main.ae460ac",
74
- "@dxos/react-ui-syntax-highlighter": "0.8.1-main.ae460ac",
75
- "@dxos/schema": "0.8.1-main.ae460ac",
76
- "@dxos/util": "0.8.1-main.ae460ac",
77
- "@dxos/react-ui-types": "0.8.1-main.ae460ac"
55
+ "@dxos/context": "0.8.1-staging.31c3ee1",
56
+ "@dxos/debug": "0.8.1-staging.31c3ee1",
57
+ "@dxos/echo-schema": "0.8.1-staging.31c3ee1",
58
+ "@dxos/effect": "0.8.1-staging.31c3ee1",
59
+ "@dxos/invariant": "0.8.1-staging.31c3ee1",
60
+ "@dxos/keys": "0.8.1-staging.31c3ee1",
61
+ "@dxos/live-object": "0.8.1-staging.31c3ee1",
62
+ "@dxos/log": "0.8.1-staging.31c3ee1",
63
+ "@dxos/lit-grid": "0.8.1-staging.31c3ee1",
64
+ "@dxos/plugin-search": "0.8.1-staging.31c3ee1",
65
+ "@dxos/plugin-space": "0.8.1-staging.31c3ee1",
66
+ "@dxos/react-client": "0.8.1-staging.31c3ee1",
67
+ "@dxos/react-ui-attention": "0.8.1-staging.31c3ee1",
68
+ "@dxos/react-ui-editor": "0.8.1-staging.31c3ee1",
69
+ "@dxos/react-ui-form": "0.8.1-staging.31c3ee1",
70
+ "@dxos/react-ui-grid": "0.8.1-staging.31c3ee1",
71
+ "@dxos/react-ui-menu": "0.8.1-staging.31c3ee1",
72
+ "@dxos/react-ui-searchlist": "0.8.1-staging.31c3ee1",
73
+ "@dxos/react-ui-stack": "0.8.1-staging.31c3ee1",
74
+ "@dxos/react-ui-tag-picker": "0.8.1-staging.31c3ee1",
75
+ "@dxos/react-ui-types": "0.8.1-staging.31c3ee1",
76
+ "@dxos/react-ui-syntax-highlighter": "0.8.1-staging.31c3ee1",
77
+ "@dxos/util": "0.8.1-staging.31c3ee1",
78
+ "@dxos/schema": "0.8.1-staging.31c3ee1"
78
79
  },
79
80
  "devDependencies": {
80
81
  "@phosphor-icons/react": "^2.1.5",
@@ -85,19 +86,19 @@
85
86
  "react": "~18.2.0",
86
87
  "react-dom": "~18.2.0",
87
88
  "vite": "5.4.7",
88
- "@dxos/echo-signals": "0.8.1-main.ae460ac",
89
- "@dxos/react-ui": "0.8.1-main.ae460ac",
90
- "@dxos/react-ui-theme": "0.8.1-main.ae460ac",
91
- "@dxos/random": "0.8.1-main.ae460ac",
92
- "@dxos/test-utils": "0.8.1-main.ae460ac",
93
- "@dxos/storybook-utils": "0.8.1-main.ae460ac"
89
+ "@dxos/echo-signals": "0.8.1-staging.31c3ee1",
90
+ "@dxos/react-ui": "0.8.1-staging.31c3ee1",
91
+ "@dxos/react-ui-theme": "0.8.1-staging.31c3ee1",
92
+ "@dxos/storybook-utils": "0.8.1-staging.31c3ee1",
93
+ "@dxos/test-utils": "0.8.1-staging.31c3ee1",
94
+ "@dxos/random": "0.8.1-staging.31c3ee1"
94
95
  },
95
96
  "peerDependencies": {
96
97
  "@phosphor-icons/react": "^2.1.5",
97
98
  "react": "~18.2.0",
98
99
  "react-dom": "~18.2.0",
99
- "@dxos/react-ui": "0.8.1-main.ae460ac",
100
- "@dxos/react-ui-theme": "0.8.1-main.ae460ac"
100
+ "@dxos/react-ui": "0.8.1-staging.31c3ee1",
101
+ "@dxos/react-ui-theme": "0.8.1-staging.31c3ee1"
101
102
  },
102
103
  "publishConfig": {
103
104
  "access": "public"
@@ -48,14 +48,16 @@ export const ColumnActionsMenu = ({ model, modals }: ColumnActionsMenuProps) =>
48
48
  {t('column action clear sorting')}
49
49
  </DropdownMenu.Item>
50
50
  )}
51
- {model.getColumnCount() > 1 && (
51
+ {model.getColumnCount() > 1 && model.features.schemaEditable && (
52
52
  <DropdownMenu.Item data-testid='column-delete' onClick={() => model.deleteColumn(state.fieldId)}>
53
53
  {t('column action delete')}
54
54
  </DropdownMenu.Item>
55
55
  )}
56
- <DropdownMenu.Item data-testid='column-settings' onClick={() => modals.openColumnSettings()}>
57
- {t('column action settings')}
58
- </DropdownMenu.Item>
56
+ {model.features.schemaEditable && (
57
+ <DropdownMenu.Item data-testid='column-settings' onClick={() => modals.openColumnSettings()}>
58
+ {t('column action settings')}
59
+ </DropdownMenu.Item>
60
+ )}
59
61
  </DropdownMenu.Viewport>
60
62
  <DropdownMenu.Arrow />
61
63
  </DropdownMenu.Content>
@@ -4,7 +4,6 @@
4
4
 
5
5
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
6
6
 
7
- import { getSpace } from '@dxos/react-client/echo';
8
7
  import { DropdownMenu } from '@dxos/react-ui';
9
8
  import { FieldEditor } from '@dxos/react-ui-form';
10
9
  import { type FieldType } from '@dxos/schema';
@@ -17,7 +16,7 @@ export const ColumnSettings = ({ model, modals, onNewColumn }: ColumnSettingsPro
17
16
  const [newField, setNewField] = useState<FieldType>();
18
17
  const state = modals.state.value;
19
18
 
20
- const space = getSpace(model?.table);
19
+ const space = model?.space;
21
20
 
22
21
  useEffect(() => {
23
22
  if (state?.type === 'columnSettings' && state.mode.type === 'create' && model?.projection) {
@@ -34,11 +33,11 @@ export const ColumnSettings = ({ model, modals, onNewColumn }: ColumnSettingsPro
34
33
  if (state?.type === 'columnSettings') {
35
34
  const { mode } = state;
36
35
  if (mode.type === 'edit') {
37
- return model?.table?.view?.target?.fields.find((f) => f.id === mode.fieldId);
36
+ return model?.view?.fields.find((f) => f.id === mode.fieldId);
38
37
  }
39
38
  }
40
39
  return undefined;
41
- }, [model?.table?.view?.target?.fields, state]);
40
+ }, [model?.view?.fields, state]);
42
41
 
43
42
  const field = existingField ?? newField;
44
43
 
@@ -52,7 +51,7 @@ export const ColumnSettings = ({ model, modals, onNewColumn }: ColumnSettingsPro
52
51
  }
53
52
  }, [model?.projection, state, newField]);
54
53
 
55
- if (!model?.table?.view?.target || !model.projection || !field) {
54
+ if (!model?.view || !model.projection || !field) {
56
55
  return null;
57
56
  }
58
57
 
@@ -63,7 +62,7 @@ export const ColumnSettings = ({ model, modals, onNewColumn }: ColumnSettingsPro
63
62
  <DropdownMenu.Content classNames='md:is-64'>
64
63
  <DropdownMenu.Viewport>
65
64
  <FieldEditor
66
- view={model.table.view.target!}
65
+ view={model.view!}
67
66
  projection={model.projection}
68
67
  field={field}
69
68
  registry={space?.db.schemaRegistry}