@osdk/react-components 0.1.0-beta.6 → 0.1.0
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 +33 -0
- package/README.md +2 -5
- package/build/browser/base-components/checkbox/Checkbox.js +32 -27
- package/build/browser/object-table/CellContextMenu.js +20 -23
- package/build/browser/object-table/LoadingCell.js +38 -0
- package/build/browser/object-table/LoadingCell.js.map +1 -0
- package/build/browser/object-table/LoadingRow.js +69 -0
- package/build/browser/object-table/LoadingRow.js.map +1 -0
- package/build/browser/object-table/LoadingStateTable.js +395 -0
- package/build/browser/object-table/LoadingStateTable.js.map +1 -0
- package/build/browser/object-table/NonIdealState.js +25 -0
- package/build/browser/object-table/NonIdealState.js.map +1 -0
- package/build/browser/object-table/ObjectTable.js +6 -5
- package/build/browser/object-table/ObjectTable.js.map +1 -1
- package/build/browser/object-table/ObjectTableApi.js.map +1 -1
- package/build/browser/object-table/Table.js +948 -45
- package/build/browser/object-table/Table.js.map +1 -1
- package/build/browser/object-table/TableBody.js +269 -34
- package/build/browser/object-table/TableBody.js.map +1 -1
- package/build/browser/object-table/TableCell.js +111 -31
- package/build/browser/object-table/TableCell.js.map +1 -1
- package/build/browser/object-table/TableHeader.js +215 -38
- package/build/browser/object-table/TableHeaderContent.js +18 -21
- package/build/browser/object-table/TableHeaderContent.js.map +1 -1
- package/build/browser/object-table/TableHeaderWithPopover.js +80 -66
- package/build/browser/object-table/TableRow.js +144 -26
- package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js +18 -20
- package/build/browser/object-table/hooks/__tests__/useObjectTableData.test.js.map +1 -1
- package/build/browser/object-table/hooks/useColumnDefs.js +6 -2
- package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/browser/object-table/hooks/useColumnPinning.js.map +1 -1
- package/build/browser/object-table/hooks/useColumnVisibility.js.map +1 -1
- package/build/browser/object-table/hooks/useObjectTableData.js +7 -6
- package/build/browser/object-table/hooks/useObjectTableData.js.map +1 -1
- package/build/browser/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/browser/object-table/hooks/useSelectionColumn.js.map +1 -1
- package/build/browser/object-table/hooks/useTableSorting.js.map +1 -1
- package/build/browser/object-table/utils/getRowId.js.map +1 -1
- package/build/cjs/public/experimental.cjs +435 -264
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +114 -56
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +8 -11
- package/build/esm/base-components/checkbox/Checkbox.module.css +10 -3
- package/build/esm/object-table/CellContextMenu.module.css +1 -1
- package/build/{browser/object-table/CellContextMenu.module.css → esm/object-table/LoadingCell.js} +16 -3
- package/build/esm/object-table/LoadingCell.js.map +1 -0
- package/build/esm/object-table/LoadingCell.module.css +48 -0
- package/build/esm/object-table/LoadingRow.js +43 -0
- package/build/esm/object-table/LoadingRow.js.map +1 -0
- package/build/esm/object-table/LoadingStateTable.js +101 -0
- package/build/esm/object-table/LoadingStateTable.js.map +1 -0
- package/build/{browser/object-table/TableHeaderContent.module.css → esm/object-table/NonIdealState.js} +11 -13
- package/build/esm/object-table/NonIdealState.js.map +1 -0
- package/build/{browser/object-table/Table.module.css → esm/object-table/NonIdealState.module.css} +10 -4
- package/build/esm/object-table/ObjectTable.js +6 -5
- package/build/esm/object-table/ObjectTable.js.map +1 -1
- package/build/esm/object-table/ObjectTableApi.js.map +1 -1
- package/build/esm/object-table/Table.js +34 -13
- package/build/esm/object-table/Table.js.map +1 -1
- package/build/esm/object-table/Table.module.css +2 -2
- package/build/esm/object-table/TableBody.js +13 -2
- package/build/esm/object-table/TableBody.js.map +1 -1
- package/build/esm/object-table/TableCell.js.map +1 -1
- package/build/esm/object-table/TableCell.module.css +7 -8
- package/build/esm/object-table/TableHeader.module.css +15 -9
- package/build/esm/object-table/TableHeaderContent.js.map +1 -1
- package/build/esm/object-table/TableHeaderWithPopover.module.css +31 -26
- package/build/esm/object-table/TableRow.module.css +1 -1
- package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js +18 -20
- package/build/esm/object-table/hooks/__tests__/useObjectTableData.test.js.map +1 -1
- package/build/esm/object-table/hooks/useColumnDefs.js +6 -2
- package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/esm/object-table/hooks/useColumnPinning.js.map +1 -1
- package/build/esm/object-table/hooks/useColumnVisibility.js.map +1 -1
- package/build/esm/object-table/hooks/useObjectTableData.js +7 -6
- package/build/esm/object-table/hooks/useObjectTableData.js.map +1 -1
- package/build/esm/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/esm/object-table/hooks/useSelectionColumn.js.map +1 -1
- package/build/esm/object-table/hooks/useTableSorting.js.map +1 -1
- package/build/esm/object-table/utils/getRowId.js.map +1 -1
- package/build/types/object-table/LoadingCell.d.ts +4 -0
- package/build/types/object-table/LoadingCell.d.ts.map +1 -0
- package/build/types/object-table/LoadingRow.d.ts +11 -0
- package/build/types/object-table/LoadingRow.d.ts.map +1 -0
- package/build/types/object-table/LoadingStateTable.d.ts +11 -0
- package/build/types/object-table/LoadingStateTable.d.ts.map +1 -0
- package/build/types/object-table/NonIdealState.d.ts +6 -0
- package/build/types/object-table/NonIdealState.d.ts.map +1 -0
- package/build/types/object-table/ObjectTable.d.ts +4 -4
- package/build/types/object-table/ObjectTable.d.ts.map +1 -1
- package/build/types/object-table/ObjectTableApi.d.ts +4 -8
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/Table.d.ts +2 -1
- package/build/types/object-table/Table.d.ts.map +1 -1
- package/build/types/object-table/TableBody.d.ts +4 -2
- package/build/types/object-table/TableBody.d.ts.map +1 -1
- package/build/types/object-table/TableHeaderContent.d.ts.map +1 -1
- package/build/types/object-table/hooks/useColumnDefs.d.ts +3 -3
- package/build/types/object-table/hooks/useColumnDefs.d.ts.map +1 -1
- package/build/types/object-table/hooks/useColumnPinning.d.ts +3 -3
- package/build/types/object-table/hooks/useColumnPinning.d.ts.map +1 -1
- package/build/types/object-table/hooks/useColumnVisibility.d.ts +3 -3
- package/build/types/object-table/hooks/useColumnVisibility.d.ts.map +1 -1
- package/build/types/object-table/hooks/useObjectTableData.d.ts +6 -6
- package/build/types/object-table/hooks/useObjectTableData.d.ts.map +1 -1
- package/build/types/object-table/hooks/useRowSelection.d.ts +3 -3
- package/build/types/object-table/hooks/useRowSelection.d.ts.map +1 -1
- package/build/types/object-table/hooks/useSelectionColumn.d.ts +2 -2
- package/build/types/object-table/hooks/useSelectionColumn.d.ts.map +1 -1
- package/build/types/object-table/hooks/useTableSorting.d.ts +3 -3
- package/build/types/object-table/hooks/useTableSorting.d.ts.map +1 -1
- package/build/types/object-table/utils/getRowId.d.ts +3 -3
- package/build/types/object-table/utils/getRowId.d.ts.map +1 -1
- package/package.json +6 -6
- package/build/browser/base-components/checkbox/Checkbox.module.css +0 -72
- package/build/browser/object-table/TableBody.module.css +0 -20
- package/build/browser/object-table/TableCell.module.css +0 -63
- package/build/browser/object-table/TableHeader.module.css +0 -95
- package/build/browser/object-table/TableHeaderWithPopover.module.css +0 -105
- package/build/browser/object-table/TableRow.module.css +0 -60
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
// build/browser/object-table/LoadingStateTable.js
|
|
2
|
+
import classNames3 from "classnames";
|
|
3
|
+
import React6, { useEffect, useRef, useState as useState2 } from "react";
|
|
4
|
+
|
|
5
|
+
// build/browser/object-table/LoadingCell.module.css
|
|
6
|
+
var css = '/*\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\n.osdkLoadingCell {\n height: var(--osdk-table-cell-fontSize);\n border-radius: calc(var(--osdk-surface-border-radius) * 0.5);\n flex: 1;\n}\n\n/* Blueprint skeleton animation keyframes */\n@keyframes skeleton-glow {\n from {\n background: var(--osdk-table-skeleton-color-from);\n border-color: var(--osdk-table-skeleton-color-from);\n }\n\n to {\n background: var(--osdk-table-skeleton-color-to);\n border-color: var(--osdk-table-skeleton-color-to);\n }\n}\n\n.osdkCellSkeleton {\n animation: 1000ms linear infinite alternate skeleton-glow;\n background: var(--osdk-table-skeleton-color-from);\n background-clip: padding-box;\n border-color: var(--osdk-table-skeleton-color-from);\n border-radius: calc(var(--osdk-surface-border-radius) * 0.5);\n border: 1px solid var(--osdk-table-skeleton-border-color);\n box-shadow: none;\n color: transparent;\n cursor: default;\n pointer-events: none;\n user-select: none;\n}\n';
|
|
7
|
+
if (typeof document !== "undefined") {
|
|
8
|
+
const style = document.createElement("style");
|
|
9
|
+
style.textContent = css;
|
|
10
|
+
document.head.appendChild(style);
|
|
11
|
+
}
|
|
12
|
+
var LoadingCell_default = { "osdkLoadingCell": "osdkLoadingCell", "osdkCellSkeleton": "osdkCellSkeleton" };
|
|
13
|
+
|
|
14
|
+
// build/browser/object-table/LoadingRow.js
|
|
15
|
+
import React2 from "react";
|
|
16
|
+
import classNames from "classnames";
|
|
17
|
+
import React from "react";
|
|
18
|
+
var css2 = '/*\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\n.osdkLoadingCell {\n height: var(--osdk-table-cell-fontSize);\n border-radius: calc(var(--osdk-surface-border-radius) * 0.5);\n flex: 1;\n}\n\n/* Blueprint skeleton animation keyframes */\n@keyframes skeleton-glow {\n from {\n background: var(--osdk-table-skeleton-color-from);\n border-color: var(--osdk-table-skeleton-color-from);\n }\n\n to {\n background: var(--osdk-table-skeleton-color-to);\n border-color: var(--osdk-table-skeleton-color-to);\n }\n}\n\n.osdkCellSkeleton {\n animation: 1000ms linear infinite alternate skeleton-glow;\n background: var(--osdk-table-skeleton-color-from);\n background-clip: padding-box;\n border-color: var(--osdk-table-skeleton-color-from);\n border-radius: calc(var(--osdk-surface-border-radius) * 0.5);\n border: 1px solid var(--osdk-table-skeleton-border-color);\n box-shadow: none;\n color: transparent;\n cursor: default;\n pointer-events: none;\n user-select: none;\n}\n';
|
|
19
|
+
if (typeof document !== "undefined") {
|
|
20
|
+
const style = document.createElement("style");
|
|
21
|
+
style.textContent = css2;
|
|
22
|
+
document.head.appendChild(style);
|
|
23
|
+
}
|
|
24
|
+
var LoadingCell_default2 = { "osdkLoadingCell": "osdkLoadingCell", "osdkCellSkeleton": "osdkCellSkeleton" };
|
|
25
|
+
var css22 = '/*\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\n.osdkTableCell {\n display: flex;\n align-items: center;\n text-align: left;\n position: relative;\n padding: var(--osdk-table-cell-padding);\n font-size: var(--osdk-table-cell-fontSize);\n color: var(--osdk-table-cell-color);\n background-color: inherit;\n border-right: var(--osdk-table-cell-divider);\n\n &:first-child {\n border-left: var(--osdk-table-border);\n }\n\n &:last-child {\n border-right: var(--osdk-table-border);\n }\n}\n\n.osdkTableCell[data-pinned="left"],\n.osdkTableCell[data-pinned="right"] {\n position: sticky;\n z-index: var(--osdk-surface-z-index-1);\n}\n\n/* Last left-pinned column - no left-pinned siblings after it */\n.osdkTableCell[data-pinned="left"]:not(:has(~ [data-pinned="left"])) {\n border-right: var(--osdk-table-pinned-column-border);\n}\n\n/* First right-pinned column - no right-pinned siblings before it */\n.osdkTableCell[data-pinned="right"]:not(:has(~ [data-pinned="right"]):nth-child(n+2)) {\n border-left: var(--osdk-table-pinned-column-border);\n}\n\n.osdkTableCell:has([role="checkbox"]) {\n justify-content: center;\n}\n\n.osdkTableCellContent:not(:has([role="checkbox"])) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n}\n';
|
|
26
|
+
if (typeof document !== "undefined") {
|
|
27
|
+
const style = document.createElement("style");
|
|
28
|
+
style.textContent = css22;
|
|
29
|
+
document.head.appendChild(style);
|
|
30
|
+
}
|
|
31
|
+
var TableCell_default = { "osdkTableCell": "osdkTableCell", "osdkTableCellContent": "osdkTableCellContent" };
|
|
32
|
+
function LoadingCell({
|
|
33
|
+
width
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ React.createElement("td", {
|
|
36
|
+
className: TableCell_default.osdkTableCell,
|
|
37
|
+
style: {
|
|
38
|
+
width
|
|
39
|
+
}
|
|
40
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
41
|
+
className: classNames(LoadingCell_default2.osdkLoadingCell, LoadingCell_default2.osdkCellSkeleton)
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
var css3 = '/*\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\n.osdkTableRow {\n position: absolute;\n display: flex;\n background-color: var(--osdk-table-row-bg-default);\n border-top: var(--osdk-table-row-divider);\n border-bottom: var(--osdk-table-border-width) solid transparent;\n\n &:last-child {\n border-bottom: var(--osdk-table-border);\n }\n\n /* Zebra rows */\n &:nth-child(even) {\n background-color: var(\n --osdk-table-row-bg-alternate,\n var(--osdk-table-row-bg-default)\n );\n }\n\n &:hover {\n z-index: 1;\n background-color: var(\n --osdk-table-row-bg-hover,\n var(--osdk-surface-background-color-default-hover)\n );\n border-top-color: var(--osdk-table-row-border-color-hover);\n border-bottom-color: var(--osdk-table-row-border-color-hover);\n }\n\n &[data-selected="true"] {\n z-index: 2;\n background-color: var(--osdk-table-row-bg-active);\n border-top-color: var(--osdk-table-row-border-color-active);\n border-bottom-color: var(--osdk-table-row-border-color-active);\n }\n\n &[data-selected="true"] + &[data-selected="true"] {\n border-top-color: transparent;\n }\n\n &[data-selected="true"]:has(+ &[data-selected="true"]) {\n border-bottom-color: transparent;\n }\n}\n';
|
|
45
|
+
if (typeof document !== "undefined") {
|
|
46
|
+
const style = document.createElement("style");
|
|
47
|
+
style.textContent = css3;
|
|
48
|
+
document.head.appendChild(style);
|
|
49
|
+
}
|
|
50
|
+
var TableRow_default = { "osdkTableRow": "osdkTableRow" };
|
|
51
|
+
function LoadingRow({
|
|
52
|
+
headers,
|
|
53
|
+
columnCount,
|
|
54
|
+
translateY,
|
|
55
|
+
rowHeight = 40,
|
|
56
|
+
columnWidth = 80
|
|
57
|
+
}) {
|
|
58
|
+
return /* @__PURE__ */ React2.createElement("tr", {
|
|
59
|
+
className: TableRow_default.osdkTableRow,
|
|
60
|
+
style: {
|
|
61
|
+
height: `${rowHeight}px`,
|
|
62
|
+
transform: `translateY(${translateY}px)`
|
|
63
|
+
}
|
|
64
|
+
}, /* @__PURE__ */ React2.createElement(React2.Fragment, null, Array.from({
|
|
65
|
+
length: columnCount
|
|
66
|
+
}).map((_, index) => {
|
|
67
|
+
const width = headers.length > index ? headers[index].getSize() : columnWidth;
|
|
68
|
+
return /* @__PURE__ */ React2.createElement(LoadingCell, {
|
|
69
|
+
key: `loading-cell-${index}`,
|
|
70
|
+
width
|
|
71
|
+
});
|
|
72
|
+
})));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// build/browser/object-table/TableBody.module.css
|
|
76
|
+
var css4 = '/*\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\n.osdkTableBody {\n display: grid;\n position: relative;\n}\n';
|
|
77
|
+
if (typeof document !== "undefined") {
|
|
78
|
+
const style = document.createElement("style");
|
|
79
|
+
style.textContent = css4;
|
|
80
|
+
document.head.appendChild(style);
|
|
81
|
+
}
|
|
82
|
+
var TableBody_default = { "osdkTableBody": "osdkTableBody" };
|
|
83
|
+
|
|
84
|
+
// build/browser/object-table/TableHeader.js
|
|
85
|
+
import React5 from "react";
|
|
86
|
+
|
|
87
|
+
// build/browser/object-table/TableHeader.module.css
|
|
88
|
+
var css5 = '/*\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\n.osdkTableHeader {\n display: grid;\n position: sticky;\n top: 0;\n z-index: var(--osdk-surface-z-index-1);\n background-color: var(--osdk-table-header-bg);\n}\n\n.osdkTableHeader[data-resizing="true"] {\n cursor: col-resize;\n user-select: none;\n}\n\n.osdkTableHeaderRow {\n display: flex;\n}\n\n.osdkTableHeaderCell {\n display: flex;\n align-items: center;\n text-align: left;\n position: relative;\n padding: var(--osdk-table-cell-padding);\n font-weight: var(--osdk-table-header-fontWeight);\n font-size: var(--osdk-table-header-fontSize);\n color: var(--osdk-table-header-color);\n border-top: var(--osdk-table-border);\n border-right: var(--osdk-table-header-divider);\n background-color: inherit;\n\n &:first-child {\n border-left: var(--osdk-table-border);\n }\n\n &:last-child {\n border-right: var(--osdk-table-border);\n }\n}\n\n.osdkTableHeaderCell[data-pinned="left"],\n.osdkTableHeaderCell[data-pinned="right"] {\n position: sticky;\n z-index: var(--osdk-surface-z-index-2);\n}\n\n/* Last left-pinned column - no left-pinned siblings after it */\n.osdkTableHeaderCell[data-pinned="left"]:not(:has(~ [data-pinned="left"])) {\n border-right: var(--osdk-table-pinned-column-border);\n}\n\n/* First right-pinned column - no right-pinned siblings before it */\n.osdkTableHeaderCell[data-pinned="right"]:not(\n :has(~ [data-pinned="right"]):nth-child(n + 2)\n ) {\n border-left: var(--osdk-table-pinned-column-border);\n}\n\n.osdkTableHeaderCell:has([role="checkbox"]) {\n justify-content: center;\n}\n\n.osdkTableHeaderResizer {\n background: none;\n cursor: col-resize;\n height: 100%;\n position: absolute;\n right: calc(-1 * var(--osdk-table-border-width));\n top: 0;\n touch-action: none;\n width: 3px;\n z-index: var(--osdk-surface-z-index-2);\n\n &:hover {\n background: var(--osdk-intent-primary-hover);\n }\n\n &:active {\n background: var(--osdk-intent-primary-active);\n }\n}\n\n.osdkLoadingHeaderCell {\n height: var(--osdk-table-header-fontSize);\n flex: 1;\n}\n';
|
|
89
|
+
if (typeof document !== "undefined") {
|
|
90
|
+
const style = document.createElement("style");
|
|
91
|
+
style.textContent = css5;
|
|
92
|
+
document.head.appendChild(style);
|
|
93
|
+
}
|
|
94
|
+
var TableHeader_default = { "osdkTableHeader": "osdkTableHeader", "osdkTableHeaderRow": "osdkTableHeaderRow", "osdkTableHeaderCell": "osdkTableHeaderCell", "osdkTableHeaderResizer": "osdkTableHeaderResizer", "osdkLoadingHeaderCell": "osdkLoadingHeaderCell" };
|
|
95
|
+
|
|
96
|
+
// build/browser/object-table/TableHeaderContent.js
|
|
97
|
+
import { flexRender } from "@tanstack/react-table";
|
|
98
|
+
import React3 from "react";
|
|
99
|
+
|
|
100
|
+
// build/browser/object-table/TableHeaderContent.module.css
|
|
101
|
+
var css6 = '/*\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\n.osdkHeaderContent {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.osdkHeaderContent:has([role="checkbox"]) {\n display: flex;\n justify-content: center;\n}\n';
|
|
102
|
+
if (typeof document !== "undefined") {
|
|
103
|
+
const style = document.createElement("style");
|
|
104
|
+
style.textContent = css6;
|
|
105
|
+
document.head.appendChild(style);
|
|
106
|
+
}
|
|
107
|
+
var TableHeaderContent_default = { "osdkHeaderContent": "osdkHeaderContent" };
|
|
108
|
+
|
|
109
|
+
// build/browser/object-table/TableHeaderContent.js
|
|
110
|
+
function TableHeaderContent({
|
|
111
|
+
header
|
|
112
|
+
}) {
|
|
113
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
114
|
+
className: TableHeaderContent_default.osdkHeaderContent
|
|
115
|
+
}, flexRender(header.column.columnDef.header, header.getContext()));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// build/browser/object-table/TableHeaderWithPopover.js
|
|
119
|
+
import { Menu } from "@base-ui/react/menu";
|
|
120
|
+
import { ChevronDown, Pin, Remove, SortAlphabetical, SortAlphabeticalDesc, Unpin, VerticalDistribution } from "@blueprintjs/icons";
|
|
121
|
+
import classNames2 from "classnames";
|
|
122
|
+
import React4, { useCallback, useState } from "react";
|
|
123
|
+
|
|
124
|
+
// build/browser/object-table/TableHeaderWithPopover.module.css
|
|
125
|
+
var css7 = '/*\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\n.osdkCenterContainer {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.osdkContentGap {\n display: flex;\n gap: var(--osdk-surface-spacing);\n}\n\n.osdkHeaderContainer {\n justify-content: space-between;\n flex: 1;\n min-width: 0;\n align-self: stretch;\n}\n\n.osdkHeaderContentLeft {\n min-width: 0;\n flex-shrink: 1;\n}\n\n.osdkHeaderContentRight {\n flex-shrink: 0;\n}\n\n.osdkHeaderPopoverTrigger {\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n border: var(--osdk-surface-border-width) solid\n var(--osdk-surface-border-color-default);\n border-radius: var(--osdk-surface-border-radius);\n color: var(--osdk-intent-default-foreground);\n user-select: none;\n outline: none;\n\n &:hover {\n background-color: var(--osdk-intent-default-hover);\n }\n\n &[data-popup-open] {\n background-color: var(--osdk-intent-primary-rest);\n }\n\n &:focus-visible {\n outline: var(--osdk-focus-visible-outline);\n outline-offset: var(--osdk-focus-visible-outline-offset);\n }\n}\n\n.osdkHeaderIcon {\n width: var(--osdk-iconography-size-small);\n height: var(--osdk-iconography-size-small);\n}\n\n.osdkHeaderPopup {\n box-sizing: border-box;\n padding: var(--osdk-surface-spacing);\n border-radius: var(--osdk-surface-border-radius);\n border: var(--osdk-surface-border-width) solid\n var(--osdk-surface-border-color-default);\n background-color: var(--osdk-surface-background-color-default);\n color: var(--osdk-typography-color-default-rest);\n box-shadow: var(--osdk-surface-shadow-2);\n font-size: var(--osdk-typography-size-body-medium);\n outline: none;\n}\n\n.osdkHeaderMenuItem {\n justify-content: flex-start;\n padding: var(--osdk-surface-spacing);\n cursor: pointer;\n}\n\n.osdkHeaderMenuItem:hover {\n outline: none;\n background-color: var(--osdk-surface-background-color-default-hover);\n border-radius: var(--osdk-surface-border-radius);\n}\n\n.osdkHeaderActiveMenuItem {\n background-color: var(--osdk-intent-primary-rest);\n color: var(--osdk-intent-primary-foreground);\n}\n\n.osdkHeaderActiveMenuItem:hover {\n background-color: var(--osdk-intent-primary-hover);\n}\n\n.osdkHeaderActiveMenuItem:active {\n background-color: var(--osdk-intent-primary-active);\n}\n';
|
|
126
|
+
if (typeof document !== "undefined") {
|
|
127
|
+
const style = document.createElement("style");
|
|
128
|
+
style.textContent = css7;
|
|
129
|
+
document.head.appendChild(style);
|
|
130
|
+
}
|
|
131
|
+
var TableHeaderWithPopover_default = { "osdkCenterContainer": "osdkCenterContainer", "osdkContentGap": "osdkContentGap", "osdkHeaderContainer": "osdkHeaderContainer", "osdkHeaderContentLeft": "osdkHeaderContentLeft", "osdkHeaderContentRight": "osdkHeaderContentRight", "osdkHeaderPopoverTrigger": "osdkHeaderPopoverTrigger", "osdkHeaderIcon": "osdkHeaderIcon", "osdkHeaderPopup": "osdkHeaderPopup", "osdkHeaderMenuItem": "osdkHeaderMenuItem", "osdkHeaderActiveMenuItem": "osdkHeaderActiveMenuItem" };
|
|
132
|
+
|
|
133
|
+
// build/browser/object-table/TableHeaderWithPopover.js
|
|
134
|
+
function HeaderMenuItem({
|
|
135
|
+
onClick,
|
|
136
|
+
icon: Icon,
|
|
137
|
+
label,
|
|
138
|
+
active = false
|
|
139
|
+
}) {
|
|
140
|
+
return /* @__PURE__ */ React4.createElement(Menu.Item, {
|
|
141
|
+
closeOnClick: true,
|
|
142
|
+
className: classNames2(TableHeaderWithPopover_default.osdkCenterContainer, TableHeaderWithPopover_default.osdkContentGap, TableHeaderWithPopover_default.osdkHeaderMenuItem, active && TableHeaderWithPopover_default.osdkHeaderActiveMenuItem),
|
|
143
|
+
onClick
|
|
144
|
+
}, /* @__PURE__ */ React4.createElement(Icon, {
|
|
145
|
+
className: TableHeaderWithPopover_default.osdkHeaderIcon,
|
|
146
|
+
color: "currentColor"
|
|
147
|
+
}), /* @__PURE__ */ React4.createElement("span", null, label));
|
|
148
|
+
}
|
|
149
|
+
function TableHeaderWithPopover({
|
|
150
|
+
header,
|
|
151
|
+
isColumnPinned,
|
|
152
|
+
setColumnPinning,
|
|
153
|
+
onSortChange,
|
|
154
|
+
onResetSize
|
|
155
|
+
}) {
|
|
156
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
157
|
+
const handlePinLeft = useCallback(() => {
|
|
158
|
+
setColumnPinning((prev) => {
|
|
159
|
+
return {
|
|
160
|
+
left: [...prev.left || [], header.column.id],
|
|
161
|
+
right: prev.right?.filter((id) => id !== header.column.id) || []
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
}, [header.column.id, setColumnPinning]);
|
|
165
|
+
const handleUnpin = useCallback(() => {
|
|
166
|
+
setColumnPinning((prev) => {
|
|
167
|
+
return {
|
|
168
|
+
left: prev.left?.filter((id) => id !== header.column.id) || [],
|
|
169
|
+
right: prev.right?.filter((id) => id !== header.column.id) || []
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
}, [header.column.id, setColumnPinning]);
|
|
173
|
+
const handleSortAscending = useCallback(() => {
|
|
174
|
+
header.column.toggleSorting(false);
|
|
175
|
+
onSortChange?.([{
|
|
176
|
+
id: header.column.id,
|
|
177
|
+
desc: false
|
|
178
|
+
}]);
|
|
179
|
+
}, [header.column, onSortChange]);
|
|
180
|
+
const handleSortDescending = useCallback(() => {
|
|
181
|
+
header.column.toggleSorting(true);
|
|
182
|
+
onSortChange?.([{
|
|
183
|
+
id: header.column.id,
|
|
184
|
+
desc: true
|
|
185
|
+
}]);
|
|
186
|
+
}, [header.column, onSortChange]);
|
|
187
|
+
const handleClearAllSorts = useCallback(() => {
|
|
188
|
+
header.column.clearSorting();
|
|
189
|
+
onSortChange?.([]);
|
|
190
|
+
}, [header.column, onSortChange]);
|
|
191
|
+
const handleResetSize = useCallback(() => {
|
|
192
|
+
header.column.resetSize();
|
|
193
|
+
if (onResetSize) {
|
|
194
|
+
onResetSize();
|
|
195
|
+
}
|
|
196
|
+
}, [header.column, onResetSize]);
|
|
197
|
+
const handleInteraction = useCallback((e) => {
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
setIsOpen((prev) => !prev);
|
|
200
|
+
}, []);
|
|
201
|
+
const isSorted = header.column.getIsSorted();
|
|
202
|
+
const isSortable = header.column.getCanSort();
|
|
203
|
+
return /* @__PURE__ */ React4.createElement(Menu.Root, {
|
|
204
|
+
open: isOpen,
|
|
205
|
+
onOpenChange: setIsOpen
|
|
206
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
207
|
+
className: classNames2(TableHeaderWithPopover_default.osdkCenterContainer, TableHeaderWithPopover_default.osdkContentGap, TableHeaderWithPopover_default.osdkHeaderContainer),
|
|
208
|
+
onContextMenu: handleInteraction
|
|
209
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
210
|
+
className: classNames2(TableHeaderWithPopover_default.osdkCenterContainer, TableHeaderWithPopover_default.osdkContentGap, TableHeaderWithPopover_default.osdkHeaderContentLeft)
|
|
211
|
+
}, isColumnPinned && /* @__PURE__ */ React4.createElement(Pin, {
|
|
212
|
+
className: TableHeaderWithPopover_default.osdkHeaderIcon,
|
|
213
|
+
color: "currentColor"
|
|
214
|
+
}), /* @__PURE__ */ React4.createElement(TableHeaderContent, {
|
|
215
|
+
header
|
|
216
|
+
})), /* @__PURE__ */ React4.createElement("div", {
|
|
217
|
+
className: classNames2(TableHeaderWithPopover_default.osdkCenterContainer, TableHeaderWithPopover_default.osdkContentGap, TableHeaderWithPopover_default.osdkHeaderContentRight)
|
|
218
|
+
}, isSorted && /* @__PURE__ */ React4.createElement("div", {
|
|
219
|
+
className: TableHeaderWithPopover_default.osdkCenterContainer
|
|
220
|
+
}, isSorted === "asc" ? /* @__PURE__ */ React4.createElement(SortAlphabetical, {
|
|
221
|
+
className: TableHeaderWithPopover_default.osdkHeaderIcon,
|
|
222
|
+
color: "currentColor"
|
|
223
|
+
}) : /* @__PURE__ */ React4.createElement(SortAlphabeticalDesc, {
|
|
224
|
+
className: TableHeaderWithPopover_default.osdkHeaderIcon,
|
|
225
|
+
color: "currentColor"
|
|
226
|
+
})), /* @__PURE__ */ React4.createElement(Menu.Trigger, {
|
|
227
|
+
"aria-label": `Open header menu for column with id=${header.column.id}`,
|
|
228
|
+
className: classNames2(TableHeaderWithPopover_default.osdkCenterContainer, TableHeaderWithPopover_default.osdkHeaderPopoverTrigger)
|
|
229
|
+
}, /* @__PURE__ */ React4.createElement(ChevronDown, {
|
|
230
|
+
className: TableHeaderWithPopover_default.osdkHeaderIcon
|
|
231
|
+
}))), /* @__PURE__ */ React4.createElement(Menu.Portal, {
|
|
232
|
+
container: document.body
|
|
233
|
+
}, /* @__PURE__ */ React4.createElement(Menu.Positioner, {
|
|
234
|
+
sideOffset: 4
|
|
235
|
+
}, /* @__PURE__ */ React4.createElement(Menu.Popup, {
|
|
236
|
+
className: TableHeaderWithPopover_default.osdkHeaderPopup
|
|
237
|
+
}, !isColumnPinned && /* @__PURE__ */ React4.createElement(HeaderMenuItem, {
|
|
238
|
+
onClick: handlePinLeft,
|
|
239
|
+
icon: Pin,
|
|
240
|
+
label: "Pin column"
|
|
241
|
+
}), isColumnPinned && /* @__PURE__ */ React4.createElement(HeaderMenuItem, {
|
|
242
|
+
onClick: handleUnpin,
|
|
243
|
+
icon: Unpin,
|
|
244
|
+
label: "Unpin Column",
|
|
245
|
+
active: true
|
|
246
|
+
}), isSortable && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(HeaderMenuItem, {
|
|
247
|
+
onClick: handleSortAscending,
|
|
248
|
+
icon: SortAlphabetical,
|
|
249
|
+
label: "Sort ascending",
|
|
250
|
+
active: isSorted === "asc"
|
|
251
|
+
}), /* @__PURE__ */ React4.createElement(HeaderMenuItem, {
|
|
252
|
+
onClick: handleSortDescending,
|
|
253
|
+
icon: SortAlphabeticalDesc,
|
|
254
|
+
label: "Sort descending",
|
|
255
|
+
active: isSorted === "desc"
|
|
256
|
+
})), !!isSorted && /* @__PURE__ */ React4.createElement(HeaderMenuItem, {
|
|
257
|
+
onClick: handleClearAllSorts,
|
|
258
|
+
icon: Remove,
|
|
259
|
+
label: "Clear all sorts"
|
|
260
|
+
}), /* @__PURE__ */ React4.createElement(HeaderMenuItem, {
|
|
261
|
+
onClick: handleResetSize,
|
|
262
|
+
icon: VerticalDistribution,
|
|
263
|
+
label: "Reset Column Size"
|
|
264
|
+
}))))));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// build/browser/object-table/utils/constants.js
|
|
268
|
+
var SELECTION_COLUMN_ID = "__selection__";
|
|
269
|
+
|
|
270
|
+
// build/browser/object-table/utils/getColumnPinningStyles.js
|
|
271
|
+
function getColumnPinningStyles(column) {
|
|
272
|
+
const isPinned = column.getIsPinned();
|
|
273
|
+
return {
|
|
274
|
+
columnStyles: {
|
|
275
|
+
left: isPinned === "left" ? `${column.getStart("left")}px` : void 0,
|
|
276
|
+
right: isPinned === "right" ? `${column.getAfter("right")}px` : void 0,
|
|
277
|
+
width: column.getSize()
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// build/browser/object-table/TableHeader.js
|
|
283
|
+
function TableHeader({
|
|
284
|
+
table
|
|
285
|
+
}) {
|
|
286
|
+
const isResizing = !!table.getState().columnSizingInfo?.isResizingColumn;
|
|
287
|
+
return /* @__PURE__ */ React5.createElement("thead", {
|
|
288
|
+
className: TableHeader_default.osdkTableHeader,
|
|
289
|
+
"data-resizing": isResizing
|
|
290
|
+
}, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React5.createElement("tr", {
|
|
291
|
+
key: headerGroup.id,
|
|
292
|
+
className: TableHeader_default.osdkTableHeaderRow
|
|
293
|
+
}, headerGroup.headers.map((header) => {
|
|
294
|
+
const {
|
|
295
|
+
columnStyles
|
|
296
|
+
} = getColumnPinningStyles(header.column);
|
|
297
|
+
const isColumnPinned = header.column.getIsPinned();
|
|
298
|
+
const isSelectColumn = header.id === SELECTION_COLUMN_ID;
|
|
299
|
+
return /* @__PURE__ */ React5.createElement("th", {
|
|
300
|
+
key: header.id,
|
|
301
|
+
"data-pinned": header.column.getIsPinned(),
|
|
302
|
+
className: TableHeader_default.osdkTableHeaderCell,
|
|
303
|
+
style: columnStyles
|
|
304
|
+
}, header.isPlaceholder ? null : isSelectColumn ? /* @__PURE__ */ React5.createElement(TableHeaderContent, {
|
|
305
|
+
header
|
|
306
|
+
}) : /* @__PURE__ */ React5.createElement(TableHeaderWithPopover, {
|
|
307
|
+
header,
|
|
308
|
+
isColumnPinned,
|
|
309
|
+
setColumnPinning: table.setColumnPinning
|
|
310
|
+
}), header.column.getCanResize() && /* @__PURE__ */ React5.createElement("div", {
|
|
311
|
+
className: TableHeader_default.osdkTableHeaderResizer,
|
|
312
|
+
onDoubleClick: () => header.column.resetSize(),
|
|
313
|
+
onMouseDown: header.getResizeHandler(),
|
|
314
|
+
onTouchStart: header.getResizeHandler()
|
|
315
|
+
}));
|
|
316
|
+
}))));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// build/browser/object-table/LoadingStateTable.js
|
|
320
|
+
var MIN_ROWS = 5;
|
|
321
|
+
function LoadingStateTable({
|
|
322
|
+
table,
|
|
323
|
+
tableContainerRef,
|
|
324
|
+
headerGroups,
|
|
325
|
+
rowHeight = 40,
|
|
326
|
+
columnWidth = 120
|
|
327
|
+
}) {
|
|
328
|
+
const isSelectionEnabled = table.options.enableRowSelection;
|
|
329
|
+
const minHeaderCount = isSelectionEnabled ? 1 : 0;
|
|
330
|
+
const headers = headerGroups[0]?.headers ?? [];
|
|
331
|
+
const hasHeadersLoaded = headers.length > minHeaderCount;
|
|
332
|
+
const headerRef = useRef(null);
|
|
333
|
+
const bodyRef = useRef(null);
|
|
334
|
+
const [loadingRowCount, setLoadingRowCount] = useState2(MIN_ROWS);
|
|
335
|
+
const [loadingColumnCount, setLoadingColumnCount] = useState2(headers.length);
|
|
336
|
+
useEffect(() => {
|
|
337
|
+
if (hasHeadersLoaded) {
|
|
338
|
+
setLoadingColumnCount(headers.length);
|
|
339
|
+
} else {
|
|
340
|
+
if (tableContainerRef.current) {
|
|
341
|
+
const tableWidth = tableContainerRef.current.clientWidth;
|
|
342
|
+
if (tableWidth > 0) {
|
|
343
|
+
const columnsNeeded = Math.ceil(tableWidth / columnWidth);
|
|
344
|
+
setLoadingColumnCount(columnsNeeded);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}, [columnWidth, hasHeadersLoaded, headers, tableContainerRef]);
|
|
349
|
+
useEffect(() => {
|
|
350
|
+
if (tableContainerRef.current) {
|
|
351
|
+
const containerHeight = tableContainerRef.current.clientHeight;
|
|
352
|
+
const availableHeight = containerHeight - rowHeight;
|
|
353
|
+
if (availableHeight > 0) {
|
|
354
|
+
const rowsNeeded = Math.ceil(availableHeight / rowHeight);
|
|
355
|
+
setLoadingRowCount(Math.max(rowsNeeded, MIN_ROWS));
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}, [tableContainerRef, rowHeight]);
|
|
359
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, hasHeadersLoaded ? /* @__PURE__ */ React6.createElement(TableHeader, {
|
|
360
|
+
table
|
|
361
|
+
}) : /* @__PURE__ */ React6.createElement("thead", {
|
|
362
|
+
className: TableHeader_default.osdkTableHeader,
|
|
363
|
+
ref: headerRef
|
|
364
|
+
}, /* @__PURE__ */ React6.createElement("tr", {
|
|
365
|
+
className: TableHeader_default.osdkTableHeaderRow
|
|
366
|
+
}, Array.from({
|
|
367
|
+
length: loadingColumnCount
|
|
368
|
+
}).map((_, index) => {
|
|
369
|
+
const width = headers.length > index ? headers[index].getSize() : columnWidth;
|
|
370
|
+
return /* @__PURE__ */ React6.createElement("th", {
|
|
371
|
+
key: `loading-header-${index}`,
|
|
372
|
+
className: TableHeader_default.osdkTableHeaderCell,
|
|
373
|
+
style: {
|
|
374
|
+
width
|
|
375
|
+
}
|
|
376
|
+
}, /* @__PURE__ */ React6.createElement("div", {
|
|
377
|
+
className: classNames3(TableHeader_default.osdkLoadingHeaderCell, LoadingCell_default.osdkCellSkeleton)
|
|
378
|
+
}));
|
|
379
|
+
}))), /* @__PURE__ */ React6.createElement("tbody", {
|
|
380
|
+
className: TableBody_default.osdkTableBody,
|
|
381
|
+
ref: bodyRef
|
|
382
|
+
}, Array.from({
|
|
383
|
+
length: loadingRowCount
|
|
384
|
+
}).map((_, index) => /* @__PURE__ */ React6.createElement(LoadingRow, {
|
|
385
|
+
key: `skeleton-${index}`,
|
|
386
|
+
columnCount: loadingColumnCount,
|
|
387
|
+
headers,
|
|
388
|
+
translateY: rowHeight * index,
|
|
389
|
+
rowHeight,
|
|
390
|
+
columnWidth
|
|
391
|
+
}))));
|
|
392
|
+
}
|
|
393
|
+
export {
|
|
394
|
+
LoadingStateTable
|
|
395
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingStateTable.js","names":["classNames","React","useEffect","useRef","useState","loadingStyles","LoadingRow","bodyStyles","TableHeader","headerStyles","MIN_ROWS","LoadingStateTable","table","tableContainerRef","headerGroups","rowHeight","columnWidth","isSelectionEnabled","options","enableRowSelection","minHeaderCount","headers","hasHeadersLoaded","length","headerRef","bodyRef","loadingRowCount","setLoadingRowCount","loadingColumnCount","setLoadingColumnCount","current","tableWidth","clientWidth","columnsNeeded","Math","ceil","containerHeight","clientHeight","availableHeight","rowsNeeded","max","createElement","Fragment","className","osdkTableHeader","ref","osdkTableHeaderRow","Array","from","map","_","index","width","getSize","key","osdkTableHeaderCell","style","osdkLoadingHeaderCell","osdkCellSkeleton","osdkTableBody","columnCount","translateY"],"sources":["LoadingStateTable.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 { HeaderGroup, RowData, Table } from \"@tanstack/react-table\";\nimport classNames from \"classnames\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport loadingStyles from \"./LoadingCell.module.css\";\nimport { LoadingRow } from \"./LoadingRow.js\";\nimport bodyStyles from \"./TableBody.module.css\";\nimport { TableHeader } from \"./TableHeader.js\";\nimport headerStyles from \"./TableHeader.module.css\";\n\ninterface LoadingStateTableProps<TData extends RowData> {\n table: Table<TData>;\n tableContainerRef: React.RefObject<HTMLDivElement>;\n headerGroups: Array<HeaderGroup<TData>>;\n rowHeight?: number;\n columnWidth?: number;\n}\n\nconst MIN_ROWS = 5;\n\nexport function LoadingStateTable<TData extends RowData>({\n table,\n tableContainerRef,\n headerGroups,\n rowHeight = 40,\n columnWidth = 120,\n}: LoadingStateTableProps<TData>): React.ReactElement {\n // If selection enabled, there will be a header for the selection column\n const isSelectionEnabled = table.options.enableRowSelection;\n const minHeaderCount = isSelectionEnabled ? 1 : 0;\n const headers = headerGroups[0]?.headers ?? [];\n const hasHeadersLoaded = headers.length > minHeaderCount;\n\n const headerRef = useRef<HTMLTableSectionElement>(null);\n const bodyRef = useRef<HTMLTableSectionElement>(null);\n const [loadingRowCount, setLoadingRowCount] = useState<number>(MIN_ROWS);\n const [loadingColumnCount, setLoadingColumnCount] = useState<number>(\n headers.length,\n );\n // Calculate number of columns needed to fill container width\n useEffect(() => {\n if (hasHeadersLoaded) {\n setLoadingColumnCount(headers.length);\n } else {\n if (tableContainerRef.current) {\n const tableWidth = tableContainerRef.current.clientWidth;\n if (tableWidth > 0) {\n const columnsNeeded = Math.ceil(tableWidth / columnWidth);\n setLoadingColumnCount(columnsNeeded);\n }\n }\n }\n }, [columnWidth, hasHeadersLoaded, headers, tableContainerRef]);\n\n // Calculate number of rows needed to fill container height\n useEffect(() => {\n if (tableContainerRef.current) {\n const containerHeight = tableContainerRef.current.clientHeight;\n const availableHeight = containerHeight - rowHeight;\n\n if (availableHeight > 0) {\n const rowsNeeded = Math.ceil(availableHeight / rowHeight);\n setLoadingRowCount(Math.max(rowsNeeded, MIN_ROWS));\n }\n }\n }, [tableContainerRef, rowHeight]);\n\n return (\n <>\n {hasHeadersLoaded\n ? <TableHeader table={table} />\n : (\n <thead className={headerStyles.osdkTableHeader} ref={headerRef}>\n <tr className={headerStyles.osdkTableHeaderRow}>\n {Array.from({ length: loadingColumnCount }).map((\n _,\n index,\n ) => {\n const width = headers.length > index\n ? headers[index].getSize()\n : columnWidth;\n return (\n <th\n key={`loading-header-${index}`}\n className={headerStyles.osdkTableHeaderCell}\n style={{ width }}\n >\n <div\n className={classNames(\n headerStyles.osdkLoadingHeaderCell,\n loadingStyles.osdkCellSkeleton,\n )}\n />\n </th>\n );\n })}\n </tr>\n </thead>\n )}\n <tbody className={bodyStyles.osdkTableBody} ref={bodyRef}>\n {Array.from({ length: loadingRowCount }).map((_, index) => (\n <LoadingRow\n key={`skeleton-${index}`}\n columnCount={loadingColumnCount}\n headers={headers}\n translateY={rowHeight * index}\n rowHeight={rowHeight}\n columnWidth={columnWidth}\n />\n ))}\n </tbody>\n </>\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,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,OAAOC,aAAa,MAAM,0BAA0B;AACpD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,OAAOC,YAAY,MAAM,0BAA0B;AAUnD,MAAMC,QAAQ,GAAG,CAAC;AAElB,OAAO,SAASC,iBAAiBA,CAAwB;EACvDC,KAAK;EACLC,iBAAiB;EACjBC,YAAY;EACZC,SAAS,GAAG,EAAE;EACdC,WAAW,GAAG;AACe,CAAC,EAAsB;EACpD;EACA,MAAMC,kBAAkB,GAAGL,KAAK,CAACM,OAAO,CAACC,kBAAkB;EAC3D,MAAMC,cAAc,GAAGH,kBAAkB,GAAG,CAAC,GAAG,CAAC;EACjD,MAAMI,OAAO,GAAGP,YAAY,CAAC,CAAC,CAAC,EAAEO,OAAO,IAAI,EAAE;EAC9C,MAAMC,gBAAgB,GAAGD,OAAO,CAACE,MAAM,GAAGH,cAAc;EAExD,MAAMI,SAAS,GAAGrB,MAAM,CAA0B,IAAI,CAAC;EACvD,MAAMsB,OAAO,GAAGtB,MAAM,CAA0B,IAAI,CAAC;EACrD,MAAM,CAACuB,eAAe,EAAEC,kBAAkB,CAAC,GAAGvB,QAAQ,CAASM,QAAQ,CAAC;EACxE,MAAM,CAACkB,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGzB,QAAQ,CAC1DiB,OAAO,CAACE,MACV,CAAC;EACD;EACArB,SAAS,CAAC,MAAM;IACd,IAAIoB,gBAAgB,EAAE;MACpBO,qBAAqB,CAACR,OAAO,CAACE,MAAM,CAAC;IACvC,CAAC,MAAM;MACL,IAAIV,iBAAiB,CAACiB,OAAO,EAAE;QAC7B,MAAMC,UAAU,GAAGlB,iBAAiB,CAACiB,OAAO,CAACE,WAAW;QACxD,IAAID,UAAU,GAAG,CAAC,EAAE;UAClB,MAAME,aAAa,GAAGC,IAAI,CAACC,IAAI,CAACJ,UAAU,GAAGf,WAAW,CAAC;UACzDa,qBAAqB,CAACI,aAAa,CAAC;QACtC;MACF;IACF;EACF,CAAC,EAAE,CAACjB,WAAW,EAAEM,gBAAgB,EAAED,OAAO,EAAER,iBAAiB,CAAC,CAAC;;EAE/D;EACAX,SAAS,CAAC,MAAM;IACd,IAAIW,iBAAiB,CAACiB,OAAO,EAAE;MAC7B,MAAMM,eAAe,GAAGvB,iBAAiB,CAACiB,OAAO,CAACO,YAAY;MAC9D,MAAMC,eAAe,GAAGF,eAAe,GAAGrB,SAAS;MAEnD,IAAIuB,eAAe,GAAG,CAAC,EAAE;QACvB,MAAMC,UAAU,GAAGL,IAAI,CAACC,IAAI,CAACG,eAAe,GAAGvB,SAAS,CAAC;QACzDY,kBAAkB,CAACO,IAAI,CAACM,GAAG,CAACD,UAAU,EAAE7B,QAAQ,CAAC,CAAC;MACpD;IACF;EACF,CAAC,EAAE,CAACG,iBAAiB,EAAEE,SAAS,CAAC,CAAC;EAElC,oBACEd,KAAA,CAAAwC,aAAA,CAAAxC,KAAA,CAAAyC,QAAA,QACGpB,gBAAgB,gBACbrB,KAAA,CAAAwC,aAAA,CAACjC,WAAW;IAACI,KAAK,EAAEA;EAAM,CAAE,CAAC,gBAE7BX,KAAA,CAAAwC,aAAA;IAAOE,SAAS,EAAElC,YAAY,CAACmC,eAAgB;IAACC,GAAG,EAAErB;EAAU,gBAC7DvB,KAAA,CAAAwC,aAAA;IAAIE,SAAS,EAAElC,YAAY,CAACqC;EAAmB,GAC5CC,KAAK,CAACC,IAAI,CAAC;IAAEzB,MAAM,EAAEK;EAAmB,CAAC,CAAC,CAACqB,GAAG,CAAC,CAC9CC,CAAC,EACDC,KAAK,KACF;IACH,MAAMC,KAAK,GAAG/B,OAAO,CAACE,MAAM,GAAG4B,KAAK,GAChC9B,OAAO,CAAC8B,KAAK,CAAC,CAACE,OAAO,CAAC,CAAC,GACxBrC,WAAW;IACf,oBACEf,KAAA,CAAAwC,aAAA;MACEa,GAAG,EAAE,kBAAkBH,KAAK,EAAG;MAC/BR,SAAS,EAAElC,YAAY,CAAC8C,mBAAoB;MAC5CC,KAAK,EAAE;QAAEJ;MAAM;IAAE,gBAEjBnD,KAAA,CAAAwC,aAAA;MACEE,SAAS,EAAE3C,UAAU,CACnBS,YAAY,CAACgD,qBAAqB,EAClCpD,aAAa,CAACqD,gBAChB;IAAE,CACH,CACC,CAAC;EAET,CAAC,CACC,CACC,CACR,eACHzD,KAAA,CAAAwC,aAAA;IAAOE,SAAS,EAAEpC,UAAU,CAACoD,aAAc;IAACd,GAAG,EAAEpB;EAAQ,GACtDsB,KAAK,CAACC,IAAI,CAAC;IAAEzB,MAAM,EAAEG;EAAgB,CAAC,CAAC,CAACuB,GAAG,CAAC,CAACC,CAAC,EAAEC,KAAK,kBACpDlD,KAAA,CAAAwC,aAAA,CAACnC,UAAU;IACTgD,GAAG,EAAE,YAAYH,KAAK,EAAG;IACzBS,WAAW,EAAEhC,kBAAmB;IAChCP,OAAO,EAAEA,OAAQ;IACjBwC,UAAU,EAAE9C,SAAS,GAAGoC,KAAM;IAC9BpC,SAAS,EAAEA,SAAU;IACrBC,WAAW,EAAEA;EAAY,CAC1B,CACF,CACI,CACP,CAAC;AAEP","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// build/browser/object-table/NonIdealState.js
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
// build/browser/object-table/NonIdealState.module.css
|
|
5
|
+
var css = '/*\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\n.container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-height: 80px;\n}\n\n.message {\n color: var(--osdk-typography-color-muted);\n}\n';
|
|
6
|
+
if (typeof document !== "undefined") {
|
|
7
|
+
const style = document.createElement("style");
|
|
8
|
+
style.textContent = css;
|
|
9
|
+
document.head.appendChild(style);
|
|
10
|
+
}
|
|
11
|
+
var NonIdealState_default = { "container": "container", "message": "message" };
|
|
12
|
+
|
|
13
|
+
// build/browser/object-table/NonIdealState.js
|
|
14
|
+
function NonIdealState({
|
|
15
|
+
message
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
18
|
+
className: NonIdealState_default.container
|
|
19
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
20
|
+
className: NonIdealState_default.message
|
|
21
|
+
}, message));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
NonIdealState
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NonIdealState.js","names":["React","styles","NonIdealState","message","createElement","className","container"],"sources":["NonIdealState.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 React from \"react\";\nimport styles from \"./NonIdealState.module.css\";\n\ninterface NonIdealStateProps {\n message: string;\n}\n\nexport function NonIdealState(\n { message }: NonIdealStateProps,\n): React.ReactElement {\n return (\n <div className={styles.container}>\n <div className={styles.message}>\n {message}\n </div>\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,4BAA4B;AAM/C,OAAO,SAASC,aAAaA,CAC3B;EAAEC;AAA4B,CAAC,EACX;EACpB,oBACEH,KAAA,CAAAI,aAAA;IAAKC,SAAS,EAAEJ,MAAM,CAACK;EAAU,gBAC/BN,KAAA,CAAAI,aAAA;IAAKC,SAAS,EAAEJ,MAAM,CAACE;EAAQ,GAC5BA,OACE,CACF,CAAC;AAEV","ignoreList":[]}
|
|
@@ -31,12 +31,11 @@ import { getRowId } from "./utils/getRowId.js";
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```tsx
|
|
34
|
-
* <ObjectTable
|
|
34
|
+
* <ObjectTable objectType={MyObjectType} />
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
38
|
export function ObjectTable({
|
|
39
|
-
objectSet,
|
|
40
39
|
objectType,
|
|
41
40
|
columnDefinitions,
|
|
42
41
|
filter,
|
|
@@ -62,8 +61,9 @@ export function ObjectTable({
|
|
|
62
61
|
const {
|
|
63
62
|
data,
|
|
64
63
|
fetchMore,
|
|
65
|
-
isLoading
|
|
66
|
-
|
|
64
|
+
isLoading,
|
|
65
|
+
error
|
|
66
|
+
} = useObjectTableData(objectType, columnDefinitions, filter, sorting);
|
|
67
67
|
const {
|
|
68
68
|
columns,
|
|
69
69
|
loading: isColumnsLoading
|
|
@@ -135,7 +135,8 @@ export function ObjectTable({
|
|
|
135
135
|
onRowClick: props.onRowClick,
|
|
136
136
|
rowHeight: props.rowHeight,
|
|
137
137
|
renderCellContextMenu: onRenderCellContextMenu,
|
|
138
|
-
className: props.className
|
|
138
|
+
className: props.className,
|
|
139
|
+
error: error
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
142
|
//# sourceMappingURL=ObjectTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useMemo","useState","useColumnDefs","useColumnPinning","useColumnVisibility","useObjectTableData","useRowSelection","useSelectionColumn","useTableSorting","BaseTable","getRowId","ObjectTable","
|
|
1
|
+
{"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useMemo","useState","useColumnDefs","useColumnPinning","useColumnVisibility","useObjectTableData","useRowSelection","useSelectionColumn","useTableSorting","BaseTable","getRowId","ObjectTable","objectType","columnDefinitions","filter","orderBy","defaultOrderBy","onOrderByChanged","onColumnsPinnedChanged","onRowSelection","renderCellContextMenu","selectionMode","selectedRows","props","columnSizing","setColumnSizing","sorting","onSortingChange","data","fetchMore","isLoading","error","columns","loading","isColumnsLoading","columnVisibility","rowSelection","isAllSelected","hasSelection","onToggleAll","onToggleRow","selectionColumn","allColumns","columnPinning","onColumnPinningChange","hasSelectionColumn","table","state","onColumnSizingChange","enableRowSelection","columnResizeMode","columnResizeDirection","manualSorting","defaultColumn","minSize","onRenderCellContextMenu","row","cell","getValue","createElement","fetchNextPage","onRowClick","rowHeight","className"],"sources":["ObjectTable.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 {\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport type { Cell, ColumnSizingState } from \"@tanstack/react-table\";\nimport { getCoreRowModel, useReactTable } from \"@tanstack/react-table\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { useColumnDefs } from \"./hooks/useColumnDefs.js\";\nimport { useColumnPinning } from \"./hooks/useColumnPinning.js\";\nimport { useColumnVisibility } from \"./hooks/useColumnVisibility.js\";\nimport { useObjectTableData } from \"./hooks/useObjectTableData.js\";\nimport { useRowSelection } from \"./hooks/useRowSelection.js\";\nimport { useSelectionColumn } from \"./hooks/useSelectionColumn.js\";\nimport { useTableSorting } from \"./hooks/useTableSorting.js\";\nimport type { ObjectTableProps } from \"./ObjectTableApi.js\";\nimport { BaseTable } from \"./Table.js\";\nimport { getRowId } from \"./utils/getRowId.js\";\n\n/**\n * ObjectTable - A headless table component for displaying OSDK object sets\n *\n * @example\n * ```tsx\n * <ObjectTable objectType={MyObjectType} />\n * ```\n */\n\nexport function ObjectTable<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<\n string,\n never\n >,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n>({\n objectType,\n columnDefinitions,\n filter,\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n onColumnsPinnedChanged,\n onRowSelection,\n renderCellContextMenu,\n selectionMode = \"none\",\n selectedRows,\n ...props\n}: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement {\n const [columnSizing, setColumnSizing] = useState<ColumnSizingState>({});\n\n const { sorting, onSortingChange } = useTableSorting<\n Q,\n RDPs,\n FunctionColumns\n >(\n {\n orderBy,\n defaultOrderBy,\n onOrderByChanged,\n },\n );\n\n const { data, fetchMore, isLoading, error } = useObjectTableData<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n filter,\n sorting,\n );\n\n const { columns, loading: isColumnsLoading } = useColumnDefs<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n );\n\n const columnVisibility = useColumnVisibility({ columnDefinitions });\n\n const {\n rowSelection,\n isAllSelected,\n hasSelection,\n onToggleAll,\n onToggleRow,\n } = useRowSelection<Q, RDPs>({\n selectionMode,\n selectedRows,\n onRowSelection,\n data,\n });\n\n const selectionColumn = useSelectionColumn<Q, RDPs>(\n { selectionMode, isAllSelected, hasSelection, onToggleAll, onToggleRow },\n );\n\n const allColumns = useMemo(() => {\n return selectionColumn ? [selectionColumn, ...columns] : columns;\n }, [selectionColumn, columns]);\n\n const { columnPinning, onColumnPinningChange } = useColumnPinning({\n columnDefinitions,\n hasSelectionColumn: selectionColumn != null,\n onColumnsPinnedChanged,\n });\n\n const table = useReactTable<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n >({\n data: data ?? [],\n columns: allColumns,\n getCoreRowModel: getCoreRowModel(),\n state: {\n columnVisibility,\n rowSelection,\n sorting,\n columnSizing,\n columnPinning,\n },\n onSortingChange,\n onColumnSizingChange: setColumnSizing,\n onColumnPinningChange,\n enableRowSelection: selectionMode !== \"none\",\n columnResizeMode: \"onChange\",\n columnResizeDirection: \"ltr\",\n manualSorting: true, // Enable manual sorting to indicate server-side sorting\n defaultColumn: {\n minSize: 80,\n },\n getRowId,\n });\n\n const onRenderCellContextMenu = useCallback(\n (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cell: Cell<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n unknown\n >,\n ) => {\n return renderCellContextMenu?.(row, cell.getValue());\n },\n [renderCellContextMenu],\n );\n\n const isTableLoading = isLoading || isColumnsLoading;\n\n return (\n <BaseTable\n table={table}\n isLoading={isTableLoading}\n fetchNextPage={fetchMore}\n onRowClick={props.onRowClick}\n rowHeight={props.rowHeight}\n renderCellContextMenu={onRenderCellContextMenu}\n className={props.className}\n error={error}\n />\n );\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectTableApi.js","names":[],"sources":["ObjectTableApi.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\nimport type {\n DerivedProperty,\n
|
|
1
|
+
{"version":3,"file":"ObjectTableApi.js","names":[],"sources":["ObjectTableApi.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\nimport type {\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type * as React from \"react\";\n\nexport type ColumnDefinition<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> = {\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>;\n\n /**\n * @default true\n */\n isVisible?: boolean;\n\n /**\n * @default none\n */\n pinned?: \"left\" | \"right\" | \"none\";\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n resizable?: boolean;\n orderable?: boolean;\n filterable?: boolean;\n renderCell?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n locator: ColumnDefinitionLocator<Q, RDPs, FunctionColumns>,\n ) => React.ReactNode;\n renderHeader?: () => React.ReactNode;\n};\n\nexport type ColumnDefinitionLocator<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> =\n | {\n type: \"property\";\n id: PropertyKeys<Q>;\n }\n | {\n type: \"function\";\n id: keyof FunctionColumns;\n }\n | {\n type: \"rdp\";\n id: keyof RDPs;\n creator: DerivedProperty.Creator<Q, RDPs[keyof RDPs]>;\n };\n\nexport interface ObjectTableProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n FunctionColumns extends Record<string, QueryDefinition<{}>> = Record<\n string,\n never\n >,\n> {\n /**\n * The object type of the object\n */\n objectType: Q;\n\n /**\n * Ordered list of column definitions to show in the table\n *\n * If not provided, all of the properties of the object type will be shown in default order.\n */\n columnDefinitions?: Array<ColumnDefinition<Q, RDPs, FunctionColumns>>;\n\n /**\n * Whether the table is filterable by the user.\n *\n * @default true\n */\n filterable?: boolean;\n\n /**\n * The current where clause to filter the objects in the table.\n * If provided, the filter is controlled.\n */\n filter?: WhereClause<Q, RDPs>;\n\n /**\n * Called when the where clause is changed.\n * Required when filter is controlled.\n *\n * @param newWhere The new where clause\n */\n onFilterChanged?: (newWhere: WhereClause<Q, RDPs>) => void;\n\n /**\n * Whether the table is sortable by the user.\n *\n * @default true\n */\n orderable?: boolean;\n\n /**\n * The default order by clause to sort the objects in the table.\n * If provided without orderBy prop, the sorting is uncontrolled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n defaultOrderBy?: Array<{\n property: PropertyKeys<Q>;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * The current order by clause to sort the objects in the table.\n * If provided, the sorting is controlled.\n * If both orderBy and defaultOrderBy are provided, orderBy takes precedence.\n */\n orderBy?: Array<{\n property: PropertyKeys<Q>;\n direction: \"asc\" | \"desc\";\n }>;\n\n /**\n * Called when the order by clause is changed.\n * Required when sorting is controlled.\n *\n * @param newOrderBy The new order by clause\n */\n onOrderByChanged?: (\n newOrderBy: Array<{\n property: PropertyKeys<Q>;\n direction: \"asc\" | \"desc\";\n }>,\n ) => void;\n\n /**\n * Called when the visible columns change.\n *\n * If provided, the table will allow the user to show/hide columns.\n *\n * @param newStates The new list of column visibility states\n */\n onColumnVisibilityChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n isVisible: boolean;\n }>,\n ) => void;\n\n /**\n * Called when the pinned columns change.\n *\n * If provided, the table will allow the user to pin/unpin columns.\n *\n * @param newStates The new list of column pin states\n */\n onColumnsPinnedChanged?: (\n newStates: Array<{\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns;\n pinned: \"left\" | \"right\" | \"none\";\n }>,\n ) => void;\n\n /**\n * Called when a column is resized.\n *\n * @param columnId The ID of the resized column\n * @param newWidth The new width of the column\n */\n onColumnResize?: (\n columnId: PropertyKeys<Q> | keyof RDPs | keyof FunctionColumns,\n newWidth: number,\n ) => void;\n\n /**\n * Called when a row is clicked.\n *\n * @param object The object representing the clicked row\n */\n onRowClick?: (\n object: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n ) => void;\n\n /**\n * Selection mode for the table rows.\n *\n * If multiple, a checkbox will be shown for each row to allow selecting multiple rows\n * as well as a top-level checkbox in the header to select all rows.\n *\n * @default \"none\"\n */\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n\n /**\n * The currently selected rows in the table.\n * If provided, the row selection is controlled.\n */\n selectedRows?: PrimaryKeyType<Q>[];\n\n /**\n * Called when the row selection changes.\n * Required when row selection is controlled.\n *\n * @param selectedRowIds The primary keys of currently selected rows\n */\n\n onRowSelection?: (selectedRowIds: PrimaryKeyType<Q>[]) => void;\n\n /**\n * If provided, will render this context menu when right clicking on a cell\n */\n renderCellContextMenu?: (\n row: Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>,\n cellValue: unknown,\n ) => React.ReactNode;\n\n /**\n * The height of each row in pixels.\n *\n * @default 40\n */\n rowHeight?: number;\n\n className?: string;\n}\n"],"mappings":"","ignoreList":[]}
|