@dxos/react-ui-table 0.7.4-staging.f7e8224 → 0.7.5-main.499c70c
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-IYCSJDMB.mjs → chunk-AT7O4RAD.mjs} +4 -4
- package/dist/lib/browser/{chunk-IYCSJDMB.mjs.map → chunk-AT7O4RAD.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +1398 -1216
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-MHBMVCFZ.cjs → chunk-YSBXNBDJ.cjs} +6 -6
- package/dist/lib/node/{chunk-MHBMVCFZ.cjs.map → chunk-YSBXNBDJ.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +1130 -934
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-BMWGPXPL.mjs → chunk-6OH2NHUX.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-BMWGPXPL.mjs.map → chunk-6OH2NHUX.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +1398 -1216
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/_deprecated/hooks/useColumnSorting.d.ts +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +4 -3
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts +3 -2
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts +3 -2
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/RefPanel.d.ts +4 -3
- package/dist/types/src/components/Table/RefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts +3 -2
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.d.ts +2 -1
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +3 -2
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +55 -71
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/model/index.d.ts +1 -0
- package/dist/types/src/model/index.d.ts.map +1 -1
- package/dist/types/src/model/modal-controller.d.ts +6 -2
- package/dist/types/src/model/modal-controller.d.ts.map +1 -1
- package/dist/types/src/model/selection-model.d.ts.map +1 -1
- package/dist/types/src/model/table-model.d.ts +8 -12
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts +22 -0
- package/dist/types/src/model/table-presentation.d.ts.map +1 -0
- package/dist/types/src/model/table-presentation.test.d.ts +2 -0
- package/dist/types/src/model/table-presentation.test.d.ts.map +1 -0
- package/dist/types/src/playwright/TableManager.d.ts +2 -1
- package/dist/types/src/playwright/TableManager.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +118 -154
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/table-buttons.d.ts +50 -20
- package/dist/types/src/util/table-buttons.d.ts.map +1 -1
- package/dist/types/src/util/table-controls.d.ts +32 -9
- package/dist/types/src/util/table-controls.d.ts.map +1 -1
- package/dist/types/src/util/table.d.ts +2 -2
- package/dist/types/src/util/table.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +29 -29
- package/src/components/Table/ColumnActionsMenu.tsx +8 -8
- package/src/components/Table/ColumnSettings.tsx +11 -11
- package/src/components/Table/CreateRefPanel.tsx +10 -10
- package/src/components/Table/RefPanel.tsx +9 -9
- package/src/components/Table/RowActionsMenu.tsx +6 -7
- package/src/components/Table/Table.stories.tsx +40 -23
- package/src/components/Table/Table.tsx +235 -148
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +13 -12
- package/src/components/TableCellEditor/TableCellEditor.tsx +6 -4
- package/src/components/testing.ts +10 -8
- package/src/index.ts +2 -0
- package/src/model/index.ts +1 -0
- package/src/model/modal-controller.ts +15 -48
- package/src/model/selection-model.ts +12 -1
- package/src/model/table-model.test.ts +4 -71
- package/src/model/table-model.ts +59 -232
- package/src/model/table-presentation.test.ts +102 -0
- package/src/model/table-presentation.ts +214 -0
- package/src/playwright/TableManager.ts +5 -1
- package/src/playwright/smoke.spec.ts +64 -1
- package/src/types/table.ts +3 -3
- package/src/util/index.ts +1 -0
- package/src/util/table-buttons.ts +97 -48
- package/src/util/table-controls.ts +71 -7
- package/src/util/table.ts +21 -13
|
@@ -1,87 +1,71 @@
|
|
|
1
1
|
import { S } from '@dxos/echo-schema';
|
|
2
2
|
import { TableType } from '../types';
|
|
3
|
-
export declare const TestSchema: import("@dxos/echo-schema").
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
netWorth
|
|
9
|
-
}
|
|
10
|
-
id: string;
|
|
11
|
-
}, S.Struct.Encoded<{
|
|
3
|
+
export declare const TestSchema: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
4
|
+
id: typeof S.String;
|
|
5
|
+
name: S.optional<typeof S.String>;
|
|
6
|
+
age: S.optional<typeof S.Number>;
|
|
7
|
+
active: S.optional<typeof S.Boolean>;
|
|
8
|
+
netWorth: S.optional<typeof S.Number>;
|
|
9
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
12
10
|
id: typeof S.String;
|
|
13
11
|
name: S.optional<typeof S.String>;
|
|
14
12
|
age: S.optional<typeof S.Number>;
|
|
15
13
|
active: S.optional<typeof S.Boolean>;
|
|
16
14
|
netWorth: S.optional<typeof S.Number>;
|
|
17
15
|
}>>;
|
|
18
|
-
export declare const createTable: (schema?: import("@dxos/echo-schema").
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
netWorth
|
|
24
|
-
}
|
|
25
|
-
id: string;
|
|
26
|
-
}, S.Struct.Encoded<{
|
|
16
|
+
export declare const createTable: (schema?: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
17
|
+
id: typeof S.String;
|
|
18
|
+
name: S.optional<typeof S.String>;
|
|
19
|
+
age: S.optional<typeof S.Number>;
|
|
20
|
+
active: S.optional<typeof S.Boolean>;
|
|
21
|
+
netWorth: S.optional<typeof S.Number>;
|
|
22
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
27
23
|
id: typeof S.String;
|
|
28
24
|
name: S.optional<typeof S.String>;
|
|
29
25
|
age: S.optional<typeof S.Number>;
|
|
30
26
|
active: S.optional<typeof S.Boolean>;
|
|
31
27
|
netWorth: S.optional<typeof S.Number>;
|
|
32
|
-
}>>) => import("@dxos/react-client/echo").ReactiveObject<{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
view
|
|
36
|
-
name: string
|
|
37
|
-
schema
|
|
38
|
-
|
|
39
|
-
fields: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
[x: string]: any;
|
|
74
|
-
} | undefined;
|
|
75
|
-
context?: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>;
|
|
76
|
-
} & {
|
|
77
|
-
id: string;
|
|
78
|
-
}>[];
|
|
79
|
-
} & {
|
|
80
|
-
id: string;
|
|
81
|
-
}>[] | undefined;
|
|
82
|
-
} & {
|
|
83
|
-
id: string;
|
|
84
|
-
}>;
|
|
28
|
+
}>>) => import("@dxos/react-client/echo").ReactiveObject<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
29
|
+
readonly id: import("@dxos/echo-schema").ObjectIdClass;
|
|
30
|
+
readonly name: S.optional<typeof S.String>;
|
|
31
|
+
readonly view: S.optional<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
32
|
+
name: S.SchemaClass<string, string, never>;
|
|
33
|
+
query: S.Schema<import("@dxos/echo-schema").QueryType, import("@dxos/echo-schema").QueryType, never>;
|
|
34
|
+
schema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
35
|
+
fields: S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
36
|
+
id: typeof S.String;
|
|
37
|
+
path: S.Schema<import("@dxos/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>;
|
|
38
|
+
visible: S.optional<typeof S.Boolean>;
|
|
39
|
+
size: S.optional<typeof S.Number>;
|
|
40
|
+
referencePath: S.optional<S.Schema<import("@dxos/echo-schema").JsonPath, import("@dxos/echo-schema").JsonPath, never>>;
|
|
41
|
+
}>>>>;
|
|
42
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
43
|
+
readonly threads: S.optional<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
44
|
+
name: S.optional<typeof S.String>;
|
|
45
|
+
anchor: S.optional<typeof S.String>;
|
|
46
|
+
status: S.optional<S.Union<[S.Literal<["staged"]>, S.Literal<["active"]>, S.Literal<["resolved"]>]>>;
|
|
47
|
+
messages: S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
48
|
+
timestamp: typeof S.String;
|
|
49
|
+
state: S.optional<S.Enums<typeof import("packages/plugins/plugin-space/dist/types/src").MessageState>>;
|
|
50
|
+
sender: S.mutable<S.Struct<{
|
|
51
|
+
contact: S.optional<import("@dxos/echo-schema").Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
52
|
+
name: S.optional<typeof S.String>;
|
|
53
|
+
identifiers: S.mutable<S.Array$<S.Struct<{
|
|
54
|
+
type: typeof S.String;
|
|
55
|
+
value: typeof S.String;
|
|
56
|
+
}>>>;
|
|
57
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
58
|
+
identityKey: S.optional<typeof S.String>;
|
|
59
|
+
email: S.optional<typeof S.String>;
|
|
60
|
+
name: S.optional<typeof S.String>;
|
|
61
|
+
}>>;
|
|
62
|
+
text: typeof S.String;
|
|
63
|
+
parts: S.optional<S.mutable<S.Array$<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>>>;
|
|
64
|
+
properties: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
65
|
+
context: S.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>>;
|
|
66
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
67
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>;
|
|
68
|
+
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>;
|
|
85
69
|
export declare const createItems: (n: number) => {
|
|
86
70
|
name: string;
|
|
87
71
|
age: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0B,CAAC,EAAqC,MAAM,mBAAmB,CAAC;AAMjG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0B,CAAC,EAAqC,MAAM,mBAAmB,CAAC;AAMjG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,eAAO,MAAM,UAAU;;;;;;;;;;;;GAMrB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;cAEP,EACX,WAAM;eAW2B,EAAG,MACvC;gBAGG,EAAG,QAAQ,CAAC,EAAE,MAAM;gBAWrB,EAAG,OAAO,CAAC,EAAG,MAAK,CAAC,EACzB,OAEG,CAAC,EAAG,MAAK;uBAAqB,EAAG,MAAM;kBAAe,EAAI,MAAK;qBACvD,EAAI,QACb,QAAO,EAAG,OAAO;kBACX,EAAG,QACN,QAEA,EAAG,MAAM;2BACR,EAAE,QAAQ,CAAC,EAAE,MAAM;;;;cAwDutD,EAAG,QAAQ,QAAO,EAAG,MAAM;gBAAqD,EAAG,QAAQ,QAAO,EAAG,MAAM;gBAAc,EAAG,QAAQ,CAAC,EAAE,KAA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ourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -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"}
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { type RefObject
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
2
|
import { type ReactiveObject } from '@dxos/live-object';
|
|
3
3
|
export type ColumnSettingsMode = {
|
|
4
4
|
type: 'create';
|
|
@@ -32,7 +32,11 @@ export declare class ModalController {
|
|
|
32
32
|
private readonly _triggerRef;
|
|
33
33
|
get state(): import("@preact/signals-core").Signal<ModalState>;
|
|
34
34
|
get trigger(): RefObject<HTMLButtonElement>;
|
|
35
|
-
|
|
35
|
+
setTrigger: (trigger: HTMLElement) => void;
|
|
36
|
+
showRowMenu: (rowIndex: number) => void;
|
|
37
|
+
showColumnMenu: (fieldId: string) => void;
|
|
38
|
+
showColumnCreator: () => void;
|
|
39
|
+
showReferencePanel: (targetId: string, schemaId: string) => void;
|
|
36
40
|
openColumnSettings: () => void;
|
|
37
41
|
openCreateRef: (typename: string, anchorCell: Element | null, initialValues?: Record<string, string>, onCreate?: (obj: ReactiveObject<any>) => void) => void;
|
|
38
42
|
close: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-controller.d.ts","sourceRoot":"","sources":["../../../../src/model/modal-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"modal-controller.d.ts","sourceRoot":"","sources":["../../../../src/model/modal-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACxD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CAC/C,GACD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IACjE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8E;IAE1G,IAAW,KAAK,sDAEf;IAED,IAAW,OAAO,IACW,SAAS,CAAC,iBAAiB,CAAC,CACxD;IAEM,UAAU,YAAa,WAAW,UAEvC;IAEK,WAAW,aAAc,MAAM,UAEpC;IAEK,cAAc,YAAa,MAAM,UAEtC;IAEK,iBAAiB,aAEtB;IAEK,kBAAkB,aAAc,MAAM,YAAY,MAAM,UAE7D;IAEK,kBAAkB,aAWvB;IAEK,aAAa,aACR,MAAM,cACJ,OAAO,GAAG,IAAI,kBACV,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAC3B,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,UAa7C;IAEK,KAAK,aAEV;CACH"}
|
|
@@ -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;
|
|
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,KAAG,OAAO,CAE5C;IAMK,0BAA0B,aAAc,MAAM,KAAG,IAAI,CAW1D;IAEK,YAAY,SAAU,KAAK,GAAG,MAAM,KAAG,IAAI,CAWhD;CACH"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type ReadonlySignal } from '@preact/signals-core';
|
|
2
2
|
import { Resource } from '@dxos/context';
|
|
3
3
|
import { type JsonProp } from '@dxos/echo-schema';
|
|
4
|
-
import { type DxGridAxisMeta, type
|
|
4
|
+
import { type DxGridAxisMeta, type DxGridPlanePosition, type DxGridPosition } from '@dxos/react-ui-grid';
|
|
5
5
|
import { type ViewProjection } from '@dxos/schema';
|
|
6
|
-
import { ModalController } from './modal-controller';
|
|
7
6
|
import { SelectionModel } from './selection-model';
|
|
8
7
|
import { type TableType } from '../types';
|
|
9
8
|
export type SortDirection = 'asc' | 'desc';
|
|
@@ -54,26 +53,18 @@ export declare class TableModel<T extends BaseTableRow = {
|
|
|
54
53
|
private _pinnedRows;
|
|
55
54
|
private _selection;
|
|
56
55
|
private _columnMeta?;
|
|
57
|
-
private readonly _modalController;
|
|
58
56
|
constructor({ table, projection, sorting, pinnedRows, onCellUpdate, onDeleteColumn, onDeleteRows, onInsertRow, onRowOrderChanged, }: TableModelProps<T>);
|
|
59
57
|
get table(): TableType;
|
|
60
58
|
get projection(): ViewProjection;
|
|
59
|
+
get rows(): ReadonlySignal<T[]>;
|
|
61
60
|
get pinnedRows(): NonNullable<TableModelProps<T>['pinnedRows']>;
|
|
62
61
|
get columnMeta(): ReadonlySignal<DxGridAxisMeta>;
|
|
63
62
|
get sorting(): SortConfig | undefined;
|
|
64
|
-
get modalController(): ModalController;
|
|
65
63
|
get selection(): SelectionModel<T>;
|
|
66
64
|
protected _open(): Promise<void>;
|
|
67
65
|
private initializeColumnMeta;
|
|
68
66
|
private initializeSorting;
|
|
69
67
|
private initializeEffects;
|
|
70
|
-
getCells: (range: DxGridPlaneRange, plane: DxGridPlane) => DxGridPlaneCells;
|
|
71
|
-
private getMainGridCells;
|
|
72
|
-
private getHeaderCells;
|
|
73
|
-
private getSelectionColumnCells;
|
|
74
|
-
private getActionColumnCells;
|
|
75
|
-
private getSelectAllCell;
|
|
76
|
-
private getNewColumnCell;
|
|
77
68
|
setRows: (obj: T[]) => void;
|
|
78
69
|
getRowCount: () => number;
|
|
79
70
|
getColumnCount: () => number;
|
|
@@ -81,8 +72,13 @@ export declare class TableModel<T extends BaseTableRow = {
|
|
|
81
72
|
deleteRow: (rowIndex: number) => void;
|
|
82
73
|
getCellData: ({ col, row }: DxGridPlanePosition) => any;
|
|
83
74
|
setCellData: ({ col, row }: DxGridPlanePosition, value: any) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Updates a cell's value using a transform function.
|
|
77
|
+
* @param {DxGridPlanePosition} position - The position of the cell to update.
|
|
78
|
+
* @param {(value: any) => any} update - A function that takes the current value and returns the updated value.
|
|
79
|
+
*/
|
|
80
|
+
updateCellData({ col, row }: DxGridPlanePosition, update: (value: any) => any): void;
|
|
84
81
|
deleteColumn(fieldId: string): void;
|
|
85
|
-
handleGridClick: (event: React.MouseEvent) => void;
|
|
86
82
|
setColumnWidth(columnIndex: number, width: number): void;
|
|
87
83
|
setSort(fieldId: string, direction: SortDirection): void;
|
|
88
84
|
clearSort(): void;
|
|
@@ -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;AAGrF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
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;AAGrF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAKlF,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,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,aAAa,CAAA;CAAE,CAAC;AAEvE,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,K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AAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAexD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,IAAI;IAIxD,SAAS,IAAI,IAAI;IASjB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI;IAItD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAIxC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type DxGridPlane, type DxGridPlaneCells, type DxGridPlaneRange } from '@dxos/react-ui-grid';
|
|
2
|
+
import { type BaseTableRow, type TableModel } from './table-model';
|
|
3
|
+
/**
|
|
4
|
+
* Presentation layer for a table component, handling cell rendering and grid display logic.
|
|
5
|
+
* Manages rendering of table cells, headers, selection columns, and action columns across
|
|
6
|
+
* different grid planes.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TablePresentation<T extends BaseTableRow = {
|
|
9
|
+
id: string;
|
|
10
|
+
}> {
|
|
11
|
+
private readonly model;
|
|
12
|
+
private readonly _visibleRange;
|
|
13
|
+
constructor(model: TableModel<T>, _visibleRange?: import("@preact/signals-core").Signal<DxGridPlaneRange>);
|
|
14
|
+
getCells(range: DxGridPlaneRange, plane: DxGridPlane): DxGridPlaneCells;
|
|
15
|
+
private getMainGridCells;
|
|
16
|
+
private getHeaderCells;
|
|
17
|
+
private getSelectionColumnCells;
|
|
18
|
+
private getActionColumnCells;
|
|
19
|
+
private getSelectAllCell;
|
|
20
|
+
private getNewColumnCell;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=table-presentation.d.ts.map
|
|
@@ -0,0 +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;IAoFxB,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,gBAAgB;CAWzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-presentation.test.d.ts","sourceRoot":"","sources":["../../../../src/model/table-presentation.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Page } from '@playwright/test';
|
|
1
|
+
import { type Locator, type Page } from '@playwright/test';
|
|
2
2
|
import { DxGridManager } from '@dxos/lit-grid/testing';
|
|
3
3
|
export declare class TableManager {
|
|
4
4
|
private readonly page;
|
|
@@ -8,6 +8,7 @@ export declare class TableManager {
|
|
|
8
8
|
deleteColumn(index: number): Promise<void>;
|
|
9
9
|
deleteRow(index?: number): Promise<void>;
|
|
10
10
|
toggleSelectAll(): Promise<void>;
|
|
11
|
+
selection(index: number): Locator;
|
|
11
12
|
sortColumn(index: number, direction: 'ascending' | 'descending'): Promise<void>;
|
|
12
13
|
addColumn({ label, format }: {
|
|
13
14
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableManager.d.ts","sourceRoot":"","sources":["../../../../src/playwright/TableManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"TableManager.d.ts","sourceRoot":"","sources":["../../../../src/playwright/TableManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAevD,qBAAa,YAAY;IAGX,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;gBAET,IAAI,EAAE,IAAI;IAIvC,IAAW,IAAI,IAAI,aAAa,CAE/B;IAEY,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1C,SAAS,CAAC,KAAK,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAItC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAI3B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,GAAG,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/E,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ9F"}
|