Skip to content

Commit 0ffc54b

Browse files
committed
BaseDataSOurce tests next Viewport
1 parent 30baff4 commit 0ffc54b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3214
-709
lines changed

vuu-ui/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vuu-ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"type": "module",
1212
"workspaces": [
13+
"experiments/**",
1314
"packages/**",
1415
"sample-apps/**",
1516
"tools/vite-plugin-inline-css",

vuu-ui/packages/grid-layout/src/GridLayoutStackedtem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export const GridLayoutStackedItem = ({
6262

6363
console.log(`[GridLayoutStackedItem#${id}] render`);
6464

65+
console.log(`[GridLayoutStackedItem#${id}] render`);
66+
6567
const { registerTabsForDragDrop } = useDragContext();
6668

6769
useEffect(() => {

vuu-ui/packages/vuu-data-local/src/array-data-source/array-data-source.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,19 @@ export interface ArrayDataSourceConstructorProps
7474
const toDataSourceRow =
7575
(key: number) =>
7676
(data: VuuRowDataItemType[], index: number): DataSourceRow => {
77-
return [index, index, true, false, 1, 0, String(data[key]), 0, ...data];
77+
return [
78+
index,
79+
index,
80+
true,
81+
false,
82+
1,
83+
0,
84+
String(data[key]),
85+
0,
86+
0, // ts
87+
false, // isNew
88+
...data,
89+
];
7890
};
7991

8092
// const isError = (err: unknown): err is { message: string } =>

vuu-ui/packages/vuu-data-local/src/array-data-source/group-utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export type GroupMap = { [key: string]: GroupMap | KeyList };
77

88
const { DEPTH, IS_EXPANDED, KEY } = metadataKeys;
99

10+
const timestamp = 0;
11+
const isNew = false;
12+
1013
export const collapseGroup = (
1114
key: string,
1215
groupedRows: readonly DataSourceRow[],
@@ -88,6 +91,8 @@ const dataRowsFromGroups2 = (
8891
childCount(groupMap[key]),
8992
groupKey,
9093
0,
94+
timestamp,
95+
isNew,
9196
];
9297
// TODO whats this
9398
row[groupIndices[depth - 1]] = key;
@@ -185,6 +190,8 @@ const dataRowsFromGroups = (groupTree: GroupMap, groupIndices: number[]) => {
185190
childCount(groupTree[key]),
186191
`$root|${key}`,
187192
0,
193+
timestamp,
194+
isNew,
188195
];
189196
row[groupIndices[depth]] = key;
190197
rows.push(row);

vuu-ui/packages/vuu-data-react/src/datasource-provider/RestDataSourceProvider.tsx

Lines changed: 0 additions & 116 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export * from "./RestDataSourceProvider";
21
export * from "./VuuDataSourceProvider";
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {
2+
DataSourceRow,
3+
DataSourceSubscribeProps,
4+
WithFullConfig,
5+
} from "@vuu-ui/vuu-data-types";
6+
import {
7+
VuuDataRow,
8+
VuuRange,
9+
VuuRow,
10+
VuuTable,
11+
VuuViewportChangeRequest,
12+
VuuViewportCreateRequest,
13+
VuuViewportRangeRequest,
14+
} from "@vuu-ui/vuu-protocol-types";
15+
16+
export interface IViewport {
17+
receiveRowsFromServer: (
18+
rows: VuuRow<VuuDataRow>[],
19+
) => [number | undefined, DataSourceRow[] | undefined];
20+
serverViewportId: string;
21+
setClientRange: (
22+
range: VuuRange,
23+
) => [DataSourceRow[] | undefined, VuuViewportRangeRequest | undefined];
24+
setConfig: (
25+
requestId: string,
26+
config: WithFullConfig,
27+
) => VuuViewportChangeRequest;
28+
subscribe: (
29+
subscriptionProps: DataSourceSubscribeProps & { table?: VuuTable },
30+
) => VuuViewportCreateRequest;
31+
}

0 commit comments

Comments
 (0)