@dxos/react-ui-table 0.8.4-main.406dc2a → 0.8.4-main.548089c
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.
- package/dist/lib/browser/{chunk-4K7JPALT.mjs → chunk-2PFAPQL4.mjs} +3 -3
- package/dist/lib/browser/chunk-2PFAPQL4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OZTXLZGM.mjs → chunk-GS2UNGJK.mjs} +434 -463
- package/dist/lib/browser/chunk-GS2UNGJK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +41 -38
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +4 -4
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-MK6OVUF6.mjs → chunk-6POOFFYF.mjs} +3 -3
- package/dist/lib/node-esm/chunk-6POOFFYF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-S56Z4V4X.mjs → chunk-TRR3C5NX.mjs} +434 -463
- package/dist/lib/node-esm/chunk-TRR3C5NX.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +41 -38
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +4 -4
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/Table/Relations.stories.d.ts +2 -3
- package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -2
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useTableModel.d.ts +2 -2
- package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
- package/dist/types/src/model/table-model.d.ts +3 -3
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-sorting.d.ts +2 -2
- package/dist/types/src/model/table-sorting.d.ts.map +1 -1
- package/dist/types/src/testing/useTestTableModel.d.ts +2 -2
- package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +3 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/dynamic-table.d.ts +2 -2
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -40
- package/src/components/Table/DynamicTable.stories.tsx +3 -3
- package/src/components/Table/Relations.stories.tsx +16 -22
- package/src/components/Table/RowActionsMenu.tsx +21 -13
- package/src/components/Table/Table.stories.tsx +12 -12
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +6 -5
- package/src/components/TableToolbar/TableToolbar.tsx +31 -21
- package/src/hooks/useTableModel.ts +4 -4
- package/src/model/table-model.test.ts +2 -2
- package/src/model/table-model.ts +10 -7
- package/src/model/table-presentation.test.ts +2 -2
- package/src/model/table-sorting.ts +8 -8
- package/src/playwright/TableManager.ts +1 -1
- package/src/playwright/smoke.spec.ts +7 -5
- package/src/testing/useTestTableModel.ts +2 -2
- package/src/types/schema.ts +4 -4
- package/src/util/dynamic-table.ts +4 -5
- package/dist/lib/browser/chunk-4K7JPALT.mjs.map +0 -7
- package/dist/lib/browser/chunk-OZTXLZGM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MK6OVUF6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-S56Z4V4X.mjs.map +0 -7
|
@@ -16,7 +16,7 @@ import * as Schema from "effect/Schema";
|
|
|
16
16
|
import { Obj, Type } from "@dxos/echo";
|
|
17
17
|
import { JsonPath, toEffectSchema } from "@dxos/echo/internal";
|
|
18
18
|
import { ViewAnnotation } from "@dxos/echo/internal";
|
|
19
|
-
import {
|
|
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
|
|
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-
|
|
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,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,KAAKC,cAAc;IAAE,GAAGN;IAAOO,cAAcL;EAAM,CAAA;AAGtF,QAAMM,SAASC,eAAeN,UAAAA;AAC9B,QAAMO,kBAAkBV,MAAMW,QAAQC,KAAK,CAACC,UAAUA,UAAU,IAAA,MAAUC;AAC1E,QAAMC,aAAaC,oBAAoBR,OAAOS,KAAK,CAAC,GAAGP,eAAAA;AACvD,aAAWQ,YAAYH,YAAY;AACjC,QAAI9B,QAAQiC,SAASC,IAAI,GAAG;AAC1BjB,YAAMjB,MAAMiC,SAASC,IAAI,IAAgBlC,MAAMiC,SAASC,IAAI;AAC5D;IACF;AAEAC,IAAMC,WAAI,EAAe9B,KACjB+B,WAAK,WAAW,MAAA;AACpBpB,YAAMjB,MAAMiC,SAASC,IAAI,IAAgB;IAC3C,CAAA,GACMG,WAAK,UAAU,MAAA;AACnBpB,YAAMjB,MAAMiC,SAASC,IAAI,IAAgB;IAC3C,CAAA,GACMI,aAAO,MAAA;IAEb,CAAA,CAAA,EACAL,SAASG,IAAI;EACjB;AAEA,SAAO;IAAElB;IAAYK;IAAQJ;EAAK;AACpC;",
|
|
6
|
+
"names": ["Match", "Schema", "Obj", "Type", "JsonPath", "toEffectSchema", "ViewAnnotation", "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
|
+
}
|