@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
@@ -0,0 +1,180 @@
1
+ /* src/base-components/checkbox/Checkbox.module.css */
2
+ .osdkCheckboxRoot {
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ min-width: calc(var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2);
7
+ min-height: calc(var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2);
8
+ padding: var(--osdk-checkbox-padding);
9
+ box-sizing: border-box;
10
+ cursor: pointer;
11
+ border-radius: var(--bp-surface-borderRadius);
12
+ border: var(--osdk-checkbox-border);
13
+ &[data-unchecked] {
14
+ background-color: var(--osdk-checkbox-bg);
15
+ &:hover {
16
+ background-color: var(--osdk-checkbox-bg-hover);
17
+ }
18
+ &:active {
19
+ background-color: var(--osdk-checkbox-bg-active);
20
+ }
21
+ }
22
+ &[data-checked],
23
+ &[data-indeterminate] {
24
+ background-color: var(--osdk-checkbox-bg-checked);
25
+ &:hover {
26
+ background-color: var(--osdk-checkbox-bg-checked-hover);
27
+ }
28
+ &:active {
29
+ background-color: var(--osdk-checkbox-bg-checked-active);
30
+ }
31
+ }
32
+ &:focus-visible {
33
+ outline: var(--bp-emphasis-focusWidth) solid var(--bp-emphasis-focusColor);
34
+ outline-offset: var(--bp-emphasis-focusOffset);
35
+ }
36
+ }
37
+ .osdkCheckboxIndicator {
38
+ color: var(--osdk-checkbox-checked-foreground);
39
+ width: var(--osdk-checkbox-icon-size);
40
+ height: var(--osdk-checkbox-icon-size);
41
+ &[data-unchecked] {
42
+ display: none;
43
+ }
44
+ }
45
+
46
+ /* src/object-table/Table.module.css */
47
+ .osdkTableContainer {
48
+ position: relative;
49
+ height: 100%;
50
+ overflow: auto;
51
+ }
52
+
53
+ /* src/object-table/TableBody.module.css */
54
+ .osdkTableBody {
55
+ display: grid;
56
+ position: relative;
57
+ }
58
+
59
+ /* src/object-table/CellContextMenu.module.css */
60
+ .osdkCellContextMenu {
61
+ position: fixed;
62
+ z-index: var(--bp-surface-zIndex-2);
63
+ }
64
+
65
+ /* src/object-table/TableCell.module.css */
66
+ .osdkTableCell {
67
+ display: flex;
68
+ align-items: center;
69
+ text-align: left;
70
+ position: relative;
71
+ padding: var(--osdk-table-cell-padding);
72
+ font-size: var(--osdk-table-cell-fontSize);
73
+ color: var(--osdk-table-cell-color);
74
+ background-color: inherit;
75
+ border-right: var(--osdk-table-cell-divider);
76
+ &:first-child {
77
+ border-left: var(--osdk-table-border);
78
+ }
79
+ &:last-child {
80
+ border-right: var(--osdk-table-border);
81
+ }
82
+ }
83
+ .osdkTableCell:has([role=checkbox]) {
84
+ justify-content: center;
85
+ }
86
+ .osdkTableCellContent {
87
+ overflow: hidden;
88
+ text-overflow: ellipsis;
89
+ white-space: nowrap;
90
+ text-align: left;
91
+ }
92
+
93
+ /* src/object-table/TableRow.module.css */
94
+ .osdkTableRow {
95
+ position: absolute;
96
+ display: flex;
97
+ background-color: var(--osdk-table-row-bg-default);
98
+ border-top: var(--osdk-table-row-divider);
99
+ border-bottom: var(--osdk-table-border-width) solid transparent;
100
+ &:last-child {
101
+ border-bottom: var(--osdk-table-border);
102
+ }
103
+ &:nth-child(even) {
104
+ background-color: var( --osdk-table-row-bg-alternate, var(--osdk-table-row-bg-default) );
105
+ }
106
+ &:hover {
107
+ z-index: 1;
108
+ background-color: var( --osdk-table-row-bg-hover, var(--bp-surface-colorHover-default) );
109
+ border-top-color: var(--osdk-table-row-border-color-hover);
110
+ border-bottom-color: var(--osdk-table-row-border-color-hover);
111
+ }
112
+ &[data-selected=true] {
113
+ z-index: 2;
114
+ background-color: var(--osdk-table-row-bg-active);
115
+ border-top-color: var(--osdk-table-row-border-color-active);
116
+ border-bottom-color: var(--osdk-table-row-border-color-active);
117
+ }
118
+ &[data-selected=true] + &[data-selected=true] {
119
+ border-top-color: transparent;
120
+ }
121
+ &[data-selected=true]:has(+ &[data-selected=true]) {
122
+ border-bottom-color: transparent;
123
+ }
124
+ }
125
+
126
+ /* src/object-table/TableHeader.module.css */
127
+ .osdkTableHeader {
128
+ display: grid;
129
+ position: sticky;
130
+ top: 0;
131
+ z-index: var(--bp-surface-zIndex-1);
132
+ background-color: var(--osdk-table-header-bg);
133
+ }
134
+ .osdkTableHeader[data-resizing=true] {
135
+ cursor: col-resize;
136
+ user-select: none;
137
+ }
138
+ .osdkTableHeaderRow {
139
+ display: flex;
140
+ }
141
+ .osdkTableHeaderCell {
142
+ display: flex;
143
+ align-items: center;
144
+ text-align: left;
145
+ position: relative;
146
+ padding: var(--osdk-table-cell-padding);
147
+ font-weight: var(--osdk-table-header-fontWeight);
148
+ font-size: var(--osdk-table-header-fontSize);
149
+ color: var(--osdk-table-header-color);
150
+ border-top: var(--osdk-table-border);
151
+ border-right: var(--osdk-table-header-divider);
152
+ background-color: inherit;
153
+ &:first-child {
154
+ border-left: var(--osdk-table-border);
155
+ }
156
+ &:last-child {
157
+ border-right: var(--osdk-table-border);
158
+ }
159
+ }
160
+ .osdkTableHeaderCell:has([role=checkbox]) {
161
+ justify-content: center;
162
+ }
163
+ .osdkTableHeaderResizer {
164
+ background: none;
165
+ cursor: col-resize;
166
+ height: 100%;
167
+ position: absolute;
168
+ right: calc(-1 * var(--osdk-table-border-width));
169
+ top: 0;
170
+ touch-action: none;
171
+ width: 3px;
172
+ z-index: var(--bp-surface-zIndex-2);
173
+ &:hover {
174
+ background: var(--bp-intent-primary-hover);
175
+ }
176
+ &:active {
177
+ background: var(--bp-intent-primary-active);
178
+ }
179
+ }
180
+ /*# sourceMappingURL=experimental.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/base-components/checkbox/Checkbox.module.css","../../../src/object-table/Table.module.css","../../../src/object-table/TableBody.module.css","../../../src/object-table/CellContextMenu.module.css","../../../src/object-table/TableCell.module.css","../../../src/object-table/TableRow.module.css","../../../src/object-table/TableHeader.module.css"],"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\n.osdkCheckboxRoot {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: calc(\n var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2\n );\n min-height: calc(\n var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2\n );\n padding: var(--osdk-checkbox-padding);\n box-sizing: border-box;\n cursor: pointer;\n border-radius: var(--bp-surface-borderRadius);\n border: var(--osdk-checkbox-border);\n\n &[data-unchecked] {\n background-color: var(--osdk-checkbox-bg);\n\n &:hover {\n background-color: var(--osdk-checkbox-bg-hover);\n }\n\n &:active {\n background-color: var(--osdk-checkbox-bg-active);\n }\n }\n\n &[data-checked],\n &[data-indeterminate] {\n background-color: var(--osdk-checkbox-bg-checked);\n\n &:hover {\n background-color: var(--osdk-checkbox-bg-checked-hover);\n }\n\n &:active {\n background-color: var(--osdk-checkbox-bg-checked-active);\n }\n }\n\n &:focus-visible {\n outline: var(--bp-emphasis-focusWidth) solid var(--bp-emphasis-focusColor);\n outline-offset: var(--bp-emphasis-focusOffset);\n }\n}\n\n.osdkCheckboxIndicator {\n color: var(--osdk-checkbox-checked-foreground);\n width: var(--osdk-checkbox-icon-size);\n height: var(--osdk-checkbox-icon-size);\n\n\n &[data-unchecked] {\n display: none;\n }\n}","/*\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.osdkTableContainer {\n position: relative; /* needed for sticky header */\n height: 100%; /* needed for scrolling */\n overflow: auto;\n}\n","/*\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","/*\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.osdkCellContextMenu {\n position: fixed;\n z-index: var(--bp-surface-zIndex-2);\n}\n","/*\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:has([role=\"checkbox\"]) {\n justify-content: center;\n}\n\n.osdkTableCellContent {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n}\n","/*\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(--bp-surface-colorHover-default)\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","/*\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(--bp-surface-zIndex-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: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(--bp-surface-zIndex-2);\n\n &:hover {\n background: var(--bp-intent-primary-hover);\n }\n\n &:active {\n background: var(--bp-intent-primary-active);\n }\n}\n"],"mappings":"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","names":[]}
@@ -327,6 +327,7 @@ interface ObjectTableProps<Q extends ObjectTypeDefinition, RDPs extends Record<s
327
327
  * @default 40
328
328
  */
329
329
  rowHeight?: number;
330
+ className?: string;
330
331
  }
331
332
 
332
333
  /**
@@ -0,0 +1,40 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ /*
3
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ import { Checkbox as BaseUICheckbox } from "@base-ui/react/checkbox";
19
+ import { Minus, Tick } from "@blueprintjs/icons";
20
+ import classnames from "classnames";
21
+ import React from "react";
22
+ import styles from "./Checkbox.module.css";
23
+ export function Checkbox({
24
+ indeterminate,
25
+ className,
26
+ indicatorProps,
27
+ ...rest
28
+ }) {
29
+ return /*#__PURE__*/React.createElement(BaseUICheckbox.Root, _extends({
30
+ className: classnames(styles.osdkCheckboxRoot, className),
31
+ indeterminate: indeterminate
32
+ }, rest), /*#__PURE__*/React.createElement(BaseUICheckbox.Indicator, _extends({}, indicatorProps, {
33
+ className: classnames(styles.osdkCheckboxIndicator, indicatorProps?.className)
34
+ }), indeterminate ? /*#__PURE__*/React.createElement(Minus, {
35
+ color: "currentColor"
36
+ }) : /*#__PURE__*/React.createElement(Tick, {
37
+ color: "currentColor"
38
+ })));
39
+ }
40
+ //# sourceMappingURL=Checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.js","names":["Checkbox","BaseUICheckbox","Minus","Tick","classnames","React","styles","indeterminate","className","indicatorProps","rest","createElement","Root","_extends","osdkCheckboxRoot","Indicator","osdkCheckboxIndicator","color"],"sources":["Checkbox.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 {\n Checkbox as BaseUICheckbox,\n type CheckboxIndicatorProps,\n type CheckboxRootProps,\n} from \"@base-ui/react/checkbox\";\nimport { Minus, Tick } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Checkbox.module.css\";\n\ninterface CheckboxProps extends Omit<CheckboxRootProps, \"className\"> {\n className?: string;\n indicatorProps?: Omit<CheckboxIndicatorProps, \"className\"> & {\n className?: string;\n };\n}\n\nexport function Checkbox(\n {\n indeterminate,\n className,\n indicatorProps,\n ...rest\n }: CheckboxProps,\n): React.ReactElement {\n return (\n <BaseUICheckbox.Root\n className={classnames(styles.osdkCheckboxRoot, className)}\n indeterminate={indeterminate}\n {...rest}\n >\n <BaseUICheckbox.Indicator\n {...indicatorProps}\n className={classnames(\n styles.osdkCheckboxIndicator,\n indicatorProps?.className,\n )}\n >\n {/* Color is used as the \"fill\" attribute on the svg */}\n {indeterminate\n ? (\n <Minus\n color={\"currentColor\"}\n />\n )\n : <Tick color={\"currentColor\"} />}\n </BaseUICheckbox.Indicator>\n </BaseUICheckbox.Root>\n );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,IAAIC,cAAc,QAGrB,yBAAyB;AAChC,SAASC,KAAK,EAAEC,IAAI,QAAQ,oBAAoB;AAChD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,uBAAuB;AAS1C,OAAO,SAASN,QAAQA,CACtB;EACEO,aAAa;EACbC,SAAS;EACTC,cAAc;EACd,GAAGC;AACU,CAAC,EACI;EACpB,oBACEL,KAAA,CAAAM,aAAA,CAACV,cAAc,CAACW,IAAI,EAAAC,QAAA;IAClBL,SAAS,EAAEJ,UAAU,CAACE,MAAM,CAACQ,gBAAgB,EAAEN,SAAS,CAAE;IAC1DD,aAAa,EAAEA;EAAc,GACzBG,IAAI,gBAERL,KAAA,CAAAM,aAAA,CAACV,cAAc,CAACc,SAAS,EAAAF,QAAA,KACnBJ,cAAc;IAClBD,SAAS,EAAEJ,UAAU,CACnBE,MAAM,CAACU,qBAAqB,EAC5BP,cAAc,EAAED,SAClB;EAAE,IAGDD,aAAa,gBAEVF,KAAA,CAAAM,aAAA,CAACT,KAAK;IACJe,KAAK,EAAE;EAAe,CACvB,CAAC,gBAEFZ,KAAA,CAAAM,aAAA,CAACR,IAAI;IAACc,KAAK,EAAE;EAAe,CAAE,CACV,CACP,CAAC;AAE1B","ignoreList":[]}
@@ -0,0 +1,73 @@
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
+ .osdkCheckboxRoot {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ min-width: calc(
22
+ var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2
23
+ );
24
+ min-height: calc(
25
+ var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2
26
+ );
27
+ padding: var(--osdk-checkbox-padding);
28
+ box-sizing: border-box;
29
+ cursor: pointer;
30
+ border-radius: var(--bp-surface-borderRadius);
31
+ border: var(--osdk-checkbox-border);
32
+
33
+ &[data-unchecked] {
34
+ background-color: var(--osdk-checkbox-bg);
35
+
36
+ &:hover {
37
+ background-color: var(--osdk-checkbox-bg-hover);
38
+ }
39
+
40
+ &:active {
41
+ background-color: var(--osdk-checkbox-bg-active);
42
+ }
43
+ }
44
+
45
+ &[data-checked],
46
+ &[data-indeterminate] {
47
+ background-color: var(--osdk-checkbox-bg-checked);
48
+
49
+ &:hover {
50
+ background-color: var(--osdk-checkbox-bg-checked-hover);
51
+ }
52
+
53
+ &:active {
54
+ background-color: var(--osdk-checkbox-bg-checked-active);
55
+ }
56
+ }
57
+
58
+ &:focus-visible {
59
+ outline: var(--bp-emphasis-focusWidth) solid var(--bp-emphasis-focusColor);
60
+ outline-offset: var(--bp-emphasis-focusOffset);
61
+ }
62
+ }
63
+
64
+ .osdkCheckboxIndicator {
65
+ color: var(--osdk-checkbox-checked-foreground);
66
+ width: var(--osdk-checkbox-icon-size);
67
+ height: var(--osdk-checkbox-icon-size);
68
+
69
+
70
+ &[data-unchecked] {
71
+ display: none;
72
+ }
73
+ }
@@ -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
+ declare module "*.module.css" {
18
+ const classes: { readonly [key: string]: string };
19
+ export default classes;
20
+ }
@@ -16,6 +16,7 @@
16
16
 
17
17
  import React, { useEffect, useRef } from "react";
18
18
  import { createPortal } from "react-dom";
19
+ import styles from "./CellContextMenu.module.css";
19
20
  export function CellContextMenu({
20
21
  cell,
21
22
  position,
@@ -36,9 +37,8 @@ export function CellContextMenu({
36
37
  }, [onClose]);
37
38
  return /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement("div", {
38
39
  ref: ref,
40
+ className: styles.osdkCellContextMenu,
39
41
  style: {
40
- position: "fixed",
41
- zIndex: 9999,
42
42
  left: position.left,
43
43
  top: position.top,
44
44
  minWidth: position.width
@@ -1 +1 @@
1
- {"version":3,"file":"CellContextMenu.js","names":["React","useEffect","useRef","createPortal","CellContextMenu","cell","position","onClose","renderContent","ref","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","createElement","style","zIndex","left","top","minWidth","width","row","original","body"],"sources":["CellContextMenu.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 React, { useEffect, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type { PopoverPosition } from \"./hooks/useCellContextMenu.js\";\n\ninterface CellContextMenuProps<TData extends RowData> {\n cell: Cell<TData, unknown>;\n position: PopoverPosition;\n onClose: () => void;\n renderContent: (row: TData, cell: Cell<TData, unknown>) => React.ReactNode;\n}\n\nexport function CellContextMenu<TData extends RowData>({\n cell,\n position,\n onClose,\n renderContent,\n}: CellContextMenuProps<TData>): React.ReactElement {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n onClose();\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [onClose]);\n\n return createPortal(\n <div\n ref={ref}\n style={{\n position: \"fixed\",\n zIndex: 9999,\n left: position.left,\n top: position.top,\n minWidth: position.width,\n }}\n >\n {renderContent(cell.row.original, cell)}\n </div>,\n document.body,\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,YAAY,QAAQ,WAAW;AAUxC,OAAO,SAASC,eAAeA,CAAwB;EACrDC,IAAI;EACJC,QAAQ;EACRC,OAAO;EACPC;AAC2B,CAAC,EAAsB;EAClD,MAAMC,GAAG,GAAGP,MAAM,CAAiB,IAAI,CAAC;EAExCD,SAAS,CAAC,MAAM;IACd,MAAMS,kBAAkB,GAAIC,KAAiB,IAAK;MAChD,IAAIF,GAAG,CAACG,OAAO,IAAI,CAACH,GAAG,CAACG,OAAO,CAACC,QAAQ,CAACF,KAAK,CAACG,MAAc,CAAC,EAAE;QAC9DP,OAAO,CAAC,CAAC;MACX;IACF,CAAC;IAEDQ,QAAQ,CAACC,gBAAgB,CAAC,WAAW,EAAEN,kBAAkB,CAAC;IAE1D,OAAO,MAAM;MACXK,QAAQ,CAACE,mBAAmB,CAAC,WAAW,EAAEP,kBAAkB,CAAC;IAC/D,CAAC;EACH,CAAC,EAAE,CAACH,OAAO,CAAC,CAAC;EAEb,oBAAOJ,YAAY,cACjBH,KAAA,CAAAkB,aAAA;IACET,GAAG,EAAEA,GAAI;IACTU,KAAK,EAAE;MACLb,QAAQ,EAAE,OAAO;MACjBc,MAAM,EAAE,IAAI;MACZC,IAAI,EAAEf,QAAQ,CAACe,IAAI;MACnBC,GAAG,EAAEhB,QAAQ,CAACgB,GAAG;MACjBC,QAAQ,EAAEjB,QAAQ,CAACkB;IACrB;EAAE,GAEDhB,aAAa,CAACH,IAAI,CAACoB,GAAG,CAACC,QAAQ,EAAErB,IAAI,CACnC,CAAC,EACNU,QAAQ,CAACY,IACX,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"CellContextMenu.js","names":["React","useEffect","useRef","createPortal","styles","CellContextMenu","cell","position","onClose","renderContent","ref","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","createElement","className","osdkCellContextMenu","style","left","top","minWidth","width","row","original","body"],"sources":["CellContextMenu.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 React, { useEffect, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport styles from \"./CellContextMenu.module.css\";\nimport type { PopoverPosition } from \"./hooks/useCellContextMenu.js\";\n\ninterface CellContextMenuProps<TData extends RowData> {\n cell: Cell<TData, unknown>;\n position: PopoverPosition;\n onClose: () => void;\n renderContent: (row: TData, cell: Cell<TData, unknown>) => React.ReactNode;\n}\n\nexport function CellContextMenu<TData extends RowData>({\n cell,\n position,\n onClose,\n renderContent,\n}: CellContextMenuProps<TData>): React.ReactElement {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (ref.current && !ref.current.contains(event.target as Node)) {\n onClose();\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [onClose]);\n\n return createPortal(\n <div\n ref={ref}\n className={styles.osdkCellContextMenu}\n style={{\n left: position.left,\n top: position.top,\n minWidth: position.width,\n }}\n >\n {renderContent(cell.row.original, cell)}\n </div>,\n document.body,\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,YAAY,QAAQ,WAAW;AACxC,OAAOC,MAAM,MAAM,8BAA8B;AAUjD,OAAO,SAASC,eAAeA,CAAwB;EACrDC,IAAI;EACJC,QAAQ;EACRC,OAAO;EACPC;AAC2B,CAAC,EAAsB;EAClD,MAAMC,GAAG,GAAGR,MAAM,CAAiB,IAAI,CAAC;EAExCD,SAAS,CAAC,MAAM;IACd,MAAMU,kBAAkB,GAAIC,KAAiB,IAAK;MAChD,IAAIF,GAAG,CAACG,OAAO,IAAI,CAACH,GAAG,CAACG,OAAO,CAACC,QAAQ,CAACF,KAAK,CAACG,MAAc,CAAC,EAAE;QAC9DP,OAAO,CAAC,CAAC;MACX;IACF,CAAC;IAEDQ,QAAQ,CAACC,gBAAgB,CAAC,WAAW,EAAEN,kBAAkB,CAAC;IAE1D,OAAO,MAAM;MACXK,QAAQ,CAACE,mBAAmB,CAAC,WAAW,EAAEP,kBAAkB,CAAC;IAC/D,CAAC;EACH,CAAC,EAAE,CAACH,OAAO,CAAC,CAAC;EAEb,oBAAOL,YAAY,cACjBH,KAAA,CAAAmB,aAAA;IACET,GAAG,EAAEA,GAAI;IACTU,SAAS,EAAEhB,MAAM,CAACiB,mBAAoB;IACtCC,KAAK,EAAE;MACLC,IAAI,EAAEhB,QAAQ,CAACgB,IAAI;MACnBC,GAAG,EAAEjB,QAAQ,CAACiB,GAAG;MACjBC,QAAQ,EAAElB,QAAQ,CAACmB;IACrB;EAAE,GAEDjB,aAAa,CAACH,IAAI,CAACqB,GAAG,CAACC,QAAQ,EAAEtB,IAAI,CACnC,CAAC,EACNU,QAAQ,CAACa,IACX,CAAC;AACH","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
+ .osdkCellContextMenu {
18
+ position: fixed;
19
+ z-index: var(--bp-surface-zIndex-2);
20
+ }
@@ -108,7 +108,8 @@ export function ObjectTable({
108
108
  fetchNextPage: fetchMore,
109
109
  onRowClick: props.onRowClick,
110
110
  rowHeight: props.rowHeight,
111
- renderCellContextMenu: onRenderCellContextMenu
111
+ renderCellContextMenu: onRenderCellContextMenu,
112
+ className: props.className
112
113
  });
113
114
  }
114
115
  //# sourceMappingURL=ObjectTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useMemo","useState","useColumnDefs","useDefaultTableStates","useObjectTableData","useRowSelection","useSelectionColumn","Table","getRowId","ObjectTable","objectSet","objectType","columnDefinitions","filter","onRowSelection","renderCellContextMenu","selectionMode","selectedRows","props","data","fetchMore","isLoading","columns","loading","isColumnsLoading","columnVisibility","columnSizing","setColumnSizing","rowSelection","isAllSelected","hasSelection","onToggleAll","onToggleRow","selectionColumn","allColumns","table","state","onColumnSizingChange","enableRowSelection","columnResizeMode","columnResizeDirection","defaultColumn","minSize","onRenderCellContextMenu","row","cell","getValue","createElement","fetchNextPage","onRowClick","rowHeight"],"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 ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport {\n type Cell,\n type ColumnSizingState,\n getCoreRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { useColumnDefs } from \"./hooks/useColumnDefs.js\";\nimport { useDefaultTableStates } from \"./hooks/useDefaultTableStates.js\";\nimport { useObjectTableData } from \"./hooks/useObjectTableData.js\";\nimport { useRowSelection } from \"./hooks/useRowSelection.js\";\nimport { useSelectionColumn } from \"./hooks/useSelectionColumn.js\";\nimport type { ObjectTableProps } from \"./ObjectTableApi.js\";\nimport { Table } 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 objectSet={myObjectSet} objectType={MyObjectType} />\n * ```\n */\n\nexport function ObjectTable<\n Q extends ObjectTypeDefinition,\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 objectSet,\n objectType,\n columnDefinitions,\n filter,\n onRowSelection,\n renderCellContextMenu,\n selectionMode = \"none\",\n selectedRows,\n ...props\n}: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement {\n const { data, fetchMore, isLoading } = useObjectTableData<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectSet,\n columnDefinitions,\n filter,\n );\n\n const { columns, loading: isColumnsLoading } = useColumnDefs<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n );\n\n const { columnVisibility } = useDefaultTableStates({ columnDefinitions });\n\n const [columnSizing, setColumnSizing] = useState<ColumnSizingState>({});\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 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 columnSizing,\n },\n onColumnSizingChange: setColumnSizing,\n enableRowSelection: selectionMode !== \"none\",\n columnResizeMode: \"onChange\",\n columnResizeDirection: \"ltr\",\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 <Table\n table={table}\n isLoading={isTableLoading}\n fetchNextPage={fetchMore}\n onRowClick={props.onRowClick}\n rowHeight={props.rowHeight}\n renderCellContextMenu={onRenderCellContextMenu}\n />\n );\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"ObjectTable.js","names":["getCoreRowModel","useReactTable","React","useCallback","useMemo","useState","useColumnDefs","useDefaultTableStates","useObjectTableData","useRowSelection","useSelectionColumn","Table","getRowId","ObjectTable","objectSet","objectType","columnDefinitions","filter","onRowSelection","renderCellContextMenu","selectionMode","selectedRows","props","data","fetchMore","isLoading","columns","loading","isColumnsLoading","columnVisibility","columnSizing","setColumnSizing","rowSelection","isAllSelected","hasSelection","onToggleAll","onToggleRow","selectionColumn","allColumns","table","state","onColumnSizingChange","enableRowSelection","columnResizeMode","columnResizeDirection","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 ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport {\n type Cell,\n type ColumnSizingState,\n getCoreRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { useColumnDefs } from \"./hooks/useColumnDefs.js\";\nimport { useDefaultTableStates } from \"./hooks/useDefaultTableStates.js\";\nimport { useObjectTableData } from \"./hooks/useObjectTableData.js\";\nimport { useRowSelection } from \"./hooks/useRowSelection.js\";\nimport { useSelectionColumn } from \"./hooks/useSelectionColumn.js\";\nimport type { ObjectTableProps } from \"./ObjectTableApi.js\";\nimport { Table } 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 objectSet={myObjectSet} objectType={MyObjectType} />\n * ```\n */\n\nexport function ObjectTable<\n Q extends ObjectTypeDefinition,\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 objectSet,\n objectType,\n columnDefinitions,\n filter,\n onRowSelection,\n renderCellContextMenu,\n selectionMode = \"none\",\n selectedRows,\n ...props\n}: ObjectTableProps<Q, RDPs, FunctionColumns>): React.ReactElement {\n const { data, fetchMore, isLoading } = useObjectTableData<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectSet,\n columnDefinitions,\n filter,\n );\n\n const { columns, loading: isColumnsLoading } = useColumnDefs<\n Q,\n RDPs,\n FunctionColumns\n >(\n objectType,\n columnDefinitions,\n );\n\n const { columnVisibility } = useDefaultTableStates({ columnDefinitions });\n\n const [columnSizing, setColumnSizing] = useState<ColumnSizingState>({});\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 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 columnSizing,\n },\n onColumnSizingChange: setColumnSizing,\n enableRowSelection: selectionMode !== \"none\",\n columnResizeMode: \"onChange\",\n columnResizeDirection: \"ltr\",\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 <Table\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 />\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 ObjectSet,\n ObjectTypeDefinition,\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 ObjectTypeDefinition,\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 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 ObjectTypeDefinition,\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 | {\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 ObjectTypeDefinition,\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 /**\n * The set of objects to show in the table\n */\n objectSet: ObjectSet<Q>;\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 current order by clause to sort the objects in the table.\n * If provided, the sorting is controlled.\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"],"mappings":"","ignoreList":[]}
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 ObjectSet,\n ObjectTypeDefinition,\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 ObjectTypeDefinition,\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 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 ObjectTypeDefinition,\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 | {\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 ObjectTypeDefinition,\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 /**\n * The set of objects to show in the table\n */\n objectSet: ObjectSet<Q>;\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 current order by clause to sort the objects in the table.\n * If provided, the sorting is controlled.\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":[]}
@@ -15,53 +15,31 @@
15
15
  */
16
16
 
17
17
  import React, { useCallback } from "react";
18
+ import { Checkbox } from "../base-components/checkbox/Checkbox.js";
18
19
  export function SelectionHeaderCell({
19
20
  isAllSelected,
20
21
  hasSelection,
21
22
  onToggleAll
22
23
  }) {
23
- return /*#__PURE__*/React.createElement("div", {
24
- style: {
25
- display: "flex",
26
- alignItems: "center",
27
- justifyContent: "center",
28
- width: "100%"
29
- }
30
- }, /*#__PURE__*/React.createElement("input", {
31
- type: "checkbox",
24
+ return /*#__PURE__*/React.createElement(Checkbox, {
25
+ indeterminate: hasSelection && !isAllSelected,
32
26
  checked: isAllSelected,
33
- ref: input => {
34
- if (input) input.indeterminate = hasSelection && !isAllSelected;
35
- },
36
- onChange: onToggleAll,
27
+ onCheckedChange: onToggleAll,
37
28
  "aria-label": "Select all rows"
38
- }));
29
+ });
39
30
  }
40
- const noop = () => {};
41
31
  export function SelectionCell({
42
32
  row,
43
33
  onToggleRow
44
34
  }) {
45
- const isSelected = row.getIsSelected();
46
- const handleClick = useCallback(e => {
47
- // Prevent onRowClick call
48
- e.stopPropagation();
49
- onToggleRow(row.id, row.index, e.shiftKey);
35
+ const handleClick = useCallback(event => {
36
+ const isShiftClick = event.shiftKey;
37
+ onToggleRow(row.id, row.index, isShiftClick);
50
38
  }, [row, onToggleRow]);
51
- return /*#__PURE__*/React.createElement("div", {
52
- style: {
53
- display: "flex",
54
- alignItems: "center",
55
- justifyContent: "center",
56
- width: "100%"
57
- }
58
- }, /*#__PURE__*/React.createElement("input", {
59
- type: "checkbox",
60
- checked: isSelected,
39
+ return /*#__PURE__*/React.createElement(Checkbox, {
40
+ checked: row.getIsSelected(),
61
41
  onClick: handleClick,
62
- onChange: noop // Using onClick here
63
- ,
64
42
  "aria-label": `Select row ${row.index + 1}`
65
- }));
43
+ });
66
44
  }
67
45
  //# sourceMappingURL=SelectionCells.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionCells.js","names":["React","useCallback","SelectionHeaderCell","isAllSelected","hasSelection","onToggleAll","createElement","style","display","alignItems","justifyContent","width","type","checked","ref","input","indeterminate","onChange","noop","SelectionCell","row","onToggleRow","isSelected","getIsSelected","handleClick","e","stopPropagation","id","index","shiftKey","onClick"],"sources":["SelectionCells.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 { Row, RowData } from \"@tanstack/react-table\";\nimport React, { useCallback } from \"react\";\n\ninterface SelectionHeaderCellProps {\n isAllSelected: boolean;\n hasSelection: boolean;\n onToggleAll: () => void;\n}\n\nexport function SelectionHeaderCell({\n isAllSelected,\n hasSelection,\n onToggleAll,\n}: SelectionHeaderCellProps): React.ReactElement {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n }}\n >\n <input\n type=\"checkbox\"\n checked={isAllSelected}\n ref={(input) => {\n if (input) input.indeterminate = hasSelection && !isAllSelected;\n }}\n onChange={onToggleAll}\n aria-label=\"Select all rows\"\n />\n </div>\n );\n}\n\ninterface SelectionCellProps<TData extends RowData> {\n row: Row<TData>;\n onToggleRow: (rowId: string, rowIndex: number, isShiftClick: boolean) => void;\n}\n\nconst noop = () => {};\nexport function SelectionCell<TData extends RowData>({\n row,\n onToggleRow,\n}: SelectionCellProps<TData>): React.ReactElement {\n const isSelected = row.getIsSelected();\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLInputElement>) => {\n // Prevent onRowClick call\n e.stopPropagation();\n\n onToggleRow(row.id, row.index, e.shiftKey);\n },\n [row, onToggleRow],\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n }}\n >\n <input\n type=\"checkbox\"\n checked={isSelected}\n onClick={handleClick}\n onChange={noop} // Using onClick here\n aria-label={`Select row ${row.index + 1}`}\n />\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAQ1C,OAAO,SAASC,mBAAmBA,CAAC;EAClCC,aAAa;EACbC,YAAY;EACZC;AACwB,CAAC,EAAsB;EAC/C,oBACEL,KAAA,CAAAM,aAAA;IACEC,KAAK,EAAE;MACLC,OAAO,EAAE,MAAM;MACfC,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,KAAK,EAAE;IACT;EAAE,gBAEFX,KAAA,CAAAM,aAAA;IACEM,IAAI,EAAC,UAAU;IACfC,OAAO,EAAEV,aAAc;IACvBW,GAAG,EAAGC,KAAK,IAAK;MACd,IAAIA,KAAK,EAAEA,KAAK,CAACC,aAAa,GAAGZ,YAAY,IAAI,CAACD,aAAa;IACjE,CAAE;IACFc,QAAQ,EAAEZ,WAAY;IACtB,cAAW;EAAiB,CAC7B,CACE,CAAC;AAEV;AAOA,MAAMa,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,OAAO,SAASC,aAAaA,CAAwB;EACnDC,GAAG;EACHC;AACyB,CAAC,EAAsB;EAChD,MAAMC,UAAU,GAAGF,GAAG,CAACG,aAAa,CAAC,CAAC;EAEtC,MAAMC,WAAW,GAAGvB,WAAW,CAC5BwB,CAAqC,IAAK;IACzC;IACAA,CAAC,CAACC,eAAe,CAAC,CAAC;IAEnBL,WAAW,CAACD,GAAG,CAACO,EAAE,EAAEP,GAAG,CAACQ,KAAK,EAAEH,CAAC,CAACI,QAAQ,CAAC;EAC5C,CAAC,EACD,CAACT,GAAG,EAAEC,WAAW,CACnB,CAAC;EAED,oBACErB,KAAA,CAAAM,aAAA;IACEC,KAAK,EAAE;MACLC,OAAO,EAAE,MAAM;MACfC,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,KAAK,EAAE;IACT;EAAE,gBAEFX,KAAA,CAAAM,aAAA;IACEM,IAAI,EAAC,UAAU;IACfC,OAAO,EAAES,UAAW;IACpBQ,OAAO,EAAEN,WAAY;IACrBP,QAAQ,EAAEC,IAAK,CAAC;IAAA;IAChB,cAAY,cAAcE,GAAG,CAACQ,KAAK,GAAG,CAAC;EAAG,CAC3C,CACE,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"SelectionCells.js","names":["React","useCallback","Checkbox","SelectionHeaderCell","isAllSelected","hasSelection","onToggleAll","createElement","indeterminate","checked","onCheckedChange","SelectionCell","row","onToggleRow","handleClick","event","isShiftClick","shiftKey","id","index","getIsSelected","onClick"],"sources":["SelectionCells.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 { Row, RowData } from \"@tanstack/react-table\";\nimport React, { useCallback } from \"react\";\nimport { Checkbox } from \"../base-components/checkbox/Checkbox.js\";\n\ninterface SelectionHeaderCellProps {\n isAllSelected: boolean;\n hasSelection: boolean;\n onToggleAll: () => void;\n}\n\nexport function SelectionHeaderCell({\n isAllSelected,\n hasSelection,\n onToggleAll,\n}: SelectionHeaderCellProps): React.ReactElement {\n return (\n <Checkbox\n indeterminate={hasSelection && !isAllSelected}\n checked={isAllSelected}\n onCheckedChange={onToggleAll}\n aria-label={\"Select all rows\"}\n />\n );\n}\n\ninterface SelectionCellProps<TData extends RowData> {\n row: Row<TData>;\n onToggleRow: (rowId: string, rowIndex: number, isShiftClick: boolean) => void;\n}\n\nexport function SelectionCell<TData extends RowData>({\n row,\n onToggleRow,\n}: SelectionCellProps<TData>): React.ReactElement {\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {\n const isShiftClick = event.shiftKey;\n onToggleRow(row.id, row.index, isShiftClick);\n },\n [row, onToggleRow],\n );\n\n return (\n <Checkbox\n checked={row.getIsSelected()}\n onClick={handleClick}\n aria-label={`Select row ${row.index + 1}`}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,QAAQ,QAAQ,yCAAyC;AAQlE,OAAO,SAASC,mBAAmBA,CAAC;EAClCC,aAAa;EACbC,YAAY;EACZC;AACwB,CAAC,EAAsB;EAC/C,oBACEN,KAAA,CAAAO,aAAA,CAACL,QAAQ;IACPM,aAAa,EAAEH,YAAY,IAAI,CAACD,aAAc;IAC9CK,OAAO,EAAEL,aAAc;IACvBM,eAAe,EAAEJ,WAAY;IAC7B,cAAY;EAAkB,CAC/B,CAAC;AAEN;AAOA,OAAO,SAASK,aAAaA,CAAwB;EACnDC,GAAG;EACHC;AACyB,CAAC,EAAsB;EAChD,MAAMC,WAAW,GAAGb,WAAW,CAC5Bc,KAAoD,IAAK;IACxD,MAAMC,YAAY,GAAGD,KAAK,CAACE,QAAQ;IACnCJ,WAAW,CAACD,GAAG,CAACM,EAAE,EAAEN,GAAG,CAACO,KAAK,EAAEH,YAAY,CAAC;EAC9C,CAAC,EACD,CAACJ,GAAG,EAAEC,WAAW,CACnB,CAAC;EAED,oBACEb,KAAA,CAAAO,aAAA,CAACL,QAAQ;IACPO,OAAO,EAAEG,GAAG,CAACQ,aAAa,CAAC,CAAE;IAC7BC,OAAO,EAAEP,WAAY;IACrB,cAAY,cAAcF,GAAG,CAACO,KAAK,GAAG,CAAC;EAAG,CAC3C,CAAC;AAEN","ignoreList":[]}