@dxos/react-ui-table 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5

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 (172) hide show
  1. package/dist/lib/browser/chunk-BF54SSNL.mjs +70 -0
  2. package/dist/lib/browser/chunk-BF54SSNL.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-F7Y374KL.mjs +1751 -0
  4. package/dist/lib/browser/chunk-F7Y374KL.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +1195 -2846
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/testing/index.mjs +114 -0
  9. package/dist/lib/browser/testing/index.mjs.map +7 -0
  10. package/dist/lib/browser/types/index.mjs +3 -5
  11. package/dist/lib/node-esm/chunk-CCJ4LOVM.mjs +1753 -0
  12. package/dist/lib/node-esm/chunk-CCJ4LOVM.mjs.map +7 -0
  13. package/dist/lib/node-esm/chunk-SIRDIPHZ.mjs +71 -0
  14. package/dist/lib/node-esm/chunk-SIRDIPHZ.mjs.map +7 -0
  15. package/dist/lib/node-esm/index.mjs +1195 -2846
  16. package/dist/lib/node-esm/index.mjs.map +4 -4
  17. package/dist/lib/node-esm/meta.json +1 -1
  18. package/dist/lib/node-esm/testing/index.mjs +115 -0
  19. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  20. package/dist/lib/node-esm/types/index.mjs +3 -5
  21. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +2 -3
  22. package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
  23. package/dist/types/src/components/Table/ColumnSettings.d.ts +4 -2
  24. package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
  25. package/dist/types/src/components/Table/DynamicTable.d.ts +7 -7
  26. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
  27. package/dist/types/src/components/Table/DynamicTable.stories.d.ts +35 -3
  28. package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Table/Relations.stories.d.ts +110 -0
  30. package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -0
  31. package/dist/types/src/components/Table/RowActionsMenu.d.ts +1 -1
  32. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  33. package/dist/types/src/components/Table/Table.d.ts +21 -18
  34. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  35. package/dist/types/src/components/Table/Table.stories.d.ts +109 -6
  36. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/Table/TableContent.d.ts +17 -0
  38. package/dist/types/src/components/Table/TableContent.d.ts.map +1 -0
  39. package/dist/types/src/components/Table/TableToolbar.d.ts +21 -0
  40. package/dist/types/src/components/Table/TableToolbar.d.ts.map +1 -0
  41. package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts +1 -1
  42. package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
  43. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +14 -9
  44. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
  45. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +12 -18
  46. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  47. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +38 -5
  48. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  49. package/dist/types/src/components/TableCellEditor/index.d.ts +1 -0
  50. package/dist/types/src/components/TableCellEditor/index.d.ts.map +1 -1
  51. package/dist/types/src/components/index.d.ts +0 -1
  52. package/dist/types/src/components/index.d.ts.map +1 -1
  53. package/dist/types/src/components/testing.d.ts +26 -56
  54. package/dist/types/src/components/testing.d.ts.map +1 -1
  55. package/dist/types/src/hooks/index.d.ts +2 -1
  56. package/dist/types/src/hooks/index.d.ts.map +1 -1
  57. package/dist/types/src/hooks/useAddRow.d.ts +6 -6
  58. package/dist/types/src/hooks/useAddRow.d.ts.map +1 -1
  59. package/dist/types/src/hooks/useProjectionModel.d.ts +6 -0
  60. package/dist/types/src/hooks/useProjectionModel.d.ts.map +1 -0
  61. package/dist/types/src/hooks/useTableModel.d.ts +11 -10
  62. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  63. package/dist/types/src/index.d.ts +0 -1
  64. package/dist/types/src/index.d.ts.map +1 -1
  65. package/dist/types/src/model/modal-controller.d.ts +5 -8
  66. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  67. package/dist/types/src/model/selection-model.d.ts +17 -7
  68. package/dist/types/src/model/selection-model.d.ts.map +1 -1
  69. package/dist/types/src/model/table-model.d.ts +116 -34
  70. package/dist/types/src/model/table-model.d.ts.map +1 -1
  71. package/dist/types/src/model/table-presentation.d.ts +5 -2
  72. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  73. package/dist/types/src/playwright/TableManager.d.ts +2 -1
  74. package/dist/types/src/playwright/TableManager.d.ts.map +1 -1
  75. package/dist/types/src/testing/index.d.ts +2 -0
  76. package/dist/types/src/testing/index.d.ts.map +1 -0
  77. package/dist/types/src/testing/useTestTableModel.d.ts +25 -0
  78. package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -0
  79. package/dist/types/src/translations.d.ts +21 -23
  80. package/dist/types/src/translations.d.ts.map +1 -1
  81. package/dist/types/src/types/Table.d.ts +26 -0
  82. package/dist/types/src/types/Table.d.ts.map +1 -0
  83. package/dist/types/src/types/index.d.ts +1 -1
  84. package/dist/types/src/types/index.d.ts.map +1 -1
  85. package/dist/types/src/util/dynamic-table.d.ts +15 -14
  86. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  87. package/dist/types/src/util/dynamic-table.test.d.ts +2 -0
  88. package/dist/types/src/util/dynamic-table.test.d.ts.map +1 -0
  89. package/dist/types/src/util/index.d.ts +2 -1
  90. package/dist/types/src/util/index.d.ts.map +1 -1
  91. package/dist/types/src/util/query-ast.d.ts +7 -0
  92. package/dist/types/src/util/query-ast.d.ts.map +1 -0
  93. package/dist/types/src/util/schema.d.ts +1 -1
  94. package/dist/types/src/util/schema.d.ts.map +1 -1
  95. package/dist/types/src/util/sort.d.ts +12 -0
  96. package/dist/types/src/util/sort.d.ts.map +1 -0
  97. package/dist/types/src/util/table-buttons.d.ts.map +1 -1
  98. package/dist/types/src/util/table-controls.d.ts.map +1 -1
  99. package/dist/types/tsconfig.tsbuildinfo +1 -1
  100. package/package.json +70 -55
  101. package/src/components/Table/ColumnActionsMenu.tsx +16 -12
  102. package/src/components/Table/ColumnSettings.tsx +18 -15
  103. package/src/components/Table/DynamicTable.stories.tsx +38 -35
  104. package/src/components/Table/DynamicTable.tsx +38 -34
  105. package/src/components/Table/Relations.stories.tsx +245 -0
  106. package/src/components/Table/RowActionsMenu.tsx +26 -17
  107. package/src/components/Table/Table.stories.tsx +196 -218
  108. package/src/components/Table/Table.tsx +47 -376
  109. package/src/components/Table/TableContent.tsx +421 -0
  110. package/src/components/Table/TableToolbar.tsx +111 -0
  111. package/src/components/TableCellEditor/CellValidationMessage.tsx +6 -6
  112. package/src/components/TableCellEditor/FormCellEditor.tsx +152 -49
  113. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +37 -77
  114. package/src/components/TableCellEditor/TableCellEditor.tsx +104 -233
  115. package/src/components/TableCellEditor/index.ts +1 -0
  116. package/src/components/index.ts +0 -1
  117. package/src/components/testing.ts +46 -37
  118. package/src/hooks/index.ts +2 -1
  119. package/src/hooks/useAddRow.ts +14 -14
  120. package/src/hooks/useProjectionModel.ts +39 -0
  121. package/src/hooks/useTableModel.ts +41 -35
  122. package/src/index.ts +0 -1
  123. package/src/model/modal-controller.ts +24 -41
  124. package/src/model/selection-model.ts +75 -41
  125. package/src/model/table-model.test.ts +91 -56
  126. package/src/model/table-model.ts +468 -187
  127. package/src/model/table-presentation.test.ts +69 -59
  128. package/src/model/table-presentation.ts +112 -66
  129. package/src/playwright/TableManager.ts +13 -6
  130. package/src/playwright/playwright.config.ts +1 -1
  131. package/src/playwright/smoke.spec.ts +180 -43
  132. package/src/testing/index.ts +5 -0
  133. package/src/testing/useTestTableModel.ts +133 -0
  134. package/src/translations.ts +20 -22
  135. package/src/types/Table.ts +79 -0
  136. package/src/types/index.ts +2 -2
  137. package/src/util/dynamic-table.test.ts +70 -0
  138. package/src/util/dynamic-table.ts +51 -36
  139. package/src/util/index.ts +2 -1
  140. package/src/util/query-ast.ts +22 -0
  141. package/src/util/schema.ts +4 -4
  142. package/src/util/sort.ts +90 -0
  143. package/src/util/table-buttons.ts +4 -3
  144. package/src/util/table-controls.ts +6 -3
  145. package/dist/lib/browser/chunk-Q5QQXJUO.mjs +0 -27
  146. package/dist/lib/browser/chunk-Q5QQXJUO.mjs.map +0 -7
  147. package/dist/lib/node-esm/chunk-ZNOU6LHG.mjs +0 -29
  148. package/dist/lib/node-esm/chunk-ZNOU6LHG.mjs.map +0 -7
  149. package/dist/types/src/components/Table/CreateRefPanel.d.ts +0 -9
  150. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +0 -1
  151. package/dist/types/src/components/Table/relations.stories.d.ts +0 -9
  152. package/dist/types/src/components/Table/relations.stories.d.ts.map +0 -1
  153. package/dist/types/src/components/TableCellEditor/extension.d.ts +0 -13
  154. package/dist/types/src/components/TableCellEditor/extension.d.ts.map +0 -1
  155. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +0 -21
  156. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +0 -1
  157. package/dist/types/src/components/TableToolbar/index.d.ts +0 -2
  158. package/dist/types/src/components/TableToolbar/index.d.ts.map +0 -1
  159. package/dist/types/src/model/table-sorting.d.ts +0 -53
  160. package/dist/types/src/model/table-sorting.d.ts.map +0 -1
  161. package/dist/types/src/types/table.d.ts +0 -56
  162. package/dist/types/src/types/table.d.ts.map +0 -1
  163. package/dist/types/src/util/table.d.ts +0 -14
  164. package/dist/types/src/util/table.d.ts.map +0 -1
  165. package/src/components/Table/CreateRefPanel.tsx +0 -84
  166. package/src/components/Table/relations.stories.tsx +0 -123
  167. package/src/components/TableCellEditor/extension.ts +0 -61
  168. package/src/components/TableToolbar/TableToolbar.tsx +0 -102
  169. package/src/components/TableToolbar/index.ts +0 -5
  170. package/src/model/table-sorting.ts +0 -216
  171. package/src/types/table.ts +0 -27
  172. package/src/util/table.ts +0 -127
@@ -1 +1 @@
1
- {"version":3,"file":"RowActionsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/RowActionsMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAGpE,KAAK,mBAAmB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAE1E,eAAO,MAAM,cAAc,GAAI,mBAAmB,mBAAmB,6BAmCpE,CAAC"}
1
+ {"version":3,"file":"RowActionsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/RowActionsMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGpE,KAAK,mBAAmB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAE1E,eAAO,MAAM,cAAc,GAAI,mBAAmB,mBAAmB,6BA2CpE,CAAC"}
@@ -1,24 +1,27 @@
1
- import { type Schema } from 'effect/Schema';
2
- import React, { type PropsWithChildren } from 'react';
3
- import { type Client } from '@dxos/client';
1
+ import React, { type PropsWithChildren, type RefObject } from 'react';
4
2
  import { type DxGridPosition } from '@dxos/react-ui-grid';
5
- import { type TableModel, type TablePresentation } from '../../model';
6
- export type TableRootProps = PropsWithChildren<{
7
- role?: string;
8
- }>;
9
- export type TableController = {
10
- update?: (cell?: DxGridPosition) => void;
3
+ import { type InsertRowResult } from '../../model';
4
+ type TableContextValue = {
5
+ /** Mutable ref populated by Content so Root can expose the controller. */
6
+ controllerRef: RefObject<TableController>;
11
7
  };
12
- export type TableMainProps = {
13
- model?: TableModel;
14
- presentation?: TablePresentation;
15
- schema?: Schema.AnyNoContext;
16
- client?: Client;
17
- ignoreAttention?: boolean;
18
- onRowClick?: (row: any) => void;
8
+ declare const useTableContext: (consumerName: string) => TableContextValue;
9
+ type TableController = {
10
+ update?: (cell?: DxGridPosition) => void;
11
+ handleInsertRowResult?: (insertRowResult?: InsertRowResult) => void;
19
12
  };
13
+ type TableRootProps = PropsWithChildren;
20
14
  export declare const Table: {
21
- Root: ({ children, role }: TableRootProps) => React.JSX.Element;
22
- Main: React.ForwardRefExoticComponent<TableMainProps & React.RefAttributes<TableController>>;
15
+ Root: React.ForwardRefExoticComponent<{
16
+ children?: React.ReactNode | undefined;
17
+ } & React.RefAttributes<TableController>>;
18
+ Toolbar: React.ForwardRefExoticComponent<Omit<import("./TableToolbar").TableToolbarProps, "className"> & {
19
+ classNames?: import("@dxos/ui-types").ClassNameValue;
20
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "className" | "style"> & React.RefAttributes<HTMLDivElement>>;
21
+ Content: React.ForwardRefExoticComponent<Omit<import("./TableContent").TableContentProps, "className"> & {
22
+ classNames?: import("@dxos/ui-types").ClassNameValue;
23
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "className" | "style"> & React.RefAttributes<HTMLDivElement>>;
23
24
  };
25
+ export type { TableController, TableRootProps };
26
+ export { useTableContext };
24
27
  //# sourceMappingURL=Table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CA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CAAC;AAEF,QAAA,MAA6B,eAAe,6CAA6C,CAAC;AAM1F,KAAK,eAAe,GAAG;IACrB,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,qBAAqB,CAAC,EAAE,CAAC,eAAe,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;CACrE,CAAC;AAQF,KAAK,cAAc,GAAG,iBAAiB,CAAC;AAuBxC,eAAO,MAAM,KAAK;;;;;;;;;;CAIjB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,12 +1,115 @@
1
- import '@dxos-theme';
2
- import { type StoryObj, type Meta } from '@storybook/react-vite';
3
- type StoryProps = {
1
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ type DefaultStoryProps = {
4
4
  rows?: number;
5
5
  };
6
- declare const meta: Meta<StoryProps>;
6
+ declare const meta: {
7
+ title: string;
8
+ render: () => React.JSX.Element;
9
+ decorators: import("@storybook/react").Decorator[];
10
+ parameters: {
11
+ layout: string;
12
+ controls: {
13
+ disable: boolean;
14
+ };
15
+ translations: ({
16
+ readonly 'en-US': {
17
+ readonly "@dxos/react-ui-table": {
18
+ readonly 'object.placeholder': "New table";
19
+ readonly 'create-object.label': "Create table";
20
+ readonly 'table-name.placeholder': "Table name";
21
+ readonly 'settings.title': "Table settings";
22
+ readonly 'table-schema.label': "Type";
23
+ readonly 'continue.label': "Continue";
24
+ readonly 'create-stack-section.label': "Create table";
25
+ readonly 'add-row.label': "Add row";
26
+ readonly 'column-action-sort-descending.menu': "Sort Descending";
27
+ readonly 'column-action-sort-ascending.menu': "Sort Ascending";
28
+ readonly 'column-action-clear-sorting.menu': "Clear Sorting";
29
+ readonly 'column-action-settings.menu': "Column Settings";
30
+ readonly 'column-action-delete.menu': "Delete Column";
31
+ readonly 'delete-row.label': "Delete row";
32
+ readonly 'bulk-delete-row.label': "Delete selected rows";
33
+ readonly 'column-deleted.label': "Column deleted";
34
+ readonly 'new-column-button.label': "Create column";
35
+ readonly 'create-new-object.label': "Create new object “{{text}}”";
36
+ readonly 'save-view.label': "Save changes to view";
37
+ };
38
+ };
39
+ } | {
40
+ readonly 'en-US': {
41
+ readonly "@dxos/react-ui-form": {
42
+ readonly "fields.label": "Fields";
43
+ readonly "hidden-fields.label": "Hidden Fields";
44
+ readonly "empty-readonly-ref-field.label": "(none)";
45
+ readonly "add-property-button.label": "Add property";
46
+ readonly "field-property.label": "Property";
47
+ readonly "field-property.placeholder": "Property name";
48
+ readonly "field-format.label": "Type";
49
+ readonly "field-path.label": "Field path";
50
+ readonly "add-field.button": "Add field";
51
+ readonly "boolean-input-true.value": "Yes";
52
+ readonly "boolean-input-false.value": "No";
53
+ readonly "show-field.label": "Show field";
54
+ readonly "hide-field.label": "Hide field";
55
+ readonly "delete-field.label": "Delete field";
56
+ readonly "ref-field-combobox-input.placeholder": "Search\u2026";
57
+ readonly "ref-field.placeholder": "Select\u2026";
58
+ readonly "ref-field.placeholder_one": "Select\u2026";
59
+ readonly "ref-field.placeholder_other": "Select items\u2026";
60
+ readonly "create-option.label": "Create";
61
+ readonly "add-tag.label": "Add tag";
62
+ readonly "example.placeholder": "Example";
63
+ readonly "latitude.placeholder": "Latitude (e.g., 40.7128)";
64
+ readonly "longitude.placeholder": "Longitude (e.g., -74.0060)";
65
+ readonly "cancel-button.label": "Cancel";
66
+ readonly "save-button.label": "Save";
67
+ readonly "format.boolean.label": "Boolean";
68
+ readonly "format.currency.label": "Currency";
69
+ readonly "format.date.label": "Date";
70
+ readonly "format.date-time.label": "DateTime";
71
+ readonly "format.did.label": "DID";
72
+ readonly "format.duration.label": "Duration";
73
+ readonly "format.dxn.label": "DXN";
74
+ readonly "format.email.label": "Email";
75
+ readonly "format.formula.label": "Formula";
76
+ readonly "format.hostname.label": "Hostname";
77
+ readonly "format.integer.label": "Integer";
78
+ readonly "format.json.label": "JSON";
79
+ readonly "format.lnglat.label": "Geopoint";
80
+ readonly "format.markdown.label": "Markdown";
81
+ readonly "format.percent.label": "Percent";
82
+ readonly "format.ref.label": "Reference";
83
+ readonly "format.regex.label": "RegExp";
84
+ readonly "format.string.label": "String";
85
+ readonly "format.single-select.label": "Select";
86
+ readonly "format.multi-select.label": "Multi-select";
87
+ readonly "format.text.label": "Long text";
88
+ readonly "format.time.label": "Time";
89
+ readonly "format.timestamp.label": "Timestamp";
90
+ readonly "format.user.label": "User";
91
+ readonly "format.number.label": "Number";
92
+ readonly "format.uri.label": "URI";
93
+ readonly "format.url.label": "URL";
94
+ readonly "format.uuid.label": "UUID";
95
+ readonly "latitude.label": "Latitude";
96
+ readonly "longitude.label": "Longitude";
97
+ readonly "select-option.label": "Label";
98
+ readonly "select-option-label.placeholder": "Option label";
99
+ readonly "select-option-delete.button": "Delete";
100
+ readonly "select-option-add.button": "Add option";
101
+ readonly "system-schema.title": "System type";
102
+ readonly "system-schema.description": "System type: cannot add or remove fields.";
103
+ readonly "remove.button": "Remove";
104
+ };
105
+ };
106
+ })[];
107
+ };
108
+ };
7
109
  export default meta;
8
- export declare const Default: {};
110
+ type Story = StoryObj<typeof meta>;
111
+ export declare const Default: Story;
9
112
  export declare const StaticSchema: StoryObj;
10
113
  export declare const ArrayOfObjects: StoryObj;
11
- export declare const Tags: Meta<StoryProps>;
114
+ export declare const Tags: Meta<DefaultStoryProps>;
12
115
  //# sourceMappingURL=Table.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAkMjE,KAAK,UAAU,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAQpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CA8B1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,eAAO,MAAM,YAAY,EAAE,QAuB1B,CAAC;AAmBF,eAAO,MAAM,cAAc,EAAE,QAuB5B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAsDjC,CAAC"}
1
+ {"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAsB,MAAM,OAAO,CAAC;AAkJ3C,KAAK,iBAAiB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAQ3C,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C6B,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,YAAY,EAAE,QA2B1B,CAAC;AAmBF,eAAO,MAAM,cAAc,EAAE,QA4B5B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAwDxC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { type Type } from '@dxos/echo';
3
+ import { type TableModel, type TablePresentation } from '../../model';
4
+ import { type OnCreateHandler } from '../TableCellEditor';
5
+ export type TableContentProps = {
6
+ schema?: Type.AnyEntity;
7
+ model?: TableModel;
8
+ presentation?: TablePresentation;
9
+ ignoreAttention?: boolean;
10
+ onCreate?: OnCreateHandler;
11
+ onRowClick?: (row: any) => void;
12
+ testId?: string;
13
+ };
14
+ export declare const TableContent: React.ForwardRefExoticComponent<Omit<TableContentProps, "className"> & {
15
+ classNames?: import("@dxos/ui-types").ClassNameValue;
16
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "className" | "style"> & React.RefAttributes<HTMLDivElement>>;
17
+ //# sourceMappingURL=TableContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableContent.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkG,MAAM,OAAO,CAAC;AAEvH,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAiBvC,OAAO,EAAyC,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE7G,OAAO,EAAE,KAAK,eAAe,EAA+C,MAAM,oBAAoB,CAAC;AAkBvG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAEjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY;;2HA0WxB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Atom } from '@effect-atom/atom-react';
2
+ import React from 'react';
3
+ import { type ActionGraphProps, type MenuAction, MenuRootProps } from '@dxos/react-ui-menu';
4
+ export type TableToolbarActionProperties = {
5
+ type: TableToolbarActionType;
6
+ };
7
+ export type TableToolbarAction = MenuAction<TableToolbarActionProperties>;
8
+ export type TableToolbarActionType = 'add-row' | 'comment' | 'save-view';
9
+ type TableToolbarState = Partial<{
10
+ viewDirty: boolean;
11
+ }>;
12
+ export type TableToolbarProps = Pick<MenuRootProps, 'attendableId'> & TableToolbarState & {
13
+ onAdd?: () => void;
14
+ onSave?: () => void;
15
+ customActions?: Atom.Atom<ActionGraphProps>;
16
+ };
17
+ export declare const TableToolbar: React.ForwardRefExoticComponent<Omit<TableToolbarProps, "className"> & {
18
+ classNames?: import("@dxos/ui-types").ClassNameValue;
19
+ } & Pick<React.HTMLAttributes<Element>, "children" | "role" | "className" | "style"> & React.RefAttributes<HTMLDivElement>>;
20
+ export {};
21
+ //# sourceMappingURL=TableToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/TableToolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAmB,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAGL,KAAK,gBAAgB,EAErB,KAAK,UAAU,EACf,aAAa,EAId,MAAM,qBAAqB,CAAC;AAK7B,MAAM,MAAM,4BAA4B,GAAG;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAE1E,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAEzE,KAAK,iBAAiB,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAmDzD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,GACjE,iBAAiB,GAAG;IAClB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;CAC7C,CAAC;AAEJ,eAAO,MAAM,YAAY;;2HAsBxB,CAAC"}
@@ -4,5 +4,5 @@ export type CellValidationMessageProps = {
4
4
  validationError: string | null;
5
5
  variant?: 'error' | 'warning';
6
6
  };
7
- export declare const CellValidationMessage: ({ validationError, variant, __gridScope, }: GridScopedProps<CellValidationMessageProps>) => React.JSX.Element | null;
7
+ export declare const CellValidationMessage: ({ __gridScope, validationError, variant, }: GridScopedProps<CellValidationMessageProps>) => React.JSX.Element | null;
8
8
  //# sourceMappingURL=CellValidationMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CellValidationMessage.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/CellValidationMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3E,MAAM,MAAM,0BAA0B,GAAG;IACvC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,4CAInC,eAAe,CAAC,0BAA0B,CAAC,6BAyB7C,CAAC"}
1
+ {"version":3,"file":"CellValidationMessage.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/CellValidationMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,qBAAqB,CAAC;AAE3E,MAAM,MAAM,0BAA0B,GAAG;IACvC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,4CAInC,eAAe,CAAC,0BAA0B,CAAC,6BAyB7C,CAAC"}
@@ -1,13 +1,18 @@
1
- import { type Schema } from 'effect';
2
1
  import React from 'react';
2
+ import { type Type } from '@dxos/echo';
3
+ import { Ref } from '@dxos/echo/internal';
4
+ import { type FormRootProps } from '@dxos/react-ui-form';
3
5
  import { type FieldProjection } from '@dxos/schema';
4
- import { type TableModel } from '../../model';
5
- type FormCellEditorProps = {
6
- fieldProjection: FieldProjection;
7
- model?: TableModel;
8
- schema?: Schema.Schema.AnyNoContext;
6
+ import { type ModalController, type TableModel } from '../../model';
7
+ export type OnCreateHandler = (schema: Type.AnyEntity, values: any) => Parameters<typeof Ref.make>[0];
8
+ export type FormCellEditorProps<T extends Type.AnyEntity = Type.AnyEntity> = {
9
9
  __gridScope: any;
10
- };
11
- export declare const FormCellEditor: ({ fieldProjection, model, schema, __gridScope }: FormCellEditorProps) => React.JSX.Element | null;
12
- export {};
10
+ schema?: T;
11
+ model?: TableModel;
12
+ fieldProjection: FieldProjection;
13
+ modals?: ModalController;
14
+ onSave?: () => void;
15
+ onCreate?: OnCreateHandler;
16
+ } & Omit<FormRootProps<any>, 'values' | 'schema' | 'onCreate'>;
17
+ export declare const FormCellEditor: <T extends Type.AnyEntity = Type.AnyEntity>({ __gridScope, schema, model, fieldProjection, onSave, onCreate, ...formProps }: FormCellEditorProps<T>) => React.JSX.Element | null;
13
18
  //# sourceMappingURL=FormCellEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormCellEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/FormCellEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAkD,MAAM,OAAO,CAAC;AAOvE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,KAAK,mBAAmB,GAAG;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CA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GAAG,IAAI,CAAC,SAAS,EAAE,iFAQvE,mBAAmB,CAAC,CAAC,CAAC,6BA4JxB,CAAC"}
@@ -1,30 +1,24 @@
1
1
  import { type Completion } from '@codemirror/autocomplete';
2
- import { type Schema } from 'effect/Schema';
3
2
  import React from 'react';
4
- import { type DxGrid } from '@dxos/lit-grid';
5
- import { type DxGridPlanePosition, type GridScopedProps } from '@dxos/react-ui-grid';
6
- import { type FieldProjection } from '@dxos/schema';
7
- import { type TableModel, type ModalController } from '../../model';
8
- declare const newValue: unique symbol;
3
+ import { type Type } from '@dxos/echo';
4
+ import { type DxGridAxis, type DxGridPosition } from '@dxos/lit-grid';
5
+ import { type GridScopedProps } from '@dxos/react-ui-grid';
6
+ import { type ModalController, type TableModel } from '../../model';
7
+ import { type OnCreateHandler } from './FormCellEditor';
9
8
  /**
10
9
  * Option to create new object/value.
11
10
  */
12
- export declare const createOption: (text: string) => {
13
- [newValue]: boolean;
14
- text: string;
15
- };
16
11
  export type QueryResult = Pick<Completion, 'label'> & {
17
12
  data: any;
18
13
  };
19
- export type TableCellEditorProps = {
14
+ export type TableCellEditorProps<T extends Type.AnyEntity = Type.AnyEntity> = {
15
+ schema?: T;
20
16
  model?: TableModel;
21
17
  modals?: ModalController;
22
- schema?: Schema.AnyNoContext;
23
- onEnter?: (cell: DxGridPlanePosition) => void;
24
- onFocus?: DxGrid['refocus'];
25
- onQuery?: (field: FieldProjection, text: string) => Promise<QueryResult[]>;
18
+ onFocus?: (axis?: DxGridAxis, delta?: -1 | 0 | 1, cell?: DxGridPosition) => void;
19
+ onCreate?: OnCreateHandler;
20
+ onSave?: () => void;
26
21
  };
27
- export declare const TableValueEditor: ({ model, modals, schema, onEnter, onFocus, onQuery, __gridScope, }: GridScopedProps<TableCellEditorProps>) => React.JSX.Element;
28
- export declare const TableCellEditor: ({ model, modals, onEnter, onFocus, onQuery, __gridScope, }: GridScopedProps<TableCellEditorProps>) => React.JSX.Element;
29
- export {};
22
+ export declare const TableValueEditor: <T extends Type.AnyEntity = Type.AnyEntity>({ __gridScope, schema, model, modals, onFocus, onSave, onCreate, }: GridScopedProps<TableCellEditorProps<T>>) => React.JSX.Element;
23
+ export declare const TableCellEditor: ({ __gridScope, model, modals, onFocus, onSave, }: GridScopedProps<TableCellEditorProps>) => React.JSX.Element;
30
24
  //# sourceMappingURL=TableCellEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCellEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/TableCellEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAA4D,MAAM,OAAO,CAAC;AAIjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAKL,KAAK,mBAAmB,EAMxB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAKpD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEpE,QAAA,MAAM,QAAQ,eAAyB,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM;;;CAAiC,CAAC;AAI3E,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,MA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C,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACjF,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,oEAQzE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,sBAoC1C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,kDAM7B,eAAe,CAAC,oBAAoB,CAAC,sBA+JvC,CAAC"}
@@ -1,11 +1,44 @@
1
- import '@dxos-theme';
2
- import { type Meta, type StoryObj } from '@storybook/react-vite';
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
3
  import { type GridEditing } from '@dxos/react-ui-grid';
4
- type StoryProps = {
4
+ type DefaultStoryProps = {
5
5
  editing: GridEditing;
6
6
  };
7
- declare const meta: Meta<StoryProps>;
7
+ declare const meta: {
8
+ title: string;
9
+ component: ({ editing }: DefaultStoryProps) => React.JSX.Element;
10
+ render: ({ editing }: DefaultStoryProps) => React.JSX.Element;
11
+ decorators: import("@storybook/react").Decorator[];
12
+ parameters: {
13
+ layout: string;
14
+ translations: [{
15
+ readonly 'en-US': {
16
+ readonly "@dxos/react-ui-table": {
17
+ readonly 'object.placeholder': "New table";
18
+ readonly 'create-object.label': "Create table";
19
+ readonly 'table-name.placeholder': "Table name";
20
+ readonly 'settings.title': "Table settings";
21
+ readonly 'table-schema.label': "Type";
22
+ readonly 'continue.label': "Continue";
23
+ readonly 'create-stack-section.label': "Create table";
24
+ readonly 'add-row.label': "Add row";
25
+ readonly 'column-action-sort-descending.menu': "Sort Descending";
26
+ readonly 'column-action-sort-ascending.menu': "Sort Ascending";
27
+ readonly 'column-action-clear-sorting.menu': "Clear Sorting";
28
+ readonly 'column-action-settings.menu': "Column Settings";
29
+ readonly 'column-action-delete.menu': "Delete Column";
30
+ readonly 'delete-row.label': "Delete row";
31
+ readonly 'bulk-delete-row.label': "Delete selected rows";
32
+ readonly 'column-deleted.label': "Column deleted";
33
+ readonly 'new-column-button.label': "Create column";
34
+ readonly 'create-new-object.label': "Create new object “{{text}}”";
35
+ readonly 'save-view.label': "Save changes to view";
36
+ };
37
+ };
38
+ }];
39
+ };
40
+ };
8
41
  export default meta;
9
- type Story = StoryObj<StoryProps>;
42
+ type Story = StoryObj<typeof meta>;
10
43
  export declare const Default: Story;
11
44
  //# sourceMappingURL=TableCellEditor.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCellEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/TableCellEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AASjE,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAW7E,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AA4DF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAyB1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
1
+ {"version":3,"file":"TableCellEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/TableCellEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAQ,KAAK,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AAU7E,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAmBF,QAAA,MAAM,IAAI;;6BAhByB,iBAAiB;0BAAjB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Cf,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './TableCellEditor';
2
+ export { type OnCreateHandler } from './FormCellEditor';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,3 +1,2 @@
1
1
  export * from './Table';
2
- export * from './TableToolbar';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
@@ -1,66 +1,36 @@
1
- import { Schema } from 'effect';
2
- import { TableType } from '../types';
3
- export declare const TestSchema: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
4
- id: import("@dxos/keys").ObjectIdClass;
5
- name: Schema.optional<typeof Schema.String>;
6
- age: Schema.optional<typeof Schema.Number>;
7
- active: Schema.optional<typeof Schema.Boolean>;
8
- netWorth: Schema.optional<typeof Schema.Number>;
9
- }, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
10
- id: import("@dxos/keys").ObjectIdClass;
11
- name: Schema.optional<typeof Schema.String>;
12
- age: Schema.optional<typeof Schema.Number>;
13
- active: Schema.optional<typeof Schema.Boolean>;
14
- netWorth: Schema.optional<typeof Schema.Number>;
15
- }>>;
16
- export declare const createTable: (schema?: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
17
- id: import("@dxos/keys").ObjectIdClass;
18
- name: Schema.optional<typeof Schema.String>;
19
- age: Schema.optional<typeof Schema.Number>;
20
- active: Schema.optional<typeof Schema.Boolean>;
21
- netWorth: Schema.optional<typeof Schema.Number>;
22
- }, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
23
- id: import("@dxos/keys").ObjectIdClass;
24
- name: Schema.optional<typeof Schema.String>;
25
- age: Schema.optional<typeof Schema.Number>;
26
- active: Schema.optional<typeof Schema.Boolean>;
27
- netWorth: Schema.optional<typeof Schema.Number>;
28
- }>>) => import("@dxos/live-object").Live<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
29
- id: string;
30
- name?: string | undefined;
31
- view?: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").TypedObjectFields<{
32
- name: Schema.SchemaClass<string, string, never>;
33
- query: Schema.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
34
- schema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
35
- fields: Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
36
- id: typeof Schema.String;
37
- path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
38
- visible: Schema.optional<typeof Schema.Boolean>;
39
- referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
40
- size: Schema.optional<typeof Schema.Number>;
41
- }>>>>;
42
- hiddenFields: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
43
- id: typeof Schema.String;
44
- path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
45
- visible: Schema.optional<typeof Schema.Boolean>;
46
- referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
47
- size: Schema.optional<typeof Schema.Number>;
48
- }>>>>>;
49
- metadata: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
50
- }, import("@dxos/echo-schema").TypedObjectOptions>> | undefined;
51
- threads?: readonly import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>[] | undefined;
52
- }>;
53
- export declare const createItems: (n: number) => {
1
+ import { Atom } from '@effect-atom/atom-react';
2
+ import * as Schema from 'effect/Schema';
3
+ import { Type } from '@dxos/echo';
4
+ import { type ProjectionModel } from '@dxos/schema';
5
+ export declare const TestSchema: Type.Obj<{
6
+ readonly name?: string | undefined;
7
+ readonly age?: number | undefined;
8
+ readonly active?: boolean | undefined;
9
+ readonly netWorth?: number | undefined;
10
+ }, Schema.Struct.Fields>;
11
+ export type TestItem = {
54
12
  name: string;
55
13
  age: number;
56
14
  active: boolean;
57
15
  netWorth: number;
58
- }[];
16
+ };
17
+ /**
18
+ * Creates an Atom containing test items data.
19
+ */
20
+ export declare const createItemsAtom: (n: number) => Atom.Writable<{
21
+ data: TestItem[];
22
+ }, {
23
+ data: TestItem[];
24
+ }>;
25
+ /**
26
+ * Creates plain test items (non-reactive).
27
+ */
28
+ export declare const createItems: (n: number) => TestItem[];
59
29
  export type SimulatorProps = {
60
- table: TableType;
30
+ projection: ProjectionModel;
61
31
  items: any[];
62
32
  insertInterval?: number;
63
33
  updateInterval?: number;
64
34
  };
65
- export declare const useSimulator: ({ items, table, insertInterval, updateInterval }: SimulatorProps) => void;
35
+ export declare const useSimulator: ({ items, projection, insertInterval, updateInterval }: SimulatorProps) => void;
66
36
  //# sourceMappingURL=testing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAShC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,eAAO,MAAM,UAAU;;;;;;;;;;;;GAMrB,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI;;;;;;;;;;;;GAAmB;;;;;;;;;;;;;;;;;;;;;;;;EAU9C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM;;;;;GAWpC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,kDAAkD,cAAc,SA+D5F,CAAC"}
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAU,IAAI,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,UAAU;;;;;wBAUtB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM;UACd,QAAQ,EAAE;;UAAV,QAAQ,EAAE;EAQpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,KAAG,QAAQ,EAO/C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,uDAAuD,cAAc,SA6DjG,CAAC"}
@@ -1,3 +1,4 @@
1
- export * from './useTableModel';
2
1
  export * from './useAddRow';
2
+ export * from './useProjectionModel';
3
+ export * from './useTableModel';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
@@ -1,13 +1,13 @@
1
- import { type Schema } from 'effect';
2
- import { type Space } from '@dxos/client/echo';
3
- export type UseAddRowParams = {
4
- space?: Space;
5
- schema?: Schema.Schema.AnyNoContext;
1
+ import { type Database, type Type } from '@dxos/echo';
2
+ import { type InsertRowResult } from '../model';
3
+ export type UseAddRowProps = {
4
+ db?: Database.Database;
5
+ schema?: Type.AnyObj;
6
6
  };
7
7
  /**
8
8
  * Hook that provides a safe row creation function that handles schema validation failures.
9
9
  * Returns a callback that attempts to create an object and returns boolean success/failure.
10
10
  * Can accept optional data to create objects with specific content (used for committing draft rows).
11
11
  */
12
- export declare const useAddRow: ({ space, schema }: UseAddRowParams) => (data?: any) => boolean;
12
+ export declare const useAddRow: ({ db, schema }: UseAddRowProps) => (data?: any) => InsertRowResult;
13
13
  //# sourceMappingURL=useAddRow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddRow.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAddRow.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;CACrC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,mBAAmB,eAAe,aAEhD,GAAG,YAad,CAAC"}
1
+ {"version":3,"file":"useAddRow.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAddRow.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,QAAQ,EAAO,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,gBAAgB,cAAc,aAE5C,GAAG,KAAG,eAajB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type Registry } from '@effect-atom/atom-react';
2
+ import { Type } from '@dxos/echo';
3
+ import { ProjectionModel } from '@dxos/schema';
4
+ import { type Table } from '../types';
5
+ export declare const useProjectionModel: <S extends Type.AnyEntity>(schema: S | undefined, table: Table.Table | undefined, registry: Registry.Registry) => ProjectionModel | undefined;
6
+ //# sourceMappingURL=useProjectionModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProjectionModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useProjectionModel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAc,IAAI,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,eAAe,EAA4B,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,IAAI,CAAC,SAAS,EACzD,QAAQ,CAAC,GAAG,SAAS,EACrB,OAAO,KAAK,CAAC,KAAK,GAAG,SAAS,EAC9B,UAAU,QAAQ,CAAC,QAAQ,gCAsB5B,CAAC"}