@dxos/react-ui-table 0.8.4-main.5ea62a8 → 0.8.4-main.ae835ea

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 (93) hide show
  1. package/dist/lib/browser/{chunk-63UUF4IG.mjs → chunk-4K7JPALT.mjs} +5 -5
  2. package/dist/lib/browser/chunk-4K7JPALT.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-RQYXNWWN.mjs → chunk-G7MGPBSR.mjs} +444 -490
  4. package/dist/lib/browser/chunk-G7MGPBSR.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +132 -283
  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 -6
  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-QNDUGIS7.mjs → chunk-LD5JEBA6.mjs} +444 -490
  12. package/dist/lib/node-esm/chunk-LD5JEBA6.mjs.map +7 -0
  13. package/dist/lib/node-esm/{chunk-K734DJB7.mjs → chunk-MK6OVUF6.mjs} +5 -5
  14. package/dist/lib/node-esm/chunk-MK6OVUF6.mjs.map +7 -0
  15. package/dist/lib/node-esm/index.mjs +132 -283
  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 -6
  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 +71 -7
  26. package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -1
  27. package/dist/types/src/components/Table/Table.d.ts +5 -2
  28. package/dist/types/src/components/Table/Table.d.ts.map +1 -1
  29. package/dist/types/src/components/Table/Table.stories.d.ts +5 -6
  30. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  31. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +7 -5
  32. package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
  33. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +5 -3
  34. package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
  35. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +1 -2
  36. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/TableCellEditor/index.d.ts +1 -0
  38. package/dist/types/src/components/TableCellEditor/index.d.ts.map +1 -1
  39. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  40. package/dist/types/src/components/testing.d.ts +3 -3
  41. package/dist/types/src/components/testing.d.ts.map +1 -1
  42. package/dist/types/src/hooks/useAddRow.d.ts +1 -1
  43. package/dist/types/src/hooks/useAddRow.d.ts.map +1 -1
  44. package/dist/types/src/hooks/useTableModel.d.ts +1 -1
  45. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  46. package/dist/types/src/model/modal-controller.d.ts +0 -7
  47. package/dist/types/src/model/modal-controller.d.ts.map +1 -1
  48. package/dist/types/src/model/table-model.d.ts +2 -2
  49. package/dist/types/src/model/table-model.d.ts.map +1 -1
  50. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  51. package/dist/types/src/model/table-sorting.d.ts +1 -2
  52. package/dist/types/src/model/table-sorting.d.ts.map +1 -1
  53. package/dist/types/src/testing/useTestTableModel.d.ts +3 -17
  54. package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
  55. package/dist/types/src/types/schema.d.ts +3 -3
  56. package/dist/types/src/types/schema.d.ts.map +1 -1
  57. package/dist/types/src/util/dynamic-table.d.ts +4 -5
  58. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  59. package/dist/types/src/util/schema.d.ts +1 -1
  60. package/dist/types/src/util/schema.d.ts.map +1 -1
  61. package/dist/types/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +51 -51
  63. package/src/components/Table/DynamicTable.stories.tsx +8 -7
  64. package/src/components/Table/DynamicTable.tsx +4 -7
  65. package/src/components/Table/Relations.stories.tsx +119 -11
  66. package/src/components/Table/Table.stories.tsx +36 -35
  67. package/src/components/Table/Table.tsx +13 -9
  68. package/src/components/TableCellEditor/FormCellEditor.tsx +51 -41
  69. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +17 -45
  70. package/src/components/TableCellEditor/TableCellEditor.tsx +17 -112
  71. package/src/components/TableCellEditor/index.ts +1 -0
  72. package/src/components/TableToolbar/TableToolbar.tsx +3 -0
  73. package/src/components/testing.ts +2 -2
  74. package/src/hooks/useAddRow.ts +1 -1
  75. package/src/hooks/useTableModel.ts +1 -1
  76. package/src/model/modal-controller.ts +0 -28
  77. package/src/model/table-model.test.ts +16 -6
  78. package/src/model/table-model.ts +10 -3
  79. package/src/model/table-presentation.test.ts +19 -17
  80. package/src/model/table-presentation.ts +4 -5
  81. package/src/model/table-sorting.ts +15 -6
  82. package/src/playwright/smoke.spec.ts +3 -3
  83. package/src/testing/useTestTableModel.ts +7 -4
  84. package/src/types/schema.ts +4 -4
  85. package/src/util/dynamic-table.ts +8 -8
  86. package/src/util/schema.ts +4 -4
  87. package/dist/lib/browser/chunk-63UUF4IG.mjs.map +0 -7
  88. package/dist/lib/browser/chunk-RQYXNWWN.mjs.map +0 -7
  89. package/dist/lib/node-esm/chunk-K734DJB7.mjs.map +0 -7
  90. package/dist/lib/node-esm/chunk-QNDUGIS7.mjs.map +0 -7
  91. package/dist/types/src/components/Table/CreateRefPanel.d.ts +0 -9
  92. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +0 -1
  93. package/src/components/Table/CreateRefPanel.tsx +0 -103
@@ -11,11 +11,11 @@ __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";
17
+ import { JsonPath, toEffectSchema } from "@dxos/echo/internal";
18
+ import { ViewAnnotation } from "@dxos/echo/internal";
19
19
  import { createViewFromSpace, getSchemaProperties } from "@dxos/schema";
20
20
  var Table = Schema.Struct({
21
21
  sizes: Schema.Record({
@@ -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-4K7JPALT.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 { type CreateViewFromSpaceProps, type DataType, createViewFromSpace, 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<CreateViewFromSpaceProps, 'presentation'> & {\n sizes?: Record<string, number>;\n};\n\nexport const makeView = async ({\n sizes,\n ...props\n}: MakeViewProps): Promise<{\n jsonSchema: JsonSchemaType;\n view: DataType.View;\n schema: ReturnType<typeof toEffectSchema>;\n}> => {\n const table = Obj.make(Table, { sizes: {} });\n const { jsonSchema, view } = await createViewFromSpace({ ...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,SAAuDC,qBAAqBC,2BAA2B;AAEhG,IAAMC,QAAeC,cAAO;EACjCC,OAAcC,cAAO;IACnBC,KAAKC;IACLC,OAAcC;EAChB,CAAA,EAAGC,KAAYC,cAAO;AACxB,CAAA,EAAGD,KACDE,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,eAAeC,IAAI,IAAA,CAAA;AAQd,IAAMC,OAAO,CAACC,QAA8C,CAAC,MAAMN,IAAIK,KAAKhB,OAAO;EAAEE,OAAO,CAAC;EAAG,GAAGe;AAAM,CAAA;AAMzG,IAAMC,WAAW,OAAO,EAC7BhB,OACA,GAAGe,MAAAA,MACW;AAKd,QAAME,QAAQR,IAAIK,KAAKhB,OAAO;IAAEE,OAAO,CAAC;EAAE,CAAA;AAC1C,QAAM,EAAEkB,YAAYC,KAAI,IAAK,MAAMC,oBAAoB;IAAE,GAAGL;IAAOM,cAAcJ;EAAM,CAAA;AAGvF,QAAMK,SAASC,eAAeL,UAAAA;AAC9B,QAAMM,kBAAkBT,MAAMU,QAAQC,KAAK,CAACC,UAAUA,UAAU,IAAA,MAAUC;AAC1E,QAAMC,aAAaC,oBAAoBR,OAAOS,KAAK,CAAC,GAAGP,eAAAA;AACvD,aAAWQ,YAAYH,YAAY;AACjC,QAAI7B,QAAQgC,SAASC,IAAI,GAAG;AAC1BhB,YAAMjB,MAAMgC,SAASC,IAAI,IAAgBjC,MAAMgC,SAASC,IAAI;AAC5D;IACF;AAEAC,IAAMC,WAAI,EAAe7B,KACjB8B,WAAK,WAAW,MAAA;AACpBnB,YAAMjB,MAAMgC,SAASC,IAAI,IAAgB;IAC3C,CAAA,GACMG,WAAK,UAAU,MAAA;AACnBnB,YAAMjB,MAAMgC,SAASC,IAAI,IAAgB;IAC3C,CAAA,GACMI,aAAO,MAAA;IAEb,CAAA,CAAA,EACAL,SAASG,IAAI;EACjB;AAEA,SAAO;IAAEjB;IAAYI;IAAQH;EAAK;AACpC;",
6
+ "names": ["Match", "Schema", "Obj", "Type", "JsonPath", "toEffectSchema", "ViewAnnotation", "createViewFromSpace", "getSchemaProperties", "Table", "Struct", "sizes", "Record", "key", "JsonPath", "value", "Number", "pipe", "mutable", "Type", "Obj", "typename", "version", "ViewAnnotation", "set", "make", "props", "makeView", "table", "jsonSchema", "view", "createViewFromSpace", "presentation", "schema", "toEffectSchema", "shouldIncludeId", "fields", "find", "field", "undefined", "properties", "getSchemaProperties", "ast", "property", "name", "Match", "type", "when", "orElse"]
7
+ }