@dxos/react-ui-table 0.8.4-main.e098934 → 0.8.4-main.e8ec1fe

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 (97) hide show
  1. package/dist/lib/browser/{chunk-63UUF4IG.mjs → chunk-2PFAPQL4.mjs} +7 -7
  2. package/dist/lib/browser/chunk-2PFAPQL4.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-BBXDTWCX.mjs → chunk-GS2UNGJK.mjs} +443 -490
  4. package/dist/lib/browser/chunk-GS2UNGJK.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +161 -303
  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 +9 -7
  9. package/dist/lib/browser/testing/index.mjs.map +3 -3
  10. package/dist/lib/browser/types/index.mjs +1 -1
  11. package/dist/lib/node-esm/{chunk-K734DJB7.mjs → chunk-6POOFFYF.mjs} +7 -7
  12. package/dist/lib/node-esm/chunk-6POOFFYF.mjs.map +7 -0
  13. package/dist/lib/node-esm/{chunk-RNQDU7IQ.mjs → chunk-TRR3C5NX.mjs} +443 -490
  14. package/dist/lib/node-esm/chunk-TRR3C5NX.mjs.map +7 -0
  15. package/dist/lib/node-esm/index.mjs +161 -303
  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 +9 -7
  19. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  20. package/dist/lib/node-esm/types/index.mjs +1 -1
  21. package/dist/types/src/components/Table/DynamicTable.d.ts +2 -2
  22. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
  23. package/dist/types/src/components/Table/DynamicTable.stories.d.ts +3 -3
  24. package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/Table/Relations.stories.d.ts +70 -7
  26. package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -1
  27. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  28. package/dist/types/src/components/Table/Table.d.ts +5 -2
  29. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  30. package/dist/types/src/components/Table/Table.stories.d.ts +5 -6
  31. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  32. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +7 -5
  33. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
  34. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +5 -3
  35. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  36. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +1 -2
  37. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  38. package/dist/types/src/components/TableCellEditor/index.d.ts +1 -0
  39. package/dist/types/src/components/TableCellEditor/index.d.ts.map +1 -1
  40. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -2
  41. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  42. package/dist/types/src/components/testing.d.ts +3 -3
  43. package/dist/types/src/components/testing.d.ts.map +1 -1
  44. package/dist/types/src/hooks/useAddRow.d.ts +1 -1
  45. package/dist/types/src/hooks/useAddRow.d.ts.map +1 -1
  46. package/dist/types/src/hooks/useTableModel.d.ts +3 -3
  47. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  48. package/dist/types/src/model/modal-controller.d.ts +0 -7
  49. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  50. package/dist/types/src/model/table-model.d.ts +4 -4
  51. package/dist/types/src/model/table-model.d.ts.map +1 -1
  52. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  53. package/dist/types/src/model/table-sorting.d.ts +2 -2
  54. package/dist/types/src/model/table-sorting.d.ts.map +1 -1
  55. package/dist/types/src/testing/useTestTableModel.d.ts +3 -3
  56. package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
  57. package/dist/types/src/types/schema.d.ts +6 -6
  58. package/dist/types/src/types/schema.d.ts.map +1 -1
  59. package/dist/types/src/util/dynamic-table.d.ts +5 -6
  60. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  61. package/dist/types/src/util/schema.d.ts +1 -1
  62. package/dist/types/src/util/schema.d.ts.map +1 -1
  63. package/dist/types/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +52 -51
  65. package/src/components/Table/DynamicTable.stories.tsx +11 -10
  66. package/src/components/Table/DynamicTable.tsx +4 -7
  67. package/src/components/Table/Relations.stories.tsx +127 -18
  68. package/src/components/Table/RowActionsMenu.tsx +21 -13
  69. package/src/components/Table/Table.stories.tsx +44 -43
  70. package/src/components/Table/Table.tsx +13 -9
  71. package/src/components/TableCellEditor/FormCellEditor.tsx +51 -41
  72. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +19 -46
  73. package/src/components/TableCellEditor/TableCellEditor.tsx +7 -94
  74. package/src/components/TableCellEditor/index.ts +1 -0
  75. package/src/components/TableToolbar/TableToolbar.tsx +32 -22
  76. package/src/components/testing.ts +2 -2
  77. package/src/hooks/useAddRow.ts +1 -1
  78. package/src/hooks/useTableModel.ts +5 -5
  79. package/src/model/modal-controller.ts +0 -28
  80. package/src/model/table-model.test.ts +12 -7
  81. package/src/model/table-model.ts +12 -8
  82. package/src/model/table-presentation.test.ts +15 -18
  83. package/src/model/table-presentation.ts +4 -5
  84. package/src/model/table-sorting.ts +9 -9
  85. package/src/playwright/TableManager.ts +1 -1
  86. package/src/playwright/smoke.spec.ts +7 -5
  87. package/src/testing/useTestTableModel.ts +7 -5
  88. package/src/types/schema.ts +8 -8
  89. package/src/util/dynamic-table.ts +9 -11
  90. package/src/util/schema.ts +4 -4
  91. package/dist/lib/browser/chunk-63UUF4IG.mjs.map +0 -7
  92. package/dist/lib/browser/chunk-BBXDTWCX.mjs.map +0 -7
  93. package/dist/lib/node-esm/chunk-K734DJB7.mjs.map +0 -7
  94. package/dist/lib/node-esm/chunk-RNQDU7IQ.mjs.map +0 -7
  95. package/dist/types/src/components/Table/CreateRefPanel.d.ts +0 -9
  96. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +0 -1
  97. package/src/components/Table/CreateRefPanel.tsx +0 -103
@@ -11,12 +11,12 @@ __export(schema_exports, {
11
11
  make: () => make,
12
12
  makeView: () => makeView
13
13
  });
14
- import { Schema } from "effect";
15
- import { Match } from "effect";
14
+ import * as Match from "effect/Match";
15
+ import * as Schema from "effect/Schema";
16
16
  import { Obj, Type } from "@dxos/echo";
17
- import { JsonPath, toEffectSchema } from "@dxos/echo-schema";
18
- import { ViewAnnotation } from "@dxos/echo-schema";
19
- import { createViewFromSpace, getSchemaProperties } from "@dxos/schema";
17
+ import { JsonPath, toEffectSchema } from "@dxos/echo/internal";
18
+ import { ViewAnnotation } from "@dxos/echo/internal";
19
+ import { View, getSchemaProperties } from "@dxos/schema";
20
20
  var Table = Schema.Struct({
21
21
  sizes: Schema.Record({
22
22
  key: JsonPath,
@@ -34,7 +34,7 @@ var makeView = async ({ sizes, ...props }) => {
34
34
  const table = Obj.make(Table, {
35
35
  sizes: {}
36
36
  });
37
- const { jsonSchema, view } = await createViewFromSpace({
37
+ const { jsonSchema, view } = await View.makeFromSpace({
38
38
  ...props,
39
39
  presentation: table
40
40
  });
@@ -63,4 +63,4 @@ var makeView = async ({ sizes, ...props }) => {
63
63
  export {
64
64
  schema_exports
65
65
  };
66
- //# sourceMappingURL=chunk-63UUF4IG.mjs.map
66
+ //# sourceMappingURL=chunk-2PFAPQL4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/schema.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\nimport { JsonPath, type JsonSchemaType, toEffectSchema } from '@dxos/echo/internal';\nimport { ViewAnnotation } from '@dxos/echo/internal';\nimport { type SimpleType } from '@dxos/effect';\nimport { View, getSchemaProperties } from '@dxos/schema';\n\nexport const Table = Schema.Struct({\n sizes: Schema.Record({\n key: JsonPath,\n value: Schema.Number,\n }).pipe(Schema.mutable),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Table',\n version: '0.1.0',\n }),\n ViewAnnotation.set(true),\n);\n\nexport type Table = Schema.Schema.Type<typeof Table>;\n\n/**\n * Make a table view.\n */\nexport const make = (props: Partial<Obj.MakeProps<typeof Table>> = {}) => Obj.make(Table, { sizes: {}, ...props });\n\ntype MakeViewProps = Omit<View.MakeFromSpaceProps, 'presentation'> & {\n sizes?: Record<string, number>;\n};\n\nexport const makeView = async ({\n sizes,\n ...props\n}: MakeViewProps): Promise<{\n jsonSchema: JsonSchemaType;\n view: View.View;\n schema: ReturnType<typeof toEffectSchema>;\n}> => {\n const table = Obj.make(Table, { sizes: {} });\n const { jsonSchema, view } = await View.makeFromSpace({ ...props, presentation: table });\n\n // Preset sizes.\n const schema = toEffectSchema(jsonSchema);\n const shouldIncludeId = props.fields?.find((field) => field === 'id') !== undefined;\n const properties = getSchemaProperties(schema.ast, {}, shouldIncludeId);\n for (const property of properties) {\n if (sizes?.[property.name]) {\n table.sizes[property.name as JsonPath] = sizes[property.name];\n continue;\n }\n\n Match.type<SimpleType>().pipe(\n Match.when('boolean', () => {\n table.sizes[property.name as JsonPath] = 100;\n }),\n Match.when('number', () => {\n table.sizes[property.name as JsonPath] = 100;\n }),\n Match.orElse(() => {\n // Noop.\n }),\n )(property.type);\n }\n\n return { jsonSchema, schema, view };\n};\n"],
5
+ "mappings": ";;;;;;;AAAA;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,UAA+BC,sBAAsB;AAC9D,SAASC,sBAAsB;AAE/B,SAASC,MAAMC,2BAA2B;AAEnC,IAA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ewAnnotation", "View", "getSchemaProperties", "Table", "Struct", "sizes", "Record", "key", "JsonPath", "value", "Number", "pipe", "mutable", "Type", "Obj", "typename", "version", "ViewAnnotation", "set", "make", "props", "makeView", "table", "jsonSchema", "view", "View", "makeFromSpace", "presentation", "schema", "toEffectSchema", "shouldIncludeId", "fields", "find", "field", "undefined", "properties", "getSchemaProperties", "ast", "property", "name", "Match", "type", "when", "orElse"]
7
+ }