@osdk/react-components 0.1.0-beta.0 → 0.1.0-beta.1
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/CHANGELOG.md +16 -0
- package/README.md +56 -6
- package/build/browser/object-table/ObjectTable.js +70 -0
- package/build/browser/object-table/ObjectTable.js.map +1 -0
- package/build/browser/object-table/ObjectTableApi.js.map +1 -1
- package/build/browser/object-table/Table.js +77 -0
- package/build/browser/object-table/Table.js.map +1 -0
- package/build/browser/object-table/TableBody.js +54 -0
- package/build/browser/object-table/TableBody.js.map +1 -0
- package/build/browser/object-table/TableHeader.js +47 -0
- package/build/browser/object-table/TableHeader.js.map +1 -0
- package/build/browser/object-table/TableRow.js +44 -0
- package/build/browser/object-table/TableRow.js.map +1 -0
- package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js +508 -0
- package/build/browser/object-table/hooks/__tests__/useColumnDefs.test.js.map +1 -0
- package/build/browser/object-table/hooks/__tests__/useDefaultTableStates.test.js +178 -0
- package/build/browser/object-table/hooks/__tests__/useDefaultTableStates.test.js.map +1 -0
- package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js +217 -0
- package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js.map +1 -0
- package/build/browser/object-table/hooks/useColumnDefs.js +87 -0
- package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -0
- package/build/browser/object-table/hooks/useDefaultTableStates.js +43 -0
- package/build/browser/object-table/hooks/useDefaultTableStates.js.map +1 -0
- package/build/browser/object-table/hooks/useObjectTableData.js +48 -0
- package/build/browser/object-table/hooks/useObjectTableData.js.map +1 -0
- package/build/browser/public/experimental.js +17 -1
- package/build/browser/public/experimental.js.map +1 -1
- package/build/cjs/public/experimental.cjs +3880 -0
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +36 -9
- package/build/esm/object-table/ObjectTable.js +70 -0
- package/build/esm/object-table/ObjectTable.js.map +1 -0
- package/build/esm/object-table/ObjectTableApi.js.map +1 -1
- package/build/esm/object-table/Table.js +77 -0
- package/build/esm/object-table/Table.js.map +1 -0
- package/build/esm/object-table/TableBody.js +54 -0
- package/build/esm/object-table/TableBody.js.map +1 -0
- package/build/esm/object-table/TableHeader.js +47 -0
- package/build/esm/object-table/TableHeader.js.map +1 -0
- package/build/esm/object-table/TableRow.js +44 -0
- package/build/esm/object-table/TableRow.js.map +1 -0
- package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js +508 -0
- package/build/esm/object-table/hooks/__tests__/useColumnDefs.test.js.map +1 -0
- package/build/esm/object-table/hooks/__tests__/useDefaultTableStates.test.js +178 -0
- package/build/esm/object-table/hooks/__tests__/useDefaultTableStates.test.js.map +1 -0
- package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js +217 -0
- package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js.map +1 -0
- package/build/esm/object-table/hooks/useColumnDefs.js +87 -0
- package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -0
- package/build/esm/object-table/hooks/useDefaultTableStates.js +43 -0
- package/build/esm/object-table/hooks/useDefaultTableStates.js.map +1 -0
- package/build/esm/object-table/hooks/useObjectTableData.js +48 -0
- package/build/esm/object-table/hooks/useObjectTableData.js.map +1 -0
- package/build/esm/public/experimental.js +17 -1
- package/build/esm/public/experimental.js.map +1 -1
- package/build/types/object-table/ObjectTable.d.ts +16 -0
- package/build/types/object-table/ObjectTable.d.ts.map +1 -0
- package/build/types/object-table/ObjectTableApi.d.ts +27 -12
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/Table.d.ts +11 -0
- package/build/types/object-table/Table.d.ts.map +1 -0
- package/build/types/object-table/TableBody.d.ts +10 -0
- package/build/types/object-table/TableBody.d.ts.map +1 -0
- package/build/types/object-table/TableHeader.d.ts +7 -0
- package/build/types/object-table/TableHeader.d.ts.map +1 -0
- package/build/types/object-table/TableRow.d.ts +10 -0
- package/build/types/object-table/TableRow.d.ts.map +1 -0
- package/build/types/object-table/hooks/__tests__/useColumnDefs.test.d.ts.map +1 -0
- package/build/types/object-table/hooks/__tests__/useDefaultTableStates.test.d.ts +1 -0
- package/build/types/object-table/hooks/__tests__/useDefaultTableStates.test.d.ts.map +1 -0
- package/build/types/object-table/hooks/__tests__/useObjectTableData.test.d.ts +1 -0
- package/build/types/object-table/hooks/__tests__/useObjectTableData.test.d.ts.map +1 -0
- package/build/types/object-table/hooks/useColumnDefs.d.ts +20 -0
- package/build/types/object-table/hooks/useColumnDefs.d.ts.map +1 -0
- package/build/types/object-table/hooks/useDefaultTableStates.d.ts +19 -0
- package/build/types/object-table/hooks/useDefaultTableStates.d.ts.map +1 -0
- package/build/types/object-table/hooks/useObjectTableData.d.ts +13 -0
- package/build/types/object-table/hooks/useObjectTableData.d.ts.map +1 -0
- package/build/types/public/experimental.d.ts +2 -1
- package/build/types/public/experimental.d.ts.map +1 -1
- package/package.json +9 -4
- package/build/browser/junk.test.js +0 -23
- package/build/browser/junk.test.js.map +0 -1
- package/build/esm/junk.test.js +0 -23
- package/build/esm/junk.test.js.map +0 -1
- package/build/types/junk.test.d.ts.map +0 -1
- /package/build/types/{junk.test.d.ts → object-table/hooks/__tests__/useColumnDefs.test.d.ts} +0 -0
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export { ObjectTable } from "../object-table/ObjectTable.js";
|
|
2
18
|
//# sourceMappingURL=experimental.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","names":[],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { FilterListProps } from \"../filter-list/FilterListApi.js\";\nexport type { FilterListItemProps } from \"../filter-list/FilterListItemApi.js\";\n\nexport type {
|
|
1
|
+
{"version":3,"file":"experimental.js","names":["ObjectTable"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { FilterListProps } from \"../filter-list/FilterListApi.js\";\nexport type { FilterListItemProps } from \"../filter-list/FilterListItemApi.js\";\n\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n ObjectTableProps,\n} from \"../object-table/ObjectTableApi.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,SAASA,WAAW,QAAQ,gCAAgC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ObjectTypeDefinition, QueryDefinition, SimplePropertyDef } from "@osdk/api";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { ObjectTableProps } from "./ObjectTableApi.js";
|
|
4
|
+
/**
|
|
5
|
+
* ObjectTable - A headless table component for displaying OSDK object sets
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <ObjectTable objectSet={myObjectSet} objectType={MyObjectType} />
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare function ObjectTable<
|
|
13
|
+
Q extends ObjectTypeDefinition,
|
|
14
|
+
RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,
|
|
15
|
+
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
16
|
+
>({ objectSet, objectType, columnDefinitions, onRowClick, rowHeight }: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cACE,sBAGA,iBACA,yBACK,WAAY;AAEnB,OAAO,WAAW,OAAQ;AAI1B,cAAc,wBAAwB,qBAAsB;;;;;;;;;AAY5D,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB;CAIjD,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;EAI9D,EACA,WACA,YACA,mBACA,YACA,WAC2C,EAA1C,iBAAiB,GAAG,MAAM,mBAAmB,MAAM","names":[],"sources":["../../../src/object-table/ObjectTable.tsx"],"version":3,"file":"ObjectTable.d.ts"}
|
|
@@ -2,11 +2,17 @@ import type { DerivedProperty, ObjectSet, ObjectTypeDefinition, Osdk, PrimaryKey
|
|
|
2
2
|
import type * as React from "react";
|
|
3
3
|
export type ColumnDefinition<
|
|
4
4
|
Q extends ObjectTypeDefinition,
|
|
5
|
-
RDPs extends Record<string, SimplePropertyDef>,
|
|
6
|
-
FunctionColumns extends Record<string, QueryDefinition<{}>>
|
|
5
|
+
RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,
|
|
6
|
+
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
7
7
|
> = {
|
|
8
8
|
locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>
|
|
9
|
+
/**
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
9
12
|
isVisible?: boolean
|
|
13
|
+
/**
|
|
14
|
+
* @default none
|
|
15
|
+
*/
|
|
10
16
|
pinned?: "left" | "right" | "none"
|
|
11
17
|
width?: number
|
|
12
18
|
minWidth?: number
|
|
@@ -14,16 +20,16 @@ export type ColumnDefinition<
|
|
|
14
20
|
resizable?: boolean
|
|
15
21
|
orderable?: boolean
|
|
16
22
|
filterable?: boolean
|
|
17
|
-
renderCell?: (object: Osdk.Instance<Q>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => React.ReactNode
|
|
23
|
+
renderCell?: (object: Osdk.Instance<Q, "$allBaseProperties", PropertyKeys<Q>, RDPs>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => React.ReactNode
|
|
18
24
|
renderHeader?: () => React.ReactNode
|
|
19
25
|
};
|
|
20
|
-
type ColumnDefinitionLocator<
|
|
26
|
+
export type ColumnDefinitionLocator<
|
|
21
27
|
Q extends ObjectTypeDefinition,
|
|
22
|
-
RDPs extends Record<string, SimplePropertyDef>,
|
|
23
|
-
FunctionColumns extends Record<string, QueryDefinition<{}>> =
|
|
28
|
+
RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,
|
|
29
|
+
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
24
30
|
> = {
|
|
25
31
|
type: "property"
|
|
26
|
-
|
|
32
|
+
id: PropertyKeys<Q>
|
|
27
33
|
} | {
|
|
28
34
|
type: "function"
|
|
29
35
|
id: keyof FunctionColumns
|
|
@@ -34,7 +40,7 @@ type ColumnDefinitionLocator<
|
|
|
34
40
|
};
|
|
35
41
|
export interface ObjectTableProps<
|
|
36
42
|
Q extends ObjectTypeDefinition,
|
|
37
|
-
RDPs extends Record<string, SimplePropertyDef> =
|
|
43
|
+
RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,
|
|
38
44
|
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
39
45
|
> {
|
|
40
46
|
/**
|
|
@@ -42,6 +48,10 @@ export interface ObjectTableProps<
|
|
|
42
48
|
*/
|
|
43
49
|
objectSet: ObjectSet<Q>;
|
|
44
50
|
/**
|
|
51
|
+
* The object type of the object
|
|
52
|
+
*/
|
|
53
|
+
objectType: Q;
|
|
54
|
+
/**
|
|
45
55
|
* Ordered list of column definitions to show in the table
|
|
46
56
|
*
|
|
47
57
|
* If not provided, all of the properties of the object type will be shown in default order.
|
|
@@ -124,13 +134,13 @@ export interface ObjectTableProps<
|
|
|
124
134
|
* @param object The object representing the row
|
|
125
135
|
* @param columnDefinition The column definition for the clicked cell
|
|
126
136
|
*/
|
|
127
|
-
onCellClick?: (object: Osdk.Instance<Q>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => void;
|
|
137
|
+
onCellClick?: (object: Osdk.Instance<Q, "$allBaseProperties", PropertyKeys<Q>, RDPs>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => void;
|
|
128
138
|
/**
|
|
129
139
|
* Called when a row is clicked.
|
|
130
140
|
*
|
|
131
141
|
* @param object The object representing the clicked row
|
|
132
142
|
*/
|
|
133
|
-
onRowClick?: (object: Osdk.Instance<Q>) => void;
|
|
143
|
+
onRowClick?: (object: Osdk.Instance<Q, "$allBaseProperties", PropertyKeys<Q>, RDPs>) => void;
|
|
134
144
|
/**
|
|
135
145
|
* Selection mode for the table rows.
|
|
136
146
|
*
|
|
@@ -153,6 +163,11 @@ export interface ObjectTableProps<
|
|
|
153
163
|
/**
|
|
154
164
|
* If provided, will render this context menu when right clicking on a cell
|
|
155
165
|
*/
|
|
156
|
-
renderCellContextMenu?: (object: Osdk.Instance<Q>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => React.ReactNode;
|
|
166
|
+
renderCellContextMenu?: (object: Osdk.Instance<Q, "$allBaseProperties", PropertyKeys<Q>, RDPs>, locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>) => React.ReactNode;
|
|
167
|
+
/**
|
|
168
|
+
* The height of each row in pixels.
|
|
169
|
+
*
|
|
170
|
+
* @default 40
|
|
171
|
+
*/
|
|
172
|
+
rowHeight?: number;
|
|
157
173
|
}
|
|
158
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,iBACA,WACA,sBACA,MACA,gBACA,cACA,iBACA,mBACA,mBACK,WAAY;AACnB,iBAAiB,WAAW,OAAQ;AAEpC,YAAY;CACV,UAAU;CACV,aAAa,eAAe;
|
|
1
|
+
{"mappings":"AAgBA,cACE,iBACA,WACA,sBACA,MACA,gBACA,cACA,iBACA,mBACA,mBACK,WAAY;AACnB,iBAAiB,WAAW,OAAQ;AAEpC,YAAY;CACV,UAAU;CACV,aAAa,eAAe,qBAAqB;CAIjD,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;IAI5D;CACF,SAAS,wBAAwB,GAAG,MAAM;;;;CAK1C;;;;CAKA,SAAS,SAAS,UAAU;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA,cACEA,QAAQ,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI,OAChEC,SAAS,wBAAwB,GAAG,MAAM,qBACvC,MAAM;CACX,qBAAqB,MAAM;AAC5B;AAED,YAAY;CACV,UAAU;CACV,aAAa,eAAe,qBAAqB;CAIjD,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;IAK5D;CACA,MAAM;CACN,IAAI,aAAa;AAClB,IACC;CACA,MAAM;CACN,UAAU;AACX,IACC;CACA,MAAM;CACN,UAAU;CACV,SAAS,gBAAgB,QAAQ,GAAG,WAAW;AAChD;AAEH,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB;CAIjD,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;EAI9D;;;;CAIA,WAAW,UAAU;;;;CAKrB,YAAY;;;;;;CAOZ,oBAAoB,MAAM,iBAAiB,GAAG,MAAM;;;;;;CAOpD;;;;;CAMA,SAAS,YAAY,GAAG;;;;;;;CAQxB,mBAAmBC,UAAU,YAAY,GAAG;;;;;;CAO5C;;;;;CAMA,UAAU,MAAM;EACd,UAAU,aAAa;EACvB,WAAW,QAAQ;CACpB;;;;;;;CAQD,oBACEC,YAAY,MAAM;EAChB,UAAU,aAAa;EACvB,WAAW,QAAQ;CACpB;;;;;;;;CAUH,6BACEC,WAAW,MAAM;EACf,UAAU,aAAa,WAAW,aAAa;EAC/C;CACD;;;;;;;;CAUH,0BACEC,WAAW,MAAM;EACf,UAAU,aAAa,WAAW,aAAa;EAC/C,QAAQ,SAAS,UAAU;CAC5B;;;;;;;CASH,kBACEC,UAAU,aAAa,WAAW,aAAa,iBAC/CC;;;;;;;CASF,eACEP,QAAQ,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI,OAChEC,SAAS,wBAAwB,GAAG,MAAM;;;;;;CAQ5C,cACED,QAAQ,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;;;;CASlE,gBAAgB,WAAW,aAAa;;;;;CAMxC,eAAe,eAAe;;;;;;;CAQ9B,kBAAkBQ,SAAS,eAAe;;;;CAK1C,yBACER,QAAQ,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI,OAChEC,SAAS,wBAAwB,GAAG,MAAM,qBACvC,MAAM;;;;;;CAOX;AACD","names":["object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>","locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>","newWhere: WhereClause<Q, RDPs>","newOrderBy: Array<{\n property: PropertyKeys<Q>;\n direction: \"asc\" | \"desc\";\n }>","newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n isVisible: boolean;\n }>","newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n pinned: \"left\" | \"right\" | \"none\";\n }>","columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns","newWidth: number","objects: PrimaryKeyType<Q>[]"],"sources":["../../../src/object-table/ObjectTableApi.ts"],"version":3,"file":"ObjectTableApi.d.ts"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RowData, Table } from "@tanstack/react-table";
|
|
2
|
+
import { type ReactElement } from "react";
|
|
3
|
+
interface TableProps<TData extends RowData> {
|
|
4
|
+
table: Table<TData>;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
fetchNextPage?: () => Promise<void>;
|
|
7
|
+
onRowClick?: (row: TData) => void;
|
|
8
|
+
rowHeight?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function Table<TData extends RowData>({ table, isLoading, fetchNextPage, onRowClick, rowHeight }: TableProps<TData>): ReactElement;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,SAAS,aAAa,uBAAwB;AAC5D,cAAqB,oBAAyC,OAAQ;UAI5D,WAAW,cAAc,SAAS;CAC1C,OAAO,MAAM;CACb;CACA,sBAAsB;CACtB,cAAcA,KAAK;CACnB;AACD;AAED,OAAO,iBAAS,MAAM,cAAc,SAClC,EAAE,OAAO,WAAW,eAAe,YAAY,WAA8B,EAAjB,WAAW,SACtE","names":["row: TData"],"sources":["../../../src/object-table/Table.tsx"],"version":3,"file":"Table.d.ts"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Row, RowData } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface TableBodyProps<TData extends RowData> {
|
|
4
|
+
rows: Array<Row<TData>>;
|
|
5
|
+
tableContainerRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
onRowClick?: (row: TData) => void;
|
|
7
|
+
rowHeight?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function TableBody<TData extends RowData>({ rows, tableContainerRef, onRowClick, rowHeight }: TableBodyProps<TData>): React.ReactElement;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,KAAK,eAAe,uBAAwB;AAE1D,OAAO,WAAgC,OAAQ;UAGrC,eAAe,cAAc,SAAS;CAC9C,MAAM,MAAM,IAAI;CAChB,mBAAmB,MAAM,UAAU;CACnC,cAAcA,KAAK;CACnB;AACD;AAED,OAAO,iBAAS,UAAU,cAAc,SAAS,EAC/C,MACA,mBACA,YACA,WACsB,EAArB,eAAe,SAAS,MAAM","names":["row: TData"],"sources":["../../../src/object-table/TableBody.tsx"],"version":3,"file":"TableBody.d.ts"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HeaderGroup, RowData } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface TableHeaderProps<TData extends RowData> {
|
|
4
|
+
headerGroups: Array<HeaderGroup<TData>>;
|
|
5
|
+
}
|
|
6
|
+
export declare function TableHeader<TData extends RowData>({ headerGroups }: TableHeaderProps<TData>): React.ReactElement;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,aAAa,eAAe,uBAAwB;AAElE,OAAO,WAAW,OAAQ;UAEhB,iBAAiB,cAAc,SAAS;CAChD,cAAc,MAAM,YAAY;AACjC;AAED,OAAO,iBAAS,YAAY,cAAc,SAAS,EACjD,cACwB,EAAvB,iBAAiB,SAAS,MAAM","names":[],"sources":["../../../src/object-table/TableHeader.tsx"],"version":3,"file":"TableHeader.d.ts"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Row, RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { VirtualItem } from "@tanstack/react-virtual";
|
|
3
|
+
import React from "react";
|
|
4
|
+
interface TableRowProps<TData extends RowData> {
|
|
5
|
+
row: Row<TData>;
|
|
6
|
+
virtualRow: VirtualItem;
|
|
7
|
+
onRowClick?: (row: TData) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function TableRow<TData extends RowData>({ row, virtualRow, onRowClick }: TableRowProps<TData>): React.ReactElement;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,KAAK,eAAe,uBAAwB;AAE1D,cAAc,mBAAmB,yBAA0B;AAC3D,OAAO,WAA4B,OAAQ;UAEjC,cAAc,cAAc,SAAS;CAC7C,KAAK,IAAI;CACT,YAAY;CACZ,cAAcA,KAAK;AACpB;AAED,OAAO,iBAAS,SAAS,cAAc,SAAS,EAC9C,KACA,YACA,YACqB,EAApB,cAAc,SAAS,MAAM","names":["row: TData"],"sources":["../../../src/object-table/TableRow.tsx"],"version":3,"file":"TableRow.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../../src/object-table/hooks/__tests__/useColumnDefs.test.tsx"],"version":3,"file":"useColumnDefs.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../../src/object-table/hooks/__tests__/useDefaultTableStates.test.tsx"],"version":3,"file":"useDefaultTableStates.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../../src/object-table/hooks/__tests__/useObjectTableData.test.tsx"],"version":3,"file":"useObjectTableData.test.d.ts"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ObjectTypeDefinition, Osdk, PropertyKeys, QueryDefinition, SimplePropertyDef } from "@osdk/api";
|
|
2
|
+
import type { AccessorColumnDef } from "@tanstack/react-table";
|
|
3
|
+
import type { ColumnDefinition } from "../ObjectTableApi.js";
|
|
4
|
+
interface UseColumnDefsResult<
|
|
5
|
+
Q extends ObjectTypeDefinition,
|
|
6
|
+
RDPs extends Record<string, SimplePropertyDef> = Record<string, never>
|
|
7
|
+
> {
|
|
8
|
+
columns: AccessorColumnDef<Osdk.Instance<Q, "$allBaseProperties", PropertyKeys<Q>, RDPs>>[];
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Hook which builds column definitions for tanstack-table given the objectSet
|
|
14
|
+
*/
|
|
15
|
+
export declare function useColumnDefs<
|
|
16
|
+
Q extends ObjectTypeDefinition,
|
|
17
|
+
RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,
|
|
18
|
+
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
19
|
+
>(objectType: Q, columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>): UseColumnDefsResult<Q, RDPs>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAEE,sBACA,MACA,cACA,iBACA,yBACK,WAAY;AAEnB,cAAc,yBAAyB,uBAAwB;AAE/D,cAAc,wBAAwB,sBAAuB;UAEnD;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB;EAIjD;CACA,SAAS,kBACP,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;CAG1D;CAEA;AACD;;;;AAKD,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB;CAIjD,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;EAK9DA,YAAY,GACZC,oBAAoB,MAAM,iBAAiB,GAAG,MAAM,oBACnD,oBAAoB,GAAG","names":["objectType: Q","columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>"],"sources":["../../../../src/object-table/hooks/useColumnDefs.ts"],"version":3,"file":"useColumnDefs.d.ts"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ObjectTypeDefinition, QueryDefinition, SimplePropertyDef } from "@osdk/api";
|
|
2
|
+
import type { VisibilityState } from "@tanstack/react-table";
|
|
3
|
+
import type { ObjectTableProps } from "../ObjectTableApi.js";
|
|
4
|
+
interface UseDefaultTableStatesProps<
|
|
5
|
+
Q extends ObjectTypeDefinition,
|
|
6
|
+
RDPs extends Record<string, SimplePropertyDef> = {},
|
|
7
|
+
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
8
|
+
> {
|
|
9
|
+
columnDefinitions: ObjectTableProps<Q, RDPs, FunctionColumns>["columnDefinitions"];
|
|
10
|
+
}
|
|
11
|
+
interface UseDefaultTableStatesResult {
|
|
12
|
+
columnVisibility: VisibilityState | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare const useDefaultTableStates: <
|
|
15
|
+
Q extends ObjectTypeDefinition,
|
|
16
|
+
RDPs extends Record<string, SimplePropertyDef> = {},
|
|
17
|
+
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
18
|
+
>({ columnDefinitions }: UseDefaultTableStatesProps<Q, RDPs, FunctionColumns>) => UseDefaultTableStatesResult;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cACE,sBACA,iBACA,yBACK,WAAY;AACnB,cAAc,uBAAuB,uBAAwB;AAE7D,cAAc,wBAAwB,sBAAuB;UAEnD;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;EAI9D;CACA,mBAAmB,iBACjB,GACA,MACA,iBACA;AACH;UAES,4BAA4B;CACpC,kBAAkB;AACnB;AAED,OAAO,cAAM;CACX,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;EAK9D,EAAE,mBAID,EAJsB,2BACrB,GACA,MACA,qBAED","names":[],"sources":["../../../../src/object-table/hooks/useDefaultTableStates.ts"],"version":3,"file":"useDefaultTableStates.d.ts"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ObjectSet, ObjectTypeDefinition, QueryDefinition, SimplePropertyDef } from "@osdk/api";
|
|
2
|
+
import { useObjectSet } from "@osdk/react/experimental";
|
|
3
|
+
import type { ColumnDefinition } from "../ObjectTableApi.js";
|
|
4
|
+
/**
|
|
5
|
+
* This hook is a wrapper around useObjectSet
|
|
6
|
+
* It extracts RDP locators from columnDefinitions and calls useObjectSet + withProperties
|
|
7
|
+
* to return data containing the derived properties.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useObjectTableData<
|
|
10
|
+
Q extends ObjectTypeDefinition,
|
|
11
|
+
RDPs extends Record<string, SimplePropertyDef>,
|
|
12
|
+
FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<string, never>
|
|
13
|
+
>(objectSet: ObjectSet<Q>, columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>): ReturnType<typeof useObjectSet<Q, never, RDPs>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAEE,WACA,sBACA,iBACA,yBACK,WAAY;AACnB,SAAS,oBAAoB,0BAA2B;AAExD,cAAc,wBAAwB,sBAAuB;;;;;;AAU7D,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe;CAC5B,wBAAwB,eAAe,gBAAgB,CAAE,MAAK;EAK9DA,WAAW,UAAU,IACrBC,oBAAoB,MAAM,iBAAiB,GAAG,MAAM,oBACnD,kBAAkB,aAAa,UAAU","names":["objectSet: ObjectSet<Q>","columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>"],"sources":["../../../../src/object-table/hooks/useObjectTableData.ts"],"version":3,"file":"useObjectTableData.d.ts"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { FilterListProps } from "../filter-list/FilterListApi.js";
|
|
2
2
|
export type { FilterListItemProps } from "../filter-list/FilterListItemApi.js";
|
|
3
|
-
export
|
|
3
|
+
export { ObjectTable } from "../object-table/ObjectTable.js";
|
|
4
|
+
export type { ColumnDefinition, ColumnDefinitionLocator, ObjectTableProps } from "../object-table/ObjectTableApi.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,uBAAuB;AACrC,cAAc,2BAA2B;AAEzC,
|
|
1
|
+
{"mappings":"AAgBA,cAAc,uBAAuB;AACrC,cAAc,2BAA2B;AAEzC,SAAS,mBAAmB;AAC5B,cACE,kBACA,yBACA,wBACK","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/react-components",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,14 +44,19 @@
|
|
|
44
44
|
"react-dom": "^17 || ^18 || ^19"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
+
"@tanstack/react-table": "^8.21.3",
|
|
48
|
+
"@tanstack/react-virtual": "^3.13.13",
|
|
49
|
+
"@testing-library/react": "^16.3.0",
|
|
47
50
|
"@types/react": "^18.3.24",
|
|
51
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
52
|
+
"p-defer": "^4.0.1",
|
|
48
53
|
"react": "^18.3.1",
|
|
49
54
|
"typescript": "~5.5.4",
|
|
50
|
-
"@osdk/api": "2.7.0-beta.
|
|
51
|
-
"@osdk/client": "2.7.0-beta.5",
|
|
55
|
+
"@osdk/api": "2.7.0-beta.6",
|
|
52
56
|
"@osdk/monorepo.api-extractor": "~0.6.0-beta.1",
|
|
57
|
+
"@osdk/client": "2.7.0-beta.6",
|
|
53
58
|
"@osdk/monorepo.tsconfig": "~0.6.0-beta.1",
|
|
54
|
-
"@osdk/react": "0.9.0-beta.
|
|
59
|
+
"@osdk/react": "0.9.0-beta.4"
|
|
55
60
|
},
|
|
56
61
|
"publishConfig": {
|
|
57
62
|
"access": "public"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { describe, expect, it } from "vitest";
|
|
18
|
-
describe("anything", () => {
|
|
19
|
-
it("does", async () => {
|
|
20
|
-
expect(1).toBe(1);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=junk.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"junk.test.js","names":["describe","expect","it","toBe"],"sources":["junk.test.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expect, it } from \"vitest\";\n\ndescribe(\"anything\", () => {\n it(\"does\", async () => {\n expect(1).toBe(1);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7CF,QAAQ,CAAC,UAAU,EAAE,MAAM;EACzBE,EAAE,CAAC,MAAM,EAAE,YAAY;IACrBD,MAAM,CAAC,CAAC,CAAC,CAACE,IAAI,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/build/esm/junk.test.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { describe, expect, it } from "vitest";
|
|
18
|
-
describe("anything", () => {
|
|
19
|
-
it("does", async () => {
|
|
20
|
-
expect(1).toBe(1);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=junk.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"junk.test.js","names":["describe","expect","it","toBe"],"sources":["junk.test.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expect, it } from \"vitest\";\n\ndescribe(\"anything\", () => {\n it(\"does\", async () => {\n expect(1).toBe(1);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7CF,QAAQ,CAAC,UAAU,EAAE,MAAM;EACzBE,EAAE,CAAC,MAAM,EAAE,YAAY;IACrBD,MAAM,CAAC,CAAC,CAAC,CAACE,IAAI,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"","names":[],"sources":["../../src/junk.test.ts"],"version":3,"file":"junk.test.d.ts"}
|
/package/build/types/{junk.test.d.ts → object-table/hooks/__tests__/useColumnDefs.test.d.ts}
RENAMED
|
File without changes
|