@osdk/react-components 0.1.0-beta.2 → 0.1.0-beta.4

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 (76) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +51 -1
  3. package/build/browser/base-components/checkbox/Checkbox.js +40 -0
  4. package/build/browser/base-components/checkbox/Checkbox.js.map +1 -0
  5. package/build/browser/base-components/checkbox/Checkbox.module.css +73 -0
  6. package/build/browser/css-modules.d.ts +20 -0
  7. package/build/browser/object-table/CellContextMenu.js +2 -2
  8. package/build/browser/object-table/CellContextMenu.js.map +1 -1
  9. package/build/browser/object-table/CellContextMenu.module.css +20 -0
  10. package/build/browser/object-table/ObjectTable.js +2 -1
  11. package/build/browser/object-table/ObjectTable.js.map +1 -1
  12. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  13. package/build/browser/object-table/SelectionCells.js +11 -33
  14. package/build/browser/object-table/SelectionCells.js.map +1 -1
  15. package/build/browser/object-table/Table.js +6 -15
  16. package/build/browser/object-table/Table.js.map +1 -1
  17. package/build/browser/object-table/Table.module.css +21 -0
  18. package/build/browser/object-table/TableBody.js +2 -2
  19. package/build/browser/object-table/TableBody.js.map +1 -1
  20. package/build/browser/object-table/TableBody.module.css +20 -0
  21. package/build/browser/object-table/TableCell.js +5 -3
  22. package/build/browser/object-table/TableCell.js.map +1 -1
  23. package/build/browser/object-table/TableCell.module.css +46 -0
  24. package/build/browser/object-table/TableHeader.js +12 -30
  25. package/build/browser/object-table/TableHeader.js.map +1 -1
  26. package/build/browser/object-table/TableHeader.module.css +78 -0
  27. package/build/browser/object-table/TableRow.js +4 -3
  28. package/build/browser/object-table/TableRow.js.map +1 -1
  29. package/build/browser/object-table/TableRow.module.css +60 -0
  30. package/build/cjs/public/experimental.cjs +143 -3716
  31. package/build/cjs/public/experimental.cjs.map +1 -1
  32. package/build/cjs/public/experimental.css +180 -0
  33. package/build/cjs/public/experimental.css.map +1 -0
  34. package/build/cjs/public/experimental.d.cts +1 -0
  35. package/build/esm/base-components/checkbox/Checkbox.js +40 -0
  36. package/build/esm/base-components/checkbox/Checkbox.js.map +1 -0
  37. package/build/esm/base-components/checkbox/Checkbox.module.css +73 -0
  38. package/build/esm/css-modules.d.ts +20 -0
  39. package/build/esm/object-table/CellContextMenu.js +2 -2
  40. package/build/esm/object-table/CellContextMenu.js.map +1 -1
  41. package/build/esm/object-table/CellContextMenu.module.css +20 -0
  42. package/build/esm/object-table/ObjectTable.js +2 -1
  43. package/build/esm/object-table/ObjectTable.js.map +1 -1
  44. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  45. package/build/esm/object-table/SelectionCells.js +11 -33
  46. package/build/esm/object-table/SelectionCells.js.map +1 -1
  47. package/build/esm/object-table/Table.js +6 -15
  48. package/build/esm/object-table/Table.js.map +1 -1
  49. package/build/esm/object-table/Table.module.css +21 -0
  50. package/build/esm/object-table/TableBody.js +2 -2
  51. package/build/esm/object-table/TableBody.js.map +1 -1
  52. package/build/esm/object-table/TableBody.module.css +20 -0
  53. package/build/esm/object-table/TableCell.js +5 -3
  54. package/build/esm/object-table/TableCell.js.map +1 -1
  55. package/build/esm/object-table/TableCell.module.css +46 -0
  56. package/build/esm/object-table/TableHeader.js +12 -30
  57. package/build/esm/object-table/TableHeader.js.map +1 -1
  58. package/build/esm/object-table/TableHeader.module.css +78 -0
  59. package/build/esm/object-table/TableRow.js +4 -3
  60. package/build/esm/object-table/TableRow.js.map +1 -1
  61. package/build/esm/object-table/TableRow.module.css +60 -0
  62. package/build/types/base-components/checkbox/Checkbox.d.ts +10 -0
  63. package/build/types/base-components/checkbox/Checkbox.d.ts.map +1 -0
  64. package/build/types/css-modules.d.d.ts +6 -0
  65. package/build/types/css-modules.d.d.ts.map +1 -0
  66. package/build/types/object-table/CellContextMenu.d.ts.map +1 -1
  67. package/build/types/object-table/ObjectTableApi.d.ts +1 -0
  68. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  69. package/build/types/object-table/SelectionCells.d.ts.map +1 -1
  70. package/build/types/object-table/Table.d.ts +2 -1
  71. package/build/types/object-table/Table.d.ts.map +1 -1
  72. package/build/types/object-table/TableBody.d.ts.map +1 -1
  73. package/build/types/object-table/TableCell.d.ts.map +1 -1
  74. package/build/types/object-table/TableHeader.d.ts.map +1 -1
  75. package/build/types/object-table/TableRow.d.ts.map +1 -1
  76. package/package.json +13 -8
@@ -14,7 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import classNames from "classnames";
17
18
  import React, { useCallback, useRef } from "react";
19
+ import styles from "./Table.module.css";
18
20
  import { TableBody } from "./TableBody.js";
19
21
  import { TableHeader } from "./TableHeader.js";
20
22
  export function Table({
@@ -23,7 +25,8 @@ export function Table({
23
25
  fetchNextPage,
24
26
  onRowClick,
25
27
  rowHeight,
26
- renderCellContextMenu
28
+ renderCellContextMenu,
29
+ className
27
30
  }) {
28
31
  const tableContainerRef = useRef(null);
29
32
 
@@ -54,21 +57,9 @@ export function Table({
54
57
 
55
58
  return /*#__PURE__*/React.createElement("div", {
56
59
  ref: tableContainerRef,
57
- style: {
58
- position: "relative",
59
- // needed for sticky header
60
- height: "100%",
61
- // needed for scrolling
62
- overflow: "auto",
63
- cursor: table.getState().columnSizingInfo?.isResizingColumn ? "col-resize" : "default",
64
- userSelect: table.getState().columnSizingInfo?.isResizingColumn ? "none" : "auto"
65
- },
60
+ className: classNames(styles.osdkTableContainer, className),
66
61
  onScroll: handleScroll
67
- }, /*#__PURE__*/React.createElement("table", {
68
- style: {
69
- display: "grid"
70
- }
71
- }, /*#__PURE__*/React.createElement(TableHeader, {
62
+ }, /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement(TableHeader, {
72
63
  table: table
73
64
  }), /*#__PURE__*/React.createElement(TableBody, {
74
65
  rows: table.getRowModel().rows,
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","names":["React","useCallback","useRef","TableBody","TableHeader","Table","table","isLoading","fetchNextPage","onRowClick","rowHeight","renderCellContextMenu","tableContainerRef","fetchingRef","fetchMoreOnEndReached","containerRefElement","current","scrollHeight","scrollTop","clientHeight","handleScroll","e","currentTarget","createElement","ref","style","position","height","overflow","cursor","getState","columnSizingInfo","isResizingColumn","userSelect","onScroll","display","rows","getRowModel"],"sources":["Table.tsx"],"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\nimport type { Cell, RowData, Table } from \"@tanstack/react-table\";\nimport React, { type ReactElement, useCallback, useRef } from \"react\";\nimport { TableBody } from \"./TableBody.js\";\nimport { TableHeader } from \"./TableHeader.js\";\n\ninterface TableProps<TData extends RowData> {\n table: Table<TData>;\n isLoading?: boolean;\n fetchNextPage?: () => Promise<void>;\n onRowClick?: (row: TData) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n}\n\nexport function Table<TData extends RowData>(\n {\n table,\n isLoading,\n fetchNextPage,\n onRowClick,\n rowHeight,\n renderCellContextMenu,\n }: TableProps<TData>,\n): ReactElement {\n const tableContainerRef = useRef<HTMLDivElement>(null);\n\n // Using a ref to prevent duplicate fetches from rapid scroll events while a fetch is in-flight\n const fetchingRef = useRef(false);\n\n const fetchMoreOnEndReached = useCallback(\n async (containerRefElement?: HTMLDivElement | null) => {\n if (containerRefElement && !fetchingRef.current) {\n const { scrollHeight, scrollTop, clientHeight } = containerRefElement;\n if (\n scrollHeight - scrollTop - clientHeight < 100\n && !isLoading\n ) {\n fetchingRef.current = true;\n try {\n await fetchNextPage?.();\n } finally {\n fetchingRef.current = false;\n }\n }\n }\n },\n [fetchNextPage, isLoading],\n );\n\n const handleScroll = useCallback(\n async (e: React.UIEvent<HTMLDivElement>) => {\n await fetchMoreOnEndReached(e.currentTarget);\n },\n [fetchMoreOnEndReached],\n );\n\n // TODO: Handle error, loading and empty states\n\n return (\n <div\n ref={tableContainerRef}\n style={{\n position: \"relative\", // needed for sticky header\n height: \"100%\", // needed for scrolling\n overflow: \"auto\",\n cursor: table.getState().columnSizingInfo?.isResizingColumn\n ? \"col-resize\"\n : \"default\",\n userSelect: table.getState().columnSizingInfo?.isResizingColumn\n ? \"none\"\n : \"auto\",\n }}\n onScroll={handleScroll}\n >\n <table\n style={{ display: \"grid\" }}\n >\n <TableHeader table={table} />\n <TableBody\n rows={table.getRowModel().rows}\n tableContainerRef={tableContainerRef}\n onRowClick={onRowClick}\n rowHeight={rowHeight}\n renderCellContextMenu={renderCellContextMenu}\n />\n </table>\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAuBC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AACrE,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,WAAW,QAAQ,kBAAkB;AAc9C,OAAO,SAASC,KAAKA,CACnB;EACEC,KAAK;EACLC,SAAS;EACTC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC;AACiB,CAAC,EACN;EACd,MAAMC,iBAAiB,GAAGV,MAAM,CAAiB,IAAI,CAAC;;EAEtD;EACA,MAAMW,WAAW,GAAGX,MAAM,CAAC,KAAK,CAAC;EAEjC,MAAMY,qBAAqB,GAAGb,WAAW,CACvC,MAAOc,mBAA2C,IAAK;IACrD,IAAIA,mBAAmB,IAAI,CAACF,WAAW,CAACG,OAAO,EAAE;MAC/C,MAAM;QAAEC,YAAY;QAAEC,SAAS;QAAEC;MAAa,CAAC,GAAGJ,m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;IACrBC,qBAAqB,EAAEA;EAAsB,CAC9C,CACI,CACJ,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"Table.js","names":["classNames","React","useCallback","useRef","styles","TableBody","TableHeader","Table","table","isLoading","fetchNextPage","onRowClick","rowHeight","renderCellContextMenu","className","tableContainerRef","fetchingRef","fetchMoreOnEndReached","containerRefElement","current","scrollHeight","scrollTop","clientHeight","handleScroll","e","currentTarget","createElement","ref","osdkTableContainer","onScroll","rows","getRowModel"],"sources":["Table.tsx"],"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\nimport type { Cell, RowData, Table } from \"@tanstack/react-table\";\nimport classNames from \"classnames\";\nimport React, { type ReactElement, useCallback, useRef } from \"react\";\nimport styles from \"./Table.module.css\";\nimport { TableBody } from \"./TableBody.js\";\nimport { TableHeader } from \"./TableHeader.js\";\n\ninterface TableProps<TData extends RowData> {\n table: Table<TData>;\n isLoading?: boolean;\n fetchNextPage?: () => Promise<void>;\n onRowClick?: (row: TData) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n className?: string;\n}\n\nexport function Table<TData extends RowData>(\n {\n table,\n isLoading,\n fetchNextPage,\n onRowClick,\n rowHeight,\n renderCellContextMenu,\n className,\n }: TableProps<TData>,\n): ReactElement {\n const tableContainerRef = useRef<HTMLDivElement>(null);\n\n // Using a ref to prevent duplicate fetches from rapid scroll events while a fetch is in-flight\n const fetchingRef = useRef(false);\n\n const fetchMoreOnEndReached = useCallback(\n async (containerRefElement?: HTMLDivElement | null) => {\n if (containerRefElement && !fetchingRef.current) {\n const { scrollHeight, scrollTop, clientHeight } = containerRefElement;\n if (\n scrollHeight - scrollTop - clientHeight < 100\n && !isLoading\n ) {\n fetchingRef.current = true;\n try {\n await fetchNextPage?.();\n } finally {\n fetchingRef.current = false;\n }\n }\n }\n },\n [fetchNextPage, isLoading],\n );\n\n const handleScroll = useCallback(\n async (e: React.UIEvent<HTMLDivElement>) => {\n await fetchMoreOnEndReached(e.currentTarget);\n },\n [fetchMoreOnEndReached],\n );\n\n // TODO: Handle error, loading and empty states\n\n return (\n <div\n ref={tableContainerRef}\n className={classNames(styles.osdkTableContainer, className)}\n onScroll={handleScroll}\n >\n <table>\n <TableHeader table={table} />\n <TableBody\n rows={table.getRowModel().rows}\n tableContainerRef={tableContainerRef}\n onRowClick={onRowClick}\n rowHeight={rowHeight}\n renderCellContextMenu={renderCellContextMenu}\n />\n </table>\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAuBC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AACrE,OAAOC,MAAM,MAAM,oBAAoB;AACvC,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,WAAW,QAAQ,kBAAkB;AAe9C,OAAO,SAASC,KAAKA,CACnB;EACEC,KAAK;EACLC,SAAS;EACTC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,qBAAqB;EACrBC;AACiB,CAAC,EACN;EACd,MAAMC,iBAAiB,GAAGZ,MAAM,CAAiB,IAAI,CAAC;;EAEtD;EACA,MAAMa,WAAW,GAAGb,MAAM,CAAC,KAAK,CAAC;EAEjC,MAAMc,qBAAqB,GAAGf,WAAW,CACvC,MAAOgB,mBAA2C,IAAK;IACrD,IAAIA,mBAAmB,IAAI,CAACF,WAAW,CAACG,OAAO,EAAE;MAC/C,MAAM;QAAEC,YAAY;QAAEC,SAAS;QAAEC;MAAa,CAAC,GAAGJ,mBAAmB;MACrE,IACEE,YAAY,GAAGC,SAAS,GAAGC,YAAY,GAAG,GAAG,IAC1C,CAACb,SAAS,EACb;QACAO,WAAW,CAACG,OAAO,GAAG,IAAI;QAC1B,IAAI;UACF,MAAMT,aAAa,GAAG,CAAC;QACzB,CAAC,SAAS;UACRM,WAAW,CAACG,OAAO,GAAG,KAAK;QAC7B;MACF;IACF;EACF,CAAC,EACD,CAACT,aAAa,EAAED,SAAS,CAC3B,CAAC;EAED,MAAMc,YAAY,GAAGrB,WAAW,CAC9B,MAAOsB,CAAgC,IAAK;IAC1C,MAAMP,qBAAqB,CAACO,CAAC,CAACC,aAAa,CAAC;EAC9C,CAAC,EACD,CAACR,qBAAqB,CACxB,CAAC;;EAED;;EAEA,oBACEhB,KAAA,CAAAyB,aAAA;IACEC,GAAG,EAAEZ,iBAAkB;IACvBD,SAAS,EAAEd,UAAU,CAACI,MAAM,CAACwB,kBAAkB,EAAEd,SAAS,CAAE;IAC5De,QAAQ,EAAEN;EAAa,gBAEvBtB,KAAA,CAAAyB,aAAA,6BACEzB,KAAA,CAAAyB,aAAA,CAACpB,WAAW;IAACE,KAAK,EAAEA;EAAM,CAAE,CAAC,eAC7BP,KAAA,CAAAyB,aAAA,CAACrB,SAAS;IACRyB,IAAI,EAAEtB,KAAK,CAACuB,WAAW,CAAC,CAAC,CAACD,IAAK;IAC/Bf,iBAAiB,EAAEA,iBAAkB;IACrCJ,UAAU,EAAEA,UAAW;IACvBC,SAAS,EAAEA,SAAU;IACrBC,qBAAqB,EAAEA;EAAsB,CAC9C,CACI,CACJ,CAAC;AAEV","ignoreList":[]}
@@ -0,0 +1,21 @@
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
+ .osdkTableContainer {
18
+ position: relative; /* needed for sticky header */
19
+ height: 100%; /* needed for scrolling */
20
+ overflow: auto;
21
+ }
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { useVirtualizer } from "@tanstack/react-virtual";
18
18
  import React, { useLayoutEffect } from "react";
19
+ import styles from "./TableBody.module.css";
19
20
  import { TableRow } from "./TableRow.js";
20
21
  export function TableBody({
21
22
  rows,
@@ -37,9 +38,8 @@ export function TableBody({
37
38
  rowVirtualizer.measure();
38
39
  }, [rowVirtualizer, rows.length]);
39
40
  return /*#__PURE__*/React.createElement("tbody", {
41
+ className: styles.osdkTableBody,
40
42
  style: {
41
- display: "grid",
42
- position: "relative",
43
43
  height: `${rowVirtualizer.getTotalSize()}px`
44
44
  }
45
45
  }, rowVirtualizer.getVirtualItems().map(virtualRow => {
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.js","names":["useVirtualizer","React","useLayoutEffect","TableRow","TableBody","rows","tableContainerRef","onRowClick","renderCellContextMenu","rowHeight","rowVirtualizer","count","length","estimateSize","getScrollElement","current","overscan","measure","createElement","style","display","position","height","getTotalSize","getVirtualItems","map","virtualRow","row","index","key","id"],"sources":["TableBody.tsx"],"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\nimport type { Cell, Row, RowData } from \"@tanstack/react-table\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport React, { useLayoutEffect } from \"react\";\nimport { TableRow } from \"./TableRow.js\";\n\ninterface TableBodyProps<TData extends RowData> {\n rows: Array<Row<TData>>;\n tableContainerRef: React.RefObject<HTMLDivElement>;\n onRowClick?: (row: TData) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n}\n\nexport function TableBody<TData extends RowData>({\n rows,\n tableContainerRef,\n onRowClick,\n renderCellContextMenu,\n rowHeight = 40,\n}: TableBodyProps<TData>): React.ReactElement {\n // Important: Keep the row virtualizer in the lowest component possible to avoid unnecessary re-renders.\n const rowVirtualizer = useVirtualizer<HTMLDivElement, HTMLTableRowElement>({\n count: rows.length,\n estimateSize: () => rowHeight,\n getScrollElement: () => tableContainerRef.current,\n overscan: 5,\n });\n\n // Measure the virtualizer after the DOM has been laid out to ensure proper dimensions\n useLayoutEffect(() => {\n rowVirtualizer.measure();\n }, [rowVirtualizer, rows.length]);\n\n return (\n <tbody\n style={{\n display: \"grid\",\n position: \"relative\",\n height: `${rowVirtualizer.getTotalSize()}px`,\n }}\n >\n {rowVirtualizer.getVirtualItems().map((virtualRow) => {\n const row = rows[virtualRow.index];\n\n return (\n <TableRow\n key={row.id}\n row={row}\n virtualRow={virtualRow}\n onRowClick={onRowClick}\n renderCellContextMenu={renderCellContextMenu}\n />\n );\n })}\n </tbody>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,cAAc,QAAQ,yBAAyB;AACxD,OAAOC,KAAK,IAAIC,eAAe,QAAQ,OAAO;AAC9C,SAASC,QAAQ,QAAQ,eAAe;AAaxC,OAAO,SAASC,SAASA,CAAwB;EAC/CC,IAAI;EACJC,iBAAiB;EACjBC,UAAU;EACVC,qBAAqB;EACrBC,SAAS,GAAG;AACS,CAAC,EAAsB;EAC5C;EACA,MAAMC,cAAc,GAAGV,cAAc,CAAsC;IACzEW,KAAK,EAAEN,IAAI,CAACO,MAAM;IAClBC,YAAY,EAAEA,CAAA,KAAMJ,SAAS;IAC7BK,gBAAgB,EAAEA,CAAA,KAAMR,iBAAiB,CAACS,OAAO;IACjDC,QAAQ,EAAE;EACZ,CAAC,CAAC;;EAEF;EACAd,eAAe,CAAC,MAAM;IACpBQ,cAAc,CAACO,OAAO,CAAC,CAAC;EAC1B,CAAC,EAAE,CAACP,cAAc,EAAEL,IAAI,CAACO,MAAM,CAAC,CAAC;EAEjC,oBACEX,KAAA,CAAAiB,aAAA;IACEC,KAAK,EAAE;MACLC,OAAO,EAAE,MAAM;MACfC,QAAQ,EAAE,UAAU;MACpBC,MAAM,EAAE,GAAGZ,cAAc,CAACa,YAAY,CAAC,CAAC;IAC1C;EAAE,GAEDb,cAAc,CAACc,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,UAAU,IAAK;IACpD,MAAMC,GAAG,GAAGtB,IAAI,CAACqB,UAAU,CAACE,KAAK,CAAC;IAElC,oBACE3B,KAAA,CAAAiB,aAAA,CAACf,QAAQ;MACP0B,GAAG,EAAEF,GAAG,CAACG,EAAG;MACZH,GAAG,EAAEA,GAAI;MACTD,UAAU,EAAEA,UAAW;MACvBnB,UAAU,EAAEA,UAAW;MACvBC,qBAAqB,EAAEA;IAAsB,CAC9C,CAAC;EAEN,CAAC,CACI,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"file":"TableBody.js","names":["useVirtualizer","React","useLayoutEffect","styles","TableRow","TableBody","rows","tableContainerRef","onRowClick","renderCellContextMenu","rowHeight","rowVirtualizer","count","length","estimateSize","getScrollElement","current","overscan","measure","createElement","className","osdkTableBody","style","height","getTotalSize","getVirtualItems","map","virtualRow","row","index","key","id"],"sources":["TableBody.tsx"],"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\nimport type { Cell, Row, RowData } from \"@tanstack/react-table\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport React, { useLayoutEffect } from \"react\";\nimport styles from \"./TableBody.module.css\";\nimport { TableRow } from \"./TableRow.js\";\n\ninterface TableBodyProps<TData extends RowData> {\n rows: Array<Row<TData>>;\n tableContainerRef: React.RefObject<HTMLDivElement>;\n onRowClick?: (row: TData) => void;\n rowHeight?: number;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n}\n\nexport function TableBody<TData extends RowData>({\n rows,\n tableContainerRef,\n onRowClick,\n renderCellContextMenu,\n rowHeight = 40,\n}: TableBodyProps<TData>): React.ReactElement {\n // Important: Keep the row virtualizer in the lowest component possible to avoid unnecessary re-renders.\n const rowVirtualizer = useVirtualizer<HTMLDivElement, HTMLTableRowElement>({\n count: rows.length,\n estimateSize: () => rowHeight,\n getScrollElement: () => tableContainerRef.current,\n overscan: 5,\n });\n\n // Measure the virtualizer after the DOM has been laid out to ensure proper dimensions\n useLayoutEffect(() => {\n rowVirtualizer.measure();\n }, [rowVirtualizer, rows.length]);\n\n return (\n <tbody\n className={styles.osdkTableBody}\n style={{\n height: `${rowVirtualizer.getTotalSize()}px`,\n }}\n >\n {rowVirtualizer.getVirtualItems().map((virtualRow) => {\n const row = rows[virtualRow.index];\n\n return (\n <TableRow\n key={row.id}\n row={row}\n virtualRow={virtualRow}\n onRowClick={onRowClick}\n renderCellContextMenu={renderCellContextMenu}\n />\n );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,CAC9C,CAAC;EAEN,CAAC,CACI,CAAC;AAEZ","ignoreList":[]}
@@ -0,0 +1,20 @@
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
+ .osdkTableBody {
18
+ display: grid;
19
+ position: relative;
20
+ }
@@ -19,6 +19,7 @@ import React, { useRef } from "react";
19
19
  import { CellContextMenu } from "./CellContextMenu.js";
20
20
  import { useCellContextMenu } from "./hooks/useCellContextMenu.js";
21
21
  import { SELECTION_COLUMN_ID } from "./hooks/useSelectionColumn.js";
22
+ import styles from "./TableCell.module.css";
22
23
  export function TableCell({
23
24
  cell,
24
25
  renderCellContextMenu
@@ -35,13 +36,14 @@ export function TableCell({
35
36
  });
36
37
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("td", {
37
38
  ref: tdRef,
39
+ className: styles.osdkTableCell,
38
40
  style: {
39
- display: "flex",
40
- alignItems: "center",
41
41
  width: cell.column.getSize()
42
42
  },
43
43
  onContextMenu: handleOpenContextMenu
44
- }, flexRender(cell.column.columnDef.cell, cell.getContext())), !isSelectColumn && isContextMenuOpen && !!popoverPosition && !!renderCellContextMenu && /*#__PURE__*/React.createElement(CellContextMenu, {
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: styles.osdkTableCellContent
46
+ }, flexRender(cell.column.columnDef.cell, cell.getContext()))), !isSelectColumn && isContextMenuOpen && !!popoverPosition && !!renderCellContextMenu && /*#__PURE__*/React.createElement(CellContextMenu, {
45
47
  cell: cell,
46
48
  position: popoverPosition,
47
49
  onClose: handleCloseContextMenu,
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","names":["flexRender","React","useRef","CellContextMenu","useCellContextMenu","SELECTION_COLUMN_ID","TableCell","cell","renderCellContextMenu","tdRef","isSelectColumn","column","id","isContextMenuOpen","handleOpenContextMenu","handleCloseContextMenu","popoverPosition","createElement","Fragment","ref","style","display","alignItems","width","getSize","onContextMenu","columnDef","getContext","position","onClose","renderContent"],"sources":["TableCell.tsx"],"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\nimport type { Cell, RowData } from \"@tanstack/react-table\";\nimport { flexRender } from \"@tanstack/react-table\";\nimport React, { useRef } from \"react\";\nimport { CellContextMenu } from \"./CellContextMenu.js\";\nimport { useCellContextMenu } from \"./hooks/useCellContextMenu.js\";\nimport { SELECTION_COLUMN_ID } from \"./hooks/useSelectionColumn.js\";\n\ninterface TableCellProps<TData extends RowData> {\n cell: Cell<TData, unknown>;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n}\n\nexport function TableCell<TData extends RowData>(\n { cell, renderCellContextMenu }: TableCellProps<TData>,\n): React.ReactElement {\n const tdRef = useRef<HTMLTableCellElement>(null);\n const isSelectColumn = cell.column.id === SELECTION_COLUMN_ID;\n\n const {\n isContextMenuOpen,\n handleOpenContextMenu,\n handleCloseContextMenu,\n popoverPosition,\n } = useCellContextMenu({\n tdRef,\n });\n\n const shouldRenderContextMenu = !isSelectColumn && isContextMenuOpen\n && !!popoverPosition\n && !!renderCellContextMenu;\n\n return (\n <>\n <td\n ref={tdRef}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n width: cell.column.getSize(),\n }}\n onContextMenu={handleOpenContextMenu}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </td>\n {shouldRenderContextMenu\n && (\n <CellContextMenu\n cell={cell}\n position={popoverPosition}\n onClose={handleCloseContextMenu}\n renderContent={renderCellContextMenu}\n />\n )}\n </>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,UAAU,QAAQ,uBAAuB;AAClD,OAAOC,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,mBAAmB,QAAQ,+BAA+B;AAUnE,OAAO,SAASC,SAASA,CACvB;EAAEC,IAAI;EAAEC;AAA6C,CAAC,EAClC;EACpB,MAAMC,KAAK,GAAGP,MAAM,CAAuB,IAAI,CAAC;EAChD,MAAMQ,cAAc,GAAGH,IAAI,CAACI,MAAM,CAACC,EAAE,KAAKP,mBAAmB;EAE7D,MAAM;IACJQ,iBAAiB;IACjBC,qBAAqB;IACrBC,sBAAsB;IACtBC;EACF,CAAC,GAAGZ,kBAAkB,CAAC;IACrBK;EACF,CAAC,CAAC;EAMF,oBACER,KAAA,CAAAgB,aAAA,CAAAhB,KAAA,CAAAiB,QAAA,qBACEjB,KAAA,CAAAgB,aAAA;IACEE,GAAG,EAAEV,KAAM;IACXW,KAAK,EAAE;MACLC,OAAO,EAAE,MAAM;MACfC,UAAU,EAAE,QAAQ;MACpBC,KAAK,EAAEhB,IAAI,CAACI,MAAM,CAACa,OAAO,CAAC;IAC7B,CAAE;IACFC,aAAa,EAAEX;EAAsB,GAEpCd,UAAU,CAACO,IAAI,CAACI,MAAM,CAACe,SAAS,CAACnB,IAAI,EAAEA,IAAI,CAACoB,UAAU,CAAC,CAAC,CACvD,CAAC,EAhBuB,CAACjB,cAAc,IAAIG,iBAAiB,IAC/D,CAAC,CAACG,eAAe,IACjB,CAAC,CAACR,qBAAqB,iBAiBpBP,KAAA,CAAAgB,aAAA,CAACd,eAAe;IACdI,IAAI,EAAEA,IAAK;IACXqB,QAAQ,EAAEZ,eAAgB;IAC1Ba,OAAO,EAAEd,sBAAuB;IAChCe,aAAa,EAAEtB;EAAsB,CACtC,CAEL,CAAC;AAEP","ignoreList":[]}
1
+ {"version":3,"file":"TableCell.js","names":["flexRender","React","useRef","CellContextMenu","useCellContextMenu","SELECTION_COLUMN_ID","styles","TableCell","cell","renderCellContextMenu","tdRef","isSelectColumn","column","id","isContextMenuOpen","handleOpenContextMenu","handleCloseContextMenu","popoverPosition","createElement","Fragment","ref","className","osdkTableCell","style","width","getSize","onContextMenu","osdkTableCellContent","columnDef","getContext","position","onClose","renderContent"],"sources":["TableCell.tsx"],"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\nimport type { Cell, RowData } from \"@tanstack/react-table\";\nimport { flexRender } from \"@tanstack/react-table\";\nimport type { ReactNode } from \"react\";\nimport React, { useRef } from \"react\";\nimport { CellContextMenu } from \"./CellContextMenu.js\";\nimport { useCellContextMenu } from \"./hooks/useCellContextMenu.js\";\nimport { SELECTION_COLUMN_ID } from \"./hooks/useSelectionColumn.js\";\nimport styles from \"./TableCell.module.css\";\n\ninterface TableCellProps<TData extends RowData> {\n cell: Cell<TData, unknown>;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n}\n\nexport function TableCell<TData extends RowData>(\n { cell, renderCellContextMenu }: TableCellProps<TData>,\n): React.ReactElement {\n const tdRef = useRef<HTMLTableCellElement>(null);\n const isSelectColumn = cell.column.id === SELECTION_COLUMN_ID;\n\n const {\n isContextMenuOpen,\n handleOpenContextMenu,\n handleCloseContextMenu,\n popoverPosition,\n } = useCellContextMenu({\n tdRef,\n });\n\n const shouldRenderContextMenu = !isSelectColumn && isContextMenuOpen\n && !!popoverPosition\n && !!renderCellContextMenu;\n\n return (\n <>\n <td\n ref={tdRef}\n className={styles.osdkTableCell}\n style={{\n width: cell.column.getSize(),\n }}\n onContextMenu={handleOpenContextMenu}\n >\n <div className={styles.osdkTableCellContent}>\n {flexRender(cell.column.columnDef.cell, cell.getContext()) as\n | ReactNode\n | React.JSX.Element}\n </div>\n </td>\n {shouldRenderContextMenu\n && (\n <CellContextMenu\n cell={cell}\n position={popoverPosition}\n onClose={handleCloseContextMenu}\n renderContent={renderCellContextMenu}\n />\n )}\n </>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,UAAU,QAAQ,uBAAuB;AAElD,OAAOC,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,mBAAmB,QAAQ,+BAA+B;AACnE,OAAOC,MAAM,MAAM,wBAAwB;AAU3C,OAAO,SAASC,SAASA,CACvB;EAAEC,IAAI;EAAEC;AAA6C,CAAC,EAClC;EACpB,MAAMC,KAAK,GAAGR,MAAM,CAAuB,IAAI,CAAC;EAChD,MAAMS,cAAc,GAAGH,IAAI,CAACI,MAAM,CAACC,EAAE,KAAKR,mBAAmB;EAE7D,MAAM;IACJS,iBAAiB;IACjBC,qBAAqB;IACrBC,sBAAsB;IACtBC;EACF,CAAC,GAAGb,kBAAkB,CAAC;IACrBM;EACF,CAAC,CAAC;EAMF,oBACET,KAAA,CAAAiB,aAAA,CAAAjB,KAAA,CAAAkB,QAAA,qBACElB,KAAA,CAAAiB,aAAA;IACEE,GAAG,EAAEV,KAAM;IACXW,SAAS,EAAEf,MAAM,CAACgB,aAAc;IAChCC,KAAK,EAAE;MACLC,KAAK,EAAEhB,IAAI,CAACI,MAAM,CAACa,OAAO,CAAC;IAC7B,CAAE;IACFC,aAAa,EAAEX;EAAsB,gBAErCd,KAAA,CAAAiB,aAAA;IAAKG,SAAS,EAAEf,MAAM,CAACqB;EAAqB,GACzC3B,UAAU,CAACQ,IAAI,CAACI,MAAM,CAACgB,SAAS,CAACpB,IAAI,EAAEA,IAAI,CAACqB,UAAU,CAAC,CAAC,CAGtD,CACH,CAAC,EAnBuB,CAAClB,cAAc,IAAIG,iBAAiB,IAC/D,CAAC,CAACG,eAAe,IACjB,CAAC,CAACR,qBAAqB,iBAoBpBR,KAAA,CAAAiB,aAAA,CAACf,eAAe;IACdK,IAAI,EAAEA,IAAK;IACXsB,QAAQ,EAAEb,eAAgB;IAC1Bc,OAAO,EAAEf,sBAAuB;IAChCgB,aAAa,EAAEvB;EAAsB,CACtC,CAEL,CAAC;AAEP","ignoreList":[]}
@@ -0,0 +1,46 @@
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
+ .osdkTableCell {
18
+ display: flex;
19
+ align-items: center;
20
+ text-align: left;
21
+ position: relative;
22
+ padding: var(--osdk-table-cell-padding);
23
+ font-size: var(--osdk-table-cell-fontSize);
24
+ color: var(--osdk-table-cell-color);
25
+ background-color: inherit;
26
+ border-right: var(--osdk-table-cell-divider);
27
+
28
+ &:first-child {
29
+ border-left: var(--osdk-table-border);
30
+ }
31
+
32
+ &:last-child {
33
+ border-right: var(--osdk-table-border);
34
+ }
35
+ }
36
+
37
+ .osdkTableCell:has([role="checkbox"]) {
38
+ justify-content: center;
39
+ }
40
+
41
+ .osdkTableCellContent {
42
+ overflow: hidden;
43
+ text-overflow: ellipsis;
44
+ white-space: nowrap;
45
+ text-align: left;
46
+ }
@@ -16,48 +16,30 @@
16
16
 
17
17
  import { flexRender } from "@tanstack/react-table";
18
18
  import React from "react";
19
+ import styles from "./TableHeader.module.css";
19
20
  export function TableHeader({
20
21
  table
21
22
  }) {
23
+ // TODO: If value is number type, right align header
24
+
25
+ const isResizing = !!table.getState().columnSizingInfo?.isResizingColumn;
22
26
  return /*#__PURE__*/React.createElement("thead", {
23
- style: {
24
- display: "grid",
25
- position: "sticky",
26
- top: 0,
27
- zIndex: 1
28
- }
27
+ className: styles.osdkTableHeader,
28
+ "data-resizing": isResizing
29
29
  }, table.getHeaderGroups().map(headerGroup => /*#__PURE__*/React.createElement("tr", {
30
30
  key: headerGroup.id,
31
- style: {
32
- display: "flex"
33
- }
34
- }, headerGroup.headers.map(header =>
35
- /*#__PURE__*/
36
- // TODO: Move inline styling to CSS file
37
- React.createElement("th", {
31
+ className: styles.osdkTableHeaderRow
32
+ }, headerGroup.headers.map(header => /*#__PURE__*/React.createElement("th", {
38
33
  key: header.id,
34
+ className: styles.osdkTableHeaderCell,
39
35
  style: {
40
- display: "flex",
41
- width: header.getSize(),
42
- justifyContent: "flex-start",
43
- alignItems: "center",
44
- position: "relative"
36
+ width: header.getSize()
45
37
  }
46
38
  }, header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), header.column.getCanResize() && /*#__PURE__*/React.createElement("div", {
39
+ className: styles.osdkTableHeaderResizer,
47
40
  onDoubleClick: () => header.column.resetSize(),
48
41
  onMouseDown: header.getResizeHandler(),
49
- onTouchStart: header.getResizeHandler(),
50
- style: {
51
- position: "absolute",
52
- right: 0,
53
- top: 0,
54
- height: "100%",
55
- width: "3px",
56
- cursor: "col-resize",
57
- touchAction: "none",
58
- zIndex: 11,
59
- transform: header.column.getIsResizing() ? `translateX(${table.getState().columnSizingInfo.deltaOffset ?? 0}px)` : ""
60
- }
42
+ onTouchStart: header.getResizeHandler()
61
43
  }))))));
62
44
  }
63
45
  //# sourceMappingURL=TableHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.js","names":["flexRender","React","TableHeader","table","createElement","style","display","position","top","zIndex","getHeaderGroups","map","headerGroup","key","id","headers","header","width","getSize","justifyContent","alignItems","isPlaceholder","column","columnDef","getContext","getCanResize","onDoubleClick","resetSize","onMouseDown","getResizeHandler","onTouchStart","right","height","cursor","touchAction","transform","getIsResizing","getState","columnSizingInfo","deltaOffset"],"sources":["TableHeader.tsx"],"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\nimport type { RowData, Table } from \"@tanstack/react-table\";\nimport { flexRender } from \"@tanstack/react-table\";\nimport React from \"react\";\n\ninterface TableHeaderProps<TData extends RowData> {\n table: Table<TData>;\n}\n\nexport function TableHeader<TData extends RowData>({\n table,\n}: TableHeaderProps<TData>): React.ReactElement {\n return (\n <thead\n style={{\n display: \"grid\",\n position: \"sticky\",\n top: 0,\n zIndex: 1,\n }}\n >\n {table.getHeaderGroups().map((headerGroup) => (\n <tr\n key={headerGroup.id}\n style={{\n display: \"flex\",\n }}\n >\n {headerGroup.headers.map((header) => (\n // TODO: Move inline styling to CSS file\n <th\n key={header.id}\n style={{\n display: \"flex\",\n width: header.getSize(),\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n position: \"relative\",\n }}\n >\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext(),\n )}\n {header.column.getCanResize() && (\n <div\n onDoubleClick={() => header.column.resetSize()}\n onMouseDown={header.getResizeHandler()}\n onTouchStart={header.getResizeHandler()}\n style={{\n position: \"absolute\",\n right: 0,\n top: 0,\n height: \"100%\",\n width: \"3px\",\n cursor: \"col-resize\",\n touchAction: \"none\",\n zIndex: 11,\n transform: header.column.getIsResizing()\n ? `translateX(${\n table.getState().columnSizingInfo.deltaOffset ?? 0\n }px)`\n : \"\",\n }}\n />\n )}\n </th>\n ))}\n </tr>\n ))}\n </thead>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,UAAU,QAAQ,uBAAuB;AAClD,OAAOC,KAAK,MAAM,OAAO;AAMzB,OAAO,SAASC,WAAWA,CAAwB;EACjDC;AACuB,CAAC,EAAsB;EAC9C,oBACEF,KAAA,CAAAG,aAAA;IACEC,KAAK,EAAE;MACLC,OAAO,EAAE,MAAM;MACfC,QAAQ,EAAE,QAAQ;MAClBC,GAAG,EAAE,CAAC;MACNC,MAAM,EAAE;IACV;EAAE,GAEDN,KAAK,CAACO,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,WAAW,iBACvCX,KAAA,CAAAG,aAAA;IACES,GAAG,EAAED,WAAW,CAACE,EAAG;IACpBT,KAAK,EAAE;MACLC,OAAO,EAAE;IACX;EAAE,GAEDM,WAAW,CAACG,OAAO,CAACJ,GAAG,CAAEK,MAAM;EAAA;EAC9B;EACAf,KAAA,CAAAG,aAAA;IACES,GAAG,EAAEG,MAAM,CAACF,EAAG;IACfT,KAAK,EAAE;MACLC,OAAO,EAAE,MAAM;MACfW,KAAK,EAAED,MAAM,CAACE,OAAO,CAAC,CAAC;MACvBC,cAAc,EAAE,YAAY;MAC5BC,UAAU,EAAE,QAAQ;MACpBb,QAAQ,EAAE;IACZ;EAAE,GAEDS,MAAM,CAACK,aAAa,GACjB,IAAI,GACJrB,UAAU,CACVgB,MAAM,CAACM,MAAM,CAACC,SAAS,CAACP,MAAM,EAC9BA,MAAM,CAACQ,UAAU,CAAC,CACpB,CAAC,EACFR,MAAM,CAACM,MAAM,CAACG,YAAY,CAAC,CAAC,iBAC3BxB,KAAA,CAAAG,aAAA;IACEsB,aAAa,EAAEA,CAAA,KAAMV,MAAM,CAACM,MAAM,CAACK,SAAS,CAAC,CAAE;IAC/CC,WAAW,EAAEZ,MAAM,CAACa,gBAAgB,CAAC,CAAE;IACvCC,YAAY,EAAEd,MAAM,CAACa,gBAAgB,CAAC,CAAE;IACxCxB,KAAK,EAAE;MACLE,QAAQ,EAAE,UAAU;MACpBwB,KAAK,EAAE,CAAC;MACRvB,GAAG,EAAE,CAAC;MACNwB,MAAM,EAAE,MAAM;MACdf,KAAK,EAAE,KAAK;MACZgB,MAAM,EAAE,YAAY;MACpBC,WAAW,EAAE,MAAM;MACnBzB,MAAM,EAAE,EAAE;MACV0B,SAAS,EAAEnB,MAAM,CAACM,MAAM,CAACc,aAAa,CAAC,CAAC,GACpC,cACAjC,KAAK,CAACkC,QAAQ,CAAC,CAAC,CAACC,gBAAgB,CAACC,WAAW,IAAI,CAAC,KAC/C,GACH;IACN;EAAE,CACH,CAED,CACL,CACC,CACL,CACI,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"file":"TableHeader.js","names":["flexRender","React","styles","TableHeader","table","isResizing","getState","columnSizingInfo","isResizingColumn","createElement","className","osdkTableHeader","getHeaderGroups","map","headerGroup","key","id","osdkTableHeaderRow","headers","header","osdkTableHeaderCell","style","width","getSize","isPlaceholder","column","columnDef","getContext","getCanResize","osdkTableHeaderResizer","onDoubleClick","resetSize","onMouseDown","getResizeHandler","onTouchStart"],"sources":["TableHeader.tsx"],"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\nimport type { RowData, Table } from \"@tanstack/react-table\";\nimport { flexRender } from \"@tanstack/react-table\";\nimport type { ReactNode } from \"react\";\nimport React from \"react\";\nimport styles from \"./TableHeader.module.css\";\n\ninterface TableHeaderProps<TData extends RowData> {\n table: Table<TData>;\n}\n\nexport function TableHeader<TData extends RowData>({\n table,\n}: TableHeaderProps<TData>): React.ReactElement {\n // TODO: If value is number type, right align header\n\n const isResizing = !!table.getState().columnSizingInfo?.isResizingColumn;\n\n return (\n <thead className={styles.osdkTableHeader} data-resizing={isResizing}>\n {table.getHeaderGroups().map((headerGroup) => (\n <tr\n key={headerGroup.id}\n className={styles.osdkTableHeaderRow}\n >\n {headerGroup.headers.map((header) => (\n <th\n key={header.id}\n className={styles.osdkTableHeaderCell}\n style={{\n width: header.getSize(),\n }}\n >\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext(),\n ) as ReactNode | React.JSX.Element}\n {header.column.getCanResize() && (\n <div\n className={styles.osdkTableHeaderResizer}\n onDoubleClick={() => header.column.resetSize()}\n onMouseDown={header.getResizeHandler()}\n onTouchStart={header.getResizeHandler()}\n />\n )}\n </th>\n ))}\n </tr>\n ))}\n </thead>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAC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AAM,CAACc,gBAAgB,CAAC;EAAE,CACzC,CAED,CACL,CACC,CACL,CACI,CAAC;AAEZ","ignoreList":[]}
@@ -0,0 +1,78 @@
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
+ .osdkTableHeader {
18
+ display: grid;
19
+ position: sticky;
20
+ top: 0;
21
+ z-index: var(--bp-surface-zIndex-1);
22
+ background-color: var(--osdk-table-header-bg);
23
+ }
24
+
25
+ .osdkTableHeader[data-resizing="true"] {
26
+ cursor: col-resize;
27
+ user-select: none;
28
+ }
29
+
30
+ .osdkTableHeaderRow {
31
+ display: flex;
32
+ }
33
+
34
+ .osdkTableHeaderCell {
35
+ display: flex;
36
+ align-items: center;
37
+ text-align: left;
38
+ position: relative;
39
+ padding: var(--osdk-table-cell-padding);
40
+ font-weight: var(--osdk-table-header-fontWeight);
41
+ font-size: var(--osdk-table-header-fontSize);
42
+ color: var(--osdk-table-header-color);
43
+ border-top: var(--osdk-table-border);
44
+ border-right: var(--osdk-table-header-divider);
45
+ background-color: inherit;
46
+
47
+ &:first-child {
48
+ border-left: var(--osdk-table-border);
49
+ }
50
+
51
+ &:last-child {
52
+ border-right: var(--osdk-table-border);
53
+ }
54
+ }
55
+
56
+ .osdkTableHeaderCell:has([role="checkbox"]) {
57
+ justify-content: center;
58
+ }
59
+
60
+ .osdkTableHeaderResizer {
61
+ background: none;
62
+ cursor: col-resize;
63
+ height: 100%;
64
+ position: absolute;
65
+ right: calc(-1 * var(--osdk-table-border-width));
66
+ top: 0;
67
+ touch-action: none;
68
+ width: 3px;
69
+ z-index: var(--bp-surface-zIndex-2);
70
+
71
+ &:hover {
72
+ background: var(--bp-intent-primary-hover);
73
+ }
74
+
75
+ &:active {
76
+ background: var(--bp-intent-primary-active);
77
+ }
78
+ }
@@ -16,6 +16,7 @@
16
16
 
17
17
  import React, { useCallback } from "react";
18
18
  import { TableCell } from "./TableCell.js";
19
+ import styles from "./TableRow.module.css";
19
20
  export function TableRow({
20
21
  row,
21
22
  virtualRow,
@@ -26,11 +27,11 @@ export function TableRow({
26
27
  onRowClick?.(row.original);
27
28
  }, [onRowClick, row.original]);
28
29
  return /*#__PURE__*/React.createElement("tr", {
30
+ "data-selected": row.getIsSelected(),
31
+ className: styles.osdkTableRow,
29
32
  style: {
30
- position: "absolute",
31
33
  height: `${virtualRow.size}px`,
32
- transform: `translateY(${virtualRow.start}px)`,
33
- display: "flex"
34
+ transform: `translateY(${virtualRow.start}px)`
34
35
  },
35
36
  onClick: handleClick
36
37
  }, row.getVisibleCells().map(cell => /*#__PURE__*/React.createElement(TableCell, {
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","names":["React","useCallback","TableCell","TableRow","row","virtualRow","onRowClick","renderCellContextMenu","handleClick","original","createElement","style","position","height","size","transform","start","display","onClick","getVisibleCells","map","cell","key","id"],"sources":["TableRow.tsx"],"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\nimport type { Cell, Row, RowData } from \"@tanstack/react-table\";\nimport type { VirtualItem } from \"@tanstack/react-virtual\";\nimport React, { useCallback } from \"react\";\nimport { TableCell } from \"./TableCell.js\";\n\ninterface TableRowProps<TData extends RowData> {\n row: Row<TData>;\n virtualRow: VirtualItem;\n onRowClick?: (row: TData) => void;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n}\n\nexport function TableRow<TData extends RowData>({\n row,\n virtualRow,\n onRowClick,\n renderCellContextMenu,\n}: TableRowProps<TData>): React.ReactElement {\n const handleClick = useCallback(() => {\n onRowClick?.(row.original);\n }, [onRowClick, row.original]);\n\n return (\n <tr\n style={{\n position: \"absolute\",\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n display: \"flex\",\n }}\n onClick={handleClick}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n cell={cell}\n renderCellContextMenu={renderCellContextMenu}\n />\n ))}\n </tr>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,SAAS,QAAQ,gBAAgB;AAY1C,OAAO,SAASC,QAAQA,CAAwB;EAC9CC,GAAG;EACHC,UAAU;EACVC,UAAU;EACVC;AACoB,CAAC,EAAsB;EAC3C,MAAMC,WAAW,GAAGP,WAAW,CAAC,MAAM;IACpCK,UAAU,GAAGF,GAAG,CAACK,QAAQ,CAAC;EAC5B,CAAC,EAAE,CAACH,UAAU,EAAEF,GAAG,CAACK,QAAQ,CAAC,CAAC;EAE9B,oBACET,KAAA,CAAAU,aAAA;IACEC,KAAK,EAAE;MACLC,QAAQ,EAAE,UAAU;MACpBC,MAAM,EAAE,GAAGR,UAAU,CAACS,IAAI,IAAI;MAC9BC,SAAS,EAAE,cAAcV,UAAU,CAACW,KAAK,KAAK;MAC9CC,OAAO,EAAE;IACX,CAAE;IACFC,OAAO,EAAEV;EAAY,GAEpBJ,GAAG,CAACe,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,IAAI,iBAC9BrB,KAAA,CAAAU,aAAA,CAACR,SAAS;IACRoB,GAAG,EAAED,IAAI,CAACE,EAAG;IACbF,IAAI,EAAEA,IAAK;IACXd,qBAAqB,EAAEA;EAAsB,CAC9C,CACF,CACC,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"file":"TableRow.js","names":["React","useCallback","TableCell","styles","TableRow","row","virtualRow","onRowClick","renderCellContextMenu","handleClick","original","createElement","getIsSelected","className","osdkTableRow","style","height","size","transform","start","onClick","getVisibleCells","map","cell","key","id"],"sources":["TableRow.tsx"],"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\nimport type { Cell, Row, RowData } from \"@tanstack/react-table\";\nimport type { VirtualItem } from \"@tanstack/react-virtual\";\nimport React, { useCallback } from \"react\";\nimport { TableCell } from \"./TableCell.js\";\nimport styles from \"./TableRow.module.css\";\n\ninterface TableRowProps<TData extends RowData> {\n row: Row<TData>;\n virtualRow: VirtualItem;\n onRowClick?: (row: TData) => void;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n}\n\nexport function TableRow<TData extends RowData>({\n row,\n virtualRow,\n onRowClick,\n renderCellContextMenu,\n}: TableRowProps<TData>): React.ReactElement {\n const handleClick = useCallback(() => {\n onRowClick?.(row.original);\n }, [onRowClick, row.original]);\n\n return (\n <tr\n data-selected={row.getIsSelected()}\n className={styles.osdkTableRow}\n style={{\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n }}\n onClick={handleClick}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n cell={cell}\n renderCellContextMenu={renderCellContextMenu}\n />\n ))}\n </tr>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,MAAM,MAAM,uBAAuB;AAY1C,OAAO,SAASC,QAAQA,CAAwB;EAC9CC,GAAG;EACHC,UAAU;EACVC,UAAU;EACVC;AACoB,CAAC,EAAsB;EAC3C,MAAMC,WAAW,GAAGR,WAAW,CAAC,MAAM;IACpCM,UAAU,GAAGF,GAAG,CAACK,QAAQ,CAAC;EAC5B,CAAC,EAAE,CAACH,UAAU,EAAEF,GAAG,CAACK,QAAQ,CAAC,CAAC;EAE9B,oBACEV,KAAA,CAAAW,aAAA;IACE,iBAAeN,GAAG,CAACO,aAAa,CAAC,CAAE;IACnCC,SAAS,EAAEV,MAAM,CAACW,YAAa;IAC/BC,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGV,UAAU,CAACW,IAAI,IAAI;MAC9BC,SAAS,EAAE,cAAcZ,UAAU,CAACa,KAAK;IAC3C,CAAE;IACFC,OAAO,EAAEX;EAAY,GAEpBJ,GAAG,CAACgB,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,IAAI,iBAC9BvB,KAAA,CAAAW,aAAA,CAACT,SAAS;IACRsB,GAAG,EAAED,IAAI,CAACE,EAAG;IACbF,IAAI,EAAEA,IAAK;IACXf,qBAAqB,EAAEA;EAAsB,CAC9C,CACF,CACC,CAAC;AAET","ignoreList":[]}
@@ -0,0 +1,60 @@
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
+ .osdkTableRow {
18
+ position: absolute;
19
+ display: flex;
20
+ background-color: var(--osdk-table-row-bg-default);
21
+ border-top: var(--osdk-table-row-divider);
22
+ border-bottom: var(--osdk-table-border-width) solid transparent;
23
+
24
+ &:last-child {
25
+ border-bottom: var(--osdk-table-border);
26
+ }
27
+
28
+ /* Zebra rows */
29
+ &:nth-child(even) {
30
+ background-color: var(
31
+ --osdk-table-row-bg-alternate,
32
+ var(--osdk-table-row-bg-default)
33
+ );
34
+ }
35
+
36
+ &:hover {
37
+ z-index: 1;
38
+ background-color: var(
39
+ --osdk-table-row-bg-hover,
40
+ var(--bp-surface-colorHover-default)
41
+ );
42
+ border-top-color: var(--osdk-table-row-border-color-hover);
43
+ border-bottom-color: var(--osdk-table-row-border-color-hover);
44
+ }
45
+
46
+ &[data-selected="true"] {
47
+ z-index: 2;
48
+ background-color: var(--osdk-table-row-bg-active);
49
+ border-top-color: var(--osdk-table-row-border-color-active);
50
+ border-bottom-color: var(--osdk-table-row-border-color-active);
51
+ }
52
+
53
+ &[data-selected="true"] + &[data-selected="true"] {
54
+ border-top-color: transparent;
55
+ }
56
+
57
+ &[data-selected="true"]:has(+ &[data-selected="true"]) {
58
+ border-bottom-color: transparent;
59
+ }
60
+ }
@@ -0,0 +1,10 @@
1
+ import { type CheckboxIndicatorProps, type CheckboxRootProps } from "@base-ui/react/checkbox";
2
+ import React from "react";
3
+ interface CheckboxProps extends Omit<CheckboxRootProps, "className"> {
4
+ className?: string;
5
+ indicatorProps?: Omit<CheckboxIndicatorProps, "className"> & {
6
+ className?: string
7
+ };
8
+ }
9
+ export declare function Checkbox({ indeterminate, className, indicatorProps,...rest }: CheckboxProps): React.ReactElement;
10
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAEO,6BACA,yBACA,yBAA0B;AAGjC,OAAO,WAAW,OAAQ;UAGhB,sBAAsB,KAAK,mBAAmB,aAAa;CACnE;CACA,iBAAiB,KAAK,wBAAwB,eAAe;EAC3D;CACD;AACF;AAED,OAAO,iBAAS,SACd,EACE,eACA,WACA,eACA,GAAG,MACW,EAAb,gBACF,MAAM","names":[],"sources":["../../../../src/base-components/checkbox/Checkbox.tsx"],"version":3,"file":"Checkbox.d.ts"}
@@ -0,0 +1,6 @@
1
+ declare module "*.module.css" {
2
+ const classes: {
3
+ readonly [key: string]: string
4
+ };
5
+ export default classes;
6
+ }
@@ -0,0 +1 @@
1
+ {"mappings":"eAgBe,eAAe;CAC5B,MAAMA,SAAS;;CAAkC;AACjD,gBAAe;AAChB","names":["classes: { readonly [key: string]: string }"],"sources":["../../src/css-modules.d.ts"],"version":3,"file":"css-modules.d.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,MAAM,eAAe,uBAAwB;AAC3D,OAAO,WAAkC,OAAQ;AAEjD,cAAc,uBAAuB,+BAAgC;UAE3D,qBAAqB,cAAc,SAAS;CACpD,MAAM,KAAK;CACX,UAAU;CACV;CACA,gBAAgBA,KAAK,OAAOC,MAAM,KAAK,oBAAoB,MAAM;AAClE;AAED,OAAO,iBAAS,gBAAgB,cAAc,SAAS,EACrD,MACA,UACA,SACA,eAC4B,EAA3B,qBAAqB,SAAS,MAAM","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/CellContextMenu.tsx"],"version":3,"file":"CellContextMenu.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,MAAM,eAAe,uBAAwB;AAC3D,OAAO,WAAkC,OAAQ;AAGjD,cAAc,uBAAuB,+BAAgC;UAE3D,qBAAqB,cAAc,SAAS;CACpD,MAAM,KAAK;CACX,UAAU;CACV;CACA,gBAAgBA,KAAK,OAAOC,MAAM,KAAK,oBAAoB,MAAM;AAClE;AAED,OAAO,iBAAS,gBAAgB,cAAc,SAAS,EACrD,MACA,UACA,SACA,eAC4B,EAA3B,qBAAqB,SAAS,MAAM","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/CellContextMenu.tsx"],"version":3,"file":"CellContextMenu.d.ts"}
@@ -165,4 +165,5 @@ export interface ObjectTableProps<
165
165
  * @default 40
166
166
  */
167
167
  rowHeight?: number;
168
+ className?: string;
168
169
  }
@@ -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,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;;;;;;CAQF,cACEP,QAAQ,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;;;;;;CAWlE,gBAAgB,WAAW,aAAa;;;;;CAMxC,eAAe,eAAe;;;;;;;CAS9B,kBAAkBQ,gBAAgB,eAAe;;;;CAKjD,yBACEC,KAAK,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI,OAC7DC,uBACG,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","selectedRowIds: PrimaryKeyType<Q>[]","row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>","cellValue: unknown"],"sources":["../../../src/object-table/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BACEC,WAAW,MAAM;EACf,UAAU,aAAa,WAAW,aAAa;EAC/C,QAAQ,SAAS,UAAU;CAC5B;;;;;;;CASH,kBACEC,UAAU,aAAa,WAAW,aAAa,iBAC/CC;;;;;;CAQF,cACEP,QAAQ,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;;;;;;CAWlE,gBAAgB,WAAW,aAAa;;;;;CAMxC,eAAe,eAAe;;;;;;;CAS9B,kBAAkBQ,gBAAgB,eAAe;;;;CAKjD,yBACEC,KAAK,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI,OAC7DC,uBACG,MAAM;;;;;;CAOX;CAEA;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","selectedRowIds: PrimaryKeyType<Q>[]","row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>","cellValue: unknown"],"sources":["../../../src/object-table/ObjectTableApi.ts"],"version":3,"file":"ObjectTableApi.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,KAAK,eAAe,uBAAwB;AAC1D,OAAO,WAA4B,OAAQ;UAEjC,yBAAyB;CACjC;CACA;CACA;AACD;AAED,OAAO,iBAAS,oBAAoB,EAClC,eACA,cACA,aACyB,EAAxB,2BAA2B,MAAM;UAuB1B,mBAAmB,cAAc,SAAS;CAClD,KAAK,IAAI;CACT,cAAcA,eAAeC,kBAAkBC;AAChD;AAGD,OAAO,iBAAS,cAAc,cAAc,SAAS,EACnD,KACA,aAC0B,EAAzB,mBAAmB,SAAS,MAAM","names":["rowId: string","rowIndex: number","isShiftClick: boolean"],"sources":["../../../src/object-table/SelectionCells.tsx"],"version":3,"file":"SelectionCells.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,KAAK,eAAe,uBAAwB;AAC1D,OAAO,WAA4B,OAAQ;UAGjC,yBAAyB;CACjC;CACA;CACA;AACD;AAED,OAAO,iBAAS,oBAAoB,EAClC,eACA,cACA,aACyB,EAAxB,2BAA2B,MAAM;UAW1B,mBAAmB,cAAc,SAAS;CAClD,KAAK,IAAI;CACT,cAAcA,eAAeC,kBAAkBC;AAChD;AAED,OAAO,iBAAS,cAAc,cAAc,SAAS,EACnD,KACA,aAC0B,EAAzB,mBAAmB,SAAS,MAAM","names":["rowId: string","rowIndex: number","isShiftClick: boolean"],"sources":["../../../src/object-table/SelectionCells.tsx"],"version":3,"file":"SelectionCells.d.ts"}
@@ -7,6 +7,7 @@ interface TableProps<TData extends RowData> {
7
7
  onRowClick?: (row: TData) => void;
8
8
  rowHeight?: number;
9
9
  renderCellContextMenu?: (row: TData, cell: Cell<TData, unknown>) => React.ReactNode;
10
+ className?: string;
10
11
  }
11
- export declare function Table<TData extends RowData>({ table, isLoading, fetchNextPage, onRowClick, rowHeight, renderCellContextMenu }: TableProps<TData>): ReactElement;
12
+ export declare function Table<TData extends RowData>({ table, isLoading, fetchNextPage, onRowClick, rowHeight, renderCellContextMenu, className }: TableProps<TData>): ReactElement;
12
13
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,MAAM,SAAS,aAAa,uBAAwB;AAClE,OAAO,cAAc,oBAAyC,OAAQ;UAI5D,WAAW,cAAc,SAAS;CAC1C,OAAO,MAAM;CACb;CACA,sBAAsB;CACtB,cAAcA,KAAK;CACnB;CACA,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;AACZ;AAED,OAAO,iBAAS,MAAM,cAAc,SAClC,EACE,OACA,WACA,eACA,YACA,WACA,uBACkB,EAAjB,WAAW,SACb","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/Table.tsx"],"version":3,"file":"Table.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,MAAM,SAAS,aAAa,uBAAwB;AAElE,OAAO,cAAc,oBAAyC,OAAQ;UAK5D,WAAW,cAAc,SAAS;CAC1C,OAAO,MAAM;CACb;CACA,sBAAsB;CACtB,cAAcA,KAAK;CACnB;CACA,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;CACX;AACD;AAED,OAAO,iBAAS,MAAM,cAAc,SAClC,EACE,OACA,WACA,eACA,YACA,WACA,uBACA,WACkB,EAAjB,WAAW,SACb","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/Table.tsx"],"version":3,"file":"Table.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,MAAM,KAAK,eAAe,uBAAwB;AAEhE,OAAO,WAAgC,OAAQ;UAGrC,eAAe,cAAc,SAAS;CAC9C,MAAM,MAAM,IAAI;CAChB,mBAAmB,MAAM,UAAU;CACnC,cAAcA,KAAK;CACnB;CACA,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;AACZ;AAED,OAAO,iBAAS,UAAU,cAAc,SAAS,EAC/C,MACA,mBACA,YACA,uBACA,WACsB,EAArB,eAAe,SAAS,MAAM","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/TableBody.tsx"],"version":3,"file":"TableBody.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,MAAM,KAAK,eAAe,uBAAwB;AAEhE,OAAO,WAAgC,OAAQ;UAIrC,eAAe,cAAc,SAAS;CAC9C,MAAM,MAAM,IAAI;CAChB,mBAAmB,MAAM,UAAU;CACnC,cAAcA,KAAK;CACnB;CACA,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;AACZ;AAED,OAAO,iBAAS,UAAU,cAAc,SAAS,EAC/C,MACA,mBACA,YACA,uBACA,WACsB,EAArB,eAAe,SAAS,MAAM","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/TableBody.tsx"],"version":3,"file":"TableBody.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,MAAM,eAAe,uBAAwB;AAE3D,OAAO,WAAuB,OAAQ;UAK5B,eAAe,cAAc,SAAS;CAC9C,MAAM,KAAK;CACX,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;AACZ;AAED,OAAO,iBAAS,UAAU,cAAc,SACtC,EAAE,MAAM,uBAA8C,EAArB,eAAe,SAC/C,MAAM","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/TableCell.tsx"],"version":3,"file":"TableCell.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,MAAM,eAAe,uBAAwB;AAG3D,OAAO,WAAuB,OAAQ;UAM5B,eAAe,cAAc,SAAS;CAC9C,MAAM,KAAK;CACX,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;AACZ;AAED,OAAO,iBAAS,UAAU,cAAc,SACtC,EAAE,MAAM,uBAA8C,EAArB,eAAe,SAC/C,MAAM","names":["row: TData","cell: Cell<TData, unknown>"],"sources":["../../../src/object-table/TableCell.tsx"],"version":3,"file":"TableCell.d.ts"}